]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Run the reindent script on the complete test suite
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 18 Jul 2013 19:18:00 +0000 (19:18 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 18 Jul 2013 19:18:00 +0000 (19:18 +0000)
git-svn-id: https://svn.dealii.org/trunk@30045 0785d39b-7218-0410-832d-ea1e28bc413d

2347 files changed:
tests/a-framework/compile.cc
tests/a-framework/fail.cc
tests/a-framework/link.cc
tests/aniso/anisotropic_crash.cc
tests/aniso/fe_tools.cc
tests/aniso/hp_constraints_dgp_08.cc
tests/aniso/hp_constraints_dgp_monomial_08.cc
tests/aniso/hp_constraints_dgp_nonparametric_08.cc
tests/aniso/mesh_3d_21.cc
tests/aniso/refine_and_coarsen_anisotropic.cc
tests/aniso/solution_transfer.cc
tests/aniso/up_and_down.cc
tests/base/anisotropic_1.cc
tests/base/anisotropic_2.cc
tests/base/auto_derivative_function.cc
tests/base/conditional_ostream.cc
tests/base/convergence_table_01.cc
tests/base/convergence_table_02.cc
tests/base/convergence_table_03.cc
tests/base/convergence_table_04.cc
tests/base/data_out_base.cc
tests/base/data_out_base_dx.cc
tests/base/data_out_base_eps.cc
tests/base/data_out_base_gmv.cc
tests/base/data_out_base_gnuplot.cc
tests/base/data_out_base_povray.cc
tests/base/data_out_base_pvd.cc
tests/base/data_out_base_pvtu.cc
tests/base/data_out_base_tecplot.cc
tests/base/data_out_base_tecplot_bin.cc
tests/base/data_out_base_vtk.cc
tests/base/data_out_base_vtk_cycle.cc
tests/base/data_out_base_vtk_time.cc
tests/base/data_out_base_vtk_time_and_cycle.cc
tests/base/data_out_base_vtu.cc
tests/base/data_out_base_vtu_cycle.cc
tests/base/data_out_base_vtu_time.cc
tests/base/data_out_base_vtu_time_and_cycle.cc
tests/base/data_out_reader_01.cc
tests/base/full_tensor_01.cc
tests/base/full_tensor_02.cc
tests/base/full_tensor_03.cc
tests/base/full_tensor_04.cc
tests/base/full_tensor_05.cc
tests/base/full_tensor_06.cc
tests/base/full_tensor_08.cc
tests/base/full_tensor_09.cc
tests/base/full_tensor_10.cc
tests/base/function_derivative.cc
tests/base/function_parser.cc
tests/base/function_parser_02.cc
tests/base/functions.h
tests/base/functions_01.cc
tests/base/functions_02.cc
tests/base/functions_03.cc
tests/base/functions_04.cc
tests/base/functions_05.cc
tests/base/functions_06.cc
tests/base/functions_07.cc
tests/base/functions_08.cc
tests/base/functions_09.cc
tests/base/functions_singularity.cc
tests/base/gauss_lobatto.cc
tests/base/geometry_info_1.cc
tests/base/geometry_info_2.cc
tests/base/geometry_info_3.cc
tests/base/geometry_info_4.cc
tests/base/geometry_info_5.cc
tests/base/geometry_info_6.cc
tests/base/geometry_info_7.cc
tests/base/geometry_info_8.cc
tests/base/hierarchical.cc
tests/base/index_set_01.cc
tests/base/index_set_02.cc
tests/base/index_set_03.cc
tests/base/index_set_04.cc
tests/base/index_set_05.cc
tests/base/index_set_06.cc
tests/base/index_set_07.cc
tests/base/index_set_08.cc
tests/base/index_set_09.cc
tests/base/index_set_10.cc
tests/base/index_set_11.cc
tests/base/index_set_12.cc
tests/base/index_set_13.cc
tests/base/index_set_14.cc
tests/base/index_set_15.cc
tests/base/index_set_16.cc
tests/base/index_set_17.cc
tests/base/index_set_18.cc
tests/base/index_set_19.cc
tests/base/index_set_20.cc
tests/base/index_set_20_offset.cc
tests/base/index_set_21.cc
tests/base/index_set_22.cc
tests/base/index_set_readwrite_02.cc
tests/base/is_finite.cc
tests/base/is_finite_complex.cc
tests/base/log_precision.cc
tests/base/log_width.cc
tests/base/named_data.cc
tests/base/number_traits_complex.cc
tests/base/number_traits_real.cc
tests/base/parallel_accumulate.cc
tests/base/parallel_transform_01.cc
tests/base/parallel_transform_02.cc
tests/base/parallel_transform_03.cc
tests/base/patches.h
tests/base/path_search.cc
tests/base/patterns_01.cc
tests/base/polynomial1d.cc
tests/base/polynomial_hermite_interpolation.cc
tests/base/polynomial_lagrange.cc
tests/base/polynomial_lagrange_ops.cc
tests/base/polynomial_lagrange_order.cc
tests/base/polynomial_lagrange_product.cc
tests/base/polynomial_minus_equals.cc
tests/base/polynomial_test.cc
tests/base/polynomials_bdm_01.cc
tests/base/polynomials_rt.cc
tests/base/polynomials_tensor.cc
tests/base/qprojector.cc
tests/base/quadrature_selector.cc
tests/base/quadrature_test.cc
tests/base/reference.cc
tests/base/scalar_01.cc
tests/base/slice_vector.cc
tests/base/symmetric_tensor_01.cc
tests/base/symmetric_tensor_02.cc
tests/base/symmetric_tensor_03.cc
tests/base/symmetric_tensor_04.cc
tests/base/symmetric_tensor_05.cc
tests/base/symmetric_tensor_06.cc
tests/base/symmetric_tensor_07.cc
tests/base/symmetric_tensor_08.cc
tests/base/symmetric_tensor_09.cc
tests/base/symmetric_tensor_10.cc
tests/base/symmetric_tensor_11.cc
tests/base/symmetric_tensor_12.cc
tests/base/symmetric_tensor_13.cc
tests/base/symmetric_tensor_14.cc
tests/base/symmetric_tensor_15.cc
tests/base/symmetric_tensor_16.cc
tests/base/symmetric_tensor_17.cc
tests/base/symmetric_tensor_18.cc
tests/base/symmetric_tensor_19.cc
tests/base/symmetric_tensor_20.cc
tests/base/symmetric_tensor_21.cc
tests/base/symmetric_tensor_22.cc
tests/base/symmetric_tensor_23.cc
tests/base/symmetric_tensor_24.cc
tests/base/symmetric_tensor_25.cc
tests/base/symmetric_tensor_26.cc
tests/base/table.cc
tests/base/table_handler_01.cc
tests/base/table_handler_02.cc
tests/base/table_handler_05.cc
tests/base/table_handler_06.cc
tests/base/table_handler_07.cc
tests/base/table_handler_08.cc
tests/base/table_handler_09.cc
tests/base/table_handler_10.cc
tests/base/table_handler_11.cc
tests/base/table_handler_12.cc
tests/base/task_01.cc
tests/base/task_02.cc
tests/base/task_03.cc
tests/base/task_04.cc
tests/base/task_05.cc
tests/base/task_06.cc
tests/base/task_07.cc
tests/base/task_08.cc
tests/base/task_09.cc
tests/base/tensor.cc
tests/base/tensor_02.cc
tests/base/tensor_03.cc
tests/base/tensor_07.cc
tests/base/tensor_08.cc
tests/base/tensor_24.cc
tests/base/tensor_25.cc
tests/base/tensor_complex.cc
tests/base/tensor_float.cc
tests/base/thread_local_storage_01.cc
tests/base/thread_local_storage_02.cc
tests/base/thread_local_storage_03.cc
tests/base/thread_local_storage_04.cc
tests/base/thread_validity_01.cc
tests/base/thread_validity_02.cc
tests/base/thread_validity_03.cc
tests/base/thread_validity_04.cc
tests/base/thread_validity_05.cc
tests/base/thread_validity_06.cc
tests/base/thread_validity_07.cc
tests/base/thread_validity_08.cc
tests/base/thread_validity_10.cc
tests/base/thread_validity_11.cc
tests/base/thread_validity_12.cc
tests/base/timer.cc
tests/base/timer_02.cc
tests/base/utilities_01.cc
tests/base/utilities_02.cc
tests/base/utilities_04.cc
tests/base/utilities_05.cc
tests/base/vectorization_01.cc
tests/base/vectorization_02.cc
tests/base/vectorization_03.cc
tests/base/vectorization_04.cc
tests/base/work_stream_01.cc
tests/base/work_stream_02.cc
tests/base/work_stream_03.cc
tests/benchmarks/gettimes/get_times.cc
tests/benchmarks/old/benchmark.cc
tests/benchmarks/old/dof_handler_size.cc
tests/benchmarks/old/dof_handler_timing.cc
tests/benchmarks/old/dof_handler_timing_01.cc
tests/benchmarks/old/performance.cc
tests/benchmarks/old/spec2006-447.dealII.cc
tests/benchmarks/step-22/step-22.cc
tests/benchmarks/tablehandler/table_handler.cc
tests/benchmarks/test_assembly/step-22.cc
tests/benchmarks/test_poisson/poisson.cc
tests/bits/accessor_equality.cc
tests/bits/anna_1.cc
tests/bits/anna_2.cc
tests/bits/anna_3.cc
tests/bits/anna_4.cc
tests/bits/anna_6.cc
tests/bits/apply_boundary_values_01.cc
tests/bits/apply_boundary_values_02.cc
tests/bits/apply_boundary_values_03.cc
tests/bits/apply_boundary_values_04.cc
tests/bits/block_matrix_array_01.cc
tests/bits/block_sparse_matrix_1.cc
tests/bits/block_sparse_matrix_2.cc
tests/bits/block_sparse_matrix_iterator_01.cc
tests/bits/block_sparse_matrix_iterator_02.cc
tests/bits/block_sparse_matrix_iterator_03.cc
tests/bits/block_sparse_matrix_iterator_04.cc
tests/bits/block_sparse_matrix_iterator_05.cc
tests/bits/block_vector_iterator_01.cc
tests/bits/block_vector_iterator_02.cc
tests/bits/block_vector_vector_01.cc
tests/bits/christian_1.cc
tests/bits/christian_2.cc
tests/bits/chunk_sparse_matrix_00.cc
tests/bits/chunk_sparse_matrix_01.cc
tests/bits/chunk_sparse_matrix_01a.cc
tests/bits/chunk_sparse_matrix_02.cc
tests/bits/chunk_sparse_matrix_03.cc
tests/bits/chunk_sparse_matrix_03a.cc
tests/bits/chunk_sparse_matrix_03b.cc
tests/bits/chunk_sparse_matrix_04.cc
tests/bits/chunk_sparse_matrix_05.cc
tests/bits/chunk_sparse_matrix_05a.cc
tests/bits/chunk_sparse_matrix_06.cc
tests/bits/chunk_sparse_matrix_07.cc
tests/bits/chunk_sparse_matrix_08.cc
tests/bits/chunk_sparse_matrix_09.cc
tests/bits/chunk_sparse_matrix_10.cc
tests/bits/chunk_sparse_matrix_11.cc
tests/bits/chunk_sparse_matrix_12.cc
tests/bits/chunk_sparse_matrix_13.cc
tests/bits/chunk_sparse_matrix_14.cc
tests/bits/chunk_sparse_matrix_15.cc
tests/bits/chunk_sparse_matrix_iterator_01.cc
tests/bits/chunk_sparse_matrix_iterator_02.cc
tests/bits/chunk_sparse_matrix_iterator_03.cc
tests/bits/chunk_sparse_matrix_iterator_04.cc
tests/bits/chunk_sparse_matrix_iterator_05.cc
tests/bits/chunk_sparse_matrix_iterator_06.cc
tests/bits/chunk_sparse_matrix_iterator_07.cc
tests/bits/chunk_sparse_matrix_iterator_08.cc
tests/bits/chunk_sparse_matrix_iterator_09.cc
tests/bits/chunk_sparse_matrix_iterator_10.cc
tests/bits/chunk_sparse_matrix_iterator_11.cc
tests/bits/chunk_sparse_matrix_iterator_12.cc
tests/bits/chunk_sparse_matrix_iterator_13.cc
tests/bits/chunk_sparse_matrix_vector_01.cc
tests/bits/chunk_sparse_matrix_vector_02.cc
tests/bits/chunk_sparse_matrix_vector_03.cc
tests/bits/chunk_sparse_matrix_vector_04.cc
tests/bits/chunk_sparse_matrix_vector_05.cc
tests/bits/chunk_sparse_matrix_vector_06.cc
tests/bits/chunk_sparse_matrix_vector_07.cc
tests/bits/coarsening_3d.cc
tests/bits/complex_complex_full_matrix_02.cc
tests/bits/complex_complex_full_matrix_03.cc
tests/bits/complex_complex_full_matrix_04.cc
tests/bits/complex_complex_full_matrix_06.cc
tests/bits/complex_complex_full_matrix_08.cc
tests/bits/complex_complex_full_matrix_12.cc
tests/bits/complex_complex_full_matrix_13.cc
tests/bits/complex_complex_full_matrix_14.cc
tests/bits/complex_complex_full_matrix_19.cc
tests/bits/complex_complex_full_matrix_24.cc
tests/bits/complex_complex_full_matrix_37.cc
tests/bits/complex_complex_full_matrix_42.cc
tests/bits/complex_real_full_matrix_02.cc
tests/bits/complex_real_full_matrix_03.cc
tests/bits/complex_real_full_matrix_04.cc
tests/bits/complex_real_full_matrix_06.cc
tests/bits/complex_real_full_matrix_08.cc
tests/bits/complex_real_full_matrix_12.cc
tests/bits/complex_real_full_matrix_13.cc
tests/bits/complex_real_full_matrix_14.cc
tests/bits/complex_real_full_matrix_19.cc
tests/bits/complex_real_full_matrix_24.cc
tests/bits/complex_real_full_matrix_37.cc
tests/bits/complex_real_full_matrix_42.cc
tests/bits/complex_vector_11.cc
tests/bits/complex_vector_12.cc
tests/bits/complex_vector_13.cc
tests/bits/complex_vector_14.cc
tests/bits/complex_vector_15.cc
tests/bits/complex_vector_16.cc
tests/bits/complex_vector_17.cc
tests/bits/complex_vector_18.cc
tests/bits/complex_vector_19.cc
tests/bits/complex_vector_20.cc
tests/bits/complex_vector_21.cc
tests/bits/complex_vector_21_negative.cc
tests/bits/complex_vector_22.cc
tests/bits/complex_vector_23.cc
tests/bits/complex_vector_24.cc
tests/bits/complex_vector_25.cc
tests/bits/complex_vector_26.cc
tests/bits/complex_vector_27.cc
tests/bits/complex_vector_28.cc
tests/bits/complex_vector_29.cc
tests/bits/complex_vector_30.cc
tests/bits/complex_vector_31.cc
tests/bits/complex_vector_32.cc
tests/bits/complex_vector_33.cc
tests/bits/complex_vector_34.cc
tests/bits/complex_vector_35.cc
tests/bits/complex_vector_36.cc
tests/bits/complex_vector_37.cc
tests/bits/complex_vector_38.cc
tests/bits/complex_vector_39.cc
tests/bits/complex_vector_40.cc
tests/bits/complex_vector_41.cc
tests/bits/complex_vector_42.cc
tests/bits/complex_vector_43.cc
tests/bits/complex_vector_44.cc
tests/bits/complex_vector_45.cc
tests/bits/complex_vector_46.cc
tests/bits/complex_vector_47.cc
tests/bits/complex_vector_48.cc
tests/bits/complex_vector_49.cc
tests/bits/complex_vector_equality_1.cc
tests/bits/complex_vector_equality_2.cc
tests/bits/complex_vector_equality_3.cc
tests/bits/complex_vector_equality_4.cc
tests/bits/complex_vector_equality_5.cc
tests/bits/complex_vector_equality_6.cc
tests/bits/complex_vector_equality_7.cc
tests/bits/complex_vector_equality_8.cc
tests/bits/complex_vector_vector_01.cc
tests/bits/compressed_set_sparsity_pattern_01.cc
tests/bits/compressed_set_sparsity_pattern_02.cc
tests/bits/compressed_set_sparsity_pattern_03.cc
tests/bits/compressed_set_sparsity_pattern_04.cc
tests/bits/compressed_set_sparsity_pattern_05.cc
tests/bits/compressed_set_sparsity_pattern_06.cc
tests/bits/compressed_set_sparsity_pattern_07.cc
tests/bits/compressed_set_sparsity_pattern_08.cc
tests/bits/compressed_set_sparsity_pattern_09.cc
tests/bits/compressed_sparsity_pattern_01.cc
tests/bits/compressed_sparsity_pattern_02.cc
tests/bits/compressed_sparsity_pattern_03.cc
tests/bits/compressed_sparsity_pattern_04.cc
tests/bits/compressed_sparsity_pattern_05.cc
tests/bits/compressed_sparsity_pattern_06.cc
tests/bits/compressed_sparsity_pattern_07.cc
tests/bits/compressed_sparsity_pattern_08.cc
tests/bits/compressed_sparsity_pattern_09.cc
tests/bits/cone_01.cc
tests/bits/count_dofs_per_block_01.cc
tests/bits/count_dofs_per_block_02.cc
tests/bits/count_dofs_per_component_hp_01.cc
tests/bits/cylinder.cc
tests/bits/cylinder_01.cc
tests/bits/cylinder_02.cc
tests/bits/cylinder_03.cc
tests/bits/cylinder_04.cc
tests/bits/cylinder_shell_01.cc
tests/bits/cylinder_shell_02.cc
tests/bits/data_out_01.cc
tests/bits/data_out_02.cc
tests/bits/data_out_03.cc
tests/bits/data_out_04.cc
tests/bits/data_out_05.cc
tests/bits/data_out_common.h
tests/bits/data_out_curved_cells.cc
tests/bits/data_out_faces_01.cc
tests/bits/data_out_faces_02.cc
tests/bits/data_out_faces_03.cc
tests/bits/data_out_faces_04.cc
tests/bits/data_out_rotation_01.cc
tests/bits/data_out_rotation_02.cc
tests/bits/data_out_rotation_03.cc
tests/bits/data_out_rotation_04.cc
tests/bits/data_out_stack_01.cc
tests/bits/data_out_stack_02.cc
tests/bits/data_out_stack_03.cc
tests/bits/deal_solver_04.cc
tests/bits/deal_solver_05.cc
tests/bits/denis_1.cc
tests/bits/distorted_cells_01.cc
tests/bits/distorted_cells_02.cc
tests/bits/distorted_cells_03.cc
tests/bits/distorted_cells_04.cc
tests/bits/distorted_cells_05.cc
tests/bits/distorted_cells_06.cc
tests/bits/distorted_cells_07.cc
tests/bits/distorted_mapped_cells_01.cc
tests/bits/distorted_mapped_cells_02.cc
tests/bits/dof_constraints_01.cc
tests/bits/dof_constraints_02.cc
tests/bits/dof_constraints_03.cc
tests/bits/dof_constraints_04.cc
tests/bits/dof_constraints_05.cc
tests/bits/dof_constraints_06.cc
tests/bits/dof_constraints_06_x.cc
tests/bits/dof_constraints_07.cc
tests/bits/dof_constraints_08.cc
tests/bits/dof_constraints_09.cc
tests/bits/dof_constraints_10.cc
tests/bits/dof_constraints_10_x.cc
tests/bits/dof_constraints_11.cc
tests/bits/dof_constraints_11_x.cc
tests/bits/dof_tools_00a.cc
tests/bits/dof_tools_01a.cc
tests/bits/dof_tools_01a_constraints_false.cc
tests/bits/dof_tools_01a_constraints_true.cc
tests/bits/dof_tools_01a_subdomain.cc
tests/bits/dof_tools_01b.cc
tests/bits/dof_tools_01b_x.cc
tests/bits/dof_tools_01c.cc
tests/bits/dof_tools_01d.cc
tests/bits/dof_tools_01d_x.cc
tests/bits/dof_tools_02a.cc
tests/bits/dof_tools_02a_constraints_false.cc
tests/bits/dof_tools_02a_constraints_true.cc
tests/bits/dof_tools_02a_subdomain.cc
tests/bits/dof_tools_02b.cc
tests/bits/dof_tools_02b_x.cc
tests/bits/dof_tools_02c.cc
tests/bits/dof_tools_02d.cc
tests/bits/dof_tools_02d_x.cc
tests/bits/dof_tools_03.cc
tests/bits/dof_tools_05.cc
tests/bits/dof_tools_06.cc
tests/bits/dof_tools_09.cc
tests/bits/dof_tools_10.cc
tests/bits/dof_tools_11.cc
tests/bits/dof_tools_12.cc
tests/bits/dof_tools_13.cc
tests/bits/dof_tools_13a.cc
tests/bits/dof_tools_14.cc
tests/bits/dof_tools_15a.cc
tests/bits/dof_tools_15b.cc
tests/bits/dof_tools_15b_x.cc
tests/bits/dof_tools_15c.cc
tests/bits/dof_tools_15d.cc
tests/bits/dof_tools_15d_x.cc
tests/bits/dof_tools_16a.cc
tests/bits/dof_tools_16b.cc
tests/bits/dof_tools_16b_x.cc
tests/bits/dof_tools_16c.cc
tests/bits/dof_tools_16d.cc
tests/bits/dof_tools_16d_x.cc
tests/bits/dof_tools_17a.cc
tests/bits/dof_tools_17b.cc
tests/bits/dof_tools_17b_x.cc
tests/bits/dof_tools_17c.cc
tests/bits/dof_tools_17d.cc
tests/bits/dof_tools_17d_x.cc
tests/bits/dof_tools_18a.cc
tests/bits/dof_tools_18a_1d.cc
tests/bits/dof_tools_18b.cc
tests/bits/dof_tools_18b_x.cc
tests/bits/dof_tools_18c.cc
tests/bits/dof_tools_18d.cc
tests/bits/dof_tools_18d_x.cc
tests/bits/dof_tools_19.cc
tests/bits/dof_tools_20.cc
tests/bits/dof_tools_21_b.cc
tests/bits/dof_tools_common.h
tests/bits/dof_tools_periodic.h
tests/bits/error_estimator_01.cc
tests/bits/error_estimator_02.cc
tests/bits/face_interpolation.cc
tests/bits/face_orientation_and_fe_nedelec_01.cc
tests/bits/face_orientation_and_fe_q_01.cc
tests/bits/face_orientation_and_fe_q_02.cc
tests/bits/face_orientation_crash.cc
tests/bits/fe_face_to_cell_index.cc
tests/bits/fe_field_function_01.cc
tests/bits/fe_field_function_01_vector.cc
tests/bits/fe_field_function_02.cc
tests/bits/fe_field_function_02_vector.cc
tests/bits/fe_field_function_03.cc
tests/bits/fe_field_function_03_vector.cc
tests/bits/fe_field_function_04.cc
tests/bits/fe_field_function_04_vector.cc
tests/bits/fe_field_function_05.cc
tests/bits/fe_field_function_05_vector.cc
tests/bits/fe_field_function_06_vector.cc
tests/bits/fe_field_function_07_vector.cc
tests/bits/fe_field_function_08_vector.cc
tests/bits/fe_q_3d_01.cc
tests/bits/fe_q_constraints.cc
tests/bits/fe_system.cc
tests/bits/fe_tools_01a.cc
tests/bits/fe_tools_01b.cc
tests/bits/fe_tools_01c.cc
tests/bits/fe_tools_02.cc
tests/bits/fe_tools_03.cc
tests/bits/fe_tools_04.cc
tests/bits/fe_tools_05.cc
tests/bits/fe_tools_06.cc
tests/bits/fe_tools_06b.cc
tests/bits/fe_tools_07.cc
tests/bits/fe_tools_08.cc
tests/bits/fe_tools_09.cc
tests/bits/fe_tools_10.cc
tests/bits/fe_tools_11.cc
tests/bits/fe_tools_12.cc
tests/bits/fe_tools_14.cc
tests/bits/fe_tools_common.h
tests/bits/fe_tools_cpfqpm_01.cc
tests/bits/fe_tools_cpfqpm_02.cc
tests/bits/fe_tools_cpfqpm_03.cc
tests/bits/fe_tools_cpfqpm_04.cc
tests/bits/find_cell_1.cc
tests/bits/find_cell_10.cc
tests/bits/find_cell_2.cc
tests/bits/find_cell_3.cc
tests/bits/find_cell_4.cc
tests/bits/find_cell_5.cc
tests/bits/find_cell_6.cc
tests/bits/find_cell_7.cc
tests/bits/find_cell_8.cc
tests/bits/find_cell_9.cc
tests/bits/find_cell_alt_1.cc
tests/bits/find_cell_alt_2.cc
tests/bits/find_cell_alt_3.cc
tests/bits/find_cell_alt_4.cc
tests/bits/find_cell_alt_5.cc
tests/bits/find_cell_alt_6.cc
tests/bits/find_cell_alt_7.cc
tests/bits/find_cells_adjacent_to_vertex_1.cc
tests/bits/find_cells_adjacent_to_vertex_2.cc
tests/bits/find_cells_adjacent_to_vertex_3.cc
tests/bits/find_cells_adjacent_to_vertex_4.cc
tests/bits/find_cells_adjacent_to_vertex_5.cc
tests/bits/find_cells_adjacent_to_vertex_6.cc
tests/bits/find_closest_vertex_1.cc
tests/bits/full_matrix_02.cc
tests/bits/full_matrix_03.cc
tests/bits/full_matrix_04.cc
tests/bits/full_matrix_06.cc
tests/bits/full_matrix_08.cc
tests/bits/full_matrix_1.cc
tests/bits/full_matrix_12.cc
tests/bits/full_matrix_13.cc
tests/bits/full_matrix_14.cc
tests/bits/full_matrix_19.cc
tests/bits/full_matrix_24.cc
tests/bits/full_matrix_37.cc
tests/bits/full_matrix_42.cc
tests/bits/full_matrix_53.cc
tests/bits/full_matrix_55.cc
tests/bits/full_matrix_56.cc
tests/bits/full_matrix_57.cc
tests/bits/full_matrix_common.h
tests/bits/full_matrix_iterator_01.cc
tests/bits/full_matrix_vector_01.cc
tests/bits/full_matrix_vector_02.cc
tests/bits/full_matrix_vector_05.cc
tests/bits/full_matrix_vector_06.cc
tests/bits/full_matrix_vector_07.cc
tests/bits/gerold_1.cc
tests/bits/gerold_2.cc
tests/bits/get_dof_indices_01.cc
tests/bits/get_fe_from_name.cc
tests/bits/grid_generator_01.cc
tests/bits/grid_generator_01a.cc
tests/bits/grid_generator_02.cc
tests/bits/grid_generator_03.cc
tests/bits/grid_generator_04.cc
tests/bits/grid_generator_05.cc
tests/bits/grid_generator_06.cc
tests/bits/grid_in_msh_01.cc
tests/bits/hp_constraints_are_implemented.cc
tests/bits/hyper_ball_3d.cc
tests/bits/joa_1.cc
tests/bits/make_boundary_constraints_01.cc
tests/bits/make_boundary_constraints_02.cc
tests/bits/map_dofs_to_support_points_hp_01.cc
tests/bits/map_dofs_to_support_points_hp_02.cc
tests/bits/mapping_cartesian_1.cc
tests/bits/mapping_q1_eulerian_01.cc
tests/bits/mapping_q4_3d.cc
tests/bits/mapping_q_eulerian_01.cc
tests/bits/mapping_q_eulerian_02.cc
tests/bits/mapping_q_eulerian_03.cc
tests/bits/mapping_q_eulerian_04.cc
tests/bits/mapping_q_eulerian_05.cc
tests/bits/max_n_cells_01.cc
tests/bits/max_n_cells_02.cc
tests/bits/mesh_3d.h
tests/bits/mesh_3d_1.cc
tests/bits/mesh_3d_10.cc
tests/bits/mesh_3d_11.cc
tests/bits/mesh_3d_12.cc
tests/bits/mesh_3d_13.cc
tests/bits/mesh_3d_14.cc
tests/bits/mesh_3d_15.cc
tests/bits/mesh_3d_16.cc
tests/bits/mesh_3d_17.cc
tests/bits/mesh_3d_18.cc
tests/bits/mesh_3d_19.cc
tests/bits/mesh_3d_2.cc
tests/bits/mesh_3d_20.cc
tests/bits/mesh_3d_21.cc
tests/bits/mesh_3d_22.cc
tests/bits/mesh_3d_24.cc
tests/bits/mesh_3d_25.cc
tests/bits/mesh_3d_26.cc
tests/bits/mesh_3d_3.cc
tests/bits/mesh_3d_4.cc
tests/bits/mesh_3d_5.cc
tests/bits/mesh_3d_6.cc
tests/bits/mesh_3d_7.cc
tests/bits/mesh_3d_8.cc
tests/bits/mesh_3d_9.cc
tests/bits/multiple_parameter_loop_01.cc
tests/bits/multiple_parameter_loop_02.cc
tests/bits/n_dofs_per_object.cc
tests/bits/nedelec_1.cc
tests/bits/neighboring_cells_at_two_faces.cc
tests/bits/normals_1.cc
tests/bits/normals_2.cc
tests/bits/normals_3.cc
tests/bits/normals_4.cc
tests/bits/oliver_01.cc
tests/bits/parameter_handler_1.cc
tests/bits/parameter_handler_10.cc
tests/bits/parameter_handler_11.cc
tests/bits/parameter_handler_13.cc
tests/bits/parameter_handler_14.cc
tests/bits/parameter_handler_2.cc
tests/bits/parameter_handler_3.cc
tests/bits/parameter_handler_4.cc
tests/bits/parameter_handler_4a.cc
tests/bits/parameter_handler_4b.cc
tests/bits/parameter_handler_5.cc
tests/bits/parameter_handler_6.cc
tests/bits/parameter_handler_6_bool.cc
tests/bits/parameter_handler_7.cc
tests/bits/parameter_handler_8.cc
tests/bits/parameter_handler_9.cc
tests/bits/parameter_handler_read_xml.cc
tests/bits/parameter_handler_read_xml_error_01.cc
tests/bits/parameter_handler_read_xml_error_02.cc
tests/bits/parameter_handler_read_xml_error_03.cc
tests/bits/parameter_handler_read_xml_error_04.cc
tests/bits/parameter_handler_write_json.cc
tests/bits/parameter_handler_write_xml.cc
tests/bits/parsed_function.cc
tests/bits/periodicity_01.cc
tests/bits/periodicity_02.cc
tests/bits/periodicity_03.cc
tests/bits/periodicity_04.cc
tests/bits/point_difference_01.cc
tests/bits/point_difference_02.cc
tests/bits/point_inside_1.cc
tests/bits/point_inside_2.cc
tests/bits/point_value_01.cc
tests/bits/point_value_02.cc
tests/bits/point_value_hp_01.cc
tests/bits/point_value_hp_02.cc
tests/bits/q_point_sum_1.cc
tests/bits/q_point_sum_2.cc
tests/bits/q_point_sum_3.cc
tests/bits/q_point_sum_4.cc
tests/bits/q_points.cc
tests/bits/refine_and_coarsen_1d.cc
tests/bits/refine_and_coarsen_2d.cc
tests/bits/refine_and_coarsen_3d.cc
tests/bits/refine_and_coarsen_for_parents.cc
tests/bits/refine_and_coarsen_for_parents_02.cc
tests/bits/refine_and_coarsen_for_parents_03.cc
tests/bits/roy_1.cc
tests/bits/rt_1.cc
tests/bits/rt_2.cc
tests/bits/solution_transfer.cc
tests/bits/solver_01.cc
tests/bits/sparse_lu_decomposition_1.cc
tests/bits/sparse_matrix_01.cc
tests/bits/sparse_matrix_01a.cc
tests/bits/sparse_matrix_02.cc
tests/bits/sparse_matrix_03.cc
tests/bits/sparse_matrix_03a.cc
tests/bits/sparse_matrix_03b.cc
tests/bits/sparse_matrix_04.cc
tests/bits/sparse_matrix_05.cc
tests/bits/sparse_matrix_05a.cc
tests/bits/sparse_matrix_06.cc
tests/bits/sparse_matrix_07.cc
tests/bits/sparse_matrix_08.cc
tests/bits/sparse_matrix_09.cc
tests/bits/sparse_matrix_10.cc
tests/bits/sparse_matrix_add_entries_01.cc
tests/bits/sparse_matrix_add_entries_02.cc
tests/bits/sparse_matrix_add_entries_03.cc
tests/bits/sparse_matrix_add_entries_04.cc
tests/bits/sparse_matrix_add_entries_05.cc
tests/bits/sparse_matrix_add_entries_06.cc
tests/bits/sparse_matrix_iterator_01.cc
tests/bits/sparse_matrix_iterator_02.cc
tests/bits/sparse_matrix_iterator_03.cc
tests/bits/sparse_matrix_iterator_04.cc
tests/bits/sparse_matrix_iterator_05.cc
tests/bits/sparse_matrix_iterator_06.cc
tests/bits/sparse_matrix_iterator_07.cc
tests/bits/sparse_matrix_iterator_08.cc
tests/bits/sparse_matrix_iterator_09.cc
tests/bits/sparse_matrix_iterator_10.cc
tests/bits/sparse_matrix_iterator_11.cc
tests/bits/sparse_matrix_iterator_12.cc
tests/bits/sparse_matrix_iterator_13.cc
tests/bits/sparse_matrix_vector_01.cc
tests/bits/sparse_matrix_vector_02.cc
tests/bits/sparse_matrix_vector_03.cc
tests/bits/sparse_matrix_vector_04.cc
tests/bits/sparse_matrix_vector_05.cc
tests/bits/sparse_matrix_vector_06.cc
tests/bits/sparse_matrix_vector_07.cc
tests/bits/sparsity_pattern_01.cc
tests/bits/sparsity_pattern_01_x.cc
tests/bits/sparsity_pattern_iterator_01.cc
tests/bits/step-10.cc
tests/bits/step-11.cc
tests/bits/step-12.cc
tests/bits/step-13.cc
tests/bits/step-14.cc
tests/bits/step-15.cc
tests/bits/step-16.cc
tests/bits/step-16b.cc
tests/bits/step-2.cc
tests/bits/step-3.cc
tests/bits/step-4.cc
tests/bits/step-5.cc
tests/bits/step-6.cc
tests/bits/step-7.cc
tests/bits/step-8.cc
tests/bits/subdomain_ids_01.cc
tests/bits/subdomain_ids_02.cc
tests/bits/subdomain_ids_03.cc
tests/bits/subdomain_ids_04.cc
tests/bits/subdomain_ids_05.cc
tests/bits/subdomain_ids_06.cc
tests/bits/subdomain_ids_07.cc
tests/bits/subface_interpolation.cc
tests/bits/tria_crash_01.cc
tests/bits/unit_support_points.cc
tests/bits/unit_support_points_02.cc
tests/bits/vector_11.cc
tests/bits/vector_12.cc
tests/bits/vector_13.cc
tests/bits/vector_14.cc
tests/bits/vector_15.cc
tests/bits/vector_16.cc
tests/bits/vector_17.cc
tests/bits/vector_18.cc
tests/bits/vector_19.cc
tests/bits/vector_20.cc
tests/bits/vector_21.cc
tests/bits/vector_21_negative.cc
tests/bits/vector_22.cc
tests/bits/vector_23.cc
tests/bits/vector_24.cc
tests/bits/vector_25.cc
tests/bits/vector_26.cc
tests/bits/vector_27.cc
tests/bits/vector_28.cc
tests/bits/vector_29.cc
tests/bits/vector_30.cc
tests/bits/vector_31.cc
tests/bits/vector_32.cc
tests/bits/vector_33.cc
tests/bits/vector_34.cc
tests/bits/vector_35.cc
tests/bits/vector_36.cc
tests/bits/vector_37.cc
tests/bits/vector_38.cc
tests/bits/vector_39.cc
tests/bits/vector_40.cc
tests/bits/vector_41.cc
tests/bits/vector_42.cc
tests/bits/vector_43.cc
tests/bits/vector_44.cc
tests/bits/vector_45.cc
tests/bits/vector_46.cc
tests/bits/vector_47.cc
tests/bits/vector_48.cc
tests/bits/vector_49.cc
tests/bits/vector_57.cc
tests/bits/vector_equality_1.cc
tests/bits/vector_equality_2.cc
tests/bits/vector_equality_3.cc
tests/bits/vector_equality_4.cc
tests/bits/vector_equality_5.cc
tests/bits/vector_equality_6.cc
tests/bits/vector_equality_7.cc
tests/bits/vector_equality_8.cc
tests/bits/vector_vector_01.cc
tests/bits/volume_1.cc
tests/bits/volume_2.cc
tests/bits/volume_3.cc
tests/bits/volume_4.cc
tests/codim_one/bem.cc
tests/codim_one/bem_integration.cc
tests/codim_one/boundary_indicator_01.cc
tests/codim_one/data_out.cc
tests/codim_one/data_out_02.cc
tests/codim_one/data_out_03.cc
tests/codim_one/direction_flag_01.cc
tests/codim_one/direction_flag_02.cc
tests/codim_one/direction_flag_03.cc
tests/codim_one/error_estimator_01.cc
tests/codim_one/extract_boundary_mesh_00.cc
tests/codim_one/extract_boundary_mesh_01.cc
tests/codim_one/extract_boundary_mesh_02.cc
tests/codim_one/extract_boundary_mesh_03.cc
tests/codim_one/extract_boundary_mesh_04.cc
tests/codim_one/extract_boundary_mesh_05.cc
tests/codim_one/extract_boundary_mesh_06.cc
tests/codim_one/extract_boundary_mesh_07.cc
tests/codim_one/fe_dgq_prolongation_01.cc
tests/codim_one/fe_values_extractor_01.cc
tests/codim_one/gradients.cc
tests/codim_one/gradients_1.cc
tests/codim_one/grid_in_out.cc
tests/codim_one/grid_in_out_02.cc
tests/codim_one/grid_in_out_03.cc
tests/codim_one/grid_refinement.cc
tests/codim_one/hanging_nodes_01.cc
tests/codim_one/hanging_nodes_02.cc
tests/codim_one/hanging_nodes_03.cc
tests/codim_one/integrate_log.cc
tests/codim_one/integrate_log_2.cc
tests/codim_one/integrate_one_over_r.cc
tests/codim_one/interpolate_boundary_values_01.cc
tests/codim_one/interpolate_boundary_values_01_vector_valued.cc
tests/codim_one/interpolate_boundary_values_02.cc
tests/codim_one/interpolate_boundary_values_02_vector_valued.cc
tests/codim_one/interpolate_boundary_values_03.cc
tests/codim_one/interpolate_boundary_values_1d_closed_ring.cc
tests/codim_one/interpolation.cc
tests/codim_one/interpolation_2.cc
tests/codim_one/interpolation_3.cc
tests/codim_one/mapping_01.cc
tests/codim_one/mapping_02.cc
tests/codim_one/mapping_03.cc
tests/codim_one/mapping_q1.cc
tests/codim_one/mapping_q1_eulerian.cc
tests/codim_one/mapping_q_eulerian.cc
tests/codim_one/mean_value.cc
tests/codim_one/mesh_bug.cc
tests/codim_one/normal_vectors_01.cc
tests/codim_one/projection.cc
tests/codim_one/projection_dgp.cc
tests/codim_one/renumber_component_wise_01.cc
tests/codim_one/solution_transfer_01.cc
tests/codim_one/surface.cc
tests/codim_one/tensor_matrix_conversion.cc
tests/codim_one/transform_01.cc
tests/deal.II/accessor_01.cc
tests/deal.II/accessor_02.cc
tests/deal.II/block_info.cc
tests/deal.II/block_info_02.cc
tests/deal.II/block_list.h
tests/deal.II/block_list_01.cc
tests/deal.II/block_list_02.cc
tests/deal.II/block_list_03.cc
tests/deal.II/block_list_04.cc
tests/deal.II/block_matrices.cc
tests/deal.II/boundaries.cc
tests/deal.II/cell_similarity_crash_01.cc
tests/deal.II/cell_similarity_crash_02.cc
tests/deal.II/coarsening_02.cc
tests/deal.II/coarsening_02_1d.cc
tests/deal.II/coarsening_03.cc
tests/deal.II/constraint_graph.cc
tests/deal.II/constraints.cc
tests/deal.II/constraints_block_01.cc
tests/deal.II/constraints_hanging_nodes_bc.cc
tests/deal.II/constraints_local_to_global.cc
tests/deal.II/constraints_local_to_global_chunk.cc
tests/deal.II/constraints_merge.cc
tests/deal.II/constraints_merge_02.cc
tests/deal.II/constraints_merge_03.cc
tests/deal.II/constraints_merge_04.cc
tests/deal.II/constraints_merge_05.cc
tests/deal.II/constraints_merge_06.cc
tests/deal.II/constraints_merge_07.cc
tests/deal.II/constraints_merge_08.cc
tests/deal.II/constraints_merge_09.cc
tests/deal.II/create_laplace_matrix_01.cc
tests/deal.II/create_laplace_matrix_01b.cc
tests/deal.II/create_laplace_matrix_02.cc
tests/deal.II/create_laplace_matrix_02b.cc
tests/deal.II/create_laplace_matrix_03.cc
tests/deal.II/create_laplace_matrix_03b.cc
tests/deal.II/create_laplace_matrix_04.cc
tests/deal.II/create_laplace_matrix_04b.cc
tests/deal.II/create_laplace_matrix_constraints_01.cc
tests/deal.II/create_laplace_matrix_constraints_02.cc
tests/deal.II/create_laplace_matrix_constraints_02b.cc
tests/deal.II/create_laplace_matrix_constraints_03.cc
tests/deal.II/create_laplace_matrix_constraints_04.cc
tests/deal.II/create_mass_matrix_01.cc
tests/deal.II/create_mass_matrix_01b.cc
tests/deal.II/create_mass_matrix_02.cc
tests/deal.II/create_mass_matrix_02b.cc
tests/deal.II/create_mass_matrix_03.cc
tests/deal.II/create_mass_matrix_03b.cc
tests/deal.II/create_mass_matrix_04.cc
tests/deal.II/create_mass_matrix_04b.cc
tests/deal.II/create_mass_matrix_05.cc
tests/deal.II/create_mass_matrix_constraints_01.cc
tests/deal.II/create_mass_matrix_constraints_02.cc
tests/deal.II/create_mass_matrix_constraints_02b.cc
tests/deal.II/create_mass_matrix_constraints_03.cc
tests/deal.II/create_mass_matrix_constraints_04.cc
tests/deal.II/create_point_source.cc
tests/deal.II/create_point_source_hp.cc
tests/deal.II/data_out.cc
tests/deal.II/data_out_postprocessor_01.cc
tests/deal.II/data_out_postprocessor_scalar_01.cc
tests/deal.II/data_out_postprocessor_vector_01.cc
tests/deal.II/derivative_approximation.cc
tests/deal.II/derivative_approximation_2.cc
tests/deal.II/derivatives.cc
tests/deal.II/dof_accessor_01.cc
tests/deal.II/dof_handler_number_cache.cc
tests/deal.II/dof_handler_number_cache_02.cc
tests/deal.II/dof_renumbering.cc
tests/deal.II/dof_renumbering_02.cc
tests/deal.II/dof_renumbering_03.cc
tests/deal.II/dof_renumbering_04.cc
tests/deal.II/dof_renumbering_04a.cc
tests/deal.II/dof_renumbering_05.cc
tests/deal.II/dof_renumbering_06.cc
tests/deal.II/dof_renumbering_07.cc
tests/deal.II/dof_renumbering_zorder_01.cc
tests/deal.II/dof_renumbering_zorder_02.cc
tests/deal.II/dof_test.cc
tests/deal.II/error_estimator.cc
tests/deal.II/error_estimator_01.cc
tests/deal.II/extent_in_direction.cc
tests/deal.II/extract_dofs_by_component_01.cc
tests/deal.II/extract_dofs_by_component_01_hp.cc
tests/deal.II/extract_dofs_by_component_01_mg.cc
tests/deal.II/extract_dofs_by_component_01x.cc
tests/deal.II/extract_dofs_by_component_01y.cc
tests/deal.II/extract_dofs_by_component_02.cc
tests/deal.II/extract_dofs_by_component_02_hp.cc
tests/deal.II/extract_dofs_by_component_02_mg.cc
tests/deal.II/extract_dofs_by_component_03.cc
tests/deal.II/extract_dofs_by_component_04.cc
tests/deal.II/extract_dofs_by_component_05.cc
tests/deal.II/extract_dofs_by_component_05_hp.cc
tests/deal.II/extract_dofs_by_component_06.cc
tests/deal.II/extract_dofs_by_component_06_hp.cc
tests/deal.II/face_orientations_3d.cc
tests/deal.II/fe_field.cc
tests/deal.II/fe_values_view_01.cc
tests/deal.II/fe_values_view_02.cc
tests/deal.II/fe_values_view_03.cc
tests/deal.II/fe_values_view_04.cc
tests/deal.II/fe_values_view_05.cc
tests/deal.II/fe_values_view_06.cc
tests/deal.II/fe_values_view_07.cc
tests/deal.II/fe_values_view_08.cc
tests/deal.II/fe_values_view_09.cc
tests/deal.II/fe_values_view_10.cc
tests/deal.II/fe_values_view_10_single_01.cc
tests/deal.II/fe_values_view_10_single_02.cc
tests/deal.II/fe_values_view_10_single_03.cc
tests/deal.II/fe_values_view_10_single_04.cc
tests/deal.II/fe_values_view_11.cc
tests/deal.II/fe_values_view_12.cc
tests/deal.II/fe_values_view_13.cc
tests/deal.II/fe_values_view_14.cc
tests/deal.II/fe_values_view_15.cc
tests/deal.II/fe_values_view_16.cc
tests/deal.II/fe_values_view_17.cc
tests/deal.II/fe_values_view_18.cc
tests/deal.II/fe_values_view_19.cc
tests/deal.II/fe_values_view_20.cc
tests/deal.II/fe_values_view_21.cc
tests/deal.II/fe_values_view_21_nonsymmetric.cc
tests/deal.II/fe_values_view_22.cc
tests/deal.II/fe_values_view_23.cc
tests/deal.II/fe_values_view_23_nonsymmetric.cc
tests/deal.II/fe_values_view_24.cc
tests/deal.II/fe_values_view_24_nonsymmetric.cc
tests/deal.II/fe_values_view_25.cc
tests/deal.II/fe_values_view_25_nonsymmetric.cc
tests/deal.II/fe_values_view_invalid_01.cc
tests/deal.II/fe_values_view_invalid_02.cc
tests/deal.II/fe_values_view_invalid_03.cc
tests/deal.II/fe_values_view_invalid_03_nonsymmetric.cc
tests/deal.II/fe_values_view_tensor_01.cc
tests/deal.II/filtered_iterator.cc
tests/deal.II/filtered_iterator_02.cc
tests/deal.II/filtered_iterator_03.cc
tests/deal.II/filtered_matrix.cc
tests/deal.II/get_finest_common_cells_01.cc
tests/deal.II/get_finest_common_cells_02.cc
tests/deal.II/get_finest_common_cells_03.cc
tests/deal.II/get_finest_common_cells_04.cc
tests/deal.II/grid_generator_01.cc
tests/deal.II/grid_hyper_shell.cc
tests/deal.II/grid_hyper_shell_02.cc
tests/deal.II/grid_hyper_shell_03.cc
tests/deal.II/grid_hyper_shell_04.cc
tests/deal.II/grid_hyper_shell_05.cc
tests/deal.II/grid_in.cc
tests/deal.II/grid_in_02.cc
tests/deal.II/grid_in_3d.cc
tests/deal.II/grid_in_3d_02.cc
tests/deal.II/grid_in_msh.cc
tests/deal.II/grid_in_msh_02.cc
tests/deal.II/grid_in_msh_03.cc
tests/deal.II/grid_in_msh_version_1.cc
tests/deal.II/grid_in_msh_version_2.cc
tests/deal.II/grid_in_tecplot.cc
tests/deal.II/grid_in_unv_2d.cc
tests/deal.II/grid_in_unv_3d.cc
tests/deal.II/grid_invert.cc
tests/deal.II/grid_out.cc
tests/deal.II/grid_out_02.cc
tests/deal.II/grid_output_input.cc
tests/deal.II/grid_parallelepiped.cc
tests/deal.II/grid_parallelepiped_01.cc
tests/deal.II/grid_parallelepiped_02.cc
tests/deal.II/grid_parallelepiped_03.cc
tests/deal.II/grid_test.cc
tests/deal.II/grid_tools.cc
tests/deal.II/grid_tools_02.cc
tests/deal.II/grid_tools_03.cc
tests/deal.II/grid_tools_04.cc
tests/deal.II/grid_tools_05.cc
tests/deal.II/grid_transform.cc
tests/deal.II/grid_transform_3d.cc
tests/deal.II/have_same_coarse_mesh_01.cc
tests/deal.II/have_same_coarse_mesh_02.cc
tests/deal.II/have_same_coarse_mesh_03.cc
tests/deal.II/have_same_coarse_mesh_04.cc
tests/deal.II/helmholtz.h
tests/deal.II/inhomogeneous_constraints.cc
tests/deal.II/inhomogeneous_constraints_02.cc
tests/deal.II/inhomogeneous_constraints_03.cc
tests/deal.II/inhomogeneous_constraints_04.cc
tests/deal.II/inhomogeneous_constraints_block.cc
tests/deal.II/inhomogeneous_constraints_nonsymmetric.cc
tests/deal.II/inhomogeneous_constraints_vector.cc
tests/deal.II/intergrid_constraints.cc
tests/deal.II/intergrid_map.cc
tests/deal.II/interpolate_boundary_values_01.cc
tests/deal.II/interpolate_boundary_values_02.cc
tests/deal.II/interpolate_dgq_01.cc
tests/deal.II/interpolate_dgq_02.cc
tests/deal.II/interpolate_q_01.cc
tests/deal.II/interpolate_q_02.cc
tests/deal.II/interpolate_q_system_01.cc
tests/deal.II/interpolate_q_system_02.cc
tests/deal.II/kelly_crash_02.cc
tests/deal.II/line_coarsening_3d.cc
tests/deal.II/matrices.cc
tests/deal.II/maximal_cell_diameter.cc
tests/deal.II/measure_et_al.cc
tests/deal.II/measure_et_al_02.cc
tests/deal.II/memory_consumption_01.cc
tests/deal.II/merge_triangulations_01.cc
tests/deal.II/mesh_smoothing_02.cc
tests/deal.II/mesh_smoothing_03.cc
tests/deal.II/mg_dof_handler.cc
tests/deal.II/minimal_cell_diameter.cc
tests/deal.II/newton_01.cc
tests/deal.II/no_flux_01.cc
tests/deal.II/no_flux_02.cc
tests/deal.II/no_flux_03.cc
tests/deal.II/no_flux_04.cc
tests/deal.II/no_flux_05.cc
tests/deal.II/no_flux_06.cc
tests/deal.II/no_flux_07.cc
tests/deal.II/no_flux_08.cc
tests/deal.II/no_flux_10.cc
tests/deal.II/no_flux_hp_01.cc
tests/deal.II/no_flux_hp_02.cc
tests/deal.II/no_flux_hp_03.cc
tests/deal.II/no_flux_hp_04.cc
tests/deal.II/no_flux_hp_05.cc
tests/deal.II/normal_vector_01.cc
tests/deal.II/normal_vector_01_2d.cc
tests/deal.II/normal_vector_02.cc
tests/deal.II/normal_vector_02_2d.cc
tests/deal.II/normal_vector_03.cc
tests/deal.II/normal_vector_03_2d.cc
tests/deal.II/normals_at_vertices_01.cc
tests/deal.II/normals_at_vertices_02.cc
tests/deal.II/number_cache_01.cc
tests/deal.II/number_cache_02.cc
tests/deal.II/number_cache_03.cc
tests/deal.II/point_value_history_01.cc
tests/deal.II/point_value_history_02.cc
tests/deal.II/point_value_history_03.cc
tests/deal.II/project_01.cc
tests/deal.II/project_01_curved_boundary.cc
tests/deal.II/project_02.cc
tests/deal.II/project_boundary_rt_01.cc
tests/deal.II/project_bv_curl_conf.cc
tests/deal.II/project_bv_div_conf.cc
tests/deal.II/project_common.h
tests/deal.II/project_nedelec_01.cc
tests/deal.II/project_nedelec_02.cc
tests/deal.II/project_nedelec_03.cc
tests/deal.II/project_nedelec_04.cc
tests/deal.II/project_nedelec_05.cc
tests/deal.II/project_q_system_01.cc
tests/deal.II/project_q_system_02.cc
tests/deal.II/project_q_system_03.cc
tests/deal.II/project_q_system_04.cc
tests/deal.II/project_q_system_05.cc
tests/deal.II/project_rt_01.cc
tests/deal.II/project_rt_02.cc
tests/deal.II/project_rt_04.cc
tests/deal.II/project_rt_05.cc
tests/deal.II/project_to_surface_01.cc
tests/deal.II/project_to_surface_02.cc
tests/deal.II/project_to_surface_03.cc
tests/deal.II/recursively_set_material_id.cc
tests/deal.II/refinement_listener_01.cc
tests/deal.II/refinement_listener_02.cc
tests/deal.II/refinement_listener_03.cc
tests/deal.II/rt_covariant.cc
tests/deal.II/rt_hessian.cc
tests/deal.II/sparsity_pattern.cc
tests/deal.II/sparsity_pattern_01.cc
tests/deal.II/sparsity_pattern_01_x.cc
tests/deal.II/sparsity_pattern_02.cc
tests/deal.II/sparsity_pattern_03.cc
tests/deal.II/sparsity_pattern_04.cc
tests/deal.II/sparsity_pattern_05.cc
tests/deal.II/sparsity_pattern_05_x.cc
tests/deal.II/sparsity_pattern_x.cc
tests/deal.II/subcelldata.cc
tests/deal.II/subdomain_ids.cc
tests/deal.II/subdomain_on_refinement.cc
tests/deal.II/time_dependent_01.cc
tests/deal.II/union_triangulation.cc
tests/deal.II/user_data_01.cc
tests/deal.II/vectors_boundary_rhs_01.cc
tests/deal.II/vectors_boundary_rhs_02.cc
tests/deal.II/vectors_boundary_rhs_03.cc
tests/deal.II/vectors_point_source_01.cc
tests/deal.II/vectors_rhs_01.cc
tests/deal.II/vectors_rhs_03.cc
tests/deal.II/vertex_as_face_01.cc
tests/deal.II/vertex_as_face_02.cc
tests/deal.II/vertex_as_face_03.cc
tests/deal.II/vertex_as_face_04.cc
tests/deal.II/vertex_as_face_05.cc
tests/deal.II/vertex_as_face_06.cc
tests/deal.II/vertex_as_face_07.cc
tests/deal.II/vertex_as_face_08.cc
tests/deal.II/vertex_as_face_09.cc
tests/deal.II/vertex_as_face_10.cc
tests/deal.II/vertex_as_face_12.cc
tests/distributed_grids/2d_coarse_grid_01.cc
tests/distributed_grids/2d_coarse_grid_02.cc
tests/distributed_grids/2d_coarse_grid_03.cc
tests/distributed_grids/2d_coarse_grid_04.cc
tests/distributed_grids/2d_coarse_grid_x_01.cc
tests/distributed_grids/2d_coarsening_01.cc
tests/distributed_grids/2d_coarsening_02.cc
tests/distributed_grids/2d_coarsening_03.cc
tests/distributed_grids/2d_coarsening_05.cc
tests/distributed_grids/2d_dofhandler_01.cc
tests/distributed_grids/2d_refinement_01.cc
tests/distributed_grids/2d_refinement_02.cc
tests/distributed_grids/2d_refinement_03.cc
tests/distributed_grids/2d_refinement_04.cc
tests/distributed_grids/2d_refinement_05.cc
tests/distributed_grids/2d_refinement_06.cc
tests/distributed_grids/2d_refinement_07.cc
tests/distributed_grids/3d_coarse_grid_01.cc
tests/distributed_grids/3d_coarse_grid_03.cc
tests/distributed_grids/3d_coarse_grid_04.cc
tests/distributed_grids/3d_coarse_grid_05.cc
tests/distributed_grids/3d_coarse_grid_06.cc
tests/distributed_grids/3d_coarse_grid_x_01.cc
tests/distributed_grids/3d_coarsening_01.cc
tests/distributed_grids/3d_coarsening_02.cc
tests/distributed_grids/3d_coarsening_03.cc
tests/distributed_grids/3d_coarsening_04.cc
tests/distributed_grids/3d_coarsening_05.cc
tests/distributed_grids/3d_refinement_01.cc
tests/distributed_grids/3d_refinement_02.cc
tests/distributed_grids/3d_refinement_03.cc
tests/distributed_grids/3d_refinement_04.cc
tests/distributed_grids/3d_refinement_05.cc
tests/distributed_grids/3d_refinement_06.cc
tests/distributed_grids/3d_refinement_07.cc
tests/distributed_grids/3d_refinement_08.cc
tests/distributed_grids/3d_refinement_09.cc
tests/distributed_grids/anisotropic.cc
tests/distributed_grids/coarse_grid_common.h
tests/distributed_grids/count_dofs_per_block_01.cc
tests/distributed_grids/count_dofs_per_component_01.cc
tests/distributed_grids/dof_handler_number_cache.cc
tests/distributed_grids/solution_transfer_01.cc
tests/distributed_grids/solution_transfer_02.cc
tests/distributed_grids/solution_transfer_03.cc
tests/distributed_grids/solution_transfer_04.cc
tests/distributed_grids/subdomain_id_01.cc
tests/distributed_grids/tria_settings_01.cc
tests/fail/abf_approximation_01.cc
tests/fail/circular_01.cc
tests/fail/fe_nothing_04.cc
tests/fail/hp-step-14.cc
tests/fail/hp-step-15.cc
tests/fail/hp_constraints_q_system_08.cc
tests/fail/hp_constraints_q_system_x_08.cc
tests/fail/hp_constraints_rt_01.cc
tests/fail/hp_constraints_rt_02.cc
tests/fail/hp_constraints_rt_03.cc
tests/fail/hp_constraints_rt_04.cc
tests/fail/hp_constraints_rt_05.cc
tests/fail/hp_constraints_rt_06.cc
tests/fail/injection_nedelec.cc
tests/fail/injection_rt.cc
tests/fail/project_rt_03.cc
tests/fail/rt_4.cc
tests/fail/rt_6.cc
tests/fail/rt_crash_01.cc
tests/fail/rt_distorted_01.cc
tests/fail/rt_distorted_02.cc
tests/fail/vectors_boundary_rhs_hp_02.cc
tests/fail/vectors_rhs_hp_02.cc
tests/fe/abf_01.cc
tests/fe/block_mask_02.cc
tests/fe/block_mask_03.cc
tests/fe/block_mask_05.cc
tests/fe/block_mask_06.cc
tests/fe/block_mask_07.cc
tests/fe/block_mask_08.cc
tests/fe/block_mask_09.cc
tests/fe/block_mask_10.cc
tests/fe/block_mask_11.cc
tests/fe/cell_similarity_01.cc
tests/fe/cell_similarity_02.cc
tests/fe/cell_similarity_03.cc
tests/fe/cell_similarity_04.cc
tests/fe/cell_similarity_05.cc
tests/fe/cell_similarity_06.cc
tests/fe/cell_similarity_07.cc
tests/fe/cell_similarity_08.cc
tests/fe/cell_similarity_09.cc
tests/fe/cell_similarity_10.cc
tests/fe/cell_similarity_dgp_monomial_01.cc
tests/fe/cell_similarity_dgp_monomial_02.cc
tests/fe/cell_similarity_dgp_monomial_03.cc
tests/fe/cell_similarity_dgp_monomial_04.cc
tests/fe/cell_similarity_dgp_monomial_05.cc
tests/fe/cell_similarity_dgp_monomial_06.cc
tests/fe/cell_similarity_dgp_monomial_07.cc
tests/fe/cell_similarity_dgp_monomial_08.cc
tests/fe/cell_similarity_dgp_monomial_09.cc
tests/fe/cell_similarity_dgp_monomial_10.cc
tests/fe/cell_similarity_dgp_nonparametric_01.cc
tests/fe/cell_similarity_dgp_nonparametric_02.cc
tests/fe/cell_similarity_dgp_nonparametric_03.cc
tests/fe/cell_similarity_dgp_nonparametric_04.cc
tests/fe/cell_similarity_dgp_nonparametric_05.cc
tests/fe/cell_similarity_dgp_nonparametric_06.cc
tests/fe/cell_similarity_dgp_nonparametric_07.cc
tests/fe/cell_similarity_dgp_nonparametric_08.cc
tests/fe/cell_similarity_dgp_nonparametric_09.cc
tests/fe/cell_similarity_dgp_nonparametric_10.cc
tests/fe/check_derivatives.cc
tests/fe/component_mask_02.cc
tests/fe/component_mask_03.cc
tests/fe/component_mask_05.cc
tests/fe/component_mask_06.cc
tests/fe/component_mask_07.cc
tests/fe/component_mask_08.cc
tests/fe/component_mask_09.cc
tests/fe/component_mask_10.cc
tests/fe/component_mask_11.cc
tests/fe/component_mask_12.cc
tests/fe/component_mask_13.cc
tests/fe/component_mask_14.cc
tests/fe/copy_01.cc
tests/fe/deformed_projection.h
tests/fe/derivatives.cc
tests/fe/derivatives_face.cc
tests/fe/dgp_01.cc
tests/fe/dgp_monomial_1.cc
tests/fe/dgp_monomial_2.cc
tests/fe/dgq_1.cc
tests/fe/fe_data_test.cc
tests/fe/fe_face_orientation_nedelec.h
tests/fe/fe_face_orientation_nedelec_0.cc
tests/fe/fe_face_values_1d.cc
tests/fe/fe_face_values_1d_mapping_cartesian.cc
tests/fe/fe_face_values_1d_mapping_q2.cc
tests/fe/fe_prolongation_common.h
tests/fe/fe_prolongation_sys_05.cc
tests/fe/fe_prolongation_sys_06.cc
tests/fe/fe_prolongation_sys_08.cc
tests/fe/fe_prolongation_sys_10.cc
tests/fe/fe_q_dg0.cc
tests/fe/fe_restriction_common.h
tests/fe/fe_restriction_sys_05.cc
tests/fe/fe_restriction_sys_06.cc
tests/fe/fe_restriction_sys_08.cc
tests/fe/fe_restriction_sys_10.cc
tests/fe/fe_support_points_common.h
tests/fe/fe_support_points_sys_05.cc
tests/fe/fe_support_points_sys_06.cc
tests/fe/fe_support_points_sys_08.cc
tests/fe/fe_support_points_sys_10.cc
tests/fe/fe_tools.cc
tests/fe/fe_tools_01.cc
tests/fe/fe_tools_test.cc
tests/fe/function.cc
tests/fe/injection_common.h
tests/fe/injection_q_dg0.cc
tests/fe/injection_q_system.cc
tests/fe/interpolate_common.h
tests/fe/interpolate_q1.cc
tests/fe/interpolate_q_dg0.cc
tests/fe/interpolate_q_iso_q1.cc
tests/fe/interpolate_rt.cc
tests/fe/interpolate_rtn.cc
tests/fe/interpolate_system.cc
tests/fe/jacobians.cc
tests/fe/mapping.cc
tests/fe/mapping_c1.cc
tests/fe/mapping_q1_eulerian.cc
tests/fe/mapping_q_eulerian.cc
tests/fe/mapping_real_to_unit_02.cc
tests/fe/mapping_real_to_unit_q1.cc
tests/fe/mapping_real_to_unit_q4_curved.cc
tests/fe/mapping_real_to_unit_q4_curved_codim.cc
tests/fe/mapping_real_to_unit_q4_sphere.cc
tests/fe/mapping_real_to_unit_q4_sphere_x.cc
tests/fe/mapping_real_to_unit_q4_sphere_y.cc
tests/fe/mapping_real_to_unit_q4_sphere_z.cc
tests/fe/mapping_real_to_unit_q4_straight.cc
tests/fe/mass_matrix_arbitrary_nodes.cc
tests/fe/nedelec.cc
tests/fe/nedelec_2.cc
tests/fe/nedelec_3.cc
tests/fe/nedelec_crash_01.cc
tests/fe/non_primitive_1.cc
tests/fe/non_primitive_2.cc
tests/fe/numbering.cc
tests/fe/q_1.cc
tests/fe/q_2.cc
tests/fe/q_3.cc
tests/fe/q_4.cc
tests/fe/rt_1.cc
tests/fe/rt_10.cc
tests/fe/rt_11.cc
tests/fe/rt_12.cc
tests/fe/rt_13.cc
tests/fe/rt_14.cc
tests/fe/rt_15.cc
tests/fe/rt_2.cc
tests/fe/rt_3.cc
tests/fe/rt_5.cc
tests/fe/rt_7.cc
tests/fe/rt_8.cc
tests/fe/rt_9.cc
tests/fe/rt_approximation_01.cc
tests/fe/rt_normal_02.cc
tests/fe/rtdiff.cc
tests/fe/rtn_1.cc
tests/fe/rtn_2.cc
tests/fe/rtn_3.cc
tests/fe/shapes.h
tests/fe/shapes_dgp.cc
tests/fe/shapes_dgp_monomial.cc
tests/fe/shapes_dgp_nonparametric.cc
tests/fe/shapes_dgq.cc
tests/fe/shapes_faceq.cc
tests/fe/shapes_nedelec.cc
tests/fe/shapes_q.cc
tests/fe/shapes_q_dg0.cc
tests/fe/shapes_q_hierarchical.cc
tests/fe/shapes_q_iso_q1.cc
tests/fe/shapes_system.cc
tests/fe/system_01.cc
tests/fe/system_02.cc
tests/fe/system_index.cc
tests/fe/traits.cc
tests/fe/transfer.cc
tests/fe/up_and_down.cc
tests/gla/block_mat_01.cc
tests/gla/block_mat_02.cc
tests/gla/block_vec_01.cc
tests/gla/block_vec_02.cc
tests/gla/gla.h
tests/gla/mat_01.cc
tests/gla/mat_02.cc
tests/gla/mat_03.cc
tests/gla/mat_04.cc
tests/gla/vec_00.cc
tests/gla/vec_01.cc
tests/gla/vec_02.cc
tests/gla/vec_03.cc
tests/grid/cell_id_01.cc
tests/grid/cell_id_02.cc
tests/grid/grid_out_svg_01.cc
tests/grid/grid_out_svg_02.cc
tests/grid/ordering_01.cc
tests/grid/refine_and_coarsen_01.cc
tests/hp/compare_hp_vs_nonhp_01.cc
tests/hp/continuous_1d_01.cc
tests/hp/continuous_2d_01.cc
tests/hp/continuous_3d_01.cc
tests/hp/count_dofs_per_block_01.cc
tests/hp/count_dofs_per_block_02.cc
tests/hp/crash_01.cc
tests/hp/crash_02.cc
tests/hp/crash_03.cc
tests/hp/crash_04.cc
tests/hp/crash_05.cc
tests/hp/crash_06.cc
tests/hp/crash_07.cc
tests/hp/crash_08.cc
tests/hp/crash_09.cc
tests/hp/crash_10.cc
tests/hp/crash_11.cc
tests/hp/crash_12.cc
tests/hp/crash_13.cc
tests/hp/crash_14.cc
tests/hp/crash_15.cc
tests/hp/crash_16.cc
tests/hp/crash_17.cc
tests/hp/crash_17_compressed_set_sparsity.cc
tests/hp/crash_18.cc
tests/hp/crash_18_compressed_set_sparsity.cc
tests/hp/crash_19.cc
tests/hp/crash_20.cc
tests/hp/crash_21.cc
tests/hp/create_laplace_matrix_01.cc
tests/hp/create_laplace_matrix_01b.cc
tests/hp/create_laplace_matrix_02.cc
tests/hp/create_laplace_matrix_02b.cc
tests/hp/create_laplace_matrix_03.cc
tests/hp/create_laplace_matrix_03b.cc
tests/hp/create_laplace_matrix_04.cc
tests/hp/create_laplace_matrix_04b.cc
tests/hp/create_laplace_matrix_constraints_02.cc
tests/hp/create_laplace_matrix_constraints_02b.cc
tests/hp/create_mass_matrix_01.cc
tests/hp/create_mass_matrix_01b.cc
tests/hp/create_mass_matrix_02.cc
tests/hp/create_mass_matrix_02b.cc
tests/hp/create_mass_matrix_03.cc
tests/hp/create_mass_matrix_03b.cc
tests/hp/create_mass_matrix_04.cc
tests/hp/create_mass_matrix_04b.cc
tests/hp/create_mass_matrix_05.cc
tests/hp/create_mass_matrix_constraints_02.cc
tests/hp/create_mass_matrix_constraints_02b.cc
tests/hp/create_rhs_01.cc
tests/hp/dof_handler_number_cache.cc
tests/hp/dof_renumbering_04.cc
tests/hp/dof_renumbering_05.cc
tests/hp/dof_renumbering_06.cc
tests/hp/fe_collection_01.cc
tests/hp/fe_collection_02.cc
tests/hp/fe_collection_03.cc
tests/hp/fe_collection_04.cc
tests/hp/fe_nothing_01.cc
tests/hp/fe_nothing_02.cc
tests/hp/fe_nothing_03.cc
tests/hp/fe_nothing_05.cc
tests/hp/fe_nothing_06.cc
tests/hp/fe_nothing_07.cc
tests/hp/fe_nothing_08.cc
tests/hp/fe_nothing_09.cc
tests/hp/fe_nothing_11.cc
tests/hp/fe_nothing_12.cc
tests/hp/fe_nothing_13.cc
tests/hp/fe_nothing_14.cc
tests/hp/fe_nothing_15.cc
tests/hp/fe_nothing_16.cc
tests/hp/fe_nothing_17.cc
tests/hp/get_active_fe_indices.cc
tests/hp/hp_constraints_common.h
tests/hp/hp_constraints_q_system.cc
tests/hp/hp_constraints_q_system_x.cc
tests/hp/hp_constraints_rt_nodal.cc
tests/hp/hp_dof_handler.cc
tests/hp/hp_hanging_nodes_01.cc
tests/hp/hp_hanging_nodes_02.cc
tests/hp/hp_line_dof_identities_dgp.cc
tests/hp/hp_line_dof_identities_dgp_monomial.cc
tests/hp/hp_line_dof_identities_dgp_monomial_system_01.cc
tests/hp/hp_line_dof_identities_dgp_monomial_system_02.cc
tests/hp/hp_line_dof_identities_dgp_nonparametric.cc
tests/hp/hp_line_dof_identities_dgp_nonparametric_system_01.cc
tests/hp/hp_line_dof_identities_dgp_nonparametric_system_02.cc
tests/hp/hp_line_dof_identities_dgp_system_01.cc
tests/hp/hp_line_dof_identities_dgp_system_02.cc
tests/hp/hp_line_dof_identities_dgq.cc
tests/hp/hp_line_dof_identities_dgq_system_01.cc
tests/hp/hp_line_dof_identities_dgq_system_02.cc
tests/hp/hp_line_dof_identities_q.cc
tests/hp/hp_line_dof_identities_q_gl.cc
tests/hp/hp_line_dof_identities_q_system_01.cc
tests/hp/hp_line_dof_identities_q_system_02.cc
tests/hp/hp_line_dof_identities_q_system_03.cc
tests/hp/hp_line_dof_identities_rt_nodal.cc
tests/hp/hp_quad_dof_identities_dgp.cc
tests/hp/hp_quad_dof_identities_dgp_monomial.cc
tests/hp/hp_quad_dof_identities_dgp_monomial_system_01.cc
tests/hp/hp_quad_dof_identities_dgp_monomial_system_02.cc
tests/hp/hp_quad_dof_identities_dgp_nonparametric.cc
tests/hp/hp_quad_dof_identities_dgp_nonparametric_system_01.cc
tests/hp/hp_quad_dof_identities_dgp_nonparametric_system_02.cc
tests/hp/hp_quad_dof_identities_dgp_system_01.cc
tests/hp/hp_quad_dof_identities_dgp_system_02.cc
tests/hp/hp_quad_dof_identities_dgq.cc
tests/hp/hp_quad_dof_identities_dgq_system_01.cc
tests/hp/hp_quad_dof_identities_dgq_system_02.cc
tests/hp/hp_quad_dof_identities_q.cc
tests/hp/hp_quad_dof_identities_q_gl.cc
tests/hp/hp_quad_dof_identities_q_system_01.cc
tests/hp/hp_quad_dof_identities_q_system_02.cc
tests/hp/hp_quad_dof_identities_rt_nodal.cc
tests/hp/hp_vertex_dof_identities_dgp.cc
tests/hp/hp_vertex_dof_identities_dgp_monomial.cc
tests/hp/hp_vertex_dof_identities_dgp_monomial_system_01.cc
tests/hp/hp_vertex_dof_identities_dgp_monomial_system_02.cc
tests/hp/hp_vertex_dof_identities_dgp_nonparametric.cc
tests/hp/hp_vertex_dof_identities_dgp_nonparametric_system_01.cc
tests/hp/hp_vertex_dof_identities_dgp_nonparametric_system_02.cc
tests/hp/hp_vertex_dof_identities_dgp_system_01.cc
tests/hp/hp_vertex_dof_identities_dgp_system_02.cc
tests/hp/hp_vertex_dof_identities_dgq.cc
tests/hp/hp_vertex_dof_identities_dgq_system_01.cc
tests/hp/hp_vertex_dof_identities_dgq_system_02.cc
tests/hp/hp_vertex_dof_identities_q.cc
tests/hp/hp_vertex_dof_identities_q_system_01.cc
tests/hp/hp_vertex_dof_identities_q_system_02.cc
tests/hp/hp_vertex_dof_identities_rt_nodal.cc
tests/hp/integrate_difference.cc
tests/hp/integrate_difference_02.cc
tests/hp/interpolate_dgq_01.cc
tests/hp/interpolate_dgq_02.cc
tests/hp/interpolate_q_01.cc
tests/hp/interpolate_q_02.cc
tests/hp/interpolate_q_system_01.cc
tests/hp/interpolate_q_system_02.cc
tests/hp/mapping_collection_01.cc
tests/hp/mapping_collection_02.cc
tests/hp/mapping_collection_03.cc
tests/hp/mapping_collection_04.cc
tests/hp/matrices.cc
tests/hp/matrices_hp.cc
tests/hp/n_active_fe_indices.cc
tests/hp/n_dofs.cc
tests/hp/q_collection_01.cc
tests/hp/random.cc
tests/hp/renumber_block_wise_01.cc
tests/hp/renumber_block_wise_01a.cc
tests/hp/renumber_block_wise_01b.cc
tests/hp/renumber_block_wise_02.cc
tests/hp/renumber_component_wise.cc
tests/hp/solution_transfer.cc
tests/hp/solution_transfer_02.cc
tests/hp/step-10.cc
tests/hp/step-11.cc
tests/hp/step-11_compressed_set_sparsity.cc
tests/hp/step-12.cc
tests/hp/step-13.cc
tests/hp/step-2.cc
tests/hp/step-3.cc
tests/hp/step-3a.cc
tests/hp/step-3b.cc
tests/hp/step-3c.cc
tests/hp/step-4.cc
tests/hp/step-5.cc
tests/hp/step-6.cc
tests/hp/step-7.cc
tests/hp/step-8.cc
tests/hp/vectors_boundary_rhs_01.cc
tests/hp/vectors_boundary_rhs_02.cc
tests/hp/vectors_boundary_rhs_03.cc
tests/hp/vectors_boundary_rhs_hp_01.cc
tests/hp/vectors_boundary_rhs_hp_03.cc
tests/hp/vectors_point_source_01.cc
tests/hp/vectors_point_source_hp_01.cc
tests/hp/vectors_rhs_01.cc
tests/hp/vectors_rhs_02.cc
tests/hp/vectors_rhs_03.cc
tests/hp/vectors_rhs_hp_01.cc
tests/hp/vectors_rhs_hp_03.cc
tests/hsl/hsl_ma27_01.cc
tests/hsl/hsl_ma27_02.cc
tests/hsl/hsl_ma47_01.cc
tests/hsl/hsl_ma47_02.cc
tests/integrators/assembler_simple_matrix_01.cc
tests/integrators/assembler_simple_matrix_02.cc
tests/integrators/assembler_simple_matrix_03.cc
tests/integrators/assembler_simple_matrix_03tri.cc
tests/integrators/assembler_simple_matrix_04.cc
tests/integrators/assembler_simple_mgmatrix_01.cc
tests/integrators/assembler_simple_mgmatrix_02.cc
tests/integrators/assembler_simple_mgmatrix_03.cc
tests/integrators/cells_and_faces_01.cc
tests/integrators/cochain_01.cc
tests/integrators/divergence_01.cc
tests/integrators/elasticity_01.cc
tests/integrators/empty_info.h
tests/integrators/functional_01.cc
tests/integrators/laplacian_01.cc
tests/integrators/mesh_worker_01.cc
tests/integrators/mesh_worker_02.cc
tests/integrators/mesh_worker_03.cc
tests/integrators/mesh_worker_1d_dg.cc
tests/integrators/mesh_worker_matrix_01.cc
tests/lac/ala_01.cc
tests/lac/bicgstab_early.cc
tests/lac/bicgstab_large.cc
tests/lac/block_compressed_01.cc
tests/lac/block_compressed_simple_sparsity_pattern_indexset_01.cc
tests/lac/block_indices.cc
tests/lac/block_matrices.cc
tests/lac/block_minres.cc
tests/lac/block_sparsity_pattern_01.cc
tests/lac/block_sparsity_pattern_02.cc
tests/lac/block_sparsity_pattern_03.cc
tests/lac/block_vector.cc
tests/lac/block_vector_copy.cc
tests/lac/block_vector_iterator.cc
tests/lac/block_vector_vector_assign.cc
tests/lac/chunk_sparsity_pattern_01.cc
tests/lac/chunk_sparsity_pattern_02.cc
tests/lac/chunk_sparsity_pattern_03.cc
tests/lac/chunk_sparsity_pattern_04.cc
tests/lac/chunk_sparsity_pattern_05.cc
tests/lac/chunk_sparsity_pattern_06.cc
tests/lac/chunk_sparsity_pattern_07.cc
tests/lac/chunk_sparsity_pattern_08.cc
tests/lac/chunk_sparsity_pattern_09.cc
tests/lac/chunk_sparsity_pattern_10.cc
tests/lac/chunk_sparsity_pattern_11.cc
tests/lac/complex_block_vector.cc
tests/lac/complex_block_vector_iterator.cc
tests/lac/complex_block_vector_vector_assign.cc
tests/lac/compressed_set_sparsity_pattern_01.cc
tests/lac/compressed_set_sparsity_pattern_02.cc
tests/lac/compressed_set_sparsity_pattern_03.cc
tests/lac/compressed_set_sparsity_pattern_04.cc
tests/lac/compressed_set_sparsity_pattern_05.cc
tests/lac/compressed_set_sparsity_pattern_10.cc
tests/lac/compressed_set_sparsity_pattern_11.cc
tests/lac/compressed_sparsity_pattern_01.cc
tests/lac/compressed_sparsity_pattern_02.cc
tests/lac/compressed_sparsity_pattern_03.cc
tests/lac/compressed_sparsity_pattern_04.cc
tests/lac/compressed_sparsity_pattern_05.cc
tests/lac/compressed_sparsity_pattern_10.cc
tests/lac/compressed_sparsity_pattern_11.cc
tests/lac/constraint_graph_zero.cc
tests/lac/constraints_01.cc
tests/lac/constraints_c1.cc
tests/lac/constraints_c1_02.cc
tests/lac/constraints_inhomogeneous.cc
tests/lac/constraints_zero.cc
tests/lac/constraints_zero_condense.cc
tests/lac/constraints_zero_merge.cc
tests/lac/copy_transposed.cc
tests/lac/eigen.cc
tests/lac/filtered_matrix.cc
tests/lac/full_matrix.cc
tests/lac/full_matrix_02.cc
tests/lac/full_matrix_03.cc
tests/lac/full_matrix_04.cc
tests/lac/full_matrix_05.cc
tests/lac/full_matrix_06.cc
tests/lac/full_matrix_07.cc
tests/lac/full_matrix_08.cc
tests/lac/full_matrix_print.cc
tests/lac/gmres_reorthogonalize_04.cc
tests/lac/gmres_reorthogonalize_05.cc
tests/lac/householder.cc
tests/lac/identity_matrix_01.cc
tests/lac/identity_matrix_02.cc
tests/lac/identity_matrix_03.cc
tests/lac/identity_matrix_04.cc
tests/lac/identity_matrix_05.cc
tests/lac/identity_matrix_06.cc
tests/lac/is_block_matrix.cc
tests/lac/is_block_vector.cc
tests/lac/lapack_fill.cc
tests/lac/matrices.cc
tests/lac/matrices_ez.cc
tests/lac/matrices_ez_add.cc
tests/lac/matrices_lapack.cc
tests/lac/matrices_lapack_fill.cc
tests/lac/matrix_lib.cc
tests/lac/matrix_out.cc
tests/lac/pointer_matrix.cc
tests/lac/pointer_matrix_vector.cc
tests/lac/print_formatted_ez_01.cc
tests/lac/quickmatrix.h
tests/lac/solver.cc
tests/lac/solver_02.cc
tests/lac/solver_leak.cc
tests/lac/solver_relaxation_01.cc
tests/lac/solver_relaxation_02.cc
tests/lac/solver_relaxation_03.cc
tests/lac/solver_selector_00.cc
tests/lac/solver_selector_01.cc
tests/lac/solver_selector_02.cc
tests/lac/sparse_ilu.cc
tests/lac/sparse_ilu_inverse.cc
tests/lac/sparse_ilu_t.cc
tests/lac/sparse_matrices.cc
tests/lac/sparse_matrix_Tmmult_01.cc
tests/lac/sparse_matrix_Tmmult_02.cc
tests/lac/sparse_matrix_iterator.cc
tests/lac/sparse_matrix_mmult_01.cc
tests/lac/sparse_matrix_mmult_02.cc
tests/lac/sparse_mic.cc
tests/lac/sparsity_pattern.cc
tests/lac/sparsity_pattern_01.cc
tests/lac/sparsity_pattern_02.cc
tests/lac/sparsity_pattern_03.cc
tests/lac/sparsity_pattern_04.cc
tests/lac/sparsity_pattern_05.cc
tests/lac/sparsity_pattern_06.cc
tests/lac/sparsity_pattern_07.cc
tests/lac/sparsity_pattern_08.cc
tests/lac/sparsity_pattern_09.cc
tests/lac/sparsity_pattern_10.cc
tests/lac/sparsity_pattern_11.cc
tests/lac/sparsity_pattern_common.h
tests/lac/sparsity_tools_01.cc
tests/lac/testmatrix.h
tests/lac/trace.cc
tests/lac/tridiagonal_matrix.cc
tests/lac/tridiagonal_matrix_sym.cc
tests/lac/vector-vector.cc
tests/lac/vector_memory.cc
tests/lac/vector_norms.cc
tests/lac/vector_view.cc
tests/lapack/full_matrix_01.cc
tests/lapack/full_matrix_02.cc
tests/lapack/full_matrix_03.cc
tests/lapack/full_matrix_04.cc
tests/lapack/full_matrix_05.cc
tests/lapack/full_matrix_06.cc
tests/lapack/full_matrix_07.cc
tests/lapack/solver_cg.cc
tests/lapack/tridiagonal_ev1.cc
tests/lib/dof_tools_frame.h
tests/lib/test_grids.h
tests/matrix_free/compress_mapping.cc
tests/matrix_free/copy.cc
tests/matrix_free/create_mesh.h
tests/matrix_free/estimate_condition_number_mass.cc
tests/matrix_free/get_functions_circle.cc
tests/matrix_free/get_functions_common.h
tests/matrix_free/get_functions_float.cc
tests/matrix_free/get_functions_gl.cc
tests/matrix_free/get_functions_mappingq.cc
tests/matrix_free/get_functions_multife.cc
tests/matrix_free/get_functions_multife2.cc
tests/matrix_free/get_functions_q_hierarchical.cc
tests/matrix_free/get_functions_rect.cc
tests/matrix_free/get_functions_variants.cc
tests/matrix_free/get_values_plain.cc
tests/matrix_free/integrate_functions.cc
tests/matrix_free/integrate_functions_multife.cc
tests/matrix_free/integrate_functions_multife2.cc
tests/matrix_free/matrix_vector_03.cc
tests/matrix_free/matrix_vector_05.cc
tests/matrix_free/matrix_vector_07.cc
tests/matrix_free/matrix_vector_common.h
tests/matrix_free/matrix_vector_curl.cc
tests/matrix_free/matrix_vector_div.cc
tests/matrix_free/matrix_vector_float.cc
tests/matrix_free/matrix_vector_hp.cc
tests/matrix_free/matrix_vector_mg.cc
tests/matrix_free/matrix_vector_stokes.cc
tests/matrix_free/matrix_vector_stokes_noflux.cc
tests/matrix_free/no_index_initialize.cc
tests/matrix_free/step-37.cc
tests/matrix_free/thread_correctness.cc
tests/matrix_free/thread_correctness_hp.cc
tests/matrix_free/update_mapping_only.cc
tests/metis/metis_01.cc
tests/metis/metis_02.cc
tests/metis/metis_03.cc
tests/mpi/blockvec_01.cc
tests/mpi/coarse_grid_common.h
tests/mpi/collective_01.cc
tests/mpi/collective_02.cc
tests/mpi/collective_02_array.cc
tests/mpi/collective_03.cc
tests/mpi/collective_03_array.cc
tests/mpi/compute_mean_value.cc
tests/mpi/constraint_matrix_condense_01.cc
tests/mpi/constraint_matrix_set_zero_01.cc
tests/mpi/constraint_matrix_set_zero_02.cc
tests/mpi/constraint_matrix_trilinos_bug.cc
tests/mpi/count_dofs_per_block_01.cc
tests/mpi/count_dofs_per_block_02.cc
tests/mpi/count_dofs_per_component_01.cc
tests/mpi/crash_01.cc
tests/mpi/crash_02.cc
tests/mpi/crash_03.cc
tests/mpi/crash_04.cc
tests/mpi/distribute_sp_01.cc
tests/mpi/distribute_sp_02.cc
tests/mpi/dof_handler_number_cache.cc
tests/mpi/extract_boundary_dofs.cc
tests/mpi/extract_constant_modes_01.cc
tests/mpi/extract_locally_active_dofs.cc
tests/mpi/fe_field_function_01.cc
tests/mpi/flux_edge_01.cc
tests/mpi/ghost_01.cc
tests/mpi/ghost_02.cc
tests/mpi/ghost_03.cc
tests/mpi/integrate_difference.cc
tests/mpi/interpolate_01.cc
tests/mpi/interpolate_02.cc
tests/mpi/interpolate_03.cc
tests/mpi/interpolate_04.cc
tests/mpi/is_locally_owned.cc
tests/mpi/make_zero_boundary_values.cc
tests/mpi/map_dofs_to_support_points.cc
tests/mpi/matrix_free_01.cc
tests/mpi/matrix_free_02.cc
tests/mpi/matrix_free_03.cc
tests/mpi/matrix_free_04.cc
tests/mpi/mesh_worker_matrix_01.cc
tests/mpi/mg_01.cc
tests/mpi/mg_02.cc
tests/mpi/mg_03.cc
tests/mpi/mg_04.cc
tests/mpi/multigrid_adaptive.cc
tests/mpi/multigrid_uniform.cc
tests/mpi/no_flux_constraints.cc
tests/mpi/no_flux_constraints_02.cc
tests/mpi/no_flux_constraints_03.cc
tests/mpi/p4est_2d_coarse_01.cc
tests/mpi/p4est_2d_constraintmatrix_01.cc
tests/mpi/p4est_2d_constraintmatrix_02.cc
tests/mpi/p4est_2d_constraintmatrix_03.cc
tests/mpi/p4est_2d_constraintmatrix_04.cc
tests/mpi/p4est_2d_constraintmatrix_05.cc
tests/mpi/p4est_2d_dofhandler_01.cc
tests/mpi/p4est_2d_dofhandler_02.cc
tests/mpi/p4est_2d_dofhandler_03.cc
tests/mpi/p4est_2d_dofhandler_04.cc
tests/mpi/p4est_2d_ghost_01.cc
tests/mpi/p4est_2d_ghost_02.cc
tests/mpi/p4est_2d_refine_01.cc
tests/mpi/p4est_2d_refine_02.cc
tests/mpi/p4est_2d_refine_03.cc
tests/mpi/p4est_2d_renumber_01.cc
tests/mpi/p4est_2d_renumber_02.cc
tests/mpi/p4est_2d_simple.cc
tests/mpi/p4est_3d_constraintmatrix_01.cc
tests/mpi/p4est_3d_constraintmatrix_02.cc
tests/mpi/p4est_3d_constraintmatrix_03.cc
tests/mpi/p4est_3d_constraintmatrix_04.cc
tests/mpi/p4est_3d_ghost_01.cc
tests/mpi/p4est_3d_refine_01.cc
tests/mpi/p4est_3d_refine_02.cc
tests/mpi/p4est_3d_refine_03.cc
tests/mpi/p4est_3d_refine_04.cc
tests/mpi/p4est_data_out_01.cc
tests/mpi/p4est_get_subdomain_association.cc
tests/mpi/p4est_max_refine.cc
tests/mpi/p4est_save_01.cc
tests/mpi/p4est_save_02.cc
tests/mpi/p4est_save_03.cc
tests/mpi/parallel_block_vector_01.cc
tests/mpi/parallel_partitioner_01.cc
tests/mpi/parallel_partitioner_02.cc
tests/mpi/parallel_partitioner_03.cc
tests/mpi/parallel_partitioner_04.cc
tests/mpi/parallel_vector_01.cc
tests/mpi/parallel_vector_02.cc
tests/mpi/parallel_vector_03.cc
tests/mpi/parallel_vector_04.cc
tests/mpi/parallel_vector_05.cc
tests/mpi/parallel_vector_06.cc
tests/mpi/parallel_vector_07.cc
tests/mpi/parallel_vector_08.cc
tests/mpi/parallel_vector_09.cc
tests/mpi/parallel_vector_10.cc
tests/mpi/parallel_vector_11.cc
tests/mpi/parallel_vector_12.cc
tests/mpi/parallel_vector_13.cc
tests/mpi/parallel_vector_back_interpolate.cc
tests/mpi/parallel_vector_interpolate.cc
tests/mpi/petsc_01.cc
tests/mpi/petsc_02.cc
tests/mpi/petsc_distribute_01.cc
tests/mpi/petsc_distribute_01_block.cc
tests/mpi/petsc_distribute_01_inhomogenous.cc
tests/mpi/petsc_locally_owned_elements.cc
tests/mpi/point_to_point_pattern_01.cc
tests/mpi/refine_and_coarsen_fixed_fraction_01.cc
tests/mpi/refine_and_coarsen_fixed_fraction_02.cc
tests/mpi/refine_and_coarsen_fixed_fraction_03.cc
tests/mpi/refine_and_coarsen_fixed_fraction_04.cc
tests/mpi/refine_and_coarsen_fixed_fraction_05.cc
tests/mpi/refine_and_coarsen_fixed_fraction_06.cc
tests/mpi/refine_and_coarsen_fixed_number_01.cc
tests/mpi/refine_and_coarsen_fixed_number_02.cc
tests/mpi/refine_and_coarsen_fixed_number_03.cc
tests/mpi/refine_and_coarsen_fixed_number_04.cc
tests/mpi/refine_and_coarsen_fixed_number_05.cc
tests/mpi/refine_and_coarsen_fixed_number_06.cc
tests/mpi/refinement_listener_01.cc
tests/mpi/refinement_listener_02.cc
tests/mpi/renumber_z_order_01.cc
tests/mpi/renumber_z_order_02.cc
tests/mpi/simple_mpi_01.cc
tests/mpi/solution_transfer_01.cc
tests/mpi/step-39.cc
tests/mpi/step-40.cc
tests/mpi/step-40_direct_solver.cc
tests/mpi/step-48.cc
tests/mpi/tria_01.cc
tests/mpi/trilinos_01.cc
tests/mpi/trilinos_02.cc
tests/mpi/trilinos_bug_5609.cc
tests/mpi/trilinos_compress_bug.cc
tests/mpi/trilinos_distribute_01.cc
tests/mpi/trilinos_distribute_01_block.cc
tests/mpi/trilinos_distribute_01_inhomogenous.cc
tests/mpi/trilinos_distribute_03.cc
tests/mpi/trilinos_distribute_04.cc
tests/mpi/trilinos_ghost_01.cc
tests/mpi/trilinos_ghost_02.cc
tests/mpi/trilinos_ghost_03.cc
tests/mpi/trilinos_ghost_03_linfty.cc
tests/mpi/trilinos_ghost_05.cc
tests/mpi/trilinos_matvec_01.cc
tests/mpi/trilinos_matvec_02.cc
tests/mpi/trilinos_matvec_03.cc
tests/mpi/trilinos_sparse_matrix_01.cc
tests/mpi/trilinos_sparse_matrix_mmult_01.cc
tests/mpi/trilinos_sparse_matrix_print_01.cc
tests/mpi/trilinos_vector_ghosts_01.cc
tests/mpi/trilinos_vector_reinit.cc
tests/multigrid/boundary_01.cc
tests/multigrid/count_01.cc
tests/multigrid/cycles.cc
tests/multigrid/dof_01.cc
tests/multigrid/dof_02.cc
tests/multigrid/dof_03.cc
tests/multigrid/mg_output.cc
tests/multigrid/mg_renumbered_01.cc
tests/multigrid/mg_renumbered_02.cc
tests/multigrid/mg_renumbered_03.cc
tests/multigrid/renumbering_01.cc
tests/multigrid/renumbering_02.cc
tests/multigrid/renumbering_03.cc
tests/multigrid/smoother_block.cc
tests/multigrid/step-16.cc
tests/multigrid/step-39-02.cc
tests/multigrid/step-39-03.cc
tests/multigrid/step-39.cc
tests/multigrid/transfer_01.cc
tests/multigrid/transfer_02.cc
tests/multigrid/transfer_03.cc
tests/multigrid/transfer_block.cc
tests/multigrid/transfer_block_select.cc
tests/multigrid/transfer_compare_01.cc
tests/multigrid/transfer_prebuilt_01.cc
tests/multigrid/transfer_prebuilt_02.cc
tests/multigrid/transfer_prebuilt_03.cc
tests/multigrid/transfer_select.cc
tests/multigrid/transfer_system_01.cc
tests/multigrid/transfer_system_02.cc
tests/multigrid/transfer_system_03.cc
tests/multigrid/transfer_system_04.cc
tests/multigrid/transfer_system_05.cc
tests/multigrid/transfer_system_adaptive_01.cc
tests/multigrid/transfer_system_adaptive_02.cc
tests/multigrid/transfer_system_adaptive_03.cc
tests/multigrid/transfer_system_adaptive_04.cc
tests/multigrid/transfer_system_adaptive_05.cc
tests/multigrid/transfer_system_adaptive_06.cc
tests/multigrid/transfer_system_adaptive_07.cc
tests/multigrid/transfer_system_adaptive_08.cc
tests/multigrid/transfer_system_adaptive_09.cc
tests/petsc/01.cc
tests/petsc/02.cc
tests/petsc/04.cc
tests/petsc/05.cc
tests/petsc/06.cc
tests/petsc/07.cc
tests/petsc/08.cc
tests/petsc/09.cc
tests/petsc/10.cc
tests/petsc/11.cc
tests/petsc/12.cc
tests/petsc/13.cc
tests/petsc/17.cc
tests/petsc/18.cc
tests/petsc/19.cc
tests/petsc/20.cc
tests/petsc/21.cc
tests/petsc/22.cc
tests/petsc/23.cc
tests/petsc/24.cc
tests/petsc/25.cc
tests/petsc/26.cc
tests/petsc/27.cc
tests/petsc/28.cc
tests/petsc/29.cc
tests/petsc/30.cc
tests/petsc/31.cc
tests/petsc/32.cc
tests/petsc/33.cc
tests/petsc/34.cc
tests/petsc/35.cc
tests/petsc/36.cc
tests/petsc/37.cc
tests/petsc/38.cc
tests/petsc/39.cc
tests/petsc/40.cc
tests/petsc/41.cc
tests/petsc/42.cc
tests/petsc/43.cc
tests/petsc/44.cc
tests/petsc/45.cc
tests/petsc/46.cc
tests/petsc/47.cc
tests/petsc/48.cc
tests/petsc/49.cc
tests/petsc/50.cc
tests/petsc/51.cc
tests/petsc/52.cc
tests/petsc/55.cc
tests/petsc/56.cc
tests/petsc/57.cc
tests/petsc/58.cc
tests/petsc/59.cc
tests/petsc/60.cc
tests/petsc/61.cc
tests/petsc/62.cc
tests/petsc/63.cc
tests/petsc/64.cc
tests/petsc/65.cc
tests/petsc/66.cc
tests/petsc/67.cc
tests/petsc/68.cc
tests/petsc/69.cc
tests/petsc/70.cc
tests/petsc/block_vector_iterator_01.cc
tests/petsc/block_vector_iterator_02.cc
tests/petsc/block_vector_iterator_03.cc
tests/petsc/deal_solver_01.cc
tests/petsc/deal_solver_02.cc
tests/petsc/deal_solver_03.cc
tests/petsc/deal_solver_04.cc
tests/petsc/deal_solver_05.cc
tests/petsc/full_matrix_01.cc
tests/petsc/full_matrix_02.cc
tests/petsc/full_matrix_04.cc
tests/petsc/full_matrix_05.cc
tests/petsc/full_matrix_06.cc
tests/petsc/full_matrix_07.cc
tests/petsc/full_matrix_08.cc
tests/petsc/full_matrix_09.cc
tests/petsc/full_matrix_10.cc
tests/petsc/full_matrix_iterator_01.cc
tests/petsc/full_matrix_vector_01.cc
tests/petsc/full_matrix_vector_02.cc
tests/petsc/full_matrix_vector_03.cc
tests/petsc/full_matrix_vector_04.cc
tests/petsc/full_matrix_vector_05.cc
tests/petsc/full_matrix_vector_06.cc
tests/petsc/full_matrix_vector_07.cc
tests/petsc/parallel_sparse_matrix_01.cc
tests/petsc/petsc_mf_testmatrix.h
tests/petsc/slowness_01.cc
tests/petsc/slowness_02.cc
tests/petsc/slowness_03.cc
tests/petsc/slowness_04.cc
tests/petsc/solver_01.cc
tests/petsc/solver_02.cc
tests/petsc/solver_03.cc
tests/petsc/solver_03_mf.cc
tests/petsc/solver_03_precondition_boomeramg.cc
tests/petsc/solver_03_precondition_boomeramg_symmetric.cc
tests/petsc/solver_03_precondition_eisenstat.cc
tests/petsc/solver_03_precondition_icc.cc
tests/petsc/solver_03_precondition_ilu.cc
tests/petsc/solver_03_precondition_lu.cc
tests/petsc/solver_03_precondition_parasails.cc
tests/petsc/solver_03_precondition_sor.cc
tests/petsc/solver_03_precondition_ssor.cc
tests/petsc/solver_04.cc
tests/petsc/solver_05.cc
tests/petsc/solver_06.cc
tests/petsc/solver_07.cc
tests/petsc/solver_08.cc
tests/petsc/solver_09.cc
tests/petsc/solver_10.cc
tests/petsc/solver_11.cc
tests/petsc/solver_12.cc
tests/petsc/solver_13.cc
tests/petsc/sparse_direct_mumps.cc
tests/petsc/sparse_matrix_01.cc
tests/petsc/sparse_matrix_02.cc
tests/petsc/sparse_matrix_iterator_01.cc
tests/petsc/sparse_matrix_vector_01.cc
tests/petsc/sparse_matrix_vector_02.cc
tests/petsc/sparse_matrix_vector_03.cc
tests/petsc/sparse_matrix_vector_04.cc
tests/petsc/sparse_matrix_vector_05.cc
tests/petsc/sparse_matrix_vector_06.cc
tests/petsc/sparse_matrix_vector_07.cc
tests/petsc/vector_assign_01.cc
tests/petsc/vector_assign_02.cc
tests/petsc/vector_equality_1.cc
tests/petsc/vector_equality_2.cc
tests/petsc/vector_equality_3.cc
tests/petsc/vector_equality_4.cc
tests/petsc/vector_print.cc
tests/petsc/vector_wrap_01.cc
tests/serialization/dof_handler_01.cc
tests/serialization/parameter_handler.cc
tests/serialization/pointer_01.cc
tests/serialization/pointer_02.cc
tests/serialization/pointer_03.cc
tests/serialization/pointer_04.cc
tests/serialization/pointer_05.cc
tests/serialization/polynomial.cc
tests/serialization/polynomial_hierarchical.cc
tests/serialization/polynomial_lagrange_gl.cc
tests/serialization/polynomial_monomial.cc
tests/serialization/quadrature.cc
tests/serialization/quadrature_qanisotropic.cc
tests/serialization/quadrature_qiterated.cc
tests/serialization/serialization.h
tests/serialization/sparsity_pattern.cc
tests/serialization/symmetric_tensor.cc
tests/serialization/table_1.cc
tests/serialization/table_2.cc
tests/serialization/table_3.cc
tests/serialization/table_4.cc
tests/serialization/table_5.cc
tests/serialization/table_6.cc
tests/serialization/table_7.cc
tests/serialization/table_handler.cc
tests/serialization/tensor.cc
tests/serialization/test_01.cc
tests/serialization/triangulation_01.cc
tests/serialization/triangulation_02.cc
tests/serialization/vector.cc
tests/slepc/00.cc
tests/tests.h
tests/trilinos/01.cc
tests/trilinos/02.cc
tests/trilinos/03.cc
tests/trilinos/03a.cc
tests/trilinos/03b.cc
tests/trilinos/04.cc
tests/trilinos/05.cc
tests/trilinos/06.cc
tests/trilinos/07.cc
tests/trilinos/08.cc
tests/trilinos/09.cc
tests/trilinos/10.cc
tests/trilinos/11.cc
tests/trilinos/12.cc
tests/trilinos/13.cc
tests/trilinos/14.cc
tests/trilinos/15.cc
tests/trilinos/16.cc
tests/trilinos/17.cc
tests/trilinos/18.cc
tests/trilinos/19.cc
tests/trilinos/20.cc
tests/trilinos/21.cc
tests/trilinos/22.cc
tests/trilinos/23.cc
tests/trilinos/24.cc
tests/trilinos/25.cc
tests/trilinos/26.cc
tests/trilinos/27.cc
tests/trilinos/28.cc
tests/trilinos/29.cc
tests/trilinos/30.cc
tests/trilinos/31.cc
tests/trilinos/32.cc
tests/trilinos/33.cc
tests/trilinos/34.cc
tests/trilinos/35.cc
tests/trilinos/36.cc
tests/trilinos/37.cc
tests/trilinos/38.cc
tests/trilinos/39.cc
tests/trilinos/40.cc
tests/trilinos/41.cc
tests/trilinos/42.cc
tests/trilinos/43.cc
tests/trilinos/44.cc
tests/trilinos/45.cc
tests/trilinos/46.cc
tests/trilinos/47.cc
tests/trilinos/48.cc
tests/trilinos/49.cc
tests/trilinos/49a.cc
tests/trilinos/49b.cc
tests/trilinos/50.cc
tests/trilinos/51.cc
tests/trilinos/52.cc
tests/trilinos/53.cc
tests/trilinos/54.cc
tests/trilinos/55.cc
tests/trilinos/56.cc
tests/trilinos/57.cc
tests/trilinos/58.cc
tests/trilinos/59.cc
tests/trilinos/60.cc
tests/trilinos/61.cc
tests/trilinos/62.cc
tests/trilinos/63.cc
tests/trilinos/64.cc
tests/trilinos/65.cc
tests/trilinos/66.cc
tests/trilinos/67.cc
tests/trilinos/68.cc
tests/trilinos/69.cc
tests/trilinos/70.cc
tests/trilinos/block_sparse_matrix_add_01.cc
tests/trilinos/block_sparse_matrix_set_01.cc
tests/trilinos/block_sparse_matrix_vector_01.cc
tests/trilinos/block_sparse_matrix_vector_02.cc
tests/trilinos/block_sparse_matrix_vector_03.cc
tests/trilinos/block_sparse_matrix_vector_04.cc
tests/trilinos/block_vector_iterator_01.cc
tests/trilinos/block_vector_iterator_02.cc
tests/trilinos/block_vector_iterator_03.cc
tests/trilinos/deal_solver_01.cc
tests/trilinos/deal_solver_02.cc
tests/trilinos/deal_solver_03.cc
tests/trilinos/deal_solver_04.cc
tests/trilinos/deal_solver_05.cc
tests/trilinos/deal_solver_06.cc
tests/trilinos/mg_transfer_prebuilt_01.cc
tests/trilinos/parallel_sparse_matrix_01.cc
tests/trilinos/precondition_q_iso_q1.cc
tests/trilinos/slowness_01.cc
tests/trilinos/slowness_02.cc
tests/trilinos/slowness_03.cc
tests/trilinos/slowness_04.cc
tests/trilinos/solver_03.cc
tests/trilinos/solver_05.cc
tests/trilinos/solver_07.cc
tests/trilinos/sparse_matrix_01.cc
tests/trilinos/sparse_matrix_02.cc
tests/trilinos/sparse_matrix_03.cc
tests/trilinos/sparse_matrix_04.cc
tests/trilinos/sparse_matrix_05.cc
tests/trilinos/sparse_matrix_07.cc
tests/trilinos/sparse_matrix_07_rectangle.cc
tests/trilinos/sparse_matrix_add_01.cc
tests/trilinos/sparse_matrix_add_02.cc
tests/trilinos/sparse_matrix_copy_from_01.cc
tests/trilinos/sparse_matrix_iterator.cc
tests/trilinos/sparse_matrix_iterator_01.cc
tests/trilinos/sparse_matrix_set_01.cc
tests/trilinos/sparse_matrix_set_02.cc
tests/trilinos/sparse_matrix_vector_01.cc
tests/trilinos/sparse_matrix_vector_02.cc
tests/trilinos/sparse_matrix_vector_03.cc
tests/trilinos/sparse_matrix_vector_04.cc
tests/trilinos/sparse_matrix_vector_05.cc
tests/trilinos/sparse_matrix_vector_06.cc
tests/trilinos/sparse_matrix_vector_07.cc
tests/trilinos/sparse_matrix_vector_08.cc
tests/trilinos/sparse_matrix_vector_09.cc
tests/trilinos/sparse_matrix_vector_10.cc
tests/trilinos/sparse_matrix_vector_11.cc
tests/trilinos/sparsity_pattern_01.cc
tests/trilinos/sparsity_pattern_02.cc
tests/trilinos/sparsity_pattern_03.cc
tests/trilinos/sparsity_pattern_common.h
tests/trilinos/trilinos_64_bit_crash_01.cc
tests/trilinos/trilinos_sparse_matrix_iterator_01.cc
tests/trilinos/trilinos_sparse_matrix_iterator_02.cc
tests/trilinos/trilinos_sparse_matrix_iterator_03.cc
tests/trilinos/trilinos_sparse_matrix_iterator_04.cc
tests/trilinos/trilinos_sparse_matrix_iterator_05.cc
tests/trilinos/trilinos_sparse_matrix_iterator_06.cc
tests/trilinos/trilinos_sparse_matrix_iterator_07.cc
tests/trilinos/trilinos_sparse_matrix_iterator_08.cc
tests/trilinos/trilinos_sparse_matrix_iterator_09.cc
tests/trilinos/trilinos_sparse_matrix_iterator_10.cc
tests/trilinos/trilinos_sparse_matrix_iterator_11.cc
tests/trilinos/trilinos_sparse_matrix_iterator_12.cc
tests/trilinos/vector_assign_01.cc
tests/trilinos/vector_assign_02.cc
tests/trilinos/vector_equality_1.cc
tests/trilinos/vector_equality_2.cc
tests/trilinos/vector_equality_3.cc
tests/trilinos/vector_equality_4.cc
tests/trilinos/vector_swap_01.cc
tests/umfpack/umfpack_01.cc
tests/umfpack/umfpack_02.cc
tests/umfpack/umfpack_03.cc
tests/umfpack/umfpack_04.cc
tests/umfpack/umfpack_05.cc
tests/umfpack/umfpack_06.cc
tests/umfpack/umfpack_07.cc
tests/umfpack/umfpack_08.cc
tests/umfpack/umfpack_09.cc
tests/umfpack/umfpack_10.cc
tests/umfpack/umfpack_11.cc

index 0a5e3568940a14beb81806dc44b431037e703ed7..2a85bf623a87d2c229a2858e71e69eb59b502dc4 100644 (file)
@@ -34,7 +34,7 @@ int main ()
   deallog.depth_console(0);
 
   function_that_does_not_exist ();
-  
+
   deallog << "OK" << std::endl;
 }
 
index 63983b93b6f63137a8ee6186e379301ed753728d..d564110b2ccc3dc5bf51498b85adce50d01c539b 100644 (file)
@@ -32,7 +32,7 @@ int main ()
   deallog.depth_console(0);
 
   compile error;
-  
+
   deallog << "OK" << std::endl;
 }
 
index 96f8c885abdcd52b8de4e9ee44d2c07561d6fdf6..d2da11219485838db4b672c017861d4c2e01009a 100644 (file)
@@ -32,7 +32,7 @@ int main ()
   deallog.depth_console(0);
 
   std::abort ();
-  
+
   deallog << "OK" << std::endl;
 }
 
index 160e6d714c17628b7d6ba1db2f08ef97dd0eb739..34b5fb308e3cf34fc01f12b89b06a9c50f9f0ffd 100644 (file)
@@ -45,53 +45,53 @@ int main()
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-                                  // Create triangulation
+  // Create triangulation
   Triangulation<2> tri;
   GridGenerator::hyper_cube( tri );
   tri.refine_global( 2 );
 
-                                  // now do some sort of random, anisotropic
-                                  // refinement
+  // now do some sort of random, anisotropic
+  // refinement
   Triangulation<2>::active_cell_iterator cell = tri.begin_active(), end = tri.end();
-  for( ; cell != end; ++cell )
+  for ( ; cell != end; ++cell )
     {
       switch (rand()%4)
-       {
-                                          /// If a randomly drawn
-                                          /// number is 0 or 1 we
-                                          /// cut x or y, resp.
-         case 0:
-               cell->set_refine_flag( RefinementCase<2>::cut_axis(0) );
-               break;
-         case 1:
-               cell->set_refine_flag( RefinementCase<2>::cut_axis(1) );
-               break;
-
-         case 2:
-                                                /// If the number is 2 we
-                                                /// refine isotropically
-               cell->set_refine_flag();
-               break;
-
-         default:
-                                                /// If the number is 3 we don't refine
-               ;
-       }
+        {
+          /// If a randomly drawn
+          /// number is 0 or 1 we
+          /// cut x or y, resp.
+        case 0:
+          cell->set_refine_flag( RefinementCase<2>::cut_axis(0) );
+          break;
+        case 1:
+          cell->set_refine_flag( RefinementCase<2>::cut_axis(1) );
+          break;
+
+        case 2:
+          /// If the number is 2 we
+          /// refine isotropically
+          cell->set_refine_flag();
+          break;
+
+        default:
+          /// If the number is 3 we don't refine
+          ;
+        }
     }
-                                  /// refine the mesh
+  /// refine the mesh
   tri.execute_coarsening_and_refinement();
 
-                                  /// For each vertex find the patch of cells
-                                  /// that surrounds it
-  for( unsigned v=0; v<tri.n_vertices(); ++v )
+  /// For each vertex find the patch of cells
+  /// that surrounds it
+  for ( unsigned v=0; v<tri.n_vertices(); ++v )
     if (tri.get_used_vertices()[v] == true)
       {
-       deallog << "Vertex=" << v << std::endl;
+        deallog << "Vertex=" << v << std::endl;
 
-       const std::vector<Triangulation<2>::active_cell_iterator>
-         tmp = GridTools::find_cells_adjacent_to_vertex( tri, v );
+        const std::vector<Triangulation<2>::active_cell_iterator>
+        tmp = GridTools::find_cells_adjacent_to_vertex( tri, v );
 
-       for (unsigned int i=0; i<tmp.size(); ++i)
-         deallog << "   " << tmp[i] << std::endl;
+        for (unsigned int i=0; i<tmp.size(); ++i)
+          deallog << "   " << tmp[i] << std::endl;
       }
 }
index 3f7ea2967d41b5628cb94e4a8a29b8e00d368bef..efa7869b279fb13e07870d6764e0dc925b23f80a 100644 (file)
 
 template <typename number>
 void print_formatted (const FullMatrix<number> &A,
-                     const unsigned int        precision,
-                     const unsigned int        width)
+                      const unsigned int        precision,
+                      const unsigned int        width)
 {
   for (unsigned int i=0; i<A.m(); ++i)
     {
       for (unsigned int j=0; j<A.n(); ++j)
-       {
-         if (A(i,j) != 0)
-           deallog << std::setw(width) << std::setprecision(precision)
-                   << A(i,j);
-         else
-           deallog << std::setw(width) << std::setprecision(precision)
-                   << "~";
-         deallog << ' ';
-       };
+        {
+          if (A(i,j) != 0)
+            deallog << std::setw(width) << std::setprecision(precision)
+                    << A(i,j);
+          else
+            deallog << std::setw(width) << std::setprecision(precision)
+                    << "~";
+          deallog << ' ';
+        };
       deallog << std::endl;
     };
 }
@@ -57,53 +57,55 @@ void print_formatted (const FullMatrix<number> &A,
 
 
 template<int dim>
-void test_embedding (const FiniteElement<dim>fe)
+void test_embedding (const FiniteElement<dim> &fe)
 {
   const std::string refine_case_names[8]=
-    {"no_refinement",
-     "cut_x",
-     "cut_y",
-     "cut_xy",
-     "cut_z",
-     "cut_xz",
-     "cut_yz",
-     "cut_xyz"};
-  
+  {
+    "no_refinement",
+    "cut_x",
+    "cut_y",
+    "cut_xy",
+    "cut_z",
+    "cut_xz",
+    "cut_yz",
+    "cut_xyz"
+  };
+
   const unsigned int n = fe.dofs_per_cell;
-  
+
   std::vector<std::vector<FullMatrix<double> > > P;
   P.resize(RefinementCase<dim>::isotropic_refinement);
   for (unsigned int ref_case=RefinementCase<dim>::cut_x;
        ref_case<RefinementCase<dim>::isotropic_refinement+1;
        ++ref_case)
     for (unsigned int c=0;
-        c<GeometryInfo<dim>::n_children(RefinementCase<dim>(ref_case));
-        ++c)
+         c<GeometryInfo<dim>::n_children(RefinementCase<dim>(ref_case));
+         ++c)
       P[ref_case-1].push_back(FullMatrix<double>(n));
-  
+
   FETools::compute_embedding_matrices(fe, P);
-  
+
   for (unsigned int ref_case=RefinementCase<dim>::cut_x;
        ref_case<RefinementCase<dim>::isotropic_refinement+1;
        ++ref_case)
     for (unsigned int c=0;
-        c<GeometryInfo<dim>::n_children(RefinementCase<dim>(ref_case));
-        ++c)
+         c<GeometryInfo<dim>::n_children(RefinementCase<dim>(ref_case));
+         ++c)
       {
-       deallog << fe.get_name() << " embedding, RefinementCase<dim>:: " << refine_case_names[ref_case] << ", child " << c << std::endl;
-       print_formatted(P[ref_case-1][c], 4, 6);
+        deallog << fe.get_name() << " embedding, RefinementCase<dim>:: " << refine_case_names[ref_case] << ", child " << c << std::endl;
+        print_formatted(P[ref_case-1][c], 4, 6);
       }
 }
 
-  
+
 template<int dim>
-void test_projection (const FiniteElement<dim>fe1,
-                     const FiniteElement<dim>& fe2,
-                     std::ostream& out)
+void test_projection (const FiniteElement<dim> &fe1,
+                      const FiniteElement<dim> &fe2,
+                      std::ostream &out)
 {
   out << fe1.get_name() << " -> "
       << fe2.get_name() << std::endl;
-  
+
   const unsigned int n1 = fe1.dofs_per_cell;
   const unsigned int n2 = fe2.dofs_per_cell;
 
@@ -113,13 +115,13 @@ void test_projection (const FiniteElement<dim>& fe1,
   for (unsigned int i=0; i<n2; ++i)
     for (unsigned int j=0; j<n1; ++j)
       if (std::fabs(P(i,j)) < 1e-12)
-       P(i,j) = 0;
+        P(i,j) = 0;
   P.print_formatted(out, 3, false, 5);
 }
 
-  
+
 template<int dim>
-void test_projection (std::ostreamout)
+void test_projection (std::ostream &out)
 {
   FE_DGQ<dim> q0(0);
   FE_DGQ<dim> q1(1);
index f3ad8f2b79f25b2d89758f61b2aed7a1fae11285..8f227932487f5bb2ebbca859514613ad9c5dcad3 100644 (file)
@@ -30,6 +30,6 @@ void test ()
   hp::FECollection<dim> fe;
   for (unsigned int i=0; i<4; ++i)
     fe.push_back (FE_DGP<dim>(i));
-  
+
   test_with_hanging_nodes_random_aniso (fe);
 }
index a03eef479845c128c34b8eba847cdfe5db75975a..3c5ad3d265529e88d370f177de4d45705297f2a4 100644 (file)
@@ -30,6 +30,6 @@ void test ()
   hp::FECollection<dim> fe;
   for (unsigned int i=0; i<4; ++i)
     fe.push_back (FE_DGPMonomial<dim>(i));
-  
+
   test_with_hanging_nodes_random_aniso (fe);
 }
index d3e0a294a714f9a0cadcd2ae9397d6153d6ea450..59fe4fa9a75272c26e7ff6b148cc1d2f540d6116 100644 (file)
@@ -31,6 +31,6 @@ void test ()
   hp::FECollection<dim> fe;
   for (unsigned int i=0; i<4; ++i)
     fe.push_back (FE_DGPMonomial<dim>(i));
-  
+
   test_with_hanging_nodes_random_aniso (fe);
 }
index 95c961edf51f3b4e2ad05291b7f54beec811c34e..c23032f94aa6eb7ca2002b852fe9adc4188f5f05 100644 (file)
@@ -44,18 +44,18 @@ FE_DGQ<3> fe(1);
 QGauss<2> quadrature(3);
 MappingQ<3> mapping(2);
 FEFaceValues<3> fe_face_values1 (mapping, fe, quadrature,
-                                update_q_points | update_JxW_values |
-                                update_normal_vectors);
+                                 update_q_points | update_JxW_values |
+                                 update_normal_vectors);
 FESubfaceValues<3> fe_face_values2 (mapping, fe, quadrature,
-                                   update_q_points | update_JxW_values |
-                                   update_normal_vectors);
+                                    update_q_points | update_JxW_values |
+                                    update_normal_vectors);
 
 void check_this (Triangulation<3> &tria)
 {
 
   DoFHandler<3> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
-  
+
   DoFHandler<3>::active_cell_iterator cell = dof_handler.begin_active();
   for (; cell!=dof_handler.end(); ++cell)
     for (unsigned int face_no=0; face_no<GeometryInfo<3>::faces_per_cell;
@@ -67,8 +67,8 @@ void check_this (Triangulation<3> &tria)
              subface_no<cell->face(face_no)->number_of_children();
              ++subface_no)
           {
-           unsigned int neighbor_neighbor = cell->neighbor_face_no(face_no);
-               
+            unsigned int neighbor_neighbor = cell->neighbor_face_no(face_no);
+
             const DoFHandler<3>::active_cell_iterator neighbor_child
               = cell->neighbor_child_on_subface(face_no, subface_no);
 
@@ -89,7 +89,7 @@ void check_this (Triangulation<3> &tria)
                          fe_face_values2.normal_vector(q)).square()
                         < 1e-20,
                         ExcInternalError());
-              }            
+              }
           }
 }
 
@@ -99,34 +99,34 @@ void check_this (Triangulation<3> &tria)
 // quadrature points both on faces and neighboring subfaces match.
 void check (Triangulation<3> &tria_org)
 {
-  for (unsigned int c=0;c<tria_org.n_active_cells();++c)
+  for (unsigned int c=0; c<tria_org.n_active_cells(); ++c)
     for (unsigned int i=1; i<8; ++i)
       {
-       Triangulation<3> tria;
-       tria.copy_triangulation(tria_org);
-       Triangulation<3>::active_cell_iterator cell=tria.begin_active();
-       for (unsigned int j=0;j<c;++j)
-         ++cell;
-       cell->set_refine_flag (RefinementCase<3>(i));
-       tria.execute_coarsening_and_refinement ();
-       
-       deallog << "Initial check, cell = "<<c<<", ref_case = " <<i<< std::endl;
-       check_this (tria);
-       
-       for (unsigned int r=0; r<2; ++r)
-         {
-           tria.refine_global (1);
-           deallog << "Check " << r << ", " << tria.n_active_cells() << " active cells"<< std::endl;
-           check_this (tria);
-         }
-
-       coarsen_global (tria);
-       deallog << "Check " << 0 << ", " << tria.n_active_cells() << " active cells"<< std::endl;
-       check_this (tria);
-       
-       tria.refine_global (1);
-       deallog << "Check " << 1 << ", " << tria.n_active_cells() << " active cells"<< std::endl;
-       check_this (tria);
+        Triangulation<3> tria;
+        tria.copy_triangulation(tria_org);
+        Triangulation<3>::active_cell_iterator cell=tria.begin_active();
+        for (unsigned int j=0; j<c; ++j)
+          ++cell;
+        cell->set_refine_flag (RefinementCase<3>(i));
+        tria.execute_coarsening_and_refinement ();
+
+        deallog << "Initial check, cell = "<<c<<", ref_case = " <<i<< std::endl;
+        check_this (tria);
+
+        for (unsigned int r=0; r<2; ++r)
+          {
+            tria.refine_global (1);
+            deallog << "Check " << r << ", " << tria.n_active_cells() << " active cells"<< std::endl;
+            check_this (tria);
+          }
+
+        coarsen_global (tria);
+        deallog << "Check " << 0 << ", " << tria.n_active_cells() << " active cells"<< std::endl;
+        check_this (tria);
+
+        tria.refine_global (1);
+        deallog << "Check " << 1 << ", " << tria.n_active_cells() << " active cells"<< std::endl;
+        check_this (tria);
       }
 }
 
@@ -137,124 +137,124 @@ void check (Triangulation<3> &tria_org)
 void check2 (Triangulation<3> &orig_tria)
 {
   for (unsigned int i=0; i<orig_tria.n_active_cells(); ++i)
-  {
-    Triangulation<3> tria;
-    tria.copy_triangulation(orig_tria);
-    Triangulation<3>::cell_iterator cell = tria.begin_active(),
-                                   endc = tria.end();
-    for (unsigned int j=0; j<i; ++j)
-      ++cell;
-    cell->set_refine_flag(RefinementCase<3>::cut_z);
-    tria.execute_coarsening_and_refinement ();
-    
-    cell=tria.begin();
-    for (; cell!=endc;++cell)
-      if (cell->refinement_case()==RefinementCase<3>::cut_z)
-       {
-         cell->child(0)->set_refine_flag(RefinementCase<3>::cut_xy);
-         cell->child(1)->set_refine_flag(RefinementCase<3>::cut_xy);
-       }
-    tria.execute_coarsening_and_refinement ();
-    
-    deallog << "2 -> Initial check, cell " << i << ", " << tria.n_active_cells() << " active cells" << std::endl;
-    check_this (tria);
-    
-    for (unsigned int r=0; r<2; ++r)
-      {
-       tria.refine_global (1);
-       deallog << "2 -> Check " << r << ", " << tria.n_active_cells() << " active cells" << std::endl;
-       check_this (tria);
-       deallog << "           ... done." << std::endl;
-      }
-
-    coarsen_global (tria);
-    deallog << "Check " << 0 << ", " << tria.n_active_cells() << " active cells"<< std::endl;
-    check_this (tria);
-    
-    tria.refine_global (1);
-    deallog << "Check " << 1 << ", " << tria.n_active_cells() << " active cells"<< std::endl;
-    check_this (tria);
-  }
+    {
+      Triangulation<3> tria;
+      tria.copy_triangulation(orig_tria);
+      Triangulation<3>::cell_iterator cell = tria.begin_active(),
+                                      endc = tria.end();
+      for (unsigned int j=0; j<i; ++j)
+        ++cell;
+      cell->set_refine_flag(RefinementCase<3>::cut_z);
+      tria.execute_coarsening_and_refinement ();
+
+      cell=tria.begin();
+      for (; cell!=endc; ++cell)
+        if (cell->refinement_case()==RefinementCase<3>::cut_z)
+          {
+            cell->child(0)->set_refine_flag(RefinementCase<3>::cut_xy);
+            cell->child(1)->set_refine_flag(RefinementCase<3>::cut_xy);
+          }
+      tria.execute_coarsening_and_refinement ();
+
+      deallog << "2 -> Initial check, cell " << i << ", " << tria.n_active_cells() << " active cells" << std::endl;
+      check_this (tria);
+
+      for (unsigned int r=0; r<2; ++r)
+        {
+          tria.refine_global (1);
+          deallog << "2 -> Check " << r << ", " << tria.n_active_cells() << " active cells" << std::endl;
+          check_this (tria);
+          deallog << "           ... done." << std::endl;
+        }
+
+      coarsen_global (tria);
+      deallog << "Check " << 0 << ", " << tria.n_active_cells() << " active cells"<< std::endl;
+      check_this (tria);
+
+      tria.refine_global (1);
+      deallog << "Check " << 1 << ", " << tria.n_active_cells() << " active cells"<< std::endl;
+      check_this (tria);
+    }
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("mesh_3d_21/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<3> coarse_grid(Triangulation<3>::allow_anisotropic_smoothing);
     GridGenerator::hyper_cube (coarse_grid);
     coarse_grid.refine_global(1);
     check2 (coarse_grid);
     check (coarse_grid);
   }
-  
-   {  
-     Triangulation<3> coarse_grid;
-     create_two_cubes (coarse_grid);
-     check (coarse_grid);
-   }
-
-   {  
-     Triangulation<3> coarse_grid;
-     create_L_shape (coarse_grid);
-     check (coarse_grid);
-   }
-
-   {  
-     Triangulation<3> coarse_grid;
-     GridGenerator::hyper_ball (coarse_grid);
-     check (coarse_grid);
-   }
-
-   {
-     Triangulation<3> coarse_grid;
-     create_two_cubes_rotation (coarse_grid,1);
-     check (coarse_grid);
-   }
-
-   {
-     Triangulation<3> coarse_grid;
-     create_two_cubes_rotation (coarse_grid,2);
-     check (coarse_grid);
-   }
-
-   {
-     Triangulation<3> coarse_grid;
-     create_two_cubes_rotation (coarse_grid,3);
-     check (coarse_grid);
-   }
-
-   {
-     Triangulation<3> coarse_grid;
-     GridGenerator::moebius(coarse_grid, 5, 0, 10.0, 2.0);
-     check (coarse_grid);
-   }
-
-   {
-     Triangulation<3> coarse_grid;
-     GridGenerator::moebius(coarse_grid, 5, 1, 10.0, 2.0);
-     check (coarse_grid);
-   }
-
-   {
-     Triangulation<3> coarse_grid;
-     GridGenerator::moebius(coarse_grid, 5, 2, 10.0, 2.0);
-     check (coarse_grid);
-   }
-
-   {
-     Triangulation<3> coarse_grid;
-     GridGenerator::moebius(coarse_grid, 5, 3, 10.0, 2.0);
-     check (coarse_grid);
-   }
+
+  {
+    Triangulation<3> coarse_grid;
+    create_two_cubes (coarse_grid);
+    check (coarse_grid);
+  }
+
+  {
+    Triangulation<3> coarse_grid;
+    create_L_shape (coarse_grid);
+    check (coarse_grid);
+  }
+
+  {
+    Triangulation<3> coarse_grid;
+    GridGenerator::hyper_ball (coarse_grid);
+    check (coarse_grid);
+  }
+
+  {
+    Triangulation<3> coarse_grid;
+    create_two_cubes_rotation (coarse_grid,1);
+    check (coarse_grid);
+  }
+
+  {
+    Triangulation<3> coarse_grid;
+    create_two_cubes_rotation (coarse_grid,2);
+    check (coarse_grid);
+  }
+
+  {
+    Triangulation<3> coarse_grid;
+    create_two_cubes_rotation (coarse_grid,3);
+    check (coarse_grid);
+  }
+
+  {
+    Triangulation<3> coarse_grid;
+    GridGenerator::moebius(coarse_grid, 5, 0, 10.0, 2.0);
+    check (coarse_grid);
+  }
+
+  {
+    Triangulation<3> coarse_grid;
+    GridGenerator::moebius(coarse_grid, 5, 1, 10.0, 2.0);
+    check (coarse_grid);
+  }
+
+  {
+    Triangulation<3> coarse_grid;
+    GridGenerator::moebius(coarse_grid, 5, 2, 10.0, 2.0);
+    check (coarse_grid);
+  }
+
+  {
+    Triangulation<3> coarse_grid;
+    GridGenerator::moebius(coarse_grid, 5, 3, 10.0, 2.0);
+    check (coarse_grid);
+  }
 
 }
 
-  
-  
+
+
index 92afeb37334b29a150acc476348a2bf8c56f6d05..647e06420301f95882a45aebbe117d018432ae29 100644 (file)
 #include <iostream>
 #include <sstream>
 
-                                // flag to decide, whether
-                                // 1) a single output_file should
-                                // be generated for automated tests or
-                                // 2) multiple eps-files and output to
-                                // std::cout in order to check
-                                // changes in the library
+// flag to decide, whether
+// 1) a single output_file should
+// be generated for automated tests or
+// 2) multiple eps-files and output to
+// std::cout in order to check
+// changes in the library
 bool single_file=true;
-                                // maximum number of refinement steps and cells
-                                // to be created during refinement. whichever
-                                // is reached first terminates the loop
+// maximum number of refinement steps and cells
+// to be created during refinement. whichever
+// is reached first terminates the loop
 const unsigned int max_cycle = 200;
 const unsigned int max_cells = 50000;
 
 
 template <int dim>
-void test_isotropic (int type, std::ostreamlogfile)
+void test_isotropic (int type, std::ostream *logfile)
 {
   const RefinementCase<dim> ref_cases[7] =
-    {RefinementCase<dim>::cut_x,
-     RefinementCase<dim>(dim > 1 ? RefinementCase<2>::cut_y : RefinementCase<2>::no_refinement),
-     RefinementCase<dim>(dim > 1 ? RefinementCase<2>::cut_xy : RefinementCase<2>::no_refinement),
-     RefinementCase<dim>(dim > 2 ? RefinementCase<3>::cut_z : RefinementCase<3>::no_refinement),
-     RefinementCase<dim>(dim > 2 ? RefinementCase<3>::cut_xz : RefinementCase<3>::no_refinement),
-     RefinementCase<dim>(dim > 2 ? RefinementCase<3>::cut_yz : RefinementCase<3>::no_refinement),
-     RefinementCase<dim>(dim > 2 ? RefinementCase<3>::cut_xyz : RefinementCase<3>::no_refinement)
-    };
+  {
+    RefinementCase<dim>::cut_x,
+    RefinementCase<dim>(dim > 1 ? RefinementCase<2>::cut_y : RefinementCase<2>::no_refinement),
+    RefinementCase<dim>(dim > 1 ? RefinementCase<2>::cut_xy : RefinementCase<2>::no_refinement),
+    RefinementCase<dim>(dim > 2 ? RefinementCase<3>::cut_z : RefinementCase<3>::no_refinement),
+    RefinementCase<dim>(dim > 2 ? RefinementCase<3>::cut_xz : RefinementCase<3>::no_refinement),
+    RefinementCase<dim>(dim > 2 ? RefinementCase<3>::cut_yz : RefinementCase<3>::no_refinement),
+    RefinementCase<dim>(dim > 2 ? RefinementCase<3>::cut_xyz : RefinementCase<3>::no_refinement)
+  };
 
   Triangulation<dim> tria(Triangulation<dim>::allow_anisotropic_smoothing);
   if (type == 0)
@@ -70,54 +71,54 @@ void test_isotropic (int type, std::ostream* logfile)
     GridGenerator::hyper_ball (tria);
 
   tria.refine_global(1);
-  
+
   *logfile << "cycle: 0, number of cells: "<<tria.n_cells()
-          << std::endl;
+           << std::endl;
 
   typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
-                                                   endc = tria.end();
+                                                    endc = tria.end();
   for (unsigned int cycle=1; cycle<max_cycle+1; ++cycle)
     {
       cell = tria.begin_active();
       for (; cell!=endc; ++cell)
-       if (rand()%5==0)
-         {
-           if(rand()%2==0)
-             cell->set_refine_flag(ref_cases[rand()%
-                                             RefinementCase<dim>::isotropic_refinement]);
-         }
-       else
-         cell->set_coarsen_flag();
+        if (rand()%5==0)
+          {
+            if (rand()%2==0)
+              cell->set_refine_flag(ref_cases[rand()%
+                                              RefinementCase<dim>::isotropic_refinement]);
+          }
+        else
+          cell->set_coarsen_flag();
 
       tria.execute_coarsening_and_refinement();
 
       if (!single_file)
-       {
-                                          // graphical output
-         GridOut grid_out;
-         GridOutFlags::Eps<2> eps2(GridOutFlags::EpsFlagsBase::width,
-                                   300, .01, false, 5, false);
-         grid_out.set_flags (eps2);
-         std::ostringstream filename;
-         filename << "refine_and_coarsen_anisotropic/grid_" << type << "_" << cycle << ".eps";
-         std::ofstream outfile(filename.str().c_str());
-         grid_out.write_eps (tria, outfile);
-       }
+        {
+          // graphical output
+          GridOut grid_out;
+          GridOutFlags::Eps<2> eps2(GridOutFlags::EpsFlagsBase::width,
+                                    300, .01, false, 5, false);
+          grid_out.set_flags (eps2);
+          std::ostringstream filename;
+          filename << "refine_and_coarsen_anisotropic/grid_" << type << "_" << cycle << ".eps";
+          std::ofstream outfile(filename.str().c_str());
+          grid_out.write_eps (tria, outfile);
+        }
 
       *logfile << "cycle: "<<cycle
-              <<", number of cells: "<<tria.n_cells()
-              << std::endl;
+               <<", number of cells: "<<tria.n_cells()
+               << std::endl;
 
       if (tria.n_cells() > max_cells || cycle == max_cycle)
-       break;
+        break;
     }
 }
 
-  
+
 
 int main ()
 {
-  std::ostreamlogfile;
+  std::ostream *logfile;
 
   if (single_file)
     logfile = new std::ofstream("refine_and_coarsen_anisotropic/output");
@@ -125,19 +126,19 @@ int main ()
     logfile = &std::cout;
 
   *logfile<<std::endl
-         <<"         2D"<<std::endl
-         <<"-----------------------"<<std::endl;
-  
+          <<"         2D"<<std::endl
+          <<"-----------------------"<<std::endl;
+
   *logfile<<"HyperCube:"<<std::endl;
   test_isotropic<2> (0,logfile);
 
   *logfile<<"HyperBall:"<<std::endl;
   test_isotropic<2> (1,logfile);
-  
+
   *logfile<<std::endl;
   *logfile<<"         3D"<<std::endl
-         <<"-----------------------"<<std::endl;
-  
+          <<"-----------------------"<<std::endl;
+
   *logfile<<"HyperCube:"<<std::endl;
   test_isotropic<3> (0,logfile);
 
index 374871e122500b3085a6b77f3dc6dd96bccda332..ad62b77dbce279a707daa72ff5fc92f5f931b46b 100644 (file)
 template<int dim>
 class MyFunction : public Function<dim>
 {
-  public:
-    MyFunction () : Function<dim>() {};
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int) const
-      {
-       double ret_value=sin(p[0]*4)*cos(p[1]*4);
-       if (dim==3)
-         ret_value*=sin(5*p[2]+1);
-       return ret_value;
-      };
+public:
+  MyFunction () : Function<dim>() {};
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int) const
+  {
+    double ret_value=sin(p[0]*4)*cos(p[1]*4);
+    if (dim==3)
+      ret_value*=sin(5*p[2]+1);
+    return ret_value;
+  };
 };
 
 
@@ -68,7 +68,7 @@ void transfer(std::ostream &out)
   Vector<double> solution;
   MappingQ1<dim> mapping;
   DataOut<dim> data_out;
-  
+
   dof_handler.distribute_dofs (fe);
   solution.reinit(dof_handler.n_dofs());
 
@@ -82,9 +82,9 @@ void transfer(std::ostream &out)
 
   SolutionTransfer<dim> soltrans(dof_handler);
 
-                                  // test a): pure refinement
+  // test a): pure refinement
   typename Triangulation<dim>::active_cell_iterator cell=tria.begin_active(),
-                                                   endc=tria.end();
+                                                    endc=tria.end();
   for (; cell!=endc; ++cell)
     cell->set_refine_flag(RefinementCase<dim>::cut_x);
 
@@ -104,7 +104,7 @@ void transfer(std::ostream &out)
   deallog << "Interpolated/tranferred solution after pure refinement" << std::endl << std::endl;
   data_out.write_gnuplot (out);
 
-                                  // test b): with coarsening
+  // test b): with coarsening
   SolutionTransfer<dim> soltrans2(dof_handler);
   cell=tria.begin_active(tria.n_levels()-1);
   endc=tria.end(tria.n_levels()-1);
@@ -135,7 +135,7 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   transfer<2>(logfile);
   transfer<3>(logfile);
 }
index c2f1a17b69b9ddeb951cee33669cd4db64a184f6..453bcef29f6f61d60555cb730d6b057f737f296b 100644 (file)
 template <int dim>
 Point<dim> transform (const Point<dim> p)
 {
-  switch (dim) 
+  switch (dim)
     {
-      case 1:
-            return p;
-      case 2:
-            return Point<dim>(p(0)*(1+p(1)), p(1)*(1+p(0)));
-      case 3:
-            return Point<dim>(p(0)*(1+p(1))*(1+p(2)),
-                              p(1)*(1+p(0))*(1+p(2)),
-                              p(2)*(1+p(0))*(1+p(1)));
-      default:
-            Assert (false, ExcNotImplemented());
-            return Point<dim>();
+    case 1:
+      return p;
+    case 2:
+      return Point<dim>(p(0)*(1+p(1)), p(1)*(1+p(0)));
+    case 3:
+      return Point<dim>(p(0)*(1+p(1))*(1+p(2)),
+                        p(1)*(1+p(0))*(1+p(2)),
+                        p(2)*(1+p(0))*(1+p(1)));
+    default:
+      Assert (false, ExcNotImplemented());
+      return Point<dim>();
     };
 }
 
@@ -71,17 +71,17 @@ void check_element (const Triangulation<dim> &tr,
   DoFHandler<dim> dof_handler(tr);
   dof_handler.distribute_dofs (fe);
 
-                                   // create a mostly arbitrary
-                                   // function plus a trend on this
-                                   // grid
+  // create a mostly arbitrary
+  // function plus a trend on this
+  // grid
   Vector<double> tmp(dof_handler.n_dofs());
   for (unsigned int i=0; i<tmp.size(); ++i)
     tmp(i) = i;//(i + 13*i%17);
 
-                                   // restrict this function to the
-                                   // next coarser level and
-                                   // distribute it again to the
-                                   // higher level
+  // restrict this function to the
+  // next coarser level and
+  // distribute it again to the
+  // higher level
   Vector<double> x(tmp.size());
   Vector<double> v(fe.dofs_per_cell);
   for (typename DoFHandler<dim>::cell_iterator cell=dof_handler.begin();
@@ -89,24 +89,24 @@ void check_element (const Triangulation<dim> &tr,
     if (cell->has_children() &&
         cell->child(0)->active())
       {
-                                         // first make sure that what
-                                         // we do is reasonable. for
-                                         // this, _all_ children have
-                                         // to be active, not only
-                                         // some of them
+        // first make sure that what
+        // we do is reasonable. for
+        // this, _all_ children have
+        // to be active, not only
+        // some of them
         for (unsigned int c=0; c<cell->n_children(); ++c)
           Assert (cell->child(c)->active(), ExcInternalError());
 
-                                         // then restrict and prolongate
+        // then restrict and prolongate
         cell->get_interpolated_dof_values (tmp, v);
         cell->set_dof_values_by_interpolation (v, x);
       };
 
-                                   // now x is a function on the fine
-                                   // grid that is representable on
-                                   // the coarse grid. so another
-                                   // cycle should not alter it any
-                                   // more:
+  // now x is a function on the fine
+  // grid that is representable on
+  // the coarse grid. so another
+  // cycle should not alter it any
+  // more:
   Vector<double> x2(x.size());
   for (typename DoFHandler<dim>::cell_iterator cell=dof_handler.begin();
        cell!=dof_handler.end(); ++cell)
@@ -117,7 +117,7 @@ void check_element (const Triangulation<dim> &tr,
         cell->set_dof_values_by_interpolation (v, x2);
       };
 
-                                   // then check that this is so:
+  // then check that this is so:
   x2 -= x;
   const double relative_residual = (x2.l2_norm() / x.l2_norm());
 
@@ -130,106 +130,108 @@ void check_element (const Triangulation<dim> &tr,
 
 
 template <int dim>
-void test () 
+void test ()
 {
   const std::string ref_case_names[7]=
-    {"RefinementCase<dim>::cut_x",
-     "RefinementCase<dim>::cut_y",
-     "RefinementCase<dim>::cut_xy",
-     "RefinementCase<dim>::cut_z",
-     "RefinementCase<dim>::cut_xz",
-     "RefinementCase<dim>::cut_yz",
-     "RefinementCase<dim>::cut_xyz"};
-
-  const unsigned int n_ref_cases_for_dim[4]={0,1,3,7};
-  
-                                  // now for a list of finite
-                                  // elements, for which we want to
-                                  // test. we happily waste tons of
-                                  // memory here, but who cares...
+  {
+    "RefinementCase<dim>::cut_x",
+    "RefinementCase<dim>::cut_y",
+    "RefinementCase<dim>::cut_xy",
+    "RefinementCase<dim>::cut_z",
+    "RefinementCase<dim>::cut_xz",
+    "RefinementCase<dim>::cut_yz",
+    "RefinementCase<dim>::cut_xyz"
+  };
+
+  const unsigned int n_ref_cases_for_dim[4]= {0,1,3,7};
+
+  // now for a list of finite
+  // elements, for which we want to
+  // test. we happily waste tons of
+  // memory here, but who cares...
   const FiniteElement<dim> *fe_list[]
-    = 
-    {
-                                          // FE_DGQ
-         new FE_DGQ<dim>(0),
-         new FE_DGQ<dim>(1),
-         new FE_DGQ<dim>(2),
-         (dim<3 ? new FE_DGQ<dim>(3) : 0),
-         (dim<3 ? new FE_DGQ<dim>(4) : 0),
-             
-                                          // FE_DGP
-         new FE_DGP<dim>(0),
-         new FE_DGP<dim>(1),
-         new FE_DGP<dim>(2),
-         new FE_DGP<dim>(3),
-         
-                                           // some composed elements
-                                           // of increasing
-                                           // complexity, to check the
-                                           // logics by which the
-                                           // matrices of the composed
-                                           // elements are assembled
-                                           // from those of the base
-                                           // elements.
-          new FESystem<dim> (FE_DGQ<dim>(1), 2),
-          new FESystem<dim> (FE_DGP<dim>(1), 1,
-                             FE_DGQ<dim>(2), 2),
-          new FESystem<dim> (FE_DGP<dim>(1), 2,
-                             FE_DGQ<dim>(2), 2,
-                             FE_DGP<dim>(0), 1),
-          new FESystem<dim> (FE_DGQ<dim>(1), 2,
-                             FESystem<dim> (FE_DGQ<dim>(1), 2,
-                                            FE_DGP<dim>(2), 2,
-                                            FE_DGQ<dim>(2), 1), 2,
-                             FE_DGP<dim>(0), 1),
-          new FESystem<dim> (FE_DGP<dim>(1), 2,
-                             FESystem<dim> (FE_DGP<dim>(1), 2,
-                                            FE_DGQ<dim>(2), 2,
-                                            FESystem<dim>(FE_DGQ<dim>(0),
-                                                          3),
-                                            1), 2,
-                             FE_DGQ<dim>(0), 1),
-         
-                                          // some continuous FEs
-         new FE_Q<dim>(1),
-         new FE_Q<dim>(2),
-         new FESystem<dim> (FE_Q<dim>(1), 2),
-         new FESystem<dim> (FE_DGQ<dim>(1), 2,
-                            FESystem<dim> (FE_Q<dim>(1), 2,
-                                           FE_Q<dim>(2), 1,
-                                           FE_DGP<dim>(2), 1), 2,
-                            FE_Q<dim>(3),1)
-    };
+  =
+  {
+    // FE_DGQ
+    new FE_DGQ<dim>(0),
+    new FE_DGQ<dim>(1),
+    new FE_DGQ<dim>(2),
+    (dim<3 ? new FE_DGQ<dim>(3) : 0),
+    (dim<3 ? new FE_DGQ<dim>(4) : 0),
+
+    // FE_DGP
+    new FE_DGP<dim>(0),
+    new FE_DGP<dim>(1),
+    new FE_DGP<dim>(2),
+    new FE_DGP<dim>(3),
+
+    // some composed elements
+    // of increasing
+    // complexity, to check the
+    // logics by which the
+    // matrices of the composed
+    // elements are assembled
+    // from those of the base
+    // elements.
+    new FESystem<dim> (FE_DGQ<dim>(1), 2),
+    new FESystem<dim> (FE_DGP<dim>(1), 1,
+    FE_DGQ<dim>(2), 2),
+    new FESystem<dim> (FE_DGP<dim>(1), 2,
+    FE_DGQ<dim>(2), 2,
+    FE_DGP<dim>(0), 1),
+    new FESystem<dim> (FE_DGQ<dim>(1), 2,
+    FESystem<dim> (FE_DGQ<dim>(1), 2,
+    FE_DGP<dim>(2), 2,
+    FE_DGQ<dim>(2), 1), 2,
+    FE_DGP<dim>(0), 1),
+    new FESystem<dim> (FE_DGP<dim>(1), 2,
+    FESystem<dim> (FE_DGP<dim>(1), 2,
+    FE_DGQ<dim>(2), 2,
+    FESystem<dim>(FE_DGQ<dim>(0),
+    3),
+    1), 2,
+    FE_DGQ<dim>(0), 1),
+
+    // some continuous FEs
+    new FE_Q<dim>(1),
+    new FE_Q<dim>(2),
+    new FESystem<dim> (FE_Q<dim>(1), 2),
+    new FESystem<dim> (FE_DGQ<dim>(1), 2,
+    FESystem<dim> (FE_Q<dim>(1), 2,
+    FE_Q<dim>(2), 1,
+    FE_DGP<dim>(2), 1), 2,
+    FE_Q<dim>(3),1)
+  };
 
   for (unsigned int j=0; j<n_ref_cases_for_dim[dim]; ++j)
     {
-                                      // make a coarse triangulation as a
-                                      // hypercube. if in more than 1d, distort it
-                                      // so that it is no more an affine image of
-                                      // the hypercube, to make things more
-                                      // difficult. then refine it globally once
-                                      // and refine again in an anisotropic way
+      // make a coarse triangulation as a
+      // hypercube. if in more than 1d, distort it
+      // so that it is no more an affine image of
+      // the hypercube, to make things more
+      // difficult. then refine it globally once
+      // and refine again in an anisotropic way
       Triangulation<dim> tr;
       GridGenerator::hyper_cube(tr, 0., 1.);
       Point<dim> (*p) (Point<dim>) = &transform<dim>;
       GridTools::transform (p, tr);
       tr.refine_global (1);
       typename Triangulation<dim>::active_cell_iterator cell=tr.begin_active(),
-                                                       endc=tr.end();
+                                                        endc=tr.end();
       for (; cell!=endc; ++cell)
-       cell->set_refine_flag(RefinementCase<dim>(j+1));
+        cell->set_refine_flag(RefinementCase<dim>(j+1));
 
       tr.execute_coarsening_and_refinement();
-      
 
-  
+
+
       for (unsigned int i=0; i<sizeof(fe_list)/sizeof(fe_list[0]); ++i)
-       if (fe_list[i] != 0)
-         {
-           deallog << dim << "d, uniform grid, fe #" << i
-                   << ", " << ref_case_names[j];
-           check_element (tr, *fe_list[i]);
-         }
+        if (fe_list[i] != 0)
+          {
+            deallog << dim << "d, uniform grid, fe #" << i
+                    << ", " << ref_case_names[j];
+            check_element (tr, *fe_list[i]);
+          }
     }
 }
 
@@ -240,15 +242,15 @@ main()
 {
   std::ofstream logfile ("up_and_down/output");
   logfile.precision (PRECISION);
-  logfile.setf(std::ios::fixed);  
+  logfile.setf(std::ios::fixed);
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1>();
   test<2>();
   test<3>();
-  
+
   return 0;
 }
 
index 7599728ec0f50ae23ca366290464fd78bf8597bb..30746cd61ea90667ae03a04dc41edc4ff76b7789 100644 (file)
@@ -35,79 +35,79 @@ using namespace Polynomials;
 
 template<int dim, class POLY1, class POLY2>
 void check_poly(const Point<dim> &x,
-               const POLY1      &p,
+                const POLY1      &p,
                 const POLY2      &q)
 {
   const unsigned int n = p.n();
-  
+
   std::vector<double> values1 (n), values2 (n);
   std::vector<Tensor<1,dim> > gradients1(n), gradients2(n);
   std::vector<Tensor<2,dim> > second1(n), second2(n);
-  
+
   p.compute (x, values1, gradients1, second1);
   q.compute (x, values2, gradients2, second2);
-  
+
   for (unsigned int k=0; k<n; ++k)
     {
-                                      // Check if compute_value is ok
+      // Check if compute_value is ok
       double val1 = p.compute_value(k,x);
       if (std::fabs(val1 - values1[k]) > 5.0E-16)
-       deallog << 'P' << k << ": values differ " << val1 << " != "
-               << values1[k] << std::endl;
+        deallog << 'P' << k << ": values differ " << val1 << " != "
+                << values1[k] << std::endl;
       double val2 = q.compute_value(k,x);
       if (std::fabs(val2 - values2[k]) > 5.0E-16)
-       deallog << 'Q' << k << ": values differ " << val2 << " != "
-               << values2[k] << std::endl;
+        deallog << 'Q' << k << ": values differ " << val2 << " != "
+                << values2[k] << std::endl;
       if (std::fabs(val2 - val1) > 5.0E-16)
-       deallog << "PQ" << k << ": values differ " << val1 << " != "
-               << val2 << std::endl;
+        deallog << "PQ" << k << ": values differ " << val1 << " != "
+                << val2 << std::endl;
 
-                                       // Check if compute_grad is ok
+      // Check if compute_grad is ok
       Tensor<1,dim> grad1 = p.compute_grad(k,x);
       if (grad1 != gradients1[k])
-       deallog << 'P' << k << ": gradients differ " << grad1 << " != "
-               << gradients1[k] << std::endl;
+        deallog << 'P' << k << ": gradients differ " << grad1 << " != "
+                << gradients1[k] << std::endl;
       Tensor<1,dim> grad2 = q.compute_grad(k,x);
       if (grad2 != gradients2[k])
-       deallog << 'Q' << k << ": gradients differ " << grad1 << " != "
-               << gradients2[k] << std::endl;
+        deallog << 'Q' << k << ": gradients differ " << grad1 << " != "
+                << gradients2[k] << std::endl;
       if (grad2 != grad1)
-       deallog << "PQ" << k << ": gradients differ " << grad1 << " != "
-               << grad2 << std::endl;
-      
-                                      // Check if compute_grad_grad is ok
+        deallog << "PQ" << k << ": gradients differ " << grad1 << " != "
+                << grad2 << std::endl;
+
+      // Check if compute_grad_grad is ok
       Tensor<2,dim> grad_grad1 = p.compute_grad_grad(k,x);
       if (grad_grad1 != second1[k])
-       deallog << 'P' << k << ": second derivatives differ " << grad_grad1 << " != "
-               << second1[k] << std::endl;
+        deallog << 'P' << k << ": second derivatives differ " << grad_grad1 << " != "
+                << second1[k] << std::endl;
       Tensor<2,dim> grad_grad2 = q.compute_grad_grad(k,x);
       if (grad_grad2 != second2[k])
-       deallog << 'Q' << k << ": second derivatives differ " << grad_grad2 << " != "
-               << second2[k] << std::endl;
+        deallog << 'Q' << k << ": second derivatives differ " << grad_grad2 << " != "
+                << second2[k] << std::endl;
       if (grad_grad2 != grad_grad1)
-       deallog << "PQ" << k << ": second derivatives differ " << grad_grad1 << " != "
-               << grad_grad2 << std::endl;
-
-
-                                       // finally output values,
-                                       // gradients, etc, to make sure
-                                       // that they are not only
-                                       // consistent, but also
-                                       // correct. Multiply them
-                                       // somewhat to make them
-                                       // significant despite our
-                                       // two-post-dot-digits limit
+        deallog << "PQ" << k << ": second derivatives differ " << grad_grad1 << " != "
+                << grad_grad2 << std::endl;
+
+
+      // finally output values,
+      // gradients, etc, to make sure
+      // that they are not only
+      // consistent, but also
+      // correct. Multiply them
+      // somewhat to make them
+      // significant despite our
+      // two-post-dot-digits limit
       values1[k] *= std::pow(10., dim);
       gradients1[k] *= std::pow(10., dim);
-      
+
       deallog << 'P' << k << "\t= " << values1[k]
-             << "\tgradient\t";
-      for (unsigned int d=0;d<dim;++d)
-       deallog << gradients1[k][d] << '\t';
+              << "\tgradient\t";
+      for (unsigned int d=0; d<dim; ++d)
+        deallog << gradients1[k][d] << '\t';
       deallog << "\t2nd\t";
-      for (unsigned int d1=0;d1<dim;++d1)
-       for (unsigned int d2=0;d2<dim;++d2)
-         deallog << second1[k][d1][d2] << '\t';
+      for (unsigned int d1=0; d1<dim; ++d1)
+        for (unsigned int d2=0; d2<dim; ++d2)
+          deallog << second1[k][d1][d2] << '\t';
       deallog << std::endl;
     }
   deallog << std::endl;
@@ -116,20 +116,20 @@ void check_poly(const Point<dim> &x,
 
 template <int dim>
 void
-check_tensor (const std::vector<Polynomial<double> >v,
-             const Point<dim>& x)
+check_tensor (const std::vector<Polynomial<double> > &v,
+              const Point<dim> &x)
 {
   TensorProductPolynomials<dim> p(v);
 
   std::vector<std::vector<Polynomial<double> > > pols (dim, v);
   AnisotropicPolynomials<dim> q(pols);
-  
+
   check_poly (x, p, q);
 }
 
 
 void
-check_dimensions (const std::vector<Polynomial<double> >p)
+check_dimensions (const std::vector<Polynomial<double> > &p)
 {
   deallog.push("1d");
   check_tensor(p, Point<1>(.5));
@@ -154,16 +154,16 @@ int main()
 
   deallog.push("Lagrange");
   std::vector<Polynomial<double> > p;
-  for (unsigned int i=0;i<3;++i)
+  for (unsigned int i=0; i<3; ++i)
     p.push_back (LagrangeEquidistant(3, i));
 
   check_dimensions(p);
 
   deallog.pop();
   deallog.push("Legendre");
-  
+
   p.clear ();
-  for (unsigned int i=0;i<3;++i)
+  for (unsigned int i=0; i<3; ++i)
     p.push_back (Legendre(i));
 
   check_dimensions(p);
@@ -172,7 +172,7 @@ int main()
   deallog.push("Hierarchical");
 
   p.clear ();
-  for (unsigned int i=0;i<3;++i)
+  for (unsigned int i=0; i<3; ++i)
     p.push_back (Hierarchical(i));
 
   check_dimensions(p);
index 1adbf72a85065df9ddaa91f68e85a5dfece4bb83..500d013455f15209e127dd1e43d981372ccf5106 100644 (file)
@@ -58,20 +58,22 @@ void print_2d (const AnisotropicPolynomials<2> &aniso)
 
 
 template <class Pol>
-void check_2d () 
+void check_2d ()
 {
-                                   // two checks with higher degree in
-                                   // x or y direction
+  // two checks with higher degree in
+  // x or y direction
   {
     PolVector pols[2] = { Pol::generate_complete_basis (3),
-                          Pol::generate_complete_basis (1) };
+                          Pol::generate_complete_basis (1)
+                        };
     std::vector<PolVector> p(&pols[0], &pols[2]);
     AnisotropicPolynomials<2> aniso (p);
     print_2d (aniso);
   }
   {
     PolVector pols[2] = { Pol::generate_complete_basis (2),
-                          Pol::generate_complete_basis (3) };
+                          Pol::generate_complete_basis (3)
+                        };
     std::vector<PolVector> p(&pols[0], &pols[2]);
     AnisotropicPolynomials<2> aniso (p);
 
@@ -110,14 +112,15 @@ void print_3d (const AnisotropicPolynomials<3> &aniso)
 
 
 template <class Pol>
-void check_3d () 
+void check_3d ()
 {
-                                   // three checks with higher degree
-                                   // in x, y or z direction
+  // three checks with higher degree
+  // in x, y or z direction
   {
     PolVector pols[3] = { Pol::generate_complete_basis (3),
                           Pol::generate_complete_basis (1),
-                          Pol::generate_complete_basis (1) };
+                          Pol::generate_complete_basis (1)
+                        };
     std::vector<PolVector> p(&pols[0], &pols[3]);
     AnisotropicPolynomials<3> aniso (p);
     print_3d (aniso);
@@ -125,7 +128,8 @@ void check_3d ()
   {
     PolVector pols[3] = { Pol::generate_complete_basis (1),
                           Pol::generate_complete_basis (3),
-                          Pol::generate_complete_basis (1) };
+                          Pol::generate_complete_basis (1)
+                        };
     std::vector<PolVector> p(&pols[0], &pols[3]);
     AnisotropicPolynomials<3> aniso (p);
     print_3d (aniso);
@@ -133,7 +137,8 @@ void check_3d ()
   {
     PolVector pols[3] = { Pol::generate_complete_basis (1),
                           Pol::generate_complete_basis (2),
-                          Pol::generate_complete_basis (3) };
+                          Pol::generate_complete_basis (3)
+                        };
     std::vector<PolVector> p(&pols[0], &pols[3]);
     AnisotropicPolynomials<3> aniso (p);
     print_3d (aniso);
@@ -143,7 +148,7 @@ void check_3d ()
 
 
 template <class Pol>
-void check () 
+void check ()
 {
   check_2d<Pol> ();
   check_3d<Pol> ();
index 6b3f1b71533281c96ffbb849372cb230d94441be..af85ba30ddc2025610d80cacc360f38e96aafebe 100644 (file)
 template <int dim>
 class AutoSinExp: public AutoDerivativeFunction<dim>
 {
-  public:
-    AutoSinExp();
-    virtual ~AutoSinExp() {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
-
-                                    /**
-                                     * n_components=2. First
-                                     * component=0, second component
-                                     * filled by @p{value} function.
-                                     */
-    virtual void vector_value (const Point<dim>   &p,
-                              Vector<double>     &values) const;
+public:
+  AutoSinExp();
+  virtual ~AutoSinExp() {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
+
+  /**
+   * n_components=2. First
+   * component=0, second component
+   * filled by @p{value} function.
+   */
+  virtual void vector_value (const Point<dim>   &p,
+                             Vector<double>     &values) const;
 };
 
 
 
 template <int dim>
 AutoSinExp<dim>::AutoSinExp():
-               AutoDerivativeFunction<dim>(1e-6, 2)
+  AutoDerivativeFunction<dim>(1e-6, 2)
 {}
 
 
 
 template <int dim>
 double AutoSinExp<dim>::value (const Point<dim> &p,
-                              const unsigned int) const
+                               const unsigned int) const
 {
   return std::sin(2*p(0))*std::exp(3*p(1));
 }
@@ -69,7 +69,7 @@ double AutoSinExp<dim>::value (const Point<dim> &p,
 
 template <int dim>
 void AutoSinExp<dim>::vector_value (const Point<dim> &p,
-                                   Vector<double>     &values) const
+                                    Vector<double>     &values) const
 {
   Assert(values.size()==this->n_components,
          ExcDimensionMismatch(values.size(), this->n_components));
@@ -82,15 +82,15 @@ void AutoSinExp<dim>::vector_value (const Point<dim> &p,
 template <int dim>
 class ExactSinExp: public AutoSinExp<dim>
 {
-  public:
-    ExactSinExp() {}
-    ~ExactSinExp() {}
-    
-    virtual Tensor<1,dim> gradient (const Point<dim>   &p,
-                                   const unsigned int  component = 0) const;    
-
-    virtual void          vector_gradient (const Point<dim>            &p,
-                                          typename std::vector<Tensor<1,dim> > &gradients) const;
+public:
+  ExactSinExp() {}
+  ~ExactSinExp() {}
+
+  virtual Tensor<1,dim> gradient (const Point<dim>   &p,
+                                  const unsigned int  component = 0) const;
+
+  virtual void          vector_gradient (const Point<dim>            &p,
+                                         typename std::vector<Tensor<1,dim> > &gradients) const;
 };
 
 
@@ -98,7 +98,7 @@ class ExactSinExp: public AutoSinExp<dim>
 
 template <int dim>
 Tensor<1,dim> ExactSinExp<dim>::gradient (const Point<dim> &p,
-                                        const unsigned int) const
+                                          const unsigned int) const
 {
   Tensor<1,dim> grad;
   grad[0]=2*std::cos(2*p(0))*std::exp(3*p(1));
@@ -109,11 +109,11 @@ Tensor<1,dim> ExactSinExp<dim>::gradient (const Point<dim> &p,
 
 template <int dim>
 void ExactSinExp<dim>::vector_gradient (const Point<dim>       &p,
-                                      typename std::vector<Tensor<1,dim> > &gradients) const
+                                        typename std::vector<Tensor<1,dim> > &gradients) const
 {
   Assert(gradients.size()==this->n_components,
          ExcDimensionMismatch(gradients.size(), this->n_components));
-  
+
   gradients[0].clear();
   gradients[1]=gradient(p);
 }
@@ -132,7 +132,7 @@ int main()
   ExactSinExp<dim> exact_function;
   Point<dim> p(0.23, 0.1);
   std::vector<Point<dim> > ps(1, p);
-  
+
   Tensor<1,dim> u_grad=exact_function.gradient(p);
 
 
@@ -144,57 +144,57 @@ int main()
       auto_function.set_formula(formula);
       deallog << "order=" << order << ",  formula=" << formula << std::endl;
       ConvergenceTable history;
-      
+
       unsigned int factor=1;
       for (unsigned int i=0; i<6; ++i, factor*=2)
-       {
-         history.add_value("f", factor);
-         history.omit_column_from_convergence_rate_evaluation("f");
-
-         auto_function.set_h(h_base/factor);
-
-                                          // Test of gradient function
-         Tensor<1,dim> a_grad=auto_function.gradient(p);
-         a_grad-=u_grad;
-         double value=std::sqrt(a_grad*a_grad);
-         history.add_value("grad", value);
-         history.set_scientific("grad", true);
-         history.set_precision("grad", 2);
-
-                                          // Test of gradient_list
-                                          // function
-         std::vector<Tensor<1,dim> > a_grads(1);
-         auto_function.gradient_list(ps, a_grads);
-         a_grads[0]-=u_grad;
-         value=std::sqrt(a_grads[0]*a_grads[0]);
-         history.add_value("grads[0]", value);
-         history.set_scientific("grads[0]", true);
-         history.set_precision("grads[0]", 2);
-         
-                                          // Test of vector_gradient
-                                          // function
-         std::vector<Tensor<1,dim> > a_vgrad(2);
-         auto_function.vector_gradient(p, a_vgrad);
-         a_vgrad[1]-=u_grad;
-         value=std::sqrt(a_vgrad[1]*a_vgrad[1]);
-         history.add_value("vgrad[1]", value);
-         history.set_scientific("vgrad[1]", true);
-         history.set_precision("vgrad[1]", 2);
-         
-                                          // Test of
-                                          // vector_gradient_list
-                                          // function
-         std::vector<std::vector<Tensor<1,dim> > >
-           a_vgrads(1, std::vector<Tensor<1,dim> > (2));
-         auto_function.vector_gradient_list(ps, a_vgrads);
-         a_vgrads[0][1]-=u_grad;
-         value=std::sqrt(a_vgrads[0][1]*a_vgrads[0][1]);
-         history.add_value("vgrads[1]", value);
-         history.set_scientific("vgrads[1]", true);
-         history.set_precision("vgrads[1]", 2);
-       }
+        {
+          history.add_value("f", factor);
+          history.omit_column_from_convergence_rate_evaluation("f");
+
+          auto_function.set_h(h_base/factor);
+
+          // Test of gradient function
+          Tensor<1,dim> a_grad=auto_function.gradient(p);
+          a_grad-=u_grad;
+          double value=std::sqrt(a_grad*a_grad);
+          history.add_value("grad", value);
+          history.set_scientific("grad", true);
+          history.set_precision("grad", 2);
+
+          // Test of gradient_list
+          // function
+          std::vector<Tensor<1,dim> > a_grads(1);
+          auto_function.gradient_list(ps, a_grads);
+          a_grads[0]-=u_grad;
+          value=std::sqrt(a_grads[0]*a_grads[0]);
+          history.add_value("grads[0]", value);
+          history.set_scientific("grads[0]", true);
+          history.set_precision("grads[0]", 2);
+
+          // Test of vector_gradient
+          // function
+          std::vector<Tensor<1,dim> > a_vgrad(2);
+          auto_function.vector_gradient(p, a_vgrad);
+          a_vgrad[1]-=u_grad;
+          value=std::sqrt(a_vgrad[1]*a_vgrad[1]);
+          history.add_value("vgrad[1]", value);
+          history.set_scientific("vgrad[1]", true);
+          history.set_precision("vgrad[1]", 2);
+
+          // Test of
+          // vector_gradient_list
+          // function
+          std::vector<std::vector<Tensor<1,dim> > >
+          a_vgrads(1, std::vector<Tensor<1,dim> > (2));
+          auto_function.vector_gradient_list(ps, a_vgrads);
+          a_vgrads[0][1]-=u_grad;
+          value=std::sqrt(a_vgrads[0][1]*a_vgrads[0][1]);
+          history.add_value("vgrads[1]", value);
+          history.set_scientific("vgrads[1]", true);
+          history.set_precision("vgrads[1]", 2);
+        }
       history.evaluate_all_convergence_rates(
-       ConvergenceTable::reduction_rate);
+        ConvergenceTable::reduction_rate);
       history.write_text(deallog.get_file_stream());
     }
 }
index ea56fa9c4c7e1ba03eaba597fd4802301ab5c01b..6e12f63f375fca97b33e47d3481ae9bf423ce6f5 100644 (file)
@@ -32,7 +32,7 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   ConditionalOStream o(logfile, true);
   o << "Yes" << std::endl;
   deallog << o.is_active() << std::endl;
index f95557e0cf01e01c57ce04693c1cce9f50ae9d09..a736b3bde68d092c347eb25bd615ac5a2878cd52 100644 (file)
@@ -40,17 +40,17 @@ int main ()
   ConvergenceTable table_2;
 
   for (unsigned int i=1; i<=4; ++i)
-  {
-    table.add_value("error", 3.*i);
-    table.add_value("key", i);
-    table_2.add_value("error", std::pow(1./sqrt(i),4.));
-    table_2.add_value("key", i);
-  }
+    {
+      table.add_value("error", 3.*i);
+      table.add_value("key", i);
+      table_2.add_value("error", std::pow(1./sqrt(i),4.));
+      table_2.add_value("key", i);
+    }
 
   table.evaluate_convergence_rates("error", "key", ConvergenceTable::reduction_rate);
   table_2.evaluate_convergence_rates("error", "key", ConvergenceTable::reduction_rate_log2);
 
-                                 // output
+  // output
   table.write_text(deallog.get_file_stream());
   table_2.write_text(deallog.get_file_stream());
 }
index b91314f9544fbf78cde6a48da4b934898c6d6524..f2dad06233a86c6d27c407b0ef18e5b00610a768 100644 (file)
@@ -26,7 +26,7 @@
 #include <fstream>
 #include <string>
 
-// test the method evaluate_all_convergence_rates with argument reference_column_key, 
+// test the method evaluate_all_convergence_rates with argument reference_column_key,
 
 int main ()
 {
@@ -38,16 +38,16 @@ int main ()
   ConvergenceTable table;
 
   for (unsigned int i=1; i<=4; ++i)
-  {
-    table.add_value("error", 1./sqrt(i));
-    table.add_value("error2", std::pow(1./sqrt(i),2.));
-    table.add_value("error3", std::pow(1./sqrt(i),3.));
-    table.add_value("error4", std::pow(1./sqrt(i),4.));
-    table.add_value("key", i);
-  }
+    {
+      table.add_value("error", 1./sqrt(i));
+      table.add_value("error2", std::pow(1./sqrt(i),2.));
+      table.add_value("error3", std::pow(1./sqrt(i),3.));
+      table.add_value("error4", std::pow(1./sqrt(i),4.));
+      table.add_value("key", i);
+    }
   table.omit_column_from_convergence_rate_evaluation ( "key" );
   table.evaluate_all_convergence_rates("key", ConvergenceTable::reduction_rate_log2);
 
-                                 // output
+  // output
   table.write_text(deallog.get_file_stream());
 }
index add19af9a4c9a4fb2f6ff9a033db1fa2622aa3c4..71a775928a1fbb757a371c9b83d90e0fc0730f81 100644 (file)
@@ -40,16 +40,16 @@ int main ()
   table.set_auto_fill_mode (true);
 
   for (unsigned int i=1; i<=4; ++i)
-  {
-    table.add_value("error", 1./sqrt(i));
-    table.add_value("error2", std::pow(1./sqrt(i),2.));
-    table.add_value("error3", std::pow(1./sqrt(i),3.));
-    table.add_value("error4", std::pow(1./sqrt(i),4.));
-    table.add_value("key", i);
-  }
+    {
+      table.add_value("error", 1./sqrt(i));
+      table.add_value("error2", std::pow(1./sqrt(i),2.));
+      table.add_value("error3", std::pow(1./sqrt(i),3.));
+      table.add_value("error4", std::pow(1./sqrt(i),4.));
+      table.add_value("key", i);
+    }
   table.omit_column_from_convergence_rate_evaluation ( "key" );
   table.evaluate_all_convergence_rates("key", ConvergenceTable::reduction_rate_log2);
 
-                                 // output
+  // output
   table.write_text(deallog.get_file_stream());
 }
index 232e308d43a8cc2442410ea85b4c679e6d51a8f7..31666ca79183dd74aecebaae2e1ba004a3e19e79 100644 (file)
@@ -58,7 +58,7 @@ int main ()
   table_1.add_value("n_cells", 96);
   table_1.add_value("error", 2.274e-06);
   table_1.add_value("n_cells", 128);
-  table_1.add_value("error", 9.597e-07); 
+  table_1.add_value("error", 9.597e-07);
   table_1.set_scientific("error", true);
   table_1.evaluate_convergence_rates("error", "n_cells", ConvergenceTable::reduction_rate);
   table_1.evaluate_convergence_rates("error", "n_cells", ConvergenceTable::reduction_rate_log2, 1);
index 2fa3687fd3d81396bcb51b193a9b49f5a6b70a5a..e31b508051ea6f1e94ae70dfbd7435e582bc9b70 100644 (file)
 //TODO: Several functions are commented out since implementations are missing
 
 #define WRITE(type) { out << "Writing " # type " dimensions " \
-<< dim << ',' << spacedim << std::endl; \
-DataOutBase::write_ ## type (patches, names, vectors, type ## flags, out); }
+                            << dim << ',' << spacedim << std::endl; \
+  DataOutBase::write_ ## type (patches, names, vectors, type ## flags, out); }
 
 template <int dim, int spacedim>
 void
-write_patches(const std::vector<DataOutBase::Patch<dim,spacedim> >patches,
-             std::ostream& out)
+write_patches(const std::vector<DataOutBase::Patch<dim,spacedim> > &patches,
+              std::ostream &out)
 {
   std::vector<std::string> names(2);
   names[0] = std::string("first name");
@@ -67,9 +67,9 @@ write_patches(const std::vector<DataOutBase::Patch<dim,spacedim> >& patches,
 template<int dim>
 struct PatchInfo
 {
-    static double vertices[GeometryInfo<dim>::vertices_per_cell][3];
-    static double offsets[GeometryInfo<dim>::vertices_per_cell][3];
-    static int neighbors[GeometryInfo<dim>::vertices_per_cell][GeometryInfo<dim>::faces_per_cell];
+  static double vertices[GeometryInfo<dim>::vertices_per_cell][3];
+  static double offsets[GeometryInfo<dim>::vertices_per_cell][3];
+  static int neighbors[GeometryInfo<dim>::vertices_per_cell][GeometryInfo<dim>::faces_per_cell];
 };
 
 
@@ -164,43 +164,43 @@ double PatchInfo<3>::offsets[8][3]
 
 template <int dim, int spacedim>
 void
-create_patches(std::vector<DataOutBase::Patch<dim,spacedim> >patches)
+create_patches(std::vector<DataOutBase::Patch<dim,spacedim> > &patches)
 {
   const unsigned int ncells = GeometryInfo<dim>::vertices_per_cell;
   const unsigned int nsub = 3;
 
   patches.resize(ncells);
 
-  for (unsigned int c = 0; c < ncells;++c)
+  for (unsigned int c = 0; c < ncells; ++c)
     {
-      DataOutBase::Patch<dim, spacedim>p = patches[c];
+      DataOutBase::Patch<dim, spacedim> &p = patches[c];
       p.patch_index = c;
       p.n_subdivisions = nsub;
 
-      for (unsigned int i=0;i<ncells;++i)
-       for (unsigned int j=0;j<spacedim;++j)
-         p.vertices[i](j) = PatchInfo<dim>::vertices[i][j]
-                            + PatchInfo<dim>::offsets[c][j];
+      for (unsigned int i=0; i<ncells; ++i)
+        for (unsigned int j=0; j<spacedim; ++j)
+          p.vertices[i](j) = PatchInfo<dim>::vertices[i][j]
+                             + PatchInfo<dim>::offsets[c][j];
 
-      for (unsigned int i=0;i<GeometryInfo<dim>::faces_per_cell;++i)
-       p.neighbors[i] = (unsigned int) PatchInfo<dim>::neighbors[c][i];
+      for (unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
+        p.neighbors[i] = (unsigned int) PatchInfo<dim>::neighbors[c][i];
 
       unsigned int ndata = 1;
-      for (unsigned int i=0;i<dim;++i)
-       ndata *= nsub+1;
+      for (unsigned int i=0; i<dim; ++i)
+        ndata *= nsub+1;
 
       p.data.reinit(2,ndata);
-      for (unsigned int i=0;i<ndata;++i)
-       {
-         p.data(0,i) = i;
-         p.data(1,i) = -(float) i;
-       }
+      for (unsigned int i=0; i<ndata; ++i)
+        {
+          p.data(0,i) = i;
+          p.data(1,i) = -(float) i;
+        }
     }
 }
 
 
 template<int dim, int spacedim>
-void test(std::ostreamout)
+void test(std::ostream &out)
 {
   std::vector<DataOutBase::Patch<dim, spacedim> > patches;
   create_patches(patches);
index 7b1538ef67d1a64642f8a2928bc6afc292193c4e..59e4c20d05a160f160f2f868069b0efd5639c1c2 100644 (file)
 
 template <int dim, int spacedim>
 void check(DataOutBase::DXFlags flags,
-          std::ostream& out)
+           std::ostream &out)
 {
   const unsigned int np = 4;
-  
+
   std::vector<DataOutBase::Patch<dim, spacedim> > patches(np);
-  
+
   create_patches(patches);
-  
+
   std::vector<std::string> names(5);
   names[0] = "x1";
   names[1] = "x2";
@@ -59,14 +59,14 @@ void check(DataOutBase::DXFlags flags,
 
 template <int dim>
 void check_cont(unsigned int ncells,
-               unsigned int nsub,
-               DataOutBase::DXFlags flags,
-               std::ostream& out)
+                unsigned int nsub,
+                DataOutBase::DXFlags flags,
+                std::ostream &out)
 {
   std::vector<DataOutBase::Patch<dim, dim> > patches;
-  
+
   create_continuous_patches(patches, ncells, nsub);
-  
+
   std::vector<std::string> names(1);
   names[0] = "CutOff";
   std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > vectors;
@@ -75,85 +75,91 @@ void check_cont(unsigned int ncells,
 
 
 template<int dim, int spacedim>
-void check_all(std::ostreamlog)
+void check_all(std::ostream &log)
 {
 #if SEPARATE_FILES == 0
-  std::ostreamout = log;
+  std::ostream &out = log;
 #endif
-  
+
   char name[100];
-  const charformat = "data_out_base_dx/%d%d%s.dx";
+  const char *format = "data_out_base_dx/%d%d%s.dx";
   DataOutBase::DXFlags flags(false, false, false, false);
-  if (dim == 2 && spacedim == 2) {
-    sprintf(name, format, dim, spacedim, "ffffcont");
+  if (dim == 2 && spacedim == 2)
+    {
+      sprintf(name, format, dim, spacedim, "ffffcont");
 #if SEPARATE_FILES==1
-    std::ofstream out(name);
+      std::ofstream out(name);
 #else
-       out << "==============================\n"
-           << name
-           << "\n==============================\n";
+      out << "==============================\n"
+          << name
+          << "\n==============================\n";
 #endif
-    check_cont<dim>(4,4,flags, out);
-  }
-  if (true) {
-    sprintf(name, format, dim, spacedim, "ffff");
+      check_cont<dim>(4,4,flags, out);
+    }
+  if (true)
+    {
+      sprintf(name, format, dim, spacedim, "ffff");
 #if SEPARATE_FILES==1
-    std::ofstream out(name);
+      std::ofstream out(name);
 #else
-       out << "==============================\n"
-           << name
-           << "\n==============================\n";
+      out << "==============================\n"
+          << name
+          << "\n==============================\n";
 #endif
-    check<dim,spacedim>(flags, out);
-  }
+      check<dim,spacedim>(flags, out);
+    }
   flags.int_binary = true;
-  if (true) {
-    sprintf(name, format, dim, spacedim, "tfff");
+  if (true)
+    {
+      sprintf(name, format, dim, spacedim, "tfff");
 #if SEPARATE_FILES==1
-    std::ofstream out(name);
+      std::ofstream out(name);
 #else
-       out << "==============================\n"
-           << name
-           << "\n==============================\n";
+      out << "==============================\n"
+          << name
+          << "\n==============================\n";
 #endif
-    check<dim,spacedim>(flags, out);
-  }
+      check<dim,spacedim>(flags, out);
+    }
   flags.coordinates_binary = true;
-  if (true) {
-    sprintf(name, format, dim, spacedim, "ttff");
+  if (true)
+    {
+      sprintf(name, format, dim, spacedim, "ttff");
 #if SEPARATE_FILES==1
-    std::ofstream out(name);
+      std::ofstream out(name);
 #else
-       out << "==============================\n"
-           << name
-           << "\n==============================\n";
+      out << "==============================\n"
+          << name
+          << "\n==============================\n";
 #endif
-    check<dim,spacedim>(flags, out);
-  }
+      check<dim,spacedim>(flags, out);
+    }
   flags.data_binary = true;
-  if (true) {
-    sprintf(name, format, dim, spacedim, "tttf");
+  if (true)
+    {
+      sprintf(name, format, dim, spacedim, "tttf");
 #if SEPARATE_FILES==1
-    std::ofstream out(name);
+      std::ofstream out(name);
 #else
-       out << "==============================\n"
-           << name
-           << "\n==============================\n";
+      out << "==============================\n"
+          << name
+          << "\n==============================\n";
 #endif
-    check<dim,spacedim>(flags, out);
-  }
+      check<dim,spacedim>(flags, out);
+    }
   flags.data_double = true;
-  if (true) {
-    sprintf(name, format, dim, spacedim, "tttf");
+  if (true)
+    {
+      sprintf(name, format, dim, spacedim, "tttf");
 #if SEPARATE_FILES==1
-    std::ofstream out(name);
+      std::ofstream out(name);
 #else
-       out << "==============================\n"
-           << name
-           << "\n==============================\n";
+      out << "==============================\n"
+          << name
+          << "\n==============================\n";
 #endif
-    check<dim,spacedim>(flags, out);
-  }
+      check<dim,spacedim>(flags, out);
+    }
 }
 
 int main()
@@ -163,5 +169,5 @@ int main()
   check_all<1,2>(logfile);
   check_all<2,2>(logfile);
   check_all<2,3>(logfile);
-  check_all<3,3>(logfile);  
+  check_all<3,3>(logfile);
 }
index 6590d10f038e992fd31992e4bb69b43e30fa52fe..c993d53a9ec6d6c69427e4d7f3e26ee896e54cd5 100644 (file)
 
 template <int dim, int spacedim>
 void check(DataOutBase::EpsFlags flags,
-          std::ostream& out)
+           std::ostream &out)
 {
   const unsigned int np = 4;
-  
+
   std::vector<DataOutBase::Patch<dim, spacedim> > patches(np);
-  
+
   create_patches(patches);
-  
+
   std::vector<std::string> names(5);
   names[0] = "x1";
   names[1] = "x2";
@@ -57,14 +57,14 @@ void check(DataOutBase::EpsFlags flags,
 
 template <int dim>
 void check_cont(unsigned int ncells,
-               unsigned int nsub,
-               DataOutBase::EpsFlags flags,
-               std::ostream& out)
+                unsigned int nsub,
+                DataOutBase::EpsFlags flags,
+                std::ostream &out)
 {
   std::vector<DataOutBase::Patch<dim, dim> > patches;
-  
+
   create_continuous_patches(patches, ncells, nsub);
-  
+
   std::vector<std::string> names(1);
   names[0] = "CutOff";
   std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > vectors;
@@ -73,14 +73,14 @@ void check_cont(unsigned int ncells,
 
 
 template<int dim, int spacedim>
-void check_all(std::ostreamlog)
+void check_all(std::ostream &log)
 {
 #if SEPARATE_FILES == 0
-  std::ostreamout = log;
+  std::ostream &out = log;
 #endif
-  
+
   char name[100];
-  const charformat = "data_out_base_eps/%d%d%d%s.eps";
+  const char *format = "data_out_base_eps/%d%d%d%s.eps";
   DataOutBase::EpsFlags flags;
 
   if (true)
@@ -90,24 +90,24 @@ void check_all(std::ostream& log)
       std::ofstream out(name);
 #else
       out << "==============================\n"
-         << name
-         << "\n==============================\n";
+          << name
+          << "\n==============================\n";
 #endif
       check_cont<dim>(4, 4, flags, out);
     }
 
-  for (unsigned int i=0;i<5;++i)
+  for (unsigned int i=0; i<5; ++i)
     {
       flags.height_vector = i;
       flags.color_vector = i;
-      
+
       sprintf(name, format, dim, spacedim, i, "");
 #if SEPARATE_FILES==1
       std::ofstream out(name);
 #else
-       out << "==============================\n"
-           << name
-           << "\n==============================\n";
+      out << "==============================\n"
+          << name
+          << "\n==============================\n";
 #endif
       check<dim,spacedim>(flags, out);
     }
@@ -120,5 +120,5 @@ int main()
 //  check_all<1,2>(logfile);
   check_all<2,2>(logfile);
   check_all<2,3>(logfile);
-//  check_all<3,3>(logfile);  
+//  check_all<3,3>(logfile);
 }
index 28af169f3762452100ca19c788c97ada92d123da..7c67694ad6e5b5d459aa132cbe1a89a5b49a1cc0 100644 (file)
 
 template <int dim, int spacedim>
 void check(DataOutBase::GmvFlags flags,
-          std::ostream& out)
+           std::ostream &out)
 {
   const unsigned int np = 4;
-  
+
   std::vector<DataOutBase::Patch<dim, spacedim> > patches(np);
-  
+
   create_patches(patches);
-  
+
   std::vector<std::string> names(5);
   names[0] = "x1";
   names[1] = "x2";
@@ -55,25 +55,26 @@ void check(DataOutBase::GmvFlags flags,
 
 
 template<int dim, int spacedim>
-void check_all(std::ostreamlog)
+void check_all(std::ostream &log)
 {
 #if SEPARATE_FILES == 0
-  std::ostreamout = log;
+  std::ostream &out = log;
 #endif
-  
+
   char name[100];
   DataOutBase::GmvFlags flags;
-  if (true) {
-    sprintf(name, "data_out_base_gmv/%d%d.gmv", dim, spacedim);
+  if (true)
+    {
+      sprintf(name, "data_out_base_gmv/%d%d.gmv", dim, spacedim);
 #if SEPARATE_FILES==1
-    std::ofstream out(name);
+      std::ofstream out(name);
 #else
-       out << "==============================\n"
-           << name
-           << "\n==============================\n";
+      out << "==============================\n"
+          << name
+          << "\n==============================\n";
 #endif
-    check<dim,spacedim>(flags, out);
-  }
+      check<dim,spacedim>(flags, out);
+    }
 }
 
 int main()
index f3c2da3ad335eb44e0d6249f03986fe2ca444dc0..849c8d5cc2821554280209b3640f45bdf224bbcb 100644 (file)
 
 template <int dim, int spacedim>
 void check(DataOutBase::GnuplotFlags flags,
-          std::ostream& out)
+           std::ostream &out)
 {
   const unsigned int np = 4;
-  
+
   std::vector<DataOutBase::Patch<dim, spacedim> > patches(np);
-  
+
   create_patches(patches);
-  
+
   std::vector<std::string> names(5);
   names[0] = "x1";
   names[1] = "x2";
@@ -54,24 +54,24 @@ void check(DataOutBase::GnuplotFlags flags,
 
 
 template<int dim, int spacedim>
-void check_all(std::ostreamlog)
+void check_all(std::ostream &log)
 {
 #if SEPARATE_FILES == 0
-  std::ostreamout = log;
+  std::ostream &out = log;
 #endif
-  
+
   char name[100];
-  const charformat = "data_out_base_gnuplot/%d%d.gnuplot";
+  const char *format = "data_out_base_gnuplot/%d%d.gnuplot";
   DataOutBase::GnuplotFlags flags;
-  for (unsigned int i=0;i<5;++i)
+  for (unsigned int i=0; i<5; ++i)
     {
       sprintf(name, format, dim, spacedim, "");
 #if SEPARATE_FILES==1
       std::ofstream out(name);
 #else
-       out << "==============================\n"
-           << name
-           << "\n==============================\n";
+      out << "==============================\n"
+          << name
+          << "\n==============================\n";
 #endif
       check<dim,spacedim>(flags, out);
     }
@@ -84,5 +84,5 @@ int main()
   check_all<1,2>(logfile);
   check_all<2,2>(logfile);
   check_all<2,3>(logfile);
-  check_all<3,3>(logfile);  
+  check_all<3,3>(logfile);
 }
index a364d14e7c6d78f8a6da0ee6d58987219fb29314..1eb125d2ed95ecbbea0aedea1ee872b3940a29ff 100644 (file)
 
 template <int dim, int spacedim>
 void check(DataOutBase::PovrayFlags flags,
-          std::ostream& out)
+           std::ostream &out)
 {
   const unsigned int np = 4;
-  
+
   std::vector<DataOutBase::Patch<dim, spacedim> > patches(np);
-  
+
   create_patches(patches);
-  
+
   std::vector<std::string> names(5);
   names[0] = "x1";
   names[1] = "x2";
@@ -57,14 +57,14 @@ void check(DataOutBase::PovrayFlags flags,
 
 template <int dim>
 void check_cont(unsigned int ncells,
-               unsigned int nsub,
-               DataOutBase::PovrayFlags flags,
-               std::ostream& out)
+                unsigned int nsub,
+                DataOutBase::PovrayFlags flags,
+                std::ostream &out)
 {
   std::vector<DataOutBase::Patch<dim, dim> > patches;
-  
+
   create_continuous_patches(patches, ncells, nsub);
-  
+
   std::vector<std::string> names(1);
   names[0] = "CutOff";
   std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > vectors;
@@ -73,12 +73,12 @@ void check_cont(unsigned int ncells,
 
 
 template<int dim, int spacedim>
-void check_all(std::ostreamlog)
+void check_all(std::ostream &log)
 {
 #if SEPARATE_FILES == 0
-  std::ostreamout = log;
+  std::ostream &out = log;
 #endif
-  
+
   char name[100];
 //  const char* format = "data_out_base_povray/%d%d%d%s.pov";
   DataOutBase::PovrayFlags flags;
@@ -90,12 +90,12 @@ void check_all(std::ostream& log)
       std::ofstream out(name);
 #else
       out << "==============================\n"
-         << name
-         << "\n==============================\n";
+          << name
+          << "\n==============================\n";
 #endif
       check_cont<dim>(4, 4, flags, out);
     }
-  
+
   flags.external_data = true;
   if (true)
     {
@@ -104,8 +104,8 @@ void check_all(std::ostream& log)
       std::ofstream out(name);
 #else
       out << "==============================\n"
-         << name
-         << "\n==============================\n";
+          << name
+          << "\n==============================\n";
 #endif
       check_cont<dim>(4, 4, flags, out);
     }
@@ -118,12 +118,12 @@ void check_all(std::ostream& log)
       std::ofstream out(name);
 #else
       out << "==============================\n"
-         << name
-         << "\n==============================\n";
+          << name
+          << "\n==============================\n";
 #endif
       check_cont<dim>(4, 4, flags, out);
     }
-  
+
   flags.bicubic_patch = true;
   if (true)
     {
@@ -132,8 +132,8 @@ void check_all(std::ostream& log)
       std::ofstream out(name);
 #else
       out << "==============================\n"
-         << name
-         << "\n==============================\n";
+          << name
+          << "\n==============================\n";
 #endif
       check_cont<dim>(4, 3, flags, out);
     }
@@ -146,5 +146,5 @@ int main()
 //  check_all<1,2>(logfile);
   check_all<2,2>(logfile);
   check_all<2,3>(logfile);
-//  check_all<3,3>(logfile);  
+//  check_all<3,3>(logfile);
 }
index 82f92cb5e6e5c33a958b30112c49ea3a73f8262c..2a9d144a679a8b8c137fc6bfb64a110cc0f77f34 100644 (file)
@@ -36,24 +36,24 @@ std::vector<DataOutBase::Patch<2,2> > patches;
 
 class DataOutX : public DataOutInterface<2,2>
 {
-    virtual
-    const std::vector< ::DataOutBase::Patch<2,2> > &
-    get_patches () const
-      {
-       return patches;
-      }
-
-    virtual
-    std::vector<std::string>
-    get_dataset_names () const
-      {
-       return std::vector<std::string>();
-      }
+  virtual
+  const std::vector< ::DataOutBase::Patch<2,2> > &
+  get_patches () const
+  {
+    return patches;
+  }
+
+  virtual
+  std::vector<std::string>
+  get_dataset_names () const
+  {
+    return std::vector<std::string>();
+  }
 };
 
 
 template <int dim, int spacedim>
-void check(std::ostreamout)
+void check(std::ostream &out)
 {
   std::vector<std::pair<double,std::string> > names(5);
   names[0] = std::make_pair(0,"x1");
index 639e4d1cf709ad720f632f5ec1f5788386b39733..4715dbe0848dda44d8609de9cbc1bc3f34eced64 100644 (file)
@@ -37,24 +37,24 @@ std::vector<std::string> names;
 
 class DataOutX : public DataOutInterface<2,2>
 {
-    virtual
-    const std::vector< ::DataOutBase::Patch<2,2> > &
-    get_patches () const
-      {
-       return patches;
-      }
-
-    virtual
-    std::vector<std::string>
-    get_dataset_names () const
-      {
-       return names;
-      }
+  virtual
+  const std::vector< ::DataOutBase::Patch<2,2> > &
+  get_patches () const
+  {
+    return patches;
+  }
+
+  virtual
+  std::vector<std::string>
+  get_dataset_names () const
+  {
+    return names;
+  }
 };
 
 
 template <int dim, int spacedim>
-void check(std::ostreamout)
+void check(std::ostream &out)
 {
   names.resize (5);
   names[0] = "x1";
index 2026f888ed26e3dac582412359572838f274292a..7294d43b2df719012acbf684413e1fb253771887 100644 (file)
 
 template <int dim, int spacedim>
 void check(DataOutBase::TecplotFlags flags,
-          std::ostream& out)
+           std::ostream &out)
 {
   const unsigned int np = 4;
-  
+
   std::vector<DataOutBase::Patch<dim, spacedim> > patches(np);
-  
+
   create_patches(patches);
-  
+
   std::vector<std::string> names(5);
   names[0] = "x1";
   names[1] = "x2";
@@ -55,31 +55,32 @@ void check(DataOutBase::TecplotFlags flags,
 
 
 template<int dim, int spacedim>
-void check_all(std::ostreamlog)
+void check_all(std::ostream &log)
 {
 #if SEPARATE_FILES == 0
-  std::ostreamout = log;
+  std::ostream &out = log;
 #endif
-  
+
   char name[100];
   DataOutBase::TecplotFlags flags;
-  if (true) {
-    sprintf(name, "data_out_base_tecplot/%d%d.tecplot", dim, spacedim);
+  if (true)
+    {
+      sprintf(name, "data_out_base_tecplot/%d%d.tecplot", dim, spacedim);
 #if SEPARATE_FILES==1
-    std::ofstream out(name);
+      std::ofstream out(name);
 #else
-       out << "==============================\n"
-           << name
-           << "\n==============================\n";
+      out << "==============================\n"
+          << name
+          << "\n==============================\n";
 #endif
-    check<dim,spacedim>(flags, out);
-  }
+      check<dim,spacedim>(flags, out);
+    }
 }
 
 int main()
 {
   std::ofstream logfile("data_out_base_tecplot/output",
-                       std::ios_base::trunc | std::ios_base::binary);
+                        std::ios_base::trunc | std::ios_base::binary);
   check_all<1,1>(logfile);
   check_all<1,2>(logfile);
   check_all<2,2>(logfile);
index 816d9d06264c7c53c95a0d6466ff6d90ab50e3f3..58253189243a7b0a8ec4bd3209b645cad4cb3cda 100644 (file)
 
 template <int dim, int spacedim>
 void check(DataOutBase::TecplotFlags flags,
-              std::ostream& out)
+           std::ostream &out)
 {
   const unsigned int np = 4;
-  
+
   std::vector<DataOutBase::Patch<dim, spacedim> > patches(np);
-  
+
   create_patches(patches);
-  
+
   std::vector<std::string> names(5);
   names[0] = "x1";
   names[1] = "x2";
@@ -56,12 +56,13 @@ void check_all()
 {
   char name[100];
   DataOutBase::TecplotFlags flags;
-  if (true) {
-    sprintf(name, "data_out_base_tecplot_bin/%d%d.tecplot", dim, spacedim);
-    flags.tecplot_binary_file_name=name;
-    
-    check<dim,spacedim>(flags, deallog.get_file_stream());
-  }
+  if (true)
+    {
+      sprintf(name, "data_out_base_tecplot_bin/%d%d.tecplot", dim, spacedim);
+      flags.tecplot_binary_file_name=name;
+
+      check<dim,spacedim>(flags, deallog.get_file_stream());
+    }
 }
 
 int main()
index 80c0aefa236b18ffdd6ac44371588a81061a049f..5845cc6ae9845a53a99b50ed8eba6dda9a8fd619 100644 (file)
 
 template <int dim, int spacedim>
 void check(DataOutBase::VtkFlags flags,
-          std::ostream& out)
+           std::ostream &out)
 {
   const unsigned int np = 4;
-  
+
   std::vector<DataOutBase::Patch<dim, spacedim> > patches(np);
-  
+
   create_patches(patches);
-  
+
   std::vector<std::string> names(5);
   names[0] = "x1";
   names[1] = "x2";
@@ -55,25 +55,26 @@ void check(DataOutBase::VtkFlags flags,
 
 
 template<int dim, int spacedim>
-void check_all(std::ostreamlog)
+void check_all(std::ostream &log)
 {
 #if SEPARATE_FILES == 0
-  std::ostreamout = log;
+  std::ostream &out = log;
 #endif
-  
+
   char name[100];
   DataOutBase::VtkFlags flags;
-  if (true) {
-    sprintf(name, "data_out_base_vtk/%d%d.vtk", dim, spacedim);
+  if (true)
+    {
+      sprintf(name, "data_out_base_vtk/%d%d.vtk", dim, spacedim);
 #if SEPARATE_FILES==1
-    std::ofstream out(name);
+      std::ofstream out(name);
 #else
-       out << "==============================\n"
-           << name
-           << "\n==============================\n";
+      out << "==============================\n"
+          << name
+          << "\n==============================\n";
 #endif
-    check<dim,spacedim>(flags, out);
-  }
+      check<dim,spacedim>(flags, out);
+    }
 }
 
 int main()
index ea4e41a4136e7e342ce3ae5b23d649aebf31f968..bdca62d0558ad9406b0c7ecf150e6b7303ff6c43 100644 (file)
 
 template <int dim, int spacedim>
 void check(DataOutBase::VtkFlags flags,
-          std::ostream& out)
+           std::ostream &out)
 {
   const unsigned int np = 4;
-  
+
   std::vector<DataOutBase::Patch<dim, spacedim> > patches(np);
-  
+
   create_patches(patches);
-  
+
   std::vector<std::string> names(5);
   names[0] = "x1";
   names[1] = "x2";
@@ -58,28 +58,29 @@ void check(DataOutBase::VtkFlags flags,
 
 
 template<int dim, int spacedim>
-void check_all(std::ostreamlog)
+void check_all(std::ostream &log)
 {
 #if SEPARATE_FILES == 0
-  std::ostreamout = log;
+  std::ostream &out = log;
 #endif
-  
+
   char name[100];
   DataOutBase::VtkFlags flags;
 
   flags.cycle = 42;
-  
-  if (true) {
-    sprintf(name, "data_out_base_vtk_cycle/%d%d.vtk", dim, spacedim);
+
+  if (true)
+    {
+      sprintf(name, "data_out_base_vtk_cycle/%d%d.vtk", dim, spacedim);
 #if SEPARATE_FILES==1
-    std::ofstream out(name);
+      std::ofstream out(name);
 #else
-       out << "==============================\n"
-           << name
-           << "\n==============================\n";
+      out << "==============================\n"
+          << name
+          << "\n==============================\n";
 #endif
-    check<dim,spacedim>(flags, out);
-  }
+      check<dim,spacedim>(flags, out);
+    }
 }
 
 int main()
index e993beffed19117e2df8a81a13169b853e343262..7f42523a59e8397b2ebec729ba7fd19beb25bee5 100644 (file)
 
 template <int dim, int spacedim>
 void check(DataOutBase::VtkFlags flags,
-          std::ostream& out)
+           std::ostream &out)
 {
   const unsigned int np = 4;
-  
+
   std::vector<DataOutBase::Patch<dim, spacedim> > patches(np);
-  
+
   create_patches(patches);
-  
+
   std::vector<std::string> names(5);
   names[0] = "x1";
   names[1] = "x2";
@@ -58,28 +58,29 @@ void check(DataOutBase::VtkFlags flags,
 
 
 template<int dim, int spacedim>
-void check_all(std::ostreamlog)
+void check_all(std::ostream &log)
 {
 #if SEPARATE_FILES == 0
-  std::ostreamout = log;
+  std::ostream &out = log;
 #endif
-  
+
   char name[100];
   DataOutBase::VtkFlags flags;
 
   flags.time = numbers::PI;
-  
-  if (true) {
-    sprintf(name, "data_out_base_vtk_time/%d%d.vtk", dim, spacedim);
+
+  if (true)
+    {
+      sprintf(name, "data_out_base_vtk_time/%d%d.vtk", dim, spacedim);
 #if SEPARATE_FILES==1
-    std::ofstream out(name);
+      std::ofstream out(name);
 #else
-       out << "==============================\n"
-           << name
-           << "\n==============================\n";
+      out << "==============================\n"
+          << name
+          << "\n==============================\n";
 #endif
-    check<dim,spacedim>(flags, out);
-  }
+      check<dim,spacedim>(flags, out);
+    }
 }
 
 int main()
index 5ba7d69cf725b23aa191aeaf5365166c1a1656a9..7a9f0fbba18dc9c5ccbcf23ba40c1b785c04b5fc 100644 (file)
 
 template <int dim, int spacedim>
 void check(DataOutBase::VtkFlags flags,
-          std::ostream& out)
+           std::ostream &out)
 {
   const unsigned int np = 4;
-  
+
   std::vector<DataOutBase::Patch<dim, spacedim> > patches(np);
-  
+
   create_patches(patches);
-  
+
   std::vector<std::string> names(5);
   names[0] = "x1";
   names[1] = "x2";
@@ -58,29 +58,30 @@ void check(DataOutBase::VtkFlags flags,
 
 
 template<int dim, int spacedim>
-void check_all(std::ostreamlog)
+void check_all(std::ostream &log)
 {
 #if SEPARATE_FILES == 0
-  std::ostreamout = log;
+  std::ostream &out = log;
 #endif
-  
+
   char name[100];
   DataOutBase::VtkFlags flags;
 
   flags.time = numbers::PI;
   flags.cycle = 42;
-  
-  if (true) {
-    sprintf(name, "data_out_base_vtk_time_and_cycle/%d%d.vtk", dim, spacedim);
+
+  if (true)
+    {
+      sprintf(name, "data_out_base_vtk_time_and_cycle/%d%d.vtk", dim, spacedim);
 #if SEPARATE_FILES==1
-    std::ofstream out(name);
+      std::ofstream out(name);
 #else
-       out << "==============================\n"
-           << name
-           << "\n==============================\n";
+      out << "==============================\n"
+          << name
+          << "\n==============================\n";
 #endif
-    check<dim,spacedim>(flags, out);
-  }
+      check<dim,spacedim>(flags, out);
+    }
 }
 
 int main()
index ba43d9e808449d22139058073b09ec0407320634..030df7bb9f366b420cbcf90820d7d685e02140c4 100644 (file)
@@ -35,7 +35,7 @@
 
 template <int dim, int spacedim>
 void check(DataOutBase::VtkFlags flags,
-          std::ostream& out)
+           std::ostream &out)
 {
   const unsigned int np = 4;
 
@@ -55,25 +55,26 @@ void check(DataOutBase::VtkFlags flags,
 
 
 template<int dim, int spacedim>
-void check_all(std::ostreamlog)
+void check_all(std::ostream &log)
 {
 #if SEPARATE_FILES == 0
-  std::ostreamout = log;
+  std::ostream &out = log;
 #endif
 
   char name[100];
   DataOutBase::VtkFlags flags;
-  if (true) {
-    sprintf(name, "data_out_base_vtu/%d%d.vtu", dim, spacedim);
+  if (true)
+    {
+      sprintf(name, "data_out_base_vtu/%d%d.vtu", dim, spacedim);
 #if SEPARATE_FILES==1
-    std::ofstream out(name);
+      std::ofstream out(name);
 #else
-       out << "==============================\n"
-           << name
-           << "\n==============================\n";
+      out << "==============================\n"
+          << name
+          << "\n==============================\n";
 #endif
-    check<dim,spacedim>(flags, out);
-  }
+      check<dim,spacedim>(flags, out);
+    }
 }
 
 int main()
index 6d4fb95542d5b99344516b0a65252e7ef9db01be..8c5b24cbfdce65f7cc86b832eb73e8dee12c1764 100644 (file)
@@ -37,7 +37,7 @@
 
 template <int dim, int spacedim>
 void check(DataOutBase::VtkFlags flags,
-          std::ostream& out)
+           std::ostream &out)
 {
   const unsigned int np = 4;
 
@@ -57,10 +57,10 @@ void check(DataOutBase::VtkFlags flags,
 
 
 template<int dim, int spacedim>
-void check_all(std::ostreamlog)
+void check_all(std::ostream &log)
 {
 #if SEPARATE_FILES == 0
-  std::ostreamout = log;
+  std::ostream &out = log;
 #endif
 
   char name[100];
@@ -68,17 +68,18 @@ void check_all(std::ostream& log)
 
   flags.cycle = 42;
 
-  if (true) {
-    sprintf(name, "data_out_base_vtu_cycle/%d%d.vtu", dim, spacedim);
+  if (true)
+    {
+      sprintf(name, "data_out_base_vtu_cycle/%d%d.vtu", dim, spacedim);
 #if SEPARATE_FILES==1
-    std::ofstream out(name);
+      std::ofstream out(name);
 #else
-       out << "==============================\n"
-           << name
-           << "\n==============================\n";
+      out << "==============================\n"
+          << name
+          << "\n==============================\n";
 #endif
-    check<dim,spacedim>(flags, out);
-  }
+      check<dim,spacedim>(flags, out);
+    }
 }
 
 int main()
index fe5bbca156522a0278864a0d922d0b8d44fe909f..48615e6ce682e232d0fb1cc3edeaffe9db7df85b 100644 (file)
@@ -37,7 +37,7 @@
 
 template <int dim, int spacedim>
 void check(DataOutBase::VtkFlags flags,
-          std::ostream& out)
+           std::ostream &out)
 {
   const unsigned int np = 4;
 
@@ -57,28 +57,29 @@ void check(DataOutBase::VtkFlags flags,
 
 
 template<int dim, int spacedim>
-void check_all(std::ostreamlog)
+void check_all(std::ostream &log)
 {
 #if SEPARATE_FILES == 0
-  std::ostreamout = log;
+  std::ostream &out = log;
 #endif
 
   char name[100];
   DataOutBase::VtkFlags flags;
 
   flags.time = numbers::PI;
-  
-  if (true) {
-    sprintf(name, "data_out_base_vtu_time/%d%d.vtu", dim, spacedim);
+
+  if (true)
+    {
+      sprintf(name, "data_out_base_vtu_time/%d%d.vtu", dim, spacedim);
 #if SEPARATE_FILES==1
-    std::ofstream out(name);
+      std::ofstream out(name);
 #else
-       out << "==============================\n"
-           << name
-           << "\n==============================\n";
+      out << "==============================\n"
+          << name
+          << "\n==============================\n";
 #endif
-    check<dim,spacedim>(flags, out);
-  }
+      check<dim,spacedim>(flags, out);
+    }
 }
 
 int main()
index d398465c3255c137cdab17bca8022f85f1984316..f60fd290fcc04fef132a75268b132b2a4c8aa622 100644 (file)
@@ -38,7 +38,7 @@
 
 template <int dim, int spacedim>
 void check(DataOutBase::VtkFlags flags,
-          std::ostream& out)
+           std::ostream &out)
 {
   const unsigned int np = 4;
 
@@ -58,10 +58,10 @@ void check(DataOutBase::VtkFlags flags,
 
 
 template<int dim, int spacedim>
-void check_all(std::ostreamlog)
+void check_all(std::ostream &log)
 {
 #if SEPARATE_FILES == 0
-  std::ostreamout = log;
+  std::ostream &out = log;
 #endif
 
   char name[100];
@@ -69,18 +69,19 @@ void check_all(std::ostream& log)
 
   flags.time = numbers::PI;
   flags.cycle = 42;
-  
-  if (true) {
-    sprintf(name, "data_out_base_vtu_time_and_cycle/%d%d.vtu", dim, spacedim);
+
+  if (true)
+    {
+      sprintf(name, "data_out_base_vtu_time_and_cycle/%d%d.vtu", dim, spacedim);
 #if SEPARATE_FILES==1
-    std::ofstream out(name);
+      std::ofstream out(name);
 #else
-       out << "==============================\n"
-           << name
-           << "\n==============================\n";
+      out << "==============================\n"
+          << name
+          << "\n==============================\n";
 #endif
-    check<dim,spacedim>(flags, out);
-  }
+      check<dim,spacedim>(flags, out);
+    }
 }
 
 int main()
index a3f3521b4916df6e5f5eaacb7564c494b807e999..1e105e3ffd8acc0175ea23975dfd38b3dde9be9d 100644 (file)
@@ -28,7 +28,7 @@
 
 // test DataOutReader::merge
 
-void cat_file(const char * filename)
+void cat_file(const char *filename)
 {
   std::ifstream in(filename);
   while (in)
@@ -43,11 +43,11 @@ template <int dim, int spacedim>
 void check()
 {
   const unsigned int np = 1;
-  
+
   std::vector<DataOutBase::Patch<dim, spacedim> > patches(np);
-  
+
   create_patches(patches);
-  
+
   std::vector<std::string> names(5);
   names[0] = "x1";
   names[1] = "x2";
@@ -55,29 +55,29 @@ void check()
   names[3] = "x4";
   names[4] = "i";
   std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> > vectors;
-  
+
   std::ostringstream old_data;
-  DataOutBase::write_deal_II_intermediate(patches, names, vectors, 
-                                         DataOutBase::Deal_II_IntermediateFlags(),
-                                         old_data);
+  DataOutBase::write_deal_II_intermediate(patches, names, vectors,
+                                          DataOutBase::Deal_II_IntermediateFlags(),
+                                          old_data);
 
   DataOutReader<dim,spacedim> data;
   {
     std::istringstream input(old_data.str());
     data.read (input);
-  }  
+  }
   DataOutReader<dim,spacedim> additional_data;
   {
     std::istringstream input(old_data.str());
     additional_data.read (input);
   }
-   
+
   data.merge (additional_data);
 
   {
     std::ofstream out2( "data_out_reader_01/outfile");
     data.write_deal_II_intermediate (out2);
-  }  
+  }
 
   cat_file("data_out_reader_01/outfile");
   std::remove ("data_out_reader_01/outfile");
@@ -93,5 +93,5 @@ int main()
   check<1,2>();
   check<2,2>();
   check<2,3>();
-  check<3,3>();  
+  check<3,3>();
 }
index 829af439b95143c8e01cf3184fb6b2b6038f4813..d88af2634a7cf9795c84186b05a3a431ec803a45 100644 (file)
@@ -30,17 +30,17 @@ int main ()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   Tensor<2,2> t;
   t[0][0] = 1;
   t[1][1] = 2;
   t[0][1] = 4;
   t[1][0] = 4;
-                                   // make sure transposition doesn't change
-                                   // anything
+  // make sure transposition doesn't change
+  // anything
   Assert (t == transpose(t), ExcInternalError());
 
-                                   // check norm of tensor
+  // check norm of tensor
   Assert (std::fabs(t.norm() - std::sqrt(1.*1+2*2+2*4*4)) < 1e-14,
           ExcInternalError());
 
index 1634f3f8dcd5161199b9e86ce2fd3dd035ebea90..dc066402d25539a14b9ff994c488d1b8fef1373b 100644 (file)
@@ -30,7 +30,7 @@ int main ()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   Tensor<2,3> t;
   t[0][0] = 1;
   t[1][1] = 2;
@@ -44,11 +44,11 @@ int main ()
 
   Assert (t[0][1] == t[1][0], ExcInternalError());
 
-                                   // make sure transposition doesn't change
-                                   // anything
+  // make sure transposition doesn't change
+  // anything
   Assert (t == transpose(t), ExcInternalError());
 
-                                   // check norm of tensor
+  // check norm of tensor
   Assert (std::fabs(t.norm() - std::sqrt(1.*1+2*2+3*3+2*4*4+2*5*5+2*6*6))
           < 1e-14,
           ExcInternalError());
index bfe3d4f367b68b9dbfe446de8f0f14413e94bf51..4833fd1b255d0abdaa491803f73c821cb6a5f531 100644 (file)
@@ -30,7 +30,7 @@ int main ()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   Tensor<4,2> t;
   t[0][0][0][0] = 1;
   t[1][1][1][1] = 2;
@@ -39,18 +39,18 @@ int main ()
 
   Assert (t[0][1][0][1] == t[1][0][1][0], ExcInternalError());
 
-                                   // check norm of tensor
+  // check norm of tensor
   deallog << t.norm() << std::endl;
 
-                                   // make sure norm is induced by scalar
-                                   // product
+  // make sure norm is induced by scalar
+  // product
   double norm_sqr = 0;
   for (unsigned int i=0; i<2; ++i)
     for (unsigned int j=0; j<2; ++j)
       for (unsigned int k=0; k<2; ++k)
-       for (unsigned int l=0; l<2; ++l)
-         norm_sqr += t[i][j][k][l] * t[i][j][k][l];
-  
+        for (unsigned int l=0; l<2; ++l)
+          norm_sqr += t[i][j][k][l] * t[i][j][k][l];
+
   Assert (std::fabs (t.norm()*t.norm() - norm_sqr) < 1e-14,
           ExcInternalError());
 
index c4a9d00341ed7f076d431db87fcbd846de66e11b..742c3b6756b72a87ae18fe16a8023c5cab21ff64 100644 (file)
@@ -30,7 +30,7 @@ int main ()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   Tensor<4,3> t;
   t[0][0][0][0] = 1;
   t[1][1][1][1] = 2;
@@ -39,17 +39,17 @@ int main ()
 
   Assert (t[0][1][0][1] == t[1][0][1][0], ExcInternalError());
 
-                                   // check norm of tensor
+  // check norm of tensor
   deallog << t.norm() << std::endl;
 
-                                   // make sure norm is induced by scalar
-                                   // product
+  // make sure norm is induced by scalar
+  // product
   double norm_sqr = 0;
   for (unsigned int i=0; i<2; ++i)
     for (unsigned int j=0; j<2; ++j)
       for (unsigned int k=0; k<2; ++k)
-       for (unsigned int l=0; l<2; ++l)
-         norm_sqr += t[i][j][k][l] * t[i][j][k][l];
+        for (unsigned int l=0; l<2; ++l)
+          norm_sqr += t[i][j][k][l] * t[i][j][k][l];
   Assert (std::fabs (t.norm()*t.norm() - norm_sqr) < 1e-14,
           ExcInternalError());
 
index 59ea220336500172cd485c4a53e2845552b940b6..f81f79504d9949dc7de1de0fcb672d66d666ea11 100644 (file)
@@ -32,9 +32,9 @@ void test ()
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       for (unsigned int k=0; k<dim; ++k)
-       for (unsigned int l=0; l<dim; ++l)
-         t[i][j][k][l] = ((i==k) && (j==l) ? 1 : 0);
-         
+        for (unsigned int l=0; l<dim; ++l)
+          t[i][j][k][l] = ((i==k) && (j==l) ? 1 : 0);
+
   Tensor<2,dim> a, b;
   a[0][0] = 1;
   a[1][1] = 2;
@@ -43,38 +43,38 @@ void test ()
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       {
-       double tmp_ij = 0;
-       for (unsigned int k=0; k<dim; ++k)
-         for (unsigned int l=0; l<dim; ++l)
-           {
-             deallog << i << ' ' << j << ' ' << k << ' ' << l << ": "
-                     << t[i][j][k][l] << ' ' << a[k][l]
-                     << std::endl;
-             tmp_ij += t[i][j][k][l] * a[k][l];
-           }
-       b[i][j] = tmp_ij;
-      }  
+        double tmp_ij = 0;
+        for (unsigned int k=0; k<dim; ++k)
+          for (unsigned int l=0; l<dim; ++l)
+            {
+              deallog << i << ' ' << j << ' ' << k << ' ' << l << ": "
+                      << t[i][j][k][l] << ' ' << a[k][l]
+                      << std::endl;
+              tmp_ij += t[i][j][k][l] * a[k][l];
+            }
+        b[i][j] = tmp_ij;
+      }
 
   Assert (a == b, ExcInternalError());
 
-                                  // try the same thing with scaled
-                                  // tensors etc
+  // try the same thing with scaled
+  // tensors etc
   t *= 2;
   b.clear ();
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       {
-       double tmp_ij = 0;
-       for (unsigned int k=0; k<dim; ++k)
-         for (unsigned int l=0; l<dim; ++l)
-           tmp_ij += t[i][j][k][l] * a[k][l];
-       b[i][j] = tmp_ij;
+        double tmp_ij = 0;
+        for (unsigned int k=0; k<dim; ++k)
+          for (unsigned int l=0; l<dim; ++l)
+            tmp_ij += t[i][j][k][l] * a[k][l];
+        b[i][j] = tmp_ij;
       }
 
   Assert (a == b/2, ExcInternalError());
 }
 
-  
+
 
 
 int main ()
@@ -87,6 +87,6 @@ int main ()
 
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 642d7c0643f0a844753646c75c937767aee3be51..fc0bd8616d3d5875cc3f27319a32e2d6ce09e47d 100644 (file)
@@ -30,56 +30,56 @@ template <int dim>
 void test ()
 {
   const double lambda = 5,
-              mu     = 7;
+               mu     = 7;
   Tensor<4,dim> ts;
   Tensor<4,dim>          ta;
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       {
-       ta[i][j][i][j] += mu;
-       ta[i][j][j][i] += mu;
-       ta[i][i][j][j] += lambda;
+        ta[i][j][i][j] += mu;
+        ta[i][j][j][i] += mu;
+        ta[i][i][j][j] += lambda;
       }
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       for (unsigned int k=0; k<dim; ++k)
-       for (unsigned int l=0; l<dim; ++l)
-         ts[i][j][k][l] = ta[i][j][k][l];
-  
+        for (unsigned int l=0; l<dim; ++l)
+          ts[i][j][k][l] = ta[i][j][k][l];
+
   Tensor<2,dim> as, bs;
   Tensor<2,dim>          aa, ba;
 
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       as[i][j] = aa[i][j] = (1. + (i+1)*(j+1));
-      
+
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       {
-       double tmp_ij = 0;
-       for (unsigned int k=0; k<dim; ++k)
-         for (unsigned int l=0; l<dim; ++l)
-           {
-             deallog << i << ' ' << j << ' ' << k << ' ' << l << ": "
-                     << ta[i][j][k][l] << ' ' << ts[i][j][k][l] << ' '
-                     << aa[k][l] << ' ' << as[k][l]
-                     << std::endl;
-             tmp_ij += ts[i][j][k][l] * as[k][l];
-           }
-       bs[i][j] = tmp_ij;
+        double tmp_ij = 0;
+        for (unsigned int k=0; k<dim; ++k)
+          for (unsigned int l=0; l<dim; ++l)
+            {
+              deallog << i << ' ' << j << ' ' << k << ' ' << l << ": "
+                      << ta[i][j][k][l] << ' ' << ts[i][j][k][l] << ' '
+                      << aa[k][l] << ' ' << as[k][l]
+                      << std::endl;
+              tmp_ij += ts[i][j][k][l] * as[k][l];
+            }
+        bs[i][j] = tmp_ij;
       }
   double_contract (ba, ta, aa);
-  
+
   for (unsigned int i=0; i<dim; ++i)
-    for (unsigned int j=0; j<dim; ++j) 
+    for (unsigned int j=0; j<dim; ++j)
       {
-       Assert (as[i][j] == aa[i][j], ExcInternalError());
-       Assert (bs[i][j] == ba[i][j], ExcInternalError());
+        Assert (as[i][j] == aa[i][j], ExcInternalError());
+        Assert (bs[i][j] == ba[i][j], ExcInternalError());
       }
-  
+
 }
 
-  
+
 
 
 int main ()
@@ -92,6 +92,6 @@ int main ()
 
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 4c6512cce8c65c3679e4f79bf23848b5bb017d08..9a5caf016e9b56c0afcd1b1a3f5bcae2afd57cd9 100644 (file)
 #include <fstream>
 #include <iomanip>
 
-  
+
 
 template <int dim>
 void test ()
 {
   const double lambda = 1.5,
-              mu     = 1.7;
+               mu     = 1.7;
   Tensor<2,dim> t;
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       t[i][j] = (1. + (i+lambda)*(mu+13));
-         
+
   Tensor<2,dim> a;
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       a[i][j] = (1. + (i+1)*(j+1));
 
-                                  // stress test the whole thing many
-                                  // times. normalize in each step to
-                                  // make sure the result remains
-                                  // representable in floating point
-                                  // arithmetic. essentially, this
-                                  // invokes the power method to
-                                  // compute the largest eigenvector
-                                  // (eigentensor in this case)
+  // stress test the whole thing many
+  // times. normalize in each step to
+  // make sure the result remains
+  // representable in floating point
+  // arithmetic. essentially, this
+  // invokes the power method to
+  // compute the largest eigenvector
+  // (eigentensor in this case)
   for (unsigned int i=0; i<1000000; ++i)
     {
       a = t*a;
@@ -55,11 +55,11 @@ void test ()
     }
 
   for (unsigned int i=0; i<dim; ++i)
-    for (unsigned int j=0; j<dim; ++j) 
+    for (unsigned int j=0; j<dim; ++j)
       deallog << i << ' ' << j << ' ' << a[i][j] << std::endl;
 }
 
-  
+
 
 
 int main ()
@@ -72,6 +72,6 @@ int main ()
 
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 31b4f0e79622611c6d38c23c4a969a4a08640982..eb726fadd77b5dc5fe186a0f945939296012733b 100644 (file)
@@ -29,8 +29,8 @@ void test ()
 {
   Tensor<2,dim> t;
 
-                                  // choose the same symmetric tensor
-                                  // as in symmetric_tensor_09
+  // choose the same symmetric tensor
+  // as in symmetric_tensor_09
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=i; j<dim; ++j)
       t[i][j] = t[j][i] = (1.+(i+1)*(j*2));
@@ -38,11 +38,11 @@ void test ()
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       deallog << i << ' ' << j << ' ' << t[i][j] << std::endl;
-  
+
   deallog << determinant(t) << std::endl;
 }
 
-  
+
 
 
 int main ()
@@ -55,6 +55,6 @@ int main ()
 
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 2a2b4b6c1df9a8a79b518fc7f06b232d2998a17e..f21e83bcf3dad40c4632775a5b53e5dd07ba7741 100644 (file)
@@ -29,8 +29,8 @@ void test ()
 {
   Tensor<2,dim> t;
 
-                                  // choose the same symmetric tensor
-                                  // as in symmetric_tensor_10
+  // choose the same symmetric tensor
+  // as in symmetric_tensor_10
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       t[i][j] = 1. * rand() / RAND_MAX;
@@ -38,12 +38,12 @@ void test ()
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       deallog << "A[" << i+1 << ',' << j+1 << "] := " << t[i][j] << ';'
-             << std::endl;
-  
+              << std::endl;
+
   deallog << determinant(t) << std::endl;
 }
 
-  
+
 
 
 int main ()
@@ -59,6 +59,6 @@ int main ()
   test<6> ();
   test<7> ();
   test<8> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 414590ce81a3c8009c4d11374a8f5e3c2f097d3f..fec5c390cc0b478e3539c9b130ce5dee2eb844b8 100644 (file)
 
 template<int dim>
 void
-check_derivative_order(const std::vector<Tensor<1,dim> >gradients,
-                      FunctionDerivative<dim>& df,
-                      const Quadrature<dim>& quadrature,
-                      const unsigned int direction,
-                      const double order)
+check_derivative_order(const std::vector<Tensor<1,dim> > &gradients,
+                       FunctionDerivative<dim> &df,
+                       const Quadrature<dim> &quadrature,
+                       const unsigned int direction,
+                       const double order)
 {
   std::vector<double> derivatives(quadrature.size());
   std::vector<double> differences(quadrature.size());
 
-                                  // Compute derivatives with one
-                                  // step size and store errors
+  // Compute derivatives with one
+  // step size and store errors
   df.set_h(1.e-2);
   df.value_list(quadrature.get_points(), derivatives);
-  for (unsigned int i=0;i<gradients.size();++i)
+  for (unsigned int i=0; i<gradients.size(); ++i)
     differences[i] = gradients[i][direction] - derivatives[i];
 
   df.set_h(5.e-3);
   df.value_list(quadrature.get_points(), derivatives);
 
-                                  // Expected reduction
+  // Expected reduction
   const double expected = std::pow(.5, order);
-  
-  for (unsigned int i=0;i<gradients.size();++i)
+
+  for (unsigned int i=0; i<gradients.size(); ++i)
     {
       const double reduction = std::fabs(gradients[i][direction] - derivatives[i])
-                              / std::fabs(differences[i]);
+                               / std::fabs(differences[i]);
       if (reduction > 1.2 * expected || reduction < .8 * expected)
-       deallog << "Derivative error " << direction
-               << ' ' << order
-               << ' ' << i
-               << "   " << reduction << std::endl;
+        deallog << "Derivative error " << direction
+                << ' ' << order
+                << ' ' << i
+                << "   " << reduction << std::endl;
     }
 }
 
 
 template<int dim>
 void
-check_hessian_order(const std::vector<double>values,
-                   FunctionDerivative<dim>& df,
-                   const Quadrature<dim>& quadrature,
-                   const Point<dim>& k,
-                   const unsigned int direction,
-                   const double order)
+check_hessian_order(const std::vector<double> &values,
+                    FunctionDerivative<dim> &df,
+                    const Quadrature<dim> &quadrature,
+                    const Point<dim> &k,
+                    const unsigned int direction,
+                    const double order)
 {
   std::vector<Tensor<1,dim> > derivatives(quadrature.size());
   std::vector<Tensor<1,dim> > differences(quadrature.size());
 
   const double h = (order < 3) ? 1.e-2 : 1.e-1 ;
-                                  // Compute derivatives with one
-                                  // step size and store errors
+  // Compute derivatives with one
+  // step size and store errors
   df.set_h(h);
   df.gradient_list(quadrature.get_points(), derivatives);
-  for (unsigned int i=0;i<values.size();++i)
-    for (unsigned int d=0;d<dim;++d)
-                                      // Use what we know about
-                                      // derivatives of the sine wave
-    differences[i][d] = -values[i]*k[direction]*k[d] - derivatives[i][d];
-  
+  for (unsigned int i=0; i<values.size(); ++i)
+    for (unsigned int d=0; d<dim; ++d)
+      // Use what we know about
+      // derivatives of the sine wave
+      differences[i][d] = -values[i]*k[direction]*k[d] - derivatives[i][d];
+
   df.set_h(h/2.);
   df.gradient_list(quadrature.get_points(), derivatives);
 
-                                  // Expected reduction
+  // Expected reduction
   const double expected = std::pow(.5, order);
-  
-  for (unsigned int i=0;i<values.size();++i)
-    for (unsigned int d=0;d<dim;++d)
+
+  for (unsigned int i=0; i<values.size(); ++i)
+    for (unsigned int d=0; d<dim; ++d)
       {
-       const double reduction = std::fabs(-values[i]*k[direction]*k[d] - derivatives[i][d])
-                                / std::fabs(differences[i][d]);
-      if (reduction > 1.2 * expected || reduction < .8 * expected)
-       deallog << "Hessian error " << direction << ' ' << d
-               << ' ' << order
-               << ' ' << i
-               << "   " << reduction
-               << "   " << expected
-               << "   " << differences[i][d]
-               << std::endl;
-    }
+        const double reduction = std::fabs(-values[i]*k[direction]*k[d] - derivatives[i][d])
+                                 / std::fabs(differences[i][d]);
+        if (reduction > 1.2 * expected || reduction < .8 * expected)
+          deallog << "Hessian error " << direction << ' ' << d
+                  << ' ' << order
+                  << ' ' << i
+                  << "   " << reduction
+                  << "   " << expected
+                  << "   " << differences[i][d]
+                  << std::endl;
+      }
 }
 
 
@@ -119,21 +119,21 @@ void
 check_sine(unsigned int nquad)
 {
   QGauss<dim> quadrature(nquad);
-  
+
   Point<dim> wave_vector;
-  for (unsigned int d=0;d<dim;++d)
+  for (unsigned int d=0; d<dim; ++d)
     wave_vector(d) = d+2.;
-  
+
   Functions::FourierSineFunction<dim> f(wave_vector);
-  
+
   std::vector<double> values(quadrature.size());
   std::vector<Tensor<1,dim> > gradients(quadrature.size());
-  
+
   f.value_list(quadrature.get_points(), values);
   f.gradient_list(quadrature.get_points(), gradients);
-  
-                                  // Check derivatives in all directions
-  for (unsigned int d=0;d<dim;++d)
+
+  // Check derivatives in all directions
+  for (unsigned int d=0; d<dim; ++d)
     {
       deallog << "Direction " << d << std::endl;
       Point<dim> dir;
index 2f6fe68c7d8d5894b8a7cbabdcdc8c7ea8b9ee1a..513a52712c3f138c2f41bbfaa0c827d4a143c9ff 100644 (file)
@@ -17,7 +17,7 @@
 
 
 // This program tests the functionality of the function parser
-// wrapper. 
+// wrapper.
 
 #include "../tests.h"
 #include <fstream>
 #include <deal.II/base/function_parser.h>
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("function_parser/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   // Define some constants that will be used by the function parser
   std::map<std::string, double> constants;
   constants["pi"] = M_PI;
+
   // Define the variables that will be used inside the expressions
   std::string variables = "x,y";
+
   // Define the expressions of the vector_valued function.
   std::vector<std::string> expressions;
   expressions.push_back("sin(2*pi*x)");
   expressions.push_back("cos(2*pi*y*x)");
   expressions.push_back("if(x<.5,y,exp(x))");
   expressions.push_back("if(x<.5,y,exp(x)*exp(x*y))");
-  
+
   // Concatenate the declared expressions, to test the second way of
   // initializing
   std::string concatenated="cos(pi*y)";
   // Now test each possibility
-  for(unsigned int i=1; i<=expressions.size(); ++i) {
-    try {
-      {
-       FunctionParser<2> function(i);
-       function.initialize(variables,
-                           expressions,
-                           constants);
-       deallog << "Initialize Succeded with dim = 2, "
-               << i << " components, "
-               << expressions.size() << " expressions, " 
-               << variables << " as variables." << std::endl;
-      }
-    } catch(...) {
-       deallog << "Initialize Failed with dim = 2, "
-               << i << " components, "
-               << expressions.size() << " expressions, " 
-               << variables << " as variables." << std::endl;
-    }
-    
-    try {
-      {
-       FunctionParser<2> function_bis(i);
-       function_bis.initialize(variables,
-                               concatenated,
-                               constants);
-       deallog << "Initialize Succeded with dim = 2, "
-               << i << " components, "
-               << concatenated << " as function and "
-               << variables << " as variables." << std::endl; 
-      }
-    } catch(...) {
-      deallog << "Initialize Failed with dim = 2, "
-             << i << " components, "
-             << concatenated  << " as function and "
-             << variables << " as variables." << std::endl;
+  for (unsigned int i=1; i<=expressions.size(); ++i)
+    {
+      try
+        {
+          {
+            FunctionParser<2> function(i);
+            function.initialize(variables,
+                                expressions,
+                                constants);
+            deallog << "Initialize Succeded with dim = 2, "
+                    << i << " components, "
+                    << expressions.size() << " expressions, "
+                    << variables << " as variables." << std::endl;
+          }
+        }
+      catch (...)
+        {
+          deallog << "Initialize Failed with dim = 2, "
+                  << i << " components, "
+                  << expressions.size() << " expressions, "
+                  << variables << " as variables." << std::endl;
+        }
+
+      try
+        {
+          {
+            FunctionParser<2> function_bis(i);
+            function_bis.initialize(variables,
+                                    concatenated,
+                                    constants);
+            deallog << "Initialize Succeded with dim = 2, "
+                    << i << " components, "
+                    << concatenated << " as function and "
+                    << variables << " as variables." << std::endl;
+          }
+        }
+      catch (...)
+        {
+          deallog << "Initialize Failed with dim = 2, "
+                  << i << " components, "
+                  << concatenated  << " as function and "
+                  << variables << " as variables." << std::endl;
+        }
+
+      concatenated += "; " + expressions[i-1];
     }
-    
-    concatenated += "; " + expressions[i-1];
-  }
 }
 
-      
 
-  
+
+
index df44384a5f274e4deb9302fa5f680d25d5aa9ec0..6e4cc091b77f91cb97866f98403236564bafcc2c 100644 (file)
 #include <deal.II/base/function_parser.h>
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("function_parser_02/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  
+
   std::vector<std::string> function(1);
   std::map<std::string, double> constants;
   std::map<std::string, double> units;
@@ -47,51 +47,51 @@ int main ()
 
   Point<2> point(2.0, 3.0);
 
-                                  //initialized with units
+  //initialized with units
   FunctionParser<2> fp;
   function[0] = "x cm + y m + PI";
   fp.initialize(FunctionParser<2>::default_variable_names(),
-               function, constants, units);
+                function, constants, units);
 
   deallog << "Function " << "[" << function[0] << "]" <<
-    " @point " << "[" << point << "]" << " is " <<
-    "[" <<  fp.value(point) << "]" << std::endl;
+          " @point " << "[" << point << "]" << " is " <<
+          "[" <<  fp.value(point) << "]" << std::endl;
 
-                                  //now initialize with a function
-                                  //that's a string, not vector of
-                                  //strings
+  //now initialize with a function
+  //that's a string, not vector of
+  //strings
   FunctionParser<2> fp4;
   fp4.initialize(FunctionParser<2>::default_variable_names(),
-                function[0], constants, units);
+                 function[0], constants, units);
 
   deallog << "Function " << "[" << function[0] << "]" <<
-    " @point " << "[" << point << "]" << " is " <<
-    "[" <<  fp4.value(point) << "]" << std::endl;
+          " @point " << "[" << point << "]" << " is " <<
+          "[" <<  fp4.value(point) << "]" << std::endl;
 
-                                  //now initialize a function without
-                                  //units to check backwards
-                                  //compatibility
+  //now initialize a function without
+  //units to check backwards
+  //compatibility
   FunctionParser<2> fp2;
   function[0] = "x + y + PI";
   fp2.initialize(FunctionParser<2>::default_variable_names(),
-                function, constants);
+                 function, constants);
   deallog << "Function " << "[" << function[0] << "]" <<
-    " @point " << "[" << point << "]" << " is " <<
-    "[" <<  fp2.value(point) << "]" << std::endl;
+          " @point " << "[" << point << "]" << " is " <<
+          "[" <<  fp2.value(point) << "]" << std::endl;
 
 
 
-                                  //same as above but the function is
-                                  //a string, not a vector
+  //same as above but the function is
+  //a string, not a vector
   FunctionParser<2> fp3;
   fp3.initialize(FunctionParser<2>::default_variable_names(),
-                function[0], constants);
+                 function[0], constants);
 
   deallog << "Function " << "[" << function[0] << "]" <<
-    " @point " << "[" << point << "]" << " is " <<
-    "[" <<  fp3.value(point) << "]" << std::endl;
+          " @point " << "[" << point << "]" << " is " <<
+          "[" <<  fp3.value(point) << "]" << std::endl;
 }
 
-      
 
-  
+
+
index 7c06a1c00f0db8f61ec5d14f08225a7a52756e86..204d65b4eb52c90de0e172dff56a91d5a1157295 100644 (file)
@@ -1,6 +1,6 @@
 //-----------------------------------------------------------------------------
 //    $Id$
-//    Version: $Name$ 
+//    Version: $Name$
 //
 //    Copyright (C) 2007, 2008, 2010 by the deal.II authors
 //
@@ -22,7 +22,7 @@
 template<int dim>
 void
 check_function_value_consistency(
-  const Function<dim>f,
+  const Function<dim> &f,
   unsigned int sub,
   double threshold = 1.e-15)
 {
@@ -31,26 +31,26 @@ check_function_value_consistency(
 
   std::vector<double> f1(quadrature.size());
   std::vector<Vector<double> > f2(quadrature.size(), Vector<double>(f.n_components));
-  
+
   f.vector_value_list(quadrature.get_points(), f2);
 
   deallog << "value vs vector value list";
-  for (unsigned int d=0;d<f.n_components;++d)
-    for (unsigned int i=0;i<f1.size();++i)
+  for (unsigned int d=0; d<f.n_components; ++d)
+    for (unsigned int i=0; i<f1.size(); ++i)
       {
-       const double v = f.value(quadrature.point(i), d);
-       if (std::fabs(v-f2[i](d)) > threshold)
-         deallog << "v-vl " << d << ':' << i << ':' << v-f2[i](d);
+        const double v = f.value(quadrature.point(i), d);
+        if (std::fabs(v-f2[i](d)) > threshold)
+          deallog << "v-vl " << d << ':' << i << ':' << v-f2[i](d);
       }
   deallog << std::endl << "value list vs vector value list";
-  for (unsigned int d=0;d<f.n_components;++d)
+  for (unsigned int d=0; d<f.n_components; ++d)
     {
       f.value_list(quadrature.get_points(), f1, d);
-      for (unsigned int i=0;i<f1.size();++i)
-       {
-         if (std::fabs(f1[i]-f2[i](d)) > threshold)
-           deallog << ' ' << d << ':' << i << ':' << f1[i]-f2[i](d);
-       }
+      for (unsigned int i=0; i<f1.size(); ++i)
+        {
+          if (std::fabs(f1[i]-f2[i](d)) > threshold)
+            deallog << ' ' << d << ':' << i << ':' << f1[i]-f2[i](d);
+        }
     }
   deallog << std::endl;
 }
@@ -59,7 +59,7 @@ check_function_value_consistency(
 template<int dim>
 void
 check_function_gradient_consistency(
-  const Function<dim>f,
+  const Function<dim> &f,
   unsigned int sub,
   double threshold = 1.e-15)
 {
@@ -68,29 +68,29 @@ check_function_gradient_consistency(
 
   std::vector<Tensor<1,dim> > f1(quadrature.size());
   std::vector<std::vector<Tensor<1,dim> > > f2(quadrature.size(),
-                                              std::vector<Tensor<1,dim> >(f.n_components));
-  
+                                               std::vector<Tensor<1,dim> >(f.n_components));
+
   f.vector_gradient_list(quadrature.get_points(), f2);
 
   deallog << "gradient vs vector gradient list";
-  for (unsigned int d=0;d<f.n_components;++d)
-    for (unsigned int i=0;i<f1.size();++i)
+  for (unsigned int d=0; d<f.n_components; ++d)
+    for (unsigned int i=0; i<f1.size(); ++i)
       {
-       const Tensor<1,dim> v = f.gradient(quadrature.point(i), d)-f2[i][d];
-       
-       if (std::sqrt(v*v) > threshold)
-         deallog << "v-vl " << d << ':' << i << ':' << v;
+        const Tensor<1,dim> v = f.gradient(quadrature.point(i), d)-f2[i][d];
+
+        if (std::sqrt(v*v) > threshold)
+          deallog << "v-vl " << d << ':' << i << ':' << v;
       }
   deallog << std::endl << "gradient list vs vector gradient list";
-  for (unsigned int d=0;d<f.n_components;++d)
+  for (unsigned int d=0; d<f.n_components; ++d)
     {
       f.gradient_list(quadrature.get_points(), f1, d);
-      for (unsigned int i=0;i<f1.size();++i)
-       {
-         const Tensor<1,dim> v = f1[i]-f2[i][d];
-         if (std::sqrt(v*v) > threshold)
-           deallog << ' ' << d << ':' << i << ':' << v;
-       }
+      for (unsigned int i=0; i<f1.size(); ++i)
+        {
+          const Tensor<1,dim> v = f1[i]-f2[i][d];
+          if (std::sqrt(v*v) > threshold)
+            deallog << ' ' << d << ':' << i << ':' << v;
+        }
     }
   deallog << std::endl;
 }
@@ -104,26 +104,26 @@ template <int dim>
 class DerivativeTestFunction :
   public AutoDerivativeFunction<dim>
 {
-  public:
-    DerivativeTestFunction(const Function<dim>&, const double h);
-    ~DerivativeTestFunction();
-    
-    virtual void vector_value (const Point<dim>& points, Vector<double>& value) const;
-    virtual double value (const Point<dim>& points, const unsigned int component) const;
-    virtual void vector_value_list (const std::vector< Point< dim > > &points,
-                                   std::vector< Vector< double > > &values) const;
-    
-  private:
-    const Function<dim>& func;
+public:
+  DerivativeTestFunction(const Function<dim> &, const double h);
+  ~DerivativeTestFunction();
+
+  virtual void vector_value (const Point<dim> &points, Vector<double> &value) const;
+  virtual double value (const Point<dim> &points, const unsigned int component) const;
+  virtual void vector_value_list (const std::vector< Point< dim > > &points,
+                                  std::vector< Vector< double > > &values) const;
+
+private:
+  const Function<dim> &func;
 };
 
 
 template <int dim>
-DerivativeTestFunction<dim>::DerivativeTestFunction(const Function<dim>f,
-                                                   const double h)
-               :
-               AutoDerivativeFunction<dim>(h, f.n_components),
-               func(f)
+DerivativeTestFunction<dim>::DerivativeTestFunction(const Function<dim> &f,
+                                                    const double h)
+  :
+  AutoDerivativeFunction<dim>(h, f.n_components),
+  func(f)
 {
   this->set_formula(AutoDerivativeFunction<dim>::FourthOrder);
 }
@@ -146,8 +146,8 @@ DerivativeTestFunction<dim>::vector_value_list (
 
 template<int dim>
 void DerivativeTestFunction<dim>::vector_value (
-  const Point<dim>point,
-  Vector<double>value) const
+  const Point<dim> &point,
+  Vector<double> &value) const
 {
   func.vector_value(point, value);
 }
@@ -155,11 +155,11 @@ void DerivativeTestFunction<dim>::vector_value (
 
 template<int dim>
 double DerivativeTestFunction<dim>::value (
-    const Point<dim>& point,
-    const unsigned int comp) const
+  const Point<dim> &point,
+  const unsigned int comp) const
 {
 //  std::cerr << '[' << point << '!' << func.value(point, comp) << ']';
-  
+
   return func.value(point, comp);
 }
 
@@ -168,62 +168,62 @@ double DerivativeTestFunction<dim>::value (
 template<int dim>
 void
 check_gradient(
-  const Function<dim>f,
+  const Function<dim> &f,
   unsigned int sub,
   double threshold = 1./14.)
 {
   DerivativeTestFunction<dim> dtest1(f, 1.e-2);
   DerivativeTestFunction<dim> dtest2(f, 2.e-2);
-  
+
   QMidpoint<1> mid;
   QIterated<dim> quadrature(mid, sub);
-  const std::vector<Point<dim> >points = quadrature.get_points();
-  
+  const std::vector<Point<dim> > &points = quadrature.get_points();
+
   std::vector<std::vector<Tensor<1,dim> > >
-    gradients(f.n_components, std::vector<Tensor<1,dim> >(points.size()));
+  gradients(f.n_components, std::vector<Tensor<1,dim> >(points.size()));
   std::vector<std::vector<Tensor<1,dim> > >
-    gradients1(f.n_components, std::vector<Tensor<1,dim> >(points.size()));
+  gradients1(f.n_components, std::vector<Tensor<1,dim> >(points.size()));
   std::vector<std::vector<Tensor<1,dim> > >
-    gradients2(f.n_components, std::vector<Tensor<1,dim> >(points.size()));
+  gradients2(f.n_components, std::vector<Tensor<1,dim> >(points.size()));
 
   deallog << "gradients vs difference quotients";
 
   f.vector_gradients(points, gradients);
   dtest1.vector_gradients(points, gradients1);
   dtest2.vector_gradients(points, gradients2);
-  
-                                  // Compare gradients and difference quotients
-  for (unsigned int k=0;k<gradients.size();++k)
-    for (unsigned int i=0;i<gradients[k].size();++i)
+
+  // Compare gradients and difference quotients
+  for (unsigned int k=0; k<gradients.size(); ++k)
+    for (unsigned int i=0; i<gradients[k].size(); ++i)
       {
-                                        // Compute difference
-       Tensor<1,dim> d1 = gradients1[k][i] - gradients[k][i];
-       Tensor<1,dim> d2 = gradients2[k][i] - gradients[k][i];
-       
-                                        // If the difference is
-                                        // already small, we are fine
-       if (d1.norm() > 1.e-13)
-         {
-                                            // Check for
-                                            // convergence. For full
-                                            // 4th order, gradients2
-                                            // should be 16 times as
-                                            // large, so let's be a
-                                            // bit generous
-           if (threshold * d2.norm() < d1.norm())
-             {
-               deallog << "Gradient error: point " << i
-                       << " (" << points[i] << " )"
-                       << " comp " << k
-//                     << " norms " << d1.norm() << " " << d2.norm()
-                       << std::endl;
-               for (unsigned int d=0;d<dim;++d)
-                 deallog
-                   << " " << gradients[k][i][d]
-                   << " " << gradients1[i][k][d]
-                   << std::endl;
-             }
-         }
+        // Compute difference
+        Tensor<1,dim> d1 = gradients1[k][i] - gradients[k][i];
+        Tensor<1,dim> d2 = gradients2[k][i] - gradients[k][i];
+
+        // If the difference is
+        // already small, we are fine
+        if (d1.norm() > 1.e-13)
+          {
+            // Check for
+            // convergence. For full
+            // 4th order, gradients2
+            // should be 16 times as
+            // large, so let's be a
+            // bit generous
+            if (threshold * d2.norm() < d1.norm())
+              {
+                deallog << "Gradient error: point " << i
+                        << " (" << points[i] << " )"
+                        << " comp " << k
+//      << " norms " << d1.norm() << " " << d2.norm()
+                        << std::endl;
+                for (unsigned int d=0; d<dim; ++d)
+                  deallog
+                      << " " << gradients[k][i][d]
+                      << " " << gradients1[i][k][d]
+                      << std::endl;
+              }
+          }
       }
   deallog << std::endl;
 }
index 1c9e3dbbece9a860bd634b108ea6f7f10fc3738a..2db6abdb4af809472ea6e7759afc30c1d46f473a 100644 (file)
 #include <fstream>
 #include <string>
 
-#define CHECK(F) { deallog << #F << std::endl; \
-  F f;                                                         \
-  check_function_value_consistency(f, 5);                              \
-  check_function_gradient_consistency(f, 5);                   \
-  check_gradient(f, 5); \
-}  
-  
+#define CHECK(F) { deallog << #F << std::endl;  \
+    F f;                \
+    check_function_value_consistency(f, 5);       \
+    check_function_gradient_consistency(f, 5);      \
+    check_gradient(f, 5); \
+  }
+
+
+#define CHECKN(F,arg) { deallog << #F << '(' << arg << ')' << std::endl;  \
+    F f(arg);               \
+    check_function_value_consistency(f, arg+1);       \
+    check_function_gradient_consistency(f, arg+1);      \
+  }
 
-#define CHECKN(F,arg) { deallog << #F << '(' << arg << ')' << std::endl;       \
-  F f(arg);                                                            \
-  check_function_value_consistency(f, arg+1);                          \
-  check_function_gradient_consistency(f, arg+1);                       \
-}  
-  
 
 int main()
 {
@@ -67,5 +67,5 @@ int main()
   CHECK(Functions::CosineGradFunction<3>);
   CHECK(Functions::ExpFunction<1>);
   CHECK(Functions::ExpFunction<2>);
-  CHECK(Functions::ExpFunction<3>);  
+  CHECK(Functions::ExpFunction<3>);
 }
index 093b405ac2faa34b735b7838dcf187f8bbb87a63..d8190b0f454b98785613b438eaf504f069f73eb1 100644 (file)
 
 
 template <int dim>
-void check_values(const Function<dim>f)
+void check_values(const Function<dim> &f)
 {
   Point<dim> p;
-  for(unsigned int i=0; i<dim; ++i)
+  for (unsigned int i=0; i<dim; ++i)
     p[i] = i+1;
-  deallog << f.value(p) << std::endl; 
+  deallog << f.value(p) << std::endl;
   deallog << " values checked" << std::endl;
 }
 
 template <int dim>
-void check_value_list(const Function<dim>f)
+void check_value_list(const Function<dim> &f)
 {
   const unsigned int max_points = 3;
   std::vector< Point<dim> >  point_vector(max_points);
-  for(unsigned int j=0; j<max_points; ++j)
-  {
-    Point<dim> p;
-    for(unsigned int i=0; i<dim; ++i)
-      p[i]=j+1;
-    point_vector[j] = p;
-  }
+  for (unsigned int j=0; j<max_points; ++j)
+    {
+      Point<dim> p;
+      for (unsigned int i=0; i<dim; ++i)
+        p[i]=j+1;
+      point_vector[j] = p;
+    }
   std::vector< double > values(max_points);
   f.value_list(point_vector, values);
-  for(unsigned int j=0; j<max_points; ++j)
-    deallog << values[j] << std::endl; 
+  for (unsigned int j=0; j<max_points; ++j)
+    deallog << values[j] << std::endl;
   deallog << " value_list checked" << std::endl;
 }
 
 template <int dim>
-void check_vector_value_list(const Function<dim>f)
+void check_vector_value_list(const Function<dim> &f)
 {
   const unsigned int max_points = 3;
   std::vector< Point<dim> >  point_vector(max_points);
-  for(unsigned int j=0; j<max_points; ++j)
-  {
-    Point<dim> p;
-    for(unsigned int i=0; i<dim; ++i)
-      p[i]=j+1;
-    point_vector[j] = p;
-  }
+  for (unsigned int j=0; j<max_points; ++j)
+    {
+      Point<dim> p;
+      for (unsigned int i=0; i<dim; ++i)
+        p[i]=j+1;
+      point_vector[j] = p;
+    }
   std::vector< Vector<double> > values(max_points, Vector<double>(1));
   f.vector_value_list(point_vector, values);
-  for(unsigned int j=0; j<max_points; ++j)
-    deallog << values[j](0) << std::endl; 
+  for (unsigned int j=0; j<max_points; ++j)
+    deallog << values[j](0) << std::endl;
   deallog << " vector_value_list checked" << std::endl;
 }
 
 template <int dim>
-void check_gradients(const Function<dim>f)
+void check_gradients(const Function<dim> &f)
 {
   Point<dim> p;
-  for(unsigned int i=0; i<dim; ++i)
-  {
-    p[i] = i+3;
-  }
+  for (unsigned int i=0; i<dim; ++i)
+    {
+      p[i] = i+3;
+    }
   Tensor <1, dim> grads = f.gradient(p);
-  for(unsigned int i=0; i<dim; ++i)
-  {
-    deallog << i <<"-der: " << grads[i] << std::endl; 
-  }
+  for (unsigned int i=0; i<dim; ++i)
+    {
+      deallog << i <<"-der: " << grads[i] << std::endl;
+    }
   deallog << " gradients checked" << std::endl;
 }
 
 template <int dim>
-void check_gradient_list(const Function<dim>f)
+void check_gradient_list(const Function<dim> &f)
 {
   const unsigned int max_points = 3;
   std::vector< Point<dim> >  point_vector(max_points);
-  for(unsigned int j=0; j<max_points; ++j)
-  {
-    Point<dim> p;
-    for(unsigned int i=0; i<dim; ++i)
-      p[i]=j+1;
-    point_vector[j] = p;
-  }
+  for (unsigned int j=0; j<max_points; ++j)
+    {
+      Point<dim> p;
+      for (unsigned int i=0; i<dim; ++i)
+        p[i]=j+1;
+      point_vector[j] = p;
+    }
   std::vector< Tensor<1,dim> > grads(max_points);
   f.gradient_list(point_vector, grads);
-  for(unsigned int j=0; j<max_points; ++j)
-    deallog << grads[j] << std::endl; 
+  for (unsigned int j=0; j<max_points; ++j)
+    deallog << grads[j] << std::endl;
   deallog << " gradient_list checked" << std::endl;
 }
 
 template <int dim>
-void check_vector_gradient_list(const Function<dim>f)
+void check_vector_gradient_list(const Function<dim> &f)
 {
   const unsigned int max_points = 3;
   std::vector< Point<dim> >  point_vector(max_points);
-  for(unsigned int j=0; j<max_points; ++j)
-  {
-    Point<dim> p;
-    for(unsigned int i=0; i<dim; ++i)
-      p[i]=j+1;
-    point_vector[j] = p;
-  }
-  std::vector< std::vector< Tensor<1,dim> > >  gradients(max_points, 
-            std::vector< Tensor<1,dim> > (1));
+  for (unsigned int j=0; j<max_points; ++j)
+    {
+      Point<dim> p;
+      for (unsigned int i=0; i<dim; ++i)
+        p[i]=j+1;
+      point_vector[j] = p;
+    }
+  std::vector< std::vector< Tensor<1,dim> > >  gradients(max_points,
+                                                         std::vector< Tensor<1,dim> > (1));
   f.vector_gradient_list(point_vector, gradients);
-  for(unsigned int j=0; j<max_points; ++j)
-    deallog << gradients[j][0] << std::endl; 
+  for (unsigned int j=0; j<max_points; ++j)
+    deallog << gradients[j][0] << std::endl;
   deallog << " vector_gradient_list checked" << std::endl;
 }
 
 template <int dim>
-void check_laplacian(const Function<dim>f)
+void check_laplacian(const Function<dim> &f)
 {
   Point<dim> p;
-  for(unsigned int i=0; i<dim; ++i)
+  for (unsigned int i=0; i<dim; ++i)
     p[i] = i+1;
   Assert( std::fabs(f.laplacian(p)) < 1e-12,
-         ExcInternalError());
+          ExcInternalError());
 }
-  
+
 template <int dim>
-void check_laplacian_list(const Function<dim>f)
+void check_laplacian_list(const Function<dim> &f)
 {
   const unsigned int max_points = 3;
   std::vector< Point<dim> >  point_vector(max_points);
-  for(unsigned int j=0; j<max_points; ++j)
-  {
-    Point<dim> p;
-    for(unsigned int i=0; i<dim; ++i)
-      p[i]=j+1;
-    point_vector[j] = p;
-  }
+  for (unsigned int j=0; j<max_points; ++j)
+    {
+      Point<dim> p;
+      for (unsigned int i=0; i<dim; ++i)
+        p[i]=j+1;
+      point_vector[j] = p;
+    }
   std::vector< double > values(max_points);
   f.laplacian_list(point_vector, values);
-  for(unsigned int j=0; j<max_points; ++j)
+  for (unsigned int j=0; j<max_points; ++j)
     Assert( std::fabs(values[j]) < 1e-12,
-         ExcInternalError());
+            ExcInternalError());
 }
 
 int main()
@@ -173,7 +173,7 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   if (true)
     {
       deallog << " Functions::Q1WedgeFunction<2>" << std::endl;
index fbcd1ee10076f9b2d8cc0d6b8a956cb6e6510420..23fbb2ee9caec570b6d95514ea3253eaf0cb5978 100644 (file)
 
 
 template <int dim>
-void check_value (const Function<dim>f)
+void check_value (const Function<dim> &f)
 {
   Point<dim> p;
   for (unsigned int i=0; i<dim; i++)
     p[i] = i;
-  
+
   deallog << f.value(p) << std::endl;
   deallog << "values checked" << std::endl;
 
 }
 
 template <int dim>
-void check_value_list (const Function<dim>f)
+void check_value_list (const Function<dim> &f)
 {
   const unsigned int max_number_of_points = 5;
   std::vector< Point<dim> >  points(max_number_of_points);
-  
-  for(unsigned int i=0; i<max_number_of_points; ++i)
-  {
-    Point<dim> p;
-    for(unsigned int j=0; j<dim; ++j)
-      p[j]=i+1;
-    
-    points[i] = p;
-  }
+
+  for (unsigned int i=0; i<max_number_of_points; ++i)
+    {
+      Point<dim> p;
+      for (unsigned int j=0; j<dim; ++j)
+        p[j]=i+1;
+
+      points[i] = p;
+    }
   std::vector< double > values(max_number_of_points);
   f.value_list(points, values);
 
-  for(unsigned int j=0; j<max_number_of_points; ++j)
-    deallog << values[j] << std::endl; 
+  for (unsigned int j=0; j<max_number_of_points; ++j)
+    deallog << values[j] << std::endl;
 
   deallog << " value_list checked" << std::endl;
 }
 
 
 template <int dim>
-void check_gradient (const Function<dim>f)
+void check_gradient (const Function<dim> &f)
 {
   Point<dim> p;
   for (unsigned int i=0; i<dim; i++)
     p[i] = i;
-  
+
   deallog << f.gradient(p) << std::endl;
   deallog << " gradients checked" << std::endl;
 }
 
 template <int dim>
-void check_gradient_list (const Function<dim>f)
+void check_gradient_list (const Function<dim> &f)
 {
   const unsigned int max_number_of_points = 5;
   std::vector< Point<dim> >  points(max_number_of_points);
-  
-  for(unsigned int i=0; i<max_number_of_points; ++i)
-  {
-    Point<dim> p;
-    for(unsigned int j=0; j<dim; ++j)
-      p[j]=i+1;
-    
-    points[i] = p;
-  }
+
+  for (unsigned int i=0; i<max_number_of_points; ++i)
+    {
+      Point<dim> p;
+      for (unsigned int j=0; j<dim; ++j)
+        p[j]=i+1;
+
+      points[i] = p;
+    }
   std::vector< Tensor<1,dim> > tensors(max_number_of_points);
   f.gradient_list(points, tensors);
 
-  for(unsigned int j=0; j<max_number_of_points; ++j)
-    deallog << tensors[j] << std::endl; 
+  for (unsigned int j=0; j<max_number_of_points; ++j)
+    deallog << tensors[j] << std::endl;
 
   deallog << " gradient_list checked" << std::endl;
 }
 
 
 template <int dim>
-void check_laplacian (const Function<dim>f)
+void check_laplacian (const Function<dim> &f)
 {
   Point<dim> p;
   for (unsigned int i=0; i<dim; i++)
     p[i] = i;
-  
+
   deallog << f.laplacian(p) << std::endl;
   deallog << " laplacians checked" << std::endl;
 }
 
 
 template <int dim>
-void check_laplacian_list (const Function<dim>f)
+void check_laplacian_list (const Function<dim> &f)
 {
   const unsigned int max_number_of_points = 5;
   std::vector< Point<dim> >  points(max_number_of_points);
-  
-  for(unsigned int i=0; i<max_number_of_points; ++i)
-  {
-    Point<dim> p;
-    for(unsigned int j=0; j<dim; ++j)
-      p[j]=i+1;
-    
-    points[i] = p;
-  }
+
+  for (unsigned int i=0; i<max_number_of_points; ++i)
+    {
+      Point<dim> p;
+      for (unsigned int j=0; j<dim; ++j)
+        p[j]=i+1;
+
+      points[i] = p;
+    }
   std::vector< double > values(max_number_of_points);
   f.laplacian_list(points, values);
 
-  for(unsigned int j=0; j<max_number_of_points; ++j)
-    deallog << values[j] << std::endl; 
+  for (unsigned int j=0; j<max_number_of_points; ++j)
+    deallog << values[j] << std::endl;
+
   deallog << " laplacian_list checked" << std::endl;
 }
 
@@ -144,33 +144,33 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   deallog << "Functions PillowFunction" << std::endl;
   check_value (Functions::PillowFunction<1>());
   check_value (Functions::PillowFunction<2>());
   check_value (Functions::PillowFunction<3>());
-  
+
   check_value_list (Functions::PillowFunction<1>());
   check_value_list (Functions::PillowFunction<2>());
   check_value_list (Functions::PillowFunction<3>());
-  
+
   check_gradient (Functions::PillowFunction<1>());
   check_gradient (Functions::PillowFunction<2>());
   check_gradient (Functions::PillowFunction<3>());
-  
+
   check_gradient_list (Functions::PillowFunction<1>());
   check_gradient_list (Functions::PillowFunction<2>());
   check_gradient_list (Functions::PillowFunction<3>());
-  
+
   check_laplacian (Functions::PillowFunction<1>());
   check_laplacian (Functions::PillowFunction<2>());
   check_laplacian (Functions::PillowFunction<3>());
-  
+
   check_laplacian_list (Functions::PillowFunction<1>());
   check_laplacian_list (Functions::PillowFunction<2>());
   check_laplacian_list (Functions::PillowFunction<3>());
 
-     
+
 }
 
 
index f031202b89700255e465a5fdf09c145448a85dcc..6b50070eef5c9c882cddd6eaada28dd27787ec9a 100644 (file)
 
 template<int dim>
 void
-check_function(const Functions::FlowFunction<dim>f,
-              unsigned int sub,
-              std::ostream& out)
+check_function(const Functions::FlowFunction<dim> &f,
+               unsigned int sub,
+               std::ostream &out)
 {
   DerivativeTestFunction<dim> dtest1(f, 1.e-2);
   DerivativeTestFunction<dim> dtest2(f, 2.e-2);
-                                  // Prepare a vector with a single
-                                  // patch stretching over the cube
-                                  // [-1,1]^dim
+  // Prepare a vector with a single
+  // patch stretching over the cube
+  // [-1,1]^dim
   std::vector<DataOutBase::Patch<dim,dim> > patches(1);
   unsigned int vertex_number = 0;
-  for (unsigned int iz=0;iz < ((dim>2) ? 2 : 1) ;++iz)
-    for (unsigned int iy=0;iy < ((dim>1) ? 2 : 1) ;++iy)
-      for (unsigned int ix=0;ix < 2 ;++ix)
-       {
-         if (dim>0) patches[0].vertices[vertex_number](0) = -1. + 2.*ix;
-         if (dim>1) patches[0].vertices[vertex_number](1) = -1. + 2.*iy;
-         if (dim>2) patches[0].vertices[vertex_number](2) = -1. + 2.*iz;
-         ++vertex_number;
-       }
-  for (unsigned int i=0;i<GeometryInfo<dim>::faces_per_cell;++i)
+  for (unsigned int iz=0; iz < ((dim>2) ? 2 : 1) ; ++iz)
+    for (unsigned int iy=0; iy < ((dim>1) ? 2 : 1) ; ++iy)
+      for (unsigned int ix=0; ix < 2 ; ++ix)
+        {
+          if (dim>0) patches[0].vertices[vertex_number](0) = -1. + 2.*ix;
+          if (dim>1) patches[0].vertices[vertex_number](1) = -1. + 2.*iy;
+          if (dim>2) patches[0].vertices[vertex_number](2) = -1. + 2.*iz;
+          ++vertex_number;
+        }
+  for (unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
     patches[0].neighbors[i] = numbers::invalid_unsigned_int;
   patches[0].patch_index = 0;
   patches[0].n_subdivisions = sub;
   patches[0].points_are_available = false;
 
   vertex_number = 1;
-  for (unsigned int d=0;d<dim;++d)
+  for (unsigned int d=0; d<dim; ++d)
     vertex_number *= (sub+1);
   patches[0].data.reinit(f.n_components, vertex_number);
 
-                                  // Build the vector of quadrature points;
+  // Build the vector of quadrature points;
   std::vector<Point<dim> > points(vertex_number);
   const double h = 2./sub;
   vertex_number = 0;
-  for (unsigned int iz=0;iz <= ((dim>2) ? sub : 0) ;++iz)
-    for (unsigned int iy=0;iy <= ((dim>1) ? sub : 0) ;++iy)
-      for (unsigned int ix=0;ix <= sub ;++ix)
-       {
-         if (dim>0) points[vertex_number](0) = -1.+ix*h;
-         if (dim>1) points[vertex_number](1) = -1.+iy*h;
-         if (dim>2) points[vertex_number](2) = -1.+iz*h;
-         ++vertex_number;
-       }
-  
+  for (unsigned int iz=0; iz <= ((dim>2) ? sub : 0) ; ++iz)
+    for (unsigned int iy=0; iy <= ((dim>1) ? sub : 0) ; ++iy)
+      for (unsigned int ix=0; ix <= sub ; ++ix)
+        {
+          if (dim>0) points[vertex_number](0) = -1.+ix*h;
+          if (dim>1) points[vertex_number](1) = -1.+iy*h;
+          if (dim>2) points[vertex_number](2) = -1.+iz*h;
+          ++vertex_number;
+        }
+
   std::vector<Vector<double> > values(points.size(), Vector<double>(f.n_components));
   std::vector<std::vector<double> > values2(f.n_components,
-                                           std::vector<double>(points.size()));
+                                            std::vector<double>(points.size()));
   f.vector_value_list(points, values);
   f.vector_values(points, values2);
-  for (unsigned int i=0;i<values.size();++i)
-    for (unsigned int j=0;j<values[i].size();++j)
+  for (unsigned int i=0; i<values.size(); ++i)
+    for (unsigned int j=0; j<values[i].size(); ++j)
       {
-                                        // generate data, but
-                                        // truncate too small values
-                                        // to avoid output that
-                                        // depends on round-off
-       if (std::fabs (values[i](j)) > 1e-10)
-         patches[0].data(j, i) = values[i](j);
-       else
-         patches[0].data(j, i) = 0;
-       if (values[i](j) != values2[j][i])
-         deallog << "Error values (" << i << ',' << j << ") : "
-                 << values[i](j) << " != " << values2[j][i] << std::endl;
+        // generate data, but
+        // truncate too small values
+        // to avoid output that
+        // depends on round-off
+        if (std::fabs (values[i](j)) > 1e-10)
+          patches[0].data(j, i) = values[i](j);
+        else
+          patches[0].data(j, i) = 0;
+        if (values[i](j) != values2[j][i])
+          deallog << "Error values (" << i << ',' << j << ") : "
+                  << values[i](j) << " != " << values2[j][i] << std::endl;
       }
-  
+
   deallog << "Gradients ";
-                                  // Compute gradients and difference approximations
+  // Compute gradients and difference approximations
   std::vector<std::vector<Tensor<1,dim> > >
-    gradients(f.n_components, std::vector<Tensor<1,dim> >(points.size()));
+  gradients(f.n_components, std::vector<Tensor<1,dim> >(points.size()));
   std::vector<std::vector<Tensor<1,dim> > >
-    gradients1(points.size(), std::vector<Tensor<1,dim> >(f.n_components));
+  gradients1(points.size(), std::vector<Tensor<1,dim> >(f.n_components));
   std::vector<std::vector<Tensor<1,dim> > >
-    gradients2(points.size(), std::vector<Tensor<1,dim> >(f.n_components));
-  
+  gradients2(points.size(), std::vector<Tensor<1,dim> >(f.n_components));
+
   f.vector_gradients(points, gradients);
   dtest1.vector_gradient_list(points, gradients1);
   dtest2.vector_gradient_list(points, gradients2);
 
-                                  // Compare gradients and difference quotients
-  for (unsigned int k=0;k<gradients.size();++k)
-    for (unsigned int i=0;i<gradients[k].size();++i)
+  // Compare gradients and difference quotients
+  for (unsigned int k=0; k<gradients.size(); ++k)
+    for (unsigned int i=0; i<gradients[k].size(); ++i)
       {
-                                        // Compute difference
-       Tensor<1,dim> d1 = gradients1[i][k] - gradients[k][i];
-       Tensor<1,dim> d2 = gradients2[i][k] - gradients[k][i];
-       
-                                        // If the difference is
-                                        // already small, we are fine
-       if (d1.norm() > 1.e-13)
-         {
-                                            // Check for
-                                            // convergence. For full
-                                            // 4th order, gradients2
-                                            // should be 16 times as
-                                            // large, so let's be a
-                                            // bit generous
-           if (d2.norm() < 12.* d1.norm())
-             {
-               deallog << "Gradient error: point " << i
-                       << " (" << points[i] << " )"
-                       << " comp " << k
-//                     << " norms " << d1.norm() << " " << d2.norm()
-                       << std::endl;
-               for (unsigned int d=0;d<dim;++d)
-                 deallog
-                   << " " << gradients[k][i][d]
-                   << " " << gradients1[i][k][d]
-                   << std::endl;
-             }
-         }
+        // Compute difference
+        Tensor<1,dim> d1 = gradients1[i][k] - gradients[k][i];
+        Tensor<1,dim> d2 = gradients2[i][k] - gradients[k][i];
+
+        // If the difference is
+        // already small, we are fine
+        if (d1.norm() > 1.e-13)
+          {
+            // Check for
+            // convergence. For full
+            // 4th order, gradients2
+            // should be 16 times as
+            // large, so let's be a
+            // bit generous
+            if (d2.norm() < 12.* d1.norm())
+              {
+                deallog << "Gradient error: point " << i
+                        << " (" << points[i] << " )"
+                        << " comp " << k
+//      << " norms " << d1.norm() << " " << d2.norm()
+                        << std::endl;
+                for (unsigned int d=0; d<dim; ++d)
+                  deallog
+                      << " " << gradients[k][i][d]
+                      << " " << gradients1[i][k][d]
+                      << std::endl;
+              }
+          }
       }
   deallog << "tested" << std::endl;
 
-                                  // Check if divergence is zero
+  // Check if divergence is zero
   deallog << "Divergence ";
-  
-  for (unsigned int k=0;k<points.size();++k)
+
+  for (unsigned int k=0; k<points.size(); ++k)
     {
       double div = 0.;
-      for (unsigned int d=0;d<dim;++d)
-       div += gradients[d][k][d];
+      for (unsigned int d=0; d<dim; ++d)
+        div += gradients[d][k][d];
       if (std::fabs(div)> 1.e-13)
-       deallog << "Divergence " << k << " "
-               << div << std::endl;
+        deallog << "Divergence " << k << " "
+                << div << std::endl;
     }
   deallog << "tested" << std::endl;
-  
+
   f.vector_laplacian_list(points, values);
   f.vector_laplacians(points, values2);
   double sum = 0.;
-  for (unsigned int i=0;i<values.size();++i)
-    for (unsigned int j=0;j<values[i].size();++j)
+  for (unsigned int i=0; i<values.size(); ++i)
+    for (unsigned int j=0; j<values[i].size(); ++j)
       {
-       sum += values[i](j)*values[i](j);
-       if (values[i](j) != values2[j][i])
-         deallog << "Error values (" << i << ',' << j << ") : "
-                 << values[i](j) << " != " << values2[j][i] << std::endl;
+        sum += values[i](j)*values[i](j);
+        if (values[i](j) != values2[j][i])
+          deallog << "Error values (" << i << ',' << j << ") : "
+                  << values[i](j) << " != " << values2[j][i] << std::endl;
       }
   deallog << "Laplacians " << std::sqrt(sum)/points.size() << std::endl;
-  
+
   std::vector<std::string> names(f.n_components);
-  for (unsigned int i=0;i<names.size();++i)
+  for (unsigned int i=0; i<names.size(); ++i)
     {
       names[i] = std::string("comp");
     }
-  
+
   DataOutBase dout;
   DataOutBase::DXFlags dxflags;
   DataOutBase::GnuplotFlags gflags;
@@ -201,7 +201,7 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   if (true)
     {
       deallog << " Functions::StokesCosine<2>" << std::endl;
@@ -220,9 +220,9 @@ int main()
     {
       deallog << "Functions::StokesLSingularity" << std::endl;
       Functions::StokesLSingularity f;
-                                      // Use odd number of points to
-                                      // avoid lines with
-                                      // discontinuous derivatives.
+      // Use odd number of points to
+      // avoid lines with
+      // discontinuous derivatives.
       check_function(f, 5, logfile);
     }
 
@@ -232,14 +232,14 @@ int main()
       Functions::Kovasznay f(10.);
       check_function(f, 4, logfile);
     }
-  
+
   if (true)
     {
       deallog << "Functions::PoisseuilleFlow<2>" << std::endl;
       Functions::PoisseuilleFlow<2> f(.8, 10.);
       check_function(f, 4, logfile);
     }
-  
+
   if (true)
     {
       deallog << "Functions::PoisseuilleFlow<3>" << std::endl;
index 0292cae6d4a9d9360b2b850df680c103ecfbe011..1772b8b09a0dc6b85e4dc86d92b6f993768126af 100644 (file)
@@ -25,16 +25,16 @@ template <int dim>
 void check1 ()
 {
   ScalarFunctionFromFunctionObject<dim>
-    object (&Point<dim>::norm);
+  object (&Point<dim>::norm);
 
   for (unsigned int i=0; i<10; ++i)
     {
       Point<dim> p;
       for (unsigned int d=0; d<dim; ++d)
-       p[d] = i+d;
+        p[d] = i+d;
 
       Assert (object.value(p) == p.norm(),
-             ExcInternalError());
+              ExcInternalError());
     }
 
   deallog << "OK" << std::endl;
@@ -49,18 +49,18 @@ void check2 ()
     q[d] = d;
 
   ScalarFunctionFromFunctionObject<dim>
-    object (std_cxx1x::bind (&Point<dim>::distance,
-                            q,
-                            std_cxx1x::_1));
+  object (std_cxx1x::bind (&Point<dim>::distance,
+                           q,
+                           std_cxx1x::_1));
 
   for (unsigned int i=0; i<10; ++i)
     {
       Point<dim> p;
       for (unsigned int d=0; d<dim; ++d)
-       p[d] = i+d;
+        p[d] = i+d;
 
       Assert (object.value(p) == q.distance (p),
-             ExcInternalError());
+              ExcInternalError());
     }
 
   deallog << "OK" << std::endl;
index fb272d0e917584b193363619c5e2bc342ac97f6d..1aa4223be5ae4050282a5d9e0fc59e0210333931 100644 (file)
@@ -26,7 +26,7 @@ template <int dim>
 void check1 ()
 {
   VectorFunctionFromScalarFunctionObject<dim>
-    object (&Point<dim>::norm, 1, 3);
+  object (&Point<dim>::norm, 1, 3);
 
   Assert (object.n_components == 3, ExcInternalError());
 
@@ -34,17 +34,17 @@ void check1 ()
     {
       Point<dim> p;
       for (unsigned int d=0; d<dim; ++d)
-       p[d] = i+d;
+        p[d] = i+d;
 
       for (unsigned int c=0; c<3; ++c)
-       Assert (object.value(p,c) == (c==1 ? p.norm() : 0),
-               ExcInternalError());
+        Assert (object.value(p,c) == (c==1 ? p.norm() : 0),
+                ExcInternalError());
 
       Vector<double> v(3);
       object.vector_value (p, v);
       for (unsigned int c=0; c<3; ++c)
-       Assert (v(c) == (c==1 ? p.norm() : 0),
-               ExcInternalError());
+        Assert (v(c) == (c==1 ? p.norm() : 0),
+                ExcInternalError());
     }
 
   deallog << "OK" << std::endl;
@@ -59,18 +59,18 @@ void check2 ()
     q[d] = d;
 
   ScalarFunctionFromFunctionObject<dim>
-    object (std_cxx1x::bind (&Point<dim>::distance,
-                            q,
-                            std_cxx1x::_1));
+  object (std_cxx1x::bind (&Point<dim>::distance,
+                           q,
+                           std_cxx1x::_1));
 
   for (unsigned int i=0; i<10; ++i)
     {
       Point<dim> p;
       for (unsigned int d=0; d<dim; ++d)
-       p[d] = i+d;
+        p[d] = i+d;
 
       Assert (object.value(p) == q.distance (p),
-             ExcInternalError());
+              ExcInternalError());
     }
 
   deallog << "OK" << std::endl;
index 58a00bec5a44b028c177e9ced230798ba0976b0f..b0fdd3c5aa9c317fd8b3a58df1ebc425ae022465 100644 (file)
 template <int dim>
 class F : public Function<dim>
 {
-  public:
-    double laplacian (const Point<dim> &p,
-                     const unsigned int c) const
-      {
-       Assert (c == 0, ExcInternalError());
-       return p.norm();
-      }
+public:
+  double laplacian (const Point<dim> &p,
+                    const unsigned int c) const
+  {
+    Assert (c == 0, ExcInternalError());
+    return p.norm();
+  }
 };
 
 
@@ -44,7 +44,7 @@ void check ()
     {
       Point<dim> p;
       for (unsigned int d=0; d<dim; ++d)
-       p[d] = d;
+        p[d] = d;
       points.push_back (p);
     }
 
@@ -54,7 +54,7 @@ void check ()
 
   for (unsigned int i=0; i<10; ++i)
     Assert (points[i].norm() == laplacians[i],
-           ExcInternalError());
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
index 43be5a1f5a6e05a7d28f60581df047154fec703a..ac846cf66d3cc481eec5cfa471ceec2c404d553f 100644 (file)
@@ -28,9 +28,9 @@ class X : public TensorFunction<1,dim>
 {
 public:
   virtual Tensor<1,dim> value (const Point<dim> &p) const
-    {
-      return p;
-    }
+  {
+    return p;
+  }
 };
 
 
@@ -39,7 +39,7 @@ void check1 ()
 {
   X<dim> x;
   VectorFunctionFromTensorFunction<dim>
-    object (x, 1, dim+2);
+  object (x, 1, dim+2);
 
   Assert (object.n_components == dim+2, ExcInternalError());
 
@@ -47,25 +47,25 @@ void check1 ()
     {
       Point<dim> p;
       for (unsigned int d=0; d<dim; ++d)
-       p[d] = i+d;
+        p[d] = i+d;
 
       for (unsigned int c=0; c<dim+2; ++c)
-       if (c==0 || c==dim+1)
-         Assert (object.value(p,c) == 0,
-               ExcInternalError())
-       else
-         Assert (object.value(p,c) == p[c-1],
-                 ExcInternalError());
+        if (c==0 || c==dim+1)
+          Assert (object.value(p,c) == 0,
+                  ExcInternalError())
+          else
+            Assert (object.value(p,c) == p[c-1],
+                    ExcInternalError());
 
       Vector<double> v(dim+2);
       object.vector_value (p, v);
       for (unsigned int c=0; c<dim+2; ++c)
-       if (c==0 || c==dim+1)
-         Assert (v(c) == 0,
-               ExcInternalError())
-       else
-         Assert (v(c) == p[c-1],
-                 ExcInternalError());
+        if (c==0 || c==dim+1)
+          Assert (v(c) == 0,
+                  ExcInternalError())
+          else
+            Assert (v(c) == p[c-1],
+                    ExcInternalError());
     }
 
   deallog << "OK" << std::endl;
index 8bc95fbbba44748b8898c904bbd3d1e504f80984..0222814b577362621ed3d3a0599e10de51e0c73b 100644 (file)
@@ -28,7 +28,7 @@ struct FillTensor
 {
   static void fill_tensor(Tensor<rank, dim> &tensor, int base)
   {
-    for(int i = 0; i < dim; ++i)
+    for (int i = 0; i < dim; ++i)
       FillTensor<rank-1,dim>::fill_tensor(tensor[i], 10 * base + i);
   }
 };
@@ -38,7 +38,7 @@ struct FillTensor<1, dim>
 {
   static void fill_tensor(Tensor<1, dim> &tensor, int base)
   {
-    for(int i = 0; i < dim; ++i)
+    for (int i = 0; i < dim; ++i)
       tensor[i] = 10 * base + i;
   }
 };
@@ -51,7 +51,7 @@ struct PrintTensor
 {
   static void print_tensor(const Tensor<rank, dim> &tensor)
   {
-    for(int i = 0; i < dim; ++i)
+    for (int i = 0; i < dim; ++i)
       {
         PrintTensor<rank-1,dim>::print_tensor(tensor[i]);
         deallog << " ";
@@ -64,7 +64,7 @@ struct PrintTensor<1, dim>
 {
   static void print_tensor(const Tensor<1, dim> &tensor)
   {
-    for(int i = 0; i < dim; ++i)
+    for (int i = 0; i < dim; ++i)
       deallog << tensor[i] << " ";
   }
 };
index c9fc80dc5a3d05dd5e4778d42d419ac27b1cb146..8e9ddd587c8c0547d60e3bafd57a0145379c1e7d 100644 (file)
@@ -37,8 +37,8 @@
 template<int dim>
 void
 check_function_consistency(
-  const Function<dim>f,
-  const Function<dim>gradf,
+  const Function<dim> &f,
+  const Function<dim> &gradf,
   unsigned int sub)
 {
   QMidpoint<1> mid;
@@ -46,29 +46,29 @@ check_function_consistency(
 
   std::vector<Tensor<1,dim> > fg1(quadrature.size());
   std::vector<std::vector<Tensor<1,dim> > > fg2(quadrature.size(), std::vector<Tensor<1,dim> >(1));
-  
+
   std::vector<double> g1(quadrature.size());
   std::vector<Vector<double> > g2(quadrature.size(), Vector<double>(dim));
-  
-                                  // Derivative values are in fg1,
-                                  // fg2, g1, and g2
+
+  // Derivative values are in fg1,
+  // fg2, g1, and g2
   f.gradient_list(quadrature.get_points(), fg1, 0);
   f.vector_gradient_list(quadrature.get_points(), fg2);
   gradf.vector_value_list(quadrature.get_points(), g2);
   deallog << "Gradient consistency ";
-  
-  for (unsigned int d=0;d<dim;++d)
+
+  for (unsigned int d=0; d<dim; ++d)
     {
       gradf.value_list(quadrature.get_points(), g1, d);
-      for (unsigned int i=0;i<g1.size();++i)
-       {
-         if (std::fabs(g1[i]-g2[i](d)) > 1.e-14)
-           deallog << ' ' << i << ':' << g1[i]-g2[i](d);
-         if (std::fabs(g1[i]-fg2[i][0][d]) > 1.e-14)
-           deallog << ' ' << i << ';' << g1[i]-fg2[i][0][d];
-         if (std::fabs(g1[i]-fg1[i][d]) > 1.e-14)
-           deallog << ' ' << i << '#' << g1[i]-fg1[i][d];
-       }
+      for (unsigned int i=0; i<g1.size(); ++i)
+        {
+          if (std::fabs(g1[i]-g2[i](d)) > 1.e-14)
+            deallog << ' ' << i << ':' << g1[i]-g2[i](d);
+          if (std::fabs(g1[i]-fg2[i][0][d]) > 1.e-14)
+            deallog << ' ' << i << ';' << g1[i]-fg2[i][0][d];
+          if (std::fabs(g1[i]-fg1[i][d]) > 1.e-14)
+            deallog << ' ' << i << '#' << g1[i]-fg1[i][d];
+        }
     }
   deallog << std::endl;
 }
@@ -76,153 +76,153 @@ check_function_consistency(
 
 template<int dim>
 void
-check_function_derivative(const Functions::FlowFunction<dim>f,
-              unsigned int sub,
-              std::ostream& out)
+check_function_derivative(const Functions::FlowFunction<dim> &f,
+                          unsigned int sub,
+                          std::ostream &out)
 {
   DerivativeTestFunction<dim> dtest1(f, 1.e-2);
   DerivativeTestFunction<dim> dtest2(f, 2.e-2);
-                                  // Prepare a vector with a single
-                                  // patch stretching over the cube
-                                  // [-1,1]^dim
+  // Prepare a vector with a single
+  // patch stretching over the cube
+  // [-1,1]^dim
   std::vector<DataOutBase::Patch<dim,dim> > patches(1);
   unsigned int vertex_number = 0;
-  for (unsigned int iz=0;iz < ((dim>2) ? 2 : 1) ;++iz)
-    for (unsigned int iy=0;iy < ((dim>1) ? 2 : 1) ;++iy)
-      for (unsigned int ix=0;ix < 2 ;++ix)
-       {
-         if (dim>0) patches[0].vertices[vertex_number](0) = -1. + 2.*ix;
-         if (dim>1) patches[0].vertices[vertex_number](1) = -1. + 2.*iy;
-         if (dim>2) patches[0].vertices[vertex_number](2) = -1. + 2.*iz;
-         ++vertex_number;
-       }
-  for (unsigned int i=0;i<GeometryInfo<dim>::faces_per_cell;++i)
+  for (unsigned int iz=0; iz < ((dim>2) ? 2 : 1) ; ++iz)
+    for (unsigned int iy=0; iy < ((dim>1) ? 2 : 1) ; ++iy)
+      for (unsigned int ix=0; ix < 2 ; ++ix)
+        {
+          if (dim>0) patches[0].vertices[vertex_number](0) = -1. + 2.*ix;
+          if (dim>1) patches[0].vertices[vertex_number](1) = -1. + 2.*iy;
+          if (dim>2) patches[0].vertices[vertex_number](2) = -1. + 2.*iz;
+          ++vertex_number;
+        }
+  for (unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
     patches[0].neighbors[i] = numbers::invalid_unsigned_int;
   patches[0].patch_index = 0;
   patches[0].n_subdivisions = sub;
   patches[0].points_are_available = false;
 
   vertex_number = 1;
-  for (unsigned int d=0;d<dim;++d)
+  for (unsigned int d=0; d<dim; ++d)
     vertex_number *= (sub+1);
   patches[0].data.reinit(f.n_components, vertex_number);
 
-                                  // Build the vector of quadrature points;
+  // Build the vector of quadrature points;
   std::vector<Point<dim> > points(vertex_number);
   const double h = 2./sub;
   vertex_number = 0;
-  for (unsigned int iz=0;iz <= ((dim>2) ? sub : 0) ;++iz)
-    for (unsigned int iy=0;iy <= ((dim>1) ? sub : 0) ;++iy)
-      for (unsigned int ix=0;ix <= sub ;++ix)
-       {
-         if (dim>0) points[vertex_number](0) = -1.+ix*h;
-         if (dim>1) points[vertex_number](1) = -1.+iy*h;
-         if (dim>2) points[vertex_number](2) = -1.+iz*h;
-         ++vertex_number;
-       }
-  
+  for (unsigned int iz=0; iz <= ((dim>2) ? sub : 0) ; ++iz)
+    for (unsigned int iy=0; iy <= ((dim>1) ? sub : 0) ; ++iy)
+      for (unsigned int ix=0; ix <= sub ; ++ix)
+        {
+          if (dim>0) points[vertex_number](0) = -1.+ix*h;
+          if (dim>1) points[vertex_number](1) = -1.+iy*h;
+          if (dim>2) points[vertex_number](2) = -1.+iz*h;
+          ++vertex_number;
+        }
+
   std::vector<Vector<double> > values(points.size(), Vector<double>(f.n_components));
   std::vector<std::vector<double> > values2(f.n_components,
-                                           std::vector<double>(points.size()));
+                                            std::vector<double>(points.size()));
   f.vector_value_list(points, values);
   f.vector_values(points, values2);
-  for (unsigned int i=0;i<values.size();++i)
-    for (unsigned int j=0;j<values[i].size();++j)
+  for (unsigned int i=0; i<values.size(); ++i)
+    for (unsigned int j=0; j<values[i].size(); ++j)
       {
-                                        // generate data, but
-                                        // truncate too small values
-                                        // to avoid output that
-                                        // depends on round-off
-       if (std::fabs (values[i](j)) > 1e-10)
-         patches[0].data(j, i) = values[i](j);
-       else
-         patches[0].data(j, i) = 0;
-       if (values[i](j) != values2[j][i])
-         deallog << "Error values (" << i << ',' << j << ") : "
-                 << values[i](j) << " != " << values2[j][i] << std::endl;
+        // generate data, but
+        // truncate too small values
+        // to avoid output that
+        // depends on round-off
+        if (std::fabs (values[i](j)) > 1e-10)
+          patches[0].data(j, i) = values[i](j);
+        else
+          patches[0].data(j, i) = 0;
+        if (values[i](j) != values2[j][i])
+          deallog << "Error values (" << i << ',' << j << ") : "
+                  << values[i](j) << " != " << values2[j][i] << std::endl;
       }
-  
+
   deallog << "Gradients ";
-                                  // Compute gradients and difference approximations
+  // Compute gradients and difference approximations
   std::vector<std::vector<Tensor<1,dim> > >
-    gradients(f.n_components, std::vector<Tensor<1,dim> >(points.size()));
+  gradients(f.n_components, std::vector<Tensor<1,dim> >(points.size()));
   std::vector<std::vector<Tensor<1,dim> > >
-    gradients1(points.size(), std::vector<Tensor<1,dim> >(f.n_components));
+  gradients1(points.size(), std::vector<Tensor<1,dim> >(f.n_components));
   std::vector<std::vector<Tensor<1,dim> > >
-    gradients2(points.size(), std::vector<Tensor<1,dim> >(f.n_components));
-  
+  gradients2(points.size(), std::vector<Tensor<1,dim> >(f.n_components));
+
   f.vector_gradients(points, gradients);
   dtest1.vector_gradient_list(points, gradients1);
   dtest2.vector_gradient_list(points, gradients2);
 
-                                  // Compare gradients and difference quotients
-  for (unsigned int k=0;k<gradients.size();++k)
-    for (unsigned int i=0;i<gradients[k].size();++i)
+  // Compare gradients and difference quotients
+  for (unsigned int k=0; k<gradients.size(); ++k)
+    for (unsigned int i=0; i<gradients[k].size(); ++i)
       {
-                                        // Compute difference
-       Tensor<1,dim> d1 = gradients1[i][k] - gradients[k][i];
-       Tensor<1,dim> d2 = gradients2[i][k] - gradients[k][i];
-       
-                                        // If the difference is
-                                        // already small, we are fine
-       if (d1.norm() > 1.e-13)
-         {
-                                            // Check for
-                                            // convergence. For full
-                                            // 4th order, gradients2
-                                            // should be 16 times as
-                                            // large, so let's be a
-                                            // bit generous
-           if (d2.norm() < 12.* d1.norm())
-             {
-               deallog << "Gradient error: point " << i
-                       << " (" << points[i] << " )"
-                       << " comp " << k
-//                     << " norms " << d1.norm() << " " << d2.norm()
-                       << std::endl;
-               for (unsigned int d=0;d<dim;++d)
-                 deallog
-                   << " " << gradients[k][i][d]
-                   << " " << gradients1[i][k][d]
-                   << std::endl;
-             }
-         }
+        // Compute difference
+        Tensor<1,dim> d1 = gradients1[i][k] - gradients[k][i];
+        Tensor<1,dim> d2 = gradients2[i][k] - gradients[k][i];
+
+        // If the difference is
+        // already small, we are fine
+        if (d1.norm() > 1.e-13)
+          {
+            // Check for
+            // convergence. For full
+            // 4th order, gradients2
+            // should be 16 times as
+            // large, so let's be a
+            // bit generous
+            if (d2.norm() < 12.* d1.norm())
+              {
+                deallog << "Gradient error: point " << i
+                        << " (" << points[i] << " )"
+                        << " comp " << k
+//      << " norms " << d1.norm() << " " << d2.norm()
+                        << std::endl;
+                for (unsigned int d=0; d<dim; ++d)
+                  deallog
+                      << " " << gradients[k][i][d]
+                      << " " << gradients1[i][k][d]
+                      << std::endl;
+              }
+          }
       }
   deallog << "tested" << std::endl;
 
-                                  // Check if divergence is zero
+  // Check if divergence is zero
   deallog << "Divergence ";
-  
-  for (unsigned int k=0;k<points.size();++k)
+
+  for (unsigned int k=0; k<points.size(); ++k)
     {
       double div = 0.;
-      for (unsigned int d=0;d<dim;++d)
-       div += gradients[d][k][d];
+      for (unsigned int d=0; d<dim; ++d)
+        div += gradients[d][k][d];
       if (std::fabs(div)> 1.e-13)
-       deallog << "Divergence " << k << " "
-               << div << std::endl;
+        deallog << "Divergence " << k << " "
+                << div << std::endl;
     }
   deallog << "tested" << std::endl;
-  
+
   f.vector_laplacian_list(points, values);
   f.vector_laplacians(points, values2);
   double sum = 0.;
-  for (unsigned int i=0;i<values.size();++i)
-    for (unsigned int j=0;j<values[i].size();++j)
+  for (unsigned int i=0; i<values.size(); ++i)
+    for (unsigned int j=0; j<values[i].size(); ++j)
       {
-       sum += values[i](j)*values[i](j);
-       if (values[i](j) != values2[j][i])
-         deallog << "Error values (" << i << ',' << j << ") : "
-                 << values[i](j) << " != " << values2[j][i] << std::endl;
+        sum += values[i](j)*values[i](j);
+        if (values[i](j) != values2[j][i])
+          deallog << "Error values (" << i << ',' << j << ") : "
+                  << values[i](j) << " != " << values2[j][i] << std::endl;
       }
   deallog << "Laplacians " << std::sqrt(sum)/points.size() << std::endl;
-  
+
   std::vector<std::string> names(f.n_components);
-  for (unsigned int i=0;i<names.size();++i)
+  for (unsigned int i=0; i<names.size(); ++i)
     {
       names[i] = std::string("comp");
     }
-  
+
   DataOutBase dout;
   DataOutBase::DXFlags dxflags;
   DataOutBase::GnuplotFlags gflags;
@@ -240,12 +240,12 @@ int main()
   std::ofstream logfile(logname.c_str());
   deallog.attach(logfile);
   deallog.depth_console(0);
-  
+
   Functions::LSingularityFunction fl;
   Functions::LSingularityGradFunction flg;
-                                      // Use odd number of points to
-                                      // avoid lines with
-                                      // discontinuous derivatives.
+  // Use odd number of points to
+  // avoid lines with
+  // discontinuous derivatives.
   deallog << "Functions::LSingularityFunction" << std::endl;
   check_function_value_consistency(fl, 5);
   check_function_gradient_consistency(fl, 5);
index 3c9fbd1550698b487bc9b96d7dbeb01ae3ce264f..69c56353dac60cd4254b372655c6d6f47122a6d0 100644 (file)
 
 template <int dim>
 void
-fill_vector (std::vector<Quadrature<dim> *>quadratures)
+fill_vector (std::vector<Quadrature<dim> *> &quadratures)
 {
   quadratures.push_back (new QMidpoint<dim>());
   quadratures.push_back (new QTrapez<dim>());
   quadratures.push_back (new QSimpson<dim>());
   quadratures.push_back (new QMilne<dim>());
   quadratures.push_back (new QWeddle<dim>());
-  for (unsigned int i=0;i<9;++i)
+  for (unsigned int i=0; i<9; ++i)
     {
       quadratures.push_back (new QGauss<dim>(i));
     }
   QMilne<1> q1d;
   quadratures.push_back (new Quadrature<dim>(q1d));
-  for (unsigned int i=2;i<8;++i)
+  for (unsigned int i=2; i<8; ++i)
     {
       quadratures.push_back (new QGaussLobatto<dim>(i));
     }
@@ -53,7 +53,7 @@ fill_vector (std::vector<Quadrature<dim> *>& quadratures)
 
 template <int dim>
 void
-check_cells (std::vector<Quadrature<dim>*>quadratures)
+check_cells (std::vector<Quadrature<dim>*> &quadratures)
 {
   Quadrature<dim> quadrature;
   for (unsigned int n=0; n<quadratures.size(); ++n)
@@ -70,50 +70,50 @@ check_cells (std::vector<Quadrature<dim>*>& quadratures)
       double err = 0;
 
       do
-       {
-         ++i;
-
-         quadrature_int=0;
-                                          // Check the polynomial x^i*y^i
-
-         for (unsigned int x=0; x<quadrature.size(); ++x)
-           {
-             double f=1.;
-             switch (dim)
-               {
-               case 3:
-                 f *= std::pow(static_cast<double>(points[x](2)), i*1.0);
-               case 2:
-                 f *= std::pow(static_cast<double>(points[x](1)), i*1.0);
-               case 1:
-                 f *= std::pow(static_cast<double>(points[x](0)), i*1.0);
-               }
-             quadrature_int+=f*weights[x];
-           }
-
-                                          // the exact integral is 1/(i+1)
-         exact_int=1./std::pow(static_cast<double>(i+1),dim);
-         err = std::fabs(quadrature_int-exact_int);
-       }
+        {
+          ++i;
+
+          quadrature_int=0;
+          // Check the polynomial x^i*y^i
+
+          for (unsigned int x=0; x<quadrature.size(); ++x)
+            {
+              double f=1.;
+              switch (dim)
+                {
+                case 3:
+                  f *= std::pow(static_cast<double>(points[x](2)), i*1.0);
+                case 2:
+                  f *= std::pow(static_cast<double>(points[x](1)), i*1.0);
+                case 1:
+                  f *= std::pow(static_cast<double>(points[x](0)), i*1.0);
+                }
+              quadrature_int+=f*weights[x];
+            }
+
+          // the exact integral is 1/(i+1)
+          exact_int=1./std::pow(static_cast<double>(i+1),dim);
+          err = std::fabs(quadrature_int-exact_int);
+        }
       while (err<1e-14);
-                                      // Uncomment here for testing
+      // Uncomment here for testing
 //      deallog << " (Int " << quadrature_int << ',' << exact_int << ")";
       deallog << " is exact for polynomials of degree " << i-1 << std::endl;
 
       if (dim==1)
-       {
-                                          // check the ordering of
-                                          // the quadrature points
-         bool in_order=true;
-         for (unsigned int x=1; x<quadrature.size(); ++x)
-           {
-             if (points[x](0)<=points[x-1](0))
-               in_order=false;
-           }
-         if (!in_order)
-           for (unsigned int x=0; x<quadrature.size(); ++x)
-             deallog << points[x] << std::endl;
-       }
+        {
+          // check the ordering of
+          // the quadrature points
+          bool in_order=true;
+          for (unsigned int x=1; x<quadrature.size(); ++x)
+            {
+              if (points[x](0)<=points[x-1](0))
+                in_order=false;
+            }
+          if (!in_order)
+            for (unsigned int x=0; x<quadrature.size(); ++x)
+              deallog << points[x] << std::endl;
+        }
     }
 }
 
@@ -130,8 +130,8 @@ check_faces (const std::vector<Quadrature<dim-1>*>& quadratures, const bool sub)
   for (unsigned int n=0; n<quadratures.size(); ++n)
     {
       Quadrature<dim> quadrature (sub == false?
-                                 QProjector<dim>::project_to_all_faces(*quadratures[n]) :
-                                 QProjector<dim>::project_to_all_subfaces(*quadratures[n]));
+                                  QProjector<dim>::project_to_all_faces(*quadratures[n]) :
+                                  QProjector<dim>::project_to_all_subfaces(*quadratures[n]));
       const std::vector<Point<dim> > &points=quadrature.get_points();
       const std::vector<double> &weights=quadrature.get_weights();
 
@@ -143,49 +143,49 @@ check_faces (const std::vector<Quadrature<dim-1>*>& quadratures, const bool sub)
       double err = 0;
 
       do
-       {
-         ++i;
-
-         quadrature_int=0;
-                                          // Check the polynomial
-                                          // x^i*y^i*z^i
-
-         for (unsigned int x=0; x<quadrature.size(); ++x)
-           {
-             long double f=1.;
-             switch (dim)
-               {
-               case 3:
-                 f *= std::pow((long double) points[x](2), i*1.0L);
-               case 2:
-                 f *= std::pow((long double) points[x](1), i*1.0L);
-               case 1:
-                 f *= std::pow((long double) points[x](0), i*1.0L);
-               }
-             quadrature_int+=f*weights[x];
-           }
-
-                                          // the exact integral is
-                                          // 1/(i+1)^(dim-1)
-         switch (dim)
-           {
-           case 2:
-             exact_int = 2 * (sub ? 2:1) / (double) (i+1);
-             break;
-           case 3:
-             exact_int = 3 * (sub ? (4+2+2):1)*8 / (double) (i+1)/(i+1);
-             break;
-           }
-
-         err = std::fabs(quadrature_int-exact_int);
-       }
-                                      // for comparison: use factor 8 in case
-                                      // of dim==3, as we integrate 8 times
-                                      // over the whole surface (all
-                                      // combinations of face_orientation,
-                                      // face_flip and face_rotation)
+        {
+          ++i;
+
+          quadrature_int=0;
+          // Check the polynomial
+          // x^i*y^i*z^i
+
+          for (unsigned int x=0; x<quadrature.size(); ++x)
+            {
+              long double f=1.;
+              switch (dim)
+                {
+                case 3:
+                  f *= std::pow((long double) points[x](2), i*1.0L);
+                case 2:
+                  f *= std::pow((long double) points[x](1), i*1.0L);
+                case 1:
+                  f *= std::pow((long double) points[x](0), i*1.0L);
+                }
+              quadrature_int+=f*weights[x];
+            }
+
+          // the exact integral is
+          // 1/(i+1)^(dim-1)
+          switch (dim)
+            {
+            case 2:
+              exact_int = 2 * (sub ? 2:1) / (double) (i+1);
+              break;
+            case 3:
+              exact_int = 3 * (sub ? (4+2+2):1)*8 / (double) (i+1)/(i+1);
+              break;
+            }
+
+          err = std::fabs(quadrature_int-exact_int);
+        }
+      // for comparison: use factor 8 in case
+      // of dim==3, as we integrate 8 times
+      // over the whole surface (all
+      // combinations of face_orientation,
+      // face_flip and face_rotation)
       while (err < (dim==3 ? 8 : 1) * 2e-14);
-                                      // Uncomment here for testing
+      // Uncomment here for testing
       //      deallog << " (Int " << quadrature_int << '-' << exact_int << '=' << err << ")";
       deallog << " is exact for polynomials of degree " << i-1 << std::endl;
     }
@@ -205,21 +205,21 @@ int main()
 
       QGaussLobatto<1> q(n);
       for (unsigned int i=0; i<q.size(); ++i)
-       deallog << q.point(i) << ' ' << q.weight(i) << std::endl;
+        deallog << q.point(i) << ' ' << q.weight(i) << std::endl;
 
-                                      // the points must be
-                                      // symmetrically located around
-                                      // 0.5
+      // the points must be
+      // symmetrically located around
+      // 0.5
       double p = 0;
       for (unsigned int i=0; i<q.size(); ++i)
-       p += (q.point(i)[0] - 0.5);
+        p += (q.point(i)[0] - 0.5);
       Assert (std::fabs(p) < 1e-12, ExcInternalError());
 
-                                      // the sum of weights must be
-                                      // one
+      // the sum of weights must be
+      // one
       double w = 0;
       for (unsigned int i=0; i<q.size(); ++i)
-       w += q.weight(i);
+        w += q.weight(i);
       Assert (std::fabs(w-1) < 1e-12, ExcInternalError());
     }
 }
index 1a188f07b4624de9270e5618dc03f7cdd541e446..7639bda561a2363466a960539fce79358686159c 100644 (file)
@@ -34,30 +34,30 @@ double rand_2 ()
 template <int dim>
 void test ()
 {
-                                  // Output normal directions for each face
-  for (unsigned int f=0;f<GeometryInfo<dim>::faces_per_cell;++f)
+  // Output normal directions for each face
+  for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     {
       deallog << "Face " << f << ": n = ( ";
-      for (unsigned int d=0;d<dim;++d)
-       {
-         if (d != 0)
-           deallog << " , ";
-         if (d==GeometryInfo<dim>::unit_normal_direction[f])
-           deallog << GeometryInfo<dim>::unit_normal_orientation[f];
-         else
-           deallog << '0';
-       }
+      for (unsigned int d=0; d<dim; ++d)
+        {
+          if (d != 0)
+            deallog << " , ";
+          if (d==GeometryInfo<dim>::unit_normal_direction[f])
+            deallog << GeometryInfo<dim>::unit_normal_orientation[f];
+          else
+            deallog << '0';
+        }
       deallog << " )" << std::endl;
     }
-  
-  
+
+
   Point<dim> p;
 
   for (unsigned int ref_case_no=1;
        ref_case_no<=RefinementPossibilities<dim>::isotropic_refinement; ++ref_case_no)
     {
       RefinementCase<dim> ref_case(ref_case_no);
-      
+
       deallog << "RefinementCase=" << static_cast<unsigned int> (ref_case) << std::endl;
       // generate N random points in
       // [-2:2]^d, and transform them
@@ -65,30 +65,30 @@ void test ()
       // and child cell
       const unsigned int N = 7;
       for (unsigned int i=0; i<N; ++i)
-       {
-         for (unsigned int d=0; d<dim; ++d)
-           p[d] = rand_2();
-         
-         deallog << i << ' ' << p << ' '
-                 << GeometryInfo<dim>::is_inside_unit_cell (p) << std::endl;
-         for (unsigned int c=0; c<GeometryInfo<dim>::n_children(ref_case); ++c)
-           {
-             const Point<dim> q = GeometryInfo<dim>::cell_to_child_coordinates(p,c);
-             const Point<dim> pp = GeometryInfo<dim>::child_to_cell_coordinates(q,c);
-             
-             deallog << "    " << c << " [" << q << "] [" << pp << ']'
-                     << std::endl;
-             Assert ((p-pp).square() < 1e-15*1e-15, ExcInternalError());
-             Assert (GeometryInfo<dim>::is_inside_unit_cell (p) ==
-                     GeometryInfo<dim>::is_inside_unit_cell (pp),
-                     ExcInternalError());
-           }
-       }
+        {
+          for (unsigned int d=0; d<dim; ++d)
+            p[d] = rand_2();
+
+          deallog << i << ' ' << p << ' '
+                  << GeometryInfo<dim>::is_inside_unit_cell (p) << std::endl;
+          for (unsigned int c=0; c<GeometryInfo<dim>::n_children(ref_case); ++c)
+            {
+              const Point<dim> q = GeometryInfo<dim>::cell_to_child_coordinates(p,c);
+              const Point<dim> pp = GeometryInfo<dim>::child_to_cell_coordinates(q,c);
+
+              deallog << "    " << c << " [" << q << "] [" << pp << ']'
+                      << std::endl;
+              Assert ((p-pp).square() < 1e-15*1e-15, ExcInternalError());
+              Assert (GeometryInfo<dim>::is_inside_unit_cell (p) ==
+                      GeometryInfo<dim>::is_inside_unit_cell (pp),
+                      ExcInternalError());
+            }
+        }
     }
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("geometry_info_1/output");
   deallog.attach(logfile);
index 6dca3cf068581daa568102daa5055d4d4739f404..47839fe1a36de78da0eb95edcb856464cdaee0b4 100644 (file)
@@ -29,88 +29,88 @@ template <int dim>
 void test ()
 {
   deallog << "max_children_per_cell "
-         << GeometryInfo<dim>::max_children_per_cell << std::endl;
+          << GeometryInfo<dim>::max_children_per_cell << std::endl;
   deallog << "faces_per_cell    "
-         << GeometryInfo<dim>::faces_per_cell << std::endl;
+          << GeometryInfo<dim>::faces_per_cell << std::endl;
   deallog << "max_children_per_face "
-         << GeometryInfo<dim>::max_children_per_face << std::endl;
+          << GeometryInfo<dim>::max_children_per_face << std::endl;
   deallog << "vertices_per_cell "
-         <<GeometryInfo<dim>::vertices_per_cell << std::endl;
+          <<GeometryInfo<dim>::vertices_per_cell << std::endl;
   deallog << "lines_per_cell    "
-         << GeometryInfo<dim>::lines_per_cell << std::endl;
+          << GeometryInfo<dim>::lines_per_cell << std::endl;
   deallog << "quads_per_cell    "
-         << GeometryInfo<dim>::quads_per_cell << std::endl;
+          << GeometryInfo<dim>::quads_per_cell << std::endl;
   deallog << "hexes_per_cell    "
-         << GeometryInfo<dim>::hexes_per_cell << std::endl;
+          << GeometryInfo<dim>::hexes_per_cell << std::endl;
 
   deallog << "vertices_per_face "
-         << GeometryInfo<dim>::vertices_per_face << std::endl;
+          << GeometryInfo<dim>::vertices_per_face << std::endl;
   deallog << "lines_per_face    "
-         << GeometryInfo<dim>::lines_per_face << std::endl;
+          << GeometryInfo<dim>::lines_per_face << std::endl;
   deallog << "quads_per_face    "
-         << GeometryInfo<dim>::quads_per_face << std::endl;
+          << GeometryInfo<dim>::quads_per_face << std::endl;
 
-  for (unsigned int f=0;f<GeometryInfo<dim>::faces_per_cell;++f)
+  for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     deallog << "face normal" << f << ' '
-           << (GeometryInfo<dim>::unit_normal_orientation[f] > 0.
-               ? '+' : '-')
-           << "x" << GeometryInfo<dim>::unit_normal_direction[f]
-           << std::endl;
+            << (GeometryInfo<dim>::unit_normal_orientation[f] > 0.
+                ? '+' : '-')
+            << "x" << GeometryInfo<dim>::unit_normal_direction[f]
+            << std::endl;
 
-  for (unsigned int f=0;f<GeometryInfo<dim>::faces_per_cell;++f)
+  for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     {
       deallog << "face_children" << f << "[true ]";
-      for (unsigned int v=0;v < GeometryInfo<dim>::max_children_per_face;++v)
-       deallog << ' '
-               << GeometryInfo<dim>::child_cell_on_face(RefinementCase<dim>::isotropic_refinement,f, v, true);
+      for (unsigned int v=0; v < GeometryInfo<dim>::max_children_per_face; ++v)
+        deallog << ' '
+                << GeometryInfo<dim>::child_cell_on_face(RefinementCase<dim>::isotropic_refinement,f, v, true);
       deallog << std::endl;
       deallog << "face_children" << f << "[false]";
-      for (unsigned int v=0;v < GeometryInfo<dim>::max_children_per_face;++v)
-       deallog << ' '
-               << GeometryInfo<dim>::child_cell_on_face(RefinementCase<dim>::isotropic_refinement,f, v, false);
+      for (unsigned int v=0; v < GeometryInfo<dim>::max_children_per_face; ++v)
+        deallog << ' '
+                << GeometryInfo<dim>::child_cell_on_face(RefinementCase<dim>::isotropic_refinement,f, v, false);
       deallog << std::endl;
     }
-  
-  for (unsigned int f=0;f<GeometryInfo<dim>::faces_per_cell;++f)
+
+  for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     {
       deallog << "face_vertices" << f << "[true ]";
-      for (unsigned int v=0;v < GeometryInfo<dim>::vertices_per_face;++v)
-       deallog << ' '
-               << GeometryInfo<dim>::face_to_cell_vertices(f, v, true);
+      for (unsigned int v=0; v < GeometryInfo<dim>::vertices_per_face; ++v)
+        deallog << ' '
+                << GeometryInfo<dim>::face_to_cell_vertices(f, v, true);
       deallog << std::endl;
       deallog << "face_vertices" << f << "[false]";
-      for (unsigned int v=0;v < GeometryInfo<dim>::vertices_per_face;++v)
-       deallog << ' '
-               << GeometryInfo<dim>::face_to_cell_vertices(f, v, false);
+      for (unsigned int v=0; v < GeometryInfo<dim>::vertices_per_face; ++v)
+        deallog << ' '
+                << GeometryInfo<dim>::face_to_cell_vertices(f, v, false);
       deallog << std::endl;
     }
-  
-  for (unsigned int f=0;f<GeometryInfo<dim>::faces_per_cell;++f)
+
+  for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     {
       deallog << "face_lines" << f << "[true ]";
-      for (unsigned int v=1;v <= GeometryInfo<dim>::lines_per_face;++v)
-       deallog << ' '
-               << GeometryInfo<dim>::face_to_cell_lines(f, v-1, true);
+      for (unsigned int v=1; v <= GeometryInfo<dim>::lines_per_face; ++v)
+        deallog << ' '
+                << GeometryInfo<dim>::face_to_cell_lines(f, v-1, true);
       deallog << std::endl;
       deallog << "face_lines" << f << "[false]";
-      for (unsigned int v=1;v <= GeometryInfo<dim>::lines_per_face;++v)
-       deallog << ' '
-               << GeometryInfo<dim>::face_to_cell_lines(f, v-1, false);
+      for (unsigned int v=1; v <= GeometryInfo<dim>::lines_per_face; ++v)
+        deallog << ' '
+                << GeometryInfo<dim>::face_to_cell_lines(f, v-1, false);
       deallog << std::endl;
     }
-  
-  for (unsigned int f=0;f<GeometryInfo<dim>::lines_per_cell;++f)
+
+  for (unsigned int f=0; f<GeometryInfo<dim>::lines_per_cell; ++f)
     {
       deallog << "line_vertices" << f;
-      for (unsigned int v=0;v < GeometryInfo<1>::vertices_per_cell;++v)
-       deallog << ' '
-               << GeometryInfo<dim>::line_to_cell_vertices(f, v);
+      for (unsigned int v=0; v < GeometryInfo<1>::vertices_per_cell; ++v)
+        deallog << ' '
+                << GeometryInfo<dim>::line_to_cell_vertices(f, v);
       deallog << std::endl;
-    }  
+    }
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("geometry_info_2/output");
   deallog.attach(logfile);
index 5ec89422d882f4d9200448377775ea1b76804cb6..9c79c24889852ed11b709bc32fd998eb515b1bac 100644 (file)
@@ -30,28 +30,28 @@ template <int dim>
 void test ()
 {
   deallog << "Checking in " << dim << "d" << std::endl;
-  
-  for (unsigned int f=0;f<GeometryInfo<dim>::faces_per_cell;++f)
-    for (unsigned int v=0;v<GeometryInfo<dim>::vertices_per_face;++v)
+
+  for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+    for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
       {
-       deallog << "Face " << f << ", vertex=" << v << ": ";
-       deallog << GeometryInfo<dim>::face_to_cell_vertices(f,v,true)
-               << std::endl;
+        deallog << "Face " << f << ", vertex=" << v << ": ";
+        deallog << GeometryInfo<dim>::face_to_cell_vertices(f,v,true)
+                << std::endl;
       }
 
   if (dim == 3)
-    for (unsigned int f=0;f<GeometryInfo<dim>::faces_per_cell;++f)
-      for (unsigned int v=0;v<GeometryInfo<dim>::vertices_per_face;++v)
-       {
-         deallog << "Face " << f << ", vertex=" << v
-                 << " (reverse orientation): ";
-         deallog << GeometryInfo<dim>::face_to_cell_vertices(f,v,false)
-                 << std::endl;
-       }
+    for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+      for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
+        {
+          deallog << "Face " << f << ", vertex=" << v
+                  << " (reverse orientation): ";
+          deallog << GeometryInfo<dim>::face_to_cell_vertices(f,v,false)
+                  << std::endl;
+        }
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("geometry_info_3/output");
   deallog.attach(logfile);
index 70e3e4698c5a142bb5e0ae61ad06ed4600c98042..7707570a7975a24b6d838a42e3d8e4c2e5687ded 100644 (file)
@@ -31,27 +31,27 @@ void test ()
 {
   deallog << "Checking in " << dim << "d" << std::endl;
 
-                                  // check phi_i(v_j) = delta_{ij}
-  for (unsigned int i=0;i<GeometryInfo<dim>::vertices_per_cell;++i)
-    for (unsigned int v=0;v<GeometryInfo<dim>::vertices_per_cell;++v)
+  // check phi_i(v_j) = delta_{ij}
+  for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
+    for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
       {
-       const double
-         phi_i = GeometryInfo<dim>::d_linear_shape_function(GeometryInfo<dim>::unit_cell_vertex(v),i);
-       
-       deallog << phi_i << std::endl;
-       Assert (phi_i == (i==v ? 1 : 0),
-               ExcInternalError());
+        const double
+        phi_i = GeometryInfo<dim>::d_linear_shape_function(GeometryInfo<dim>::unit_cell_vertex(v),i);
+
+        deallog << phi_i << std::endl;
+        Assert (phi_i == (i==v ? 1 : 0),
+                ExcInternalError());
       }
 
-                                  // check that
-                                  //    sum_i phi_i(x) == 1
-                                  // at all points. do so at every
-                                  // vertex, and then at the center
-  for (unsigned int v=0;v<GeometryInfo<dim>::vertices_per_cell;++v)
+  // check that
+  //    sum_i phi_i(x) == 1
+  // at all points. do so at every
+  // vertex, and then at the center
+  for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
     {
       double s = 0;
-      for (unsigned int i=0;i<GeometryInfo<dim>::vertices_per_cell;++i)
-       s += GeometryInfo<dim>::d_linear_shape_function(GeometryInfo<dim>::unit_cell_vertex(v),i);
+      for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
+        s += GeometryInfo<dim>::d_linear_shape_function(GeometryInfo<dim>::unit_cell_vertex(v),i);
       Assert (s == 1, ExcInternalError());
 
       deallog << "Sum of shape functions: " << s << std::endl;
@@ -60,9 +60,9 @@ void test ()
     Point<dim> center;
     for (unsigned int i=0; i<dim; ++i)
       center[i] = 0.5;
-    
+
     double s = 0;
-    for (unsigned int i=0;i<GeometryInfo<dim>::vertices_per_cell;++i)
+    for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
       s += GeometryInfo<dim>::d_linear_shape_function(center,i);
     Assert (s == 1, ExcInternalError());
 
@@ -71,7 +71,7 @@ void test ()
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("geometry_info_4/output");
   deallog.attach(logfile);
index 0cea1b73a3d6c17fb96c3e06e17f72466b2fcda1..36535f9a25fe8ebfc18ac65d7b0decb460d90ad5 100644 (file)
@@ -31,28 +31,28 @@ void test ()
 {
   deallog << "Checking in " << dim << "d" << std::endl;
 
-                                  // check phi_i(v_j) = delta_{ij}
-  for (unsigned int i=0;i<GeometryInfo<dim>::vertices_per_cell;++i)
-    for (unsigned int v=0;v<GeometryInfo<dim>::vertices_per_cell;++v)
+  // check phi_i(v_j) = delta_{ij}
+  for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
+    for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
       {
-       const Tensor<1,dim>
-         phi_i_grad
-         = GeometryInfo<dim>::d_linear_shape_function_gradient(GeometryInfo<dim>::unit_cell_vertex(v),i);
-       
-       deallog << phi_i_grad << std::endl;
+        const Tensor<1,dim>
+        phi_i_grad
+          = GeometryInfo<dim>::d_linear_shape_function_gradient(GeometryInfo<dim>::unit_cell_vertex(v),i);
+
+        deallog << phi_i_grad << std::endl;
       }
 
-                                  // check that
-                                  //    sum_i phi_i(x) == const
-                                  // at all points by verifying that the
-                                  // gradient of the sum of shape functions
-                                  // is zero. do so at every vertex, and then
-                                  // at the center
-  for (unsigned int v=0;v<GeometryInfo<dim>::vertices_per_cell;++v)
+  // check that
+  //    sum_i phi_i(x) == const
+  // at all points by verifying that the
+  // gradient of the sum of shape functions
+  // is zero. do so at every vertex, and then
+  // at the center
+  for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
     {
       Tensor<1,dim> s;
-      for (unsigned int i=0;i<GeometryInfo<dim>::vertices_per_cell;++i)
-       s += GeometryInfo<dim>::d_linear_shape_function_gradient(GeometryInfo<dim>::unit_cell_vertex(v),i);
+      for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
+        s += GeometryInfo<dim>::d_linear_shape_function_gradient(GeometryInfo<dim>::unit_cell_vertex(v),i);
       Assert (s.norm() == 0, ExcInternalError());
 
       deallog << "Sum of shape functions: " << s << std::endl;
@@ -61,9 +61,9 @@ void test ()
     Point<dim> center;
     for (unsigned int i=0; i<dim; ++i)
       center[i] = 0.5;
-    
+
     Tensor<1,dim> s;
-    for (unsigned int i=0;i<GeometryInfo<dim>::vertices_per_cell;++i)
+    for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
       s += GeometryInfo<dim>::d_linear_shape_function_gradient(center,i);
     Assert (s.norm() == 0, ExcInternalError());
 
@@ -72,7 +72,7 @@ void test ()
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("geometry_info_5/output");
   deallog.attach(logfile);
index e8ed9723009ffda14a29b12690e6ea1d52115ae7..756f2f1c384722716f227af061b038293e0385dc 100644 (file)
@@ -31,111 +31,111 @@ void test ()
 {
   deallog << "Checking in " << dim << "d" << std::endl;
 
-                                  // check the determinant of the
-                                  // transformation for the reference
-                                  // cell. the determinant should be one in
-                                  // that case
+  // check the determinant of the
+  // transformation for the reference
+  // cell. the determinant should be one in
+  // that case
   {
     Point<dim> vertices[GeometryInfo<dim>::vertices_per_cell];
-    for (unsigned int v=0;v<GeometryInfo<dim>::vertices_per_cell;++v)
+    for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
       vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
 
     Tensor<0,dim> determinants[GeometryInfo<dim>::vertices_per_cell];
     GeometryInfo<dim>::alternating_form_at_vertices (vertices,
-                                                    determinants);
-    for (unsigned int v=0;v<GeometryInfo<dim>::vertices_per_cell;++v)
+                                                     determinants);
+    for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
       {
-       deallog << "Reference cell: " << determinants[v]
-               << std::endl;
-       Assert (static_cast<double>(determinants[v]) == 1, ExcInternalError());
+        deallog << "Reference cell: " << determinants[v]
+                << std::endl;
+        Assert (static_cast<double>(determinants[v]) == 1, ExcInternalError());
       }
   }
 
-                                  // try the same, but move squash the cell
-                                  // in the x-direction by a factor of 10
+  // try the same, but move squash the cell
+  // in the x-direction by a factor of 10
   {
     Point<dim> vertices[GeometryInfo<dim>::vertices_per_cell];
-    for (unsigned int v=0;v<GeometryInfo<dim>::vertices_per_cell;++v)
+    for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
       {
-       vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
-       vertices[v][0] /= 10;
+        vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
+        vertices[v][0] /= 10;
       }
 
     Tensor<0,dim> determinants[GeometryInfo<dim>::vertices_per_cell];
     GeometryInfo<dim>::alternating_form_at_vertices (vertices,
-                                                    determinants);
-    for (unsigned int v=0;v<GeometryInfo<dim>::vertices_per_cell;++v)
+                                                     determinants);
+    for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
       {
-       deallog << "Squashed cell: " << determinants[v]
-               << std::endl;
-       Assert (static_cast<double>(determinants[v]) == 0.1, ExcInternalError());
+        deallog << "Squashed cell: " << determinants[v]
+                << std::endl;
+        Assert (static_cast<double>(determinants[v]) == 0.1, ExcInternalError());
       }
   }
 
 
-                                  // try the same, but move squash the cell
-                                  // in the x-direction by a factor of 10 and
-                                  // rotate it around the z-axis (unless in
-                                  // 1d)
+  // try the same, but move squash the cell
+  // in the x-direction by a factor of 10 and
+  // rotate it around the z-axis (unless in
+  // 1d)
   {
     Point<dim> vertices[GeometryInfo<dim>::vertices_per_cell];
-    for (unsigned int v=0;v<GeometryInfo<dim>::vertices_per_cell;++v)
+    for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
       {
-       vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
-       vertices[v][0] /= 10;
-
-       if (dim > 1)
-         {
-           std::swap (vertices[v][0], vertices[v][1]);
-           vertices[v][1] *= -1;
-         }
+        vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
+        vertices[v][0] /= 10;
+
+        if (dim > 1)
+          {
+            std::swap (vertices[v][0], vertices[v][1]);
+            vertices[v][1] *= -1;
+          }
       }
 
     Tensor<0,dim> determinants[GeometryInfo<dim>::vertices_per_cell];
     GeometryInfo<dim>::alternating_form_at_vertices (vertices,
-                                                    determinants);
-    for (unsigned int v=0;v<GeometryInfo<dim>::vertices_per_cell;++v)
+                                                     determinants);
+    for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
       {
-       deallog << "Squashed+rotated cell: " << determinants[v]
-               << std::endl;
-       Assert (static_cast<double>(determinants[v]) == 0.1, ExcInternalError());
+        deallog << "Squashed+rotated cell: " << determinants[v]
+                << std::endl;
+        Assert (static_cast<double>(determinants[v]) == 0.1, ExcInternalError());
       }
   }
 
-                                  // pinched cell
+  // pinched cell
   {
     Point<dim> vertices[GeometryInfo<dim>::vertices_per_cell];
-    for (unsigned int v=0;v<GeometryInfo<dim>::vertices_per_cell;++v)
+    for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
       vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
     vertices[1] /= 10;
-    
+
     Tensor<0,dim> determinants[GeometryInfo<dim>::vertices_per_cell];
     GeometryInfo<dim>::alternating_form_at_vertices (vertices,
-                                                    determinants);
-    for (unsigned int v=0;v<GeometryInfo<dim>::vertices_per_cell;++v)
+                                                     determinants);
+    for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
       deallog << "Pinched cell: " << determinants[v]
-             << std::endl;
+              << std::endl;
   }
 
 
-                                  // inverted cell
+  // inverted cell
   {
     Point<dim> vertices[GeometryInfo<dim>::vertices_per_cell];
-    for (unsigned int v=0;v<GeometryInfo<dim>::vertices_per_cell;++v)
+    for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
       vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
     std::swap (vertices[0], vertices[1]);
-    
+
     Tensor<0,dim> determinants[GeometryInfo<dim>::vertices_per_cell];
     GeometryInfo<dim>::alternating_form_at_vertices (vertices,
-                                                    determinants);
-    for (unsigned int v=0;v<GeometryInfo<dim>::vertices_per_cell;++v)
+                                                     determinants);
+    for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
       deallog << "Inverted cell: " << determinants[v]
-             << std::endl;
+              << std::endl;
   }
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("geometry_info_6/output");
   deallog.attach(logfile);
index 5a95d4f2ab2adef41a9a445ebe90182913bc1b6b..41b0aefa82edd6171b5bf1f332aa5266b794c1d9 100644 (file)
@@ -31,166 +31,166 @@ void test ()
 {
   deallog << "Checking in " << dim << "d" << std::endl;
 
-                                  // check the determinant of the
-                                  // transformation for the reference
-                                  // cell. the determinant should be one in
-                                  // that case
+  // check the determinant of the
+  // transformation for the reference
+  // cell. the determinant should be one in
+  // that case
   {
     Point<dim> vertices[GeometryInfo<dim>::vertices_per_cell];
-    for (unsigned int v=0;v<GeometryInfo<dim>::vertices_per_cell;++v)
+    for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
       vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
 
     for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
       {
-       Point<dim> face_vertices[GeometryInfo<dim>::vertices_per_face];
-       for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
-         face_vertices[v] = vertices[GeometryInfo<dim>::face_to_cell_vertices (f, v)];
-       
-       Tensor<1,dim> alternating_forms[GeometryInfo<dim>::vertices_per_face];
-       GeometryInfo<dim-1>::alternating_form_at_vertices (face_vertices,
-                                                          alternating_forms);
-       for (unsigned int v=0;v<GeometryInfo<dim>::vertices_per_face;++v)
-         {
-           deallog << "Reference cell: face " << f << ": " << alternating_forms[v]
-                   << std::endl;
-           Assert (alternating_forms[v].norm() == 1, ExcInternalError());
-         }
+        Point<dim> face_vertices[GeometryInfo<dim>::vertices_per_face];
+        for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
+          face_vertices[v] = vertices[GeometryInfo<dim>::face_to_cell_vertices (f, v)];
+
+        Tensor<1,dim> alternating_forms[GeometryInfo<dim>::vertices_per_face];
+        GeometryInfo<dim-1>::alternating_form_at_vertices (face_vertices,
+                                                           alternating_forms);
+        for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
+          {
+            deallog << "Reference cell: face " << f << ": " << alternating_forms[v]
+                    << std::endl;
+            Assert (alternating_forms[v].norm() == 1, ExcInternalError());
+          }
       }
   }
-  
-                                  // try the same, but move squash the cell
-                                  // in the x-direction by a factor of 10
+
+  // try the same, but move squash the cell
+  // in the x-direction by a factor of 10
   {
     Point<dim> vertices[GeometryInfo<dim>::vertices_per_cell];
-    for (unsigned int v=0;v<GeometryInfo<dim>::vertices_per_cell;++v)
+    for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
       {
-       vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
-       vertices[v][0] /= 10;
+        vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
+        vertices[v][0] /= 10;
       }
 
     for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
       {
-       Point<dim> face_vertices[GeometryInfo<dim>::vertices_per_face];
-       for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
-         face_vertices[v] = vertices[GeometryInfo<dim>::face_to_cell_vertices (f, v)];
-       Tensor<1,dim> alternating_forms[GeometryInfo<dim>::vertices_per_face];
-       GeometryInfo<dim-1>::alternating_form_at_vertices (face_vertices,
-                                                          alternating_forms);
-       for (unsigned int v=0;v<GeometryInfo<dim>::vertices_per_face;++v)
-         {
-           deallog << "Squashed cell: face " << f << ": " << alternating_forms[v]
-                   << std::endl;
-                                            // faces 0,1 should be
-                                            // unaffected, but all
-                                            // other faces are
-                                            // squashed
-           if (f < 2)
-             Assert (alternating_forms[v].norm() == 1, ExcInternalError())
-           else
-             Assert (alternating_forms[v].norm() == 0.1, ExcInternalError());
-         }
+        Point<dim> face_vertices[GeometryInfo<dim>::vertices_per_face];
+        for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
+          face_vertices[v] = vertices[GeometryInfo<dim>::face_to_cell_vertices (f, v)];
+        Tensor<1,dim> alternating_forms[GeometryInfo<dim>::vertices_per_face];
+        GeometryInfo<dim-1>::alternating_form_at_vertices (face_vertices,
+                                                           alternating_forms);
+        for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
+          {
+            deallog << "Squashed cell: face " << f << ": " << alternating_forms[v]
+                    << std::endl;
+            // faces 0,1 should be
+            // unaffected, but all
+            // other faces are
+            // squashed
+            if (f < 2)
+              Assert (alternating_forms[v].norm() == 1, ExcInternalError())
+              else
+                Assert (alternating_forms[v].norm() == 0.1, ExcInternalError());
+          }
       }
   }
-  
 
-                                  // try the same, but move squash the cell
-                                  // in the x-direction by a factor of 10 and
-                                  // rotate it around the z-axis (unless in
-                                  // 1d)
+
+  // try the same, but move squash the cell
+  // in the x-direction by a factor of 10 and
+  // rotate it around the z-axis (unless in
+  // 1d)
   {
     Point<dim> vertices[GeometryInfo<dim>::vertices_per_cell];
-    for (unsigned int v=0;v<GeometryInfo<dim>::vertices_per_cell;++v)
+    for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
       {
-       vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
-       vertices[v][0] /= 10;
-
-       if (dim > 1)
-         {
-           std::swap (vertices[v][0], vertices[v][1]);
-           vertices[v][1] *= -1;
-         }
+        vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
+        vertices[v][0] /= 10;
+
+        if (dim > 1)
+          {
+            std::swap (vertices[v][0], vertices[v][1]);
+            vertices[v][1] *= -1;
+          }
       }
 
     for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
       {
-       Point<dim> face_vertices[GeometryInfo<dim>::vertices_per_face];
-       for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
-         face_vertices[v] = vertices[GeometryInfo<dim>::face_to_cell_vertices (f, v)];
-       Tensor<1,dim> alternating_forms[GeometryInfo<dim>::vertices_per_face];
-       GeometryInfo<dim-1>::alternating_form_at_vertices (face_vertices,
-                                                          alternating_forms);
-       for (unsigned int v=0;v<GeometryInfo<dim>::vertices_per_face;++v)
-         {
-           deallog << "Squashed+rotated cell: face " << f << ": " << alternating_forms[v]
-                   << std::endl;
-
-                                            // in 2d and 3d, faces
-                                            // 0,1 should be
-                                            // unaffected (just like
-                                            // for the squashed cell,
-                                            // the rotation has
-                                            // nothing to do with
-                                            // face numbers though
-                                            // the direction of the
-                                            // alternating form
-                                            // vector would have
-                                            // rotated along)
-           if (f<2)
-             Assert (alternating_forms[v].norm() == 1, ExcInternalError())
-           else
-             Assert (alternating_forms[v].norm() == 0.1, ExcInternalError());
-         }
+        Point<dim> face_vertices[GeometryInfo<dim>::vertices_per_face];
+        for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
+          face_vertices[v] = vertices[GeometryInfo<dim>::face_to_cell_vertices (f, v)];
+        Tensor<1,dim> alternating_forms[GeometryInfo<dim>::vertices_per_face];
+        GeometryInfo<dim-1>::alternating_form_at_vertices (face_vertices,
+                                                           alternating_forms);
+        for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
+          {
+            deallog << "Squashed+rotated cell: face " << f << ": " << alternating_forms[v]
+                    << std::endl;
+
+            // in 2d and 3d, faces
+            // 0,1 should be
+            // unaffected (just like
+            // for the squashed cell,
+            // the rotation has
+            // nothing to do with
+            // face numbers though
+            // the direction of the
+            // alternating form
+            // vector would have
+            // rotated along)
+            if (f<2)
+              Assert (alternating_forms[v].norm() == 1, ExcInternalError())
+              else
+                Assert (alternating_forms[v].norm() == 0.1, ExcInternalError());
+          }
       }
   }
-  
-                                  // pinched cell
+
+  // pinched cell
   {
     Point<dim> vertices[GeometryInfo<dim>::vertices_per_cell];
-    for (unsigned int v=0;v<GeometryInfo<dim>::vertices_per_cell;++v)
+    for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
       vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
     vertices[1] /= 10;
-    
+
     for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
       {
-       Point<dim> face_vertices[GeometryInfo<dim>::vertices_per_face];
-       for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
-         face_vertices[v] = vertices[GeometryInfo<dim>::face_to_cell_vertices (f, v)];
-       Tensor<1,dim> alternating_forms[GeometryInfo<dim>::vertices_per_face];
-       GeometryInfo<dim-1>::alternating_form_at_vertices (face_vertices,
-                                                          alternating_forms);
-       for (unsigned int v=0;v<GeometryInfo<dim>::vertices_per_face;++v)
-         deallog << "Pinched cell: face " << f << ": " << alternating_forms[v]
-                 << std::endl;
+        Point<dim> face_vertices[GeometryInfo<dim>::vertices_per_face];
+        for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
+          face_vertices[v] = vertices[GeometryInfo<dim>::face_to_cell_vertices (f, v)];
+        Tensor<1,dim> alternating_forms[GeometryInfo<dim>::vertices_per_face];
+        GeometryInfo<dim-1>::alternating_form_at_vertices (face_vertices,
+                                                           alternating_forms);
+        for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
+          deallog << "Pinched cell: face " << f << ": " << alternating_forms[v]
+                  << std::endl;
       }
   }
-  
 
-                                  // inverted cell
+
+  // inverted cell
   {
     Point<dim> vertices[GeometryInfo<dim>::vertices_per_cell];
-    for (unsigned int v=0;v<GeometryInfo<dim>::vertices_per_cell;++v)
+    for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
       vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
     std::swap (vertices[0], vertices[1]);
-    
+
     for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
       {
-       Point<dim> face_vertices[GeometryInfo<dim>::vertices_per_face];
-       for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
-         face_vertices[v] = vertices[GeometryInfo<dim>::face_to_cell_vertices (f, v)];
-
-       Tensor<1,dim> alternating_forms[GeometryInfo<dim>::vertices_per_face];
-       GeometryInfo<dim-1>::alternating_form_at_vertices (face_vertices,
-                                                          alternating_forms);
-       for (unsigned int v=0;v<GeometryInfo<dim>::vertices_per_face;++v)
-         deallog << "Inverted cell: face " << f << ": " << alternating_forms[v]
-                 << std::endl;
+        Point<dim> face_vertices[GeometryInfo<dim>::vertices_per_face];
+        for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
+          face_vertices[v] = vertices[GeometryInfo<dim>::face_to_cell_vertices (f, v)];
+
+        Tensor<1,dim> alternating_forms[GeometryInfo<dim>::vertices_per_face];
+        GeometryInfo<dim-1>::alternating_form_at_vertices (face_vertices,
+                                                           alternating_forms);
+        for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
+          deallog << "Inverted cell: face " << f << ": " << alternating_forms[v]
+                  << std::endl;
       }
   }
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("geometry_info_7/output");
   deallog.attach(logfile);
index ad50a82fc389dca38c96547d10c40f648084f63b..8aa2533e93a23207ba6ff92e5884b370d3bb652b 100644 (file)
@@ -35,26 +35,29 @@ void test_vertices()
 {
   deallog << dim << "D:" << std::endl;
 
-  for(unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i) {
-
-    deallog << "face " << i << ":" << std::endl;
-
-    for(unsigned int o = 0; o < 8; ++o) {
-      const std::bitset<3> orientation = o;
-
-      deallog << "orientation " << orientation[0]
-              << ", flip " << orientation[1]
-              << ", rotation " << orientation[2]
-              << ":" << std::endl << "    ";
-
-      for(unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_face; ++j) {
-        deallog << " (" << j << " -> "
-                << GeometryInfo<dim>::face_to_cell_vertices(i, j, orientation[0], orientation[1], orientation[2])
-                << " )";
-      }
-      deallog << std::endl;
+  for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+    {
+
+      deallog << "face " << i << ":" << std::endl;
+
+      for (unsigned int o = 0; o < 8; ++o)
+        {
+          const std::bitset<3> orientation = o;
+
+          deallog << "orientation " << orientation[0]
+                  << ", flip " << orientation[1]
+                  << ", rotation " << orientation[2]
+                  << ":" << std::endl << "    ";
+
+          for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_face; ++j)
+            {
+              deallog << " (" << j << " -> "
+                      << GeometryInfo<dim>::face_to_cell_vertices(i, j, orientation[0], orientation[1], orientation[2])
+                      << " )";
+            }
+          deallog << std::endl;
+        }
     }
-  }
 }
 
 
@@ -63,26 +66,29 @@ void test_lines()
 {
   deallog << dim << "D:" << std::endl;
 
-  for(unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i) {
+  for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+    {
 
-    deallog << "face " << i << ":" << std::endl;
+      deallog << "face " << i << ":" << std::endl;
 
-    for(unsigned int o = 0; o < 8; ++o) {
-      const std::bitset<3> orientation = o;
+      for (unsigned int o = 0; o < 8; ++o)
+        {
+          const std::bitset<3> orientation = o;
 
-      deallog << "orientation " << orientation[0]
-              << ", flip " << orientation[1]
-              << ", rotation " << orientation[2]
-              << ":" << std::endl << "    ";
+          deallog << "orientation " << orientation[0]
+                  << ", flip " << orientation[1]
+                  << ", rotation " << orientation[2]
+                  << ":" << std::endl << "    ";
 
-      for(unsigned int j = 0; j < GeometryInfo<dim>::lines_per_face; ++j) {
-        deallog << " (" << j << " -> "
-                << GeometryInfo<dim>::face_to_cell_lines(i, j, orientation[0], orientation[1], orientation[2])
-                << " )";
-      }
-      deallog << std::endl;
+          for (unsigned int j = 0; j < GeometryInfo<dim>::lines_per_face; ++j)
+            {
+              deallog << " (" << j << " -> "
+                      << GeometryInfo<dim>::face_to_cell_lines(i, j, orientation[0], orientation[1], orientation[2])
+                      << " )";
+            }
+          deallog << std::endl;
+        }
     }
-  }
 }
 
 
index fb834a6e4f5dedac0595bd082e2601f506b8fd94..fe8d2f9a2cade702b960c50d53fecc39d76265c0 100644 (file)
@@ -40,7 +40,7 @@ int main ()
   deallog.threshold_double(1.e-10);
 
   const std::vector<Polynomial<double> >
-    p = Hierarchical::generate_complete_basis (10);
+  p = Hierarchical::generate_complete_basis (10);
 
   const unsigned int div=30;
   for (unsigned int i=0; i<=div; ++i)
index 6d808749e97ee8e2960d12a1515aef86a3d7c5bf..203d9507365da405c01a45e33ddee9b6f523f225 100644 (file)
@@ -38,7 +38,7 @@ void test ()
 
   for (unsigned int i=0; i<index_set.size(); ++i)
     deallog << i << ' ' << (index_set.is_element(i) ? "true" : "false")
-           << std::endl;
+            << std::endl;
 }
 
 
index 91e3e3c0bb69fc87b26782d3192c202b70844017..b60f5b53665ea65739c2c708bca9c530d485dfe3 100644 (file)
@@ -33,21 +33,21 @@ void test ()
   index_set.add_index (3);
   index_set.add_index (4);
   deallog << (index_set.is_contiguous() ? "true" : "false")
-         << std::endl;
+          << std::endl;
   Assert (index_set.is_contiguous() == true, ExcInternalError());
 
   for (unsigned int i=0; i<index_set.size(); ++i)
     deallog << i << ' ' << (index_set.is_element(i) ? "true" : "false")
-           << std::endl;
+            << std::endl;
 
   index_set.add_index (6);
   deallog << (index_set.is_contiguous() ? "true" : "false")
-         << std::endl;
+          << std::endl;
   Assert (index_set.is_contiguous() == false, ExcInternalError());
 
   for (unsigned int i=0; i<index_set.size(); ++i)
     deallog << i << ' ' << (index_set.is_element(i) ? "true" : "false")
-           << std::endl;
+            << std::endl;
 }
 
 
index 91ab9c6e4212519463c2157f1e9d666abebb9b2f..f0b17596d341952570d768f187bdd594ee908e01 100644 (file)
@@ -37,12 +37,12 @@ void test ()
   index_set.add_index (7);
 
   deallog << (index_set.is_contiguous() ? "true" : "false")
-         << std::endl;
+          << std::endl;
   Assert (index_set.is_contiguous() == false, ExcInternalError());
 
   for (unsigned int i=0; i<index_set.size(); ++i)
     deallog << i << ' ' << (index_set.is_element(i) ? "true" : "false")
-           << std::endl;
+            << std::endl;
 }
 
 
index 5163a4ecde9280ed7028ead8bb0b11d6d059906d..99fd63f64596ce1c61bf9a70088d12ab4b577811 100644 (file)
@@ -41,12 +41,12 @@ void test ()
   index_set.add_index (7);
 
   deallog << (index_set.is_contiguous() ? "true" : "false")
-         << std::endl;
+          << std::endl;
   Assert (index_set.is_contiguous() == true, ExcInternalError());
 
   for (unsigned int i=0; i<index_set.size(); ++i)
     deallog << i << ' ' << (index_set.is_element(i) ? "true" : "false")
-           << std::endl;
+            << std::endl;
 }
 
 
index 8c3e495747f2143f0f94512cdf4a9a86abc3d7a2..3e7d26057932f239ce6aff71a74c18dc56ba3248 100644 (file)
@@ -39,12 +39,12 @@ void test ()
 
 
   deallog << (index_set.is_contiguous() ? "true" : "false")
-         << std::endl;
+          << std::endl;
   Assert (index_set.is_contiguous() == true, ExcInternalError());
 
   for (unsigned int i=0; i<index_set.size(); ++i)
     deallog << i << ' ' << (index_set.is_element(i) ? "true" : "false")
-           << std::endl;
+            << std::endl;
 }
 
 
index edb4724e92a654e1716604cc259fae5a97954cf4..3eb383b62be05c6bb0ebdaec48c4f89caceb540e 100644 (file)
@@ -39,12 +39,12 @@ void test ()
 
 
   deallog << (index_set.is_contiguous() ? "true" : "false")
-         << std::endl;
+          << std::endl;
   Assert (index_set.is_contiguous() == true, ExcInternalError());
 
   for (unsigned int i=0; i<index_set.size(); ++i)
     deallog << i << ' ' << (index_set.is_element(i) ? "true" : "false")
-           << std::endl;
+            << std::endl;
 }
 
 
index 34e2c6f0ebf1a4e6ff3d2082716a0505cdc18241..93e110948ff74416c7779ecc3200431d46e9079f 100644 (file)
@@ -42,12 +42,12 @@ void test ()
 
 
   deallog << (index_set.is_contiguous() ? "true" : "false")
-         << std::endl;
+          << std::endl;
   Assert (index_set.is_contiguous() == true, ExcInternalError());
 
   for (unsigned int i=0; i<index_set.size(); ++i)
     deallog << i << ' ' << (index_set.is_element(i) ? "true" : "false")
-           << std::endl;
+            << std::endl;
 }
 
 
index b689f3751093d6ce417df1b2ebe9c30e8d75a062..dee63983bfed6de8223f19ad4501e3d5ba02fb2b 100644 (file)
@@ -44,12 +44,12 @@ void test ()
 
 
   deallog << (index_set.is_contiguous() ? "true" : "false")
-         << std::endl;
+          << std::endl;
   Assert (index_set.is_contiguous() == true, ExcInternalError());
 
   for (unsigned int i=0; i<index_set.size(); ++i)
     deallog << i << ' ' << (index_set.is_element(i) ? "true" : "false")
-           << std::endl;
+            << std::endl;
 }
 
 
index b07b19acfc1786c1d943136b4db4d9ba3ab42009..7ae2458f5e0eeea3b2b9460de4892e686fe8253f 100644 (file)
@@ -39,7 +39,7 @@ void test ()
   index_set.add_index (9);
 
   deallog << index_set.n_elements()
-         << std::endl;
+          << std::endl;
 }
 
 
index f92588981c89cdb349528f13eb8aba52f99a8280..01cbb8e489637983f0be6e3e7a6118e48202dd64 100644 (file)
@@ -44,16 +44,16 @@ void test ()
   for (unsigned int i=0; i<index_set.n_elements(); ++i)
     {
       deallog << index_set.nth_index_in_set(i)
-             << std::endl;
+              << std::endl;
       Assert (index_set.index_within_set(index_set.nth_index_in_set(i)) == i,
-             ExcInternalError());
+              ExcInternalError());
     }
   deallog << "OK" << std::endl;
 
   for (unsigned int i=0; i<index_set.size(); ++i)
     if (index_set.is_element (i))
       deallog << i << ' ' << index_set.index_within_set(i)
-             << std::endl;
+              << std::endl;
 }
 
 
index dfe49c1b9cd7daa32aa942a3308a7b4ae1cb77b0..1ae44092eb671c7c38b5c37ea48cfb87c552e35c 100644 (file)
@@ -32,30 +32,30 @@ void test ()
 
   {
     const unsigned int array[] = { 2, 3, 4 };
-    index_set.add_indices ((const unsigned int*)array, array+sizeof(array)/sizeof(array[0]));
+    index_set.add_indices ((const unsigned int *)array, array+sizeof(array)/sizeof(array[0]));
   }
   {
     const unsigned int array[] = { 7,6 };
-    index_set.add_indices ((const unsigned int*)array, array+sizeof(array)/sizeof(array[0]));
+    index_set.add_indices ((const unsigned int *)array, array+sizeof(array)/sizeof(array[0]));
   }
 
   Assert (index_set.is_contiguous() == false, ExcInternalError());
 
   for (unsigned int i=0; i<index_set.size(); ++i)
     deallog << i << ' ' << (index_set.is_element(i) ? "true" : "false")
-           << std::endl;
+            << std::endl;
 
 
   {
     const unsigned int array[] = { 5 };
-    index_set.add_indices ((const unsigned int*)array, array+sizeof(array)/sizeof(array[0]));
+    index_set.add_indices ((const unsigned int *)array, array+sizeof(array)/sizeof(array[0]));
   }
 
   Assert (index_set.is_contiguous() == true, ExcInternalError());
 
   for (unsigned int i=0; i<index_set.size(); ++i)
     deallog << i << ' ' << (index_set.is_element(i) ? "true" : "false")
-           << std::endl;
+            << std::endl;
 
 
   deallog << "OK" << std::endl;
index e87a895b30ec9d2efa30baa16feba7f5d9b5779b..1792a0fe224bbf8a88974e4b5bbde7868ae67cb6 100644 (file)
@@ -44,16 +44,16 @@ void test ()
   for (unsigned int i=0; i<index_set.n_elements(); ++i)
     {
       deallog << index_set.nth_index_in_set(i)
-             << std::endl;
+              << std::endl;
       Assert (index_set.index_within_set(index_set.nth_index_in_set(i)) == i,
-             ExcInternalError());
+              ExcInternalError());
     }
   deallog << "OK" << std::endl;
 
   for (unsigned int i=0; i<index_set.size(); ++i)
     if (index_set.is_element (i))
       deallog << i << ' ' << index_set.index_within_set(i)
-             << std::endl;
+              << std::endl;
 }
 
 
index b8fb0025883a7db1a1a5260000c2727b44731cc2..3cdec71e3582e6950b337dcd01fbee57537d0b0d 100644 (file)
@@ -44,15 +44,15 @@ void test ()
   for (unsigned int i=0; i<is3.size(); ++i)
     {
       deallog << i << ' ' << (is3.is_element(i) ? "true" : "false")
-             << std::endl;
+              << std::endl;
 
       Assert ((is1.is_element(i) && is2.is_element(i))
-             ==
-             is3.is_element(i),
-             ExcInternalError());
+              ==
+              is3.is_element(i),
+              ExcInternalError());
     }
 
-                                  // some sanity tests
+  // some sanity tests
   Assert ((is1 & is2) == (is2 & is1), ExcInternalError());
   Assert ((is1 & is3) == (is2 & is3), ExcInternalError());
   Assert ((is1 & is3) == is3, ExcInternalError());
index ca1bbfea6dd59c808034b1e90b99e5dd034e4e1b..c71afb262cca6c12e5a0c8ef496326134f1347aa 100644 (file)
@@ -32,9 +32,9 @@ void test ()
   IndexSet is1 (100);
   IndexSet is2 (100);
 
-                                  // randomly add 90 elements to each
-                                  // set, some of which may be
-                                  // repetitions of previous ones
+  // randomly add 90 elements to each
+  // set, some of which may be
+  // repetitions of previous ones
   for (unsigned int i=0; i<9*is1.size()/10; ++i)
     {
       is1.add_index (rand() % is1.size());
@@ -44,22 +44,22 @@ void test ()
   IndexSet is3 = is1 & is2;
 
   deallog << "Set sizes: "
-         << is1.n_elements() << ' '
-         << is2.n_elements() << ' '
-         << is3.n_elements() << std::endl;
+          << is1.n_elements() << ' '
+          << is2.n_elements() << ' '
+          << is3.n_elements() << std::endl;
 
   for (unsigned int i=0; i<is3.size(); ++i)
     {
       deallog << i << ' ' << (is3.is_element(i) ? "true" : "false")
-             << std::endl;
+              << std::endl;
 
       Assert ((is1.is_element(i) && is2.is_element(i))
-             ==
-             is3.is_element(i),
-             ExcInternalError());
+              ==
+              is3.is_element(i),
+              ExcInternalError());
     }
 
-                                  // some sanity tests
+  // some sanity tests
   Assert ((is1 & is2) == (is2 & is1), ExcInternalError());
   Assert ((is1 & is3) == (is2 & is3), ExcInternalError());
   Assert ((is1 & is3) == is3, ExcInternalError());
index d61c0757f3eee263a6b6f623589ccdbae87a8607..aaea25954a6c52c5babe88ebd8f7a92fca36cec9 100644 (file)
@@ -32,9 +32,9 @@ void test ()
   IndexSet is1 (100);
   IndexSet is2 (100);
 
-                                  // randomly add 90 elements to each
-                                  // set, some of which may be
-                                  // repetitions of previous ones
+  // randomly add 90 elements to each
+  // set, some of which may be
+  // repetitions of previous ones
   for (unsigned int i=0; i<9*is1.size()/10; ++i)
     {
       is1.add_index (rand() % is1.size());
@@ -45,33 +45,33 @@ void test ()
   is3.subtract_set(is2);
 
   deallog << "Set sizes: "
-         << is1.n_elements() << ' '
-         << is2.n_elements() << ' '
-         << is3.n_elements() << std::endl;
+          << is1.n_elements() << ' '
+          << is2.n_elements() << ' '
+          << is3.n_elements() << std::endl;
 
   is1.print(deallog);
   is2.print(deallog);
   is3.print(deallog);
-  
-  
-  
+
+
+
   for (unsigned int i=0; i<is3.size(); ++i)
     {
       Assert ((is1.is_element(i) && !is2.is_element(i))
-             ==
-             is3.is_element(i),
-             ExcInternalError());
+              ==
+              is3.is_element(i),
+              ExcInternalError());
     }
 
   IndexSet empty(100);
   is3 = is1;
   is3.subtract_set(empty);
-  
+
   Assert (is3 == is1, ExcInternalError());
 
   is3.subtract_set(is1);
   Assert (is3 == empty, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
index 986293e73118d9611ad8c867a3a792acd8b18501..7dc1bd85454031792d1494881a48479e7f8753f0 100644 (file)
@@ -34,28 +34,28 @@ void test ()
 
   is1.add_range(0,10);
   is1.add_range(20,100);
-  
+
   is2.add_range(0,50);
 //  is2.add_range(10,15);
-  
+
   IndexSet is3 = is1;
   is3.subtract_set(is2);
-  
+
   is1.print(deallog);
   is2.print(deallog);
-  is3.print(deallog);  
-  
+  is3.print(deallog);
+
   for (unsigned int i=0; i<is3.size(); ++i)
     {
       Assert ((is1.is_element(i) && !is2.is_element(i))
-             ==
-             is3.is_element(i),
-             ExcInternalError());
+              ==
+              is3.is_element(i),
+              ExcInternalError());
     }
 
   deallog << is3.index_within_set(51) << std::endl;
   Assert(is3.index_within_set(51)==1, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
index ad98815b7b84a5aaa8afe385d628cbafb3891747..b94cb78072433c1cb56a980051e7d774f53e1c5d 100644 (file)
@@ -31,9 +31,9 @@ void test ()
 {
   IndexSet is1 (100);
 
-                                  // randomly add 90 elements to each
-                                  // set, some of which may be
-                                  // repetitions of previous ones
+  // randomly add 90 elements to each
+  // set, some of which may be
+  // repetitions of previous ones
   for (unsigned int i=0; i<9*is1.size()/10; ++i)
     {
       is1.add_index (rand() % is1.size());
@@ -42,7 +42,7 @@ void test ()
   is1.compress();
 
   deallog << "Number of intervals: "
-         << is1.n_intervals() << std::endl;
+          << is1.n_intervals() << std::endl;
 
   is1.print(deallog);
 
index f57b5fb955b3a20f26e8cae7d4f1ba077db681d2..fab46b91346c23df2f887f99ceff3d7414e88bc3 100644 (file)
@@ -31,9 +31,9 @@ void test ()
 {
   IndexSet is1 (100);
 
-                                  // randomly add 90 elements to each
-                                  // set, some of which may be
-                                  // repetitions of previous ones
+  // randomly add 90 elements to each
+  // set, some of which may be
+  // repetitions of previous ones
   for (unsigned int i=0; i<9*is1.size()/10; ++i)
     is1.add_index (rand() % is1.size());
 
index bde83e84ad2ebc0b50b02624f0e0051c03ecace4..a70aa632013cad337085dc4c0dc3a48f4583872b 100644 (file)
@@ -31,9 +31,9 @@ void test ()
 {
   IndexSet is1 (100);
 
-                                  // randomly add 90 elements to each
-                                  // set, some of which may be
-                                  // repetitions of previous ones
+  // randomly add 90 elements to each
+  // set, some of which may be
+  // repetitions of previous ones
   for (unsigned int i=0; i<9*is1.size()/10; ++i)
     is1.add_index (rand() % is1.size());
 
index ed747734531d32a5a4ecc2c1c9aa13e42c22ebca..9728193f258f13a0bd9cb59c99e9aced5f8b9e55 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <deal.II/base/index_set.h>
 
-void testor(IndexSet & a, IndexSet & other, bool verbose=true)
+void testor(IndexSet &a, IndexSet &other, bool verbose=true)
 {
   IndexSet merged(a);
 
@@ -41,13 +41,13 @@ void testor(IndexSet & a, IndexSet & other, bool verbose=true)
       merged.print(deallog);
     }
 
-  for (unsigned int i=0;i<merged.size();++i)
+  for (unsigned int i=0; i<merged.size(); ++i)
     {
       Assert(
-       merged.is_element(i)
-       ==
-       (a.is_element(i) || other.is_element(i)),
-       ExcInternalError());
+        merged.is_element(i)
+        ==
+        (a.is_element(i) || other.is_element(i)),
+        ExcInternalError());
     }
 }
 
@@ -57,14 +57,14 @@ void testor(IndexSet & a, IndexSet & other, bool verbose=true)
 void test()
 {
   const int size = 10;
-  
+
   IndexSet empty(size);
   IndexSet id(size);
 
   id.add_index(3);
   id.add_index(4);
   id.add_index(7);
-  
+
   deallog << "* add empty: " << std::endl;
   testor(id, empty);
 
@@ -79,18 +79,18 @@ void test()
   testor(id, id2);
 
   deallog << "* random tests... " << std::endl;
-  for (unsigned int i=0;i<10;++i)
+  for (unsigned int i=0; i<10; ++i)
     {
       const int size=100;
       IndexSet a(size);
       IndexSet b(size);
       for (unsigned int i=0; i<9*a.size()/10; ++i)
-       {           
-         a.add_index (rand() % a.size());
-         b.add_index (rand() % a.size());
-       }
+        {
+          a.add_index (rand() % a.size());
+          b.add_index (rand() % a.size());
+        }
       testor(a, b, false);
-    }  
+    }
 }
 
 
index afba9cb6d0bb02f793c58c2f89145022434cdc72..18e03090838a4b52b43ef41925a11449ce576590 100644 (file)
 
 #include <deal.II/base/index_set.h>
 
-void testor(IndexSet & a,
-           IndexSet & other,
-           unsigned int offset,
-           bool verbose)
+void testor(IndexSet &a,
+            IndexSet &other,
+            unsigned int offset,
+            bool verbose)
 {
   IndexSet merged(a);
 
@@ -44,13 +44,13 @@ void testor(IndexSet & a,
       merged.print(deallog);
     }
 
-  for (unsigned int i=0;i<merged.size();++i)
+  for (unsigned int i=0; i<merged.size(); ++i)
     {
       Assert(
-       merged.is_element(i)
-       ==
-       (a.is_element(i) || (i>=offset && other.is_element(i-offset))),
-       ExcInternalError());
+        merged.is_element(i)
+        ==
+        (a.is_element(i) || (i>=offset && other.is_element(i-offset))),
+        ExcInternalError());
     }
 }
 
@@ -60,14 +60,14 @@ void testor(IndexSet & a,
 void test()
 {
   const int size = 10;
-  
+
   IndexSet empty(size);
   IndexSet id(size);
 
   id.add_index(3);
   id.add_index(4);
   id.add_index(7);
-  
+
   deallog << "* add empty: " << std::endl;
   testor(id, empty, 2, true);
 
index c97b197b26bbff44402126fb6b0625cd47c3e09b..1bcaaf199db0c2acfe7e78b938100976e54c9b80 100644 (file)
@@ -36,8 +36,8 @@ void test ()
   index_set.add_index (14);
   index_set.add_index (16);
 
-                                  // clear the IndexSet and then set elements
-                                  // again
+  // clear the IndexSet and then set elements
+  // again
   index_set.clear ();
 
   index_set.add_range (2,4);
@@ -49,7 +49,7 @@ void test ()
 
   for (unsigned int i=0; i<index_set.size(); ++i)
     deallog << i << ' ' << (index_set.is_element(i) ? "true" : "false")
-           << std::endl;
+            << std::endl;
 }
 
 
index 52a413d92c6eb205dfe4992b18c44c34ee586778..18c386cd0af11b31afc8d90c6f8c5a0b72c10c0a 100644 (file)
@@ -31,9 +31,9 @@ void test ()
 {
   IndexSet is1 (100);
 
-                                  // randomly add 90 elements to each
-                                  // set, some of which may be
-                                  // repetitions of previous ones
+  // randomly add 90 elements to each
+  // set, some of which may be
+  // repetitions of previous ones
   for (unsigned int i=0; i<9*is1.size()/10; ++i)
     is1.add_index (rand() % is1.size());
 
@@ -45,7 +45,7 @@ void test ()
 
   for (unsigned int i=0; i<is1.size(); i++)
     Assert(is1.is_element(i) == zeros_and_ones[i],
-          ExcInternalError());
+           ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
index 703f2f8f19c10ee692d228c97fad556cf0ec7b8b..722dad00d6fad2037ff47c18cd769cff7d9d1e33 100644 (file)
@@ -39,7 +39,7 @@ void test ()
     std::ofstream out("index_set_readwrite_02/a.idxset");
     is1.block_write(out);
   }
-  
+
   IndexSet is2;
   std::ifstream in("index_set_readwrite_02/a.idxset");
   is2.block_read(in);
index ee82492a4b6acc12fbb0604638a951a89d5ff786..90f14eed23c924feeaceae9ab5690951c50bb846 100644 (file)
@@ -28,7 +28,7 @@ template <typename T>
 void check ()
 {
   using namespace numbers;
-  
+
   deallog << std::numeric_limits<T>::quiet_NaN() << "   -->   ";
   deallog << is_finite(std::numeric_limits<T>::quiet_NaN()) << std::endl;
 
@@ -68,7 +68,7 @@ int main ()
 
   check<int> ();
   check<unsigned int> ();
-  
+
   return 0;
 }
 
index bfe860da8046799efeaae843f4731b3c079c59fc..67d065b49a37c50f56a45deb2f005ac644215431 100644 (file)
@@ -28,7 +28,7 @@ template <typename T>
 void check ()
 {
   using namespace numbers;
-  
+
   deallog << std::numeric_limits<typename numbers::NumberTraits<T>::real_type>::quiet_NaN() << "   -->   ";
   deallog << is_finite(T(std::numeric_limits<typename numbers::NumberTraits<T>::real_type>::quiet_NaN(), 0)) << ' ';
   deallog << is_finite(T(0,std::numeric_limits<typename numbers::NumberTraits<T>::real_type>::quiet_NaN())) << std::endl;
@@ -73,7 +73,7 @@ int main ()
 
   check<std::complex<double> > ();
   check<std::complex<long double> > ();
-  
+
   return 0;
 }
 
index 997d2ebabf62ffb8ee6f039153279bd01322ecad..521bc4d529bd33d4c9f8d30622d462845083c829 100644 (file)
@@ -40,7 +40,7 @@ int main ()
   // ensure that the precision of the underlying file stream object remained
   // unchanged
   deallog.get_file_stream() << numbers::PI << std::endl;
-  
+
   return 0;
 }
 
index 4c15faa6f0a8820938fa4aa9e934d4666061d0a5..c61925a4a9d7777dbbabf09d3bd83c174a00354c 100644 (file)
@@ -40,7 +40,7 @@ int main ()
   // ensure that the width of the underlying file stream object remained
   // unchanged
   deallog.get_file_stream() << numbers::PI*2 << 42 << std::endl;
-  
+
   return 0;
 }
 
index 0baac6a222c0778c9b3ee70e7d44a7c04ccd82a6..8c7ad959d622c1c999b76c918e60bbf4e8890f7e 100644 (file)
 
 template<typename DATA>
 void
-test_const(const NamedData<DATA>data)
+test_const(const NamedData<DATA> &data)
 {
   NamedData<DATA> newdata;
   newdata.merge(data);
   data.print(deallog);
-  
+
   deallog << "Const should be true: " << (newdata.is_const() ? "true" : "false") << std::endl;
 }
 
 template<typename DATA>
 void
-test_selector(const NamedData<DATA>data)
+test_selector(const NamedData<DATA> &data)
 {
   NamedSelection select;
   select.add("P1");
   select.add("P6");
-  select.add("P5");  
+  select.add("P5");
   select.add("P3");
   select.initialize(data);
 
-  for (unsigned int i=0;i<select.size();++i)
+  for (unsigned int i=0; i<select.size(); ++i)
     {
       deallog << "Selection " << i << ':';
       if (select(i) != deal_II_numbers::invalid_unsigned_int)
-       deallog << data.name(select(i)) << ' ' << *data(select(i));
+        deallog << data.name(select(i)) << ' ' << *data(select(i));
       deallog << std::endl;
     }
 }
@@ -70,7 +70,7 @@ test_shared_pointer()
   p = std_cxx1x::shared_ptr<double>(new double);
   data.add(p, "P5");
 
-  for (unsigned int i=0;i<data.size();++i)
+  for (unsigned int i=0; i<data.size(); ++i)
     *data(i) = i+0.5;
 
   test_const(data);
index 9efc5c9b1cfb6f008dc81a2fb15e950be01e5def..47d235c087fc282de445a69bfbdf97e9cb8038a9 100644 (file)
@@ -29,21 +29,21 @@ template <typename number>
 void check (const number &x)
 {
   deallog << "typeid(x).name() = " << typeid(x).name()
-         << std::endl;
+          << std::endl;
 
   deallog << "typeid(NumberTraits<number>::real_type).name() = "
-         << typeid(typename numbers::NumberTraits<number>::real_type).name()
-         << std::endl;
+          << typeid(typename numbers::NumberTraits<number>::real_type).name()
+          << std::endl;
 
   deallog << numbers::NumberTraits<number>::conjugate (x)
-         << std::endl;
+          << std::endl;
 
   deallog << numbers::NumberTraits<number>::abs_square (x)
-         << std::endl;
+          << std::endl;
 
   deallog << numbers::NumberTraits<number>::abs (x)
-         << std::endl;
-} 
+          << std::endl;
+}
 
 
 
index 68815cf0add72e51166c03e462e7e406439991fa..84a676308aafdf6a05eff0c7c884edefa4964180 100644 (file)
@@ -29,21 +29,21 @@ template <typename number>
 void check (const number &x)
 {
   deallog << "typeid(x).name() = " << typeid(x).name()
-         << std::endl;
+          << std::endl;
 
   deallog << "typeid(NumberTraits<number>::real_type).name() = "
-         << typeid(typename numbers::NumberTraits<number>::real_type).name()
-         << std::endl;
+          << typeid(typename numbers::NumberTraits<number>::real_type).name()
+          << std::endl;
 
   deallog << numbers::NumberTraits<number>::conjugate (x)
-         << std::endl;
+          << std::endl;
 
   deallog << numbers::NumberTraits<number>::abs_square (x)
-         << std::endl;
+          << std::endl;
 
   deallog << numbers::NumberTraits<number>::abs (x)
-         << std::endl;
-} 
+          << std::endl;
+}
 
 
 
@@ -62,7 +62,7 @@ int main ()
   check ((double)-1.5);
 
   check ((long double)1.5);
-  check ((long double)-1.5);  
+  check ((long double)-1.5);
 
   return 0;
 }
index c301b47ff427f4e18d089603cb48e5c0061c31a5..42a246328372510e75535811678edb5e2e4738f9 100644 (file)
 
 
 int sum (const int begin,
-        const int end)
+         const int end)
 {
   int s=0;
   for (int i=begin; i<end; ++i)
     s += i;
   return s;
 }
-  
+
 
 int main()
 {
index 7f7c8feb03350048ec58491f02f88ca2a31e7f13..41d7a9ebf66b861991e5d0309f01b0903c50538b 100644 (file)
@@ -40,12 +40,12 @@ int main()
   for (unsigned int i=0; i<N; ++i)
     x(i) = i;
 
-                                  // set y=2*x
+  // set y=2*x
   parallel::transform (x.begin(), x.end(), y.begin(),
-                      (2*boost::lambda::_1),
-                      10);
+                       (2*boost::lambda::_1),
+                       10);
 
-                                  // compute y=0 from the previous result
+  // compute y=0 from the previous result
   y -= x;
   y -= x;
 
index 5296c1e148bffa2f28bd4da10ea10186591de1b8..520fecb7bc7bd559c0cd819dfb1755d1010903fb 100644 (file)
@@ -43,12 +43,12 @@ int main()
       y(i) = -1.*i;
     }
 
-                                  // set z=x+2y, which happens to be zero
+  // set z=x+2y, which happens to be zero
   parallel::transform (x.begin(), x.end(),
-                      y.begin(),
-                      z.begin(),
-                      (boost::lambda::_1 + 2*boost::lambda::_2),
-                      10);
+                       y.begin(),
+                       z.begin(),
+                       (boost::lambda::_1 + 2*boost::lambda::_2),
+                       10);
 
   Assert (z.l2_norm() == 0, ExcInternalError());
 
index c3582fd2ada5cc391a2db2486c15c0b9a4b8377d..a81baea31ad93eb47073f0716aaf47063099549c 100644 (file)
@@ -43,15 +43,15 @@ int main()
       y(i) = 2*i;
       z(i) = 3*i;
     }
-  
-                                  // set a=x+y-z, which happens to be
-                                  // zero
+
+  // set a=x+y-z, which happens to be
+  // zero
   parallel::transform (x.begin(), x.end(),
-                      y.begin(),
-                      z.begin(),
-                      a.begin(),
-                      (boost::lambda::_1 + boost::lambda::_2 - boost::lambda::_3),
-                      10);
+                       y.begin(),
+                       z.begin(),
+                       a.begin(),
+                       (boost::lambda::_1 + boost::lambda::_2 - boost::lambda::_3),
+                       10);
 
   Assert (a.l2_norm() == 0, ExcInternalError());
 
index 779f89c287331981997a2e89dee6d06d009bcc39..5259e5f21e72deae829c068820cd5fd160a177a2 100644 (file)
@@ -1,6 +1,6 @@
 //-----------------------------------------------------------------------------
 //    $Id$
-//    Version: $Name$ 
+//    Version: $Name$
 //
 //    Copyright (C) 2006, 2010 by the deal.II authors
 //
 
 double cell_coordinates [3][8] =
 {
-      { 0, 1, 0, 1, 0, 1, 0, 1 },
-      { 0, 0, 1, 1, 0, 0, 1, 1 },
-      { 0, 0, 0, 0, 1, 1, 1, 1 }
+  { 0, 1, 0, 1, 0, 1, 0, 1 },
+  { 0, 0, 1, 1, 0, 0, 1, 1 },
+  { 0, 0, 0, 0, 1, 1, 1, 1 }
 };
 
-      
+
 template <int dim, int spacedim>
 void
-create_patches(std::vector<DataOutBase::Patch<dim, spacedim> > & patches)
+create_patches(std::vector<DataOutBase::Patch<dim, spacedim> > &patches)
 {
-  for (unsigned int p=0;p<patches.size();++p)
+  for (unsigned int p=0; p<patches.size(); ++p)
     {
-      DataOutBase::Patch<dim, spacedim>patch = patches[p];
-      
+      DataOutBase::Patch<dim, spacedim> &patch = patches[p];
+
       const unsigned int nsub = p+1;
       const unsigned int nsubp = nsub+1;
-      
+
       patch.n_subdivisions = nsub;
-      for (unsigned int v=0;v<GeometryInfo<dim>::vertices_per_cell;++v)
-       for (unsigned int d=0;d<spacedim;++d)
-         patch.vertices[v](d) = p+cell_coordinates[d][v]
-                                + ((d>=dim) ? v : 0);
-      
+      for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
+        for (unsigned int d=0; d<spacedim; ++d)
+          patch.vertices[v](d) = p+cell_coordinates[d][v]
+                                 + ((d>=dim) ? v : 0);
+
       unsigned int n1 = (dim>0) ? nsubp : 1;
       unsigned int n2 = (dim>1) ? nsubp : 1;
       unsigned int n3 = (dim>2) ? nsubp : 1;
       unsigned int n4 = (dim>3) ? nsubp : 1;
       patch.data.reinit(5, n1*n2*n3*n4);
-      
-      for (unsigned int i4=0;i4<n4;++i4)
-       for (unsigned int i3=0;i3<n3;++i3)
-         for (unsigned int i2=0;i2<n2;++i2)
-           for (unsigned int i1=0;i1<n1;++i1)
-             {
-               const unsigned int i = i1+nsubp*(i2+nsubp*(i3+nsubp*i4));
-               const float x1 = 1.*i1/nsub;
-               const float x2 = 1.*i2/nsub;
-               const float x3 = 1.*i3/nsub;
-               const float x4 = 1.*i4/nsub;
-               
-               patch.data(0,i) = p+x1;
-               patch.data(1,i) = p+x2;
-               patch.data(2,i) = p+x3;
-               patch.data(3,i) = p+x4;
-               patch.data(4,i) = i;
-             }
+
+      for (unsigned int i4=0; i4<n4; ++i4)
+        for (unsigned int i3=0; i3<n3; ++i3)
+          for (unsigned int i2=0; i2<n2; ++i2)
+            for (unsigned int i1=0; i1<n1; ++i1)
+              {
+                const unsigned int i = i1+nsubp*(i2+nsubp*(i3+nsubp*i4));
+                const float x1 = 1.*i1/nsub;
+                const float x2 = 1.*i2/nsub;
+                const float x3 = 1.*i3/nsub;
+                const float x4 = 1.*i4/nsub;
+
+                patch.data(0,i) = p+x1;
+                patch.data(1,i) = p+x2;
+                patch.data(2,i) = p+x3;
+                patch.data(3,i) = p+x4;
+                patch.data(4,i) = i;
+              }
       patch.patch_index = p;
     }
 }
@@ -75,7 +75,7 @@ create_patches(std::vector<DataOutBase::Patch<dim, spacedim> > & patches)
 template <int dim>
 void
 create_continuous_patches(
-  std::vector<DataOutBase::Patch<dim, dim> > & patches,
+  std::vector<DataOutBase::Patch<dim, dim> > &patches,
   unsigned int n_cells,
   unsigned int n_sub)
 {
@@ -88,39 +88,39 @@ create_continuous_patches(
   QIterated<dim> trapezsub(trapez1d, n_sub);
 
   Point<dim> midpoint;
-  for (unsigned int d=0;d<dim;++d)
+  for (unsigned int d=0; d<dim; ++d)
     midpoint(d) = n_cells/2.;
-  
+
   Functions::CutOffFunctionCinfty<dim> function(2., midpoint);
-  
-  for (unsigned int i3=0;i3<n3;++i3)
-    for (unsigned int i2=0;i2<n2;++i2)
-      for (unsigned int i1=0;i1<n1;++i1)
-       {
-         DataOutBase::Patch<dim, dim> patch;
-         patch.n_subdivisions = n_sub;
-         for (unsigned int k=0;k<trapez.size();++k)
-           {
-             Point<dim> p = trapez.point(k);
-             if (dim>=1) p(0) += i1;
-             if (dim>=2) p(1) += i2;
-             if (dim>=3) p(2) += i3;
-             patch.vertices[k] = p;
-           }
-         std::vector<Point<dim> > points = trapezsub.get_points();
-         for (unsigned int k=0;k<points.size();++k)
-           {
-             if (dim>=1) points[k](0) += i1;
-             if (dim>=2) points[k](1) += i2;
-             if (dim>=3) points[k](2) += i3;
-           }
-         std::vector<double> values(points.size());
-         function.value_list(points, values);
-         patch.data.reinit(1, points.size());
-         for (unsigned int k=0;k<points.size();++k)
-           patch.data(0,k) = values[k];
-         patches.push_back(patch);
-       }
+
+  for (unsigned int i3=0; i3<n3; ++i3)
+    for (unsigned int i2=0; i2<n2; ++i2)
+      for (unsigned int i1=0; i1<n1; ++i1)
+        {
+          DataOutBase::Patch<dim, dim> patch;
+          patch.n_subdivisions = n_sub;
+          for (unsigned int k=0; k<trapez.size(); ++k)
+            {
+              Point<dim> p = trapez.point(k);
+              if (dim>=1) p(0) += i1;
+              if (dim>=2) p(1) += i2;
+              if (dim>=3) p(2) += i3;
+              patch.vertices[k] = p;
+            }
+          std::vector<Point<dim> > points = trapezsub.get_points();
+          for (unsigned int k=0; k<points.size(); ++k)
+            {
+              if (dim>=1) points[k](0) += i1;
+              if (dim>=2) points[k](1) += i2;
+              if (dim>=3) points[k](2) += i3;
+            }
+          std::vector<double> values(points.size());
+          function.value_list(points, values);
+          patch.data.reinit(1, points.size());
+          for (unsigned int k=0; k<points.size(); ++k)
+            patch.data(0,k) = values[k];
+          patches.push_back(patch);
+        }
 }
 
 #endif
index cf797e4bb0857b9bfa2968c93693297b2f09d06e..6c872c5599bd5958a149cc3453c3d4c18208aa22 100644 (file)
@@ -28,7 +28,7 @@ int main()
 
   PathSearch::add_class("CC");
 
-                                  // Open with full debugging
+  // Open with full debugging
   PathSearch cc("CC", 3);
   cc.add_path("../");
   cc.add_path("../scripts/", PathSearch::front);
@@ -40,13 +40,13 @@ int main()
   cc.add_suffix(".h", PathSearch::after_none);
   deallog << cc.find("tests") << std::endl;
   cc.show(deallog);
-  
+
   PathSearch mesh("MESH", 3);
   mesh.add_path("../bits/");
   mesh.show(deallog);
   std::ifstream in(mesh.find("grid_in_msh_01.2d").c_str());
   std::string line;
-  for (unsigned int i=0;i<4;++i)
+  for (unsigned int i=0; i<4; ++i)
     {
       in >> line;
       deallog << ' ' << line;
index 96162f0c056b7870ca2a0d93f28e38c45f6cf2e0..6ab401c31715fa99e6b52278517e457367e5f619 100644 (file)
@@ -27,17 +27,17 @@ int main()
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-                                  // create a pattern and let it
-                                  // output its description
+  // create a pattern and let it
+  // output its description
   Patterns::Integer pattern(-1,42);
   const std::string desc = pattern.description();
 
-                                  // now let the same class re-create
-                                  // a pattern object from the
-                                  // description and verify that the
-                                  // result is the same as what we
-                                  // started out with
-  Patterns::Integer * pattern2 = Patterns::Integer::create (desc);
+  // now let the same class re-create
+  // a pattern object from the
+  // description and verify that the
+  // result is the same as what we
+  // started out with
+  Patterns::Integer *pattern2 = Patterns::Integer::create (desc);
 
   Assert (pattern2 != 0, ExcInternalError());
   Assert (desc == pattern2->description(), ExcInternalError());
index bbc0bddfc8aa19fdc7b22ced1a972cfa368136b8..51991db6d7d4df609134f433f466d179b66ee36d 100644 (file)
 using namespace Polynomials;
 
 
-double scalar_product (const Polynomial<double>p1,
-                      const Polynomial<double>& p2)
+double scalar_product (const Polynomial<double> &p1,
+                       const Polynomial<double> &p2)
 {
   unsigned int degree = (p1.degree() + p2.degree())/2 + 1;
   QGauss<1> gauss(degree);
 
   double sum = 0.;
-  for (unsigned int i=0;i<gauss.size();++i)
+  for (unsigned int i=0; i<gauss.size(); ++i)
     {
       double x = gauss.point(i)(0);
       double P1 = p1.value(x);
@@ -59,7 +59,7 @@ void polynomial_arithmetic ()
   c1[2] = 5;
   c1[3] = 4;
   Polynomial<double> p1(c1);
-  
+
   std::vector<double> c2(3);
   c2[0] = .4;
   c2[1] = .7;
@@ -85,8 +85,8 @@ void polynomial_arithmetic ()
   std::cerr << "*P2" << std::endl;
   p2 *= p1;
   p2.print(std::cerr);
-  
-  for (unsigned int i=0;i<7;++i)
+
+  for (unsigned int i=0; i<7; ++i)
     {
       std::cerr << "derive" << std::endl;
       p1 = p1.derivative();
@@ -105,88 +105,88 @@ int main ()
   deallog.log_cerr();
 
   polynomial_arithmetic();
-  
+
   std::vector<Polynomial<double> > p;
   std::vector<Polynomial<double> > q;
 
   deallog << "Legendre" << std::endl;
-  
-  for (unsigned int i=0;i<12;++i)
+
+  for (unsigned int i=0; i<12; ++i)
     {
       p.push_back (Legendre(i));
     }
-  
-  
-  for (unsigned int i=0;i<p.size();++i)
-    for (unsigned int j=0;j<=i;++j)
+
+
+  for (unsigned int i=0; i<p.size(); ++i)
+    for (unsigned int j=0; j<=i; ++j)
       deallog << 'P' << i << " * P" << j
-             << " = " << scalar_product(p[i], p[j]) << std::endl;
+              << " = " << scalar_product(p[i], p[j]) << std::endl;
 
 
   deallog << "LagrangeEquidistant" << std::endl;
-  
+
   p.clear();
-  for (unsigned int i=0;i<6;++i)
+  for (unsigned int i=0; i<6; ++i)
     {
       p.push_back(LagrangeEquidistant(6, i));
       q.push_back(LagrangeEquidistant(6, i));
     }
 
-                                  // We add 1.0001 because of bugs in
-                                  // the ostream classes
-  for (unsigned int i=0;i<p.size();++i)
-    for (unsigned int j=0;j<p.size();++j)
+  // We add 1.0001 because of bugs in
+  // the ostream classes
+  for (unsigned int i=0; i<p.size(); ++i)
+    for (unsigned int j=0; j<p.size(); ++j)
       deallog << 'P' << i << "(x" << j
-             << ") = " << p[i].value((double) j/p.size())+1.0001 << std::endl;
+              << ") = " << p[i].value((double) j/p.size())+1.0001 << std::endl;
 
-  for (unsigned int i=0;i<p.size();++i)
+  for (unsigned int i=0; i<p.size(); ++i)
     {
       q[i].scale(.5);
-      for (unsigned int j=0;j<p.size();++j)
-       {
-         double x = (double) j/p.size();
-         if (std::fabs(q[i].value(2.*x)-p[i].value(x)) > 1.e-15)
-           deallog << "Polynomial " << i
-                   << ": Values q(" << 2.*x
-                   << ") and p(" << x
-                   << ") differ after scale: " << q[i].value(2.*x)
-                   << " != " << p[i].value(x)
-                   << std::endl;
-       }
+      for (unsigned int j=0; j<p.size(); ++j)
+        {
+          double x = (double) j/p.size();
+          if (std::fabs(q[i].value(2.*x)-p[i].value(x)) > 1.e-15)
+            deallog << "Polynomial " << i
+                    << ": Values q(" << 2.*x
+                    << ") and p(" << x
+                    << ") differ after scale: " << q[i].value(2.*x)
+                    << " != " << p[i].value(x)
+                    << std::endl;
+        }
       q[i].shift((double) 1.);
-      for (unsigned int j=0;j<p.size();++j)
-       {
-         double x = (double) j/p.size();
-         double diff = std::fabs(q[i].value(2.*x-1.)-p[i].value(x));
-         if (diff > 1.e-13)
-           deallog << "Polynomial " << i
-                   << ": Values q(" << 2.*x-1.
-                   << ") and p(" << x
-                   << ") differ by 10^" << std::log(diff)/std::log(10.)
-                   << " after shift: " << q[i].value(2.*x-1.)
-                   << " != " << p[i].value(x)
-                   << std::endl;
-       }
+      for (unsigned int j=0; j<p.size(); ++j)
+        {
+          double x = (double) j/p.size();
+          double diff = std::fabs(q[i].value(2.*x-1.)-p[i].value(x));
+          if (diff > 1.e-13)
+            deallog << "Polynomial " << i
+                    << ": Values q(" << 2.*x-1.
+                    << ") and p(" << x
+                    << ") differ by 10^" << std::log(diff)/std::log(10.)
+                    << " after shift: " << q[i].value(2.*x-1.)
+                    << " != " << p[i].value(x)
+                    << std::endl;
+        }
     }
 
   deallog << "Hierarchical" << std::endl;
-  
+
   p.clear ();
-  for (unsigned int i=0;i<12;++i)
+  for (unsigned int i=0; i<12; ++i)
     {
       p.push_back (Hierarchical(i));
     }
 
-  for (unsigned int i=0;i<p.size();++i)
+  for (unsigned int i=0; i<p.size(); ++i)
     {
       deallog << "N0(P" << i << ")"
-             << " = " << p[i].value(0.) << std::endl;
+              << " = " << p[i].value(0.) << std::endl;
     }
 
-  for (unsigned int i=0;i<p.size();++i)
+  for (unsigned int i=0; i<p.size(); ++i)
     {
       deallog << "N1(P" << i << ")"
-             << " = " << p[i].value(1.) << std::endl;
+              << " = " << p[i].value(1.) << std::endl;
     }
 
   std::vector<double> values (p.size());
@@ -194,15 +194,15 @@ int main ()
   for (unsigned int j=2; j<p.size(); ++j)
     {
       double factor = 1.;
-      for (unsigned int k=0; k<j;++k)
-       factor /= 2. * (j-k);
-
-      for (unsigned int i=0;i<p.size();++i)
-       {
-         p[i].value (.5, values);
-         deallog << "N" << j << "(P" << i << ")"
-                 << " = " << values[j] * factor << std::endl;
-       }
+      for (unsigned int k=0; k<j; ++k)
+        factor /= 2. * (j-k);
+
+      for (unsigned int i=0; i<p.size(); ++i)
+        {
+          p[i].value (.5, values);
+          deallog << "N" << j << "(P" << i << ")"
+                  << " = " << values[j] * factor << std::endl;
+        }
     }
 }
 
index d27ed48600b91f22e55447d4d3d76a77e3918e0c..f0cd87b8650be424905c8d92906899c782ded929 100644 (file)
 
 using namespace Polynomials;
 
-void plot(const std::vector<Polynomial<double> >polynomials)
+void plot(const std::vector<Polynomial<double> > &polynomials)
 {
   LogStream::Prefix("plot");
   const unsigned int n=8;
-  for (unsigned int i=0;i<=n;++i)
+  for (unsigned int i=0; i<=n; ++i)
     {
       const double x = 1.*i/n;
       deallog << x;
-      for (unsigned int p=0;p<polynomials.size();++p)
-       deallog << '\t' << polynomials[p].value(x);
+      for (unsigned int p=0; p<polynomials.size(); ++p)
+        deallog << '\t' << polynomials[p].value(x);
       deallog << std::endl;
     }
 }
 
-void interpolation_conditions(const std::vector<Polynomial<double> >polynomials)
+void interpolation_conditions(const std::vector<Polynomial<double> > &polynomials)
 {
   std::vector<double> values(2);
-  for (unsigned int i=0;i<polynomials.size();++i)
+  for (unsigned int i=0; i<polynomials.size(); ++i)
     {
       polynomials[i].value(0., values);
       deallog << i << "\t 0:\t" << values[0] << '\t' << values[1] << std::endl;
@@ -59,7 +59,7 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-12);
-  
+
   interpolation_conditions(HermiteInterpolation::generate_complete_basis(6));
   plot(HermiteInterpolation::generate_complete_basis(6));
 }
index 7d68f337a6fb5b28871933f6a3349c776df901aa..8e2d3cef5482be68701c4525aab3ebea4bd582fd 100644 (file)
 
 using namespace Polynomials;
 
-void check_interpolation (const std::vector<Polynomial<double> >p,
-                         const std::vector<Point<1> >& x)
+void check_interpolation (const std::vector<Polynomial<double> > &p,
+                          const std::vector<Point<1> > &x)
 {
-  for (unsigned int i=0;i<p.size();++i)
+  for (unsigned int i=0; i<p.size(); ++i)
     {
       deallog << i;
-      for (unsigned int k=0;k<x.size();++k)
-       {
-         deallog << '.';
-         const double y = p[i].value(x[k](0));
-         if (i == k)
-           {
-             if (std::fabs(y-1.) > 2.e-10)
-               deallog << "Error1  lg y=" << std::log10(std::fabs(y-1.))
-                       << std::endl;
-           }
-         else
-           {
-             if (std::fabs(y) > 3.e-10)
-               deallog << "Error0  lg y=" << std::log10(std::fabs(y))
-                       << std::endl;
-           }
-       }
+      for (unsigned int k=0; k<x.size(); ++k)
+        {
+          deallog << '.';
+          const double y = p[i].value(x[k](0));
+          if (i == k)
+            {
+              if (std::fabs(y-1.) > 2.e-10)
+                deallog << "Error1  lg y=" << std::log10(std::fabs(y-1.))
+                        << std::endl;
+            }
+          else
+            {
+              if (std::fabs(y) > 3.e-10)
+                deallog << "Error0  lg y=" << std::log10(std::fabs(y))
+                        << std::endl;
+            }
+        }
       deallog << std::endl;
     }
 }
 
 
 void
-check_poly (const Quadrature<1>q)
+check_poly (const Quadrature<1> &q)
 {
   deallog << "Points: " << q.size() << std::endl;
   std::vector<Polynomial<double> > p = generate_complete_Lagrange_basis(q.get_points());
@@ -72,7 +72,7 @@ check_lge (unsigned int n)
   std::vector<Polynomial<double> > p = LagrangeEquidistant::generate_complete_basis(n);
   std::vector<Point<1> > x(n+1);
   const double h = 1./n;
-  for (unsigned int i=0;i<=n;++i)
+  for (unsigned int i=0; i<=n; ++i)
     x[i](0) = h*i;
   check_interpolation(p, x);
 }
@@ -85,7 +85,7 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
 //  deallog.threshold_double(1.e-10);
-  
+
   QTrapez<1> trapez;
   QSimpson<1> simpson;
   QIterated<1> equi7(trapez, 6);
@@ -103,7 +103,7 @@ int main()
   QGaussLobatto<1> gl6(6);
   QGaussLobatto<1> gl7(7);
   QGaussLobatto<1> gl10(10);
-  
+
   deallog.push("LagrangeEquidistant");
   check_lge(6);
   check_lge(9);
@@ -114,13 +114,13 @@ int main()
   check_poly(equi7);
   check_poly(equi10);
   deallog.pop();
-  deallog.push("Gauss");  
+  deallog.push("Gauss");
   check_poly(g2);
   check_poly(g3);
   check_poly(g7);
   check_poly(g10);
   deallog.pop();
-  deallog.push("GaussLobatto");  
+  deallog.push("GaussLobatto");
   check_poly(gl2);
   check_poly(gl3);
   check_poly(gl4);
index 5083600733a5fad897fe88db2e4c82b754af177c..7b67d26f2b040bd6f5199fe8b5ddd0b393834ad2 100644 (file)
@@ -43,8 +43,8 @@ void check_scale (const std::vector<Polynomial<double> > &p)
       double value1 = p[i].value (factor * x);
       double value2 = q   .value (x);
       if (std::fabs(value1-value2) > std::max(1e-13,1e-13*std::fabs(value1)))
-       deallog << "Error scale at x=" << x << ": p(t)=" << value1
-               << ", q(x)=" << value2 << std::endl;
+        deallog << "Error scale at x=" << x << ": p(t)=" << value1
+                << ", q(x)=" << value2 << std::endl;
       deallog << ".";
     }
   deallog << std::endl;
@@ -54,7 +54,7 @@ void check_scale (const std::vector<Polynomial<double> > &p)
 
 void check_shift (const std::vector<Polynomial<double> > &p)
 {
-                               // shift does not work for too high orders
+  // shift does not work for too high orders
   if (p.size() > 30)
     return;
 
@@ -68,8 +68,8 @@ void check_shift (const std::vector<Polynomial<double> > &p)
       double value1 = p[i].value (x+a);
       double value2 = q   .value (x);
       if (std::fabs(value1-value2) > std::max(1e-13,1e-13*std::fabs(value1)))
-       deallog << "Error shift at x=" << x << ": p(t)=" << value1
-               << ", q(x)=" << value2 << std::endl;
+        deallog << "Error shift at x=" << x << ": p(t)=" << value1
+                << ", q(x)=" << value2 << std::endl;
       deallog << ".";
     }
   deallog << std::endl;
@@ -89,8 +89,8 @@ void check_mult_scalar (const std::vector<Polynomial<double> > &p)
       double value1 = p[i].value (x) * a;
       double value2 = q   .value (x);
       if (std::fabs(value1-value2) > std::max(1e-13,1e-13*std::fabs(value1)))
-       deallog << "Error multiply at x=" << x << ": a*p(x)=" << value1
-               << ", q(x)=" << value2 << std::endl;
+        deallog << "Error multiply at x=" << x << ": a*p(x)=" << value1
+                << ", q(x)=" << value2 << std::endl;
       deallog << ".";
     }
   deallog << std::endl;
@@ -104,16 +104,16 @@ void check_mult (const std::vector<Polynomial<double> > &p)
   for (unsigned int i=0; i<p.size(); ++i)
     {
       for (unsigned int j=0; j<p.size(); ++j)
-       {
-         Polynomial<double> q = p[i];
-         q *= p[j];
-         double x = (double)rand()/RAND_MAX;
-         double value1 = p[i].value (x) * p[j].value(x);
-         double value2 = q   .value (x);
-         if (std::fabs(value1-value2) > std::max(1e-13,1e-13*std::fabs(value1)))
-           deallog << "Error multiply at x=" << x << ": p_1(x)*p_2(x)=" << value1
-                   << ", q(x)=" << value2 << std::endl;
-       }
+        {
+          Polynomial<double> q = p[i];
+          q *= p[j];
+          double x = (double)rand()/RAND_MAX;
+          double value1 = p[i].value (x) * p[j].value(x);
+          double value2 = q   .value (x);
+          if (std::fabs(value1-value2) > std::max(1e-13,1e-13*std::fabs(value1)))
+            deallog << "Error multiply at x=" << x << ": p_1(x)*p_2(x)=" << value1
+                    << ", q(x)=" << value2 << std::endl;
+        }
       deallog << ".";
     }
   deallog << std::endl;
@@ -125,15 +125,15 @@ void check_expand (const std::vector<Polynomial<double> > &p)
 {
   if (p.size() > 10)
     return;
-                               // this checks whether the Lagrange product
-                               // form and the usual form with factors for
-                               // different powers does the same
-                               // thing. Realize this by adding the
-                               // polynomial '0' to the current
-                               // polynomial. That destroys the product form
-                               // and triggers the usual form. do not do this
-                               // for higher order because then the standard
-                               // form is unstable
+  // this checks whether the Lagrange product
+  // form and the usual form with factors for
+  // different powers does the same
+  // thing. Realize this by adding the
+  // polynomial '0' to the current
+  // polynomial. That destroys the product form
+  // and triggers the usual form. do not do this
+  // for higher order because then the standard
+  // form is unstable
   deallog << "Expansion operation";
   Monomial<double> zero(0, 0.);
   for (unsigned int i=0; i<p.size(); ++i)
@@ -144,8 +144,8 @@ void check_expand (const std::vector<Polynomial<double> > &p)
       double value1 = p[i].value (x);
       double value2 = q   .value (x);
       if (std::fabs(value1-value2) > std::max(1e-10,1e-10*std::fabs(value1)))
-       deallog << "Error expansion at x=" << x << ": p(x)=" << value1
-               << ", q(x)=" << value2 << std::endl;
+        deallog << "Error expansion at x=" << x << ": p(x)=" << value1
+                << ", q(x)=" << value2 << std::endl;
       deallog << ".";
     }
   deallog << std::endl;
@@ -162,18 +162,18 @@ void check_mult_expand (const std::vector<Polynomial<double> > &p)
   for (unsigned int i=0; i<p.size(); ++i)
     {
       for (unsigned int j=0; j<p.size(); ++j)
-       {
-         Polynomial<double> q = p[i];
-         q += zero;
-         q *= p[j];
-         double x = (double)rand()/RAND_MAX;
-         double value1 = p[i].value (x) * p[j].value(x);
-         double value2 = q   .value (x);
-         if (std::fabs(value1-value2) > std::max(1e-10,1e-10*std::fabs(value1)))
-           deallog << "Error multiply at x=" << x
-                   << ": p_"<<i<< "(x)*p_"<<j<<"(x)=" << value1
-                   << ", q(x)=" << value2 << std::endl;
-       }
+        {
+          Polynomial<double> q = p[i];
+          q += zero;
+          q *= p[j];
+          double x = (double)rand()/RAND_MAX;
+          double value1 = p[i].value (x) * p[j].value(x);
+          double value2 = q   .value (x);
+          if (std::fabs(value1-value2) > std::max(1e-10,1e-10*std::fabs(value1)))
+            deallog << "Error multiply at x=" << x
+                    << ": p_"<<i<< "(x)*p_"<<j<<"(x)=" << value1
+                    << ", q(x)=" << value2 << std::endl;
+        }
       deallog << ".";
     }
   deallog << std::endl;
@@ -198,7 +198,7 @@ check_lge (unsigned int n)
 
 
 void
-check_poly (const Quadrature<1>q)
+check_poly (const Quadrature<1> &q)
 {
   deallog << "Points: " << q.size() << std::endl;
   std::vector<Polynomial<double> > p = generate_complete_Lagrange_basis(q.get_points());
@@ -227,9 +227,9 @@ int main()
   deallog.pop();
   deallog << std::endl;
 
-                               // Lagrange elements on GL points have good
-                               // conditioning, so test to some very high
-                               // orders
+  // Lagrange elements on GL points have good
+  // conditioning, so test to some very high
+  // orders
   deallog.push("GaussLobatto");
   for (unsigned i=1; i<40; i+=3)
     check_poly (QGaussLobatto<1>(i+1));
index 716561fdcb8a399cb1194468190cc3e9453bdebc..17982623b098a1b8f07b88507233e4a26e8f6846 100644 (file)
 using namespace Polynomials;
 
 
-void check_interpolation (const std::vector<Polynomial<double> >p,
-                         const std::vector<Point<1> >& x)
+void check_interpolation (const std::vector<Polynomial<double> > &p,
+                          const std::vector<Point<1> > &x)
 {
-  for (unsigned int i=0;i<p.size();++i)
+  for (unsigned int i=0; i<p.size(); ++i)
     {
       deallog << i;
-      for (unsigned int k=0;k<x.size();++k)
-       {
-         deallog << '.';
-         const double y = p[i].value(x[k](0));
-         if (i == k)
-           {
-             if (std::fabs(y-1.) > 1e-13)
-               deallog << "Error1  lg y=" << std::log10(std::fabs(y-1.))
-                       << std::endl;
-           }
-         else
-           {
-             if (std::fabs(y) > 1e-13)
-               deallog << "Error0  lg y=" << std::log10(std::fabs(y))
-                       << std::endl;
-           }
-       }
+      for (unsigned int k=0; k<x.size(); ++k)
+        {
+          deallog << '.';
+          const double y = p[i].value(x[k](0));
+          if (i == k)
+            {
+              if (std::fabs(y-1.) > 1e-13)
+                deallog << "Error1  lg y=" << std::log10(std::fabs(y-1.))
+                        << std::endl;
+            }
+          else
+            {
+              if (std::fabs(y) > 1e-13)
+                deallog << "Error0  lg y=" << std::log10(std::fabs(y))
+                        << std::endl;
+            }
+        }
       deallog << std::endl;
     }
 }
 
 
 
-void check_constant (const std::vector<Polynomial<double> >p)
+void check_constant (const std::vector<Polynomial<double> > &p)
 {
-                               // check whether the sum of all polynomials in
-                               // the basis gives one for a given point
+  // check whether the sum of all polynomials in
+  // the basis gives one for a given point
   deallog << "Representation of one at random points";
   for (unsigned int j=0; j<12; ++j)
     {
       double x = (double)rand()/RAND_MAX;
       double value = 0;
-      for (unsigned int i=0;i<p.size();++i)
-       {
-         value += p[i].value(x);
-       }
+      for (unsigned int i=0; i<p.size(); ++i)
+        {
+          value += p[i].value(x);
+        }
       deallog << ".";
       if (std::fabs (1.-value) > 1e-13)
-       deallog << "Error1  lg y=" << std::log10(std::fabs(1.-value))
-               << std::endl;
+        deallog << "Error1  lg y=" << std::log10(std::fabs(1.-value))
+                << std::endl;
     }
   deallog << std::endl;
 
@@ -86,7 +86,7 @@ void check_constant (const std::vector<Polynomial<double> >& p)
 
 
 void
-check_poly (const Quadrature<1>q)
+check_poly (const Quadrature<1> &q)
 {
   deallog << "Points: " << q.size() << std::endl;
   std::vector<Polynomial<double> > p = generate_complete_Lagrange_basis(q.get_points());
@@ -104,7 +104,7 @@ check_lge (unsigned int n)
   std::vector<Polynomial<double> > p = LagrangeEquidistant::generate_complete_basis(n);
   std::vector<Point<1> > x(n+1);
   const double h = 1./n;
-  for (unsigned int i=0;i<=n;++i)
+  for (unsigned int i=0; i<=n; ++i)
     x[i](0) = h*i;
   check_interpolation(p, x);
   check_constant(p);
@@ -127,9 +127,9 @@ int main()
   deallog.pop();
   deallog << std::endl;
 
-                               // Lagrange elements on GL points have good
-                               // conditioning, so test to some very high
-                               // orders
+  // Lagrange elements on GL points have good
+  // conditioning, so test to some very high
+  // orders
   deallog.push("GaussLobatto");
   for (unsigned i=8; i<40; i+=3)
     check_poly (QGaussLobatto<1>(i+1));
index 2a536db168d6fbb2750e560d18d4dff09ab60d37..ed01525b7283f912a102951b376c9dca636ee0c2 100644 (file)
 using namespace Polynomials;
 
 
-void check_derivatives (const std::vector<Polynomial<double> >p,
-                       const unsigned int                      n_deriv)
+void check_derivatives (const std::vector<Polynomial<double> > &p,
+                        const unsigned int                      n_deriv)
 {
-                               // check whether the values and derivatives
-                               // are evaluated correctly some randomly
-                               // generated points. compare with a polynomial
-                               // that is not in product form (we get the
-                               // expanded form by adding a dummy polynomial;
-                               // addition of polynomials destroys the
-                               // product form in the current implementation)
+  // check whether the values and derivatives
+  // are evaluated correctly some randomly
+  // generated points. compare with a polynomial
+  // that is not in product form (we get the
+  // expanded form by adding a dummy polynomial;
+  // addition of polynomials destroys the
+  // product form in the current implementation)
   deallog << "Representation of derivatives up to order " << n_deriv-1 << std::endl;
   std::vector<double> values(n_deriv), values_ref(n_deriv);
   Monomial<double> zero (0,0);
@@ -52,15 +52,15 @@ void check_derivatives (const std::vector<Polynomial<double> >& p,
       q += zero;
       q.value (x, values_ref);
       for (unsigned int i=0; i<n_deriv; ++i)
-       {
-         deallog << ".";
-         if (std::fabs (values[i]-values_ref[i]) >
-             std::max(1e-11,1e-11*std::fabs(values[i])))
-           deallog << "Error deriv" << i << "  lg y="
-                   << std::log10(std::fabs(values[i]-values_ref[i]))
-                   << ", is: " << values[i] << ", should be: " << values_ref[i]
-                   << std::endl;
-       }
+        {
+          deallog << ".";
+          if (std::fabs (values[i]-values_ref[i]) >
+              std::max(1e-11,1e-11*std::fabs(values[i])))
+            deallog << "Error deriv" << i << "  lg y="
+                    << std::log10(std::fabs(values[i]-values_ref[i]))
+                    << ", is: " << values[i] << ", should be: " << values_ref[i]
+                    << std::endl;
+        }
     }
   deallog << std::endl;
 
@@ -69,7 +69,7 @@ void check_derivatives (const std::vector<Polynomial<double> >& p,
 
 
 void
-check_poly (const Quadrature<1>q)
+check_poly (const Quadrature<1> &q)
 {
   deallog << "Points: " << q.size() << std::endl;
   std::vector<Polynomial<double> > p = generate_complete_Lagrange_basis(q.get_points());
@@ -106,9 +106,9 @@ int main()
   deallog.pop();
   deallog << std::endl;
 
-                               // Lagrange elements on GL points have good
-                               // conditioning, so test to some very high
-                               // orders
+  // Lagrange elements on GL points have good
+  // conditioning, so test to some very high
+  // orders
   deallog.push("GaussLobatto");
   for (unsigned i=1; i<8; i+=2)
     check_poly (QGaussLobatto<1>(i+1));
index acd7fec7f834961f395137bca5d31e5894f50d2f..843616e124d44b71872bf0f18e5fce4609d99f93 100644 (file)
@@ -33,32 +33,32 @@ using namespace dealii;
 
 int main ()
 {
-    std::ofstream logfile("polynomial_minus_equals/output");
-    deallog << std::setprecision(3);
-    deallog.attach(logfile);
-    deallog.depth_console(0);
+  std::ofstream logfile("polynomial_minus_equals/output");
+  deallog << std::setprecision(3);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
 
-    //                 subtract two equal polynomials up to order p_dim
-    //                 the result evaluated at an arbitrary point
-    //                 should always be zero
+  //      subtract two equal polynomials up to order p_dim
+  //      the result evaluated at an arbitrary point
+  //      should always be zero
 
-    //                 check polynomials up to order 32
-       const unsigned int p_dim = 32;
+  //      check polynomials up to order 32
+  const unsigned int p_dim = 32;
 
-       std::vector<double> coefficients_a;
+  std::vector<double> coefficients_a;
 
-       //                      arbitrary point
-       double evalutation_number = 12.123;
+  //      arbitrary point
+  double evalutation_number = 12.123;
 
-       for (unsigned int pp = 0; pp < p_dim; pp++)
-       {
-               coefficients_a.push_back(pp);
+  for (unsigned int pp = 0; pp < p_dim; pp++)
+    {
+      coefficients_a.push_back(pp);
 
-               Polynomials::Polynomial<double> test_poly_a(coefficients_a);
-               Polynomials::Polynomial<double> test_poly_b(coefficients_a);
+      Polynomials::Polynomial<double> test_poly_a(coefficients_a);
+      Polynomials::Polynomial<double> test_poly_b(coefficients_a);
 
-               test_poly_b -= test_poly_a;
+      test_poly_b -= test_poly_a;
 
-               deallog << test_poly_b.value(evalutation_number) << std::endl;
-       }
+      deallog << test_poly_b.value(evalutation_number) << std::endl;
+    }
 }
index 3cf8e3e33121ed0f0d14ebeda08737d8b2e356c2..f9d377249654cb2a05cba4043f15e8662792a0fa 100644 (file)
@@ -35,65 +35,65 @@ using namespace Polynomials;
 
 
 template<int dim, class POLY>
-void check_poly(const Point<dim>x,
-               const POLY& p)
+void check_poly(const Point<dim> &x,
+                const POLY &p)
 {
   const unsigned int n = p.n();
   std::vector<double> values (n);
   std::vector<Tensor<1,dim> > gradients(n);
   std::vector<Tensor<2,dim> > second(n);
-  
+
   p.compute (x, values, gradients, second);
-  
-  for (unsigned int k=0;k<n;++k)
+
+  for (unsigned int k=0; k<n; ++k)
     {
-                                       // first make sure the
-                                       // individual functions work in
-                                       // a consistent way
-      
-                                      // Check if compute_value is ok
+      // first make sure the
+      // individual functions work in
+      // a consistent way
+
+      // Check if compute_value is ok
       double val = p.compute_value(k,x);
       if (std::fabs(val - values[k]) > 5.0E-15)
-       deallog << 'P' << k << ": values differ " << val << " != "
-               << values[k] << std::endl;
+        deallog << 'P' << k << ": values differ " << val << " != "
+                << values[k] << std::endl;
 
-                                       // Check if compute_grad is ok
+      // Check if compute_grad is ok
       Tensor<1,dim> grad = p.compute_grad(k,x);
       if ((grad-gradients[k]) * (grad-gradients[k]) > 5e-15*5e-15)
-       deallog << 'P' << k << ": gradients differ " << grad << " != "
-               << gradients[k] << std::endl;
-      
-                                      // Check if compute_grad_grad is ok
+        deallog << 'P' << k << ": gradients differ " << grad << " != "
+                << gradients[k] << std::endl;
+
+      // Check if compute_grad_grad is ok
       Tensor<2,dim> grad2 = p.compute_grad_grad(k,x);
       Tensor<2,dim> diff = grad2-second[k];
       double s = 0;
       for (unsigned int i=0; i<dim; ++i)
-       for (unsigned int j=0; j<dim; ++j)
-         s += diff[i][j]*diff[i][j];
+        for (unsigned int j=0; j<dim; ++j)
+          s += diff[i][j]*diff[i][j];
       if (s > 5e-15*5e-15)
-       deallog << 'P' << k << ": second derivatives differ " << grad2 << " != "
-               << second[k] << std::endl;
-
-
-                                       // finally output values,
-                                       // gradients, etc, to make sure
-                                       // that they are not only
-                                       // consistent, but also
-                                       // correct. Multiply them
-                                       // somewhat to make them
-                                       // significant despite our
-                                       // two-post-dot-digits limit
+        deallog << 'P' << k << ": second derivatives differ " << grad2 << " != "
+                << second[k] << std::endl;
+
+
+      // finally output values,
+      // gradients, etc, to make sure
+      // that they are not only
+      // consistent, but also
+      // correct. Multiply them
+      // somewhat to make them
+      // significant despite our
+      // two-post-dot-digits limit
       values[k] *= std::pow(10., dim);
       gradients[k] *= std::pow(10., dim);
-      
+
       deallog << 'P' << k << "\t= " << values[k]
-             << "\tgradient\t";
-      for (unsigned int d=0;d<dim;++d)
-       deallog << gradients[k][d] << '\t';
+              << "\tgradient\t";
+      for (unsigned int d=0; d<dim; ++d)
+        deallog << gradients[k][d] << '\t';
       deallog << "\t2nd\t";
-      for (unsigned int d1=0;d1<dim;++d1)
-       for (unsigned int d2=0;d2<dim;++d2)
-         deallog << second[k][d1][d2] << '\t';
+      for (unsigned int d1=0; d1<dim; ++d1)
+        for (unsigned int d2=0; d2<dim; ++d2)
+          deallog << second[k][d1][d2] << '\t';
       deallog << std::endl;
     }
   deallog << std::endl;
@@ -102,8 +102,8 @@ void check_poly(const Point<dim>& x,
 
 template <int dim>
 void
-check_tensor (const std::vector<Polynomial<double> >v,
-             const Point<dim>& x)
+check_tensor (const std::vector<Polynomial<double> > &v,
+              const Point<dim> &x)
 {
   deallog.push("Tensor");
   TensorProductPolynomials<dim> p(v);
@@ -114,8 +114,8 @@ check_tensor (const std::vector<Polynomial<double> >& v,
 
 template <int dim>
 void
-check_poly (const std::vector<Polynomial<double> >v,
-           const Point<dim>& x)
+check_poly (const std::vector<Polynomial<double> > &v,
+            const Point<dim> &x)
 {
   deallog.push("Polyno");
   PolynomialSpace<dim> p(v);
@@ -126,7 +126,7 @@ check_poly (const std::vector<Polynomial<double> >& v,
 
 
 void
-check_dimensions (const std::vector<Polynomial<double> >p)
+check_dimensions (const std::vector<Polynomial<double> > &p)
 {
   deallog.push("1d");
   check_tensor(p, Point<1>(.5));
@@ -152,16 +152,16 @@ int main()
 
   deallog.push("Lagrange");
   std::vector<Polynomial<double> > p;
-  for (unsigned int i=0;i<3;++i)
+  for (unsigned int i=0; i<3; ++i)
     p.push_back (LagrangeEquidistant(3, i));
 
   check_dimensions(p);
 
   deallog.pop();
   deallog.push("Legendre");
-  
+
   p.clear ();
-  for (unsigned int i=0;i<3;++i)
+  for (unsigned int i=0; i<3; ++i)
     p.push_back (Legendre(i));
 
   check_dimensions(p);
@@ -170,7 +170,7 @@ int main()
   deallog.push("Hierarchical");
 
   p.clear ();
-  for (unsigned int i=0;i<3;++i)
+  for (unsigned int i=0; i<3; ++i)
     p.push_back (Hierarchical(i));
 
   check_dimensions(p);
index 7b39eb8e41081953b6a117ddb72c0224335baad1..df091692bb282449b56b39dc1669230b8277f126 100644 (file)
@@ -31,7 +31,7 @@
 using namespace std;
 
 template <int dim>
-void plot(const PolynomialsBDM<dim>poly)
+void plot(const PolynomialsBDM<dim> &poly)
 {
   QTrapez<1> base_quadrature;
   QIterated<dim> quadrature(base_quadrature, poly.degree()+3);
@@ -39,19 +39,19 @@ void plot(const PolynomialsBDM<dim>& poly)
   std::vector<Tensor<2,dim> > grads;
   std::vector<Tensor<3,dim> > grads2;
 
-  
-  for (unsigned int k=0;k<quadrature.size();++k)
+
+  for (unsigned int k=0; k<quadrature.size(); ++k)
     {
       if (k%(poly.degree()+4) == 0)
-       deallog << "BDM" << poly.degree() << '<' << dim << '>' << std::endl;
-      
+        deallog << "BDM" << poly.degree() << '<' << dim << '>' << std::endl;
+
       deallog << "BDM" << poly.degree() << '<' << dim << '>'
-             << '\t' << quadrature.point(k);
+              << '\t' << quadrature.point(k);
       poly.compute(quadrature.point(k), values, grads, grads2);
-      
-      for (unsigned int i=0;i<poly.n();++i)
-       for (unsigned int d=0;d<dim;++d)
-         deallog << '\t' << values[i][d];
+
+      for (unsigned int i=0; i<poly.n(); ++i)
+        for (unsigned int d=0; d<dim; ++d)
+          deallog << '\t' << values[i][d];
       deallog << std::endl;
     }
 }
@@ -64,11 +64,11 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   PolynomialsBDM<2> p20(0);
   PolynomialsBDM<2> p21(1);
   PolynomialsBDM<2> p22(2);
-  
+
   plot(p20);
   plot(p21);
   plot(p22);
index 75206e6e3cf86fd024e644959274f243e0686c85..e0992d0ec51bca45fc24cf1cfd773362dd9d08f4 100644 (file)
@@ -30,7 +30,7 @@
 using namespace std;
 
 template <int dim>
-void plot(const PolynomialsRaviartThomas<dim>poly)
+void plot(const PolynomialsRaviartThomas<dim> &poly)
 {
   QTrapez<1> base_quadrature;
   QIterated<dim> quadrature(base_quadrature, poly.degree()+3);
@@ -38,19 +38,19 @@ void plot(const PolynomialsRaviartThomas<dim>& poly)
   std::vector<Tensor<2,dim> > grads;
   std::vector<Tensor<3,dim> > grads2;
 
-  
-  for (unsigned int k=0;k<quadrature.size();++k)
+
+  for (unsigned int k=0; k<quadrature.size(); ++k)
     {
       if (k%(poly.degree()+4) == 0)
-       deallog << "RT" << poly.degree() << '<' << dim << '>' << std::endl;
-      
+        deallog << "RT" << poly.degree() << '<' << dim << '>' << std::endl;
+
       deallog << "RT" << poly.degree() << '<' << dim << '>'
-             << '\t' << quadrature.point(k);
+              << '\t' << quadrature.point(k);
       poly.compute(quadrature.point(k), values, grads, grads2);
-      
-      for (unsigned int i=0;i<poly.n();++i)
-       for (unsigned int d=0;d<dim;++d)
-         deallog << '\t' << values[i][d];
+
+      for (unsigned int i=0; i<poly.n(); ++i)
+        for (unsigned int d=0; d<dim; ++d)
+          deallog << '\t' << values[i][d];
       deallog << std::endl;
     }
 }
index adc1879a4563bc0f43d0b60861db4965ef6dd72f..87c6145cf9a780a6d54245e74d3bef870fe1ac31 100644 (file)
@@ -32,8 +32,8 @@
 using namespace std;
 
 template<int dim, class POLY>
-void check_point (const Point<dim>x,
-                 const POLY& p)
+void check_point (const Point<dim> &x,
+                  const POLY &p)
 {
   const unsigned int n = p.n();
   std::vector<Tensor<1,dim> > values(n);
@@ -41,17 +41,17 @@ void check_point (const Point<dim>& x,
   std::vector<Tensor<3,dim> > seconds(0);
 
   p.compute(x, values, gradients, seconds);
-  
+
   deallog << "Point " << x << std::endl;
-  for (unsigned int i=0;i<n;++i)
+  for (unsigned int i=0; i<n; ++i)
     {
       deallog << "p[" << i << "] value ";
-      for (unsigned int d=0;d<dim;++d)
-       deallog << (int) (values[i][d]+.5) << ' ';
+      for (unsigned int d=0; d<dim; ++d)
+        deallog << (int) (values[i][d]+.5) << ' ';
       deallog << " first ";
-      for (unsigned int d1=0;d1<dim;++d1)
-       for (unsigned int d2=0;d2<dim;++d2)
-         deallog << (int) (gradients[i][d1][d2]+.5) << ' ';
+      for (unsigned int d1=0; d1<dim; ++d1)
+        for (unsigned int d2=0; d2<dim; ++d2)
+          deallog << (int) (gradients[i][d1][d2]+.5) << ' ';
       deallog << std::endl;
     }
 }
@@ -61,17 +61,17 @@ template<int dim>
 void check_bdm ()
 {
   Point<dim> x;
-  
+
   PolynomialsBDM<dim> p1(1);
   PolynomialsBDM<dim> p2(2);
   PolynomialsBDM<dim> p3(3);
   PolynomialsBDM<dim> p4(4);
-  
+
   x(0) = 2.;
   x(1) = 3.;
   if (dim>2)
     x(2) = 4;
-  
+
   check_point(x, p1);
   check_point(x, p2);
   check_point(x, p3);
@@ -82,17 +82,17 @@ template<int dim>
 void check_rt ()
 {
   Point<dim> x;
-  
+
   PolynomialsRaviartThomas<dim> p0(0);
   PolynomialsRaviartThomas<dim> p1(1);
   PolynomialsRaviartThomas<dim> p2(2);
   PolynomialsRaviartThomas<dim> p3(3);
-  
+
   x(0) = 2.;
   x(1) = 3.;
   if (dim>2)
     x(2) = 4;
-  
+
   check_point(x, p0);
   check_point(x, p1);
   check_point(x, p2);
index be55d67aae0d524a3cbb0e070e0819ea2082b0e5..180687ab7881778d1bb6193280491eff845037b7 100644 (file)
@@ -28,7 +28,7 @@
 #include <cmath>
 
 template<int dim>
-void check_line(Quadrature<1>quadrature)
+void check_line(Quadrature<1> &quadrature)
 {
   Point<dim> p1;
   Point<dim> p2;
@@ -46,8 +46,8 @@ void check_line(Quadrature<1>& quadrature)
     }
   Quadrature<dim> q = QProjector<dim>::project_to_line(quadrature, p1, p2);
   double s = 0.;
-  
-  for (unsigned int k=0;k<q.size();++k)
+
+  for (unsigned int k=0; k<q.size(); ++k)
     {
       deallog << k << '\t' << q.point(k) << std::endl;
       s += q.weight(k);
@@ -56,107 +56,107 @@ void check_line(Quadrature<1>& quadrature)
 }
 
 template<int dim>
-void check_face(Quadrature<1>q1)
+void check_face(Quadrature<1> &q1)
 {
   deallog << "Checking dim " << dim
-         << " 1d-points " << q1.size()
-         << std::endl;
-  
+          << " 1d-points " << q1.size()
+          << std::endl;
+
   Quadrature<dim-1> subquadrature(q1);
-  for (unsigned int f=0;f<GeometryInfo<dim>::faces_per_cell;++f)
+  for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     {
       deallog << "Face " << f
-             << std::endl;
-      
+              << std::endl;
+
       Quadrature<dim> quadrature
-       = QProjector<dim>::project_to_face(subquadrature, f);
-      for (unsigned int k=0;k<quadrature.size();++k)
-       deallog << quadrature.point(k) << std::endl;
+        = QProjector<dim>::project_to_face(subquadrature, f);
+      for (unsigned int k=0; k<quadrature.size(); ++k)
+        deallog << quadrature.point(k) << std::endl;
     }
 
-  for (unsigned int f=0;f<GeometryInfo<dim>::faces_per_cell;++f)
-    for (unsigned int s=0;s<GeometryInfo<dim>::max_children_per_face;++s)
+  for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+    for (unsigned int s=0; s<GeometryInfo<dim>::max_children_per_face; ++s)
       {
-       deallog << "Face " << f << " subface " << s
-               << std::endl;
-       
-       Quadrature<dim> quadrature
-         = QProjector<dim>::project_to_face(subquadrature, f);
-       for (unsigned int k=0;k<quadrature.size();++k)
-         deallog << quadrature.point(k) << std::endl;
+        deallog << "Face " << f << " subface " << s
+                << std::endl;
+
+        Quadrature<dim> quadrature
+          = QProjector<dim>::project_to_face(subquadrature, f);
+        for (unsigned int k=0; k<quadrature.size(); ++k)
+          deallog << quadrature.point(k) << std::endl;
       }
 }
 
 template<int dim>
-void check_faces (Quadrature<1>q1)
+void check_faces (Quadrature<1> &q1)
 {
   const unsigned int nq = q1.size();
-  
+
   deallog << "Checking dim " << dim
-         << " 1d-points " << nq
-         << std::endl;
+          << " 1d-points " << nq
+          << std::endl;
 
 
   Quadrature<dim-1> subquadrature(q1);
   const unsigned int nqs = subquadrature.size();
-  
+
   Quadrature<dim> faces = QProjector<dim>::project_to_all_faces(subquadrature);
 
-  for (unsigned int f=0;f<GeometryInfo<dim>::faces_per_cell;++f)
+  for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     {
 
       deallog << "Face " << f
-             << " orientation false"
-             << std::endl;
+              << " orientation false"
+              << std::endl;
 
       unsigned int
-       offset = QProjector<dim>::DataSetDescriptor::face(f, false, false, false, nqs);
-      
-      for (unsigned int k=0;k<nqs;++k)
-       deallog << faces.point(offset+k) << std::endl;
-      
+      offset = QProjector<dim>::DataSetDescriptor::face(f, false, false, false, nqs);
+
+      for (unsigned int k=0; k<nqs; ++k)
+        deallog << faces.point(offset+k) << std::endl;
+
       deallog << "Face " << f
-             << " orientation true"
-             << std::endl;
-      
+              << " orientation true"
+              << std::endl;
+
       offset = QProjector<dim>::DataSetDescriptor::face(f, true, false, false, nqs);
-      
-      for (unsigned int k=0;k<nqs;++k)
-       deallog << faces.point(offset+k) << std::endl;
+
+      for (unsigned int k=0; k<nqs; ++k)
+        deallog << faces.point(offset+k) << std::endl;
     }
-  
-                                  /*
+
+  /*
   Quadrature<dim> subs = QProjector<dim>::project_to_all_subfaces(subquadrature);
 
 
   for (unsigned int f=0;f<GeometryInfo<dim>::faces_per_cell;++f)
-    for (unsigned int s=0;s<GeometryInfo<dim>::max_children_per_face;++s)
-      {
+  for (unsigned int s=0;s<GeometryInfo<dim>::max_children_per_face;++s)
+  {
 
-       deallog << "Face " << f << " subface " << s
-               << " orientation false"
-               << std::endl;
-       
-       unsigned int
-         offset = QProjector<dim>::DataSetDescriptor::subface(f, s, false, nqs);
-       
-       for (unsigned int k=0;k<nqs;++k)
-         deallog << faces.point(offset+k) << std::endl;
-       
-       deallog << "Face " << f << " subface " << s
-               << " orientation true"
-               << std::endl;
-       
-       offset = QProjector<dim>::DataSetDescriptor::subface(f, s, true, nqs);
-       
-       for (unsigned int k=0;k<nqs;++k)
-         deallog << faces.point(offset+k) << std::endl;
-      }
-                                  */
+  deallog << "Face " << f << " subface " << s
+  << " orientation false"
+  << std::endl;
+
+  unsigned int
+  offset = QProjector<dim>::DataSetDescriptor::subface(f, s, false, nqs);
+
+  for (unsigned int k=0;k<nqs;++k)
+  deallog << faces.point(offset+k) << std::endl;
+
+  deallog << "Face " << f << " subface " << s
+  << " orientation true"
+  << std::endl;
+
+  offset = QProjector<dim>::DataSetDescriptor::subface(f, s, true, nqs);
+
+  for (unsigned int k=0;k<nqs;++k)
+  deallog << faces.point(offset+k) << std::endl;
+  }
+  */
 }
 
 
-void check(Quadrature<1>q)
+void check(Quadrature<1> &q)
 {
   deallog << std::endl;
   deallog.push("line");
@@ -181,7 +181,7 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog << std::setprecision(2);
-  
+
   deallog.threshold_double(1.e-10);
 
   Quadrature<1> none(0);
@@ -189,10 +189,10 @@ int main()
 
   QGauss<1> midpoint(1);
   check(midpoint);
-  
+
   QTrapez<1> trapez;
   check(trapez);
-  
+
   QSimpson<1> simpson;
   check(simpson);
 
index 8c1cc8250d18756c289c14a75aea3e695c8a8d0c..2e5f220d7fded85fa66cf0eaec43e406c897e5bb 100644 (file)
 
 template <int dim>
 void check (const std::string     &name,
-           const unsigned int     order,
-           const Quadrature<dim> &q)
+            const unsigned int     order,
+            const Quadrature<dim> &q)
 {
   Assert (QuadratureSelector<dim>(name, order).get_points() ==
-         q.get_points(),
-         ExcInternalError());
+          q.get_points(),
+          ExcInternalError());
   deallog << name << ' ' << order << " ok" << std::endl;
 }
 
@@ -52,7 +52,7 @@ int main()
   check ("gauss", 2, QGauss<1>(2));
   check ("gauss", 2, QGauss<2>(2));
   check ("gauss", 2, QGauss<3>(2));
-  
+
   check ("gauss", 2, QGauss<3>(2));
   check ("gauss", 6, QGauss<3>(6));
   check ("gauss", 10, QGauss<3>(10));
index 57d281eb9deab4258c36512da116d85dcd46affa..5a7a1c989cd1a9b4e2b44a41d7e8f3b883c64d8a 100644 (file)
 
 template <int dim>
 void
-fill_vector (std::vector<Quadrature<dim> *>quadratures)
+fill_vector (std::vector<Quadrature<dim> *> &quadratures)
 {
   quadratures.push_back (new QMidpoint<dim>());
   quadratures.push_back (new QTrapez<dim>());
   quadratures.push_back (new QSimpson<dim>());
   quadratures.push_back (new QMilne<dim>());
   quadratures.push_back (new QWeddle<dim>());
-  for (unsigned int i=0;i<9;++i)
+  for (unsigned int i=0; i<9; ++i)
     {
       quadratures.push_back (new QGauss<dim>(i));
     }
   QMilne<1> q1d;
   quadratures.push_back (new Quadrature<dim>(q1d));
-  for (unsigned int i=2;i<8;++i)
+  for (unsigned int i=2; i<8; ++i)
     {
       quadratures.push_back (new QGaussLobatto<dim>(i));
     }
@@ -53,7 +53,7 @@ fill_vector (std::vector<Quadrature<dim> *>& quadratures)
 
 template <int dim>
 void
-check_cells (std::vector<Quadrature<dim>*>quadratures)
+check_cells (std::vector<Quadrature<dim>*> &quadratures)
 {
   Quadrature<dim> quadrature;
   for (unsigned int n=0; n<quadratures.size(); ++n)
@@ -68,53 +68,53 @@ check_cells (std::vector<Quadrature<dim>*>& quadratures)
       double quadrature_int=0;
       double exact_int=0;
       double err = 0;
-      
+
       do
-       {
-         ++i;
-
-         quadrature_int=0;
-                                          // Check the polynomial x^i*y^i
-
-         for (unsigned int x=0; x<quadrature.size(); ++x)
-           {
-             double f=1.;
-             switch (dim)
-               {
-               case 3:
-                 f *= std::pow(static_cast<double>(points[x](2)), i*1.0);
-               case 2:
-                 f *= std::pow(static_cast<double>(points[x](1)), i*1.0);
-               case 1:
-                 f *= std::pow(static_cast<double>(points[x](0)), i*1.0);
-               }
-             quadrature_int+=f*weights[x];
-           }
-         
-                                          // the exact integral is 1/(i+1)
-         exact_int=1./std::pow(static_cast<double>(i+1),dim);    
-         err = std::fabs(quadrature_int-exact_int);
-       }
+        {
+          ++i;
+
+          quadrature_int=0;
+          // Check the polynomial x^i*y^i
+
+          for (unsigned int x=0; x<quadrature.size(); ++x)
+            {
+              double f=1.;
+              switch (dim)
+                {
+                case 3:
+                  f *= std::pow(static_cast<double>(points[x](2)), i*1.0);
+                case 2:
+                  f *= std::pow(static_cast<double>(points[x](1)), i*1.0);
+                case 1:
+                  f *= std::pow(static_cast<double>(points[x](0)), i*1.0);
+                }
+              quadrature_int+=f*weights[x];
+            }
+
+          // the exact integral is 1/(i+1)
+          exact_int=1./std::pow(static_cast<double>(i+1),dim);
+          err = std::fabs(quadrature_int-exact_int);
+        }
       while (err<1e-14);
-                                      // Uncomment here for testing
+      // Uncomment here for testing
 //      deallog << " (Int " << quadrature_int << ',' << exact_int << ")";
       deallog << " is exact for polynomials of degree " << i-1 << std::endl;
 
       if (dim==1)
-       {
-                                          // check the ordering of
-                                          // the quadrature points
-         bool in_order=true;
-         for (unsigned int x=1; x<quadrature.size(); ++x)
-           {
-             if (points[x](0)<=points[x-1](0))
-               in_order=false;
-           }
-         if (!in_order)
-           for (unsigned int x=0; x<quadrature.size(); ++x)
-             deallog << points[x] << std::endl;
-       }
-    }  
+        {
+          // check the ordering of
+          // the quadrature points
+          bool in_order=true;
+          for (unsigned int x=1; x<quadrature.size(); ++x)
+            {
+              if (points[x](0)<=points[x-1](0))
+                in_order=false;
+            }
+          if (!in_order)
+            for (unsigned int x=0; x<quadrature.size(); ++x)
+              deallog << points[x] << std::endl;
+        }
+    }
 }
 
 
@@ -130,8 +130,8 @@ check_faces (const std::vector<Quadrature<dim-1>*>& quadratures, const bool sub)
   for (unsigned int n=0; n<quadratures.size(); ++n)
     {
       Quadrature<dim> quadrature (sub == false?
-                                 QProjector<dim>::project_to_all_faces(*quadratures[n]) :
-                                 QProjector<dim>::project_to_all_subfaces(*quadratures[n]));
+                                  QProjector<dim>::project_to_all_faces(*quadratures[n]) :
+                                  QProjector<dim>::project_to_all_subfaces(*quadratures[n]));
       const std::vector<Point<dim> > &points=quadrature.get_points();
       const std::vector<double> &weights=quadrature.get_weights();
 
@@ -143,49 +143,49 @@ check_faces (const std::vector<Quadrature<dim-1>*>& quadratures, const bool sub)
       double err = 0;
 
       do
-       {
-         ++i;
-
-         quadrature_int=0;
-                                          // Check the polynomial
-                                          // x^i*y^i*z^i
-
-         for (unsigned int x=0; x<quadrature.size(); ++x)
-           {
-             long double f=1.;
-             switch (dim)
-               {
-               case 3:
-                 f *= std::pow((long double) points[x](2), i*1.0L);
-               case 2:
-                 f *= std::pow((long double) points[x](1), i*1.0L);
-               case 1:
-                 f *= std::pow((long double) points[x](0), i*1.0L);
-               }
-             quadrature_int+=f*weights[x];
-           }
-         
-                                          // the exact integral is
-                                          // 1/(i+1)^(dim-1)
-         switch (dim)
-           {
-           case 2:
-             exact_int = 2 * (sub ? 2:1) / (double) (i+1);
-             break;
-           case 3:
-             exact_int = 3 * (sub ? (4+2+2):1)*8 / (double) (i+1)/(i+1);
-             break;
-           }
-      
-         err = std::fabs(quadrature_int-exact_int);
-       }
-                                      // for comparison: use factor 8 in case
-                                      // of dim==3, as we integrate 8 times
-                                      // over the whole surface (all
-                                      // combinations of face_orientation,
-                                      // face_flip and face_rotation)
+        {
+          ++i;
+
+          quadrature_int=0;
+          // Check the polynomial
+          // x^i*y^i*z^i
+
+          for (unsigned int x=0; x<quadrature.size(); ++x)
+            {
+              long double f=1.;
+              switch (dim)
+                {
+                case 3:
+                  f *= std::pow((long double) points[x](2), i*1.0L);
+                case 2:
+                  f *= std::pow((long double) points[x](1), i*1.0L);
+                case 1:
+                  f *= std::pow((long double) points[x](0), i*1.0L);
+                }
+              quadrature_int+=f*weights[x];
+            }
+
+          // the exact integral is
+          // 1/(i+1)^(dim-1)
+          switch (dim)
+            {
+            case 2:
+              exact_int = 2 * (sub ? 2:1) / (double) (i+1);
+              break;
+            case 3:
+              exact_int = 3 * (sub ? (4+2+2):1)*8 / (double) (i+1)/(i+1);
+              break;
+            }
+
+          err = std::fabs(quadrature_int-exact_int);
+        }
+      // for comparison: use factor 8 in case
+      // of dim==3, as we integrate 8 times
+      // over the whole surface (all
+      // combinations of face_orientation,
+      // face_flip and face_rotation)
       while (err < (dim==3 ? 8 : 1) * 2e-14);
-                                      // Uncomment here for testing
+      // Uncomment here for testing
       //      deallog << " (Int " << quadrature_int << '-' << exact_int << '=' << err << ")";
       deallog << " is exact for polynomials of degree " << i-1 << std::endl;
     }
@@ -222,16 +222,16 @@ int main()
   check_faces<3>(q2,true);
   deallog.pop();
 
-                                  // delete objects again to avoid
-                                  // messages about memory leaks when
-                                  // using purify or other memory
-                                  // checkers
+  // delete objects again to avoid
+  // messages about memory leaks when
+  // using purify or other memory
+  // checkers
   for (unsigned int i=0; i<q1.size(); ++i)
     delete q1[i];
   for (unsigned int i=0; i<q2.size(); ++i)
     delete q2[i];
   for (unsigned int i=0; i<q3.size(); ++i)
-    delete q3[i];  
+    delete q3[i];
 }
 
 
index f3b821e974701bd4b2a329d285d1dda0124215a3..1b21b9efe37b9f6ec6fc6cd8d808117c4c5fa2b1 100644 (file)
@@ -37,12 +37,24 @@ int next = 0;
 
 class Test : public Subscriptor
 {
-    const char* name;
-  public:
-    Test(const char* n) : name(n) { deallog << "Construct " << name << std::endl; }
-    ~Test()                       { deallog << "Destruct " << name << std::endl;  }
-    void f()        { deallog << "mutable" << std::endl; }
-    void f() const  { deallog << "const" << std::endl;   }
+  const char *name;
+public:
+  Test(const char *n) : name(n)
+  {
+    deallog << "Construct " << name << std::endl;
+  }
+  ~Test()
+  {
+    deallog << "Destruct " << name << std::endl;
+  }
+  void f()
+  {
+    deallog << "mutable" << std::endl;
+  }
+  void f() const
+  {
+    deallog << "const" << std::endl;
+  }
 };
 
 
@@ -58,15 +70,15 @@ int main()
   try
     {
       Test a("A");
-      const Testb("B");
-      
+      const Test &b("B");
+
       SmartPointer<Test,Test>       r(&a, "Test R");
       SmartPointer<const Test,Test> s(&a, "const Test S");
 //  SmartPointer<Test,Test>       t=&b;    // this one should not work
-      SmartPointer<Test,Test>       t(const_cast<Test*>(&b), "Test T");
+      SmartPointer<Test,Test>       t(const_cast<Test *>(&b), "Test T");
       SmartPointer<const Test,Test> u(&b, "const Test");
-      
-      
+
+
       deallog << "a ";
       a.f();            // should print "mutable", since #a# is not const
       deallog << "b ";
@@ -75,13 +87,13 @@ int main()
       r->f();           // should print "mutable", since it points to the non-const #a#
       deallog << "s ";
       s->f();           // should print "const", since it points to the const #b#
-                                      // but we made it const
+      // but we made it const
       deallog << "t ";
       t->f();           // should print "mutable", since #b# is const, but
-                                      // we casted the constness away
+      // we casted the constness away
       deallog << "u ";
       u->f();           // should print "const" since #b# is const
-                                      // Now try if subscriptor works
+      // Now try if subscriptor works
       Test c("C");
       r = &c;
       Test d("D");
@@ -93,6 +105,6 @@ int main()
     {
       deallog << e.get_exc_name() << std::endl;
     }
-  
+
 }
 
index b387133e491dbdb1b9c6bebde7c7a7ecc4517c9c..72be390ea35c477dee66cf3e56bec80f5c564149 100644 (file)
@@ -47,7 +47,7 @@ int main ()
   compare (T(13.), 13.);
   compare (T(t1), 13.);
   compare (static_cast<double>(t1), 13.);
-  compare (static_cast<double&>(t1), 13.);
+  compare (static_cast<double &>(t1), 13.);
   compare ((T() = t1), 13.);
   compare ((T() = 13.), 13.);
   compare ((t1==t1), true);
@@ -67,6 +67,6 @@ int main ()
 
   t1.clear();
   compare (t1, 0.);
-  
+
   deallog << "OK" << std::endl;
 }
index 25ad62649e63a519e272a6521b91c2a73e1846b2..d980341c53b997e0a90dfaefdb416231a47835ef 100644 (file)
 #include <fstream>
 #include <iomanip>
 
-void f(const std::vector<int>v)
+void f(const std::vector<int> &v)
 {
   const VectorSlice<const std::vector<int> >
-    s = make_slice(v,2,3);
-  
-  for (unsigned int i=0;i<s.size();++i)
+  s = make_slice(v,2,3);
+
+  for (unsigned int i=0; i<s.size(); ++i)
     deallog << '\t' << s[i];
   deallog << std::endl;
 }
@@ -41,18 +41,18 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   std::vector<int> v(7);
 
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     v[i] = i;
-  
+
   VectorSlice<std::vector<int> > s(v, 3, 4);
 
-  for (unsigned int i=0;i<s.size();++i)
+  for (unsigned int i=0; i<s.size(); ++i)
     s[i] = i;
 
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << '\t' << v[i];
   deallog << std::endl;
 
index 92bac988aa2af0800bff29ac072baee92ce6b3a0..dfa4bd42b0c045c1f96b4f5d53f24dff57234823 100644 (file)
@@ -30,7 +30,7 @@ int main ()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   SymmetricTensor<2,2> t;
   t[0][0] = 1;
   t[1][1] = 2;
@@ -38,22 +38,22 @@ int main ()
 
   Assert (t[0][1] == t[1][0], ExcInternalError());
 
-                                   // check that if a single element is
-                                   // accessed, its transpose element gets the
-                                   // same value
+  // check that if a single element is
+  // accessed, its transpose element gets the
+  // same value
   t[1][0] = 4;
   Assert (t[0][1] == 4, ExcInternalError());
 
-                                   // make sure transposition doesn't change
-                                   // anything
+  // make sure transposition doesn't change
+  // anything
   Assert (t == transpose(t), ExcInternalError());
 
-                                   // check norm of tensor
+  // check norm of tensor
   Assert (std::fabs(t.norm() - std::sqrt(1.*1+2*2+2*4*4)) < 1e-14,
           ExcInternalError());
 
-                                   // make sure norm is induced by scalar
-                                   // product
+  // make sure norm is induced by scalar
+  // product
   Assert (std::fabs (t.norm()*t.norm() - t*t) < 1e-14,
           ExcInternalError());
 
index 7874072d4f8d6aaceef413a3329fab11869129e1..ed0482033b6a0df94c2785a00ab7d8c73739e679 100644 (file)
@@ -30,7 +30,7 @@ int main ()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   SymmetricTensor<2,3> t;
   t[0][0] = 1;
   t[1][1] = 2;
@@ -41,23 +41,23 @@ int main ()
 
   Assert (t[0][1] == t[1][0], ExcInternalError());
 
-                                   // check that if a single element is
-                                   // accessed, its transpose element gets the
-                                   // same value
+  // check that if a single element is
+  // accessed, its transpose element gets the
+  // same value
   t[1][0] = 14;
   Assert (t[0][1] == 14, ExcInternalError());
 
-                                   // make sure transposition doesn't change
-                                   // anything
+  // make sure transposition doesn't change
+  // anything
   Assert (t == transpose(t), ExcInternalError());
 
-                                   // check norm of tensor
+  // check norm of tensor
   Assert (std::fabs(t.norm() - std::sqrt(1.*1+2*2+3*3+2*14*14+2*5*5+2*6*6))
           < 1e-14,
           ExcInternalError());
 
-                                   // make sure norm is induced by scalar
-                                   // product
+  // make sure norm is induced by scalar
+  // product
   Assert (std::fabs (t.norm()*t.norm() - t*t) < 1e-14,
           ExcInternalError());
 
index 23a6dfad9c918bfa0188d02a09c259349a5f6ba7..0491deab3f2be05c188fdc3d8fd7b15abbf2b5bd 100644 (file)
@@ -30,7 +30,7 @@ int main ()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   SymmetricTensor<4,2> t;
   t[0][0][0][0] = 1;
   t[1][1][1][1] = 2;
@@ -38,28 +38,28 @@ int main ()
 
   Assert (t[0][1][0][1] == t[1][0][1][0], ExcInternalError());
 
-                                   // check that if a single element is
-                                   // accessed, its transpose element gets the
-                                   // same value
+  // check that if a single element is
+  // accessed, its transpose element gets the
+  // same value
   t[1][0][0][1] = 4;
   Assert (t[0][1][1][0] == 4, ExcInternalError());
 
-                                   // make sure transposition doesn't change
-                                   // anything
+  // make sure transposition doesn't change
+  // anything
   Assert (t == transpose(t), ExcInternalError());
 
-                                   // check norm of tensor
+  // check norm of tensor
   deallog << t.norm() << std::endl;
 
-                                   // make sure norm is induced by scalar
-                                   // product
+  // make sure norm is induced by scalar
+  // product
   double norm_sqr = 0;
   for (unsigned int i=0; i<2; ++i)
     for (unsigned int j=0; j<2; ++j)
       for (unsigned int k=0; k<2; ++k)
-       for (unsigned int l=0; l<2; ++l)
-         norm_sqr += t[i][j][k][l] * t[i][j][k][l];
-  
+        for (unsigned int l=0; l<2; ++l)
+          norm_sqr += t[i][j][k][l] * t[i][j][k][l];
+
   Assert (std::fabs (t.norm()*t.norm() - norm_sqr) < 1e-14,
           ExcInternalError());
 
index 0e0a6594502d918fb6d4a2ef60a80ee753562faf..73cc4e73ac39cd2c01c40b21a0470ca7fbebef1e 100644 (file)
@@ -30,7 +30,7 @@ int main ()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   SymmetricTensor<4,3> t;
   t[0][0][0][0] = 1;
   t[1][1][1][1] = 2;
@@ -38,27 +38,27 @@ int main ()
 
   Assert (t[0][1][0][1] == t[1][0][1][0], ExcInternalError());
 
-                                   // check that if a single element is
-                                   // accessed, its transpose element gets the
-                                   // same value
+  // check that if a single element is
+  // accessed, its transpose element gets the
+  // same value
   t[1][0][0][1] = 4;
   Assert (t[0][1][1][0] == 4, ExcInternalError());
 
-                                   // make sure transposition doesn't change
-                                   // anything
+  // make sure transposition doesn't change
+  // anything
   Assert (t == transpose(t), ExcInternalError());
 
-                                   // check norm of tensor
+  // check norm of tensor
   deallog << t.norm() << std::endl;
 
-                                   // make sure norm is induced by scalar
-                                   // product
+  // make sure norm is induced by scalar
+  // product
   double norm_sqr = 0;
   for (unsigned int i=0; i<2; ++i)
     for (unsigned int j=0; j<2; ++j)
       for (unsigned int k=0; k<2; ++k)
-       for (unsigned int l=0; l<2; ++l)
-         norm_sqr += t[i][j][k][l] * t[i][j][k][l];
+        for (unsigned int l=0; l<2; ++l)
+          norm_sqr += t[i][j][k][l] * t[i][j][k][l];
   Assert (std::fabs (t.norm()*t.norm() - norm_sqr) < 1e-14,
           ExcInternalError());
 
index a2ebbcb7713fff1691ad35fd35879898192c343c..a5e6ae7834ff09066e552a014d9117827af16e55 100644 (file)
@@ -32,10 +32,10 @@ void test ()
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       for (unsigned int k=0; k<dim; ++k)
-       for (unsigned int l=0; l<dim; ++l)
-         t[i][j][k][l] = (((i==k) && (j==l) ? 1 : 0) +
-                          ((i==l) && (j==k) ? 1 : 0));
-         
+        for (unsigned int l=0; l<dim; ++l)
+          t[i][j][k][l] = (((i==k) && (j==l) ? 1 : 0) +
+                           ((i==l) && (j==k) ? 1 : 0));
+
   SymmetricTensor<2,dim> a, b;
   a[0][0] = 1;
   a[1][1] = 2;
@@ -44,38 +44,38 @@ void test ()
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       {
-       double tmp_ij = 0;
-       for (unsigned int k=0; k<dim; ++k)
-         for (unsigned int l=0; l<dim; ++l)
-           {
-             deallog << i << ' ' << j << ' ' << k << ' ' << l << ": "
-                     << t[i][j][k][l] << ' ' << a[k][l]
-                     << std::endl;
-             tmp_ij += t[i][j][k][l] * a[k][l];
-           }
-       b[i][j] = tmp_ij;
-      }  
+        double tmp_ij = 0;
+        for (unsigned int k=0; k<dim; ++k)
+          for (unsigned int l=0; l<dim; ++l)
+            {
+              deallog << i << ' ' << j << ' ' << k << ' ' << l << ": "
+                      << t[i][j][k][l] << ' ' << a[k][l]
+                      << std::endl;
+              tmp_ij += t[i][j][k][l] * a[k][l];
+            }
+        b[i][j] = tmp_ij;
+      }
 
   Assert (a == b/2, ExcInternalError());
 
-                                  // try the same thing with scaled
-                                  // tensors etc
+  // try the same thing with scaled
+  // tensors etc
   t *= 2;
   b.clear ();
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       {
-       double tmp_ij = 0;
-       for (unsigned int k=0; k<dim; ++k)
-         for (unsigned int l=0; l<dim; ++l)
-           tmp_ij += t[i][j][k][l] * a[k][l];
-       b[i][j] = tmp_ij;
+        double tmp_ij = 0;
+        for (unsigned int k=0; k<dim; ++k)
+          for (unsigned int l=0; l<dim; ++l)
+            tmp_ij += t[i][j][k][l] * a[k][l];
+        b[i][j] = tmp_ij;
       }
 
   Assert (a == b/4, ExcInternalError());
 }
 
-  
+
 
 
 int main ()
@@ -85,9 +85,9 @@ int main ()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index dc03a3f2f58492aa608ceda45eda6bf4050d0d39..494acdc5ca3dd87bf6eeae7be25aaeb6059ce200 100644 (file)
@@ -30,56 +30,56 @@ template <int dim>
 void test ()
 {
   const double lambda = 5,
-              mu     = 7;
+               mu     = 7;
   SymmetricTensor<4,dim> ts;
   Tensor<4,dim>          ta;
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       {
-       ta[i][j][i][j] += mu;
-       ta[i][j][j][i] += mu;
-       ta[i][i][j][j] += lambda;
+        ta[i][j][i][j] += mu;
+        ta[i][j][j][i] += mu;
+        ta[i][i][j][j] += lambda;
       }
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       for (unsigned int k=0; k<dim; ++k)
-       for (unsigned int l=0; l<dim; ++l)
-         ts[i][j][k][l] = ta[i][j][k][l];
-  
+        for (unsigned int l=0; l<dim; ++l)
+          ts[i][j][k][l] = ta[i][j][k][l];
+
   SymmetricTensor<2,dim> as, bs;
   Tensor<2,dim>          aa, ba;
 
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       as[i][j] = aa[i][j] = (1. + (i+1)*(j+1));
-      
+
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       {
-       double tmp_ij = 0;
-       for (unsigned int k=0; k<dim; ++k)
-         for (unsigned int l=0; l<dim; ++l)
-           {
-             deallog << i << ' ' << j << ' ' << k << ' ' << l << ": "
-                     << ta[i][j][k][l] << ' ' << ts[i][j][k][l] << ' '
-                     << aa[k][l] << ' ' << as[k][l]
-                     << std::endl;
-             tmp_ij += ts[i][j][k][l] * as[k][l];
-           }
-       bs[i][j] = tmp_ij;
+        double tmp_ij = 0;
+        for (unsigned int k=0; k<dim; ++k)
+          for (unsigned int l=0; l<dim; ++l)
+            {
+              deallog << i << ' ' << j << ' ' << k << ' ' << l << ": "
+                      << ta[i][j][k][l] << ' ' << ts[i][j][k][l] << ' '
+                      << aa[k][l] << ' ' << as[k][l]
+                      << std::endl;
+              tmp_ij += ts[i][j][k][l] * as[k][l];
+            }
+        bs[i][j] = tmp_ij;
       }
   double_contract (ba, ta, aa);
-  
+
   for (unsigned int i=0; i<dim; ++i)
-    for (unsigned int j=0; j<dim; ++j) 
+    for (unsigned int j=0; j<dim; ++j)
       {
-       Assert (as[i][j] == aa[i][j], ExcInternalError());
-       Assert (bs[i][j] == ba[i][j], ExcInternalError());
+        Assert (as[i][j] == aa[i][j], ExcInternalError());
+        Assert (bs[i][j] == ba[i][j], ExcInternalError());
       }
-  
+
 }
 
-  
+
 
 
 int main ()
@@ -92,6 +92,6 @@ int main ()
 
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 17e762f6f130ea2995963044bb03ec6c0cff0bfc..f46c0afa9ba4f5ea771923b81c714c244f16088f 100644 (file)
@@ -17,7 +17,7 @@
 
 // in symmetric_tensor_06 we have established that contracting with a
 // symmetric tensor by hand works as with a full tensor that is stored
-// in non-symmetric form. here make sure that we can abbreviate the contraction 
+// in non-symmetric form. here make sure that we can abbreviate the contraction
 
 #include "../tests.h"
 #include <deal.II/base/symmetric_tensor.h>
 #include <iomanip>
 
 
-  
+
 
 template <int dim>
 void test ()
 {
   const double lambda = 7,
-              mu     = 5;
+               mu     = 5;
   SymmetricTensor<4,dim> ts;
   Tensor<4,dim>          ta;
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       {
-       ta[i][j][i][j] += mu;
-       ta[i][j][j][i] += mu;
-       ta[i][i][j][j] += lambda;
+        ta[i][j][i][j] += mu;
+        ta[i][j][j][i] += mu;
+        ta[i][i][j][j] += lambda;
       }
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       for (unsigned int k=0; k<dim; ++k)
-       for (unsigned int l=0; l<dim; ++l)
-         ts[i][j][k][l] = ta[i][j][k][l];
-         
+        for (unsigned int l=0; l<dim; ++l)
+          ts[i][j][k][l] = ta[i][j][k][l];
+
   SymmetricTensor<2,dim> as, bs;
   Tensor<2,dim>          aa, ba;
 
@@ -58,28 +58,28 @@ void test ()
 
   bs = ts * as;
   double_contract (ba, ta, aa);
-  
+
   for (unsigned int i=0; i<dim; ++i)
-    for (unsigned int j=0; j<dim; ++j) 
+    for (unsigned int j=0; j<dim; ++j)
       {
-       Assert (as[i][j] == aa[i][j], ExcInternalError());
-       Assert (bs[i][j] == ba[i][j], ExcInternalError());
+        Assert (as[i][j] == aa[i][j], ExcInternalError());
+        Assert (bs[i][j] == ba[i][j], ExcInternalError());
 
-       deallog << as[i][j] << ' ' << bs[i][j] << std::endl;
+        deallog << as[i][j] << ' ' << bs[i][j] << std::endl;
       }
 
-                                  // test distributivity of
-                                  // multiplication
+  // test distributivity of
+  // multiplication
   Assert ((as*ts)*as == as*(ts*as), ExcInternalError());
-  
-  
-                                  // also test that the elasticity
-                                  // tensor is positive definite
-  deallog << as * ts * as << std::endl;
+
+
+  // also test that the elasticity
+  // tensor is positive definite
+  deallog << as *ts *as << std::endl;
   Assert (as * ts * as > 0, ExcInternalError());
 }
 
-  
+
 
 
 int main ()
@@ -92,6 +92,6 @@ int main ()
 
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 77ca51addbf15284becf8f01f5402c06714b7ecd..4b9de8bd3aa08a25d549e1919fa060b6988e36fa 100644 (file)
 
 inline
 double value(unsigned int i,
-            unsigned int j,
-            unsigned int k,
-            unsigned int l,
-            double lambda,
-            double mu)
+             unsigned int j,
+             unsigned int k,
+             unsigned int l,
+             double lambda,
+             double mu)
 {
   return ((i==k) && (j==l) ? mu : 0) +
-        ((i==l) && (j==k) ? mu : 0) +
-        ((i==j) && (k==l) ? lambda : 0);
+         ((i==l) && (j==k) ? mu : 0) +
+         ((i==j) && (k==l) ? lambda : 0);
 }
 
 
@@ -44,27 +44,27 @@ template <int dim>
 void test ()
 {
   const double lambda = 1.5,
-              mu     = 1.7;
+               mu     = 1.7;
   SymmetricTensor<4,dim> t;
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       for (unsigned int k=0; k<dim; ++k)
-       for (unsigned int l=0; l<dim; ++l)
-         t[i][j][k][l] = value(i,j,k,l,lambda,mu);
-  
+        for (unsigned int l=0; l<dim; ++l)
+          t[i][j][k][l] = value(i,j,k,l,lambda,mu);
+
   SymmetricTensor<2,dim> a;
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       a[i][j] = (1. + (i+1)*(j+1));
 
-                                  // stress test the whole thing many
-                                  // times. normalize in each step to
-                                  // make sure the result remains
-                                  // representable in floating point
-                                  // arithmetic. essentially, this
-                                  // invokes the power method to
-                                  // compute the largest eigenvector
-                                  // (eigentensor in this case)
+  // stress test the whole thing many
+  // times. normalize in each step to
+  // make sure the result remains
+  // representable in floating point
+  // arithmetic. essentially, this
+  // invokes the power method to
+  // compute the largest eigenvector
+  // (eigentensor in this case)
   for (unsigned int i=0; i<1000000; ++i)
     {
       a = t*a;
@@ -72,11 +72,11 @@ void test ()
     }
 
   for (unsigned int i=0; i<dim; ++i)
-    for (unsigned int j=0; j<dim; ++j) 
+    for (unsigned int j=0; j<dim; ++j)
       deallog << i << ' ' << j << ' ' << a[i][j] << std::endl;
 }
 
-  
+
 
 
 int main ()
@@ -89,6 +89,6 @@ int main ()
 
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 4b4402e857aad4eb912ae1624583382b02332c22..fa0ec9cb418a1c204742c8aae1f0202acc2e7fd0 100644 (file)
@@ -35,11 +35,11 @@ void test ()
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       deallog << i << ' ' << j << ' ' << t[i][j] << std::endl;
-  
+
   deallog << determinant(t) << std::endl;
 }
 
-  
+
 
 
 int main ()
@@ -52,6 +52,6 @@ int main ()
 
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 4ffc86623b08500042a39473c6e6253260798709..c47f81cd44bba9e353a97d93c0ca5e0de7792fe9 100644 (file)
@@ -28,7 +28,7 @@ template <int dim>
 void test ()
 {
   deallog << "dim=" << dim << std::endl;
-  
+
   SymmetricTensor<2,dim> t;
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=i; j<dim; ++j)
@@ -41,17 +41,17 @@ void test ()
     for (unsigned int j=0; j<dim; ++j)
       deallog << i << ' ' << j << ' ' << x[i][j] << std::endl;
 
-                                   // the difference between t and x is a
-                                   // diagonal tensor with constant elements
-                                   // proportional to the trace of t
+  // the difference between t and x is a
+  // diagonal tensor with constant elements
+  // proportional to the trace of t
   t -= x;
   deallog << "t-x=" << std::endl;
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
-      deallog << i << ' ' << j << ' ' << t[i][j] << std::endl;  
+      deallog << i << ' ' << j << ' ' << t[i][j] << std::endl;
 }
 
-  
+
 
 
 int main ()
@@ -65,6 +65,6 @@ int main ()
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index a944a46cbf2917321c1ef203f8dc596990dca154..eca04cc56035c5de1dff78c30e58fba7e5cfc5a6 100644 (file)
@@ -29,7 +29,7 @@ template <int dim>
 void test ()
 {
   deallog << "dim=" << dim << std::endl;
-  
+
   SymmetricTensor<2,dim> t;
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=i; j<dim; ++j)
@@ -43,17 +43,17 @@ void test ()
     for (unsigned int j=0; j<dim; ++j)
       deallog << i << ' ' << j << ' ' << x[i][j] << std::endl;
 
-                                   // the difference between t and x is a
-                                   // diagonal tensor with constant elements
-                                   // proportional to the trace of t
+  // the difference between t and x is a
+  // diagonal tensor with constant elements
+  // proportional to the trace of t
   t -= x;
   deallog << "t-x=" << std::endl;
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
-      deallog << i << ' ' << j << ' ' << t[i][j] << std::endl;  
+      deallog << i << ' ' << j << ' ' << t[i][j] << std::endl;
 }
 
-  
+
 
 
 int main ()
@@ -67,6 +67,6 @@ int main ()
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 3647101e88debfcba6195d110896e7e63858a896..14d05c0e6d4de67423b77cf196acefad3cdda70e 100644 (file)
@@ -28,7 +28,7 @@ template <int dim>
 void test ()
 {
   deallog << "dim=" << dim << std::endl;
-  
+
   SymmetricTensor<2,dim> t;
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=i; j<dim; ++j)
@@ -38,7 +38,7 @@ void test ()
           ExcInternalError());
 }
 
-  
+
 
 
 int main ()
@@ -52,6 +52,6 @@ int main ()
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 18a63d6ffe682895a9291d6aeaaf8d72eed5ffd6..179d28ef3be3fec382e3220d0ee4f4498e2543e7 100644 (file)
@@ -28,7 +28,7 @@ template <int dim>
 void test ()
 {
   deallog << "dim=" << dim << std::endl;
-  
+
   SymmetricTensor<2,dim> t;
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=i; j<dim; ++j)
@@ -38,7 +38,7 @@ void test ()
           ExcInternalError());
 }
 
-  
+
 
 
 int main ()
@@ -52,6 +52,6 @@ int main ()
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 9de89b0390630431c1e04d465b7406d1cc325cd6..a874a61f7fbe2e456644c8a473272b93d1716cc5 100644 (file)
@@ -28,7 +28,7 @@ template <int dim>
 void test ()
 {
   deallog << "dim=" << dim << std::endl;
-  
+
   SymmetricTensor<2,dim> t;
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=i; j<dim; ++j)
@@ -43,7 +43,7 @@ void test ()
       deallog << i << ' ' << j << ' ' << x[i][j] << std::endl;
 }
 
-  
+
 
 
 int main ()
@@ -57,6 +57,6 @@ int main ()
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 8874d1e962038601c370207252b82b7fabaf1698..fc157f4d192cd42bad8e4514c1cfab9b42993180 100644 (file)
@@ -28,21 +28,21 @@ template <int dim>
 void test ()
 {
   deallog << "dim=" << dim << std::endl;
-  
+
   SymmetricTensor<2,dim> t;
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=i; j<dim; ++j)
       t[i][j] = (1.+(i+1)*(j*2));
 
-                                   // test 1: check trace-like operator
+  // test 1: check trace-like operator
   {
     const SymmetricTensor<4,dim> T
       = outer_product<dim> (unit_symmetric_tensor<dim>(),
                             unit_symmetric_tensor<dim>());
 
-                                     // T*t should yield a diagonal tensor
-                                     // where the diagonal elements are the
-                                     // traces of t
+    // T*t should yield a diagonal tensor
+    // where the diagonal elements are the
+    // traces of t
     SymmetricTensor<2,dim> x = T * t;
     Assert ((x-trace(t)*unit_symmetric_tensor<dim>()).norm()
             < 1e-15*t.norm(), ExcInternalError());
@@ -53,12 +53,12 @@ void test ()
         deallog << i << ' ' << j << ' ' << x[i][j] << std::endl;
   }
 
-                                   // test 2: check outer product of t with
-                                   // itself
+  // test 2: check outer product of t with
+  // itself
   {
     const SymmetricTensor<4,dim> T = outer_product<dim> (t,t);
 
-                                     // T*t should yield norm(t)^2*t
+    // T*t should yield norm(t)^2*t
     SymmetricTensor<2,dim> x = T * t;
     Assert ((x-(t*t)*t).norm()
             < 1e-15*t.norm(), ExcInternalError());
@@ -68,10 +68,10 @@ void test ()
       for (unsigned int j=0; j<dim; ++j)
         deallog << i << ' ' << j << ' ' << x[i][j] << std::endl;
   }
-  
+
 }
 
-  
+
 
 
 int main ()
@@ -85,6 +85,6 @@ int main ()
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 07316d051cd6948e5e944afbec8a7948163cfa67..462f94dbe1f2a8f565f81674707aa1ba857909de 100644 (file)
@@ -30,15 +30,15 @@ void test ()
   deallog << "dim=" << dim << std::endl;
 
   const SymmetricTensor<4,dim>
-    T = (identity_tensor<dim>()
-         - 1./dim * outer_product(unit_symmetric_tensor<dim>(),
-                                  unit_symmetric_tensor<dim>()));
+  T = (identity_tensor<dim>()
+       - 1./dim * outer_product(unit_symmetric_tensor<dim>(),
+                                unit_symmetric_tensor<dim>()));
 
   Assert ((T-deviator_tensor<dim>()).norm()
           <= 1e-15*T.norm(), ExcInternalError());
 }
 
-  
+
 
 
 int main ()
@@ -52,6 +52,6 @@ int main ()
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index f58f875bfd68ec885717d249c2693e0d6d09850a..228463b091f1f024e0c7b5b37f97f9f38cacad5e 100644 (file)
@@ -30,7 +30,7 @@ template <int dim>
 void test ()
 {
   deallog << "dim=" << dim << std::endl;
-  
+
   SymmetricTensor<4,dim> t;
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
@@ -43,30 +43,30 @@ void test ()
   deallog << "t=" << std::endl;
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
-       for (unsigned int k=0; k<dim; ++k)
-         for (unsigned int l=0; l<dim; ++l)
-            deallog << i << ' ' << j << ' ' << k << ' ' << l << ": "
-                    << (int)t[i][j][k][l] << std::endl;
+      for (unsigned int k=0; k<dim; ++k)
+        for (unsigned int l=0; l<dim; ++l)
+          deallog << i << ' ' << j << ' ' << k << ' ' << l << ": "
+                  << (int)t[i][j][k][l] << std::endl;
 
-                                   // multiply t by the unit symmetric tensor
+  // multiply t by the unit symmetric tensor
   const SymmetricTensor<2,dim> t_times_1 = t * unit_symmetric_tensor<dim>();
-  
+
   deallog << "t*1=" << std::endl;
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
-            deallog << i << ' ' << j << ": "
-                    << (int)(t_times_1[i][j])
-                    << std::endl;
+      deallog << i << ' ' << j << ": "
+              << (int)(t_times_1[i][j])
+              << std::endl;
 
-                                   // t_times_1 should be a multiple of the
-                                   // unit tensor, given the structure we have
-                                   // given to it
+  // t_times_1 should be a multiple of the
+  // unit tensor, given the structure we have
+  // given to it
   Assert ((t_times_1 - (dim*10000 + 2*100)*unit_symmetric_tensor<dim>()).norm()
           < 1e-14*t_times_1.norm(),
           ExcInternalError());
 }
 
-  
+
 
 
 int main ()
@@ -80,6 +80,6 @@ int main ()
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 2dc06b1ab9b97711fd18f211574741a34a06a817..f9bd9970ec53f7559ae42a6581223d293cd25d77 100644 (file)
@@ -33,39 +33,39 @@ void test ()
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       for (unsigned int k=0; k<dim; ++k)
-       for (unsigned int l=0; l<dim; ++l)
-         {
-                                            // write some entries
-                                            // into the tensors. may
-                                            // be overwritten by
-                                            // subsequent writes, but
-                                            // who cares?
-           A[i][j][k][l] = (i+1)*(j+1)*(l+1)*(k+1);
-           B[i][j][k][l] = (i+2)*(j+3)*(l+4)*(k+5);
-         }
-  
+        for (unsigned int l=0; l<dim; ++l)
+          {
+            // write some entries
+            // into the tensors. may
+            // be overwritten by
+            // subsequent writes, but
+            // who cares?
+            A[i][j][k][l] = (i+1)*(j+1)*(l+1)*(k+1);
+            B[i][j][k][l] = (i+2)*(j+3)*(l+4)*(k+5);
+          }
+
   T = A*B;
 
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       for (unsigned int k=0; k<dim; ++k)
-       for (unsigned int l=0; l<dim; ++l)
-         {
-           deallog << (int)T[i][j][k][l] << std::endl;
-
-                                            // calculate result by
-                                            // hand
-           double tmp = 0;
-           for (unsigned int a=0; a<dim; ++a)
-             for (unsigned int b=0; b<dim; ++b)
-               tmp += A[i][j][a][b] * B[a][b][k][l];
-
-           Assert (std::fabs(T[i][j][k][l] - tmp) < 1e-14*tmp,
-                   ExcInternalError());
-         }
+        for (unsigned int l=0; l<dim; ++l)
+          {
+            deallog << (int)T[i][j][k][l] << std::endl;
+
+            // calculate result by
+            // hand
+            double tmp = 0;
+            for (unsigned int a=0; a<dim; ++a)
+              for (unsigned int b=0; b<dim; ++b)
+                tmp += A[i][j][a][b] * B[a][b][k][l];
+
+            Assert (std::fabs(T[i][j][k][l] - tmp) < 1e-14*tmp,
+                    ExcInternalError());
+          }
 }
 
-  
+
 
 
 int main ()
@@ -79,6 +79,6 @@ int main ()
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 3edb8fd1cdd7dea254dfcce8c0510e3a290a9eb0..ac768a7aeec86a6da55c40744763380e7646e009 100644 (file)
@@ -32,46 +32,46 @@ void check (const SymmetricTensor<4,dim> &A)
 {
   const SymmetricTensor<4,dim> B = invert (A);
 
-                                   // check left inverse
+  // check left inverse
   deallog << "    checking left inverse" << std::endl;
   const SymmetricTensor<4,dim> T_left = B*A;
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       for (unsigned int k=0; k<dim; ++k)
-       for (unsigned int l=0; l<dim; ++l)
-         {
-           deallog << "      "
+        for (unsigned int l=0; l<dim; ++l)
+          {
+            deallog << "      "
                     << A[i][j][k][l] << ' '
                     << B[i][j][k][l] << ' '
                     << T_left[i][j][k][l] << std::endl;
 
-           Assert (std::fabs(T_left[i][j][k][l] -
+            Assert (std::fabs(T_left[i][j][k][l] -
                               identity_tensor<dim>()[i][j][k][l])
                     < 1e-10,
-                   ExcInternalError());
-         }
+                    ExcInternalError());
+          }
 
-                                   // check left inverse
+  // check left inverse
   deallog << "    checking right inverse" << std::endl;
   const SymmetricTensor<4,dim> T_right = A*B;
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       for (unsigned int k=0; k<dim; ++k)
-       for (unsigned int l=0; l<dim; ++l)
-         {
-           deallog << "      "
+        for (unsigned int l=0; l<dim; ++l)
+          {
+            deallog << "      "
                     << A[i][j][k][l] << ' '
                     << B[i][j][k][l] << ' '
                     << T_right[i][j][k][l] << std::endl;
 
-           Assert (std::fabs(T_right[i][j][k][l] -
+            Assert (std::fabs(T_right[i][j][k][l] -
                               identity_tensor<dim>()[i][j][k][l])
                     < 1e-10,
-                   ExcInternalError());
-         }
+                    ExcInternalError());
+          }
 }
 
-  
+
 
 template <int dim>
 void test ()
@@ -81,42 +81,42 @@ void test ()
   deallog << "  unit tensor" << std::endl;
   check (identity_tensor<dim>());
 
-                                   // do something with a more complicated
-                                   // tensor. make sure it is not
-                                   // rank-deficient, so choose elements by
-                                   // hand
+  // do something with a more complicated
+  // tensor. make sure it is not
+  // rank-deficient, so choose elements by
+  // hand
   deallog << "  complicated tensor" << std::endl;
   SymmetricTensor<4,dim> A;
   switch (dim)
     {
-      case 1:
-            A[0][0][0][0] = 2;
-            break;
-            
-      case 2:
-            A[0][0][0][0] = 2;
-            A[0][0][1][1] = 4;
-            A[0][0][0][1] = 8;
-            A[1][1][0][0] = 4;
-            A[1][1][1][1] = 6;
-            A[1][1][0][1] = 10;
-            A[0][1][0][0] = 6;
-            A[0][1][1][1] = 10;
-            A[0][1][0][1] = 16;
-            break;
-
-      case 3:
-                                             // I'm too lazy to code something
-                                             // up by hand here
-            for (unsigned int i=0; i<3; ++i)
-              for (unsigned int j=0; j<3; ++j)
-                for (unsigned int k=0; k<3; ++k)
-                  for (unsigned int l=0; l<3; ++l)
-                    A[i][j][k][l] = 1.*rand()/RAND_MAX;
-            break;
-            
-      default:
-            Assert (false, ExcNotImplemented());
+    case 1:
+      A[0][0][0][0] = 2;
+      break;
+
+    case 2:
+      A[0][0][0][0] = 2;
+      A[0][0][1][1] = 4;
+      A[0][0][0][1] = 8;
+      A[1][1][0][0] = 4;
+      A[1][1][1][1] = 6;
+      A[1][1][0][1] = 10;
+      A[0][1][0][0] = 6;
+      A[0][1][1][1] = 10;
+      A[0][1][0][1] = 16;
+      break;
+
+    case 3:
+      // I'm too lazy to code something
+      // up by hand here
+      for (unsigned int i=0; i<3; ++i)
+        for (unsigned int j=0; j<3; ++j)
+          for (unsigned int k=0; k<3; ++k)
+            for (unsigned int l=0; l<3; ++l)
+              A[i][j][k][l] = 1.*rand()/RAND_MAX;
+      break;
+
+    default:
+      Assert (false, ExcNotImplemented());
     }
   check (A);
 }
@@ -134,6 +134,6 @@ int main ()
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 24209862346a268ff42594562f12100d8962b9b9..94bf6a3d484dc4b627e8cde6e86ba235a046a0e9 100644 (file)
@@ -31,7 +31,7 @@ int main ()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   const unsigned int dim=3;
   SymmetricTensor<2,dim> t;
   t[0][0] = t[1][0] = t[1][1] = t[2][2] = 3;
@@ -41,6 +41,6 @@ int main ()
   deallog << t.norm() << std::endl;
 
   Assert (t.norm() == 0, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
index 2ad02380a9da65ce2851bd48f2fd719a978dd621..19a414dbcc25a9de842438860142869a42d82fba 100644 (file)
@@ -31,17 +31,17 @@ int main ()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   const unsigned int dim=3;
   SymmetricTensor<4,dim> t;
   t[0][0][0][0] = t[1][0][1][0] = t[1][1][1][1]
-                = t[2][2][2][2] = t[2][0][2][0] = 3;
+                                  = t[2][2][2][2] = t[2][0][2][0] = 3;
 
   deallog << t.norm() << std::endl;
   t = 0;
   deallog << t.norm() << std::endl;
 
   Assert (t.norm() == 0, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
index e2f038ebb50807525fccccfa218ead6dbb2edb73..0494b4bc2766a6dc600ff4851f03e290227cb9d2 100644 (file)
@@ -41,15 +41,15 @@ int main ()
 
     deallog << t << std::endl;
   }
-  
+
   {
     const unsigned int dim=3;
     SymmetricTensor<4,dim> t;
     t[0][0][0][0] = t[1][0][1][0] = t[1][1][1][1]
-                 = t[2][2][2][2] = t[2][0][2][0] = 3;
+                                    = t[2][2][2][2] = t[2][0][2][0] = 3;
 
     deallog << t << std::endl;
   }
-  
+
   deallog << "OK" << std::endl;
 }
index 0b85c7ce3c5da8c43321ec38662732496136de77..db774d364c5d9d1a05aff1251aeb640b19f651e9 100644 (file)
@@ -38,7 +38,7 @@ int main ()
 
     double x[1] = { 1 };
     Assert ((t == SymmetricTensor<2,1>(x)),
-           ExcInternalError());
+            ExcInternalError());
   }
 
   {
@@ -49,7 +49,7 @@ int main ()
 
     double x[3] = { 1, 2, 3 };
     Assert ((t == SymmetricTensor<2,2>(x)),
-           ExcInternalError());
+            ExcInternalError());
   }
 
   {
@@ -63,8 +63,8 @@ int main ()
 
     double x[6] = { 1, 2, 3, 4, 5, 6 };
     Assert ((t == SymmetricTensor<2,3>(x)),
-           ExcInternalError());
+            ExcInternalError());
   }
-  
+
   deallog << "OK" << std::endl;
 }
index d66ffb6558051be8bf1d75e7a0b8cbed1e8d2775..d5a9051b4eeea5cacd81a3ceabc5abaace4b64dc 100644 (file)
@@ -33,13 +33,13 @@ void check ()
   for (unsigned int i=0; i<S::n_independent_components; ++i)
     {
       deallog << i << "  --  "
-             << S::unrolled_to_component_indices (i)
-             << std::endl;
+              << S::unrolled_to_component_indices (i)
+              << std::endl;
       Assert (S::component_to_unrolled_index
-             (S::unrolled_to_component_indices (i))
-             ==
-             i,
-             ExcInternalError());
+              (S::unrolled_to_component_indices (i))
+              ==
+              i,
+              ExcInternalError());
     }
 }
 
index 6ee53a109ad679607805e0d50146959bed8cd5e2..c53e33e6c7a9c115c4152e7c421833505a14a4a7 100644 (file)
@@ -33,7 +33,7 @@ void check ()
     {
       SymmetricTensor<2,dim> S;
       for (unsigned int i=0; i<S.n_independent_components; ++i)
-       S[S.unrolled_to_component_indices (i)] = std::rand () % 10;
+        S[S.unrolled_to_component_indices (i)] = std::rand () % 10;
 
       deallog << "S = " << S << std::endl;
       deallog << "first invariant  = " << first_invariant(S) << std::endl;
@@ -42,21 +42,21 @@ void check ()
 
       Tensor<2,dim> S_cubed;
       for (unsigned int d=0; d<dim; ++d)
-       for (unsigned int e=0; e<dim; ++e)
-         for (unsigned int f=0; f<dim; ++f)
-           for (unsigned int g=0; g<dim; ++g)
-             S_cubed[d][e] += S[d][f] * S[f][g] * S[g][e];
+        for (unsigned int e=0; e<dim; ++e)
+          for (unsigned int f=0; f<dim; ++f)
+            for (unsigned int g=0; g<dim; ++g)
+              S_cubed[d][e] += S[d][f] * S[f][g] * S[g][e];
 
       Tensor<2,dim> S_squared;
       for (unsigned int d=0; d<dim; ++d)
-       for (unsigned int e=0; e<dim; ++e)
-         for (unsigned int f=0; f<dim; ++f)
-           S_squared[d][e] += S[d][f] * S[f][e];
+        for (unsigned int e=0; e<dim; ++e)
+          for (unsigned int f=0; f<dim; ++f)
+            S_squared[d][e] += S[d][f] * S[f][e];
 
       Tensor<2,dim> R = S_cubed
-                       - first_invariant(S) * S_squared
-                       + second_invariant(S) * S
-                       - third_invariant(S) * unit_symmetric_tensor<dim> ();
+                        - first_invariant(S) * S_squared
+                        + second_invariant(S) * S
+                        - third_invariant(S) * unit_symmetric_tensor<dim> ();
       deallog << R << std::endl;
 
       Assert (R.norm() < 1e-10, ExcInternalError());
index c8e4e1a9162a4994c48906ebb47373da535f4b85..7666453c5e153ca6218cad8679b9482abbf23eba 100644 (file)
@@ -35,10 +35,10 @@ void check ()
   Tensor<1,dim> x;
   for (unsigned int i=0; i<dim; ++i)
     x[i] = std::rand() % 10;
-  
+
   deallog << "S = " << S << std::endl;
   deallog << "x = " << x << std::endl;
-  deallog << "S*x = " << S*x << std::endl;
+  deallog << "S*x = " << S *x << std::endl;
 }
 
 
@@ -53,6 +53,6 @@ int main ()
   check<1> ();
   check<2> ();
   check<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 3c4224d0a9cf6052be1fc21b78e26adea64434a8..2d23869b6c9a0ba5619600f4646dd0b7fe343728 100644 (file)
@@ -32,7 +32,8 @@ const int entries[] = { 11,12,13,21,
                         33,58,65,78,
                         80,83,87,91,
                         1, 2, 3, 4,
-                        6, 8, 10, 14};
+                        6, 8, 10, 14
+                      };
 
 int
 main ()
@@ -44,7 +45,7 @@ main ()
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-                                   // a square table
+  // a square table
   if (true)
     {
       Table<2,double> Td(3,3);
@@ -74,7 +75,7 @@ main ()
           };
     };
 
-                                   // a rectangular table
+  // a rectangular table
   if (true)
     {
       Table<2,double> Td(4,3);
@@ -109,37 +110,37 @@ main ()
     };
 
 
-                                   // a transposed rectangular table
+  // a transposed rectangular table
   if (true)
     {
       TransposeTable<float> Td(4,3);
       TransposeTable<int> Ti(4,3);
 
-                                      // Fill the float matrix in row
-                                      // first ordering
+      // Fill the float matrix in row
+      // first ordering
       for (unsigned int i=0; i<12; ++i)
         {
           Td(i/3,i%3) = entries[i];
         };
 
-                                      // This fills the integer
-                                      // matrix in column first
-                                      // ordering
+      // This fills the integer
+      // matrix in column first
+      // ordering
       Ti.fill(entries);
-                                      // Output both matrices...
-                                      // They should be different
+      // Output both matrices...
+      // They should be different
       for (unsigned int i=0; i<4; ++i)
-       {
-         for (unsigned int j=0; j<3; ++j)
-           {
-             deallog << '\t' << Ti(i,j) << '/' << Td(i,j);
-           }
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<3; ++j)
+            {
+              deallog << '\t' << Ti(i,j) << '/' << Td(i,j);
+            }
+          deallog << std::endl;
+        }
     }
 
 
-                                   // a 1d-table
+  // a 1d-table
   if (true)
     {
       const unsigned int N=10;
@@ -162,7 +163,7 @@ main ()
         };
     };
 
-                                   // a 3d-table
+  // a 3d-table
   if (true)
     {
       const unsigned int I=4, J=3, K=2;
@@ -181,21 +182,21 @@ main ()
       for (unsigned int i=0; i<I; ++i)
         for (unsigned int j=0; j<J; ++j)
           for (unsigned int k=0; k<K; ++k)
-          {
-            Assert (Td[i][j][k] == Td(i,j,k), ExcInternalError());
-            Assert (Ti[i][j][k] == Ti(i,j,k), ExcInternalError());
-            Assert (Ti[i][j][k] == Td(i,j,k), ExcInternalError());
+            {
+              Assert (Td[i][j][k] == Td(i,j,k), ExcInternalError());
+              Assert (Ti[i][j][k] == Ti(i,j,k), ExcInternalError());
+              Assert (Ti[i][j][k] == Td(i,j,k), ExcInternalError());
 
-            Assert (*(Td[i][j].begin()+k) == Td(i,j,k), ExcInternalError());
-            Assert (*(Ti[i][j].begin()+k) == Ti(i,j,k), ExcInternalError());
-            Assert (*(Ti[i][j].begin()+k) == Td(i,j,k), ExcInternalError());
+              Assert (*(Td[i][j].begin()+k) == Td(i,j,k), ExcInternalError());
+              Assert (*(Ti[i][j].begin()+k) == Ti(i,j,k), ExcInternalError());
+              Assert (*(Ti[i][j].begin()+k) == Td(i,j,k), ExcInternalError());
 
-            Assert (&*(Td[i][j].begin()+k) == &Td(i,j,k), ExcInternalError());
-           Assert (&*(Ti[i][j].begin()+k) == &Ti(i,j,k), ExcInternalError());
+              Assert (&*(Td[i][j].begin()+k) == &Td(i,j,k), ExcInternalError());
+              Assert (&*(Ti[i][j].begin()+k) == &Ti(i,j,k), ExcInternalError());
 
-            deallog << i << " " << j << " " << k << " "
-                    << Td[i][j][k] << " ok" << std::endl;
-          };
+              deallog << i << " " << j << " " << k << " "
+                      << Td[i][j][k] << " ok" << std::endl;
+            };
 
       for (unsigned int i=0; i<I; ++i)
         for (unsigned int j=0; j<J; ++j)
@@ -204,7 +205,7 @@ main ()
                   ExcInternalError());
     };
 
-                                   // a 4d-table
+  // a 4d-table
   if (true)
     {
       const unsigned int I=5, J=4, K=3, L=2;
@@ -215,49 +216,49 @@ main ()
       for (unsigned int i=0; i<I; ++i)
         for (unsigned int j=0; j<J; ++j)
           for (unsigned int k=0; k<K; ++k)
-           for (unsigned int l=0; l<L; ++l, ++index)
-             {
-                                                // Take a simple
-                                                // number generator
-                                                // rather than
-                                                // dreaming up lots
-                                                // of `arbitrary'
-                                                // numbers in the
-                                                // entries array
-               Td(i,j,k,l) = 2*index+1;
-               Ti(i,j,k,l) = 2*index+1;
-             };
+            for (unsigned int l=0; l<L; ++l, ++index)
+              {
+                // Take a simple
+                // number generator
+                // rather than
+                // dreaming up lots
+                // of `arbitrary'
+                // numbers in the
+                // entries array
+                Td(i,j,k,l) = 2*index+1;
+                Ti(i,j,k,l) = 2*index+1;
+              };
 
       for (unsigned int i=0; i<I; ++i)
         for (unsigned int j=0; j<J; ++j)
           for (unsigned int k=0; k<K; ++k)
-           for (unsigned int l=0; l<L; ++l)
-             {
-               Assert (Td[i][j][k][l] == Td(i,j,k,l), ExcInternalError());
-               Assert (Ti[i][j][k][l] == Ti(i,j,k,l), ExcInternalError());
-               Assert (Ti[i][j][k][l] == Td(i,j,k,l), ExcInternalError());
+            for (unsigned int l=0; l<L; ++l)
+              {
+                Assert (Td[i][j][k][l] == Td(i,j,k,l), ExcInternalError());
+                Assert (Ti[i][j][k][l] == Ti(i,j,k,l), ExcInternalError());
+                Assert (Ti[i][j][k][l] == Td(i,j,k,l), ExcInternalError());
 
-               Assert (*(Td[i][j][k].begin()+l) == Td(i,j,k,l), ExcInternalError());
-               Assert (*(Ti[i][j][k].begin()+l) == Ti(i,j,k,l), ExcInternalError());
-               Assert (*(Ti[i][j][k].begin()+l) == Td(i,j,k,l), ExcInternalError());
+                Assert (*(Td[i][j][k].begin()+l) == Td(i,j,k,l), ExcInternalError());
+                Assert (*(Ti[i][j][k].begin()+l) == Ti(i,j,k,l), ExcInternalError());
+                Assert (*(Ti[i][j][k].begin()+l) == Td(i,j,k,l), ExcInternalError());
 
-               Assert (&*(Td[i][j][k].begin()+l) == &Td(i,j,k,l), ExcInternalError());
-               Assert (&*(Ti[i][j][k].begin()+l) == &Ti(i,j,k,l), ExcInternalError());
+                Assert (&*(Td[i][j][k].begin()+l) == &Td(i,j,k,l), ExcInternalError());
+                Assert (&*(Ti[i][j][k].begin()+l) == &Ti(i,j,k,l), ExcInternalError());
 
-               deallog << i << " " << j << " " << k << " " << l << " "
-                       << Td[i][j][k][l] << " ok" << std::endl;
-             };
+                deallog << i << " " << j << " " << k << " " << l << " "
+                        << Td[i][j][k][l] << " ok" << std::endl;
+              };
 
       for (unsigned int i=0; i<I; ++i)
         for (unsigned int j=0; j<J; ++j)
-         for (unsigned int k=0; k<K; ++k)
-           Assert (Td[i][j][k].end() - Td[i][j][k].begin() ==
-                   static_cast<signed int>(L),
-                   ExcDimensionMismatch(Td[i][j][k].end() - Td[i][j][k].begin(),
-                                        static_cast<signed int>(L)));
+          for (unsigned int k=0; k<K; ++k)
+            Assert (Td[i][j][k].end() - Td[i][j][k].begin() ==
+                    static_cast<signed int>(L),
+                    ExcDimensionMismatch(Td[i][j][k].end() - Td[i][j][k].begin(),
+                                         static_cast<signed int>(L)));
     };
 
-                                   // 5d-table
+  // 5d-table
   if (true)
     {
       const unsigned int I=6, J=2, K=3, L=4, M=5;
@@ -268,45 +269,45 @@ main ()
       for (unsigned int i=0; i<I; ++i)
         for (unsigned int j=0; j<J; ++j)
           for (unsigned int k=0; k<K; ++k)
-           for (unsigned int l=0; l<L; ++l)
-             for (unsigned int m=0; m<M; ++m, ++index)
-               {
-                 Td(i,j,k,l,m) = 2*index+1;
-                 Ti(i,j,k,l,m) = 2*index+1;
-               };
+            for (unsigned int l=0; l<L; ++l)
+              for (unsigned int m=0; m<M; ++m, ++index)
+                {
+                  Td(i,j,k,l,m) = 2*index+1;
+                  Ti(i,j,k,l,m) = 2*index+1;
+                };
 
       for (unsigned int i=0; i<I; ++i)
         for (unsigned int j=0; j<J; ++j)
           for (unsigned int k=0; k<K; ++k)
-           for (unsigned int l=0; l<L; ++l)
-             for (unsigned int m=0; m<M; ++m)
-               {
-                 Assert (Td[i][j][k][l][m] == Td(i,j,k,l,m), ExcInternalError());
-                 Assert (Ti[i][j][k][l][m] == Ti(i,j,k,l,m), ExcInternalError());
-                 Assert (Ti[i][j][k][l][m] == Td(i,j,k,l,m), ExcInternalError());
+            for (unsigned int l=0; l<L; ++l)
+              for (unsigned int m=0; m<M; ++m)
+                {
+                  Assert (Td[i][j][k][l][m] == Td(i,j,k,l,m), ExcInternalError());
+                  Assert (Ti[i][j][k][l][m] == Ti(i,j,k,l,m), ExcInternalError());
+                  Assert (Ti[i][j][k][l][m] == Td(i,j,k,l,m), ExcInternalError());
 
-                 Assert (*(Td[i][j][k][l].begin()+m) == Td(i,j,k,l,m), ExcInternalError());
-                 Assert (*(Ti[i][j][k][l].begin()+m) == Ti(i,j,k,l,m), ExcInternalError());
-                 Assert (*(Ti[i][j][k][l].begin()+m) == Td(i,j,k,l,m), ExcInternalError());
+                  Assert (*(Td[i][j][k][l].begin()+m) == Td(i,j,k,l,m), ExcInternalError());
+                  Assert (*(Ti[i][j][k][l].begin()+m) == Ti(i,j,k,l,m), ExcInternalError());
+                  Assert (*(Ti[i][j][k][l].begin()+m) == Td(i,j,k,l,m), ExcInternalError());
 
-                 Assert (&*(Td[i][j][k][l].begin()+m) == &Td(i,j,k,l,m), ExcInternalError());
-                 Assert (&*(Ti[i][j][k][l].begin()+m) == &Ti(i,j,k,l,m), ExcInternalError());
+                  Assert (&*(Td[i][j][k][l].begin()+m) == &Td(i,j,k,l,m), ExcInternalError());
+                  Assert (&*(Ti[i][j][k][l].begin()+m) == &Ti(i,j,k,l,m), ExcInternalError());
 
-                 deallog << i << " " << j << " " << k << " " << l << " " << m << " "
-                         << Td[i][j][k][l][m] << " ok" << std::endl;
-               };
+                  deallog << i << " " << j << " " << k << " " << l << " " << m << " "
+                          << Td[i][j][k][l][m] << " ok" << std::endl;
+                };
 
       for (unsigned int i=0; i<I; ++i)
         for (unsigned int j=0; j<J; ++j)
-         for (unsigned int k=0; k<K; ++k)
-           for (unsigned int l=0; l<L; ++l)
-             Assert (Td[i][j][k][l].end() - Td[i][j][k][l].begin() ==
-                     static_cast<signed int>(M),
-                     ExcDimensionMismatch(Td[i][j][k][l].end() - Td[i][j][k][l].begin(),
-                                          static_cast<signed int>(M)));
+          for (unsigned int k=0; k<K; ++k)
+            for (unsigned int l=0; l<L; ++l)
+              Assert (Td[i][j][k][l].end() - Td[i][j][k][l].begin() ==
+                      static_cast<signed int>(M),
+                      ExcDimensionMismatch(Td[i][j][k][l].end() - Td[i][j][k][l].begin(),
+                                           static_cast<signed int>(M)));
     };
 
-                                   // a 6d-table
+  // a 6d-table
   if (true)
     {
       const unsigned int I=6, J=2, K=4, L=3, M=5, N=7;
@@ -317,45 +318,45 @@ main ()
       for (unsigned int i=0; i<I; ++i)
         for (unsigned int j=0; j<J; ++j)
           for (unsigned int k=0; k<K; ++k)
-           for (unsigned int l=0; l<L; ++l)
-             for (unsigned int m=0; m<M; ++m)
-               for (unsigned int n=0; n<N; ++n, ++index)
-                 {
-                   Td(i,j,k,l,m,n) = 2*index+1;
-                   Ti(i,j,k,l,m,n) = 2*index+1;
-                 };
+            for (unsigned int l=0; l<L; ++l)
+              for (unsigned int m=0; m<M; ++m)
+                for (unsigned int n=0; n<N; ++n, ++index)
+                  {
+                    Td(i,j,k,l,m,n) = 2*index+1;
+                    Ti(i,j,k,l,m,n) = 2*index+1;
+                  };
 
       for (unsigned int i=0; i<I; ++i)
         for (unsigned int j=0; j<J; ++j)
           for (unsigned int k=0; k<K; ++k)
-           for (unsigned int l=0; l<L; ++l)
-             for (unsigned int m=0; m<M; ++m)
-               for (unsigned int n=0; n<N; ++n)
-                 {
-                   Assert (Td[i][j][k][l][m][n] == Td(i,j,k,l,m,n), ExcInternalError());
-                   Assert (Ti[i][j][k][l][m][n] == Ti(i,j,k,l,m,n), ExcInternalError());
-                   Assert (Ti[i][j][k][l][m][n] == Td(i,j,k,l,m,n), ExcInternalError());
+            for (unsigned int l=0; l<L; ++l)
+              for (unsigned int m=0; m<M; ++m)
+                for (unsigned int n=0; n<N; ++n)
+                  {
+                    Assert (Td[i][j][k][l][m][n] == Td(i,j,k,l,m,n), ExcInternalError());
+                    Assert (Ti[i][j][k][l][m][n] == Ti(i,j,k,l,m,n), ExcInternalError());
+                    Assert (Ti[i][j][k][l][m][n] == Td(i,j,k,l,m,n), ExcInternalError());
 
-                   Assert (*(Td[i][j][k][l][m].begin()+n) == Td(i,j,k,l,m,n), ExcInternalError());
-                   Assert (*(Ti[i][j][k][l][m].begin()+n) == Ti(i,j,k,l,m,n), ExcInternalError());
-                   Assert (*(Ti[i][j][k][l][m].begin()+n) == Td(i,j,k,l,m,n), ExcInternalError());
+                    Assert (*(Td[i][j][k][l][m].begin()+n) == Td(i,j,k,l,m,n), ExcInternalError());
+                    Assert (*(Ti[i][j][k][l][m].begin()+n) == Ti(i,j,k,l,m,n), ExcInternalError());
+                    Assert (*(Ti[i][j][k][l][m].begin()+n) == Td(i,j,k,l,m,n), ExcInternalError());
 
-                   Assert (&*(Td[i][j][k][l][m].begin()+n) == &Td(i,j,k,l,m,n), ExcInternalError());
-                   Assert (&*(Ti[i][j][k][l][m].begin()+n) == &Ti(i,j,k,l,m,n), ExcInternalError());
+                    Assert (&*(Td[i][j][k][l][m].begin()+n) == &Td(i,j,k,l,m,n), ExcInternalError());
+                    Assert (&*(Ti[i][j][k][l][m].begin()+n) == &Ti(i,j,k,l,m,n), ExcInternalError());
 
-                   deallog << i << " " << j << " " << k << " " << l << " " << m << " " << n << " "
-                           << Td[i][j][k][l][m][n] << " ok" << std::endl;
-                 };
+                    deallog << i << " " << j << " " << k << " " << l << " " << m << " " << n << " "
+                            << Td[i][j][k][l][m][n] << " ok" << std::endl;
+                  };
 
       for (unsigned int i=0; i<I; ++i)
         for (unsigned int j=0; j<J; ++j)
-         for (unsigned int k=0; k<K; ++k)
-           for (unsigned int l=0; l<L; ++l)
-             for (unsigned int m=0; m<M; ++m)
-               Assert (Td[i][j][k][l][m].end() - Td[i][j][k][l][m].begin() ==
-                       static_cast<signed int>(N),
-                       ExcDimensionMismatch(Td[i][j][k][l][m].end() - Td[i][j][k][l][m].begin(),
-                                            static_cast<signed int>(N)));
+          for (unsigned int k=0; k<K; ++k)
+            for (unsigned int l=0; l<L; ++l)
+              for (unsigned int m=0; m<M; ++m)
+                Assert (Td[i][j][k][l][m].end() - Td[i][j][k][l][m].begin() ==
+                        static_cast<signed int>(N),
+                        ExcDimensionMismatch(Td[i][j][k][l][m].end() - Td[i][j][k][l][m].begin(),
+                                             static_cast<signed int>(N)));
     };
 }
 
index ba163989626097edfe9cb13408491c8a6b50b9d7..d6e1fd97ce95c9545e7a0b0debc614e2770eeb38 100644 (file)
@@ -38,14 +38,14 @@ int main ()
   TableHandler table;
 
   for (unsigned int i=1; i<=10; ++i)
-  {
-    table.add_value("numbers", i);
-    table.add_value("squares", i*i);
-    table.add_value("square roots", sqrt(i));
-  }
+    {
+      table.add_value("numbers", i);
+      table.add_value("squares", i*i);
+      table.add_value("square roots", sqrt(i));
+    }
 
   table.set_tex_table_caption("This is a caption text with \\LaTeX{} symbols");
 
-                                 // output
+  // output
   table.write_tex(deallog.get_file_stream());
 }
index 9d2c9423493420460eb3524e0cf3bf0c28a1946d..5cab305dc8471c3cd303f427cb82f2b21c30f488 100644 (file)
@@ -38,21 +38,21 @@ int main ()
 
   TableHandler table;
 
-                                  // have keys that we rotate in each row to
-                                  // make sure that individual entries in the
-                                  // same column really have different data
-                                  // types
+  // have keys that we rotate in each row to
+  // make sure that individual entries in the
+  // same column really have different data
+  // types
   std::string keys[4] = { "key1", "key2", "key3", "key4" };
 
 
   for (unsigned int i=0; i<10; ++i)
-  {
-    table.add_value(keys[(0+i)%4], i);
-    table.add_value(keys[(1+i)%4], sqrt(i));
-    table.add_value(keys[(2+i)%4], 'a'+i);
-    table.add_value(keys[(3+i)%4], std::string("abc-")+"0123456789"[i]);
-  }
-
-                                 // output
+    {
+      table.add_value(keys[(0+i)%4], i);
+      table.add_value(keys[(1+i)%4], sqrt(i));
+      table.add_value(keys[(2+i)%4], 'a'+i);
+      table.add_value(keys[(3+i)%4], std::string("abc-")+"0123456789"[i]);
+    }
+
+  // output
   table.write_text(deallog.get_file_stream());
 }
index 9a91ae759dc12960f38133d63641072b7a72d7f1..22bfaa63af5f028055b8e93d4929c1b4886e3a2c 100644 (file)
@@ -42,18 +42,18 @@ int main ()
 
   std::string keys[3] = { "key1", "key2", "key3" };
 
-                                  // fill rows 1 and 2 partially
+  // fill rows 1 and 2 partially
   table.add_value(keys[0], 0);
   table.add_value(keys[0], 1);
-                                  // now fill row 3 completely
+  // now fill row 3 completely
   table.add_value(keys[0], 2);
   table.add_value(keys[1], 13);
   table.add_value(keys[2], std::string("a"));
 
-                                  // now again fill row 4 partially
+  // now again fill row 4 partially
   table.add_value(keys[0], 1);
 
-                                  // produce output. hope that row 4 is
-                                  // completely padded
+  // produce output. hope that row 4 is
+  // completely padded
   table.write_text(deallog.get_file_stream());
 }
index ffc7d5807c2340aafccdd1b288dc5d62d5f958e0..2863f99d09208780b821ab9599c8c9a97b8b64b2 100644 (file)
@@ -41,19 +41,19 @@ int main ()
 
   std::string keys[3] = { "key1", "key2", "key3" };
 
-                                  // fill rows 1 and 2 partially
+  // fill rows 1 and 2 partially
   table.add_value(keys[0], 0);
   table.add_value(keys[0], 1);
-                                  // now fill row 3 completely
+  // now fill row 3 completely
   table.add_value(keys[0], 2);
   table.add_value(keys[1], 13);
   table.add_value(keys[2], std::string("a"));
 
-                                  // now again fill row 4 partially
+  // now again fill row 4 partially
   table.add_value(keys[0], 1);
 
-                                  // produce output. hope that row 4 is
-                                  // completely padded
+  // produce output. hope that row 4 is
+  // completely padded
   table.write_text(deallog.get_file_stream(),
-                  TableHandler::table_with_separate_column_description);
+                   TableHandler::table_with_separate_column_description);
 }
index f515b13b2919675c3ddf350e5917ece35318464f..cfad4e156e82445847f0668fb002fe5613814c9d 100644 (file)
@@ -36,29 +36,29 @@ int main ()
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-/* Like in _06 */
+  /* Like in _06 */
   TableHandler table;
   table.set_auto_fill_mode (true);
 
   std::string keys[3] = { "key1", "key2", "key3" };
 
-                                  // fill rows 1 and 2 partially
+  // fill rows 1 and 2 partially
   table.add_value(keys[0], 0);
   table.add_value(keys[0], 1);
-                                  // now fill row 3 completely
+  // now fill row 3 completely
   table.add_value(keys[0], 2);
   table.add_value(keys[1], 13);
   table.add_value(keys[2], std::string("a"));
 
-                                  // now again fill row 4 partially
+  // now again fill row 4 partially
   table.add_value(keys[0], 1);
 
-/* Now copy and write the file from the copy */
+  /* Now copy and write the file from the copy */
   TableHandler table2;
   table2 = table;
 
-                                  // produce output. hope that row 4 is
-                                  // completely padded
+  // produce output. hope that row 4 is
+  // completely padded
   table2.write_text(deallog.get_file_stream(),
-                  TableHandler::table_with_separate_column_description);
+                    TableHandler::table_with_separate_column_description);
 }
index f9e7b0678b86ed45cfe3a06eca087482fdf6f688..e3beeb9e3586d9f9498d230b376548648685565e 100644 (file)
@@ -37,28 +37,28 @@ int main ()
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-/* Like in _06 */
+  /* Like in _06 */
   TableHandler table;
   table.set_auto_fill_mode (true);
 
   std::string keys[3] = { "key1", "key2", "key3" };
 
-                                  // fill rows 1 and 2 partially
+  // fill rows 1 and 2 partially
   table.add_value(keys[0], 0);
   table.add_value(keys[0], 1);
-                                  // now fill row 3 completely
+  // now fill row 3 completely
   table.add_value(keys[0], 2);
   table.add_value(keys[1], 13);
   table.add_value(keys[2], std::string("a"));
 
-                                  // now again fill row 4 partially
+  // now again fill row 4 partially
   table.add_value(keys[0], 1);
 
-/* Now copy and write the file from the copy */
+  /* Now copy and write the file from the copy */
   TableHandler table2(table);
 
-                                  // produce output. hope that row 4 is
-                                  // completely padded
+  // produce output. hope that row 4 is
+  // completely padded
   table2.write_text(deallog.get_file_stream(),
-                  TableHandler::table_with_separate_column_description);
+                    TableHandler::table_with_separate_column_description);
 }
index 845d5202a340a7f2a9e1523bd0098ff4af7d3fb9..95330167a31d421957606773ac2082903267882f 100644 (file)
@@ -41,19 +41,19 @@ int main ()
 
   std::string keys[3] = { "key1", "key2", "key3" };
 
-                                  // fill rows 1 and 2 partially
+  // fill rows 1 and 2 partially
   table.add_value(keys[0], 0);
   table.add_value(keys[0], 1);
-                                  // now fill row 3 completely
+  // now fill row 3 completely
   table.add_value(keys[0], 2);
   table.add_value(keys[1], 113);
   table.add_value(keys[2], std::string("a"));
 
-                                  // now again fill row 4 partially
+  // now again fill row 4 partially
   table.add_value(keys[0], 1);
 
-                                  // produce output. hope that row 4 is
-                                  // completely padded
+  // produce output. hope that row 4 is
+  // completely padded
   table.write_text(deallog.get_file_stream(),
-                  TableHandler::simple_table_with_separate_column_description);
+                   TableHandler::simple_table_with_separate_column_description);
 }
index 8e576a1e3b2357f3de56c7bf959b00c06b942b97..e4666b63074f6ab14ecd14646f54b6e8c5f0ff63 100644 (file)
@@ -41,26 +41,26 @@ int main ()
 
   std::string keys[3] = { "key1", "key2", "key3" };
 
-                                  // fill rows 1 and 2 partially
+  // fill rows 1 and 2 partially
   table.add_value(keys[0], 0.0);
   table.add_value(keys[0], 1.0);
-                                  // now fill row 3 completely
+  // now fill row 3 completely
   table.add_value(keys[0], 2.0);
   table.add_value(keys[1], 123.456);
   table.add_value(keys[2], std::string("abc"));
 
-                                  // now again fill row 4 partially
+  // now again fill row 4 partially
   table.add_value(keys[0], 1.0);
 
-                                  // produce output. hope that row 4 is
-                                  // completely padded
+  // produce output. hope that row 4 is
+  // completely padded
   table.write_text(deallog.get_file_stream(),
-                  TableHandler::table_with_separate_column_description);
+                   TableHandler::table_with_separate_column_description);
 
   table.set_scientific(keys[0], true);
   table.set_precision(keys[1], 1);
 
   table.write_text(deallog.get_file_stream(),
-                  TableHandler::table_with_separate_column_description);
-  
+                   TableHandler::table_with_separate_column_description);
+
 }
index 683f4c7416050a034f723e39f0b86bd32c9a4a49..e735d91ee1df65bec3a4ce492ccf43b93432de9a 100644 (file)
@@ -47,17 +47,17 @@ int main ()
   table.add_value(keys[2], std::string("abc"));
   table.add_value(keys[3], std::string("A"));
   table.add_value(keys[4], 123456789.0);
-  
+
   table.add_column_to_supercolumn("key1","short");
   table.add_column_to_supercolumn("key2","short");
   table.add_column_to_supercolumn("key3","very_long_supercolumn");
   table.add_column_to_supercolumn("key4","very_long_supercolumn");
 
   table.write_text(deallog.get_file_stream(),
-                  TableHandler::table_with_separate_column_description);
-  
+                   TableHandler::table_with_separate_column_description);
+
   deallog << std::endl;
-  
+
   table.write_text(deallog.get_file_stream(),
-                  TableHandler::table_with_headers);  
+                   TableHandler::table_with_headers);
 }
index 2e917dd93e19c519c70f0b80d72404f0e32dc58c..da4066aea5c9f7b88260d1829433528ea8963596 100644 (file)
@@ -38,20 +38,20 @@ int main ()
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-                                  // set precision on the output
-                                  // stream to 4 digits
+  // set precision on the output
+  // stream to 4 digits
   logfile << std::setprecision(4);
 
-                                  // but then set precision on the
-                                  // table output to 2
+  // but then set precision on the
+  // table output to 2
   TableHandler table;
   table.add_value("key", 0.123456789);
   table.set_precision ("key", 2);
 
-                                  // now output the table...
+  // now output the table...
   table.write_text(logfile);
-                                  // ...and then output some other
-                                  // number, hopefully with 4 digits
-                                  // of precision
+  // ...and then output some other
+  // number, hopefully with 4 digits
+  // of precision
   logfile << 0.123456789 << std::endl;
 }
index 809f6010183bccb20f18ccaa3fffb38510504463..96c1cd465cc7af43c8368a9b67eda2e42d31eeee 100644 (file)
 #include <deal.II/base/thread_management.h>
 
 
-void test () 
+void test ()
 {
   sleep (3);
   deallog << "OK" << std::endl;
 }
 
-  
+
 int main()
 {
   std::ofstream logfile("task_01/output");
index fab05e2bb2306542c0196a07af38992da0e77ff7..c7a826c76dc83dc8c979de06c69c9a8c017c4cb9 100644 (file)
 #include <deal.II/base/thread_management.h>
 
 
-int test () 
+int test ()
 {
   sleep (3);
   return 42;
 }
 
-  
-  
+
+
 
 int main()
 {
index 2ff38f444e46bd416ddef0217e71943997ce028f..616ee60c1d2d112f4e54e202f51870b80610e696 100644 (file)
 #include <deal.II/base/thread_management.h>
 
 
-void test (int i) 
+void test (int i)
 {
   deallog << "Task " << i << " starting..." << std::endl;
   sleep (1);
   deallog << "Task " << i << " finished!" << std::endl;
 }
 
-  
-  
+
+
 
 int main()
 {
@@ -42,7 +42,7 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   Threads::Task<> t1 = Threads::new_task (test, 1);
   {
     Threads::Task<> t2 = Threads::new_task (test, 2);
@@ -50,6 +50,6 @@ int main()
     t1.join ();
     t2.join ();
   }
-  
+
   deallog << "OK" << std::endl;
 }
index 297afa3276c8b0c0251a973bb2f1cfed3662b436..3fb1768554ee09babef558f99456d7d150f8cfc2 100644 (file)
@@ -25,7 +25,7 @@
 #include <deal.II/base/thread_management.h>
 
 
-void test (int i) 
+void test (int i)
 {
   deallog << "Task " << i << " starting..." << std::endl;
 
@@ -37,13 +37,13 @@ void test (int i)
       t1.join ();
       t2.join ();
     }
-  
+
   sleep (1);
   deallog << "Task " << i << " finished!" << std::endl;
 }
 
-  
-  
+
+
 
 int main()
 {
@@ -51,12 +51,12 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   Threads::Task<> t1 = Threads::new_task (test, 1);
   Threads::Task<> t2 = Threads::new_task (test, 2);
 
   t1.join ();
   t2.join ();
-  
+
   deallog << "OK" << std::endl;
 }
index 092fe4269f2b9bb51579545fc9b8513e79066322..a9fc105be42eb2cb7c5282ac6fde1f5967a07cd2 100644 (file)
@@ -32,7 +32,7 @@
 #include <deal.II/base/thread_management.h>
 
 
-int test (int i) 
+int test (int i)
 {
   int k = 1;
   for (unsigned int j=0; j<100000000; ++j)
@@ -40,8 +40,8 @@ int test (int i)
   return k;
 }
 
-  
-  
+
+
 
 int main()
 {
@@ -49,19 +49,21 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   Threads::Task<int> tasks[] =
-    { Threads::new_task (test, 1),
-      Threads::new_task (test, 2),
-      Threads::new_task (test, 3),
-      Threads::new_task (test, 4),
-      Threads::new_task (test, 5),
-      Threads::new_task (test, 6),
-      Threads::new_task (test, 7),
-      Threads::new_task (test, 8)  };
-  
+  {
+    Threads::new_task (test, 1),
+    Threads::new_task (test, 2),
+    Threads::new_task (test, 3),
+    Threads::new_task (test, 4),
+    Threads::new_task (test, 5),
+    Threads::new_task (test, 6),
+    Threads::new_task (test, 7),
+    Threads::new_task (test, 8)
+  };
+
   for (unsigned int i=0; i<sizeof(tasks)/sizeof(tasks[0]); ++i)
     deallog << i << ' ' << tasks[i].return_value() << std::endl;
-  
+
   deallog << "OK" << std::endl;
 }
index 9868cf78b520bb91f7fe44c37176a19c2e0437ba..991accb02147fa01fa4ac2379a4f507af9a9f86c 100644 (file)
@@ -26,7 +26,7 @@
 #include <deal.II/base/thread_management.h>
 
 
-void test (int i) 
+void test (int i)
 {
   deallog << "Task " << i << " starting..." << std::endl;
   sleep (1);
@@ -37,8 +37,8 @@ void test (int i)
   deallog << "Task " << i << " finished!" << std::endl;
 }
 
-  
-  
+
+
 
 int main()
 {
@@ -46,12 +46,12 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   Threads::Thread<> t1 = Threads::new_thread (test, 1);
   Threads::Thread<> t2 = Threads::new_thread (test, 2);
 
   t1.join ();
   t2.join ();
-  
+
   deallog << "OK" << std::endl;
 }
index 544bd2afe3a7323117c4106f4447093407747ac9..d9f148710fd14271854991cf237e42fe2c62cd24 100644 (file)
 #include <deal.II/base/thread_management.h>
 
 
-void test (int i) 
+void test (int i)
 {
   deallog << "Task " << i << " starting..." << std::endl;
   sleep (1);
   deallog << "Task " << i << " finished!" << std::endl;
 }
 
-  
-  
+
+
 
 int main()
 {
@@ -41,12 +41,12 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   Threads::TaskGroup<> tg;
   tg += Threads::new_task (test, 1);
   tg += Threads::new_task (test, 2);
 
   tg.join_all ();
-  
+
   deallog << "OK" << std::endl;
 }
index a2530d34faab7a164541861def504af3c5e48ec0..c7d19964f1779f178971948cecdf88c74cc81fcc 100644 (file)
 #include <deal.II/base/thread_management.h>
 
 
-void test (int i) 
+void test (int i)
 {
   sleep (1);
   deallog << "Task " << i << " finished!" << std::endl;
 }
 
-  
-  
+
+
 
 int main()
 {
@@ -42,8 +42,8 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   Threads::new_task (test, 1);
-  
+
   deallog << "OK" << std::endl;
 }
index 541aae602280b227b069ac44ae1f2a5805f223f5..6e84e4bbe2974d2d37c1a1554ceb77e2d73acfe3 100644 (file)
@@ -39,20 +39,20 @@ void test ()
 
 void outer ()
 {
-                                  // wait for some time to make sure
-                                  // that really all outer tasks have
-                                  // been started, then start a bunch
-                                  // of new tasks and wait for them
-                                  // to finish. it used to be that
-                                  // the join() function used a mutex
-                                  // which could only be acquired
-                                  // once the spawned task has
-                                  // finished, but since we already
-                                  // have so many tasks running at
-                                  // this point, the children never
-                                  // get to run and so never release
-                                  // the mutex that we try to acquire
-                                  // in join()
+  // wait for some time to make sure
+  // that really all outer tasks have
+  // been started, then start a bunch
+  // of new tasks and wait for them
+  // to finish. it used to be that
+  // the join() function used a mutex
+  // which could only be acquired
+  // once the spawned task has
+  // finished, but since we already
+  // have so many tasks running at
+  // this point, the children never
+  // get to run and so never release
+  // the mutex that we try to acquire
+  // in join()
   sleep (1);
 
   Threads::new_task (test).join();
index b3c0a743ed9c9ee1dacdf74d17fd19c7e7753a59..b3ad0c95610f07599f1a0edb31a83ae36df55eae 100644 (file)
@@ -30,10 +30,10 @@ int main ()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   double a[3][3] = {{1, 2, 3}, {3, 4, 5}, {6, 7, 8}};
   double b[3][3] = {{25,31,37}, {45,57,69}, {75,96,117}};
-    
+
   const unsigned int dim=3;
   Tensor<2,dim> t(a);
   Tensor<2,dim> tt;
@@ -42,10 +42,10 @@ int main ()
   Assert (transpose(transpose(result)) == result, ExcInternalError());
 
   Vector<double> unrolled(9);
-  
+
   t.unroll(unrolled);
   deallog << "unrolled:";
-  for (unsigned i=0;i<9;i++)
+  for (unsigned i=0; i<9; i++)
     deallog << ' ' << unrolled(i);
   deallog << std::endl;
 
@@ -53,17 +53,17 @@ int main ()
   for (unsigned int i=0; i<dim; ++i)
     {
       for (unsigned int j=0; j<dim; ++j)
-       deallog << t[i][j] << ' ';
+        deallog << t[i][j] << ' ';
       deallog << std::endl;
     };
-  
+
   contract (tt,t,t);
 
   deallog << "tt=" << std::endl;
   for (unsigned int i=0; i<dim; ++i)
     {
       for (unsigned int j=0; j<dim; ++j)
-       deallog << tt[i][j] << ' ';
+        deallog << tt[i][j] << ' ';
       deallog << std::endl;
     };
 
@@ -79,20 +79,20 @@ int main ()
       Tensor<1,3> result;
       cross_product(result,e1,e2);
       deallog << '\t' << result[0]
-             << '\t' << result[1]
-             << '\t' << result[2] << std::endl;
-      
+              << '\t' << result[1]
+              << '\t' << result[2] << std::endl;
+
       cross_product(result,e2,e3);
       deallog << '\t' << result[0]
-             << '\t' << result[1] << '\t'
-             << result[2] << std::endl;
-      
+              << '\t' << result[1] << '\t'
+              << result[2] << std::endl;
+
       cross_product(result,e3,e1);
       deallog << '\t' << result[0]
-             << '\t' << result[1]
-             << '\t' << result[2] << std::endl;
-      
-       deallog.pop();
+              << '\t' << result[1]
+              << '\t' << result[2] << std::endl;
+
+      deallog.pop();
     }
 
   if (tt==result)
index dc679875163480d0ddbde3ae3e930c1edc311377..c08406da0b361062101fe9869b8e210ab9332164 100644 (file)
@@ -31,9 +31,9 @@ int main ()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   double a[3][3] = {{1, 2, 3}, {3, 4, 5}, {6, 7, 8}};
-    
+
   const unsigned int dim=3;
   Tensor<2,dim> t(a);
 
@@ -42,6 +42,6 @@ int main ()
   deallog << t.norm() << std::endl;
 
   Assert (t.norm() == 0, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
index 55c9473cfcee6c339e93ff280a38046487c49d2a..68ff64c4f5a4cf16159e05cbe959ef0356a6d56b 100644 (file)
@@ -31,9 +31,9 @@ int main ()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   double a[3] = {1, 2, 3};
-    
+
   const unsigned int dim=3;
   Tensor<1,dim> t(a);
 
@@ -42,6 +42,6 @@ int main ()
   deallog << t.norm() << std::endl;
 
   Assert (t.norm() == 0, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
index c93c9c2457a38c01410fc2276f88fb755245237d..6ae7f2149452ea010508dd96c5eefcad0aa27f17 100644 (file)
@@ -28,11 +28,11 @@ template <int dim>
 void test_constant()
 {
   Tensor<2,dim> t;
-  for (unsigned int i=0;i<dim;++i)
-    for (unsigned int j=0;j<dim;++j)
+  for (unsigned int i=0; i<dim; ++i)
+    for (unsigned int j=0; j<dim; ++j)
       t[i][j] = 2.;
   deallog << "Constant dim " << dim << '\t' << double_contract(t,t)
-         << " compare " << 4*dim*dim << std::endl;
+          << " compare " << 4*dim *dim << std::endl;
 }
 
 
@@ -41,15 +41,15 @@ void test_equal()
 {
   Tensor<2,dim> t;
   unsigned int sum = 0;
-  for (unsigned int i=0;i<dim;++i)
-    for (unsigned int j=0;j<dim;++j)
+  for (unsigned int i=0; i<dim; ++i)
+    for (unsigned int j=0; j<dim; ++j)
       {
-       t[i][j] = i+dim*j;
-       sum += (i+dim*j)*(i+dim*j);
+        t[i][j] = i+dim*j;
+        sum += (i+dim*j)*(i+dim*j);
       }
-  
+
   deallog << "Equal    dim " << dim << '\t' << double_contract(t,t)
-         << " compare " << sum << std::endl;
+          << " compare " << sum << std::endl;
 }
 
 
@@ -59,16 +59,16 @@ void test_unequal()
   Tensor<2,dim> s;
   Tensor<2,dim> t;
   unsigned int sum = 0;
-  for (unsigned int i=0;i<dim;++i)
-    for (unsigned int j=0;j<dim;++j)
+  for (unsigned int i=0; i<dim; ++i)
+    for (unsigned int j=0; j<dim; ++j)
       {
-       s[i][j] = i+dim*j;
-       t[i][j] = dim*i+j;
-       sum += (i+dim*j)*(dim*i+j);
+        s[i][j] = i+dim*j;
+        t[i][j] = dim*i+j;
+        sum += (i+dim*j)*(dim*i+j);
       }
-  
+
   deallog << "Unequal  dim " << dim << '\t' << double_contract(s,t)
-         << " compare " << sum << std::endl;
+          << " compare " << sum << std::endl;
 }
 
 
index 73ebfcfff4824e798d199a0192e758e3b7d8ff70..34ecb91aba35a1d42528bd8d42ffe07ee210d672 100644 (file)
@@ -29,17 +29,17 @@ void test_select(double f1, double f2)
 {
   Tensor<2,dim> t;
   unsigned int k = 0;
-  for (unsigned int i=0;i<dim;++i)
-    for (unsigned int j=0;j<dim;++j)
+  for (unsigned int i=0; i<dim; ++i)
+    for (unsigned int j=0; j<dim; ++j)
       t[i][j] = ++k;
-  
-  for (unsigned int i=0;i<dim;++i)
-    for (unsigned int j=0;j<dim;++j)
+
+  for (unsigned int i=0; i<dim; ++i)
+    for (unsigned int j=0; j<dim; ++j)
       {
-       Tensor<1,dim> u, v;
-       u[i] = f1;
-       v[j] = f2;
-       deallog << '\t' << contract3(u,t,v);
+        Tensor<1,dim> u, v;
+        u[i] = f1;
+        v[j] = f2;
+        deallog << '\t' << contract3(u,t,v);
       }
   deallog << std::endl;
 }
@@ -49,14 +49,14 @@ int main ()
 {
   std::string logname = JobIdentifier::base_name(__FILE__) + std::string("/output");
   std::ofstream logfile(logname.c_str());
-  deallog.attach(logfile);  
+  deallog.attach(logfile);
   deallog.depth_console(0);
   deallog << std::setprecision(3);
 
   test_select<2>(1.,1.);
   test_select<3>(1.,1.);
   test_select<4>(1.,1.);
-  
+
   test_select<2>(2.,3.);
   test_select<3>(2.,3.);
   test_select<4>(2.,3.);
index 48680a70e4a067c8d5e8bb2e3fdf543c58e1596a..21f1b43e1b0a585e86ebdb832653b43b6c963a52 100644 (file)
@@ -33,13 +33,13 @@ void check ()
   for (unsigned int i=0; i<S::n_independent_components; ++i)
     {
       deallog << i << "  --  "
-             << S::unrolled_to_component_indices (i)
-             << std::endl;
+              << S::unrolled_to_component_indices (i)
+              << std::endl;
       Assert (S::component_to_unrolled_index
-             (S::unrolled_to_component_indices (i))
-             ==
-             i,
-             ExcInternalError());
+              (S::unrolled_to_component_indices (i))
+              ==
+              i,
+              ExcInternalError());
     }
 }
 
index ce7c50103f64fe51595b2ddaf9bfd4e41de90188..e3ff1a5315e22afae4df6caabe4f7b3235d514df 100644 (file)
@@ -36,18 +36,18 @@ void check ()
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       for (unsigned int k=0; k<dim; ++k)
-       {
-         Assert (TableIndices<3>(i,j,k)
-                 ==
-                 T::unrolled_to_component_indices (i*dim*dim+j*dim+k),
-                 ExcInternalError());
-         Assert (T::component_to_unrolled_index(TableIndices<3>(i,j,k))
-                 ==
-                 i*dim*dim+j*dim+k,
-                 ExcInternalError());
-         Assert (t[TableIndices<3>(i,j,k)] == t[i][j][k],
-                 ExcInternalError());
-       }
+        {
+          Assert (TableIndices<3>(i,j,k)
+                  ==
+                  T::unrolled_to_component_indices (i*dim*dim+j*dim+k),
+                  ExcInternalError());
+          Assert (T::component_to_unrolled_index(TableIndices<3>(i,j,k))
+                  ==
+                  i*dim*dim+j*dim+k,
+                  ExcInternalError());
+          Assert (t[TableIndices<3>(i,j,k)] == t[i][j][k],
+                  ExcInternalError());
+        }
   deallog << "OK" << std::endl;
 }
 
index b4b489f8750eae13daa173640ebe84d999381633..af2521e2ad47ae3c4d509887c85934c1a4f85047 100644 (file)
@@ -35,19 +35,21 @@ int main ()
   deallog.threshold_double(1.e-10);
 
   double a_double[3][3][2] = {{{1,-1}, {2,0}, {3,0}},
-                             {{3,0}, {4,0}, {5,0}},
-                             {{6,0}, {7,0}, {8,3}}};
+    {{3,0}, {4,0}, {5,0}},
+    {{6,0}, {7,0}, {8,3}}
+  };
   double b_double[3][3][2] = {{{24,-2}, {31,-2}, {37,6}},
-                             {{45,-3}, {57,0},  {69,15}},
-                             {{75,12}, {96,21}, {108,48}}};
+    {{45,-3}, {57,0},  {69,15}},
+    {{75,12}, {96,21}, {108,48}}
+  };
 
   const unsigned int dim=3;
   std::complex<double> a[dim][dim], b[dim][dim];
   for (unsigned int d=0; d<dim; ++d)
     for (unsigned int e=0; e<dim; ++e)
       {
-       a[d][e] = std::complex<double>(a_double[d][e][0],a_double[d][e][1]);
-       b[d][e] = std::complex<double>(b_double[d][e][0],b_double[d][e][1]);
+        a[d][e] = std::complex<double>(a_double[d][e][0],a_double[d][e][1]);
+        b[d][e] = std::complex<double>(b_double[d][e][0],b_double[d][e][1]);
       }
 
   Tensor<2,dim,std::complex<double> > t(a);
@@ -58,11 +60,11 @@ int main ()
 
   Vector<std::complex<double> > unrolled(9);
 
-                               // cast result to double to profit from zero
-                               // threshold and so on
+  // cast result to double to profit from zero
+  // threshold and so on
   t.unroll(unrolled);
   deallog << "unrolled:";
-  for (unsigned i=0;i<9;i++)
+  for (unsigned i=0; i<9; i++)
     deallog << ' ' << unrolled(i);
   deallog << std::endl;
 
@@ -70,7 +72,7 @@ int main ()
   for (unsigned int i=0; i<dim; ++i)
     {
       for (unsigned int j=0; j<dim; ++j)
-       deallog << t[i][j] << ' ';
+        deallog << t[i][j] << ' ';
       deallog << std::endl;
     };
 
@@ -82,7 +84,7 @@ int main ()
   for (unsigned int i=0; i<dim; ++i)
     {
       for (unsigned int j=0; j<dim; ++j)
-       deallog << tt[i][j] << ' ';
+        deallog << tt[i][j] << ' ';
       deallog << std::endl;
     };
 
@@ -98,18 +100,18 @@ int main ()
       Tensor<1,3,std::complex<double> > result;
       cross_product(result,e1,e2);
       deallog << '\t' << result[0]
-             << '\t' << result[1]
-             << '\t' << result[2] << std::endl;
+              << '\t' << result[1]
+              << '\t' << result[2] << std::endl;
 
       cross_product(result,e2,e3);
       deallog << '\t' << result[0]
-             << '\t' << result[1] << '\t'
-             << result[2] << std::endl;
+              << '\t' << result[1] << '\t'
+              << result[2] << std::endl;
 
       cross_product(result,e3,e1);
       deallog << '\t' << result[0]
-             << '\t' << result[1]
-             << '\t' << result[2] << std::endl;
+              << '\t' << result[1]
+              << '\t' << result[2] << std::endl;
 
       deallog.pop();
     }
index 2202dc4e7a5de784b1c929dedbb75f6f4aee5044..c07415e724fce07a324f218f21a9bd9f39101c41 100644 (file)
@@ -44,11 +44,11 @@ int main ()
 
   Vector<float> unrolled(9);
 
-                               // cast result to double to profit from zero
-                               // threshold and so on
+  // cast result to double to profit from zero
+  // threshold and so on
   t.unroll(unrolled);
   deallog << "unrolled:";
-  for (unsigned i=0;i<9;i++)
+  for (unsigned i=0; i<9; i++)
     deallog << ' ' << static_cast<double>(unrolled(i));
   deallog << std::endl;
 
@@ -56,7 +56,7 @@ int main ()
   for (unsigned int i=0; i<dim; ++i)
     {
       for (unsigned int j=0; j<dim; ++j)
-       deallog << static_cast<double>(t[i][j]) << ' ';
+        deallog << static_cast<double>(t[i][j]) << ' ';
       deallog << std::endl;
     };
 
@@ -68,7 +68,7 @@ int main ()
   for (unsigned int i=0; i<dim; ++i)
     {
       for (unsigned int j=0; j<dim; ++j)
-       deallog << static_cast<double>(tt[i][j]) << ' ';
+        deallog << static_cast<double>(tt[i][j]) << ' ';
       deallog << std::endl;
     };
 
@@ -84,18 +84,18 @@ int main ()
       Tensor<1,3,float> result;
       cross_product(result,e1,e2);
       deallog << '\t' << static_cast<double>(result[0])
-             << '\t' << static_cast<double>(result[1])
-             << '\t' << static_cast<double>(result[2]) << std::endl;
+              << '\t' << static_cast<double>(result[1])
+              << '\t' << static_cast<double>(result[2]) << std::endl;
 
       cross_product(result,e2,e3);
       deallog << '\t' << static_cast<double>(result[0])
-             << '\t' << static_cast<double>(result[1]) << '\t'
-             << static_cast<double>(result[2]) << std::endl;
+              << '\t' << static_cast<double>(result[1]) << '\t'
+              << static_cast<double>(result[2]) << std::endl;
 
       cross_product(result,e3,e1);
       deallog << '\t' << static_cast<double>(result[0])
-             << '\t' << static_cast<double>(result[1])
-             << '\t' << static_cast<double>(result[2]) << std::endl;
+              << '\t' << static_cast<double>(result[1])
+              << '\t' << static_cast<double>(result[2]) << std::endl;
 
       deallog.pop();
     }
index 0cba0692477ee63e3c223b4a04c63e4650a5e8b4..82e3c039e5af811f38660f0a3f58e179af7a8d29 100644 (file)
 
 struct X
 {
-    X ()  { deallog << "Creating" << std::endl; };
-    ~X () { deallog << "Destroying " << std::endl; };
-    int i;
+  X ()
+  {
+    deallog << "Creating" << std::endl;
+  };
+  ~X ()
+  {
+    deallog << "Destroying " << std::endl;
+  };
+  int i;
 };
 
 Threads::ThreadLocalStorage<X> *tls_data;
@@ -40,60 +46,60 @@ void execute (int i)
 {
   tls_data->get().i = i;
 
-                                  // indicate that the TLS object has been
-                                  // accessed
+  // indicate that the TLS object has been
+  // accessed
   static Threads::Mutex m;
   {
     Threads::Mutex::ScopedLock l(m);
     ++counter;
   }
 
-                                  // wait in order to make sure that the
-                                  // thread lives longer than the TLS object
+  // wait in order to make sure that the
+  // thread lives longer than the TLS object
   sleep (5);
 }
 
 
-void test () 
+void test ()
 {
-                                  // create a thread local storage object
+  // create a thread local storage object
   tls_data = new Threads::ThreadLocalStorage<X>();
-  
-                                  // create 5 threads and wait for their
-                                  // return. the OS will create 5 individual
-                                  // thread ids, which means that we will
-                                  // create 5 individual thread specific
-                                  // storage locations
+
+  // create 5 threads and wait for their
+  // return. the OS will create 5 individual
+  // thread ids, which means that we will
+  // create 5 individual thread specific
+  // storage locations
   Threads::ThreadGroup<> tg;
   for (unsigned int i=10; i<15; ++i)
     tg += Threads::new_thread (execute, i);
 
-                                  // spin lock until all threads have created
-                                  // their objects
+  // spin lock until all threads have created
+  // their objects
   while (counter != 5);
-  
-                                  // delete the TLS object. this should also
-                                  // destroy all the objects created so far,
-                                  // namely 5 of them; while that happens, we
-                                  // should get output into logstream
+
+  // delete the TLS object. this should also
+  // destroy all the objects created so far,
+  // namely 5 of them; while that happens, we
+  // should get output into logstream
   delete tls_data;
 
-                                  // write something into the output
-                                  // file. this also makes sure that the
-                                  // output file records the order in which
-                                  // this output is generated and in which
-                                  // the TLS objects were destroyed. we want
-                                  // that these objects are destroyed when
-                                  // the TLS object is destroyed, not when
-                                  // the threads exit
+  // write something into the output
+  // file. this also makes sure that the
+  // output file records the order in which
+  // this output is generated and in which
+  // the TLS objects were destroyed. we want
+  // that these objects are destroyed when
+  // the TLS object is destroyed, not when
+  // the threads exit
   deallog << "Done." << std::endl;
 
-                                  // now make sure the threads all finish
+  // now make sure the threads all finish
   tg.join_all ();
 }
 
-  
-  
+
+
 
 int main()
 {
index 01ddb7d5affa9ad1ad806c2a8698be21e4547f6d..575b4858ad4e1a9055a030546c6ed2b877a4cdc6 100644 (file)
 
 struct X
 {
-    X ()  { Assert (false, ExcInternalError()); };
-    X (int n)  { deallog << "Creating" << std::endl;
-      Assert (n==42, ExcInternalError()); };
-    X (const X&)  { deallog << "Copying" << std::endl; };
-    ~X () { deallog << "Destroying " << std::endl; };
-    int i;
+  X ()
+  {
+    Assert (false, ExcInternalError());
+  };
+  X (int n)
+  {
+    deallog << "Creating" << std::endl;
+    Assert (n==42, ExcInternalError());
+  };
+  X (const X &)
+  {
+    deallog << "Copying" << std::endl;
+  };
+  ~X ()
+  {
+    deallog << "Destroying " << std::endl;
+  };
+  int i;
 };
 
 Threads::ThreadLocalStorage<X> *tls_data;
@@ -44,66 +56,66 @@ void execute (int i)
 {
   tls_data->get().i = i;
 
-                                  // indicate that the TLS object has been
-                                  // accessed
+  // indicate that the TLS object has been
+  // accessed
   static Threads::Mutex m;
   {
     Threads::Mutex::ScopedLock l(m);
     ++counter;
   }
 
-                                  // wait in order to make sure that the
-                                  // thread lives longer than the TLS object
+  // wait in order to make sure that the
+  // thread lives longer than the TLS object
   sleep (5);
 }
 
 
-void test () 
+void test ()
 {
-                                  // create a thread local storage object
+  // create a thread local storage object
   X exemplar(42);
   tls_data = new Threads::ThreadLocalStorage<X>(exemplar);
-  
-                                  // create 5 threads and wait for their
-                                  // return. the OS will create 5 individual
-                                  // thread ids, which means that we will
-                                  // create 5 individual thread specific
-                                  // storage locations
+
+  // create 5 threads and wait for their
+  // return. the OS will create 5 individual
+  // thread ids, which means that we will
+  // create 5 individual thread specific
+  // storage locations
   Threads::ThreadGroup<> tg;
   for (unsigned int i=10; i<15; ++i)
     tg += Threads::new_thread (execute, i);
 
-                                  // spin lock until all threads have created
-                                  // their objects
+  // spin lock until all threads have created
+  // their objects
   while (counter != 5);
-  
-                                  // delete the TLS object. this should also
-                                  // destroy all the objects created so far,
-                                  // namely 5 of them, plus the one copy the
-                                  // TLS object stores; while that happens,
-                                  // we should get output into logstream
+
+  // delete the TLS object. this should also
+  // destroy all the objects created so far,
+  // namely 5 of them, plus the one copy the
+  // TLS object stores; while that happens,
+  // we should get output into logstream
   delete tls_data;
 
-                                  // write something into the output
-                                  // file. this also makes sure that the
-                                  // output file records the order in which
-                                  // this output is generated and in which
-                                  // the TLS objects were destroyed. we want
-                                  // that these objects are destroyed when
-                                  // the TLS object is destroyed, not when
-                                  // the threads exit
+  // write something into the output
+  // file. this also makes sure that the
+  // output file records the order in which
+  // this output is generated and in which
+  // the TLS objects were destroyed. we want
+  // that these objects are destroyed when
+  // the TLS object is destroyed, not when
+  // the threads exit
   deallog << "Done." << std::endl;
 
-                                  // now make sure the threads all finish
+  // now make sure the threads all finish
   tg.join_all ();
 
-                                  // at this point, the seventh object will
-                                  // be destroyed, which is the exemplar
-                                  // object local to this function
+  // at this point, the seventh object will
+  // be destroyed, which is the exemplar
+  // object local to this function
 }
 
-  
-  
+
+
 
 int main()
 {
index 746aa42fcaaa9808bb39d0599d9ac3b036455d08..7433568261dc0f91b829393bfac650859718a780 100644 (file)
 
 struct X
 {
-    Threads::ThreadLocalStorage<int> tls_data;
-
-    X ()
-                   :
-                   tls_data (42)
-      {}
-
-    int f ()
-      {
-                                        // access TLS data and have it
-                                        // converted to the right data type
-                                        // without the need to call
-                                        // tls_data.get()
-       return tls_data;
-      }
+  Threads::ThreadLocalStorage<int> tls_data;
+
+  X ()
+    :
+    tls_data (42)
+  {}
+
+  int f ()
+  {
+    // access TLS data and have it
+    // converted to the right data type
+    // without the need to call
+    // tls_data.get()
+    return tls_data;
+  }
 };
 
 
@@ -52,7 +52,7 @@ void test ()
   t = Threads::new_thread (&X::f, x);
 
   Assert (t.return_value() == 42,
-         ExcInternalError());
+          ExcInternalError());
 }
 
 
index e3e27e80b31b6a75800b078fc40eceb85d5ed648..60863834c7fb02b30d9a899749b23a681bd8e007 100644 (file)
@@ -28,23 +28,23 @@ int counter = 10;
 
 struct X
 {
-    Threads::ThreadLocalStorage<int> tls_data;
-
-    X ()
-                   :
-                   tls_data (42)
-      {}
-
-    int f ()
-      {
-                                        // use TLS::operator=
-       tls_data = counter++;
-                                        // access TLS data and have it
-                                        // converted to the right data type
-                                        // without the need to call
-                                        // tls_data.get()
-       return tls_data;
-      }
+  Threads::ThreadLocalStorage<int> tls_data;
+
+  X ()
+    :
+    tls_data (42)
+  {}
+
+  int f ()
+  {
+    // use TLS::operator=
+    tls_data = counter++;
+    // access TLS data and have it
+    // converted to the right data type
+    // without the need to call
+    // tls_data.get()
+    return tls_data;
+  }
 };
 
 
@@ -55,13 +55,13 @@ void test ()
     Threads::Thread<int> t;
     t = Threads::new_thread (&X::f, x);
     Assert (t.return_value() == 10,
-           ExcInternalError());
+            ExcInternalError());
   }
   {
     Threads::Thread<int> t;
     t = Threads::new_thread (&X::f, x);
     Assert (t.return_value() == 11,
-           ExcInternalError());
+            ExcInternalError());
   }
 
   Assert (counter == 12, ExcInternalError());
index 6e10e0e284698f66ff663f38c3197507e35a3c7b..6ce1434ee178ebb93f644a14900d844af90345b4 100644 (file)
 
 struct X
 {
-    X(int i) : i(i) {}
-    int i;
-  private:
-    X(const X&);
-    X & operator= (const X&);
+  X(int i) : i(i) {}
+  int i;
+private:
+  X(const X &);
+  X &operator= (const X &);
 };
 
 
@@ -41,15 +41,15 @@ void execute (const X &x)
 }
 
 
-void test () 
+void test ()
 {
   X x(42);
   Threads::Thread<void> t = Threads::spawn (&execute)(x);
   t.join ();
 }
 
-  
-  
+
+
 
 int main()
 {
index e8327324906b06caddbb145f2411815f3d73b491..f0c89f103e29e1746eff6b3815ea3275ce526514 100644 (file)
 
 struct X
 {
-    X(int i) : i(i) {}
-    int i;
-  private:
-    X(const X&);
-    X & operator= (const X&);
+  X(int i) : i(i) {}
+  int i;
+private:
+  X(const X &);
+  X &operator= (const X &);
 };
 
 
 void execute (const X &x)
 {
-  Assert (x.i == 42, ExcInternalError());  
+  Assert (x.i == 42, ExcInternalError());
   deallog << "OK" << std::endl;
 }
 
 
-void test () 
+void test ()
 {
   const X x(42);
   Threads::Thread<void> t = Threads::spawn (&execute)(x);
   t.join ();
 }
 
-  
-  
+
+
 
 int main()
 {
index 93357d3d4f6c12334571d0ae57a378f84e848e05..1c27a502fa5888155827da192cc55338524f7051 100644 (file)
 
 struct X
 {
-    X(int i) : i(i) {}
-    int i;
-
-    void execute ()
-      {
-       Assert (i == 42, ExcInternalError());
-       deallog << "OK" << std::endl;
-      }
-    
-  private:
-    X(const X&);
-    X & operator= (const X&);
+  X(int i) : i(i) {}
+  int i;
+
+  void execute ()
+  {
+    Assert (i == 42, ExcInternalError());
+    deallog << "OK" << std::endl;
+  }
+
+private:
+  X(const X &);
+  X &operator= (const X &);
 };
 
 
 
 
-void test () 
+void test ()
 {
   X x(42);
   Threads::Thread<void> t = Threads::spawn (x, &X::execute)();
   t.join ();
 }
 
-  
-  
+
+
 
 int main()
 {
index a982a94828c2f6474950510b8aabb2e2bfa027e1..2b2d72e8ae0f81ee1c9f9bb8b91a3fc8b6e98ecf 100644 (file)
 
 struct X
 {
-    X(int i) : i(i) {}
-    int i;
-
-    void execute () const
-      {
-       Assert (i == 42, ExcInternalError());
-       deallog << "OK" << std::endl;
-      }
-    
-  private:
-    X(const X&);
-    X & operator= (const X&);
+  X(int i) : i(i) {}
+  int i;
+
+  void execute () const
+  {
+    Assert (i == 42, ExcInternalError());
+    deallog << "OK" << std::endl;
+  }
+
+private:
+  X(const X &);
+  X &operator= (const X &);
 };
 
 
 
 
-void test () 
+void test ()
 {
   const X x(42);
   Threads::Thread<void> t = Threads::spawn (x, &X::execute)();
   t.join ();
 }
 
-  
-  
+
+
 
 int main()
 {
index ea6b2e3fd9fa566e56145b2a05b098c1d38594e8..7746c2d89433d98619378ec3d6e3c46d7efd6132 100644 (file)
 
 struct X
 {
-    X(int i) : i(i) {}
-    int i;
-
-    void execute ()
-      {
-       Assert (false, ExcInternalError());
-      }
-
-    void execute () const
-      {
-       Assert (i == 42, ExcInternalError());
-       deallog << "OK" << std::endl;
-      }
-    
-  private:
-    X(const X&);
-    X & operator= (const X&);
+  X(int i) : i(i) {}
+  int i;
+
+  void execute ()
+  {
+    Assert (false, ExcInternalError());
+  }
+
+  void execute () const
+  {
+    Assert (i == 42, ExcInternalError());
+    deallog << "OK" << std::endl;
+  }
+
+private:
+  X(const X &);
+  X &operator= (const X &);
 };
 
 
-void test1 () 
+void test1 ()
 {
   const X x(42);
   Threads::Thread<void> t = Threads::spawn (x, &X::execute)();
@@ -59,35 +59,35 @@ void test1 ()
 
 struct Y
 {
-    Y(int i) : i(i) {}
-    int i;
-
-    void execute ()
-      {
-       Assert (i == 42, ExcInternalError());
-       deallog << "OK" << std::endl;
-      }
-
-    void execute () const
-      {
-       Assert (false, ExcInternalError());
-      }
-    
-  private:
-    Y(const Y&);
-    Y & operator= (const Y&);
+  Y(int i) : i(i) {}
+  int i;
+
+  void execute ()
+  {
+    Assert (i == 42, ExcInternalError());
+    deallog << "OK" << std::endl;
+  }
+
+  void execute () const
+  {
+    Assert (false, ExcInternalError());
+  }
+
+private:
+  Y(const Y &);
+  Y &operator= (const Y &);
 };
 
 
-void test2 () 
+void test2 ()
 {
   Y y(42);
   Threads::Thread<void> t = Threads::spawn (y, &Y::execute)();
   t.join ();
 }
 
-  
-  
+
+
 
 int main()
 {
index f4be50886f920b90ea39e6a94f959802a995eb80..9c3fc87e4f6422ec37d9b610eabf00144ca10898 100644 (file)
 
 struct X
 {
-    X() : i(0) {}
-    X(const X &x) : i(x.i+1) {}
-    X & operator= (const X &x) { i = x.i+1; return *this;}
-    int i;
+  X() : i(0) {}
+  X(const X &x) : i(x.i+1) {}
+  X &operator= (const X &x)
+  {
+    i = x.i+1;
+    return *this;
+  }
+  int i;
 };
 
 
@@ -49,12 +53,12 @@ void execute_value (X x)
 {
   Assert (x.i > 0, ExcInternalError());
   deallog << __PRETTY_FUNCTION__ << ' ' << (x.i>0 ? "OK" : "not OK")
-         << std::endl;
+          << std::endl;
   deallog << "OK" << std::endl;
 }
 
 
-void test () 
+void test ()
 {
   {
     X x;
@@ -68,8 +72,8 @@ void test ()
   }
 }
 
-  
-  
+
+
 
 int main()
 {
index 4dbf617e02eda4c2e9b6958b679d36b7a24e4682..da1e9180f111b1496be0918696c990fbd40a7ef0 100644 (file)
@@ -35,16 +35,16 @@ void worker ()
 
 Threads::Thread<> worker_thread;
 
-void waiter (int i) 
+void waiter (int i)
 {
   worker_thread.join ();
-  
+
   deallog << "Waiting thread " << i << " was woken up."
-         << std::endl;
+          << std::endl;
 }
 
-  
-  
+
+
 
 int main()
 {
index ffe57760133a5e1998467eb20d0523d94d1eeb83..e69ef0c4ec0a3bb29327d04a0af05ccdc0a9a1b4 100644 (file)
@@ -36,7 +36,7 @@ void worker ()
   spin_lock = 1;
 }
 
-  
+
 
 int main()
 {
@@ -46,32 +46,32 @@ int main()
   deallog.threshold_double(1.e-10);
 
   mutex.acquire ();
-                                  // start and abandon the
-                                  // thread. because we hold the
-                                  // lock, the started task can not
-                                  // proceed to print out "OK" until
-                                  // we release the lock which we do
-                                  // only after some time to give the
-                                  // thread a way to start up
-                                  //
-                                  // if detachment from threads isn't
-                                  // possible, then the worker()
-                                  // function will hang because it
-                                  // won't be able to acquire the
-                                  // mutex
+  // start and abandon the
+  // thread. because we hold the
+  // lock, the started task can not
+  // proceed to print out "OK" until
+  // we release the lock which we do
+  // only after some time to give the
+  // thread a way to start up
+  //
+  // if detachment from threads isn't
+  // possible, then the worker()
+  // function will hang because it
+  // won't be able to acquire the
+  // mutex
   {
     Threads::new_thread (worker);
   }
   sleep (1);
 
-                                  // let abandoned thread continue
+  // let abandoned thread continue
   mutex.release ();
 
-                                  // wait for thread to finish
+  // wait for thread to finish
   while (spin_lock == 0)
     ;
 
-                                  // release the lock that the thread
-                                  // acquired to avoid pthread errors
+  // release the lock that the thread
+  // acquired to avoid pthread errors
   mutex.release ();
 }
index ddd3cb6e5c10fe80d00c0b664dd222b367674376..0f832207bb591392c9281351d5e1d7c574425530 100644 (file)
@@ -46,15 +46,15 @@ int main()
   deallog.threshold_double(1.e-10);
 
   Threads::Thread<int> t;
-                                  // join non-existing thread
+  // join non-existing thread
   deallog << (t.valid() ? "true" : "false")
-         << std::endl;
+          << std::endl;
 
-                                  // now assign a thread object and
-                                  // wait for it
+  // now assign a thread object and
+  // wait for it
   t = Threads::new_thread (worker);
   deallog << (t.valid() ? "true" : "false")
-         << std::endl;
+          << std::endl;
   deallog << "return value = " << t.return_value()
-         << std::endl;
+          << std::endl;
 }
index f454d7f807f2633f9bf1885b887bedb7738f4cb0..0f03cb2de99dc9c6e8aadb70b7e653605700dd27 100644 (file)
@@ -30,18 +30,18 @@ void execute ()
 {}
 
 
-void test () 
+void test ()
 {
   Threads::Thread<> t = Threads::spawn (&execute)();
   deallog << "Before first join()" << std::endl;
   t.join ();
   deallog << "Between join()s" << std::endl;
   t.join ();
-  deallog << "After second join()" << std::endl;  
+  deallog << "After second join()" << std::endl;
 }
 
-  
-  
+
+
 
 int main()
 {
index 0ca1b30d21e09bf1af772a700297d00d917460e2..c202c64139043f8e0c31739db967ee6ab3361059 100644 (file)
@@ -28,19 +28,19 @@ void execute ()
 {}
 
 
-void test () 
+void test ()
 {
-                                  // use a default constructed object
+  // use a default constructed object
   Threads::Thread<> t;
   deallog << "Before first join()" << std::endl;
   t.join ();
   deallog << "Between join()s" << std::endl;
   t.join ();
-  deallog << "After second join()" << std::endl;  
+  deallog << "After second join()" << std::endl;
 }
 
-  
-  
+
+
 
 int main()
 {
index 75396a88654076f378643cb3c2cb7ded3166dd33..5b375eae63a4fb8e063b803d94d727427648a2fc 100644 (file)
@@ -31,11 +31,13 @@ void compare (double t1, double t2, double ratio)
   double r = t2/t1;
   double d = std::fabs(r-ratio) / ratio;
 
-                                  // relative error < 15%?
+  // relative error < 15%?
   if (d <= .15)
     {
       deallog << "OK" << std::endl;
-    } else {
+    }
+  else
+    {
       deallog << "Ratio " << r << " should be " << ratio << std::endl;
     }
 }
@@ -48,9 +50,9 @@ void burn (unsigned int n)
   for (unsigned int i=0 ; i<n ; ++i)
     {
       for (unsigned int j=1 ; j<100000 ; ++j)
-       {
-         s += 1./j * i;
-       }
+        {
+          s += 1./j * i;
+        }
     }
 }
 
index b6f165df5aa7eed1d4883c6ee625d55b052a7e87..e54aed5575fd7ab7015a1eb1d2309bd48c891fa2 100644 (file)
@@ -36,13 +36,13 @@ int main ()
   deallog.threshold_double(1.e-10);
 
   {
-    
-  TimerOutput t(logfile, TimerOutput::summary, TimerOutput::cpu_times);
 
-  t.enter_subsection("hi");
-  t.leave_subsection("hi");
+    TimerOutput t(logfile, TimerOutput::summary, TimerOutput::cpu_times);
+
+    t.enter_subsection("hi");
+    t.leave_subsection("hi");
   }
-  
+
   deallog << "ok" << std::endl;
 }
 
index 4fab703ad9b6789d459b40e1feb6d117995c34d2..45b2f039714e6905dac52f270f9f4bbfe4e32952 100644 (file)
@@ -26,7 +26,7 @@
 #include <deal.II/base/utilities.h>
 
 
-void test () 
+void test ()
 {
   deallog << Utilities::int_to_string (42,4) << std::endl;
   deallog << Utilities::int_to_string (42) << std::endl;
@@ -47,19 +47,19 @@ void test ()
     Assert (Utilities::split_string_list (p).size() == 3,
             ExcInternalError());
     Assert (Utilities::split_string_list (p)[0] == "alpha",
-            ExcInternalError());  
+            ExcInternalError());
     Assert (Utilities::split_string_list (p)[1] == "beta",
             ExcInternalError());
     Assert (Utilities::split_string_list (p)[2] == "gamma",
             ExcInternalError());
   }
-  
+
   {
     const char *p = "alpha; beta; gamma ";
     Assert (Utilities::split_string_list (p, ';').size() == 3,
             ExcInternalError());
     Assert (Utilities::split_string_list (p, ';')[0] == "alpha",
-            ExcInternalError());  
+            ExcInternalError());
     Assert (Utilities::split_string_list (p, ';')[1] == "beta",
             ExcInternalError());
     Assert (Utilities::split_string_list (p, ';')[2] == "gamma",
@@ -72,8 +72,8 @@ void test ()
   deallog << std::endl;
 }
 
-  
-  
+
+
 
 int main()
 {
index b1633f703d8d34478614938805eccc5bca072141..ce9711b769ac87bc7d318a3bc892459d4aee57b3 100644 (file)
@@ -27,7 +27,7 @@
 
 
 template <int dim>
-void test () 
+void test ()
 {
   deallog << Utilities::fixed_power<dim> (2) << std::endl;
   deallog << Utilities::fixed_power<dim> (-2) << std::endl;
@@ -36,8 +36,8 @@ void test ()
   deallog << std::endl;
 }
 
-  
-  
+
+
 
 int main()
 {
index 7a4d417e86fb8200fa9475700d7e5c4a69823276..837e0b3e1394f765ae90c27cf3b838cc378014e8 100644 (file)
@@ -33,7 +33,7 @@ std::vector<std::string> split_string(const std::string &text, const char delim=
   std::vector<std::string> result;
   std::string word;
   std::stringstream stream(text);
-  while( getline(stream, word, delim) )
+  while ( getline(stream, word, delim) )
     result.push_back(word);
 
   return result;
@@ -41,9 +41,9 @@ std::vector<std::string> split_string(const std::string &text, const char delim=
 
 
 void test_function(const std::string &original_text,
-                  const unsigned int width,
-                  const char delimiter,
-                  const std::string &result)
+                   const unsigned int width,
+                   const char delimiter,
+                   const std::string &result)
 {
   std::vector<std::string> res_vec
     = Utilities::break_text_into_lines (original_text, width, delimiter);
@@ -53,10 +53,10 @@ void test_function(const std::string &original_text,
 
 
   Assert(res_vec.size()==should_be_vec.size(), ExcInternalError());
-  for (unsigned int i=0;i<res_vec.size();++i)
+  for (unsigned int i=0; i<res_vec.size(); ++i)
     {
       if (res_vec[i]!=should_be_vec[i])
-       std::cout << "'" << res_vec[i] << "!=" << should_be_vec[i] << "'" << std::endl;
+        std::cout << "'" << res_vec[i] << "!=" << should_be_vec[i] << "'" << std::endl;
       Assert(res_vec[i]==should_be_vec[i], ExcInternalError());
     }
 
index 71595cec4c85799d12c62f8fba3756b503d8673f..785289a37ee009725cdaba66e3f15fc4919c5619 100644 (file)
@@ -40,17 +40,17 @@ void test ()
       s << "test test" << number << "test test";
 
       Assert (Utilities::get_integer_at_position (s.str(),
-                                                 9).first
-             == number,
-             ExcInternalError());
+                                                  9).first
+              == number,
+              ExcInternalError());
       Assert (Utilities::get_integer_at_position (s.str(),
-                                                 9).second
-             == i+1,
-             ExcInternalError());
+                                                  9).second
+              == i+1,
+              ExcInternalError());
 
       deallog << i << ' ' << Utilities::get_integer_at_position (s.str(),
-                                                                9).first
-             << std::endl;
+                                                                 9).first
+              << std::endl;
 
       number = number*10 + i;
     }
index 742be0c2d0e9d8f4edb6bd8594d252cd1f291f91..080ba67ced99ef0e9ac6c350a714704209dbc1e2 100644 (file)
@@ -66,7 +66,7 @@ void test ()
     deallog << a[i] << " ";
   deallog << std::endl;
 
-                               // check setting elements for large vectors
+  // check setting elements for large vectors
   a.resize (0);
   a.resize (100000, 1);
   deallog << "Check large initialization: ";
@@ -74,7 +74,7 @@ void test ()
     AssertDimension (a[i], 1);
   deallog << "OK" << std::endl;
 
-                               // check resize for large vectors
+  // check resize for large vectors
   deallog << "Check large resize: ";
   a.resize (200000, 2);
   a.resize (400000);
index d4c91908233590b83f246a1c18cd8c4675d9d8a3..b15663c5c29f26e60cd51d34f6d2e3684bc0e614 100644 (file)
@@ -49,7 +49,7 @@ void test ()
   b.push_back (make_vectorized_array(27.));
   a.insert_back (b.begin(), b.end());
 
-                               // keep reference in sync
+  // keep reference in sync
   b_ref = a_ref;
   b_ref.push_back (27);
   a_ref.insert (a_ref.end(), b_ref.begin(), b_ref.end());
@@ -82,7 +82,7 @@ void test ()
       Assert (a[i][d] == a_ref[i], ExcInternalError());
   deallog << "OK" << std::endl;
 
-                               // check setting elements for large vectors
+  // check setting elements for large vectors
   a.resize (0);
   a.resize (100000, make_vectorized_array(1.));
   deallog << "Check large initialization: ";
@@ -91,7 +91,7 @@ void test ()
       Assert (a[i][d] == 1., ExcInternalError());
   deallog << "OK" << std::endl;
 
-                               // check resize for large vectors
+  // check resize for large vectors
   deallog << "Check large resize: ";
   a.resize (200000, make_vectorized_array(2.));
   a.resize (400000);
index 22e63912aaacdd2695687345d05584d5032301e5..22876ad78080086de83b5eae610ba168742967f2 100644 (file)
@@ -33,7 +33,7 @@ void print_vec (VECVEC &v)
     {
       deallog << "[";
       for (unsigned int j=0; j<v[i].size(); ++j)
-       deallog << v[i][j] << " ";
+        deallog << v[i][j] << " ";
       deallog << "]";
     }
   deallog << std::endl;
index a6a0046e4ec89d9aa3071993115cb867bcd5f81c..1359e1962a34ad3e9b7f2a52fa8844a220ca4293 100644 (file)
@@ -41,107 +41,107 @@ void test ()
   for (unsigned int i=0; i<n_vectors; ++i)
     Assert (d[i] == 1, ExcInternalError());
   deallog << "OK" << std::endl
-         << "Subtraction: ";
+          << "Subtraction: ";
   VectorizedArray<Number> e = d - b;
   for (unsigned int i=0; i<n_vectors; ++i)
     Assert (e[i] == a[i], ExcInternalError());
   deallog << "OK" << std::endl
-         << "Multiplication: ";
+          << "Multiplication: ";
   d = a * c;
   for (unsigned int i=0; i<n_vectors; ++i)
     Assert (d[i] == a[i] * c[i], ExcInternalError());
   deallog << "OK" << std::endl
-         << "Division: ";
+          << "Division: ";
   e = d / a;
   for (unsigned int i=0; i<n_vectors; ++i)
     Assert (e[i] == c[i], ExcInternalError());
   deallog << "OK" << std::endl
-         << "Multiplication scalar: ";
+          << "Multiplication scalar: ";
   a = 2. * a;
   for (unsigned int i=0; i<n_vectors; ++i)
-    Assert (a[i] == 4., ExcInternalError()); 
+    Assert (a[i] == 4., ExcInternalError());
   deallog << "OK" << std::endl
-         << "Division scalar left: ";
+          << "Division scalar left: ";
   d = 1. / a;
   for (unsigned int i=0; i<n_vectors; ++i)
     Assert (d[i] == 0.25, ExcInternalError());
   deallog << "OK" << std::endl
-         << "Division scalar right: ";
+          << "Division scalar right: ";
   e = d / 0.25;
   for (unsigned int i=0; i<n_vectors; ++i)
     Assert (e[i] == 1, ExcInternalError());
   deallog << "OK" << std::endl
-         << "Unary operator -: ";
+          << "Unary operator -: ";
   d = -c;
   for (unsigned int i=0; i<n_vectors; ++i)
     Assert (d[i] == -(Number)i, ExcInternalError());
   deallog << "OK" << std::endl
-         << "Unary operator +: ";
+          << "Unary operator +: ";
   d = c;
   for (unsigned int i=0; i<n_vectors; ++i)
     Assert (d[i] == i, ExcInternalError());
 
 
   deallog << "OK" << std::endl
-         << "Square root: ";
+          << "Square root: ";
   d = std::sqrt(c);
   for (unsigned int i=0; i<n_vectors; ++i)
     Assert (std::fabs(d[i]-std::sqrt(Number(i)))<
-           std::numeric_limits<Number>::epsilon(),
-           ExcInternalError());
+            std::numeric_limits<Number>::epsilon(),
+            ExcInternalError());
 
   deallog << "OK" << std::endl
-         << "Absolute value: ";
+          << "Absolute value: ";
   d = -c;
   d = std::abs(d);
   for (unsigned int i=0; i<n_vectors; ++i)
     Assert (d[i] == Number(i), ExcInternalError());
   deallog << "OK" << std::endl
-         << "Maximum value: ";
+          << "Maximum value: ";
   d = std::max(a, c);
   for (unsigned int i=0; i<n_vectors; ++i)
     Assert (d[i] == std::max(a[i], c[i]), ExcInternalError());
   deallog << "OK" << std::endl
-         << "Minimum value: ";
+          << "Minimum value: ";
   d = std::min(0.5 * a + b, c);
   for (unsigned int i=0; i<n_vectors; ++i)
     Assert (d[i] == std::min(Number(0.5 * a[i] + b[i]), c[i]), ExcInternalError());
 
   deallog << "OK" << std::endl
-         << "Sine: ";
+          << "Sine: ";
   e = std::sin(b);
   for (unsigned int i=0; i<n_vectors; ++i)
     Assert (std::fabs(e[i]-std::sin(b[i])) <
-           10.*std::numeric_limits<Number>::epsilon(),
-           ExcInternalError());
+            10.*std::numeric_limits<Number>::epsilon(),
+            ExcInternalError());
   deallog << "OK" << std::endl
-         << "Cosine: ";
+          << "Cosine: ";
   e = std::cos(c);
   for (unsigned int i=0; i<n_vectors; ++i)
     Assert (std::fabs(e[i]-std::cos(c[i])) <
-           10.*std::numeric_limits<Number>::epsilon(),
-           ExcInternalError());
+            10.*std::numeric_limits<Number>::epsilon(),
+            ExcInternalError());
   deallog << "OK" << std::endl
-         << "Tangent: ";
+          << "Tangent: ";
   d = std::tan(e);
   for (unsigned int i=0; i<n_vectors; ++i)
     Assert (std::fabs(d[i]-std::tan(e[i])) <
-           10.*std::numeric_limits<Number>::epsilon(),
-           ExcInternalError());
+            10.*std::numeric_limits<Number>::epsilon(),
+            ExcInternalError());
   deallog << "OK" << std::endl
-         << "Exponential: ";
+          << "Exponential: ";
   d = std::exp(c-a);
   for (unsigned int i=0; i<n_vectors; ++i)
     Assert (std::fabs(d[i]-std::exp(c[i]-a[i])) <
-           10.*std::numeric_limits<Number>::epsilon(),
-           ExcInternalError());
+            10.*std::numeric_limits<Number>::epsilon(),
+            ExcInternalError());
   deallog << "OK" << std::endl
-         << "Logarithm: ";
+          << "Logarithm: ";
   e = std::log(d);
   for (unsigned int i=0; i<n_vectors; ++i)
     Assert (std::fabs(e[i]-(c[i]-a[i])) <
-           10.*std::numeric_limits<Number>::epsilon(),
-           ExcInternalError());
+            10.*std::numeric_limits<Number>::epsilon(),
+            ExcInternalError());
   deallog << "OK" << std::endl;
 }
 
@@ -162,9 +162,9 @@ int main()
   test<float> ();
   deallog.pop();
 
-                               // test long double: in that case, the default
-                               // path of VectorizedArray is taken no matter
-                               // what was done for double or float
+  // test long double: in that case, the default
+  // path of VectorizedArray is taken no matter
+  // what was done for double or float
   deallog.push("long double");
   test<float> ();
   deallog.pop();
index 1d650889583804572c9c0acf46967997aae4f229..2ac20ab9fd6a3a8fd88ed74ba0f6a5e62603a7c2 100644 (file)
@@ -32,40 +32,40 @@ struct ScratchData
 
 struct CopyData
 {
-    unsigned int computed;
+  unsigned int computed;
 };
 
 
 struct X
 {
-    void worker (const std::vector<unsigned int>::iterator &i,
-                ScratchData &,
-                CopyData &ad)
-      {
-       ad.computed = *i * 2;
-      }
-
-    void copier (const CopyData &ad)
-      {
-       deallog << ad.computed << std::endl;
-      }
+  void worker (const std::vector<unsigned int>::iterator &i,
+               ScratchData &,
+               CopyData &ad)
+  {
+    ad.computed = *i * 2;
+  }
+
+  void copier (const CopyData &ad)
+  {
+    deallog << ad.computed << std::endl;
+  }
 };
 
 
-void test () 
+void test ()
 {
   std::vector<unsigned int> v;
   for (unsigned int i=0; i<20; ++i)
     v.push_back (i);
-  
+
   X x;
   WorkStream::run (v.begin(), v.end(), x, &X::worker, &X::copier,
-                  ScratchData(),
-                  CopyData());
+                   ScratchData(),
+                   CopyData());
 }
 
-  
-  
+
+
 
 int main()
 {
index 6209d428833fceb3a298cf8f33e95a0f65aa179e..54bcd752ae419cf1e043122cda55d91924dc5ca6 100644 (file)
@@ -32,13 +32,13 @@ struct ScratchData
 
 struct CopyData
 {
-    unsigned int computed;
+  unsigned int computed;
 };
 
 
 void worker (const std::vector<unsigned int>::iterator &i,
-            ScratchData &,
-            CopyData &ad)
+             ScratchData &,
+             CopyData &ad)
 {
   ad.computed = *i * 2;
 }
@@ -49,19 +49,19 @@ void copier (const CopyData &ad)
 }
 
 
-void test () 
+void test ()
 {
   std::vector<unsigned int> v;
   for (unsigned int i=0; i<20; ++i)
     v.push_back (i);
-  
+
   WorkStream::run (v.begin(), v.end(), &worker, &copier,
-                  ScratchData(),
-                  CopyData());
+                   ScratchData(),
+                   CopyData());
 }
 
-  
-  
+
+
 
 int main()
 {
index 7dc97e1bc75944cc3406fc756786570ad6f5b7eb..70760f9502b3c3949f556387860a731d4fc629e0 100644 (file)
 char logname[] = "work_stream_03/output";
 
 template<int dim>
-  double
-  value(const Point<dim> &p)
-  {
-    double val = 0;
-    for (unsigned int d = 0; d < dim; ++d)
-      for (unsigned int i = 0; i <= 1; ++i)
-        val += std::pow(p[d], 1. * i);
-    return val;
-  }
+double
+value(const Point<dim> &p)
+{
+  double val = 0;
+  for (unsigned int d = 0; d < dim; ++d)
+    for (unsigned int i = 0; i <= 1; ++i)
+      val += std::pow(p[d], 1. * i);
+  return val;
+}
 
 namespace
 {
   template<int dim>
-    struct Scratch
+  struct Scratch
+  {
+    Scratch(const FiniteElement<dim> &fe, const Quadrature<dim> &quadrature) :
+      fe_collection(fe), quadrature_collection(quadrature), x_fe_values(
+        fe_collection, quadrature_collection, update_q_points), rhs_values(
+          quadrature_collection.size())
     {
-      Scratch(const FiniteElement<dim> &fe, const Quadrature<dim> &quadrature) :
-          fe_collection(fe), quadrature_collection(quadrature), x_fe_values(
-              fe_collection, quadrature_collection, update_q_points), rhs_values(
-              quadrature_collection.size())
-      {
-      }
+    }
 
-      Scratch(const Scratch &data) :
-          fe_collection(data.fe_collection), quadrature_collection(
-              data.quadrature_collection), x_fe_values(fe_collection,
-              quadrature_collection, update_q_points), rhs_values(
-              data.rhs_values)
-      {
-      }
+    Scratch(const Scratch &data) :
+      fe_collection(data.fe_collection), quadrature_collection(
+        data.quadrature_collection), x_fe_values(fe_collection,
+                                                 quadrature_collection, update_q_points), rhs_values(
+                                                   data.rhs_values)
+    {
+    }
 
-      const FiniteElement<dim> &fe_collection;
-      const Quadrature<dim> &quadrature_collection;
+    const FiniteElement<dim> &fe_collection;
+    const Quadrature<dim> &quadrature_collection;
 
-      FEValues<dim> x_fe_values;
+    FEValues<dim> x_fe_values;
 
-      std::vector<double> rhs_values;
-    };
+    std::vector<double> rhs_values;
+  };
 
   struct CopyData
   {
@@ -87,7 +87,7 @@ namespace
 
 void
 zero_subrange(const unsigned int begin, const unsigned int end,
-    std::vector<double> &dst)
+              std::vector<double> &dst)
 {
   for (unsigned int i = begin; i < end; ++i)
     dst[i] = 0;
@@ -96,7 +96,7 @@ zero_subrange(const unsigned int begin, const unsigned int end,
 
 void
 zero_element(std::vector<double> &dst,
-            const unsigned int i)
+             const unsigned int i)
 {
   dst[i] = 0;
 }
@@ -104,24 +104,24 @@ zero_element(std::vector<double> &dst,
 
 template<int dim>
 void
-  mass_assembler(const typename Triangulation<dim>::active_cell_iterator &cell,
-      Scratch<dim> &data, CopyData &copy_data)
-  {
-    data.x_fe_values.reinit(cell);
+mass_assembler(const typename Triangulation<dim>::active_cell_iterator &cell,
+               Scratch<dim> &data, CopyData &copy_data)
+{
+  data.x_fe_values.reinit(cell);
 
-    const Point<dim> q = data.x_fe_values.quadrature_point(0);
+  const Point<dim> q = data.x_fe_values.quadrature_point(0);
 
-    // this appears to be the key: the following two ways both overwrite some
-    // of the memory in which we store the quadrature point location.
-    parallel::apply_to_subranges(0U, copy_data.cell_rhs.size(),
-        std_cxx1x::bind(&zero_subrange, std_cxx1x::_1, std_cxx1x::_2,
-            std_cxx1x::ref(copy_data.cell_rhs)), 1);
+  // this appears to be the key: the following two ways both overwrite some
+  // of the memory in which we store the quadrature point location.
+  parallel::apply_to_subranges(0U, copy_data.cell_rhs.size(),
+                               std_cxx1x::bind(&zero_subrange, std_cxx1x::_1, std_cxx1x::_2,
+                                               std_cxx1x::ref(copy_data.cell_rhs)), 1);
 
-    Assert(q == data.x_fe_values.quadrature_point(0),
-        ExcInternalError());
+  Assert(q == data.x_fe_values.quadrature_point(0),
+         ExcInternalError());
 
-    copy_data.cell_rhs[0] = value(data.x_fe_values.quadrature_point(0));
-  }
+  copy_data.cell_rhs[0] = value(data.x_fe_values.quadrature_point(0));
+}
 
 
 void
@@ -152,9 +152,9 @@ do_project()
       CopyData copy_data;
       copy_data.cell_rhs.resize(8);
       WorkStream::run(triangulation.begin_active(), triangulation.end(),
-          &mass_assembler<dim>,
-          std_cxx1x::bind(&copy_local_to_global, std_cxx1x::_1, &sum),
-          assembler_data, copy_data, 8, 1);
+                      &mass_assembler<dim>,
+                      std_cxx1x::bind(&copy_local_to_global, std_cxx1x::_1, &sum),
+                      assembler_data, copy_data, 8, 1);
 
       Assert (std::fabs(sum-288.) < 1e-12, ExcInternalError());
       deallog << sum << std::endl;
index 988d4707764a906c6acfbd59cfb9cc0633dea234..03e2c0e06b73cf93fd3e460ff74f46ae6b0336b7 100644 (file)
 
 using namespace std;
 
-int main(int argc, char *argv[]) {
-
-       ifstream input;
-       stringstream ss;
-       const int IGNORE_LINES = 3; //Number of initial lines to ignore
-       const string DELIM = "*"; //String to divide test data
-
-       input.open("temp.txt");
-
-       vector<string> names;
-       vector<double> times;
-       
-       //If no revision number, retrieve column names 
-       if(argc <= 1)
-       {
-               string curr_line;
-       
-               //Ignore first n lines + delimeter- they don't hold any useful data
-               for(int i = 0; i < IGNORE_LINES + 1; i++)
-               {
-                       getline(input, curr_line);
-               }
-       
-               while(!input.eof()) {
-                       
-                       getline(input, curr_line);
-                       if(curr_line == "")
-                               continue;
-                       if(curr_line == DELIM)
-                               break;
-               
-                       ////cout << "curr line: " << curr_line << endl;
-                       //Looking for the string after the '|' and ' '
-                       int first_char = 0;
-                       if(curr_line[0] == '|')
-                               first_char++;
-                       if (curr_line[1] == ' ')
-                               first_char++;
-
-                       
-                       ////cout << "first char at pos: " << first_char << endl;
-                       
-                       //Find end of string
-                       int num_chars = 0;
-                       while(curr_line[first_char + num_chars] != '|')
-                               num_chars++;
-
-                       num_chars--;
-                       
-                       while(curr_line[first_char + num_chars] == ' ')
-                         num_chars--;
-                       
-                       names.push_back(curr_line.substr(first_char, num_chars+1));
-               }
-       }
-
-       else //Else, extract execution time from each line 
-       {
-               
-               int time_index = 0;
-               
-               while(!input.eof())
-               {
-               
-                       string curr_line = "";
-       
-                       //Read in line
-                       getline(input,curr_line);
-
-                       //Check for delimeter
-                       if(curr_line == DELIM)
-                       {
-                               ////cout << "Delimeter detected" << endl;
-                               time_index = 0;
-                               //Ignore first n lines- they don't hold any useful data
-                               for(int i = 0; i < IGNORE_LINES; i++)
-                               {
-                                       string dummy;
-                                       getline(input, dummy);
-                                       ////cout << "Skipping: " << dummy << endl;
-                               }
-                               continue;
-                       }
-                       
-                       ////cout << "Reading: " << curr_line << endl;
-
-                       if(curr_line == "" && DELIM != "")
-                               continue;
-
-
-                       //Looking for a number that ends with 's'
-                       int last_s = curr_line.rfind('s');
-                       //In case 's' is not used in the future
-                       assert(isdigit(curr_line[last_s - 1])); // Test: s preceded by number
-                       
-                       //Find time string and convert to double
-                       int num_start = last_s - 1;
-                               while(curr_line[num_start] != ' ')
-                               num_start--;
-                       string timestr = curr_line.substr(num_start+1, last_s - num_start);
-                       double time = (double)atof(timestr.substr(0,timestr.size()-1).c_str());
-                       
-                       assert(times.size() >= time_index);
-                       // first addition of times to vector; each loop, times.size() should be one less than time_index        
-                       if(times.size() == time_index) 
-                               times.push_back(time);
-                       else
-                               times[time_index] = (time < times[time_index]) ? time : times[time_index]; //else, determines minimum time and stores it
-                       time_index++;
-
-               }
-       }
-
-
-       //Output individual names
-       if(argc <= 1) {
-               for(int i = 0; i < names.size(); i++) {
-                       cout << names[i];
-                       if(i < names.size() - 1)
-                               cout << endl;
-               }
-       }
-
-       //Output individual times
-       if(argc > 1) {
-               cout << argv[1]; 
-               for(int i = 0; i < times.size(); i++)
-                       cout << " " << times[i];
-       }
-
-       cout << endl;
-
-       
-       return 0;
+int main(int argc, char *argv[])
+{
+
+  ifstream input;
+  stringstream ss;
+  const int IGNORE_LINES = 3; //Number of initial lines to ignore
+  const string DELIM = "*"; //String to divide test data
+
+  input.open("temp.txt");
+
+  vector<string> names;
+  vector<double> times;
+
+  //If no revision number, retrieve column names
+  if (argc <= 1)
+    {
+      string curr_line;
+
+      //Ignore first n lines + delimeter- they don't hold any useful data
+      for (int i = 0; i < IGNORE_LINES + 1; i++)
+        {
+          getline(input, curr_line);
+        }
+
+      while (!input.eof())
+        {
+
+          getline(input, curr_line);
+          if (curr_line == "")
+            continue;
+          if (curr_line == DELIM)
+            break;
+
+          ////cout << "curr line: " << curr_line << endl;
+          //Looking for the string after the '|' and ' '
+          int first_char = 0;
+          if (curr_line[0] == '|')
+            first_char++;
+          if (curr_line[1] == ' ')
+            first_char++;
+
+
+          ////cout << "first char at pos: " << first_char << endl;
+
+          //Find end of string
+          int num_chars = 0;
+          while (curr_line[first_char + num_chars] != '|')
+            num_chars++;
+
+          num_chars--;
+
+          while (curr_line[first_char + num_chars] == ' ')
+            num_chars--;
+
+          names.push_back(curr_line.substr(first_char, num_chars+1));
+        }
+    }
+
+  else //Else, extract execution time from each line
+    {
+
+      int time_index = 0;
+
+      while (!input.eof())
+        {
+
+          string curr_line = "";
+
+          //Read in line
+          getline(input,curr_line);
+
+          //Check for delimeter
+          if (curr_line == DELIM)
+            {
+              ////cout << "Delimeter detected" << endl;
+              time_index = 0;
+              //Ignore first n lines- they don't hold any useful data
+              for (int i = 0; i < IGNORE_LINES; i++)
+                {
+                  string dummy;
+                  getline(input, dummy);
+                  ////cout << "Skipping: " << dummy << endl;
+                }
+              continue;
+            }
+
+          ////cout << "Reading: " << curr_line << endl;
+
+          if (curr_line == "" && DELIM != "")
+            continue;
+
+
+          //Looking for a number that ends with 's'
+          int last_s = curr_line.rfind('s');
+          //In case 's' is not used in the future
+          assert(isdigit(curr_line[last_s - 1])); // Test: s preceded by number
+
+          //Find time string and convert to double
+          int num_start = last_s - 1;
+          while (curr_line[num_start] != ' ')
+            num_start--;
+          string timestr = curr_line.substr(num_start+1, last_s - num_start);
+          double time = (double)atof(timestr.substr(0,timestr.size()-1).c_str());
+
+          assert(times.size() >= time_index);
+          // first addition of times to vector; each loop, times.size() should be one less than time_index
+          if (times.size() == time_index)
+            times.push_back(time);
+          else
+            times[time_index] = (time < times[time_index]) ? time : times[time_index]; //else, determines minimum time and stores it
+          time_index++;
+
+        }
+    }
+
+
+  //Output individual names
+  if (argc <= 1)
+    {
+      for (int i = 0; i < names.size(); i++)
+        {
+          cout << names[i];
+          if (i < names.size() - 1)
+            cout << endl;
+        }
+    }
+
+  //Output individual times
+  if (argc > 1)
+    {
+      cout << argv[1];
+      for (int i = 0; i < times.size(); i++)
+        cout << " " << times[i];
+    }
+
+  cout << endl;
+
+
+  return 0;
 }
index fcc503f3823de98093ce3b8a5633d61fee484523..03c9f4472ab7ce847ab12f27a2040c8ea82762d6 100644 (file)
@@ -42,29 +42,29 @@ int main()
       deallog << "size = " << nx << "  dim = " << dim << std::endl;
 
       start = clock();
-      for (unsigned int i=0;i<ITER;i++)
-       {
-         u.reinit(dim);
-         v.reinit(dim);
-       }
+      for (unsigned int i=0; i<ITER; i++)
+        {
+          u.reinit(dim);
+          v.reinit(dim);
+        }
       diff = clock()-start;
       deallog << "reinit: " << double(diff)/(2*ITER) << std::endl;
 
       start = clock();
-      for (unsigned int i=0;i<ITER;i++)
-       {
-         u = (double) i;
-       }
+      for (unsigned int i=0; i<ITER; i++)
+        {
+          u = (double) i;
+        }
       diff = clock()-start;
       deallog << "operator=(double): " << double(diff)/ITER << std::endl;
 
       QuickMatrix<double> A(nx,nx);
 
       start = clock();
-      for (unsigned int i=0;i<ITER;i++)
-       {
-         A.vmult(v,u);
-       }
+      for (unsigned int i=0; i<ITER; i++)
+        {
+          A.vmult(v,u);
+        }
       diff = clock()-start;
       deallog << "vmult: " << double(diff)/ITER << std::endl;
     }
index 68c70cc96040c3b4c61a2be83c360e3518721767..cbd8018e5af973485711404cc9236c33741abff5 100644 (file)
@@ -33,7 +33,7 @@ using namespace dealii;
 
 // Fill dof handlers for different elements and see how large they get.
 template <class DOF>
-void check_dofs(DOFdof)
+void check_dofs(DOF &dof)
 {
   FE_Q<DOF::dimension> q1(1);
   FE_Q<DOF::dimension> q3(3);
@@ -42,28 +42,28 @@ void check_dofs(DOF& dof)
 
   dof.distribute_dofs(q1);
   deallog << "Dofs Q1   " << std::setw(12) << dof.n_dofs()
-         << " memory " << std::setw(12) << dof.memory_consumption()
-         << " quotient " << (1./dof.n_dofs()*dof.memory_consumption())
-         << std::endl;
-  
+          << " memory " << std::setw(12) << dof.memory_consumption()
+          << " quotient " << (1./dof.n_dofs()*dof.memory_consumption())
+          << std::endl;
+
   dof.distribute_dofs(q3);
   deallog << "Dofs Q3   " << std::setw(12) << dof.n_dofs()
-         << " memory " << std::setw(12) << dof.memory_consumption()
-         << " quotient " << (1./dof.n_dofs()*dof.memory_consumption())
-         << std::endl;
-  
+          << " memory " << std::setw(12) << dof.memory_consumption()
+          << " quotient " << (1./dof.n_dofs()*dof.memory_consumption())
+          << std::endl;
+
   dof.distribute_dofs(sys1);
   deallog << "Dofs Sys1 " << std::setw(12) << dof.n_dofs()
-         << " memory " << std::setw(12) << dof.memory_consumption()
-         << " quotient " << (1./dof.n_dofs()*dof.memory_consumption())
-         << std::endl;
-  
+          << " memory " << std::setw(12) << dof.memory_consumption()
+          << " quotient " << (1./dof.n_dofs()*dof.memory_consumption())
+          << std::endl;
+
   dof.distribute_dofs(sys2);
   deallog << "Dofs Sys2 " << std::setw(12) << dof.n_dofs()
-         << " memory " << std::setw(12) << dof.memory_consumption()
-         << " quotient " << (1./dof.n_dofs()*dof.memory_consumption())
-         << std::endl;
-  
+          << " memory " << std::setw(12) << dof.memory_consumption()
+          << " quotient " << (1./dof.n_dofs()*dof.memory_consumption())
+          << std::endl;
+
   dof.clear();
 }
 
@@ -76,21 +76,21 @@ void check (bool local)
   GridGenerator::hyper_cube(tr);
 
   if (local)
-    for (unsigned int i=0;i<99/dim;++i)
+    for (unsigned int i=0; i<99/dim; ++i)
       {
-       tr.last_active()->set_refine_flag();
-       tr.execute_coarsening_and_refinement();
+        tr.last_active()->set_refine_flag();
+        tr.execute_coarsening_and_refinement();
       }
   else
     tr.refine_global(18/dim);
-  
+
   deallog << "Levels " << tr.n_levels() << "Cells "<< tr.n_cells()
-         << std::endl
-         << " active " << std::setw(12)  << tr.n_active_cells()
-         << " memory " << std::setw(12)  << tr.memory_consumption()
-         << " quotient " << (1./tr.n_cells()*tr.memory_consumption())
-         << std::endl;
-  
+          << std::endl
+          << " active " << std::setw(12)  << tr.n_active_cells()
+          << " memory " << std::setw(12)  << tr.memory_consumption()
+          << " quotient " << (1./tr.n_cells()*tr.memory_consumption())
+          << std::endl;
+
   FE_Q<dim> q1(1);
   FE_Q<dim> q3(3);
   FESystem<dim> sys1(q3, 1);
@@ -113,7 +113,7 @@ int main()
   check<2>(true);
   check<3>(true);
   deallog.pop();
-  deallog.push("global");  
+  deallog.push("global");
   check<2>(false);
   check<3>(false);
   deallog.pop();
index 04dbdccf7d1a0b7e0f1649242045a4db1b66232e..9c284962640968893713326aaf5ce8aaf70e00a3 100644 (file)
 using namespace dealii;
 
 template <int dim>
-void indices (const DoFHandler<dim>dof, unsigned int repeat)
+void indices (const DoFHandler<dim> &dof, unsigned int repeat)
 {
   typedef typename DoFHandler<dim>::active_cell_iterator I;
-  
+
   std::vector<unsigned int> dofs(dof.get_fe().dofs_per_cell);
   const I end = dof.end();
 
-  for (unsigned int k=0;k<repeat;++k)
-    for (I i=dof.begin_active(); i!=end;++i)
+  for (unsigned int k=0; k<repeat; ++k)
+    for (I i=dof.begin_active(); i!=end; ++i)
       i->get_dof_indices(dofs);
 }
 
 
 template <int dim>
-void fevalues (const DoFHandler<dim>dof,
-              UpdateFlags updates)
+void fevalues (const DoFHandler<dim> &dof,
+               UpdateFlags updates)
 {
   typedef typename DoFHandler<dim>::active_cell_iterator I;
   const I end = dof.end();
-  
+
   QGauss<dim> quadrature(5);
   MappingQ1<dim> mapping;
   FEValues<dim> fe(mapping, dof.get_fe(), quadrature, updates);
-  
-  for (I i=dof.begin_active(); i!=end;++i)
+
+  for (I i=dof.begin_active(); i!=end; ++i)
     fe.reinit(i);
 }
 
 
 template <int dim>
-void fefacevalues (const DoFHandler<dim>dof,
-                  UpdateFlags updates)
+void fefacevalues (const DoFHandler<dim> &dof,
+                   UpdateFlags updates)
 {
   typedef typename DoFHandler<dim>::active_cell_iterator I;
   const I end = dof.end();
-  
+
   QGauss<dim-1> quadrature(5);
   MappingQ1<dim> mapping;
   FEFaceValues<dim> fe(mapping, dof.get_fe(), quadrature, updates);
-  
-  for (I i=dof.begin_active(); i!=end;++i)
-    for (unsigned int f=0;f<GeometryInfo<dim>::faces_per_cell;++f)
+
+  for (I i=dof.begin_active(); i!=end; ++i)
+    for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
       fe.reinit(i, f);
 }
 
 
 template <int dim>
-void check_mapping (const DoFHandler<dim>dof)
+void check_mapping (const DoFHandler<dim> &dof)
 {
   deallog.push("cell");
   fevalues(dof,  update_q_points);
@@ -98,7 +98,7 @@ void check_mapping (const DoFHandler<dim>& dof)
   fevalues(dof,  update_q_points | update_JxW_values);
   deallog << "qpoints|JxW" << std::endl;
   deallog.pop();
-  
+
   deallog.push("face");
   fefacevalues(dof,  update_quadrature_points);
   deallog << "qpoints" << std::endl;
@@ -109,12 +109,12 @@ void check_mapping (const DoFHandler<dim>& dof)
   fefacevalues(dof,  update_q_points | update_JxW_values | update_normal_vectors);
   deallog << "qpoints|JxW|normals" << std::endl;
   deallog.pop();
-  
+
 }
 
 
 template <int dim>
-void check_values (const DoFHandler<dim>dof)
+void check_values (const DoFHandler<dim> &dof)
 {
   indices(dof, 100);
   deallog << "Index*100" << std::endl;
@@ -126,13 +126,13 @@ void check_values (const DoFHandler<dim>& dof)
   fevalues(dof,  update_values | update_JxW_values);
   deallog << "values|JxW" << std::endl;
   fevalues(dof,  update_values | update_gradients
-          | update_q_points | update_JxW_values);
+           | update_q_points | update_JxW_values);
   deallog << "values|gradients|qpoints|JxW" << std::endl;
 //  fevalues(dof,  update_values | update_gradients | update_second_derivatives
-//        | update_q_points | update_JxW_values);
+//     | update_q_points | update_JxW_values);
 //  deallog << "values|gradients|2nds|qpoints|JxW" << std::endl;
   deallog.pop();
-  
+
   deallog.push("face");
   fefacevalues(dof,  update_values);
   deallog << "values" << std::endl;
@@ -141,12 +141,12 @@ void check_values (const DoFHandler<dim>& dof)
   fefacevalues(dof,  update_values | update_JxW_values);
   deallog << "values|JxW" << std::endl;
   fefacevalues(dof,  update_values | update_gradients
-              | update_q_points | update_JxW_values | update_normal_vectors);
+               | update_q_points | update_JxW_values | update_normal_vectors);
   deallog << "values|gradients|qpoints|JxW|normals" << std::endl;
 //  fefacevalues(dof,  update_values | update_gradients | update_second_derivatives
-//        | update_q_points | update_JxW_values);
+//     | update_q_points | update_JxW_values);
 //  deallog << "values|gradients|2nds|qpoints|JxW" << std::endl;
-  deallog.pop();  
+  deallog.pop();
 }
 
 
@@ -157,8 +157,8 @@ void check_q ()
   Triangulation<dim> tr;
   GridGenerator::hyper_cube(tr);
   tr.refine_global(REF/dim);
-  
-  for (unsigned int i=1;i<5;++i)
+
+  for (unsigned int i=1; i<5; ++i)
     {
       FE_Q<dim> q(i);
       deallog.push(q.get_name());
@@ -166,9 +166,9 @@ void check_q ()
       DoFHandler<dim> dof(tr);
       dof.distribute_dofs(q);
       deallog << "Dofs " << dof.n_dofs() << std::endl;
-      
+
       if (i==1)
-       check_mapping(dof);
+        check_mapping(dof);
       check_values(dof);
       deallog.pop();
     }
@@ -185,7 +185,7 @@ void check_sys ()
 
   FE_Q<dim> q(1);
 
-  for (unsigned int i=1;i<5;++i)
+  for (unsigned int i=1; i<5; ++i)
     {
       FESystem<dim> fe(q,1<<i);
       deallog.push(fe.get_name());
@@ -193,9 +193,9 @@ void check_sys ()
       DoFHandler<dim> dof(tr);
       dof.distribute_dofs(fe);
       deallog << "Dofs " << dof.n_dofs() << std::endl;
-      
+
       if (i==1)
-       check_mapping(dof);
+        check_mapping(dof);
       check_values(dof);
       deallog.pop();
     }
index 9a29a14d3f6bdab5e95fae57890013d9665adeb7..47f4070d628b7e1c89b7b563004e95da7834c323 100644 (file)
@@ -33,27 +33,27 @@ using namespace dealii;
 
 // Fill dof handlers for different elements and see how large they get.
 template <class DOF>
-void check_dofs(DOFdof, unsigned int repeat)
+void check_dofs(DOF &dof, unsigned int repeat)
 {
   FE_Q<DOF::dimension> q1(1);
-  
+
   deallog << "Start" << std::endl;
-  for (unsigned int i=1;i<6;++i)
+  for (unsigned int i=1; i<6; ++i)
     {
       FE_Q<DOF::dimension> fe(i);
-      for (unsigned int i=0;i<repeat;++i)
-       dof.distribute_dofs(fe);
+      for (unsigned int i=0; i<repeat; ++i)
+        dof.distribute_dofs(fe);
       deallog << dof.get_fe().get_name() << '*' << repeat
-             << " memory " << dof.memory_consumption()/1.e6 << std::endl;
+              << " memory " << dof.memory_consumption()/1.e6 << std::endl;
     }
-  
-  for (unsigned int i=1;i<6;++i)
+
+  for (unsigned int i=1; i<6; ++i)
     {
       FESystem<DOF::dimension> fe(q1, 1 << i);
-      for (unsigned int i=0;i<repeat;++i)
-       dof.distribute_dofs(fe);
+      for (unsigned int i=0; i<repeat; ++i)
+        dof.distribute_dofs(fe);
       deallog << dof.get_fe().get_name()
-             << " memory " << dof.memory_consumption()/1.e6 << std::endl;
+              << " memory " << dof.memory_consumption()/1.e6 << std::endl;
     }
   dof.clear();
 }
@@ -67,20 +67,20 @@ void check (bool local)
   GridGenerator::hyper_cube(tr);
 
   if (local)
-    for (unsigned int i=0;i<1800/dim;++i)
+    for (unsigned int i=0; i<1800/dim; ++i)
       {
-       tr.last_active()->set_refine_flag();
-       tr.execute_coarsening_and_refinement();
+        tr.last_active()->set_refine_flag();
+        tr.execute_coarsening_and_refinement();
       }
   else
     tr.refine_global(21/dim);
-  
+
   deallog << "Levels " << tr.n_levels() << " Cells "<< tr.n_cells()
-         << std::endl
-         << "active " << tr.n_active_cells()
-         << " memory " << tr.memory_consumption()/1.e6
-         << std::endl;
-  
+          << std::endl
+          << "active " << tr.n_active_cells()
+          << " memory " << tr.memory_consumption()/1.e6
+          << std::endl;
+
   deallog.push("DoF");
   DoFHandler<dim> dof(tr);
   check_dofs(dof, (local ? 100 : 10));
index da19885f5e4a1afec33b81ec7d1f82d056be1240..e56604d028c7000f71fde24b3037974f90d9f36b 100644 (file)
 
 
 template <int dim>
-void performance (Triangulation<dim>tr,
-                 const Mapping<dim>& mapping,
-                 const FiniteElement<dim>& fe,
-                 const Quadrature<dim>& quadrature,
-                 UpdateFlags flags)
+void performance (Triangulation<dim> &tr,
+                  const Mapping<dim> &mapping,
+                  const FiniteElement<dim> &fe,
+                  const Quadrature<dim> &quadrature,
+                  UpdateFlags flags)
 {
   deallog << "Create dofs" << std::endl;
   DoFHandler<dim> dof (tr);
   dof.distribute_dofs (fe);
 
   deallog << "Create FEValues" << std::endl;
-  
+
   FEValues<dim> val (mapping, fe, quadrature, flags);
 
   DoFHandler<dim>::active_cell_iterator cell = dof.begin_active();
   DoFHandler<dim>::active_cell_iterator end = dof.end();
 
   deallog << "Loop" << std::endl;
-  
-  for (;cell != end ; ++cell)
+
+  for (; cell != end ; ++cell)
     val.reinit(cell);
 
   deallog << "End" << std::endl;
@@ -63,53 +63,53 @@ void performance (Triangulation<dim>& tr,
 
 template <int dim>
 void loop (std::vector<FiniteElement<dim> *> elements,
-           const Mapping<dim>mapping,
-           Triangulation<dim>tr)
+           const Mapping<dim> &mapping,
+           Triangulation<dim> &tr)
 {
   QGauss<dim> gauss (4);
-  
+
   typename std::vector<FiniteElement<dim> *>::iterator elementp = elements.begin ();
   typename std::vector<FiniteElement<dim> *>::iterator end = elements.end ();
 
-  for (;elementp != end; ++elementp)
+  for (; elementp != end; ++elementp)
     {
-      const FiniteElement<dim>element = **elementp;
+      const FiniteElement<dim> &element = **elementp;
 
       char dofs[20];
       std::ostrstream ost (dofs, 19);
       ost << element.n_dofs_per_cell() << std::ends;
-      
+
       deallog.push(dofs);
-      
+
       deallog.push("points");
       performance (tr, mapping, element, gauss, update_q_points);
       deallog.pop();
-  
+
       deallog.push("values");
       performance (tr, mapping, element, gauss, update_values);
       deallog.pop();
-  
+
       deallog.push("grads-");
       performance (tr, mapping, element, gauss, update_gradients);
       deallog.pop();
-  
+
       deallog.push("2nd---");
       performance (tr, mapping, element, gauss, update_second_derivatives);
       deallog.pop();
-  
+
       deallog.push("matrix");
       performance (tr, mapping, element, gauss, update_q_points
-                  | update_JxW_values
-                  | update_values
-                  | update_gradients);
+                   | update_JxW_values
+                   | update_values
+                   | update_gradients);
       deallog.pop();
 
       deallog.push("all---");
       performance (tr, mapping, element, gauss, update_q_points
-                  | update_JxW_values
-                  | update_values
-                  | update_gradients
-                  | update_second_derivatives);
+                   | update_JxW_values
+                   | update_values
+                   | update_gradients
+                   | update_second_derivatives);
       deallog.pop();
       deallog.pop();
     }
@@ -124,7 +124,7 @@ int main ()
   Triangulation<2> tr;
   GridGenerator::hyper_ball (tr);
   tr.refine_global (8);
-  
+
   MappingCartesian<2> cartesian;
   MappingQ1<2> mapping;
   MappingQ<2> mappingq1(1);
index bc214912498161240fa160efd1f64cb7fe6b4d1a..e827739fc63e5267543495f48c048624434586df 100644 (file)
@@ -77,73 +77,73 @@ unsigned int n_steps = 0;
  */
 unsigned int step;
 
-                                /**
                                * Declare the coefficient in front
                                * of the Laplace operator of the
                                * equation.
                                */
+/**
+ * Declare the coefficient in front
+ * of the Laplace operator of the
+ * equation.
+ */
 template <int dim>
 class LaplaceCoefficient : public Function<dim>
 {
-  public:
-    virtual double value (const Point<dim> &p,
-                         const unsigned int) const
-      {
-       return 1.+p*p;
-      }
+public:
+  virtual double value (const Point<dim> &p,
+                        const unsigned int) const
+  {
+    return 1.+p*p;
+  }
 };
 
 
-                                /**
                                * Same for the coefficient in front
                                * of the mass term.
                                */
+/**
+ * Same for the coefficient in front
+ * of the mass term.
+ */
 template <int dim>
 class MassCoefficient : public Function<dim>
 {
-  public:
-    virtual double value (const Point<dim> &p,
-                         const unsigned int) const
-      {
-       double factor = 1;
-       for (unsigned int d=0; d<dim; ++d)
-         factor *= std::sin(4*p(d));
-       return 1.+factor/2;
-      }
+public:
+  virtual double value (const Point<dim> &p,
+                        const unsigned int) const
+  {
+    double factor = 1;
+    for (unsigned int d=0; d<dim; ++d)
+      factor *= std::sin(4*p(d));
+    return 1.+factor/2;
+  }
 };
 
 
 
-                                // @sect3{Evaluating the solution}
+// @sect3{Evaluating the solution}
 
-                                // As mentioned in the introduction,
-                                // significant parts of the program
-                                // have simply been taken over from
-                                // the step-13 example program. We
-                                // therefore only comment on those
-                                // things that are new.
-                                //
-                                // First, the framework for
-                                // evaluation of solutions is
-                                // unchanged, i.e. the base class is
-                                // the same, and the class to
-                                // evaluate the solution at a grid
-                                // point is unchanged:
+// As mentioned in the introduction,
+// significant parts of the program
+// have simply been taken over from
+// the step-13 example program. We
+// therefore only comment on those
+// things that are new.
+//
+// First, the framework for
+// evaluation of solutions is
+// unchanged, i.e. the base class is
+// the same, and the class to
+// evaluate the solution at a grid
+// point is unchanged:
 namespace Evaluation
 {
-                                  // @sect4{The EvaluationBase class}
+  // @sect4{The EvaluationBase class}
   template <int dim>
   class EvaluationBase
   {
-    public:
-      virtual ~EvaluationBase ();
+  public:
+    virtual ~EvaluationBase ();
 
-      void set_refinement_cycle (const unsigned int refinement_cycle);
+    void set_refinement_cycle (const unsigned int refinement_cycle);
 
-      virtual void operator () (const DoFHandler<dim> &dof_handler,
-                               const Vector<double>  &solution) const = 0;
+    virtual void operator () (const DoFHandler<dim> &dof_handler,
+                              const Vector<double>  &solution) const = 0;
 
-      unsigned int refinement_cycle;
+    unsigned int refinement_cycle;
   };
 
 
@@ -161,30 +161,30 @@ namespace Evaluation
   }
 
 
-                                  // @sect4{The PointValueEvaluation class}
+  // @sect4{The PointValueEvaluation class}
   template <int dim>
   class PointValueEvaluation : public EvaluationBase<dim>
   {
-    public:
-      PointValueEvaluation (const Point<dim>   &evaluation_point);
+  public:
+    PointValueEvaluation (const Point<dim>   &evaluation_point);
 
-      virtual void operator () (const DoFHandler<dim> &dof_handler,
-                               const Vector<double>  &solution) const;
+    virtual void operator () (const DoFHandler<dim> &dof_handler,
+                              const Vector<double>  &solution) const;
 
-      DeclException1 (ExcEvaluationPointNotFound,
-                     Point<dim>,
-                     << "The evaluation point " << arg1
-                     << " was not found among the vertices of the present grid.");
+    DeclException1 (ExcEvaluationPointNotFound,
+                    Point<dim>,
+                    << "The evaluation point " << arg1
+                    << " was not found among the vertices of the present grid.");
 
-      const Point<dim>  evaluation_point;
+    const Point<dim>  evaluation_point;
   };
 
 
   template <int dim>
   PointValueEvaluation<dim>::
   PointValueEvaluation (const Point<dim>   &evaluation_point)
-                 :
-                 evaluation_point (evaluation_point)
+    :
+    evaluation_point (evaluation_point)
   {}
 
 
@@ -193,298 +193,298 @@ namespace Evaluation
   void
   PointValueEvaluation<dim>::
   operator () (const DoFHandler<dim> &dof_handler,
-              const Vector<double>  &solution) const
+               const Vector<double>  &solution) const
   {
     double point_value = 1e20;
 
     typename DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     bool evaluation_point_found = false;
     for (; (cell!=endc) && !evaluation_point_found; ++cell)
       for (unsigned int vertex=0;
-          vertex<GeometryInfo<dim>::vertices_per_cell;
-          ++vertex)
-       if (cell->vertex(vertex).distance (evaluation_point)
-           <
-           cell->diameter() * 1e-8)
-         {
-           point_value = solution(cell->vertex_dof_index(vertex,0));
-
-           evaluation_point_found = true;
-           break;
-         };
+           vertex<GeometryInfo<dim>::vertices_per_cell;
+           ++vertex)
+        if (cell->vertex(vertex).distance (evaluation_point)
+            <
+            cell->diameter() * 1e-8)
+          {
+            point_value = solution(cell->vertex_dof_index(vertex,0));
+
+            evaluation_point_found = true;
+            break;
+          };
 
     AssertThrow (evaluation_point_found,
-                ExcEvaluationPointNotFound(evaluation_point));
+                 ExcEvaluationPointNotFound(evaluation_point));
 
     std::cout << "   Point value=" << point_value
-             << std::endl;
+              << std::endl;
   }
 
 
-                                  // @sect4{The PointXDerivativeEvaluation class}
-
-                                  // Besides the class implementing
-                                  // the evaluation of the solution
-                                  // at one point, we here provide
-                                  // one which evaluates the gradient
-                                  // at a grid point. Since in
-                                  // general the gradient of a finite
-                                  // element function is not
-                                  // continuous at a vertex, we have
-                                  // to be a little bit more careful
-                                  // here. What we do is to loop over
-                                  // all cells, even if we have found
-                                  // the point already on one cell,
-                                  // and use the mean value of the
-                                  // gradient at the vertex taken
-                                  // from all adjacent cells.
-                                  //
-                                  // Given the interface of the
-                                  // ``PointValueEvaluation'' class,
-                                  // the declaration of this class
-                                  // provides little surprise, and
-                                  // neither does the constructor:
+  // @sect4{The PointXDerivativeEvaluation class}
+
+  // Besides the class implementing
+  // the evaluation of the solution
+  // at one point, we here provide
+  // one which evaluates the gradient
+  // at a grid point. Since in
+  // general the gradient of a finite
+  // element function is not
+  // continuous at a vertex, we have
+  // to be a little bit more careful
+  // here. What we do is to loop over
+  // all cells, even if we have found
+  // the point already on one cell,
+  // and use the mean value of the
+  // gradient at the vertex taken
+  // from all adjacent cells.
+  //
+  // Given the interface of the
+  // ``PointValueEvaluation'' class,
+  // the declaration of this class
+  // provides little surprise, and
+  // neither does the constructor:
   template <int dim>
   class PointXDerivativeEvaluation : public EvaluationBase<dim>
   {
-    public:
-      PointXDerivativeEvaluation (const Point<dim>   &evaluation_point);
+  public:
+    PointXDerivativeEvaluation (const Point<dim>   &evaluation_point);
 
-      virtual void operator () (const DoFHandler<dim> &dof_handler,
-                               const Vector<double>  &solution) const;
+    virtual void operator () (const DoFHandler<dim> &dof_handler,
+                              const Vector<double>  &solution) const;
 
-      DeclException1 (ExcEvaluationPointNotFound,
-                     Point<dim>,
-                     << "The evaluation point " << arg1
-                     << " was not found among the vertices of the present grid.");
+    DeclException1 (ExcEvaluationPointNotFound,
+                    Point<dim>,
+                    << "The evaluation point " << arg1
+                    << " was not found among the vertices of the present grid.");
 
-      const Point<dim>  evaluation_point;
+    const Point<dim>  evaluation_point;
   };
 
 
   template <int dim>
   PointXDerivativeEvaluation<dim>::
   PointXDerivativeEvaluation (const Point<dim>   &evaluation_point)
-                 :
-                 evaluation_point (evaluation_point)
+    :
+    evaluation_point (evaluation_point)
   {}
 
 
-                                  // The more interesting things
-                                  // happen inside the function doing
-                                  // the actual evaluation:
+  // The more interesting things
+  // happen inside the function doing
+  // the actual evaluation:
   template <int dim>
   void
   PointXDerivativeEvaluation<dim>::
   operator () (const DoFHandler<dim> &dof_handler,
-              const Vector<double>  &solution) const
+               const Vector<double>  &solution) const
   {
-                                    // This time initialize the
-                                    // return value with something
-                                    // useful, since we will have to
-                                    // add up a number of
-                                    // contributions and take the
-                                    // mean value afterwards...
+    // This time initialize the
+    // return value with something
+    // useful, since we will have to
+    // add up a number of
+    // contributions and take the
+    // mean value afterwards...
     double point_derivative = 0;
 
-                                    // ...then have some objects of
-                                    // which the meaning wil become
-                                    // clear below...
+    // ...then have some objects of
+    // which the meaning wil become
+    // clear below...
     QTrapez<dim>  vertex_quadrature;
     MappingQ<dim> mapping (4);
     FEValues<dim> fe_values (mapping, dof_handler.get_fe(),
-                            vertex_quadrature,
-                            update_gradients | update_q_points);
+                             vertex_quadrature,
+                             update_gradients | update_q_points);
     std::vector<Tensor<1,dim> >
-      solution_gradients (vertex_quadrature.n_quadrature_points);
+    solution_gradients (vertex_quadrature.n_quadrature_points);
 
-                                    // ...and next loop over all cells
-                                    // and their vertices, and count
-                                    // how often the vertex has been
-                                    // found:
+    // ...and next loop over all cells
+    // and their vertices, and count
+    // how often the vertex has been
+    // found:
     typename DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     unsigned int evaluation_point_hits = 0;
     for (; cell!=endc; ++cell)
       for (unsigned int vertex=0;
-          vertex<GeometryInfo<dim>::vertices_per_cell;
-          ++vertex)
-       if (cell->vertex(vertex) == evaluation_point)
-         {
-                                            // Things are now no more
-                                            // as simple, since we
-                                            // can't get the gradient
-                                            // of the finite element
-                                            // field as before, where
-                                            // we simply had to pick
-                                            // one degree of freedom
-                                            // at a vertex.
-                                            //
-                                            // Rather, we have to
-                                            // evaluate the finite
-                                            // element field on this
-                                            // cell, and at a certain
-                                            // point. As you know,
-                                            // evaluating finite
-                                            // element fields at
-                                            // certain points is done
-                                            // through the
-                                            // ``FEValues'' class, so
-                                            // we use that. The
-                                            // question is: the
-                                            // ``FEValues'' object
-                                            // needs to be a given a
-                                            // quadrature formula and
-                                            // can then compute the
-                                            // values of finite
-                                            // element quantities at
-                                            // the quadrature
-                                            // points. Here, we don't
-                                            // want to do quadrature,
-                                            // we simply want to
-                                            // specify some points!
-                                            //
-                                            // Nevertheless, the same
-                                            // way is chosen: use a
-                                            // special quadrature
-                                            // rule with points at
-                                            // the vertices, since
-                                            // these are what we are
-                                            // interested in. The
-                                            // appropriate rule is
-                                            // the trapezoidal rule,
-                                            // so that is the reason
-                                            // why we used that one
-                                            // above.
-                                            //
-                                            // Thus: initialize the
-                                            // ``FEValues'' object on
-                                            // this cell,
-           fe_values.reinit (cell);
-                                            // and extract the
-                                            // gradients of the
-                                            // solution vector at the
-                                            // vertices:
-           fe_values.get_function_grads (solution,
-                                         solution_gradients);
-
-                                            // Now we have the
-                                            // gradients at all
-                                            // vertices, so pick out
-                                            // that one which belongs
-                                            // to the evaluation
-                                            // point (note that the
-                                            // order of vertices is
-                                            // not necessarily the
-                                            // same as that of the
-                                            // quadrature points):
-           unsigned int q_point = 0;
-           for (; q_point<solution_gradients.size(); ++q_point)
-             if (fe_values.quadrature_point(q_point) ==
-                 evaluation_point)
-               break;
-
-                                            // Check that the
-                                            // evaluation point was
-                                            // indeed found,
-           Assert (q_point < solution_gradients.size(),
-                   ExcInternalError());
-                                            // and if so take the
-                                            // x-derivative of the
-                                            // gradient there as the
-                                            // value which we are
-                                            // interested in, and
-                                            // increase the counter
-                                            // indicating how often
-                                            // we have added to that
-                                            // variable:
-           point_derivative += solution_gradients[q_point][0];
-           ++evaluation_point_hits;
-
-                                            // Finally break out of
-                                            // the innermost loop
-                                            // iterating over the
-                                            // vertices of the
-                                            // present cell, since if
-                                            // we have found the
-                                            // evaluation point at
-                                            // one vertex it cannot
-                                            // be at a following
-                                            // vertex as well:
-           break;
-         };
-
-                                    // Now we have looped over all
-                                    // cells and vertices, so check
-                                    // whether the point was found:
+           vertex<GeometryInfo<dim>::vertices_per_cell;
+           ++vertex)
+        if (cell->vertex(vertex) == evaluation_point)
+          {
+            // Things are now no more
+            // as simple, since we
+            // can't get the gradient
+            // of the finite element
+            // field as before, where
+            // we simply had to pick
+            // one degree of freedom
+            // at a vertex.
+            //
+            // Rather, we have to
+            // evaluate the finite
+            // element field on this
+            // cell, and at a certain
+            // point. As you know,
+            // evaluating finite
+            // element fields at
+            // certain points is done
+            // through the
+            // ``FEValues'' class, so
+            // we use that. The
+            // question is: the
+            // ``FEValues'' object
+            // needs to be a given a
+            // quadrature formula and
+            // can then compute the
+            // values of finite
+            // element quantities at
+            // the quadrature
+            // points. Here, we don't
+            // want to do quadrature,
+            // we simply want to
+            // specify some points!
+            //
+            // Nevertheless, the same
+            // way is chosen: use a
+            // special quadrature
+            // rule with points at
+            // the vertices, since
+            // these are what we are
+            // interested in. The
+            // appropriate rule is
+            // the trapezoidal rule,
+            // so that is the reason
+            // why we used that one
+            // above.
+            //
+            // Thus: initialize the
+            // ``FEValues'' object on
+            // this cell,
+            fe_values.reinit (cell);
+            // and extract the
+            // gradients of the
+            // solution vector at the
+            // vertices:
+            fe_values.get_function_grads (solution,
+                                          solution_gradients);
+
+            // Now we have the
+            // gradients at all
+            // vertices, so pick out
+            // that one which belongs
+            // to the evaluation
+            // point (note that the
+            // order of vertices is
+            // not necessarily the
+            // same as that of the
+            // quadrature points):
+            unsigned int q_point = 0;
+            for (; q_point<solution_gradients.size(); ++q_point)
+              if (fe_values.quadrature_point(q_point) ==
+                  evaluation_point)
+                break;
+
+            // Check that the
+            // evaluation point was
+            // indeed found,
+            Assert (q_point < solution_gradients.size(),
+                    ExcInternalError());
+            // and if so take the
+            // x-derivative of the
+            // gradient there as the
+            // value which we are
+            // interested in, and
+            // increase the counter
+            // indicating how often
+            // we have added to that
+            // variable:
+            point_derivative += solution_gradients[q_point][0];
+            ++evaluation_point_hits;
+
+            // Finally break out of
+            // the innermost loop
+            // iterating over the
+            // vertices of the
+            // present cell, since if
+            // we have found the
+            // evaluation point at
+            // one vertex it cannot
+            // be at a following
+            // vertex as well:
+            break;
+          };
+
+    // Now we have looped over all
+    // cells and vertices, so check
+    // whether the point was found:
     AssertThrow (evaluation_point_hits > 0,
-                ExcEvaluationPointNotFound(evaluation_point));
+                 ExcEvaluationPointNotFound(evaluation_point));
 
-                                    // We have simply summed up the
-                                    // contributions of all adjacent
-                                    // cells, so we still have to
-                                    // compute the mean value. Once
-                                    // this is done, report the status:
+    // We have simply summed up the
+    // contributions of all adjacent
+    // cells, so we still have to
+    // compute the mean value. Once
+    // this is done, report the status:
     point_derivative /= evaluation_point_hits;
     std::cout << "   Point x-derivative=" << point_derivative
-             << std::endl;
+              << std::endl;
   }
 
 
 
-                                  // @sect4{The GridOutput class}
-
-                                  // Since this program has a more
-                                  // difficult structure (it computed
-                                  // a dual solution in addition to a
-                                  // primal one), writing out the
-                                  // solution is no more done by an
-                                  // evaluation object since we want
-                                  // to write both solutions at once
-                                  // into one file, and that requires
-                                  // some more information than
-                                  // available to the evaluation
-                                  // classes.
-                                  //
-                                  // However, we also want to look at
-                                  // the grids generated. This again
-                                  // can be done with one such
-                                  // class. Its structure is analog
-                                  // to the ``SolutionOutput'' class
-                                  // of the previous example program,
-                                  // so we do not discuss it here in
-                                  // more detail. Furthermore,
-                                  // everything that is used here has
-                                  // already been used in previous
-                                  // example programs.
+  // @sect4{The GridOutput class}
+
+  // Since this program has a more
+  // difficult structure (it computed
+  // a dual solution in addition to a
+  // primal one), writing out the
+  // solution is no more done by an
+  // evaluation object since we want
+  // to write both solutions at once
+  // into one file, and that requires
+  // some more information than
+  // available to the evaluation
+  // classes.
+  //
+  // However, we also want to look at
+  // the grids generated. This again
+  // can be done with one such
+  // class. Its structure is analog
+  // to the ``SolutionOutput'' class
+  // of the previous example program,
+  // so we do not discuss it here in
+  // more detail. Furthermore,
+  // everything that is used here has
+  // already been used in previous
+  // example programs.
   template <int dim>
   class GridOutput : public EvaluationBase<dim>
   {
-    public:
-      GridOutput (const std::string &output_name_base);
+  public:
+    GridOutput (const std::string &output_name_base);
 
-      virtual void operator () (const DoFHandler<dim> &dof_handler,
-                               const Vector<double>  &solution) const;
+    virtual void operator () (const DoFHandler<dim> &dof_handler,
+                              const Vector<double>  &solution) const;
 
-      const std::string output_name_base;
+    const std::string output_name_base;
   };
 
 
   template <int dim>
   GridOutput<dim>::
   GridOutput (const std::string &output_name_base)
-                 :
-                 output_name_base (output_name_base)
+    :
+    output_name_base (output_name_base)
   {}
 
 
   template <int dim>
   void
   GridOutput<dim>::operator () (const DoFHandler<dim> &dof_handler,
-                               const Vector<double>  &/*solution*/) const
+                                const Vector<double>  &/*solution*/) const
   {
 #ifdef HAVE_STD_STRINGSTREAM
     std::ostringstream filename;
@@ -492,10 +492,10 @@ namespace Evaluation
     std::ostrstream filename;
 #endif
     filename << "spec2006-447.dealII/"
-            << output_name_base << "-"
-            << this->refinement_cycle
-            << ".eps"
-            << std::ends;
+             << output_name_base << "-"
+             << this->refinement_cycle
+             << ".eps"
+             << std::ends;
 #ifdef HAVE_STD_STRINGSTREAM
     std::ofstream out (filename.str().c_str());
 #else
@@ -507,68 +507,68 @@ namespace Evaluation
 }
 
 
-                                // @sect3{The Laplace solver classes}
+// @sect3{The Laplace solver classes}
 
-                                // Next are the actual solver
-                                // classes. Again, we discuss only
-                                // the differences to the previous
-                                // program.
+// Next are the actual solver
+// classes. Again, we discuss only
+// the differences to the previous
+// program.
 namespace LaplaceSolver
 {
-                                  // Before everything else,
-                                  // forward-declare one class that
-                                  // we will have later, since we
-                                  // will want to make it a friend of
-                                  // some of the classes that follow,
-                                  // which requires the class to be
-                                  // known:
+  // Before everything else,
+  // forward-declare one class that
+  // we will have later, since we
+  // will want to make it a friend of
+  // some of the classes that follow,
+  // which requires the class to be
+  // known:
   template <int dim> class WeightedResidual;
 
 
-                                  // @sect4{The Laplace solver base class}
-
-                                  // This class is almost unchanged,
-                                  // with the exception that it
-                                  // declares two more functions:
-                                  // ``output_solution'' will be used
-                                  // to generate output files from
-                                  // the actual solutions computed by
-                                  // derived classes, and the
-                                  // ``set_refinement_cycle''
-                                  // function by which the testing
-                                  // framework sets the number of the
-                                  // refinement cycle to a local
-                                  // variable in this class; this
-                                  // number is later used to generate
-                                  // filenames for the solution
-                                  // output.
+  // @sect4{The Laplace solver base class}
+
+  // This class is almost unchanged,
+  // with the exception that it
+  // declares two more functions:
+  // ``output_solution'' will be used
+  // to generate output files from
+  // the actual solutions computed by
+  // derived classes, and the
+  // ``set_refinement_cycle''
+  // function by which the testing
+  // framework sets the number of the
+  // refinement cycle to a local
+  // variable in this class; this
+  // number is later used to generate
+  // filenames for the solution
+  // output.
   template <int dim>
   class Base
   {
-    public:
-      Base (Triangulation<dim> &coarse_grid);
-      virtual ~Base ();
+  public:
+    Base (Triangulation<dim> &coarse_grid);
+    virtual ~Base ();
 
-      virtual void solve_problem () = 0;
-      virtual void postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const = 0;
-      virtual void refine_grid () = 0;
-      virtual unsigned int n_dofs () const = 0;
+    virtual void solve_problem () = 0;
+    virtual void postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const = 0;
+    virtual void refine_grid () = 0;
+    virtual unsigned int n_dofs () const = 0;
 
-      virtual void set_refinement_cycle (const unsigned int cycle);
+    virtual void set_refinement_cycle (const unsigned int cycle);
 
-      virtual void output_solution () const = 0;
+    virtual void output_solution () const = 0;
 
 
-      const SmartPointer<Triangulation<dim> > triangulation;
+    const SmartPointer<Triangulation<dim> > triangulation;
 
-      unsigned int refinement_cycle;
+    unsigned int refinement_cycle;
   };
 
 
   template <int dim>
   Base<dim>::Base (Triangulation<dim> &coarse_grid)
-                 :
-                 triangulation (&coarse_grid)
+    :
+    triangulation (&coarse_grid)
   {}
 
 
@@ -586,83 +586,83 @@ namespace LaplaceSolver
   }
 
 
-                                  // @sect4{The Laplace Solver class}
+  // @sect4{The Laplace Solver class}
 
-                                  // Likewise, the ``Solver'' class
-                                  // is entirely unchanged and will
-                                  // thus not be discussed.
+  // Likewise, the ``Solver'' class
+  // is entirely unchanged and will
+  // thus not be discussed.
   template <int dim>
   class Solver : public virtual Base<dim>
   {
-    public:
-      Solver (Triangulation<dim>       &triangulation,
-             const FiniteElement<dim> &fe,
-             const Quadrature<dim>    &quadrature,
-             const Quadrature<dim-1>  &face_quadrature,
-             const Function<dim>      &boundary_values);
-      virtual
-      ~Solver ();
+  public:
+    Solver (Triangulation<dim>       &triangulation,
+            const FiniteElement<dim> &fe,
+            const Quadrature<dim>    &quadrature,
+            const Quadrature<dim-1>  &face_quadrature,
+            const Function<dim>      &boundary_values);
+    virtual
+    ~Solver ();
 
-      virtual
-      void
-      solve_problem ();
+    virtual
+    void
+    solve_problem ();
 
-      virtual
-      void
-      postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const;
+    virtual
+    void
+    postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const;
 
-      virtual
-      unsigned int
-      n_dofs () const;
+    virtual
+    unsigned int
+    n_dofs () const;
 
 
-      const SmartPointer<const FiniteElement<dim> >  fe;
-      const SmartPointer<const Quadrature<dim> >     quadrature;
-      const SmartPointer<const Quadrature<dim-1> >   face_quadrature;
-      DoFHandler<dim>                                dof_handler;
-      Vector<double>                                 solution;
-      const SmartPointer<const Function<dim> >       boundary_values;
+    const SmartPointer<const FiniteElement<dim> >  fe;
+    const SmartPointer<const Quadrature<dim> >     quadrature;
+    const SmartPointer<const Quadrature<dim-1> >   face_quadrature;
+    DoFHandler<dim>                                dof_handler;
+    Vector<double>                                 solution;
+    const SmartPointer<const Function<dim> >       boundary_values;
 
-      virtual void assemble_rhs (Vector<double> &rhs) const = 0;
+    virtual void assemble_rhs (Vector<double> &rhs) const = 0;
 
 
-      struct LinearSystem
-      {
-         LinearSystem (const DoFHandler<dim> &dof_handler);
+    struct LinearSystem
+    {
+      LinearSystem (const DoFHandler<dim> &dof_handler);
 
-         void solve (Vector<double> &solution) const;
+      void solve (Vector<double> &solution) const;
 
-         ConstraintMatrix     hanging_node_constraints;
-         SparsityPattern      sparsity_pattern;
-         SparseMatrix<double> matrix;
-         Vector<double>       rhs;
-      };
+      ConstraintMatrix     hanging_node_constraints;
+      SparsityPattern      sparsity_pattern;
+      SparseMatrix<double> matrix;
+      Vector<double>       rhs;
+    };
 
-      void
-      assemble_linear_system (LinearSystem &linear_system);
+    void
+    assemble_linear_system (LinearSystem &linear_system);
 
-      void
-      assemble_matrix (LinearSystem                                         &linear_system,
-                      const typename DoFHandler<dim>::active_cell_iterator &begin_cell,
-                      const typename DoFHandler<dim>::active_cell_iterator &end_cell,
-                      Threads::ThreadMutex                                 &mutex) const;
+    void
+    assemble_matrix (LinearSystem                                         &linear_system,
+                     const typename DoFHandler<dim>::active_cell_iterator &begin_cell,
+                     const typename DoFHandler<dim>::active_cell_iterator &end_cell,
+                     Threads::ThreadMutex                                 &mutex) const;
   };
 
 
 
   template <int dim>
   Solver<dim>::Solver (Triangulation<dim>       &triangulation,
-                      const FiniteElement<dim> &fe,
-                      const Quadrature<dim>    &quadrature,
-                      const Quadrature<dim-1>  &face_quadrature,
-                      const Function<dim>      &boundary_values)
-                 :
-                 Base<dim> (triangulation),
-                 fe (&fe),
-                  quadrature (&quadrature),
-                  face_quadrature (&face_quadrature),
-                 dof_handler (triangulation),
-                 boundary_values (&boundary_values)
+                       const FiniteElement<dim> &fe,
+                       const Quadrature<dim>    &quadrature,
+                       const Quadrature<dim-1>  &face_quadrature,
+                       const Function<dim>      &boundary_values)
+    :
+    Base<dim> (triangulation),
+    fe (&fe),
+    quadrature (&quadrature),
+    face_quadrature (&face_quadrature),
+    dof_handler (triangulation),
+    boundary_values (&boundary_values)
   {}
 
 
@@ -708,15 +708,15 @@ namespace LaplaceSolver
   Solver<dim>::assemble_linear_system (LinearSystem &linear_system)
   {
     typedef
-      typename DoFHandler<dim>::active_cell_iterator
-      active_cell_iterator;
+    typename DoFHandler<dim>::active_cell_iterator
+    active_cell_iterator;
 
     const unsigned int n_threads = multithread_info.n_default_threads;
     std::vector<std::pair<active_cell_iterator,active_cell_iterator> >
-      thread_ranges
+    thread_ranges
       = Threads::split_range<active_cell_iterator> (dof_handler.begin_active (),
-                                                   dof_handler.end (),
-                                                   n_threads);
+                                                    dof_handler.end (),
+                                                    n_threads);
 
     Threads::ThreadMutex mutex;
     Threads::ThreadGroup<> threads;
@@ -732,32 +732,32 @@ namespace LaplaceSolver
 
     std::map<types::global_dof_index,double> boundary_value_map;
     VectorTools::interpolate_boundary_values (dof_handler,
-                                             0,
-                                             *boundary_values,
-                                             boundary_value_map);
+                                              0,
+                                              *boundary_values,
+                                              boundary_value_map);
 
     threads.join_all ();
     linear_system.hanging_node_constraints.condense (linear_system.matrix);
 
     MatrixTools::apply_boundary_values (boundary_value_map,
-                                       linear_system.matrix,
-                                       solution,
-                                       linear_system.rhs);
+                                        linear_system.matrix,
+                                        solution,
+                                        linear_system.rhs);
   }
 
 
   template <int dim>
   void
   Solver<dim>::assemble_matrix (LinearSystem                                         &linear_system,
-                               const typename DoFHandler<dim>::active_cell_iterator &begin_cell,
-                               const typename DoFHandler<dim>::active_cell_iterator &end_cell,
-                               Threads::ThreadMutex                                 &mutex) const
+                                const typename DoFHandler<dim>::active_cell_iterator &begin_cell,
+                                const typename DoFHandler<dim>::active_cell_iterator &end_cell,
+                                Threads::ThreadMutex                                 &mutex) const
   {
     MappingQ<dim> mapping (4);
     FEValues<dim> fe_values (mapping, *fe, *quadrature,
-                            UpdateFlags(update_gradients | update_values |
-                                        update_q_points |
-                                        update_JxW_values));
+                             UpdateFlags(update_gradients | update_values |
+                                         update_q_points |
+                                         update_JxW_values));
 
     const unsigned int   dofs_per_cell = fe->dofs_per_cell;
     const unsigned int   n_q_points    = quadrature->n_quadrature_points;
@@ -771,39 +771,39 @@ namespace LaplaceSolver
 
 
     for (typename DoFHandler<dim>::active_cell_iterator cell=begin_cell;
-        cell!=end_cell; ++cell)
+         cell!=end_cell; ++cell)
       {
-       cell_matrix = 0;
-
-       fe_values.reinit (cell);
-
-       LaplaceCoefficient<dim>().value_list (fe_values.get_quadrature_points(),
-                                             laplace_coefficients);
-       MassCoefficient<dim>().value_list (fe_values.get_quadrature_points(),
-                                          mass_coefficients);
-
-
-       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-         for (unsigned int i=0; i<dofs_per_cell; ++i)
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += ((fe_values.shape_grad(i,q_point) *
-                                   fe_values.shape_grad(j,q_point) *
-                                   laplace_coefficients[q_point]
-                                   +
-                                   fe_values.shape_value(i,q_point) *
-                                   fe_values.shape_value(j,q_point) *
-                                   mass_coefficients[q_point]
-                                  ) *
-                                  fe_values.JxW(q_point));
-
-
-       cell->get_dof_indices (local_dof_indices);
-       Threads::ThreadMutex::ScopedLock lock (mutex);
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           linear_system.matrix.add (local_dof_indices[i],
-                                     local_dof_indices[j],
-                                     cell_matrix(i,j));
+        cell_matrix = 0;
+
+        fe_values.reinit (cell);
+
+        LaplaceCoefficient<dim>().value_list (fe_values.get_quadrature_points(),
+                                              laplace_coefficients);
+        MassCoefficient<dim>().value_list (fe_values.get_quadrature_points(),
+                                           mass_coefficients);
+
+
+        for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+          for (unsigned int i=0; i<dofs_per_cell; ++i)
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += ((fe_values.shape_grad(i,q_point) *
+                                    fe_values.shape_grad(j,q_point) *
+                                    laplace_coefficients[q_point]
+                                    +
+                                    fe_values.shape_value(i,q_point) *
+                                    fe_values.shape_value(j,q_point) *
+                                    mass_coefficients[q_point]
+                                   ) *
+                                   fe_values.JxW(q_point));
+
+
+        cell->get_dof_indices (local_dof_indices);
+        Threads::ThreadMutex::ScopedLock lock (mutex);
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            linear_system.matrix.add (local_dof_indices[i],
+                                      local_dof_indices[j],
+                                      cell_matrix(i,j));
       };
   }
 
@@ -815,21 +815,21 @@ namespace LaplaceSolver
     hanging_node_constraints.clear ();
 
     void (*mhnc_p) (const DoFHandler<dim> &,
-                   ConstraintMatrix      &)
+                    ConstraintMatrix &)
       = &DoFTools::make_hanging_node_constraints;
 
     Threads::Thread<>
-      mhnc_thread = Threads::spawn (mhnc_p)(dof_handler, hanging_node_constraints);
-
-                                    // make sparsity pattern. since
-                                    // in 3d the usual way just blows
-                                    // the roof w.r.t. memory
-                                    // consumption, use the detour
-                                    // via a compressed sparsity
-                                    // pattern that we later copy
-                                    // over
+    mhnc_thread = Threads::spawn (mhnc_p)(dof_handler, hanging_node_constraints);
+
+    // make sparsity pattern. since
+    // in 3d the usual way just blows
+    // the roof w.r.t. memory
+    // consumption, use the detour
+    // via a compressed sparsity
+    // pattern that we later copy
+    // over
     CompressedSparsityPattern csp(dof_handler.n_dofs(),
-                                 dof_handler.n_dofs());
+                                  dof_handler.n_dofs());
     DoFTools::make_sparsity_pattern (dof_handler, csp);
 
     mhnc_thread.join ();
@@ -862,122 +862,122 @@ namespace LaplaceSolver
 
 
 
-                                  // @sect4{The PrimalSolver class}
-
-                                  // The ``PrimalSolver'' class is
-                                  // also mostly unchanged except for
-                                  // overloading the functions
-                                  // ``solve_problem'', ``n_dofs'',
-                                  // and ``postprocess'' of the base
-                                  // class, and implementing the
-                                  // ``output_solution''
-                                  // function. These overloaded
-                                  // functions do nothing particular
-                                  // besides calling the functions of
-                                  // the base class -- that seems
-                                  // superfluous, but works around a
-                                  // bug in a popular compiler which
-                                  // requires us to write such
-                                  // functions for the following
-                                  // scenario: Besides the
-                                  // ``PrimalSolver'' class, we will
-                                  // have a ``DualSolver'', both
-                                  // derived from ``Solver''. We will
-                                  // then have a final classes which
-                                  // derived from these two, which
-                                  // will then have two instances of
-                                  // the ``Solver'' class as its base
-                                  // classes. If we want, for
-                                  // example, the number of degrees
-                                  // of freedom of the primal solver,
-                                  // we would have to indicate this
-                                  // like so:
-                                  // ``PrimalSolver<dim>::n_dofs()''.
-                                  // However, the compiler does not
-                                  // accept this since the ``n_dofs''
-                                  // function is actually from a base
-                                  // class of the ``PrimalSolver''
-                                  // class, so we have to inject the
-                                  // name from the base to the
-                                  // derived class using these
-                                  // additional functions.
-                                  //
-                                  // Regarding the implementation of
-                                  // the ``output_solution''
-                                  // function, we keep the
-                                  // ``GlobalRefinement'' and
-                                  // ``RefinementKelly'' classes in
-                                  // this program, and they can then
-                                  // rely on the default
-                                  // implementation of this function
-                                  // which simply outputs the primal
-                                  // solution. The class implementing
-                                  // dual weighted error estimators
-                                  // will overload this function
-                                  // itself, to also output the dual
-                                  // solution.
-                                  //
-                                  // Except for this, the class is
-                                  // unchanged with respect to the
-                                  // previous example.
+  // @sect4{The PrimalSolver class}
+
+  // The ``PrimalSolver'' class is
+  // also mostly unchanged except for
+  // overloading the functions
+  // ``solve_problem'', ``n_dofs'',
+  // and ``postprocess'' of the base
+  // class, and implementing the
+  // ``output_solution''
+  // function. These overloaded
+  // functions do nothing particular
+  // besides calling the functions of
+  // the base class -- that seems
+  // superfluous, but works around a
+  // bug in a popular compiler which
+  // requires us to write such
+  // functions for the following
+  // scenario: Besides the
+  // ``PrimalSolver'' class, we will
+  // have a ``DualSolver'', both
+  // derived from ``Solver''. We will
+  // then have a final classes which
+  // derived from these two, which
+  // will then have two instances of
+  // the ``Solver'' class as its base
+  // classes. If we want, for
+  // example, the number of degrees
+  // of freedom of the primal solver,
+  // we would have to indicate this
+  // like so:
+  // ``PrimalSolver<dim>::n_dofs()''.
+  // However, the compiler does not
+  // accept this since the ``n_dofs''
+  // function is actually from a base
+  // class of the ``PrimalSolver''
+  // class, so we have to inject the
+  // name from the base to the
+  // derived class using these
+  // additional functions.
+  //
+  // Regarding the implementation of
+  // the ``output_solution''
+  // function, we keep the
+  // ``GlobalRefinement'' and
+  // ``RefinementKelly'' classes in
+  // this program, and they can then
+  // rely on the default
+  // implementation of this function
+  // which simply outputs the primal
+  // solution. The class implementing
+  // dual weighted error estimators
+  // will overload this function
+  // itself, to also output the dual
+  // solution.
+  //
+  // Except for this, the class is
+  // unchanged with respect to the
+  // previous example.
   template <int dim>
   class PrimalSolver : public Solver<dim>
   {
-    public:
-      PrimalSolver (Triangulation<dim>       &triangulation,
-                   const FiniteElement<dim> &fe,
-                   const Quadrature<dim>    &quadrature,
-                   const Quadrature<dim-1>  &face_quadrature,
-                   const Function<dim>      &rhs_function,
-                   const Function<dim>      &boundary_values);
-
-      virtual
-      void solve_problem ();
-
-      virtual
-      unsigned int n_dofs () const;
-
-      virtual
-      void postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const;
-
-      virtual
-      void output_solution () const;
-
-
-      const SmartPointer<const Function<dim> > rhs_function;
-      virtual void assemble_rhs (Vector<double> &rhs) const;
-
-                                      // Now, in order to work around
-                                      // some problems in one of the
-                                      // compilers this library can
-                                      // be compiled with, we will
-                                      // have to use some
-                                      // workarounds. This will
-                                      // require that we declare a
-                                      // class that is actually
-                                      // derived from the present
-                                      // one, as a friend (strange as
-                                      // that seems). The full
-                                      // rationale will be explained
-                                      // below.
-      friend class WeightedResidual<dim>;
+  public:
+    PrimalSolver (Triangulation<dim>       &triangulation,
+                  const FiniteElement<dim> &fe,
+                  const Quadrature<dim>    &quadrature,
+                  const Quadrature<dim-1>  &face_quadrature,
+                  const Function<dim>      &rhs_function,
+                  const Function<dim>      &boundary_values);
+
+    virtual
+    void solve_problem ();
+
+    virtual
+    unsigned int n_dofs () const;
+
+    virtual
+    void postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const;
+
+    virtual
+    void output_solution () const;
+
+
+    const SmartPointer<const Function<dim> > rhs_function;
+    virtual void assemble_rhs (Vector<double> &rhs) const;
+
+    // Now, in order to work around
+    // some problems in one of the
+    // compilers this library can
+    // be compiled with, we will
+    // have to use some
+    // workarounds. This will
+    // require that we declare a
+    // class that is actually
+    // derived from the present
+    // one, as a friend (strange as
+    // that seems). The full
+    // rationale will be explained
+    // below.
+    friend class WeightedResidual<dim>;
   };
 
 
   template <int dim>
   PrimalSolver<dim>::
   PrimalSolver (Triangulation<dim>       &triangulation,
-               const FiniteElement<dim> &fe,
-               const Quadrature<dim>    &quadrature,
-               const Quadrature<dim-1>  &face_quadrature,
-               const Function<dim>      &rhs_function,
-               const Function<dim>      &boundary_values)
-                 :
-                 Base<dim> (triangulation),
-                 Solver<dim> (triangulation, fe,
-                              quadrature, face_quadrature,
-                              boundary_values),
-                  rhs_function (&rhs_function)
+                const FiniteElement<dim> &fe,
+                const Quadrature<dim>    &quadrature,
+                const Quadrature<dim-1>  &face_quadrature,
+                const Function<dim>      &rhs_function,
+                const Function<dim>      &boundary_values)
+    :
+    Base<dim> (triangulation),
+    Solver<dim> (triangulation, fe,
+                 quadrature, face_quadrature,
+                 boundary_values),
+    rhs_function (&rhs_function)
   {}
 
 
@@ -1023,9 +1023,9 @@ namespace LaplaceSolver
   {
     MappingQ<dim> mapping (4);
     FEValues<dim> fe_values (mapping, *this->fe, *this->quadrature,
-                            UpdateFlags(update_values    |
-                                        update_q_points  |
-                                        update_JxW_values));
+                             UpdateFlags(update_values    |
+                                         update_q_points  |
+                                         update_JxW_values));
 
     const unsigned int   dofs_per_cell = this->fe->dofs_per_cell;
     const unsigned int   n_q_points    = this->quadrature->n_quadrature_points;
@@ -1035,48 +1035,48 @@ namespace LaplaceSolver
     std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     typename DoFHandler<dim>::active_cell_iterator
-      cell = this->dof_handler.begin_active(),
-      endc = this->dof_handler.end();
+    cell = this->dof_handler.begin_active(),
+    endc = this->dof_handler.end();
     for (; cell!=endc; ++cell)
       {
-       cell_rhs = 0;
+        cell_rhs = 0;
 
-       fe_values.reinit (cell);
+        fe_values.reinit (cell);
 
-       rhs_function->value_list (fe_values.get_quadrature_points(),
-                                 rhs_values);
+        rhs_function->value_list (fe_values.get_quadrature_points(),
+                                  rhs_values);
 
-       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-         for (unsigned int i=0; i<dofs_per_cell; ++i)
-           cell_rhs(i) += (fe_values.shape_value(i,q_point) *
-                           rhs_values[q_point] *
-                           fe_values.JxW(q_point));
+        for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+          for (unsigned int i=0; i<dofs_per_cell; ++i)
+            cell_rhs(i) += (fe_values.shape_value(i,q_point) *
+                            rhs_values[q_point] *
+                            fe_values.JxW(q_point));
 
-       cell->get_dof_indices (local_dof_indices);
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         rhs(local_dof_indices[i]) += cell_rhs(i);
+        cell->get_dof_indices (local_dof_indices);
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          rhs(local_dof_indices[i]) += cell_rhs(i);
       }
   }
 
 
-                                  // @sect4{The RefinementGlobal and RefinementKelly classes}
+  // @sect4{The RefinementGlobal and RefinementKelly classes}
 
-                                  // For the following two classes,
-                                  // the same applies as for most of
-                                  // the above: the class is taken
-                                  // from the previous example as-is:
+  // For the following two classes,
+  // the same applies as for most of
+  // the above: the class is taken
+  // from the previous example as-is:
   template <int dim>
   class RefinementGlobal : public PrimalSolver<dim>
   {
-    public:
-      RefinementGlobal (Triangulation<dim>       &coarse_grid,
-                       const FiniteElement<dim> &fe,
-                       const Quadrature<dim>    &quadrature,
-                       const Quadrature<dim-1>  &face_quadrature,
-                       const Function<dim>      &rhs_function,
-                       const Function<dim>      &boundary_values);
-
-      virtual void refine_grid ();
+  public:
+    RefinementGlobal (Triangulation<dim>       &coarse_grid,
+                      const FiniteElement<dim> &fe,
+                      const Quadrature<dim>    &quadrature,
+                      const Quadrature<dim-1>  &face_quadrature,
+                      const Function<dim>      &rhs_function,
+                      const Function<dim>      &boundary_values);
+
+    virtual void refine_grid ();
   };
 
 
@@ -1084,16 +1084,16 @@ namespace LaplaceSolver
   template <int dim>
   RefinementGlobal<dim>::
   RefinementGlobal (Triangulation<dim>       &coarse_grid,
-                   const FiniteElement<dim> &fe,
-                   const Quadrature<dim>    &quadrature,
-                   const Quadrature<dim-1>  &face_quadrature,
-                   const Function<dim>      &rhs_function,
-                   const Function<dim>      &boundary_values)
-                 :
-                 Base<dim> (coarse_grid),
-                  PrimalSolver<dim> (coarse_grid, fe, quadrature,
-                                    face_quadrature, rhs_function,
-                                    boundary_values)
+                    const FiniteElement<dim> &fe,
+                    const Quadrature<dim>    &quadrature,
+                    const Quadrature<dim-1>  &face_quadrature,
+                    const Function<dim>      &rhs_function,
+                    const Function<dim>      &boundary_values)
+    :
+    Base<dim> (coarse_grid),
+    PrimalSolver<dim> (coarse_grid, fe, quadrature,
+                       face_quadrature, rhs_function,
+                       boundary_values)
   {}
 
 
@@ -1110,15 +1110,15 @@ namespace LaplaceSolver
   template <int dim>
   class RefinementKelly : public PrimalSolver<dim>
   {
-    public:
-      RefinementKelly (Triangulation<dim>       &coarse_grid,
-                      const FiniteElement<dim> &fe,
-                      const Quadrature<dim>    &quadrature,
-                      const Quadrature<dim-1>  &face_quadrature,
-                      const Function<dim>      &rhs_function,
-                      const Function<dim>      &boundary_values);
-
-      virtual void refine_grid ();
+  public:
+    RefinementKelly (Triangulation<dim>       &coarse_grid,
+                     const FiniteElement<dim> &fe,
+                     const Quadrature<dim>    &quadrature,
+                     const Quadrature<dim-1>  &face_quadrature,
+                     const Function<dim>      &rhs_function,
+                     const Function<dim>      &boundary_values);
+
+    virtual void refine_grid ();
   };
 
 
@@ -1126,16 +1126,16 @@ namespace LaplaceSolver
   template <int dim>
   RefinementKelly<dim>::
   RefinementKelly (Triangulation<dim>       &coarse_grid,
-                  const FiniteElement<dim> &fe,
-                  const Quadrature<dim>    &quadrature,
-                  const Quadrature<dim-1>  &face_quadrature,
-                  const Function<dim>      &rhs_function,
-                  const Function<dim>      &boundary_values)
-                 :
-                 Base<dim> (coarse_grid),
-                  PrimalSolver<dim> (coarse_grid, fe, quadrature,
-                                    face_quadrature,
-                                    rhs_function, boundary_values)
+                   const FiniteElement<dim> &fe,
+                   const Quadrature<dim>    &quadrature,
+                   const Quadrature<dim-1>  &face_quadrature,
+                   const Function<dim>      &rhs_function,
+                   const Function<dim>      &boundary_values)
+    :
+    Base<dim> (coarse_grid),
+    PrimalSolver<dim> (coarse_grid, fe, quadrature,
+                       face_quadrature,
+                       rhs_function, boundary_values)
   {}
 
 
@@ -1146,58 +1146,58 @@ namespace LaplaceSolver
   {
     Vector<float> estimated_error_per_cell (this->triangulation->n_active_cells());
     KellyErrorEstimator<dim>::estimate (this->dof_handler,
-                                       QGauss<dim-1>(3),
-                                       typename FunctionMap<dim>::type(),
-                                       this->solution,
-                                       estimated_error_per_cell);
+                                        QGauss<dim-1>(3),
+                                        typename FunctionMap<dim>::type(),
+                                        this->solution,
+                                        estimated_error_per_cell);
     GridRefinement::refine_and_coarsen_fixed_number (*this->triangulation,
-                                                    estimated_error_per_cell,
-                                                    0.2, 0.02);
+                                                     estimated_error_per_cell,
+                                                     0.2, 0.02);
     this->triangulation->execute_coarsening_and_refinement ();
   }
 
 
 
-                                  // @sect4{The RefinementWeightedKelly class}
-
-                                  // This class is a variant of the
-                                  // previous one, in that it allows
-                                  // to weight the refinement
-                                  // indicators we get from the
-                                  // library's Kelly indicator by
-                                  // some function. We include this
-                                  // class since the goal of this
-                                  // example program is to
-                                  // demonstrate automatic refinement
-                                  // criteria even for complex output
-                                  // quantities such as point values
-                                  // or stresses. If we did not solve
-                                  // a dual problem and compute the
-                                  // weights thereof, we would
-                                  // probably be tempted to give a
-                                  // hand-crafted weighting to the
-                                  // indicators to account for the
-                                  // fact that we are going to
-                                  // evaluate these quantities. This
-                                  // class accepts such a weighting
-                                  // function as argument to its
-                                  // constructor:
+  // @sect4{The RefinementWeightedKelly class}
+
+  // This class is a variant of the
+  // previous one, in that it allows
+  // to weight the refinement
+  // indicators we get from the
+  // library's Kelly indicator by
+  // some function. We include this
+  // class since the goal of this
+  // example program is to
+  // demonstrate automatic refinement
+  // criteria even for complex output
+  // quantities such as point values
+  // or stresses. If we did not solve
+  // a dual problem and compute the
+  // weights thereof, we would
+  // probably be tempted to give a
+  // hand-crafted weighting to the
+  // indicators to account for the
+  // fact that we are going to
+  // evaluate these quantities. This
+  // class accepts such a weighting
+  // function as argument to its
+  // constructor:
   template <int dim>
   class RefinementWeightedKelly : public PrimalSolver<dim>
   {
-    public:
-      RefinementWeightedKelly (Triangulation<dim>       &coarse_grid,
-                              const FiniteElement<dim> &fe,
-                              const Quadrature<dim>    &quadrature,
-                              const Quadrature<dim-1>  &face_quadrature,
-                              const Function<dim>      &rhs_function,
-                              const Function<dim>      &boundary_values,
-                              const Function<dim>      &weighting_function);
+  public:
+    RefinementWeightedKelly (Triangulation<dim>       &coarse_grid,
+                             const FiniteElement<dim> &fe,
+                             const Quadrature<dim>    &quadrature,
+                             const Quadrature<dim-1>  &face_quadrature,
+                             const Function<dim>      &rhs_function,
+                             const Function<dim>      &boundary_values,
+                             const Function<dim>      &weighting_function);
 
-      virtual void refine_grid ();
+    virtual void refine_grid ();
 
 
-      const SmartPointer<const Function<dim> > weighting_function;
+    const SmartPointer<const Function<dim> > weighting_function;
   };
 
 
@@ -1205,262 +1205,262 @@ namespace LaplaceSolver
   template <int dim>
   RefinementWeightedKelly<dim>::
   RefinementWeightedKelly (Triangulation<dim>       &coarse_grid,
-                          const FiniteElement<dim> &fe,
-                          const Quadrature<dim>    &quadrature,
-                          const Quadrature<dim-1>  &face_quadrature,
-                          const Function<dim>      &rhs_function,
-                          const Function<dim>      &boundary_values,
-                          const Function<dim>      &weighting_function)
-                 :
-                 Base<dim> (coarse_grid),
-                  PrimalSolver<dim> (coarse_grid, fe, quadrature,
-                                    face_quadrature,
-                                    rhs_function, boundary_values),
-                  weighting_function (&weighting_function)
+                           const FiniteElement<dim> &fe,
+                           const Quadrature<dim>    &quadrature,
+                           const Quadrature<dim-1>  &face_quadrature,
+                           const Function<dim>      &rhs_function,
+                           const Function<dim>      &boundary_values,
+                           const Function<dim>      &weighting_function)
+    :
+    Base<dim> (coarse_grid),
+    PrimalSolver<dim> (coarse_grid, fe, quadrature,
+                       face_quadrature,
+                       rhs_function, boundary_values),
+    weighting_function (&weighting_function)
   {}
 
 
 
-                                  // Now, here comes the main
-                                  // function, including the
-                                  // weighting:
+  // Now, here comes the main
+  // function, including the
+  // weighting:
   template <int dim>
   void
   RefinementWeightedKelly<dim>::refine_grid ()
   {
-                                    // First compute some residual
-                                    // based error indicators for all
-                                    // cells by a method already
-                                    // implemented in the
-                                    // library. What exactly is
-                                    // computed can be read in the
-                                    // documentation of that class.
+    // First compute some residual
+    // based error indicators for all
+    // cells by a method already
+    // implemented in the
+    // library. What exactly is
+    // computed can be read in the
+    // documentation of that class.
     Vector<float> estimated_error (this->triangulation->n_active_cells());
     KellyErrorEstimator<dim>::estimate (this->dof_handler,
-                                       *this->face_quadrature,
-                                       typename FunctionMap<dim>::type(),
-                                       this->solution,
-                                       estimated_error);
-
-                                    // Now we are going to weight
-                                    // these indicators by the value
-                                    // of the function given to the
-                                    // constructor:
+                                        *this->face_quadrature,
+                                        typename FunctionMap<dim>::type(),
+                                        this->solution,
+                                        estimated_error);
+
+    // Now we are going to weight
+    // these indicators by the value
+    // of the function given to the
+    // constructor:
     typename DoFHandler<dim>::active_cell_iterator
-      cell = this->dof_handler.begin_active(),
-      endc = this->dof_handler.end();
+    cell = this->dof_handler.begin_active(),
+    endc = this->dof_handler.end();
     for (unsigned int cell_index=0; cell!=endc; ++cell, ++cell_index)
       estimated_error(cell_index)
-       *= weighting_function->value (cell->center());
+      *= weighting_function->value (cell->center());
 
     GridRefinement::refine_and_coarsen_fixed_number (*this->triangulation,
-                                                    estimated_error,
-                                                    0.2, 0.02);
+                                                     estimated_error,
+                                                     0.2, 0.02);
     this->triangulation->execute_coarsening_and_refinement ();
   }
 
 }
 
 
-                                // @sect3{Equation data}
-                                //
-                                // In this example program, we work
-                                // with the same data sets as in the
-                                // previous one, but as it may so
-                                // happen that someone wants to run
-                                // the program with different
-                                // boundary values and right hand side
-                                // functions, or on a different grid,
-                                // we show a simple technique to do
-                                // exactly that. For more clarity, we
-                                // furthermore pack everything that
-                                // has to do with equation data into
-                                // a namespace of its own.
-                                //
-                                // The underlying assumption is that
-                                // this is a research program, and
-                                // that there we often have a number
-                                // of test cases that consist of a
-                                // domain, a right hand side,
-                                // boundary values, possibly a
-                                // specified coefficient, and a
-                                // number of other parameters. They
-                                // often vary all at the same time
-                                // when shifting from one example to
-                                // another. To make handling such
-                                // sets of problem description
-                                // parameters simple is the goal of
-                                // the following.
-                                //
-                                // Basically, the idea is this: let
-                                // us have a structure for each set
-                                // of data, in which we pack
-                                // everything that describes a test
-                                // case: here, these are two
-                                // subclasses, one called
-                                // ``BoundaryValues'' for the
-                                // boundary values of the exact
-                                // solution, and one called
-                                // ``RightHandSide'', and then a way
-                                // to generate the coarse grid. Since
-                                // the solution of the previous
-                                // example program looked like curved
-                                // ridges, we use this name here for
-                                // the enclosing class. Note that the
-                                // names of the two inner classes
-                                // have to be the same for all
-                                // enclosing test case classes, and
-                                // also that we have attached the
-                                // dimension template argument to the
-                                // enclosing class rather than to the
-                                // inner ones, to make further
-                                // processing simpler.  (From a
-                                // language viewpoint, a namespace
-                                // would be better to encapsulate
-                                // these inner classes, rather than a
-                                // structure. However, namespaces
-                                // cannot be given as template
-                                // arguments, so we use a structure
-                                // to allow a second object to select
-                                // from within its given
-                                // argument. The enclosing structure,
-                                // of course, has no member variables
-                                // apart from the classes it
-                                // declares, and a static function to
-                                // generate the coarse mesh; it will
-                                // in general never be instantiated.)
-                                //
-                                // The idea is then the following
-                                // (this is the right time to also
-                                // take a brief look at the code
-                                // below): we can generate objects
-                                // for boundary values and
-                                // right hand side by simply giving
-                                // the name of the outer class as a
-                                // template argument to a class which
-                                // we call here ``Data::SetUp'', and
-                                // it then creates objects for the
-                                // inner classes. In this case, to
-                                // get all that characterizes the
-                                // curved ridge solution, we would
-                                // simply generate an instance of
-                                // ``Data::SetUp<Data::CurvedRidge>'',
-                                // and everything we need to know
-                                // about the solution would be static
-                                // member variables and functions of
-                                // that object.
-                                //
-                                // This approach might seem like
-                                // overkill in this case, but will
-                                // become very handy once a certain
-                                // set up is not only characterized
-                                // by Dirichlet boundary values and a
-                                // right hand side function, but in
-                                // addition by material properties,
-                                // Neumann values, different boundary
-                                // descriptors, etc. In that case,
-                                // the ``SetUp'' class might consist
-                                // of a dozen or more objects, and
-                                // each descriptor class (like the
-                                // ``CurvedRidges'' class below)
-                                // would have to provide them. Then,
-                                // you will be happy to be able to
-                                // change from one set of data to
-                                // another by only changing the
-                                // template argument to the ``SetUp''
-                                // class at one place, rather than at
-                                // many.
-                                //
-                                // With this framework for different
-                                // test cases, we are almost
-                                // finished, but one thing remains:
-                                // by now we can select statically,
-                                // by changing one template argument,
-                                // which data set to choose. In order
-                                // to be able to do that dynamically,
-                                // i.e. at run time, we need a base
-                                // class. This we provide in the
-                                // obvious way, see below, with
-                                // virtual abstract functions. It
-                                // forces us to introduce a second
-                                // template parameter ``dim'' which
-                                // we need for the base class (which
-                                // could be avoided using some
-                                // template magic, but we omit that),
-                                // but that's all.
-                                //
-                                // Adding new testcases is now
-                                // simple, you don't have to touch
-                                // the framework classes, only a
-                                // structure like the
-                                // ``CurvedRidges'' one is needed.
+// @sect3{Equation data}
+//
+// In this example program, we work
+// with the same data sets as in the
+// previous one, but as it may so
+// happen that someone wants to run
+// the program with different
+// boundary values and right hand side
+// functions, or on a different grid,
+// we show a simple technique to do
+// exactly that. For more clarity, we
+// furthermore pack everything that
+// has to do with equation data into
+// a namespace of its own.
+//
+// The underlying assumption is that
+// this is a research program, and
+// that there we often have a number
+// of test cases that consist of a
+// domain, a right hand side,
+// boundary values, possibly a
+// specified coefficient, and a
+// number of other parameters. They
+// often vary all at the same time
+// when shifting from one example to
+// another. To make handling such
+// sets of problem description
+// parameters simple is the goal of
+// the following.
+//
+// Basically, the idea is this: let
+// us have a structure for each set
+// of data, in which we pack
+// everything that describes a test
+// case: here, these are two
+// subclasses, one called
+// ``BoundaryValues'' for the
+// boundary values of the exact
+// solution, and one called
+// ``RightHandSide'', and then a way
+// to generate the coarse grid. Since
+// the solution of the previous
+// example program looked like curved
+// ridges, we use this name here for
+// the enclosing class. Note that the
+// names of the two inner classes
+// have to be the same for all
+// enclosing test case classes, and
+// also that we have attached the
+// dimension template argument to the
+// enclosing class rather than to the
+// inner ones, to make further
+// processing simpler.  (From a
+// language viewpoint, a namespace
+// would be better to encapsulate
+// these inner classes, rather than a
+// structure. However, namespaces
+// cannot be given as template
+// arguments, so we use a structure
+// to allow a second object to select
+// from within its given
+// argument. The enclosing structure,
+// of course, has no member variables
+// apart from the classes it
+// declares, and a static function to
+// generate the coarse mesh; it will
+// in general never be instantiated.)
+//
+// The idea is then the following
+// (this is the right time to also
+// take a brief look at the code
+// below): we can generate objects
+// for boundary values and
+// right hand side by simply giving
+// the name of the outer class as a
+// template argument to a class which
+// we call here ``Data::SetUp'', and
+// it then creates objects for the
+// inner classes. In this case, to
+// get all that characterizes the
+// curved ridge solution, we would
+// simply generate an instance of
+// ``Data::SetUp<Data::CurvedRidge>'',
+// and everything we need to know
+// about the solution would be static
+// member variables and functions of
+// that object.
+//
+// This approach might seem like
+// overkill in this case, but will
+// become very handy once a certain
+// set up is not only characterized
+// by Dirichlet boundary values and a
+// right hand side function, but in
+// addition by material properties,
+// Neumann values, different boundary
+// descriptors, etc. In that case,
+// the ``SetUp'' class might consist
+// of a dozen or more objects, and
+// each descriptor class (like the
+// ``CurvedRidges'' class below)
+// would have to provide them. Then,
+// you will be happy to be able to
+// change from one set of data to
+// another by only changing the
+// template argument to the ``SetUp''
+// class at one place, rather than at
+// many.
+//
+// With this framework for different
+// test cases, we are almost
+// finished, but one thing remains:
+// by now we can select statically,
+// by changing one template argument,
+// which data set to choose. In order
+// to be able to do that dynamically,
+// i.e. at run time, we need a base
+// class. This we provide in the
+// obvious way, see below, with
+// virtual abstract functions. It
+// forces us to introduce a second
+// template parameter ``dim'' which
+// we need for the base class (which
+// could be avoided using some
+// template magic, but we omit that),
+// but that's all.
+//
+// Adding new testcases is now
+// simple, you don't have to touch
+// the framework classes, only a
+// structure like the
+// ``CurvedRidges'' one is needed.
 namespace Data
 {
-                                  // @sect4{The SetUpBase and SetUp classes}
-
-                                  // Based on the above description,
-                                  // the ``SetUpBase'' class then
-                                  // looks as follows. To allow using
-                                  // the ``SmartPointer'' class with
-                                  // this class, we derived from the
-                                  // ``Subscriptor'' class.
+  // @sect4{The SetUpBase and SetUp classes}
+
+  // Based on the above description,
+  // the ``SetUpBase'' class then
+  // looks as follows. To allow using
+  // the ``SmartPointer'' class with
+  // this class, we derived from the
+  // ``Subscriptor'' class.
   template <int dim>
   struct SetUpBase : public Subscriptor
   {
-      virtual
-      const Function<dim> &  get_boundary_values () const = 0;
+    virtual
+    const Function<dim>   &get_boundary_values () const = 0;
 
-      virtual
-      const Function<dim> &  get_right_hand_side () const = 0;
+    virtual
+    const Function<dim>   &get_right_hand_side () const = 0;
 
-      virtual
-      void create_coarse_grid (Triangulation<dim> &coarse_grid) const = 0;
+    virtual
+    void create_coarse_grid (Triangulation<dim> &coarse_grid) const = 0;
   };
 
 
-                                  // And now for the derived class
-                                  // that takes the template argument
-                                  // as explained above. For some
-                                  // reason, C++ requires us to
-                                  // define a constructor (which
-                                  // maybe empty), as otherwise a
-                                  // warning is generated that some
-                                  // data is not initialized.
-                                  //
-                                  // Here we pack the data elements
-                                  // into private variables, and
-                                  // allow access to them through the
-                                  // methods of the base class.
+  // And now for the derived class
+  // that takes the template argument
+  // as explained above. For some
+  // reason, C++ requires us to
+  // define a constructor (which
+  // maybe empty), as otherwise a
+  // warning is generated that some
+  // data is not initialized.
+  //
+  // Here we pack the data elements
+  // into private variables, and
+  // allow access to them through the
+  // methods of the base class.
   template <class Traits, int dim>
   struct SetUp : public SetUpBase<dim>
   {
-      SetUp () {};
+    SetUp () {};
 
-      virtual
-      const Function<dim> &  get_boundary_values () const;
+    virtual
+    const Function<dim>   &get_boundary_values () const;
 
-      virtual
-      const Function<dim> &  get_right_hand_side () const;
+    virtual
+    const Function<dim>   &get_right_hand_side () const;
 
 
-      virtual
-      void create_coarse_grid (Triangulation<dim> &coarse_grid) const;
+    virtual
+    void create_coarse_grid (Triangulation<dim> &coarse_grid) const;
 
 
-      static const typename Traits::BoundaryValues boundary_values;
-      static const typename Traits::RightHandSide  right_hand_side;
+    static const typename Traits::BoundaryValues boundary_values;
+    static const typename Traits::RightHandSide  right_hand_side;
   };
 
-                                  // We have to provide definitions
-                                  // for the static member variables
-                                  // of the above class:
+  // We have to provide definitions
+  // for the static member variables
+  // of the above class:
   template <class Traits, int dim>
   const typename Traits::BoundaryValues  SetUp<Traits,dim>::boundary_values;
   template <class Traits, int dim>
   const typename Traits::RightHandSide   SetUp<Traits,dim>::right_hand_side;
 
-                                  // And definitions of the member
-                                  // functions:
+  // And definitions of the member
+  // functions:
   template <class Traits, int dim>
   const Function<dim> &
   SetUp<Traits,dim>::get_boundary_values () const
@@ -1486,39 +1486,39 @@ namespace Data
   }
 
 
-                                  // @sect4{The CurvedRidges class}
+  // @sect4{The CurvedRidges class}
 
-                                  // The class that is used to
-                                  // describe the boundary values and
-                                  // right hand side of the ``curved
-                                  // ridge'' problem already used in
-                                  // the step-13 example program is
-                                  // then like so:
+  // The class that is used to
+  // describe the boundary values and
+  // right hand side of the ``curved
+  // ridge'' problem already used in
+  // the step-13 example program is
+  // then like so:
   template <int dim>
   struct CurvedRidges
   {
-      class BoundaryValues : public Function<dim>
-      {
-       public:
-         BoundaryValues () : Function<dim> () {};
+    class BoundaryValues : public Function<dim>
+    {
+    public:
+      BoundaryValues () : Function<dim> () {};
 
-         virtual double value (const Point<dim>   &p,
-                               const unsigned int  component) const;
-      };
+      virtual double value (const Point<dim>   &p,
+                            const unsigned int  component) const;
+    };
 
 
-      class RightHandSide : public Function<dim>
-      {
-       public:
-         RightHandSide () : Function<dim> () {};
+    class RightHandSide : public Function<dim>
+    {
+    public:
+      RightHandSide () : Function<dim> () {};
 
-         virtual double value (const Point<dim>   &p,
-                               const unsigned int  component) const;
-      };
+      virtual double value (const Point<dim>   &p,
+                            const unsigned int  component) const;
+    };
 
-      static
-      void
-      create_coarse_grid (Triangulation<dim> &coarse_grid);
+    static
+    void
+    create_coarse_grid (Triangulation<dim> &coarse_grid);
   };
 
 
@@ -1526,7 +1526,7 @@ namespace Data
   double
   CurvedRidges<dim>::BoundaryValues::
   value (const Point<dim>   &p,
-        const unsigned int  /*component*/) const
+         const unsigned int  /*component*/) const
   {
     double q = p(0);
     for (unsigned int i=1; i<dim; ++i)
@@ -1540,22 +1540,22 @@ namespace Data
   template <int dim>
   double
   CurvedRidges<dim>::RightHandSide::value (const Point<dim>   &p,
-                                          const unsigned int  /*component*/) const
+                                           const unsigned int  /*component*/) const
   {
     double q = p(0);
     for (unsigned int i=1; i<dim; ++i)
       q += std::sin(10*p(i)+5*p(0)*p(0));
     const double u = std::exp(q);
     double t1 = 1,
-          t2 = 0,
-          t3 = 0;
+           t2 = 0,
+           t3 = 0;
     for (unsigned int i=1; i<dim; ++i)
       {
-       t1 += std::cos(10*p(i)+5*p(0)*p(0)) * 10 * p(0);
-       t2 += 10*std::cos(10*p(i)+5*p(0)*p(0)) -
-             100*std::sin(10*p(i)+5*p(0)*p(0)) * p(0)*p(0);
-       t3 += 100*std::cos(10*p(i)+5*p(0)*p(0))*std::cos(10*p(i)+5*p(0)*p(0)) -
-             100*std::sin(10*p(i)+5*p(0)*p(0));
+        t1 += std::cos(10*p(i)+5*p(0)*p(0)) * 10 * p(0);
+        t2 += 10*std::cos(10*p(i)+5*p(0)*p(0)) -
+              100*std::sin(10*p(i)+5*p(0)*p(0)) * p(0)*p(0);
+        t3 += 100*std::cos(10*p(i)+5*p(0)*p(0))*std::cos(10*p(i)+5*p(0)*p(0)) -
+              100*std::sin(10*p(i)+5*p(0)*p(0));
       };
     t1 = t1*t1;
 
@@ -1573,218 +1573,218 @@ namespace Data
   }
 
 
-                                  // @sect4{The Exercise_2_3 class}
-
-                                  // This example program was written
-                                  // while giving practical courses
-                                  // for a lecture on adaptive finite
-                                  // element methods and duality
-                                  // based error estimates. For these
-                                  // courses, we had one exercise,
-                                  // which required to solve the
-                                  // Laplace equation with constant
-                                  // right hand side on a square
-                                  // domain with a square hole in the
-                                  // center, and zero boundary
-                                  // values. Since the implementation
-                                  // of the properties of this
-                                  // problem is so particularly
-                                  // simple here, lets do it. As the
-                                  // number of the exercise was 2.3,
-                                  // we take the liberty to retain
-                                  // this name for the class as well.
+  // @sect4{The Exercise_2_3 class}
+
+  // This example program was written
+  // while giving practical courses
+  // for a lecture on adaptive finite
+  // element methods and duality
+  // based error estimates. For these
+  // courses, we had one exercise,
+  // which required to solve the
+  // Laplace equation with constant
+  // right hand side on a square
+  // domain with a square hole in the
+  // center, and zero boundary
+  // values. Since the implementation
+  // of the properties of this
+  // problem is so particularly
+  // simple here, lets do it. As the
+  // number of the exercise was 2.3,
+  // we take the liberty to retain
+  // this name for the class as well.
   template <int dim>
   struct Exercise_2_3
   {
-                                      // We need a class to denote
-                                      // the boundary values of the
-                                      // problem. In this case, this
-                                      // is simple: it's the zero
-                                      // function, so don't even
-                                      // declare a class, just a
-                                      // typedef:
-      typedef ZeroFunction<dim> BoundaryValues;
-
-                                      // Second, a class that denotes
-                                      // the right hand side. Since
-                                      // they are constant, just
-                                      // subclass the corresponding
-                                      // class of the library and be
-                                      // done:
-      class RightHandSide : public ConstantFunction<dim>
-      {
-       public:
-         RightHandSide () : ConstantFunction<dim> (1.) {};
-      };
+    // We need a class to denote
+    // the boundary values of the
+    // problem. In this case, this
+    // is simple: it's the zero
+    // function, so don't even
+    // declare a class, just a
+    // typedef:
+    typedef ZeroFunction<dim> BoundaryValues;
+
+    // Second, a class that denotes
+    // the right hand side. Since
+    // they are constant, just
+    // subclass the corresponding
+    // class of the library and be
+    // done:
+    class RightHandSide : public ConstantFunction<dim>
+    {
+    public:
+      RightHandSide () : ConstantFunction<dim> (1.) {};
+    };
 
-                                      // Finally a function to
-                                      // generate the coarse
-                                      // grid. This is somewhat more
-                                      // complicated here, see
-                                      // immediately below.
-      static
-      void
-      create_coarse_grid (Triangulation<dim> &coarse_grid);
+    // Finally a function to
+    // generate the coarse
+    // grid. This is somewhat more
+    // complicated here, see
+    // immediately below.
+    static
+    void
+    create_coarse_grid (Triangulation<dim> &coarse_grid);
   };
 
 
-                                  // As stated above, the grid for
-                                  // this example is the square
-                                  // [-1,1]^2 with the square
-                                  // [-1/2,1/2]^2 as hole in it. We
-                                  // create the coarse grid as 4
-                                  // times 4 cells with the middle
-                                  // four ones missing.
-                                  //
-                                  // Of course, the example has an
-                                  // extension to 3d, but since this
-                                  // function cannot be written in a
-                                  // dimension independent way we
-                                  // choose not to implement this
-                                  // here, but rather only specialize
-                                  // the template for dim=2. If you
-                                  // compile the program for 3d,
-                                  // you'll get a message from the
-                                  // linker that this function is not
-                                  // implemented for 3d, and needs to
-                                  // be provided.
-                                  //
-                                  // For the creation of this
-                                  // geometry, the library has no
-                                  // predefined method. In this case,
-                                  // the geometry is still simple
-                                  // enough to do the creation by
-                                  // hand, rather than using a mesh
-                                  // generator.
-/*
-  template <>
-  void
-  Exercise_2_3<2>::
-  create_coarse_grid (Triangulation<2> &coarse_grid)
-  {
-                                    // First define the space
-                                    // dimension, to allow those
-                                    // parts of the function that are
-                                    // actually dimension independent
-                                    // to use this variable. That
-                                    // makes it simpler if you later
-                                    // takes this as a starting point
-                                    // to implement the 3d version.
-    const unsigned int dim = 2;
-
-                                    // Then have a list of
-                                    // vertices. Here, they are 24 (5
-                                    // times 5, with the middle one
-                                    // omitted). It is probably best
-                                    // to draw a sketch here. Note
-                                    // that we leave the number of
-                                    // vertices open at first, but
-                                    // then let the compiler compute
-                                    // this number afterwards. This
-                                    // reduces the possibility of
-                                    // having the dimension to large
-                                    // and leaving the last ones
-                                    // uninitialized.
-    static const Point<2> vertices_1[]
-      = {  Point<2> (-1.,   -1.),
-            Point<2> (-1./2, -1.),
-            Point<2> (0.,    -1.),
-            Point<2> (+1./2, -1.),
-            Point<2> (+1,    -1.),
-
-            Point<2> (-1.,   -1./2.),
-            Point<2> (-1./2, -1./2.),
-            Point<2> (0.,    -1./2.),
-            Point<2> (+1./2, -1./2.),
-            Point<2> (+1,    -1./2.),
-
-            Point<2> (-1.,   0.),
-            Point<2> (-1./2, 0.),
-            Point<2> (+1./2, 0.),
-            Point<2> (+1,    0.),
-
-            Point<2> (-1.,   1./2.),
-            Point<2> (-1./2, 1./2.),
-            Point<2> (0.,    1./2.),
-            Point<2> (+1./2, 1./2.),
-            Point<2> (+1,    1./2.),
-
-            Point<2> (-1.,   1.),
-            Point<2> (-1./2, 1.),
-            Point<2> (0.,    1.),
-            Point<2> (+1./2, 1.),
-            Point<2> (+1,    1.)    };
-    const unsigned int
-      n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
-
-                                    // From this static list of
-                                    // vertices, we generate an STL
-                                    // vector of the vertices, as
-                                    // this is the data type the
-                                    // library wants to see.
-    const std::vector<Point<dim> > vertices (&vertices_1[0],
-                                            &vertices_1[n_vertices]);
-
-                                    // Next, we have to define the
-                                    // cells and the vertices they
-                                    // contain. Here, we have 8
-                                    // vertices, but leave the number
-                                    // open and let it be computed
-                                    // afterwards:
-    static const int cell_vertices[][GeometryInfo<dim>::vertices_per_cell]
-      = {{0, 1, 6,5},
-        {1, 2, 7, 6},
-        {2, 3, 8, 7},
-        {3, 4, 9, 8},
-        {5, 6, 11, 10},
-        {8, 9, 13, 12},
-        {10, 11, 15, 14},
-        {12, 13, 18, 17},
-        {14, 15, 20, 19},
-        {15, 16, 21, 20},
-        {16, 17, 22, 21},
-        {17, 18, 23, 22}};
-    const unsigned int
-      n_cells = sizeof(cell_vertices) / sizeof(cell_vertices[0]);
-
-                                    // Again, we generate a C++
-                                    // vector type from this, but
-                                    // this time by looping over the
-                                    // cells (yes, this is
-                                    // boring). Additionally, we set
-                                    // the material indicator to zero
-                                    // for all the cells:
-    std::vector<CellData<dim> > cells (n_cells, CellData<dim>());
-    for (unsigned int i=0; i<n_cells; ++i)
-      {
-       for (unsigned int j=0;
-            j<GeometryInfo<dim>::vertices_per_cell;
-            ++j)
-         cells[i].vertices[j] = cell_vertices[i][j];
-       cells[i].material_id = 0;
-      };
-
-                                    // Finally pass all this
-                                    // information to the library to
-                                    // generate a triangulation. The
-                                    // last parameter may be used to
-                                    // pass information about
-                                    // non-zero boundary indicators
-                                    // at certain faces of the
-                                    // triangulation to the library,
-                                    // but we don't want that here,
-                                    // so we give an empty object:
-    coarse_grid.create_triangulation (vertices,
-                                     cells,
-                                     SubCellData());
-
-                                    // And since we want that the
-                                    // evaluation point (3/4,3/4) in
-                                    // this example is a grid point,
-                                    // we refine once globally:
-    coarse_grid.refine_global (1);
-  }
-*/
+  // As stated above, the grid for
+  // this example is the square
+  // [-1,1]^2 with the square
+  // [-1/2,1/2]^2 as hole in it. We
+  // create the coarse grid as 4
+  // times 4 cells with the middle
+  // four ones missing.
+  //
+  // Of course, the example has an
+  // extension to 3d, but since this
+  // function cannot be written in a
+  // dimension independent way we
+  // choose not to implement this
+  // here, but rather only specialize
+  // the template for dim=2. If you
+  // compile the program for 3d,
+  // you'll get a message from the
+  // linker that this function is not
+  // implemented for 3d, and needs to
+  // be provided.
+  //
+  // For the creation of this
+  // geometry, the library has no
+  // predefined method. In this case,
+  // the geometry is still simple
+  // enough to do the creation by
+  // hand, rather than using a mesh
+  // generator.
+  /*
+    template <>
+    void
+    Exercise_2_3<2>::
+    create_coarse_grid (Triangulation<2> &coarse_grid)
+    {
+               // First define the space
+               // dimension, to allow those
+               // parts of the function that are
+               // actually dimension independent
+               // to use this variable. That
+               // makes it simpler if you later
+               // takes this as a starting point
+               // to implement the 3d version.
+      const unsigned int dim = 2;
+
+               // Then have a list of
+               // vertices. Here, they are 24 (5
+               // times 5, with the middle one
+               // omitted). It is probably best
+               // to draw a sketch here. Note
+               // that we leave the number of
+               // vertices open at first, but
+               // then let the compiler compute
+               // this number afterwards. This
+               // reduces the possibility of
+               // having the dimension to large
+               // and leaving the last ones
+               // uninitialized.
+      static const Point<2> vertices_1[]
+        = {  Point<2> (-1.,   -1.),
+         Point<2> (-1./2, -1.),
+         Point<2> (0.,    -1.),
+         Point<2> (+1./2, -1.),
+         Point<2> (+1,    -1.),
+
+         Point<2> (-1.,   -1./2.),
+         Point<2> (-1./2, -1./2.),
+         Point<2> (0.,    -1./2.),
+         Point<2> (+1./2, -1./2.),
+         Point<2> (+1,    -1./2.),
+
+         Point<2> (-1.,   0.),
+         Point<2> (-1./2, 0.),
+         Point<2> (+1./2, 0.),
+         Point<2> (+1,    0.),
+
+         Point<2> (-1.,   1./2.),
+         Point<2> (-1./2, 1./2.),
+         Point<2> (0.,    1./2.),
+         Point<2> (+1./2, 1./2.),
+         Point<2> (+1,    1./2.),
+
+         Point<2> (-1.,   1.),
+         Point<2> (-1./2, 1.),
+         Point<2> (0.,    1.),
+         Point<2> (+1./2, 1.),
+         Point<2> (+1,    1.)    };
+      const unsigned int
+        n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
+
+               // From this static list of
+               // vertices, we generate an STL
+               // vector of the vertices, as
+               // this is the data type the
+               // library wants to see.
+      const std::vector<Point<dim> > vertices (&vertices_1[0],
+                 &vertices_1[n_vertices]);
+
+               // Next, we have to define the
+               // cells and the vertices they
+               // contain. Here, we have 8
+               // vertices, but leave the number
+               // open and let it be computed
+               // afterwards:
+      static const int cell_vertices[][GeometryInfo<dim>::vertices_per_cell]
+        = {{0, 1, 6,5},
+     {1, 2, 7, 6},
+     {2, 3, 8, 7},
+     {3, 4, 9, 8},
+     {5, 6, 11, 10},
+     {8, 9, 13, 12},
+     {10, 11, 15, 14},
+     {12, 13, 18, 17},
+     {14, 15, 20, 19},
+     {15, 16, 21, 20},
+     {16, 17, 22, 21},
+     {17, 18, 23, 22}};
+      const unsigned int
+        n_cells = sizeof(cell_vertices) / sizeof(cell_vertices[0]);
+
+               // Again, we generate a C++
+               // vector type from this, but
+               // this time by looping over the
+               // cells (yes, this is
+               // boring). Additionally, we set
+               // the material indicator to zero
+               // for all the cells:
+      std::vector<CellData<dim> > cells (n_cells, CellData<dim>());
+      for (unsigned int i=0; i<n_cells; ++i)
+        {
+    for (unsigned int j=0;
+         j<GeometryInfo<dim>::vertices_per_cell;
+         ++j)
+      cells[i].vertices[j] = cell_vertices[i][j];
+    cells[i].material_id = 0;
+        };
+
+               // Finally pass all this
+               // information to the library to
+               // generate a triangulation. The
+               // last parameter may be used to
+               // pass information about
+               // non-zero boundary indicators
+               // at certain faces of the
+               // triangulation to the library,
+               // but we don't want that here,
+               // so we give an empty object:
+      coarse_grid.create_triangulation (vertices,
+                cells,
+                SubCellData());
+
+               // And since we want that the
+               // evaluation point (3/4,3/4) in
+               // this example is a grid point,
+               // we refine once globally:
+      coarse_grid.refine_global (1);
+    }
+  */
 
 
   template <>
@@ -1800,426 +1800,426 @@ namespace Data
 
 }
 
-                                // @sect4{Discussion}
-                                //
-                                // As you have now read through this
-                                // framework, you may be wondering
-                                // why we have not chosen to
-                                // implement the classes implementing
-                                // a certain setup (like the
-                                // ``CurvedRidges'' class) directly
-                                // as classes derived from
-                                // ``Data::SetUpBase''. Indeed, we
-                                // could have done very well so. The
-                                // only reason is that then we would
-                                // have to have member variables for
-                                // the solution and right hand side
-                                // classes in the ``CurvedRidges''
-                                // class, as well as member functions
-                                // overloading the abstract functions
-                                // of the base class giving access to
-                                // these member variables. The
-                                // ``SetUp'' class has the sole
-                                // reason to relieve us from the need
-                                // to reiterate these member
-                                // variables and functions that would
-                                // be necessary in all such
-                                // classes. In some way, the template
-                                // mechanism here only provides a way
-                                // to have default implementations
-                                // for a number of functions that
-                                // depend on external quantities and
-                                // can thus not be provided using
-                                // normal virtual functions, at least
-                                // not without the help of templates.
-                                //
-                                // However, there might be good
-                                // reasons to actually implement
-                                // classes derived from
-                                // ``Data::SetUpBase'', for example
-                                // if the solution or right hand side
-                                // classes require constructors that
-                                // take arguments, which the
-                                // ``Data::SetUpBase'' class cannot
-                                // provide. In that case, subclassing
-                                // is a worthwhile strategy. Other
-                                // possibilities for special cases
-                                // are to derive from
-                                // ``Data::SetUp<SomeSetUp>'' where
-                                // ``SomeSetUp'' denotes a class, or
-                                // even to explicitly specialize
-                                // ``Data::SetUp<SomeSetUp>''. The
-                                // latter allows to transparently use
-                                // the way the ``SetUp'' class is
-                                // used for other set-ups, but with
-                                // special actions taken for special
-                                // arguments.
-                                //
-                                // A final observation favoring the
-                                // approach taken here is the
-                                // following: we have found numerous
-                                // times that when starting a
-                                // project, the number of parameters
-                                // (usually boundary values, right
-                                // hand side, coarse grid, just as
-                                // here) was small, and the number of
-                                // test cases was small as well. One
-                                // then starts out by handcoding them
-                                // into a number of ``switch''
-                                // statements. Over time, projects
-                                // grow, and so does the number of
-                                // test cases. The number of
-                                // ``switch'' statements grows with
-                                // that, and their length as well,
-                                // and one starts to find ways to
-                                // consider impossible examples where
-                                // domains, boundary values, and
-                                // right hand sides do not fit
-                                // together any more, and starts
-                                // loosing the overview over the
-                                // whole structure. Encapsulating
-                                // everything belonging to a certain
-                                // test case into a structure of its
-                                // own has proven worthwhile for
-                                // this, as it keeps everything that
-                                // belongs to one test case in one
-                                // place. Furthermore, it allows to
-                                // put these things all in one or
-                                // more files that are only devoted
-                                // to test cases and their data,
-                                // without having to bring their
-                                // actual implementation into contact
-                                // with the rest of the program.
-
-
-                                // @sect3{Dual functionals}
-
-                                // As with the other components of
-                                // the program, we put everything we
-                                // need to describe dual functionals
-                                // into a namespace of its own, and
-                                // define an abstract base class that
-                                // provides the interface the class
-                                // solving the dual problem needs for
-                                // its work.
-                                //
-                                // We will then implement two such
-                                // classes, for the evaluation of a
-                                // point value and of the derivative
-                                // of the solution at that point. For
-                                // these functionals we already have
-                                // the corresponding evaluation
-                                // objects, so they are comlementary.
+// @sect4{Discussion}
+//
+// As you have now read through this
+// framework, you may be wondering
+// why we have not chosen to
+// implement the classes implementing
+// a certain setup (like the
+// ``CurvedRidges'' class) directly
+// as classes derived from
+// ``Data::SetUpBase''. Indeed, we
+// could have done very well so. The
+// only reason is that then we would
+// have to have member variables for
+// the solution and right hand side
+// classes in the ``CurvedRidges''
+// class, as well as member functions
+// overloading the abstract functions
+// of the base class giving access to
+// these member variables. The
+// ``SetUp'' class has the sole
+// reason to relieve us from the need
+// to reiterate these member
+// variables and functions that would
+// be necessary in all such
+// classes. In some way, the template
+// mechanism here only provides a way
+// to have default implementations
+// for a number of functions that
+// depend on external quantities and
+// can thus not be provided using
+// normal virtual functions, at least
+// not without the help of templates.
+//
+// However, there might be good
+// reasons to actually implement
+// classes derived from
+// ``Data::SetUpBase'', for example
+// if the solution or right hand side
+// classes require constructors that
+// take arguments, which the
+// ``Data::SetUpBase'' class cannot
+// provide. In that case, subclassing
+// is a worthwhile strategy. Other
+// possibilities for special cases
+// are to derive from
+// ``Data::SetUp<SomeSetUp>'' where
+// ``SomeSetUp'' denotes a class, or
+// even to explicitly specialize
+// ``Data::SetUp<SomeSetUp>''. The
+// latter allows to transparently use
+// the way the ``SetUp'' class is
+// used for other set-ups, but with
+// special actions taken for special
+// arguments.
+//
+// A final observation favoring the
+// approach taken here is the
+// following: we have found numerous
+// times that when starting a
+// project, the number of parameters
+// (usually boundary values, right
+// hand side, coarse grid, just as
+// here) was small, and the number of
+// test cases was small as well. One
+// then starts out by handcoding them
+// into a number of ``switch''
+// statements. Over time, projects
+// grow, and so does the number of
+// test cases. The number of
+// ``switch'' statements grows with
+// that, and their length as well,
+// and one starts to find ways to
+// consider impossible examples where
+// domains, boundary values, and
+// right hand sides do not fit
+// together any more, and starts
+// loosing the overview over the
+// whole structure. Encapsulating
+// everything belonging to a certain
+// test case into a structure of its
+// own has proven worthwhile for
+// this, as it keeps everything that
+// belongs to one test case in one
+// place. Furthermore, it allows to
+// put these things all in one or
+// more files that are only devoted
+// to test cases and their data,
+// without having to bring their
+// actual implementation into contact
+// with the rest of the program.
+
+
+// @sect3{Dual functionals}
+
+// As with the other components of
+// the program, we put everything we
+// need to describe dual functionals
+// into a namespace of its own, and
+// define an abstract base class that
+// provides the interface the class
+// solving the dual problem needs for
+// its work.
+//
+// We will then implement two such
+// classes, for the evaluation of a
+// point value and of the derivative
+// of the solution at that point. For
+// these functionals we already have
+// the corresponding evaluation
+// objects, so they are comlementary.
 namespace DualFunctional
 {
-                                  // @sect4{The DualFunctionalBase class}
-
-                                  // First start with the base class
-                                  // for dual functionals. Since for
-                                  // linear problems the
-                                  // characteristics of the dual
-                                  // problem play a role only in the
-                                  // right hand side, we only need to
-                                  // provide for a function that
-                                  // assembles the right hand side
-                                  // for a given discretization:
+  // @sect4{The DualFunctionalBase class}
+
+  // First start with the base class
+  // for dual functionals. Since for
+  // linear problems the
+  // characteristics of the dual
+  // problem play a role only in the
+  // right hand side, we only need to
+  // provide for a function that
+  // assembles the right hand side
+  // for a given discretization:
   template <int dim>
   class DualFunctionalBase : public Subscriptor
   {
-    public:
-      virtual
-      void
-      assemble_rhs (const DoFHandler<dim> &dof_handler,
-                   Vector<double>        &rhs) const = 0;
+  public:
+    virtual
+    void
+    assemble_rhs (const DoFHandler<dim> &dof_handler,
+                  Vector<double>        &rhs) const = 0;
   };
 
 
-                                  // @sect4{The PointValueEvaluation class}
+  // @sect4{The PointValueEvaluation class}
 
-                                  // As a first application, we
-                                  // consider the functional
-                                  // corresponding to the evaluation
-                                  // of the solution's value at a
-                                  // given point which again we
-                                  // assume to be a vertex. Apart
-                                  // from the constructor that takes
-                                  // and stores the evaluation point,
-                                  // this class consists only of the
-                                  // function that implements
-                                  // assembling the right hand side.
+  // As a first application, we
+  // consider the functional
+  // corresponding to the evaluation
+  // of the solution's value at a
+  // given point which again we
+  // assume to be a vertex. Apart
+  // from the constructor that takes
+  // and stores the evaluation point,
+  // this class consists only of the
+  // function that implements
+  // assembling the right hand side.
   template <int dim>
   class PointValueEvaluation : public DualFunctionalBase<dim>
   {
-    public:
-      PointValueEvaluation (const Point<dim> &evaluation_point);
+  public:
+    PointValueEvaluation (const Point<dim> &evaluation_point);
 
-      virtual
-      void
-      assemble_rhs (const DoFHandler<dim> &dof_handler,
-                   Vector<double>        &rhs) const;
+    virtual
+    void
+    assemble_rhs (const DoFHandler<dim> &dof_handler,
+                  Vector<double>        &rhs) const;
 
-      DeclException1 (ExcEvaluationPointNotFound,
-                     Point<dim>,
-                     << "The evaluation point " << arg1
-                     << " was not found among the vertices of the present grid.");
+    DeclException1 (ExcEvaluationPointNotFound,
+                    Point<dim>,
+                    << "The evaluation point " << arg1
+                    << " was not found among the vertices of the present grid.");
 
 
-      const Point<dim> evaluation_point;
+    const Point<dim> evaluation_point;
   };
 
 
   template <int dim>
   PointValueEvaluation<dim>::
   PointValueEvaluation (const Point<dim> &evaluation_point)
-                 :
-                 evaluation_point (evaluation_point)
+    :
+    evaluation_point (evaluation_point)
   {}
 
 
-                                  // As for doing the main purpose of
-                                  // the class, assembling the right
-                                  // hand side, let us first consider
-                                  // what is necessary: The right
-                                  // hand side of the dual problem is
-                                  // a vector of values J(phi_i),
-                                  // where J is the error functional,
-                                  // and phi_i is the i-th shape
-                                  // function. Here, J is the
-                                  // evaluation at the point x0,
-                                  // i.e. J(phi_i)=phi_i(x0).
-                                  //
-                                  // Now, we have assumed that the
-                                  // evaluation point is a
-                                  // vertex. Thus, for the usual
-                                  // finite elements we might be
-                                  // using in this program, we can
-                                  // take for granted that at such a
-                                  // point exactly one shape function
-                                  // is nonzero, and in particular
-                                  // has the value one. Thus, we set
-                                  // the right hand side vector to
-                                  // all-zeros, then seek for the
-                                  // shape function associated with
-                                  // that point and set the
-                                  // corresponding value of the right
-                                  // hand side vector to one:
+  // As for doing the main purpose of
+  // the class, assembling the right
+  // hand side, let us first consider
+  // what is necessary: The right
+  // hand side of the dual problem is
+  // a vector of values J(phi_i),
+  // where J is the error functional,
+  // and phi_i is the i-th shape
+  // function. Here, J is the
+  // evaluation at the point x0,
+  // i.e. J(phi_i)=phi_i(x0).
+  //
+  // Now, we have assumed that the
+  // evaluation point is a
+  // vertex. Thus, for the usual
+  // finite elements we might be
+  // using in this program, we can
+  // take for granted that at such a
+  // point exactly one shape function
+  // is nonzero, and in particular
+  // has the value one. Thus, we set
+  // the right hand side vector to
+  // all-zeros, then seek for the
+  // shape function associated with
+  // that point and set the
+  // corresponding value of the right
+  // hand side vector to one:
   template <int dim>
   void
   PointValueEvaluation<dim>::
   assemble_rhs (const DoFHandler<dim> &dof_handler,
-               Vector<double>        &rhs) const
+                Vector<double>        &rhs) const
   {
-                                    // So, first set everything to
-                                    // zeros...
+    // So, first set everything to
+    // zeros...
     rhs.reinit (dof_handler.n_dofs());
 
-                                    // ...then loop over cells and
-                                    // find the evaluation point
-                                    // among the vertices (or very
-                                    // close to a vertex, which may
-                                    // happen due to floating point
-                                    // round-off):
+    // ...then loop over cells and
+    // find the evaluation point
+    // among the vertices (or very
+    // close to a vertex, which may
+    // happen due to floating point
+    // round-off):
     typename DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     for (; cell!=endc; ++cell)
       for (unsigned int vertex=0;
-          vertex<GeometryInfo<dim>::vertices_per_cell;
-          ++vertex)
-       if (cell->vertex(vertex).distance(evaluation_point)
-           < cell->diameter()*1e-8)
-         {
-                                            // Ok, found, so set
-                                            // corresponding entry,
-                                            // and leave function
-                                            // since we are finished:
-           rhs(cell->vertex_dof_index(vertex,0)) = 1;
-           return;
-         };
-
-                                    // Finally, a sanity check: if we
-                                    // somehow got here, then we must
-                                    // have missed the evaluation
-                                    // point, so raise an exception
-                                    // unconditionally:
+           vertex<GeometryInfo<dim>::vertices_per_cell;
+           ++vertex)
+        if (cell->vertex(vertex).distance(evaluation_point)
+            < cell->diameter()*1e-8)
+          {
+            // Ok, found, so set
+            // corresponding entry,
+            // and leave function
+            // since we are finished:
+            rhs(cell->vertex_dof_index(vertex,0)) = 1;
+            return;
+          };
+
+    // Finally, a sanity check: if we
+    // somehow got here, then we must
+    // have missed the evaluation
+    // point, so raise an exception
+    // unconditionally:
     AssertThrow (false, ExcEvaluationPointNotFound(evaluation_point));
   }
 
 
-                                  // @sect4{The PointXDerivativeEvaluation class}
+  // @sect4{The PointXDerivativeEvaluation class}
 
-                                  // As second application, we again
-                                  // consider the evaluation of the
-                                  // x-derivative of the solution at
-                                  // one point. Again, the
-                                  // declaration of the class, and
-                                  // the implementation of its
-                                  // constructor is not too
-                                  // interesting:
+  // As second application, we again
+  // consider the evaluation of the
+  // x-derivative of the solution at
+  // one point. Again, the
+  // declaration of the class, and
+  // the implementation of its
+  // constructor is not too
+  // interesting:
   template <int dim>
   class PointXDerivativeEvaluation : public DualFunctionalBase<dim>
   {
-    public:
-      PointXDerivativeEvaluation (const Point<dim> &evaluation_point);
+  public:
+    PointXDerivativeEvaluation (const Point<dim> &evaluation_point);
 
-      virtual
-      void
-      assemble_rhs (const DoFHandler<dim> &dof_handler,
-                   Vector<double>        &rhs) const;
+    virtual
+    void
+    assemble_rhs (const DoFHandler<dim> &dof_handler,
+                  Vector<double>        &rhs) const;
 
-      DeclException1 (ExcEvaluationPointNotFound,
-                     Point<dim>,
-                     << "The evaluation point " << arg1
-                     << " was not found among the vertices of the present grid.");
+    DeclException1 (ExcEvaluationPointNotFound,
+                    Point<dim>,
+                    << "The evaluation point " << arg1
+                    << " was not found among the vertices of the present grid.");
 
 
-      const Point<dim> evaluation_point;
+    const Point<dim> evaluation_point;
   };
 
 
   template <int dim>
   PointXDerivativeEvaluation<dim>::
   PointXDerivativeEvaluation (const Point<dim> &evaluation_point)
-                 :
-                 evaluation_point (evaluation_point)
+    :
+    evaluation_point (evaluation_point)
   {}
 
 
-                                  // What is interesting is the
-                                  // implementation of this
-                                  // functional: here,
-                                  // J(phi_i)=d/dx phi_i(x0).
-                                  //
-                                  // We could, as in the
-                                  // implementation of the respective
-                                  // evaluation object take the
-                                  // average of the gradients of each
-                                  // shape function phi_i at this
-                                  // evaluation point. However, we
-                                  // take a slightly different
-                                  // approach: we simply take the
-                                  // average over all cells that
-                                  // surround this point. The
-                                  // question which cells
-                                  // ``surrounds'' the evaluation
-                                  // point is made dependent on the
-                                  // mesh width by including those
-                                  // cells for which the distance of
-                                  // the cell's midpoint to the
-                                  // evaluation point is less than
-                                  // the cell's diameter.
-                                  //
-                                  // Taking the average of the
-                                  // gradient over the area/volume of
-                                  // these cells leads to a dual
-                                  // solution which is very close to
-                                  // the one which would result from
-                                  // the point evaluation of the
-                                  // gradient. It is simple to
-                                  // justify theoretically that this
-                                  // does not change the method
-                                  // significantly.
+  // What is interesting is the
+  // implementation of this
+  // functional: here,
+  // J(phi_i)=d/dx phi_i(x0).
+  //
+  // We could, as in the
+  // implementation of the respective
+  // evaluation object take the
+  // average of the gradients of each
+  // shape function phi_i at this
+  // evaluation point. However, we
+  // take a slightly different
+  // approach: we simply take the
+  // average over all cells that
+  // surround this point. The
+  // question which cells
+  // ``surrounds'' the evaluation
+  // point is made dependent on the
+  // mesh width by including those
+  // cells for which the distance of
+  // the cell's midpoint to the
+  // evaluation point is less than
+  // the cell's diameter.
+  //
+  // Taking the average of the
+  // gradient over the area/volume of
+  // these cells leads to a dual
+  // solution which is very close to
+  // the one which would result from
+  // the point evaluation of the
+  // gradient. It is simple to
+  // justify theoretically that this
+  // does not change the method
+  // significantly.
   template <int dim>
   void
   PointXDerivativeEvaluation<dim>::
   assemble_rhs (const DoFHandler<dim> &dof_handler,
-               Vector<double>        &rhs) const
+                Vector<double>        &rhs) const
   {
-                                    // Again, first set all entries
-                                    // to zero:
+    // Again, first set all entries
+    // to zero:
     rhs.reinit (dof_handler.n_dofs());
 
-                                    // Initialize a ``FEValues''
-                                    // object with a quadrature
-                                    // formula, have abbreviations
-                                    // for the number of quadrature
-                                    // points and shape functions...
+    // Initialize a ``FEValues''
+    // object with a quadrature
+    // formula, have abbreviations
+    // for the number of quadrature
+    // points and shape functions...
     QGauss<dim> quadrature(4);
     MappingQ<dim> mapping (4);
     FEValues<dim>  fe_values (mapping, dof_handler.get_fe(), quadrature,
-                             update_gradients |
-                             update_q_points  |
-                             update_JxW_values);
+                              update_gradients |
+                              update_q_points  |
+                              update_JxW_values);
     const unsigned int n_q_points = fe_values.n_quadrature_points;
     const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell;
 
-                                    // ...and have two objects that
-                                    // are used to store the global
-                                    // indices of the degrees of
-                                    // freedom on a cell, and the
-                                    // values of the gradients of the
-                                    // shape functions at the
-                                    // quadrature points:
+    // ...and have two objects that
+    // are used to store the global
+    // indices of the degrees of
+    // freedom on a cell, and the
+    // values of the gradients of the
+    // shape functions at the
+    // quadrature points:
     Vector<double> cell_rhs (dofs_per_cell);
     std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
-                                    // Finally have a variable in
-                                    // which we will sum up the
-                                    // area/volume of the cells over
-                                    // which we integrate, by
-                                    // integrating the unit functions
-                                    // on these cells:
+    // Finally have a variable in
+    // which we will sum up the
+    // area/volume of the cells over
+    // which we integrate, by
+    // integrating the unit functions
+    // on these cells:
     double total_volume = 0;
 
-                                    // Then start the loop over all
-                                    // cells, and select those cells
-                                    // which are close enough to the
-                                    // evaluation point:
+    // Then start the loop over all
+    // cells, and select those cells
+    // which are close enough to the
+    // evaluation point:
     typename DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     for (; cell!=endc; ++cell)
       if (cell->center().distance(evaluation_point) <=
-         cell->diameter())
-       {
-                                          // If we have found such a
-                                          // cell, then initialize
-                                          // the ``FEValues'' object
-                                          // and integrate the
-                                          // x-component of the
-                                          // gradient of each shape
-                                          // function, as well as the
-                                          // unit function for the
-                                          // total area/volume.
-         fe_values.reinit (cell);
-         cell_rhs = 0;
-
-         for (unsigned int q=0; q<n_q_points; ++q)
-           {
-             for (unsigned int i=0; i<dofs_per_cell; ++i)
-               cell_rhs(i) += fe_values.shape_grad(i,q)[0] *
-                              fe_values.JxW (q);
-             total_volume += fe_values.JxW (q);
-           };
-
-                                          // If we have the local
-                                          // contributions,
-                                          // distribute them to the
-                                          // global vector:
-         cell->get_dof_indices (local_dof_indices);
-         for (unsigned int i=0; i<dofs_per_cell; ++i)
-           rhs(local_dof_indices[i]) += cell_rhs(i);
-       };
-
-                                    // After we have looped over all
-                                    // cells, check whether we have
-                                    // found any at all, by making
-                                    // sure that their volume is
-                                    // non-zero. If not, then the
-                                    // results will be botched, as
-                                    // the right hand side should
-                                    // then still be zero, so throw
-                                    // an exception:
+          cell->diameter())
+        {
+          // If we have found such a
+          // cell, then initialize
+          // the ``FEValues'' object
+          // and integrate the
+          // x-component of the
+          // gradient of each shape
+          // function, as well as the
+          // unit function for the
+          // total area/volume.
+          fe_values.reinit (cell);
+          cell_rhs = 0;
+
+          for (unsigned int q=0; q<n_q_points; ++q)
+            {
+              for (unsigned int i=0; i<dofs_per_cell; ++i)
+                cell_rhs(i) += fe_values.shape_grad(i,q)[0] *
+                               fe_values.JxW (q);
+              total_volume += fe_values.JxW (q);
+            };
+
+          // If we have the local
+          // contributions,
+          // distribute them to the
+          // global vector:
+          cell->get_dof_indices (local_dof_indices);
+          for (unsigned int i=0; i<dofs_per_cell; ++i)
+            rhs(local_dof_indices[i]) += cell_rhs(i);
+        };
+
+    // After we have looped over all
+    // cells, check whether we have
+    // found any at all, by making
+    // sure that their volume is
+    // non-zero. If not, then the
+    // results will be botched, as
+    // the right hand side should
+    // then still be zero, so throw
+    // an exception:
     AssertThrow (total_volume > 0,
-                ExcEvaluationPointNotFound(evaluation_point));
-
-                                    // Finally, we have by now only
-                                    // integrated the gradients of
-                                    // the shape functions, not
-                                    // taking their mean value. We
-                                    // fix this by dividing by the
-                                    // measure of the volume over
-                                    // which we have integrated:
+                 ExcEvaluationPointNotFound(evaluation_point));
+
+    // Finally, we have by now only
+    // integrated the gradients of
+    // the shape functions, not
+    // taking their mean value. We
+    // fix this by dividing by the
+    // measure of the volume over
+    // which we have integrated:
     rhs.scale (1./total_volume);
   }
 
@@ -2227,79 +2227,79 @@ namespace DualFunctional
 }
 
 
-                                // @sect3{Extending the LaplaceSolver namespace}
+// @sect3{Extending the LaplaceSolver namespace}
 namespace LaplaceSolver
 {
 
-                                  // @sect4{The DualSolver class}
-
-                                  // In the same way as the
-                                  // ``PrimalSolver'' class above, we
-                                  // now implement a
-                                  // ``DualSolver''. It has all the
-                                  // same features, the only
-                                  // difference is that it does not
-                                  // take a function object denoting
-                                  // a right hand side object, but
-                                  // now takes a
-                                  // ``DualFunctionalBase'' object
-                                  // that will assemble the right
-                                  // hand side vector of the dual
-                                  // problem. The rest of the class
-                                  // is rather trivial.
-                                  //
-                                  // Since both primal and dual
-                                  // solver will use the same
-                                  // triangulation, but different
-                                  // discretizations, it now becomes
-                                  // clear why we have made the
-                                  // ``Base'' class a virtual one:
-                                  // since the final class will be
-                                  // derived from both
-                                  // ``PrimalSolver'' as well as
-                                  // ``DualSolver'', it would have
-                                  // two ``Base'' instances, would we
-                                  // not have marked the inheritance
-                                  // as virtual. Since in many
-                                  // applications the base class
-                                  // would store much more
-                                  // information than just the
-                                  // triangulation which needs to be
-                                  // shared between primal and dual
-                                  // solvers, we do not usually want
-                                  // to use two such base classes.
+  // @sect4{The DualSolver class}
+
+  // In the same way as the
+  // ``PrimalSolver'' class above, we
+  // now implement a
+  // ``DualSolver''. It has all the
+  // same features, the only
+  // difference is that it does not
+  // take a function object denoting
+  // a right hand side object, but
+  // now takes a
+  // ``DualFunctionalBase'' object
+  // that will assemble the right
+  // hand side vector of the dual
+  // problem. The rest of the class
+  // is rather trivial.
+  //
+  // Since both primal and dual
+  // solver will use the same
+  // triangulation, but different
+  // discretizations, it now becomes
+  // clear why we have made the
+  // ``Base'' class a virtual one:
+  // since the final class will be
+  // derived from both
+  // ``PrimalSolver'' as well as
+  // ``DualSolver'', it would have
+  // two ``Base'' instances, would we
+  // not have marked the inheritance
+  // as virtual. Since in many
+  // applications the base class
+  // would store much more
+  // information than just the
+  // triangulation which needs to be
+  // shared between primal and dual
+  // solvers, we do not usually want
+  // to use two such base classes.
   template <int dim>
   class DualSolver : public Solver<dim>
   {
-    public:
-      DualSolver (Triangulation<dim>       &triangulation,
-                 const FiniteElement<dim> &fe,
-                 const Quadrature<dim>    &quadrature,
-                 const Quadrature<dim-1>  &face_quadrature,
-                 const DualFunctional::DualFunctionalBase<dim> &dual_functional);
+  public:
+    DualSolver (Triangulation<dim>       &triangulation,
+                const FiniteElement<dim> &fe,
+                const Quadrature<dim>    &quadrature,
+                const Quadrature<dim-1>  &face_quadrature,
+                const DualFunctional::DualFunctionalBase<dim> &dual_functional);
 
-      virtual
-      void
-      solve_problem ();
+    virtual
+    void
+    solve_problem ();
 
-      virtual
-      unsigned int
-      n_dofs () const;
+    virtual
+    unsigned int
+    n_dofs () const;
 
-      virtual
-      void
-      postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const;
+    virtual
+    void
+    postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const;
 
 
-      const SmartPointer<const DualFunctional::DualFunctionalBase<dim> > dual_functional;
-      virtual void assemble_rhs (Vector<double> &rhs) const;
+    const SmartPointer<const DualFunctional::DualFunctionalBase<dim> > dual_functional;
+    virtual void assemble_rhs (Vector<double> &rhs) const;
 
-      static const ZeroFunction<dim> boundary_values;
+    static const ZeroFunction<dim> boundary_values;
 
-                                      // Same as above -- make a
-                                      // derived class a friend of
-                                      // this one:
-      friend class WeightedResidual<dim>;
+    // Same as above -- make a
+    // derived class a friend of
+    // this one:
+    friend class WeightedResidual<dim>;
   };
 
   template <int dim>
@@ -2308,16 +2308,16 @@ namespace LaplaceSolver
   template <int dim>
   DualSolver<dim>::
   DualSolver (Triangulation<dim>       &triangulation,
-             const FiniteElement<dim> &fe,
-             const Quadrature<dim>    &quadrature,
-             const Quadrature<dim-1>  &face_quadrature,
-             const DualFunctional::DualFunctionalBase<dim> &dual_functional)
-                 :
-                 Base<dim> (triangulation),
-                 Solver<dim> (triangulation, fe,
-                              quadrature, face_quadrature,
-                              boundary_values),
-                  dual_functional (&dual_functional)
+              const FiniteElement<dim> &fe,
+              const Quadrature<dim>    &quadrature,
+              const Quadrature<dim-1>  &face_quadrature,
+              const DualFunctional::DualFunctionalBase<dim> &dual_functional)
+    :
+    Base<dim> (triangulation),
+    Solver<dim> (triangulation, fe,
+                 quadrature, face_quadrature,
+                 boundary_values),
+    dual_functional (&dual_functional)
   {}
 
 
@@ -2357,306 +2357,306 @@ namespace LaplaceSolver
   }
 
 
-                                  // @sect4{The WeightedResidual class}
-
-                                  // Here finally comes the main
-                                  // class of this program, the one
-                                  // that implements the dual
-                                  // weighted residual error
-                                  // estimator. It joins the primal
-                                  // and dual solver classes to use
-                                  // them for the computation of
-                                  // primal and dual solutions, and
-                                  // implements the error
-                                  // representation formula for use
-                                  // as error estimate and mesh
-                                  // refinement.
-                                  //
-                                  // The first few of the functions
-                                  // of this class are mostly
-                                  // overriders of the respective
-                                  // functions of the base class:
+  // @sect4{The WeightedResidual class}
+
+  // Here finally comes the main
+  // class of this program, the one
+  // that implements the dual
+  // weighted residual error
+  // estimator. It joins the primal
+  // and dual solver classes to use
+  // them for the computation of
+  // primal and dual solutions, and
+  // implements the error
+  // representation formula for use
+  // as error estimate and mesh
+  // refinement.
+  //
+  // The first few of the functions
+  // of this class are mostly
+  // overriders of the respective
+  // functions of the base class:
   template <int dim>
   class WeightedResidual : public PrimalSolver<dim>,
-                          public DualSolver<dim>
+    public DualSolver<dim>
   {
-    public:
-      WeightedResidual (Triangulation<dim>       &coarse_grid,
-                       const FiniteElement<dim> &primal_fe,
-                       const FiniteElement<dim> &dual_fe,
-                       const Quadrature<dim>    &quadrature,
-                       const Quadrature<dim-1>  &face_quadrature,
-                       const Function<dim>      &rhs_function,
-                       const Function<dim>      &boundary_values,
-                       const DualFunctional::DualFunctionalBase<dim> &dual_functional);
-
-      virtual
-      void
-      solve_problem ();
-
-      virtual
-      void
-      postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const;
-
-      virtual
-      unsigned int
-      n_dofs () const;
-
-      virtual void refine_grid ();
-
-      virtual
-      void
-      output_solution () const;
-
-
-                                      // In the private section, we
-                                      // have two functions that are
-                                      // used to call the
-                                      // ``solve_problem'' functions
-                                      // of the primal and dual base
-                                      // classes. These two functions
-                                      // will be called in parallel
-                                      // by the ``solve_problem''
-                                      // function of this class.
-      void solve_primal_problem ();
-      void solve_dual_problem ();
-                                      // Then declare abbreviations
-                                      // for active cell iterators,
-                                      // to avoid that we have to
-                                      // write this lengthy name
-                                      // over and over again:
-
-      typedef
-      typename DoFHandler<dim>::active_cell_iterator
-      active_cell_iterator;
-
-                                      // Next, declare a data type
-                                      // that we will us to store the
-                                      // contribution of faces to the
-                                      // error estimator. The idea is
-                                      // that we can compute the face
-                                      // terms from each of the two
-                                      // cells to this face, as they
-                                      // are the same when viewed
-                                      // from both sides. What we
-                                      // will do is to compute them
-                                      // only once, based on some
-                                      // rules explained below which
-                                      // of the two adjacent cells
-                                      // will be in charge to do
-                                      // so. We then store the
-                                      // contribution of each face in
-                                      // a map mapping faces to their
-                                      // values, and only collect the
-                                      // contributions for each cell
-                                      // by looping over the cells a
-                                      // second time and grabbing the
-                                      // values from the map.
-                                      //
-                                      // The data type of this map is
-                                      // declared here:
-      typedef
-      typename std::map<typename DoFHandler<dim>::face_iterator,double>
-      FaceIntegrals;
-
-                                      // In the computation of the
-                                      // error estimates on cells and
-                                      // faces, we need a number of
-                                      // helper objects, such as
-                                      // ``FEValues'' and
-                                      // ``FEFaceValues'' functions,
-                                      // but also temporary objects
-                                      // storing the values and
-                                      // gradients of primal and dual
-                                      // solutions, for
-                                      // example. These fields are
-                                      // needed in the three
-                                      // functions that do the
-                                      // integration on cells, and
-                                      // regular and irregular faces,
-                                      // respectively.
-                                      //
-                                      // There are three reasonable
-                                      // ways to provide these
-                                      // fields: first, as local
-                                      // variables in the function
-                                      // that needs them; second, as
-                                      // member variables of this
-                                      // class; third, as arguments
-                                      // passed to that function.
-                                      //
-                                      // These three alternatives all
-                                      // have drawbacks: the third
-                                      // that their number is not
-                                      // neglectable and would make
-                                      // calling these functions a
-                                      // lengthy enterprise. The
-                                      // second has the drawback that
-                                      // it disallows
-                                      // parallelization, since the
-                                      // threads that will compute
-                                      // the error estimate have to
-                                      // have their own copies of
-                                      // these variables each, so
-                                      // member variables of the
-                                      // enclosing class will not
-                                      // work. The first approach,
-                                      // although straightforward,
-                                      // has a subtle but important
-                                      // drawback: we will call these
-                                      // functions over and over
-                                      // again, many thousand times
-                                      // maybe; it has now turned out
-                                      // that allocating vectors and
-                                      // other objects that need
-                                      // memory from the heap is an
-                                      // expensive business in terms
-                                      // of run-time, since memory
-                                      // allocation is expensive when
-                                      // several threads are
-                                      // involved. In our experience,
-                                      // more than 20 per cent of the
-                                      // total run time of error
-                                      // estimation functions are due
-                                      // to memory allocation, if
-                                      // done on a per-call level. It
-                                      // is thus significantly better
-                                      // to allocate the memory only
-                                      // once, and recycle the
-                                      // objects as often as
-                                      // possible.
-                                      //
-                                      // What to do? Our answer is to
-                                      // use a variant of the third
-                                      // strategy, namely generating
-                                      // these variables once in the
-                                      // main function of each
-                                      // thread, and passing them
-                                      // down to the functions that
-                                      // do the actual work. To avoid
-                                      // that we have to give these
-                                      // functions a dozen or so
-                                      // arguments, we pack all these
-                                      // variables into two
-                                      // structures, one which is
-                                      // used for the computations on
-                                      // cells, the other doing them
-                                      // on the faces. Instead of
-                                      // many individual objects, we
-                                      // will then only pass one such
-                                      // object to these functions,
-                                      // making their calling
-                                      // sequence simpler.
-      struct CellData
-      {
-         MappingQ<dim> mapping;
-         FEValues<dim>    fe_values;
-         const SmartPointer<const Function<dim> > right_hand_side;
-
-         std::vector<double> cell_residual;
-         std::vector<double> rhs_values;
-         std::vector<double> dual_weights;
-         typename std::vector<Tensor<2,dim> > cell_grad_grads;
-         CellData (const FiniteElement<dim> &fe,
-                   const Quadrature<dim>    &quadrature,
-                   const Function<dim>      &right_hand_side);
-      };
+  public:
+    WeightedResidual (Triangulation<dim>       &coarse_grid,
+                      const FiniteElement<dim> &primal_fe,
+                      const FiniteElement<dim> &dual_fe,
+                      const Quadrature<dim>    &quadrature,
+                      const Quadrature<dim-1>  &face_quadrature,
+                      const Function<dim>      &rhs_function,
+                      const Function<dim>      &boundary_values,
+                      const DualFunctional::DualFunctionalBase<dim> &dual_functional);
+
+    virtual
+    void
+    solve_problem ();
+
+    virtual
+    void
+    postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const;
+
+    virtual
+    unsigned int
+    n_dofs () const;
+
+    virtual void refine_grid ();
+
+    virtual
+    void
+    output_solution () const;
+
+
+    // In the private section, we
+    // have two functions that are
+    // used to call the
+    // ``solve_problem'' functions
+    // of the primal and dual base
+    // classes. These two functions
+    // will be called in parallel
+    // by the ``solve_problem''
+    // function of this class.
+    void solve_primal_problem ();
+    void solve_dual_problem ();
+    // Then declare abbreviations
+    // for active cell iterators,
+    // to avoid that we have to
+    // write this lengthy name
+    // over and over again:
 
-      struct FaceData
-      {
-         MappingQ<dim> mapping;
-         FEFaceValues<dim>    fe_face_values_cell;
-         FEFaceValues<dim>    fe_face_values_neighbor;
-         FESubfaceValues<dim> fe_subface_values_cell;
-
-         std::vector<double> jump_residual;
-         std::vector<double> dual_weights;
-         typename std::vector<Tensor<1,dim> > cell_grads;
-         typename std::vector<Tensor<1,dim> > neighbor_grads;
-         FaceData (const FiniteElement<dim> &fe,
-                   const Quadrature<dim-1>  &face_quadrature);
-      };
+    typedef
+    typename DoFHandler<dim>::active_cell_iterator
+    active_cell_iterator;
+
+    // Next, declare a data type
+    // that we will us to store the
+    // contribution of faces to the
+    // error estimator. The idea is
+    // that we can compute the face
+    // terms from each of the two
+    // cells to this face, as they
+    // are the same when viewed
+    // from both sides. What we
+    // will do is to compute them
+    // only once, based on some
+    // rules explained below which
+    // of the two adjacent cells
+    // will be in charge to do
+    // so. We then store the
+    // contribution of each face in
+    // a map mapping faces to their
+    // values, and only collect the
+    // contributions for each cell
+    // by looping over the cells a
+    // second time and grabbing the
+    // values from the map.
+    //
+    // The data type of this map is
+    // declared here:
+    typedef
+    typename std::map<typename DoFHandler<dim>::face_iterator,double>
+    FaceIntegrals;
+
+    // In the computation of the
+    // error estimates on cells and
+    // faces, we need a number of
+    // helper objects, such as
+    // ``FEValues'' and
+    // ``FEFaceValues'' functions,
+    // but also temporary objects
+    // storing the values and
+    // gradients of primal and dual
+    // solutions, for
+    // example. These fields are
+    // needed in the three
+    // functions that do the
+    // integration on cells, and
+    // regular and irregular faces,
+    // respectively.
+    //
+    // There are three reasonable
+    // ways to provide these
+    // fields: first, as local
+    // variables in the function
+    // that needs them; second, as
+    // member variables of this
+    // class; third, as arguments
+    // passed to that function.
+    //
+    // These three alternatives all
+    // have drawbacks: the third
+    // that their number is not
+    // neglectable and would make
+    // calling these functions a
+    // lengthy enterprise. The
+    // second has the drawback that
+    // it disallows
+    // parallelization, since the
+    // threads that will compute
+    // the error estimate have to
+    // have their own copies of
+    // these variables each, so
+    // member variables of the
+    // enclosing class will not
+    // work. The first approach,
+    // although straightforward,
+    // has a subtle but important
+    // drawback: we will call these
+    // functions over and over
+    // again, many thousand times
+    // maybe; it has now turned out
+    // that allocating vectors and
+    // other objects that need
+    // memory from the heap is an
+    // expensive business in terms
+    // of run-time, since memory
+    // allocation is expensive when
+    // several threads are
+    // involved. In our experience,
+    // more than 20 per cent of the
+    // total run time of error
+    // estimation functions are due
+    // to memory allocation, if
+    // done on a per-call level. It
+    // is thus significantly better
+    // to allocate the memory only
+    // once, and recycle the
+    // objects as often as
+    // possible.
+    //
+    // What to do? Our answer is to
+    // use a variant of the third
+    // strategy, namely generating
+    // these variables once in the
+    // main function of each
+    // thread, and passing them
+    // down to the functions that
+    // do the actual work. To avoid
+    // that we have to give these
+    // functions a dozen or so
+    // arguments, we pack all these
+    // variables into two
+    // structures, one which is
+    // used for the computations on
+    // cells, the other doing them
+    // on the faces. Instead of
+    // many individual objects, we
+    // will then only pass one such
+    // object to these functions,
+    // making their calling
+    // sequence simpler.
+    struct CellData
+    {
+      MappingQ<dim> mapping;
+      FEValues<dim>    fe_values;
+      const SmartPointer<const Function<dim> > right_hand_side;
+
+      std::vector<double> cell_residual;
+      std::vector<double> rhs_values;
+      std::vector<double> dual_weights;
+      typename std::vector<Tensor<2,dim> > cell_grad_grads;
+      CellData (const FiniteElement<dim> &fe,
+                const Quadrature<dim>    &quadrature,
+                const Function<dim>      &right_hand_side);
+    };
+
+    struct FaceData
+    {
+      MappingQ<dim> mapping;
+      FEFaceValues<dim>    fe_face_values_cell;
+      FEFaceValues<dim>    fe_face_values_neighbor;
+      FESubfaceValues<dim> fe_subface_values_cell;
+
+      std::vector<double> jump_residual;
+      std::vector<double> dual_weights;
+      typename std::vector<Tensor<1,dim> > cell_grads;
+      typename std::vector<Tensor<1,dim> > neighbor_grads;
+      FaceData (const FiniteElement<dim> &fe,
+                const Quadrature<dim-1>  &face_quadrature);
+    };
 
 
 
-                                      // Regarding the evaluation of
-                                      // the error estimator, we have
-                                      // two driver functions that do
-                                      // this: the first is called to
-                                      // generate the cell-wise
-                                      // estimates, and splits up the
-                                      // task in a number of threads
-                                      // each of which work on a
-                                      // subset of the cells. The
-                                      // first function will run the
-                                      // second for each of these
-                                      // threads:
-      void estimate_error (Vector<float> &error_indicators) const;
-
-      void estimate_some (const Vector<double> &primal_solution,
-                         const Vector<double> &dual_weights,
-                         const unsigned int    n_threads,
-                         const unsigned int    this_thread,
-                         Vector<float>        &error_indicators,
-                         FaceIntegrals        &face_integrals) const;
-
-                                      // Then we have functions that
-                                      // do the actual integration of
-                                      // the error representation
-                                      // formula. They will treat the
-                                      // terms on the cell interiors,
-                                      // on those faces that have no
-                                      // hanging nodes, and on those
-                                      // faces with hanging nodes,
-                                      // respectively:
-      void
-      integrate_over_cell (const active_cell_iterator &cell,
-                          const unsigned int          cell_index,
-                          const Vector<double>       &primal_solution,
-                          const Vector<double>       &dual_weights,
-                          CellData                   &cell_data,
-                          Vector<float>              &error_indicators) const;
-
-      void
-      integrate_over_regular_face (const active_cell_iterator &cell,
-                                  const unsigned int          face_no,
-                                  const Vector<double>       &primal_solution,
-                                  const Vector<double>       &dual_weights,
-                                  FaceData                   &face_data,
-                                  FaceIntegrals              &face_integrals) const;
-      void
-      integrate_over_irregular_face (const active_cell_iterator &cell,
-                                    const unsigned int          face_no,
-                                    const Vector<double>       &primal_solution,
-                                    const Vector<double>       &dual_weights,
-                                    FaceData                   &face_data,
-                                    FaceIntegrals              &face_integrals) const;
+    // Regarding the evaluation of
+    // the error estimator, we have
+    // two driver functions that do
+    // this: the first is called to
+    // generate the cell-wise
+    // estimates, and splits up the
+    // task in a number of threads
+    // each of which work on a
+    // subset of the cells. The
+    // first function will run the
+    // second for each of these
+    // threads:
+    void estimate_error (Vector<float> &error_indicators) const;
+
+    void estimate_some (const Vector<double> &primal_solution,
+                        const Vector<double> &dual_weights,
+                        const unsigned int    n_threads,
+                        const unsigned int    this_thread,
+                        Vector<float>        &error_indicators,
+                        FaceIntegrals        &face_integrals) const;
+
+    // Then we have functions that
+    // do the actual integration of
+    // the error representation
+    // formula. They will treat the
+    // terms on the cell interiors,
+    // on those faces that have no
+    // hanging nodes, and on those
+    // faces with hanging nodes,
+    // respectively:
+    void
+    integrate_over_cell (const active_cell_iterator &cell,
+                         const unsigned int          cell_index,
+                         const Vector<double>       &primal_solution,
+                         const Vector<double>       &dual_weights,
+                         CellData                   &cell_data,
+                         Vector<float>              &error_indicators) const;
+
+    void
+    integrate_over_regular_face (const active_cell_iterator &cell,
+                                 const unsigned int          face_no,
+                                 const Vector<double>       &primal_solution,
+                                 const Vector<double>       &dual_weights,
+                                 FaceData                   &face_data,
+                                 FaceIntegrals              &face_integrals) const;
+    void
+    integrate_over_irregular_face (const active_cell_iterator &cell,
+                                   const unsigned int          face_no,
+                                   const Vector<double>       &primal_solution,
+                                   const Vector<double>       &dual_weights,
+                                   FaceData                   &face_data,
+                                   FaceIntegrals              &face_integrals) const;
   };
 
 
 
-                                  // In the implementation of this
-                                  // class, we first have the
-                                  // constructors of the ``CellData''
-                                  // and ``FaceData'' member classes,
-                                  // and the ``WeightedResidual''
-                                  // constructor. They only
-                                  // initialize fields to their
-                                  // correct lengths, so we do not
-                                  // have to discuss them to length.
+  // In the implementation of this
+  // class, we first have the
+  // constructors of the ``CellData''
+  // and ``FaceData'' member classes,
+  // and the ``WeightedResidual''
+  // constructor. They only
+  // initialize fields to their
+  // correct lengths, so we do not
+  // have to discuss them to length.
   template <int dim>
   WeightedResidual<dim>::CellData::
   CellData (const FiniteElement<dim> &fe,
-           const Quadrature<dim>    &quadrature,
-           const Function<dim>      &right_hand_side)
-                 :
-                 mapping (4),
-                 fe_values (mapping, fe, quadrature,
-                            update_values             |
-                            update_second_derivatives |
-                            update_q_points           |
-                            update_JxW_values),
-                 right_hand_side (&right_hand_side)
+            const Quadrature<dim>    &quadrature,
+            const Function<dim>      &right_hand_side)
+    :
+    mapping (4),
+    fe_values (mapping, fe, quadrature,
+               update_values             |
+               update_second_derivatives |
+               update_q_points           |
+               update_JxW_values),
+    right_hand_side (&right_hand_side)
   {
     const unsigned int n_q_points
       = quadrature.n_quadrature_points;
@@ -2672,21 +2672,21 @@ namespace LaplaceSolver
   template <int dim>
   WeightedResidual<dim>::FaceData::
   FaceData (const FiniteElement<dim> &fe,
-           const Quadrature<dim-1>  &face_quadrature)
-                 :
-                 mapping (4),
-                 fe_face_values_cell (mapping, fe, face_quadrature,
-                                      update_values        |
-                                      update_gradients     |
-                                      update_JxW_values    |
-                                      update_normal_vectors),
-                 fe_face_values_neighbor (mapping, fe, face_quadrature,
-                                          update_values     |
-                                          update_gradients  |
-                                          update_JxW_values |
-                                          update_normal_vectors),
-                 fe_subface_values_cell (mapping, fe, face_quadrature,
-                                         update_gradients)
+            const Quadrature<dim-1>  &face_quadrature)
+    :
+    mapping (4),
+    fe_face_values_cell (mapping, fe, face_quadrature,
+                         update_values        |
+                         update_gradients     |
+                         update_JxW_values    |
+                         update_normal_vectors),
+    fe_face_values_neighbor (mapping, fe, face_quadrature,
+                             update_values     |
+                             update_gradients  |
+                             update_JxW_values |
+                             update_normal_vectors),
+    fe_subface_values_cell (mapping, fe, face_quadrature,
+                            update_gradients)
   {
     const unsigned int n_face_q_points
       = face_quadrature.n_quadrature_points;
@@ -2703,33 +2703,33 @@ namespace LaplaceSolver
   template <int dim>
   WeightedResidual<dim>::
   WeightedResidual (Triangulation<dim>       &coarse_grid,
-                   const FiniteElement<dim> &primal_fe,
-                   const FiniteElement<dim> &dual_fe,
-                   const Quadrature<dim>    &quadrature,
-                   const Quadrature<dim-1>  &face_quadrature,
-                   const Function<dim>      &rhs_function,
-                   const Function<dim>      &bv,
-                   const DualFunctional::DualFunctionalBase<dim> &dual_functional)
-                 :
-                 Base<dim> (coarse_grid),
-                  PrimalSolver<dim> (coarse_grid, primal_fe,
-                                    quadrature, face_quadrature,
-                                    rhs_function, bv),
-                  DualSolver<dim> (coarse_grid, dual_fe,
-                                  quadrature, face_quadrature,
-                                  dual_functional)
+                    const FiniteElement<dim> &primal_fe,
+                    const FiniteElement<dim> &dual_fe,
+                    const Quadrature<dim>    &quadrature,
+                    const Quadrature<dim-1>  &face_quadrature,
+                    const Function<dim>      &rhs_function,
+                    const Function<dim>      &bv,
+                    const DualFunctional::DualFunctionalBase<dim> &dual_functional)
+    :
+    Base<dim> (coarse_grid),
+    PrimalSolver<dim> (coarse_grid, primal_fe,
+                       quadrature, face_quadrature,
+                       rhs_function, bv),
+    DualSolver<dim> (coarse_grid, dual_fe,
+                     quadrature, face_quadrature,
+                     dual_functional)
   {}
 
 
-                                  // The next five functions are
-                                  // boring, as they simply relay
-                                  // their work to the base
-                                  // classes. The first calls the
-                                  // primal and dual solvers in
-                                  // parallel, while postprocessing
-                                  // the solution and retrieving the
-                                  // number of degrees of freedom is
-                                  // done by the primal class.
+  // The next five functions are
+  // boring, as they simply relay
+  // their work to the base
+  // classes. The first calls the
+  // primal and dual solvers in
+  // parallel, while postprocessing
+  // the solution and retrieving the
+  // number of degrees of freedom is
+  // done by the primal class.
   template <int dim>
   void
   WeightedResidual<dim>::solve_problem ()
@@ -2774,136 +2774,136 @@ namespace LaplaceSolver
 
 
 
-                                  // Now, it is becoming more
-                                  // interesting: the ``refine_grid''
-                                  // function asks the error
-                                  // estimator to compute the
-                                  // cell-wise error indicators, then
-                                  // uses their absolute values for
-                                  // mesh refinement.
+  // Now, it is becoming more
+  // interesting: the ``refine_grid''
+  // function asks the error
+  // estimator to compute the
+  // cell-wise error indicators, then
+  // uses their absolute values for
+  // mesh refinement.
   template <int dim>
   void
   WeightedResidual<dim>::refine_grid ()
   {
-                                    // First call the function that
-                                    // computes the cell-wise and
-                                    // global error:
+    // First call the function that
+    // computes the cell-wise and
+    // global error:
     Vector<float> error_indicators (this->triangulation->n_active_cells());
     estimate_error (error_indicators);
 
-                                    // Then note that marking cells
-                                    // for refinement or coarsening
-                                    // only works if all indicators
-                                    // are positive, to allow their
-                                    // comparison. Thus, drop the
-                                    // signs on all these indicators:
+    // Then note that marking cells
+    // for refinement or coarsening
+    // only works if all indicators
+    // are positive, to allow their
+    // comparison. Thus, drop the
+    // signs on all these indicators:
     for (Vector<float>::iterator i=error_indicators.begin();
-        i != error_indicators.end(); ++i)
+         i != error_indicators.end(); ++i)
       *i = std::fabs (*i);
 
-                                    // Finally, we can select between
-                                    // different strategies for
-                                    // refinement. The default here
-                                    // is to refine those cells with
-                                    // the largest error indicators
-                                    // that make up for a total of 80
-                                    // per cent of the error, while
-                                    // we coarsen those with the
-                                    // smallest indicators that make
-                                    // up for the bottom 2 per cent
-                                    // of the error.
+    // Finally, we can select between
+    // different strategies for
+    // refinement. The default here
+    // is to refine those cells with
+    // the largest error indicators
+    // that make up for a total of 80
+    // per cent of the error, while
+    // we coarsen those with the
+    // smallest indicators that make
+    // up for the bottom 2 per cent
+    // of the error.
     GridRefinement::refine_and_coarsen_fixed_fraction (*this->triangulation,
-                                                      error_indicators,
-                                                      0.5/std::sqrt(1.+step),
-                                                      0.2/std::sqrt(1.+step));
+                                                       error_indicators,
+                                                       0.5/std::sqrt(1.+step),
+                                                       0.2/std::sqrt(1.+step));
     this->triangulation->execute_coarsening_and_refinement ();
   }
 
 
-                                  // Since we want to output both the
-                                  // primal and the dual solution, we
-                                  // overload the ``output_solution''
-                                  // function. The only interesting
-                                  // feature of this function is that
-                                  // the primal and dual solutions
-                                  // are defined on different finite
-                                  // element spaces, which is not the
-                                  // format the ``DataOut'' class
-                                  // expects. Thus, we have to
-                                  // transfer them to a common finite
-                                  // element space. Since we want the
-                                  // solutions only to see them
-                                  // qualitatively, we contend
-                                  // ourselves with interpolating the
-                                  // dual solution to the (smaller)
-                                  // primal space. For the
-                                  // interpolation, there is a
-                                  // library function, that takes a
-                                  // ``ConstraintMatrix'' object
-                                  // including the hanging node
-                                  // constraints. The rest is
-                                  // standard.
-                                  //
-                                  // There is, however, one
-                                  // work-around worth mentioning: in
-                                  // this function, as in a couple of
-                                  // following ones, we have to
-                                  // access the ``DoFHandler''
-                                  // objects and solutions of both
-                                  // the primal as well as of the
-                                  // dual solver. Since these are
-                                  // members of the ``Solver'' base
-                                  // class which exists twice in the
-                                  // class hierarchy leading to the
-                                  // present class (once as base
-                                  // class of the ``PrimalSolver''
-                                  // class, once as base class of the
-                                  // ``DualSolver'' class), we have
-                                  // to disambiguate accesses to them
-                                  // by telling the compiler a member
-                                  // of which of these two instances
-                                  // we want to access. The way to do
-                                  // this would be identify the
-                                  // member by pointing a path
-                                  // through the class hierarchy
-                                  // which disambiguates the base
-                                  // class, for example writing
-                                  // ``PrimalSolver::dof_handler'' to
-                                  // denote the member variable
-                                  // ``dof_handler'' from the
-                                  // ``Solver'' base class of the
-                                  // ``PrimalSolver''
-                                  // class. Unfortunately, this
-                                  // confuses gcc's version 2.96 (a
-                                  // version that was intended as a
-                                  // development snapshot, but
-                                  // delivered as system compiler by
-                                  // Red Hat in their 7.x releases)
-                                  // so much that it bails out and
-                                  // refuses to compile the code.
-                                  //
-                                  // Thus, we have to work around
-                                  // this problem. We do this by
-                                  // introducing references to the
-                                  // ``PrimalSolver'' and
-                                  // ``DualSolver'' components of the
-                                  // ``WeightedResidual'' object at
-                                  // the beginning of the
-                                  // function. Since each of these
-                                  // has an unambiguous base class
-                                  // ``Solver'', we can access the
-                                  // member variables we want through
-                                  // these references. However, we
-                                  // are now accessing protected
-                                  // member variables of these
-                                  // classes through a pointer other
-                                  // than the ``this'' pointer (in
-                                  // fact, this is of course the
-                                  // ``this'' pointer, but not
-                                  // explicitly). This finally is the
-                                  // reason why we had to declare the
-                                  // present class a friend of the
-                                  // classes we so access.
+  // Since we want to output both the
+  // primal and the dual solution, we
+  // overload the ``output_solution''
+  // function. The only interesting
+  // feature of this function is that
+  // the primal and dual solutions
+  // are defined on different finite
+  // element spaces, which is not the
+  // format the ``DataOut'' class
+  // expects. Thus, we have to
+  // transfer them to a common finite
+  // element space. Since we want the
+  // solutions only to see them
+  // qualitatively, we contend
+  // ourselves with interpolating the
+  // dual solution to the (smaller)
+  // primal space. For the
+  // interpolation, there is a
+  // library function, that takes a
+  // ``ConstraintMatrix'' object
+  // including the hanging node
+  // constraints. The rest is
+  // standard.
+  //
+  // There is, however, one
+  // work-around worth mentioning: in
+  // this function, as in a couple of
+  // following ones, we have to
+  // access the ``DoFHandler''
+  // objects and solutions of both
+  // the primal as well as of the
+  // dual solver. Since these are
+  // members of the ``Solver'' base
+  // class which exists twice in the
+  // class hierarchy leading to the
+  // present class (once as base
+  // class of the ``PrimalSolver''
+  // class, once as base class of the
+  // ``DualSolver'' class), we have
+  // to disambiguate accesses to them
+  // by telling the compiler a member
+  // of which of these two instances
+  // we want to access. The way to do
+  // this would be identify the
+  // member by pointing a path
+  // through the class hierarchy
+  // which disambiguates the base
+  // class, for example writing
+  // ``PrimalSolver::dof_handler'' to
+  // denote the member variable
+  // ``dof_handler'' from the
+  // ``Solver'' base class of the
+  // ``PrimalSolver''
+  // class. Unfortunately, this
+  // confuses gcc's version 2.96 (a
+  // version that was intended as a
+  // development snapshot, but
+  // delivered as system compiler by
+  // Red Hat in their 7.x releases)
+  // so much that it bails out and
+  // refuses to compile the code.
+  //
+  // Thus, we have to work around
+  // this problem. We do this by
+  // introducing references to the
+  // ``PrimalSolver'' and
+  // ``DualSolver'' components of the
+  // ``WeightedResidual'' object at
+  // the beginning of the
+  // function. Since each of these
+  // has an unambiguous base class
+  // ``Solver'', we can access the
+  // member variables we want through
+  // these references. However, we
+  // are now accessing protected
+  // member variables of these
+  // classes through a pointer other
+  // than the ``this'' pointer (in
+  // fact, this is of course the
+  // ``this'' pointer, but not
+  // explicitly). This finally is the
+  // reason why we had to declare the
+  // present class a friend of the
+  // classes we so access.
   template <int dim>
   void
   WeightedResidual<dim>::output_solution () const
@@ -2913,81 +2913,81 @@ namespace LaplaceSolver
 
     ConstraintMatrix primal_hanging_node_constraints;
     DoFTools::make_hanging_node_constraints (primal_solver.dof_handler,
-                                            primal_hanging_node_constraints);
+                                             primal_hanging_node_constraints);
     primal_hanging_node_constraints.close();
     Vector<double> dual_solution (primal_solver.dof_handler.n_dofs());
     FETools::interpolate (dual_solver.dof_handler,
-                         dual_solver.solution,
-                         primal_solver.dof_handler,
-                         primal_hanging_node_constraints,
-                         dual_solution);
-
-                                    // approximate error, gradient,
-                                    // and second derivative
-                                    // information as cell information
+                          dual_solver.solution,
+                          primal_solver.dof_handler,
+                          primal_hanging_node_constraints,
+                          dual_solution);
+
+    // approximate error, gradient,
+    // and second derivative
+    // information as cell information
     Vector<float> error_indicators (this->triangulation->n_active_cells());
     Vector<float> gradient_indicators (this->triangulation->n_active_cells());
     Vector<float> second_indicators (this->triangulation->n_active_cells());
     {
       MappingQ<dim> mapping(4);
       KellyErrorEstimator<dim>::estimate (mapping, primal_solver.dof_handler,
-                                         QGauss<dim-1>(3),
-                                         typename FunctionMap<dim>::type(),
-                                         primal_solver.solution,
-                                         error_indicators);
+                                          QGauss<dim-1>(3),
+                                          typename FunctionMap<dim>::type(),
+                                          primal_solver.solution,
+                                          error_indicators);
 
       DerivativeApproximation::
-       approximate_gradient (mapping,
-                             primal_solver.dof_handler,
-                             primal_solver.solution,
-                             gradient_indicators);
+      approximate_gradient (mapping,
+                            primal_solver.dof_handler,
+                            primal_solver.solution,
+                            gradient_indicators);
 
       DerivativeApproximation::
-       approximate_second_derivative (mapping,
-                                      primal_solver.dof_handler,
-                                      primal_solver.solution,
-                                      second_indicators);
+      approximate_second_derivative (mapping,
+                                     primal_solver.dof_handler,
+                                     primal_solver.solution,
+                                     second_indicators);
 
     }
-                                    // distribute cell to dof vectors
+    // distribute cell to dof vectors
     Vector<double> x_error_indicators (primal_solver.dof_handler.n_dofs());
     Vector<double> x_gradient_indicators (primal_solver.dof_handler.n_dofs());
     Vector<double> x_second_indicators (primal_solver.dof_handler.n_dofs());
     DoFTools::distribute_cell_to_dof_vector (primal_solver.dof_handler,
-                                            error_indicators,
-                                            x_error_indicators);
+                                             error_indicators,
+                                             x_error_indicators);
     DoFTools::distribute_cell_to_dof_vector (primal_solver.dof_handler,
-                                            gradient_indicators,
-                                            x_gradient_indicators);
+                                             gradient_indicators,
+                                             x_gradient_indicators);
     DoFTools::distribute_cell_to_dof_vector (primal_solver.dof_handler,
-                                            second_indicators,
-                                            x_second_indicators);
+                                             second_indicators,
+                                             x_second_indicators);
 
 
 
-                                    // we generate too much output in
-                                    // 3d. instead of doing it that
-                                    // way, simply generate a coarser
-                                    // mesh and output from there
+    // we generate too much output in
+    // 3d. instead of doing it that
+    // way, simply generate a coarser
+    // mesh and output from there
     Triangulation<dim> coarser_mesh;
     coarser_mesh.copy_triangulation (*this->triangulation);
     for (typename Triangulation<dim>::active_cell_iterator
-          cell = coarser_mesh.begin_active();
-        cell != coarser_mesh.end(); ++cell)
+         cell = coarser_mesh.begin_active();
+         cell != coarser_mesh.end(); ++cell)
       cell->set_coarsen_flag();
     coarser_mesh.execute_coarsening_and_refinement ();
 
-                                    // next generate a DoF handler on
-                                    // that mesh and a map fron one
-                                    // to the other mesh
+    // next generate a DoF handler on
+    // that mesh and a map fron one
+    // to the other mesh
     DoFHandler<dim> coarser_dof_handler (coarser_mesh);
     coarser_dof_handler.distribute_dofs (primal_solver.dof_handler.get_fe());
     InterGridMap<DoFHandler<dim> > coarse_to_fine_map;
     coarse_to_fine_map.make_mapping (coarser_dof_handler,
-                                    primal_solver.dof_handler);
+                                     primal_solver.dof_handler);
 
-                                    // finally we have to transfer
-                                    // the data vectors
+    // finally we have to transfer
+    // the data vectors
     Vector<double> coarse_primal_solution (coarser_dof_handler.n_dofs());
     Vector<double> coarse_dual_solution (coarser_dof_handler.n_dofs());
     Vector<double> coarse_error_indicators (coarser_dof_handler.n_dofs());
@@ -2996,23 +2996,23 @@ namespace LaplaceSolver
 
     Vector<double> tmp (coarser_dof_handler.get_fe().dofs_per_cell);
     for (typename DoFHandler<dim>::active_cell_iterator
-          cell = coarser_dof_handler.begin_active();
-        cell != coarser_dof_handler.end(); ++cell)
+         cell = coarser_dof_handler.begin_active();
+         cell != coarser_dof_handler.end(); ++cell)
       {
-       coarse_to_fine_map[cell]->get_interpolated_dof_values (primal_solver.solution,tmp);
-       cell->set_dof_values (tmp, coarse_primal_solution);
+        coarse_to_fine_map[cell]->get_interpolated_dof_values (primal_solver.solution,tmp);
+        cell->set_dof_values (tmp, coarse_primal_solution);
 
-       coarse_to_fine_map[cell]->get_interpolated_dof_values (dual_solution,tmp);
-       cell->set_dof_values (tmp, coarse_dual_solution);
+        coarse_to_fine_map[cell]->get_interpolated_dof_values (dual_solution,tmp);
+        cell->set_dof_values (tmp, coarse_dual_solution);
 
-       coarse_to_fine_map[cell]->get_interpolated_dof_values (x_error_indicators,tmp);
-       cell->set_dof_values (tmp, coarse_error_indicators);
+        coarse_to_fine_map[cell]->get_interpolated_dof_values (x_error_indicators,tmp);
+        cell->set_dof_values (tmp, coarse_error_indicators);
 
-       coarse_to_fine_map[cell]->get_interpolated_dof_values (x_gradient_indicators,tmp);
-       cell->set_dof_values (tmp, coarse_gradient_indicators);
+        coarse_to_fine_map[cell]->get_interpolated_dof_values (x_gradient_indicators,tmp);
+        cell->set_dof_values (tmp, coarse_gradient_indicators);
 
-       coarse_to_fine_map[cell]->get_interpolated_dof_values (x_second_indicators,tmp);
-       cell->set_dof_values (tmp, coarse_second_indicators);
+        coarse_to_fine_map[cell]->get_interpolated_dof_values (x_second_indicators,tmp);
+        cell->set_dof_values (tmp, coarse_second_indicators);
       }
 
     {
@@ -3031,10 +3031,10 @@ namespace LaplaceSolver
       std::ostrstream filename;
 #endif
       filename << "spec2006-447.dealII/"
-              << "solution-"
-              << this->refinement_cycle
-              << ".gmv"
-              << std::ends;
+               << "solution-"
+               << this->refinement_cycle
+               << ".gmv"
+               << std::ends;
 #ifdef HAVE_STD_STRINGSTREAM
       std::ofstream out (filename.str().c_str());
 #else
@@ -3047,17 +3047,17 @@ namespace LaplaceSolver
   }
 
 
-                                  // @sect3{Estimating errors}
+  // @sect3{Estimating errors}
 
-                                  // @sect4{Error estimation driver functions}
-                                  //
-                                  // As for the actual computation of
-                                  // error estimates, let's start
-                                  // with the function that drives
-                                  // all this, i.e. calls those
-                                  // functions that actually do the
-                                  // work, and finally collects the
-                                  // results.
+  // @sect4{Error estimation driver functions}
+  //
+  // As for the actual computation of
+  // error estimates, let's start
+  // with the function that drives
+  // all this, i.e. calls those
+  // functions that actually do the
+  // work, and finally collects the
+  // results.
 
   template <int dim>
   void
@@ -3067,141 +3067,141 @@ namespace LaplaceSolver
     const PrimalSolver<dim> &primal_solver = *this;
     const DualSolver<dim>   &dual_solver   = *this;
 
-                                    // The first task in computing
-                                    // the error is to set up vectors
-                                    // that denote the primal
-                                    // solution, and the weights
-                                    // (z-z_h)=(z-I_hz), both in the
-                                    // finite element space for which
-                                    // we have computed the dual
-                                    // solution. For this, we have to
-                                    // interpolate the primal
-                                    // solution to the dual finite
-                                    // element space, and to subtract
-                                    // the interpolation of the
-                                    // computed dual solution to the
-                                    // primal finite element
-                                    // space. Fortunately, the
-                                    // library provides functions for
-                                    // the interpolation into larger
-                                    // or smaller finite element
-                                    // spaces, so this is mostly
-                                    // obvious.
-                                    //
-                                    // First, let's do that for the
-                                    // primal solution: it is
-                                    // cell-wise interpolated into
-                                    // the finite element space in
-                                    // which we have solved the dual
-                                    // problem: But, again as in the
-                                    // ``WeightedResidual::output_solution''
-                                    // function we first need to
-                                    // create a ConstraintMatrix
-                                    // including the hanging node
-                                    // constraints, but this time of
-                                    // the dual finite element space.
+    // The first task in computing
+    // the error is to set up vectors
+    // that denote the primal
+    // solution, and the weights
+    // (z-z_h)=(z-I_hz), both in the
+    // finite element space for which
+    // we have computed the dual
+    // solution. For this, we have to
+    // interpolate the primal
+    // solution to the dual finite
+    // element space, and to subtract
+    // the interpolation of the
+    // computed dual solution to the
+    // primal finite element
+    // space. Fortunately, the
+    // library provides functions for
+    // the interpolation into larger
+    // or smaller finite element
+    // spaces, so this is mostly
+    // obvious.
+    //
+    // First, let's do that for the
+    // primal solution: it is
+    // cell-wise interpolated into
+    // the finite element space in
+    // which we have solved the dual
+    // problem: But, again as in the
+    // ``WeightedResidual::output_solution''
+    // function we first need to
+    // create a ConstraintMatrix
+    // including the hanging node
+    // constraints, but this time of
+    // the dual finite element space.
     ConstraintMatrix dual_hanging_node_constraints;
     DoFTools::make_hanging_node_constraints (dual_solver.dof_handler,
-                                            dual_hanging_node_constraints);
+                                             dual_hanging_node_constraints);
     dual_hanging_node_constraints.close();
     Vector<double> primal_solution (dual_solver.dof_handler.n_dofs());
     FETools::interpolate (primal_solver.dof_handler,
-                         primal_solver.solution,
-                         dual_solver.dof_handler,
-                         dual_hanging_node_constraints,
-                         primal_solution);
-
-                                    // Then for computing the
-                                    // interpolation of the
-                                    // numerically approximated dual
-                                    // solution z into the finite
-                                    // element space of the primal
-                                    // solution and subtracting it
-                                    // from z: use the
-                                    // ``interpolate_difference''
-                                    // function, that gives (z-I_hz)
-                                    // in the element space of the
-                                    // dual solution.
+                          primal_solver.solution,
+                          dual_solver.dof_handler,
+                          dual_hanging_node_constraints,
+                          primal_solution);
+
+    // Then for computing the
+    // interpolation of the
+    // numerically approximated dual
+    // solution z into the finite
+    // element space of the primal
+    // solution and subtracting it
+    // from z: use the
+    // ``interpolate_difference''
+    // function, that gives (z-I_hz)
+    // in the element space of the
+    // dual solution.
     ConstraintMatrix primal_hanging_node_constraints;
     DoFTools::make_hanging_node_constraints (primal_solver.dof_handler,
-                                            primal_hanging_node_constraints);
+                                             primal_hanging_node_constraints);
     primal_hanging_node_constraints.close();
     Vector<double> dual_weights (dual_solver.dof_handler.n_dofs());
     FETools::interpolation_difference (dual_solver.dof_handler,
-                                      dual_hanging_node_constraints,
-                                      dual_solver.solution,
-                                      primal_solver.dof_handler,
-                                      primal_hanging_node_constraints,
-                                      dual_weights);
-
-                                    // Note that this could probably
-                                    // have been more efficient since
-                                    // those constraints have been
-                                    // used previously when
-                                    // assembling matrix and right
-                                    // hand side for the primal
-                                    // problem and writing out the
-                                    // dual solution. We leave the
-                                    // optimization of the program in
-                                    // this respect as an exercise.
-
-                                    // Having computed the dual
-                                    // weights we now proceed with
-                                    // computing the cell and face
-                                    // residuals of the primal
-                                    // solution. First we set up a
-                                    // map between face iterators and
-                                    // their jump term contributions
-                                    // of faces to the error
-                                    // estimator. The reason is that
-                                    // we compute the jump terms only
-                                    // once, from one side of the
-                                    // face, and want to collect them
-                                    // only afterwards when looping
-                                    // over all cells a second time.
-                                    //
-                                    // We initialize this map already
-                                    // with a value of -1e20 for all
-                                    // faces, since this value will
-                                    // strike in the results if
-                                    // something should go wrong and
-                                    // we fail to compute the value
-                                    // for a face for some
-                                    // reason. Secondly, we
-                                    // initialize the map once before
-                                    // we branch to different threads
-                                    // since this way the map's
-                                    // structure is no more modified
-                                    // by the individual threads,
-                                    // only existing entries are set
-                                    // to new values. This relieves
-                                    // us from the necessity to
-                                    // synchronise the threads
-                                    // through a mutex each time they
-                                    // write to (and modify the
-                                    // structure of) this map.
+                                       dual_hanging_node_constraints,
+                                       dual_solver.solution,
+                                       primal_solver.dof_handler,
+                                       primal_hanging_node_constraints,
+                                       dual_weights);
+
+    // Note that this could probably
+    // have been more efficient since
+    // those constraints have been
+    // used previously when
+    // assembling matrix and right
+    // hand side for the primal
+    // problem and writing out the
+    // dual solution. We leave the
+    // optimization of the program in
+    // this respect as an exercise.
+
+    // Having computed the dual
+    // weights we now proceed with
+    // computing the cell and face
+    // residuals of the primal
+    // solution. First we set up a
+    // map between face iterators and
+    // their jump term contributions
+    // of faces to the error
+    // estimator. The reason is that
+    // we compute the jump terms only
+    // once, from one side of the
+    // face, and want to collect them
+    // only afterwards when looping
+    // over all cells a second time.
+    //
+    // We initialize this map already
+    // with a value of -1e20 for all
+    // faces, since this value will
+    // strike in the results if
+    // something should go wrong and
+    // we fail to compute the value
+    // for a face for some
+    // reason. Secondly, we
+    // initialize the map once before
+    // we branch to different threads
+    // since this way the map's
+    // structure is no more modified
+    // by the individual threads,
+    // only existing entries are set
+    // to new values. This relieves
+    // us from the necessity to
+    // synchronise the threads
+    // through a mutex each time they
+    // write to (and modify the
+    // structure of) this map.
     FaceIntegrals face_integrals;
     for (active_cell_iterator cell=dual_solver.dof_handler.begin_active();
-        cell!=dual_solver.dof_handler.end();
-        ++cell)
+         cell!=dual_solver.dof_handler.end();
+         ++cell)
       for (unsigned int face_no=0;
-          face_no<GeometryInfo<dim>::faces_per_cell;
-          ++face_no)
-       face_integrals[cell->face(face_no)] = -1e20;
-
-                                    // Then set up a vector with
-                                    // error indicators.  Reserve one
-                                    // slot for each cell and set it
-                                    // to zero.
+           face_no<GeometryInfo<dim>::faces_per_cell;
+           ++face_no)
+        face_integrals[cell->face(face_no)] = -1e20;
+
+    // Then set up a vector with
+    // error indicators.  Reserve one
+    // slot for each cell and set it
+    // to zero.
     error_indicators.reinit (dual_solver.dof_handler
-                            .get_tria().n_active_cells());
-
-                                    // Now start a number of threads
-                                    // which compute the error
-                                    // formula on parts of all the
-                                    // cells, and once they are all
-                                    // started wait until they have
-                                    // all finished:
+                             .get_tria().n_active_cells());
+
+    // Now start a number of threads
+    // which compute the error
+    // formula on parts of all the
+    // cells, and once they are all
+    // started wait until they have
+    // all finished:
     const unsigned int n_threads = multithread_info.n_default_threads;
     Threads::ThreadGroup<> threads;
     for (unsigned int i=0; i<n_threads; ++i)
@@ -3213,890 +3213,891 @@ namespace LaplaceSolver
                   face_integrals);
     threads.join_all();
 
-                                    // Once the error contributions
-                                    // are computed, sum them up. For
-                                    // this, note that the cell terms
-                                    // are already set, and that only
-                                    // the edge terms need to be
-                                    // collected. Thus, loop over all
-                                    // cells and their faces, make
-                                    // sure that the contributions of
-                                    // each of the faces are there,
-                                    // and add them up. Only take
-                                    // minus one half of the jump
-                                    // term, since the other half
-                                    // will be taken by the
-                                    // neighboring cell.
+    // Once the error contributions
+    // are computed, sum them up. For
+    // this, note that the cell terms
+    // are already set, and that only
+    // the edge terms need to be
+    // collected. Thus, loop over all
+    // cells and their faces, make
+    // sure that the contributions of
+    // each of the faces are there,
+    // and add them up. Only take
+    // minus one half of the jump
+    // term, since the other half
+    // will be taken by the
+    // neighboring cell.
     unsigned int present_cell=0;
     for (active_cell_iterator cell=dual_solver.dof_handler.begin_active();
-        cell!=dual_solver.dof_handler.end();
-        ++cell, ++present_cell)
+         cell!=dual_solver.dof_handler.end();
+         ++cell, ++present_cell)
       for (unsigned int face_no=0; face_no<GeometryInfo<dim>::faces_per_cell;
-          ++face_no)
-       {
-         Assert(face_integrals.find(cell->face(face_no)) !=
-                face_integrals.end(),
-                ExcInternalError());
-         error_indicators(present_cell)
-           -= 0.5*face_integrals[cell->face(face_no)];
-       };
+           ++face_no)
+        {
+          Assert(face_integrals.find(cell->face(face_no)) !=
+                 face_integrals.end(),
+                 ExcInternalError());
+          error_indicators(present_cell)
+          -= 0.5*face_integrals[cell->face(face_no)];
+        };
     std::cout << "   Estimated error="
-             << std::accumulate (error_indicators.begin(),
-                                 error_indicators.end(), 0.)
-             << std::endl;
+              << std::accumulate (error_indicators.begin(),
+                                  error_indicators.end(), 0.)
+              << std::endl;
   }
 
 
-                                  // @sect4{Estimating on a subset of cells}
+  // @sect4{Estimating on a subset of cells}
 
-                                  // Next we have the function that
-                                  // is called to estimate the error
-                                  // on a subset of cells. The
-                                  // function may be called multiply
-                                  // if the library was configured to
-                                  // use multi-threading. Here it
-                                  // goes:
+  // Next we have the function that
+  // is called to estimate the error
+  // on a subset of cells. The
+  // function may be called multiply
+  // if the library was configured to
+  // use multi-threading. Here it
+  // goes:
   template <int dim>
   void
   WeightedResidual<dim>::
   estimate_some (const Vector<double> &primal_solution,
-                const Vector<double> &dual_weights,
-                const unsigned int    n_threads,
-                const unsigned int    this_thread,
-                Vector<float>        &error_indicators,
-                FaceIntegrals        &face_integrals) const
+                 const Vector<double> &dual_weights,
+                 const unsigned int    n_threads,
+                 const unsigned int    this_thread,
+                 Vector<float>        &error_indicators,
+                 FaceIntegrals        &face_integrals) const
   {
     const PrimalSolver<dim> &primal_solver = *this;
     const DualSolver<dim>   &dual_solver   = *this;
 
-                                    // At the beginning, we
-                                    // initialize two variables for
-                                    // each thread which may be
-                                    // running this function. The
-                                    // reason for these functions was
-                                    // discussed above, when the
-                                    // respective classes were
-                                    // discussed, so we here only
-                                    // point out that since they are
-                                    // local to the function that is
-                                    // spawned when running more than
-                                    // one thread, the data of these
-                                    // objects exists actually once
-                                    // per thread, so we don't have
-                                    // to take care about
-                                    // synchronising access to them.
+    // At the beginning, we
+    // initialize two variables for
+    // each thread which may be
+    // running this function. The
+    // reason for these functions was
+    // discussed above, when the
+    // respective classes were
+    // discussed, so we here only
+    // point out that since they are
+    // local to the function that is
+    // spawned when running more than
+    // one thread, the data of these
+    // objects exists actually once
+    // per thread, so we don't have
+    // to take care about
+    // synchronising access to them.
     CellData cell_data (*dual_solver.fe,
-                       *dual_solver.quadrature,
-                       *primal_solver.rhs_function);
+                        *dual_solver.quadrature,
+                        *primal_solver.rhs_function);
     FaceData face_data (*dual_solver.fe,
-                       *dual_solver.face_quadrature);
-
-                                    // Then calculate the start cell
-                                    // for this thread. We let the
-                                    // different threads run on
-                                    // interleaved cells, i.e. for
-                                    // example if we have 4 threads,
-                                    // then the first thread treates
-                                    // cells 0, 4, 8, etc, while the
-                                    // second threads works on cells 1,
-                                    // 5, 9, and so on. The reason is
-                                    // that it takes vastly more time
-                                    // to work on cells with hanging
-                                    // nodes than on regular cells, but
-                                    // such cells are not evenly
-                                    // distributed across the range of
-                                    // cell iterators, so in order to
-                                    // have the different threads do
-                                    // approximately the same amount of
-                                    // work, we have to let them work
-                                    // interleaved to the effect of a
-                                    // pseudorandom distribution of the
-                                    // `hard' cells to the different
-                                    // threads.
+                        *dual_solver.face_quadrature);
+
+    // Then calculate the start cell
+    // for this thread. We let the
+    // different threads run on
+    // interleaved cells, i.e. for
+    // example if we have 4 threads,
+    // then the first thread treates
+    // cells 0, 4, 8, etc, while the
+    // second threads works on cells 1,
+    // 5, 9, and so on. The reason is
+    // that it takes vastly more time
+    // to work on cells with hanging
+    // nodes than on regular cells, but
+    // such cells are not evenly
+    // distributed across the range of
+    // cell iterators, so in order to
+    // have the different threads do
+    // approximately the same amount of
+    // work, we have to let them work
+    // interleaved to the effect of a
+    // pseudorandom distribution of the
+    // `hard' cells to the different
+    // threads.
     active_cell_iterator cell=dual_solver.dof_handler.begin_active();
     for (unsigned int t=0;
-        (t<this_thread) && (cell!=dual_solver.dof_handler.end());
-        ++t, ++cell);
-
-                                    // If there are no cells for this
-                                    // thread (for example if there
-                                    // are a total of less cells than
-                                    // there are threads), then go
-                                    // back right now
+         (t<this_thread) && (cell!=dual_solver.dof_handler.end());
+         ++t, ++cell);
+
+    // If there are no cells for this
+    // thread (for example if there
+    // are a total of less cells than
+    // there are threads), then go
+    // back right now
     if (cell == dual_solver.dof_handler.end())
       return;
 
-                                    // Next loop over all cells. The
-                                    // check for loop end is done at
-                                    // the end of the loop, along
-                                    // with incrementing the loop
-                                    // index.
+    // Next loop over all cells. The
+    // check for loop end is done at
+    // the end of the loop, along
+    // with incrementing the loop
+    // index.
     for (unsigned int cell_index=this_thread; true; )
       {
-                                        // First task on each cell is
-                                        // to compute the cell
-                                        // residual contributions of
-                                        // this cell, and put them
-                                        // into the
-                                        // ``error_indicators''
-                                        // variable:
-       integrate_over_cell (cell, cell_index,
-                            primal_solution,
-                            dual_weights,
-                            cell_data,
-                            error_indicators);
-
-                                        // After computing the cell
-                                        // terms, turn to the face
-                                        // terms. For this, loop over
-                                        // all faces of the present
-                                        // cell, and see whether
-                                        // something needs to be
-                                        // computed on it:
-       for (unsigned int face_no=0;
-            face_no<GeometryInfo<dim>::faces_per_cell;
-            ++face_no)
-         {
-                                            // First, if this face is
-                                            // part of the boundary,
-                                            // then there is nothing
-                                            // to do. However, to
-                                            // make things easier
-                                            // when summing up the
-                                            // contributions of the
-                                            // faces of cells, we
-                                            // enter this face into
-                                            // the list of faces with
-                                            // a zero contribution to
-                                            // the error.
-           if (cell->face(face_no)->at_boundary())
-             {
-               face_integrals[cell->face(face_no)] = 0;
-               continue;
-             };
-
-                                            // Next, note that since
-                                            // we want to compute the
-                                            // jump terms on each
-                                            // face only once
-                                            // although we access it
-                                            // twice (if it is not at
-                                            // the boundary), we have
-                                            // to define some rules
-                                            // who is responsible for
-                                            // computing on a face:
-                                            //
-                                            // First, if the
-                                            // neighboring cell is on
-                                            // the same level as this
-                                            // one, i.e. neither
-                                            // further refined not
-                                            // coarser, then the one
-                                            // with the lower index
-                                            // within this level does
-                                            // the work. In other
-                                            // words: if the other
-                                            // one has a lower index,
-                                            // then skip work on this
-                                            // face:
-           if ((cell->neighbor(face_no)->has_children() == false) &&
-               (cell->neighbor(face_no)->level() == cell->level()) &&
-               (cell->neighbor(face_no)->index() < cell->index()))
-             continue;
-
-                                            // Likewise, we always
-                                            // work from the coarser
-                                            // cell if this and its
-                                            // neighbor differ in
-                                            // refinement. Thus, if
-                                            // the neighboring cell
-                                            // is less refined than
-                                            // the present one, then
-                                            // do nothing since we
-                                            // integrate over the
-                                            // subfaces when we visit
-                                            // the coarse cell.
-           if (cell->at_boundary(face_no) == false)
-             if (cell->neighbor(face_no)->level() < cell->level())
-               continue;
-
-
-                                            // Now we know that we
-                                            // are in charge here, so
-                                            // actually compute the
-                                            // face jump terms. If
-                                            // the face is a regular
-                                            // one, i.e.  the other
-                                            // side's cell is neither
-                                            // coarser not finer than
-                                            // this cell, then call
-                                            // one function, and if
-                                            // the cell on the other
-                                            // side is further
-                                            // refined, then use
-                                            // another function. Note
-                                            // that the case that the
-                                            // cell on the other side
-                                            // is coarser cannot
-                                            // happen since we have
-                                            // decided above that we
-                                            // handle this case when
-                                            // we pass over that
-                                            // other cell.
-           if (cell->face(face_no)->has_children() == false)
-             integrate_over_regular_face (cell, face_no,
-                                          primal_solution,
-                                          dual_weights,
-                                          face_data,
-                                          face_integrals);
-           else
-             integrate_over_irregular_face (cell, face_no,
-                                            primal_solution,
-                                            dual_weights,
-                                            face_data,
-                                            face_integrals);
-         };
-
-                                        // After computing the cell
-                                        // contributions and looping
-                                        // over the faces, go to the
-                                        // next cell for this
-                                        // thread. Note again that
-                                        // the cells for each of the
-                                        // threads are interleaved.
-                                        // If we are at the end of
-                                        // our workload, jump out
-                                        // of the loop.
-       for (unsigned int t=0;
-            ((t<n_threads) && (cell!=dual_solver.dof_handler.end()));
-            ++t, ++cell, ++cell_index);
-       if (cell == dual_solver.dof_handler.end())
-         break;
+        // First task on each cell is
+        // to compute the cell
+        // residual contributions of
+        // this cell, and put them
+        // into the
+        // ``error_indicators''
+        // variable:
+        integrate_over_cell (cell, cell_index,
+                             primal_solution,
+                             dual_weights,
+                             cell_data,
+                             error_indicators);
+
+        // After computing the cell
+        // terms, turn to the face
+        // terms. For this, loop over
+        // all faces of the present
+        // cell, and see whether
+        // something needs to be
+        // computed on it:
+        for (unsigned int face_no=0;
+             face_no<GeometryInfo<dim>::faces_per_cell;
+             ++face_no)
+          {
+            // First, if this face is
+            // part of the boundary,
+            // then there is nothing
+            // to do. However, to
+            // make things easier
+            // when summing up the
+            // contributions of the
+            // faces of cells, we
+            // enter this face into
+            // the list of faces with
+            // a zero contribution to
+            // the error.
+            if (cell->face(face_no)->at_boundary())
+              {
+                face_integrals[cell->face(face_no)] = 0;
+                continue;
+              };
+
+            // Next, note that since
+            // we want to compute the
+            // jump terms on each
+            // face only once
+            // although we access it
+            // twice (if it is not at
+            // the boundary), we have
+            // to define some rules
+            // who is responsible for
+            // computing on a face:
+            //
+            // First, if the
+            // neighboring cell is on
+            // the same level as this
+            // one, i.e. neither
+            // further refined not
+            // coarser, then the one
+            // with the lower index
+            // within this level does
+            // the work. In other
+            // words: if the other
+            // one has a lower index,
+            // then skip work on this
+            // face:
+            if ((cell->neighbor(face_no)->has_children() == false) &&
+                (cell->neighbor(face_no)->level() == cell->level()) &&
+                (cell->neighbor(face_no)->index() < cell->index()))
+              continue;
+
+            // Likewise, we always
+            // work from the coarser
+            // cell if this and its
+            // neighbor differ in
+            // refinement. Thus, if
+            // the neighboring cell
+            // is less refined than
+            // the present one, then
+            // do nothing since we
+            // integrate over the
+            // subfaces when we visit
+            // the coarse cell.
+            if (cell->at_boundary(face_no) == false)
+              if (cell->neighbor(face_no)->level() < cell->level())
+                continue;
+
+
+            // Now we know that we
+            // are in charge here, so
+            // actually compute the
+            // face jump terms. If
+            // the face is a regular
+            // one, i.e.  the other
+            // side's cell is neither
+            // coarser not finer than
+            // this cell, then call
+            // one function, and if
+            // the cell on the other
+            // side is further
+            // refined, then use
+            // another function. Note
+            // that the case that the
+            // cell on the other side
+            // is coarser cannot
+            // happen since we have
+            // decided above that we
+            // handle this case when
+            // we pass over that
+            // other cell.
+            if (cell->face(face_no)->has_children() == false)
+              integrate_over_regular_face (cell, face_no,
+                                           primal_solution,
+                                           dual_weights,
+                                           face_data,
+                                           face_integrals);
+            else
+              integrate_over_irregular_face (cell, face_no,
+                                             primal_solution,
+                                             dual_weights,
+                                             face_data,
+                                             face_integrals);
+          };
+
+        // After computing the cell
+        // contributions and looping
+        // over the faces, go to the
+        // next cell for this
+        // thread. Note again that
+        // the cells for each of the
+        // threads are interleaved.
+        // If we are at the end of
+        // our workload, jump out
+        // of the loop.
+        for (unsigned int t=0;
+             ((t<n_threads) && (cell!=dual_solver.dof_handler.end()));
+             ++t, ++cell, ++cell_index);
+        if (cell == dual_solver.dof_handler.end())
+          break;
       };
   }
 
 
-                                  // @sect4{Computing cell term error contributions}
+  // @sect4{Computing cell term error contributions}
 
-                                  // As for the actual computation of
-                                  // the error contributions, first
-                                  // turn to the cell terms:
+  // As for the actual computation of
+  // the error contributions, first
+  // turn to the cell terms:
   template <int dim>
   void WeightedResidual<dim>::
   integrate_over_cell (const active_cell_iterator &cell,
-                      const unsigned int          cell_index,
-                      const Vector<double>       &primal_solution,
-                      const Vector<double>       &dual_weights,
-                      CellData                   &cell_data,
-                      Vector<float>              &error_indicators) const
+                       const unsigned int          cell_index,
+                       const Vector<double>       &primal_solution,
+                       const Vector<double>       &dual_weights,
+                       CellData                   &cell_data,
+                       Vector<float>              &error_indicators) const
   {
-                                    // The tasks to be done are what
-                                    // appears natural from looking
-                                    // at the error estimation
-                                    // formula: first compute the the
-                                    // right hand side and the
-                                    // Laplacian of the numerical
-                                    // solution at the quadrature
-                                    // points for the cell residual,
+    // The tasks to be done are what
+    // appears natural from looking
+    // at the error estimation
+    // formula: first compute the the
+    // right hand side and the
+    // Laplacian of the numerical
+    // solution at the quadrature
+    // points for the cell residual,
     cell_data.fe_values.reinit (cell);
     cell_data.right_hand_side
-      ->value_list (cell_data.fe_values.get_quadrature_points(),
-                   cell_data.rhs_values);
+    ->value_list (cell_data.fe_values.get_quadrature_points(),
+                  cell_data.rhs_values);
     cell_data.fe_values.get_function_2nd_derivatives (primal_solution,
-                                                     cell_data.cell_grad_grads);
+                                                      cell_data.cell_grad_grads);
 
-                                    // ...then get the dual weights...
+    // ...then get the dual weights...
     cell_data.fe_values.get_function_values (dual_weights,
-                                            cell_data.dual_weights);
+                                             cell_data.dual_weights);
 
-                                    // ...and finally build the sum
-                                    // over all quadrature points and
-                                    // store it with the present
-                                    // cell:
+    // ...and finally build the sum
+    // over all quadrature points and
+    // store it with the present
+    // cell:
     double sum = 0;
     for (unsigned int p=0; p<cell_data.fe_values.n_quadrature_points; ++p)
       sum += ((cell_data.rhs_values[p]+trace(cell_data.cell_grad_grads[p])) *
-             cell_data.dual_weights[p] *
-             cell_data.fe_values.JxW (p));
+              cell_data.dual_weights[p] *
+              cell_data.fe_values.JxW (p));
     error_indicators(cell_index) += sum;
   }
 
 
-                                  // @sect4{Computing edge term error contributions - 1}
+  // @sect4{Computing edge term error contributions - 1}
 
-                                  // On the other hand, computation
-                                  // of the edge terms for the error
-                                  // estimate is not so
-                                  // simple. First, we have to
-                                  // distinguish between faces with
-                                  // and without hanging
-                                  // nodes. Because it is the simple
-                                  // case, we first consider the case
-                                  // without hanging nodes on a face
-                                  // (let's call this the `regular'
-                                  // case):
+  // On the other hand, computation
+  // of the edge terms for the error
+  // estimate is not so
+  // simple. First, we have to
+  // distinguish between faces with
+  // and without hanging
+  // nodes. Because it is the simple
+  // case, we first consider the case
+  // without hanging nodes on a face
+  // (let's call this the `regular'
+  // case):
   template <int dim>
   void WeightedResidual<dim>::
   integrate_over_regular_face (const active_cell_iterator &cell,
-                              const unsigned int          face_no,
-                              const Vector<double>       &primal_solution,
-                              const Vector<double>       &dual_weights,
-                              FaceData                   &face_data,
-                              FaceIntegrals              &face_integrals) const
+                               const unsigned int          face_no,
+                               const Vector<double>       &primal_solution,
+                               const Vector<double>       &dual_weights,
+                               FaceData                   &face_data,
+                               FaceIntegrals              &face_integrals) const
   {
     const unsigned int
-      n_q_points = face_data.fe_face_values_cell.n_quadrature_points;
-
-                                    // The first step is to get the
-                                    // values of the gradients at the
-                                    // quadrature points of the
-                                    // finite element field on the
-                                    // present cell. For this,
-                                    // initialize the
-                                    // ``FEFaceValues'' object
-                                    // corresponding to this side of
-                                    // the face, and extract the
-                                    // gradients using that
-                                    // object.
+    n_q_points = face_data.fe_face_values_cell.n_quadrature_points;
+
+    // The first step is to get the
+    // values of the gradients at the
+    // quadrature points of the
+    // finite element field on the
+    // present cell. For this,
+    // initialize the
+    // ``FEFaceValues'' object
+    // corresponding to this side of
+    // the face, and extract the
+    // gradients using that
+    // object.
     face_data.fe_face_values_cell.reinit (cell, face_no);
     face_data.fe_face_values_cell.get_function_grads (primal_solution,
-                                                     face_data.cell_grads);
-
-                                    // The second step is then to
-                                    // extract the gradients of the
-                                    // finite element solution at the
-                                    // quadrature points on the other
-                                    // side of the face, i.e. from
-                                    // the neighboring cell.
-                                    //
-                                    // For this, do a sanity check
-                                    // before: make sure that the
-                                    // neigbor actually exists (yes,
-                                    // we should not have come here
-                                    // if the neighbor did not exist,
-                                    // but in complicated software
-                                    // there are bugs, so better
-                                    // check this), and if this is
-                                    // not the case throw an error.
+                                                      face_data.cell_grads);
+
+    // The second step is then to
+    // extract the gradients of the
+    // finite element solution at the
+    // quadrature points on the other
+    // side of the face, i.e. from
+    // the neighboring cell.
+    //
+    // For this, do a sanity check
+    // before: make sure that the
+    // neigbor actually exists (yes,
+    // we should not have come here
+    // if the neighbor did not exist,
+    // but in complicated software
+    // there are bugs, so better
+    // check this), and if this is
+    // not the case throw an error.
     Assert (cell->neighbor(face_no).state() == IteratorState::valid,
-           ExcInternalError());
-                                    // If we have that, then we need
-                                    // to find out with which face of
-                                    // the neighboring cell we have
-                                    // to work, i.e. the
-                                    // ``home-many''the neighbor the
-                                    // present cell is of the cell
-                                    // behind the present face. For
-                                    // this, there is a function, and
-                                    // we put the result into a
-                                    // variable with the name
-                                    // ``neighbor_neighbor'':
+            ExcInternalError());
+    // If we have that, then we need
+    // to find out with which face of
+    // the neighboring cell we have
+    // to work, i.e. the
+    // ``home-many''the neighbor the
+    // present cell is of the cell
+    // behind the present face. For
+    // this, there is a function, and
+    // we put the result into a
+    // variable with the name
+    // ``neighbor_neighbor'':
     const unsigned int
-      neighbor_neighbor = cell->neighbor_of_neighbor (face_no);
-                                    // Then define an abbreviation
-                                    // for the neigbor cell,
-                                    // initialize the
-                                    // ``FEFaceValues'' object on
-                                    // that cell, and extract the
-                                    // gradients on that cell:
+    neighbor_neighbor = cell->neighbor_of_neighbor (face_no);
+    // Then define an abbreviation
+    // for the neigbor cell,
+    // initialize the
+    // ``FEFaceValues'' object on
+    // that cell, and extract the
+    // gradients on that cell:
     const active_cell_iterator neighbor = cell->neighbor(face_no);
     face_data.fe_face_values_neighbor.reinit (neighbor, neighbor_neighbor);
     face_data.fe_face_values_neighbor.get_function_grads (primal_solution,
-                                                         face_data.neighbor_grads);
-
-                                    // Now that we have the gradients
-                                    // on this and the neighboring
-                                    // cell, compute the jump
-                                    // residual by multiplying the
-                                    // jump in the gradient with the
-                                    // normal vector:
+                                                          face_data.neighbor_grads);
+
+    // Now that we have the gradients
+    // on this and the neighboring
+    // cell, compute the jump
+    // residual by multiplying the
+    // jump in the gradient with the
+    // normal vector:
     for (unsigned int p=0; p<n_q_points; ++p)
       face_data.jump_residual[p]
-       = ((face_data.cell_grads[p] - face_data.neighbor_grads[p]) *
-          face_data.fe_face_values_cell.normal_vector(p));
+        = ((face_data.cell_grads[p] - face_data.neighbor_grads[p]) *
+           face_data.fe_face_values_cell.normal_vector(p));
 
-                                    // Next get the dual weights for
-                                    // this face:
+    // Next get the dual weights for
+    // this face:
     face_data.fe_face_values_cell.get_function_values (dual_weights,
-                                                      face_data.dual_weights);
+                                                       face_data.dual_weights);
 
-                                    // Finally, we have to compute
-                                    // the sum over jump residuals,
-                                    // dual weights, and quadrature
-                                    // weights, to get the result for
-                                    // this face:
+    // Finally, we have to compute
+    // the sum over jump residuals,
+    // dual weights, and quadrature
+    // weights, to get the result for
+    // this face:
     double face_integral = 0;
     for (unsigned int p=0; p<n_q_points; ++p)
       face_integral += (face_data.jump_residual[p] *
-                       face_data.dual_weights[p]  *
-                       face_data.fe_face_values_cell.JxW(p));
+                        face_data.dual_weights[p]  *
+                        face_data.fe_face_values_cell.JxW(p));
 
-                                    // Double check that the element
-                                    // already exists and that it was
-                                    // not already written to...
+    // Double check that the element
+    // already exists and that it was
+    // not already written to...
     Assert (face_integrals.find (cell->face(face_no)) != face_integrals.end(),
-           ExcInternalError());
+            ExcInternalError());
     Assert (face_integrals[cell->face(face_no)] == -1e20,
-           ExcInternalError());
-
-                                    // ...then store computed value
-                                    // at assigned location. Note
-                                    // that the stored value does not
-                                    // contain the factor 1/2 that
-                                    // appears in the error
-                                    // representation. The reason is
-                                    // that the term actually does
-                                    // not have this factor if we
-                                    // loop over all faces in the
-                                    // triangulation, but only
-                                    // appears if we write it as a
-                                    // sum over all cells and all
-                                    // faces of each cell; we thus
-                                    // visit the same face twice. We
-                                    // take account of this by using
-                                    // this factor -1/2 later, when we
-                                    // sum up the contributions for
-                                    // each cell individually.
+            ExcInternalError());
+
+    // ...then store computed value
+    // at assigned location. Note
+    // that the stored value does not
+    // contain the factor 1/2 that
+    // appears in the error
+    // representation. The reason is
+    // that the term actually does
+    // not have this factor if we
+    // loop over all faces in the
+    // triangulation, but only
+    // appears if we write it as a
+    // sum over all cells and all
+    // faces of each cell; we thus
+    // visit the same face twice. We
+    // take account of this by using
+    // this factor -1/2 later, when we
+    // sum up the contributions for
+    // each cell individually.
     face_integrals[cell->face(face_no)] = face_integral;
   }
 
 
-                                  // @sect4{Computing edge term error contributions - 2}
+  // @sect4{Computing edge term error contributions - 2}
 
-                                  // We are still missing the case of
-                                  // faces with hanging nodes. This
-                                  // is what is covered in this
-                                  // function:
+  // We are still missing the case of
+  // faces with hanging nodes. This
+  // is what is covered in this
+  // function:
   template <int dim>
   void WeightedResidual<dim>::
   integrate_over_irregular_face (const active_cell_iterator &cell,
-                                const unsigned int          face_no,
-                                const Vector<double>       &primal_solution,
-                                const Vector<double>       &dual_weights,
-                                FaceData                   &face_data,
-                                FaceIntegrals              &face_integrals) const
+                                 const unsigned int          face_no,
+                                 const Vector<double>       &primal_solution,
+                                 const Vector<double>       &dual_weights,
+                                 FaceData                   &face_data,
+                                 FaceIntegrals              &face_integrals) const
   {
-                                    // First again two abbreviations,
-                                    // and some consistency checks
-                                    // whether the function is called
-                                    // only on faces for which it is
-                                    // supposed to be called:
+    // First again two abbreviations,
+    // and some consistency checks
+    // whether the function is called
+    // only on faces for which it is
+    // supposed to be called:
     const unsigned int
-      n_q_points = face_data.fe_face_values_cell.n_quadrature_points;
+    n_q_points = face_data.fe_face_values_cell.n_quadrature_points;
 
     const typename DoFHandler<dim>::cell_iterator
-      neighbor = cell->neighbor(face_no);
+    neighbor = cell->neighbor(face_no);
     Assert (neighbor.state() == IteratorState::valid,
-           ExcInternalError());
+            ExcInternalError());
     Assert (neighbor->has_children(),
-           ExcInternalError());
-
-                                    // Then find out which neighbor
-                                    // the present cell is of the
-                                    // adjacent cell. Note that we
-                                    // will operator on the children
-                                    // of this adjacent cell, but
-                                    // that their orientation is the
-                                    // same as that of their mother,
-                                    // i.e. the neigbor direction is
-                                    // the same.
+            ExcInternalError());
+
+    // Then find out which neighbor
+    // the present cell is of the
+    // adjacent cell. Note that we
+    // will operator on the children
+    // of this adjacent cell, but
+    // that their orientation is the
+    // same as that of their mother,
+    // i.e. the neigbor direction is
+    // the same.
     const unsigned int
-      neighbor_neighbor = cell->neighbor_of_neighbor (face_no);
+    neighbor_neighbor = cell->neighbor_of_neighbor (face_no);
 
-                                    // Then simply do everything we
-                                    // did in the previous function
-                                    // for one face for all the
-                                    // sub-faces now:
+    // Then simply do everything we
+    // did in the previous function
+    // for one face for all the
+    // sub-faces now:
     for (unsigned int subface_no=0;
-        subface_no<GeometryInfo<dim>::subfaces_per_face;
-        ++subface_no)
+         subface_no<GeometryInfo<dim>::subfaces_per_face;
+         ++subface_no)
       {
-       const active_cell_iterator neighbor_child
+        const active_cell_iterator neighbor_child
           = cell->neighbor_child_on_subface (face_no, subface_no);
 
-                                        // Now start the work by
-                                        // again getting the gradient
-                                        // of the solution first at
-                                        // this side of the
-                                        // interface,
-       face_data.fe_subface_values_cell.reinit (cell, face_no, subface_no);
-       face_data.fe_subface_values_cell.get_function_grads (primal_solution,
-                                                            face_data.cell_grads);
-                                        // then at the other side,
-       face_data.fe_face_values_neighbor.reinit (neighbor_child,
-                                            neighbor_neighbor);
-       face_data.fe_face_values_neighbor.get_function_grads (primal_solution,
-                                                             face_data.neighbor_grads);
-
-                                        // and finally building the
-                                        // jump residuals. Since we
-                                        // take the normal vector
-                                        // from the other cell this
-                                        // time, revert the sign of
-                                        // the first term compared to
-                                        // the other function:
-       for (unsigned int p=0; p<n_q_points; ++p)
-         face_data.jump_residual[p]
-            = ((face_data.neighbor_grads[p] - face_data.cell_grads[p]) *
-               face_data.fe_face_values_neighbor.normal_vector(p));
-
-                                        // Then get dual weights:
-       face_data.fe_face_values_neighbor.get_function_values (dual_weights,
-                                                              face_data.dual_weights);
-
-                                        // At last, sum up the
-                                        // contribution of this
-                                        // sub-face, and set it in
-                                        // the global map:
-       double face_integral = 0;
-       for (unsigned int p=0; p<n_q_points; ++p)
-         face_integral += (face_data.jump_residual[p] *
-                           face_data.dual_weights[p] *
-                           face_data.fe_face_values_neighbor.JxW(p));
-       face_integrals[neighbor_child->face(neighbor_neighbor)]
-         = face_integral;
+        // Now start the work by
+        // again getting the gradient
+        // of the solution first at
+        // this side of the
+        // interface,
+        face_data.fe_subface_values_cell.reinit (cell, face_no, subface_no);
+        face_data.fe_subface_values_cell.get_function_grads (primal_solution,
+                                                             face_data.cell_grads);
+        // then at the other side,
+        face_data.fe_face_values_neighbor.reinit (neighbor_child,
+                                                  neighbor_neighbor);
+        face_data.fe_face_values_neighbor.get_function_grads (primal_solution,
+                                                              face_data.neighbor_grads);
+
+        // and finally building the
+        // jump residuals. Since we
+        // take the normal vector
+        // from the other cell this
+        // time, revert the sign of
+        // the first term compared to
+        // the other function:
+        for (unsigned int p=0; p<n_q_points; ++p)
+          face_data.jump_residual[p]
+            = ((face_data.neighbor_grads[p] - face_data.cell_grads[p]) *
+               face_data.fe_face_values_neighbor.normal_vector(p));
+
+        // Then get dual weights:
+        face_data.fe_face_values_neighbor.get_function_values (dual_weights,
+                                                               face_data.dual_weights);
+
+        // At last, sum up the
+        // contribution of this
+        // sub-face, and set it in
+        // the global map:
+        double face_integral = 0;
+        for (unsigned int p=0; p<n_q_points; ++p)
+          face_integral += (face_data.jump_residual[p] *
+                            face_data.dual_weights[p] *
+                            face_data.fe_face_values_neighbor.JxW(p));
+        face_integrals[neighbor_child->face(neighbor_neighbor)]
+          = face_integral;
       };
 
-                                    // Once the contributions of all
-                                    // sub-faces are computed, loop
-                                    // over all sub-faces to collect
-                                    // and store them with the mother
-                                    // face for simple use when later
-                                    // collecting the error terms of
-                                    // cells. Again make safety
-                                    // checks that the entries for
-                                    // the sub-faces have been
-                                    // computed and do not carry an
-                                    // invalid value.
+    // Once the contributions of all
+    // sub-faces are computed, loop
+    // over all sub-faces to collect
+    // and store them with the mother
+    // face for simple use when later
+    // collecting the error terms of
+    // cells. Again make safety
+    // checks that the entries for
+    // the sub-faces have been
+    // computed and do not carry an
+    // invalid value.
     double sum = 0;
     typename DoFHandler<dim>::face_iterator face = cell->face(face_no);
     for (unsigned int subface_no=0;
-        subface_no<GeometryInfo<dim>::subfaces_per_face;
-        ++subface_no)
+         subface_no<GeometryInfo<dim>::subfaces_per_face;
+         ++subface_no)
       {
-       Assert (face_integrals.find(face->child(subface_no)) !=
-               face_integrals.end(),
-               ExcInternalError());
-       Assert (face_integrals[face->child(subface_no)] != -1e20,
-               ExcInternalError());
+        Assert (face_integrals.find(face->child(subface_no)) !=
+                face_integrals.end(),
+                ExcInternalError());
+        Assert (face_integrals[face->child(subface_no)] != -1e20,
+                ExcInternalError());
 
-       sum += face_integrals[face->child(subface_no)];
+        sum += face_integrals[face->child(subface_no)];
       };
-                                    // Finally store the value with
-                                    // the parent face.
+    // Finally store the value with
+    // the parent face.
     face_integrals[face] = sum;
   }
 
 }
 
 
-                                // @sect3{A simulation framework}
-
-                                // In the previous example program,
-                                // we have had two functions that
-                                // were used to drive the process of
-                                // solving on subsequently finer
-                                // grids. We extend this here to
-                                // allow for a number of parameters
-                                // to be passed to these functions,
-                                // and put all of that into framework
-                                // class.
-                                //
-                                // You will have noted that this
-                                // program is built up of a number of
-                                // small parts (evaluation functions,
-                                // solver classes implementing
-                                // various refinement methods,
-                                // different dual functionals,
-                                // different problem and data
-                                // descriptions), which makes the
-                                // program relatively simple to
-                                // extend, but also allows to solve a
-                                // large number of different problems
-                                // by replacing one part by
-                                // another. We reflect this
-                                // flexibility by declaring a
-                                // structure in the following
-                                // framework class that holds a
-                                // number of parameters that may be
-                                // set to test various combinations
-                                // of the parts of this program, and
-                                // which can be used to test it at
-                                // various problems and
-                                // discretizations in a simple way.
+// @sect3{A simulation framework}
+
+// In the previous example program,
+// we have had two functions that
+// were used to drive the process of
+// solving on subsequently finer
+// grids. We extend this here to
+// allow for a number of parameters
+// to be passed to these functions,
+// and put all of that into framework
+// class.
+//
+// You will have noted that this
+// program is built up of a number of
+// small parts (evaluation functions,
+// solver classes implementing
+// various refinement methods,
+// different dual functionals,
+// different problem and data
+// descriptions), which makes the
+// program relatively simple to
+// extend, but also allows to solve a
+// large number of different problems
+// by replacing one part by
+// another. We reflect this
+// flexibility by declaring a
+// structure in the following
+// framework class that holds a
+// number of parameters that may be
+// set to test various combinations
+// of the parts of this program, and
+// which can be used to test it at
+// various problems and
+// discretizations in a simple way.
 template <int dim>
 struct Framework
 {
-  public:
-                                    // First, we declare two
-                                    // abbreviations for simple use
-                                    // of the respective data types:
-    typedef Evaluation::EvaluationBase<dim> Evaluator;
-    typedef std::list<Evaluator*>           EvaluatorList;
-
-
-                                    // Then we have the structure
-                                    // which declares all the
-                                    // parameters that may be set. In
-                                    // the default constructor of the
-                                    // structure, these values are
-                                    // all set to default values, for
-                                    // simple use.
-    struct ProblemDescription
+public:
+  // First, we declare two
+  // abbreviations for simple use
+  // of the respective data types:
+  typedef Evaluation::EvaluationBase<dim> Evaluator;
+  typedef std::list<Evaluator *>           EvaluatorList;
+
+
+  // Then we have the structure
+  // which declares all the
+  // parameters that may be set. In
+  // the default constructor of the
+  // structure, these values are
+  // all set to default values, for
+  // simple use.
+  struct ProblemDescription
+  {
+    // First allow for the
+    // degrees of the piecewise
+    // polynomials by which the
+    // primal and dual problems
+    // will be discretized. They
+    // default to (bi-,
+    // tri-)linear ansatz
+    // functions for the primal,
+    // and (bi-, tri-)quadratic
+    // ones for the dual
+    // problem. If a refinement
+    // criterion is chosen that
+    // does not need the solution
+    // of a dual problem, the
+    // value of the dual finite
+    // element degree is of
+    // course ignored.
+    unsigned int primal_fe_degree;
+    unsigned int dual_fe_degree;
+
+    // Then have an object that
+    // describes the problem
+    // type, i.e. right hand
+    // side, domain, boundary
+    // values, etc. The pointer
+    // needed here defaults to
+    // the Null pointer, i.e. you
+    // will have to set it in
+    // actual instances of this
+    // object to make it useful.
+    SmartPointer<const Data::SetUpBase<dim> > data;
+
+    // Since we allow to use
+    // different refinement
+    // criteria (global
+    // refinement, refinement by
+    // the Kelly error indicator,
+    // possibly with a weight,
+    // and using the dual
+    // estimator), define a
+    // number of enumeration
+    // values, and subsequently a
+    // variable of that type. It
+    // will default to
+    // ``dual_weighted_error_estimator''.
+    enum RefinementCriterion
     {
-                                        // First allow for the
-                                        // degrees of the piecewise
-                                        // polynomials by which the
-                                        // primal and dual problems
-                                        // will be discretized. They
-                                        // default to (bi-,
-                                        // tri-)linear ansatz
-                                        // functions for the primal,
-                                        // and (bi-, tri-)quadratic
-                                        // ones for the dual
-                                        // problem. If a refinement
-                                        // criterion is chosen that
-                                        // does not need the solution
-                                        // of a dual problem, the
-                                        // value of the dual finite
-                                        // element degree is of
-                                        // course ignored.
-       unsigned int primal_fe_degree;
-       unsigned int dual_fe_degree;
-
-                                        // Then have an object that
-                                        // describes the problem
-                                        // type, i.e. right hand
-                                        // side, domain, boundary
-                                        // values, etc. The pointer
-                                        // needed here defaults to
-                                        // the Null pointer, i.e. you
-                                        // will have to set it in
-                                        // actual instances of this
-                                        // object to make it useful.
-       SmartPointer<const Data::SetUpBase<dim> > data;
-
-                                        // Since we allow to use
-                                        // different refinement
-                                        // criteria (global
-                                        // refinement, refinement by
-                                        // the Kelly error indicator,
-                                        // possibly with a weight,
-                                        // and using the dual
-                                        // estimator), define a
-                                        // number of enumeration
-                                        // values, and subsequently a
-                                        // variable of that type. It
-                                        // will default to
-                                        // ``dual_weighted_error_estimator''.
-       enum RefinementCriterion {
-             dual_weighted_error_estimator,
-             global_refinement,
-             kelly_indicator,
-             weighted_kelly_indicator
-       };
-
-       RefinementCriterion refinement_criterion;
-
-                                        // Next, an object that
-                                        // describes the dual
-                                        // functional. It is only
-                                        // needed if the dual
-                                        // weighted residual
-                                        // refinement is chosen, and
-                                        // also defaults to a Null
-                                        // pointer.
-       SmartPointer<const DualFunctional::DualFunctionalBase<dim> > dual_functional;
-
-                                        // Then a list of evaluation
-                                        // objects. Its default value
-                                        // is empty, i.e. no
-                                        // evaluation objects.
-       EvaluatorList evaluator_list;
-
-                                        // Next to last, a function
-                                        // that is used as a weight
-                                        // to the
-                                        // ``RefinementWeightedKelly''
-                                        // class. The default value
-                                        // of this pointer is zero,
-                                        // but you have to set it to
-                                        // some other value if you
-                                        // want to use the
-                                        // ``weighted_kelly_indicator''
-                                        // refinement criterion.
-       SmartPointer<const Function<dim> > kelly_weight;
-
-                                        // Finally, we have a
-                                        // variable that denotes the
-                                        // maximum number of degrees
-                                        // of freedom we allow for
-                                        // the (primal)
-                                        // discretization. If it is
-                                        // exceeded, we stop the
-                                        // process of solving and
-                                        // intermittend mesh
-                                        // refinement. Its default
-                                        // value is 20,000.
-       unsigned int max_degrees_of_freedom;
-
-                                        // Finally the default
-                                        // constructor of this class:
-       ProblemDescription ();
+      dual_weighted_error_estimator,
+      global_refinement,
+      kelly_indicator,
+      weighted_kelly_indicator
     };
 
-                                    // The driver framework class
-                                    // only has one method which
-                                    // calls solver and mesh
-                                    // refinement intermittently, and
-                                    // does some other small tasks in
-                                    // between. Since it does not
-                                    // need data besides the
-                                    // parameters given to it, we
-                                    // make it static:
-    static void run (const ProblemDescription &descriptor);
+    RefinementCriterion refinement_criterion;
+
+    // Next, an object that
+    // describes the dual
+    // functional. It is only
+    // needed if the dual
+    // weighted residual
+    // refinement is chosen, and
+    // also defaults to a Null
+    // pointer.
+    SmartPointer<const DualFunctional::DualFunctionalBase<dim> > dual_functional;
+
+    // Then a list of evaluation
+    // objects. Its default value
+    // is empty, i.e. no
+    // evaluation objects.
+    EvaluatorList evaluator_list;
+
+    // Next to last, a function
+    // that is used as a weight
+    // to the
+    // ``RefinementWeightedKelly''
+    // class. The default value
+    // of this pointer is zero,
+    // but you have to set it to
+    // some other value if you
+    // want to use the
+    // ``weighted_kelly_indicator''
+    // refinement criterion.
+    SmartPointer<const Function<dim> > kelly_weight;
+
+    // Finally, we have a
+    // variable that denotes the
+    // maximum number of degrees
+    // of freedom we allow for
+    // the (primal)
+    // discretization. If it is
+    // exceeded, we stop the
+    // process of solving and
+    // intermittend mesh
+    // refinement. Its default
+    // value is 20,000.
+    unsigned int max_degrees_of_freedom;
+
+    // Finally the default
+    // constructor of this class:
+    ProblemDescription ();
+  };
+
+  // The driver framework class
+  // only has one method which
+  // calls solver and mesh
+  // refinement intermittently, and
+  // does some other small tasks in
+  // between. Since it does not
+  // need data besides the
+  // parameters given to it, we
+  // make it static:
+  static void run (const ProblemDescription &descriptor);
 };
 
 
-                                // As for the implementation, first
-                                // the constructor of the parameter
-                                // object, setting all values to
-                                // their defaults:
+// As for the implementation, first
+// the constructor of the parameter
+// object, setting all values to
+// their defaults:
 template <int dim>
 Framework<dim>::ProblemDescription::ProblemDescription ()
-               :
-               primal_fe_degree (1),
-               dual_fe_degree (2),
-               refinement_criterion (dual_weighted_error_estimator),
-               max_degrees_of_freedom (1000)
+  :
+  primal_fe_degree (1),
+  dual_fe_degree (2),
+  refinement_criterion (dual_weighted_error_estimator),
+  max_degrees_of_freedom (1000)
 {}
 
 
 
-                                // Then the function which drives the
-                                // whole process:
+// Then the function which drives the
+// whole process:
 template <int dim>
 void Framework<dim>::run (const ProblemDescription &descriptor)
 {
-                                  // First create a triangulation
-                                  // from the given data object,
+  // First create a triangulation
+  // from the given data object,
   Triangulation<dim>
-    triangulation (Triangulation<dim>::smoothing_on_refinement);
+  triangulation (Triangulation<dim>::smoothing_on_refinement);
   descriptor.data->create_coarse_grid (triangulation);
 
-                                  // then a set of finite elements
-                                  // and appropriate quadrature
-                                  // formula:
+  // then a set of finite elements
+  // and appropriate quadrature
+  // formula:
   const FE_Q<dim>     primal_fe(descriptor.primal_fe_degree);
   const FE_Q<dim>     dual_fe(descriptor.dual_fe_degree);
   const QGauss<dim>   quadrature(descriptor.dual_fe_degree+1);
   const QGauss<dim-1> face_quadrature(descriptor.dual_fe_degree+1);
 
-                                  // Next, select one of the classes
-                                  // implementing different
-                                  // refinement criteria.
-  LaplaceSolver::Base<dim> * solver = 0;
+  // Next, select one of the classes
+  // implementing different
+  // refinement criteria.
+  LaplaceSolver::Base<dim> *solver = 0;
   switch (descriptor.refinement_criterion)
     {
-      case ProblemDescription::dual_weighted_error_estimator:
-      {
-       solver
-         = new LaplaceSolver::WeightedResidual<dim> (triangulation,
-                                                     primal_fe,
-                                                     dual_fe,
-                                                     quadrature,
-                                                     face_quadrature,
-                                                     descriptor.data->get_right_hand_side(),
-                                                     descriptor.data->get_boundary_values(),
-                                                     *descriptor.dual_functional);
-       break;
-      };
+    case ProblemDescription::dual_weighted_error_estimator:
+    {
+      solver
+        = new LaplaceSolver::WeightedResidual<dim> (triangulation,
+                                                    primal_fe,
+                                                    dual_fe,
+                                                    quadrature,
+                                                    face_quadrature,
+                                                    descriptor.data->get_right_hand_side(),
+                                                    descriptor.data->get_boundary_values(),
+                                                    *descriptor.dual_functional);
+      break;
+    };
 
-      case ProblemDescription::global_refinement:
-      {
-       solver
-         = new LaplaceSolver::RefinementGlobal<dim> (triangulation,
-                                                     primal_fe,
-                                                     quadrature,
-                                                     face_quadrature,
-                                                     descriptor.data->get_right_hand_side(),
-                                                     descriptor.data->get_boundary_values());
-       break;
-      };
+    case ProblemDescription::global_refinement:
+    {
+      solver
+        = new LaplaceSolver::RefinementGlobal<dim> (triangulation,
+                                                    primal_fe,
+                                                    quadrature,
+                                                    face_quadrature,
+                                                    descriptor.data->get_right_hand_side(),
+                                                    descriptor.data->get_boundary_values());
+      break;
+    };
 
-      case ProblemDescription::kelly_indicator:
-      {
-       solver
-         = new LaplaceSolver::RefinementKelly<dim> (triangulation,
-                                                    primal_fe,
-                                                    quadrature,
-                                                    face_quadrature,
-                                                    descriptor.data->get_right_hand_side(),
-                                                    descriptor.data->get_boundary_values());
-       break;
-      };
+    case ProblemDescription::kelly_indicator:
+    {
+      solver
+        = new LaplaceSolver::RefinementKelly<dim> (triangulation,
+                                                   primal_fe,
+                                                   quadrature,
+                                                   face_quadrature,
+                                                   descriptor.data->get_right_hand_side(),
+                                                   descriptor.data->get_boundary_values());
+      break;
+    };
 
-      case ProblemDescription::weighted_kelly_indicator:
-      {
-       solver
-         = new LaplaceSolver::RefinementWeightedKelly<dim> (triangulation,
-                                                            primal_fe,
-                                                            quadrature,
-                                                            face_quadrature,
-                                                            descriptor.data->get_right_hand_side(),
-                                                            descriptor.data->get_boundary_values(),
-                                                            *descriptor.kelly_weight);
-       break;
-      };
+    case ProblemDescription::weighted_kelly_indicator:
+    {
+      solver
+        = new LaplaceSolver::RefinementWeightedKelly<dim> (triangulation,
+                                                           primal_fe,
+                                                           quadrature,
+                                                           face_quadrature,
+                                                           descriptor.data->get_right_hand_side(),
+                                                           descriptor.data->get_boundary_values(),
+                                                           *descriptor.kelly_weight);
+      break;
+    };
 
-      default:
-           AssertThrow (false, ExcInternalError());
+    default:
+      AssertThrow (false, ExcInternalError());
     };
 
-                                  // Now that all objects are in
-                                  // place, run the main loop. The
-                                  // stopping criterion is
-                                  // implemented at the bottom of the
-                                  // loop.
-                                  //
-                                  // In the loop, first set the new
-                                  // cycle number, then solve the
-                                  // problem, output its solution(s),
-                                  // apply the evaluation objects to
-                                  // it, then decide whether we want
-                                  // to refine the mesh further and
-                                  // solve again on this mesh, or
-                                  // jump out of the loop.
+  // Now that all objects are in
+  // place, run the main loop. The
+  // stopping criterion is
+  // implemented at the bottom of the
+  // loop.
+  //
+  // In the loop, first set the new
+  // cycle number, then solve the
+  // problem, output its solution(s),
+  // apply the evaluation objects to
+  // it, then decide whether we want
+  // to refine the mesh further and
+  // solve again on this mesh, or
+  // jump out of the loop.
   for (step=0; step<=n_steps; ++step)
     {
-      std::cout << "Refinement cycle: "        << step
-               << std::endl;
+      std::cout << "Refinement cycle: " << step
+                << std::endl;
 
       solver->set_refinement_cycle (step);
       solver->solve_problem ();
       solver->output_solution ();
 
       std::cout << "   Number of degrees of freedom="
-               << solver->n_dofs() << std::endl;
+                << solver->n_dofs() << std::endl;
 
       for (typename EvaluatorList::const_iterator
-            e = descriptor.evaluator_list.begin();
-          e != descriptor.evaluator_list.end(); ++e)
-       {
-         (*e)->set_refinement_cycle (step);
-         solver->postprocess (**e);
-       };
+           e = descriptor.evaluator_list.begin();
+           e != descriptor.evaluator_list.end(); ++e)
+        {
+          (*e)->set_refinement_cycle (step);
+          solver->postprocess (**e);
+        };
 
 
       if (solver->n_dofs() < descriptor.max_degrees_of_freedom)
-       solver->refine_grid ();
+        solver->refine_grid ();
       else
-       break;
+        break;
     };
 
-                                  // After the loop has run, clean up
-                                  // the screen, and delete objects
-                                  // no more needed:
+  // After the loop has run, clean up
+  // the screen, and delete objects
+  // no more needed:
   std::cout << std::endl;
   delete solver;
   solver = 0;
@@ -4105,40 +4106,39 @@ void Framework<dim>::run (const ProblemDescription &descriptor)
 
 
 
-                                // @sect3{The main function}
+// @sect3{The main function}
 
-                                // Here finally comes the main
-                                // function. It drives the whole
-                                // process by specifying a set of
-                                // parameters to be used for the
-                                // simulation (polynomial degrees,
-                                // evaluation and dual functionals,
-                                // etc), and passes them packed into
-                                // a structure to the frame work
-                                // class above.
+// Here finally comes the main
+// function. It drives the whole
+// process by specifying a set of
+// parameters to be used for the
+// simulation (polynomial degrees,
+// evaluation and dual functionals,
+// etc), and passes them packed into
+// a structure to the frame work
+// class above.
 int main (int argc, char **argv)
 {
-                                  // if no argument is given, then do 18
-                                  // iterations
+  // if no argument is given, then do 18
+  // iterations
   if (argc == 1)
     n_steps = 18;
+  else if (argc == 2)
+    {
+      n_steps = atoi(argv[1]);
+      if ((n_steps==0) || (n_steps>100))
+        {
+          std::cout << "Please call this program with an argument in the range 1..100"
+                    << std::endl;
+          exit (1);
+        }
+    }
   else
-    if (argc == 2)
-      {
-       n_steps = atoi(argv[1]);
-       if ((n_steps==0) || (n_steps>100))
-         {
-           std::cout << "Please call this program with an argument in the range 1..100"
-                     << std::endl;
-           exit (1);
-         }
-      }
-    else
-      {
-       std::cout << "Please call this program with a single argument in the range 1..100"
-                 << std::endl;
-       exit (1);
-      }
+    {
+      std::cout << "Please call this program with a single argument in the range 1..100"
+                << std::endl;
+      exit (1);
+    }
 
 
 
@@ -4146,133 +4146,133 @@ int main (int argc, char **argv)
   deallog.depth_console (0);
   try
     {
-                                      // Describe the problem we want
-                                      // to solve here by passing a
-                                      // descriptor object to the
-                                      // function doing the rest of
-                                      // the work:
+      // Describe the problem we want
+      // to solve here by passing a
+      // descriptor object to the
+      // function doing the rest of
+      // the work:
       const unsigned int dim = 3;
       Framework<dim>::ProblemDescription descriptor;
 
-                                      // First set the refinement
-                                      // criterion we wish to use:
+      // First set the refinement
+      // criterion we wish to use:
       descriptor.refinement_criterion
-       = Framework<dim>::ProblemDescription::dual_weighted_error_estimator;
-                                      // Here, we could as well have
-                                      // used ``global_refinement''
-                                      // or
-                                      // ``weighted_kelly_indicator''. Note
-                                      // that the information given
-                                      // about dual finite elements,
-                                      // dual functional, etc is only
-                                      // important for the given
-                                      // choice of refinement
-                                      // criterion, and is ignored
-                                      // otherwise.
-
-                                      // Then set the polynomial
-                                      // degrees of primal and dual
-                                      // problem. We choose here
-                                      // bi-linear and bi-quadratic
-                                      // ones:
+        = Framework<dim>::ProblemDescription::dual_weighted_error_estimator;
+      // Here, we could as well have
+      // used ``global_refinement''
+      // or
+      // ``weighted_kelly_indicator''. Note
+      // that the information given
+      // about dual finite elements,
+      // dual functional, etc is only
+      // important for the given
+      // choice of refinement
+      // criterion, and is ignored
+      // otherwise.
+
+      // Then set the polynomial
+      // degrees of primal and dual
+      // problem. We choose here
+      // bi-linear and bi-quadratic
+      // ones:
       descriptor.primal_fe_degree = 1;
       descriptor.dual_fe_degree   = 2;
 
-                                      // Then set the description of
-                                      // the test case, i.e. domain,
-                                      // boundary values, and right
-                                      // hand side. These are
-                                      // prepackaged in classes. We
-                                      // take here the description of
-                                      // ``Exercise_2_3'', but you
-                                      // can also use
-                                      // ``CurvedRidges<dim>'':
+      // Then set the description of
+      // the test case, i.e. domain,
+      // boundary values, and right
+      // hand side. These are
+      // prepackaged in classes. We
+      // take here the description of
+      // ``Exercise_2_3'', but you
+      // can also use
+      // ``CurvedRidges<dim>'':
       descriptor.data = new Data::SetUp<Data::Exercise_2_3<dim>,dim> ();
 
-                                      // Next set first a dual
-                                      // functional, then a list of
-                                      // evaluation objects. We
-                                      // choose as default the
-                                      // evaluation of the
-                                      // value at an
-                                      // evaluation point,
-                                      // represented by the classes
-                                      // ``PointValueEvaluation''
-                                      // in the namespaces of
-                                      // evaluation and dual
-                                      // functional classes. You can
-                                      // also set the
-                                      // ``PointXDerivativeEvaluation''
-                                      // classes for the x-derivative
-                                      // instead of the value
-                                      // at the evaluation point.
-                                      //
-                                      // Note that dual functional
-                                      // and evaluation objects
-                                      // should match. However, you
-                                      // can give as many evaluation
-                                      // functionals as you want, so
-                                      // you can have both point
-                                      // value and derivative
-                                      // evaluated after each step.
-                                      // One such additional
-                                      // evaluation is to output the
-                                      // grid in each step.
+      // Next set first a dual
+      // functional, then a list of
+      // evaluation objects. We
+      // choose as default the
+      // evaluation of the
+      // value at an
+      // evaluation point,
+      // represented by the classes
+      // ``PointValueEvaluation''
+      // in the namespaces of
+      // evaluation and dual
+      // functional classes. You can
+      // also set the
+      // ``PointXDerivativeEvaluation''
+      // classes for the x-derivative
+      // instead of the value
+      // at the evaluation point.
+      //
+      // Note that dual functional
+      // and evaluation objects
+      // should match. However, you
+      // can give as many evaluation
+      // functionals as you want, so
+      // you can have both point
+      // value and derivative
+      // evaluated after each step.
+      // One such additional
+      // evaluation is to output the
+      // grid in each step.
       const Point<dim> evaluation_point (0., 0., 0.);
       descriptor.dual_functional
-       = new DualFunctional::PointValueEvaluation<dim> (evaluation_point);
+        = new DualFunctional::PointValueEvaluation<dim> (evaluation_point);
 
       Evaluation::PointValueEvaluation<dim>
-       postprocessor1 (evaluation_point);
+      postprocessor1 (evaluation_point);
       Evaluation::GridOutput<dim>
-       postprocessor2 ("grid");
+      postprocessor2 ("grid");
 
       descriptor.evaluator_list.push_back (&postprocessor1);
       descriptor.evaluator_list.push_back (&postprocessor2);
 
-                                      // Set the maximal number of
-                                      // degrees of freedom after
-                                      // which we want the program to
-                                      // stop refining the mesh
-                                      // further:
+      // Set the maximal number of
+      // degrees of freedom after
+      // which we want the program to
+      // stop refining the mesh
+      // further:
 #if defined(SPEC_CPU)
-                                      // raise from 20000 to 30000. (jfk p6f)
+      // raise from 20000 to 30000. (jfk p6f)
       descriptor.max_degrees_of_freedom = 30000;
 #else
       descriptor.max_degrees_of_freedom = 20000;
 #endif
 
-                                      // Finally pass the descriptor
-                                      // object to a function that
-                                      // runs the entire solution
-                                      // with it:
+      // Finally pass the descriptor
+      // object to a function that
+      // runs the entire solution
+      // with it:
       Framework<dim>::run (descriptor);
     }
 
-                                  // Catch exceptions to give
-                                  // information about things that
-                                  // failed:
+  // Catch exceptions to give
+  // information about things that
+  // failed:
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     }
   catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 
index 76eea21a70ed8e7e14ac090ab4c82c7e8f30fb29..e0b0298afe4006e13d9c4d2dc5c24bc2ea18dfd5 100644 (file)
  * step-22.cc
  */
 
-                                // @sect3{Include files}
+// @sect3{Include files}
 
-                                // As usual, we start by including
-                                // some well-known files:
+// As usual, we start by including
+// some well-known files:
 #include <deal.II/base/quadrature_lib.h>
 #include <deal.II/base/logstream.h>
 #include <deal.II/base/function.h>
 #include <deal.II/numerics/data_out.h>
 #include <deal.II/numerics/error_estimator.h>
 
-                                // Then we need to include the header file
-                                // for the sparse direct solver UMFPACK:
+// Then we need to include the header file
+// for the sparse direct solver UMFPACK:
 #include <deal.II/lac/sparse_direct.h>
 #include <deal.II/base/timer.h>
 
-                                // This includes the library for the
-                                // incomplete LU factorization that will
-                                // be used as a preconditioner in 3D:
+// This includes the library for the
+// incomplete LU factorization that will
+// be used as a preconditioner in 3D:
 #include <deal.II/lac/sparse_ilu.h>
 
-                                // This is C++:
+// This is C++:
 #include <fstream>
 #include <sstream>
 
-                                // As in all programs, the namespace dealii
-                                // is included:
+// As in all programs, the namespace dealii
+// is included:
 namespace Step22
 {
   using namespace dealii;
 
-                                  // @sect3{Defining the inner preconditioner type}
-
-                                  // As explained in the introduction, we are
-                                  // going to use different preconditioners for
-                                  // two and three space dimensions,
-                                  // respectively. We distinguish between
-                                  // them by the use of the spatial dimension
-                                  // as a template parameter. See step-4 for
-                                  // details on templates. We are not going to
-                                  // create any preconditioner object here, all
-                                  // we do is to create class that holds a
-                                  // local typedef determining the
-                                  // preconditioner class so we can write our
-                                  // program in a dimension-independent way.
+  // @sect3{Defining the inner preconditioner type}
+
+  // As explained in the introduction, we are
+  // going to use different preconditioners for
+  // two and three space dimensions,
+  // respectively. We distinguish between
+  // them by the use of the spatial dimension
+  // as a template parameter. See step-4 for
+  // details on templates. We are not going to
+  // create any preconditioner object here, all
+  // we do is to create class that holds a
+  // local typedef determining the
+  // preconditioner class so we can write our
+  // program in a dimension-independent way.
   template <int dim>
   struct InnerPreconditioner;
 
-                                  // In 2D, we are going to use a sparse direct
-                                  // solver as preconditioner:
+  // In 2D, we are going to use a sparse direct
+  // solver as preconditioner:
   template <>
   struct InnerPreconditioner<2>
   {
-      typedef SparseILU<double> type;
+    typedef SparseILU<double> type;
 //      typedef SparseDirectUMFPACK type;
   };
 
-                                   // And the ILU preconditioning in 3D, called
-                                   // by SparseILU:
+  // And the ILU preconditioning in 3D, called
+  // by SparseILU:
   template <>
   struct InnerPreconditioner<3>
   {
-      typedef SparseILU<double> type;
+    typedef SparseILU<double> type;
   };
 
 
-                                   // @sect3{The <code>StokesProblem</code> class template}
-
-                                   // This is an adaptation of step-20, so the
-                                   // main class and the data types are the
-                                   // same as used there. In this example we
-                                   // also use adaptive grid refinement, which
-                                   // is handled in analogy to
-                                   // step-6. According to the discussion in
-                                   // the introduction, we are also going to
-                                   // use the ConstraintMatrix for
-                                   // implementing Dirichlet boundary
-                                   // conditions. Hence, we change the name
-                                   // <code>hanging_node_constraints</code>
-                                   // into <code>constraints</code>.
+  // @sect3{The <code>StokesProblem</code> class template}
+
+  // This is an adaptation of step-20, so the
+  // main class and the data types are the
+  // same as used there. In this example we
+  // also use adaptive grid refinement, which
+  // is handled in analogy to
+  // step-6. According to the discussion in
+  // the introduction, we are also going to
+  // use the ConstraintMatrix for
+  // implementing Dirichlet boundary
+  // conditions. Hence, we change the name
+  // <code>hanging_node_constraints</code>
+  // into <code>constraints</code>.
   template <int dim>
   class StokesProblem
   {
-    public:
-      StokesProblem (const unsigned int degree);
-      void run ();
-
-    private:
-      void setup_dofs ();
-      void assemble_system ();
-      void solve ();
-      void output_results (const unsigned int refinement_cycle) const;
-      void refine_mesh ();
-
-      const unsigned int   degree;
-
-      Triangulation<dim>   triangulation;
-      FESystem<dim>        fe;
-      DoFHandler<dim>      dof_handler;
-
-      ConstraintMatrix     constraints;
-
-      BlockSparsityPattern      sparsity_pattern;
-      BlockSparseMatrix<double> system_matrix;
-
-      BlockVector<double> solution;
-      BlockVector<double> system_rhs;
-
-                                       // This one is new: We shall use a
-                                       // so-called shared pointer structure to
-                                       // access the preconditioner. Shared
-                                       // pointers are essentially just a
-                                       // convenient form of pointers. Several
-                                       // shared pointers can point to the same
-                                       // object (just like regular pointers),
-                                       // but when the last shared pointer
-                                       // object to point to a preconditioner
-                                       // object is deleted (for example if a
-                                       // shared pointer object goes out of
-                                       // scope, if the class of which it is a
-                                       // member is destroyed, or if the pointer
-                                       // is assigned a different preconditioner
-                                       // object) then the preconditioner object
-                                       // pointed to is also destroyed. This
-                                       // ensures that we don't have to manually
-                                       // track in how many places a
-                                       // preconditioner object is still
-                                       // referenced, it can never create a
-                                       // memory leak, and can never produce a
-                                       // dangling pointer to an already
-                                       // destroyed object:
-      std_cxx1x::shared_ptr<typename InnerPreconditioner<dim>::type> A_preconditioner;
-
-      TimerOutput timer;
+  public:
+    StokesProblem (const unsigned int degree);
+    void run ();
+
+  private:
+    void setup_dofs ();
+    void assemble_system ();
+    void solve ();
+    void output_results (const unsigned int refinement_cycle) const;
+    void refine_mesh ();
+
+    const unsigned int   degree;
+
+    Triangulation<dim>   triangulation;
+    FESystem<dim>        fe;
+    DoFHandler<dim>      dof_handler;
+
+    ConstraintMatrix     constraints;
+
+    BlockSparsityPattern      sparsity_pattern;
+    BlockSparseMatrix<double> system_matrix;
+
+    BlockVector<double> solution;
+    BlockVector<double> system_rhs;
+
+    // This one is new: We shall use a
+    // so-called shared pointer structure to
+    // access the preconditioner. Shared
+    // pointers are essentially just a
+    // convenient form of pointers. Several
+    // shared pointers can point to the same
+    // object (just like regular pointers),
+    // but when the last shared pointer
+    // object to point to a preconditioner
+    // object is deleted (for example if a
+    // shared pointer object goes out of
+    // scope, if the class of which it is a
+    // member is destroyed, or if the pointer
+    // is assigned a different preconditioner
+    // object) then the preconditioner object
+    // pointed to is also destroyed. This
+    // ensures that we don't have to manually
+    // track in how many places a
+    // preconditioner object is still
+    // referenced, it can never create a
+    // memory leak, and can never produce a
+    // dangling pointer to an already
+    // destroyed object:
+    std_cxx1x::shared_ptr<typename InnerPreconditioner<dim>::type> A_preconditioner;
+
+    TimerOutput timer;
   };
 
-                                   // @sect3{Boundary values and right hand side}
-
-                                   // As in step-20 and most other
-                                   // example programs, the next task is
-                                   // to define the data for the PDE:
-                                   // For the Stokes problem, we are
-                                   // going to use natural boundary
-                                   // values on parts of the boundary
-                                   // (i.e. homogenous Neumann-type) for
-                                   // which we won't have to do anything
-                                   // special (the homogeneity implies
-                                   // that the corresponding terms in
-                                   // the weak form are simply zero),
-                                   // and boundary conditions on the
-                                   // velocity (Dirichlet-type) on the
-                                   // rest of the boundary, as described
-                                   // in the introduction.
-                                   //
-                                   // In order to enforce the Dirichlet
-                                   // boundary values on the velocity,
-                                   // we will use the
-                                   // VectorTools::interpolate_boundary_values
-                                   // function as usual which requires
-                                   // us to write a function object with
-                                   // as many components as the finite
-                                   // element has. In other words, we
-                                   // have to define the function on the
-                                   // $(u,p)$-space, but we are going to
-                                   // filter out the pressure component
-                                   // when interpolating the boundary
-                                   // values.
-
-                                   // The following function object is a
-                                   // representation of the boundary
-                                   // values described in the
-                                   // introduction:
+  // @sect3{Boundary values and right hand side}
+
+  // As in step-20 and most other
+  // example programs, the next task is
+  // to define the data for the PDE:
+  // For the Stokes problem, we are
+  // going to use natural boundary
+  // values on parts of the boundary
+  // (i.e. homogenous Neumann-type) for
+  // which we won't have to do anything
+  // special (the homogeneity implies
+  // that the corresponding terms in
+  // the weak form are simply zero),
+  // and boundary conditions on the
+  // velocity (Dirichlet-type) on the
+  // rest of the boundary, as described
+  // in the introduction.
+  //
+  // In order to enforce the Dirichlet
+  // boundary values on the velocity,
+  // we will use the
+  // VectorTools::interpolate_boundary_values
+  // function as usual which requires
+  // us to write a function object with
+  // as many components as the finite
+  // element has. In other words, we
+  // have to define the function on the
+  // $(u,p)$-space, but we are going to
+  // filter out the pressure component
+  // when interpolating the boundary
+  // values.
+
+  // The following function object is a
+  // representation of the boundary
+  // values described in the
+  // introduction:
   template <int dim>
   class BoundaryValues : public Function<dim>
   {
-    public:
-      BoundaryValues () : Function<dim>(dim+1) {}
+  public:
+    BoundaryValues () : Function<dim>(dim+1) {}
 
-      virtual double value (const Point<dim>   &p,
-                            const unsigned int  component = 0) const;
+    virtual double value (const Point<dim>   &p,
+                          const unsigned int  component = 0) const;
 
-      virtual void vector_value (const Point<dim> &p,
-                                 Vector<double>   &value) const;
+    virtual void vector_value (const Point<dim> &p,
+                               Vector<double>   &value) const;
   };
 
 
@@ -256,20 +256,20 @@ namespace Step22
 
 
 
-                                   // We implement similar functions for
-                                   // the right hand side which for the
-                                   // current example is simply zero:
+  // We implement similar functions for
+  // the right hand side which for the
+  // current example is simply zero:
   template <int dim>
   class RightHandSide : public Function<dim>
   {
-    public:
-      RightHandSide () : Function<dim>(dim+1) {}
+  public:
+    RightHandSide () : Function<dim>(dim+1) {}
 
-      virtual double value (const Point<dim>   &p,
-                            const unsigned int  component = 0) const;
+    virtual double value (const Point<dim>   &p,
+                          const unsigned int  component = 0) const;
 
-      virtual void vector_value (const Point<dim> &p,
-                                 Vector<double>   &value) const;
+    virtual void vector_value (const Point<dim> &p,
+                               Vector<double>   &value) const;
 
   };
 
@@ -293,82 +293,82 @@ namespace Step22
   }
 
 
-                                   // @sect3{Linear solvers and preconditioners}
-
-                                   // The linear solvers and preconditioners are
-                                   // discussed extensively in the
-                                   // introduction. Here, we create the
-                                   // respective objects that will be used.
-
-                                   // @sect4{The <code>InverseMatrix</code> class template}
-
-                                   // The <code>InverseMatrix</code>
-                                   // class represents the data
-                                   // structure for an inverse
-                                   // matrix. It is derived from the one
-                                   // in step-20. The only difference is
-                                   // that we now do include a
-                                   // preconditioner to the matrix since
-                                   // we will apply this class to
-                                   // different kinds of matrices that
-                                   // will require different
-                                   // preconditioners (in step-20 we did
-                                   // not use a preconditioner in this
-                                   // class at all). The types of matrix
-                                   // and preconditioner are passed to
-                                   // this class via template
-                                   // parameters, and matrix and
-                                   // preconditioner objects of these
-                                   // types will then be passed to the
-                                   // constructor when an
-                                   // <code>InverseMatrix</code> object
-                                   // is created. The member function
-                                   // <code>vmult</code> is, as in
-                                   // step-20, a multiplication with a
-                                   // vector, obtained by solving a
-                                   // linear system:
+  // @sect3{Linear solvers and preconditioners}
+
+  // The linear solvers and preconditioners are
+  // discussed extensively in the
+  // introduction. Here, we create the
+  // respective objects that will be used.
+
+  // @sect4{The <code>InverseMatrix</code> class template}
+
+  // The <code>InverseMatrix</code>
+  // class represents the data
+  // structure for an inverse
+  // matrix. It is derived from the one
+  // in step-20. The only difference is
+  // that we now do include a
+  // preconditioner to the matrix since
+  // we will apply this class to
+  // different kinds of matrices that
+  // will require different
+  // preconditioners (in step-20 we did
+  // not use a preconditioner in this
+  // class at all). The types of matrix
+  // and preconditioner are passed to
+  // this class via template
+  // parameters, and matrix and
+  // preconditioner objects of these
+  // types will then be passed to the
+  // constructor when an
+  // <code>InverseMatrix</code> object
+  // is created. The member function
+  // <code>vmult</code> is, as in
+  // step-20, a multiplication with a
+  // vector, obtained by solving a
+  // linear system:
   template <class Matrix, class Preconditioner>
   class InverseMatrix : public Subscriptor
   {
-    public:
-      InverseMatrix (const Matrix         &m,
-                     const Preconditioner &preconditioner);
+  public:
+    InverseMatrix (const Matrix         &m,
+                   const Preconditioner &preconditioner);
 
-      void vmult (Vector<double>       &dst,
-                  const Vector<double> &src) const;
+    void vmult (Vector<double>       &dst,
+                const Vector<double> &src) const;
 
-    private:
-      const SmartPointer<const Matrix> matrix;
-      const SmartPointer<const Preconditioner> preconditioner;
+  private:
+    const SmartPointer<const Matrix> matrix;
+    const SmartPointer<const Preconditioner> preconditioner;
   };
 
 
   template <class Matrix, class Preconditioner>
   InverseMatrix<Matrix,Preconditioner>::InverseMatrix (const Matrix &m,
                                                        const Preconditioner &preconditioner)
-                  :
-                  matrix (&m),
-                  preconditioner (&preconditioner)
+    :
+    matrix (&m),
+    preconditioner (&preconditioner)
   {}
 
 
-                                   // This is the implementation of the
-                                   // <code>vmult</code> function.
-
-                                   // In this class we use a rather large
-                                   // tolerance for the solver control. The
-                                   // reason for this is that the function is
-                                   // used very frequently, and hence, any
-                                   // additional effort to make the residual
-                                   // in the CG solve smaller makes the
-                                   // solution more expensive. Note that we do
-                                   // not only use this class as a
-                                   // preconditioner for the Schur complement,
-                                   // but also when forming the inverse of the
-                                   // Laplace matrix &ndash; which is hence
-                                   // directly responsible for the accuracy of
-                                   // the solution itself, so we can't choose
-                                   // a too large tolerance, either.
+  // This is the implementation of the
+  // <code>vmult</code> function.
+
+  // In this class we use a rather large
+  // tolerance for the solver control. The
+  // reason for this is that the function is
+  // used very frequently, and hence, any
+  // additional effort to make the residual
+  // in the CG solve smaller makes the
+  // solution more expensive. Note that we do
+  // not only use this class as a
+  // preconditioner for the Schur complement,
+  // but also when forming the inverse of the
+  // Laplace matrix &ndash; which is hence
+  // directly responsible for the accuracy of
+  // the solution itself, so we can't choose
+  // a too large tolerance, either.
   template <class Matrix, class Preconditioner>
   void InverseMatrix<Matrix,Preconditioner>::vmult (Vector<double>       &dst,
                                                     const Vector<double> &src) const
@@ -382,36 +382,36 @@ namespace Step22
   }
 
 
-                                   // @sect4{The <code>SchurComplement</code> class template}
-
-                                   // This class implements the Schur complement
-                                   // discussed in the introduction.  It is in
-                                   // analogy to step-20.  Though, we now call
-                                   // it with a template parameter
-                                   // <code>Preconditioner</code> in order to
-                                   // access that when specifying the respective
-                                   // type of the inverse matrix class. As a
-                                   // consequence of the definition above, the
-                                   // declaration <code>InverseMatrix</code> now
-                                   // contains the second template parameter
-                                   // for a preconditioner class as above, which
-                                   // affects the <code>SmartPointer</code>
-                                   // object <code>m_inverse</code> as well.
+  // @sect4{The <code>SchurComplement</code> class template}
+
+  // This class implements the Schur complement
+  // discussed in the introduction.  It is in
+  // analogy to step-20.  Though, we now call
+  // it with a template parameter
+  // <code>Preconditioner</code> in order to
+  // access that when specifying the respective
+  // type of the inverse matrix class. As a
+  // consequence of the definition above, the
+  // declaration <code>InverseMatrix</code> now
+  // contains the second template parameter
+  // for a preconditioner class as above, which
+  // affects the <code>SmartPointer</code>
+  // object <code>m_inverse</code> as well.
   template <class Preconditioner>
   class SchurComplement : public Subscriptor
   {
-    public:
-      SchurComplement (const BlockSparseMatrix<double> &system_matrix,
-                       const InverseMatrix<SparseMatrix<double>, Preconditioner> &A_inverse);
+  public:
+    SchurComplement (const BlockSparseMatrix<double> &system_matrix,
+                     const InverseMatrix<SparseMatrix<double>, Preconditioner> &A_inverse);
 
-      void vmult (Vector<double>       &dst,
-                  const Vector<double> &src) const;
+    void vmult (Vector<double>       &dst,
+                const Vector<double> &src) const;
 
-    private:
-      const SmartPointer<const BlockSparseMatrix<double> > system_matrix;
-      const SmartPointer<const InverseMatrix<SparseMatrix<double>, Preconditioner> > A_inverse;
+  private:
+    const SmartPointer<const BlockSparseMatrix<double> > system_matrix;
+    const SmartPointer<const InverseMatrix<SparseMatrix<double>, Preconditioner> > A_inverse;
 
-      mutable Vector<double> tmp1, tmp2;
+    mutable Vector<double> tmp1, tmp2;
   };
 
 
@@ -420,11 +420,11 @@ namespace Step22
   SchurComplement<Preconditioner>::
   SchurComplement (const BlockSparseMatrix<double> &system_matrix,
                    const InverseMatrix<SparseMatrix<double>,Preconditioner> &A_inverse)
-                  :
-                  system_matrix (&system_matrix),
-                  A_inverse (&A_inverse),
-                  tmp1 (system_matrix.block(0,0).m()),
-                  tmp2 (system_matrix.block(0,0).m())
+    :
+    system_matrix (&system_matrix),
+    A_inverse (&A_inverse),
+    tmp1 (system_matrix.block(0,0).m()),
+    tmp2 (system_matrix.block(0,0).m())
   {}
 
 
@@ -438,138 +438,138 @@ namespace Step22
   }
 
 
-                                   // @sect3{StokesProblem class implementation}
-
-                                   // @sect4{StokesProblem::StokesProblem}
-
-                                   // The constructor of this class
-                                   // looks very similar to the one of
-                                   // step-20. The constructor
-                                   // initializes the variables for the
-                                   // polynomial degree, triangulation,
-                                   // finite element system and the dof
-                                   // handler. The underlying polynomial
-                                   // functions are of order
-                                   // <code>degree+1</code> for the
-                                   // vector-valued velocity components
-                                   // and of order <code>degree</code>
-                                   // for the pressure.  This gives the
-                                   // LBB-stable element pair
-                                   // $Q_{degree+1}^d\times Q_{degree}$,
-                                   // often referred to as the
-                                   // Taylor-Hood element.
-                                   //
-                                   // Note that we initialize the triangulation
-                                   // with a MeshSmoothing argument, which
-                                   // ensures that the refinement of cells is
-                                   // done in a way that the approximation of
-                                   // the PDE solution remains well-behaved
-                                   // (problems arise if grids are too
-                                   // unstructered), see the documentation of
-                                   // <code>Triangulation::MeshSmoothing</code>
-                                   // for details.
+  // @sect3{StokesProblem class implementation}
+
+  // @sect4{StokesProblem::StokesProblem}
+
+  // The constructor of this class
+  // looks very similar to the one of
+  // step-20. The constructor
+  // initializes the variables for the
+  // polynomial degree, triangulation,
+  // finite element system and the dof
+  // handler. The underlying polynomial
+  // functions are of order
+  // <code>degree+1</code> for the
+  // vector-valued velocity components
+  // and of order <code>degree</code>
+  // for the pressure.  This gives the
+  // LBB-stable element pair
+  // $Q_{degree+1}^d\times Q_{degree}$,
+  // often referred to as the
+  // Taylor-Hood element.
+  //
+  // Note that we initialize the triangulation
+  // with a MeshSmoothing argument, which
+  // ensures that the refinement of cells is
+  // done in a way that the approximation of
+  // the PDE solution remains well-behaved
+  // (problems arise if grids are too
+  // unstructered), see the documentation of
+  // <code>Triangulation::MeshSmoothing</code>
+  // for details.
   template <int dim>
   StokesProblem<dim>::StokesProblem (const unsigned int degree)
-                  :
-                  degree (degree),
-                  triangulation (Triangulation<dim>::maximum_smoothing),
-                  fe (FE_Q<dim>(degree+1), dim,
-                      FE_Q<dim>(degree), 1),
-                  dof_handler (triangulation),
-                 timer (std::cout, TimerOutput::summary, TimerOutput::cpu_times)
+    :
+    degree (degree),
+    triangulation (Triangulation<dim>::maximum_smoothing),
+    fe (FE_Q<dim>(degree+1), dim,
+        FE_Q<dim>(degree), 1),
+    dof_handler (triangulation),
+    timer (std::cout, TimerOutput::summary, TimerOutput::cpu_times)
   {}
 
 
-                                   // @sect4{StokesProblem::setup_dofs}
-
-                                   // Given a mesh, this function
-                                   // associates the degrees of freedom
-                                   // with it and creates the
-                                   // corresponding matrices and
-                                   // vectors. At the beginning it also
-                                   // releases the pointer to the
-                                   // preconditioner object (if the
-                                   // shared pointer pointed at anything
-                                   // at all at this point) since it
-                                   // will definitely not be needed any
-                                   // more after this point and will
-                                   // have to be re-computed after
-                                   // assembling the matrix, and unties
-                                   // the sparse matrix from its
-                                   // sparsity pattern object.
-                                   //
-                                   // We then proceed with distributing
-                                   // degrees of freedom and renumbering
-                                   // them: In order to make the ILU
-                                   // preconditioner (in 3D) work
-                                   // efficiently, it is important to
-                                   // enumerate the degrees of freedom
-                                   // in such a way that it reduces the
-                                   // bandwidth of the matrix, or maybe
-                                   // more importantly: in such a way
-                                   // that the ILU is as close as
-                                   // possible to a real LU
-                                   // decomposition. On the other hand,
-                                   // we need to preserve the block
-                                   // structure of velocity and pressure
-                                   // already seen in in step-20 and
-                                   // step-21. This is done in two
-                                   // steps: First, all dofs are
-                                   // renumbered to improve the ILU and
-                                   // then we renumber once again by
-                                   // components. Since
-                                   // <code>DoFRenumbering::component_wise</code>
-                                   // does not touch the renumbering
-                                   // within the individual blocks, the
-                                   // basic renumbering from the first
-                                   // step remains. As for how the
-                                   // renumber degrees of freedom to
-                                   // improve the ILU: deal.II has a
-                                   // number of algorithms that attempt
-                                   // to find orderings to improve ILUs,
-                                   // or reduce the bandwidth of
-                                   // matrices, or optimize some other
-                                   // aspect. The DoFRenumbering
-                                   // namespace shows a comparison of
-                                   // the results we obtain with several
-                                   // of these algorithms based on the
-                                   // testcase discussed here in this
-                                   // tutorial program. Here, we will
-                                   // use the traditional Cuthill-McKee
-                                   // algorithm already used in some of
-                                   // the previous tutorial programs.
-                                   // In the
-                                   // <a href="#improved-ilu">section on improved ILU</a>
-                                   // we're going to discuss this issue
-                                   // in more detail.
-
-                                   // There is one more change compared
-                                   // to previous tutorial programs:
-                                   // There is no reason in sorting the
-                                   // <code>dim</code> velocity
-                                   // components individually. In fact,
-                                   // rather than first enumerating all
-                                   // $x$-velocities, then all
-                                   // $y$-velocities, etc, we would like
-                                   // to keep all velocities at the same
-                                   // location together and only
-                                   // separate between velocities (all
-                                   // components) and pressures. By
-                                   // default, this is not what the
-                                   // DoFRenumbering::component_wise
-                                   // function does: it treats each
-                                   // vector component separately; what
-                                   // we have to do is group several
-                                   // components into "blocks" and pass
-                                   // this block structure to that
-                                   // function. Consequently, we
-                                   // allocate a vector
-                                   // <code>block_component</code> with
-                                   // as many elements as there are
-                                   // components and describe all
-                                   // velocity components to correspond
-                                   // to block 0, while the pressure
-                                   // component will form block 1:
+  // @sect4{StokesProblem::setup_dofs}
+
+  // Given a mesh, this function
+  // associates the degrees of freedom
+  // with it and creates the
+  // corresponding matrices and
+  // vectors. At the beginning it also
+  // releases the pointer to the
+  // preconditioner object (if the
+  // shared pointer pointed at anything
+  // at all at this point) since it
+  // will definitely not be needed any
+  // more after this point and will
+  // have to be re-computed after
+  // assembling the matrix, and unties
+  // the sparse matrix from its
+  // sparsity pattern object.
+  //
+  // We then proceed with distributing
+  // degrees of freedom and renumbering
+  // them: In order to make the ILU
+  // preconditioner (in 3D) work
+  // efficiently, it is important to
+  // enumerate the degrees of freedom
+  // in such a way that it reduces the
+  // bandwidth of the matrix, or maybe
+  // more importantly: in such a way
+  // that the ILU is as close as
+  // possible to a real LU
+  // decomposition. On the other hand,
+  // we need to preserve the block
+  // structure of velocity and pressure
+  // already seen in in step-20 and
+  // step-21. This is done in two
+  // steps: First, all dofs are
+  // renumbered to improve the ILU and
+  // then we renumber once again by
+  // components. Since
+  // <code>DoFRenumbering::component_wise</code>
+  // does not touch the renumbering
+  // within the individual blocks, the
+  // basic renumbering from the first
+  // step remains. As for how the
+  // renumber degrees of freedom to
+  // improve the ILU: deal.II has a
+  // number of algorithms that attempt
+  // to find orderings to improve ILUs,
+  // or reduce the bandwidth of
+  // matrices, or optimize some other
+  // aspect. The DoFRenumbering
+  // namespace shows a comparison of
+  // the results we obtain with several
+  // of these algorithms based on the
+  // testcase discussed here in this
+  // tutorial program. Here, we will
+  // use the traditional Cuthill-McKee
+  // algorithm already used in some of
+  // the previous tutorial programs.
+  // In the
+  // <a href="#improved-ilu">section on improved ILU</a>
+  // we're going to discuss this issue
+  // in more detail.
+
+  // There is one more change compared
+  // to previous tutorial programs:
+  // There is no reason in sorting the
+  // <code>dim</code> velocity
+  // components individually. In fact,
+  // rather than first enumerating all
+  // $x$-velocities, then all
+  // $y$-velocities, etc, we would like
+  // to keep all velocities at the same
+  // location together and only
+  // separate between velocities (all
+  // components) and pressures. By
+  // default, this is not what the
+  // DoFRenumbering::component_wise
+  // function does: it treats each
+  // vector component separately; what
+  // we have to do is group several
+  // components into "blocks" and pass
+  // this block structure to that
+  // function. Consequently, we
+  // allocate a vector
+  // <code>block_component</code> with
+  // as many elements as there are
+  // components and describe all
+  // velocity components to correspond
+  // to block 0, while the pressure
+  // component will form block 1:
   template <int dim>
   void StokesProblem<dim>::setup_dofs ()
   {
@@ -583,44 +583,44 @@ namespace Step22
     block_component[dim] = 1;
     DoFRenumbering::component_wise (dof_handler, block_component);
 
-                                     // Now comes the implementation of
-                                     // Dirichlet boundary conditions, which
-                                     // should be evident after the discussion
-                                     // in the introduction. All that changed is
-                                     // that the function already appears in the
-                                     // setup functions, whereas we were used to
-                                     // see it in some assembly routine. Further
-                                     // down below where we set up the mesh, we
-                                     // will associate the top boundary where we
-                                     // impose Dirichlet boundary conditions
-                                     // with boundary indicator 1.  We will have
-                                     // to pass this boundary indicator as
-                                     // second argument to the function below
-                                     // interpolating boundary values.  There is
-                                     // one more thing, though.  The function
-                                     // describing the Dirichlet conditions was
-                                     // defined for all components, both
-                                     // velocity and pressure. However, the
-                                     // Dirichlet conditions are to be set for
-                                     // the velocity only.  To this end, we use
-                                     // a <code>component_mask</code> that
-                                     // filters out the pressure component, so
-                                     // that the condensation is performed on
-                                     // velocity degrees of freedom only. Since
-                                     // we use adaptively refined grids the
-                                     // constraint matrix needs to be first
-                                     // filled with hanging node constraints
-                                     // generated from the DoF handler. Note the
-                                     // order of the two functions &mdash; we
-                                     // first compute the hanging node
-                                     // constraints, and then insert the
-                                     // boundary values into the constraint
-                                     // matrix. This makes sure that we respect
-                                     // H<sup>1</sup> conformity on boundaries
-                                     // with hanging nodes (in three space
-                                     // dimensions), where the hanging node
-                                     // needs to dominate the Dirichlet boundary
-                                     // values.
+    // Now comes the implementation of
+    // Dirichlet boundary conditions, which
+    // should be evident after the discussion
+    // in the introduction. All that changed is
+    // that the function already appears in the
+    // setup functions, whereas we were used to
+    // see it in some assembly routine. Further
+    // down below where we set up the mesh, we
+    // will associate the top boundary where we
+    // impose Dirichlet boundary conditions
+    // with boundary indicator 1.  We will have
+    // to pass this boundary indicator as
+    // second argument to the function below
+    // interpolating boundary values.  There is
+    // one more thing, though.  The function
+    // describing the Dirichlet conditions was
+    // defined for all components, both
+    // velocity and pressure. However, the
+    // Dirichlet conditions are to be set for
+    // the velocity only.  To this end, we use
+    // a <code>component_mask</code> that
+    // filters out the pressure component, so
+    // that the condensation is performed on
+    // velocity degrees of freedom only. Since
+    // we use adaptively refined grids the
+    // constraint matrix needs to be first
+    // filled with hanging node constraints
+    // generated from the DoF handler. Note the
+    // order of the two functions &mdash; we
+    // first compute the hanging node
+    // constraints, and then insert the
+    // boundary values into the constraint
+    // matrix. This makes sure that we respect
+    // H<sup>1</sup> conformity on boundaries
+    // with hanging nodes (in three space
+    // dimensions), where the hanging node
+    // needs to dominate the Dirichlet boundary
+    // values.
     {
       constraints.clear ();
       std::vector<bool> component_mask (dim+1, true);
@@ -636,17 +636,17 @@ namespace Step22
 
     constraints.close ();
 
-                                     // In analogy to step-20, we count the dofs
-                                     // in the individual components.  We could
-                                     // do this in the same way as there, but we
-                                     // want to operate on the block structure
-                                     // we used already for the renumbering: The
-                                     // function
-                                     // <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>.
+    // In analogy to step-20, we count the dofs
+    // in the individual components.  We could
+    // do this in the same way as there, but we
+    // want to operate on the block structure
+    // we used already for the renumbering: The
+    // function
+    // <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);
     DoFTools::count_dofs_per_block (dof_handler, dofs_per_block, block_component);
     const unsigned int n_u = dofs_per_block[0],
@@ -660,84 +660,84 @@ namespace Step22
               << " (" << n_u << '+' << n_p << ')'
               << std::endl;
 
-                                     // The next task is to allocate a
-                                     // sparsity pattern for the system matrix
-                                     // we will create. We could do this in
-                                     // the same way as in step-20,
-                                     // i.e. directly build an object of type
-                                     // SparsityPattern through
-                                     // DoFTools::make_sparsity_pattern. However,
-                                     // there is a major reason not to do so:
-                                     // In 3D, the function
-                                     // DoFTools::max_couplings_between_dofs
-                                     // yields a conservative but rather large
-                                     // number for the coupling between the
-                                     // individual dofs, so that the memory
-                                     // initially provided for the creation of
-                                     // the sparsity pattern of the matrix is
-                                     // far too much -- so much actually that
-                                     // the initial sparsity pattern won't
-                                     // even fit into the physical memory of
-                                     // most systems already for
-                                     // moderately-sized 3D problems, see also
-                                     // the discussion in step-18.  Instead,
-                                     // we first build a temporary object that
-                                     // uses a different data structure that
-                                     // doesn't require allocating more memory
-                                     // than necessary but isn't suitable for
-                                     // use as a basis of SparseMatrix or
-                                     // BlockSparseMatrix objects; in a second
-                                     // step we then copy this object into an
-                                     // object of BlockSparsityPattern. This
-                                     // is entirely analgous to what we
-                                     // already did in step-11 and step-18.
-                                     //
-                                     // There is one snag again here, though:
-                                     // it turns out that using the
-                                     // CompressedSparsityPattern (or the
-                                     // block version
-                                     // BlockCompressedSparsityPattern we
-                                     // would use here) has a bottleneck that
-                                     // makes the algorithm to build the
-                                     // sparsity pattern be quadratic in the
-                                     // number of degrees of freedom. This
-                                     // doesn't become noticeable until we get
-                                     // well into the range of several 100,000
-                                     // degrees of freedom, but eventually
-                                     // dominates the setup of the linear
-                                     // system when we get to more than a
-                                     // million degrees of freedom. This is
-                                     // due to the data structures used in the
-                                     // CompressedSparsityPattern class,
-                                     // nothing that can easily be
-                                     // changed. Fortunately, there is an easy
-                                     // solution: the
-                                     // CompressedSimpleSparsityPattern class
-                                     // (and its block variant
-                                     // BlockCompressedSimpleSparsityPattern)
-                                     // has exactly the same interface, uses a
-                                     // different %internal data structure and
-                                     // is linear in the number of degrees of
-                                     // freedom and therefore much more
-                                     // efficient for large problems. As
-                                     // another alternative, we could also
-                                     // have chosen the class
-                                     // BlockCompressedSetSparsityPattern that
-                                     // uses yet another strategy for %internal
-                                     // memory management. Though, that class
-                                     // turns out to be more memory-demanding
-                                     // than
-                                     // BlockCompressedSimpleSparsityPattern
-                                     // for this example.
-                                     //
-                                     // Consequently, this is the class that
-                                     // we will use for our intermediate
-                                     // sparsity representation. All this is
-                                     // done inside a new scope, which means
-                                     // that the memory of <code>csp</code>
-                                     // will be released once the information
-                                     // has been copied to
-                                     // <code>sparsity_pattern</code>.
+    // The next task is to allocate a
+    // sparsity pattern for the system matrix
+    // we will create. We could do this in
+    // the same way as in step-20,
+    // i.e. directly build an object of type
+    // SparsityPattern through
+    // DoFTools::make_sparsity_pattern. However,
+    // there is a major reason not to do so:
+    // In 3D, the function
+    // DoFTools::max_couplings_between_dofs
+    // yields a conservative but rather large
+    // number for the coupling between the
+    // individual dofs, so that the memory
+    // initially provided for the creation of
+    // the sparsity pattern of the matrix is
+    // far too much -- so much actually that
+    // the initial sparsity pattern won't
+    // even fit into the physical memory of
+    // most systems already for
+    // moderately-sized 3D problems, see also
+    // the discussion in step-18.  Instead,
+    // we first build a temporary object that
+    // uses a different data structure that
+    // doesn't require allocating more memory
+    // than necessary but isn't suitable for
+    // use as a basis of SparseMatrix or
+    // BlockSparseMatrix objects; in a second
+    // step we then copy this object into an
+    // object of BlockSparsityPattern. This
+    // is entirely analgous to what we
+    // already did in step-11 and step-18.
+    //
+    // There is one snag again here, though:
+    // it turns out that using the
+    // CompressedSparsityPattern (or the
+    // block version
+    // BlockCompressedSparsityPattern we
+    // would use here) has a bottleneck that
+    // makes the algorithm to build the
+    // sparsity pattern be quadratic in the
+    // number of degrees of freedom. This
+    // doesn't become noticeable until we get
+    // well into the range of several 100,000
+    // degrees of freedom, but eventually
+    // dominates the setup of the linear
+    // system when we get to more than a
+    // million degrees of freedom. This is
+    // due to the data structures used in the
+    // CompressedSparsityPattern class,
+    // nothing that can easily be
+    // changed. Fortunately, there is an easy
+    // solution: the
+    // CompressedSimpleSparsityPattern class
+    // (and its block variant
+    // BlockCompressedSimpleSparsityPattern)
+    // has exactly the same interface, uses a
+    // different %internal data structure and
+    // is linear in the number of degrees of
+    // freedom and therefore much more
+    // efficient for large problems. As
+    // another alternative, we could also
+    // have chosen the class
+    // BlockCompressedSetSparsityPattern that
+    // uses yet another strategy for %internal
+    // memory management. Though, that class
+    // turns out to be more memory-demanding
+    // than
+    // BlockCompressedSimpleSparsityPattern
+    // for this example.
+    //
+    // Consequently, this is the class that
+    // we will use for our intermediate
+    // sparsity representation. All this is
+    // done inside a new scope, which means
+    // that the memory of <code>csp</code>
+    // will be released once the information
+    // has been copied to
+    // <code>sparsity_pattern</code>.
     {
       BlockCompressedSimpleSparsityPattern csp (2,2);
 
@@ -752,10 +752,10 @@ namespace Step22
       sparsity_pattern.copy_from (csp);
     }
 
-                                     // Finally, the system matrix,
-                                     // solution and right hand side are
-                                     // created from the block
-                                     // structure as in step-20:
+    // Finally, the system matrix,
+    // solution and right hand side are
+    // created from the block
+    // structure as in step-20:
     system_matrix.reinit (sparsity_pattern);
 
     solution.reinit (2);
@@ -770,16 +770,16 @@ namespace Step22
   }
 
 
-                                   // @sect4{StokesProblem::assemble_system}
+  // @sect4{StokesProblem::assemble_system}
 
-                                   // The assembly process follows the
-                                   // discussion in step-20 and in the
-                                   // introduction. We use the well-known
-                                   // abbreviations for the data structures
-                                   // that hold the local matrix, right
-                                   // hand side, and global
-                                   // numbering of the degrees of freedom
-                                   // for the present cell.
+  // The assembly process follows the
+  // discussion in step-20 and in the
+  // introduction. We use the well-known
+  // abbreviations for the data structures
+  // that hold the local matrix, right
+  // hand side, and global
+  // numbering of the degrees of freedom
+  // for the present cell.
   template <int dim>
   void StokesProblem<dim>::assemble_system ()
   {
@@ -807,70 +807,70 @@ namespace Step22
     std::vector<Vector<double> >      rhs_values (n_q_points,
                                                   Vector<double>(dim+1));
 
-                                     // Next, we need two objects that work as
-                                     // extractors for the FEValues
-                                     // object. Their use is explained in detail
-                                     // in the report on @ref vector_valued :
+    // Next, we need two objects that work as
+    // extractors for the FEValues
+    // object. Their use is explained in detail
+    // in the report on @ref vector_valued :
     const FEValuesExtractors::Vector velocities (0);
     const FEValuesExtractors::Scalar pressure (dim);
 
-                                     // As an extension over step-20 and
-                                     // step-21, we include a few
-                                     // optimizations that make assembly
-                                     // much faster for this particular
-                                     // problem.  The improvements are
-                                     // based on the observation that we
-                                     // do a few calculations too many
-                                     // times when we do as in step-20:
-                                     // The symmetric gradient actually
-                                     // has <code>dofs_per_cell</code>
-                                     // different values per quadrature
-                                     // point, but we extract it
-                                     // <code>dofs_per_cell*dofs_per_cell</code>
-                                     // times from the FEValues object -
-                                     // for both the loop over
-                                     // <code>i</code> and the inner
-                                     // loop over <code>j</code>. In 3d,
-                                     // that means evaluating it
-                                     // $89^2=7921$ instead of $89$
-                                     // times, a not insignificant
-                                     // difference.
-                                     //
-                                     // So what we're
-                                     // going to do here is to avoid
-                                     // such repeated calculations by
-                                     // getting a vector of rank-2
-                                     // tensors (and similarly for
-                                     // the divergence and the basis
-                                     // function value on pressure)
-                                     // at the quadrature point prior
-                                     // to starting the loop over the
-                                     // dofs on the cell. First, we
-                                     // create the respective objects
-                                     // that will hold these
-                                     // values. Then, we start the
-                                     // loop over all cells and the loop
-                                     // over the quadrature points,
-                                     // where we first extract these
-                                     // values. There is one more
-                                     // optimization we implement here:
-                                     // the local matrix (as well as
-                                     // the global one) is going to
-                                     // be symmetric, since all
-                                     // the operations involved are
-                                     // symmetric with respect to $i$
-                                     // and $j$. This is implemented by
-                                     // simply running the inner loop
-                                     // not to <code>dofs_per_cell</code>,
-                                     // but only up to <code>i</code>,
-                                     // the index of the outer loop.
+    // As an extension over step-20 and
+    // step-21, we include a few
+    // optimizations that make assembly
+    // much faster for this particular
+    // problem.  The improvements are
+    // based on the observation that we
+    // do a few calculations too many
+    // times when we do as in step-20:
+    // The symmetric gradient actually
+    // has <code>dofs_per_cell</code>
+    // different values per quadrature
+    // point, but we extract it
+    // <code>dofs_per_cell*dofs_per_cell</code>
+    // times from the FEValues object -
+    // for both the loop over
+    // <code>i</code> and the inner
+    // loop over <code>j</code>. In 3d,
+    // that means evaluating it
+    // $89^2=7921$ instead of $89$
+    // times, a not insignificant
+    // difference.
+    //
+    // So what we're
+    // going to do here is to avoid
+    // such repeated calculations by
+    // getting a vector of rank-2
+    // tensors (and similarly for
+    // the divergence and the basis
+    // function value on pressure)
+    // at the quadrature point prior
+    // to starting the loop over the
+    // dofs on the cell. First, we
+    // create the respective objects
+    // that will hold these
+    // values. Then, we start the
+    // loop over all cells and the loop
+    // over the quadrature points,
+    // where we first extract these
+    // values. There is one more
+    // optimization we implement here:
+    // the local matrix (as well as
+    // the global one) is going to
+    // be symmetric, since all
+    // the operations involved are
+    // symmetric with respect to $i$
+    // and $j$. This is implemented by
+    // simply running the inner loop
+    // not to <code>dofs_per_cell</code>,
+    // but only up to <code>i</code>,
+    // the index of the outer loop.
     std::vector<SymmetricTensor<2,dim> > symgrad_phi_u (dofs_per_cell);
     std::vector<double>                  div_phi_u   (dofs_per_cell);
     std::vector<double>                  phi_p       (dofs_per_cell);
 
     typename DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     for (; cell!=endc; ++cell)
       {
         fe_values.reinit (cell);
@@ -909,47 +909,47 @@ namespace Step22
               }
           }
 
-                                         // Note that in the above computation
-                                         // of the local matrix contribution
-                                         // we added the term <code> phi_p[i] *
-                                         // phi_p[j] </code>, yielding a
-                                         // pressure mass matrix in the
-                                         // $(1,1)$ block of the matrix as
-                                         // discussed in the
-                                         // introduction. That this term only
-                                         // ends up in the $(1,1)$ block stems
-                                         // from the fact that both of the
-                                         // factors in <code>phi_p[i] *
-                                         // phi_p[j]</code> are only non-zero
-                                         // when all the other terms vanish
-                                         // (and the other way around).
-                                         //
-                                         // Note also that operator* is
-                                         // overloaded for symmetric
-                                         // tensors, yielding the scalar
-                                         // product between the two
-                                         // tensors in the first line of
-                                         // the local matrix
-                                         // contribution.
-
-                                         // Before we can write the local data
-                                         // into the global matrix (and
-                                         // simultaneously use the
-                                         // ConstraintMatrix object to apply
-                                         // Dirichlet boundary conditions and
-                                         // eliminate hanging node
-                                         // constraints, as we discussed in
-                                         // the introduction), we have to be
-                                         // careful about one thing,
-                                         // though. We have only build up half
-                                         // of the local matrix because of
-                                         // symmetry, but we're going to save
-                                         // the full system matrix in order to
-                                         // use the standard functions for
-                                         // solution. This is done by flipping
-                                         // the indices in case we are
-                                         // pointing into the empty part of
-                                         // the local matrix.
+        // Note that in the above computation
+        // of the local matrix contribution
+        // we added the term <code> phi_p[i] *
+        // phi_p[j] </code>, yielding a
+        // pressure mass matrix in the
+        // $(1,1)$ block of the matrix as
+        // discussed in the
+        // introduction. That this term only
+        // ends up in the $(1,1)$ block stems
+        // from the fact that both of the
+        // factors in <code>phi_p[i] *
+        // phi_p[j]</code> are only non-zero
+        // when all the other terms vanish
+        // (and the other way around).
+        //
+        // Note also that operator* is
+        // overloaded for symmetric
+        // tensors, yielding the scalar
+        // product between the two
+        // tensors in the first line of
+        // the local matrix
+        // contribution.
+
+        // Before we can write the local data
+        // into the global matrix (and
+        // simultaneously use the
+        // ConstraintMatrix object to apply
+        // Dirichlet boundary conditions and
+        // eliminate hanging node
+        // constraints, as we discussed in
+        // the introduction), we have to be
+        // careful about one thing,
+        // though. We have only build up half
+        // of the local matrix because of
+        // symmetry, but we're going to save
+        // the full system matrix in order to
+        // use the standard functions for
+        // solution. This is done by flipping
+        // the indices in case we are
+        // pointing into the empty part of
+        // the local matrix.
         for (unsigned int i=0; i<dofs_per_cell; ++i)
           for (unsigned int j=i+1; j<dofs_per_cell; ++j)
             local_matrix(i,j) = local_matrix(j,i);
@@ -960,21 +960,21 @@ namespace Step22
                                                 system_matrix, system_rhs);
       }
 
-                                     // Before we're going to solve this
-                                     // linear system, we generate a
-                                     // preconditioner for the
-                                     // velocity-velocity matrix, i.e.,
-                                     // <code>block(0,0)</code> in the
-                                     // system matrix. As mentioned
-                                     // above, this depends on the
-                                     // spatial dimension. Since the two
-                                     // classes described by the
-                                     // <code>InnerPreconditioner::type</code>
-                                     // typedef have the same interface,
-                                     // we do not have to do anything
-                                     // different whether we want to use
-                                     // a sparse direct solver or an
-                                     // ILU:
+    // Before we're going to solve this
+    // linear system, we generate a
+    // preconditioner for the
+    // velocity-velocity matrix, i.e.,
+    // <code>block(0,0)</code> in the
+    // system matrix. As mentioned
+    // above, this depends on the
+    // spatial dimension. Since the two
+    // classes described by the
+    // <code>InnerPreconditioner::type</code>
+    // typedef have the same interface,
+    // we do not have to do anything
+    // different whether we want to use
+    // a sparse direct solver or an
+    // ILU:
     std::cout << "   Computing preconditioner..." << std::endl << std::flush;
 
     A_preconditioner
@@ -986,37 +986,37 @@ namespace Step22
 
 
 
-                                   // @sect4{StokesProblem::solve}
+  // @sect4{StokesProblem::solve}
 
-                                   // After the discussion in the introduction
-                                   // and the definition of the respective
-                                   // classes above, the implementation of the
-                                   // <code>solve</code> function is rather
-                                   // straigt-forward and done in a similar way
-                                   // as in step-20. To start with, we need an
-                                   // object of the <code>InverseMatrix</code>
-                                   // class that represents the inverse of the
-                                   // matrix A. As described in the
-                                   // introduction, the inverse is generated
-                                   // with the help of an inner preconditioner
-                                   // of type
-                                   // <code>InnerPreconditioner::type</code>.
+  // After the discussion in the introduction
+  // and the definition of the respective
+  // classes above, the implementation of the
+  // <code>solve</code> function is rather
+  // straigt-forward and done in a similar way
+  // as in step-20. To start with, we need an
+  // object of the <code>InverseMatrix</code>
+  // class that represents the inverse of the
+  // matrix A. As described in the
+  // introduction, the inverse is generated
+  // with the help of an inner preconditioner
+  // of type
+  // <code>InnerPreconditioner::type</code>.
   template <int dim>
   void StokesProblem<dim>::solve ()
   {
     const InverseMatrix<SparseMatrix<double>,
-      typename InnerPreconditioner<dim>::type>
-      A_inverse (system_matrix.block(0,0), *A_preconditioner);
+          typename InnerPreconditioner<dim>::type>
+          A_inverse (system_matrix.block(0,0), *A_preconditioner);
     Vector<double> tmp (solution.block(0).size());
 
-                                     // This is as in step-20. We generate the
-                                     // right hand side $B A^{-1} F - G$ for the
-                                     // Schur complement and an object that
-                                     // represents the respective linear
-                                     // operation $B A^{-1} B^T$, now with a
-                                     // template parameter indicating the
-                                     // preconditioner - in accordance with the
-                                     // definition of the class.
+    // This is as in step-20. We generate the
+    // right hand side $B A^{-1} F - G$ for the
+    // Schur complement and an object that
+    // represents the respective linear
+    // operation $B A^{-1} B^T$, now with a
+    // template parameter indicating the
+    // preconditioner - in accordance with the
+    // definition of the class.
     {
       Vector<double> schur_rhs (solution.block(1).size());
       A_inverse.vmult (tmp, system_rhs.block(0));
@@ -1024,79 +1024,79 @@ namespace Step22
       schur_rhs -= system_rhs.block(1);
 
       SchurComplement<typename InnerPreconditioner<dim>::type>
-        schur_complement (system_matrix, A_inverse);
+      schur_complement (system_matrix, A_inverse);
 
-                                       // The usual control structures for
-                                       // the solver call are created...
+      // The usual control structures for
+      // the solver call are created...
       SolverControl solver_control (solution.block(1).size(),
                                     1e-6*schur_rhs.l2_norm());
       SolverCG<>    cg (solver_control);
 
-                                       // Now to the preconditioner to the
-                                       // Schur complement. As explained in
-                                       // the introduction, the
-                                       // preconditioning is done by a mass
-                                       // matrix in the pressure variable.  It
-                                       // is stored in the $(1,1)$ block of
-                                       // the system matrix (that is not used
-                                       // anywhere else but in
-                                       // preconditioning).
-                                       //
-                                       // Actually, the solver needs to have
-                                       // the preconditioner in the form
-                                       // $P^{-1}$, so we need to create an
-                                       // inverse operation. Once again, we
-                                       // use an object of the class
-                                       // <code>InverseMatrix</code>, which
-                                       // implements the <code>vmult</code>
-                                       // operation that is needed by the
-                                       // solver.  In this case, we have to
-                                       // invert the pressure mass matrix. As
-                                       // it already turned out in earlier
-                                       // tutorial programs, the inversion of
-                                       // a mass matrix is a rather cheap and
-                                       // straight-forward operation (compared
-                                       // to, e.g., a Laplace matrix). The CG
-                                       // method with ILU preconditioning
-                                       // converges in 5-10 steps,
-                                       // independently on the mesh size.
-                                       // This is precisely what we do here:
-                                       // We choose another ILU preconditioner
-                                       // and take it along to the
-                                       // InverseMatrix object via the
-                                       // corresponding template parameter.  A
-                                       // CG solver is then called within the
-                                       // vmult operation of the inverse
-                                       // matrix.
-                                       //
-                                       // An alternative that is cheaper to
-                                       // build, but needs more iterations
-                                       // afterwards, would be to choose a
-                                       // SSOR preconditioner with factor
-                                       // 1.2. It needs about twice the number
-                                       // of iterations, but the costs for its
-                                       // generation are almost neglible.
+      // Now to the preconditioner to the
+      // Schur complement. As explained in
+      // the introduction, the
+      // preconditioning is done by a mass
+      // matrix in the pressure variable.  It
+      // is stored in the $(1,1)$ block of
+      // the system matrix (that is not used
+      // anywhere else but in
+      // preconditioning).
+      //
+      // Actually, the solver needs to have
+      // the preconditioner in the form
+      // $P^{-1}$, so we need to create an
+      // inverse operation. Once again, we
+      // use an object of the class
+      // <code>InverseMatrix</code>, which
+      // implements the <code>vmult</code>
+      // operation that is needed by the
+      // solver.  In this case, we have to
+      // invert the pressure mass matrix. As
+      // it already turned out in earlier
+      // tutorial programs, the inversion of
+      // a mass matrix is a rather cheap and
+      // straight-forward operation (compared
+      // to, e.g., a Laplace matrix). The CG
+      // method with ILU preconditioning
+      // converges in 5-10 steps,
+      // independently on the mesh size.
+      // This is precisely what we do here:
+      // We choose another ILU preconditioner
+      // and take it along to the
+      // InverseMatrix object via the
+      // corresponding template parameter.  A
+      // CG solver is then called within the
+      // vmult operation of the inverse
+      // matrix.
+      //
+      // An alternative that is cheaper to
+      // build, but needs more iterations
+      // afterwards, would be to choose a
+      // SSOR preconditioner with factor
+      // 1.2. It needs about twice the number
+      // of iterations, but the costs for its
+      // generation are almost neglible.
       SparseILU<double> preconditioner;
       preconditioner.initialize (system_matrix.block(1,1),
                                  SparseILU<double>::AdditionalData());
 
       InverseMatrix<SparseMatrix<double>,SparseILU<double> >
-        m_inverse (system_matrix.block(1,1), preconditioner);
-
-                                       // With the Schur complement and an
-                                       // efficient preconditioner at hand, we
-                                       // can solve the respective equation
-                                       // for the pressure (i.e. block 0 in
-                                       // the solution vector) in the usual
-                                       // way:
+      m_inverse (system_matrix.block(1,1), preconditioner);
+
+      // With the Schur complement and an
+      // efficient preconditioner at hand, we
+      // can solve the respective equation
+      // for the pressure (i.e. block 0 in
+      // the solution vector) in the usual
+      // way:
       cg.solve (schur_complement, solution.block(1), schur_rhs,
                 m_inverse);
 
-                                       // After this first solution step, the
-                                       // hanging node constraints have to be
-                                       // distributed to the solution in order
-                                       // to achieve a consistent pressure
-                                       // field.
+      // After this first solution step, the
+      // hanging node constraints have to be
+      // distributed to the solution in order
+      // to achieve a consistent pressure
+      // field.
       constraints.distribute (solution);
 
       std::cout << "  "
@@ -1105,17 +1105,17 @@ namespace Step22
                 << std::endl;
     }
 
-                                     // As in step-20, we finally need to
-                                     // solve for the velocity equation where
-                                     // we plug in the solution to the
-                                     // pressure equation. This involves only
-                                     // objects we already know - so we simply
-                                     // multiply $p$ by $B^T$, subtract the
-                                     // right hand side and multiply by the
-                                     // inverse of $A$. At the end, we need to
-                                     // distribute the constraints from
-                                     // hanging nodes in order to obtain a
-                                     // constistent flow field:
+    // As in step-20, we finally need to
+    // solve for the velocity equation where
+    // we plug in the solution to the
+    // pressure equation. This involves only
+    // objects we already know - so we simply
+    // multiply $p$ by $B^T$, subtract the
+    // right hand side and multiply by the
+    // inverse of $A$. At the end, we need to
+    // distribute the constraints from
+    // hanging nodes in order to obtain a
+    // constistent flow field:
     {
       system_matrix.block(0,1).vmult (tmp, solution.block(1));
       tmp *= -1;
@@ -1128,48 +1128,48 @@ namespace Step22
   }
 
 
-                                   // @sect4{StokesProblem::output_results}
-
-                                   // The next function generates graphical
-                                   // output. In this example, we are going to
-                                   // use the VTK file format.  We attach
-                                   // names to the individual variables in the
-                                   // problem: <code>velocity</code> to the
-                                   // <code>dim</code> components of velocity
-                                   // and <code>pressure</code> to the
-                                   // pressure.
-                                   //
-                                   // Not all visualization programs have the
-                                   // ability to group individual vector
-                                   // components into a vector to provide
-                                   // vector plots; in particular, this holds
-                                   // for some VTK-based visualization
-                                   // programs. In this case, the logical
-                                   // grouping of components into vectors
-                                   // should already be described in the file
-                                   // containing the data. In other words,
-                                   // what we need to do is provide our output
-                                   // writers with a way to know which of the
-                                   // components of the finite element
-                                   // logically form a vector (with $d$
-                                   // components in $d$ space dimensions)
-                                   // rather than letting them assume that we
-                                   // simply have a bunch of scalar fields.
-                                   // This is achieved using the members of
-                                   // the
-                                   // <code>DataComponentInterpretation</code>
-                                   // namespace: as with the filename, we
-                                   // create a vector in which the first
-                                   // <code>dim</code> components refer to the
-                                   // velocities and are given the tag
-                                   // <code>DataComponentInterpretation::component_is_part_of_vector</code>;
-                                   // we finally push one tag
-                                   // <code>DataComponentInterpretation::component_is_scalar</code>
-                                   // to describe the grouping of the pressure
-                                   // variable.
-
-                                   // The rest of the function is then
-                                   // the same as in step-20.
+  // @sect4{StokesProblem::output_results}
+
+  // The next function generates graphical
+  // output. In this example, we are going to
+  // use the VTK file format.  We attach
+  // names to the individual variables in the
+  // problem: <code>velocity</code> to the
+  // <code>dim</code> components of velocity
+  // and <code>pressure</code> to the
+  // pressure.
+  //
+  // Not all visualization programs have the
+  // ability to group individual vector
+  // components into a vector to provide
+  // vector plots; in particular, this holds
+  // for some VTK-based visualization
+  // programs. In this case, the logical
+  // grouping of components into vectors
+  // should already be described in the file
+  // containing the data. In other words,
+  // what we need to do is provide our output
+  // writers with a way to know which of the
+  // components of the finite element
+  // logically form a vector (with $d$
+  // components in $d$ space dimensions)
+  // rather than letting them assume that we
+  // simply have a bunch of scalar fields.
+  // This is achieved using the members of
+  // the
+  // <code>DataComponentInterpretation</code>
+  // namespace: as with the filename, we
+  // create a vector in which the first
+  // <code>dim</code> components refer to the
+  // velocities and are given the tag
+  // <code>DataComponentInterpretation::component_is_part_of_vector</code>;
+  // we finally push one tag
+  // <code>DataComponentInterpretation::component_is_scalar</code>
+  // to describe the grouping of the pressure
+  // variable.
+
+  // The rest of the function is then
+  // the same as in step-20.
   template <int dim>
   void
   StokesProblem<dim>::output_results (const unsigned int refinement_cycle)  const
@@ -1178,10 +1178,10 @@ namespace Step22
     solution_names.push_back ("pressure");
 
     std::vector<DataComponentInterpretation::DataComponentInterpretation>
-      data_component_interpretation
-      (dim, DataComponentInterpretation::component_is_part_of_vector);
     data_component_interpretation
-      .push_back (DataComponentInterpretation::component_is_scalar);
+    (dim, DataComponentInterpretation::component_is_part_of_vector);
+    data_component_interpretation
+    .push_back (DataComponentInterpretation::component_is_scalar);
 
     DataOut<dim> data_out;
     data_out.attach_dof_handler (dof_handler);
@@ -1200,20 +1200,20 @@ namespace Step22
   }
 
 
-                                   // @sect4{StokesProblem::refine_mesh}
-
-                                   // This is the last interesting function of
-                                   // the <code>StokesProblem</code> class.
-                                   // As indicated by its name, it takes the
-                                   // solution to the problem and refines the
-                                   // mesh where this is needed. The procedure
-                                   // is the same as in the respective step in
-                                   // step-6, with the exception that we base
-                                   // the refinement only on the change in
-                                   // pressure, i.e., we call the Kelly error
-                                   // estimator with a mask
-                                   // object. Additionally, we do not coarsen
-                                   // the grid again:
+  // @sect4{StokesProblem::refine_mesh}
+
+  // This is the last interesting function of
+  // the <code>StokesProblem</code> class.
+  // As indicated by its name, it takes the
+  // solution to the problem and refines the
+  // mesh where this is needed. The procedure
+  // is the same as in the respective step in
+  // step-6, with the exception that we base
+  // the refinement only on the change in
+  // pressure, i.e., we call the Kelly error
+  // estimator with a mask
+  // object. Additionally, we do not coarsen
+  // the grid again:
   template <int dim>
   void
   StokesProblem<dim>::refine_mesh ()
@@ -1236,27 +1236,27 @@ namespace Step22
   }
 
 
-                                   // @sect4{StokesProblem::run}
-
-                                   // The last step in the Stokes class is, as
-                                   // usual, the function that generates the
-                                   // initial grid and calls the other
-                                   // functions in the respective order.
-                                   //
-                                   // We start off with a rectangle of size $4
-                                   // \times 1$ (in 2d) or $4 \times 1 \times
-                                   // 1$ (in 3d), placed in $R^2/R^3$ as
-                                   // $(-2,2)\times(-1,0)$ or
-                                   // $(-2,2)\times(0,1)\times(-1,0)$,
-                                   // respectively. It is natural to start
-                                   // with equal mesh size in each direction,
-                                   // so we subdivide the initial rectangle
-                                   // four times in the first coordinate
-                                   // direction. To limit the scope of the
-                                   // variables involved in the creation of
-                                   // the mesh to the range where we actually
-                                   // need them, we put the entire block
-                                   // between a pair of braces:
+  // @sect4{StokesProblem::run}
+
+  // The last step in the Stokes class is, as
+  // usual, the function that generates the
+  // initial grid and calls the other
+  // functions in the respective order.
+  //
+  // We start off with a rectangle of size $4
+  // \times 1$ (in 2d) or $4 \times 1 \times
+  // 1$ (in 3d), placed in $R^2/R^3$ as
+  // $(-2,2)\times(-1,0)$ or
+  // $(-2,2)\times(0,1)\times(-1,0)$,
+  // respectively. It is natural to start
+  // with equal mesh size in each direction,
+  // so we subdivide the initial rectangle
+  // four times in the first coordinate
+  // direction. To limit the scope of the
+  // variables involved in the creation of
+  // the mesh to the range where we actually
+  // need them, we put the entire block
+  // between a pair of braces:
   template <int dim>
   void StokesProblem<dim>::run ()
   {
@@ -1277,61 +1277,61 @@ namespace Step22
                                                  top_right);
     }
 
-                                     // A boundary indicator of 1 is set to all
-                                     // boundaries that are subject to Dirichlet
-                                     // boundary conditions, i.e.  to faces that
-                                     // are located at 0 in the last coordinate
-                                     // direction. See the example description
-                                     // above for details.
+    // A boundary indicator of 1 is set to all
+    // boundaries that are subject to Dirichlet
+    // boundary conditions, i.e.  to faces that
+    // are located at 0 in the last coordinate
+    // direction. See the example description
+    // above for details.
     for (typename Triangulation<dim>::active_cell_iterator
-           cell = triangulation.begin_active();
+         cell = triangulation.begin_active();
          cell != triangulation.end(); ++cell)
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
         if (cell->face(f)->center()[dim-1] == 0)
           cell->face(f)->set_all_boundary_indicators(1);
 
 
-                                     // We then apply an initial refinement
-                                     // before solving for the first time. In
-                                     // 3D, there are going to be more degrees
-                                     // of freedom, so we refine less there:
+    // We then apply an initial refinement
+    // before solving for the first time. In
+    // 3D, there are going to be more degrees
+    // of freedom, so we refine less there:
     triangulation.refine_global (4-dim);
 
-                                     // As first seen in step-6, we cycle over
-                                     // the different refinement levels and
-                                     // refine (except for the first cycle),
-                                     // setup the degrees of freedom and
-                                     // matrices, assemble, solve and create
-                                     // output:
+    // As first seen in step-6, we cycle over
+    // the different refinement levels and
+    // refine (except for the first cycle),
+    // setup the degrees of freedom and
+    // matrices, assemble, solve and create
+    // output:
     for (unsigned int refinement_cycle = 0; refinement_cycle<6;
          ++refinement_cycle)
       {
         std::cout << "Refinement cycle " << refinement_cycle << std::endl;
 
         if (refinement_cycle > 0)
-         {
-           timer.enter_section("refine");
-           refine_mesh ();
-           timer.exit_section("refine");
-         }
+          {
+            timer.enter_section("refine");
+            refine_mesh ();
+            timer.exit_section("refine");
+          }
 
-       timer.enter_section("setup");
+        timer.enter_section("setup");
         setup_dofs ();
-       timer.exit_section("setup");
+        timer.exit_section("setup");
 
         std::cout << "   Assembling..." << std::endl << std::flush;
-       timer.enter_section("assembly");
+        timer.enter_section("assembly");
         assemble_system ();
-       timer.exit_section("assembly");
+        timer.exit_section("assembly");
 
         std::cout << "   Solving..." << std::flush;
-       timer.enter_section("solver");
+        timer.enter_section("solver");
         solve ();
-       timer.exit_section("solver");
+        timer.exit_section("solver");
 
-       timer.enter_section("results");
+        timer.enter_section("results");
         output_results (refinement_cycle);
-       timer.exit_section("results");
+        timer.exit_section("results");
 
         std::cout << std::endl;
       }
@@ -1340,12 +1340,12 @@ namespace Step22
 }
 
 
-                                 // @sect3{The <code>main</code> function}
+// @sect3{The <code>main</code> function}
 
-                                 // The main function is the same as in
-                                 // step-20. We pass the element degree as a
-                                 // parameter and choose the space dimension
-                                 // at the well-known template slot.
+// The main function is the same as in
+// step-20. We pass the element degree as a
+// parameter and choose the space dimension
+// at the well-known template slot.
 int main ()
 {
   try
index 2505998a3c5c31d9ad2ae28fb1ccf99013920792..0cc347de456a6e2a735b211ea6353b4c669a349c 100644 (file)
@@ -45,20 +45,20 @@ int main ()
   unsigned int n_keys = 15;
   unsigned int n_rows = 40000;
 
-  for (unsigned int j=0;j<n_rows;++j)
+  for (unsigned int j=0; j<n_rows; ++j)
     {
       table.add_value("begin", std::string("this is some text"));
-      for (unsigned int i=0;i<n_keys;++i)
-      {
-       table.add_value(keys[i], j*1.0+i/100.0);
-      }
+      for (unsigned int i=0; i<n_keys; ++i)
+        {
+          table.add_value(keys[i], j*1.0+i/100.0);
+        }
     }
-  
+
   timer.enter_section("write");
   {
     std::ofstream data("datatable.txt");
     table.write_text(data);
-//                TableHandler::table_with_separate_column_description);
+//       TableHandler::table_with_separate_column_description);
   }
-  timer.exit_section("write");  
+  timer.exit_section("write");
 }
index 60645ade4d87bff9b256a86f84906e8e79bc4c83..d88c7d63c9afe248ca2c24d455d32af442ec966e 100644 (file)
  */
 
 
-                                // @sect3{Include files}
+// @sect3{Include files}
 
-                                // As usual, we start by including
-                                // some well-known files:
+// As usual, we start by including
+// some well-known files:
 #include <deal.II/base/quadrature_lib.h>
 #include <deal.II/base/logstream.h>
 #include <deal.II/base/function.h>
 #include <deal.II/numerics/data_out.h>
 #include <deal.II/numerics/error_estimator.h>
 
-                                // Then we need to include the header file
-                                // for the sparse direct solver UMFPACK:
+// Then we need to include the header file
+// for the sparse direct solver UMFPACK:
 #include <deal.II/lac/sparse_direct.h>
 #include <deal.II/base/timer.h>
 
-                                // This includes the library for the
-                                // incomplete LU factorization that will
-                                // be used as a preconditioner in 3D:
+// This includes the library for the
+// incomplete LU factorization that will
+// be used as a preconditioner in 3D:
 #include <deal.II/lac/sparse_ilu.h>
 
-                                // This is C++:
+// This is C++:
 #include <fstream>
 #include <sstream>
 
-                                // As in all programs, the namespace dealii
-                                // is included:
+// As in all programs, the namespace dealii
+// is included:
 namespace Step22
 {
   using namespace dealii;
 
-                                  // @sect3{Defining the inner preconditioner type}
-
-                                  // As explained in the introduction, we are
-                                  // going to use different preconditioners for
-                                  // two and three space dimensions,
-                                  // respectively. We distinguish between
-                                  // them by the use of the spatial dimension
-                                  // as a template parameter. See step-4 for
-                                  // details on templates. We are not going to
-                                  // create any preconditioner object here, all
-                                  // we do is to create class that holds a
-                                  // local typedef determining the
-                                  // preconditioner class so we can write our
-                                  // program in a dimension-independent way.
+  // @sect3{Defining the inner preconditioner type}
+
+  // As explained in the introduction, we are
+  // going to use different preconditioners for
+  // two and three space dimensions,
+  // respectively. We distinguish between
+  // them by the use of the spatial dimension
+  // as a template parameter. See step-4 for
+  // details on templates. We are not going to
+  // create any preconditioner object here, all
+  // we do is to create class that holds a
+  // local typedef determining the
+  // preconditioner class so we can write our
+  // program in a dimension-independent way.
   template <int dim>
   struct InnerPreconditioner;
 
-                                  // In 2D, we are going to use a sparse direct
-                                  // solver as preconditioner:
+  // In 2D, we are going to use a sparse direct
+  // solver as preconditioner:
   template <>
   struct InnerPreconditioner<2>
   {
-      typedef SparseILU<double> type;
+    typedef SparseILU<double> type;
 //      typedef SparseDirectUMFPACK type;
   };
 
-                                   // And the ILU preconditioning in 3D, called
-                                   // by SparseILU:
+  // And the ILU preconditioning in 3D, called
+  // by SparseILU:
   template <>
   struct InnerPreconditioner<3>
   {
-      typedef SparseILU<double> type;
+    typedef SparseILU<double> type;
   };
 
 
-                                   // @sect3{The <code>StokesProblem</code> class template}
-
-                                   // This is an adaptation of step-20, so the
-                                   // main class and the data types are the
-                                   // same as used there. In this example we
-                                   // also use adaptive grid refinement, which
-                                   // is handled in analogy to
-                                   // step-6. According to the discussion in
-                                   // the introduction, we are also going to
-                                   // use the ConstraintMatrix for
-                                   // implementing Dirichlet boundary
-                                   // conditions. Hence, we change the name
-                                   // <code>hanging_node_constraints</code>
-                                   // into <code>constraints</code>.
+  // @sect3{The <code>StokesProblem</code> class template}
+
+  // This is an adaptation of step-20, so the
+  // main class and the data types are the
+  // same as used there. In this example we
+  // also use adaptive grid refinement, which
+  // is handled in analogy to
+  // step-6. According to the discussion in
+  // the introduction, we are also going to
+  // use the ConstraintMatrix for
+  // implementing Dirichlet boundary
+  // conditions. Hence, we change the name
+  // <code>hanging_node_constraints</code>
+  // into <code>constraints</code>.
   template <int dim>
   class StokesProblem
   {
-    public:
-      StokesProblem (const unsigned int degree);
-      void run ();
-
-    private:
-      void setup_dofs ();
-      void assemble_system ();
-      void solve ();
-      void output_results (const unsigned int refinement_cycle) const;
-      void refine_mesh ();
-
-      const unsigned int   degree;
-
-      Triangulation<dim>   triangulation;
-      FESystem<dim>        fe;
-      DoFHandler<dim>      dof_handler;
-
-      ConstraintMatrix     constraints;
-
-      BlockSparsityPattern      sparsity_pattern;
-      BlockSparseMatrix<double> system_matrix;
-
-      BlockVector<double> solution;
-      BlockVector<double> system_rhs;
-
-                                       // This one is new: We shall use a
-                                       // so-called shared pointer structure to
-                                       // access the preconditioner. Shared
-                                       // pointers are essentially just a
-                                       // convenient form of pointers. Several
-                                       // shared pointers can point to the same
-                                       // object (just like regular pointers),
-                                       // but when the last shared pointer
-                                       // object to point to a preconditioner
-                                       // object is deleted (for example if a
-                                       // shared pointer object goes out of
-                                       // scope, if the class of which it is a
-                                       // member is destroyed, or if the pointer
-                                       // is assigned a different preconditioner
-                                       // object) then the preconditioner object
-                                       // pointed to is also destroyed. This
-                                       // ensures that we don't have to manually
-                                       // track in how many places a
-                                       // preconditioner object is still
-                                       // referenced, it can never create a
-                                       // memory leak, and can never produce a
-                                       // dangling pointer to an already
-                                       // destroyed object:
-      std_cxx1x::shared_ptr<typename InnerPreconditioner<dim>::type> A_preconditioner;
-
-      TimerOutput timer;
+  public:
+    StokesProblem (const unsigned int degree);
+    void run ();
+
+  private:
+    void setup_dofs ();
+    void assemble_system ();
+    void solve ();
+    void output_results (const unsigned int refinement_cycle) const;
+    void refine_mesh ();
+
+    const unsigned int   degree;
+
+    Triangulation<dim>   triangulation;
+    FESystem<dim>        fe;
+    DoFHandler<dim>      dof_handler;
+
+    ConstraintMatrix     constraints;
+
+    BlockSparsityPattern      sparsity_pattern;
+    BlockSparseMatrix<double> system_matrix;
+
+    BlockVector<double> solution;
+    BlockVector<double> system_rhs;
+
+    // This one is new: We shall use a
+    // so-called shared pointer structure to
+    // access the preconditioner. Shared
+    // pointers are essentially just a
+    // convenient form of pointers. Several
+    // shared pointers can point to the same
+    // object (just like regular pointers),
+    // but when the last shared pointer
+    // object to point to a preconditioner
+    // object is deleted (for example if a
+    // shared pointer object goes out of
+    // scope, if the class of which it is a
+    // member is destroyed, or if the pointer
+    // is assigned a different preconditioner
+    // object) then the preconditioner object
+    // pointed to is also destroyed. This
+    // ensures that we don't have to manually
+    // track in how many places a
+    // preconditioner object is still
+    // referenced, it can never create a
+    // memory leak, and can never produce a
+    // dangling pointer to an already
+    // destroyed object:
+    std_cxx1x::shared_ptr<typename InnerPreconditioner<dim>::type> A_preconditioner;
+
+    TimerOutput timer;
   };
 
-                                   // @sect3{Boundary values and right hand side}
-
-                                   // As in step-20 and most other
-                                   // example programs, the next task is
-                                   // to define the data for the PDE:
-                                   // For the Stokes problem, we are
-                                   // going to use natural boundary
-                                   // values on parts of the boundary
-                                   // (i.e. homogenous Neumann-type) for
-                                   // which we won't have to do anything
-                                   // special (the homogeneity implies
-                                   // that the corresponding terms in
-                                   // the weak form are simply zero),
-                                   // and boundary conditions on the
-                                   // velocity (Dirichlet-type) on the
-                                   // rest of the boundary, as described
-                                   // in the introduction.
-                                   //
-                                   // In order to enforce the Dirichlet
-                                   // boundary values on the velocity,
-                                   // we will use the
-                                   // VectorTools::interpolate_boundary_values
-                                   // function as usual which requires
-                                   // us to write a function object with
-                                   // as many components as the finite
-                                   // element has. In other words, we
-                                   // have to define the function on the
-                                   // $(u,p)$-space, but we are going to
-                                   // filter out the pressure component
-                                   // when interpolating the boundary
-                                   // values.
-
-                                   // The following function object is a
-                                   // representation of the boundary
-                                   // values described in the
-                                   // introduction:
+  // @sect3{Boundary values and right hand side}
+
+  // As in step-20 and most other
+  // example programs, the next task is
+  // to define the data for the PDE:
+  // For the Stokes problem, we are
+  // going to use natural boundary
+  // values on parts of the boundary
+  // (i.e. homogenous Neumann-type) for
+  // which we won't have to do anything
+  // special (the homogeneity implies
+  // that the corresponding terms in
+  // the weak form are simply zero),
+  // and boundary conditions on the
+  // velocity (Dirichlet-type) on the
+  // rest of the boundary, as described
+  // in the introduction.
+  //
+  // In order to enforce the Dirichlet
+  // boundary values on the velocity,
+  // we will use the
+  // VectorTools::interpolate_boundary_values
+  // function as usual which requires
+  // us to write a function object with
+  // as many components as the finite
+  // element has. In other words, we
+  // have to define the function on the
+  // $(u,p)$-space, but we are going to
+  // filter out the pressure component
+  // when interpolating the boundary
+  // values.
+
+  // The following function object is a
+  // representation of the boundary
+  // values described in the
+  // introduction:
   template <int dim>
   class BoundaryValues : public Function<dim>
   {
-    public:
-      BoundaryValues () : Function<dim>(dim+1) {}
+  public:
+    BoundaryValues () : Function<dim>(dim+1) {}
 
-      virtual double value (const Point<dim>   &p,
-                            const unsigned int  component = 0) const;
+    virtual double value (const Point<dim>   &p,
+                          const unsigned int  component = 0) const;
 
-      virtual void vector_value (const Point<dim> &p,
-                                 Vector<double>   &value) const;
+    virtual void vector_value (const Point<dim> &p,
+                               Vector<double>   &value) const;
   };
 
 
@@ -257,20 +257,20 @@ namespace Step22
 
 
 
-                                   // We implement similar functions for
-                                   // the right hand side which for the
-                                   // current example is simply zero:
+  // We implement similar functions for
+  // the right hand side which for the
+  // current example is simply zero:
   template <int dim>
   class RightHandSide : public Function<dim>
   {
-    public:
-      RightHandSide () : Function<dim>(dim+1) {}
+  public:
+    RightHandSide () : Function<dim>(dim+1) {}
 
-      virtual double value (const Point<dim>   &p,
-                            const unsigned int  component = 0) const;
+    virtual double value (const Point<dim>   &p,
+                          const unsigned int  component = 0) const;
 
-      virtual void vector_value (const Point<dim> &p,
-                                 Vector<double>   &value) const;
+    virtual void vector_value (const Point<dim> &p,
+                               Vector<double>   &value) const;
 
   };
 
@@ -294,82 +294,82 @@ namespace Step22
   }
 
 
-                                   // @sect3{Linear solvers and preconditioners}
-
-                                   // The linear solvers and preconditioners are
-                                   // discussed extensively in the
-                                   // introduction. Here, we create the
-                                   // respective objects that will be used.
-
-                                   // @sect4{The <code>InverseMatrix</code> class template}
-
-                                   // The <code>InverseMatrix</code>
-                                   // class represents the data
-                                   // structure for an inverse
-                                   // matrix. It is derived from the one
-                                   // in step-20. The only difference is
-                                   // that we now do include a
-                                   // preconditioner to the matrix since
-                                   // we will apply this class to
-                                   // different kinds of matrices that
-                                   // will require different
-                                   // preconditioners (in step-20 we did
-                                   // not use a preconditioner in this
-                                   // class at all). The types of matrix
-                                   // and preconditioner are passed to
-                                   // this class via template
-                                   // parameters, and matrix and
-                                   // preconditioner objects of these
-                                   // types will then be passed to the
-                                   // constructor when an
-                                   // <code>InverseMatrix</code> object
-                                   // is created. The member function
-                                   // <code>vmult</code> is, as in
-                                   // step-20, a multiplication with a
-                                   // vector, obtained by solving a
-                                   // linear system:
+  // @sect3{Linear solvers and preconditioners}
+
+  // The linear solvers and preconditioners are
+  // discussed extensively in the
+  // introduction. Here, we create the
+  // respective objects that will be used.
+
+  // @sect4{The <code>InverseMatrix</code> class template}
+
+  // The <code>InverseMatrix</code>
+  // class represents the data
+  // structure for an inverse
+  // matrix. It is derived from the one
+  // in step-20. The only difference is
+  // that we now do include a
+  // preconditioner to the matrix since
+  // we will apply this class to
+  // different kinds of matrices that
+  // will require different
+  // preconditioners (in step-20 we did
+  // not use a preconditioner in this
+  // class at all). The types of matrix
+  // and preconditioner are passed to
+  // this class via template
+  // parameters, and matrix and
+  // preconditioner objects of these
+  // types will then be passed to the
+  // constructor when an
+  // <code>InverseMatrix</code> object
+  // is created. The member function
+  // <code>vmult</code> is, as in
+  // step-20, a multiplication with a
+  // vector, obtained by solving a
+  // linear system:
   template <class Matrix, class Preconditioner>
   class InverseMatrix : public Subscriptor
   {
-    public:
-      InverseMatrix (const Matrix         &m,
-                     const Preconditioner &preconditioner);
+  public:
+    InverseMatrix (const Matrix         &m,
+                   const Preconditioner &preconditioner);
 
-      void vmult (Vector<double>       &dst,
-                  const Vector<double> &src) const;
+    void vmult (Vector<double>       &dst,
+                const Vector<double> &src) const;
 
-    private:
-      const SmartPointer<const Matrix> matrix;
-      const SmartPointer<const Preconditioner> preconditioner;
+  private:
+    const SmartPointer<const Matrix> matrix;
+    const SmartPointer<const Preconditioner> preconditioner;
   };
 
 
   template <class Matrix, class Preconditioner>
   InverseMatrix<Matrix,Preconditioner>::InverseMatrix (const Matrix &m,
                                                        const Preconditioner &preconditioner)
-                  :
-                  matrix (&m),
-                  preconditioner (&preconditioner)
+    :
+    matrix (&m),
+    preconditioner (&preconditioner)
   {}
 
 
-                                   // This is the implementation of the
-                                   // <code>vmult</code> function.
-
-                                   // In this class we use a rather large
-                                   // tolerance for the solver control. The
-                                   // reason for this is that the function is
-                                   // used very frequently, and hence, any
-                                   // additional effort to make the residual
-                                   // in the CG solve smaller makes the
-                                   // solution more expensive. Note that we do
-                                   // not only use this class as a
-                                   // preconditioner for the Schur complement,
-                                   // but also when forming the inverse of the
-                                   // Laplace matrix &ndash; which is hence
-                                   // directly responsible for the accuracy of
-                                   // the solution itself, so we can't choose
-                                   // a too large tolerance, either.
+  // This is the implementation of the
+  // <code>vmult</code> function.
+
+  // In this class we use a rather large
+  // tolerance for the solver control. The
+  // reason for this is that the function is
+  // used very frequently, and hence, any
+  // additional effort to make the residual
+  // in the CG solve smaller makes the
+  // solution more expensive. Note that we do
+  // not only use this class as a
+  // preconditioner for the Schur complement,
+  // but also when forming the inverse of the
+  // Laplace matrix &ndash; which is hence
+  // directly responsible for the accuracy of
+  // the solution itself, so we can't choose
+  // a too large tolerance, either.
   template <class Matrix, class Preconditioner>
   void InverseMatrix<Matrix,Preconditioner>::vmult (Vector<double>       &dst,
                                                     const Vector<double> &src) const
@@ -383,36 +383,36 @@ namespace Step22
   }
 
 
-                                   // @sect4{The <code>SchurComplement</code> class template}
-
-                                   // This class implements the Schur complement
-                                   // discussed in the introduction.  It is in
-                                   // analogy to step-20.  Though, we now call
-                                   // it with a template parameter
-                                   // <code>Preconditioner</code> in order to
-                                   // access that when specifying the respective
-                                   // type of the inverse matrix class. As a
-                                   // consequence of the definition above, the
-                                   // declaration <code>InverseMatrix</code> now
-                                   // contains the second template parameter
-                                   // for a preconditioner class as above, which
-                                   // affects the <code>SmartPointer</code>
-                                   // object <code>m_inverse</code> as well.
+  // @sect4{The <code>SchurComplement</code> class template}
+
+  // This class implements the Schur complement
+  // discussed in the introduction.  It is in
+  // analogy to step-20.  Though, we now call
+  // it with a template parameter
+  // <code>Preconditioner</code> in order to
+  // access that when specifying the respective
+  // type of the inverse matrix class. As a
+  // consequence of the definition above, the
+  // declaration <code>InverseMatrix</code> now
+  // contains the second template parameter
+  // for a preconditioner class as above, which
+  // affects the <code>SmartPointer</code>
+  // object <code>m_inverse</code> as well.
   template <class Preconditioner>
   class SchurComplement : public Subscriptor
   {
-    public:
-      SchurComplement (const BlockSparseMatrix<double> &system_matrix,
-                       const InverseMatrix<SparseMatrix<double>, Preconditioner> &A_inverse);
+  public:
+    SchurComplement (const BlockSparseMatrix<double> &system_matrix,
+                     const InverseMatrix<SparseMatrix<double>, Preconditioner> &A_inverse);
 
-      void vmult (Vector<double>       &dst,
-                  const Vector<double> &src) const;
+    void vmult (Vector<double>       &dst,
+                const Vector<double> &src) const;
 
-    private:
-      const SmartPointer<const BlockSparseMatrix<double> > system_matrix;
-      const SmartPointer<const InverseMatrix<SparseMatrix<double>, Preconditioner> > A_inverse;
+  private:
+    const SmartPointer<const BlockSparseMatrix<double> > system_matrix;
+    const SmartPointer<const InverseMatrix<SparseMatrix<double>, Preconditioner> > A_inverse;
 
-      mutable Vector<double> tmp1, tmp2;
+    mutable Vector<double> tmp1, tmp2;
   };
 
 
@@ -421,11 +421,11 @@ namespace Step22
   SchurComplement<Preconditioner>::
   SchurComplement (const BlockSparseMatrix<double> &system_matrix,
                    const InverseMatrix<SparseMatrix<double>,Preconditioner> &A_inverse)
-                  :
-                  system_matrix (&system_matrix),
-                  A_inverse (&A_inverse),
-                  tmp1 (system_matrix.block(0,0).m()),
-                  tmp2 (system_matrix.block(0,0).m())
+    :
+    system_matrix (&system_matrix),
+    A_inverse (&A_inverse),
+    tmp1 (system_matrix.block(0,0).m()),
+    tmp2 (system_matrix.block(0,0).m())
   {}
 
 
@@ -439,138 +439,138 @@ namespace Step22
   }
 
 
-                                   // @sect3{StokesProblem class implementation}
-
-                                   // @sect4{StokesProblem::StokesProblem}
-
-                                   // The constructor of this class
-                                   // looks very similar to the one of
-                                   // step-20. The constructor
-                                   // initializes the variables for the
-                                   // polynomial degree, triangulation,
-                                   // finite element system and the dof
-                                   // handler. The underlying polynomial
-                                   // functions are of order
-                                   // <code>degree+1</code> for the
-                                   // vector-valued velocity components
-                                   // and of order <code>degree</code>
-                                   // for the pressure.  This gives the
-                                   // LBB-stable element pair
-                                   // $Q_{degree+1}^d\times Q_{degree}$,
-                                   // often referred to as the
-                                   // Taylor-Hood element.
-                                   //
-                                   // Note that we initialize the triangulation
-                                   // with a MeshSmoothing argument, which
-                                   // ensures that the refinement of cells is
-                                   // done in a way that the approximation of
-                                   // the PDE solution remains well-behaved
-                                   // (problems arise if grids are too
-                                   // unstructered), see the documentation of
-                                   // <code>Triangulation::MeshSmoothing</code>
-                                   // for details.
+  // @sect3{StokesProblem class implementation}
+
+  // @sect4{StokesProblem::StokesProblem}
+
+  // The constructor of this class
+  // looks very similar to the one of
+  // step-20. The constructor
+  // initializes the variables for the
+  // polynomial degree, triangulation,
+  // finite element system and the dof
+  // handler. The underlying polynomial
+  // functions are of order
+  // <code>degree+1</code> for the
+  // vector-valued velocity components
+  // and of order <code>degree</code>
+  // for the pressure.  This gives the
+  // LBB-stable element pair
+  // $Q_{degree+1}^d\times Q_{degree}$,
+  // often referred to as the
+  // Taylor-Hood element.
+  //
+  // Note that we initialize the triangulation
+  // with a MeshSmoothing argument, which
+  // ensures that the refinement of cells is
+  // done in a way that the approximation of
+  // the PDE solution remains well-behaved
+  // (problems arise if grids are too
+  // unstructered), see the documentation of
+  // <code>Triangulation::MeshSmoothing</code>
+  // for details.
   template <int dim>
   StokesProblem<dim>::StokesProblem (const unsigned int degree)
-                  :
-                  degree (degree),
-                  triangulation (Triangulation<dim>::maximum_smoothing),
-                  fe (FE_Q<dim>(degree+1), dim,
-                      FE_Q<dim>(degree), 1),
-                  dof_handler (triangulation),
-                 timer (std::cout, TimerOutput::summary, TimerOutput::cpu_times)
+    :
+    degree (degree),
+    triangulation (Triangulation<dim>::maximum_smoothing),
+    fe (FE_Q<dim>(degree+1), dim,
+        FE_Q<dim>(degree), 1),
+    dof_handler (triangulation),
+    timer (std::cout, TimerOutput::summary, TimerOutput::cpu_times)
   {}
 
 
-                                   // @sect4{StokesProblem::setup_dofs}
-
-                                   // Given a mesh, this function
-                                   // associates the degrees of freedom
-                                   // with it and creates the
-                                   // corresponding matrices and
-                                   // vectors. At the beginning it also
-                                   // releases the pointer to the
-                                   // preconditioner object (if the
-                                   // shared pointer pointed at anything
-                                   // at all at this point) since it
-                                   // will definitely not be needed any
-                                   // more after this point and will
-                                   // have to be re-computed after
-                                   // assembling the matrix, and unties
-                                   // the sparse matrix from its
-                                   // sparsity pattern object.
-                                   //
-                                   // We then proceed with distributing
-                                   // degrees of freedom and renumbering
-                                   // them: In order to make the ILU
-                                   // preconditioner (in 3D) work
-                                   // efficiently, it is important to
-                                   // enumerate the degrees of freedom
-                                   // in such a way that it reduces the
-                                   // bandwidth of the matrix, or maybe
-                                   // more importantly: in such a way
-                                   // that the ILU is as close as
-                                   // possible to a real LU
-                                   // decomposition. On the other hand,
-                                   // we need to preserve the block
-                                   // structure of velocity and pressure
-                                   // already seen in in step-20 and
-                                   // step-21. This is done in two
-                                   // steps: First, all dofs are
-                                   // renumbered to improve the ILU and
-                                   // then we renumber once again by
-                                   // components. Since
-                                   // <code>DoFRenumbering::component_wise</code>
-                                   // does not touch the renumbering
-                                   // within the individual blocks, the
-                                   // basic renumbering from the first
-                                   // step remains. As for how the
-                                   // renumber degrees of freedom to
-                                   // improve the ILU: deal.II has a
-                                   // number of algorithms that attempt
-                                   // to find orderings to improve ILUs,
-                                   // or reduce the bandwidth of
-                                   // matrices, or optimize some other
-                                   // aspect. The DoFRenumbering
-                                   // namespace shows a comparison of
-                                   // the results we obtain with several
-                                   // of these algorithms based on the
-                                   // testcase discussed here in this
-                                   // tutorial program. Here, we will
-                                   // use the traditional Cuthill-McKee
-                                   // algorithm already used in some of
-                                   // the previous tutorial programs.
-                                   // In the
-                                   // <a href="#improved-ilu">section on improved ILU</a>
-                                   // we're going to discuss this issue
-                                   // in more detail.
-
-                                   // There is one more change compared
-                                   // to previous tutorial programs:
-                                   // There is no reason in sorting the
-                                   // <code>dim</code> velocity
-                                   // components individually. In fact,
-                                   // rather than first enumerating all
-                                   // $x$-velocities, then all
-                                   // $y$-velocities, etc, we would like
-                                   // to keep all velocities at the same
-                                   // location together and only
-                                   // separate between velocities (all
-                                   // components) and pressures. By
-                                   // default, this is not what the
-                                   // DoFRenumbering::component_wise
-                                   // function does: it treats each
-                                   // vector component separately; what
-                                   // we have to do is group several
-                                   // components into "blocks" and pass
-                                   // this block structure to that
-                                   // function. Consequently, we
-                                   // allocate a vector
-                                   // <code>block_component</code> with
-                                   // as many elements as there are
-                                   // components and describe all
-                                   // velocity components to correspond
-                                   // to block 0, while the pressure
-                                   // component will form block 1:
+  // @sect4{StokesProblem::setup_dofs}
+
+  // Given a mesh, this function
+  // associates the degrees of freedom
+  // with it and creates the
+  // corresponding matrices and
+  // vectors. At the beginning it also
+  // releases the pointer to the
+  // preconditioner object (if the
+  // shared pointer pointed at anything
+  // at all at this point) since it
+  // will definitely not be needed any
+  // more after this point and will
+  // have to be re-computed after
+  // assembling the matrix, and unties
+  // the sparse matrix from its
+  // sparsity pattern object.
+  //
+  // We then proceed with distributing
+  // degrees of freedom and renumbering
+  // them: In order to make the ILU
+  // preconditioner (in 3D) work
+  // efficiently, it is important to
+  // enumerate the degrees of freedom
+  // in such a way that it reduces the
+  // bandwidth of the matrix, or maybe
+  // more importantly: in such a way
+  // that the ILU is as close as
+  // possible to a real LU
+  // decomposition. On the other hand,
+  // we need to preserve the block
+  // structure of velocity and pressure
+  // already seen in in step-20 and
+  // step-21. This is done in two
+  // steps: First, all dofs are
+  // renumbered to improve the ILU and
+  // then we renumber once again by
+  // components. Since
+  // <code>DoFRenumbering::component_wise</code>
+  // does not touch the renumbering
+  // within the individual blocks, the
+  // basic renumbering from the first
+  // step remains. As for how the
+  // renumber degrees of freedom to
+  // improve the ILU: deal.II has a
+  // number of algorithms that attempt
+  // to find orderings to improve ILUs,
+  // or reduce the bandwidth of
+  // matrices, or optimize some other
+  // aspect. The DoFRenumbering
+  // namespace shows a comparison of
+  // the results we obtain with several
+  // of these algorithms based on the
+  // testcase discussed here in this
+  // tutorial program. Here, we will
+  // use the traditional Cuthill-McKee
+  // algorithm already used in some of
+  // the previous tutorial programs.
+  // In the
+  // <a href="#improved-ilu">section on improved ILU</a>
+  // we're going to discuss this issue
+  // in more detail.
+
+  // There is one more change compared
+  // to previous tutorial programs:
+  // There is no reason in sorting the
+  // <code>dim</code> velocity
+  // components individually. In fact,
+  // rather than first enumerating all
+  // $x$-velocities, then all
+  // $y$-velocities, etc, we would like
+  // to keep all velocities at the same
+  // location together and only
+  // separate between velocities (all
+  // components) and pressures. By
+  // default, this is not what the
+  // DoFRenumbering::component_wise
+  // function does: it treats each
+  // vector component separately; what
+  // we have to do is group several
+  // components into "blocks" and pass
+  // this block structure to that
+  // function. Consequently, we
+  // allocate a vector
+  // <code>block_component</code> with
+  // as many elements as there are
+  // components and describe all
+  // velocity components to correspond
+  // to block 0, while the pressure
+  // component will form block 1:
   template <int dim>
   void StokesProblem<dim>::setup_dofs ()
   {
@@ -606,17 +606,17 @@ namespace Step22
     constraints.close ();
     timer.exit_section("setup constraints");
 
-                                     // In analogy to step-20, we count the dofs
-                                     // in the individual components.  We could
-                                     // do this in the same way as there, but we
-                                     // want to operate on the block structure
-                                     // we used already for the renumbering: The
-                                     // function
-                                     // <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>.
+    // In analogy to step-20, we count the dofs
+    // in the individual components.  We could
+    // do this in the same way as there, but we
+    // want to operate on the block structure
+    // we used already for the renumbering: The
+    // function
+    // <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);
     DoFTools::count_dofs_per_block (dof_handler, dofs_per_block, block_component);
     const unsigned int n_u = dofs_per_block[0],
@@ -630,88 +630,88 @@ namespace Step22
               << " (" << n_u << '+' << n_p << ')'
               << std::endl;
 
-                                     // The next task is to allocate a
-                                     // sparsity pattern for the system matrix
-                                     // we will create. We could do this in
-                                     // the same way as in step-20,
-                                     // i.e. directly build an object of type
-                                     // SparsityPattern through
-                                     // DoFTools::make_sparsity_pattern. However,
-                                     // there is a major reason not to do so:
-                                     // In 3D, the function
-                                     // DoFTools::max_couplings_between_dofs
-                                     // yields a conservative but rather large
-                                     // number for the coupling between the
-                                     // individual dofs, so that the memory
-                                     // initially provided for the creation of
-                                     // the sparsity pattern of the matrix is
-                                     // far too much -- so much actually that
-                                     // the initial sparsity pattern won't
-                                     // even fit into the physical memory of
-                                     // most systems already for
-                                     // moderately-sized 3D problems, see also
-                                     // the discussion in step-18.  Instead,
-                                     // we first build a temporary object that
-                                     // uses a different data structure that
-                                     // doesn't require allocating more memory
-                                     // than necessary but isn't suitable for
-                                     // use as a basis of SparseMatrix or
-                                     // BlockSparseMatrix objects; in a second
-                                     // step we then copy this object into an
-                                     // object of BlockSparsityPattern. This
-                                     // is entirely analgous to what we
-                                     // already did in step-11 and step-18.
-                                     //
-                                     // There is one snag again here, though:
-                                     // it turns out that using the
-                                     // CompressedSparsityPattern (or the
-                                     // block version
-                                     // BlockCompressedSparsityPattern we
-                                     // would use here) has a bottleneck that
-                                     // makes the algorithm to build the
-                                     // sparsity pattern be quadratic in the
-                                     // number of degrees of freedom. This
-                                     // doesn't become noticeable until we get
-                                     // well into the range of several 100,000
-                                     // degrees of freedom, but eventually
-                                     // dominates the setup of the linear
-                                     // system when we get to more than a
-                                     // million degrees of freedom. This is
-                                     // due to the data structures used in the
-                                     // CompressedSparsityPattern class,
-                                     // nothing that can easily be
-                                     // changed. Fortunately, there is an easy
-                                     // solution: the
-                                     // CompressedSimpleSparsityPattern class
-                                     // (and its block variant
-                                     // BlockCompressedSimpleSparsityPattern)
-                                     // has exactly the same interface, uses a
-                                     // different %internal data structure and
-                                     // is linear in the number of degrees of
-                                     // freedom and therefore much more
-                                     // efficient for large problems. As
-                                     // another alternative, we could also
-                                     // have chosen the class
-                                     // BlockCompressedSetSparsityPattern that
-                                     // uses yet another strategy for %internal
-                                     // memory management. Though, that class
-                                     // turns out to be more memory-demanding
-                                     // than
-                                     // BlockCompressedSimpleSparsityPattern
-                                     // for this example.
-                                     //
-                                     // Consequently, this is the class that
-                                     // we will use for our intermediate
-                                     // sparsity representation. All this is
-                                     // done inside a new scope, which means
-                                     // that the memory of <code>csp</code>
-                                     // will be released once the information
-                                     // has been copied to
-                                     // <code>sparsity_pattern</code>.
+    // The next task is to allocate a
+    // sparsity pattern for the system matrix
+    // we will create. We could do this in
+    // the same way as in step-20,
+    // i.e. directly build an object of type
+    // SparsityPattern through
+    // DoFTools::make_sparsity_pattern. However,
+    // there is a major reason not to do so:
+    // In 3D, the function
+    // DoFTools::max_couplings_between_dofs
+    // yields a conservative but rather large
+    // number for the coupling between the
+    // individual dofs, so that the memory
+    // initially provided for the creation of
+    // the sparsity pattern of the matrix is
+    // far too much -- so much actually that
+    // the initial sparsity pattern won't
+    // even fit into the physical memory of
+    // most systems already for
+    // moderately-sized 3D problems, see also
+    // the discussion in step-18.  Instead,
+    // we first build a temporary object that
+    // uses a different data structure that
+    // doesn't require allocating more memory
+    // than necessary but isn't suitable for
+    // use as a basis of SparseMatrix or
+    // BlockSparseMatrix objects; in a second
+    // step we then copy this object into an
+    // object of BlockSparsityPattern. This
+    // is entirely analgous to what we
+    // already did in step-11 and step-18.
+    //
+    // There is one snag again here, though:
+    // it turns out that using the
+    // CompressedSparsityPattern (or the
+    // block version
+    // BlockCompressedSparsityPattern we
+    // would use here) has a bottleneck that
+    // makes the algorithm to build the
+    // sparsity pattern be quadratic in the
+    // number of degrees of freedom. This
+    // doesn't become noticeable until we get
+    // well into the range of several 100,000
+    // degrees of freedom, but eventually
+    // dominates the setup of the linear
+    // system when we get to more than a
+    // million degrees of freedom. This is
+    // due to the data structures used in the
+    // CompressedSparsityPattern class,
+    // nothing that can easily be
+    // changed. Fortunately, there is an easy
+    // solution: the
+    // CompressedSimpleSparsityPattern class
+    // (and its block variant
+    // BlockCompressedSimpleSparsityPattern)
+    // has exactly the same interface, uses a
+    // different %internal data structure and
+    // is linear in the number of degrees of
+    // freedom and therefore much more
+    // efficient for large problems. As
+    // another alternative, we could also
+    // have chosen the class
+    // BlockCompressedSetSparsityPattern that
+    // uses yet another strategy for %internal
+    // memory management. Though, that class
+    // turns out to be more memory-demanding
+    // than
+    // BlockCompressedSimpleSparsityPattern
+    // for this example.
+    //
+    // Consequently, this is the class that
+    // we will use for our intermediate
+    // sparsity representation. All this is
+    // done inside a new scope, which means
+    // that the memory of <code>csp</code>
+    // will be released once the information
+    // has been copied to
+    // <code>sparsity_pattern</code>.
     {
       timer.enter_section("make csp");
       BlockCompressedSimpleSparsityPattern csp (2,2);
+
       csp.block(0,0).reinit (n_u, n_u);
       csp.block(1,0).reinit (n_p, n_u);
       csp.block(0,1).reinit (n_u, n_p);
@@ -726,10 +726,10 @@ namespace Step22
       timer.exit_section("copy sp");
     }
 
-                                     // Finally, the system matrix,
-                                     // solution and right hand side are
-                                     // created from the block
-                                     // structure as in step-20:
+    // Finally, the system matrix,
+    // solution and right hand side are
+    // created from the block
+    // structure as in step-20:
     timer.enter_section("create matrix and vectors");
     system_matrix.reinit (sparsity_pattern);
 
@@ -746,16 +746,16 @@ namespace Step22
   }
 
 
-                                   // @sect4{StokesProblem::assemble_system}
+  // @sect4{StokesProblem::assemble_system}
 
-                                   // The assembly process follows the
-                                   // discussion in step-20 and in the
-                                   // introduction. We use the well-known
-                                   // abbreviations for the data structures
-                                   // that hold the local matrix, right
-                                   // hand side, and global
-                                   // numbering of the degrees of freedom
-                                   // for the present cell.
+  // The assembly process follows the
+  // discussion in step-20 and in the
+  // introduction. We use the well-known
+  // abbreviations for the data structures
+  // that hold the local matrix, right
+  // hand side, and global
+  // numbering of the degrees of freedom
+  // for the present cell.
   template <int dim>
   void StokesProblem<dim>::assemble_system ()
   {
@@ -783,70 +783,70 @@ namespace Step22
     std::vector<Vector<double> >      rhs_values (n_q_points,
                                                   Vector<double>(dim+1));
 
-                                     // Next, we need two objects that work as
-                                     // extractors for the FEValues
-                                     // object. Their use is explained in detail
-                                     // in the report on @ref vector_valued :
+    // Next, we need two objects that work as
+    // extractors for the FEValues
+    // object. Their use is explained in detail
+    // in the report on @ref vector_valued :
     const FEValuesExtractors::Vector velocities (0);
     const FEValuesExtractors::Scalar pressure (dim);
 
-                                     // As an extension over step-20 and
-                                     // step-21, we include a few
-                                     // optimizations that make assembly
-                                     // much faster for this particular
-                                     // problem.  The improvements are
-                                     // based on the observation that we
-                                     // do a few calculations too many
-                                     // times when we do as in step-20:
-                                     // The symmetric gradient actually
-                                     // has <code>dofs_per_cell</code>
-                                     // different values per quadrature
-                                     // point, but we extract it
-                                     // <code>dofs_per_cell*dofs_per_cell</code>
-                                     // times from the FEValues object -
-                                     // for both the loop over
-                                     // <code>i</code> and the inner
-                                     // loop over <code>j</code>. In 3d,
-                                     // that means evaluating it
-                                     // $89^2=7921$ instead of $89$
-                                     // times, a not insignificant
-                                     // difference.
-                                     //
-                                     // So what we're
-                                     // going to do here is to avoid
-                                     // such repeated calculations by
-                                     // getting a vector of rank-2
-                                     // tensors (and similarly for
-                                     // the divergence and the basis
-                                     // function value on pressure)
-                                     // at the quadrature point prior
-                                     // to starting the loop over the
-                                     // dofs on the cell. First, we
-                                     // create the respective objects
-                                     // that will hold these
-                                     // values. Then, we start the
-                                     // loop over all cells and the loop
-                                     // over the quadrature points,
-                                     // where we first extract these
-                                     // values. There is one more
-                                     // optimization we implement here:
-                                     // the local matrix (as well as
-                                     // the global one) is going to
-                                     // be symmetric, since all
-                                     // the operations involved are
-                                     // symmetric with respect to $i$
-                                     // and $j$. This is implemented by
-                                     // simply running the inner loop
-                                     // not to <code>dofs_per_cell</code>,
-                                     // but only up to <code>i</code>,
-                                     // the index of the outer loop.
+    // As an extension over step-20 and
+    // step-21, we include a few
+    // optimizations that make assembly
+    // much faster for this particular
+    // problem.  The improvements are
+    // based on the observation that we
+    // do a few calculations too many
+    // times when we do as in step-20:
+    // The symmetric gradient actually
+    // has <code>dofs_per_cell</code>
+    // different values per quadrature
+    // point, but we extract it
+    // <code>dofs_per_cell*dofs_per_cell</code>
+    // times from the FEValues object -
+    // for both the loop over
+    // <code>i</code> and the inner
+    // loop over <code>j</code>. In 3d,
+    // that means evaluating it
+    // $89^2=7921$ instead of $89$
+    // times, a not insignificant
+    // difference.
+    //
+    // So what we're
+    // going to do here is to avoid
+    // such repeated calculations by
+    // getting a vector of rank-2
+    // tensors (and similarly for
+    // the divergence and the basis
+    // function value on pressure)
+    // at the quadrature point prior
+    // to starting the loop over the
+    // dofs on the cell. First, we
+    // create the respective objects
+    // that will hold these
+    // values. Then, we start the
+    // loop over all cells and the loop
+    // over the quadrature points,
+    // where we first extract these
+    // values. There is one more
+    // optimization we implement here:
+    // the local matrix (as well as
+    // the global one) is going to
+    // be symmetric, since all
+    // the operations involved are
+    // symmetric with respect to $i$
+    // and $j$. This is implemented by
+    // simply running the inner loop
+    // not to <code>dofs_per_cell</code>,
+    // but only up to <code>i</code>,
+    // the index of the outer loop.
     std::vector<SymmetricTensor<2,dim> > symgrad_phi_u (dofs_per_cell);
     std::vector<double>                  div_phi_u   (dofs_per_cell);
     std::vector<double>                  phi_p       (dofs_per_cell);
 
     typename DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     for (; cell!=endc; ++cell)
       {
         fe_values.reinit (cell);
@@ -885,47 +885,47 @@ namespace Step22
               }
           }
 
-                                         // Note that in the above computation
-                                         // of the local matrix contribution
-                                         // we added the term <code> phi_p[i] *
-                                         // phi_p[j] </code>, yielding a
-                                         // pressure mass matrix in the
-                                         // $(1,1)$ block of the matrix as
-                                         // discussed in the
-                                         // introduction. That this term only
-                                         // ends up in the $(1,1)$ block stems
-                                         // from the fact that both of the
-                                         // factors in <code>phi_p[i] *
-                                         // phi_p[j]</code> are only non-zero
-                                         // when all the other terms vanish
-                                         // (and the other way around).
-                                         //
-                                         // Note also that operator* is
-                                         // overloaded for symmetric
-                                         // tensors, yielding the scalar
-                                         // product between the two
-                                         // tensors in the first line of
-                                         // the local matrix
-                                         // contribution.
-
-                                         // Before we can write the local data
-                                         // into the global matrix (and
-                                         // simultaneously use the
-                                         // ConstraintMatrix object to apply
-                                         // Dirichlet boundary conditions and
-                                         // eliminate hanging node
-                                         // constraints, as we discussed in
-                                         // the introduction), we have to be
-                                         // careful about one thing,
-                                         // though. We have only build up half
-                                         // of the local matrix because of
-                                         // symmetry, but we're going to save
-                                         // the full system matrix in order to
-                                         // use the standard functions for
-                                         // solution. This is done by flipping
-                                         // the indices in case we are
-                                         // pointing into the empty part of
-                                         // the local matrix.
+        // Note that in the above computation
+        // of the local matrix contribution
+        // we added the term <code> phi_p[i] *
+        // phi_p[j] </code>, yielding a
+        // pressure mass matrix in the
+        // $(1,1)$ block of the matrix as
+        // discussed in the
+        // introduction. That this term only
+        // ends up in the $(1,1)$ block stems
+        // from the fact that both of the
+        // factors in <code>phi_p[i] *
+        // phi_p[j]</code> are only non-zero
+        // when all the other terms vanish
+        // (and the other way around).
+        //
+        // Note also that operator* is
+        // overloaded for symmetric
+        // tensors, yielding the scalar
+        // product between the two
+        // tensors in the first line of
+        // the local matrix
+        // contribution.
+
+        // Before we can write the local data
+        // into the global matrix (and
+        // simultaneously use the
+        // ConstraintMatrix object to apply
+        // Dirichlet boundary conditions and
+        // eliminate hanging node
+        // constraints, as we discussed in
+        // the introduction), we have to be
+        // careful about one thing,
+        // though. We have only build up half
+        // of the local matrix because of
+        // symmetry, but we're going to save
+        // the full system matrix in order to
+        // use the standard functions for
+        // solution. This is done by flipping
+        // the indices in case we are
+        // pointing into the empty part of
+        // the local matrix.
         for (unsigned int i=0; i<dofs_per_cell; ++i)
           for (unsigned int j=i+1; j<dofs_per_cell; ++j)
             local_matrix(i,j) = local_matrix(j,i);
@@ -936,21 +936,21 @@ namespace Step22
                                                 system_matrix, system_rhs);
       }
 
-                                     // Before we're going to solve this
-                                     // linear system, we generate a
-                                     // preconditioner for the
-                                     // velocity-velocity matrix, i.e.,
-                                     // <code>block(0,0)</code> in the
-                                     // system matrix. As mentioned
-                                     // above, this depends on the
-                                     // spatial dimension. Since the two
-                                     // classes described by the
-                                     // <code>InnerPreconditioner::type</code>
-                                     // typedef have the same interface,
-                                     // we do not have to do anything
-                                     // different whether we want to use
-                                     // a sparse direct solver or an
-                                     // ILU:
+    // Before we're going to solve this
+    // linear system, we generate a
+    // preconditioner for the
+    // velocity-velocity matrix, i.e.,
+    // <code>block(0,0)</code> in the
+    // system matrix. As mentioned
+    // above, this depends on the
+    // spatial dimension. Since the two
+    // classes described by the
+    // <code>InnerPreconditioner::type</code>
+    // typedef have the same interface,
+    // we do not have to do anything
+    // different whether we want to use
+    // a sparse direct solver or an
+    // ILU:
     std::cout << "   Computing preconditioner..." << std::endl << std::flush;
 
     A_preconditioner
@@ -962,37 +962,37 @@ namespace Step22
 
 
 
-                                   // @sect4{StokesProblem::solve}
+  // @sect4{StokesProblem::solve}
 
-                                   // After the discussion in the introduction
-                                   // and the definition of the respective
-                                   // classes above, the implementation of the
-                                   // <code>solve</code> function is rather
-                                   // straigt-forward and done in a similar way
-                                   // as in step-20. To start with, we need an
-                                   // object of the <code>InverseMatrix</code>
-                                   // class that represents the inverse of the
-                                   // matrix A. As described in the
-                                   // introduction, the inverse is generated
-                                   // with the help of an inner preconditioner
-                                   // of type
-                                   // <code>InnerPreconditioner::type</code>.
+  // After the discussion in the introduction
+  // and the definition of the respective
+  // classes above, the implementation of the
+  // <code>solve</code> function is rather
+  // straigt-forward and done in a similar way
+  // as in step-20. To start with, we need an
+  // object of the <code>InverseMatrix</code>
+  // class that represents the inverse of the
+  // matrix A. As described in the
+  // introduction, the inverse is generated
+  // with the help of an inner preconditioner
+  // of type
+  // <code>InnerPreconditioner::type</code>.
   template <int dim>
   void StokesProblem<dim>::solve ()
   {
     const InverseMatrix<SparseMatrix<double>,
-      typename InnerPreconditioner<dim>::type>
-      A_inverse (system_matrix.block(0,0), *A_preconditioner);
+          typename InnerPreconditioner<dim>::type>
+          A_inverse (system_matrix.block(0,0), *A_preconditioner);
     Vector<double> tmp (solution.block(0).size());
 
-                                     // This is as in step-20. We generate the
-                                     // right hand side $B A^{-1} F - G$ for the
-                                     // Schur complement and an object that
-                                     // represents the respective linear
-                                     // operation $B A^{-1} B^T$, now with a
-                                     // template parameter indicating the
-                                     // preconditioner - in accordance with the
-                                     // definition of the class.
+    // This is as in step-20. We generate the
+    // right hand side $B A^{-1} F - G$ for the
+    // Schur complement and an object that
+    // represents the respective linear
+    // operation $B A^{-1} B^T$, now with a
+    // template parameter indicating the
+    // preconditioner - in accordance with the
+    // definition of the class.
     {
       Vector<double> schur_rhs (solution.block(1).size());
       A_inverse.vmult (tmp, system_rhs.block(0));
@@ -1000,79 +1000,79 @@ namespace Step22
       schur_rhs -= system_rhs.block(1);
 
       SchurComplement<typename InnerPreconditioner<dim>::type>
-        schur_complement (system_matrix, A_inverse);
+      schur_complement (system_matrix, A_inverse);
 
-                                       // The usual control structures for
-                                       // the solver call are created...
+      // The usual control structures for
+      // the solver call are created...
       SolverControl solver_control (solution.block(1).size(),
                                     1e-6*schur_rhs.l2_norm());
       SolverCG<>    cg (solver_control);
 
-                                       // Now to the preconditioner to the
-                                       // Schur complement. As explained in
-                                       // the introduction, the
-                                       // preconditioning is done by a mass
-                                       // matrix in the pressure variable.  It
-                                       // is stored in the $(1,1)$ block of
-                                       // the system matrix (that is not used
-                                       // anywhere else but in
-                                       // preconditioning).
-                                       //
-                                       // Actually, the solver needs to have
-                                       // the preconditioner in the form
-                                       // $P^{-1}$, so we need to create an
-                                       // inverse operation. Once again, we
-                                       // use an object of the class
-                                       // <code>InverseMatrix</code>, which
-                                       // implements the <code>vmult</code>
-                                       // operation that is needed by the
-                                       // solver.  In this case, we have to
-                                       // invert the pressure mass matrix. As
-                                       // it already turned out in earlier
-                                       // tutorial programs, the inversion of
-                                       // a mass matrix is a rather cheap and
-                                       // straight-forward operation (compared
-                                       // to, e.g., a Laplace matrix). The CG
-                                       // method with ILU preconditioning
-                                       // converges in 5-10 steps,
-                                       // independently on the mesh size.
-                                       // This is precisely what we do here:
-                                       // We choose another ILU preconditioner
-                                       // and take it along to the
-                                       // InverseMatrix object via the
-                                       // corresponding template parameter.  A
-                                       // CG solver is then called within the
-                                       // vmult operation of the inverse
-                                       // matrix.
-                                       //
-                                       // An alternative that is cheaper to
-                                       // build, but needs more iterations
-                                       // afterwards, would be to choose a
-                                       // SSOR preconditioner with factor
-                                       // 1.2. It needs about twice the number
-                                       // of iterations, but the costs for its
-                                       // generation are almost neglible.
+      // Now to the preconditioner to the
+      // Schur complement. As explained in
+      // the introduction, the
+      // preconditioning is done by a mass
+      // matrix in the pressure variable.  It
+      // is stored in the $(1,1)$ block of
+      // the system matrix (that is not used
+      // anywhere else but in
+      // preconditioning).
+      //
+      // Actually, the solver needs to have
+      // the preconditioner in the form
+      // $P^{-1}$, so we need to create an
+      // inverse operation. Once again, we
+      // use an object of the class
+      // <code>InverseMatrix</code>, which
+      // implements the <code>vmult</code>
+      // operation that is needed by the
+      // solver.  In this case, we have to
+      // invert the pressure mass matrix. As
+      // it already turned out in earlier
+      // tutorial programs, the inversion of
+      // a mass matrix is a rather cheap and
+      // straight-forward operation (compared
+      // to, e.g., a Laplace matrix). The CG
+      // method with ILU preconditioning
+      // converges in 5-10 steps,
+      // independently on the mesh size.
+      // This is precisely what we do here:
+      // We choose another ILU preconditioner
+      // and take it along to the
+      // InverseMatrix object via the
+      // corresponding template parameter.  A
+      // CG solver is then called within the
+      // vmult operation of the inverse
+      // matrix.
+      //
+      // An alternative that is cheaper to
+      // build, but needs more iterations
+      // afterwards, would be to choose a
+      // SSOR preconditioner with factor
+      // 1.2. It needs about twice the number
+      // of iterations, but the costs for its
+      // generation are almost neglible.
       SparseILU<double> preconditioner;
       preconditioner.initialize (system_matrix.block(1,1),
                                  SparseILU<double>::AdditionalData());
 
       InverseMatrix<SparseMatrix<double>,SparseILU<double> >
-        m_inverse (system_matrix.block(1,1), preconditioner);
-
-                                       // With the Schur complement and an
-                                       // efficient preconditioner at hand, we
-                                       // can solve the respective equation
-                                       // for the pressure (i.e. block 0 in
-                                       // the solution vector) in the usual
-                                       // way:
+      m_inverse (system_matrix.block(1,1), preconditioner);
+
+      // With the Schur complement and an
+      // efficient preconditioner at hand, we
+      // can solve the respective equation
+      // for the pressure (i.e. block 0 in
+      // the solution vector) in the usual
+      // way:
       cg.solve (schur_complement, solution.block(1), schur_rhs,
                 m_inverse);
 
-                                       // After this first solution step, the
-                                       // hanging node constraints have to be
-                                       // distributed to the solution in order
-                                       // to achieve a consistent pressure
-                                       // field.
+      // After this first solution step, the
+      // hanging node constraints have to be
+      // distributed to the solution in order
+      // to achieve a consistent pressure
+      // field.
       constraints.distribute (solution);
 
       std::cout << "  "
@@ -1081,17 +1081,17 @@ namespace Step22
                 << std::endl;
     }
 
-                                     // As in step-20, we finally need to
-                                     // solve for the velocity equation where
-                                     // we plug in the solution to the
-                                     // pressure equation. This involves only
-                                     // objects we already know - so we simply
-                                     // multiply $p$ by $B^T$, subtract the
-                                     // right hand side and multiply by the
-                                     // inverse of $A$. At the end, we need to
-                                     // distribute the constraints from
-                                     // hanging nodes in order to obtain a
-                                     // constistent flow field:
+    // As in step-20, we finally need to
+    // solve for the velocity equation where
+    // we plug in the solution to the
+    // pressure equation. This involves only
+    // objects we already know - so we simply
+    // multiply $p$ by $B^T$, subtract the
+    // right hand side and multiply by the
+    // inverse of $A$. At the end, we need to
+    // distribute the constraints from
+    // hanging nodes in order to obtain a
+    // constistent flow field:
     {
       system_matrix.block(0,1).vmult (tmp, solution.block(1));
       tmp *= -1;
@@ -1104,48 +1104,48 @@ namespace Step22
   }
 
 
-                                   // @sect4{StokesProblem::output_results}
-
-                                   // The next function generates graphical
-                                   // output. In this example, we are going to
-                                   // use the VTK file format.  We attach
-                                   // names to the individual variables in the
-                                   // problem: <code>velocity</code> to the
-                                   // <code>dim</code> components of velocity
-                                   // and <code>pressure</code> to the
-                                   // pressure.
-                                   //
-                                   // Not all visualization programs have the
-                                   // ability to group individual vector
-                                   // components into a vector to provide
-                                   // vector plots; in particular, this holds
-                                   // for some VTK-based visualization
-                                   // programs. In this case, the logical
-                                   // grouping of components into vectors
-                                   // should already be described in the file
-                                   // containing the data. In other words,
-                                   // what we need to do is provide our output
-                                   // writers with a way to know which of the
-                                   // components of the finite element
-                                   // logically form a vector (with $d$
-                                   // components in $d$ space dimensions)
-                                   // rather than letting them assume that we
-                                   // simply have a bunch of scalar fields.
-                                   // This is achieved using the members of
-                                   // the
-                                   // <code>DataComponentInterpretation</code>
-                                   // namespace: as with the filename, we
-                                   // create a vector in which the first
-                                   // <code>dim</code> components refer to the
-                                   // velocities and are given the tag
-                                   // <code>DataComponentInterpretation::component_is_part_of_vector</code>;
-                                   // we finally push one tag
-                                   // <code>DataComponentInterpretation::component_is_scalar</code>
-                                   // to describe the grouping of the pressure
-                                   // variable.
-
-                                   // The rest of the function is then
-                                   // the same as in step-20.
+  // @sect4{StokesProblem::output_results}
+
+  // The next function generates graphical
+  // output. In this example, we are going to
+  // use the VTK file format.  We attach
+  // names to the individual variables in the
+  // problem: <code>velocity</code> to the
+  // <code>dim</code> components of velocity
+  // and <code>pressure</code> to the
+  // pressure.
+  //
+  // Not all visualization programs have the
+  // ability to group individual vector
+  // components into a vector to provide
+  // vector plots; in particular, this holds
+  // for some VTK-based visualization
+  // programs. In this case, the logical
+  // grouping of components into vectors
+  // should already be described in the file
+  // containing the data. In other words,
+  // what we need to do is provide our output
+  // writers with a way to know which of the
+  // components of the finite element
+  // logically form a vector (with $d$
+  // components in $d$ space dimensions)
+  // rather than letting them assume that we
+  // simply have a bunch of scalar fields.
+  // This is achieved using the members of
+  // the
+  // <code>DataComponentInterpretation</code>
+  // namespace: as with the filename, we
+  // create a vector in which the first
+  // <code>dim</code> components refer to the
+  // velocities and are given the tag
+  // <code>DataComponentInterpretation::component_is_part_of_vector</code>;
+  // we finally push one tag
+  // <code>DataComponentInterpretation::component_is_scalar</code>
+  // to describe the grouping of the pressure
+  // variable.
+
+  // The rest of the function is then
+  // the same as in step-20.
   template <int dim>
   void
   StokesProblem<dim>::output_results (const unsigned int refinement_cycle)  const
@@ -1154,10 +1154,10 @@ namespace Step22
     solution_names.push_back ("pressure");
 
     std::vector<DataComponentInterpretation::DataComponentInterpretation>
-      data_component_interpretation
-      (dim, DataComponentInterpretation::component_is_part_of_vector);
     data_component_interpretation
-      .push_back (DataComponentInterpretation::component_is_scalar);
+    (dim, DataComponentInterpretation::component_is_part_of_vector);
+    data_component_interpretation
+    .push_back (DataComponentInterpretation::component_is_scalar);
 
     DataOut<dim> data_out;
     data_out.attach_dof_handler (dof_handler);
@@ -1176,38 +1176,38 @@ namespace Step22
   }
 
 
-                                   // @sect4{StokesProblem::refine_mesh}
-
-                                   // This is the last interesting function of
-                                   // the <code>StokesProblem</code> class.
-                                   // As indicated by its name, it takes the
-                                   // solution to the problem and refines the
-                                   // mesh where this is needed. The procedure
-                                   // is the same as in the respective step in
-                                   // step-6, with the exception that we base
-                                   // the refinement only on the change in
-                                   // pressure, i.e., we call the Kelly error
-                                   // estimator with a mask
-                                   // object. Additionally, we do not coarsen
-                                   // the grid again:
+  // @sect4{StokesProblem::refine_mesh}
+
+  // This is the last interesting function of
+  // the <code>StokesProblem</code> class.
+  // As indicated by its name, it takes the
+  // solution to the problem and refines the
+  // mesh where this is needed. The procedure
+  // is the same as in the respective step in
+  // step-6, with the exception that we base
+  // the refinement only on the change in
+  // pressure, i.e., we call the Kelly error
+  // estimator with a mask
+  // object. Additionally, we do not coarsen
+  // the grid again:
   template <int dim>
   void
   StokesProblem<dim>::refine_mesh ()
   {
     Vector<float> estimated_error_per_cell (triangulation.n_active_cells());
     srand (0);
-    for (unsigned int i=0;i<estimated_error_per_cell.size();++i)
+    for (unsigned int i=0; i<estimated_error_per_cell.size(); ++i)
       estimated_error_per_cell(i) = 1.0*(rand() % 1000);
-/*
-    std::vector<bool> component_mask (dim+1, false);
-    component_mask[dim] = true;
-    KellyErrorEstimator<dim>::estimate (dof_handler,
-                                        QGauss<dim-1>(degree+1),
-                                        typename FunctionMap<dim>::type(),
-                                        solution,
-                                        estimated_error_per_cell,
-                                        component_mask);
-*/
+    /*
+        std::vector<bool> component_mask (dim+1, false);
+        component_mask[dim] = true;
+        KellyErrorEstimator<dim>::estimate (dof_handler,
+                                            QGauss<dim-1>(degree+1),
+                                            typename FunctionMap<dim>::type(),
+                                            solution,
+                                            estimated_error_per_cell,
+                                            component_mask);
+    */
     GridRefinement::refine_and_coarsen_fixed_number (triangulation,
                                                      estimated_error_per_cell,
                                                      0.3, 0.0);
@@ -1215,27 +1215,27 @@ namespace Step22
   }
 
 
-                                   // @sect4{StokesProblem::run}
-
-                                   // The last step in the Stokes class is, as
-                                   // usual, the function that generates the
-                                   // initial grid and calls the other
-                                   // functions in the respective order.
-                                   //
-                                   // We start off with a rectangle of size $4
-                                   // \times 1$ (in 2d) or $4 \times 1 \times
-                                   // 1$ (in 3d), placed in $R^2/R^3$ as
-                                   // $(-2,2)\times(-1,0)$ or
-                                   // $(-2,2)\times(0,1)\times(-1,0)$,
-                                   // respectively. It is natural to start
-                                   // with equal mesh size in each direction,
-                                   // so we subdivide the initial rectangle
-                                   // four times in the first coordinate
-                                   // direction. To limit the scope of the
-                                   // variables involved in the creation of
-                                   // the mesh to the range where we actually
-                                   // need them, we put the entire block
-                                   // between a pair of braces:
+  // @sect4{StokesProblem::run}
+
+  // The last step in the Stokes class is, as
+  // usual, the function that generates the
+  // initial grid and calls the other
+  // functions in the respective order.
+  //
+  // We start off with a rectangle of size $4
+  // \times 1$ (in 2d) or $4 \times 1 \times
+  // 1$ (in 3d), placed in $R^2/R^3$ as
+  // $(-2,2)\times(-1,0)$ or
+  // $(-2,2)\times(0,1)\times(-1,0)$,
+  // respectively. It is natural to start
+  // with equal mesh size in each direction,
+  // so we subdivide the initial rectangle
+  // four times in the first coordinate
+  // direction. To limit the scope of the
+  // variables involved in the creation of
+  // the mesh to the range where we actually
+  // need them, we put the entire block
+  // between a pair of braces:
   template <int dim>
   void StokesProblem<dim>::run ()
   {
@@ -1256,64 +1256,64 @@ namespace Step22
                                                  top_right);
     }
 
-                                     // A boundary indicator of 1 is set to all
-                                     // boundaries that are subject to Dirichlet
-                                     // boundary conditions, i.e.  to faces that
-                                     // are located at 0 in the last coordinate
-                                     // direction. See the example description
-                                     // above for details.
+    // A boundary indicator of 1 is set to all
+    // boundaries that are subject to Dirichlet
+    // boundary conditions, i.e.  to faces that
+    // are located at 0 in the last coordinate
+    // direction. See the example description
+    // above for details.
     for (typename Triangulation<dim>::active_cell_iterator
-           cell = triangulation.begin_active();
+         cell = triangulation.begin_active();
          cell != triangulation.end(); ++cell)
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
         if (cell->face(f)->center()[dim-1] == 0)
           cell->face(f)->set_all_boundary_indicators(1);
 
 
-                                     // We then apply an initial refinement
-                                     // before solving for the first time. In
-                                     // 3D, there are going to be more degrees
-                                     // of freedom, so we refine less there:
+    // We then apply an initial refinement
+    // before solving for the first time. In
+    // 3D, there are going to be more degrees
+    // of freedom, so we refine less there:
     triangulation.refine_global (8-dim);
 
-                                     // As first seen in step-6, we cycle over
-                                     // the different refinement levels and
-                                     // refine (except for the first cycle),
-                                     // setup the degrees of freedom and
-                                     // matrices, assemble, solve and create
-                                     // output:
+    // As first seen in step-6, we cycle over
+    // the different refinement levels and
+    // refine (except for the first cycle),
+    // setup the degrees of freedom and
+    // matrices, assemble, solve and create
+    // output:
     for (unsigned int refinement_cycle = 0; refinement_cycle<1;
          ++refinement_cycle)
       {
         std::cout << "Refinement cycle " << refinement_cycle << std::endl;
 
-                                        //if (refinement_cycle > 0)
-         {
-           timer.enter_section("refine");
-                                            refine_mesh ();
-                                            refine_mesh ();
-                                            refine_mesh ();
-                                                                             //triangulation.refine_global(1);
-           timer.exit_section("refine");
-         }
-
-                                        //timer.enter_section("setup");
+        //if (refinement_cycle > 0)
+        {
+          timer.enter_section("refine");
+          refine_mesh ();
+          refine_mesh ();
+          refine_mesh ();
+          //triangulation.refine_global(1);
+          timer.exit_section("refine");
+        }
+
+        //timer.enter_section("setup");
         setup_dofs ();
-                                        //timer.exit_section("setup");
+        //timer.exit_section("setup");
 
         std::cout << "   Assembling..." << std::endl << std::flush;
-       timer.enter_section("assembly");
+        timer.enter_section("assembly");
         assemble_system ();
-       timer.exit_section("assembly");
+        timer.exit_section("assembly");
 
         std::cout << "   Solving..." << std::flush;
-                                        //timer.enter_section("solver");
-                                        //solve ();
-                                        //timer.exit_section("solver");
+        //timer.enter_section("solver");
+        //solve ();
+        //timer.exit_section("solver");
 
-                                        //timer.enter_section("results");
-                                        //output_results (refinement_cycle);
-                                        //timer.exit_section("results");
+        //timer.enter_section("results");
+        //output_results (refinement_cycle);
+        //timer.exit_section("results");
 
         std::cout << std::endl;
       }
@@ -1322,12 +1322,12 @@ namespace Step22
 }
 
 
-                                 // @sect3{The <code>main</code> function}
+// @sect3{The <code>main</code> function}
 
-                                 // The main function is the same as in
-                                 // step-20. We pass the element degree as a
-                                 // parameter and choose the space dimension
-                                 // at the well-known template slot.
+// The main function is the same as in
+// step-20. We pass the element degree as a
+// parameter and choose the space dimension
+// at the well-known template slot.
 int main ()
 {
   try
index f8fcb9842f74133b074ece08c6b4399c63d30433..b9448adf95cf32e689d10b51c1f84136386b98ee 100644 (file)
@@ -123,7 +123,7 @@ template <int dim>
 void HelmholtzProblem<dim>::assemble_system ()
 {
   timer.enter_subsection("write into matrix");
-  
+
   QGauss<dim>   quadrature_formula(fe.degree+1);
 
   const unsigned int n_q_points    = quadrature_formula.size();
@@ -160,11 +160,11 @@ void HelmholtzProblem<dim>::assemble_system ()
                                      fe_values.JxW(q_point));
           }
 
-        cell->get_dof_indices (local_dof_indices);
-        hanging_node_constraints.distribute_local_to_global (cell_matrix,
-                                                             local_dof_indices,
-                                                             system_matrix);
-      }
+      cell->get_dof_indices (local_dof_indices);
+      hanging_node_constraints.distribute_local_to_global (cell_matrix,
+                                                           local_dof_indices,
+                                                           system_matrix);
+    }
 
   timer.leave_subsection();
 }
index f2c03827954aa7b0d9c7c217823b3993ef593b39..302781a95290378656aa6be327f9496c48af8cb2 100644 (file)
@@ -35,66 +35,66 @@ template <int dim>
 void test ()
 {
   deallog << dim << 'd' << std::endl;
-  
-  Triangulation<dim> tria;  
+
+  Triangulation<dim> tria;
   GridGenerator::hyper_cube (tria,0,1);
   tria.refine_global (1);
 
   deallog << tria.begin_active() << std::endl;
 
-                                   // test a few comparison operators
+  // test a few comparison operators
   {
     const typename Triangulation<dim>::active_cell_iterator
-      cell = tria.begin_active();
+    cell = tria.begin_active();
     Assert (cell == cell, ExcInternalError());
     Assert (! (cell != cell), ExcInternalError());
     Assert (! (cell < cell), ExcInternalError());
   }
 
-                                   // same with non-active iterators
+  // same with non-active iterators
   {
     const typename Triangulation<dim>::cell_iterator
-      cell = tria.begin();
+    cell = tria.begin();
     Assert (cell == cell, ExcInternalError());
     Assert (! (cell != cell), ExcInternalError());
     Assert (! (cell < cell), ExcInternalError());
   }
-  
+
   FE_Q<dim> fe (1);
   DoFHandler<dim> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
 
-                                   // now do the same tests with the
-                                   // DoFHandler iterators
+  // now do the same tests with the
+  // DoFHandler iterators
   {
     const typename DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active();
+    cell = dof_handler.begin_active();
     Assert (cell == cell, ExcInternalError());
     Assert (! (cell != cell), ExcInternalError());
     Assert (! (cell < cell), ExcInternalError());
   }
   {
     const typename DoFHandler<dim>::cell_iterator
-      cell = dof_handler.begin();
+    cell = dof_handler.begin();
     Assert (cell == cell, ExcInternalError());
     Assert (! (cell != cell), ExcInternalError());
     Assert (! (cell < cell), ExcInternalError());
   }
 
-                                   // finally check that two iterators
-                                   // pointing into different DoFHandlers
-                                   // can't be the same
-                                   //
-                                   // this test accidentally failed before a
-                                   // fix was checked in on 2005-08-08 that
-                                   // completely forbids comparing iterators
-                                   // into different DoFHandlers at all
+  // finally check that two iterators
+  // pointing into different DoFHandlers
+  // can't be the same
+  //
+  // this test accidentally failed before a
+  // fix was checked in on 2005-08-08 that
+  // completely forbids comparing iterators
+  // into different DoFHandlers at all
   {
     DoFHandler<dim> dof_handler2 (tria);
     dof_handler2.distribute_dofs (fe);
-    try 
+    try
       {
-       (dof_handler.begin_active() != dof_handler2.begin_active());
+        (dof_handler.begin_active() != dof_handler2.begin_active());
       }
     catch (ExceptionBase &e)
       {
index 33f4478bac622025006d71994cafe826122a64df..baf5ccf41052abf895c0db46434905df4886ed83 100644 (file)
@@ -34,7 +34,7 @@
 #include <deal.II/grid/tria_iterator.h>
 #include <deal.II/dofs/dof_accessor.h>
 #include <deal.II/dofs/dof_tools.h>
-#include <deal.II/fe/fe_system.h>              
+#include <deal.II/fe/fe_system.h>
 #include <deal.II/fe/fe_q.h>
 #include <deal.II/fe/fe_nedelec.h>
 #include <deal.II/fe/fe_base.h>
 
 
 template <int dim>
-class SystemTest 
+class SystemTest
 {
-  public:
-    SystemTest ();
-    void run ();    
-                                   
-  private:
-    void make_grid_and_dofs ();
-    void shape_to_components ();
-    void check_numbering ();
-
-                                   
-    Triangulation<dim>     triangulation;
-    FESystem<dim>          fe;
-    DoFHandler<dim>        dof_handler;
-
-                                  
+public:
+  SystemTest ();
+  void run ();
+
+private:
+  void make_grid_and_dofs ();
+  void shape_to_components ();
+  void check_numbering ();
+
+
+  Triangulation<dim>     triangulation;
+  FESystem<dim>          fe;
+  DoFHandler<dim>        dof_handler;
+
+
 };
 
 template <int dim>
 SystemTest<dim>::SystemTest () :
-                fe (FE_Nedelec<dim>(0), 2,
-                    FE_Q<dim>(1), 1),
-               dof_handler (triangulation)
+  fe (FE_Nedelec<dim>(0), 2,
+      FE_Q<dim>(1), 1),
+  dof_handler (triangulation)
 {}
 
 
 template <int dim>
 void SystemTest<dim>::make_grid_and_dofs ()
 {
-                                 
+
   GridGenerator::hyper_cube (triangulation, -1, 1);
   triangulation.refine_global (0);
   deallog << "Number of active cells: " << triangulation.n_active_cells()
           << std::endl;
   deallog << "Total number of cells: " << triangulation.n_cells()
           << std::endl;
-                                 
+
   dof_handler.distribute_dofs (fe);
   deallog << "Number of degrees of freedom: " << dof_handler.n_dofs()
           << std::endl;
-                                 
+
 }
 
 template <int dim>
-void SystemTest<dim>::shape_to_components () 
+void SystemTest<dim>::shape_to_components ()
 {
-                                   // testing, if the shape function
-                                   // with index i is of type Nedelec:
-                                   // (i.e. the first component of the FESystem)
-                                   // 1 for yes, 0 for no.
-   
-  for(unsigned int i = 0; i<fe.dofs_per_cell; i++)
+  // testing, if the shape function
+  // with index i is of type Nedelec:
+  // (i.e. the first component of the FESystem)
+  // 1 for yes, 0 for no.
+
+  for (unsigned int i = 0; i<fe.dofs_per_cell; i++)
     deallog <<"  shapefunction "<< i << " is Nedelec:  "
             << (fe.is_primitive(i) ? "false" : "true") << std::endl;
 }
@@ -104,39 +104,39 @@ void SystemTest<dim>::shape_to_components ()
 
 
 template <int dim>
-void SystemTest<dim>::check_numbering () 
+void SystemTest<dim>::check_numbering ()
 {
   typename DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
-  std::vector<types::global_dof_index> local_dof_indices(fe.dofs_per_cell);
-       
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
+  std::vector<types::global_dof_index>  local_dof_indices(fe.dofs_per_cell);
+
   for (; cell!=endc; ++cell)
     {
       cell->get_dof_indices (local_dof_indices);
       for (unsigned int i=0; i<fe.dofs_per_cell; i++)
-        deallog <<"  DoF "<< local_dof_indices[i] << " belongs to base element " 
+        deallog <<"  DoF "<< local_dof_indices[i] << " belongs to base element "
                 << fe.system_to_base_index(i).first.first
                 << ", instance " << fe.system_to_base_index(i).first.second
                 << std::endl;
       deallog<< std::endl;
     };
-        
-        
-                                   //Now: Componentwise reodering of the dofs
-       
+
+
+  //Now: Componentwise reodering of the dofs
+
   deallog << "  Now we renumber the DoFs component-wise:" << std::endl;
   deallog << "  ****************************************" << std::endl;
   DoFRenumbering::component_wise (dof_handler);
-       
+
   cell = dof_handler.begin_active();
   endc = dof_handler.end();
-       
+
   for (; cell!=endc; ++cell)
     {
       cell->get_dof_indices (local_dof_indices);
-      for(unsigned int i=0; i<fe.dofs_per_cell; i++)
-        deallog <<"  DoF "<< local_dof_indices[i] << " belongs to base " 
+      for (unsigned int i=0; i<fe.dofs_per_cell; i++)
+        deallog <<"  DoF "<< local_dof_indices[i] << " belongs to base "
                 << fe.system_to_base_index(i).first.first
                 << ", instance " << fe.system_to_base_index(i).first.second
                 << std::endl;
@@ -146,16 +146,16 @@ void SystemTest<dim>::check_numbering ()
 
 
 template <int dim>
-void SystemTest<dim>::run () 
+void SystemTest<dim>::run ()
 {
   make_grid_and_dofs ();
   shape_to_components ();
   check_numbering();
 }
 
-    
 
-int main () 
+
+int main ()
 {
   std::ofstream logfile("anna_1/output");
   deallog.attach(logfile);
@@ -163,6 +163,6 @@ int main ()
   deallog.threshold_double(1.e-10);
 
   SystemTest<2>().run();
-  SystemTest<3>().run();  
+  SystemTest<3>().run();
   return 0;
 }
index 65509ea54c101f13f85110cfdb51ac79ca7b9447..e4e2c7b579291774d626b7cb149a2474dbfd0503 100644 (file)
@@ -38,7 +38,7 @@
 #include <deal.II/grid/tria_iterator.h>
 #include <deal.II/dofs/dof_accessor.h>
 #include <deal.II/dofs/dof_tools.h>
-#include <deal.II/fe/fe_system.h>              
+#include <deal.II/fe/fe_system.h>
 #include <deal.II/fe/fe_q.h>
 #include <deal.II/fe/fe_nedelec.h>
 #include <deal.II/fe/fe_base.h>
 
 
 template <int dim>
-class SystemTest 
+class SystemTest
 {
-  public:
-    SystemTest ();
-    void run ();    
-                                   
-  private:
-    void make_grid_and_dofs ();
-    void shape_to_components ();
-    void check_numbering ();
-
-                                   
-    Triangulation<dim>     triangulation;
-    FESystem<dim>          fe;
-    DoFHandler<dim>        dof_handler;                   
+public:
+  SystemTest ();
+  void run ();
+
+private:
+  void make_grid_and_dofs ();
+  void shape_to_components ();
+  void check_numbering ();
+
+
+  Triangulation<dim>     triangulation;
+  FESystem<dim>          fe;
+  DoFHandler<dim>        dof_handler;
 };
 
 template <int dim>
 SystemTest<dim>::SystemTest () :
-                fe (FE_Nedelec<dim>(0), 2,
-                    FE_Q<dim>(1), 1),
-               dof_handler (triangulation)
+  fe (FE_Nedelec<dim>(0), 2,
+      FE_Q<dim>(1), 1),
+  dof_handler (triangulation)
 {}
 
 
 template <int dim>
 void SystemTest<dim>::make_grid_and_dofs ()
 {
-                                 
+
   GridGenerator::hyper_cube (triangulation, -1, 1);
   triangulation.refine_global (0);
   deallog << "Number of active cells: " << triangulation.n_active_cells()
           << std::endl;
   deallog << "Total number of cells: " << triangulation.n_cells()
           << std::endl;
-                                 
+
   dof_handler.distribute_dofs (fe);
   deallog << "Number of degrees of freedom: " << dof_handler.n_dofs()
-          << std::endl;                          
+          << std::endl;
 }
 
 template <int dim>
-void SystemTest<dim>::shape_to_components () 
+void SystemTest<dim>::shape_to_components ()
 {
-                                   // testing, if the shape function
-                                   // with index i is of type Nedelec:
-                                   // (i.e. the first component of the FESystem)
-                                   // 1 for yes, 0 for no.
-   
-  for(unsigned int i = 0; i<fe.dofs_per_cell; i++)
+  // testing, if the shape function
+  // with index i is of type Nedelec:
+  // (i.e. the first component of the FESystem)
+  // 1 for yes, 0 for no.
+
+  for (unsigned int i = 0; i<fe.dofs_per_cell; i++)
     deallog <<"  shapefunction "<< i << " is Nedelec:  "
             << (fe.is_primitive(i) ? "false" : "true") << std::endl;
 }
@@ -105,42 +105,42 @@ void SystemTest<dim>::shape_to_components ()
 
 
 template <int dim>
-void SystemTest<dim>::check_numbering () 
+void SystemTest<dim>::check_numbering ()
 {
   typename DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
-  std::vector<types::global_dof_index> local_dof_indices(fe.dofs_per_cell);
-       
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
+  std::vector<types::global_dof_index>  local_dof_indices(fe.dofs_per_cell);
+
   for (; cell!=endc; ++cell)
     {
       cell->get_dof_indices (local_dof_indices);
       for (unsigned int i=0; i<fe.dofs_per_cell; i++)
-        deallog <<"  DoF "<< local_dof_indices[i] << " belongs to base element " 
+        deallog <<"  DoF "<< local_dof_indices[i] << " belongs to base element "
                 << fe.system_to_base_index(i).first.first
                 << ", instance " << fe.system_to_base_index(i).first.second
                 << std::endl;
       deallog<< std::endl;
     };
-        
-        
-                                   //Now: Componentwise reodering of the dofs
-       
+
+
+  //Now: Componentwise reodering of the dofs
+
   deallog << "  Now we renumber the DoFs anti-component-wise:" << std::endl;
   deallog << "  *********************************************" << std::endl;
   std::vector<unsigned int> comp(fe.n_components());
   for (unsigned int i=0; i<comp.size(); ++i)
     comp[i] = comp.size()-i-1;
   DoFRenumbering::component_wise (dof_handler, comp);
-       
+
   cell = dof_handler.begin_active();
   endc = dof_handler.end();
-       
+
   for (; cell!=endc; ++cell)
     {
       cell->get_dof_indices (local_dof_indices);
-      for(unsigned int i=0; i<fe.dofs_per_cell; i++)
-        deallog <<"  DoF "<< local_dof_indices[i] << " belongs to base " 
+      for (unsigned int i=0; i<fe.dofs_per_cell; i++)
+        deallog <<"  DoF "<< local_dof_indices[i] << " belongs to base "
                 << fe.system_to_base_index(i).first.first
                 << ", instance " << fe.system_to_base_index(i).first.second
                 << std::endl;
@@ -150,16 +150,16 @@ void SystemTest<dim>::check_numbering ()
 
 
 template <int dim>
-void SystemTest<dim>::run () 
+void SystemTest<dim>::run ()
 {
   make_grid_and_dofs ();
   shape_to_components ();
   check_numbering();
 }
 
-    
 
-int main () 
+
+int main ()
 {
   std::ofstream logfile("anna_2/output");
   deallog.attach(logfile);
@@ -167,6 +167,6 @@ int main ()
   deallog.threshold_double(1.e-10);
 
   SystemTest<2>().run();
-  SystemTest<3>().run();  
+  SystemTest<3>().run();
   return 0;
 }
index d1b17d68e09d1642bc65518bfe37623e5e18d7e8..daa6af1d485cbccf2c31eed5d926afe35760473a 100644 (file)
 template <int dim>
 class SystemTest
 {
-  public:
-    SystemTest ();
-    void run ();
+public:
+  SystemTest ();
+  void run ();
 
-  private:
-    void make_grid_and_dofs ();
-    void check ();
+private:
+  void make_grid_and_dofs ();
+  void check ();
 
 
-    Triangulation<dim>     triangulation;
-    FESystem<dim>          fe;
-    DoFHandler<dim>        dof_handler;
+  Triangulation<dim>     triangulation;
+  FESystem<dim>          fe;
+  DoFHandler<dim>        dof_handler;
 
 
 };
 
 template <int dim>
 SystemTest<dim>::SystemTest () :
-                fe (FE_Nedelec<dim>(0), 2,
-                    FE_Q<dim>(1), 1),
-               dof_handler (triangulation)
+  fe (FE_Nedelec<dim>(0), 2,
+      FE_Q<dim>(1), 1),
+  dof_handler (triangulation)
 {}
 
 
@@ -102,8 +102,8 @@ void SystemTest<dim>::check ()
           deallog << "  DoF " << i << std::endl;
     };
 
-  std::vector<types::global_dof_index> dofs_per_component (fe.n_components(), 
-      static_cast<types::global_dof_index>(0));
+  std::vector<types::global_dof_index> dofs_per_component (fe.n_components(),
+                                                           static_cast<types::global_dof_index>(0));
   DoFTools::count_dofs_per_component (dof_handler, dofs_per_component);
   deallog << "DoFs per component: ";
   for (unsigned int i=0; i<fe.n_components(); ++i)
@@ -119,8 +119,8 @@ void SystemTest<dim>::run ()
   make_grid_and_dofs ();
   check();
 
-                                   // renumber degrees of freedom and
-                                   // try again
+  // renumber degrees of freedom and
+  // try again
   deallog << std::endl << "*** Renumbering ***" << std::endl;
   DoFRenumbering::component_wise (dof_handler);
   check ();
index ea0fc496270f0b80b5615264e23407a543d8310e..fd394d062cebc20f06cb13b9638680fa31691cdf 100644 (file)
 #include <deal.II/dofs/dof_tools.h>
 #include <deal.II/numerics/vector_tools.h>
 
-                                 // We need a FESystem
+// We need a FESystem
 #include <deal.II/fe/fe_system.h>
 
-                                 // we need DG-elements
-                                 // and Q1-elements
+// we need DG-elements
+// and Q1-elements
 #include <deal.II/fe/fe_q.h>
 #include <deal.II/fe/fe_dgp.h>
 
 template <int dim>
 class VectorBoundaryValues :  public Function<dim>
 {
-  public:
-    VectorBoundaryValues ();
-    virtual void vector_value (const Point<dim> &p,
-                               Vector<double>   &values) const;
+public:
+  VectorBoundaryValues ();
+  virtual void vector_value (const Point<dim> &p,
+                             Vector<double>   &values) const;
 };
 
 template <int dim>
 VectorBoundaryValues<dim>::VectorBoundaryValues () :
-                Function<dim> (2)
+  Function<dim> (2)
 {}
 
 template <int dim>
@@ -81,28 +81,28 @@ void VectorBoundaryValues<dim>::vector_value (const Point<dim> &p,
 template <int dim>
 class FindBug
 {
-  public:
-    FindBug ();
-    void run ();
-  private:
-    void make_grid_and_dofs ();
-    void dirichlet_conditions ();
-
-    Triangulation<dim>     triangulation;
-    FESystem<dim>              fe;
-    DoFHandler<dim>        dof_handler;
-    Vector<double>          solution;
+public:
+  FindBug ();
+  void run ();
+private:
+  void make_grid_and_dofs ();
+  void dirichlet_conditions ();
+
+  Triangulation<dim>     triangulation;
+  FESystem<dim>              fe;
+  DoFHandler<dim>        dof_handler;
+  Vector<double>          solution;
 };
 
 
-                                 // Construct FESystem with
-                                 // first component: Q1-Element,
-                                 // second component: lowest order DG_Element
+// Construct FESystem with
+// first component: Q1-Element,
+// second component: lowest order DG_Element
 template <int dim>
 FindBug<dim>::FindBug () :
-                fe (FE_Q<dim>(1), 1,
-                    FE_DGP<dim>(0), 1),
-                dof_handler (triangulation)
+  fe (FE_Q<dim>(1), 1,
+      FE_DGP<dim>(0), 1),
+  dof_handler (triangulation)
 {}
 
 
@@ -136,53 +136,53 @@ void FindBug<dim>::make_grid_and_dofs ()
 template <int dim>
 void FindBug<dim>::dirichlet_conditions ()
 {
-                                   // we want to set the Boundary DoFs
-                                   // of the selected component to a
-                                   // given value, say zero.  To do
-                                   // so, we want to use VectorTools::
-                                   // interpolate_boundary_values
-                                   //
-                                   // This works fine if all the
-                                   // components have support on the
-                                   // faces.  (This, of course, has to
-                                   // be requested when fixing the
-                                   // boundary DoFs.)  However,
-                                   // getting the values for the
-                                   // boundary DoFs of a valid
-                                   // component by the function
-                                   // VectorTools::
-                                   // interpolate_boundary_values and
-                                   // an appropriate component_mask
-                                   // (unselecting the DG-component)
-                                   // does not work yet. Or, better:
-                                   // it did not work and this program
-                                   // checks that it has been
-                                   // correctly implemented by now
+  // we want to set the Boundary DoFs
+  // of the selected component to a
+  // given value, say zero.  To do
+  // so, we want to use VectorTools::
+  // interpolate_boundary_values
+  //
+  // This works fine if all the
+  // components have support on the
+  // faces.  (This, of course, has to
+  // be requested when fixing the
+  // boundary DoFs.)  However,
+  // getting the values for the
+  // boundary DoFs of a valid
+  // component by the function
+  // VectorTools::
+  // interpolate_boundary_values and
+  // an appropriate component_mask
+  // (unselecting the DG-component)
+  // does not work yet. Or, better:
+  // it did not work and this program
+  // checks that it has been
+  // correctly implemented by now
 
 
   std::map<types::global_dof_index,double> dirichlet_dofs;
 
-                                   // we declare a vector of bools,
-                                   // which tells the
-                                   // VectorTools::interpolate_boundary_values
-                                   // on which components of the
-                                   // FESystem we want to impose
-                                   // Dirichlet BC.
+  // we declare a vector of bools,
+  // which tells the
+  // VectorTools::interpolate_boundary_values
+  // on which components of the
+  // FESystem we want to impose
+  // Dirichlet BC.
   std::vector<bool> component_mask(2);
-                                   // Dirichlet-BC for the
-                                   // Q1-Component
+  // Dirichlet-BC for the
+  // Q1-Component
   component_mask[0] = true;
-                                   // no Dirichlet-BC for the
-                                   // DG-component
+  // no Dirichlet-BC for the
+  // DG-component
   component_mask[1] = false;
 
-                                   // This is just for the final
-                                   // output-test
+  // This is just for the final
+  // output-test
   for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
     dirichlet_dofs[i] = 1.;
 
 
-                                   // Here comes the crucial call....
+  // Here comes the crucial call....
   VectorTools::interpolate_boundary_values (dof_handler,
                                             0,
                                             ZeroFunction<dim> (2),
@@ -194,19 +194,19 @@ void FindBug<dim>::dirichlet_conditions ()
   std::set<types::boundary_id> boundary_indicators;
   boundary_indicators.insert (0);
 
-                                   // get a list of those boundary DoFs which
-                                   // we want to be fixed:
+  // get a list of those boundary DoFs which
+  // we want to be fixed:
   DoFTools::extract_boundary_dofs (dof_handler,
                                    component_mask,
                                    fixed_dofs,
                                    boundary_indicators);
 
-                                   // (Primitive) Check if the DoFs
-                                   // where adjusted correctly (note
-                                   // that we have preset all values
-                                   // to 1, and interpolate_b_v should
-                                   // have overwritten those for
-                                   // component 0 by 0)
+  // (Primitive) Check if the DoFs
+  // where adjusted correctly (note
+  // that we have preset all values
+  // to 1, and interpolate_b_v should
+  // have overwritten those for
+  // component 0 by 0)
   for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
     {
       if (fixed_dofs[i] == true)
@@ -219,9 +219,9 @@ void FindBug<dim>::dirichlet_conditions ()
         };
     };
 
-                                   // check 1 has obviously succeeded,
-                                   // so also check a more complicated
-                                   // boundary value function
+  // check 1 has obviously succeeded,
+  // so also check a more complicated
+  // boundary value function
   dirichlet_dofs.clear ();
   VectorTools::interpolate_boundary_values (dof_handler,
                                             0,
@@ -253,7 +253,7 @@ int main ()
 
   FindBug<2>().run ();
   FindBug<3>().run ();
-  
+
   return 0;
 }
 
index 3f4997575e1b68096cf4fdc3f76415ac81f17246..4899b1ba17aae3553d41436d8be8ff9b5c9cfe2c 100644 (file)
 // ---------------------------------------------------------------------
 
 
-/*     Test code to help fixing 
+/*  Test code to help fixing
 
 DoFTools::extract_boundary_dofs
 and
-       
+
 VectorTools::interpolate_boundary_values
-          
-          
-          
+
+
+
 The underlying FE is a FESystem with one Nedelec
 component and one scalar component.
-       
+
 We would like to use
 DoFTools::extract_boundary_dofs
 with a component_mask disabling the
 Nedelec and the scalar component respectively.
-       
+
 Furthermore, we would like to use
 VectorTools::interpolate_boundary_values
 with a component_mask enabling only
 the scalar component.
-       
+
 author: Anna Schneebeli, February 2003
-  
+
 */
 
-                       
-                       
+
+
 
 #include "../tests.h"
 #include <deal.II/base/function.h>
@@ -64,8 +64,8 @@ author: Anna Schneebeli, February 2003
 #include <deal.II/numerics/matrix_tools.h>
 #include <deal.II/numerics/data_out.h>
 
-                               
-#include <deal.II/fe/fe_system.h>      
+
+#include <deal.II/fe/fe_system.h>
 #include <deal.II/fe/fe_nedelec.h>
 #include <deal.II/fe/fe_q.h>
 
@@ -76,60 +76,60 @@ author: Anna Schneebeli, February 2003
 template <int dim>
 class ImposeBC
 {
-  public:
-    ImposeBC();
-    ~ImposeBC();
-    void run ();
-    
-  private:
-   
-    void get_ready ();
-    void test_extract_boundary_DoFs ();
-    void test_interpolate_BC ();
-       
-    Triangulation<dim>   triangulation;
-       
-                                     // We use a FE-System with 2 components:
-                                     // a vector-valued one for the
-                                     // field-variable u and a scalar one for
-                                     // the pressure-variable p
-    FESystem<dim>        fe;
-    DoFHandler<dim>      dof_handler;
-    
-    unsigned int               n_u_dofs;
-    unsigned int               n_p_dofs;
-       
-};                     
+public:
+  ImposeBC();
+  ~ImposeBC();
+  void run ();
+
+private:
+
+  void get_ready ();
+  void test_extract_boundary_DoFs ();
+  void test_interpolate_BC ();
+
+  Triangulation<dim>   triangulation;
+
+  // We use a FE-System with 2 components:
+  // a vector-valued one for the
+  // field-variable u and a scalar one for
+  // the pressure-variable p
+  FESystem<dim>        fe;
+  DoFHandler<dim>      dof_handler;
+
+  unsigned int    n_u_dofs;
+  unsigned int    n_p_dofs;
+
+};
 
 
 // some boundary function for the scalar component
 template <int dim>
 class BoundaryFunction : public Function<dim>
 {
-  public:
-    BoundaryFunction ();
-    
-    virtual void vector_value (const Point<dim>   &p,
-                               Vector<double> &values) const;
-       
+public:
+  BoundaryFunction ();
+
+  virtual void vector_value (const Point<dim>   &p,
+                             Vector<double> &values) const;
+
 };
 
 
 template <int dim>
-BoundaryFunction<dim>::BoundaryFunction () : 
-                Function<dim> (dim+1) {}
+BoundaryFunction<dim>::BoundaryFunction () :
+  Function<dim> (dim+1) {}
 
 
 
 template <int dim>
 inline
-void BoundaryFunction<dim>::vector_value (const Point<dim>   &,
+void BoundaryFunction<dim>::vector_value (const Point<dim> &,
                                           Vector<double> &values) const
 {
-       
-  Assert (values.size() == dim+1, 
-         ExcDimensionMismatch (values.size(), dim+1));
-                                 
+
+  Assert (values.size() == dim+1,
+          ExcDimensionMismatch (values.size(), dim+1));
+
   values = 0;
   values(dim) = 1.;
 }
@@ -138,111 +138,111 @@ void BoundaryFunction<dim>::vector_value (const Point<dim>   &,
 
 
 
-                                 // Construct FE with first component: Nedelec-Element,
-                                 // second component: Q1_Element
+// Construct FE with first component: Nedelec-Element,
+// second component: Q1_Element
 template <int dim>
 ImposeBC<dim>::ImposeBC() :
-                fe (FE_Nedelec<dim>(0), 1, FE_Q<dim>(1), 1),
-                dof_handler (triangulation)                     
+  fe (FE_Nedelec<dim>(0), 1, FE_Q<dim>(1), 1),
+  dof_handler (triangulation)
 {}
 
 
 
 template <int dim>
-ImposeBC<dim>::~ImposeBC() 
+ImposeBC<dim>::~ImposeBC()
 {
   dof_handler.clear ();
 }
 
 
 template <int dim>
-void ImposeBC<dim>::get_ready () 
-{  
+void ImposeBC<dim>::get_ready ()
+{
   dof_handler.distribute_dofs (fe);
-  std::vector<types::global_dof_index> dofs_per_comp (fe.n_components());
+  std::vector<types::global_dof_index>  dofs_per_comp (fe.n_components());
   DoFTools::count_dofs_per_component(dof_handler, dofs_per_comp);
-       
-                                   // For an FESystem with Nedelec-elements as
-                                   // first component and bilinear elements as
-                                   // component we have:
-                                   // dofs_per_comp[0] = dofs_per_comp[1] = # Ned-DoFs
-                                   // dofs_per_comp[2] = # Q1-DoFs
+
+  // For an FESystem with Nedelec-elements as
+  // first component and bilinear elements as
+  // component we have:
+  // dofs_per_comp[0] = dofs_per_comp[1] = # Ned-DoFs
+  // dofs_per_comp[2] = # Q1-DoFs
   n_u_dofs = dofs_per_comp[0];
   n_p_dofs = dofs_per_comp[2];
-       
+
 }
 
 
 template <int dim>
-void ImposeBC<dim>::test_extract_boundary_DoFs () 
-{      
-       
-  std::map<types::global_dof_index,double> boundary_values;    
-  std::vector<bool>    bc_component_select(dim + 1);
-        
-                                   // extract boundary DoFs for the Nedelec-component
-                                   // and impose zero boundary condition                                               
+void ImposeBC<dim>::test_extract_boundary_DoFs ()
+{
+
+  std::map<types::global_dof_index,double> boundary_values;
+  std::vector<bool>   bc_component_select(dim + 1);
+
+  // extract boundary DoFs for the Nedelec-component
+  // and impose zero boundary condition
   bc_component_select[0] = true;
   bc_component_select[1] = true;
   bc_component_select[2] = false;
-                       
+
   std::vector<bool> ned_boundary_dofs (dof_handler.n_dofs());
   std::set<types::boundary_id> boundary_indicators;
   boundary_indicators.insert (0);
-  DoFTools::extract_boundary_dofs (dof_handler, 
+  DoFTools::extract_boundary_dofs (dof_handler,
                                    bc_component_select,
                                    ned_boundary_dofs,
                                    boundary_indicators);
-                                                                  
-  
+
+
   for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
     if (ned_boundary_dofs[i] == true)
       boundary_values[i] = 0.;
 }
 
 
-                               
+
 template <int dim>
-void ImposeBC<dim>::test_interpolate_BC () 
-{      
-       
-  std::map<types::global_dof_index,double> boundary_values;    
-  std::vector<bool>    bc_component_select(dim + 1, false);
-  
-         
-                                   // impose inhomogeneous boundary condition
-                                   // on the scalar variable
+void ImposeBC<dim>::test_interpolate_BC ()
+{
+
+  std::map<types::global_dof_index,double> boundary_values;
+  std::vector<bool>   bc_component_select(dim + 1, false);
+
+
+  // impose inhomogeneous boundary condition
+  // on the scalar variable
   bc_component_select.back() = true;
-  
+
   VectorTools::interpolate_boundary_values (dof_handler,
                                             0,
                                             BoundaryFunction<dim>(),
                                             boundary_values,
                                             bc_component_select);
-                                                
-                                                
-       
-                                   // check 
-                                   // (the pressure is assumed to be set to 1
-                                   // on the boundary)                                  
+
+
+
+  // check
+  // (the pressure is assumed to be set to 1
+  // on the boundary)
   std::vector<bool> p_boundary_dofs (dof_handler.n_dofs());
   std::set<types::boundary_id> boundary_indicators;
   boundary_indicators.insert (0);
-  DoFTools::extract_boundary_dofs (dof_handler, 
+  DoFTools::extract_boundary_dofs (dof_handler,
                                    bc_component_select,
                                    p_boundary_dofs,
                                    boundary_indicators);
   for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
     {
-                                       // error: pressure boundary DoF
-                                       // i has not been set to the
-                                       // correct value
-                                       //
-                                       // or:
-                                       //
-                                       // nedelec boundary DoF i has
-                                       // wrongly been set to some
-                                       // value
+      // error: pressure boundary DoF
+      // i has not been set to the
+      // correct value
+      //
+      // or:
+      //
+      // nedelec boundary DoF i has
+      // wrongly been set to some
+      // value
       Assert ((p_boundary_dofs[i] && boundary_values[i] == 1.)
               ||
               (!(p_boundary_dofs[i])  && boundary_values[i] != 1.),
@@ -257,19 +257,19 @@ void ImposeBC<dim>::test_interpolate_BC ()
 
 
 template <int dim>
-void ImposeBC<dim>::run () 
-{ 
+void ImposeBC<dim>::run ()
+{
   GridGenerator::hyper_cube(triangulation, -1,1);
   triangulation.refine_global (1);
   triangulation.begin_active()->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
-  
+
   deallog << "   Number of active cells:       "
           << triangulation.n_active_cells()
           << std::endl;
-       
+
   get_ready ();
+
   deallog << "  Total number of degrees of freedom: "
           << dof_handler.n_dofs()
           << std::endl
@@ -281,19 +281,19 @@ void ImposeBC<dim>::run ()
           << std::endl;
 
   test_extract_boundary_DoFs ();
-  test_interpolate_BC ();  
+  test_interpolate_BC ();
 }
 
 
-int main () 
+int main ()
 {
   try
     {
       std::ofstream logfile("anna_6/output");
-      deallog << std::setprecision (2);      
+      deallog << std::setprecision (2);
       deallog.attach(logfile);
       deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);
+      deallog.threshold_double(1.e-10);
 
       ImposeBC<2>().run ();
       ImposeBC<3>().run ();
@@ -301,25 +301,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 
index 969b7b5540de4df46f2c1ec440d3625905682d10..b81211fca73a12c5228a61715491b9efa9d34e30 100644 (file)
@@ -43,33 +43,33 @@ template <int dim>
 void test ()
 {
   deallog << dim << "D" << std::endl;
-  
+
   Triangulation<dim> triangulation;
   GridGenerator::hyper_cube (triangulation);
 
-                                   // refine the mesh in a random way
+  // refine the mesh in a random way
   triangulation.refine_global (4-dim);
   for (unsigned int i=0; i<11-2*dim; ++i)
     {
       typename Triangulation<dim>::active_cell_iterator
-        cell = triangulation.begin_active();
+      cell = triangulation.begin_active();
       for (unsigned int index=0; cell != triangulation.end(); ++cell, ++index)
         if (index % (3*dim) == 0)
           cell->set_refine_flag();
       triangulation.execute_coarsening_and_refinement ();
     }
   deallog << "Number of cells: " << triangulation.n_active_cells() << std::endl;
-  
-                                   // set up a DoFHandler and compute hanging
-                                   // node constraints
+
+  // set up a DoFHandler and compute hanging
+  // node constraints
   FE_Q<dim> fe(1);
   DoFHandler<dim> dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
   deallog << "Number of dofs: " << dof_handler.n_dofs() << std::endl;
 
-                                   // then set up a sparsity pattern and two
-                                   // matrices on top of it. similar for two
-                                   // vectors
+  // then set up a sparsity pattern and two
+  // matrices on top of it. similar for two
+  // vectors
   SparsityPattern sparsity (dof_handler.n_dofs(),
                             dof_handler.n_dofs(),
                             dof_handler.max_couplings_between_dofs());
@@ -79,22 +79,22 @@ void test ()
   Vector<double> b1 (dof_handler.n_dofs());
   Vector<double> b2 (dof_handler.n_dofs());
 
-                                   // then fill the two matrices and vectors
-                                   // by setting up bogus matrix entries and
-                                   // (1) writing them into the matrix and
-                                   // applying boundary values later on, or
-                                   // (2) applying them right away
+  // then fill the two matrices and vectors
+  // by setting up bogus matrix entries and
+  // (1) writing them into the matrix and
+  // applying boundary values later on, or
+  // (2) applying them right away
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           ConstantFunction<dim>(1.),
-                                           boundary_values);
-  
+                                            0,
+                                            ConstantFunction<dim>(1.),
+                                            boundary_values);
+
   std::vector<types::global_dof_index> local_dofs (fe.dofs_per_cell);
   FullMatrix<double> local_matrix (fe.dofs_per_cell, fe.dofs_per_cell);
   Vector<double> local_vector (fe.dofs_per_cell);
   for (typename DoFHandler<dim>::active_cell_iterator
-         cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell != dof_handler.end(); ++cell)
     {
       cell->get_dof_indices (local_dofs);
@@ -105,15 +105,15 @@ void test ()
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
         local_vector(i) = (i+1.)*(local_dofs[i]+1.);
 
-                                       // copy local to global by ourselves
+      // copy local to global by ourselves
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
         for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
           A.add (local_dofs[i], local_dofs[j], local_matrix(i,j));
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
         b1(local_dofs[i]) += local_vector(i);
 
-                                       // or let other functions do that after
-                                       // removing boundary values
+      // or let other functions do that after
+      // removing boundary values
       MatrixTools::local_apply_boundary_values (boundary_values, local_dofs,
                                                 local_matrix, local_vector,
                                                 false);
@@ -121,19 +121,19 @@ void test ()
       cell->distribute_local_to_global (local_vector, b2);
     }
 
-                                   // for A, remove boundary values only now.
+  // for A, remove boundary values only now.
   Vector<double> x (dof_handler.n_dofs());
   MatrixTools::apply_boundary_values (boundary_values, A, x, b1, false);
-  
-                                   // now comes the check: we subtract B from
-                                   // A, and make sure that the result is zero
+
+  // now comes the check: we subtract B from
+  // A, and make sure that the result is zero
   A.add (-1., B);
   deallog << "|A|=" << A.frobenius_norm() << std::endl;
   deallog << "|B|=" << B.frobenius_norm() << std::endl;
   Assert (A.frobenius_norm() < 1e-12*B.frobenius_norm(),
           ExcInternalError());
 
-                                   // similar for b1 and b2
+  // similar for b1 and b2
   b1 -= b2;
   deallog << "|b1|=" << b1.l2_norm() << std::endl;
   deallog << "|b2|=" << b2.l2_norm() << std::endl;
@@ -159,25 +159,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index a95d1be133d3e30542a5f9a3eb9febb78a60ad8a..8bb84ccfd8f629702b0691f37bada82d35cc6fff 100644 (file)
@@ -43,33 +43,33 @@ template <int dim>
 void test ()
 {
   deallog << dim << "D" << std::endl;
-  
+
   Triangulation<dim> triangulation;
   GridGenerator::hyper_cube (triangulation);
 
-                                   // refine the mesh in a random way
+  // refine the mesh in a random way
   triangulation.refine_global (4-dim);
   for (unsigned int i=0; i<11-2*dim; ++i)
     {
       typename Triangulation<dim>::active_cell_iterator
-        cell = triangulation.begin_active();
+      cell = triangulation.begin_active();
       for (unsigned int index=0; cell != triangulation.end(); ++cell, ++index)
         if (index % (3*dim) == 0)
           cell->set_refine_flag();
       triangulation.execute_coarsening_and_refinement ();
     }
   deallog << "Number of cells: " << triangulation.n_active_cells() << std::endl;
-  
-                                   // set up a DoFHandler and compute hanging
-                                   // node constraints
+
+  // set up a DoFHandler and compute hanging
+  // node constraints
   FE_Q<dim> fe(1);
   DoFHandler<dim> dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
   deallog << "Number of dofs: " << dof_handler.n_dofs() << std::endl;
 
-                                   // then set up a sparsity pattern and two
-                                   // matrices on top of it. similar for two
-                                   // vectors
+  // then set up a sparsity pattern and two
+  // matrices on top of it. similar for two
+  // vectors
   SparsityPattern sparsity (dof_handler.n_dofs(),
                             dof_handler.n_dofs(),
                             dof_handler.max_couplings_between_dofs());
@@ -79,22 +79,22 @@ void test ()
   Vector<double> b1 (dof_handler.n_dofs());
   Vector<double> b2 (dof_handler.n_dofs());
 
-                                   // then fill the two matrices and vectors
-                                   // by setting up bogus matrix entries and
-                                   // (1) writing them into the matrix and
-                                   // applying boundary values later on, or
-                                   // (2) applying them right away
+  // then fill the two matrices and vectors
+  // by setting up bogus matrix entries and
+  // (1) writing them into the matrix and
+  // applying boundary values later on, or
+  // (2) applying them right away
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           ConstantFunction<dim>(1.),
-                                           boundary_values);
-  
+                                            0,
+                                            ConstantFunction<dim>(1.),
+                                            boundary_values);
+
   std::vector<types::global_dof_index> local_dofs (fe.dofs_per_cell);
   FullMatrix<double> local_matrix (fe.dofs_per_cell, fe.dofs_per_cell);
   Vector<double> local_vector (fe.dofs_per_cell);
   for (typename DoFHandler<dim>::active_cell_iterator
-         cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell != dof_handler.end(); ++cell)
     {
       cell->get_dof_indices (local_dofs);
@@ -105,15 +105,15 @@ void test ()
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
         local_vector(i) = (i+1.)*(local_dofs[i]+1.);
 
-                                       // copy local to global by ourselves
+      // copy local to global by ourselves
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
         for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
           A.add (local_dofs[i], local_dofs[j], local_matrix(i,j));
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
         b1(local_dofs[i]) += local_vector(i);
 
-                                       // or let other functions do that after
-                                       // removing boundary values
+      // or let other functions do that after
+      // removing boundary values
       MatrixTools::local_apply_boundary_values (boundary_values, local_dofs,
                                                 local_matrix, local_vector,
                                                 true);
@@ -121,19 +121,19 @@ void test ()
       cell->distribute_local_to_global (local_vector, b2);
     }
 
-                                   // for A, remove boundary values only now.
+  // for A, remove boundary values only now.
   Vector<double> x (dof_handler.n_dofs());
   MatrixTools::apply_boundary_values (boundary_values, A, x, b1, true);
-  
-                                   // now comes the check: we subtract B from
-                                   // A, and make sure that the result is zero
+
+  // now comes the check: we subtract B from
+  // A, and make sure that the result is zero
   A.add (-1., B);
   deallog << "|A|=" << A.frobenius_norm() << std::endl;
   deallog << "|B|=" << B.frobenius_norm() << std::endl;
   Assert (A.frobenius_norm() < 1e-12*B.frobenius_norm(),
           ExcInternalError());
 
-                                   // similar for b1 and b2
+  // similar for b1 and b2
   b1 -= b2;
   deallog << "|b1|=" << b1.l2_norm() << std::endl;
   deallog << "|b2|=" << b2.l2_norm() << std::endl;
@@ -159,25 +159,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 898e5fac0c6e8e120403ec109c37f5e1f2fbe98d..5671fc4a801bdee9a5a5a2c5785d27db3ea773fe 100644 (file)
@@ -51,11 +51,11 @@ void test ()
   Vector<double> b1 (N);
   Vector<double> b2 (N);
 
-                                   // then fill the two matrices and vectors
-                                   // by setting up bogus matrix entries and
-                                   // (1) writing them into the matrix and
-                                   // applying boundary values later on, or
-                                   // (2) applying them right away
+  // then fill the two matrices and vectors
+  // by setting up bogus matrix entries and
+  // (1) writing them into the matrix and
+  // applying boundary values later on, or
+  // (2) applying them right away
   std::map<types::global_dof_index,double> boundary_values;
   boundary_values[N/2] = 42;
 
@@ -63,37 +63,37 @@ void test ()
   std::vector<types::global_dof_index> local_dofs (N);
   FullMatrix<double> local_matrix (N,N);
   Vector<double> local_vector (N);
-    {
-      for (unsigned int i=0; i<N; ++i)
-       local_dofs[i] = i;
-
-      local_matrix = 0;
-      for (unsigned int i=0; i<N; ++i)
-        for (unsigned int j=0; j<N; ++j)
-          local_matrix(i,j) = i*N+j;
-      for (unsigned int i=0; i<N; ++i)
-        local_vector(i) = i+1;
-
-      // copy local to global by ourselves
-      for (unsigned int i=0; i<N; ++i)
-        for (unsigned int j=0; j<N; ++j)
-          A.add (local_dofs[i], local_dofs[j], local_matrix(i,j));
-      for (unsigned int i=0; i<N; ++i)
-        b1(local_dofs[i]) += local_vector(i);
-
-                                       // or let other functions do that after
-                                       // removing boundary values
-      MatrixTools::local_apply_boundary_values (boundary_values, local_dofs,
-                                                local_matrix, local_vector,
-                                                false);
-      for (unsigned int i=0; i<N; ++i)
-        for (unsigned int j=0; j<N; ++j)
-          B.add (local_dofs[i], local_dofs[j], local_matrix(i,j));
-      for (unsigned int i=0; i<N; ++i)
-        b2(local_dofs[i]) += local_vector(i);
-    }
-
-                                   // for A, remove boundary values only now.
+  {
+    for (unsigned int i=0; i<N; ++i)
+      local_dofs[i] = i;
+
+    local_matrix = 0;
+    for (unsigned int i=0; i<N; ++i)
+      for (unsigned int j=0; j<N; ++j)
+        local_matrix(i,j) = i*N+j;
+    for (unsigned int i=0; i<N; ++i)
+      local_vector(i) = i+1;
+
+    // copy local to global by ourselves
+    for (unsigned int i=0; i<N; ++i)
+      for (unsigned int j=0; j<N; ++j)
+        A.add (local_dofs[i], local_dofs[j], local_matrix(i,j));
+    for (unsigned int i=0; i<N; ++i)
+      b1(local_dofs[i]) += local_vector(i);
+
+    // or let other functions do that after
+    // removing boundary values
+    MatrixTools::local_apply_boundary_values (boundary_values, local_dofs,
+                                              local_matrix, local_vector,
+                                              false);
+    for (unsigned int i=0; i<N; ++i)
+      for (unsigned int j=0; j<N; ++j)
+        B.add (local_dofs[i], local_dofs[j], local_matrix(i,j));
+    for (unsigned int i=0; i<N; ++i)
+      b2(local_dofs[i]) += local_vector(i);
+  }
+
+  // for A, remove boundary values only now.
   Vector<double> x (N);
   MatrixTools::apply_boundary_values (boundary_values, A, x, b1, false);
 
@@ -107,15 +107,15 @@ void test ()
   deallog << "b2=" << std::endl;
   b2.print (deallog.get_file_stream());
 
-                                   // now comes the check: we subtract B from
-                                   // A, and make sure that the result is zero
+  // now comes the check: we subtract B from
+  // A, and make sure that the result is zero
   A.add (-1., B);
   deallog << "|A|=" << A.frobenius_norm() << std::endl;
   deallog << "|B|=" << B.frobenius_norm() << std::endl;
   Assert (A.frobenius_norm() < 1e-12*B.frobenius_norm(),
           ExcInternalError());
 
-                                   // similar for b1 and b2
+  // similar for b1 and b2
   b1 -= b2;
   deallog << "|b1|=" << b1.l2_norm() << std::endl;
   deallog << "|b2|=" << b2.l2_norm() << std::endl;
@@ -139,25 +139,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index ec690364aed56f516f4ec5c0468688907b18a4ff..a8ce85e5cc6fe2977930d90bee5b4cb50188ad1d 100644 (file)
@@ -51,11 +51,11 @@ void test ()
   Vector<double> b1 (N);
   Vector<double> b2 (N);
 
-                                   // then fill the two matrices and vectors
-                                   // by setting up bogus matrix entries and
-                                   // (1) writing them into the matrix and
-                                   // applying boundary values later on, or
-                                   // (2) applying them right away
+  // then fill the two matrices and vectors
+  // by setting up bogus matrix entries and
+  // (1) writing them into the matrix and
+  // applying boundary values later on, or
+  // (2) applying them right away
   std::map<types::global_dof_index,double> boundary_values;
   boundary_values[N/2] = 42;
 
@@ -63,37 +63,37 @@ void test ()
   std::vector<types::global_dof_index> local_dofs (N);
   FullMatrix<double> local_matrix (N,N);
   Vector<double> local_vector (N);
-    {
-      for (unsigned int i=0; i<N; ++i)
-             local_dofs[i] = i;
-
-      local_matrix = 0;
-      for (unsigned int i=0; i<N; ++i)
-        for (unsigned int j=0; j<N; ++j)
-          local_matrix(i,j) = i*N+j;
-      for (unsigned int i=0; i<N; ++i)
-        local_vector(i) = i+1;
-
-      // copy local to global by ourselves
-      for (unsigned int i=0; i<N; ++i)
-        for (unsigned int j=0; j<N; ++j)
-          A.add (local_dofs[i], local_dofs[j], local_matrix(i,j));
-      for (unsigned int i=0; i<N; ++i)
-        b1(local_dofs[i]) += local_vector(i);
-
-                                       // or let other functions do that after
-                                       // removing boundary values
-      MatrixTools::local_apply_boundary_values (boundary_values, local_dofs,
-                                                local_matrix, local_vector,
-                                                true);
-      for (unsigned int i=0; i<N; ++i)
-        for (unsigned int j=0; j<N; ++j)
-          B.add (local_dofs[i], local_dofs[j], local_matrix(i,j));
-      for (unsigned int i=0; i<N; ++i)
-        b2(local_dofs[i]) += local_vector(i);
-    }
-
-                                   // for A, remove boundary values only now.
+  {
+    for (unsigned int i=0; i<N; ++i)
+      local_dofs[i] = i;
+
+    local_matrix = 0;
+    for (unsigned int i=0; i<N; ++i)
+      for (unsigned int j=0; j<N; ++j)
+        local_matrix(i,j) = i*N+j;
+    for (unsigned int i=0; i<N; ++i)
+      local_vector(i) = i+1;
+
+    // copy local to global by ourselves
+    for (unsigned int i=0; i<N; ++i)
+      for (unsigned int j=0; j<N; ++j)
+        A.add (local_dofs[i], local_dofs[j], local_matrix(i,j));
+    for (unsigned int i=0; i<N; ++i)
+      b1(local_dofs[i]) += local_vector(i);
+
+    // or let other functions do that after
+    // removing boundary values
+    MatrixTools::local_apply_boundary_values (boundary_values, local_dofs,
+                                              local_matrix, local_vector,
+                                              true);
+    for (unsigned int i=0; i<N; ++i)
+      for (unsigned int j=0; j<N; ++j)
+        B.add (local_dofs[i], local_dofs[j], local_matrix(i,j));
+    for (unsigned int i=0; i<N; ++i)
+      b2(local_dofs[i]) += local_vector(i);
+  }
+
+  // for A, remove boundary values only now.
   Vector<double> x (N);
   MatrixTools::apply_boundary_values (boundary_values, A, x, b1, true);
 
@@ -107,15 +107,15 @@ void test ()
   deallog << "b2=" << std::endl;
   b2.print (deallog.get_file_stream());
 
-                                   // now comes the check: we subtract B from
-                                   // A, and make sure that the result is zero
+  // now comes the check: we subtract B from
+  // A, and make sure that the result is zero
   A.add (-1., B);
   deallog << "|A|=" << A.frobenius_norm() << std::endl;
   deallog << "|B|=" << B.frobenius_norm() << std::endl;
   Assert (A.frobenius_norm() < 1e-12*B.frobenius_norm(),
           ExcInternalError());
 
-                                   // similar for b1 and b2
+  // similar for b1 and b2
   b1 -= b2;
   deallog << "|b1|=" << b1.l2_norm() << std::endl;
   deallog << "|b2|=" << b2.l2_norm() << std::endl;
@@ -139,25 +139,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index a7d394df541c07d29321c788330d1ca797618596..1650cf076a35f2cb4607e34c0776fc64aa6bed7f 100644 (file)
@@ -27,7 +27,7 @@
 #include <fstream>
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("block_matrix_array_01/output");
   deallog.attach(logfile);
@@ -39,9 +39,9 @@ int main ()
   FullMatrix<double> B(4,3);
   FullMatrix<double> C(3,3);
   PrimitiveVectorMemory<Vector<double> > mem;
-  
+
   BlockMatrixArray<double> block(2,2,mem);
-  
+
   block.enter(A1,0,0);
   block.enter(A2,0,0,2,true);
   block.enter(B,0,1,-3.);
@@ -49,6 +49,6 @@ int main ()
   block.enter(C,1,1,1.,true);
 
   block.print_latex(deallog);
-  
+
   return 0;
 }
index 8a0608fe503a0e05599989916438e4a6ef0d5d3f..1efd87b56f0cb36a73e26f8ab4ee4ed28c839cf2 100644 (file)
@@ -60,51 +60,51 @@ int main()
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  Triangulation<2> tria;  
+  Triangulation<2> tria;
   GridGenerator::hyper_cube (tria,0,1);
   tria.refine_global (1);
 
   FE_Q_Hierarchical<2> fe (1);
   DoFHandler<2> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
-    
+
   BlockSparsityPattern sparsity_pattern;
   sparsity_pattern.reinit (2,2);
   sparsity_pattern.collect_sizes ();
-  
+
   sparsity_pattern.block(0,0).reinit (dof_handler.n_dofs(),
-                                     dof_handler.n_dofs(),
-                                     dof_handler.max_couplings_between_dofs());
+                                      dof_handler.n_dofs(),
+                                      dof_handler.max_couplings_between_dofs());
   sparsity_pattern.block(0,1).reinit (dof_handler.n_dofs(),
-                                     1,
-                                     1);
+                                      1,
+                                      1);
   sparsity_pattern.block(1,0).reinit (1,
-                                     dof_handler.n_dofs(),
-                                     dof_handler.n_dofs());
+                                      dof_handler.n_dofs(),
+                                      dof_handler.n_dofs());
   sparsity_pattern.block(1,1).reinit (1,
-                                     1,
-                                     1);
+                                      1,
+                                      1);
   sparsity_pattern.collect_sizes ();
-  
+
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern.block(0,0));
-  
+
   for (unsigned int j=0; j<dof_handler.n_dofs (); ++j)
-  {
-    sparsity_pattern.block(0,1).add (j,0);
-    sparsity_pattern.block(1,0).add (0,j);
-  }
+    {
+      sparsity_pattern.block(0,1).add (j,0);
+      sparsity_pattern.block(1,0).add (0,j);
+    }
   sparsity_pattern.block(1,1).add (0,0);
   sparsity_pattern.compress ();
-  
+
   BlockSparseMatrix<double> B;
-  B.reinit (sparsity_pattern);  
-  
-  QGauss<2> qr (2); 
-  FEValues<2> fe_values (dof_handler.get_fe(), 
-                        qr, UpdateFlags(update_values    |
-                                        update_gradients |
-                                        update_q_points  |
-                                        update_JxW_values));
+  B.reinit (sparsity_pattern);
+
+  QGauss<2> qr (2);
+  FEValues<2> fe_values (dof_handler.get_fe(),
+                         qr, UpdateFlags(update_values    |
+                                         update_gradients |
+                                         update_q_points  |
+                                         update_JxW_values));
 
   MatrixTools::create_laplace_matrix (dof_handler, qr, B.block(0,0));
   B.block(1,1).add (0,0,1.);
@@ -113,17 +113,17 @@ int main()
 
   B.block(0,0) *= 10.;
   B.print_formatted (deallog.get_file_stream (),3,false);
-  
+
   B *= 10.;
   B.print_formatted (deallog.get_file_stream (),3,false);
-  
+
   B /= 10.;
   B.print_formatted (deallog.get_file_stream (),3,false);
-  
+
   B.block(0,0) /= 10.;
   B.print_formatted (deallog.get_file_stream (),3,false);
 
   B = 0;
-  
+
   return 0;
 }
index 9829220e7bda45e8b89ac0955700e54ed94b27f2..fa480ac96dd544ff27ae12571e345254024668aa 100644 (file)
@@ -40,46 +40,46 @@ int main()
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  Triangulation<2> tria;  
+  Triangulation<2> tria;
   GridGenerator::hyper_cube (tria,0,1);
   tria.refine_global (1);
 
   FE_Q_Hierarchical<2> fe (1);
   DoFHandler<2> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
-    
+
   BlockSparsityPattern sparsity_pattern;
   sparsity_pattern.reinit (2,2);
   sparsity_pattern.collect_sizes ();
-  
+
   sparsity_pattern.block(0,0).reinit (dof_handler.n_dofs(),
-                                     dof_handler.n_dofs(),
-                                     dof_handler.max_couplings_between_dofs());
+                                      dof_handler.n_dofs(),
+                                      dof_handler.max_couplings_between_dofs());
   sparsity_pattern.block(0,1).reinit (dof_handler.n_dofs(),
-                                     1,
-                                     1);
+                                      1,
+                                      1);
   sparsity_pattern.block(1,0).reinit (1,
-                                     dof_handler.n_dofs(),
-                                     dof_handler.n_dofs());
+                                      dof_handler.n_dofs(),
+                                      dof_handler.n_dofs());
   sparsity_pattern.block(1,1).reinit (1,
-                                     1,
-                                     1);
+                                      1,
+                                      1);
   sparsity_pattern.collect_sizes ();
-  
+
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern.block(0,0));
-  
+
   for (unsigned int j=0; j<dof_handler.n_dofs (); ++j)
-  {
-    sparsity_pattern.block(0,1).add (j,0);
-    sparsity_pattern.block(1,0).add (0,j);
-  }
+    {
+      sparsity_pattern.block(0,1).add (j,0);
+      sparsity_pattern.block(1,0).add (0,j);
+    }
   sparsity_pattern.block(1,1).add (0,0);
   sparsity_pattern.compress ();
-  
+
   BlockSparseMatrix<double> B;
-  B.reinit (sparsity_pattern);  
+  B.reinit (sparsity_pattern);
 
-                                   // check some sizes
+  // check some sizes
   Assert (B.m() == B.block(0,0).m() + B.block(1,1).m(),
           ExcInternalError());
   Assert (B.n() == B.block(0,0).n() + B.block(1,1).n(),
@@ -87,7 +87,7 @@ int main()
   Assert (B.n_block_rows() == 2, ExcInternalError());
   Assert (B.n_block_cols() == 2, ExcInternalError());
 
-                                   // then clear, and check again
+  // then clear, and check again
   B.clear ();
   Assert (B.m() == 0, ExcInternalError());
   Assert (B.n() == 0, ExcInternalError());
@@ -95,6 +95,6 @@ int main()
   Assert (B.n_block_cols() == 0, ExcInternalError());
 
   deallog << "OK" << std::endl;
-  
+
   return 0;
 }
index 7306d3f00110e1dba5e316d259246882cdec5e39..79dd72bbc32cc179d9fa924d136519e066eeb70a 100644 (file)
@@ -40,25 +40,25 @@ template <int dim>
 void test ()
 {
   deallog << dim << "D" << std::endl;
-  
+
   Triangulation<dim> triangulation;
   GridGenerator::hyper_cube (triangulation);
 
-                                   // refine once, then refine first cell to
-                                   // create hanging nodes
+  // refine once, then refine first cell to
+  // create hanging nodes
   triangulation.refine_global (1);
   triangulation.execute_coarsening_and_refinement ();
   deallog << "Number of cells: " << triangulation.n_active_cells() << std::endl;
-  
-                                   // set up a DoFHandler and compute hanging
-                                   // node constraints for a Q2 element
+
+  // set up a DoFHandler and compute hanging
+  // node constraints for a Q2 element
   FE_Q<dim> fe(1);
   DoFHandler<dim> dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
   deallog << "Number of dofs: " << dof_handler.n_dofs() << std::endl;
 
-                                   // then set up a sparsity pattern and a
-                                   // matrix on top of it
+  // then set up a sparsity pattern and a
+  // matrix on top of it
   std::vector<unsigned int> block_sizes(2);
   block_sizes[0] = dof_handler.n_dofs()/3;
   block_sizes[1] = dof_handler.n_dofs() - block_sizes[0];
@@ -69,14 +69,14 @@ void test ()
       sparsity.block(i,j).reinit (block_sizes[i], block_sizes[j],
                                   dof_handler.max_couplings_between_dofs());
   sparsity.collect_sizes();
-  
+
   DoFTools::make_sparsity_pattern (dof_handler, sparsity);
   sparsity.compress ();
   BlockSparseMatrix<double> A(sparsity);
 
-                                   // and output what we have. first for the
-                                   // individual blocks, and later for all
-                                   // together (which yielded an abort)
+  // and output what we have. first for the
+  // individual blocks, and later for all
+  // together (which yielded an abort)
   deallog << "Blockwise output" << std::endl;
   for (unsigned int i=0; i<2; ++i)
     for (unsigned int j=0; j<2; ++j)
@@ -109,25 +109,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 9964144fb3fc09c3892493c2afaeb1545bcd9dc5..54dfc93b8ec3277a04a98c4781c5b12cc93b5970 100644 (file)
 void test ()
 {
   const int dim = 2;
-  
+
   Triangulation<dim> triangulation;
   GridGenerator::hyper_cube (triangulation);
 
-                                   // refine once, then refine first cell to
-                                   // create hanging nodes
+  // refine once, then refine first cell to
+  // create hanging nodes
   triangulation.refine_global (1);
   triangulation.execute_coarsening_and_refinement ();
   deallog << "Number of cells: " << triangulation.n_active_cells() << std::endl;
-  
-                                   // set up a DoFHandler and compute hanging
-                                   // node constraints for a Q2 element
+
+  // set up a DoFHandler and compute hanging
+  // node constraints for a Q2 element
   FE_Q<dim> fe(1);
   DoFHandler<dim> dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
   deallog << "Number of dofs: " << dof_handler.n_dofs() << std::endl;
 
-                                   // then set up a sparsity pattern and a
-                                   // matrix on top of it
+  // then set up a sparsity pattern and a
+  // matrix on top of it
   std::vector<unsigned int> block_sizes(2);
   block_sizes[0] = dof_handler.n_dofs()/3;
   block_sizes[1] = dof_handler.n_dofs() - block_sizes[0];
@@ -69,21 +69,21 @@ void test ()
       sparsity.block(i,j).reinit (block_sizes[i], block_sizes[j],
                                   dof_handler.max_couplings_between_dofs());
   sparsity.collect_sizes();
-  
+
   DoFTools::make_sparsity_pattern (dof_handler, sparsity);
   sparsity.compress ();
   BlockSparseMatrix<double> A(sparsity);
 
   const BlockSparseMatrix<double>::const_iterator
-    begin = A.begin(),
-    end = A.end();
+  begin = A.begin(),
+  end = A.end();
 
   deallog << begin->row() << ' '
           << begin->column() << ' ' << begin->block_row() << ' '
           << begin->block_column()
           << std::endl;
 
-                                   // this matrix certainly has entries
+  // this matrix certainly has entries
   Assert (begin != end, ExcInternalError());
   deallog << "OK" << std::endl;
 }
@@ -104,25 +104,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 4ca9dd68cbd61f4a2ffd9467d8e4f77e5e556fe5..5107ccf41fc106e00b400bd8a165d2712f805b67 100644 (file)
 void test ()
 {
   const int dim = 2;
-  
+
   Triangulation<dim> triangulation;
   GridGenerator::hyper_cube (triangulation);
 
-                                   // refine once, then refine first cell to
-                                   // create hanging nodes
+  // refine once, then refine first cell to
+  // create hanging nodes
   triangulation.refine_global (1);
   triangulation.execute_coarsening_and_refinement ();
   deallog << "Number of cells: " << triangulation.n_active_cells() << std::endl;
-  
-                                   // set up a DoFHandler and compute hanging
-                                   // node constraints for a Q2 element
+
+  // set up a DoFHandler and compute hanging
+  // node constraints for a Q2 element
   FE_Q<dim> fe(1);
   DoFHandler<dim> dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
   deallog << "Number of dofs: " << dof_handler.n_dofs() << std::endl;
 
-                                   // then set up a sparsity pattern and a
-                                   // matrix on top of it
+  // then set up a sparsity pattern and a
+  // matrix on top of it
   std::vector<unsigned int> block_sizes(2);
   block_sizes[0] = dof_handler.n_dofs()/3;
   block_sizes[1] = dof_handler.n_dofs() - block_sizes[0];
@@ -68,21 +68,21 @@ void test ()
       sparsity.block(i,j).reinit (block_sizes[i], block_sizes[j],
                                   dof_handler.max_couplings_between_dofs());
   sparsity.collect_sizes();
-  
+
   DoFTools::make_sparsity_pattern (dof_handler, sparsity);
   sparsity.compress ();
   BlockSparseMatrix<double> A(sparsity);
 
   const BlockSparseMatrix<double>::const_iterator
-    begin = A.begin(),
-    end = A.end();
+  begin = A.begin(),
+  end = A.end();
 
   deallog << begin->row() << ' '
           << begin->column() << ' ' << begin->block_row() << ' '
           << begin->block_column()
           << std::endl;
 
-                                   // this matrix certainly has entries
+  // this matrix certainly has entries
   Assert (begin != end, ExcInternalError());
   deallog << "OK" << std::endl;
 }
@@ -103,25 +103,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 7204b9b7b5c2cd285c501e97aeace3002336b94c..d0ad31c827f1139a0793bc75320ff62f9e6e8d34 100644 (file)
@@ -38,17 +38,17 @@ void test ()
 
   BlockSparseMatrix<double> m(bsp);
 
-                                   // advance it to the end of the matrix
+  // advance it to the end of the matrix
   BlockSparseMatrix<double>::const_iterator it = m.begin();
   for (unsigned int i=0; i<4; ++i)
     ++it;
 
-                                   // now also get an end iterator
+  // now also get an end iterator
   BlockSparseMatrix<double>::const_iterator it2 = m.end();
 
-                                   // make sure that the two of them match
+  // make sure that the two of them match
   Assert (it == it2, ExcInternalError());
-   
+
   deallog << "OK" << std::endl;
 }
 
@@ -68,25 +68,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index d83eb968bc22aa01ac4565f28a17d3eb99c8779e..0a816606317d0a8b04bc1083ff1d24eee3b52fbe 100644 (file)
 
 void test ()
 {
-                                   // create a 1x2 block matrix with
-                                   // non-quadratic blocks so as to make them
-                                   // not specially store the diagonal
+  // create a 1x2 block matrix with
+  // non-quadratic blocks so as to make them
+  // not specially store the diagonal
   BlockSparsityPattern bsp (1,2);
   for (unsigned int j=0; j<2; ++j)
     bsp.block(0,j).reinit (3,2,1);
   bsp.collect_sizes ();
 
-                                   // leave row 0 of block 0,0 empty, but have
-                                   // something in this row for block 0,1
+  // leave row 0 of block 0,0 empty, but have
+  // something in this row for block 0,1
   bsp.block(0,0).add (1,0);
-  bsp.block(0,1).add (0,0);  
+  bsp.block(0,1).add (0,0);
   bsp.compress ();
 
   BlockSparseMatrix<double> m(bsp);
 
-                                   // get the start iterator. it should point
-                                   // to the first element of the first row,
-                                   // which happens to be in block 0,1
+  // get the start iterator. it should point
+  // to the first element of the first row,
+  // which happens to be in block 0,1
   BlockSparseMatrix<double>::const_iterator it = m.begin();
 
   deallog << it->row() << ' '
@@ -59,14 +59,14 @@ void test ()
   Assert (it->column() == 2, ExcInternalError());
   Assert (it->block_row() == 0, ExcInternalError());
   Assert (it->block_column() == 1, ExcInternalError());
-  
-                                   // now advance by two (the only two
-                                   // elements of the matrix) and make sure
-                                   // that we equal the end iterator
+
+  // now advance by two (the only two
+  // elements of the matrix) and make sure
+  // that we equal the end iterator
   ++it;
   ++it;
   Assert (it == m.end(), ExcInternalError());
-   
+
   deallog << "OK" << std::endl;
 }
 
@@ -86,25 +86,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 5c855dae379d69a838889ce40923e6afe86c3bc5..fad4c937a33bc31e30d1e90a4b438ff39cc59087 100644 (file)
@@ -30,8 +30,8 @@ void test ()
   v(0) = 1;
   v(1) = 2;
 
-                                   // first check reading through a const
-                                   // iterator
+  // first check reading through a const
+  // iterator
   {
     BlockVector<double>::const_iterator i=v.begin();
     Assert (*i == 1, ExcInternalError());
@@ -39,17 +39,17 @@ void test ()
     Assert (*i == 2, ExcInternalError());
   }
 
-                                   // same, but create iterator in a different
-                                   // way
+  // same, but create iterator in a different
+  // way
   {
     BlockVector<double>::const_iterator
-      i=const_cast<const BlockVector<double>&>(v).begin();
+    i=const_cast<const BlockVector<double>&>(v).begin();
     Assert (*i == 1, ExcInternalError());
     ++i;
     Assert (*i == 2, ExcInternalError());
   }
 
-                                   // read through a read-write iterator
+  // read through a read-write iterator
   {
     BlockVector<double>::iterator i = v.begin();
     Assert (*i == 1, ExcInternalError());
@@ -57,23 +57,23 @@ void test ()
     Assert (*i == 2, ExcInternalError());
   }
 
-                                   // write through a read-write iterator
+  // write through a read-write iterator
   {
     BlockVector<double>::iterator i = v.begin();
 
     *i = 2;
     ++i;
     *i = 3;
-  }  
+  }
 
-                                   // and read again
+  // and read again
   {
     BlockVector<double>::iterator i = v.begin();
     Assert (*i == 2, ExcInternalError());
     ++i;
     Assert (*i == 3, ExcInternalError());
   }
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -93,25 +93,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 7e1d5faadc66a7b0213134177682d8abd9c32600..ab2982f40234be8747df05a6abd60152f781155a 100644 (file)
@@ -30,44 +30,44 @@ void test ()
   v(0) = 1;
   v(1) = 2;
 
-                                   // first check reading through a const
-                                   // iterator
+  // first check reading through a const
+  // iterator
   {
     BlockVector<double>::const_iterator i=v.begin();
     Assert (i[0] == 1, ExcInternalError());
     Assert (i[1] == 2, ExcInternalError());
   }
 
-                                   // same, but create iterator in a different
-                                   // way
+  // same, but create iterator in a different
+  // way
   {
     BlockVector<double>::const_iterator
-      i=const_cast<const BlockVector<double>&>(v).begin();
+    i=const_cast<const BlockVector<double>&>(v).begin();
     Assert (i[0] == 1, ExcInternalError());
     Assert (i[1] == 2, ExcInternalError());
   }
 
-                                   // read through a read-write iterator
+  // read through a read-write iterator
   {
     BlockVector<double>::iterator i = v.begin();
     Assert (i[0] == 1, ExcInternalError());
     Assert (i[1] == 2, ExcInternalError());
   }
 
-                                   // write through a read-write iterator
+  // write through a read-write iterator
   {
     BlockVector<double>::iterator i = v.begin();
     i[0] = 2;
     i[1] = 3;
-  }  
+  }
 
-                                   // and read again
+  // and read again
   {
     BlockVector<double>::iterator i = v.begin();
     Assert (i[0] == 2, ExcInternalError());
     Assert (i[1] == 3, ExcInternalError());
   }
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -87,25 +87,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 6af75c4a8334cc785e7a274fe437c5d2e6036050..b40212a7a82ebebee30ef0d18cbf0e21c96d314d 100644 (file)
@@ -23,7 +23,7 @@
 // now autoconf'ed.
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 
@@ -35,13 +35,13 @@ void test (Vector<double> &v)
   Vector<float> w(v);
 
   Assert (w==v, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("block_vector_vector_01/output");
   deallog.attach(logfile);
@@ -56,25 +56,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index a5dafce301860689d13380c327260d915bb71fa3..59204ba07c67fcc6793631dbafd0c8db1424f9c7 100644 (file)
@@ -40,61 +40,63 @@ namespace DoFToolsEx
 {
   /// transfers solution between differently refined grids
   template <int dim, class InVector, class OutVector>
-  void transfer(const DoFHandler<dim>& source_dof, const InVector& source_vector, const DoFHandler<dim>& target_dof, OutVector& target_vector);
+  void transfer(const DoFHandler<dim> &source_dof, const InVector &source_vector, const DoFHandler<dim> &target_dof, OutVector &target_vector);
 }
 
 /**
  * Detailed desc.
  * Does it make sense to have InVector and OutVector templates? Shouldn't just one Vector be enough?
- * 
+ *
  * @param
- * 
+ *
  */
 template <int dim, class InVector, class OutVector>
 void
-DoFToolsEx::transfer(const DoFHandler<dim>& source_dof, const InVector& source_vector, const DoFHandler<dim>& target_dof, OutVector& target_vector)
+DoFToolsEx::transfer(const DoFHandler<dim> &source_dof, const InVector &source_vector, const DoFHandler<dim> &target_dof, OutVector &target_vector)
 {
   // any sanity tests? Trias derived from same coarse grid?
-  
+
   // build mappings between the cells
   InterGridMap<DoFHandler<dim> > source2target, target2source;
   source2target.make_mapping(source_dof, target_dof);
   target2source.make_mapping(target_dof, source_dof);
-  
+
   // setup temporary vector
   InVector local_dofs(source_dof.get_fe().dofs_per_cell);
-  
+
   // iterate over all active source cells
   typedef typename DoFHandler<dim>::active_cell_iterator cell_iterator;
   cell_iterator cell = source_dof.begin_active(), endc = source_dof.end();
-  for(; cell != endc; ++cell)
-  {
-    if(cell->level() == source2target[cell]->level())
+  for (; cell != endc; ++cell)
     {
-      // cell has not been coarsend, but possibly been refined
-      cell->get_dof_values(source_vector, local_dofs);
-      source2target[cell]->set_dof_values_by_interpolation(local_dofs, target_vector);
+      if (cell->level() == source2target[cell]->level())
+        {
+          // cell has not been coarsend, but possibly been refined
+          cell->get_dof_values(source_vector, local_dofs);
+          source2target[cell]->set_dof_values_by_interpolation(local_dofs, target_vector);
+        }
+      else
+        {
+          // the source cell has been coarsened
+          Assert(cell->level() > source2target[cell]->level(), ExcInternalError());
+          target2source[ source2target[cell] ]->get_interpolated_dof_values(source_vector, local_dofs);
+          source2target[cell]->set_dof_values(local_dofs, target_vector);
+        }
     }
-    else
-    {
-      // the source cell has been coarsened
-      Assert(cell->level() > source2target[cell]->level(), ExcInternalError());
-      target2source[ source2target[cell] ]->get_interpolated_dof_values(source_vector, local_dofs);
-      source2target[cell]->set_dof_values(local_dofs, target_vector);
-    }
-  }
-  
+
   // handle hanging node constraints inside or outside of this function?
 }
 
 
 class TestFunction : public Function<2>
 {
-  public:
-    TestFunction() : Function<2>() {}
-    virtual double value(const Point<2> &p,
-           const unsigned int) const
-    { return std::sin(3.14159*p(0))*std::sin(3.14159*p(1)); }
+public:
+  TestFunction() : Function<2>() {}
+  virtual double value(const Point<2> &p,
+                       const unsigned int) const
+  {
+    return std::sin(3.14159*p(0))*std::sin(3.14159*p(1));
+  }
 };
 
 int main()
@@ -105,7 +107,7 @@ int main()
   deallog.threshold_double(1.e-10);
 
 
-                                   // build test-case trias
+  // build test-case trias
   Triangulation<2> tria;
   Triangulation<2> refined_tria;
   Triangulation<2> coarse_tria;
@@ -123,7 +125,7 @@ int main()
   Triangulation<2>::active_cell_iterator it = both_tria.begin_active();
   it->set_refine_flag();
   (++it)->set_refine_flag();
-  for(int i = 1; i < 8; ++i, ++it)
+  for (int i = 1; i < 8; ++i, ++it)
     ;
   it->set_coarsen_flag();
   (++it)->set_coarsen_flag();
@@ -133,7 +135,7 @@ int main()
 
   // finite element
   FE_Q<2> fe(1);
+
   // dof handlers
   DoFHandler<2> dof(tria), refined_dof(refined_tria), coarse_dof(coarse_tria), both_dof(both_tria);
   dof.distribute_dofs(fe);
@@ -148,18 +150,18 @@ int main()
 
   // setup solution vectors
   Vector<double> refined_sol(refined_dof.n_dofs()), coarse_sol(coarse_dof.n_dofs()), both_sol(both_dof.n_dofs());
-  
+
   // transfer solutions
   DoFToolsEx::transfer(dof, sol, refined_dof, refined_sol);
   DoFToolsEx::transfer(dof, sol, coarse_dof, coarse_sol);
   DoFToolsEx::transfer(dof, sol, both_dof, both_sol);
-  
+
   // handle hanging nodes
   ConstraintMatrix both_constraints;
   DoFTools::make_hanging_node_constraints(both_dof, both_constraints);
   both_constraints.close();
   both_constraints.distribute(both_sol);
-  
+
   // reference output using DataOut to create seperate files
   DataOut<2> data_out;
   data_out.attach_dof_handler(dof);
index b9051982bdabb3210f04358c8e54555d0a4e0662..a0d73999b24b221b535df7c967264a0a3522feab 100644 (file)
@@ -37,7 +37,7 @@ int main()
   Triangulation<2> tria;
   GridGenerator::hyper_cube(tria, 0, 1);
   FE_Q<2> fe(1);
+
   DoFHandler<2> dof(tria);
   dof.distribute_dofs(fe);
 
@@ -45,7 +45,7 @@ int main()
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
     sol(i) = i;
 
-                                   // test output using DataOutStack
+  // test output using DataOutStack
   DataOutStack<2> data_out_stack;
   data_out_stack.declare_data_vector("dof", DataOutStack<2>::dof_vector);
   data_out_stack.new_parameter_value(2.5,1.);
index d6969bcb9dea6cb00696fada14679aec468e1b3b..c3247ac9af53e44d85230fd722f3b342578cf018 100644 (file)
@@ -20,7 +20,7 @@
 // yield the same result for all chunk sizes, of course
 
 #include "../tests.h"
-#include <deal.II/lac/chunk_sparse_matrix.h>    
+#include <deal.II/lac/chunk_sparse_matrix.h>
 #include <fstream>
 #include <iomanip>
 
@@ -28,7 +28,7 @@
 void test (const unsigned int chunk_size)
 {
   deallog << "Chunk size = " << chunk_size << std::endl;
-  
+
   ChunkSparsityPattern sp (5,5,3,chunk_size,false);
   for (unsigned int i=0; i<5; ++i)
     for (unsigned int j=0; j<5; ++j)
@@ -37,19 +37,19 @@ void test (const unsigned int chunk_size)
   sp.compress ();
 
   ChunkSparseMatrix<double> m(sp);
-  
-                                   // first set a few entries
+
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
 
-                                   // then write them to the output stream
+  // then write them to the output stream
   for (unsigned int i=0; i<m.m(); ++i)
     {
       for (unsigned int j=0; j<m.n(); ++j)
-       deallog << std::setprecision(2) << std::fixed << std::setw(4)
-               << m.el(i,j) << ' ';
+        deallog << std::setprecision(2) << std::fixed << std::setw(4)
+                << m.el(i,j) << ' ';
 
       deallog << std::endl;
     }
@@ -68,32 +68,32 @@ int main ()
     {
       const unsigned int chunk_sizes[] = { 1, 2, 4, 5, 7 };
       for (unsigned int i=0;
-          i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
-          ++i)
-       test (chunk_sizes[i]);
+           i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
+           ++i)
+        test (chunk_sizes[i]);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index e32a10719ee05a225b429f5aa17a5a160a0d8cd0..58bad9a3093fee232844c1dd0718ebcb52e121be 100644 (file)
@@ -20,7 +20,7 @@
 // ChunkSparseMatrix::set()
 
 #include "../tests.h"
-#include <deal.II/lac/chunk_sparse_matrix.h>    
+#include <deal.II/lac/chunk_sparse_matrix.h>
 #include <fstream>
 #include <iomanip>
 
@@ -35,14 +35,14 @@ void test (const unsigned int chunk_size)
   sp.compress ();
 
   ChunkSparseMatrix<double> m(sp);
-  
-                                   // first set a few entries
+
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
 
-                                   // then make sure we retrieve the same ones
+  // then make sure we retrieve the same ones
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -71,32 +71,32 @@ int main ()
     {
       const unsigned int chunk_sizes[] = { 1, 2, 4, 5, 7 };
       for (unsigned int i=0;
-          i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
-          ++i)
-       test (chunk_sizes[i]);
+           i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
+           ++i)
+        test (chunk_sizes[i]);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 0653bc9c6c958eb628d084b3f6a7b6127e247faa..4cd43e787c535a149d7fe33a333e1b4884017aa9 100644 (file)
@@ -37,13 +37,13 @@ void test (const unsigned int chunk_size)
 
   ChunkSparseMatrix<double> m(sp);
 
-                                   // first set a few entries
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
 
-                                   // then make sure we retrieve the same ones
+  // then make sure we retrieve the same ones
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -53,21 +53,21 @@ void test (const unsigned int chunk_size)
         }
       else
         {
-                                          // reading elements not in the
-                                          // sparsity pattern should return
-                                          // zero
-         const double x = m.el(i,j);
-         Assert (x == 0, ExcInternalError());
-
-                                          // if this is a sparsity_pattern
-                                          // with chunk_size==1, then we need
-                                          // to get an exception if we access
-                                          // any other element. if
-                                          // chunk_size>1, then this isn't
-                                          // necessarily true. because the
-                                          // matrix is square, we may also
-                                          // always access the diagonal
-                                          // element
+          // reading elements not in the
+          // sparsity pattern should return
+          // zero
+          const double x = m.el(i,j);
+          Assert (x == 0, ExcInternalError());
+
+          // if this is a sparsity_pattern
+          // with chunk_size==1, then we need
+          // to get an exception if we access
+          // any other element. if
+          // chunk_size>1, then this isn't
+          // necessarily true. because the
+          // matrix is square, we may also
+          // always access the diagonal
+          // element
           bool exc_thrown = false;
           try
             {
@@ -78,7 +78,7 @@ void test (const unsigned int chunk_size)
               exc_thrown = true;
             }
           Assert ((exc_thrown == true) || (chunk_size > 1) || (i==j),
-                 ExcInternalError());
+                  ExcInternalError());
         }
 
   deallog << "OK" << std::endl;
@@ -97,32 +97,32 @@ int main ()
     {
       const unsigned int chunk_sizes[] = { 1, 2, 4, 5, 7 };
       for (unsigned int i=0;
-          i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
-          ++i)
-       test (chunk_sizes[i]);
+           i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
+           ++i)
+        test (chunk_sizes[i]);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 128b25bc4a2cb5c923d8bbad888f80997d4b994d..b13828122e96d4fd23e93bfca899aaf2b99c2e03 100644 (file)
@@ -20,7 +20,7 @@
 // ChunkSparseMatrix::add()
 
 #include "../tests.h"
-#include <deal.II/lac/chunk_sparse_matrix.h>    
+#include <deal.II/lac/chunk_sparse_matrix.h>
 #include <fstream>
 
 
@@ -35,13 +35,13 @@ void test (const unsigned int chunk_size)
 
   ChunkSparseMatrix<double> m(sp);
 
-                                   // first set a few entries
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.add (i,j, i*j*.5+.5);
 
-                                   // then make sure we retrieve the same ones
+  // then make sure we retrieve the same ones
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -70,32 +70,32 @@ int main ()
     {
       const unsigned int chunk_sizes[] = { 1, 2, 4, 5, 7 };
       for (unsigned int i=0;
-          i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
-          ++i)
-       test (chunk_sizes[i]);
+           i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
+           ++i)
+        test (chunk_sizes[i]);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index d103f244ad02f1844b9570ae103b2f60fdf6b639..2e3396d54e2d00e0e76d6ed9ea66012c7cb7184d 100644 (file)
@@ -22,7 +22,7 @@
 // problem with the deal.II matrices. worth checking anyway
 
 #include "../tests.h"
-#include <deal.II/lac/chunk_sparse_matrix.h>    
+#include <deal.II/lac/chunk_sparse_matrix.h>
 #include <fstream>
 
 
@@ -36,8 +36,8 @@ void test (const unsigned int chunk_size)
   sp.compress ();
 
   ChunkSparseMatrix<double> m(sp);
-  
-                                   // first set a few entries
+
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -47,8 +47,8 @@ void test (const unsigned int chunk_size)
           else
             m.add (i,j, i*j*.5+.5);
         }
-  
-                                   // then make sure we retrieve the same ones
+
+  // then make sure we retrieve the same ones
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -77,32 +77,32 @@ int main ()
     {
       const unsigned int chunk_sizes[] = { 1, 2, 4, 5, 7 };
       for (unsigned int i=0;
-          i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
-          ++i)
-       test (chunk_sizes[i]);
+           i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
+           ++i)
+        test (chunk_sizes[i]);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 1128a60408fead95387868bebb5bce1abbf846d9..ee1632225b7d3bf18e54e4441b2b3399d9c3b892 100644 (file)
@@ -25,7 +25,7 @@
 // get double the original value
 
 #include "../tests.h"
-#include <deal.II/lac/chunk_sparse_matrix.h>    
+#include <deal.II/lac/chunk_sparse_matrix.h>
 #include <fstream>
 
 
@@ -39,20 +39,20 @@ void test (const unsigned int chunk_size)
   sp.compress ();
 
   ChunkSparseMatrix<double> m(sp);
-  
-                                   // first set a few entries
+
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
-                                   // then add the same elements again
+  // then add the same elements again
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.add (i,j, i*j*.5+.5);
-  
-                                   // then make sure we retrieve the correct
-                                   // ones
+
+  // then make sure we retrieve the correct
+  // ones
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -81,32 +81,32 @@ int main ()
     {
       const unsigned int chunk_sizes[] = { 1, 2, 4, 5, 7 };
       for (unsigned int i=0;
-          i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
-          ++i)
-       test (chunk_sizes[i]);
+           i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
+           ++i)
+        test (chunk_sizes[i]);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 1be7ad8afeeb221c282912a829f8ac011f2132cd..1d3b715890ed86098711cbd969bd2f38093f9e3e 100644 (file)
@@ -25,7 +25,7 @@
 // get double the original value
 
 #include "../tests.h"
-#include <deal.II/lac/chunk_sparse_matrix.h>    
+#include <deal.II/lac/chunk_sparse_matrix.h>
 #include <fstream>
 
 
@@ -39,20 +39,20 @@ void test (const unsigned int chunk_size)
   sp.compress ();
 
   ChunkSparseMatrix<double> m(sp);
-  
-                                   // first set a few entries
+
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
-                                   // then add the same elements again
+  // then add the same elements again
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.add (i,j, i*j*.5+.5);
-  
-                                   // then make sure we retrieve the correct
-                                   // ones
+
+  // then make sure we retrieve the correct
+  // ones
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -81,32 +81,32 @@ int main ()
     {
       const unsigned int chunk_sizes[] = { 1, 2, 4, 5, 7 };
       for (unsigned int i=0;
-          i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
-          ++i)
-       test (chunk_sizes[i]);
+           i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
+           ++i)
+        test (chunk_sizes[i]);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 5906aadaf220ec371318500303fb5df12ac1cc86..bc5e8ab47c2c3d374937aa0f81cfab7fdd494e6b 100644 (file)
@@ -19,7 +19,7 @@
 // check querying matrix sizes
 
 #include "../tests.h"
-#include <deal.II/lac/chunk_sparse_matrix.h>    
+#include <deal.II/lac/chunk_sparse_matrix.h>
 #include <fstream>
 
 
@@ -33,7 +33,7 @@ void test (const unsigned int chunk_size)
   sp.compress ();
 
   ChunkSparseMatrix<double> m(sp);
-  
+
   Assert (m.m() == 5, ExcInternalError());
   Assert (m.n() == 5, ExcInternalError());
 
@@ -53,32 +53,32 @@ int main ()
     {
       const unsigned int chunk_sizes[] = { 1, 2, 4, 5, 7 };
       for (unsigned int i=0;
-          i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
-          ++i)
-       test (chunk_sizes[i]);
+           i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
+           ++i)
+        test (chunk_sizes[i]);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 63130e68760424effaa4385e87b0d87ac7efdd27..0bdafb3426364b8f843a93c28f3ba0dbf5c5ad26 100644 (file)
@@ -20,7 +20,7 @@
 // ChunkSparseMatrix
 
 #include "../tests.h"
-#include <deal.II/lac/chunk_sparse_matrix.h>    
+#include <deal.II/lac/chunk_sparse_matrix.h>
 #include <fstream>
 
 
@@ -34,13 +34,13 @@ void test (const unsigned int chunk_size)
   sp.compress ();
 
   ChunkSparseMatrix<double> m(sp);
-  
-                                   // first set a few entries. count how many
-                                   // entries we have. note that for square
-                                   // matrices we also always store the
-                                   // diagonal element, so add one per row,
-                                   // but don't count it when traversing the
-                                   // row
+
+  // first set a few entries. count how many
+  // entries we have. note that for square
+  // matrices we also always store the
+  // diagonal element, so add one per row,
+  // but don't count it when traversing the
+  // row
   unsigned int counter = 0;
   for (unsigned int i=0; i<m.m(); ++i)
     {
@@ -57,11 +57,11 @@ void test (const unsigned int chunk_size)
   deallog << m.n_nonzero_elements() << std::endl;
   if (chunk_size == 1)
     Assert (m.n_nonzero_elements() == counter,
-           ExcInternalError())
-  else
-    Assert (m.n_nonzero_elements() >= counter,
-           ExcInternalError());
-  
+            ExcInternalError())
+    else
+      Assert (m.n_nonzero_elements() >= counter,
+              ExcInternalError());
+
   deallog << "OK" << std::endl;
 }
 
@@ -78,32 +78,32 @@ int main ()
     {
       const unsigned int chunk_sizes[] = { 1, 2, 4, 5, 7 };
       for (unsigned int i=0;
-          i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
-          ++i)
-       test (chunk_sizes[i]);
+           i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
+           ++i)
+        test (chunk_sizes[i]);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 119ee9d7f4ac375e4b145ee78a8dfa579be8e979..a4027276f85777d0545b9fc23a294c901eb2247a 100644 (file)
@@ -35,10 +35,10 @@ void test (const unsigned int chunk_size)
 
   ChunkSparseMatrix<double> m(sp);
 
-                                   // first set a few entries. count how many
-                                   // entries we have. note that for square
-                                   // matrices we also always store the
-                                   // diagonal element
+  // first set a few entries. count how many
+  // entries we have. note that for square
+  // matrices we also always store the
+  // diagonal element
   unsigned int counter = 0;
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
@@ -52,10 +52,10 @@ void test (const unsigned int chunk_size)
 
   if (chunk_size == 1)
     Assert (m.n_nonzero_elements() == counter,
-           ExcInternalError())
-  else
-    Assert (m.n_nonzero_elements() >= counter,
-           ExcInternalError());
+            ExcInternalError())
+    else
+      Assert (m.n_nonzero_elements() >= counter,
+              ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
@@ -73,32 +73,32 @@ int main ()
     {
       const unsigned int chunk_sizes[] = { 1, 2, 4, 5, 7 };
       for (unsigned int i=0;
-          i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
-          ++i)
-       test (chunk_sizes[i]);
+           i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
+           ++i)
+        test (chunk_sizes[i]);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index b96565b4d359c9642f4e932953348c3c4ac7bebf..a312e8a09989b7bf69eb888fe42e577565b5ebc2 100644 (file)
@@ -19,7 +19,7 @@
 // check ChunkSparseMatrix::l1_norm
 
 #include "../tests.h"
-#include <deal.II/lac/chunk_sparse_matrix.h>    
+#include <deal.II/lac/chunk_sparse_matrix.h>
 #include <fstream>
 
 
@@ -33,19 +33,19 @@ void test (const unsigned int chunk_size)
   sp.compress ();
 
   ChunkSparseMatrix<double> m(sp);
-  
-                                   // first set a few entries. count how many
-                                   // entries we have
+
+  // first set a few entries. count how many
+  // entries we have
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
-        m.set (i,j, i*j*.5+.5);  
+        m.set (i,j, i*j*.5+.5);
 
-                                   // compare against the exact value of the
-                                   // l1-norm (max col-sum)
+  // compare against the exact value of the
+  // l1-norm (max col-sum)
   deallog << m.l1_norm() << std::endl;
   Assert (m.l1_norm() == 7, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -62,32 +62,32 @@ int main ()
     {
       const unsigned int chunk_sizes[] = { 1, 2, 4, 5, 7 };
       for (unsigned int i=0;
-          i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
-          ++i)
-       test (chunk_sizes[i]);
+           i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
+           ++i)
+        test (chunk_sizes[i]);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 8f57d69d14247080c57ee218cabe879d1ab208da..12b79bf7a6aaefc715358d14e085c49764e609f5 100644 (file)
@@ -19,7 +19,7 @@
 // check ChunkSparseMatrix::linfty_norm
 
 #include "../tests.h"
-#include <deal.II/lac/chunk_sparse_matrix.h>    
+#include <deal.II/lac/chunk_sparse_matrix.h>
 #include <fstream>
 
 
@@ -33,19 +33,19 @@ void test (const unsigned int chunk_size)
   sp.compress ();
 
   ChunkSparseMatrix<double> m(sp);
-  
-                                   // first set a few entries. count how many
-                                   // entries we have
+
+  // first set a few entries. count how many
+  // entries we have
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
-        m.set (i,j, i*j*.5+.5);  
+        m.set (i,j, i*j*.5+.5);
 
-                                   // compare against the exact value of the
-                                   // linfty-norm (max row-sum)
+  // compare against the exact value of the
+  // linfty-norm (max row-sum)
   deallog << m.linfty_norm() << std::endl;
   Assert (m.linfty_norm() == 8.5, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -62,32 +62,32 @@ int main ()
     {
       const unsigned int chunk_sizes[] = { 1, 2, 4, 5, 7 };
       for (unsigned int i=0;
-          i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
-          ++i)
-       test (chunk_sizes[i]);
+           i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
+           ++i)
+        test (chunk_sizes[i]);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index e2d86ca39d230ba09f053b449ada7df23c14faa9..70ae5fa05f6c6256d44fa23e9fe7b902a11a535f 100644 (file)
@@ -19,7 +19,7 @@
 // check ChunkSparseMatrix::frobenius_norm
 
 #include "../tests.h"
-#include <deal.II/lac/chunk_sparse_matrix.h>    
+#include <deal.II/lac/chunk_sparse_matrix.h>
 #include <fstream>
 
 
@@ -33,9 +33,9 @@ void test (const unsigned int chunk_size)
   sp.compress ();
 
   ChunkSparseMatrix<double> m(sp);
-  
-                                   // first set a few entries. count how many
-                                   // entries we have
+
+  // first set a few entries. count how many
+  // entries we have
   double norm = 0;
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
@@ -46,11 +46,11 @@ void test (const unsigned int chunk_size)
         }
   norm = std::sqrt(norm);
 
-                                   // compare against the exact value of the
-                                   // l2-norm (max row-sum)
+  // compare against the exact value of the
+  // l2-norm (max row-sum)
   deallog << m.frobenius_norm() << std::endl;
   Assert (std::fabs((m.frobenius_norm() - norm)/norm) < 1e-14, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -67,32 +67,32 @@ int main ()
     {
       const unsigned int chunk_sizes[] = { 1, 2, 4, 5, 7 };
       for (unsigned int i=0;
-          i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
-          ++i)
-       test (chunk_sizes[i]);
+           i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
+           ++i)
+        test (chunk_sizes[i]);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 1c4996ff5650f474cc0fee9fa9c1abb8e8ae9dd5..5945512a03656034aaf5dfcd1267c3e5ec5a2c7a 100644 (file)
@@ -19,7 +19,7 @@
 // check ChunkSparseMatrix::operator *=
 
 #include "../tests.h"
-#include <deal.II/lac/chunk_sparse_matrix.h>    
+#include <deal.II/lac/chunk_sparse_matrix.h>
 #include <fstream>
 
 
@@ -33,18 +33,18 @@ void test (const unsigned int chunk_size)
   sp.compress ();
 
   ChunkSparseMatrix<double> m(sp);
-  
-                                   // first set a few entries
+
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
 
-                                   // then multiply everything by 1.25 and
-                                   // make sure we retrieve the values we
-                                   // expect
+  // then multiply everything by 1.25 and
+  // make sure we retrieve the values we
+  // expect
   m *= 1.25;
-  
+
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -73,32 +73,32 @@ int main ()
     {
       const unsigned int chunk_sizes[] = { 1, 2, 4, 5, 7 };
       for (unsigned int i=0;
-          i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
-          ++i)
-       test (chunk_sizes[i]);
+           i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
+           ++i)
+        test (chunk_sizes[i]);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 2902c01b92875ae582a0eed086867e4e3ad25d88..f626a399b858dee633e803a9983288f76f97170a 100644 (file)
@@ -19,7 +19,7 @@
 // check ChunkSparseMatrix::operator /=
 
 #include "../tests.h"
-#include <deal.II/lac/chunk_sparse_matrix.h>    
+#include <deal.II/lac/chunk_sparse_matrix.h>
 #include <fstream>
 
 
@@ -33,18 +33,18 @@ void test (const unsigned int chunk_size)
   sp.compress ();
 
   ChunkSparseMatrix<double> m(sp);
-  
-                                   // first set a few entries
+
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
 
-                                   // then divide everything by 4/3 and
-                                   // make sure we retrieve the values we
-                                   // expect
+  // then divide everything by 4/3 and
+  // make sure we retrieve the values we
+  // expect
   m /= 4./3.;
-  
+
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -73,32 +73,32 @@ int main ()
     {
       const unsigned int chunk_sizes[] = { 1, 2, 4, 5, 7 };
       for (unsigned int i=0;
-          i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
-          ++i)
-       test (chunk_sizes[i]);
+           i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
+           ++i)
+        test (chunk_sizes[i]);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 598884a7d668000f21b08d7d26002e44165bbec5..3ca1d42cccbd7a21536f394aab1f2481e195ebf1 100644 (file)
@@ -38,15 +38,15 @@ void test (const unsigned int chunk_size)
 
   ChunkSparseMatrix<double> m(sp);
 
-                                   // first set a few entries
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
 
-                                   // then extract the elements (note that
-                                   // some may be zero or even outside the
-                                   // matrix
+  // then extract the elements (note that
+  // some may be zero or even outside the
+  // matrix
   for (unsigned int i=0; i<m.m(); ++i)
     {
       deallog << "row " << i << ": ";
@@ -74,32 +74,32 @@ int main ()
     {
       const unsigned int chunk_sizes[] = { 1, 2, 4, 5, 7 };
       for (unsigned int i=0;
-          i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
-          ++i)
-       test (chunk_sizes[i]);
+           i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
+           ++i)
+        test (chunk_sizes[i]);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index e0490c42a165a4fd3ceafc2a73077759a3a50f16..b75b2f6db8fa938ca6d176b96c979a8be3c86425 100644 (file)
@@ -38,15 +38,15 @@ void test (const unsigned int chunk_size)
 
   ChunkSparseMatrix<double> m(sp);
 
-                                   // first set a few entries
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
 
-                                   // then extract the elements (note that
-                                   // some may be zero or even outside the
-                                   // matrix
+  // then extract the elements (note that
+  // some may be zero or even outside the
+  // matrix
   for (unsigned int i=0; i<m.m(); ++i)
     {
       deallog << "row " << i << ": ";
@@ -74,32 +74,32 @@ int main ()
     {
       const unsigned int chunk_sizes[] = { 1, 2, 4, 5, 7 };
       for (unsigned int i=0;
-          i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
-          ++i)
-       test (chunk_sizes[i]);
+           i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
+           ++i)
+        test (chunk_sizes[i]);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 4cf498c4d3665551a11373c7dc93b11754b94e12..a5b12486729a2802a45f5929e7276be4db27d32c 100644 (file)
@@ -38,15 +38,15 @@ void test (const unsigned int chunk_size)
 
   ChunkSparseMatrix<double> m(sp);
 
-                                   // first set a few entries
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
 
-                                   // then extract the elements (note that
-                                   // some may be zero or even outside the
-                                   // matrix
+  // then extract the elements (note that
+  // some may be zero or even outside the
+  // matrix
   for (unsigned int i=0; i<m.m(); ++i)
     {
       deallog << "row " << i << ": ";
@@ -74,32 +74,32 @@ int main ()
     {
       const unsigned int chunk_sizes[] = { 1, 2, 4, 5, 7 };
       for (unsigned int i=0;
-          i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
-          ++i)
-       test (chunk_sizes[i]);
+           i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
+           ++i)
+        test (chunk_sizes[i]);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 17c98e3d244a49e2e850d1c0d8cd1faedb836972..c802e0d9405144c93b6120aabe85472ca09e25ef 100644 (file)
@@ -38,15 +38,15 @@ void test (const unsigned int chunk_size)
 
   ChunkSparseMatrix<double> m(sp);
 
-                                   // first set a few entries
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
 
-                                   // then extract the elements (note that
-                                   // some may be zero or even outside the
-                                   // matrix
+  // then extract the elements (note that
+  // some may be zero or even outside the
+  // matrix
   AssertDimension(m.end()-m.begin(), m.n_nonzero_elements());
   for (unsigned int i=0; i<m.m(); ++i)
     {
@@ -75,32 +75,32 @@ int main ()
     {
       const unsigned int chunk_sizes[] = { 1, 2, 4, 5, 7 };
       for (unsigned int i=0;
-          i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
-          ++i)
-       test (chunk_sizes[i]);
+           i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
+           ++i)
+        test (chunk_sizes[i]);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index d88c0dc41504148bfe53d77fe0f9be5b75548a6b..56e4d6656516ff81364af96c0c8883e0ffbe0d94 100644 (file)
@@ -42,7 +42,7 @@ void test (const unsigned int chunk_size)
 
       ChunkSparseMatrix<double> m(sp);
 
-                                   // first set a few entries
+      // first set a few entries
       for (unsigned int i=0; i<m.m(); ++i)
         for (unsigned int j=0; j<m.n(); ++j)
           if ((i+2*j+1) % 3 == 0)
@@ -81,32 +81,32 @@ int main ()
     {
       const unsigned int chunk_sizes[] = { 1, 2, 4, 5, 7 };
       for (unsigned int i=0;
-          i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
-          ++i)
-       test (chunk_sizes[i]);
+           i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
+           ++i)
+        test (chunk_sizes[i]);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index b10deb5a0f31fb3e3364ab4e04ce6e499d1cf756..18aed5204179a5b9215b1f374384b1364aff1ffe 100644 (file)
@@ -58,32 +58,32 @@ int main ()
     {
       const unsigned int chunk_sizes[] = { 1, 2, 4, 5, 7 };
       for (unsigned int i=0;
-          i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
-          ++i)
-       test (chunk_sizes[i]);
+           i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
+           ++i)
+        test (chunk_sizes[i]);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index f023ee836c7c152ceb6b2cda8c9131f2ddb2e384..eaf3ad4bc1a7bfec237b45e2b8864cc57bf6caf5 100644 (file)
@@ -20,7 +20,7 @@
 // iterator
 
 #include "../tests.h"
-#include <deal.II/lac/chunk_sparse_matrix.h>    
+#include <deal.II/lac/chunk_sparse_matrix.h>
 #include <fstream>
 #include <iomanip>
 
@@ -44,7 +44,7 @@ void test (const unsigned int chunk_size)
           ||
           (i==j))
         m.set (i,j, i*j);
-  
+
   ChunkSparseMatrix<double>::const_iterator i = m.begin();
   for (; i!=m.end(); ++i)
     {
@@ -77,32 +77,32 @@ int main ()
     {
       const unsigned int chunk_sizes[] = { 1, 2, 4, 5, 7 };
       for (unsigned int i=0;
-          i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
-          ++i)
-       test (chunk_sizes[i]);
+           i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
+           ++i)
+        test (chunk_sizes[i]);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 6eae12028b785df9d78e876f4c4cdc185c419545..79f32a47eeae4466f315b0541e6a3ab5dbbbec79 100644 (file)
@@ -20,7 +20,7 @@
 // matrix iterator
 
 #include "../tests.h"
-#include <deal.II/lac/chunk_sparse_matrix.h>    
+#include <deal.II/lac/chunk_sparse_matrix.h>
 #include <fstream>
 #include <iomanip>
 
@@ -44,7 +44,7 @@ void test (const unsigned int chunk_size)
           ||
           (i==j))
         m.set (i,j, i*j);
-  
+
   ChunkSparseMatrix<double>::iterator i = m.begin();
   for (; i!=m.end(); ++i)
     {
@@ -77,32 +77,32 @@ int main ()
     {
       const unsigned int chunk_sizes[] = { 1, 2, 4, 5, 7 };
       for (unsigned int i=0;
-          i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
-          ++i)
-       test (chunk_sizes[i]);
+           i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
+           ++i)
+        test (chunk_sizes[i]);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 70b3d99cc9245d24bfa484e190925d82a9309f05..d5f9e3c28c8747266000dcd1806d0ff97dcc595a 100644 (file)
@@ -19,7 +19,7 @@
 // operator=, and reading them back through the matrix itself
 
 #include "../tests.h"
-#include <deal.II/lac/chunk_sparse_matrix.h>    
+#include <deal.II/lac/chunk_sparse_matrix.h>
 #include <fstream>
 #include <iomanip>
 
@@ -40,7 +40,7 @@ void test (const unsigned int chunk_size)
   ChunkSparseMatrix<double>::iterator i = m.begin();
   for (; i!=m.end(); ++i)
     i->value() = i->row()*i->column();
-  
+
   for (unsigned int i=0; i<5; ++i)
     for (unsigned int j=0; j<5; ++j)
       if (((i+2*j+1) % 3 == 0)
@@ -52,7 +52,7 @@ void test (const unsigned int chunk_size)
           Assert (std::fabs(m.el(i,j)-i*j) < 1e-14,
                   ExcInternalError());
         }
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -76,25 +76,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index a64f6f5f16aa8169c06dc6780628d42f47b5ea14..3eabc3730af1256b6f8e34782bf118e3f543e081 100644 (file)
@@ -19,7 +19,7 @@
 // operator+=, and reading them back through the matrix itself
 
 #include "../tests.h"
-#include <deal.II/lac/chunk_sparse_matrix.h>    
+#include <deal.II/lac/chunk_sparse_matrix.h>
 #include <fstream>
 #include <iomanip>
 
@@ -47,7 +47,7 @@ void test (const unsigned int chunk_size)
   ChunkSparseMatrix<double>::iterator i = m.begin();
   for (; i!=m.end(); ++i)
     i->value() += i->row()*i->column();
-  
+
   for (unsigned int i=0; i<5; ++i)
     for (unsigned int j=0; j<5; ++j)
       if (((i+2*j+1) % 3 == 0)
@@ -59,7 +59,7 @@ void test (const unsigned int chunk_size)
           Assert (std::fabs(m.el(i,j)-(1.+i*j)) < 1e-14,
                   ExcInternalError());
         }
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -83,25 +83,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 7d76f1fb1f706e5168b613ae29bfbccc7d57f015..2299c95393b10a89b7ac11922e77310c284875f5 100644 (file)
@@ -19,7 +19,7 @@
 // operator-=, and reading them back through the matrix itself
 
 #include "../tests.h"
-#include <deal.II/lac/chunk_sparse_matrix.h>    
+#include <deal.II/lac/chunk_sparse_matrix.h>
 #include <fstream>
 #include <iomanip>
 
@@ -47,7 +47,7 @@ void test (const unsigned int chunk_size)
   ChunkSparseMatrix<double>::iterator i = m.begin();
   for (; i!=m.end(); ++i)
     i->value() -= i->row()*i->column();
-  
+
   for (unsigned int i=0; i<5; ++i)
     for (unsigned int j=0; j<5; ++j)
       if (((i+2*j+1) % 3 == 0)
@@ -66,7 +66,7 @@ void test (const unsigned int chunk_size)
           Assert (std::fabs(m.el(i,j)+i*j) < 1e-14,
                   ExcInternalError());
         }
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -90,25 +90,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index c85fc2075e347cb76ac2b97747cde7565146b4f1..efb7904aee7c08f037b671bb51f40667a52f53a9 100644 (file)
@@ -19,7 +19,7 @@
 // operator*=, and reading them back through the matrix itself
 
 #include "../tests.h"
-#include <deal.II/lac/chunk_sparse_matrix.h>    
+#include <deal.II/lac/chunk_sparse_matrix.h>
 #include <fstream>
 #include <iomanip>
 
@@ -47,7 +47,7 @@ void test (const unsigned int chunk_size)
   ChunkSparseMatrix<double>::iterator i = m.begin();
   for (; i!=m.end(); ++i)
     i->value() *= 2;
-  
+
   for (unsigned int i=0; i<5; ++i)
     for (unsigned int j=0; j<5; ++j)
       if (((i+2*j+1) % 3 == 0)
@@ -66,7 +66,7 @@ void test (const unsigned int chunk_size)
           Assert (std::fabs(m.el(i,j)) < 1e-14,
                   ExcInternalError());
         }
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -90,25 +90,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index eabb412e7055e7077f5949f7951099de1871f2b2..b8fbb2a279be6269b2b98e20f785eebc2d28c35f 100644 (file)
@@ -19,7 +19,7 @@
 // operator/=, and reading them back through the matrix itself
 
 #include "../tests.h"
-#include <deal.II/lac/chunk_sparse_matrix.h>    
+#include <deal.II/lac/chunk_sparse_matrix.h>
 #include <fstream>
 #include <iomanip>
 
@@ -47,7 +47,7 @@ void test (const unsigned int chunk_size)
   ChunkSparseMatrix<double>::iterator i = m.begin();
   for (; i!=m.end(); ++i)
     i->value() /= 2;
-  
+
   for (unsigned int i=0; i<5; ++i)
     for (unsigned int j=0; j<5; ++j)
       if (((i+2*j+1) % 3 == 0)
@@ -66,7 +66,7 @@ void test (const unsigned int chunk_size)
           Assert (std::fabs(m.el(i,j)) < 1e-14,
                   ExcInternalError());
         }
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -90,25 +90,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 50f3f095000b73c660673b04a08c3cf393753f9f..bf84076ddff527d42f379f9cbff61d715b64d1d4 100644 (file)
@@ -28,18 +28,18 @@ void test (const unsigned int chunk_size)
 {
   deallog << "Chunk size: " << chunk_size << std::endl;
 
-                                   // create a sparsity pattern with totally
-                                   // empty lines (not even diagonals, since
-                                   // not quadratic)
+  // create a sparsity pattern with totally
+  // empty lines (not even diagonals, since
+  // not quadratic)
   ChunkSparsityPattern sparsity(4,5,1,chunk_size);
   sparsity.add (1,1);
   sparsity.add (3,1);
   sparsity.compress ();
 
-                                   // attach a sparse matrix to it
+  // attach a sparse matrix to it
   ChunkSparseMatrix<double> A(sparsity);
 
-                                   // and loop over the elements of it
+  // and loop over the elements of it
   for (ChunkSparseMatrix<double>::const_iterator k=A.begin();
        k!=A.end(); ++k)
     deallog << k->row() << ' ' << k->column() << ' ' << k->value()
@@ -63,25 +63,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 1ae6cc8349d2e58eada0785008f8c1d61ec5cc91..9c17bb6f4f523af3aae2e0e0ec12f8421cf2fe4a 100644 (file)
@@ -30,18 +30,18 @@ void test (const unsigned int chunk_size)
 {
   deallog << "Chunk size: " << chunk_size << std::endl;
 
-                                   // create a sparsity pattern with totally
-                                   // empty lines (not even diagonals, since
-                                   // not quadratic)
+  // create a sparsity pattern with totally
+  // empty lines (not even diagonals, since
+  // not quadratic)
   ChunkSparsityPattern sparsity(4,5,1,chunk_size);
   sparsity.add (1,1);
   sparsity.add (3,1);
   sparsity.compress ();
 
-                                   // attach a sparse matrix to it
+  // attach a sparse matrix to it
   ChunkSparseMatrix<double> A(sparsity);
 
-                                   // and loop over the elements of it
+  // and loop over the elements of it
   for (ChunkSparseMatrix<double>::const_iterator k=A.begin();
        k!=A.end(); ++k)
     deallog << k->row() << ' ' << k->column() << ' ' << k->value()
@@ -65,25 +65,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index a98f72f910211411d29ab51d32e06d55a2194223..b357927c02ab8c726bc000c40f421ebdc0a8e827 100644 (file)
@@ -29,15 +29,15 @@ void test (const unsigned int chunk_size)
 {
   deallog << "Chunk size: " << chunk_size << std::endl;
 
-                                   // create a sparsity pattern with totally
-                                   // empty lines (not even diagonals, since
-                                   // not quadratic)
+  // create a sparsity pattern with totally
+  // empty lines (not even diagonals, since
+  // not quadratic)
   ChunkSparsityPattern sparsity(4,5,1,chunk_size);
   sparsity.add (1,1);
   sparsity.add (3,1);
   sparsity.compress ();
 
-                                   // attach a sparse matrix to it
+  // attach a sparse matrix to it
   ChunkSparseMatrix<double> A(sparsity);
 
   ChunkSparseMatrix<double>::iterator k = A.begin(),
@@ -54,7 +54,7 @@ void test (const unsigned int chunk_size)
 
   Assert (k == k, ExcInternalError());
   Assert (!(k != k), ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -75,25 +75,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 97ff309aeffaec9f389e8d5123a67c0149807ce7..8bdb6ecded592e5c0c48a1ac76c89b8adb0f37b8 100644 (file)
@@ -28,15 +28,15 @@ void test (const unsigned int chunk_size)
 {
   deallog << "Chunk size: " << chunk_size << std::endl;
 
-                                   // create a sparsity pattern with totally
-                                   // empty lines (not even diagonals, since
-                                   // not quadratic)
+  // create a sparsity pattern with totally
+  // empty lines (not even diagonals, since
+  // not quadratic)
   ChunkSparsityPattern sparsity(4,5,1,chunk_size);
   sparsity.add (1,1);
   sparsity.add (3,1);
   sparsity.compress ();
 
-                                   // attach a sparse matrix to it
+  // attach a sparse matrix to it
   ChunkSparseMatrix<double> A(sparsity);
 
   ChunkSparseMatrix<double>::const_iterator k = A.begin(),
@@ -53,7 +53,7 @@ void test (const unsigned int chunk_size)
 
   Assert (k == k, ExcInternalError());
   Assert (!(k != k), ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -74,25 +74,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index ec4b64db0bf10285ecbc14ec13e7cddbacaa998f..4d07e3925fcd44932b60a953d3abcc1fa3e38e5d 100644 (file)
@@ -28,9 +28,9 @@ void test (const unsigned int chunk_size)
 {
   deallog << "Chunk size: " << chunk_size << std::endl;
 
-                                   // create a sparsity pattern with totally
-                                   // empty lines (not even diagonals, since
-                                   // not quadratic)
+  // create a sparsity pattern with totally
+  // empty lines (not even diagonals, since
+  // not quadratic)
   ChunkSparsityPattern sp(5,5,3,chunk_size);
   for (unsigned int i=0; i<5; ++i)
     for (unsigned int j=0; j<5; ++j)
@@ -40,29 +40,29 @@ void test (const unsigned int chunk_size)
         sp.add (i,j);
   sp.compress ();
 
-                                   // attach a sparse matrix to it
+  // attach a sparse matrix to it
   ChunkSparseMatrix<double> m(sp);
 
   for (unsigned int row=0; row<sp.n_rows(); ++row)
     Assert (m.begin(row)-m.begin(row) == 0,
-           ExcInternalError());
+            ExcInternalError());
 
   for (unsigned int row=0; row<sp.n_rows(); ++row)
     Assert (m.end(row)-m.begin(row) == (int)sp.row_length(row),
-           ExcInternalError());
+            ExcInternalError());
   for (unsigned int row=0; row<sp.n_rows(); ++row)
     Assert (m.begin(row)-m.end(row) == -(int)sp.row_length(row),
-           ExcInternalError());
+            ExcInternalError());
 
   {
     unsigned int counter = 0;
     for (unsigned int row=0; row<sp.n_rows(); ++row)
       {
-       Assert (m.begin(row)-m.begin(0) == (int)counter,
-               ExcInternalError());
-       Assert (m.begin(0)-m.begin(row) == -(int)counter,
-               ExcInternalError());
-       counter += sp.row_length(row);
+        Assert (m.begin(row)-m.begin(0) == (int)counter,
+                ExcInternalError());
+        Assert (m.begin(0)-m.begin(row) == -(int)counter,
+                ExcInternalError());
+        counter += sp.row_length(row);
       }
   }
 
@@ -71,9 +71,9 @@ void test (const unsigned int chunk_size)
   Assert (m.end(sp.n_rows()-1) - m.end() == 0, ExcInternalError());
   Assert (m.end() - m.end(sp.n_rows()-1) == 0, ExcInternalError());
   Assert (m.end() - m.begin() == (int)sp.n_nonzero_elements(),
-         ExcInternalError());
+          ExcInternalError());
   Assert (m.begin() - m.end() == -(int)sp.n_nonzero_elements(),
-         ExcInternalError());
+          ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
@@ -97,25 +97,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index bf1bb184b7cad58871e7b04175ba977e7cab40d1..f853e2006a3f69ba03df3e652c79a272132ee527 100644 (file)
 
 
 void test (const unsigned int chunk_size,
-          Vector<double> &v,
+           Vector<double> &v,
            Vector<double> &w)
 {
-                                   // set some entries in the
-                                   // matrix. actually, set them all
+  // set some entries in the
+  // matrix. actually, set them all
   ChunkSparsityPattern sp (v.size(),v.size(),v.size(), chunk_size);
   for (unsigned int i=0; i<v.size(); ++i)
     for (unsigned int j=0; j<v.size(); ++j)
       sp.add (i,j);
   sp.compress ();
 
-                                   // then create a matrix from that
+  // then create a matrix from that
   ChunkSparseMatrix<double> m(sp);
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
-  
+
   v.compress ();
   w.compress ();
 
-                                   // w:=Mv
+  // w:=Mv
   m.vmult (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -69,7 +69,7 @@ void test (const unsigned int chunk_size,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("chunk_sparse_matrix_vector_01/output");
   deallog.attach(logfile);
@@ -80,35 +80,35 @@ int main ()
     {
       const unsigned int chunk_sizes[] = { 1, 2, 4, 7, 11 };
       for (unsigned int i=0; i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
-          ++i)
-       {
-         Vector<double> v (100);
-         Vector<double> w (100);
-         test (chunk_sizes[i], v,w);
-       }
+           ++i)
+        {
+          Vector<double> v (100);
+          Vector<double> w (100);
+          test (chunk_sizes[i], v,w);
+        }
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 8f950d57db006de7fa9628469163ad629d3b0e7c..eb040b6904bb01025b71018ffa7c0bc6a95e4ce0 100644 (file)
 
 
 void test (const unsigned int chunk_size,
-          Vector<double> &v,
+           Vector<double> &v,
            Vector<double> &w)
 {
-                                   // set some entries in the
-                                   // matrix. actually, set them all
+  // set some entries in the
+  // matrix. actually, set them all
   ChunkSparsityPattern sp (v.size(),v.size(),v.size(), chunk_size);
   for (unsigned int i=0; i<v.size(); ++i)
     for (unsigned int j=0; j<v.size(); ++j)
       sp.add (i,j);
   sp.compress ();
 
-                                   // then create a matrix from that
+  // then create a matrix from that
   ChunkSparseMatrix<double> m(sp);
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
-  
+
   v.compress ();
   w.compress ();
 
-                                   // w:=Mv
+  // w:=Mv
   m.Tvmult (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -69,7 +69,7 @@ void test (const unsigned int chunk_size,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("chunk_sparse_matrix_vector_02/output");
   deallog.attach(logfile);
@@ -80,35 +80,35 @@ int main ()
     {
       const unsigned int chunk_sizes[] = { 1, 2, 4, 7, 11 };
       for (unsigned int i=0; i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
-          ++i)
-       {
-         Vector<double> v (100);
-         Vector<double> w (100);
-         test (chunk_sizes[i], v,w);
-       }
+           ++i)
+        {
+          Vector<double> v (100);
+          Vector<double> w (100);
+          test (chunk_sizes[i], v,w);
+        }
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index bc4252dbed828eea4fec1238351fdef753aecf3d..20e03de588d93e178e2068e717b1bd90c66a7fd4 100644 (file)
 
 
 void test (const unsigned int chunk_size,
-          Vector<double> &v,
+           Vector<double> &v,
            Vector<double> &w)
 {
-                                   // set some entries in the
-                                   // matrix. actually, set them all
+  // set some entries in the
+  // matrix. actually, set them all
   ChunkSparsityPattern sp (v.size(),v.size(),v.size(), chunk_size);
   for (unsigned int i=0; i<v.size(); ++i)
     for (unsigned int j=0; j<v.size(); ++j)
       sp.add (i,j);
   sp.compress ();
 
-                                   // then create a matrix from that
+  // then create a matrix from that
   ChunkSparseMatrix<double> m(sp);
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       w(i) = i;
     }
-  
+
   v.compress ();
   w.compress ();
 
-                                   // w+=Mv
+  // w+=Mv
   m.vmult_add (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -72,7 +72,7 @@ void test (const unsigned int chunk_size,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("chunk_sparse_matrix_vector_03/output");
   deallog.attach(logfile);
@@ -83,35 +83,35 @@ int main ()
     {
       const unsigned int chunk_sizes[] = { 1, 2, 4, 7, 11 };
       for (unsigned int i=0; i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
-          ++i)
-       {
-         Vector<double> v (100);
-         Vector<double> w (100);
-         test (chunk_sizes[i], v,w);
-       }
+           ++i)
+        {
+          Vector<double> v (100);
+          Vector<double> w (100);
+          test (chunk_sizes[i], v,w);
+        }
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 7e37a33e033d967ad831c688818b753520562cfc..69f8bb7fe474777207cccbc5689106420977b63b 100644 (file)
 
 
 void test (const unsigned int chunk_size,
-          Vector<double> &v,
+           Vector<double> &v,
            Vector<double> &w)
 {
-                                   // set some entries in the
-                                   // matrix. actually, set them all
+  // set some entries in the
+  // matrix. actually, set them all
   ChunkSparsityPattern sp (v.size(),v.size(),v.size(), chunk_size);
   for (unsigned int i=0; i<v.size(); ++i)
     for (unsigned int j=0; j<v.size(); ++j)
       sp.add (i,j);
   sp.compress ();
 
-                                   // then create a matrix from that
+  // then create a matrix from that
   ChunkSparseMatrix<double> m(sp);
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       w(i) = i;
     }
-  
+
   v.compress ();
   w.compress ();
 
-                                   // w:=Mv
+  // w:=Mv
   m.Tvmult_add (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -72,7 +72,7 @@ void test (const unsigned int chunk_size,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("chunk_sparse_matrix_vector_04/output");
   deallog.attach(logfile);
@@ -83,35 +83,35 @@ int main ()
     {
       const unsigned int chunk_sizes[] = { 1, 2, 4, 7, 11 };
       for (unsigned int i=0; i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
-          ++i)
-       {
-         Vector<double> v (100);
-         Vector<double> w (100);
-         test (chunk_sizes[i], v,w);
-       }
+           ++i)
+        {
+          Vector<double> v (100);
+          Vector<double> w (100);
+          test (chunk_sizes[i], v,w);
+        }
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 55a3b24afc7bd211613e004c0e77f1b17c97e63d..eae0f176934153812b197ab4a67cbe7dfa944033 100644 (file)
 
 
 void test (const unsigned int chunk_size,
-          Vector<double> &v,
+           Vector<double> &v,
            Vector<double> &w)
 {
-                                   // set some entries in the
-                                   // matrix. actually, set them all
+  // set some entries in the
+  // matrix. actually, set them all
   ChunkSparsityPattern sp (v.size(),v.size(),v.size(), chunk_size);
   for (unsigned int i=0; i<v.size(); ++i)
     for (unsigned int j=0; j<v.size(); ++j)
       sp.add (i,j);
   sp.compress ();
 
-                                   // then create a matrix from that
+  // then create a matrix from that
   ChunkSparseMatrix<double> m(sp);
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       w(i) = i+1;
     }
-  
+
   v.compress ();
   w.compress ();
 
-                                   // <w,Mv>
+  // <w,Mv>
   const double s = m.matrix_scalar_product (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -75,7 +75,7 @@ void test (const unsigned int chunk_size,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("chunk_sparse_matrix_vector_05/output");
   deallog.attach(logfile);
@@ -86,35 +86,35 @@ int main ()
     {
       const unsigned int chunk_sizes[] = { 1, 2, 4, 7, 11 };
       for (unsigned int i=0; i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
-          ++i)
-       {
-         Vector<double> v (100);
-         Vector<double> w (100);
-         test (chunk_sizes[i],v,w);
-       }
+           ++i)
+        {
+          Vector<double> v (100);
+          Vector<double> w (100);
+          test (chunk_sizes[i],v,w);
+        }
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 093a672e4efb756c9220376a2180d6fd0a2dee0a..79c129819f8af3f00aa304e039e6085d37ac6853 100644 (file)
 
 
 void test (const unsigned int chunk_size,
-          Vector<double> &v)
+           Vector<double> &v)
 {
-                                   // set some entries in the
-                                   // matrix. actually, set them all
+  // set some entries in the
+  // matrix. actually, set them all
   ChunkSparsityPattern sp (v.size(),v.size(),v.size(), chunk_size);
   for (unsigned int i=0; i<v.size(); ++i)
     for (unsigned int j=0; j<v.size(); ++j)
       sp.add (i,j);
   sp.compress ();
 
-                                   // then create a matrix from that
+  // then create a matrix from that
   ChunkSparseMatrix<double> m(sp);
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
-  
+
   v.compress ();
 
-                                   // <w,Mv>
+  // <w,Mv>
   const double s = m.matrix_norm_square (v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     Assert (v(i) == i, ExcInternalError());
 
@@ -67,7 +67,7 @@ void test (const unsigned int chunk_size,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("chunk_sparse_matrix_vector_06/output");
   deallog.attach(logfile);
@@ -78,34 +78,34 @@ int main ()
     {
       const unsigned int chunk_sizes[] = { 1, 2, 4, 7, 11 };
       for (unsigned int i=0; i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
-          ++i)
-       {
-         Vector<double> v (100);
-         test (chunk_sizes[i], v);
-       }
+           ++i)
+        {
+          Vector<double> v (100);
+          test (chunk_sizes[i], v);
+        }
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index f84a4608a576b46039bd9a19b6b90ae74e46181b..6770a39cae168f26391ca0d4c8c1f95d7430180a 100644 (file)
 
 
 void test (const unsigned int chunk_size,
-          Vector<double> &v,
+           Vector<double> &v,
            Vector<double> &w,
            Vector<double> &x)
 {
-                                   // set some entries in the
-                                   // matrix. actually, set them all
+  // set some entries in the
+  // matrix. actually, set them all
   ChunkSparsityPattern sp (v.size(),v.size(),v.size(), chunk_size);
   for (unsigned int i=0; i<v.size(); ++i)
     for (unsigned int j=0; j<v.size(); ++j)
       sp.add (i,j);
   sp.compress ();
 
-                                   // then create a matrix from that
+  // then create a matrix from that
   ChunkSparseMatrix<double> m(sp);
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       w(i) = i+1;
     }
-      
+
   v.compress ();
   w.compress ();
 
-                                   // x=w-Mv
+  // x=w-Mv
   const double s = m.residual (x, v, w);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -77,7 +77,7 @@ void test (const unsigned int chunk_size,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("chunk_sparse_matrix_vector_07/output");
   deallog.attach(logfile);
@@ -88,36 +88,36 @@ int main ()
     {
       const unsigned int chunk_sizes[] = { 1, 2, 4, 7, 11 };
       for (unsigned int i=0; i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
-          ++i)
-       {
-         Vector<double> v (100);
-         Vector<double> w (100);
-         Vector<double> x (100);
-         test (chunk_sizes[i],v,w,x);
-       }
+           ++i)
+        {
+          Vector<double> v (100);
+          Vector<double> w (100);
+          Vector<double> x (100);
+          test (chunk_sizes[i],v,w,x);
+        }
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 48d3ff506f190204de7dd66e115d57c33dbc8312..dffdabab97628d4f37ebd35a1cf83c6939306237 100644 (file)
@@ -32,7 +32,7 @@
 #include <fstream>
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("coarsening_3d/output");
   deallog.attach(logfile);
@@ -42,7 +42,7 @@ int main ()
   Triangulation<3> coarse_grid;
   create_L_shape (coarse_grid);
 
-                                   // refine once, then unrefine again
+  // refine once, then unrefine again
   coarse_grid.refine_global (1);
   for (Triangulation<3>::active_cell_iterator c=coarse_grid.begin_active();
        c != coarse_grid.end(); ++c)
@@ -52,5 +52,5 @@ int main ()
   deallog << "ok." << std::endl;
 }
 
-  
-  
+
+
index 88ab1a6b12be5fa43e0837a8d21fafd9bfb2466f..5717b754a3d35ea92d79dc24fabd3456fd098041 100644 (file)
@@ -36,9 +36,9 @@ check ()
   make_complex_matrix (m);
 
   for (typename FullMatrix<std::complex<number> >::const_iterator
-        p = m.begin(); p!=m.end(); ++p)
+       p = m.begin(); p!=m.end(); ++p)
     deallog << p->row() << ' ' << p->column() << ' '
-           << p->value()
-           << std::endl;
+            << p->value()
+            << std::endl;
 }
 
index ac30360b665115ab7062aad370b0c30ab25ad3ea..02de710b1419d795cfc42a1e370c025ea95fb222 100644 (file)
@@ -35,11 +35,11 @@ check ()
   FullMatrix<std::complex<number> > m;
   make_complex_matrix (m);
 
-  
+
   for (typename FullMatrix<std::complex<number> >::const_iterator
-        p = m.begin(1); p!=m.end(1); ++p)
+       p = m.begin(1); p!=m.end(1); ++p)
     deallog << p->row() << ' ' << p->column() << ' '
-           << p->value()
-           << std::endl;
+            << p->value()
+            << std::endl;
 }
 
index b47dfc10ffe45e3fa80397afd791bd99a68d009d..5d0c85d3ea33b2b0cecc5eb30f90f36dbd44c8de 100644 (file)
@@ -33,11 +33,12 @@ void
 check ()
 {
   const std::complex<number> array[] = { 1, 2, 3, 4, 5,
-                          6, 7, 8, 9, 0,
-                          1, 2, 3, 4, 5,
-                          6, 7, 8, 9, 0,
-                          1, 2, 3, 4, 5 };
-  
+                                         6, 7, 8, 9, 0,
+                                         1, 2, 3, 4, 5,
+                                         6, 7, 8, 9, 0,
+                                         1, 2, 3, 4, 5
+                                       };
+
   FullMatrix<std::complex<number> > m (5,5,array);
 
   print_matrix (m);
index 25c8d952025c162ec7ffca451afc0b245b67465e..388424055994e067e58fad1382c66c1b17d2bac5 100644 (file)
@@ -37,7 +37,7 @@ check ()
 
   FullMatrix<std::complex<number> > n;
   n = m;
-  
+
   print_matrix (n);
 }
 
index 14624842b5f3281dded0b3004232aa633632a27f..a205c4006b52738bd160c3fcbe3d1885dc9d942f 100644 (file)
@@ -37,7 +37,7 @@ check ()
 
   FullMatrix<std::complex<number> > n;
   n.copy_from (m);
-  
+
   print_matrix (n);
 }
 
index f900c889cc5b8adc7e930ff9b889236f5026328b..b1b51d5df7e747d08f3e2c44c5961880b463cd46 100644 (file)
@@ -34,7 +34,7 @@ check ()
 {
   FullMatrix<std::complex<number> > m(3,3);
   deallog << m.all_zero() << std::endl;
-  
+
   make_complex_matrix (m);
   deallog << m.all_zero() << std::endl;
 }
index a1d609310451893ca5c62a4a96d22091d8955215..bb5831777faefa365758e8ace99d8eee3cbc0ce0 100644 (file)
@@ -36,7 +36,7 @@ check ()
   make_complex_matrix (m);
   Vector<std::complex<number> > v;
   make_complex_vector (v);
-  
+
   deallog << m.matrix_norm_square (v) << std::endl;
 }
 
index 0f39f4793c41c32e5dfe9034df61666295de5d5c..3b039195bf84336d82f8ad46b4fd39bf6555219a 100644 (file)
@@ -39,7 +39,7 @@ check ()
   make_complex_vector (w);
   for (unsigned int i=0; i<w.size(); ++i)
     w(i) = w(i)+std::complex<number>(1.);
-  
+
   deallog << m.matrix_scalar_product (v,w) << std::endl;
 }
 
index d2eccc4d4c3dcbe9616da0ef7f5f186af699dfa2..1ee1189583c8ca788c5d64af2d2ca0d9e2b10832 100644 (file)
@@ -35,7 +35,7 @@ check ()
   for (unsigned int n=1; n<=3; ++n)
     {
       const std::complex<number> array[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
-    
+
       FullMatrix<std::complex<number> > m(n,n, array);
       print_matrix (m);
       deallog << m.determinant () << std::endl;
index 4c74b67d6a9b8c6c9e3896bdf7f6e87b93c0898e..654e662c5b3d4219fa5a3c61abc9c1056f8ef3b5 100644 (file)
@@ -36,7 +36,7 @@ check ()
   make_complex_matrix (m);
   make_complex_matrix (n);
   m.add (3.14159, n);
-  
+
   print_matrix (m);
 }
 
index 7450a9df7016148f1213ebe65e87aa5e6870db9f..d3f9b0bbc85d93c68c9b5c69a704a7066fc1cc1e 100644 (file)
@@ -36,7 +36,7 @@ check ()
   make_complex_matrix (m);
   make_complex_matrix (n);
   m.equ (3.14159, n);
-  
+
   print_matrix (m);
 }
 
index fb369e28247ed0b1668fb2897ca1e9985478eb49..e86b0099559ba4811d9250035827f3b39accfe00 100644 (file)
@@ -35,11 +35,12 @@ check ()
   for (unsigned int n=1; n<=5; ++n)
     {
       const std::complex<number> array[] = { 50, 2, 3, 4, 5,
-                              6, 50, 8, 9, 0,
-                              1, 2, 50, 4, 5,
-                              6, 7, 8, 50, 0,
-                              1, 2, 3, 4, 50 };
-  
+                                             6, 50, 8, 9, 0,
+                                             1, 2, 50, 4, 5,
+                                             6, 7, 8, 50, 0,
+                                             1, 2, 3, 4, 50
+                                           };
+
       FullMatrix<std::complex<number> > m (n,n,array), p(n,n);
       p.invert (m);
       print_matrix (p);
index 44d6599a9c2dff42927716e3c0b4b98ad11f3eb7..aa85e6bb901c73151a9c89ff905c38230f2b2f2c 100644 (file)
@@ -36,9 +36,9 @@ check ()
   make_matrix (m);
 
   for (typename FullMatrix<std::complex<number> >::const_iterator
-        p = m.begin(); p!=m.end(); ++p)
+       p = m.begin(); p!=m.end(); ++p)
     deallog << p->row() << ' ' << p->column() << ' '
-           << p->value()
-           << std::endl;
+            << p->value()
+            << std::endl;
 }
 
index 01b7c3b7297e28facaf1f9cdd6f3513dc46c8fb3..fe3425fe6e080abb25ef92ed9cf7479e2f174725 100644 (file)
@@ -35,11 +35,11 @@ check ()
   FullMatrix<std::complex<number> > m;
   make_matrix (m);
 
-  
+
   for (typename FullMatrix<std::complex<number> >::const_iterator
-        p = m.begin(1); p!=m.end(1); ++p)
+       p = m.begin(1); p!=m.end(1); ++p)
     deallog << p->row() << ' ' << p->column() << ' '
-           << p->value()
-           << std::endl;
+            << p->value()
+            << std::endl;
 }
 
index d0487944322a7205fd6d7ca370c69daf38514e7c..95590c955a5d3823ff6cce59147d35ebdfd88fad 100644 (file)
@@ -33,11 +33,12 @@ void
 check ()
 {
   const std::complex<number> array[] = { 1, 2, 3, 4, 5,
-                          6, 7, 8, 9, 0,
-                          1, 2, 3, 4, 5,
-                          6, 7, 8, 9, 0,
-                          1, 2, 3, 4, 5 };
-  
+                                         6, 7, 8, 9, 0,
+                                         1, 2, 3, 4, 5,
+                                         6, 7, 8, 9, 0,
+                                         1, 2, 3, 4, 5
+                                       };
+
   FullMatrix<std::complex<number> > m (5,5,array);
 
   print_matrix (m);
index ed80679567fa2a8b0dbe78ea24c783da1d82a1e1..67193e564c02f39b64703703de56218cd3bc52eb 100644 (file)
@@ -37,7 +37,7 @@ check ()
 
   FullMatrix<std::complex<number> > n;
   n = m;
-  
+
   print_matrix (n);
 }
 
index 6c067b560d945ac98cb00d449a188673066d6132..3e8b8d9a8c2c77982c532762fe7648a689389032 100644 (file)
@@ -37,7 +37,7 @@ check ()
 
   FullMatrix<std::complex<number> > n;
   n.copy_from (m);
-  
+
   print_matrix (n);
 }
 
index 1d49e3a09d2b7e2acc48f0bb801455aff5f5b0bd..617be5ec0d333eed323f21a68e39606dce3660ea 100644 (file)
@@ -34,7 +34,7 @@ check ()
 {
   FullMatrix<std::complex<number> > m(3,3);
   deallog << m.all_zero() << std::endl;
-  
+
   make_matrix (m);
   deallog << m.all_zero() << std::endl;
 }
index 6784fea6045a1efa12cfdbdc4e9bce33811515d5..df5604c5aeee0266f511330d78e249a23d252f51 100644 (file)
@@ -36,7 +36,7 @@ check ()
   make_matrix (m);
   Vector<std::complex<number> > v;
   make_vector (v);
-  
+
   deallog << m.matrix_norm_square (v) << std::endl;
 }
 
index 2ca4eccf28085c137b197c11007104af960f201f..9b727d3b06d1e06847d46f4a8d3e29e8424c8188 100644 (file)
@@ -39,7 +39,7 @@ check ()
   make_vector (w);
   for (unsigned int i=0; i<w.size(); ++i)
     w(i) = w(i)+std::complex<number>(1.);
-  
+
   deallog << m.matrix_scalar_product (v,w) << std::endl;
 }
 
index 2dd334647d9b123aeda3a91e5f247a65d636a9be..2d967724ec2cf654a2e214f74a9304fded2ce789 100644 (file)
@@ -35,7 +35,7 @@ check ()
   for (unsigned int n=1; n<=3; ++n)
     {
       const std::complex<number> array[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
-    
+
       FullMatrix<std::complex<number> > m(n,n, array);
       print_matrix (m);
       deallog << m.determinant () << std::endl;
index b6e12d13b21b20ebecb698092d7e1dd7849a531f..4b2efca428ab0be822f337b76252708abbd5bcdb 100644 (file)
@@ -36,7 +36,7 @@ check ()
   make_matrix (m);
   make_matrix (n);
   m.add (3.14159, n);
-  
+
   print_matrix (m);
 }
 
index 48d140913d49c5fe8935cc68f834fab14adb20d6..fbaaf13544fcd935ae7b87b519906faa0b2ee8e0 100644 (file)
@@ -36,7 +36,7 @@ check ()
   make_matrix (m);
   make_matrix (n);
   m.equ (3.14159, n);
-  
+
   print_matrix (m);
 }
 
index 4bcf2bea7835b2b12c5d15a44dc1d92c32d20749..600faaaea1d8ec31900c4c2d1f80c7f9a60d11cd 100644 (file)
@@ -35,11 +35,12 @@ check ()
   for (unsigned int n=1; n<=5; ++n)
     {
       const std::complex<number> array[] = { 50, 2, 3, 4, 5,
-                              6, 50, 8, 9, 0,
-                              1, 2, 50, 4, 5,
-                              6, 7, 8, 50, 0,
-                              1, 2, 3, 4, 50 };
-  
+                                             6, 50, 8, 9, 0,
+                                             1, 2, 50, 4, 5,
+                                             6, 7, 8, 50, 0,
+                                             1, 2, 3, 4, 50
+                                           };
+
       FullMatrix<std::complex<number> > m (n,n,array), p(n,n);
       p.invert (m);
       print_matrix (p);
index d25c03b92ab223a7fa423ea71a723f0f43769e52..d02253300e4a7270a4697ec16b7aaca697db1fd0 100644 (file)
 // check Vector<std::complex<double> >::size()
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 
 
 void test (Vector<std::complex<double> > &v)
 {
-                                   // set only certain elements of the vector
+  // set only certain elements of the vector
   for (unsigned int i=0; i<v.size(); i+=1+i)
     v(i) = std::complex<double> (i+1., i+2.);
 
   v.compress ();
-  
+
   Assert (v.size() == 100, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -39,7 +39,7 @@ void test (Vector<std::complex<double> > &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_11/output");
   deallog.attach(logfile);
@@ -54,25 +54,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 1777eb6df40b4d23fa6ce1c54a16af749a8737d8..ad02e2362a112574ea2836235d23083fe2c30f68 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<std::complex<double> >::operator() in set-mode
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -27,9 +27,9 @@
 
 void test (Vector<std::complex<double> > &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -39,20 +39,20 @@ void test (Vector<std::complex<double> > &v)
 
   v.compress ();
 
-                                   // check that they are ok, and this time
-                                   // all of them
+  // check that they are ok, and this time
+  // all of them
   for (unsigned int i=0; i<v.size(); ++i)
     Assert ((((pattern[i] == true) && (v(i) == std::complex<double> (i+1., i+2.)))
              ||
              ((pattern[i] == false) && (v(i) == std::complex<double> (0)))),
-             ExcInternalError());
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_12/output");
   deallog.attach(logfile);
@@ -67,25 +67,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 86a0310e40ac7e48c5eacd057e754d533728405a..64a66c42b307179e9975ff648edf5a067918f6de 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<std::complex<double> >::operator() in add-mode
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -27,9 +27,9 @@
 
 void test (Vector<std::complex<double> > &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -39,20 +39,20 @@ void test (Vector<std::complex<double> > &v)
 
   v.compress ();
 
-                                   // check that they are ok, and this time
-                                   // all of them
+  // check that they are ok, and this time
+  // all of them
   for (unsigned int i=0; i<v.size(); ++i)
     Assert ((((pattern[i] == true) && (v(i) == std::complex<double> (i+1., i+2.)))
              ||
              ((pattern[i] == false) && (v(i) == std::complex<double> (0)))),
-             ExcInternalError());
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_13/output");
   deallog.attach(logfile);
@@ -67,25 +67,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 38e376589e13a9c1c41bd1b2c4b279e857e3810b..0e7292ba39632c030edf2e62800f23687b484db3 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<std::complex<double> >::operator() in set/add-mode alternatingly
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -27,9 +27,9 @@
 
 void test (Vector<std::complex<double> > &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   bool flag = false;
   for (unsigned int i=0; i<v.size(); i+=1+i)
@@ -39,26 +39,26 @@ void test (Vector<std::complex<double> > &v)
       else
         v(i) = std::complex<double> (i+1., i+2.);
       flag = !flag;
-      
+
       pattern[i] = true;
     }
 
   v.compress ();
 
-                                   // check that they are ok, and this time
-                                   // all of them
+  // check that they are ok, and this time
+  // all of them
   for (unsigned int i=0; i<v.size(); ++i)
     Assert (((pattern[i] == true) && (v(i) == std::complex<double> (i+1., i+2.)))
-           ||
-           ((pattern[i] == false) && (v(i) == std::complex<double>(0))),
-             ExcInternalError());
+            ||
+            ((pattern[i] == false) && (v(i) == std::complex<double>(0))),
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_14/output");
   deallog.attach(logfile);
@@ -73,25 +73,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 73faa7328ab626f4af642b1b7de596d0b374e906..e64fed5d9e311c92492b7447e3f88583630a4e6c 100644 (file)
@@ -20,7 +20,7 @@
 // writing to the same elements
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -28,9 +28,9 @@
 
 void test (Vector<std::complex<double> > &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -42,20 +42,20 @@ void test (Vector<std::complex<double> > &v)
 
   v.compress ();
 
-                                   // check that they are ok, and this time
-                                   // all of them
+  // check that they are ok, and this time
+  // all of them
   for (unsigned int i=0; i<v.size(); ++i)
     Assert (((pattern[i] == true) && (v(i) == 2.*std::complex<double> (i+1., i+2.)))
-           ||
-           ((pattern[i] == false) && (v(i) == std::complex<double>(0))),
-           ExcInternalError());
+            ||
+            ((pattern[i] == false) && (v(i) == std::complex<double>(0))),
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_15/output");
   deallog.attach(logfile);
@@ -70,25 +70,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 9d90896e0fc199ab471bb99dc93245b38cb1fe76..46198a5a81f7f8245c9d147492f3fde9e53c93a6 100644 (file)
@@ -20,7 +20,7 @@
 // writing and overwriting the same elements
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -28,9 +28,9 @@
 
 void test (Vector<std::complex<double> > &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -44,20 +44,20 @@ void test (Vector<std::complex<double> > &v)
 
   v.compress ();
 
-                                   // check that they are ok, and this time
-                                   // all of them
+  // check that they are ok, and this time
+  // all of them
   for (unsigned int i=0; i<v.size(); ++i)
     Assert (((pattern[i] == true) && (v(i) == std::complex<double> (i+1., i+2.)))
-           ||
-           ((pattern[i] == false) && (v(i) == std::complex<double> (0))),
-           ExcInternalError());
+            ||
+            ((pattern[i] == false) && (v(i) == std::complex<double> (0))),
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_16/output");
   deallog.attach(logfile);
@@ -72,25 +72,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 91d969fb2bbb92c35a9ade5cb268ed7f3b4297ad..142ecada91f3d3ec2ed8696730a4eccfe2eaef9c 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<std::complex<double> >::l1_norm()
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -27,7 +27,7 @@
 
 void test (Vector<std::complex<double> > &v)
 {
-                                   // set some elements of the vector
+  // set some elements of the vector
   double norm = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -36,7 +36,7 @@ void test (Vector<std::complex<double> > &v)
     }
   v.compress ();
 
-                                   // then check the norm
+  // then check the norm
   Assert (v.l1_norm() == norm, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -44,7 +44,7 @@ void test (Vector<std::complex<double> > &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_17/output");
   deallog.attach(logfile);
@@ -59,25 +59,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 5d4be0c4284e3e3f5a9c3f2045fd812685cfc1e4..d04ef3aa3d4a1111ec4b485cadc2dc2f560a6097 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<std::complex<double> >::l2_norm()
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
 
 void test (Vector<std::complex<double> > &v)
 {
-                                   // set some elements of the vector
+  // set some elements of the vector
   double norm = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
       v(i) = std::complex<double> (i+1., i+2.);
       norm += std::abs(std::complex<double> (i+1., i+2.))*
-             std::abs(std::complex<double> (i+1., i+2.));
+              std::abs(std::complex<double> (i+1., i+2.));
     }
   v.compress ();
 
-                                   // then check the norm
+  // then check the norm
   Assert (std::fabs((v.l2_norm() - std::sqrt(norm))/std::sqrt(norm)) < 1e-14, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -45,7 +45,7 @@ void test (Vector<std::complex<double> > &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_18/output");
   deallog.attach(logfile);
@@ -60,25 +60,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 0094ef31df968e6b1b0fc530ce7497448d3cf42d..9adb97d67e698f69cc281554fc6c7e0a0278a960 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<std::complex<double> >::linfty_norm()
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
 
 void test (Vector<std::complex<double> > &v)
 {
-                                   // set some elements of the vector
+  // set some elements of the vector
   double norm = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
       v(i) = std::complex<double> (i+1., i+2.);
       norm = std::max(norm,
-                     std::abs(std::complex<double> (i+1., i+2.)));
+                      std::abs(std::complex<double> (i+1., i+2.)));
     }
   v.compress ();
 
-                                   // then check the norm
+  // then check the norm
   Assert (v.linfty_norm() == norm, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -45,7 +45,7 @@ void test (Vector<std::complex<double> > &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_19/output");
   deallog.attach(logfile);
@@ -60,25 +60,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index bdd7da64fcdeefbb8c1b3ff6c94147b60b89353a..3c623ddfceb21c8b412a146c1aa35fb841a9aeb2 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<std::complex<double> >::operator *=
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -27,9 +27,9 @@
 
 void test (Vector<std::complex<double> > &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -38,22 +38,22 @@ void test (Vector<std::complex<double> > &v)
     }
   v.compress ();
 
-                                   // multiply v with 5/4
+  // multiply v with 5/4
   v *= 5./4.;
 
-                                   // check that the entries are ok
+  // check that the entries are ok
   for (unsigned int i=0; i<v.size(); ++i)
     Assert (((pattern[i] == true) && (v(i) == std::complex<double> (i+1., i+2.)*5./4.))
-           ||
-           ((pattern[i] == false) && (v(i) == std::complex<double>(0))),
-           ExcInternalError());
+            ||
+            ((pattern[i] == false) && (v(i) == std::complex<double>(0))),
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_20/output");
   deallog.attach(logfile);
@@ -68,25 +68,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 06cc0f87042d1139a15dfbebda69ba0937265db5..0375ae89c19e84bf7bf77da58168595364e4e938 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<std::complex<double> >::operator /=
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -27,9 +27,9 @@
 
 void test (Vector<std::complex<double> > &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -38,22 +38,22 @@ void test (Vector<std::complex<double> > &v)
     }
   v.compress ();
 
-                                   // multiply v with 3/4
+  // multiply v with 3/4
   v /= 4./3.;
 
-                                   // check that the entries are ok
+  // check that the entries are ok
   for (unsigned int i=0; i<v.size(); ++i)
     Assert (((pattern[i] == true) && (v(i) == std::complex<double> (i+1., i+2.)*3./4.))
-           ||
-           ((pattern[i] == false) && (v(i) == std::complex<double>(0))),
-           ExcInternalError());
+            ||
+            ((pattern[i] == false) && (v(i) == std::complex<double>(0))),
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_21/output");
   deallog.attach(logfile);
@@ -68,25 +68,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 7d105057947d3327accbe4c6b50ccae67a4646cd..4aaf7789c4ce563c56493f10704f8c3e1712ccea 100644 (file)
@@ -21,7 +21,7 @@
 // should have been that the factor is != 0...
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -29,9 +29,9 @@
 
 void test (Vector<std::complex<double> > &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -40,22 +40,22 @@ void test (Vector<std::complex<double> > &v)
     }
   v.compress ();
 
-                                   // multiply v with 3/4
+  // multiply v with 3/4
   v /= -4./3.;
 
-                                   // check that the entries are ok
+  // check that the entries are ok
   for (unsigned int i=0; i<v.size(); ++i)
     Assert (((pattern[i] == true) && (v(i)-(-1.*i*std::complex<double> (i+1., i+2.)*3./4.) == std::complex<double>(0)))
-           ||
-           ((pattern[i] == false) && (v(i) == std::complex<double>(0))),
-           ExcInternalError());
+            ||
+            ((pattern[i] == false) && (v(i) == std::complex<double>(0))),
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_21_negative/output");
   deallog.attach(logfile);
@@ -70,25 +70,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index e2dc3f5fa123f038e92d9b8bd0c291d40dbf83d5..4aa285c46d005a7d2ace67625e3e94289c61741e 100644 (file)
@@ -20,7 +20,7 @@
 // orthogonal
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -29,8 +29,8 @@
 void test (Vector<std::complex<double> > &v,
            Vector<std::complex<double> > &w)
 {
-                                   // set only certain elements of each
-                                   // vector, but disjoint sets of elements
+  // set only certain elements of each
+  // vector, but disjoint sets of elements
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = std::complex<double> (i+1., i+2.);
@@ -39,7 +39,7 @@ void test (Vector<std::complex<double> > &v,
   v.compress ();
   w.compress ();
 
-                                   // make sure the scalar product is zero
+  // make sure the scalar product is zero
   Assert (v*w == std::complex<double>(0), ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -47,7 +47,7 @@ void test (Vector<std::complex<double> > &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_22/output");
   deallog.attach(logfile);
@@ -63,25 +63,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index ea23a8ed2300773b614eac6278bc2fbc2bceffda..f3bb3800713310f2aa733eb91d6d88f1a61b60ee 100644 (file)
@@ -20,7 +20,7 @@
 // not orthogonal
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -29,9 +29,9 @@
 void test (Vector<std::complex<double> > &v,
            Vector<std::complex<double> > &w)
 {
-                                   // set only certain elements of each
-                                   // vector, and record the expected scalar
-                                   // product
+  // set only certain elements of each
+  // vector, and record the expected scalar
+  // product
   std::complex<double> product = 0;
   for (unsigned int i=0; i<v.size(); ++i)
     {
@@ -42,18 +42,18 @@ void test (Vector<std::complex<double> > &v,
           product += 1.*i*std::conj(std::complex<double> (i+1., i+2.));
         }
     }
-  
+
   v.compress ();
   w.compress ();
 
-  
-                                   // make sure the scalar product is correct
-  deallog << v*w << ' ' << w*v << ' '
-         << product << ' ' << std::conj(product) << std::endl;
-  
+
+  // make sure the scalar product is correct
+  deallog << v *w << ' ' << w *v << ' '
+          << product << ' ' << std::conj(product) << std::endl;
+
   Assert (v*w == product, ExcInternalError());
 
-                                  // also make sure that v*w=conj(w*v)
+  // also make sure that v*w=conj(w*v)
   Assert (w*v == std::conj(product), ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -61,7 +61,7 @@ void test (Vector<std::complex<double> > &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_23/output");
   deallog.attach(logfile);
@@ -77,25 +77,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index c22d2b9213ab8c99a19d57a1d021863a30c322aa..cb61b18439af8f01e97f279b0e293a52e6ad66a3 100644 (file)
@@ -21,7 +21,7 @@
 // may be covered by one of the other tests
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
 
 void test (Vector<std::complex<double> > &v)
 {
-                                   // set some entries of the vector
+  // set some entries of the vector
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = std::complex<double> (i+1., i+2.);
   v.compress ();
 
-                                   // then clear it again and make sure the
-                                   // vector is really empty
+  // then clear it again and make sure the
+  // vector is really empty
   const unsigned int sz = v.size();
   v = 0;
   Assert (v.size() == sz, ExcInternalError());
@@ -47,7 +47,7 @@ void test (Vector<std::complex<double> > &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_24/output");
   deallog.attach(logfile);
@@ -62,25 +62,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 33e6e7c1a968d2adf5ea307b9bfc224603ce03d5..fcc8f3193cd0eb071ea04efba251c7af017415b0 100644 (file)
@@ -18,7 +18,7 @@
 // check Vector::operator = (Scalar) with setting to zero
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
 
 void test (Vector<std::complex<double> > &v)
 {
-                                   // set some entries of the vector
+  // set some entries of the vector
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = std::complex<double> (i+1., i+2.);
   v.compress ();
 
-                                   // then clear it again and make sure the
-                                   // vector is really empty
+  // then clear it again and make sure the
+  // vector is really empty
   const unsigned int sz = v.size();
   v = 0;
   Assert (v.size() == sz, ExcInternalError());
@@ -43,7 +43,7 @@ void test (Vector<std::complex<double> > &v)
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_25/output");
   deallog.attach(logfile);
@@ -58,25 +58,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 7bfc4a9ca629585c5eb27f9efece9f5153bce41b..ab0a0a7a2f4f47d1ab7a61a626ec1097ed130cd6 100644 (file)
@@ -19,7 +19,7 @@
 // nonzero value
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -27,7 +27,7 @@
 
 void test (Vector<std::complex<double> > &v)
 {
-                                   // set some entries of the vector
+  // set some entries of the vector
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = std::complex<double> (i+1., i+2.);
@@ -42,7 +42,7 @@ void test (Vector<std::complex<double> > &v)
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_26/output");
   deallog.attach(logfile);
@@ -57,25 +57,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 1d17c8086d6338b5bfc5fad88b55cfd29c3487d7..caf6504b51915d7e3e8bcddb80028288e5200ff2 100644 (file)
 
 
 
-// check Vector<std::complex<double> >::operator = (Vector) 
+// check Vector<std::complex<double> >::operator = (Vector)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
 
 void test (Vector<std::complex<double> > &v)
 {
-                                   // set some entries of the vector
+  // set some entries of the vector
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = std::complex<double> (i+1., i+2.);
   v.compress ();
 
-                                   // then copy it
+  // then copy it
   Vector<std::complex<double> > w (v.size());
   w = v;
 
-                                   // make sure they're equal
+  // make sure they're equal
   deallog << std::abs(v*w) << ' ' << v.l2_norm() * w.l2_norm()
           << ' ' << std::abs(v*w) - v.l2_norm() * w.l2_norm() << std::endl;
   Assert (std::abs(std::abs(v*w) - v.l2_norm() * w.l2_norm()) <
-         1e-14*(std::abs(v*w)),
+          1e-14*(std::abs(v*w)),
           ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -49,7 +49,7 @@ void test (Vector<std::complex<double> > &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_27/output");
   deallog.attach(logfile);
@@ -64,25 +64,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index dcae97fac36c58338c4676067522bd1436bb397b..8f1482cb59e359f86d5c22ab6a5dbda625c3284c 100644 (file)
@@ -20,7 +20,7 @@
 // resize the vector to be copied to beforehand
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
 
 void test (Vector<std::complex<double> > &v)
 {
-                                   // set some entries of the vector
+  // set some entries of the vector
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = std::complex<double> (i+1., i+2.);
   v.compress ();
 
-                                   // then copy it to a vector of different
-                                   // size
+  // then copy it to a vector of different
+  // size
   Vector<std::complex<double> > w (1);
   w = v;
 
-                                   // make sure they're equal
+  // make sure they're equal
   deallog << std::abs(v*w) << ' ' << v.l2_norm() * w.l2_norm()
           << ' ' << std::abs(v*w) - v.l2_norm() * w.l2_norm() << std::endl;
   Assert (std::abs(std::abs(v*w) - v.l2_norm() * w.l2_norm()) <
-         1e-14*std::abs(v*w),
+          1e-14*std::abs(v*w),
           ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -51,7 +51,7 @@ void test (Vector<std::complex<double> > &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_28/output");
   deallog.attach(logfile);
@@ -66,25 +66,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 848f6207767deb8cfa704b5f845be8421727f7e0..6de6b5581fe9425ecb416d1d9babb39d2e06c06b 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<std::complex<double> >::reinit(fast)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -28,7 +28,7 @@
 void test (Vector<std::complex<double> > &v)
 {
   v.reinit (13, true);
-  
+
   Assert (v.size() == 13, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -36,7 +36,7 @@ void test (Vector<std::complex<double> > &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_29/output");
   deallog.attach(logfile);
@@ -51,25 +51,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 4a884457f040afc694f8c13bc39656123e95aefe..3fa0b99e169cb9748976927271d8cbf95e89a64e 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<std::complex<double> >::reinit(!fast)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
 
 void test (Vector<std::complex<double> > &v)
 {
-                                   // set some entries of the vector
+  // set some entries of the vector
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = std::complex<double> (i+1., i+2.);
   v.compress ();
 
-                                   // then resize with setting to zero
+  // then resize with setting to zero
   v.reinit (13, false);
-  
+
   Assert (v.size() == 13, ExcInternalError());
   Assert (v.l2_norm() == 0, ExcInternalError());
 
@@ -44,7 +44,7 @@ void test (Vector<std::complex<double> > &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_30/output");
   deallog.attach(logfile);
@@ -59,25 +59,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index a27d975ad121e3361b68af66fab0400492dc794d..1e856f6f2a4926c3424f50a7cd894cf669579507 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<std::complex<double> >::l2_norm()
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
 
 void test (Vector<std::complex<double> > &v)
 {
-                                   // set some elements of the vector
+  // set some elements of the vector
   std::complex<double> norm = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
       v(i) = std::complex<double> (i+1., i+2.);
       norm += std::conj(std::complex<double> (i+1., i+2.)) *
-             std::complex<double> (i+1., i+2.);
+              std::complex<double> (i+1., i+2.);
     }
   v.compress ();
 
-                                   // then check the norm
+  // then check the norm
   Assert (std::abs(v.norm_sqr() - norm) < 1e-14*std::abs(norm),
           ExcInternalError());
 
@@ -46,7 +46,7 @@ void test (Vector<std::complex<double> > &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_31/output");
   deallog.attach(logfile);
@@ -61,25 +61,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index a96f9ac4ab1af081597d5afd51d8067a0f083592..6e47089122ad1d5e5d07aff760459c2f25f86792 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<std::complex<double> >::mean_value()
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -27,7 +27,7 @@
 
 void test (Vector<std::complex<double> > &v)
 {
-                                   // set some elements of the vector
+  // set some elements of the vector
   std::complex<double> sum = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -36,9 +36,9 @@ void test (Vector<std::complex<double> > &v)
     }
   v.compress ();
 
-                                   // then check the norm
+  // then check the norm
   Assert (std::abs(v.mean_value() - sum/(1.*v.size())) <
-         1e-14*std::abs(sum)/v.size(),
+          1e-14*std::abs(sum)/v.size(),
           ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -46,7 +46,7 @@ void test (Vector<std::complex<double> > &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_32/output");
   deallog.attach(logfile);
@@ -61,25 +61,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 0b0c322e1df3c9ee348336f738444771d43b03da..6230fdfb2693b746684d7c78085a7fadacd753e1 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<std::complex<double> >::lp_norm(3)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
 
 void test (Vector<std::complex<double> > &v)
 {
-                                   // set some elements of the vector
+  // set some elements of the vector
   std::complex<double> sum = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
       v(i) = std::complex<double> (i+1., i+2.);
       sum += std::pow (std::abs(std::complex<double> (i+1., i+2.)),
-                      3);
+                       3);
     }
   v.compress ();
 
-                                   // then check the norm
+  // then check the norm
   Assert (std::abs(v.lp_norm(3) - std::pow(sum, 1./3.)) <
           1e-14*std::abs(std::pow(sum, 1./3.)),
           ExcInternalError());
@@ -47,7 +47,7 @@ void test (Vector<std::complex<double> > &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_33/output");
   deallog.attach(logfile);
@@ -62,25 +62,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 40b4c16c48a2fe2582a3d9737bd2a38dd15761c9..9cf08801df9e4fccaf6ebd749eccc75fe246f722 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<std::complex<double> >::all_zero
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
 
 void test (Vector<std::complex<double> > &v)
 {
-                                   // set some elements of the vector
+  // set some elements of the vector
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
       v(i) = std::complex<double> (i+1., i+2.);
     }
   v.compress ();
 
-                                   // set them to zero again
+  // set them to zero again
   v = 0;
 
-                                   // then check all_zero
+  // then check all_zero
   Assert (v.all_zero() == true, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -45,7 +45,7 @@ void test (Vector<std::complex<double> > &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_34/output");
   deallog.attach(logfile);
@@ -60,25 +60,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 038856e2958ff00429513e5c31358f13af022308..f5f974ece5995cd991a3810a703af1791a82f7f9 100644 (file)
 
 
 
-// check Vector<std::complex<double> >::operator+=(Vector) 
+// check Vector<std::complex<double> >::operator+=(Vector)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
 void test (Vector<std::complex<double> > &v,
            Vector<std::complex<double> > &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       if (i%3 == 0)
         w(i) = std::complex<double> (i+1., i+2.);
     }
-  
+
   v.compress ();
   w.compress ();
 
   v += w;
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       if (i%3 == 0)
         {
           Assert (w(i) == std::complex<double> (i+1., i+2.),
-                 ExcInternalError());
+                  ExcInternalError());
           Assert (v(i) == std::complex<double> (i+1., i+2.)+1.*i,
-                 ExcInternalError());
+                  ExcInternalError());
         }
       else
         {
@@ -65,7 +65,7 @@ void test (Vector<std::complex<double> > &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_35/output");
   deallog.attach(logfile);
@@ -81,25 +81,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index de33bba2cdf85082a98073196bee9e70e67807b9..4311a13a0a563f175de48ab79fbc59e6f29a4c4a 100644 (file)
 
 
 
-// check Vector<std::complex<double> >::operator-=(Vector) 
+// check Vector<std::complex<double> >::operator-=(Vector)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
 void test (Vector<std::complex<double> > &v,
            Vector<std::complex<double> > &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       if (i%3 == 0)
         w(i) = std::complex<double> (i+1., i+2.);
     }
-  
+
   v.compress ();
   w.compress ();
 
   v -= w;
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       if (i%3 == 0)
         {
           Assert (w(i) == std::complex<double> (i+1., i+2.),
-                 ExcInternalError());
+                  ExcInternalError());
           Assert (v(i) == std::complex<double> (-1., -(i+2.)),
-                 ExcInternalError());
+                  ExcInternalError());
         }
       else
         {
@@ -65,7 +65,7 @@ void test (Vector<std::complex<double> > &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_36/output");
   deallog.attach(logfile);
@@ -81,25 +81,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 2471d00789d5b30fadfa1ac0d740afadb13c37b5..ddf131c01848d80fc83d9a0e456905118e879660 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<std::complex<double> >::add (scalar)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -29,22 +29,22 @@ void test (Vector<std::complex<double> > &v)
 {
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = std::complex<double> (i+1., i+2.);
-  
+
   v.compress ();
 
   v.add (1.);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     Assert (v(i) == std::complex<double> (i+2., i+2.),
-           ExcInternalError());
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_37/output");
   deallog.attach(logfile);
@@ -59,25 +59,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 036ad2ac69d7e899e5ccfab02c6268f311ad20ce..c1d7754ebf56c3490be596cba11972d26f77efe5 100644 (file)
 
 
 
-// check Vector<std::complex<double> >::add(Vector) 
+// check Vector<std::complex<double> >::add(Vector)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -33,19 +33,19 @@ void test (Vector<std::complex<double> > &v,
       v(i) = i;
       w(i) = std::complex<double> (i+1., i+2.);
     }
-  
+
   v.compress ();
   w.compress ();
 
   v.add (w);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == std::complex<double> (i+1., i+2.),
-             ExcInternalError());
+              ExcInternalError());
       Assert (v(i) == 1.*i+std::complex<double> (i+1., i+2.),
-             ExcInternalError());
+              ExcInternalError());
     }
 
   deallog << "OK" << std::endl;
@@ -53,7 +53,7 @@ void test (Vector<std::complex<double> > &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_38/output");
   deallog.attach(logfile);
@@ -69,25 +69,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 7d70578565c333d83e017257bf3a4ab4cbc4bcdb..808bf0e9994604d09276daa9b9f865f46608d9b5 100644 (file)
 
 
 
-// check Vector<std::complex<double> >::add(scalar, Vector) 
+// check Vector<std::complex<double> >::add(scalar, Vector)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -33,19 +33,19 @@ void test (Vector<std::complex<double> > &v,
       v(i) = i;
       w(i) = std::complex<double> (i+1., i+2.);
     }
-  
+
   v.compress ();
   w.compress ();
 
   v.add (2, w);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == std::complex<double> (i+1., i+2.),
-             ExcInternalError());
+              ExcInternalError());
       Assert (v(i) == 1.*i+2.*std::complex<double> (i+1., i+2.),
-             ExcInternalError());
+              ExcInternalError());
     }
 
   deallog << "OK" << std::endl;
@@ -53,7 +53,7 @@ void test (Vector<std::complex<double> > &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_39/output");
   deallog.attach(logfile);
@@ -69,25 +69,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 94b5ecc491532964aa17eecfecae28322d13fcc3..b69a1ac02491993091946f048164b81fd8e9adf3 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<std::complex<double> >::add(s,V,s,V)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -35,20 +35,20 @@ void test (Vector<std::complex<double> > &v,
       w(i) = std::complex<double> (i+1., i+2.);
       x(i) = i+2.;
     }
-  
+
   v.compress ();
   w.compress ();
   x.compress ();
 
   v.add (2, w, 3, x);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == std::complex<double> (i+1., i+2.), ExcInternalError());
       Assert (x(i) == i+2., ExcInternalError());
       Assert (v(i) == 1.*i+2.*std::complex<double> (i+1., i+2.)+3*(i+2.),
-             ExcInternalError());
+              ExcInternalError());
     }
 
   deallog << "OK" << std::endl;
@@ -56,7 +56,7 @@ void test (Vector<std::complex<double> > &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_40/output");
   deallog.attach(logfile);
@@ -73,25 +73,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index fc6d7b509473b47d1cf124f36ac3cce636896083..f0d817ee4c9d74ec6087ea25fa62ef6436a1b129 100644 (file)
 
 
 
-// check Vector<std::complex<double> >::sadd(s, Vector) 
+// check Vector<std::complex<double> >::sadd(s, Vector)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -33,19 +33,19 @@ void test (Vector<std::complex<double> > &v,
       v(i) = i;
       w(i) = std::complex<double> (i+1., i+2.);
     }
-  
+
   v.compress ();
   w.compress ();
 
   v.sadd (2, w);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == std::complex<double> (i+1., i+2.),
-             ExcInternalError());
+              ExcInternalError());
       Assert (v(i) == 2.*i+std::complex<double> (i+1., i+2.),
-             ExcInternalError());
+              ExcInternalError());
     }
 
   deallog << "OK" << std::endl;
@@ -53,7 +53,7 @@ void test (Vector<std::complex<double> > &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_41/output");
   deallog.attach(logfile);
@@ -69,25 +69,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index e41f793a1a6bcf2665625ab9b3eedee99d280edc..fe3154adbc08bc9fdabd230a593eb4afcc928f9e 100644 (file)
 
 
 
-// check Vector<std::complex<double> >::sadd(scalar, scalar, Vector) 
+// check Vector<std::complex<double> >::sadd(scalar, scalar, Vector)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -33,19 +33,19 @@ void test (Vector<std::complex<double> > &v,
       v(i) = i;
       w(i) = std::complex<double> (i+1., i+2.);
     }
-  
+
   v.compress ();
   w.compress ();
 
   v.sadd (3, 2, w);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == std::complex<double> (i+1., i+2.),
-             ExcInternalError());
+              ExcInternalError());
       Assert (v(i) == 3.*i+2.*std::complex<double> (i+1., i+2.),
-             ExcInternalError());
+              ExcInternalError());
     }
 
   deallog << "OK" << std::endl;
@@ -53,7 +53,7 @@ void test (Vector<std::complex<double> > &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_42/output");
   deallog.attach(logfile);
@@ -69,25 +69,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 36c5b2000db60dd6c7689d4b24e493cd0c67deaa..527d67ecdedba5f3f02760bd57123fa130dab349 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<std::complex<double> >::sadd(s,s,V,s,V)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -35,20 +35,20 @@ void test (Vector<std::complex<double> > &v,
       w(i) = std::complex<double> (i+1., i+2.);
       x(i) = i+2.;
     }
-  
+
   v.compress ();
   w.compress ();
   x.compress ();
 
   v.sadd (1.5, 2, w, 3, x);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == std::complex<double> (i+1., i+2.), ExcInternalError());
       Assert (x(i) == i+2., ExcInternalError());
       Assert (v(i) == 1.5*i+2.*std::complex<double> (i+1., i+2.)+3*(i+2.),
-             ExcInternalError());
+              ExcInternalError());
     }
 
   deallog << "OK" << std::endl;
@@ -56,7 +56,7 @@ void test (Vector<std::complex<double> > &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_43/output");
   deallog.attach(logfile);
@@ -73,25 +73,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index abc571772339aab1db14ab109ea0dd17557479ec..5b46f67c51ff1077d7d88bd169e7f6cf3c4da5e4 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<std::complex<double> >::sadd(s,s,V,s,V,s,V)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -37,7 +37,7 @@ void test (Vector<std::complex<double> > &v,
       x(i) = i+2.;
       y(i) = std::complex<double> (i+3., i+4.);
     }
-  
+
   v.compress ();
   w.compress ();
   x.compress ();
@@ -45,18 +45,18 @@ void test (Vector<std::complex<double> > &v,
 
   v.sadd (1.5, 2, w, 3, x, 4, y);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == std::complex<double> (i+1., i+2.),
-             ExcInternalError());
+              ExcInternalError());
       Assert (x(i) == i+2., ExcInternalError());
       Assert (y(i) == std::complex<double> (i+3., i+4.),
-             ExcInternalError());
+              ExcInternalError());
       Assert (v(i) ==
-             1.5*i+2.*std::complex<double> (i+1., i+2.)+
-             3.*(i+2.)+4.*std::complex<double> (i+3., i+4.),
-             ExcInternalError());
+              1.5*i+2.*std::complex<double> (i+1., i+2.)+
+              3.*(i+2.)+4.*std::complex<double> (i+3., i+4.),
+              ExcInternalError());
     }
 
   deallog << "OK" << std::endl;
@@ -64,7 +64,7 @@ void test (Vector<std::complex<double> > &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_44/output");
   deallog.attach(logfile);
@@ -82,25 +82,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 6df225f7cedfc98a8299253dc19023c93b3ea2fa..28251a49d90a33313dccf02b1ad5991ada91d34e 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<std::complex<double> >::scale
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -33,13 +33,13 @@ void test (Vector<std::complex<double> > &v,
       v(i) = i;
       w(i) = std::complex<double> (i+1., i+2.);
     }
-  
+
   v.compress ();
   w.compress ();
 
   v.scale (w);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == std::complex<double> (i+1., i+2.), ExcInternalError());
@@ -51,7 +51,7 @@ void test (Vector<std::complex<double> > &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_45/output");
   deallog.attach(logfile);
@@ -67,25 +67,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 64c6cb139a66f845dae562b475179645825aefa3..d531b58592208ae727153b6c55142175a26aeac9 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<std::complex<double> >::equ (s,V)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -33,19 +33,19 @@ void test (Vector<std::complex<double> > &v,
       v(i) = i;
       w(i) = std::complex<double> (i+1., i+2.);
     }
-  
+
   v.compress ();
   w.compress ();
 
   v.equ (2, w);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == std::complex<double> (i+1., i+2.),
-             ExcInternalError());
+              ExcInternalError());
       Assert (v(i) == 2.*std::complex<double> (i+1., i+2.),
-             ExcInternalError());
+              ExcInternalError());
     }
 
   deallog << "OK" << std::endl;
@@ -53,7 +53,7 @@ void test (Vector<std::complex<double> > &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_46/output");
   deallog.attach(logfile);
@@ -69,25 +69,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 9c58366c7adea6e305dd1845cfead0a03ae45099..722c4937adff179b29285264532ad63ddfff1295 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<std::complex<double> >::equ (s,V,s,V)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -35,21 +35,21 @@ void test (Vector<std::complex<double> > &v,
       w(i) = std::complex<double> (i+1., i+2.);
       x(i) = i+2.;
     }
-  
+
   v.compress ();
   w.compress ();
   x.compress ();
 
   v.equ (2, w, 3, x);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == std::complex<double> (i+1., i+2.),
-             ExcInternalError());
+              ExcInternalError());
       Assert (x(i) == i+2., ExcInternalError());
       Assert (v(i) == 2.*std::complex<double> (i+1., i+2.)+3.*(i+2.),
-             ExcInternalError());
+              ExcInternalError());
     }
 
   deallog << "OK" << std::endl;
@@ -57,7 +57,7 @@ void test (Vector<std::complex<double> > &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_47/output");
   deallog.attach(logfile);
@@ -74,25 +74,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index c8c3f68fe632856f6fbbce46da35119170f7121a..95935d9483c04c192d4b69559026488f22df6fbe 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<std::complex<double> >::ratio
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -35,23 +35,23 @@ void test (Vector<std::complex<double> > &v,
       w(i) = std::complex<double> (i+2., i+3.);
       x(i) = std::complex<double> (i+3., i+4.);
     }
-  
+
   v.compress ();
   w.compress ();
   x.compress ();
 
   v.ratio (w, x);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == std::complex<double> (i+2., i+3.),
-             ExcInternalError());
+              ExcInternalError());
       Assert (x(i) == std::complex<double> (i+3., i+4.),
-             ExcInternalError());
+              ExcInternalError());
       Assert (std::abs(v(i) -
-                      std::complex<double> (i+2., i+3.) /
-                      std::complex<double> (i+3., i+4.)) < 1e-14*std::abs(v(i)),
+                       std::complex<double> (i+2., i+3.) /
+                       std::complex<double> (i+3., i+4.)) < 1e-14*std::abs(v(i)),
               ExcInternalError());
     }
 
@@ -60,7 +60,7 @@ void test (Vector<std::complex<double> > &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_48/output");
   deallog.attach(logfile);
@@ -77,25 +77,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 9e187396cc93db883a83474b337f94d90e5c80bb..aae3915dc72acd63202f152827cea4ebdfb963de 100644 (file)
@@ -20,7 +20,7 @@
 // argument
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
 
 void test (Vector<std::complex<double> > &v)
 {
-                                   // set some entries of the vector
+  // set some entries of the vector
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = std::complex<double> (i+1., i+2.);
   v.compress ();
 
-                                   // then copy it
+  // then copy it
   Vector<std::complex<double> > w (v);
 
-                                   // make sure they're equal
+  // make sure they're equal
   deallog << std::abs(v*w) << ' ' << v.l2_norm() * w.l2_norm()
           << ' ' << std::abs(v*w) - v.l2_norm() * w.l2_norm() << std::endl;
   Assert (std::abs(std::abs(v*w) - v.l2_norm() * w.l2_norm())
-         < 1e-14*std::abs(v*w),
+          < 1e-14*std::abs(v*w),
           ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -49,7 +49,7 @@ void test (Vector<std::complex<double> > &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_49/output");
   deallog.attach(logfile);
@@ -64,25 +64,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index ea6c0adbe15c58909e8c36f54405eb3271f322cf..da868190c7680f93ad5129e6c0d25958c36f1698 100644 (file)
@@ -20,7 +20,7 @@
 // equal
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -29,8 +29,8 @@
 void test (Vector<std::complex<double> > &v,
            Vector<std::complex<double> > &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = std::complex<double> (i+0., i+1.);
@@ -61,25 +61,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index bcdb07fc45ba5dafa0ef08ca260169c6775fdae3..4d2e0abf36aadd275bc829aaf45427be41cd7b78 100644 (file)
@@ -20,7 +20,7 @@
 // equal
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
 void test (Vector<std::complex<double> > &v,
            Vector<std::complex<double> > &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = std::complex<double> (i, i+1.);
       if (i%3 == 0)
         w(i) = std::complex<double> (i+1., i+2.);
     }
-                                   // but then copy elements and make sure the
-                                   // vectors are actually equal
+  // but then copy elements and make sure the
+  // vectors are actually equal
   v = w;
   Assert (v==w, ExcInternalError());
 
@@ -63,25 +63,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index fbb71d365510667292d7ba04662da30d0de0d699..f27cb1ecc40f87de248811391e139fd3cb221075 100644 (file)
@@ -20,7 +20,7 @@
 // equal
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -29,8 +29,8 @@
 void test (Vector<std::complex<double> > &v,
            Vector<std::complex<double> > &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = std::complex<double> (i, i+1.);
@@ -61,25 +61,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 97c37232348b0764c579e7496006939902f91cdb..41873359e2aa3f70f0c25bc0264fc5c14b1f2af9 100644 (file)
@@ -20,7 +20,7 @@
 // equal
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
 void test (Vector<std::complex<double> > &v,
            Vector<std::complex<double> > &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = std::complex<double> (i, i+1.);
       if (i%3 == 0)
         w(i) = std::complex<double> (i+1., i+2.);
     }
-                                   // but then copy elements and make sure the
-                                   // vectors are actually equal
+  // but then copy elements and make sure the
+  // vectors are actually equal
   v = w;
   Assert (! (v.operator != (w)), ExcInternalError());
 
@@ -63,25 +63,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index f98a3cb67671358da57b1923d4b1db41c7130752..6d9b54380e797c0448539272298aac3b88a7c042 100644 (file)
@@ -20,7 +20,7 @@
 // equal and different template arguments
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -29,8 +29,8 @@
 void test (Vector<std::complex<double> > &v,
            Vector<std::complex<float> > &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = std::complex<double> (i, i+1.);
@@ -62,25 +62,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index b0f5ff6370dea8df5e3ebd9a210cd2bb1e6059ad..704b4b5bb5d8d60c5f0c17d6497eaf44a5c953ec 100644 (file)
@@ -20,7 +20,7 @@
 // equal and different template arguments
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
 void test (Vector<std::complex<double> > &v,
            Vector<std::complex<float> > &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = std::complex<double> (i, i+1.);
       if (i%3 == 0)
         w(i) = std::complex<double> (i+1., i+2.);
     }
-                                   // but then copy elements and make sure the
-                                   // vectors are actually equal
+  // but then copy elements and make sure the
+  // vectors are actually equal
   v = w;
   Assert (v==w, ExcInternalError());
   Assert (w==v, ExcInternalError());
@@ -64,25 +64,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 7492e28f39d337b4e7c9e31b249eaa032891f9e3..c65a6e0f4a78afd8714db24659b742a2fbe6033a 100644 (file)
@@ -20,7 +20,7 @@
 // equal and different template arguments
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -29,8 +29,8 @@
 void test (Vector<std::complex<double> > &v,
            Vector<std::complex<float> > &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = std::complex<double> (i, i+1.);
@@ -62,25 +62,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index ebdb2017b4b53e5b025860bcd3699d27e5711bce..ab52c446116f0c9741b126e850a89a7a5bf616ec 100644 (file)
@@ -20,7 +20,7 @@
 // equal and different template arguments
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
 void test (Vector<std::complex<double> > &v,
            Vector<std::complex<float> > &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = std::complex<double> (i, i+1.);
       if (i%3 == 0)
         w(i) = std::complex<double> (i+1., i+2.);
     }
-                                   // but then copy elements and make sure the
-                                   // vectors are actually equal
+  // but then copy elements and make sure the
+  // vectors are actually equal
   v = w;
   Assert (! (v!=w), ExcInternalError());
   Assert (! (w!=v), ExcInternalError());
@@ -64,25 +64,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index d826bd04dd122b04111ba8b33310d29f2a9a4c55..c1a83d17ad8f814a818a5a0264e52a9e182fb4f6 100644 (file)
@@ -22,7 +22,7 @@
 // now autoconf'ed.
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 
@@ -34,13 +34,13 @@ void test (Vector<std::complex<double> > &v)
   Vector<std::complex<float> > w(v);
 
   Assert (w==v, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("complex_vector_vector_01/output");
   deallog.attach(logfile);
@@ -55,25 +55,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index f34d858b5eacc768cad718eca7070d063c4b1d30..e9905a35efca487ae861780a416d8f5e4fcfe5be 100644 (file)
 
 void test ()
 {
-                                   // set up a sparsity pattern. since
-                                   // CompressedSetSparsityPatterns are most
-                                   // often used for 3d, use a rather large
-                                   // number of entries per row
+  // set up a sparsity pattern. since
+  // CompressedSetSparsityPatterns are most
+  // often used for 3d, use a rather large
+  // number of entries per row
   const unsigned int N = 1000;
   CompressedSetSparsityPattern csp (N,N);
   for (unsigned int i=0; i<N; ++i)
@@ -45,7 +45,7 @@ void test ()
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("compressed_set_sparsity_pattern_01/output");
   deallog.attach(logfile);
index 5b147061940e668e38d856dba10abaa1e82bf22a..63aedbca92a148122226f8f9ffe0f6ff64bb0e7c 100644 (file)
 
 void test ()
 {
-                                   // set up a sparsity pattern. since
-                                   // CompressedSetSparsityPatterns are most
-                                   // often used for 3d, use a rather large
-                                   // number of entries per row
+  // set up a sparsity pattern. since
+  // CompressedSetSparsityPatterns are most
+  // often used for 3d, use a rather large
+  // number of entries per row
   const unsigned int N = 1000;
   CompressedSetSparsityPattern csp (N,N);
   for (unsigned int i=0; i<N; ++i)
@@ -42,7 +42,7 @@ void test ()
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("compressed_set_sparsity_pattern_02/output");
   deallog.attach(logfile);
index d9d4338e8cc971d2708692bda89d3dad6c3ab2cd..007431eeee5150daa008be8eb0aa44e9099850b0 100644 (file)
 
 void test ()
 {
-                                   // set up a sparsity pattern. since
-                                   // CompressedSetSparsityPatterns are most
-                                   // often used for 3d, use a rather large
-                                   // number of entries per row
+  // set up a sparsity pattern. since
+  // CompressedSetSparsityPatterns are most
+  // often used for 3d, use a rather large
+  // number of entries per row
   const unsigned int N = 1000;
   CompressedSetSparsityPattern csp (N,N);
   for (unsigned int i=0; i<N; ++i)
@@ -47,14 +47,14 @@ void test ()
                                                     true))
               == csp.row_length(i),
               ExcInternalError());
-      
+
       deallog << i << ' ' << csp.row_length (i) << std::endl;
     }
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("compressed_set_sparsity_pattern_03/output");
   deallog.attach(logfile);
index 303d79d68111cefe020400d1dd0dba8cc165e788..2f4f8ba4a39a95ff856236b87676238413ca3bca 100644 (file)
@@ -39,15 +39,15 @@ void test ()
     {
       unsigned int index = 0;
       for (CompressedSetSparsityPattern::row_iterator
-            j = csp.row_begin(i); j != csp.row_end(i); ++j, ++index)
-       deallog << i << ' ' << index << ' ' << *j
-               << std::endl;
+           j = csp.row_begin(i); j != csp.row_end(i); ++j, ++index)
+        deallog << i << ' ' << index << ' ' << *j
+                << std::endl;
     }
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("compressed_set_sparsity_pattern_04/output");
   deallog.attach(logfile);
index 3af74dd8c50b8b3865910b2c931274a5e6422f0f..a6384df9510bb546fac74878e6d0d9b78e714832 100644 (file)
@@ -40,15 +40,15 @@ void test ()
     {
       unsigned int index = 0;
       for (CompressedSetSparsityPattern::row_iterator
-            j = csp.row_begin(i); j != csp.row_end(i); ++j, ++index)
-       deallog << i << ' ' << index << ' ' << *j
-               << std::endl;
+           j = csp.row_begin(i); j != csp.row_end(i); ++j, ++index)
+        deallog << i << ' ' << index << ' ' << *j
+                << std::endl;
     }
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("compressed_set_sparsity_pattern_05/output");
   deallog.attach(logfile);
index 96af1a5511c1142cba9dba183adbe17659b0095b..b234b80ef2e9a3654f24428a0f8f1462fa774f34 100644 (file)
@@ -44,7 +44,7 @@ void test ()
 
 
 
-int main () 
+int main ()
 {
   deallog.attach(logfile);
   deallog.depth_console(0);
index 08c8dfe91d47dfbeae7a76a643dcac36a206ee50..4c1ef9adc2387fd6b7b109e24e0b6d147eed3f8b 100644 (file)
@@ -47,7 +47,7 @@ void test ()
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("compressed_set_sparsity_pattern_07/output");
   deallog.attach(logfile);
index 77f451595dd71907ed8b89e053067afe24493c35..e7de1e0ac86603dfa00096ac911df969833a07b0 100644 (file)
 
 void test ()
 {
-                                   // set up a sparsity pattern. since
-                                   // CompressedSetSparsityPatterns are most
-                                   // often used for 3d, use a rather large
-                                   // number of entries per row
+  // set up a sparsity pattern. since
+  // CompressedSetSparsityPatterns are most
+  // often used for 3d, use a rather large
+  // number of entries per row
   const unsigned int N = 1000;
   CompressedSetSparsityPattern csp (N,N);
   for (unsigned int i=0; i<N; ++i)
@@ -42,7 +42,7 @@ void test ()
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("compressed_set_sparsity_pattern_08/output");
   deallog.attach(logfile);
index dea094e791c78c5aa7918d595e5ca03d14094528..54bf98c737a8d99a23bf363c047205e6e1718f99 100644 (file)
@@ -33,13 +33,13 @@ void test ()
 
   csp.reinit (N, N);
   Assert (csp.empty() == false, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("compressed_set_sparsity_pattern_09/output");
   deallog.attach(logfile);
index 4d2a57d11e94f59dabfb3d4430e8bb05610af1fa..a14f9e1937ec2b68c7d688883485368c4492504e 100644 (file)
 
 void test ()
 {
-                                   // set up a sparsity pattern. since
-                                   // CompressedSparsityPatterns are most
-                                   // often used for 3d, use a rather large
-                                   // number of entries per row
+  // set up a sparsity pattern. since
+  // CompressedSparsityPatterns are most
+  // often used for 3d, use a rather large
+  // number of entries per row
   const unsigned int N = 1000;
   CompressedSparsityPattern csp (N,N);
   for (unsigned int i=0; i<N; ++i)
@@ -45,7 +45,7 @@ void test ()
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("compressed_sparsity_pattern_01/output");
   deallog.attach(logfile);
index e61b744177605e1cb218ae5da3c6eacf8eb73e7d..f9a148d9e10fbc72e8fad14ab8742ae2077371ed 100644 (file)
 
 void test ()
 {
-                                   // set up a sparsity pattern. since
-                                   // CompressedSparsityPatterns are most
-                                   // often used for 3d, use a rather large
-                                   // number of entries per row
+  // set up a sparsity pattern. since
+  // CompressedSparsityPatterns are most
+  // often used for 3d, use a rather large
+  // number of entries per row
   const unsigned int N = 1000;
   CompressedSparsityPattern csp (N,N);
   for (unsigned int i=0; i<N; ++i)
@@ -42,7 +42,7 @@ void test ()
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("compressed_sparsity_pattern_02/output");
   deallog.attach(logfile);
index 15690f8703cf227449cf015a064576740d25d713..d58b336603e977fdae781524a1637325f68b9ce7 100644 (file)
 
 void test ()
 {
-                                   // set up a sparsity pattern. since
-                                   // CompressedSparsityPatterns are most
-                                   // often used for 3d, use a rather large
-                                   // number of entries per row
+  // set up a sparsity pattern. since
+  // CompressedSparsityPatterns are most
+  // often used for 3d, use a rather large
+  // number of entries per row
   const unsigned int N = 1000;
   CompressedSparsityPattern csp (N,N);
   for (unsigned int i=0; i<N; ++i)
@@ -47,14 +47,14 @@ void test ()
                                                     true))
               == csp.row_length(i),
               ExcInternalError());
-      
+
       deallog << i << ' ' << csp.row_length (i) << std::endl;
     }
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("compressed_sparsity_pattern_03/output");
   deallog.attach(logfile);
index b98c889a4833fc22d3eb59ccffa97f577cc9a031..a38b1dfe43344d8bf2872304b255d8004329b06e 100644 (file)
@@ -43,7 +43,7 @@ void test ()
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("compressed_sparsity_pattern_04/output");
   deallog.attach(logfile);
index fc9cb1da537906f50f296fd1cce15bf9efdd6466..b0fec64ced44a34fce8e6592d4654782a16b6a00 100644 (file)
@@ -44,7 +44,7 @@ void test ()
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("compressed_sparsity_pattern_05/output");
   deallog.attach(logfile);
index dbf9f1952d5a2824c3f9588a1ffbdcc103705413..72226547a2d4f5681022243aad44786d36a82c63 100644 (file)
@@ -44,7 +44,7 @@ void test ()
 
 
 
-int main () 
+int main ()
 {
   deallog.attach(logfile);
   deallog.depth_console(0);
index 9d3fd4b0da1911f49c0465fabb53de5396918f3b..7923b674d941fb193e478584dd08a387759dcea0 100644 (file)
@@ -47,7 +47,7 @@ void test ()
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("compressed_sparsity_pattern_07/output");
   deallog.attach(logfile);
index f1aab962e7d809c331995806531e6b236b357c1b..d0a54d413cd109a76833f951968164f40ad58aad 100644 (file)
 
 void test ()
 {
-                                   // set up a sparsity pattern. since
-                                   // CompressedSparsityPatterns are most
-                                   // often used for 3d, use a rather large
-                                   // number of entries per row
+  // set up a sparsity pattern. since
+  // CompressedSparsityPatterns are most
+  // often used for 3d, use a rather large
+  // number of entries per row
   const unsigned int N = 1000;
   CompressedSparsityPattern csp (N,N);
   for (unsigned int i=0; i<N; ++i)
@@ -42,7 +42,7 @@ void test ()
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("compressed_sparsity_pattern_08/output");
   deallog.attach(logfile);
index 7a849ba9c7bfb93f7f3af341744d6fb1d673f54b..401759d3ee8d7be8de5d06550084c00bcfe367d2 100644 (file)
@@ -33,13 +33,13 @@ void test ()
 
   csp.reinit (N, N);
   Assert (csp.empty() == false, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("compressed_sparsity_pattern_09/output");
   deallog.attach(logfile);
index d246bf27aa6604b07def5ce6c5f966c5fb05f0b2..2e07836730e1287dcbc3826bd0f2e4b6dd60fb9b 100644 (file)
@@ -50,7 +50,7 @@ void check ()
   triangulation.refine_global (2);
 
   GridOut().write_gnuplot (triangulation,
-                          deallog.get_file_stream());
+                           deallog.get_file_stream());
 }
 
 
index 6d70b27f2909e3300519160ecc2504a7148e5e10..9f86244119ae3f3e8194b360cfee045de0f1ba47 100644 (file)
@@ -47,22 +47,22 @@ std::string output_file_name = "count_dofs_per_block_01/output";
 
 
 void print (const std::vector<types::global_dof_index> &v)
-{  
+{
   deallog << v.size();
   for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v[i];
   deallog << std::endl;
 }
 
-  
+
 
 template <int dim>
 void
 check ()
 {
-                                   // create tria and dofhandler
-                                   // objects. set different boundary
-                                   // and sub-domain ids
+  // create tria and dofhandler
+  // objects. set different boundary
+  // and sub-domain ids
   Triangulation<dim> tria;
   GridGenerator::hyper_cube(tria, 0., 1.);
   tria.refine_global (1);
@@ -72,12 +72,12 @@ check ()
       tria.execute_coarsening_and_refinement ();
     }
 
-                                  // Taylor-Hood element
+  // Taylor-Hood element
   FESystem<dim> fe (FE_Q<dim>(1), dim, FE_DGQ<dim>(0), 1);
   DoFHandler<dim> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
 
-                                  // no grouping
+  // no grouping
   {
     std::vector<types::global_dof_index> dpc(dim+1);
     DoFTools::count_dofs_per_component (dof_handler, dpc);
@@ -91,8 +91,8 @@ check ()
   }
 
 
-                                  // grouping into less groups than
-                                  // components
+  // grouping into less groups than
+  // components
   {
     std::vector<unsigned int> group(dim+1, 0);
     group[dim] = 1;
@@ -101,7 +101,7 @@ check ()
     Assert (dpc.size() == 2, ExcInternalError());
     print (dpc);
   }
-  
+
   {
     std::vector<unsigned int> group(dim+1, 0);
     group[dim] = 1;
@@ -109,10 +109,10 @@ check ()
     DoFTools::count_dofs_per_block (dof_handler, dpc, group);
     Assert (dpc.size() == 2, ExcInternalError());
     print (dpc);
-  }  
+  }
 
-                                  // grouping into more groups than
-                                  // components
+  // grouping into more groups than
+  // components
   {
     std::vector<unsigned int> group(dim+1, 2*dim);
     group[dim] = 0;
@@ -121,7 +121,7 @@ check ()
     Assert (dpc.size() == 2*dim+1, ExcInternalError());
     print (dpc);
   }
-  
+
   {
     std::vector<unsigned int> group(dim+1, 2*dim);
     group[dim] = 0;
@@ -129,7 +129,7 @@ check ()
     DoFTools::count_dofs_per_block (dof_handler, dpc, group);
     Assert (dpc.size() == 2*dim+1, ExcInternalError());
     print (dpc);
-  }  
+  }
 }
 
 
index de00dc2c05d79d011c7ea04e8f9b27cd21eeb68f..495421e25676d1f98a62f8ed75fcb4f2edf88d42 100644 (file)
@@ -45,22 +45,22 @@ std::string output_file_name = "count_dofs_per_block_02/output";
 
 
 void print (const std::vector<types::global_dof_index> &v)
-{  
+{
   deallog << v.size();
   for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v[i];
   deallog << std::endl;
 }
 
-  
+
 
 template <int dim>
 void
 check ()
 {
-                                   // create tria and dofhandler
-                                   // objects. set different boundary
-                                   // and sub-domain ids
+  // create tria and dofhandler
+  // objects. set different boundary
+  // and sub-domain ids
   Triangulation<dim> tria;
   GridGenerator::hyper_cube(tria, 0., 1.);
   tria.refine_global (1);
@@ -75,7 +75,7 @@ check ()
   dof_handler.distribute_dofs (fe);
   deallog << "Number of DoFs: " << dof_handler.n_dofs() << std::endl;
 
-                                  // no grouping
+  // no grouping
   {
     std::vector<types::global_dof_index> dpc(dim+1);
     DoFTools::count_dofs_per_component (dof_handler, dpc);
@@ -89,8 +89,8 @@ check ()
   }
 
 
-                                  // grouping into less groups than
-                                  // components
+  // grouping into less groups than
+  // components
   {
     std::vector<unsigned int> group(dim+1, 0);
     group[dim] = 1;
@@ -99,7 +99,7 @@ check ()
     Assert (dpc.size() == 2, ExcInternalError());
     print (dpc);
   }
-  
+
   {
     std::vector<unsigned int> group(2, 0);
     group[1] = 1;
@@ -107,10 +107,10 @@ check ()
     DoFTools::count_dofs_per_block (dof_handler, dpc, group);
     Assert (dpc.size() == 2, ExcInternalError());
     print (dpc);
-  }  
+  }
 
-                                  // grouping into more groups than
-                                  // components
+  // grouping into more groups than
+  // components
   {
     std::vector<unsigned int> group(dim+1, 2*dim);
     group[dim] = 0;
@@ -119,7 +119,7 @@ check ()
     Assert (dpc.size() == 2*dim+1, ExcInternalError());
     print (dpc);
   }
-  
+
   {
     std::vector<unsigned int> group(2, 2*dim);
     group[1] = 0;
@@ -127,7 +127,7 @@ check ()
     DoFTools::count_dofs_per_block (dof_handler, dpc, group);
     Assert (dpc.size() == 2*dim+1, ExcInternalError());
     print (dpc);
-  }  
+  }
 }
 
 
index 47571dab0c7789bd9fa3a3b56697039c41ed095c..46762725fa077c05801a90f8e7ccfde3b2ed007e 100644 (file)
@@ -68,7 +68,7 @@ void test ()
       deallog <<"DoFs in the " <<i<<". component for hp FE: "<< dofs_per_component_hp.at(i)<< std::endl;
 
       Assert (dofs_per_component.at(i) == dofs_per_component_hp.at(i),
-             ExcInternalError());
+              ExcInternalError());
     }
 
 }
index ea32fcbbfae0c47dfd783942b80f0dac50fba04e..abaee7dcf49b5855daac09d241cc8892d4ce2083 100644 (file)
@@ -30,9 +30,9 @@
 #include <fstream>
 #include <iomanip>
 
-    
 
-int main () 
+
+int main ()
 {
   std::ofstream logfile("cylinder/output");
   deallog.attach(logfile);
@@ -40,15 +40,15 @@ int main ()
   deallog.threshold_double(1.e-10);
   deallog << std::setprecision (2);
 
-                                   // generate a cylinder
+  // generate a cylinder
   Triangulation<3> tria;
   GridGenerator::cylinder (tria, std::sqrt(2.));
 
-                                   // output all faces. here, we
-                                   // should have 18 (two layers of
-                                   // cells, each with 4 outer faces,
-                                   // plus 5 faces each for the top
-                                   // and bottom of the cylinder)
+  // output all faces. here, we
+  // should have 18 (two layers of
+  // cells, each with 4 outer faces,
+  // plus 5 faces each for the top
+  // and bottom of the cylinder)
   unsigned int external_faces = 0;
   for (Triangulation<3>::face_iterator face=tria.begin_face();
        face!=tria.end_face(); ++face)
@@ -66,6 +66,6 @@ int main ()
   deallog << "External faces: " << external_faces << std::endl;
 
   Assert (external_faces == 18, ExcInternalError());
-  
+
   return 0;
 }
index 8585bf337c79a90bf679f21aae6a5e89a2cbfc01..95b8b22c910970b285bed3d20d3e1ffc407f8a25 100644 (file)
@@ -46,14 +46,14 @@ void check ()
   triangulation.refine_global (2);
 
   for (typename Triangulation<dim>::active_cell_iterator
-         cell = triangulation.begin_active();
+       cell = triangulation.begin_active();
        cell!=triangulation.end(); ++cell)
     for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
       deallog << cell->vertex(i) << std::endl;
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("cylinder_01/output");
   deallog.attach(logfile);
@@ -64,5 +64,5 @@ int main ()
   check<3> ();
 }
 
-  
-  
+
+
index 3eb9801e2fe9f067e8ac10f5e60d97301eaeef32..f3930d41a998402e430e387cc87d5bd38588cdc8 100644 (file)
@@ -16,7 +16,7 @@
 
 
 
-// check the cells generated by the CylinderBoundary the 
+// check the cells generated by the CylinderBoundary the
 // axiparallel cylinder parallel to the y-axis
 
 #include "../tests.h"
@@ -52,21 +52,21 @@ void check ()
   Triangulation<dim> triangulation;
   GridGenerator::cylinder (triangulation);
 
-  GridTools::transform ((Point<dim> (*)(const Point<dim>&))&rotate_to_y<dim>, triangulation);
-  
+  GridTools::transform ((Point<dim> ( *)(const Point<dim> &))&rotate_to_y<dim>, triangulation);
+
   static const CylinderBoundary<dim> boundary (1,1);
   triangulation.set_boundary (0, boundary);
   triangulation.refine_global (2);
 
   for (typename Triangulation<dim>::active_cell_iterator
-         cell = triangulation.begin_active();
+       cell = triangulation.begin_active();
        cell!=triangulation.end(); ++cell)
     for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
       deallog << cell->vertex(i) << std::endl;
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("cylinder_02/output");
   deallog.attach(logfile);
@@ -77,5 +77,5 @@ int main ()
   check<3> ();
 }
 
-  
-  
+
+
index 5d0e0ebc759d24be1de4dff0ccf97e343e9d60e5..91431813d16a09be3ed651cf361c662e6b3b759f 100644 (file)
@@ -49,21 +49,21 @@ void check ()
   Triangulation<dim> triangulation;
   GridGenerator::cylinder (triangulation);
 
-  GridTools::transform ((Point<dim> (*)(const Point<dim>&))&rotate_to_y<dim>, triangulation);
-  
+  GridTools::transform ((Point<dim> ( *)(const Point<dim> &))&rotate_to_y<dim>, triangulation);
+
   static const CylinderBoundary<dim> boundary (1,2);
   triangulation.set_boundary (0, boundary);
   triangulation.refine_global (2);
 
   for (typename Triangulation<dim>::active_cell_iterator
-         cell = triangulation.begin_active();
+       cell = triangulation.begin_active();
        cell!=triangulation.end(); ++cell)
     for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
       deallog << cell->vertex(i) << std::endl;
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("cylinder_03/output");
   deallog.attach(logfile);
@@ -73,5 +73,5 @@ int main ()
   check<3> ();
 }
 
-  
-  
+
+
index 312b3561427383ca41269e88e4e063b238b68b82..e067e52fbabbcaa4eff7fa9a74c5a5125906d5be 100644 (file)
@@ -42,8 +42,8 @@ template <int dim>
 Point<dim> rotate_to_y (const Point<dim> &p)
 {
   return Point<dim> (p[0]*std::cos(xy_angle) - p[1]*std::sin(xy_angle),
-                    p[0]*std::sin(xy_angle) + p[1]*std::cos(xy_angle),
-                    p[2]);
+                     p[0]*std::sin(xy_angle) + p[1]*std::cos(xy_angle),
+                     p[2]);
 }
 
 
@@ -53,23 +53,23 @@ void check ()
   Triangulation<dim> triangulation;
   GridGenerator::cylinder (triangulation);
 
-  GridTools::transform ((Point<dim> (*)(const Point<dim>&))&rotate_to_y<dim>, triangulation);
-  
+  GridTools::transform ((Point<dim> ( *)(const Point<dim> &))&rotate_to_y<dim>, triangulation);
+
   static const CylinderBoundary<dim> boundary (1,
-                                              Point<dim>(std::cos(xy_angle), std::sin(xy_angle), 0),
-                                              Point<dim>());
+                                               Point<dim>(std::cos(xy_angle), std::sin(xy_angle), 0),
+                                               Point<dim>());
   triangulation.set_boundary (0, boundary);
   triangulation.refine_global (2);
 
   for (typename Triangulation<dim>::active_cell_iterator
-         cell = triangulation.begin_active();
+       cell = triangulation.begin_active();
        cell!=triangulation.end(); ++cell)
     for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
       deallog << cell->vertex(i) << std::endl;
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("cylinder_04/output");
   deallog.attach(logfile);
@@ -79,5 +79,5 @@ int main ()
   check<3> ();
 }
 
-  
-  
+
+
index 4359f2b12e8ec8bf8d4a33c039d0f546b179601b..17eeda8bf988fb94481135d3f2a284630165be1e 100644 (file)
@@ -28,9 +28,9 @@
 #include <fstream>
 #include <iomanip>
 
-    
 
-int main () 
+
+int main ()
 {
   std::ofstream logfile("cylinder_shell_01/output");
   deallog.attach(logfile);
@@ -38,12 +38,12 @@ int main ()
   deallog.threshold_double(1.e-10);
   deallog << std::setprecision (2);
 
-                                   // generate a hyperball in 3d
+  // generate a hyperball in 3d
   Triangulation<3> tria;
   GridGenerator::cylinder_shell (tria, 1, .8, 1);
 
-                                   // make sure that all cells have positive
-                                   // volume
+  // make sure that all cells have positive
+  // volume
   for (Triangulation<3>::active_cell_iterator cell=tria.begin_active();
        cell!=tria.end(); ++cell)
     deallog << cell << ' ' << cell->measure () << std::endl;
index 2b95a1d6a64ed172ecd60b93de75407dd22b356c..7f17388a77099928acc5bf124c4b288955a69ebe 100644 (file)
@@ -33,9 +33,9 @@
 #include <deal.II/fe/fe_values.h>
 #include <fstream>
 
-    
 
-int main () 
+
+int main ()
 {
   std::ofstream logfile("cylinder_shell_02/output");
   deallog.attach(logfile);
@@ -43,7 +43,7 @@ int main ()
   deallog.threshold_double(1.e-10);
   deallog << std::setprecision (2);
 
-                                   // generate a hyperball in 3d
+  // generate a hyperball in 3d
   Triangulation<3> tria;
   GridGenerator::cylinder_shell (tria, 1, .8, 1);
 
@@ -53,9 +53,9 @@ int main ()
 
   QMidpoint<3> q;
   FEValues<3> fe_values (fe, q, update_JxW_values);
-  
-                                   // make sure that all cells have positive
-                                   // volume
+
+  // make sure that all cells have positive
+  // volume
   for (DoFHandler<3>::active_cell_iterator cell=dof_handler.begin_active();
        cell!=dof_handler.end(); ++cell)
     {
index 4d1f0cb73b72b65e4f75e606c7fe6a46a73837fe..90b26b13a9f17eb370f953f2a50fd7c258c1e084 100644 (file)
@@ -35,23 +35,23 @@ check_this (const DoFHandler<dim> &dof_handler,
   data_out.add_data_vector (v_node, "node_data");
   data_out.add_data_vector (v_cell, "cell_data");
   data_out.build_patches ();
-  
+
   data_out.write_dx (deallog.get_file_stream());
   data_out.set_flags (DataOutBase::UcdFlags(true));
-  data_out.write_ucd (deallog.get_file_stream());  
+  data_out.write_ucd (deallog.get_file_stream());
   data_out.write_gmv (deallog.get_file_stream());
   data_out.write_tecplot (deallog.get_file_stream());
   data_out.write_vtk (deallog.get_file_stream());
   data_out.write_gnuplot (deallog.get_file_stream());
   data_out.write_deal_II_intermediate (deallog.get_file_stream());
 
-                                   // the following is only
-                                   // implemented for 2d
+  // the following is only
+  // implemented for 2d
   if (dim == 2)
     {
       data_out.write_povray (deallog.get_file_stream());
       data_out.write_eps (deallog.get_file_stream());
-    }  
+    }
 }
 
 
index 0f61d29168faf000f8764a7b2bcaf39db1e0d226..a8f5cc0becaeb8cdfcfd5ee5c9ce283fc4c1a439 100644 (file)
@@ -36,29 +36,29 @@ check_this (const DoFHandler<dim> &dof_handler,
   BlockVector<double> v_node, v_cell;
   make_block_vector (v_node_x, v_node);
   make_block_vector (v_cell_x, v_cell);
-  
+
   DataOut<dim> data_out;
   data_out.attach_dof_handler (dof_handler);
   data_out.add_data_vector (v_node, "node_data");
   data_out.add_data_vector (v_cell, "cell_data");
   data_out.build_patches ();
-  
+
   data_out.write_dx (deallog.get_file_stream());
   data_out.set_flags (DataOutBase::UcdFlags(true));
-  data_out.write_ucd (deallog.get_file_stream());  
+  data_out.write_ucd (deallog.get_file_stream());
   data_out.write_gmv (deallog.get_file_stream());
   data_out.write_tecplot (deallog.get_file_stream());
   data_out.write_vtk (deallog.get_file_stream());
   data_out.write_gnuplot (deallog.get_file_stream());
   data_out.write_deal_II_intermediate (deallog.get_file_stream());
 
-                                   // the following is only
-                                   // implemented for 2d
+  // the following is only
+  // implemented for 2d
   if (dim == 2)
     {
       data_out.write_povray (deallog.get_file_stream());
       data_out.write_eps (deallog.get_file_stream());
-    }  
+    }
 }
 
 
index 59b0b8f21a08a1630b0f0b9472902fa20ac87b4e..3c1baefda29446ebb68c61eb73ef4df1877b8b2e 100644 (file)
@@ -33,14 +33,18 @@ std::string output_file_name = "data_out_03/output";
 template <int dim>
 class XDataOut : public DataOut<dim>
 {
-  public:
-    const std::vector<typename ::DataOutBase::Patch<dim,dim> > &
-    get_patches() const
-      { return DataOut<dim>::get_patches(); }
-
-    std::vector<std::string>
-    get_dataset_names () const    
-      { return DataOut<dim>::get_dataset_names();  }
+public:
+  const std::vector<typename ::DataOutBase::Patch<dim,dim> > &
+  get_patches() const
+  {
+    return DataOut<dim>::get_patches();
+  }
+
+  std::vector<std::string>
+  get_dataset_names () const
+  {
+    return DataOut<dim>::get_dataset_names();
+  }
 };
 
 // have a class that makes sure we can get at the patches and data set
@@ -48,14 +52,18 @@ class XDataOut : public DataOut<dim>
 template <int dim>
 class XDataOutReader : public DataOutReader<dim>
 {
-  public:
-    const std::vector<typename ::DataOutBase::Patch<dim,dim> > &
-    get_patches() const
-      { return DataOutReader<dim>::get_patches(); }
-
-    std::vector<std::string>
-    get_dataset_names () const    
-      { return DataOutReader<dim>::get_dataset_names();  }
+public:
+  const std::vector<typename ::DataOutBase::Patch<dim,dim> > &
+  get_patches() const
+  {
+    return DataOutReader<dim>::get_patches();
+  }
+
+  std::vector<std::string>
+  get_dataset_names () const
+  {
+    return DataOutReader<dim>::get_dataset_names();
+  }
 };
 
 
@@ -70,7 +78,7 @@ check_this (const DoFHandler<dim> &dof_handler,
   data_out.add_data_vector (v_node, "node_data");
   data_out.add_data_vector (v_cell, "cell_data");
   data_out.build_patches ();
-  
+
   {
     std::ofstream tmp ("data_out_03.tmp");
     data_out.write_deal_II_intermediate (tmp);
@@ -80,24 +88,24 @@ check_this (const DoFHandler<dim> &dof_handler,
   {
     std::ifstream tmp ("data_out_03.tmp");
     reader.read (tmp);
-  }  
+  }
 
-                                  // finally make sure that we have
-                                  // read everything back in
-                                  // correctly
+  // finally make sure that we have
+  // read everything back in
+  // correctly
   Assert (data_out.get_dataset_names() == reader.get_dataset_names(),
-         ExcInternalError());
-  
+          ExcInternalError());
+
   Assert (data_out.get_patches().size() == reader.get_patches().size(),
-         ExcInternalError());
+          ExcInternalError());
 
   for (unsigned int i=0; i<reader.get_patches().size(); ++i)
     Assert (data_out.get_patches()[i] == reader.get_patches()[i],
-           ExcInternalError());
+            ExcInternalError());
 
-                                  // for good measure, delete tmp file
+  // for good measure, delete tmp file
   remove ("data_out_03.tmp");
-  
+
   deallog << "OK" << std::endl;
 }
 
index 2eef14dd48636aa241262b9eb957dd8d14351767..a6c44b3d5d851da9ba6e1cba3dbdb3958ef16355 100644 (file)
@@ -36,31 +36,35 @@ std::string output_file_name = "data_out_04/output";
 template <int dim>
 class XDataOut : public DataOut<dim>
 {
-  public:
-    const std::vector<typename ::DataOutBase::Patch<dim,dim> > &
-    get_patches() const
-      { return DataOut<dim>::get_patches(); }
+public:
+  const std::vector<typename ::DataOutBase::Patch<dim,dim> > &
+  get_patches() const
+  {
+    return DataOut<dim>::get_patches();
+  }
 
-    std::vector<std::string>
-    get_dataset_names () const
-      { return DataOut<dim>::get_dataset_names();  }
+  std::vector<std::string>
+  get_dataset_names () const
+  {
+    return DataOut<dim>::get_dataset_names();
+  }
 
+  std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> >
+  get_vector_data_ranges () const
+  {
+    // if we have enough components for a
+    // vector solution, make the last dim
+    // components a vector
     std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> >
-    get_vector_data_ranges () const
-      {
-                                        // if we have enough components for a
-                                        // vector solution, make the last dim
-                                        // components a vector
-       std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> >
-         retval;
-       if (get_dataset_names().size() >= dim)
-         retval.push_back (std_cxx1x::tuple
-                           <unsigned int, unsigned int, std::string>
-                           (get_dataset_names().size()-dim,
-                            get_dataset_names().size()-1,
-                            "vector_data"));
-       return retval;
-      }
+    retval;
+    if (get_dataset_names().size() >= dim)
+      retval.push_back (std_cxx1x::tuple
+                        <unsigned int, unsigned int, std::string>
+                        (get_dataset_names().size()-dim,
+                         get_dataset_names().size()-1,
+                         "vector_data"));
+    return retval;
+  }
 };
 
 // have a class that makes sure we can get at the patches and data set
@@ -68,20 +72,24 @@ class XDataOut : public DataOut<dim>
 template <int dim>
 class XDataOutReader : public DataOutReader<dim>
 {
-  public:
-    const std::vector<typename ::DataOutBase::Patch<dim,dim> > &
-    get_patches() const
-      { return DataOutReader<dim>::get_patches(); }
+public:
+  const std::vector<typename ::DataOutBase::Patch<dim,dim> > &
+  get_patches() const
+  {
+    return DataOutReader<dim>::get_patches();
+  }
 
-    std::vector<std::string>
-    get_dataset_names () const
-      { return DataOutReader<dim>::get_dataset_names();  }
+  std::vector<std::string>
+  get_dataset_names () const
+  {
+    return DataOutReader<dim>::get_dataset_names();
+  }
 
-    std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> >
-    get_vector_data_ranges () const
-      {
-       return DataOutReader<dim>::get_vector_data_ranges ();
-      }
+  std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> >
+  get_vector_data_ranges () const
+  {
+    return DataOutReader<dim>::get_vector_data_ranges ();
+  }
 };
 
 
@@ -108,47 +116,47 @@ check_this (const DoFHandler<dim> &dof_handler,
     reader.read (tmp);
   }
 
-                                  // finally make sure that we have
-                                  // read everything back in
-                                  // correctly
+  // finally make sure that we have
+  // read everything back in
+  // correctly
   Assert (data_out.get_dataset_names() == reader.get_dataset_names(),
-         ExcInternalError());
+          ExcInternalError());
 
   Assert (data_out.get_patches().size() == reader.get_patches().size(),
-         ExcInternalError());
+          ExcInternalError());
 
   for (unsigned int i=0; i<reader.get_patches().size(); ++i)
     Assert (data_out.get_patches()[i] == reader.get_patches()[i],
-           ExcInternalError());
+            ExcInternalError());
 
   deallog << data_out.get_vector_data_ranges().size()
-         << std::endl;
+          << std::endl;
   Assert (data_out.get_vector_data_ranges().size() ==
-         reader.get_vector_data_ranges().size(),
-         ExcInternalError());
+          reader.get_vector_data_ranges().size(),
+          ExcInternalError());
   for (unsigned int i=0; i<data_out.get_vector_data_ranges().size(); ++i)
     {
       deallog << std_cxx1x::get<0>(data_out.get_vector_data_ranges()[i])
-             << ' '
-             << std_cxx1x::get<1>(data_out.get_vector_data_ranges()[i])
-             << ' '
-             << std_cxx1x::get<2>(data_out.get_vector_data_ranges()[i])
-             << std::endl;
+              << ' '
+              << std_cxx1x::get<1>(data_out.get_vector_data_ranges()[i])
+              << ' '
+              << std_cxx1x::get<2>(data_out.get_vector_data_ranges()[i])
+              << std::endl;
       Assert (std_cxx1x::get<0>(data_out.get_vector_data_ranges()[i])
-             ==
-             std_cxx1x::get<0>(reader.get_vector_data_ranges()[i]),
-             ExcInternalError());
+              ==
+              std_cxx1x::get<0>(reader.get_vector_data_ranges()[i]),
+              ExcInternalError());
       Assert (std_cxx1x::get<1>(data_out.get_vector_data_ranges()[i])
-             ==
-             std_cxx1x::get<1>(reader.get_vector_data_ranges()[i]),
-             ExcInternalError());
+              ==
+              std_cxx1x::get<1>(reader.get_vector_data_ranges()[i]),
+              ExcInternalError());
       Assert (std_cxx1x::get<2>(data_out.get_vector_data_ranges()[i])
-             ==
-             std_cxx1x::get<2>(reader.get_vector_data_ranges()[i]),
-             ExcInternalError());
+              ==
+              std_cxx1x::get<2>(reader.get_vector_data_ranges()[i]),
+              ExcInternalError());
     }
 
-                                  // for good measure, delete tmp file
+  // for good measure, delete tmp file
   remove ("data_out_04.tmp");
 
   deallog << "OK" << std::endl;
index f87d61137490ab0bd290d21c4731af9acea7d7d5..dd71f81284b973ac92e3eefc9c069ac6d59b462f 100644 (file)
@@ -40,43 +40,43 @@ check_this (const DoFHandler<dim> &dof_handler,
             const Vector<double>  &v_cell)
 {
   std::vector<DataComponentInterpretation::DataComponentInterpretation>
-    data_component_interpretation (dof_handler.get_fe().n_components(),
-                                  DataComponentInterpretation::component_is_scalar);
-                                  // if possible, declare the last
-                                  // dim components as vectors
+  data_component_interpretation (dof_handler.get_fe().n_components(),
+                                 DataComponentInterpretation::component_is_scalar);
+  // if possible, declare the last
+  // dim components as vectors
   if (dof_handler.get_fe().n_components() >= dim)
     for (unsigned int i=dof_handler.get_fe().n_components()-dim;
-        i<dof_handler.get_fe().n_components(); ++i)
+         i<dof_handler.get_fe().n_components(); ++i)
       data_component_interpretation[i]
-       = DataComponentInterpretation::component_is_part_of_vector;
+        = DataComponentInterpretation::component_is_part_of_vector;
 
   deallog << "Checking " << dof_handler.get_fe().get_name()
-         << std::endl
-         << "Component mask: ";
+          << std::endl
+          << "Component mask: ";
   for (unsigned int i=0; i<dof_handler.get_fe().n_components(); ++i)
     deallog << (data_component_interpretation[i] ==
-               DataComponentInterpretation::component_is_scalar
-               ?
-               "scalar "
-               :
-               "vector ");
+                DataComponentInterpretation::component_is_scalar
+                ?
+                "scalar "
+                :
+                "vector ");
   deallog << std::endl;
-  
+
   DataOut<dim> data_out;
   data_out.attach_dof_handler (dof_handler);
   data_out.add_data_vector (v_node,
-                           std::vector<std::string>(dof_handler.get_fe().n_components(),
-                                                    "node_data_1"),
-                           DataOut<dim>::type_dof_data,
-                           data_component_interpretation);
+                            std::vector<std::string>(dof_handler.get_fe().n_components(),
+                                                     "node_data_1"),
+                            DataOut<dim>::type_dof_data,
+                            data_component_interpretation);
   data_out.add_data_vector (v_node,
-                           std::vector<std::string>(dof_handler.get_fe().n_components(),
-                                                    "node_data_2"),
-                           DataOut<dim>::type_dof_data,
-                           data_component_interpretation);
+                            std::vector<std::string>(dof_handler.get_fe().n_components(),
+                                                     "node_data_2"),
+                            DataOut<dim>::type_dof_data,
+                            data_component_interpretation);
   data_out.add_data_vector (v_cell, "cell_data");
   data_out.build_patches ();
-  
+
   data_out.write_vtk (deallog.get_file_stream());
 }
 
index 21344d8a9738bedf7997cd311abd8c02f2164f66..556ef3c46c177747a31dd75a2be14a5990464142 100644 (file)
@@ -1,6 +1,6 @@
 //----------------------------  dof_tools_common.cc  ---------------------------
 //    $Id$
-//    Version: $Name$ 
+//    Version: $Name$
 //
 //    Copyright (C) 2003, 2004, 2005, 2008, 2010 by the deal.II authors
 //
@@ -72,10 +72,10 @@ check (const FiniteElement<dim> &fe,
   deallog << "Checking " << name
           << " in " << dim << "d:"
           << std::endl;
-  
-                                   // create tria and dofhandler
-                                   // objects. set different boundary
-                                   // and sub-domain ids
+
+  // create tria and dofhandler
+  // objects. set different boundary
+  // and sub-domain ids
   Triangulation<dim> tria;
   GridGenerator::hyper_cube(tria, 0., 1.);
   tria.refine_global (1);
@@ -90,8 +90,8 @@ check (const FiniteElement<dim> &fe,
 
   Vector<double> v_cell (dof_handler.get_tria().n_active_cells());
   for (unsigned int i=0; i<v_cell.size(); ++i) v_cell(i) = i;
-  
-                                   // call main function in .cc files
+
+  // call main function in .cc files
   check_this (dof_handler, v_node, v_cell);
 }
 
@@ -100,14 +100,14 @@ check (const FiniteElement<dim> &fe,
 
 
 #define CHECK(EL,deg,dim)\
- { FE_ ## EL<dim> EL(deg);   \
-   check(EL, #EL #deg); }
 { FE_ ## EL<dim> EL(deg);   \
+    check(EL, #EL #deg); }
 
 #define CHECK_ALL(EL,deg)\
- { CHECK(EL,deg,1); \
-   CHECK(EL,deg,2); \
-   CHECK(EL,deg,3); \
- }
 { CHECK(EL,deg,1); \
+    CHECK(EL,deg,2); \
+    CHECK(EL,deg,3); \
 }
 
 
 int
@@ -120,7 +120,7 @@ main()
       logfile << std::setprecision (2);
       deallog.attach(logfile);
       deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);
+      deallog.threshold_double(1.e-10);
 
       CHECK_ALL(Q,1);
       CHECK_ALL(Q,2);
@@ -132,30 +132,30 @@ main()
 
       CHECK(Nedelec, 0, 2);
       CHECK(Nedelec, 0, 3);
-  
+
       return 0;
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 708271ed4b56ce711bdd9036e4eea5236b864606..9a99e5142f24bcb1240070c53e8a0e7ee576e94d 100644 (file)
@@ -59,8 +59,8 @@ using namespace dealii;
 
 // this is copied from GridGenerator
 void laplace_solve (const SparseMatrix<double> &S,
-                   const std::map<unsigned int,double> &m,
-                   Vector<double> &u)
+                    const std::map<unsigned int,double> &m,
+                    Vector<double> &u)
 {
   const unsigned int n_dofs=S.n();
   FilteredMatrix<Vector<double> > SF (S);
@@ -84,163 +84,163 @@ void laplace_solve (const SparseMatrix<double> &S,
 // boundary
 void curved_grid (std::ofstream &out)
 {
-                                  // number of cells in radial and
-                                  // circumferential direction
+  // number of cells in radial and
+  // circumferential direction
   const unsigned int n_phi=4,
-                      n_r=8;
-                                  // inner and outer radius
+                     n_r=8;
+  // inner and outer radius
   const double r_i=0.5,
-              r_a=2.0;
-                                  // we want to increase the radial extent of
-                                  // each cell by 'factor'. compute, how large
-                                  // the first extent 'dr' has to be
+               r_a=2.0;
+  // we want to increase the radial extent of
+  // each cell by 'factor'. compute, how large
+  // the first extent 'dr' has to be
   double factor=2.,
-           sum=0;
+         sum=0;
   for (unsigned int j=0; j<n_r; ++j)
     sum+=std::pow(factor,1.*j);
   double dr=(r_a-r_i)/sum;
-                                  // radii of the cells
+  // radii of the cells
   std::vector<double> r(n_r+1,r_i);
   for (unsigned int j=1; j<n_r+1; ++j)
     {
       r[j]=r[j-1]+dr;
       dr*=factor;
     }
-                                  // create vertices
+  // create vertices
   std::vector<Point<2> > vertices(n_phi*(n_r+1));
   for (unsigned int j=0; j<n_r+1; ++j)
     for (unsigned int i=0; i<n_phi; ++i)
       {
-       const unsigned int p=i+j*n_phi;
-       const double alpha=i*2*numbers::PI/n_phi;
-       vertices[p]=Point<2>(r[j]*cos(alpha),r[j]*sin(alpha));
+        const unsigned int p=i+j*n_phi;
+        const double alpha=i*2*numbers::PI/n_phi;
+        vertices[p]=Point<2>(r[j]*cos(alpha),r[j]*sin(alpha));
       }
-                                  // create connectivity
+  // create connectivity
   std::vector<CellData<2> > cells(n_phi*n_r);
   for (unsigned int j=0; j<n_r; ++j)
     for (unsigned int i=0; i<n_phi; ++i)
       {
-       const unsigned int index=i+j*n_phi;
-       const unsigned int p            =i          +    j*n_phi;
-       const unsigned int p_iplus      =(i+1)%n_phi+    j*n_phi;
-       const unsigned int p_iplus_jplus=(i+1)%n_phi+(j+1)*n_phi;
-       const unsigned int p_jplus      =i          +(j+1)*n_phi;
+        const unsigned int index=i+j*n_phi;
+        const unsigned int p            =i          +    j*n_phi;
+        const unsigned int p_iplus      =(i+1)%n_phi+    j*n_phi;
+        const unsigned int p_iplus_jplus=(i+1)%n_phi+(j+1)*n_phi;
+        const unsigned int p_jplus      =i          +(j+1)*n_phi;
 
-       cells[index].vertices[0]=p_iplus;
-       cells[index].vertices[1]=p;
-       cells[index].vertices[2]=p_jplus;
-       cells[index].vertices[3]=p_iplus_jplus;
+        cells[index].vertices[0]=p_iplus;
+        cells[index].vertices[1]=p;
+        cells[index].vertices[2]=p_jplus;
+        cells[index].vertices[3]=p_iplus_jplus;
       }
-                                  // create triangulation
+  // create triangulation
   Triangulation<2> triangulation;
   triangulation.create_triangulation_compatibility(vertices,cells,SubCellData());
-                                  // now provide everything that is
-                                  // needed for solving a Laplace
-                                  // equation.
+  // now provide everything that is
+  // needed for solving a Laplace
+  // equation.
   MappingQ1<2> mapping_q1;
   FE_Q<2> fe(2);
   DoFHandler<2> dof_handler(triangulation);
   dof_handler.distribute_dofs(fe);
   SparsityPattern sparsity_pattern (dof_handler.n_dofs (), dof_handler.n_dofs (),
-                                   dof_handler.max_couplings_between_dofs());
+                                    dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
   sparsity_pattern.compress ();
   SparseMatrix<double> S(sparsity_pattern);
   QGauss<2> quadrature(4);
   MatrixCreator::create_laplace_matrix(mapping_q1, dof_handler, quadrature, S);
-                                  // set up the boundary values for
-                                  // the laplace problem
+  // set up the boundary values for
+  // the laplace problem
   std::vector<std::map<unsigned int,double> > m(2);
-                                  // fill these maps: on the inner boundary try
-                                  // to approximate a circle, on the outer
-                                  // boundary use straight lines
+  // fill these maps: on the inner boundary try
+  // to approximate a circle, on the outer
+  // boundary use straight lines
   DoFHandler<2>::cell_iterator cell=dof_handler.begin_active(),
-                                         endc=dof_handler.end();
+                               endc=dof_handler.end();
   DoFHandler<2>::face_iterator face;
   for (; cell!=endc; ++cell)
     {
-                                      // fix all vertices
+      // fix all vertices
       for (unsigned int vertex_no=0;
-          vertex_no<GeometryInfo<2>::vertices_per_cell; ++vertex_no)
-       {
-         for (unsigned int i=0; i<2; ++i)
-           m[i][cell->vertex_dof_index(vertex_no, 0)]=0.;
-       }
+           vertex_no<GeometryInfo<2>::vertices_per_cell; ++vertex_no)
+        {
+          for (unsigned int i=0; i<2; ++i)
+            m[i][cell->vertex_dof_index(vertex_no, 0)]=0.;
+        }
 
       if (cell->at_boundary())
-       for (unsigned int face_no=0; face_no<GeometryInfo<2>::faces_per_cell; ++face_no)
-         {
-           face=cell->face(face_no);
-                                                // insert a modifiued value for
-                                                // the middle point of boundary
-                                                // faces
-           if (face->at_boundary())
-             {
-               const double eps=1e-4;
-               if (std::fabs(face->vertex(1).norm()-r_i)<eps)
-                   for (unsigned int i=0; i<2; ++i)
-                     m[i][face->dof_index(0)]= (face->center()*(r_i/face->center().norm()-1))(i);
-               else if (std::fabs(face->vertex(1).norm()-r_a)<eps)
-                   for (unsigned int i=0; i<2; ++i)
-                     m[i][face->dof_index(0)]=0.;
-               else
-                 Assert(false, ExcInternalError());
-             }
-         }
+        for (unsigned int face_no=0; face_no<GeometryInfo<2>::faces_per_cell; ++face_no)
+          {
+            face=cell->face(face_no);
+            // insert a modifiued value for
+            // the middle point of boundary
+            // faces
+            if (face->at_boundary())
+              {
+                const double eps=1e-4;
+                if (std::fabs(face->vertex(1).norm()-r_i)<eps)
+                  for (unsigned int i=0; i<2; ++i)
+                    m[i][face->dof_index(0)]= (face->center()*(r_i/face->center().norm()-1))(i);
+                else if (std::fabs(face->vertex(1).norm()-r_a)<eps)
+                  for (unsigned int i=0; i<2; ++i)
+                    m[i][face->dof_index(0)]=0.;
+                else
+                  Assert(false, ExcInternalError());
+              }
+          }
     }
-                                  // solve the 2 problems with
-                                  // different right hand sides.
+  // solve the 2 problems with
+  // different right hand sides.
   Vector<double> us[2];
   for (unsigned int i=0; i<2; ++i)
     us[i].reinit (dof_handler.n_dofs());
-                                  // solve linear systems in parallel
+  // solve linear systems in parallel
   Threads::ThreadGroup<> threads;
   for (unsigned int i=0; i<2; ++i)
     threads += Threads::spawn (&laplace_solve)(S, m[i], us[i]);
   threads.join_all ();
-                                  // create a new DoFHandler for the combined
-                                  // system
+  // create a new DoFHandler for the combined
+  // system
   FESystem<2> cfe(FE_Q<2>(2),2);
   DoFHandler<2> cdh(triangulation);
   cdh.distribute_dofs(cfe);
   Vector<double> displacements(cdh.n_dofs()),
-    dx(fe.dofs_per_cell),
-    dy(fe.dofs_per_cell),
-    dxy(cfe.dofs_per_cell);
+         dx(fe.dofs_per_cell),
+         dy(fe.dofs_per_cell),
+         dxy(cfe.dofs_per_cell);
   DoFHandler<2>::active_cell_iterator component_cell=dof_handler.begin_active(),
-                                               end_c=dof_handler.end(),
-                                      combined_cell=cdh.begin_active();
+                                      end_c=dof_handler.end(),
+                                      combined_cell=cdh.begin_active();
   for (; component_cell!=end_c; ++component_cell, ++combined_cell)
     {
       component_cell->get_dof_values (us[0], dx);
       component_cell->get_dof_values (us[1], dy);
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
-       {
-         dxy(cfe.component_to_system_index(0,i))= dx(i);
-         dxy(cfe.component_to_system_index(1,i))= dy(i);
-       }
+        {
+          dxy(cfe.component_to_system_index(0,i))= dx(i);
+          dxy(cfe.component_to_system_index(1,i))= dy(i);
+        }
       combined_cell->set_dof_values (dxy, displacements);
     }
-                                  // and create the MappingQEulerian
+  // and create the MappingQEulerian
   MappingQEulerian<2> euler(2, displacements, cdh);
-                                  // now the actual test
+  // now the actual test
   DataOut<2> data_out;
   data_out.attach_dof_handler(cdh);
   std::vector<std::string> names;
   names.push_back("x_displacement");
   names.push_back("y_displacement");
   data_out.add_data_vector(displacements,names);
-                                  // output with no mapping
+  // output with no mapping
   data_out.build_patches(5);
   data_out.write_gnuplot(out);
-                                  // output with no curved cells
+  // output with no curved cells
   data_out.build_patches(euler,5,DataOut<2>::no_curved_cells);
   data_out.write_gnuplot(out);
-                                  // output with curved cells at the boundary
-                                  // (default)
+  // output with curved cells at the boundary
+  // (default)
   data_out.build_patches(euler,5);
   data_out.write_gnuplot(out);
-                                  // output with all cells curved
+  // output with all cells curved
   data_out.build_patches(euler,5,DataOut<2>::curved_inner_cells);
   data_out.write_gnuplot(out);
 }
@@ -256,10 +256,10 @@ int main ()
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-                                  // this test, for reasons unknown
-                                  // to me, appears to deadlock at
-                                  // times. make sure we kill it
-                                  // after some time
+  // this test, for reasons unknown
+  // to me, appears to deadlock at
+  // times. make sure we kill it
+  // after some time
 #ifdef DEAL_II_WITH_THREADS
   DeadlockKiller killer;
 #endif
index 77029d7ebcbfbc61a53a63e1b36b4da8fad8509d..6511ed3fccd3bcdf1d491c4f50437941c7acd58b 100644 (file)
@@ -26,37 +26,37 @@ std::string output_file_name = "data_out_faces_01/output";
 
 
 void
-my_check_this (const DoFHandler<1>   &,
-            const Vector<double>  &,
-            const Vector<double>  &)
+my_check_this (const DoFHandler<1> &,
+               const Vector<double> &,
+               const Vector<double> &)
 {
-                                   // nothing to check in 1d
+  // nothing to check in 1d
 }
 
 
 template <int dim>
 void
 my_check_this (const DoFHandler<dim> &dof_handler,
-            const Vector<double>  &v_node,
-            const Vector<double>  &v_cell)
+               const Vector<double>  &v_node,
+               const Vector<double>  &v_cell)
 {
   DataOutFaces<dim> data_out_faces;
   data_out_faces.attach_dof_handler (dof_handler);
   data_out_faces.add_data_vector (v_node, "node_data");
   data_out_faces.add_data_vector (v_cell, "cell_data");
   data_out_faces.build_patches ();
-  
+
   data_out_faces.write_dx (deallog.get_file_stream());
   data_out_faces.set_flags (DataOutBase::UcdFlags(true));
-  data_out_faces.write_ucd (deallog.get_file_stream());  
+  data_out_faces.write_ucd (deallog.get_file_stream());
   data_out_faces.write_gmv (deallog.get_file_stream());
   data_out_faces.write_tecplot (deallog.get_file_stream());
   data_out_faces.write_vtk (deallog.get_file_stream());
   data_out_faces.write_gnuplot (deallog.get_file_stream());
   data_out_faces.write_deal_II_intermediate (deallog.get_file_stream());
 
-                                  // povray and eps cannot presently
-                                  // write out face data
+  // povray and eps cannot presently
+  // write out face data
 }
 
 
@@ -66,13 +66,13 @@ check_this (const DoFHandler<dim> &dof_handler,
             const Vector<double>  &v_node,
             const Vector<double>  &v_cell)
 {
-                                  // since we can't forward declare
-                                  // check_this in this file (it is forward
-                                  // declared in data_out_common.h), we
-                                  // also can't make the driver file aware of
-                                  // the overload for 1d. to avoid linker
-                                  // errors, we can consequently not overload
-                                  // check_this, and need this forwarder
-                                  // function
+  // since we can't forward declare
+  // check_this in this file (it is forward
+  // declared in data_out_common.h), we
+  // also can't make the driver file aware of
+  // the overload for 1d. to avoid linker
+  // errors, we can consequently not overload
+  // check_this, and need this forwarder
+  // function
   my_check_this (dof_handler, v_node, v_cell);
 }
index 55cd93fa0e22b7489aeebeb57ae5432563854732..4b394945d6d9309bef3f9f23e7168090e2d46220 100644 (file)
@@ -28,41 +28,41 @@ std::string output_file_name = "data_out_faces_02/output";
 
 
 void
-my_check_this (const DoFHandler<1>   &,
-            const Vector<double>  &,
-            const Vector<double>  &)
+my_check_this (const DoFHandler<1> &,
+               const Vector<double> &,
+               const Vector<double> &)
 {
-                                   // nothing to check in 1d
+  // nothing to check in 1d
 }
 
 
 template <int dim>
 void
 my_check_this (const DoFHandler<dim> &dof_handler,
-            const Vector<double>  &v_node_x,
-            const Vector<double>  &v_cell_x)
+               const Vector<double>  &v_node_x,
+               const Vector<double>  &v_cell_x)
 {
   BlockVector<double> v_node, v_cell;
   make_block_vector (v_node_x, v_node);
   make_block_vector (v_cell_x, v_cell);
-  
+
   DataOutFaces<dim> data_out_faces;
   data_out_faces.attach_dof_handler (dof_handler);
   data_out_faces.add_data_vector (v_node, "node_data");
   data_out_faces.add_data_vector (v_cell, "cell_data");
   data_out_faces.build_patches ();
-  
+
   data_out_faces.write_dx (deallog.get_file_stream());
   data_out_faces.set_flags (DataOutBase::UcdFlags(true));
-  data_out_faces.write_ucd (deallog.get_file_stream());  
+  data_out_faces.write_ucd (deallog.get_file_stream());
   data_out_faces.write_gmv (deallog.get_file_stream());
   data_out_faces.write_tecplot (deallog.get_file_stream());
   data_out_faces.write_vtk (deallog.get_file_stream());
   data_out_faces.write_gnuplot (deallog.get_file_stream());
   data_out_faces.write_deal_II_intermediate (deallog.get_file_stream());
 
-                                  // povray and eps cannot presently
-                                  // write out face data
+  // povray and eps cannot presently
+  // write out face data
 }
 
 
@@ -74,13 +74,13 @@ check_this (const DoFHandler<dim> &dof_handler,
             const Vector<double>  &v_node,
             const Vector<double>  &v_cell)
 {
-                                  // since we can't forward declare
-                                  // check_this in this file (it is forward
-                                  // declared in data_out_common.h), we
-                                  // also can't make the driver file aware of
-                                  // the overload for 1d. to avoid linker
-                                  // errors, we can consequently not overload
-                                  // check_this, and need this forwarder
-                                  // function
+  // since we can't forward declare
+  // check_this in this file (it is forward
+  // declared in data_out_common.h), we
+  // also can't make the driver file aware of
+  // the overload for 1d. to avoid linker
+  // errors, we can consequently not overload
+  // check_this, and need this forwarder
+  // function
   my_check_this (dof_handler, v_node, v_cell);
 }
index 2d786e6e35f6d336db967197fdb868135e757b55..8588ca36b8a6e7fb20a3cdcaabd5245fcf441658 100644 (file)
@@ -33,14 +33,18 @@ std::string output_file_name = "data_out_faces_03/output";
 template <int dim>
 class XDataOut : public DataOutFaces<dim>
 {
-  public:
-    const std::vector<typename ::DataOutBase::Patch<dim-1,dim> > &
-    get_patches() const
-      { return DataOutFaces<dim>::get_patches(); }
-
-    std::vector<std::string>
-    get_dataset_names () const    
-      { return DataOutFaces<dim>::get_dataset_names();  }
+public:
+  const std::vector<typename ::DataOutBase::Patch<dim-1,dim> > &
+  get_patches() const
+  {
+    return DataOutFaces<dim>::get_patches();
+  }
+
+  std::vector<std::string>
+  get_dataset_names () const
+  {
+    return DataOutFaces<dim>::get_dataset_names();
+  }
 };
 
 // have a class that makes sure we can get at the patches and data set
@@ -48,24 +52,28 @@ class XDataOut : public DataOutFaces<dim>
 template <int dim>
 class XDataOutReader : public DataOutReader<dim-1,dim>
 {
-  public:
-    const std::vector<typename ::DataOutBase::Patch<dim-1,dim> > &
-    get_patches() const
-      { return DataOutReader<dim-1,dim>::get_patches(); }
-
-    std::vector<std::string>
-    get_dataset_names () const    
-      { return DataOutReader<dim-1,dim>::get_dataset_names();  }
+public:
+  const std::vector<typename ::DataOutBase::Patch<dim-1,dim> > &
+  get_patches() const
+  {
+    return DataOutReader<dim-1,dim>::get_patches();
+  }
+
+  std::vector<std::string>
+  get_dataset_names () const
+  {
+    return DataOutReader<dim-1,dim>::get_dataset_names();
+  }
 };
 
 
 
 void
 my_check_this (const DoFHandler<1> &,
-            const Vector<double>  &,
-            const Vector<double>  &)
+               const Vector<double> &,
+               const Vector<double> &)
 {
-                                  // don't check in 1d
+  // don't check in 1d
 }
 
 
@@ -74,15 +82,15 @@ my_check_this (const DoFHandler<1> &,
 template <int dim>
 void
 my_check_this (const DoFHandler<dim> &dof_handler,
-            const Vector<double>  &v_node,
-            const Vector<double>  &v_cell)
+               const Vector<double>  &v_node,
+               const Vector<double>  &v_cell)
 {
   XDataOut<dim> data_out;
   data_out.attach_dof_handler (dof_handler);
   data_out.add_data_vector (v_node, "node_data");
   data_out.add_data_vector (v_cell, "cell_data");
   data_out.build_patches ();
-  
+
   {
     std::ofstream tmp ("data_out_faces_03.tmp");
     data_out.write_deal_II_intermediate (tmp);
@@ -92,24 +100,24 @@ my_check_this (const DoFHandler<dim> &dof_handler,
   {
     std::ifstream tmp ("data_out_faces_03.tmp");
     reader.read (tmp);
-  }  
+  }
 
-                                  // finally make sure that we have
-                                  // read everything back in
-                                  // correctly
+  // finally make sure that we have
+  // read everything back in
+  // correctly
   Assert (data_out.get_dataset_names() == reader.get_dataset_names(),
-         ExcInternalError());
-  
+          ExcInternalError());
+
   Assert (data_out.get_patches().size() == reader.get_patches().size(),
-         ExcInternalError());
+          ExcInternalError());
 
   for (unsigned int i=0; i<reader.get_patches().size(); ++i)
     Assert (data_out.get_patches()[i] == reader.get_patches()[i],
-           ExcInternalError());
+            ExcInternalError());
 
-                                  // for good measure, delete tmp file
+  // for good measure, delete tmp file
   remove ("data_out_faces_03.tmp");
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -122,13 +130,13 @@ check_this (const DoFHandler<dim> &dof_handler,
             const Vector<double>  &v_node,
             const Vector<double>  &v_cell)
 {
-                                  // since we can't forward declare
-                                  // check_this in this file (it is forward
-                                  // declared in data_out_common.h), we
-                                  // also can't make the driver file aware of
-                                  // the overload for 1d. to avoid linker
-                                  // errors, we can consequently not overload
-                                  // check_this, and need this forwarder
-                                  // function
+  // since we can't forward declare
+  // check_this in this file (it is forward
+  // declared in data_out_common.h), we
+  // also can't make the driver file aware of
+  // the overload for 1d. to avoid linker
+  // errors, we can consequently not overload
+  // check_this, and need this forwarder
+  // function
   my_check_this (dof_handler, v_node, v_cell);
 }
index b603dfeaf53764298a254773e3c3bfd4a4f7c43e..2be0e4432d2bdeca517ac249889774700adfe46b 100644 (file)
@@ -36,20 +36,24 @@ std::string output_file_name = "data_out_faces_04/output";
 template <int dim>
 class XDataOut : public DataOutFaces<dim>
 {
-  public:
-    const std::vector<typename ::DataOutBase::Patch<dim-1,dim> > &
-    get_patches() const
-      { return DataOutFaces<dim>::get_patches(); }
-
-    std::vector<std::string>
-    get_dataset_names () const
-      { return DataOutFaces<dim>::get_dataset_names();  }
-
-    std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> >
-    get_vector_data_ranges () const
-      {
-       return DataOutFaces<dim>::get_vector_data_ranges ();
-      }
+public:
+  const std::vector<typename ::DataOutBase::Patch<dim-1,dim> > &
+  get_patches() const
+  {
+    return DataOutFaces<dim>::get_patches();
+  }
+
+  std::vector<std::string>
+  get_dataset_names () const
+  {
+    return DataOutFaces<dim>::get_dataset_names();
+  }
+
+  std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> >
+  get_vector_data_ranges () const
+  {
+    return DataOutFaces<dim>::get_vector_data_ranges ();
+  }
 };
 
 // have a class that makes sure we can get at the patches and data set
@@ -57,30 +61,34 @@ class XDataOut : public DataOutFaces<dim>
 template <int dim>
 class XDataOutReader : public DataOutReader<dim-1,dim>
 {
-  public:
-    const std::vector<typename ::DataOutBase::Patch<dim-1,dim> > &
-    get_patches() const
-      { return DataOutReader<dim-1,dim>::get_patches(); }
-
-    std::vector<std::string>
-    get_dataset_names () const
-      { return DataOutReader<dim-1,dim>::get_dataset_names();  }
-
-    std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> >
-    get_vector_data_ranges () const
-      {
-       return DataOutReader<dim-1,dim>::get_vector_data_ranges ();
-      }
+public:
+  const std::vector<typename ::DataOutBase::Patch<dim-1,dim> > &
+  get_patches() const
+  {
+    return DataOutReader<dim-1,dim>::get_patches();
+  }
+
+  std::vector<std::string>
+  get_dataset_names () const
+  {
+    return DataOutReader<dim-1,dim>::get_dataset_names();
+  }
+
+  std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> >
+  get_vector_data_ranges () const
+  {
+    return DataOutReader<dim-1,dim>::get_vector_data_ranges ();
+  }
 };
 
 
 
 void
 my_check_this (const DoFHandler<1> &,
-            const Vector<double>  &,
-            const Vector<double>  &)
+               const Vector<double> &,
+               const Vector<double> &)
 {
-                                  // don't check in 1d
+  // don't check in 1d
 }
 
 
@@ -89,8 +97,8 @@ my_check_this (const DoFHandler<1> &,
 template <int dim>
 void
 my_check_this (const DoFHandler<dim> &dof_handler,
-            const Vector<double>  &v_node,
-            const Vector<double>  &v_cell)
+               const Vector<double>  &v_node,
+               const Vector<double>  &v_cell)
 {
   XDataOut<dim> data_out;
   data_out.attach_dof_handler (dof_handler);
@@ -109,47 +117,47 @@ my_check_this (const DoFHandler<dim> &dof_handler,
     reader.read (tmp);
   }
 
-                                  // finally make sure that we have
-                                  // read everything back in
-                                  // correctly
+  // finally make sure that we have
+  // read everything back in
+  // correctly
   Assert (data_out.get_dataset_names() == reader.get_dataset_names(),
-         ExcInternalError());
+          ExcInternalError());
 
   Assert (data_out.get_patches().size() == reader.get_patches().size(),
-         ExcInternalError());
+          ExcInternalError());
 
   for (unsigned int i=0; i<reader.get_patches().size(); ++i)
     Assert (data_out.get_patches()[i] == reader.get_patches()[i],
-           ExcInternalError());
+            ExcInternalError());
 
   deallog << data_out.get_vector_data_ranges().size()
-         << std::endl;
+          << std::endl;
   Assert (data_out.get_vector_data_ranges().size() ==
-         reader.get_vector_data_ranges().size(),
-         ExcInternalError());
+          reader.get_vector_data_ranges().size(),
+          ExcInternalError());
   for (unsigned int i=0; i<data_out.get_vector_data_ranges().size(); ++i)
     {
       deallog << std_cxx1x::get<0>(data_out.get_vector_data_ranges()[i])
-             << ' '
-             << std_cxx1x::get<1>(data_out.get_vector_data_ranges()[i])
-             << ' '
-             << std_cxx1x::get<2>(data_out.get_vector_data_ranges()[i])
-             << std::endl;
+              << ' '
+              << std_cxx1x::get<1>(data_out.get_vector_data_ranges()[i])
+              << ' '
+              << std_cxx1x::get<2>(data_out.get_vector_data_ranges()[i])
+              << std::endl;
       Assert (std_cxx1x::get<0>(data_out.get_vector_data_ranges()[i])
-             ==
-             std_cxx1x::get<0>(reader.get_vector_data_ranges()[i]),
-             ExcInternalError());
+              ==
+              std_cxx1x::get<0>(reader.get_vector_data_ranges()[i]),
+              ExcInternalError());
       Assert (std_cxx1x::get<1>(data_out.get_vector_data_ranges()[i])
-             ==
-             std_cxx1x::get<1>(reader.get_vector_data_ranges()[i]),
-             ExcInternalError());
+              ==
+              std_cxx1x::get<1>(reader.get_vector_data_ranges()[i]),
+              ExcInternalError());
       Assert (std_cxx1x::get<2>(data_out.get_vector_data_ranges()[i])
-             ==
-             std_cxx1x::get<2>(reader.get_vector_data_ranges()[i]),
-             ExcInternalError());
+              ==
+              std_cxx1x::get<2>(reader.get_vector_data_ranges()[i]),
+              ExcInternalError());
     }
 
-                                  // for good measure, delete tmp file
+  // for good measure, delete tmp file
   remove ("data_out_faces_04.tmp");
 
   deallog << "OK" << std::endl;
@@ -164,13 +172,13 @@ check_this (const DoFHandler<dim> &dof_handler,
             const Vector<double>  &v_node,
             const Vector<double>  &v_cell)
 {
-                                  // since we can't forward declare
-                                  // check_this in this file (it is forward
-                                  // declared in data_out_common.h), we
-                                  // also can't make the driver file aware of
-                                  // the overload for 1d. to avoid linker
-                                  // errors, we can consequently not overload
-                                  // check_this, and need this forwarder
-                                  // function
+  // since we can't forward declare
+  // check_this in this file (it is forward
+  // declared in data_out_common.h), we
+  // also can't make the driver file aware of
+  // the overload for 1d. to avoid linker
+  // errors, we can consequently not overload
+  // check_this, and need this forwarder
+  // function
   my_check_this (dof_handler, v_node, v_cell);
 }
index 7403b5eaa3ecaf7faa33eb822eccd1b27c34b978..cb92f56157dbec4ae6b9c2efe8b86b7e62a6c370 100644 (file)
@@ -26,37 +26,37 @@ std::string output_file_name = "data_out_rotation_01/output";
 
 
 void
-my_check_this (const DoFHandler<3>   &,
-            const Vector<double>  &,
-            const Vector<double>  &)
+my_check_this (const DoFHandler<3> &,
+               const Vector<double> &,
+               const Vector<double> &)
 {
-                                   // nothing to check in 3d
+  // nothing to check in 3d
 }
 
 
 template <int dim>
 void
 my_check_this (const DoFHandler<dim> &dof_handler,
-            const Vector<double>  &v_node,
-            const Vector<double>  &v_cell)
+               const Vector<double>  &v_node,
+               const Vector<double>  &v_cell)
 {
   DataOutRotation<dim> data_out_rotation;
   data_out_rotation.attach_dof_handler (dof_handler);
   data_out_rotation.add_data_vector (v_node, "node_data");
   data_out_rotation.add_data_vector (v_cell, "cell_data");
   data_out_rotation.build_patches (4);
-  
+
   data_out_rotation.write_dx (deallog.get_file_stream());
   data_out_rotation.set_flags (DataOutBase::UcdFlags(true));
-  data_out_rotation.write_ucd (deallog.get_file_stream());  
+  data_out_rotation.write_ucd (deallog.get_file_stream());
   data_out_rotation.write_gmv (deallog.get_file_stream());
   data_out_rotation.write_tecplot (deallog.get_file_stream());
   data_out_rotation.write_vtk (deallog.get_file_stream());
   data_out_rotation.write_gnuplot (deallog.get_file_stream());
   data_out_rotation.write_deal_II_intermediate (deallog.get_file_stream());
 
-                                   // following only implemented for
-                                   // 1d+rotation=2d
+  // following only implemented for
+  // 1d+rotation=2d
   if (dim == 1)
     {
       data_out_rotation.write_povray (deallog.get_file_stream());
@@ -71,13 +71,13 @@ check_this (const DoFHandler<dim> &dof_handler,
             const Vector<double>  &v_node,
             const Vector<double>  &v_cell)
 {
-                                  // since we can't forward declare
-                                  // check_this in this file (it is forward
-                                  // declared in data_out_common.h), we
-                                  // also can't make the driver file aware of
-                                  // the overload for 1d. to avoid linker
-                                  // errors, we can consequently not overload
-                                  // check_this, and need this forwarder
-                                  // function
+  // since we can't forward declare
+  // check_this in this file (it is forward
+  // declared in data_out_common.h), we
+  // also can't make the driver file aware of
+  // the overload for 1d. to avoid linker
+  // errors, we can consequently not overload
+  // check_this, and need this forwarder
+  // function
   my_check_this (dof_handler, v_node, v_cell);
 }
index 8ffb24ed7442fdbc03099dd0257cb23d044a196f..4e550a72f3da65dee86c198bf5670f7eb71e74d2 100644 (file)
@@ -29,41 +29,41 @@ std::string output_file_name = "data_out_rotation_02/output";
 
 
 void
-my_check_this (const DoFHandler<3>   &,
-            const Vector<double>  &,
-            const Vector<double>  &)
+my_check_this (const DoFHandler<3> &,
+               const Vector<double> &,
+               const Vector<double> &)
 {
-                                   // nothing to check in 3d
+  // nothing to check in 3d
 }
 
 
 template <int dim>
 void
 my_check_this (const DoFHandler<dim> &dof_handler,
-            const Vector<double>  &v_node_x,
-            const Vector<double>  &v_cell_x)
+               const Vector<double>  &v_node_x,
+               const Vector<double>  &v_cell_x)
 {
   BlockVector<double> v_node, v_cell;
   make_block_vector (v_node_x, v_node);
   make_block_vector (v_cell_x, v_cell);
-  
+
   DataOutRotation<dim> data_out_rotation;
   data_out_rotation.attach_dof_handler (dof_handler);
   data_out_rotation.add_data_vector (v_node, "node_data");
   data_out_rotation.add_data_vector (v_cell, "cell_data");
   data_out_rotation.build_patches (4);
-  
+
   data_out_rotation.write_dx (deallog.get_file_stream());
   data_out_rotation.set_flags (DataOutBase::UcdFlags(true));
-  data_out_rotation.write_ucd (deallog.get_file_stream());  
+  data_out_rotation.write_ucd (deallog.get_file_stream());
   data_out_rotation.write_gmv (deallog.get_file_stream());
   data_out_rotation.write_tecplot (deallog.get_file_stream());
   data_out_rotation.write_vtk (deallog.get_file_stream());
   data_out_rotation.write_gnuplot (deallog.get_file_stream());
   data_out_rotation.write_deal_II_intermediate (deallog.get_file_stream());
 
-                                   // following only implemented for
-                                   // 1d+rotation=2d
+  // following only implemented for
+  // 1d+rotation=2d
   if (dim == 1)
     {
       data_out_rotation.write_povray (deallog.get_file_stream());
@@ -78,13 +78,13 @@ check_this (const DoFHandler<dim> &dof_handler,
             const Vector<double>  &v_node,
             const Vector<double>  &v_cell)
 {
-                                  // since we can't forward declare
-                                  // check_this in this file (it is forward
-                                  // declared in data_out_common.h), we
-                                  // also can't make the driver file aware of
-                                  // the overload for 1d. to avoid linker
-                                  // errors, we can consequently not overload
-                                  // check_this, and need this forwarder
-                                  // function
+  // since we can't forward declare
+  // check_this in this file (it is forward
+  // declared in data_out_common.h), we
+  // also can't make the driver file aware of
+  // the overload for 1d. to avoid linker
+  // errors, we can consequently not overload
+  // check_this, and need this forwarder
+  // function
   my_check_this (dof_handler, v_node, v_cell);
 }
index 6da416d63939874bc0e5d2d700bac3b8cb166a28..1549e70039fc90a9ab88a551ed1a03887e88e43f 100644 (file)
@@ -33,14 +33,18 @@ std::string output_file_name = "data_out_rotation_03/output";
 template <int dim>
 class XDataOut : public DataOutRotation<dim>
 {
-  public:
-    const std::vector<typename ::DataOutBase::Patch<dim+1,dim+1> > &
-    get_patches() const
-      { return DataOutRotation<dim>::get_patches(); }
-
-    std::vector<std::string>
-    get_dataset_names () const    
-      { return DataOutRotation<dim>::get_dataset_names();  }
+public:
+  const std::vector<typename ::DataOutBase::Patch<dim+1,dim+1> > &
+  get_patches() const
+  {
+    return DataOutRotation<dim>::get_patches();
+  }
+
+  std::vector<std::string>
+  get_dataset_names () const
+  {
+    return DataOutRotation<dim>::get_dataset_names();
+  }
 };
 
 // have a class that makes sure we can get at the patches and data set
@@ -48,23 +52,27 @@ class XDataOut : public DataOutRotation<dim>
 template <int dim>
 class XDataOutReader : public DataOutReader<dim+1>
 {
-  public:
-    const std::vector<typename ::DataOutBase::Patch<dim+1,dim+1> > &
-    get_patches() const
-      { return DataOutReader<dim+1>::get_patches(); }
-
-    std::vector<std::string>
-    get_dataset_names () const    
-      { return DataOutReader<dim+1>::get_dataset_names();  }
+public:
+  const std::vector<typename ::DataOutBase::Patch<dim+1,dim+1> > &
+  get_patches() const
+  {
+    return DataOutReader<dim+1>::get_patches();
+  }
+
+  std::vector<std::string>
+  get_dataset_names () const
+  {
+    return DataOutReader<dim+1>::get_dataset_names();
+  }
 };
 
 
 void
 my_check_this (const DoFHandler<3> &,
-            const Vector<double>  &,
-            const Vector<double>  &)
+               const Vector<double> &,
+               const Vector<double> &)
 {
-                                  // no checks in 3d
+  // no checks in 3d
 }
 
 
@@ -72,19 +80,19 @@ my_check_this (const DoFHandler<3> &,
 template <int dim>
 void
 my_check_this (const DoFHandler<dim> &dof_handler,
-            const Vector<double>  &v_node,
-            const Vector<double>  &v_cell)
+               const Vector<double>  &v_node,
+               const Vector<double>  &v_cell)
 {
   XDataOut<dim> data_out;
   data_out.attach_dof_handler (dof_handler);
   data_out.add_data_vector (v_node, "node_data");
   data_out.add_data_vector (v_cell, "cell_data");
   data_out.build_patches (4);
-  
+
   {
     std::ofstream tmp ("data_out_rotation_03.tmp");
-                                    // use full precision to avoid
-                                    // errors
+    // use full precision to avoid
+    // errors
     tmp.precision (20);
     data_out.write_deal_II_intermediate (tmp);
   }
@@ -93,24 +101,24 @@ my_check_this (const DoFHandler<dim> &dof_handler,
   {
     std::ifstream tmp ("data_out_rotation_03.tmp");
     reader.read (tmp);
-  }  
+  }
 
-                                  // finally make sure that we have
-                                  // read everything back in
-                                  // correctly
+  // finally make sure that we have
+  // read everything back in
+  // correctly
   Assert (data_out.get_dataset_names() == reader.get_dataset_names(),
-         ExcInternalError());
-  
+          ExcInternalError());
+
   Assert (data_out.get_patches().size() == reader.get_patches().size(),
-         ExcInternalError());
+          ExcInternalError());
 
   for (unsigned int i=0; i<reader.get_patches().size(); ++i)
     Assert (data_out.get_patches()[i] == reader.get_patches()[i],
-           ExcInternalError());
+            ExcInternalError());
 
-                                  // for good measure, delete tmp file
+  // for good measure, delete tmp file
   remove ("data_out_rotation_03.tmp");
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -121,13 +129,13 @@ check_this (const DoFHandler<dim> &dof_handler,
             const Vector<double>  &v_node,
             const Vector<double>  &v_cell)
 {
-                                  // since we can't forward declare
-                                  // check_this in this file (it is forward
-                                  // declared in data_out_common.h), we
-                                  // also can't make the driver file aware of
-                                  // the overload for 1d. to avoid linker
-                                  // errors, we can consequently not overload
-                                  // check_this, and need this forwarder
-                                  // function
+  // since we can't forward declare
+  // check_this in this file (it is forward
+  // declared in data_out_common.h), we
+  // also can't make the driver file aware of
+  // the overload for 1d. to avoid linker
+  // errors, we can consequently not overload
+  // check_this, and need this forwarder
+  // function
   my_check_this (dof_handler, v_node, v_cell);
 }
index 8d89204935f5e8cfa2ae1851c600f586e5d25de3..82cdadb1d136660caf9427580f8f7152882eded3 100644 (file)
@@ -36,20 +36,24 @@ std::string output_file_name = "data_out_rotation_04/output";
 template <int dim>
 class XDataOut : public DataOutRotation<dim>
 {
-  public:
-    const std::vector<typename ::DataOutBase::Patch<dim+1,dim+1> > &
-    get_patches() const
-      { return DataOutRotation<dim>::get_patches(); }
-
-    std::vector<std::string>
-    get_dataset_names () const
-      { return DataOutRotation<dim>::get_dataset_names();  }
-
-    std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> >
-    get_vector_data_ranges () const
-      {
-       return DataOutRotation<dim>::get_vector_data_ranges ();
-      }
+public:
+  const std::vector<typename ::DataOutBase::Patch<dim+1,dim+1> > &
+  get_patches() const
+  {
+    return DataOutRotation<dim>::get_patches();
+  }
+
+  std::vector<std::string>
+  get_dataset_names () const
+  {
+    return DataOutRotation<dim>::get_dataset_names();
+  }
+
+  std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> >
+  get_vector_data_ranges () const
+  {
+    return DataOutRotation<dim>::get_vector_data_ranges ();
+  }
 };
 
 // have a class that makes sure we can get at the patches and data set
@@ -57,29 +61,33 @@ class XDataOut : public DataOutRotation<dim>
 template <int dim>
 class XDataOutReader : public DataOutReader<dim+1>
 {
-  public:
-    const std::vector<typename ::DataOutBase::Patch<dim+1,dim+1> > &
-    get_patches() const
-      { return DataOutReader<dim+1>::get_patches(); }
-
-    std::vector<std::string>
-    get_dataset_names () const
-      { return DataOutReader<dim+1>::get_dataset_names();  }
-
-    std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> >
-    get_vector_data_ranges () const
-      {
-       return DataOutReader<dim+1>::get_vector_data_ranges ();
-      }
+public:
+  const std::vector<typename ::DataOutBase::Patch<dim+1,dim+1> > &
+  get_patches() const
+  {
+    return DataOutReader<dim+1>::get_patches();
+  }
+
+  std::vector<std::string>
+  get_dataset_names () const
+  {
+    return DataOutReader<dim+1>::get_dataset_names();
+  }
+
+  std::vector<std_cxx1x::tuple<unsigned int, unsigned int, std::string> >
+  get_vector_data_ranges () const
+  {
+    return DataOutReader<dim+1>::get_vector_data_ranges ();
+  }
 };
 
 
 void
 my_check_this (const DoFHandler<3> &,
-            const Vector<double>  &,
-            const Vector<double>  &)
+               const Vector<double> &,
+               const Vector<double> &)
 {
-                                  // no checks in 3d
+  // no checks in 3d
 }
 
 
@@ -87,8 +95,8 @@ my_check_this (const DoFHandler<3> &,
 template <int dim>
 void
 my_check_this (const DoFHandler<dim> &dof_handler,
-            const Vector<double>  &v_node,
-            const Vector<double>  &v_cell)
+               const Vector<double>  &v_node,
+               const Vector<double>  &v_cell)
 {
   XDataOut<dim> data_out;
   data_out.attach_dof_handler (dof_handler);
@@ -98,8 +106,8 @@ my_check_this (const DoFHandler<dim> &dof_handler,
 
   {
     std::ofstream tmp ("data_out_rotation_04.tmp");
-                                    // use full precision to avoid
-                                    // errors
+    // use full precision to avoid
+    // errors
     tmp.precision (20);
     data_out.write_deal_II_intermediate (tmp);
   }
@@ -110,47 +118,47 @@ my_check_this (const DoFHandler<dim> &dof_handler,
     reader.read (tmp);
   }
 
-                                  // finally make sure that we have
-                                  // read everything back in
-                                  // correctly
+  // finally make sure that we have
+  // read everything back in
+  // correctly
   Assert (data_out.get_dataset_names() == reader.get_dataset_names(),
-         ExcInternalError());
+          ExcInternalError());
 
   Assert (data_out.get_patches().size() == reader.get_patches().size(),
-         ExcInternalError());
+          ExcInternalError());
 
   for (unsigned int i=0; i<reader.get_patches().size(); ++i)
     Assert (data_out.get_patches()[i] == reader.get_patches()[i],
-           ExcInternalError());
+            ExcInternalError());
 
   deallog << data_out.get_vector_data_ranges().size()
-         << std::endl;
+          << std::endl;
   Assert (data_out.get_vector_data_ranges().size() ==
-         reader.get_vector_data_ranges().size(),
-         ExcInternalError());
+          reader.get_vector_data_ranges().size(),
+          ExcInternalError());
   for (unsigned int i=0; i<data_out.get_vector_data_ranges().size(); ++i)
     {
       deallog << std_cxx1x::get<0>(data_out.get_vector_data_ranges()[i])
-             << ' '
-             << std_cxx1x::get<1>(data_out.get_vector_data_ranges()[i])
-             << ' '
-             << std_cxx1x::get<2>(data_out.get_vector_data_ranges()[i])
-             << std::endl;
+              << ' '
+              << std_cxx1x::get<1>(data_out.get_vector_data_ranges()[i])
+              << ' '
+              << std_cxx1x::get<2>(data_out.get_vector_data_ranges()[i])
+              << std::endl;
       Assert (std_cxx1x::get<0>(data_out.get_vector_data_ranges()[i])
-             ==
-             std_cxx1x::get<0>(reader.get_vector_data_ranges()[i]),
-             ExcInternalError());
+              ==
+              std_cxx1x::get<0>(reader.get_vector_data_ranges()[i]),
+              ExcInternalError());
       Assert (std_cxx1x::get<1>(data_out.get_vector_data_ranges()[i])
-             ==
-             std_cxx1x::get<1>(reader.get_vector_data_ranges()[i]),
-             ExcInternalError());
+              ==
+              std_cxx1x::get<1>(reader.get_vector_data_ranges()[i]),
+              ExcInternalError());
       Assert (std_cxx1x::get<2>(data_out.get_vector_data_ranges()[i])
-             ==
-             std_cxx1x::get<2>(reader.get_vector_data_ranges()[i]),
-             ExcInternalError());
+              ==
+              std_cxx1x::get<2>(reader.get_vector_data_ranges()[i]),
+              ExcInternalError());
     }
 
-                                  // for good measure, delete tmp file
+  // for good measure, delete tmp file
   remove ("data_out_rotation_04.tmp");
 
   deallog << "OK" << std::endl;
@@ -163,13 +171,13 @@ check_this (const DoFHandler<dim> &dof_handler,
             const Vector<double>  &v_node,
             const Vector<double>  &v_cell)
 {
-                                  // since we can't forward declare
-                                  // check_this in this file (it is forward
-                                  // declared in data_out_common.h), we
-                                  // also can't make the driver file aware of
-                                  // the overload for 1d. to avoid linker
-                                  // errors, we can consequently not overload
-                                  // check_this, and need this forwarder
-                                  // function
+  // since we can't forward declare
+  // check_this in this file (it is forward
+  // declared in data_out_common.h), we
+  // also can't make the driver file aware of
+  // the overload for 1d. to avoid linker
+  // errors, we can consequently not overload
+  // check_this, and need this forwarder
+  // function
   my_check_this (dof_handler, v_node, v_cell);
 }
index cddeda4d3af2a16ed428e982d50509bfbc93a35a..633d94b37f63faa6010a07d43647512a61b3de71 100644 (file)
@@ -30,21 +30,21 @@ check_this (const DoFHandler<dim> &dof_handler,
             const Vector<double>  &v_node,
             const Vector<double>  &v_cell)
 {
-                                   // 3d would generate 4d data, which
-                                   // we don't presently support
-                                   //
-                                   // output for 2d+time is not
-                                   // presently implemented
+  // 3d would generate 4d data, which
+  // we don't presently support
+  //
+  // output for 2d+time is not
+  // presently implemented
   if (dim > 1)
     return;
-  
+
   DataOutStack<dim> data_out_stack;
   data_out_stack.declare_data_vector ("node_data",
                                       DataOutStack<dim>::dof_vector);
   data_out_stack.declare_data_vector ("cell_data",
                                       DataOutStack<dim>::cell_vector);
-  
-  
+
+
   data_out_stack.new_parameter_value (1., 1.);
   data_out_stack.attach_dof_handler (dof_handler);
   data_out_stack.add_data_vector (v_node, "node_data");
@@ -64,23 +64,23 @@ check_this (const DoFHandler<dim> &dof_handler,
   data_out_stack.add_data_vector (vc1, "cell_data");
   data_out_stack.build_patches ();
   data_out_stack.finish_parameter_value ();
-  
+
   data_out_stack.write_dx (deallog.get_file_stream());
   data_out_stack.set_flags (DataOutBase::UcdFlags(true));
-  data_out_stack.write_ucd (deallog.get_file_stream());  
+  data_out_stack.write_ucd (deallog.get_file_stream());
   data_out_stack.write_gmv (deallog.get_file_stream());
   data_out_stack.write_tecplot (deallog.get_file_stream());
   data_out_stack.write_vtk (deallog.get_file_stream());
   data_out_stack.write_gnuplot (deallog.get_file_stream());
   data_out_stack.write_deal_II_intermediate (deallog.get_file_stream());
 
-                                   // the following is only
-                                   // implemented for 2d (=1d+time)
+  // the following is only
+  // implemented for 2d (=1d+time)
   if (dim == 1)
     {
       data_out_stack.write_povray (deallog.get_file_stream());
       data_out_stack.write_eps (deallog.get_file_stream());
-    }  
+    }
 }
 
 
index c4057afe8b99f337eac6710fdae17e9c1837c23b..bb24c2efcb6c631b5cc33bac4c793df70ba149c7 100644 (file)
@@ -34,21 +34,21 @@ check_this (const DoFHandler<dim> &dof_handler,
             const Vector<double>  &v_node,
             const Vector<double>  &v_cell)
 {
-                                   // 3d would generate 4d data, which
-                                   // we don't presently support
-                                   //
-                                   // output for 2d+time is not
-                                   // presently implemented
+  // 3d would generate 4d data, which
+  // we don't presently support
+  //
+  // output for 2d+time is not
+  // presently implemented
   if (dim > 1)
     return;
-  
+
   DataOutStack<dim> data_out_stack;
   data_out_stack.declare_data_vector ("node_data",
                                       DataOutStack<dim>::dof_vector);
   data_out_stack.declare_data_vector ("cell_data",
                                       DataOutStack<dim>::cell_vector);
-  
-  
+
+
   data_out_stack.new_parameter_value (1., 1.);
   data_out_stack.attach_dof_handler (dof_handler);
 
@@ -72,23 +72,23 @@ check_this (const DoFHandler<dim> &dof_handler,
   data_out_stack.add_data_vector (vc1, names_2);
   data_out_stack.build_patches ();
   data_out_stack.finish_parameter_value ();
-  
+
   data_out_stack.write_dx (deallog.get_file_stream());
   data_out_stack.set_flags (DataOutBase::UcdFlags(true));
-  data_out_stack.write_ucd (deallog.get_file_stream());  
+  data_out_stack.write_ucd (deallog.get_file_stream());
   data_out_stack.write_gmv (deallog.get_file_stream());
   data_out_stack.write_tecplot (deallog.get_file_stream());
   data_out_stack.write_vtk (deallog.get_file_stream());
   data_out_stack.write_gnuplot (deallog.get_file_stream());
   data_out_stack.write_deal_II_intermediate (deallog.get_file_stream());
 
-                                   // the following is only
-                                   // implemented for 2d (=1d+time)
+  // the following is only
+  // implemented for 2d (=1d+time)
   if (dim == 1)
     {
       data_out_stack.write_povray (deallog.get_file_stream());
       data_out_stack.write_eps (deallog.get_file_stream());
-    }  
+    }
 }
 
 
index 9ea6b00c70a88228e91f22332f704a9ef9157edb..1377daebe5d3e524bb99b47adad075713e9ed1f2 100644 (file)
 
 
 template <int dim>
-void run () 
+void run ()
 {
   Triangulation<dim> triangulation;
   GridGenerator::hyper_cube (triangulation, -1, 1);
   triangulation.refine_global (1);
-  
+
   FE_Q<dim> fe(1);
   DoFHandler<dim> dof_handler(triangulation);
   dof_handler.distribute_dofs (fe);
 
-                                  // create a continuous field over
-                                  // this DoFHandler
+  // create a continuous field over
+  // this DoFHandler
   Vector<double> v(dof_handler.n_dofs());
   v = 1.;
   v(v.size()/2) = 2.;
 
-                                  // output this field using
-                                  // DataOutStack. the result should
-                                  // be a continuous field again
+  // output this field using
+  // DataOutStack. the result should
+  // be a continuous field again
   DataOutStack<dim> data_out_stack;
   data_out_stack.declare_data_vector ("solution",
-                                     DataOutStack<dim>::dof_vector);
+                                      DataOutStack<dim>::dof_vector);
   data_out_stack.new_parameter_value (1,1);
   data_out_stack.attach_dof_handler (dof_handler);
   data_out_stack.add_data_vector (v, "solution");
@@ -67,7 +67,7 @@ void run ()
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("data_out_stack_03/output");
   deallog.attach(logfile);
index 603126037f43794021d3d6e2e24c45a17e0cb3f7..2b201f084c349f9f1dcf5e22ff34f9f291dac867 100644 (file)
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
-  
+
   u = 0.;
   f = 1.;
-  try 
+  try
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -69,7 +69,7 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   GrowingVectorMemory<> mem;
   SolverControl control(100, 1.e-3);
 
@@ -77,8 +77,8 @@ int main()
   unsigned int dim = (size-1)*(size-1);
 
   deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                   // Make matrix
+
+  // Make matrix
   FDMatrix testproblem(size, size);
   SparsityPattern structure(dim, dim, 5);
   testproblem.five_point_structure(structure);
index 72f3115c5c240ad8c8f3cd5d0615db649ea1f753..548c2b568367cac6762ae0b3dbdcd89a6de8d5cb 100644 (file)
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
-  
+
   u = 0.;
   f = 1.;
-  try 
+  try
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -68,7 +68,7 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   GrowingVectorMemory<> mem;
   SolverControl control(100, 1.e-3);
 
@@ -76,8 +76,8 @@ int main()
   unsigned int dim = (size-1)*(size-1);
 
   deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                   // Make matrix
+
+  // Make matrix
   FDMatrix testproblem(size, size);
   SparsityPattern structure(dim, dim, 5);
   testproblem.five_point_structure(structure);
index 31e6aacd0f95707813d6d0758376812fbab1bafc..461f057fb835421d767861464b9eee5c2a20342b 100644 (file)
@@ -22,7 +22,7 @@
 // the program is already there let's make use of it.
 //
 // this program is a modified version of one by
-// Denis Danilov <danilovdenis@yandex.ru>, 
+// Denis Danilov <danilovdenis@yandex.ru>,
 
 
 #include "../tests.h"
 
 class F : public Function<2>
 {
-  public:
-    virtual double value (const Point<2> &p, const unsigned int) const
-      {
-        double delta = 0.05;
-        double x, y, r;
-        x = p(0);
-        y = p(1);
-        r = std::sqrt( x*x + y*y );
-        return 0.5 * ( 1 - std::tanh( ( r - 0.5 )
-                                 /( 2*M_SQRT2 * delta ) ) ) ;
-      }
+public:
+  virtual double value (const Point<2> &p, const unsigned int) const
+  {
+    double delta = 0.05;
+    double x, y, r;
+    x = p(0);
+    y = p(1);
+    r = std::sqrt( x*x + y*y );
+    return 0.5 * ( 1 - std::tanh( ( r - 0.5 )
+                                  /( 2*M_SQRT2 * delta ) ) ) ;
+  }
 };
 
 
-int main() 
+int main()
 {
   std::ofstream logfile("denis_1/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
 
   Triangulation<2>   triangulation;
   FE_Q<2>            fe(2);
@@ -79,7 +79,7 @@ int main()
   dof_handler.distribute_dofs(fe);
 
   DoFHandler<2>::active_cell_iterator cell = dof_handler.begin_active(), endc = dof_handler.end();
-  
+
   phi_solution.reinit(dof_handler.n_dofs());
   VectorTools::interpolate (dof_handler, F(), phi_solution);
 
@@ -89,17 +89,17 @@ int main()
   gradient_phi_min = 1e30;
   gradient_phi_max = -1;
 
-  cell = dof_handler.begin_active();  
-  for(unsigned int cell_no=0; cell!=endc; ++cell, ++cell_no)
+  cell = dof_handler.begin_active();
+  for (unsigned int cell_no=0; cell!=endc; ++cell, ++cell_no)
     {
-      if( gradient_phi(cell_no) < gradient_phi_min )
-       gradient_phi_min =  gradient_phi(cell_no);
-      
-      if( gradient_phi(cell_no) > gradient_phi_max )
-       gradient_phi_max =  gradient_phi(cell_no);
-      
+      if ( gradient_phi(cell_no) < gradient_phi_min )
+        gradient_phi_min =  gradient_phi(cell_no);
+
+      if ( gradient_phi(cell_no) > gradient_phi_max )
+        gradient_phi_max =  gradient_phi(cell_no);
+
     }
 
   deallog << "gradient_phi_min: " << gradient_phi_min << std::endl;
-  deallog << "gradient_phi_max: " << gradient_phi_max << std::endl; 
+  deallog << "gradient_phi_max: " << gradient_phi_max << std::endl;
 }
index 9e9c6c88b3a4f7e769d2f9e24e0d88f8eccfd3bd..7b38059a68de6d5b87d4e1bbb8e8caa8a7743601 100644 (file)
@@ -45,16 +45,16 @@ void check (const unsigned int testcase)
 
   switch (testcase)
     {
-      case 1:
-           deallog << "Pinched cell in " << dim << "d" << std::endl;
-           vertices[0] = vertices[1];
-           break;
-      case 2:
-           deallog << "Twisted cell in " << dim << "d" << std::endl;
-           std::swap (vertices[0], vertices[1]);
-           break;
-      default:
-           Assert (false, ExcNotImplemented());
+    case 1:
+      deallog << "Pinched cell in " << dim << "d" << std::endl;
+      vertices[0] = vertices[1];
+      break;
+    case 2:
+      deallog << "Twisted cell in " << dim << "d" << std::endl;
+      std::swap (vertices[0], vertices[1]);
+      break;
+    default:
+      Assert (false, ExcNotImplemented());
     }
 
 
@@ -78,9 +78,9 @@ void check (const unsigned int testcase)
       flag = true;
 
       deallog << dcv.distorted_cells.size() << " distorted cells"
-             << std::endl;
+              << std::endl;
       Assert (dcv.distorted_cells.front() == coarse_grid.begin(0),
-             ExcInternalError());
+              ExcInternalError());
     }
 
   Assert (flag == true, ExcInternalError());
index b15dffd31ad8837f4fe5f7ce82ce9dff18dc35f5..d93df5e318b538a29117ff178dfe924f72c52968 100644 (file)
@@ -56,9 +56,9 @@ void check ()
       flag = true;
 
       deallog << dcv.distorted_cells.size() << " distorted cells"
-             << std::endl;
+              << std::endl;
       Assert (dcv.distorted_cells.front() == coarse_grid.begin(0),
-             ExcInternalError());
+              ExcInternalError());
     }
 
   Assert (flag == true, ExcInternalError());
index 3b6d603dd6758476b2d4bb52c340218fe46fb7b8..08985b912d19c9c5079f27d988ee48085b32390d 100644 (file)
 template <int dim>
 class MyBoundary : public Boundary<dim>
 {
-    virtual Point<dim>
-    get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const
-      {
-       deallog << "Finding point between "
-               << line->vertex(0) << " and "
-               << line->vertex(1) << std::endl;
-
-                                        // in 2d, find a point that
-                                        // lies on the opposite side
-                                        // of the quad. in 3d, choose
-                                        // the midpoint of the edge
-       if (dim == 2)
-         return Point<dim>(0,0.75);
-       else
-         return (line->vertex(0) + line->vertex(1)) / 2;
-      }
-
-    virtual Point<dim>
-    get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const
-      {
-       deallog << "Finding point between "
-               << quad->vertex(0) << " and "
-               << quad->vertex(1) << " and "
-               << quad->vertex(2) << " and "
-               << quad->vertex(3) << std::endl;
-
-       return Point<dim>(0,0,.75);
-      }
+  virtual Point<dim>
+  get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const
+  {
+    deallog << "Finding point between "
+            << line->vertex(0) << " and "
+            << line->vertex(1) << std::endl;
+
+    // in 2d, find a point that
+    // lies on the opposite side
+    // of the quad. in 3d, choose
+    // the midpoint of the edge
+    if (dim == 2)
+      return Point<dim>(0,0.75);
+    else
+      return (line->vertex(0) + line->vertex(1)) / 2;
+  }
+
+  virtual Point<dim>
+  get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const
+  {
+    deallog << "Finding point between "
+            << quad->vertex(0) << " and "
+            << quad->vertex(1) << " and "
+            << quad->vertex(2) << " and "
+            << quad->vertex(3) << std::endl;
+
+    return Point<dim>(0,0,.75);
+  }
 };
 
 
@@ -79,18 +79,18 @@ void check ()
 {
   MyBoundary<dim> my_boundary;
 
-                                  // create a single square/cube
+  // create a single square/cube
   Triangulation<dim> coarse_grid (Triangulation<dim>::none, true);
   GridGenerator::hyper_cube (coarse_grid, -1, 1);
 
-                                  // set bottom face to use MyBoundary
+  // set bottom face to use MyBoundary
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (coarse_grid.begin_active()->face(f)->center()[dim-1] == -1)
       coarse_grid.begin_active()->face(f)->set_boundary_indicator (1);
   coarse_grid.set_boundary (1, my_boundary);
 
-                                  // now try to refine this one
-                                  // cell. we should get an exception
+  // now try to refine this one
+  // cell. we should get an exception
   bool flag = false;
   try
     {
@@ -102,21 +102,21 @@ void check ()
       flag = true;
 
       deallog << dcv.distorted_cells.size() << " distorted cells"
-             << std::endl;
+              << std::endl;
       Assert (dcv.distorted_cells.front() == coarse_grid.begin(0),
-             ExcInternalError());
+              ExcInternalError());
 
-                                      // ignore the exception, i.e. do not
-                                      // even attempt to fix up the problem
-                                      // (but see the _04 testcase for this)
+      // ignore the exception, i.e. do not
+      // even attempt to fix up the problem
+      // (but see the _04 testcase for this)
     }
 
   Assert (flag == true, ExcInternalError());
   Assert (coarse_grid.n_levels() == 2, ExcInternalError());
   Assert (coarse_grid.n_active_cells() == 1<<dim, ExcInternalError());
 
-                                  // output the coordinates of the
-                                  // child cells
+  // output the coordinates of the
+  // child cells
   GridOut().write_gnuplot (coarse_grid, deallog.get_file_stream());
 }
 
index 6955f44808827e36c8aa285e90dad708c8c1fbfd..c62a954cccb0c7bb5f06244a17cca1dffa0cbe99 100644 (file)
 template <int dim>
 class MyBoundary : public Boundary<dim>
 {
-    virtual Point<dim>
-    get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const
-      {
-       deallog << "Finding point between "
-               << line->vertex(0) << " and "
-               << line->vertex(1) << std::endl;
-
-                                        // in 2d, find a point that
-                                        // lies on the opposite side
-                                        // of the quad. in 3d, choose
-                                        // the midpoint of the edge
-       if (dim == 2)
-         return Point<dim>(0,0.75);
-       else
-         return (line->vertex(0) + line->vertex(1)) / 2;
-      }
-
-    virtual Point<dim>
-    get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const
-      {
-       deallog << "Finding point between "
-               << quad->vertex(0) << " and "
-               << quad->vertex(1) << " and "
-               << quad->vertex(2) << " and "
-               << quad->vertex(3) << std::endl;
-
-       return Point<dim>(0,0,.75);
-      }
-
-    virtual
-    Point<dim>
-    project_to_surface (const typename Triangulation<dim>::line_iterator &,
-                       const Point<dim> &p) const
-      {
-       deallog << "Projecting line point " << p << std::endl;
-
-       if (dim == 2)
-         return Point<dim>(p[0], 0.75-1.75*std::fabs(p[0]));
-       else
-         return p;
-      }
-
-    virtual
-    Point<dim>
-    project_to_surface (const typename Triangulation<dim>::quad_iterator &,
-                       const Point<dim> &p) const
-      {
-       deallog << "Projecting quad point " << p << std::endl;
-
-       Assert (dim == 3, ExcInternalError());
-
-       return Point<dim>(p[0], p[1],
-                         0.75-1.75*std::max(std::fabs(p[0]),
-                                            std::fabs(p[1])));
-      }
-
-    virtual
-    Point<dim>
-    project_to_surface (const typename Triangulation<dim>::hex_iterator &,
-                       const Point<dim> &) const
-      {
-       Assert (false, ExcInternalError());
-       return Point<dim>();
-      }
+  virtual Point<dim>
+  get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const
+  {
+    deallog << "Finding point between "
+            << line->vertex(0) << " and "
+            << line->vertex(1) << std::endl;
+
+    // in 2d, find a point that
+    // lies on the opposite side
+    // of the quad. in 3d, choose
+    // the midpoint of the edge
+    if (dim == 2)
+      return Point<dim>(0,0.75);
+    else
+      return (line->vertex(0) + line->vertex(1)) / 2;
+  }
+
+  virtual Point<dim>
+  get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const
+  {
+    deallog << "Finding point between "
+            << quad->vertex(0) << " and "
+            << quad->vertex(1) << " and "
+            << quad->vertex(2) << " and "
+            << quad->vertex(3) << std::endl;
+
+    return Point<dim>(0,0,.75);
+  }
+
+  virtual
+  Point<dim>
+  project_to_surface (const typename Triangulation<dim>::line_iterator &,
+                      const Point<dim> &p) const
+  {
+    deallog << "Projecting line point " << p << std::endl;
+
+    if (dim == 2)
+      return Point<dim>(p[0], 0.75-1.75*std::fabs(p[0]));
+    else
+      return p;
+  }
+
+  virtual
+  Point<dim>
+  project_to_surface (const typename Triangulation<dim>::quad_iterator &,
+                      const Point<dim> &p) const
+  {
+    deallog << "Projecting quad point " << p << std::endl;
+
+    Assert (dim == 3, ExcInternalError());
+
+    return Point<dim>(p[0], p[1],
+                      0.75-1.75*std::max(std::fabs(p[0]),
+                                         std::fabs(p[1])));
+  }
+
+  virtual
+  Point<dim>
+  project_to_surface (const typename Triangulation<dim>::hex_iterator &,
+                      const Point<dim> &) const
+  {
+    Assert (false, ExcInternalError());
+    return Point<dim>();
+  }
 };
 
 
@@ -112,18 +112,18 @@ void check ()
 {
   MyBoundary<dim> my_boundary;
 
-                                  // create a single square/cube
+  // create a single square/cube
   Triangulation<dim> coarse_grid (Triangulation<dim>::none, true);
   GridGenerator::hyper_cube (coarse_grid, -1, 1);
 
-                                  // set bottom face to use MyBoundary
+  // set bottom face to use MyBoundary
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (coarse_grid.begin_active()->face(f)->center()[dim-1] == -1)
       coarse_grid.begin_active()->face(f)->set_boundary_indicator (1);
   coarse_grid.set_boundary (1, my_boundary);
 
-                                  // now try to refine this one
-                                  // cell. we should get an exception
+  // now try to refine this one
+  // cell. we should get an exception
   try
     {
       coarse_grid.begin_active()->set_refine_flag ();
@@ -132,17 +132,17 @@ void check ()
   catch (typename Triangulation<dim>::DistortedCellList &dcv)
     {
       typename Triangulation<dim>::DistortedCellList
-       subset = GridTools::fix_up_distorted_child_cells (dcv,
-                                                         coarse_grid);
+      subset = GridTools::fix_up_distorted_child_cells (dcv,
+                                                        coarse_grid);
       Assert (subset.distorted_cells.size() == 0,
-             ExcInternalError());
+              ExcInternalError());
     }
 
   Assert (coarse_grid.n_levels() == 2, ExcInternalError());
   Assert (coarse_grid.n_active_cells() == 1<<dim, ExcInternalError());
 
-                                  // output the coordinates of the
-                                  // child cells
+  // output the coordinates of the
+  // child cells
   GridOut().write_gnuplot (coarse_grid, deallog.get_file_stream());
 }
 
index a8b2a5324ed1fc5191190e5a0449a6213547224b..28220c4d5a0e6a126a7a58f59cd3249667b5d0d2 100644 (file)
 template <int dim>
 class MyBoundary : public Boundary<dim>
 {
-    virtual Point<dim>
-    get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const
-      {
-       deallog << "Finding point between "
-               << line->vertex(0) << " and "
-               << line->vertex(1) << std::endl;
-
-                                        // in 2d, find a point that
-                                        // lies on the opposite side
-                                        // of the quad. in 3d, choose
-                                        // the midpoint of the edge
-       if (dim == 2)
-         return Point<dim>(0,1.25);
-       else
-         return (line->vertex(0) + line->vertex(1)) / 2;
-      }
-
-    virtual Point<dim>
-    get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const
-      {
-       deallog << "Finding point between "
-               << quad->vertex(0) << " and "
-               << quad->vertex(1) << " and "
-               << quad->vertex(2) << " and "
-               << quad->vertex(3) << std::endl;
-
-       return Point<dim>(0,0,1.25);
-      }
-
-    virtual
-    Point<dim>
-    project_to_surface (const typename Triangulation<dim>::line_iterator &,
-                       const Point<dim> &p) const
-      {
-       deallog << "Projecting line point " << p << std::endl;
-
-       if (dim == 2)
-         return Point<dim>(p[0], 1.25-2.25*std::fabs(p[0]));
-       else
-         return p;
-      }
-
-    virtual
-    Point<dim>
-    project_to_surface (const typename Triangulation<dim>::quad_iterator &,
-                       const Point<dim> &p) const
-      {
-       deallog << "Projecting quad point " << p << std::endl;
-
-       Assert (dim == 3, ExcInternalError());
-
-       return Point<dim>(p[0], p[1],
-                         1.25-2.25*std::max(std::fabs(p[0]),
-                                            std::fabs(p[1])));
-      }
-
-    virtual
-    Point<dim>
-    project_to_surface (const typename Triangulation<dim>::hex_iterator &,
-                       const Point<dim> &) const
-      {
-       Assert (false, ExcInternalError());
-       return Point<dim>();
-      }
+  virtual Point<dim>
+  get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const
+  {
+    deallog << "Finding point between "
+            << line->vertex(0) << " and "
+            << line->vertex(1) << std::endl;
+
+    // in 2d, find a point that
+    // lies on the opposite side
+    // of the quad. in 3d, choose
+    // the midpoint of the edge
+    if (dim == 2)
+      return Point<dim>(0,1.25);
+    else
+      return (line->vertex(0) + line->vertex(1)) / 2;
+  }
+
+  virtual Point<dim>
+  get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const
+  {
+    deallog << "Finding point between "
+            << quad->vertex(0) << " and "
+            << quad->vertex(1) << " and "
+            << quad->vertex(2) << " and "
+            << quad->vertex(3) << std::endl;
+
+    return Point<dim>(0,0,1.25);
+  }
+
+  virtual
+  Point<dim>
+  project_to_surface (const typename Triangulation<dim>::line_iterator &,
+                      const Point<dim> &p) const
+  {
+    deallog << "Projecting line point " << p << std::endl;
+
+    if (dim == 2)
+      return Point<dim>(p[0], 1.25-2.25*std::fabs(p[0]));
+    else
+      return p;
+  }
+
+  virtual
+  Point<dim>
+  project_to_surface (const typename Triangulation<dim>::quad_iterator &,
+                      const Point<dim> &p) const
+  {
+    deallog << "Projecting quad point " << p << std::endl;
+
+    Assert (dim == 3, ExcInternalError());
+
+    return Point<dim>(p[0], p[1],
+                      1.25-2.25*std::max(std::fabs(p[0]),
+                                         std::fabs(p[1])));
+  }
+
+  virtual
+  Point<dim>
+  project_to_surface (const typename Triangulation<dim>::hex_iterator &,
+                      const Point<dim> &) const
+  {
+    Assert (false, ExcInternalError());
+    return Point<dim>();
+  }
 };
 
 
@@ -114,18 +114,18 @@ void check ()
 {
   MyBoundary<dim> my_boundary;
 
-                                  // create a single square/cube
+  // create a single square/cube
   Triangulation<dim> coarse_grid (Triangulation<dim>::none, true);
   GridGenerator::hyper_cube (coarse_grid, -1, 1);
 
-                                  // set bottom face to use MyBoundary
+  // set bottom face to use MyBoundary
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (coarse_grid.begin_active()->face(f)->center()[dim-1] == -1)
       coarse_grid.begin_active()->face(f)->set_boundary_indicator (1);
   coarse_grid.set_boundary (1, my_boundary);
 
-                                  // now try to refine this one
-                                  // cell. we should get an exception
+  // now try to refine this one
+  // cell. we should get an exception
   try
     {
       coarse_grid.begin_active()->set_refine_flag ();
@@ -134,17 +134,17 @@ void check ()
   catch (typename Triangulation<dim>::DistortedCellList &dcv)
     {
       typename Triangulation<dim>::DistortedCellList
-       subset = GridTools::fix_up_distorted_child_cells (dcv,
-                                                         coarse_grid);
+      subset = GridTools::fix_up_distorted_child_cells (dcv,
+                                                        coarse_grid);
       Assert (subset.distorted_cells.size() == 1,
-             ExcInternalError());
+              ExcInternalError());
     }
 
   Assert (coarse_grid.n_levels() == 2, ExcInternalError());
   Assert (coarse_grid.n_active_cells() == 1<<dim, ExcInternalError());
 
-                                  // output the coordinates of the
-                                  // child cells
+  // output the coordinates of the
+  // child cells
   GridOut().write_gnuplot (coarse_grid, deallog.get_file_stream());
 }
 
index 6d38d1982c5786cdd960186e73f14053456363d9..6a04aeae9ed0ed4398e1300ea80dd8cf272f8f33 100644 (file)
 template <int dim>
 class MyBoundary : public Boundary<dim>
 {
-    virtual Point<dim>
-    get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const
-      {
-       deallog << "Finding point between "
-               << line->vertex(0) << " and "
-               << line->vertex(1) << std::endl;
-
-       return Point<dim>(0,0.5,0.9);
-      }
-
-    virtual Point<dim>
-    get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &) const
-      {
-       Assert (false, ExcInternalError());
-       return Point<dim>(0,0,1.25);
-      }
+  virtual Point<dim>
+  get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const
+  {
+    deallog << "Finding point between "
+            << line->vertex(0) << " and "
+            << line->vertex(1) << std::endl;
+
+    return Point<dim>(0,0.5,0.9);
+  }
+
+  virtual Point<dim>
+  get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &) const
+  {
+    Assert (false, ExcInternalError());
+    return Point<dim>(0,0,1.25);
+  }
 };
 
 
@@ -65,7 +65,7 @@ void check ()
 {
   MyBoundary<dim> my_boundary;
 
-                                  // create two cubes
+  // create two cubes
   Triangulation<dim> coarse_grid (Triangulation<dim>::none, true);
 
   std::vector<unsigned int> sub(dim, 1);
@@ -73,17 +73,17 @@ void check ()
   Point<dim> p1 (-1,0,0), p2(1,1,1);
   GridGenerator::subdivided_hyper_rectangle(coarse_grid, sub, p1, p2, true);
 
-                                  // set bottom middle edge to use MyBoundary
+  // set bottom middle edge to use MyBoundary
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     for (unsigned int e=0; e<GeometryInfo<dim-1>::faces_per_cell; ++e)
       if (coarse_grid.begin_active()->face(f)->line(e)->center()[0] == 0)
-       if (coarse_grid.begin_active()->face(f)->line(e)->center()[1] == 0.5)
-         if (coarse_grid.begin_active()->face(f)->line(e)->center()[2] == 0)
-           coarse_grid.begin_active()->face(f)->line(e)->set_boundary_indicator (99);
+        if (coarse_grid.begin_active()->face(f)->line(e)->center()[1] == 0.5)
+          if (coarse_grid.begin_active()->face(f)->line(e)->center()[2] == 0)
+            coarse_grid.begin_active()->face(f)->line(e)->set_boundary_indicator (99);
   coarse_grid.set_boundary (99, my_boundary);
 
-                                  // now try to refine this one
-                                  // cell. we should get an exception
+  // now try to refine this one
+  // cell. we should get an exception
   try
     {
       coarse_grid.refine_global(1);
@@ -91,27 +91,27 @@ void check ()
   catch (typename Triangulation<dim>::DistortedCellList &dcv)
     {
       deallog << "Found " << dcv.distorted_cells.size() << " distorted cells"
-             << std::endl;
+              << std::endl;
 
       Assert (dcv.distorted_cells.size() == 2,
-             ExcInternalError());
+              ExcInternalError());
 
       typename Triangulation<dim>::DistortedCellList
-       subset = GridTools::fix_up_distorted_child_cells (dcv,
-                                                         coarse_grid);
+      subset = GridTools::fix_up_distorted_child_cells (dcv,
+                                                        coarse_grid);
       deallog << "Found " << subset.distorted_cells.size()
-             << " cells that are still distorted"
-             << std::endl;
+              << " cells that are still distorted"
+              << std::endl;
 
       Assert (subset.distorted_cells.size() == 0,
-             ExcInternalError());
+              ExcInternalError());
     }
 
   Assert (coarse_grid.n_levels() == 2, ExcInternalError());
   Assert (coarse_grid.n_active_cells() == 2*1<<dim, ExcInternalError());
 
-                                  // output the coordinates of the
-                                  // child cells
+  // output the coordinates of the
+  // child cells
   GridOut().write_gnuplot (coarse_grid, deallog.get_file_stream());
 }
 
index dfbdf286bfc12737864891389a1b38ef94aff844..bccc33d98ab00eb5a6d7a3fafbced3d755e71cf9 100644 (file)
@@ -44,12 +44,12 @@ void check (const unsigned int testcase)
 
   switch (testcase)
     {
-      case 2:
-           deallog << "Twisted cell in " << dim << "d" << std::endl;
-            std::swap (vertices[1], vertices[0]);
-           break;
-      default:
-           Assert (false, ExcNotImplemented());
+    case 2:
+      deallog << "Twisted cell in " << dim << "d" << std::endl;
+      std::swap (vertices[1], vertices[0]);
+      break;
+    default:
+      Assert (false, ExcNotImplemented());
     }
 
 
@@ -80,7 +80,7 @@ void check (const unsigned int testcase)
   QGauss<dim> quadrature(2);
   FEValues<dim> fe_values(dummy, quadrature, update_JxW_values);
   // should throw an assertion
-  try 
+  try
     {
       fe_values.reinit(coarse_grid.begin());
     }
index 86c696eea2f76616a4e5b5e788d16f95bc465abc..2dfc7867765035749cbbca18e4987af2bf05b4fd 100644 (file)
@@ -61,15 +61,15 @@ void test()
   FEValues<dim> fe_val (mapping, fe, quad, update_JxW_values);
   double integral = 0.;
   /*typename*/ Triangulation<dim>::active_cell_iterator
-    cell = tria.begin_active(), endc = tria.end();
+  cell = tria.begin_active(), endc = tria.end();
   for ( ; cell != endc; ++cell)
     {
       try
-       {
-         fe_val.reinit (cell);
-         for (unsigned int q=0; q<quad.size(); ++q)
-           integral += fe_val.JxW(q);
-       }
+        {
+          fe_val.reinit (cell);
+          for (unsigned int q=0; q<quad.size(); ++q)
+            integral += fe_val.JxW(q);
+        }
       catch (ExceptionBase &e)
         {
           deallog << e.get_exc_name() << std::endl;
index 393f1c5c3e592d63bd5b947dfbe78da46ac76d57..4b98ed3f80202169faa030c17f9c4d3486990df2 100644 (file)
@@ -44,18 +44,19 @@ void test()
   FEValues<dim> fe_val (mapping, dummy, quad, update_JxW_values);
   double integral = 0.;
   /*typename*/ Triangulation<dim>::active_cell_iterator
-    cell = tria.begin_active(), endc = tria.end();
+  cell = tria.begin_active(), endc = tria.end();
   for ( ; cell != endc; ++cell)
     {
-      try{
-       fe_val.reinit (cell);
-      for (unsigned int q=0; q<quad.size(); ++q)
-        integral += fe_val.JxW(q);
-      }
-    catch (ExceptionBase &e)
-      {
-        deallog << e.get_exc_name() << std::endl;
-      }
+      try
+        {
+          fe_val.reinit (cell);
+          for (unsigned int q=0; q<quad.size(); ++q)
+            integral += fe_val.JxW(q);
+        }
+      catch (ExceptionBase &e)
+        {
+          deallog << e.get_exc_name() << std::endl;
+        }
     }
   deallog << "Integral = " << integral << std::endl;
 }
index 7fd1179b749d1686dd7d9514c8ad12f379236be4..155c7ae0c23eabc19bbac3286703b306eba5adc6 100644 (file)
@@ -40,27 +40,27 @@ template <int dim>
 void test ()
 {
   deallog << dim << "D" << std::endl;
-  
+
   Triangulation<dim> triangulation;
   GridGenerator::hyper_cube (triangulation);
 
-                                   // refine the mesh in a random way so as to
-                                   // generate as many hanging node
-                                   // constraints as possible
+  // refine the mesh in a random way so as to
+  // generate as many hanging node
+  // constraints as possible
   triangulation.refine_global (4-dim);
   for (unsigned int i=0; i<11-2*dim; ++i)
     {
       typename Triangulation<dim>::active_cell_iterator
-        cell = triangulation.begin_active();
+      cell = triangulation.begin_active();
       for (unsigned int index=0; cell != triangulation.end(); ++cell, ++index)
         if (index % (3*dim) == 0)
           cell->set_refine_flag();
       triangulation.execute_coarsening_and_refinement ();
     }
   deallog << "Number of cells: " << triangulation.n_active_cells() << std::endl;
-  
-                                   // set up a DoFHandler and compute hanging
-                                   // node constraints
+
+  // set up a DoFHandler and compute hanging
+  // node constraints
   FE_Q<dim> fe(1);
   DoFHandler<dim> dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
@@ -71,8 +71,8 @@ void test ()
   constraints.close ();
   deallog << "Number of constraints: " << constraints.n_constraints() << std::endl;
 
-                                   // then set up a sparsity pattern and two
-                                   // matrices on top of it
+  // then set up a sparsity pattern and two
+  // matrices on top of it
   SparsityPattern sparsity (dof_handler.n_dofs(),
                             dof_handler.n_dofs(),
                             dof_handler.max_couplings_between_dofs());
@@ -80,15 +80,15 @@ void test ()
   constraints.condense (sparsity);
   SparseMatrix<double> A(sparsity), B(sparsity);
 
-                                   // then fill the two matrices by setting up
-                                   // bogus matrix entries and (1) writing
-                                   // them into the matrix and condensing away
-                                   // hanging node constraints later on, or
-                                   // (2) distributing them right away
+  // then fill the two matrices by setting up
+  // bogus matrix entries and (1) writing
+  // them into the matrix and condensing away
+  // hanging node constraints later on, or
+  // (2) distributing them right away
   std::vector<types::global_dof_index> local_dofs (fe.dofs_per_cell);
   FullMatrix<double> local_matrix (fe.dofs_per_cell, fe.dofs_per_cell);
   for (typename DoFHandler<dim>::active_cell_iterator
-         cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell != dof_handler.end(); ++cell)
     {
       cell->get_dof_indices (local_dofs);
@@ -97,28 +97,28 @@ void test ()
         for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
           local_matrix(i,j) = (i+1.)*(j+1.)*(local_dofs[i]+1.)*(local_dofs[j]+1.);
 
-                                       // copy local to global by ourselves
+      // copy local to global by ourselves
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
         for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
           A.add (local_dofs[i], local_dofs[j], local_matrix(i,j));
 
-                                       // or let other functions do that
+      // or let other functions do that
       constraints.distribute_local_to_global (local_matrix, local_dofs, B);
     }
 
-                                   // now condense away constraints from A
+  // now condense away constraints from A
   constraints.condense (A);
 
-                                   // we haven't yet set the diagonal entries
-                                   // for constrained nodes. we can do so at
-                                   // will, since these values don't matter
-                                   // anyway
+  // we haven't yet set the diagonal entries
+  // for constrained nodes. we can do so at
+  // will, since these values don't matter
+  // anyway
   for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
     if (constraints.is_constrained(i))
       B.set(i,i,A(i,i));
-  
-                                   // now comes the check: we subtract B from
-                                   // A, and make sure that the result is zero
+
+  // now comes the check: we subtract B from
+  // A, and make sure that the result is zero
   A.add (-1., B);
   deallog << "|A|=" << A.frobenius_norm() << std::endl;
   deallog << "|B|=" << B.frobenius_norm() << std::endl;
@@ -144,25 +144,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index f896dc583f8a409660d8bec545ee900f7795e386..64ef7bcc2870c96f6e4b8584225bce5bf96af30d 100644 (file)
@@ -38,18 +38,18 @@ template <int dim>
 void test ()
 {
   deallog << dim << "D" << std::endl;
-  
+
   Triangulation<dim> triangulation;
   GridGenerator::hyper_cube (triangulation);
 
-                                   // refine the mesh in a random way so as to
-                                   // generate as many hanging node
-                                   // constraints as possible
+  // refine the mesh in a random way so as to
+  // generate as many hanging node
+  // constraints as possible
   triangulation.refine_global (4-dim);
   for (unsigned int i=0; i<11-2*dim; ++i)
     {
       typename Triangulation<dim>::active_cell_iterator
-        cell = triangulation.begin_active();
+      cell = triangulation.begin_active();
       for (unsigned int index=0; cell != triangulation.end(); ++cell, ++index)
         if (index % (3*dim) == 0)
           cell->set_refine_flag();
@@ -57,9 +57,9 @@ void test ()
     }
   deallog << "Number of cells: " << triangulation.n_active_cells()
           << std::endl;
-  
-                                   // set up a DoFHandler and compute hanging
-                                   // node constraints
+
+  // set up a DoFHandler and compute hanging
+  // node constraints
   FE_Q<dim> fe(1);
   DoFHandler<dim> dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
@@ -70,18 +70,18 @@ void test ()
   constraints.close ();
   deallog << "Number of constraints: " << constraints.n_constraints() << std::endl;
 
-                                   // then set up two vectors
+  // then set up two vectors
   Vector<double> A(dof_handler.n_dofs()), B(dof_handler.n_dofs());
 
-                                   // then fill the two vectors by setting up
-                                   // bogus matrix entries and (1) writing
-                                   // them into the vector and condensing away
-                                   // hanging node constraints later on, or
-                                   // (2) distributing them right away
+  // then fill the two vectors by setting up
+  // bogus matrix entries and (1) writing
+  // them into the vector and condensing away
+  // hanging node constraints later on, or
+  // (2) distributing them right away
   std::vector<types::global_dof_index> local_dofs (fe.dofs_per_cell);
   Vector<double> local_vector (fe.dofs_per_cell);
   for (typename DoFHandler<dim>::active_cell_iterator
-         cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell != dof_handler.end(); ++cell)
     {
       cell->get_dof_indices (local_dofs);
@@ -89,27 +89,27 @@ void test ()
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
         local_vector(i) = (i+1.)*(local_dofs[i]+1.);
 
-                                       // copy local to global by ourselves
+      // copy local to global by ourselves
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
         A(local_dofs[i]) += local_vector(i);
 
-                                       // or let other functions do that
+      // or let other functions do that
       constraints.distribute_local_to_global (local_vector, local_dofs, B);
     }
 
-                                   // now condense away constraints from A
+  // now condense away constraints from A
   constraints.condense (A);
 
-                                   // we haven't yet set the entries
-                                   // for constrained nodes. we can do so at
-                                   // will, since these values don't matter
-                                   // anyway
+  // we haven't yet set the entries
+  // for constrained nodes. we can do so at
+  // will, since these values don't matter
+  // anyway
   for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
     if (constraints.is_constrained(i))
       B(i) = A(i);
-  
-                                   // now comes the check: we subtract B from
-                                   // A, and make sure that the result is zero
+
+  // now comes the check: we subtract B from
+  // A, and make sure that the result is zero
   A -= B;
   deallog << "|A|=" << A.l2_norm() << std::endl;
   deallog << "|B|=" << B.l2_norm() << std::endl;
@@ -135,25 +135,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 7c59dd1a436ee24183d3f585c76c1b260cae37bc..2ac086eb588c75db2ba697a1572a9d717eec4a7a 100644 (file)
@@ -43,19 +43,19 @@ template <int dim>
 void test ()
 {
   deallog << dim << "D" << std::endl;
-  
+
   Triangulation<dim> triangulation;
   GridGenerator::hyper_cube (triangulation);
 
-                                   // refine once, then refine first cell to
-                                   // create hanging nodes
+  // refine once, then refine first cell to
+  // create hanging nodes
   triangulation.refine_global (1);
   triangulation.begin_active()->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
   deallog << "Number of cells: " << triangulation.n_active_cells() << std::endl;
-  
-                                   // set up a DoFHandler and compute hanging
-                                   // node constraints for a Q2 element
+
+  // set up a DoFHandler and compute hanging
+  // node constraints for a Q2 element
   FE_Q<dim> fe(2);
   DoFHandler<dim> dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
@@ -66,8 +66,8 @@ void test ()
   constraints.close ();
   deallog << "Number of constraints: " << constraints.n_constraints() << std::endl;
 
-                                   // then set up a sparsity pattern and a
-                                   // matrix on top of it
+  // then set up a sparsity pattern and a
+  // matrix on top of it
   SparsityPattern sparsity (dof_handler.n_dofs(),
                             dof_handler.n_dofs(),
                             dof_handler.max_couplings_between_dofs());
@@ -75,12 +75,12 @@ void test ()
   constraints.condense (sparsity);
   SparseMatrix<double> A(sparsity);
 
-                                   // then fill the matrix by setting up
-                                   // bogus matrix entries
+  // then fill the matrix by setting up
+  // bogus matrix entries
   std::vector<types::global_dof_index> local_dofs (fe.dofs_per_cell);
   FullMatrix<double> local_matrix (fe.dofs_per_cell, fe.dofs_per_cell);
   for (typename DoFHandler<dim>::active_cell_iterator
-         cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell != dof_handler.end(); ++cell)
     {
       cell->get_dof_indices (local_dofs);
@@ -89,16 +89,16 @@ void test ()
         for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
           local_matrix(i,j) = (i+1.)*(j+1.)*(local_dofs[i]+1.)*(local_dofs[j]+1.);
 
-                                       // copy local to global
+      // copy local to global
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
         for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
           A.add (local_dofs[i], local_dofs[j], local_matrix(i,j));
     }
 
-                                   // now condense away constraints from A
+  // now condense away constraints from A
   constraints.condense (A);
 
-                                   // and output what we have
+  // and output what we have
   for (SparseMatrix<double>::const_iterator i=A.begin(); i!=A.end(); ++i)
     deallog << i->row() << ' ' << i->column() << ' ' << i->value()
             << std::endl;
@@ -122,25 +122,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 1fa41479fe89493fb1f4ce453ef5f0d4ec7e257f..057ffbe063c48d7cb47202fd87e32b770e236831 100644 (file)
@@ -41,19 +41,19 @@ template <int dim>
 void test ()
 {
   deallog << dim << "D" << std::endl;
-  
+
   Triangulation<dim> triangulation;
   GridGenerator::hyper_cube (triangulation);
 
-                                   // refine once, then refine first cell to
-                                   // create hanging nodes
+  // refine once, then refine first cell to
+  // create hanging nodes
   triangulation.refine_global (1);
   triangulation.begin_active()->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
   deallog << "Number of cells: " << triangulation.n_active_cells() << std::endl;
-  
-                                   // set up a DoFHandler and compute hanging
-                                   // node constraints for a Q2 element
+
+  // set up a DoFHandler and compute hanging
+  // node constraints for a Q2 element
   FE_Q<dim> fe(2);
   DoFHandler<dim> dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
@@ -68,15 +68,15 @@ void test ()
   for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
     b(i) = (1.+1.*i*i)/3;
 
-                                   // now condense away constraints
+  // now condense away constraints
   constraints.condense (b);
 
-                                   // and output what we have
+  // and output what we have
   for (Vector<double>::const_iterator i=b.begin(); i!=b.end(); ++i)
     deallog << *i << std::endl;
 
-                                   // now also make sure that the elements in
-                                   // constrained rows are zero
+  // now also make sure that the elements in
+  // constrained rows are zero
   for (unsigned int i=0; i<b.size(); ++i)
     if (constraints.is_constrained(i))
       Assert (b(i) == 0, ExcInternalError());
@@ -100,25 +100,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index ea6f6eed6a31d90c7b5f4bf3ef1693aa669eeaa0..f1fa40efe4582f1005aa39a30590e44736e64ca3 100644 (file)
@@ -41,19 +41,19 @@ template <int dim>
 void test ()
 {
   deallog << dim << "D" << std::endl;
-  
+
   Triangulation<dim> triangulation;
   GridGenerator::hyper_cube (triangulation);
 
-                                   // refine once, then refine first cell to
-                                   // create hanging nodes
+  // refine once, then refine first cell to
+  // create hanging nodes
   triangulation.refine_global (1);
   triangulation.begin_active()->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
   deallog << "Number of cells: " << triangulation.n_active_cells() << std::endl;
-  
-                                   // set up a DoFHandler and compute hanging
-                                   // node constraints for a Q2 element
+
+  // set up a DoFHandler and compute hanging
+  // node constraints for a Q2 element
   FE_Q<dim> fe(2);
   DoFHandler<dim> dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
@@ -68,22 +68,22 @@ void test ()
   for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
     b(i) = (1.+1.*i*i)/3;
 
-                                   // now condense away constraints
+  // now condense away constraints
   constraints.set_zero (b);
 
-                                   // and output what we have
+  // and output what we have
   for (Vector<double>::const_iterator i=b.begin(); i!=b.end(); ++i)
     deallog << *i << std::endl;
 
-                                   // now also make sure that the elements in
-                                   // constrained rows are zero, and that all
-                                   // the other elements are unchanged
+  // now also make sure that the elements in
+  // constrained rows are zero, and that all
+  // the other elements are unchanged
   for (unsigned int i=0; i<b.size(); ++i)
     if (constraints.is_constrained(i))
       Assert (b(i) == 0, ExcInternalError())
-    else
-      Assert (std::fabs(b(i) - (1.+1.*i*i)/3) < 1e-14*std::fabs(b(i)),
-              ExcInternalError());
+      else
+        Assert (std::fabs(b(i) - (1.+1.*i*i)/3) < 1e-14*std::fabs(b(i)),
+                ExcInternalError());
 }
 
 
@@ -104,25 +104,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 42f22779d80899dc59efef48fd1be95fe59bccba..37c6032498b5b242010819205da694fe13f97071 100644 (file)
@@ -39,19 +39,19 @@ template <int dim>
 void test ()
 {
   deallog << dim << "D" << std::endl;
-  
+
   Triangulation<dim> triangulation;
   GridGenerator::hyper_cube (triangulation);
 
-                                   // refine once, then refine first cell to
-                                   // create hanging nodes
+  // refine once, then refine first cell to
+  // create hanging nodes
   triangulation.refine_global (1);
   triangulation.begin_active()->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
   deallog << "Number of cells: " << triangulation.n_active_cells() << std::endl;
-  
-                                   // set up a DoFHandler and compute hanging
-                                   // node constraints for a Q2 element
+
+  // set up a DoFHandler and compute hanging
+  // node constraints for a Q2 element
   FE_Q<dim> fe(2);
   DoFHandler<dim> dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
@@ -62,14 +62,14 @@ void test ()
   constraints.close ();
   deallog << "Number of constraints: " << constraints.n_constraints() << std::endl;
 
-                                   // then set up a sparsity pattern and a
-                                   // matrix on top of it
+  // then set up a sparsity pattern and a
+  // matrix on top of it
   CompressedSparsityPattern sparsity (dof_handler.n_dofs(),
                                       dof_handler.n_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity);
   constraints.condense (sparsity);
 
-                                   // output what we have
+  // output what we have
   for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
     for (unsigned int j=0; j<dof_handler.n_dofs(); ++j)
       if (sparsity.exists(i,j))
@@ -94,25 +94,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index b2f79782c2ac80c6ce45a304a2f1b72b2327b367..92bda3ab240ae607cfc30a905085923801da93e6 100644 (file)
@@ -39,19 +39,19 @@ template <int dim>
 void test ()
 {
   deallog << dim << "D" << std::endl;
-  
+
   Triangulation<dim> triangulation;
   GridGenerator::hyper_cube (triangulation);
 
-                                   // refine once, then refine first cell to
-                                   // create hanging nodes
+  // refine once, then refine first cell to
+  // create hanging nodes
   triangulation.refine_global (1);
   triangulation.begin_active()->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
   deallog << "Number of cells: " << triangulation.n_active_cells() << std::endl;
-  
-                                   // set up a DoFHandler and compute hanging
-                                   // node constraints for a Q2 element
+
+  // set up a DoFHandler and compute hanging
+  // node constraints for a Q2 element
   FE_Q<dim> fe(2);
   DoFHandler<dim> dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
@@ -62,14 +62,14 @@ void test ()
   constraints.close ();
   deallog << "Number of constraints: " << constraints.n_constraints() << std::endl;
 
-                                   // then set up a sparsity pattern and a
-                                   // matrix on top of it
+  // then set up a sparsity pattern and a
+  // matrix on top of it
   CompressedSetSparsityPattern sparsity (dof_handler.n_dofs(),
-                                      dof_handler.n_dofs());
+                                         dof_handler.n_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity);
   constraints.condense (sparsity);
 
-                                   // output what we have
+  // output what we have
   for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
     for (unsigned int j=0; j<dof_handler.n_dofs(); ++j)
       if (sparsity.exists(i,j))
@@ -94,25 +94,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 002d73e032cfbb1984c11611891a1431e4392427..d8acfe05c576f67606b3ed283ed3089a23ed689e 100644 (file)
@@ -42,19 +42,19 @@ template <int dim>
 void test ()
 {
   deallog << dim << "D" << std::endl;
-  
+
   Triangulation<dim> triangulation;
   GridGenerator::hyper_cube (triangulation);
 
-                                   // refine once, then refine first cell to
-                                   // create hanging nodes
+  // refine once, then refine first cell to
+  // create hanging nodes
   triangulation.refine_global (1);
   triangulation.begin_active()->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
   deallog << "Number of cells: " << triangulation.n_active_cells() << std::endl;
-  
-                                   // set up a DoFHandler and compute hanging
-                                   // node constraints for a Q2 element
+
+  // set up a DoFHandler and compute hanging
+  // node constraints for a Q2 element
   FE_Q<dim> fe(2);
   DoFHandler<dim> dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
@@ -72,22 +72,22 @@ void test ()
   for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
     b(i) = (1.+1.*i*i)/3;
 
-                                   // now condense away constraints
+  // now condense away constraints
   constraints.set_zero (b);
 
-                                   // and output what we have
+  // and output what we have
   for (BlockVector<double>::const_iterator i=b.begin(); i!=b.end(); ++i)
     deallog << *i << std::endl;
 
-                                   // now also make sure that the elements in
-                                   // constrained rows are zero, and that all
-                                   // the other elements are unchanged
+  // now also make sure that the elements in
+  // constrained rows are zero, and that all
+  // the other elements are unchanged
   for (unsigned int i=0; i<b.size(); ++i)
     if (constraints.is_constrained(i))
       Assert (b(i) == 0, ExcInternalError())
-    else
-      Assert (std::fabs(b(i) - (1.+1.*i*i)/3) < 1e-14*std::fabs(b(i)),
-              ExcInternalError());
+      else
+        Assert (std::fabs(b(i) - (1.+1.*i*i)/3) < 1e-14*std::fabs(b(i)),
+                ExcInternalError());
 }
 
 
@@ -108,25 +108,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 22deca9c23ec27d3e236da83edbb8a9320fcd9b3..e33660c67f28dcdedf8ec19f084a770657b549f7 100644 (file)
@@ -42,19 +42,19 @@ template <int dim>
 void test ()
 {
   deallog << dim << "D" << std::endl;
-  
+
   Triangulation<dim> triangulation;
   GridGenerator::hyper_cube (triangulation);
 
-                                   // refine once, then refine first cell to
-                                   // create hanging nodes
+  // refine once, then refine first cell to
+  // create hanging nodes
   triangulation.refine_global (1);
   triangulation.begin_active()->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
   deallog << "Number of cells: " << triangulation.n_active_cells() << std::endl;
-  
-                                   // set up a DoFHandler and compute hanging
-                                   // node constraints for a Q2 element
+
+  // set up a DoFHandler and compute hanging
+  // node constraints for a Q2 element
   FE_Q<dim> fe(2);
   DoFHandler<dim> dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
@@ -72,15 +72,15 @@ void test ()
   for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
     b(i) = (1.+1.*i*i)/3;
 
-                                   // now condense away constraints
+  // now condense away constraints
   constraints.condense (b);
 
-                                   // and output what we have
+  // and output what we have
   for (BlockVector<double>::const_iterator i=b.begin(); i!=b.end(); ++i)
     deallog << *i << std::endl;
 
-                                   // now also make sure that the elements in
-                                   // constrained rows are zero
+  // now also make sure that the elements in
+  // constrained rows are zero
   for (unsigned int i=0; i<b.size(); ++i)
     if (constraints.is_constrained(i))
       Assert (b(i) == 0, ExcInternalError());
@@ -104,25 +104,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index b426ab5a7acd9b2d17b2bf48c46a13e5597c68ce..9c5265044b5646431e2f2ea140b700ea3ac1d97c 100644 (file)
@@ -43,19 +43,19 @@ template <int dim>
 void test ()
 {
   deallog << dim << "D" << std::endl;
-  
+
   Triangulation<dim> triangulation;
   GridGenerator::hyper_cube (triangulation);
 
-                                   // refine once, then refine first cell to
-                                   // create hanging nodes
+  // refine once, then refine first cell to
+  // create hanging nodes
   triangulation.refine_global (1);
   triangulation.begin_active()->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
   deallog << "Number of cells: " << triangulation.n_active_cells() << std::endl;
-  
-                                   // set up a DoFHandler and compute hanging
-                                   // node constraints for a Q2 element
+
+  // set up a DoFHandler and compute hanging
+  // node constraints for a Q2 element
   FE_Q<dim> fe(2);
   DoFHandler<dim> dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
@@ -66,8 +66,8 @@ void test ()
   constraints.close ();
   deallog << "Number of constraints: " << constraints.n_constraints() << std::endl;
 
-                                   // then set up a sparsity pattern and a
-                                   // matrix on top of it
+  // then set up a sparsity pattern and a
+  // matrix on top of it
   std::vector<unsigned int> block_sizes(2);
   block_sizes[0] = dof_handler.n_dofs()/3;
   block_sizes[1] = dof_handler.n_dofs() - block_sizes[0];
@@ -78,17 +78,17 @@ void test ()
       sparsity.block(i,j).reinit (block_sizes[i], block_sizes[j],
                                   dof_handler.max_couplings_between_dofs());
   sparsity.collect_sizes();
-  
+
   DoFTools::make_sparsity_pattern (dof_handler, sparsity);
   constraints.condense (sparsity);
   BlockSparseMatrix<double> A(sparsity);
 
-                                   // then fill the matrix by setting up
-                                   // bogus matrix entries
+  // then fill the matrix by setting up
+  // bogus matrix entries
   std::vector<types::global_dof_index> local_dofs (fe.dofs_per_cell);
   FullMatrix<double> local_matrix (fe.dofs_per_cell, fe.dofs_per_cell);
   for (typename DoFHandler<dim>::active_cell_iterator
-         cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell != dof_handler.end(); ++cell)
     {
       cell->get_dof_indices (local_dofs);
@@ -97,16 +97,16 @@ void test ()
         for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
           local_matrix(i,j) = (i+1.)*(j+1.)*(local_dofs[i]+1.)*(local_dofs[j]+1.);
 
-                                       // copy local to global
+      // copy local to global
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
         for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
           A.add (local_dofs[i], local_dofs[j], local_matrix(i,j));
     }
 
-                                   // now condense away constraints from A
+  // now condense away constraints from A
   constraints.condense (A);
 
-                                   // and output what we have
+  // and output what we have
   for (BlockSparseMatrix<double>::const_iterator i=A.begin(); i!=A.end(); ++i)
     deallog << i->block_row() << ' ' << i->block_column() << ' '
             << i->row() << ' ' << i->column() << ' ' << i->value()
@@ -131,25 +131,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 3728e1e6692a9f7a2b9c651302956e91dd06c157..849d3532ad583c0af87229f6a33f7ad89ac0cf9b 100644 (file)
@@ -41,19 +41,19 @@ template <int dim>
 void test ()
 {
   deallog << dim << "D" << std::endl;
-  
+
   Triangulation<dim> triangulation;
   GridGenerator::hyper_cube (triangulation);
 
-                                   // refine once, then refine first cell to
-                                   // create hanging nodes
+  // refine once, then refine first cell to
+  // create hanging nodes
   triangulation.refine_global (1);
   triangulation.begin_active()->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
   deallog << "Number of cells: " << triangulation.n_active_cells() << std::endl;
-  
-                                   // set up a DoFHandler and compute hanging
-                                   // node constraints for a Q2 element
+
+  // set up a DoFHandler and compute hanging
+  // node constraints for a Q2 element
   FE_Q<dim> fe(2);
   DoFHandler<dim> dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
@@ -64,14 +64,14 @@ void test ()
   constraints.close ();
   deallog << "Number of constraints: " << constraints.n_constraints() << std::endl;
 
-                                   // then set up a sparsity pattern and a
-                                   // matrix on top of it
+  // then set up a sparsity pattern and a
+  // matrix on top of it
   CompressedSparsityPattern sparsity (dof_handler.n_dofs(),
                                       dof_handler.n_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity);
   constraints.condense (sparsity);
 
-                                   // and output what we have
+  // and output what we have
   SparsityPattern A;
   A.copy_from (sparsity);
   for (SparsityPattern::const_iterator i=A.begin(); i!=A.end(); ++i)
@@ -97,25 +97,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 30f34e99f69e872c12bd28b660f9d620541a6479..353ba831c188da01adcb7aeba9e76608bd1b6c1c 100644 (file)
@@ -41,19 +41,19 @@ template <int dim>
 void test ()
 {
   deallog << dim << "D" << std::endl;
-  
+
   Triangulation<dim> triangulation;
   GridGenerator::hyper_cube (triangulation);
 
-                                   // refine once, then refine first cell to
-                                   // create hanging nodes
+  // refine once, then refine first cell to
+  // create hanging nodes
   triangulation.refine_global (1);
   triangulation.begin_active()->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
   deallog << "Number of cells: " << triangulation.n_active_cells() << std::endl;
-  
-                                   // set up a DoFHandler and compute hanging
-                                   // node constraints for a Q2 element
+
+  // set up a DoFHandler and compute hanging
+  // node constraints for a Q2 element
   FE_Q<dim> fe(2);
   DoFHandler<dim> dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
@@ -64,14 +64,14 @@ void test ()
   constraints.close ();
   deallog << "Number of constraints: " << constraints.n_constraints() << std::endl;
 
-                                   // then set up a sparsity pattern and a
-                                   // matrix on top of it
+  // then set up a sparsity pattern and a
+  // matrix on top of it
   CompressedSetSparsityPattern sparsity (dof_handler.n_dofs(),
-                                      dof_handler.n_dofs());
+                                         dof_handler.n_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity);
   constraints.condense (sparsity);
 
-                                   // and output what we have
+  // and output what we have
   SparsityPattern A;
   A.copy_from (sparsity);
   for (SparsityPattern::const_iterator i=A.begin(); i!=A.end(); ++i)
@@ -97,25 +97,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index ddbca65f2c73f3e2de88f22d72c393b41ffc9609..9cc2fb39494a3b7ddc0f940418fb87fbec1bf3a6 100644 (file)
@@ -42,19 +42,19 @@ template <int dim>
 void test ()
 {
   deallog << dim << "D" << std::endl;
-  
+
   Triangulation<dim> triangulation;
   GridGenerator::hyper_cube (triangulation);
 
-                                   // refine once, then refine first cell to
-                                   // create hanging nodes
+  // refine once, then refine first cell to
+  // create hanging nodes
   triangulation.refine_global (1);
   triangulation.begin_active()->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
   deallog << "Number of cells: " << triangulation.n_active_cells() << std::endl;
-  
-                                   // set up a DoFHandler and compute hanging
-                                   // node constraints for a Q2 element
+
+  // set up a DoFHandler and compute hanging
+  // node constraints for a Q2 element
   FE_Q<dim> fe(2);
   DoFHandler<dim> dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
@@ -65,8 +65,8 @@ void test ()
   constraints.close ();
   deallog << "Number of constraints: " << constraints.n_constraints() << std::endl;
 
-                                   // then set up a sparsity pattern and a
-                                   // matrix on top of it
+  // then set up a sparsity pattern and a
+  // matrix on top of it
   std::vector<unsigned int> block_sizes(2);
   block_sizes[0] = dof_handler.n_dofs()/3;
   block_sizes[1] = dof_handler.n_dofs() - block_sizes[0];
@@ -76,11 +76,11 @@ void test ()
     for (unsigned int j=0; j<2; ++j)
       sparsity.block(i,j).reinit (block_sizes[i], block_sizes[j]);
   sparsity.collect_sizes();
-  
+
   DoFTools::make_sparsity_pattern (dof_handler, sparsity);
   constraints.condense (sparsity);
 
-                                   // and output what we have
+  // and output what we have
   BlockSparsityPattern A;
   A.copy_from (sparsity);
   for (unsigned int r=0; r<A.n_block_rows(); ++r)
@@ -109,25 +109,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 0ade083344afd6e6c185d7ce17441c837315e416..10db9ff101eae4c0521f1be309b282a41bfb3348 100644 (file)
@@ -42,19 +42,19 @@ template <int dim>
 void test ()
 {
   deallog << dim << "D" << std::endl;
-  
+
   Triangulation<dim> triangulation;
   GridGenerator::hyper_cube (triangulation);
 
-                                   // refine once, then refine first cell to
-                                   // create hanging nodes
+  // refine once, then refine first cell to
+  // create hanging nodes
   triangulation.refine_global (1);
   triangulation.begin_active()->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
   deallog << "Number of cells: " << triangulation.n_active_cells() << std::endl;
-  
-                                   // set up a DoFHandler and compute hanging
-                                   // node constraints for a Q2 element
+
+  // set up a DoFHandler and compute hanging
+  // node constraints for a Q2 element
   FE_Q<dim> fe(2);
   DoFHandler<dim> dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
@@ -65,8 +65,8 @@ void test ()
   constraints.close ();
   deallog << "Number of constraints: " << constraints.n_constraints() << std::endl;
 
-                                   // then set up a sparsity pattern and a
-                                   // matrix on top of it
+  // then set up a sparsity pattern and a
+  // matrix on top of it
   std::vector<unsigned int> block_sizes(2);
   block_sizes[0] = dof_handler.n_dofs()/3;
   block_sizes[1] = dof_handler.n_dofs() - block_sizes[0];
@@ -76,11 +76,11 @@ void test ()
     for (unsigned int j=0; j<2; ++j)
       sparsity.block(i,j).reinit (block_sizes[i], block_sizes[j]);
   sparsity.collect_sizes();
-  
+
   DoFTools::make_sparsity_pattern (dof_handler, sparsity);
   constraints.condense (sparsity);
 
-                                   // and output what we have
+  // and output what we have
   BlockSparsityPattern A;
   A.copy_from (sparsity);
   for (unsigned int r=0; r<A.n_block_rows(); ++r)
@@ -109,25 +109,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 99144d3d8f6ea3b0df11f56c70b20f02cf0edee9..ada6c193fab43ad50bed33cdb0cf920d5cb3542d 100644 (file)
@@ -32,19 +32,19 @@ check_this (const DoFHandler<dim> &dof_handler)
   const unsigned int n_components = dof_handler.get_fe().n_components();
 
   deallog << "n_dofs:" << dof_handler.n_dofs() << std::endl;
-  
+
   std::vector<types::global_dof_index> dofs_per_component(n_components);
   DoFTools::count_dofs_per_component (dof_handler,
-                                     dofs_per_component);
+                                      dofs_per_component);
 
-  for (unsigned int i=0;i<n_components;++i)
+  for (unsigned int i=0; i<n_components; ++i)
     deallog << ' ' << dofs_per_component[i];
   deallog << std::endl;
 
   DoFTools::count_dofs_per_component (dof_handler,
-                                     dofs_per_component, true);
+                                      dofs_per_component, true);
 
-  for (unsigned int i=0;i<n_components;++i)
+  for (unsigned int i=0; i<n_components; ++i)
     deallog << ' ' << dofs_per_component[i];
   deallog << std::endl;
 
@@ -53,39 +53,39 @@ check_this (const DoFHandler<dim> &dof_handler)
       std::vector<unsigned int> target_component(n_components,0U);
       dofs_per_component.resize (1);
       DoFTools::count_dofs_per_component (dof_handler,
-                                         dofs_per_component,
-                                         false,
-                                         target_component);
-      for (unsigned int i=0;i<std::min(n_components, (unsigned int)dofs_per_component.size());++i)
-       deallog << ' ' << dofs_per_component[i];
+                                          dofs_per_component,
+                                          false,
+                                          target_component);
+      for (unsigned int i=0; i<std::min(n_components, (unsigned int)dofs_per_component.size()); ++i)
+        deallog << ' ' << dofs_per_component[i];
       deallog << std::endl;
 
       DoFTools::count_dofs_per_component (dof_handler,
-                                         dofs_per_component,
-                                         true,
-                                         target_component);
-      for (unsigned int i=0;i<std::min(n_components, (unsigned int)dofs_per_component.size());++i)
-       deallog << ' ' << dofs_per_component[i];
+                                          dofs_per_component,
+                                          true,
+                                          target_component);
+      for (unsigned int i=0; i<std::min(n_components, (unsigned int)dofs_per_component.size()); ++i)
+        deallog << ' ' << dofs_per_component[i];
       deallog << std::endl;
 
-      for (unsigned int i=n_components/2;i<n_components;++i)
-       target_component[i] = 1;
+      for (unsigned int i=n_components/2; i<n_components; ++i)
+        target_component[i] = 1;
       dofs_per_component.resize (2);
-      
+
       DoFTools::count_dofs_per_component (dof_handler,
-                                         dofs_per_component,
-                                         false,
-                                         target_component);
-      for (unsigned int i=0;i<std::min(n_components, (unsigned int)dofs_per_component.size());++i)
-       deallog << ' ' << dofs_per_component[i];
+                                          dofs_per_component,
+                                          false,
+                                          target_component);
+      for (unsigned int i=0; i<std::min(n_components, (unsigned int)dofs_per_component.size()); ++i)
+        deallog << ' ' << dofs_per_component[i];
       deallog << std::endl;
       DoFTools::count_dofs_per_component (dof_handler,
-                                         dofs_per_component,
-                                         true,
-                                         target_component);
-      for (unsigned int i=0;i<std::min(n_components, (unsigned int)dofs_per_component.size());++i)
-       deallog << ' ' << dofs_per_component[i];
+                                          dofs_per_component,
+                                          true,
+                                          target_component);
+      for (unsigned int i=0; i<std::min(n_components, (unsigned int)dofs_per_component.size()); ++i)
+        deallog << ' ' << dofs_per_component[i];
       deallog << std::endl;
     }
-  
+
 }
index 5a8dba395f769dcc07916d2cab4bf94d5d088b1b..b43ebbc51a350a763e6cd30060d4e9d9ce6f4975 100644 (file)
@@ -22,7 +22,7 @@
 // check
 //   DoFTools::
 //   make_sparsity_pattern (const DoFHandler<dim> &,
-//                         SparsityPattern       &);
+//                      SparsityPattern       &);
 
 
 std::string output_file_name = "dof_tools_01a/output";
@@ -32,16 +32,16 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // create sparsity pattern
+  // create sparsity pattern
   SparsityPattern sp (dof_handler.n_dofs(),
                       dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sp);
   sp.compress ();
-  
-                                   // write out 10 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 10 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<10; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/10);
@@ -50,7 +50,7 @@ check_this (const DoFHandler<dim> &dof_handler)
       deallog << std::endl;
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   deallog << sp.bandwidth () << std::endl
           << sp.max_entries_per_row () << std::endl
           << sp.n_nonzero_elements () << std::endl;
index 239012421db31fec4d727fc868c2da5cd1c86d9c..fa6c9678ee9ddf0a814e6d12095d0d8572ab6d12 100644 (file)
@@ -22,7 +22,7 @@
 // check
 //   DoFTools::
 //   make_sparsity_pattern (const DoFHandler<dim> &,
-//                         SparsityPattern       &,
+//                      SparsityPattern       &,
 //                          ConstraintMatrix,
 //                          true);
 
@@ -37,17 +37,17 @@ check_this (const DoFHandler<dim> &dof_handler)
   ConstraintMatrix cm;
   DoFTools::make_hanging_node_constraints (dof_handler, cm);
   cm.close ();
-  
-                                   // create sparsity pattern
+
+  // create sparsity pattern
   SparsityPattern sp (dof_handler.n_dofs(),
                       dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sp, cm, false);
   sp.compress ();
-  
-                                   // write out 10 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 10 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<10; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/10);
@@ -56,7 +56,7 @@ check_this (const DoFHandler<dim> &dof_handler)
       deallog << std::endl;
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   deallog << sp.bandwidth () << std::endl
           << sp.max_entries_per_row () << std::endl
           << sp.n_nonzero_elements () << std::endl;
index 549568e8866add7658fba669088a00f4739d9c51..d6c1c22713930e4f260b609397d45f71b9f6e9e0 100644 (file)
@@ -22,7 +22,7 @@
 // check
 //   DoFTools::
 //   make_sparsity_pattern (const DoFHandler<dim> &,
-//                         SparsityPattern       &,
+//                      SparsityPattern       &,
 //                          ConstraintMatrix,
 //                          true);
 
@@ -37,17 +37,17 @@ check_this (const DoFHandler<dim> &dof_handler)
   ConstraintMatrix cm;
   DoFTools::make_hanging_node_constraints (dof_handler, cm);
   cm.close ();
-  
-                                   // create sparsity pattern
+
+  // create sparsity pattern
   SparsityPattern sp (dof_handler.n_dofs(),
                       dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sp, cm, true);
   sp.compress ();
-  
-                                   // write out 10 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 10 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<10; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/10);
@@ -56,7 +56,7 @@ check_this (const DoFHandler<dim> &dof_handler)
       deallog << std::endl;
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   deallog << sp.bandwidth () << std::endl
           << sp.max_entries_per_row () << std::endl
           << sp.n_nonzero_elements () << std::endl;
index ff59c005fe03963738220d8b4720d30146a10831..6d82bc2943012fe8c7fb35addea969719feb0f6e 100644 (file)
@@ -22,7 +22,7 @@
 // check
 //   DoFTools::
 //   make_sparsity_pattern (const DoFHandler<dim> &,
-//                         SparsityPattern       &, ...)
+//                      SparsityPattern       &, ...)
 // with the subdomain argument
 
 
@@ -33,22 +33,22 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // create sparsity pattern
+  // create sparsity pattern
   SparsityPattern sp (dof_handler.n_dofs(),
                       dof_handler.max_couplings_between_dofs());
 
-                                  // pass a subdomain id; note that
-                                  // the framework sets the subdomain
-                                  // id to the level of each cell
+  // pass a subdomain id; note that
+  // the framework sets the subdomain
+  // id to the level of each cell
   DoFTools::make_sparsity_pattern (dof_handler, sp,
-                                  ConstraintMatrix(), true,
-                                  2);
+                                   ConstraintMatrix(), true,
+                                   2);
   sp.compress ();
-  
-                                   // write out 10 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 10 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<10; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/10);
@@ -57,7 +57,7 @@ check_this (const DoFHandler<dim> &dof_handler)
       deallog << std::endl;
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   deallog << sp.bandwidth () << std::endl
           << sp.max_entries_per_row () << std::endl
           << sp.n_nonzero_elements () << std::endl;
index fecafb645ae9e50c517241177c8026f00ec26d1e..1811a780da7fd22ca4774986785524c1fbddf052 100644 (file)
@@ -22,7 +22,7 @@
 // check
 //   DoFTools::
 //   make_sparsity_pattern (const DoFHandler<dim>     &,
-//                         CompressedSparsityPattern &);
+//                      CompressedSparsityPattern &);
 
 std::string output_file_name = "dof_tools_01b/output";
 
@@ -31,15 +31,15 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // create sparsity pattern
+  // create sparsity pattern
   CompressedSparsityPattern sp (dof_handler.n_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sp);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
@@ -48,7 +48,7 @@ check_this (const DoFHandler<dim> &dof_handler)
       deallog << std::endl;
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   deallog << sp.bandwidth () << std::endl
           << sp.max_entries_per_row () << std::endl
           << sp.n_nonzero_elements () << std::endl;
index 577fe8630314ac665cc26c299416be1d17648a5a..15526b442e81c054a2e7e62e808c7c686360ce45 100644 (file)
@@ -22,7 +22,7 @@
 // check
 //   DoFTools::
 //   make_sparsity_pattern (const DoFHandler<dim>     &,
-//                         CompressedSetSparsityPattern &);
+//                      CompressedSetSparsityPattern &);
 
 std::string output_file_name = "dof_tools_01b_x/output";
 
@@ -31,25 +31,25 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // create sparsity pattern
+  // create sparsity pattern
   CompressedSetSparsityPattern sp (dof_handler.n_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sp);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
       for (CompressedSetSparsityPattern::row_iterator
-            c = sp.row_begin(line); c!=sp.row_end(line); ++c)
+           c = sp.row_begin(line); c!=sp.row_end(line); ++c)
         deallog << *c << " ";
       deallog << std::endl;
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   deallog << sp.bandwidth () << std::endl
           << sp.max_entries_per_row () << std::endl
           << sp.n_nonzero_elements () << std::endl;
index 440ff59d141ddbc858d9727ebfdcb9ffdafc2887..d15d20e7a47530d43e7e67c33cce59be341b23b6 100644 (file)
@@ -22,7 +22,7 @@
 // check
 //   DoFTools::
 //   make_sparsity_pattern (const DoFHandler<dim> &,
-//                         BlockSparsityPattern  &);
+//                      BlockSparsityPattern  &);
 
 std::string output_file_name = "dof_tools_01c/output";
 
@@ -31,16 +31,16 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // we split up the matrix into
-                                   // blocks according to the number
-                                   // of dofs in each component. this
-                                   // fails if the element is not
-                                   // primitive, so skip this test for
-                                   // such elements
+  // we split up the matrix into
+  // blocks according to the number
+  // of dofs in each component. this
+  // fails if the element is not
+  // primitive, so skip this test for
+  // such elements
   if (dof_handler.get_fe().is_primitive() != true)
     return;
-  
-                                   // create sparsity pattern
+
+  // create sparsity pattern
   const unsigned int n_components = dof_handler.get_fe().n_components();
   BlockSparsityPattern sp (n_components,
                            n_components);
@@ -53,19 +53,19 @@ check_this (const DoFHandler<dim> &dof_handler)
                            dofs_per_component[j],
                            dof_handler.max_couplings_between_dofs());
   sp.collect_sizes ();
-  
+
   DoFTools::make_sparsity_pattern (dof_handler, sp);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
       std::pair<unsigned int,unsigned int>
-        block_row = sp.get_row_indices().global_to_local(line);
+      block_row = sp.get_row_indices().global_to_local(line);
       for (unsigned int col=0; col<n_components; ++col)
         {
           for (unsigned int c=0;
@@ -77,7 +77,7 @@ check_this (const DoFHandler<dim> &dof_handler)
         }
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   for (unsigned int r=0; r<n_components; ++r)
     for (unsigned int c=0; c<n_components; ++c)
       {
@@ -85,7 +85,7 @@ check_this (const DoFHandler<dim> &dof_handler)
         deallog << x.bandwidth () << std::endl
                 << x.max_entries_per_row () << std::endl
                 << x.n_nonzero_elements () << std::endl;
-        
+
         unsigned int hash = 0;
         for (unsigned int l=0; l<x.n_rows(); ++l)
           hash += l*x.row_length(l);
index c90069834be7aea293b52aa6483dc3753ddfb880..99d61667685641a7150536c08acd925df8d24c97 100644 (file)
@@ -22,7 +22,7 @@
 // check
 //   DoFTools::
 //   make_sparsity_pattern (const DoFHandler<dim> &,
-//                         BlockCompressedSparsityPattern  &);
+//                      BlockCompressedSparsityPattern  &);
 
 std::string output_file_name = "dof_tools_01d/output";
 
@@ -31,16 +31,16 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // we split up the matrix into
-                                   // blocks according to the number
-                                   // of dofs in each component. this
-                                   // fails if the element is not
-                                   // primitive, so skip this test for
-                                   // such elements
+  // we split up the matrix into
+  // blocks according to the number
+  // of dofs in each component. this
+  // fails if the element is not
+  // primitive, so skip this test for
+  // such elements
   if (dof_handler.get_fe().is_primitive() != true)
     return;
-  
-                                   // create sparsity pattern
+
+  // create sparsity pattern
   const unsigned int n_components = dof_handler.get_fe().n_components();
   BlockCompressedSparsityPattern sp (n_components,
                                      n_components);
@@ -52,19 +52,19 @@ check_this (const DoFHandler<dim> &dof_handler)
       sp.block(i,j).reinit(dofs_per_component[i],
                            dofs_per_component[j]);
   sp.collect_sizes ();
-  
+
   DoFTools::make_sparsity_pattern (dof_handler, sp);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
       std::pair<unsigned int,unsigned int>
-        block_row = sp.get_row_indices().global_to_local(line);
+      block_row = sp.get_row_indices().global_to_local(line);
       for (unsigned int col=0; col<n_components; ++col)
         {
           for (unsigned int c=0;
@@ -76,7 +76,7 @@ check_this (const DoFHandler<dim> &dof_handler)
         }
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   for (unsigned int r=0; r<n_components; ++r)
     for (unsigned int c=0; c<n_components; ++c)
       {
@@ -84,7 +84,7 @@ check_this (const DoFHandler<dim> &dof_handler)
         deallog << x.bandwidth () << std::endl
                 << x.max_entries_per_row () << std::endl
                 << x.n_nonzero_elements () << std::endl;
-        
+
         unsigned int hash = 0;
         for (unsigned int l=0; l<x.n_rows(); ++l)
           hash += l*x.row_length(l);
index fe5385aeb3253764b284bf90c618e488eedacb14..40f20627bf55f2d37abd4ab50b042f9da0faa158 100644 (file)
@@ -22,7 +22,7 @@
 // check
 //   DoFTools::
 //   make_sparsity_pattern (const DoFHandler<dim> &,
-//                         BlockCompressedSetSparsityPattern  &);
+//                      BlockCompressedSetSparsityPattern  &);
 
 std::string output_file_name = "dof_tools_01d_x/output";
 
@@ -31,19 +31,19 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // we split up the matrix into
-                                   // blocks according to the number
-                                   // of dofs in each component. this
-                                   // fails if the element is not
-                                   // primitive, so skip this test for
-                                   // such elements
+  // we split up the matrix into
+  // blocks according to the number
+  // of dofs in each component. this
+  // fails if the element is not
+  // primitive, so skip this test for
+  // such elements
   if (dof_handler.get_fe().is_primitive() != true)
     return;
-  
-                                   // create sparsity pattern
+
+  // create sparsity pattern
   const unsigned int n_components = dof_handler.get_fe().n_components();
   BlockCompressedSetSparsityPattern sp (n_components,
-                                     n_components);
+                                        n_components);
   std::vector<types::global_dof_index> dofs_per_component(n_components);
   DoFTools::count_dofs_per_component (dof_handler,
                                       dofs_per_component);
@@ -52,31 +52,31 @@ check_this (const DoFHandler<dim> &dof_handler)
       sp.block(i,j).reinit(dofs_per_component[i],
                            dofs_per_component[j]);
   sp.collect_sizes ();
-  
+
   DoFTools::make_sparsity_pattern (dof_handler, sp);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
       std::pair<unsigned int,unsigned int>
-        block_row = sp.get_row_indices().global_to_local(line);
+      block_row = sp.get_row_indices().global_to_local(line);
       for (unsigned int col=0; col<n_components; ++col)
         {
-         for (CompressedSetSparsityPattern::row_iterator
-                c = sp.block(block_row.first,col).row_begin(block_row.second);
-              c!=sp.block(block_row.first,col).row_end(block_row.second); ++c)
+          for (CompressedSetSparsityPattern::row_iterator
+               c = sp.block(block_row.first,col).row_begin(block_row.second);
+               c!=sp.block(block_row.first,col).row_end(block_row.second); ++c)
             deallog << *c
                     << " ";
           deallog << std::endl;
         }
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   for (unsigned int r=0; r<n_components; ++r)
     for (unsigned int c=0; c<n_components; ++c)
       {
@@ -84,7 +84,7 @@ check_this (const DoFHandler<dim> &dof_handler)
         deallog << x.bandwidth () << std::endl
                 << x.max_entries_per_row () << std::endl
                 << x.n_nonzero_elements () << std::endl;
-        
+
         unsigned int hash = 0;
         for (unsigned int l=0; l<x.n_rows(); ++l)
           hash += l*x.row_length(l);
index 7cba00e41ebb4815e29cc52553152b26c8a7c5ed..b31e95ad77b9e202f8513d7312b4ddb1c63dc22f 100644 (file)
@@ -23,7 +23,7 @@
 //   DoFTools::
 //   make_sparsity_pattern (const DoFHandler<dim> &,
 //                          std::vector<std::vector<bool> > &,
-//                         SparsityPattern       &);
+//                      SparsityPattern       &);
 
 
 std::string output_file_name = "dof_tools_02a/output";
@@ -33,23 +33,23 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // set up X-shape mask
+  // set up X-shape mask
   const unsigned int n_components = dof_handler.get_fe().n_components();
   std::vector<std::vector<bool> > mask (n_components,
                                         std::vector<bool>(n_components,false));
   for (unsigned int i=0; i<n_components; ++i)
     mask[i][i] = mask[i][n_components-i-1] = true;
-  
-                                   // create sparsity pattern
+
+  // create sparsity pattern
   SparsityPattern sp (dof_handler.n_dofs(),
                       dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, mask, sp);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
@@ -58,7 +58,7 @@ check_this (const DoFHandler<dim> &dof_handler)
       deallog << std::endl;
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   deallog << sp.bandwidth () << std::endl
           << sp.max_entries_per_row () << std::endl
           << sp.n_nonzero_elements () << std::endl;
index 2c19b7b518c185e366413988afef45c40ced1b20..08e2439fb45551a08a0c6e5d7d65c2ae260c9c36 100644 (file)
@@ -23,7 +23,7 @@
 //   DoFTools::
 //   make_sparsity_pattern (const DoFHandler<dim> &,
 //                          std::vector<std::vector<bool> > &,
-//                         SparsityPattern       &,
+//                      SparsityPattern       &,
 //                          ConstraintMatrix,
 //                          true);
 
@@ -35,7 +35,7 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // set up X-shape mask
+  // set up X-shape mask
   const unsigned int n_components = dof_handler.get_fe().n_components();
   Table<2,DoFTools::Coupling> mask (n_components,n_components);
   for (unsigned int i=0; i<n_components; ++i)
@@ -47,17 +47,17 @@ check_this (const DoFHandler<dim> &dof_handler)
   ConstraintMatrix cm;
   DoFTools::make_hanging_node_constraints (dof_handler, cm);
   cm.close ();
-  
-                                   // create sparsity pattern
+
+  // create sparsity pattern
   SparsityPattern sp (dof_handler.n_dofs(),
                       dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, mask, sp, cm, false);
   sp.compress ();
-  
-                                   // write out 10 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 10 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<10; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/10);
@@ -66,7 +66,7 @@ check_this (const DoFHandler<dim> &dof_handler)
       deallog << std::endl;
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   deallog << sp.bandwidth () << std::endl
           << sp.max_entries_per_row () << std::endl
           << sp.n_nonzero_elements () << std::endl;
index 0a70a6980875ad2e34610fb71b7fc330f4f67a79..65bafc2e5633ab31d3c7521a5707c40797d0b1a8 100644 (file)
@@ -23,7 +23,7 @@
 //   DoFTools::
 //   make_sparsity_pattern (const DoFHandler<dim> &,
 //                          std::vector<std::vector<bool> > &,
-//                         SparsityPattern       &,
+//                      SparsityPattern       &,
 //                          ConstraintMatrix,
 //                          true);
 
@@ -35,7 +35,7 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // set up X-shape mask
+  // set up X-shape mask
   const unsigned int n_components = dof_handler.get_fe().n_components();
   Table<2,DoFTools::Coupling> mask (n_components,n_components);
   for (unsigned int i=0; i<n_components; ++i)
@@ -47,17 +47,17 @@ check_this (const DoFHandler<dim> &dof_handler)
   ConstraintMatrix cm;
   DoFTools::make_hanging_node_constraints (dof_handler, cm);
   cm.close ();
-  
-                                   // create sparsity pattern
+
+  // create sparsity pattern
   SparsityPattern sp (dof_handler.n_dofs(),
                       dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, mask, sp, cm, true);
   sp.compress ();
-  
-                                   // write out 10 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 10 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<10; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/10);
@@ -66,7 +66,7 @@ check_this (const DoFHandler<dim> &dof_handler)
       deallog << std::endl;
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   deallog << sp.bandwidth () << std::endl
           << sp.max_entries_per_row () << std::endl
           << sp.n_nonzero_elements () << std::endl;
index 005b5f5fec45ed37b151ac675bfbbca9ee024d2b..bbedd6f66a5fe01249b4c629fa2f98947c0eb910 100644 (file)
@@ -23,7 +23,7 @@
 //   DoFTools::
 //   make_sparsity_pattern (const DoFHandler<dim> &,
 //                          std::vector<std::vector<bool> > &,
-//                         SparsityPattern       &,
+//                      SparsityPattern       &,
 //                          ...)
 // with the subdomain argument
 
@@ -35,7 +35,7 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // set up X-shape mask
+  // set up X-shape mask
   const unsigned int n_components = dof_handler.get_fe().n_components();
   Table<2,DoFTools::Coupling> mask (n_components,n_components);
   for (unsigned int i=0; i<n_components; ++i)
@@ -44,22 +44,22 @@ check_this (const DoFHandler<dim> &dof_handler)
   for (unsigned int i=0; i<n_components; ++i)
     mask[i][i] = mask[i][n_components-i-1] = DoFTools::always;
 
-                                   // create sparsity pattern
+  // create sparsity pattern
   SparsityPattern sp (dof_handler.n_dofs(),
                       dof_handler.max_couplings_between_dofs());
 
-                                  // pass a subdomain id; note that
-                                  // the framework sets the subdomain
-                                  // id to the level of each cell
+  // pass a subdomain id; note that
+  // the framework sets the subdomain
+  // id to the level of each cell
   DoFTools::make_sparsity_pattern (dof_handler, mask, sp,
-                                  ConstraintMatrix(), true,
-                                  2);
+                                   ConstraintMatrix(), true,
+                                   2);
   sp.compress ();
-  
-                                   // write out 10 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 10 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<10; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/10);
@@ -68,7 +68,7 @@ check_this (const DoFHandler<dim> &dof_handler)
       deallog << std::endl;
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   deallog << sp.bandwidth () << std::endl
           << sp.max_entries_per_row () << std::endl
           << sp.n_nonzero_elements () << std::endl;
index 634cd686c1af7541e41f61351bf3dd492f8e0048..b273a404f4d83c6d0ba020edc48059ab6839309f 100644 (file)
@@ -23,7 +23,7 @@
 //   DoFTools::
 //   make_sparsity_pattern (const DoFHandler<dim>     &,
 //                          std::vector<std::vector<bool> > &,
-//                         CompressedSparsityPattern &);
+//                      CompressedSparsityPattern &);
 
 std::string output_file_name = "dof_tools_02b/output";
 
@@ -32,22 +32,22 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // set up X-shape mask
+  // set up X-shape mask
   const unsigned int n_components = dof_handler.get_fe().n_components();
   std::vector<std::vector<bool> > mask (n_components,
                                         std::vector<bool>(n_components,false));
   for (unsigned int i=0; i<n_components; ++i)
     mask[i][i] = mask[i][n_components-i-1] = true;
-  
-                                   // create sparsity pattern
+
+  // create sparsity pattern
   CompressedSparsityPattern sp (dof_handler.n_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, mask, sp);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
@@ -56,7 +56,7 @@ check_this (const DoFHandler<dim> &dof_handler)
       deallog << std::endl;
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   deallog << sp.bandwidth () << std::endl
           << sp.max_entries_per_row () << std::endl
           << sp.n_nonzero_elements () << std::endl;
index 090400b71759357216a3680986bdac0032a84678..0c29e546b042786c6bf38464db3b7366716ad599 100644 (file)
@@ -23,7 +23,7 @@
 //   DoFTools::
 //   make_sparsity_pattern (const DoFHandler<dim>     &,
 //                          std::vector<std::vector<bool> > &,
-//                         CompressedSetSparsityPattern &);
+//                      CompressedSetSparsityPattern &);
 
 std::string output_file_name = "dof_tools_02b_x/output";
 
@@ -32,32 +32,32 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // set up X-shape mask
+  // set up X-shape mask
   const unsigned int n_components = dof_handler.get_fe().n_components();
   std::vector<std::vector<bool> > mask (n_components,
                                         std::vector<bool>(n_components,false));
   for (unsigned int i=0; i<n_components; ++i)
     mask[i][i] = mask[i][n_components-i-1] = true;
-  
-                                   // create sparsity pattern
+
+  // create sparsity pattern
   CompressedSetSparsityPattern sp (dof_handler.n_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, mask, sp);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
       for (CompressedSetSparsityPattern::row_iterator
-            c = sp.row_begin(line); c!=sp.row_end(line); ++c)
+           c = sp.row_begin(line); c!=sp.row_end(line); ++c)
         deallog << *c << " ";
       deallog << std::endl;
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   deallog << sp.bandwidth () << std::endl
           << sp.max_entries_per_row () << std::endl
           << sp.n_nonzero_elements () << std::endl;
index b252a2bf2a3974b5b6ec22b99e9668c2d598c5e7..24c2a5438e4fac582751644ca54273e183b726ac 100644 (file)
@@ -23,7 +23,7 @@
 //   DoFTools::
 //   make_sparsity_pattern (const DoFHandler<dim> &,
 //                          std::vector<std::vector<bool> > &,
-//                         BlockSparsityPattern  &);
+//                      BlockSparsityPattern  &);
 
 std::string output_file_name = "dof_tools_02c/output";
 
@@ -32,23 +32,23 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // set up X-shape mask
+  // set up X-shape mask
   const unsigned int n_components = dof_handler.get_fe().n_components();
   std::vector<std::vector<bool> > mask (n_components,
                                         std::vector<bool>(n_components,false));
   for (unsigned int i=0; i<n_components; ++i)
     mask[i][i] = mask[i][n_components-i-1] = true;
-  
-                                   // we split up the matrix into
-                                   // blocks according to the number
-                                   // of dofs in each component. this
-                                   // fails if the element is not
-                                   // primitive, so skip this test for
-                                   // such elements
+
+  // we split up the matrix into
+  // blocks according to the number
+  // of dofs in each component. this
+  // fails if the element is not
+  // primitive, so skip this test for
+  // such elements
   if (dof_handler.get_fe().is_primitive() != true)
     return;
-  
-                                   // create sparsity pattern
+
+  // create sparsity pattern
   BlockSparsityPattern sp (n_components,
                            n_components);
   std::vector<types::global_dof_index> dofs_per_component(n_components);
@@ -60,19 +60,19 @@ check_this (const DoFHandler<dim> &dof_handler)
                            dofs_per_component[j],
                            dof_handler.max_couplings_between_dofs());
   sp.collect_sizes ();
-  
+
   DoFTools::make_sparsity_pattern (dof_handler, mask, sp);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
       std::pair<unsigned int,unsigned int>
-        block_row = sp.get_row_indices().global_to_local(line);
+      block_row = sp.get_row_indices().global_to_local(line);
       for (unsigned int col=0; col<n_components; ++col)
         {
           for (unsigned int c=0;
@@ -84,7 +84,7 @@ check_this (const DoFHandler<dim> &dof_handler)
         }
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   for (unsigned int r=0; r<n_components; ++r)
     for (unsigned int c=0; c<n_components; ++c)
       {
@@ -92,7 +92,7 @@ check_this (const DoFHandler<dim> &dof_handler)
         deallog << x.bandwidth () << std::endl
                 << x.max_entries_per_row () << std::endl
                 << x.n_nonzero_elements () << std::endl;
-        
+
         unsigned int hash = 0;
         for (unsigned int l=0; l<x.n_rows(); ++l)
           hash += l*x.row_length(l);
index c9c9dc0ea894760cd3ee076fe42ae9df1edf02fa..1faa653f762ed5d26f505e5f27e7a8291b85c3f9 100644 (file)
@@ -23,7 +23,7 @@
 //   DoFTools::
 //   make_sparsity_pattern (const DoFHandler<dim> &,
 //                          std::vector<std::vector<bool> > &,
-//                         BlockCompressedSparsityPattern  &);
+//                      BlockCompressedSparsityPattern  &);
 
 std::string output_file_name = "dof_tools_02d/output";
 
@@ -32,23 +32,23 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // set up X-shape mask
+  // set up X-shape mask
   const unsigned int n_components = dof_handler.get_fe().n_components();
   std::vector<std::vector<bool> > mask (n_components,
                                         std::vector<bool>(n_components,false));
   for (unsigned int i=0; i<n_components; ++i)
     mask[i][i] = mask[i][n_components-i-1] = true;
-  
-                                   // we split up the matrix into
-                                   // blocks according to the number
-                                   // of dofs in each component. this
-                                   // fails if the element is not
-                                   // primitive, so skip this test for
-                                   // such elements
+
+  // we split up the matrix into
+  // blocks according to the number
+  // of dofs in each component. this
+  // fails if the element is not
+  // primitive, so skip this test for
+  // such elements
   if (dof_handler.get_fe().is_primitive() != true)
     return;
-  
-                                   // create sparsity pattern
+
+  // create sparsity pattern
   BlockCompressedSparsityPattern sp (n_components,
                                      n_components);
   std::vector<types::global_dof_index> dofs_per_component(n_components);
@@ -59,19 +59,19 @@ check_this (const DoFHandler<dim> &dof_handler)
       sp.block(i,j).reinit(dofs_per_component[i],
                            dofs_per_component[j]);
   sp.collect_sizes ();
-  
+
   DoFTools::make_sparsity_pattern (dof_handler, mask, sp);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
       std::pair<unsigned int,unsigned int>
-        block_row = sp.get_row_indices().global_to_local(line);
+      block_row = sp.get_row_indices().global_to_local(line);
       for (unsigned int col=0; col<n_components; ++col)
         {
           for (unsigned int c=0;
@@ -83,7 +83,7 @@ check_this (const DoFHandler<dim> &dof_handler)
         }
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   for (unsigned int r=0; r<n_components; ++r)
     for (unsigned int c=0; c<n_components; ++c)
       {
@@ -91,7 +91,7 @@ check_this (const DoFHandler<dim> &dof_handler)
         deallog << x.bandwidth () << std::endl
                 << x.max_entries_per_row () << std::endl
                 << x.n_nonzero_elements () << std::endl;
-        
+
         unsigned int hash = 0;
         for (unsigned int l=0; l<x.n_rows(); ++l)
           hash += l*x.row_length(l);
index 86aff4b42d281baa0c42766084b9ac232b4e9615..040ef90c74ad3e9570aa6d3a49e3b0bee56b5b8c 100644 (file)
@@ -23,7 +23,7 @@
 //   DoFTools::
 //   make_sparsity_pattern (const DoFHandler<dim> &,
 //                          std::vector<std::vector<bool> > &,
-//                         BlockCompressedSetSparsityPattern  &);
+//                      BlockCompressedSetSparsityPattern  &);
 
 std::string output_file_name = "dof_tools_02d_x/output";
 
@@ -32,25 +32,25 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // set up X-shape mask
+  // set up X-shape mask
   const unsigned int n_components = dof_handler.get_fe().n_components();
   std::vector<std::vector<bool> > mask (n_components,
                                         std::vector<bool>(n_components,false));
   for (unsigned int i=0; i<n_components; ++i)
     mask[i][i] = mask[i][n_components-i-1] = true;
-  
-                                   // we split up the matrix into
-                                   // blocks according to the number
-                                   // of dofs in each component. this
-                                   // fails if the element is not
-                                   // primitive, so skip this test for
-                                   // such elements
+
+  // we split up the matrix into
+  // blocks according to the number
+  // of dofs in each component. this
+  // fails if the element is not
+  // primitive, so skip this test for
+  // such elements
   if (dof_handler.get_fe().is_primitive() != true)
     return;
-  
-                                   // create sparsity pattern
+
+  // create sparsity pattern
   BlockCompressedSetSparsityPattern sp (n_components,
-                                     n_components);
+                                        n_components);
   std::vector<types::global_dof_index> dofs_per_component(n_components);
   DoFTools::count_dofs_per_component (dof_handler,
                                       dofs_per_component);
@@ -59,31 +59,31 @@ check_this (const DoFHandler<dim> &dof_handler)
       sp.block(i,j).reinit(dofs_per_component[i],
                            dofs_per_component[j]);
   sp.collect_sizes ();
-  
+
   DoFTools::make_sparsity_pattern (dof_handler, mask, sp);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
       std::pair<unsigned int,unsigned int>
-        block_row = sp.get_row_indices().global_to_local(line);
+      block_row = sp.get_row_indices().global_to_local(line);
       for (unsigned int col=0; col<n_components; ++col)
         {
-         for (CompressedSetSparsityPattern::row_iterator
-                c = sp.block(block_row.first,col).row_begin(block_row.second);
-              c!=sp.block(block_row.first,col).row_end(block_row.second); ++c)
+          for (CompressedSetSparsityPattern::row_iterator
+               c = sp.block(block_row.first,col).row_begin(block_row.second);
+               c!=sp.block(block_row.first,col).row_end(block_row.second); ++c)
             deallog << *c
                     << " ";
           deallog << std::endl;
         }
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   for (unsigned int r=0; r<n_components; ++r)
     for (unsigned int c=0; c<n_components; ++c)
       {
@@ -91,7 +91,7 @@ check_this (const DoFHandler<dim> &dof_handler)
         deallog << x.bandwidth () << std::endl
                 << x.max_entries_per_row () << std::endl
                 << x.n_nonzero_elements () << std::endl;
-        
+
         unsigned int hash = 0;
         for (unsigned int l=0; l<x.n_rows(); ++l)
           hash += l*x.row_length(l);
index b2d2a42bd0b8182efcb4140da8d463ce9a079e17..164245bd03c9bb92005b5bc9f9a633d18e8d5f06 100644 (file)
@@ -23,7 +23,7 @@
 // check
 //   DoFTools::
 //   make_hanging_node_constraints (const DoFHandler<dim> &,
-//                                 ConstraintMatrix      &);
+//                              ConstraintMatrix      &);
 
 
 std::string output_file_name = "dof_tools_03/output";
@@ -33,22 +33,22 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                  // use a higher output accuracy for this
-                                  // test. the reason is that many of the
-                                  // constraints are negative powers of 2,
-                                  // which have exact representations with 3
-                                  // or 4 digits of accuracy, but not with
-                                  // the usual 2 digits (for example, 0.375,
-                                  // which sometimes rounds to 0.38 and
-                                  // sometimes to 0.37, depending on how
-                                  // intermediate errors have accumulated)
+  // use a higher output accuracy for this
+  // test. the reason is that many of the
+  // constraints are negative powers of 2,
+  // which have exact representations with 3
+  // or 4 digits of accuracy, but not with
+  // the usual 2 digits (for example, 0.375,
+  // which sometimes rounds to 0.38 and
+  // sometimes to 0.37, depending on how
+  // intermediate errors have accumulated)
   deallog << std::setprecision (5);
-  
-                                   // don't run this test if hanging
-                                   // nodes are not implemented
+
+  // don't run this test if hanging
+  // nodes are not implemented
   if (dof_handler.get_fe().constraints_are_implemented() == false)
     return;
-  
+
   ConstraintMatrix cm;
   DoFTools::make_hanging_node_constraints (dof_handler, cm);
   cm.close ();
@@ -59,7 +59,7 @@ check_this (const DoFHandler<dim> &dof_handler)
   for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
     deallog << (cm.is_constrained(i) ? '0' : '1');
   deallog << std::endl;
-  
+
   deallog << cm.n_constraints () << std::endl;
   for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
     deallog << (cm.is_identity_constrained(i) ? '0' : '1');
@@ -68,12 +68,12 @@ check_this (const DoFHandler<dim> &dof_handler)
   for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
     if (cm.is_constrained(i))
       {
-       deallog << "not identity constrained: " << i << std::endl;
-       Vector<double> v (dof_handler.n_dofs());
-       v(i) = 1;
-       cm.condense (v);
-       for (unsigned int j=0; j<dof_handler.n_dofs(); ++j)
-         if (v(j) != 0)
-           deallog << "  line " << j << ": " << v(j) << std::endl;
+        deallog << "not identity constrained: " << i << std::endl;
+        Vector<double> v (dof_handler.n_dofs());
+        v(i) = 1;
+        cm.condense (v);
+        for (unsigned int j=0; j<dof_handler.n_dofs(); ++j)
+          if (v(j) != 0)
+            deallog << "  line " << j << ": " << v(j) << std::endl;
       }
 }
index d96cb6cfc57a72720e42db6f2cfc1f19ff075c18..ac1ed00141eff8a55c9200f368137331e33d69ed 100644 (file)
@@ -32,8 +32,8 @@ check_this (const DoFHandler<dim> &dof_handler)
   std::vector<bool> component_select (dof_handler.get_fe().n_components(),
                                       true);
   std::vector<bool> boundary_dofs (dof_handler.n_dofs());
-  
-                                   // first with all components
+
+  // first with all components
   {
     DoFTools::extract_boundary_dofs (dof_handler,
                                      component_select,
@@ -41,8 +41,8 @@ check_this (const DoFHandler<dim> &dof_handler)
     output_bool_vector (boundary_dofs);
   }
 
-                                   // next with only every second
-                                   // component
+  // next with only every second
+  // component
   for (unsigned int i=1; i<component_select.size(); i+=2)
     component_select[i] = false;
   {
@@ -52,8 +52,8 @@ check_this (const DoFHandler<dim> &dof_handler)
     output_bool_vector (boundary_dofs);
   }
 
-                                   // third further restrict to
-                                   // boundary indicator 0
+  // third further restrict to
+  // boundary indicator 0
   {
     std::set<types::boundary_id> boundary_ids;
     boundary_ids.insert (0);
@@ -62,5 +62,5 @@ check_this (const DoFHandler<dim> &dof_handler)
                                      boundary_dofs,
                                      boundary_ids);
     output_bool_vector (boundary_dofs);
-  }  
+  }
 }
index 8468469efebb108176edc43309d671503cf7f516..9973ca1df2aa608e5b70f519a5a3d905b7417e90 100644 (file)
@@ -30,7 +30,7 @@ void
 check_this (const DoFHandler<dim> &dof_handler)
 {
   std::vector<bool> dofs(dof_handler.n_dofs());
-  
+
   for (unsigned int level=0; level<dof_handler.get_tria().n_levels(); ++level)
     {
       DoFTools::extract_subdomain_dofs (dof_handler,
index 4edf710d8cc8e4842e1bac93d0f014be171c5aec..a103e06a3ca3dc6ea8ebc066f00bd400ef5178d4 100644 (file)
@@ -34,7 +34,7 @@ check_this (const DoFHandler<dim> &dof_handler)
   std::vector<types::global_dof_index> map(dof_handler.n_dofs());
   std::set<types::boundary_id> boundary_ids;
 
-                                   // check for boundary id 0 alone
+  // check for boundary id 0 alone
   boundary_ids.insert (0);
   DoFTools::map_dof_to_boundary_indices (dof_handler, map);
   for (unsigned int i=0; i<map.size(); ++i)
@@ -43,7 +43,7 @@ check_this (const DoFHandler<dim> &dof_handler)
             << " ";
   deallog << std::endl;
 
-                                   // check for boundary id 0 and 1
+  // check for boundary id 0 and 1
   boundary_ids.insert (1);
   DoFTools::map_dof_to_boundary_indices (dof_handler, map);
   for (unsigned int i=0; i<map.size(); ++i)
index 67f1fbe690c001035e4194b6b5820493c59ed3fe..76aa96b7fe3658754a71dc629747e50a7bc0763b 100644 (file)
@@ -21,8 +21,8 @@
 
 // check
 //   DoFTools::map_dofs_to_support_points (const Mapping<dim> &,
-//                                        const DoFHandler<dim> &,
-//                                        std::vector<Point<dim> > &)
+//                   const DoFHandler<dim> &,
+//                   std::vector<Point<dim> > &)
 
 
 std::string output_file_name = "dof_tools_10/output";
@@ -32,17 +32,17 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // don't check if fe has no support
-                                   // points
+  // don't check if fe has no support
+  // points
   if (dof_handler.get_fe().get_unit_support_points().size() == 0)
     return;
-  
+
   std::vector<Point<dim> > map(dof_handler.n_dofs());
   MappingQ<dim> mapping(2);
 
   DoFTools::map_dofs_to_support_points (mapping, dof_handler, map);
 
-                                   // output every third element
+  // output every third element
   for (unsigned int i=0; i<map.size(); i+=3)
     deallog << map[i] << " ";
   deallog << std::endl;
index 2d95e605ede7ae7f824b73505cf9fd82c2d8cf35..d915493bfc534624e47e761b1115db3fb06e3fd2 100644 (file)
 
 // check
 //   DoFTools::map_support_points_to_dofs (const Mapping<dim> &,
-//                                        const DoFHandler<dim> &,
-//                                        std::map<Point<dim>, unsigned int, Comp> &)
+//                   const DoFHandler<dim> &,
+//                   std::map<Point<dim>, unsigned int, Comp> &)
 
 
 std::string output_file_name = "dof_tools_11/output";
 
 struct Comp
 {
-    template <int dim>
-    bool operator() (const Point<dim> p, const Point<dim> q) const
-      {
-        for (unsigned int d=0; d<dim; ++d)
-          if (p(d) < q(d))
-            return true;
-          else if (p(d) > q(d))
-            return false;
-        
+  template <int dim>
+  bool operator() (const Point<dim> p, const Point<dim> q) const
+  {
+    for (unsigned int d=0; d<dim; ++d)
+      if (p(d) < q(d))
+        return true;
+      else if (p(d) > q(d))
         return false;
-      }
+
+    return false;
+  }
 };
 
 
@@ -47,8 +47,8 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // don't check if fe has no support
-                                   // points
+  // don't check if fe has no support
+  // points
   if (dof_handler.get_fe().get_unit_support_points().size() == 0)
     return;
 
@@ -57,10 +57,10 @@ check_this (const DoFHandler<dim> &dof_handler)
 
   DoFTools::map_support_points_to_dofs (mapping, dof_handler, map);
 
-                                   // output every second element
+  // output every second element
   unsigned int j=0;
   for (typename std::map<Point<dim>, types::global_dof_index, Comp>::const_iterator
-         i=map.begin(); i!=map.end(); ++i,++j)
+       i=map.begin(); i!=map.end(); ++i,++j)
     if (j%2 == 0)
       deallog << i->first << " " << i->second << std::endl;
   deallog << std::endl;
index 4acc719b86d0118204e92f4d0d8bf82e9da2aaed..95de974f99dbd87ddaa8808c901fd9394245d521 100644 (file)
@@ -32,12 +32,12 @@ check_this (const DoFHandler<dim> &dof_handler)
   std::vector<bool> selected_dofs (dof_handler.n_dofs());
   std::vector<bool> mask (dof_handler.get_fe().n_components(), false);
 
-                                   // only select first component
+  // only select first component
   mask[0] = true;
   DoFTools::extract_dofs (dof_handler, ComponentMask(mask), selected_dofs);
   output_bool_vector (selected_dofs);
 
-                                   // also select last component
+  // also select last component
   mask.back() = true;
   DoFTools::extract_dofs (dof_handler, ComponentMask(mask), selected_dofs);
   output_bool_vector (selected_dofs);
index db5ee54e57cc1dcc1aa9857bb27b6b077aaaa61c..555444e73f35702d7ce381f7b49bdcd280e6312c 100644 (file)
@@ -31,35 +31,35 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // this doesn't make much sense if
-                                   // the element is not primitive
+  // this doesn't make much sense if
+  // the element is not primitive
   if (dof_handler.get_fe().is_primitive() == false)
     return;
-  
+
   Vector<double> cell_data (dof_handler.get_tria().n_active_cells());
   for (unsigned int i=0; i<cell_data.size(); ++i)
     cell_data(i) = i;
 
-                                   // distribute to first component
+  // distribute to first component
   Vector<double> dof_data (dof_handler.n_dofs());
   DoFTools::distribute_cell_to_dof_vector (dof_handler,
                                            cell_data,
                                            dof_data);
-  
-                                   // output every third element
+
+  // output every third element
   for (unsigned int i=0; i<dof_data.size(); i+=3)
     deallog << dof_data(i) << " ";
   deallog << std::endl;
 
 
-                                   // distribute to last component. note that
-                                   // there will still be data left from the
-                                   // first component.
+  // distribute to last component. note that
+  // there will still be data left from the
+  // first component.
   DoFTools::distribute_cell_to_dof_vector (dof_handler,
                                            cell_data,
                                            dof_data,
                                            dof_handler.get_fe().n_components()-1);
   for (unsigned int i=0; i<dof_data.size(); i+=3)
     deallog << dof_data(i) << " ";
-  deallog << std::endl;  
+  deallog << std::endl;
 }
index 202de14dc348f93eba07e384bcdee17fd424c295..cbdc0707cf76df4eb1a9c88639e38cedc3282fb4 100644 (file)
@@ -37,8 +37,8 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // this doesn't make much sense if
-                                   // the element is not primitive
+  // this doesn't make much sense if
+  // the element is not primitive
   if (dof_handler.get_fe().is_primitive() == false)
     return;
 
@@ -46,61 +46,61 @@ check_this (const DoFHandler<dim> &dof_handler)
   for (unsigned int i=0; i<cell_data.size(); ++i)
     cell_data(i) = i;
 
-                                   // distribute to first component
+  // distribute to first component
   Vector<double> dof_data (dof_handler.n_dofs());
 
-                                  // preset the vector to make sure
-                                  // that the function zeroes out
-                                  // previous content. however, only
-                                  // touch those elements that we
-                                  // will actually use
+  // preset the vector to make sure
+  // that the function zeroes out
+  // previous content. however, only
+  // touch those elements that we
+  // will actually use
   std::vector<bool> component_dofs (dof_handler.n_dofs());
   {
     std::vector<bool> component_mask (dof_handler.get_fe().n_components(),
-                                     false);
+                                      false);
     component_mask[0] = true;
     DoFTools::extract_dofs (dof_handler, ComponentMask(component_mask), component_dofs);
 
     for (unsigned int i=0; i<dof_data.size(); ++i)
       if (component_dofs[i] == true)
-       dof_data(i) = i+1;
+        dof_data(i) = i+1;
       else
-       dof_data(i) = 0;
+        dof_data(i) = 0;
   }
 
   DoFTools::distribute_cell_to_dof_vector (dof_handler,
                                            cell_data,
                                            dof_data);
-                                   // output every third element
+  // output every third element
   for (unsigned int i=0; i<dof_data.size(); i+=3)
     deallog << dof_data(i) << " ";
   deallog << std::endl;
 
-                                  // check that no other values were
-                                  // set
+  // check that no other values were
+  // set
   for (unsigned int i=0; i<dof_data.size(); ++i)
     if (component_dofs[i] == false)
       Assert (dof_data(i) == 0,
-             ExcInternalError());
+              ExcInternalError());
 
 
-                                   // distribute to last component. by
-                                   // default we distribute to
-                                   // component zero
+  // distribute to last component. by
+  // default we distribute to
+  // component zero
 
-                                  // preset the vector again to make
-                                  // sure that the function zeroes out
-                                  // previous content.
+  // preset the vector again to make
+  // sure that the function zeroes out
+  // previous content.
   {
     std::vector<bool> component_mask (dof_handler.get_fe().n_components(),
-                                     false);
+                                      false);
     component_mask.back() = true;
     DoFTools::extract_dofs (dof_handler, ComponentMask(component_mask), component_dofs);
     for (unsigned int i=0; i<dof_data.size(); ++i)
       if (component_dofs[i] == true)
-       dof_data(i) = i+1;
+        dof_data(i) = i+1;
       else
-       dof_data(i) = 0;
+        dof_data(i) = 0;
   }
   DoFTools::distribute_cell_to_dof_vector (dof_handler,
                                            cell_data,
@@ -110,10 +110,10 @@ check_this (const DoFHandler<dim> &dof_handler)
     deallog << dof_data(i) << " ";
   deallog << std::endl;
 
-                                  // check that no other values were
-                                  // set
+  // check that no other values were
+  // set
   for (unsigned int i=0; i<dof_data.size(); ++i)
     if (component_dofs[i] == false)
       Assert (dof_data(i) == 0,
-             ExcInternalError());
+              ExcInternalError());
 }
index b9208510a38ff89db0239f9f1b68e88e65f0e903..76f001e3f9ebacf4fc798a2583f641e075f4479a 100644 (file)
@@ -31,17 +31,17 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // no other args
+  // no other args
   deallog << dof_handler.n_boundary_dofs() << std::endl;
 
-                                   // with FunctionMap
+  // with FunctionMap
   typename FunctionMap<dim>::type fm;
   fm[0] = 0;
   deallog << dof_handler.n_boundary_dofs(fm) << std::endl;
-  
-                                   // with std::set
+
+  // with std::set
   std::set<types::boundary_id> s;
   s.insert (0);
   deallog << dof_handler.n_boundary_dofs(s) << std::endl;
-  
+
 }
index 59288b04791302dce424ef085e92e4d810c4df93..3cc00834c697225c375442a28adc1f13b0788a0c 100644 (file)
@@ -23,7 +23,7 @@
 //   DoFTools::
 //   make_boundary_sparsity_pattern (const DoFHandler<dim> &,
 //                                   const std::vector<unsigned int> &
-//                                  SparsityPattern       &);
+//                               SparsityPattern       &);
 
 
 std::string output_file_name = "dof_tools_15a/output";
@@ -33,24 +33,24 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // test doesn't make much sense if
-                                   // no boundary dofs exist
+  // test doesn't make much sense if
+  // no boundary dofs exist
   if (dof_handler.get_fe().dofs_per_face == 0)
     return;
-  
+
   std::vector<types::global_dof_index> map (dof_handler.n_dofs());
   DoFTools::map_dof_to_boundary_indices (dof_handler, map);
-  
-                                   // create sparsity pattern
+
+  // create sparsity pattern
   SparsityPattern sp (dof_handler.n_boundary_dofs(),
                       dof_handler.max_couplings_between_dofs());
   DoFTools::make_boundary_sparsity_pattern (dof_handler, map, sp);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
@@ -59,7 +59,7 @@ check_this (const DoFHandler<dim> &dof_handler)
       deallog << std::endl;
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   deallog << sp.bandwidth () << std::endl
           << sp.max_entries_per_row () << std::endl
           << sp.n_nonzero_elements () << std::endl;
index b489916ef1d983ec0f4c51a0e96a5107c009b36e..a1dd023f31059a1be05cf411be24236347af56b3 100644 (file)
@@ -23,7 +23,7 @@
 //   DoFTools::
 //   make_boundary_sparsity_pattern (const DoFHandler<dim>     &,
 //                                   const std::vector<unsigned int> &
-//                                  CompressedSparsityPattern &);
+//                               CompressedSparsityPattern &);
 
 std::string output_file_name = "dof_tools_15b/output";
 
@@ -32,23 +32,23 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // test doesn't make much sense if
-                                   // no boundary dofs exist
+  // test doesn't make much sense if
+  // no boundary dofs exist
   if (dof_handler.get_fe().dofs_per_face == 0)
     return;
-  
+
   std::vector<types::global_dof_index> map (dof_handler.n_dofs());
   DoFTools::map_dof_to_boundary_indices (dof_handler, map);
-  
-                                   // create sparsity pattern
+
+  // create sparsity pattern
   CompressedSparsityPattern sp (dof_handler.n_boundary_dofs());
   DoFTools::make_boundary_sparsity_pattern (dof_handler, map, sp);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
@@ -57,7 +57,7 @@ check_this (const DoFHandler<dim> &dof_handler)
       deallog << std::endl;
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   deallog << sp.bandwidth () << std::endl
           << sp.max_entries_per_row () << std::endl
           << sp.n_nonzero_elements () << std::endl;
index a00c1b9bbfbe6a9ea780239f087f085c9a15e2f4..fa2fd7a957ca06ecec6e738b0821acc06b288adb 100644 (file)
@@ -23,7 +23,7 @@
 //   DoFTools::
 //   make_boundary_sparsity_pattern (const DoFHandler<dim>     &,
 //                                   const std::vector<unsigned int> &
-//                                  CompressedSetSparsityPattern &);
+//                               CompressedSetSparsityPattern &);
 
 std::string output_file_name = "dof_tools_15b_x/output";
 
@@ -32,33 +32,33 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // test doesn't make much sense if
-                                   // no boundary dofs exist
+  // test doesn't make much sense if
+  // no boundary dofs exist
   if (dof_handler.get_fe().dofs_per_face == 0)
     return;
-  
+
   std::vector<types::global_dof_index> map (dof_handler.n_dofs());
   DoFTools::map_dof_to_boundary_indices (dof_handler, map);
-  
-                                   // create sparsity pattern
+
+  // create sparsity pattern
   CompressedSetSparsityPattern sp (dof_handler.n_boundary_dofs());
   DoFTools::make_boundary_sparsity_pattern (dof_handler, map, sp);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
       for (CompressedSetSparsityPattern::row_iterator
-            c = sp.row_begin(line); c!=sp.row_end(line); ++c)
+           c = sp.row_begin(line); c!=sp.row_end(line); ++c)
         deallog << *c << " ";
       deallog << std::endl;
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   deallog << sp.bandwidth () << std::endl
           << sp.max_entries_per_row () << std::endl
           << sp.n_nonzero_elements () << std::endl;
index be97c2d5f15a88f7ea43cac51ae97157ac44b372..092b8a38f21ca7a7c227720fabfa6866be8d464e 100644 (file)
@@ -23,7 +23,7 @@
 //   DoFTools::
 //   make_boundary_sparsity_pattern (const DoFHandler<dim> &,
 //                                   const std::vector<unsigned int> &
-//                                  BlockSparsityPattern  &);
+//                               BlockSparsityPattern  &);
 
 std::string output_file_name = "dof_tools_15c/output";
 
@@ -32,46 +32,46 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // test doesn't make much sense if
-                                   // no boundary dofs exist
+  // test doesn't make much sense if
+  // no boundary dofs exist
   if (dof_handler.get_fe().dofs_per_face == 0)
     return;
-  
+
   std::vector<types::global_dof_index> map (dof_handler.n_dofs());
   DoFTools::map_dof_to_boundary_indices (dof_handler, map);
-  
+
   const unsigned int n_blocks = std::min (
-      static_cast<types::global_dof_index>(dof_handler.get_fe().n_components()),
-      dof_handler.n_boundary_dofs());
+                                  static_cast<types::global_dof_index>(dof_handler.get_fe().n_components()),
+                                  dof_handler.n_boundary_dofs());
   BlockSparsityPattern sp (n_blocks,
                            n_blocks);
-                                   // split dofs almost arbitrarily to
-                                   // blocks
+  // split dofs almost arbitrarily to
+  // blocks
   std::vector<types::global_dof_index> dofs_per_block(n_blocks);
   for (unsigned int i=0; i<n_blocks-1; ++i)
     dofs_per_block[i] = dof_handler.n_boundary_dofs()/n_blocks;
   dofs_per_block.back() = (dof_handler.n_boundary_dofs() -
                            (dof_handler.n_boundary_dofs()/n_blocks)*(n_blocks-1));
-  
+
   for (unsigned int i=0; i<n_blocks; ++i)
     for (unsigned int j=0; j<n_blocks; ++j)
       sp.block(i,j).reinit(dofs_per_block[i],
                            dofs_per_block[j],
                            dof_handler.max_couplings_between_dofs());
   sp.collect_sizes ();
-  
+
   DoFTools::make_boundary_sparsity_pattern (dof_handler, map, sp);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
       std::pair<unsigned int,unsigned int>
-        block_row = sp.get_row_indices().global_to_local(line);
+      block_row = sp.get_row_indices().global_to_local(line);
       for (unsigned int col=0; col<n_blocks; ++col)
         {
           for (unsigned int c=0;
@@ -83,7 +83,7 @@ check_this (const DoFHandler<dim> &dof_handler)
         }
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   for (unsigned int r=0; r<n_blocks; ++r)
     for (unsigned int c=0; c<n_blocks; ++c)
       {
@@ -91,7 +91,7 @@ check_this (const DoFHandler<dim> &dof_handler)
         deallog << x.bandwidth () << std::endl
                 << x.max_entries_per_row () << std::endl
                 << x.n_nonzero_elements () << std::endl;
-        
+
         unsigned int hash = 0;
         for (unsigned int l=0; l<x.n_rows(); ++l)
           hash += l*x.row_length(l);
index db8a2684271ed232519ecfbfa9c81798a688e37f..7aa8ed77c6572fcc208d9f32b8d5c28d0ae1337d 100644 (file)
@@ -23,7 +23,7 @@
 //   DoFTools::
 //   make_boundary_sparsity_pattern (const DoFHandler<dim> &,
 //                                   const std::vector<unsigned int> &
-//                                  BlockCompressedSparsityPattern  &);
+//                               BlockCompressedSparsityPattern  &);
 
 std::string output_file_name = "dof_tools_15d/output";
 
@@ -32,45 +32,45 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // test doesn't make much sense if
-                                   // no boundary dofs exist
+  // test doesn't make much sense if
+  // no boundary dofs exist
   if (dof_handler.get_fe().dofs_per_face == 0)
     return;
-  
+
   std::vector<types::global_dof_index> map (dof_handler.n_dofs());
   DoFTools::map_dof_to_boundary_indices (dof_handler, map);
-  
+
   const unsigned int n_blocks = std::min (
-      static_cast<types::global_dof_index>(dof_handler.get_fe().n_components()),
-      dof_handler.n_boundary_dofs());
+                                  static_cast<types::global_dof_index>(dof_handler.get_fe().n_components()),
+                                  dof_handler.n_boundary_dofs());
   BlockCompressedSparsityPattern sp (n_blocks,
                                      n_blocks);
-                                   // split dofs almost arbitrarily to
-                                   // blocks
+  // split dofs almost arbitrarily to
+  // blocks
   std::vector<types::global_dof_index> dofs_per_block(n_blocks);
   for (unsigned int i=0; i<n_blocks-1; ++i)
     dofs_per_block[i] = dof_handler.n_boundary_dofs()/n_blocks;
   dofs_per_block.back() = (dof_handler.n_boundary_dofs() -
                            (dof_handler.n_boundary_dofs()/n_blocks)*(n_blocks-1));
-  
+
   for (unsigned int i=0; i<n_blocks; ++i)
     for (unsigned int j=0; j<n_blocks; ++j)
       sp.block(i,j).reinit(dofs_per_block[i],
                            dofs_per_block[j]);
   sp.collect_sizes ();
-  
+
   DoFTools::make_boundary_sparsity_pattern (dof_handler, map, sp);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
       std::pair<unsigned int,unsigned int>
-        block_row = sp.get_row_indices().global_to_local(line);
+      block_row = sp.get_row_indices().global_to_local(line);
       for (unsigned int col=0; col<n_blocks; ++col)
         {
           for (unsigned int c=0;
@@ -82,7 +82,7 @@ check_this (const DoFHandler<dim> &dof_handler)
         }
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   for (unsigned int r=0; r<n_blocks; ++r)
     for (unsigned int c=0; c<n_blocks; ++c)
       {
@@ -90,7 +90,7 @@ check_this (const DoFHandler<dim> &dof_handler)
         deallog << x.bandwidth () << std::endl
                 << x.max_entries_per_row () << std::endl
                 << x.n_nonzero_elements () << std::endl;
-        
+
         unsigned int hash = 0;
         for (unsigned int l=0; l<x.n_rows(); ++l)
           hash += l*x.row_length(l);
index 9996e4629cc4bbfb84a2632a5a1b663b940dd277..b2abb5fb90201288491c72222e07694cffd2becb 100644 (file)
@@ -23,7 +23,7 @@
 //   DoFTools::
 //   make_boundary_sparsity_pattern (const DoFHandler<dim> &,
 //                                   const std::vector<unsigned int> &
-//                                  BlockCompressedSetSparsityPattern  &);
+//                               BlockCompressedSetSparsityPattern  &);
 
 std::string output_file_name = "dof_tools_15d_x/output";
 
@@ -32,57 +32,57 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // test doesn't make much sense if
-                                   // no boundary dofs exist
+  // test doesn't make much sense if
+  // no boundary dofs exist
   if (dof_handler.get_fe().dofs_per_face == 0)
     return;
-  
+
   std::vector<types::global_dof_index> map (dof_handler.n_dofs());
   DoFTools::map_dof_to_boundary_indices (dof_handler, map);
-  
+
   const unsigned int n_blocks = std::min (
-      static_cast<types::global_dof_index>(dof_handler.get_fe().n_components()),
-      dof_handler.n_boundary_dofs());
+                                  static_cast<types::global_dof_index>(dof_handler.get_fe().n_components()),
+                                  dof_handler.n_boundary_dofs());
   BlockCompressedSetSparsityPattern sp (n_blocks,
-                                     n_blocks);
-                                   // split dofs almost arbitrarily to
-                                   // blocks
+                                        n_blocks);
+  // split dofs almost arbitrarily to
+  // blocks
   std::vector<types::global_dof_index> dofs_per_block(n_blocks);
   for (unsigned int i=0; i<n_blocks-1; ++i)
     dofs_per_block[i] = dof_handler.n_boundary_dofs()/n_blocks;
   dofs_per_block.back() = (dof_handler.n_boundary_dofs() -
                            (dof_handler.n_boundary_dofs()/n_blocks)*(n_blocks-1));
-  
+
   for (unsigned int i=0; i<n_blocks; ++i)
     for (unsigned int j=0; j<n_blocks; ++j)
       sp.block(i,j).reinit(dofs_per_block[i],
                            dofs_per_block[j]);
   sp.collect_sizes ();
-  
+
   DoFTools::make_boundary_sparsity_pattern (dof_handler, map, sp);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
       std::pair<unsigned int,unsigned int>
-        block_row = sp.get_row_indices().global_to_local(line);
+      block_row = sp.get_row_indices().global_to_local(line);
       for (unsigned int col=0; col<n_blocks; ++col)
         {
-         for (CompressedSetSparsityPattern::row_iterator
-                c = sp.block(block_row.first,col).row_begin(block_row.second);
-              c!=sp.block(block_row.first,col).row_end(block_row.second); ++c)
+          for (CompressedSetSparsityPattern::row_iterator
+               c = sp.block(block_row.first,col).row_begin(block_row.second);
+               c!=sp.block(block_row.first,col).row_end(block_row.second); ++c)
             deallog << *c
                     << " ";
           deallog << std::endl;
         }
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   for (unsigned int r=0; r<n_blocks; ++r)
     for (unsigned int c=0; c<n_blocks; ++c)
       {
@@ -90,7 +90,7 @@ check_this (const DoFHandler<dim> &dof_handler)
         deallog << x.bandwidth () << std::endl
                 << x.max_entries_per_row () << std::endl
                 << x.n_nonzero_elements () << std::endl;
-        
+
         unsigned int hash = 0;
         for (unsigned int l=0; l<x.n_rows(); ++l)
           hash += l*x.row_length(l);
index 75259a0b71c7373c6ae34899bcf4127837454685..fd8b7d074bf3d2c47e41d2326f39ad6724c4993e 100644 (file)
@@ -24,7 +24,7 @@
 //   make_boundary_sparsity_pattern (const DoFHandler<dim> &,
 //                                   const typename FunctionMap<dim>::type &
 //                                   const std::vector<unsigned int> &
-//                                  SparsityPattern       &);
+//                               SparsityPattern       &);
 
 
 std::string output_file_name = "dof_tools_16a/output";
@@ -34,29 +34,29 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // test doesn't make much sense if
-                                   // no boundary dofs exist
+  // test doesn't make much sense if
+  // no boundary dofs exist
   if (dof_handler.get_fe().dofs_per_face == 0)
     return;
-  
+
   std::vector<types::global_dof_index> map (dof_handler.n_dofs());
   std::set<types::boundary_id> set;
   set.insert (0);
   DoFTools::map_dof_to_boundary_indices (dof_handler, set, map);
-  
-                                   // create sparsity pattern
+
+  // create sparsity pattern
   typename FunctionMap<dim>::type boundary_ids;
-  boundary_ids[0] = 0;  
+  boundary_ids[0] = 0;
   SparsityPattern sp (dof_handler.n_boundary_dofs(boundary_ids),
                       dof_handler.max_couplings_between_dofs());
   DoFTools::make_boundary_sparsity_pattern (dof_handler, boundary_ids,
                                             map, sp);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
@@ -65,7 +65,7 @@ check_this (const DoFHandler<dim> &dof_handler)
       deallog << std::endl;
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   deallog << sp.bandwidth () << std::endl
           << sp.max_entries_per_row () << std::endl
           << sp.n_nonzero_elements () << std::endl;
index 78e64e8e87f5b320759725e6e15a8790bb2bc07b..2a5966188c0060a60393f2dde7bb96764c67bbd2 100644 (file)
@@ -24,7 +24,7 @@
 //   make_boundary_sparsity_pattern (const DoFHandler<dim>     &,
 //                                   const typename FunctionMap<dim>::type &
 //                                   const std::vector<unsigned int> &
-//                                  CompressedSparsityPattern &);
+//                               CompressedSparsityPattern &);
 
 std::string output_file_name = "dof_tools_16b/output";
 
@@ -33,28 +33,28 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // test doesn't make much sense if
-                                   // no boundary dofs exist
+  // test doesn't make much sense if
+  // no boundary dofs exist
   if (dof_handler.get_fe().dofs_per_face == 0)
     return;
-  
+
   std::vector<types::global_dof_index> map (dof_handler.n_dofs());
   std::set<types::boundary_id> set;
   set.insert (0);
   DoFTools::map_dof_to_boundary_indices (dof_handler, set, map);
-  
-                                   // create sparsity pattern
+
+  // create sparsity pattern
   typename FunctionMap<dim>::type boundary_ids;
   boundary_ids[0] = 0;
   CompressedSparsityPattern sp (dof_handler.n_boundary_dofs(boundary_ids));
   DoFTools::make_boundary_sparsity_pattern (dof_handler, boundary_ids,
                                             map, sp);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
@@ -63,7 +63,7 @@ check_this (const DoFHandler<dim> &dof_handler)
       deallog << std::endl;
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   deallog << sp.bandwidth () << std::endl
           << sp.max_entries_per_row () << std::endl
           << sp.n_nonzero_elements () << std::endl;
index 98bf527172cc1e7ca7dfb681513a0da25432dcf6..d54d0b36d550781e3513065166e6960bf6262258 100644 (file)
@@ -24,7 +24,7 @@
 //   make_boundary_sparsity_pattern (const DoFHandler<dim>     &,
 //                                   const typename FunctionMap<dim>::type &
 //                                   const std::vector<unsigned int> &
-//                                  CompressedSetSparsityPattern &);
+//                               CompressedSetSparsityPattern &);
 
 std::string output_file_name = "dof_tools_16b_x/output";
 
@@ -33,38 +33,38 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // test doesn't make much sense if
-                                   // no boundary dofs exist
+  // test doesn't make much sense if
+  // no boundary dofs exist
   if (dof_handler.get_fe().dofs_per_face == 0)
     return;
-  
+
   std::vector<types::global_dof_index> map (dof_handler.n_dofs());
   std::set<types::boundary_id> set;
   set.insert (0);
   DoFTools::map_dof_to_boundary_indices (dof_handler, set, map);
-  
-                                   // create sparsity pattern
+
+  // create sparsity pattern
   typename FunctionMap<dim>::type boundary_ids;
   boundary_ids[0] = 0;
   CompressedSetSparsityPattern sp (dof_handler.n_boundary_dofs(boundary_ids));
   DoFTools::make_boundary_sparsity_pattern (dof_handler, boundary_ids,
                                             map, sp);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
       for (CompressedSetSparsityPattern::row_iterator
-            c = sp.row_begin(line); c!=sp.row_end(line); ++c)
+           c = sp.row_begin(line); c!=sp.row_end(line); ++c)
         deallog << *c << " ";
       deallog << std::endl;
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   deallog << sp.bandwidth () << std::endl
           << sp.max_entries_per_row () << std::endl
           << sp.n_nonzero_elements () << std::endl;
index ee67debe5b252333d85dca7a7a7eb7edae6753e8..4de8084a4b6cf81eba2a5fd68f0d6ec14e809f57 100644 (file)
@@ -24,7 +24,7 @@
 //   make_boundary_sparsity_pattern (const DoFHandler<dim> &,
 //                                   const typename FunctionMap<dim>::type &
 //                                   const std::vector<unsigned int> &
-//                                  BlockSparsityPattern  &);
+//                               BlockSparsityPattern  &);
 
 std::string output_file_name = "dof_tools_16c/output";
 
@@ -33,16 +33,16 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // test doesn't make much sense if
-                                   // no boundary dofs exist
+  // test doesn't make much sense if
+  // no boundary dofs exist
   if (dof_handler.get_fe().dofs_per_face == 0)
     return;
-  
+
   std::vector<types::global_dof_index> map (dof_handler.n_dofs());
   std::set<types::boundary_id> set;
   set.insert (0);
   DoFTools::map_dof_to_boundary_indices (dof_handler, set, map);
-  
+
   typename FunctionMap<dim>::type boundary_ids;
   boundary_ids[0] = 0;
   const unsigned int n_boundary_dofs = dof_handler.n_boundary_dofs(boundary_ids);
@@ -50,34 +50,34 @@ check_this (const DoFHandler<dim> &dof_handler)
                                           n_boundary_dofs);
   BlockSparsityPattern sp (n_blocks,
                            n_blocks);
-                                   // split dofs almost arbitrarily to
-                                   // blocks
+  // split dofs almost arbitrarily to
+  // blocks
   std::vector<types::global_dof_index> dofs_per_block(n_blocks);
   for (unsigned int i=0; i<n_blocks-1; ++i)
     dofs_per_block[i] = n_boundary_dofs/n_blocks;
   dofs_per_block.back() = (n_boundary_dofs -
                            (n_boundary_dofs/n_blocks)*(n_blocks-1));
-  
+
   for (unsigned int i=0; i<n_blocks; ++i)
     for (unsigned int j=0; j<n_blocks; ++j)
       sp.block(i,j).reinit(dofs_per_block[i],
                            dofs_per_block[j],
                            dof_handler.max_couplings_between_dofs());
   sp.collect_sizes ();
-  
+
   DoFTools::make_boundary_sparsity_pattern (dof_handler, boundary_ids,
                                             map, sp);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
       std::pair<unsigned int,unsigned int>
-        block_row = sp.get_row_indices().global_to_local(line);
+      block_row = sp.get_row_indices().global_to_local(line);
       for (unsigned int col=0; col<n_blocks; ++col)
         {
           for (unsigned int c=0;
@@ -89,7 +89,7 @@ check_this (const DoFHandler<dim> &dof_handler)
         }
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   for (unsigned int r=0; r<n_blocks; ++r)
     for (unsigned int c=0; c<n_blocks; ++c)
       {
@@ -97,7 +97,7 @@ check_this (const DoFHandler<dim> &dof_handler)
         deallog << x.bandwidth () << std::endl
                 << x.max_entries_per_row () << std::endl
                 << x.n_nonzero_elements () << std::endl;
-        
+
         unsigned int hash = 0;
         for (unsigned int l=0; l<x.n_rows(); ++l)
           hash += l*x.row_length(l);
index f7627b0907065f652e2162470e387130a59c6f99..b50782b2aa2b469402bf3de0e7e0c89e4e255b0c 100644 (file)
@@ -24,7 +24,7 @@
 //   make_boundary_sparsity_pattern (const DoFHandler<dim> &,
 //                                   const typename FunctionMap<dim>::type &
 //                                   const std::vector<unsigned int> &
-//                                  BlockCompressedSparsityPattern  &);
+//                               BlockCompressedSparsityPattern  &);
 
 std::string output_file_name = "dof_tools_16d/output";
 
@@ -33,11 +33,11 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // test doesn't make much sense if
-                                   // no boundary dofs exist
+  // test doesn't make much sense if
+  // no boundary dofs exist
   if (dof_handler.get_fe().dofs_per_face == 0)
     return;
-  
+
   std::vector<types::global_dof_index> map (dof_handler.n_dofs());
   std::set<types::boundary_id> set;
   set.insert (0);
@@ -47,18 +47,18 @@ check_this (const DoFHandler<dim> &dof_handler)
   boundary_ids[0] = 0;
   const types::global_dof_index n_boundary_dofs = dof_handler.n_boundary_dofs(boundary_ids);
   const unsigned int n_blocks = std::min (
-      static_cast<types::global_dof_index>(dof_handler.get_fe().n_components()),
-      n_boundary_dofs);
+                                  static_cast<types::global_dof_index>(dof_handler.get_fe().n_components()),
+                                  n_boundary_dofs);
   BlockCompressedSparsityPattern sp (n_blocks,
                                      n_blocks);
-                                   // split dofs almost arbitrarily to
-                                   // blocks
+  // split dofs almost arbitrarily to
+  // blocks
   std::vector<types::global_dof_index> dofs_per_block(n_blocks);
   for (unsigned int i=0; i<n_blocks-1; ++i)
     dofs_per_block[i] = n_boundary_dofs/n_blocks;
   dofs_per_block.back() = (n_boundary_dofs -
                            (n_boundary_dofs/n_blocks)*(n_blocks-1));
-  
+
   for (unsigned int i=0; i<n_blocks; ++i)
     for (unsigned int j=0; j<n_blocks; ++j)
       sp.block(i,j).reinit(dofs_per_block[i],
@@ -68,16 +68,16 @@ check_this (const DoFHandler<dim> &dof_handler)
   DoFTools::make_boundary_sparsity_pattern (dof_handler, boundary_ids,
                                             map, sp);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
       std::pair<unsigned int,unsigned int>
-        block_row = sp.get_row_indices().global_to_local(line);
+      block_row = sp.get_row_indices().global_to_local(line);
       for (unsigned int col=0; col<n_blocks; ++col)
         {
           for (unsigned int c=0;
@@ -89,7 +89,7 @@ check_this (const DoFHandler<dim> &dof_handler)
         }
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   for (unsigned int r=0; r<n_blocks; ++r)
     for (unsigned int c=0; c<n_blocks; ++c)
       {
@@ -97,7 +97,7 @@ check_this (const DoFHandler<dim> &dof_handler)
         deallog << x.bandwidth () << std::endl
                 << x.max_entries_per_row () << std::endl
                 << x.n_nonzero_elements () << std::endl;
-        
+
         unsigned int hash = 0;
         for (unsigned int l=0; l<x.n_rows(); ++l)
           hash += l*x.row_length(l);
index 783c2181d6fe7d5ce8e8b39a26e1f1c1fc3f991a..8dae7f0e3c94a20ce521f78b9f38d183561c9d01 100644 (file)
@@ -24,7 +24,7 @@
 //   make_boundary_sparsity_pattern (const DoFHandler<dim> &,
 //                                   const typename FunctionMap<dim>::type &
 //                                   const std::vector<unsigned int> &
-//                                  BlockCompressedSetSparsityPattern  &);
+//                               BlockCompressedSetSparsityPattern  &);
 
 std::string output_file_name = "dof_tools_16d_x/output";
 
@@ -33,11 +33,11 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // test doesn't make much sense if
-                                   // no boundary dofs exist
+  // test doesn't make much sense if
+  // no boundary dofs exist
   if (dof_handler.get_fe().dofs_per_face == 0)
     return;
-  
+
   std::vector<types::global_dof_index> map (dof_handler.n_dofs());
   std::set<types::boundary_id> set;
   set.insert (0);
@@ -47,18 +47,18 @@ check_this (const DoFHandler<dim> &dof_handler)
   boundary_ids[0] = 0;
   const types::global_dof_index n_boundary_dofs = dof_handler.n_boundary_dofs(boundary_ids);
   const unsigned int n_blocks = std::min (
-      static_cast<types::global_dof_index>(dof_handler.get_fe().n_components()),
-      n_boundary_dofs);
+                                  static_cast<types::global_dof_index>(dof_handler.get_fe().n_components()),
+                                  n_boundary_dofs);
   BlockCompressedSetSparsityPattern sp (n_blocks,
-                                     n_blocks);
-                                   // split dofs almost arbitrarily to
-                                   // blocks
+                                        n_blocks);
+  // split dofs almost arbitrarily to
+  // blocks
   std::vector<types::global_dof_index> dofs_per_block(n_blocks);
   for (unsigned int i=0; i<n_blocks-1; ++i)
     dofs_per_block[i] = n_boundary_dofs/n_blocks;
   dofs_per_block.back() = (n_boundary_dofs -
                            (n_boundary_dofs/n_blocks)*(n_blocks-1));
-  
+
   for (unsigned int i=0; i<n_blocks; ++i)
     for (unsigned int j=0; j<n_blocks; ++j)
       sp.block(i,j).reinit(dofs_per_block[i],
@@ -68,28 +68,28 @@ check_this (const DoFHandler<dim> &dof_handler)
   DoFTools::make_boundary_sparsity_pattern (dof_handler, boundary_ids,
                                             map, sp);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
       std::pair<unsigned int,unsigned int>
-        block_row = sp.get_row_indices().global_to_local(line);
+      block_row = sp.get_row_indices().global_to_local(line);
       for (unsigned int col=0; col<n_blocks; ++col)
         {
-         for (CompressedSetSparsityPattern::row_iterator
-                c = sp.block(block_row.first,col).row_begin(block_row.second);
-              c!=sp.block(block_row.first,col).row_end(block_row.second); ++c)
+          for (CompressedSetSparsityPattern::row_iterator
+               c = sp.block(block_row.first,col).row_begin(block_row.second);
+               c!=sp.block(block_row.first,col).row_end(block_row.second); ++c)
             deallog << *c
                     << " ";
           deallog << std::endl;
         }
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   for (unsigned int r=0; r<n_blocks; ++r)
     for (unsigned int c=0; c<n_blocks; ++c)
       {
@@ -97,7 +97,7 @@ check_this (const DoFHandler<dim> &dof_handler)
         deallog << x.bandwidth () << std::endl
                 << x.max_entries_per_row () << std::endl
                 << x.n_nonzero_elements () << std::endl;
-        
+
         unsigned int hash = 0;
         for (unsigned int l=0; l<x.n_rows(); ++l)
           hash += l*x.row_length(l);
index 51e233e4ec4016b90a965e54b6ba5eb3ecc49e9c..5fec6471be0df3150fa78c794b67dfa96f727b4b 100644 (file)
@@ -22,7 +22,7 @@
 // check
 //   DoFTools::
 //   make_flux_sparsity_pattern (const DoFHandler<dim> &,
-//                              SparsityPattern       &);
+//                           SparsityPattern       &);
 
 
 std::string output_file_name = "dof_tools_17a/output";
@@ -32,16 +32,16 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // create sparsity pattern
+  // create sparsity pattern
   SparsityPattern sp (dof_handler.n_dofs(),
                       dof_handler.max_couplings_between_dofs()*2);
   DoFTools::make_flux_sparsity_pattern (dof_handler, sp);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
@@ -50,7 +50,7 @@ check_this (const DoFHandler<dim> &dof_handler)
       deallog << std::endl;
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   deallog << sp.bandwidth () << std::endl
           << sp.max_entries_per_row () << std::endl
           << sp.n_nonzero_elements () << std::endl;
index 31269a8561a7d60b1ed674a676a49e209afa2e8d..88c1ed82835ece500fa3908e9cc964d0abe5f67a 100644 (file)
@@ -22,7 +22,7 @@
 // check
 //   DoFTools::
 //   make_flux_sparsity_pattern (const DoFHandler<dim>     &,
-//                              CompressedSparsityPattern &);
+//                           CompressedSparsityPattern &);
 
 std::string output_file_name = "dof_tools_17b/output";
 
@@ -31,15 +31,15 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // create sparsity pattern
+  // create sparsity pattern
   CompressedSparsityPattern sp (dof_handler.n_dofs());
   DoFTools::make_flux_sparsity_pattern (dof_handler, sp);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
@@ -48,7 +48,7 @@ check_this (const DoFHandler<dim> &dof_handler)
       deallog << std::endl;
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   deallog << sp.bandwidth () << std::endl
           << sp.max_entries_per_row () << std::endl
           << sp.n_nonzero_elements () << std::endl;
index 9fdf9afef65f2659b6c81f52f2b50afd6304e3cd..804a631488d5aef6218c5f0982d706b31a05045a 100644 (file)
@@ -22,7 +22,7 @@
 // check
 //   DoFTools::
 //   make_flux_sparsity_pattern (const DoFHandler<dim>     &,
-//                              CompressedSetSparsityPattern &);
+//                           CompressedSetSparsityPattern &);
 
 std::string output_file_name = "dof_tools_17b_x/output";
 
@@ -31,25 +31,25 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // create sparsity pattern
+  // create sparsity pattern
   CompressedSetSparsityPattern sp (dof_handler.n_dofs());
   DoFTools::make_flux_sparsity_pattern (dof_handler, sp);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
       for (CompressedSetSparsityPattern::row_iterator
-            c = sp.row_begin(line); c!=sp.row_end(line); ++c)
+           c = sp.row_begin(line); c!=sp.row_end(line); ++c)
         deallog << *c << " ";
       deallog << std::endl;
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   deallog << sp.bandwidth () << std::endl
           << sp.max_entries_per_row () << std::endl
           << sp.n_nonzero_elements () << std::endl;
index 92d1e85fff2e369300fed8db214e45eda7af4346..4adce838e9dcd88b65779b0ca52c1b67e637eb06 100644 (file)
@@ -22,7 +22,7 @@
 // check
 //   DoFTools::
 //   make_flux_sparsity_pattern (const DoFHandler<dim> &,
-//                              BlockSparsityPattern  &);
+//                           BlockSparsityPattern  &);
 
 std::string output_file_name = "dof_tools_17c/output";
 
@@ -31,16 +31,16 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // we split up the matrix into
-                                   // blocks according to the number
-                                   // of dofs in each component. this
-                                   // fails if the element is not
-                                   // primitive, so skip this test for
-                                   // such elements
+  // we split up the matrix into
+  // blocks according to the number
+  // of dofs in each component. this
+  // fails if the element is not
+  // primitive, so skip this test for
+  // such elements
   if (dof_handler.get_fe().is_primitive() != true)
     return;
-  
-                                   // create sparsity pattern
+
+  // create sparsity pattern
   const unsigned int n_components = dof_handler.get_fe().n_components();
   BlockSparsityPattern sp (n_components,
                            n_components);
@@ -53,19 +53,19 @@ check_this (const DoFHandler<dim> &dof_handler)
                            dofs_per_component[j],
                            dof_handler.max_couplings_between_dofs()*2);
   sp.collect_sizes ();
-  
+
   DoFTools::make_flux_sparsity_pattern (dof_handler, sp);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
       std::pair<unsigned int,unsigned int>
-        block_row = sp.get_row_indices().global_to_local(line);
+      block_row = sp.get_row_indices().global_to_local(line);
       for (unsigned int col=0; col<n_components; ++col)
         {
           for (unsigned int c=0;
@@ -77,7 +77,7 @@ check_this (const DoFHandler<dim> &dof_handler)
         }
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   for (unsigned int r=0; r<n_components; ++r)
     for (unsigned int c=0; c<n_components; ++c)
       {
@@ -85,7 +85,7 @@ check_this (const DoFHandler<dim> &dof_handler)
         deallog << x.bandwidth () << std::endl
                 << x.max_entries_per_row () << std::endl
                 << x.n_nonzero_elements () << std::endl;
-        
+
         unsigned int hash = 0;
         for (unsigned int l=0; l<x.n_rows(); ++l)
           hash += l*x.row_length(l);
index 24c41fa07bf9061da47817fbc44fa3080851d177..e830f8d2fd9f764964612f9c0678d1316f3bd6a3 100644 (file)
@@ -22,7 +22,7 @@
 // check
 //   DoFTools::
 //   make_flux_sparsity_pattern (const DoFHandler<dim> &,
-//                              BlockCompressedSparsityPattern  &);
+//                           BlockCompressedSparsityPattern  &);
 
 std::string output_file_name = "dof_tools_17d/output";
 
@@ -31,16 +31,16 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // we split up the matrix into
-                                   // blocks according to the number
-                                   // of dofs in each component. this
-                                   // fails if the element is not
-                                   // primitive, so skip this test for
-                                   // such elements
+  // we split up the matrix into
+  // blocks according to the number
+  // of dofs in each component. this
+  // fails if the element is not
+  // primitive, so skip this test for
+  // such elements
   if (dof_handler.get_fe().is_primitive() != true)
     return;
-  
-                                   // create sparsity pattern
+
+  // create sparsity pattern
   const unsigned int n_components = dof_handler.get_fe().n_components();
   BlockCompressedSparsityPattern sp (n_components,
                                      n_components);
@@ -52,19 +52,19 @@ check_this (const DoFHandler<dim> &dof_handler)
       sp.block(i,j).reinit(dofs_per_component[i],
                            dofs_per_component[j]);
   sp.collect_sizes ();
-  
+
   DoFTools::make_flux_sparsity_pattern (dof_handler, sp);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
       std::pair<unsigned int,unsigned int>
-        block_row = sp.get_row_indices().global_to_local(line);
+      block_row = sp.get_row_indices().global_to_local(line);
       for (unsigned int col=0; col<n_components; ++col)
         {
           for (unsigned int c=0;
@@ -76,7 +76,7 @@ check_this (const DoFHandler<dim> &dof_handler)
         }
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   for (unsigned int r=0; r<n_components; ++r)
     for (unsigned int c=0; c<n_components; ++c)
       {
@@ -84,7 +84,7 @@ check_this (const DoFHandler<dim> &dof_handler)
         deallog << x.bandwidth () << std::endl
                 << x.max_entries_per_row () << std::endl
                 << x.n_nonzero_elements () << std::endl;
-        
+
         unsigned int hash = 0;
         for (unsigned int l=0; l<x.n_rows(); ++l)
           hash += l*x.row_length(l);
index d74e81297e9b2dfe07f758e3600618792ef21f24..8bf6e662f6b276c9cb256651e543c8dd0c6eed59 100644 (file)
@@ -22,7 +22,7 @@
 // check
 //   DoFTools::
 //   make_flux_sparsity_pattern (const DoFHandler<dim> &,
-//                              BlockCompressedSetSparsityPattern  &);
+//                           BlockCompressedSetSparsityPattern  &);
 
 std::string output_file_name = "dof_tools_17d_x/output";
 
@@ -31,19 +31,19 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // we split up the matrix into
-                                   // blocks according to the number
-                                   // of dofs in each component. this
-                                   // fails if the element is not
-                                   // primitive, so skip this test for
-                                   // such elements
+  // we split up the matrix into
+  // blocks according to the number
+  // of dofs in each component. this
+  // fails if the element is not
+  // primitive, so skip this test for
+  // such elements
   if (dof_handler.get_fe().is_primitive() != true)
     return;
-  
-                                   // create sparsity pattern
+
+  // create sparsity pattern
   const unsigned int n_components = dof_handler.get_fe().n_components();
   BlockCompressedSetSparsityPattern sp (n_components,
-                                     n_components);
+                                        n_components);
   std::vector<types::global_dof_index> dofs_per_component(n_components);
   DoFTools::count_dofs_per_component (dof_handler,
                                       dofs_per_component);
@@ -52,31 +52,31 @@ check_this (const DoFHandler<dim> &dof_handler)
       sp.block(i,j).reinit(dofs_per_component[i],
                            dofs_per_component[j]);
   sp.collect_sizes ();
-  
+
   DoFTools::make_flux_sparsity_pattern (dof_handler, sp);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
       std::pair<unsigned int,unsigned int>
-        block_row = sp.get_row_indices().global_to_local(line);
+      block_row = sp.get_row_indices().global_to_local(line);
       for (unsigned int col=0; col<n_components; ++col)
         {
-         for (CompressedSetSparsityPattern::row_iterator
-                c = sp.block(block_row.first,col).row_begin(block_row.second);
-              c!=sp.block(block_row.first,col).row_end(block_row.second); ++c)
+          for (CompressedSetSparsityPattern::row_iterator
+               c = sp.block(block_row.first,col).row_begin(block_row.second);
+               c!=sp.block(block_row.first,col).row_end(block_row.second); ++c)
             deallog << *c
                     << " ";
           deallog << std::endl;
         }
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   for (unsigned int r=0; r<n_components; ++r)
     for (unsigned int c=0; c<n_components; ++c)
       {
@@ -84,7 +84,7 @@ check_this (const DoFHandler<dim> &dof_handler)
         deallog << x.bandwidth () << std::endl
                 << x.max_entries_per_row () << std::endl
                 << x.n_nonzero_elements () << std::endl;
-        
+
         unsigned int hash = 0;
         for (unsigned int l=0; l<x.n_rows(); ++l)
           hash += l*x.row_length(l);
index 8f4abe8297d0cfca8b650940d2fa3151e39e2bb5..da2c81f17164e4edc89baa1acb6bbcad1015c201 100644 (file)
 // check
 //   DoFTools::
 //   make_flux_sparsity_pattern (const DoFHandler<dim> &,
-//                              SparsityPattern       &);
+//                           SparsityPattern       &);
 
 
 std::string output_file_name = "dof_tools_18a/output";
 
-                                   // set up masks. choose X-shaped
-                                   // masks with full first row and
-                                   // column (well, we had to invent
-                                   // something)
+// set up masks. choose X-shaped
+// masks with full first row and
+// column (well, we had to invent
+// something)
 void
 make_masks (const unsigned int n,
             Table<2,DoFTools::Coupling> &m1,
@@ -42,9 +42,9 @@ make_masks (const unsigned int n,
     m1(i,0) = m1(0,i) = m2(i,0) = m2(0,i) = m1(i,i) = m2(i,i) = DoFTools::nonzero;
 }
 
-  
+
 void
-my_check_this (const DoFHandler<1> &) 
+my_check_this (const DoFHandler<1> &)
 {}
 
 
@@ -56,18 +56,18 @@ my_check_this (const DoFHandler<dim> &dof_handler)
   Table<2,DoFTools::Coupling> mask_ext;
   make_masks (dof_handler.get_fe().n_components(),
               mask_int, mask_ext);
-  
-                                   // create sparsity pattern
+
+  // create sparsity pattern
   SparsityPattern sp (dof_handler.n_dofs(),
                       dof_handler.max_couplings_between_dofs()*2);
   DoFTools::make_flux_sparsity_pattern (dof_handler, sp,
                                         mask_int, mask_ext);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
@@ -76,7 +76,7 @@ my_check_this (const DoFHandler<dim> &dof_handler)
       deallog << std::endl;
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   deallog << sp.bandwidth () << std::endl
           << sp.max_entries_per_row () << std::endl
           << sp.n_nonzero_elements () << std::endl;
@@ -96,13 +96,13 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                  // since we can't forward declare
-                                  // check_this in this file (it is forward
-                                  // declared in dof_tools_common.h), we
-                                  // also can't make the driver file aware of
-                                  // the overload for 1d. to avoid linker
-                                  // errors, we can consequently not overload
-                                  // check_this, and need this forwarder
-                                  // function
+  // since we can't forward declare
+  // check_this in this file (it is forward
+  // declared in dof_tools_common.h), we
+  // also can't make the driver file aware of
+  // the overload for 1d. to avoid linker
+  // errors, we can consequently not overload
+  // check_this, and need this forwarder
+  // function
   my_check_this (dof_handler);
 }
index e1f548f443801357af6263254aec38553bf00c1a..faeb7bf39000eef49ae9188ae560ee9daddaf75c 100644 (file)
@@ -39,8 +39,8 @@
 // check
 //   DoFTools::
 //   make_flux_sparsity_pattern (const DoFHandler<dim> &,
-//                              SparsityPattern       &,
-//                              ConstraintMatrix      &);
+//                           SparsityPattern       &,
+//                           ConstraintMatrix      &);
 // this used to fail at one point because we forgot that in 1d
 // neighboring cells can be more than one level apart. with
 // FE_DGQ(0) elements, we get the following mesh and DoF indices:
@@ -59,17 +59,17 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // create sparsity pattern
+  // create sparsity pattern
   SparsityPattern sp (dof_handler.n_dofs(),
                       dof_handler.max_couplings_between_dofs()*2);
   DoFTools::make_flux_sparsity_pattern (dof_handler, sp,
-                                       ConstraintMatrix());
+                                        ConstraintMatrix());
   sp.compress ();
 
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<sp.n_rows(); ++l)
     {
       for (unsigned int c=0; c<sp.row_length(l); ++c)
@@ -77,7 +77,7 @@ check_this (const DoFHandler<dim> &dof_handler)
       deallog << std::endl;
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   deallog << sp.bandwidth () << std::endl
           << sp.max_entries_per_row () << std::endl
           << sp.n_nonzero_elements () << std::endl;
@@ -96,8 +96,8 @@ check_this (const DoFHandler<dim> &dof_handler)
 void
 check_this ()
 {
-                                  // create a mesh where two cells at levels
-                                  // 1 and 3 are adjacent
+  // create a mesh where two cells at levels
+  // 1 and 3 are adjacent
   const int dim = 1;
   Triangulation<dim> tr;
   GridGenerator::hyper_cube (tr);
@@ -105,7 +105,7 @@ check_this ()
   tr.begin_active()->set_refine_flag();
   tr.execute_coarsening_and_refinement();
   for (Triangulation<dim>::active_cell_iterator
-        c=tr.begin_active(2); c!=tr.end_active(2); ++c)
+       c=tr.begin_active(2); c!=tr.end_active(2); ++c)
     c->set_refine_flag();
   tr.execute_coarsening_and_refinement();
 
@@ -135,24 +135,24 @@ main()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 876279ed35611ba7ecab665079a0fd991e5042c0..771b1319e50fd6a53b88a52946016ab5c270e904 100644 (file)
 // check
 //   DoFTools::
 //   make_flux_sparsity_pattern (const DoFHandler<dim>     &,
-//                              CompressedSparsityPattern &);
+//                           CompressedSparsityPattern &);
 
 std::string output_file_name = "dof_tools_18b/output";
 
-                                   // set up masks. choose X-shaped
-                                   // masks with full first row and
-                                   // column (well, we had to invent
-                                   // something)
+// set up masks. choose X-shaped
+// masks with full first row and
+// column (well, we had to invent
+// something)
 void
 make_masks (const unsigned int n,
             Table<2, DoFTools::Coupling> &m1,
@@ -41,9 +41,9 @@ make_masks (const unsigned int n,
     m1(i,0) = m1(0,i) = m2(i,0) = m2(0,i) = m1(i,i) = m2(i,i) = DoFTools::nonzero;
 }
 
-  
+
 void
-my_check_this (const DoFHandler<1> &) 
+my_check_this (const DoFHandler<1> &)
 {}
 
 
@@ -56,17 +56,17 @@ my_check_this (const DoFHandler<dim> &dof_handler)
   Table<2, DoFTools::Coupling> mask_ext;
   make_masks (dof_handler.get_fe().n_components(),
               mask_int, mask_ext);
-  
-                                   // create sparsity pattern
+
+  // create sparsity pattern
   CompressedSparsityPattern sp (dof_handler.n_dofs());
   DoFTools::make_flux_sparsity_pattern (dof_handler, sp,
                                         mask_int, mask_ext);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
@@ -75,7 +75,7 @@ my_check_this (const DoFHandler<dim> &dof_handler)
       deallog << std::endl;
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   deallog << sp.bandwidth () << std::endl
           << sp.max_entries_per_row () << std::endl
           << sp.n_nonzero_elements () << std::endl;
@@ -90,13 +90,13 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                  // since we can't forward declare
-                                  // check_this in this file (it is forward
-                                  // declared in dof_tools_common.h), we
-                                  // also can't make the driver file aware of
-                                  // the overload for 1d. to avoid linker
-                                  // errors, we can consequently not overload
-                                  // check_this, and need this forwarder
-                                  // function
+  // since we can't forward declare
+  // check_this in this file (it is forward
+  // declared in dof_tools_common.h), we
+  // also can't make the driver file aware of
+  // the overload for 1d. to avoid linker
+  // errors, we can consequently not overload
+  // check_this, and need this forwarder
+  // function
   my_check_this (dof_handler);
 }
index 257c941d3a14a64481c2176b6f63d8e72caf296d..c4e69e31a9af4c56f293b6fbb712e27f4ba581eb 100644 (file)
 // check
 //   DoFTools::
 //   make_flux_sparsity_pattern (const DoFHandler<dim>     &,
-//                              CompressedSetSparsityPattern &);
+//                           CompressedSetSparsityPattern &);
 
 std::string output_file_name = "dof_tools_18b_x/output";
 
-                                   // set up masks. choose X-shaped
-                                   // masks with full first row and
-                                   // column (well, we had to invent
-                                   // something)
+// set up masks. choose X-shaped
+// masks with full first row and
+// column (well, we had to invent
+// something)
 void
 make_masks (const unsigned int n,
             Table<2, DoFTools::Coupling> &m1,
@@ -41,9 +41,9 @@ make_masks (const unsigned int n,
     m1(i,0) = m1(0,i) = m2(i,0) = m2(0,i) = m1(i,i) = m2(i,i) = DoFTools::nonzero;
 }
 
-  
+
 void
-my_check_this (const DoFHandler<1> &) 
+my_check_this (const DoFHandler<1> &)
 {}
 
 
@@ -56,27 +56,27 @@ my_check_this (const DoFHandler<dim> &dof_handler)
   Table<2, DoFTools::Coupling> mask_ext;
   make_masks (dof_handler.get_fe().n_components(),
               mask_int, mask_ext);
-  
-                                   // create sparsity pattern
+
+  // create sparsity pattern
   CompressedSetSparsityPattern sp (dof_handler.n_dofs());
   DoFTools::make_flux_sparsity_pattern (dof_handler, sp,
                                         mask_int, mask_ext);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
       for (CompressedSetSparsityPattern::row_iterator
-            c = sp.row_begin(line); c!=sp.row_end(line); ++c)
+           c = sp.row_begin(line); c!=sp.row_end(line); ++c)
         deallog << *c << " ";
       deallog << std::endl;
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   deallog << sp.bandwidth () << std::endl
           << sp.max_entries_per_row () << std::endl
           << sp.n_nonzero_elements () << std::endl;
@@ -91,13 +91,13 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                  // since we can't forward declare
-                                  // check_this in this file (it is forward
-                                  // declared in dof_tools_common.h), we
-                                  // also can't make the driver file aware of
-                                  // the overload for 1d. to avoid linker
-                                  // errors, we can consequently not overload
-                                  // check_this, and need this forwarder
-                                  // function
+  // since we can't forward declare
+  // check_this in this file (it is forward
+  // declared in dof_tools_common.h), we
+  // also can't make the driver file aware of
+  // the overload for 1d. to avoid linker
+  // errors, we can consequently not overload
+  // check_this, and need this forwarder
+  // function
   my_check_this (dof_handler);
 }
index 61a9bb0cc8c2f33ae36745418071cb46b312573b..c034b4c5c954a8f06fa781bcb6621a33259ae44a 100644 (file)
 // check
 //   DoFTools::
 //   make_flux_sparsity_pattern (const DoFHandler<dim> &,
-//                              BlockSparsityPattern  &);
+//                           BlockSparsityPattern  &);
 
 std::string output_file_name = "dof_tools_18c/output";
 
-                                   // set up masks. choose X-shaped
-                                   // masks with full first row and
-                                   // column (well, we had to invent
-                                   // something)
+// set up masks. choose X-shaped
+// masks with full first row and
+// column (well, we had to invent
+// something)
 void
 make_masks (const unsigned int n,
             Table<2, DoFTools::Coupling> &m1,
@@ -41,9 +41,9 @@ make_masks (const unsigned int n,
     m1(i,0) = m1(0,i) = m2(i,0) = m2(0,i) = m1(i,i) = m2(i,i) = DoFTools::nonzero;
 }
 
-  
+
 void
-my_check_this (const DoFHandler<1> &) 
+my_check_this (const DoFHandler<1> &)
 {}
 
 
@@ -51,21 +51,21 @@ template <int dim>
 void
 my_check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // we split up the matrix into
-                                   // blocks according to the number
-                                   // of dofs in each component. this
-                                   // fails if the element is not
-                                   // primitive, so skip this test for
-                                   // such elements
+  // we split up the matrix into
+  // blocks according to the number
+  // of dofs in each component. this
+  // fails if the element is not
+  // primitive, so skip this test for
+  // such elements
   if (dof_handler.get_fe().is_primitive() != true)
     return;
-  
+
   Table<2, DoFTools::Coupling> mask_int;
   Table<2, DoFTools::Coupling> mask_ext;
   make_masks (dof_handler.get_fe().n_components(),
               mask_int, mask_ext);
-  
-                                   // create sparsity pattern
+
+  // create sparsity pattern
   const unsigned int n_components = dof_handler.get_fe().n_components();
   BlockSparsityPattern sp (n_components,
                            n_components);
@@ -78,20 +78,20 @@ my_check_this (const DoFHandler<dim> &dof_handler)
                            dofs_per_component[j],
                            dof_handler.max_couplings_between_dofs()*2);
   sp.collect_sizes ();
-  
+
   DoFTools::make_flux_sparsity_pattern (dof_handler, sp,
                                         mask_int, mask_ext);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
       std::pair<unsigned int,unsigned int>
-        block_row = sp.get_row_indices().global_to_local(line);
+      block_row = sp.get_row_indices().global_to_local(line);
       for (unsigned int col=0; col<n_components; ++col)
         {
           for (unsigned int c=0;
@@ -103,7 +103,7 @@ my_check_this (const DoFHandler<dim> &dof_handler)
         }
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   for (unsigned int r=0; r<n_components; ++r)
     for (unsigned int c=0; c<n_components; ++c)
       {
@@ -111,7 +111,7 @@ my_check_this (const DoFHandler<dim> &dof_handler)
         deallog << x.bandwidth () << std::endl
                 << x.max_entries_per_row () << std::endl
                 << x.n_nonzero_elements () << std::endl;
-        
+
         unsigned int hash = 0;
         for (unsigned int l=0; l<x.n_rows(); ++l)
           hash += l*x.row_length(l);
@@ -125,13 +125,13 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                  // since we can't forward declare
-                                  // check_this in this file (it is forward
-                                  // declared in dof_tools_common.h), we
-                                  // also can't make the driver file aware of
-                                  // the overload for 1d. to avoid linker
-                                  // errors, we can consequently not overload
-                                  // check_this, and need this forwarder
-                                  // function
+  // since we can't forward declare
+  // check_this in this file (it is forward
+  // declared in dof_tools_common.h), we
+  // also can't make the driver file aware of
+  // the overload for 1d. to avoid linker
+  // errors, we can consequently not overload
+  // check_this, and need this forwarder
+  // function
   my_check_this (dof_handler);
 }
index 41d6acb5a525415c9f3569683837a24ac78b5eda..9a45b64a6833dd28aadbd922db5a6a07cc6522c9 100644 (file)
 // check
 //   DoFTools::
 //   make_flux_sparsity_pattern (const DoFHandler<dim> &,
-//                              BlockCompressedSparsityPattern  &);
+//                           BlockCompressedSparsityPattern  &);
 
 std::string output_file_name = "dof_tools_18d/output";
 
-                                   // set up masks. choose X-shaped
-                                   // masks with full first row and
-                                   // column (well, we had to invent
-                                   // something)
+// set up masks. choose X-shaped
+// masks with full first row and
+// column (well, we had to invent
+// something)
 void
 make_masks (const unsigned int n,
             Table<2, DoFTools::Coupling> &m1,
@@ -41,9 +41,9 @@ make_masks (const unsigned int n,
     m1(i,0) = m1(0,i) = m2(i,0) = m2(0,i) = m1(i,i) = m2(i,i) = DoFTools::nonzero;
 }
 
-  
+
 void
-my_check_this (const DoFHandler<1> &) 
+my_check_this (const DoFHandler<1> &)
 {}
 
 
@@ -52,21 +52,21 @@ template <int dim>
 void
 my_check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // we split up the matrix into
-                                   // blocks according to the number
-                                   // of dofs in each component. this
-                                   // fails if the element is not
-                                   // primitive, so skip this test for
-                                   // such elements
+  // we split up the matrix into
+  // blocks according to the number
+  // of dofs in each component. this
+  // fails if the element is not
+  // primitive, so skip this test for
+  // such elements
   if (dof_handler.get_fe().is_primitive() != true)
     return;
-  
+
   Table<2, DoFTools::Coupling> mask_int;
   Table<2, DoFTools::Coupling> mask_ext;
   make_masks (dof_handler.get_fe().n_components(),
               mask_int, mask_ext);
-  
-                                   // create sparsity pattern
+
+  // create sparsity pattern
   const unsigned int n_components = dof_handler.get_fe().n_components();
   BlockCompressedSparsityPattern sp (n_components,
                                      n_components);
@@ -78,20 +78,20 @@ my_check_this (const DoFHandler<dim> &dof_handler)
       sp.block(i,j).reinit(dofs_per_component[i],
                            dofs_per_component[j]);
   sp.collect_sizes ();
-  
+
   DoFTools::make_flux_sparsity_pattern (dof_handler, sp,
                                         mask_int, mask_ext);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
       std::pair<unsigned int,unsigned int>
-        block_row = sp.get_row_indices().global_to_local(line);
+      block_row = sp.get_row_indices().global_to_local(line);
       for (unsigned int col=0; col<n_components; ++col)
         {
           for (unsigned int c=0;
@@ -103,7 +103,7 @@ my_check_this (const DoFHandler<dim> &dof_handler)
         }
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   for (unsigned int r=0; r<n_components; ++r)
     for (unsigned int c=0; c<n_components; ++c)
       {
@@ -111,7 +111,7 @@ my_check_this (const DoFHandler<dim> &dof_handler)
         deallog << x.bandwidth () << std::endl
                 << x.max_entries_per_row () << std::endl
                 << x.n_nonzero_elements () << std::endl;
-        
+
         unsigned int hash = 0;
         for (unsigned int l=0; l<x.n_rows(); ++l)
           hash += l*x.row_length(l);
@@ -124,13 +124,13 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                  // since we can't forward declare
-                                  // check_this in this file (it is forward
-                                  // declared in dof_tools_common.h), we
-                                  // also can't make the driver file aware of
-                                  // the overload for 1d. to avoid linker
-                                  // errors, we can consequently not overload
-                                  // check_this, and need this forwarder
-                                  // function
+  // since we can't forward declare
+  // check_this in this file (it is forward
+  // declared in dof_tools_common.h), we
+  // also can't make the driver file aware of
+  // the overload for 1d. to avoid linker
+  // errors, we can consequently not overload
+  // check_this, and need this forwarder
+  // function
   my_check_this (dof_handler);
 }
index c29823da1da1f67d7d1221655813aa14e75f46f6..dc2e12b579c48f969e45775f9066030621aa4814 100644 (file)
 // check
 //   DoFTools::
 //   make_flux_sparsity_pattern (const DoFHandler<dim> &,
-//                              BlockCompressedSetSparsityPattern  &);
+//                           BlockCompressedSetSparsityPattern  &);
 
 std::string output_file_name = "dof_tools_18d_x/output";
 
-                                   // set up masks. choose X-shaped
-                                   // masks with full first row and
-                                   // column (well, we had to invent
-                                   // something)
+// set up masks. choose X-shaped
+// masks with full first row and
+// column (well, we had to invent
+// something)
 void
 make_masks (const unsigned int n,
             Table<2, DoFTools::Coupling> &m1,
@@ -41,9 +41,9 @@ make_masks (const unsigned int n,
     m1(i,0) = m1(0,i) = m2(i,0) = m2(0,i) = m1(i,i) = m2(i,i) = DoFTools::nonzero;
 }
 
-  
+
 void
-my_check_this (const DoFHandler<1> &) 
+my_check_this (const DoFHandler<1> &)
 {}
 
 
@@ -52,24 +52,24 @@ template <int dim>
 void
 my_check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // we split up the matrix into
-                                   // blocks according to the number
-                                   // of dofs in each component. this
-                                   // fails if the element is not
-                                   // primitive, so skip this test for
-                                   // such elements
+  // we split up the matrix into
+  // blocks according to the number
+  // of dofs in each component. this
+  // fails if the element is not
+  // primitive, so skip this test for
+  // such elements
   if (dof_handler.get_fe().is_primitive() != true)
     return;
-  
+
   Table<2, DoFTools::Coupling> mask_int;
   Table<2, DoFTools::Coupling> mask_ext;
   make_masks (dof_handler.get_fe().n_components(),
               mask_int, mask_ext);
-  
-                                   // create sparsity pattern
+
+  // create sparsity pattern
   const unsigned int n_components = dof_handler.get_fe().n_components();
   BlockCompressedSetSparsityPattern sp (n_components,
-                                     n_components);
+                                        n_components);
   std::vector<types::global_dof_index> dofs_per_component(n_components);
   DoFTools::count_dofs_per_component (dof_handler,
                                       dofs_per_component);
@@ -78,32 +78,32 @@ my_check_this (const DoFHandler<dim> &dof_handler)
       sp.block(i,j).reinit(dofs_per_component[i],
                            dofs_per_component[j]);
   sp.collect_sizes ();
-  
+
   DoFTools::make_flux_sparsity_pattern (dof_handler, sp,
                                         mask_int, mask_ext);
   sp.compress ();
-  
-                                   // write out 20 lines of this
-                                   // pattern (if we write out the
-                                   // whole pattern, the output file
-                                   // would be in the range of 40 MB)
+
+  // write out 20 lines of this
+  // pattern (if we write out the
+  // whole pattern, the output file
+  // would be in the range of 40 MB)
   for (unsigned int l=0; l<20; ++l)
     {
       const unsigned int line = l*(sp.n_rows()/20);
       std::pair<unsigned int,unsigned int>
-        block_row = sp.get_row_indices().global_to_local(line);
+      block_row = sp.get_row_indices().global_to_local(line);
       for (unsigned int col=0; col<n_components; ++col)
         {
-         for (CompressedSetSparsityPattern::row_iterator
-                c = sp.block(block_row.first,col).row_begin(block_row.second);
-              c!=sp.block(block_row.first,col).row_end(block_row.second); ++c)
+          for (CompressedSetSparsityPattern::row_iterator
+               c = sp.block(block_row.first,col).row_begin(block_row.second);
+               c!=sp.block(block_row.first,col).row_end(block_row.second); ++c)
             deallog << *c
                     << " ";
           deallog << std::endl;
         }
     }
 
-                                   // write out some other indicators
+  // write out some other indicators
   for (unsigned int r=0; r<n_components; ++r)
     for (unsigned int c=0; c<n_components; ++c)
       {
@@ -111,7 +111,7 @@ my_check_this (const DoFHandler<dim> &dof_handler)
         deallog << x.bandwidth () << std::endl
                 << x.max_entries_per_row () << std::endl
                 << x.n_nonzero_elements () << std::endl;
-        
+
         unsigned int hash = 0;
         for (unsigned int l=0; l<x.n_rows(); ++l)
           hash += l*x.row_length(l);
@@ -124,13 +124,13 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                  // since we can't forward declare
-                                  // check_this in this file (it is forward
-                                  // declared in dof_tools_common.h), we
-                                  // also can't make the driver file aware of
-                                  // the overload for 1d. to avoid linker
-                                  // errors, we can consequently not overload
-                                  // check_this, and need this forwarder
-                                  // function
+  // since we can't forward declare
+  // check_this in this file (it is forward
+  // declared in dof_tools_common.h), we
+  // also can't make the driver file aware of
+  // the overload for 1d. to avoid linker
+  // errors, we can consequently not overload
+  // check_this, and need this forwarder
+  // function
   my_check_this (dof_handler);
 }
index 279d486679d38ea1d180dca4a6ca56dfda6d64f0..b847205d46de64deb4c7b5285b148004db091107 100644 (file)
@@ -27,7 +27,7 @@
 // check
 //   DoFTools::
 //   make_hanging_node_constraints (const DoFHandler<dim> &,
-//                                 ConstraintMatrix      &);
+//                              ConstraintMatrix      &);
 //
 // As the results of dof_tools_03 seem unclear, this test aims
 // at verifying the constraints by projecting a constant function
@@ -46,19 +46,19 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // there's presently a crash in the
-                                   // Raviart-Thomas element. don't
-                                   // check this element for that
-                                   // reason. this case is covered in
-                                   // rt_crash_01, however
+  // there's presently a crash in the
+  // Raviart-Thomas element. don't
+  // check this element for that
+  // reason. this case is covered in
+  // rt_crash_01, however
   if (dof_handler.get_fe().get_name().find ("RaviartThomas") !=
       std::string::npos)
     return;
-  
-  ConstantFunction<dim> test_func (1, dof_handler.get_fe().n_components ()); 
 
-                                   // don't run this test if hanging
-                                   // nodes are not implemented
+  ConstantFunction<dim> test_func (1, dof_handler.get_fe().n_components ());
+
+  // don't run this test if hanging
+  // nodes are not implemented
   if (dof_handler.get_fe().constraints_are_implemented() == false)
     return;
 
@@ -74,8 +74,8 @@ check_this (const DoFHandler<dim> &dof_handler)
   Vector<double> solution (dof_handler.n_dofs ());
 
   VectorTools::project (dof_handler, cm,
-                       quadrature, test_func,
-                       solution);
+                        quadrature, test_func,
+                        solution);
   cm.distribute (solution);
 
   // Evaluate error
@@ -86,6 +86,6 @@ check_this (const DoFHandler<dim> &dof_handler)
   const double p_l2_error = cellwise_errors.l2_norm();
 
   Assert (p_l2_error < 1e-11, ExcInternalError());
-  
+
   deallog << "L2_Error : " << p_l2_error << std::endl;
 }
index 02986e0a3fb54407440db0617f4e6ad3b7bc52ed..69864a8b862c7733cedd0d705fa15f1524e48db9 100644 (file)
@@ -33,34 +33,34 @@ check_this (const DoFHandler<dim> &dof_handler)
                                       true);
   std::vector<bool> boundary_dofs (dof_handler.n_dofs());
 
-                                   // first with all components
+  // first with all components
   {
     DoFTools::extract_dofs_with_support_on_boundary (dof_handler,
-                                     component_select,
-                                     boundary_dofs);
+                                                     component_select,
+                                                     boundary_dofs);
     output_bool_vector (boundary_dofs);
   }
 
-                                   // next with only every second
-                                   // component
+  // next with only every second
+  // component
   for (unsigned int i=1; i<component_select.size(); i+=2)
     component_select[i] = false;
   {
     DoFTools::extract_dofs_with_support_on_boundary (dof_handler,
-                                     component_select,
-                                     boundary_dofs);
+                                                     component_select,
+                                                     boundary_dofs);
     output_bool_vector (boundary_dofs);
   }
 
-                                   // third further restrict to
-                                   // boundary indicator 0
+  // third further restrict to
+  // boundary indicator 0
   {
     std::set<types::boundary_id> boundary_ids;
     boundary_ids.insert (0);
     DoFTools::extract_dofs_with_support_on_boundary (dof_handler,
-                                     component_select,
-                                     boundary_dofs,
-                                     boundary_ids);
+                                                     component_select,
+                                                     boundary_dofs,
+                                                     boundary_ids);
     output_bool_vector (boundary_dofs);
   }
 }
index ec3f620c68f843ff84d4edd073418236aba0b20d..6771c3ce603ae2ba92890f3d0bb506929519fc46 100644 (file)
@@ -58,127 +58,135 @@ using namespace dealii;
 /* The 2D case */
 void generate_grid(Triangulation<2> &triangulation, int orientation)
 {
-    Point<2> vertices_1[]
-      = {
-           Point<2> (-1.,-3.),
-           Point<2> (+1.,-3.),
-           Point<2> (-1.,-1.),
-           Point<2> (+1.,-1.),
-           Point<2> (-1.,+1.),
-           Point<2> (+1.,+1.),
-           Point<2> (-1.,+3.),
-           Point<2> (+1.,+3.),
-        };
-    std::vector<Point<2> > vertices (&vertices_1[0], &vertices_1[8]);
-
-    std::vector<CellData<2> > cells (2, CellData<2>());
-
-    /* cell 0 */
-    int cell_vertices_0[GeometryInfo<2>::vertices_per_cell] = {0, 1,  2,  3};
-
-    /* cell 1 */
-    int cell_vertices_1[2][GeometryInfo<2>::vertices_per_cell]
-      = {
-        {4,5,6,7},
-        {7,6,5,4},
-      };
-
-    for (unsigned int j=0;j<GeometryInfo<2>::vertices_per_cell;++j) {
+  Point<2> vertices_1[]
+  =
+  {
+    Point<2> (-1.,-3.),
+    Point<2> (+1.,-3.),
+    Point<2> (-1.,-1.),
+    Point<2> (+1.,-1.),
+    Point<2> (-1.,+1.),
+    Point<2> (+1.,+1.),
+    Point<2> (-1.,+3.),
+    Point<2> (+1.,+3.),
+  };
+  std::vector<Point<2> > vertices (&vertices_1[0], &vertices_1[8]);
+
+  std::vector<CellData<2> > cells (2, CellData<2>());
+
+  /* cell 0 */
+  int cell_vertices_0[GeometryInfo<2>::vertices_per_cell] = {0, 1,  2,  3};
+
+  /* cell 1 */
+  int cell_vertices_1[2][GeometryInfo<2>::vertices_per_cell]
+  =
+  {
+    {4,5,6,7},
+    {7,6,5,4},
+  };
+
+  for (unsigned int j=0; j<GeometryInfo<2>::vertices_per_cell; ++j)
+    {
       cells[0].vertices[j] = cell_vertices_0[j];
       cells[1].vertices[j] = cell_vertices_1[orientation][j];
     }
-    cells[0].material_id = 0;
-    cells[1].material_id = 0;
+  cells[0].material_id = 0;
+  cells[1].material_id = 0;
 
-    triangulation.create_triangulation(vertices, cells, SubCellData());
+  triangulation.create_triangulation(vertices, cells, SubCellData());
 
-    Triangulation<2>::cell_iterator cell_1 = triangulation.begin();
-    Triangulation<2>::cell_iterator cell_2 = cell_1++;
-    Triangulation<2>::face_iterator face_1;
-    Triangulation<2>::face_iterator face_2;
+  Triangulation<2>::cell_iterator cell_1 = triangulation.begin();
+  Triangulation<2>::cell_iterator cell_2 = cell_1++;
+  Triangulation<2>::face_iterator face_1;
+  Triangulation<2>::face_iterator face_2;
 
-    // Look for the two outermost faces:
-    for (unsigned int j=0;j<GeometryInfo<2>::faces_per_cell;++j) {
+  // Look for the two outermost faces:
+  for (unsigned int j=0; j<GeometryInfo<2>::faces_per_cell; ++j)
+    {
       if (cell_1->face(j)->center()(1) > 2.9)
         face_1 = cell_1->face(j);
       if (cell_2->face(j)->center()(1) < -2.9)
         face_2 = cell_2->face(j);
     }
-    face_1->set_boundary_indicator(42);
-    face_2->set_boundary_indicator(43);
+  face_1->set_boundary_indicator(42);
+  face_2->set_boundary_indicator(43);
 
-    triangulation.refine_global(0);
+  triangulation.refine_global(0);
 }
 
 
 /* The 3D case */
 void generate_grid(Triangulation<3> &triangulation, int orientation)
 {
-    Point<3> vertices_1[]
-      = {
-           Point<3> (-1.,-1.,-3.),
-           Point<3> (+1.,-1.,-3.),
-           Point<3> (-1.,+1.,-3.),
-           Point<3> (+1.,+1.,-3.),
-           Point<3> (-1.,-1.,-1.),
-           Point<3> (+1.,-1.,-1.),
-           Point<3> (-1.,+1.,-1.),
-           Point<3> (+1.,+1.,-1.),
-           Point<3> (-1.,-1.,+1.),
-           Point<3> (+1.,-1.,+1.),
-           Point<3> (-1.,+1.,+1.),
-           Point<3> (+1.,+1.,+1.),
-           Point<3> (-1.,-1.,+3.),
-           Point<3> (+1.,-1.,+3.),
-           Point<3> (-1.,+1.,+3.),
-           Point<3> (+1.,+1.,+3.)
-        };
-    std::vector<Point<3> > vertices (&vertices_1[0], &vertices_1[16]);
-
-    std::vector<CellData<3> > cells (2, CellData<3>());
-
-    /* cell 0 */
-    int cell_vertices_0[GeometryInfo<3>::vertices_per_cell] = {0, 1,  2,  3,  4,  5,  6,  7};
-
-    /* cell 1 */
-    int cell_vertices_1[8][GeometryInfo<3>::vertices_per_cell]
-      = {
-        {8,9,10,11,12,13,14,15},
-        {9,11,8,10,13,15,12,14},
-        {11,10,9,8,15,14,13,12},
-        {10,8,11,9,14,12,15,13},
-        {13,12,15,14,9,8,11,10},
-        {12,14,13,15,8,10,9,11},
-        {14,15,12,13,10,11,8,9},
-        {15,13,14,12,11,9,10,8},
-      };
-
-    for (unsigned int j=0;j<GeometryInfo<3>::vertices_per_cell;++j) {
+  Point<3> vertices_1[]
+  =
+  {
+    Point<3> (-1.,-1.,-3.),
+    Point<3> (+1.,-1.,-3.),
+    Point<3> (-1.,+1.,-3.),
+    Point<3> (+1.,+1.,-3.),
+    Point<3> (-1.,-1.,-1.),
+    Point<3> (+1.,-1.,-1.),
+    Point<3> (-1.,+1.,-1.),
+    Point<3> (+1.,+1.,-1.),
+    Point<3> (-1.,-1.,+1.),
+    Point<3> (+1.,-1.,+1.),
+    Point<3> (-1.,+1.,+1.),
+    Point<3> (+1.,+1.,+1.),
+    Point<3> (-1.,-1.,+3.),
+    Point<3> (+1.,-1.,+3.),
+    Point<3> (-1.,+1.,+3.),
+    Point<3> (+1.,+1.,+3.)
+  };
+  std::vector<Point<3> > vertices (&vertices_1[0], &vertices_1[16]);
+
+  std::vector<CellData<3> > cells (2, CellData<3>());
+
+  /* cell 0 */
+  int cell_vertices_0[GeometryInfo<3>::vertices_per_cell] = {0, 1,  2,  3,  4,  5,  6,  7};
+
+  /* cell 1 */
+  int cell_vertices_1[8][GeometryInfo<3>::vertices_per_cell]
+  =
+  {
+    {8,9,10,11,12,13,14,15},
+    {9,11,8,10,13,15,12,14},
+    {11,10,9,8,15,14,13,12},
+    {10,8,11,9,14,12,15,13},
+    {13,12,15,14,9,8,11,10},
+    {12,14,13,15,8,10,9,11},
+    {14,15,12,13,10,11,8,9},
+    {15,13,14,12,11,9,10,8},
+  };
+
+  for (unsigned int j=0; j<GeometryInfo<3>::vertices_per_cell; ++j)
+    {
       cells[0].vertices[j] = cell_vertices_0[j];
       cells[1].vertices[j] = cell_vertices_1[orientation][j];
     }
-    cells[0].material_id = 0;
-    cells[1].material_id = 0;
+  cells[0].material_id = 0;
+  cells[1].material_id = 0;
 
 
-    triangulation.create_triangulation(vertices, cells, SubCellData());
+  triangulation.create_triangulation(vertices, cells, SubCellData());
 
-    Triangulation<3>::cell_iterator cell_1 = triangulation.begin();
-    Triangulation<3>::cell_iterator cell_2 = cell_1++;
-    Triangulation<3>::face_iterator face_1;
-    Triangulation<3>::face_iterator face_2;
+  Triangulation<3>::cell_iterator cell_1 = triangulation.begin();
+  Triangulation<3>::cell_iterator cell_2 = cell_1++;
+  Triangulation<3>::face_iterator face_1;
+  Triangulation<3>::face_iterator face_2;
 
-    // Look for the two outermost faces:
-    for (unsigned int j=0;j<GeometryInfo<3>::faces_per_cell;++j) {
+  // Look for the two outermost faces:
+  for (unsigned int j=0; j<GeometryInfo<3>::faces_per_cell; ++j)
+    {
       if (cell_1->face(j)->center()(2) > 2.9)
         face_1 = cell_1->face(j);
       if (cell_2->face(j)->center()(2) < -2.9)
         face_2 = cell_2->face(j);
     }
-    face_1->set_boundary_indicator(42);
-    face_2->set_boundary_indicator(43);
+  face_1->set_boundary_indicator(42);
+  face_2->set_boundary_indicator(43);
 
-    triangulation.refine_global(0);
+  triangulation.refine_global(0);
 }
 
 
@@ -203,21 +211,23 @@ void print_matching(DoFHandler<dim> &dof_handler, bool constrain_only_velocity =
   FEValuesExtractors::Scalar pressure(3);
 
   ComponentMask velocity_mask;
-  if(constrain_only_velocity)
+  if (constrain_only_velocity)
     velocity_mask = fe.component_mask (v);
 
   // Look for the two outermost faces:
   typename DoFHandler<dim>::face_iterator face_1;
   typename DoFHandler<dim>::face_iterator face_2;
   for (typename DoFHandler<dim>::cell_iterator cell = dof_handler.begin(0);
-       cell != dof_handler.end(0); ++cell) {
-    for (unsigned int j=0;j<GeometryInfo<dim>::faces_per_cell;++j) {
-      if (cell->face(j)->center()(dim==2 ? 1 : 2) > 2.9)
-        face_1 = cell->face(j);
-      if (cell->face(j)->center()(dim==2 ? 1 : 2) < -2.9)
-        face_2 = cell->face(j);
+       cell != dof_handler.end(0); ++cell)
+    {
+      for (unsigned int j=0; j<GeometryInfo<dim>::faces_per_cell; ++j)
+        {
+          if (cell->face(j)->center()(dim==2 ? 1 : 2) > 2.9)
+            face_1 = cell->face(j);
+          if (cell->face(j)->center()(dim==2 ? 1 : 2) < -2.9)
+            face_2 = cell->face(j);
+        }
     }
-  }
 
   // Determine the orientation of the two faces:
 
@@ -233,11 +243,11 @@ void print_matching(DoFHandler<dim> &dof_handler, bool constrain_only_velocity =
   for (unsigned int c = 0; c < fe.n_components(); c++)
     {
       deallog << std::endl << " component " << c << ":";
-      for(unsigned int i = 0; i < fe.dofs_per_face; ++i)
+      for (unsigned int i = 0; i < fe.dofs_per_face; ++i)
         {
-          if(fe.face_system_to_component_index(i).first == c)
+          if (fe.face_system_to_component_index(i).first == c)
             deallog << " (" << dofs_1[i] << " - "
-                      << support_points[dofs_1[i]] << ")";
+                    << support_points[dofs_1[i]] << ")";
         }
     }
   deallog << std::endl;
@@ -245,20 +255,20 @@ void print_matching(DoFHandler<dim> &dof_handler, bool constrain_only_velocity =
   for (unsigned int c = 0; c < fe.n_components(); c++)
     {
       deallog << std::endl << " component " << c << ":";
-      for(unsigned int i = 0; i < fe.dofs_per_face; ++i)
+      for (unsigned int i = 0; i < fe.dofs_per_face; ++i)
         {
-          if(fe.face_system_to_component_index(i).first == c)
+          if (fe.face_system_to_component_index(i).first == c)
             deallog << " (" << dofs_2[i] << " - "
-                      << support_points[dofs_2[i]] << ")";
+                    << support_points[dofs_2[i]] << ")";
         }
     }
   deallog << std::endl;
 
 
   std::bitset<3> orientation;
-  if(not GridTools::orthogonal_equality(orientation, face_1, face_2,
-                                        dim==2 ? 1 : 2,
-                                        dealii::Tensor<1,dim>()))
+  if (not GridTools::orthogonal_equality(orientation, face_1, face_2,
+                                         dim==2 ? 1 : 2,
+                                         dealii::Tensor<1,dim>()))
     std::cerr << " not match! oh noze!! " << std::endl;
   deallog << "Orientation: " << orientation[0] << orientation[1] << orientation[2] << std::endl;
 
@@ -285,84 +295,89 @@ int main()
 
   deallog << "Test for 2D, Q1:" << std::endl << std::endl;
 
-  for(int i = 0; i < 2; ++i) {
-    // Generate a triangulation and match:
-    Triangulation<2> triangulation;
-    FE_Q<2> fe(1);
-    DoFHandler<2> dof_handler;
+  for (int i = 0; i < 2; ++i)
+    {
+      // Generate a triangulation and match:
+      Triangulation<2> triangulation;
+      FE_Q<2> fe(1);
+      DoFHandler<2> dof_handler;
 
-    deallog << "Triangulation:" << i << std::endl;
+      deallog << "Triangulation:" << i << std::endl;
 
-    generate_grid(triangulation, i);
-    dof_handler.initialize(triangulation, fe);
-    print_matching(dof_handler);
-  }
+      generate_grid(triangulation, i);
+      dof_handler.initialize(triangulation, fe);
+      print_matching(dof_handler);
+    }
 
   deallog << "Test for 3D, Q1:" << std::endl << std::endl;
 
-  for(int i = 0; i < 8; ++i) {
-    // Generate a triangulation and match:
-    Triangulation<3> triangulation;
-    FE_Q<3> fe(1);
-    DoFHandler<3> dof_handler;
+  for (int i = 0; i < 8; ++i)
+    {
+      // Generate a triangulation and match:
+      Triangulation<3> triangulation;
+      FE_Q<3> fe(1);
+      DoFHandler<3> dof_handler;
 
-    deallog << "Triangulation:" << i << std::endl;
+      deallog << "Triangulation:" << i << std::endl;
 
-    generate_grid(triangulation, i);
-    dof_handler.initialize(triangulation, fe);
-    print_matching(dof_handler);
-  }
+      generate_grid(triangulation, i);
+      dof_handler.initialize(triangulation, fe);
+      print_matching(dof_handler);
+    }
 
 
   deallog << "Test for 3D, Q1, correct subface iteration:" << std::endl << std::endl;
 
-  for(int i = 0; i < 8; ++i) {
-    // Generate a triangulation and match:
-    Triangulation<3> triangulation;
-    FE_Q<3> fe(1);
-    DoFHandler<3> dof_handler;
+  for (int i = 0; i < 8; ++i)
+    {
+      // Generate a triangulation and match:
+      Triangulation<3> triangulation;
+      FE_Q<3> fe(1);
+      DoFHandler<3> dof_handler;
 
-    deallog << "Triangulation:" << i << std::endl;
+      deallog << "Triangulation:" << i << std::endl;
 
-    generate_grid(triangulation, i);
-    triangulation.refine_global(1);
-    dof_handler.initialize(triangulation, fe);
-    print_matching(dof_handler);
-  }
+      generate_grid(triangulation, i);
+      triangulation.refine_global(1);
+      dof_handler.initialize(triangulation, fe);
+      print_matching(dof_handler);
+    }
 
 
   deallog << "Test for 3D, Q4:" << std::endl << std::endl;
 
-  for(int i = 0; i < 8; ++i) {
-    // Generate a triangulation and match:
-    Triangulation<3> triangulation;
-    FE_Q<3> fe(4);
-    DoFHandler<3> dof_handler;
+  for (int i = 0; i < 8; ++i)
+    {
+      // Generate a triangulation and match:
+      Triangulation<3> triangulation;
+      FE_Q<3> fe(4);
+      DoFHandler<3> dof_handler;
 
-    deallog << "Triangulation:" << i << std::endl;
+      deallog << "Triangulation:" << i << std::endl;
 
-    generate_grid(triangulation, i);
-    dof_handler.initialize(triangulation, fe);
-    print_matching(dof_handler);
-  }
+      generate_grid(triangulation, i);
+      dof_handler.initialize(triangulation, fe);
+      print_matching(dof_handler);
+    }
 
   deallog << "Test for 3D, Taylor-Hood with Component-Mask on v:" << std::endl << std::endl;
 
-  for(int i = 0; i < 8; ++i) {
-    // Generate a triangulation and match:
-    Triangulation<3> triangulation;
-    FE_Q<3> u(2);
-    FE_Q<3> p(1);
-    FESystem<3> taylor_hood(u, 3, p, 1);
+  for (int i = 0; i < 8; ++i)
+    {
+      // Generate a triangulation and match:
+      Triangulation<3> triangulation;
+      FE_Q<3> u(2);
+      FE_Q<3> p(1);
+      FESystem<3> taylor_hood(u, 3, p, 1);
 
-    DoFHandler<3> dof_handler;
+      DoFHandler<3> dof_handler;
 
-    deallog << "Triangulation:" << i << std::endl;
+      deallog << "Triangulation:" << i << std::endl;
 
-    generate_grid(triangulation, i);
-    dof_handler.initialize(triangulation, taylor_hood);
-    print_matching(dof_handler, true);
-  }
+      generate_grid(triangulation, i);
+      dof_handler.initialize(triangulation, taylor_hood);
+      print_matching(dof_handler, true);
+    }
 
   return 0;
 }
index c4c85bf89025eb73488a8643b115572828c15199..6aa3a654c438f0780d812b0b3152e3538fa57b07 100644 (file)
@@ -1,6 +1,6 @@
 //----------------------------  dof_tools_common.h  ---------------------------
 //    $Id$
-//    Version: $Name$ 
+//    Version: $Name$
 //
 //    Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010 by the deal.II authors
 //
@@ -48,7 +48,7 @@ extern std::string output_file_name;
 void
 output_bool_vector (std::vector<bool> &v)
 {
-for (unsigned int i=0; i<v.size(); ++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << (v[i] ? '1' : '0');
   deallog << std::endl;
 }
@@ -58,7 +58,7 @@ for (unsigned int i=0; i<v.size(); ++i)
 template <int dim>
 void
 set_boundary_ids (Triangulation<dim> &tria)
-{  
+{
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     tria.begin_active()->face(f)->set_boundary_indicator (f);
 }
@@ -67,7 +67,7 @@ set_boundary_ids (Triangulation<dim> &tria)
 void
 set_boundary_ids (Triangulation<1> &)
 {}
-  
+
 
 
 template <int dim>
@@ -78,10 +78,10 @@ check (const FiniteElement<dim> &fe,
   deallog << "Checking " << name
           << " in " << dim << "d:"
           << std::endl;
-  
-                                   // create tria and dofhandler
-                                   // objects. set different boundary
-                                   // and sub-domain ids
+
+  // create tria and dofhandler
+  // objects. set different boundary
+  // and sub-domain ids
   Triangulation<dim> tria;
   GridGenerator::hyper_cube(tria, 0., 1.);
   set_boundary_ids (tria);
@@ -92,13 +92,13 @@ check (const FiniteElement<dim> &fe,
       tria.execute_coarsening_and_refinement ();
     }
   for (typename Triangulation<dim>::active_cell_iterator
-         cell=tria.begin_active();
+       cell=tria.begin_active();
        cell!=tria.end(); ++cell)
     cell->set_subdomain_id (cell->level());
   DoFHandler<dim> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
 
-                                   // call main function in .cc files
+  // call main function in .cc files
   check_this (dof_handler);
 }
 
@@ -107,27 +107,27 @@ check (const FiniteElement<dim> &fe,
 
 
 #define CHECK(EL,deg,dim)\
- { FE_ ## EL<dim> EL(deg);   \
-   check(EL, #EL #deg); }
 { FE_ ## EL<dim> EL(deg);   \
+    check(EL, #EL #deg); }
 
 #define CHECK_SYS1(sub1,N1,dim) \
- { FESystem<dim> q(sub1, N1);   \
-   check(q, #sub1 #N1); }
 { FESystem<dim> q(sub1, N1);   \
+    check(q, #sub1 #N1); }
 
 #define CHECK_SYS2(sub1,N1,sub2,N2,dim) \
- { FESystem<dim> q(sub1, N1, sub2, N2); \
-   check(q, #sub1 #N1 #sub2 #N2); }
 { FESystem<dim> q(sub1, N1, sub2, N2); \
+    check(q, #sub1 #N1 #sub2 #N2); }
 
 #define CHECK_SYS3(sub1,N1,sub2,N2,sub3,N3,dim)   \
- { FESystem<dim> q(sub1, N1, sub2, N2, sub3, N3); \
-   check(q, #sub1 #N1 #sub2 #N2 #sub3 #N3); }
 { FESystem<dim> q(sub1, N1, sub2, N2, sub3, N3); \
+    check(q, #sub1 #N1 #sub2 #N2 #sub3 #N3); }
 
 
 #define CHECK_ALL(EL,deg)\
- { CHECK(EL,deg,1); \
-   CHECK(EL,deg,2); \
-   CHECK(EL,deg,3); \
- }
 { CHECK(EL,deg,1); \
+    CHECK(EL,deg,2); \
+    CHECK(EL,deg,3); \
 }
 
 
 int
@@ -140,7 +140,7 @@ main()
       deallog << std::setprecision (2);
       deallog.attach(logfile);
       deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);
+      deallog.threshold_double(1.e-10);
 
       CHECK_ALL(Q,1);
       CHECK_ALL(Q,2);
@@ -167,7 +167,7 @@ main()
       CHECK(RaviartThomasNodal, 0, 3);
       CHECK(RaviartThomasNodal, 1, 3);
       CHECK(RaviartThomasNodal, 2, 3);
-      
+
       CHECK_SYS1(FE_Q<1>(1),  3,1);
       CHECK_SYS1(FE_DGQ<1>(2),2,1);
       CHECK_SYS1(FE_DGP<1>(3),1,1);
@@ -199,7 +199,7 @@ main()
 
       CHECK_SYS3(FE_DGQ<3>(1),  3,FE_DGP<3>(3),1,FE_Q<3>(1),3,3);
 
-                                       // systems of systems  
+      // systems of systems
       CHECK_SYS3((FESystem<2>(FE_Q<2>(1),3)), 3,
                  FE_DGQ<2>(0), 1,
                  FE_Q<2>(1), 3,
@@ -210,7 +210,7 @@ main()
                              FE_DGQ<2>(0),1),2,
                  2);
 
-                                       // systems with Nedelec elements
+      // systems with Nedelec elements
       CHECK_SYS2 (FE_DGQ<2>(3), 1,
                   FE_Nedelec<2>(0), 2,
                   2);
@@ -219,30 +219,30 @@ main()
                  FESystem<2>(FE_Q<2>(2),1,
                              FE_Nedelec<2>(0),2),2,
                  2);
-  
+
       return 0;
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index db2eb4c153a64006dddf5c85bb7d98cb6e089e6d..df93d1dc0a034250016ee5d31106866686734c4e 100644 (file)
@@ -50,7 +50,7 @@ extern std::string output_file_name;
 void
 output_bool_vector (std::vector<bool> &v)
 {
-for (unsigned int i=0; i<v.size(); ++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << (v[i] ? '1' : '0');
   deallog << std::endl;
 }
@@ -72,13 +72,13 @@ check (const FiniteElement<dim> &fe,
           << " in " << dim << "d:"
           << std::endl;
 
-                                   // create tria and dofhandler
-                                   // objects. set different boundary
-                                   // and sub-domain ids
+  // create tria and dofhandler
+  // objects. set different boundary
+  // and sub-domain ids
   Triangulation<dim> tria;
   GridGenerator::hyper_cube(tria, -2., 2.);
   tria.refine_global (1);
-                                   // refine the first two cells:
+  // refine the first two cells:
   for (int i=0; i<2; ++i)
     {
       tria.begin_active()->set_refine_flag();
@@ -86,13 +86,13 @@ check (const FiniteElement<dim> &fe,
     }
   tria.refine_global (1);
   for (typename Triangulation<dim>::active_cell_iterator
-         cell=tria.begin_active();
+       cell=tria.begin_active();
        cell!=tria.end(); ++cell)
     cell->set_subdomain_id (cell->level());
   DoFHandler<dim> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
 
-                                   // call main function in .cc files
+  // call main function in .cc files
   check_this (dof_handler);
 }
 
@@ -101,27 +101,27 @@ check (const FiniteElement<dim> &fe,
 
 
 #define CHECK(EL,deg,dim)\
- { FE_ ## EL<dim> EL(deg);   \
-   check(EL, #EL #deg); }
 { FE_ ## EL<dim> EL(deg);   \
+    check(EL, #EL #deg); }
 
 #define CHECK_SYS1(sub1,N1,dim) \
- { FESystem<dim> q(sub1, N1);   \
-   check(q, #sub1 #N1); }
 { FESystem<dim> q(sub1, N1);   \
+    check(q, #sub1 #N1); }
 
 #define CHECK_SYS2(sub1,N1,sub2,N2,dim) \
- { FESystem<dim> q(sub1, N1, sub2, N2); \
-   check(q, #sub1 #N1 #sub2 #N2); }
 { FESystem<dim> q(sub1, N1, sub2, N2); \
+    check(q, #sub1 #N1 #sub2 #N2); }
 
 #define CHECK_SYS3(sub1,N1,sub2,N2,sub3,N3,dim)   \
- { FESystem<dim> q(sub1, N1, sub2, N2, sub3, N3); \
-   check(q, #sub1 #N1 #sub2 #N2 #sub3 #N3); }
 { FESystem<dim> q(sub1, N1, sub2, N2, sub3, N3); \
+    check(q, #sub1 #N1 #sub2 #N2 #sub3 #N3); }
 
 
 #define CHECK_ALL(EL,deg)\
- { /*CHECK(EL,deg,1);*/ \
-   CHECK(EL,deg,2); \
-   CHECK(EL,deg,3); \
- }
 { /*CHECK(EL,deg,1);*/ \
+    CHECK(EL,deg,2); \
+    CHECK(EL,deg,3); \
 }
 
 
 int
@@ -134,7 +134,7 @@ main()
       deallog << std::setprecision (2);
       deallog.attach(logfile);
       deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);
+      deallog.threshold_double(1.e-10);
 
       CHECK_ALL(Q,1);
       CHECK_ALL(Q,2);
@@ -193,7 +193,7 @@ main()
 
       CHECK_SYS3(FE_DGQ<3>(1),  3,FE_DGP<3>(3),1,FE_Q<3>(1),3,3);
 
-                                       // systems of systems
+      // systems of systems
       CHECK_SYS3((FESystem<2>(FE_Q<2>(1),3)), 3,
                  FE_DGQ<2>(0), 1,
                  FE_Q<2>(1), 3,
@@ -204,7 +204,7 @@ main()
                              FE_DGQ<2>(0),1),2,
                  2);
 
-                                       // systems with Nedelec elements
+      // systems with Nedelec elements
       CHECK_SYS2 (FE_DGQ<2>(3), 1,
                   FE_Nedelec<2>(0), 2,
                   2);
@@ -219,24 +219,24 @@ main()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index db9468be1a7593bdb523f31751b998458c7f0967..c430c711e17a281b4008e27c6e21dbddd9af167b 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim>(2) {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square(); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { values(0) = value(p,0);
-       values(1) = value(p,1); }
+public:
+  MySquareFunction () : Function<dim>(2) {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square();
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+    values(1) = value(p,1);
+  }
 };
 
 
 
 template <int dim>
 Quadrature<dim-1> &
-get_q_face (Function<dim>&)
+get_q_face (Function<dim> &)
 {
   static QGauss<dim-1> q(4);
   return q;
@@ -66,7 +70,7 @@ get_q_face (Function<dim>&)
 
 
 Quadrature<0> &
-get_q_face (Function<1>&)
+get_q_face (Function<1> &)
 {
   Quadrature<0> *q = 0;
   return *q;
@@ -77,38 +81,38 @@ get_q_face (Function<1>&)
 template <int dim>
 void make_mesh (Triangulation<dim> &tria)
 {
-  
+
   GridGenerator::hyper_cube(tria, -1, 1);
 
-                                   // refine the mesh in a random way so as to
-                                   // generate as many cells with
-                                   // hanging nodes as possible
+  // refine the mesh in a random way so as to
+  // generate as many cells with
+  // hanging nodes as possible
   tria.refine_global (4-dim);
   const double steps[4] = { /*d=0*/ 0, 7, 3, 3 };
   for (unsigned int i=0; i<steps[dim]; ++i)
     {
       typename Triangulation<dim>::active_cell_iterator
-        cell = tria.begin_active();
+      cell = tria.begin_active();
       for (unsigned int index=0; cell != tria.end(); ++cell, ++index)
         if (index % (3*dim) == 0)
           cell->set_refine_flag();
       tria.execute_coarsening_and_refinement ();
     }
 
-                                  // we now have a number of cells,
-                                  // flag them with some subdomain
-                                  // ids based on their position, in
-                                  // particular we take the quadrant
-                                  // (octant)
+  // we now have a number of cells,
+  // flag them with some subdomain
+  // ids based on their position, in
+  // particular we take the quadrant
+  // (octant)
   typename Triangulation<dim>::active_cell_iterator
-    cell = tria.begin_active (),
-    endc = tria.end ();
+  cell = tria.begin_active (),
+  endc = tria.end ();
   for (; cell!=endc; ++cell)
     {
       unsigned int subdomain = 0;
       for (unsigned int d=0; d<dim; ++d)
-       if (cell->center()(d) > 0)
-         subdomain |= (1<<d);
+        if (cell->center()(d) > 0)
+          subdomain |= (1<<d);
       Assert (subdomain < (1<<dim), ExcInternalError());
 
       cell->set_subdomain_id (subdomain);
@@ -123,10 +127,10 @@ void
 check ()
 {
   Functions::CosineFunction<dim> function;
-  
+
   Triangulation<dim> tria;
   make_mesh (tria);
-  
+
   FE_Q<dim> element(3);
   DoFHandler<dim> dof(tria);
   dof.distribute_dofs(element);
@@ -136,33 +140,33 @@ check ()
 
   std::map<types::boundary_id,const Function<dim>*> neumann_bc;
   neumann_bc[0] = &function;
-  
+
   Vector<double> v (dof.n_dofs());
   VectorTools::interpolate (mapping, dof, function, v);
 
   Vector<float> error1 (tria.n_active_cells());
   Vector<float> error2 (tria.n_active_cells());
 
-                                   // compute error by looking at all cells at
-                                   // once and output this as the base line
-                                   // results. scale results so that they show
-                                   // up in the output file as a reasonable
-                                   // number
+  // compute error by looking at all cells at
+  // once and output this as the base line
+  // results. scale results so that they show
+  // up in the output file as a reasonable
+  // number
   KellyErrorEstimator<dim>::estimate (mapping, dof, q_face, neumann_bc,
                                       v, error1);
   const double scaling_factor = 10000.*error1.size()/error1.l1_norm();
   error1 *= scaling_factor;
-    
+
   deallog << "Estimated error indicators:" << std::endl;
   for (unsigned int i=0; i<error1.size(); ++i)
     deallog << error1(i) << std::endl;
 
-                                   // then do the same with different
-                                   // subdomain ids and add up the result
+  // then do the same with different
+  // subdomain ids and add up the result
   for (unsigned int subdomain=0; subdomain<(1<<dim); ++subdomain)
     {
       deallog << "Subdomain id=" << subdomain << std::endl;
-        
+
       Vector<float> this_error (tria.n_active_cells());
       KellyErrorEstimator<dim>::estimate (mapping, dof, q_face, neumann_bc,
                                           v, this_error,
@@ -171,18 +175,18 @@ check ()
                                           subdomain);
       this_error *= scaling_factor;
 
-                                       // copy the result into error2. since
-                                       // every invokation of the kelly
-                                       // estimator should only operate on
-                                       // the cells of one subdomain,
-                                       // whenever there is something in
-                                       // this_error, the corresponding
-                                       // entry in error2 should still be
-                                       // empty
+      // copy the result into error2. since
+      // every invokation of the kelly
+      // estimator should only operate on
+      // the cells of one subdomain,
+      // whenever there is something in
+      // this_error, the corresponding
+      // entry in error2 should still be
+      // empty
       for (unsigned int i=0; i<this_error.size(); ++i)
         {
           deallog << i << ' ' << this_error(i) << std::endl;
-            
+
           Assert ((this_error(i)==0) || (error2(i)==0),
                   ExcInternalError());
           if (this_error(i) != 0)
@@ -190,8 +194,8 @@ check ()
         }
     }
 
-                                   // now compare the results of the two
-                                   // computations
+  // now compare the results of the two
+  // computations
   Assert (error1 == error2, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -202,7 +206,7 @@ int main ()
 {
   std::ofstream logfile ("error_estimator_01/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index a2fa1382c4d31e7a0f0fa1f4f987954f68dca6b0..62503e79f1c68c2a0a85110f97381962228ea298 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim>(2) {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square(); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { values(0) = value(p,0);
-       values(1) = value(p,1); }
+public:
+  MySquareFunction () : Function<dim>(2) {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square();
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+    values(1) = value(p,1);
+  }
 };
 
 
 
 template <int dim>
 Quadrature<dim-1> &
-get_q_face (Function<dim>&)
+get_q_face (Function<dim> &)
 {
   static QGauss<dim-1> q(4);
   return q;
@@ -66,7 +70,7 @@ get_q_face (Function<dim>&)
 
 
 Quadrature<0> &
-get_q_face (Function<1>&)
+get_q_face (Function<1> &)
 {
   Quadrature<0> *q = 0;
   return *q;
@@ -77,38 +81,38 @@ get_q_face (Function<1>&)
 template <int dim>
 void make_mesh (Triangulation<dim> &tria)
 {
-  
+
   GridGenerator::hyper_cube(tria, -1, 1);
 
-                                   // refine the mesh in a random way so as to
-                                   // generate as many cells with
-                                   // hanging nodes as possible
+  // refine the mesh in a random way so as to
+  // generate as many cells with
+  // hanging nodes as possible
   tria.refine_global (4-dim);
   const double steps[4] = { /*d=0*/ 0, 7, 3, 3 };
   for (unsigned int i=0; i<steps[dim]; ++i)
     {
       typename Triangulation<dim>::active_cell_iterator
-        cell = tria.begin_active();
+      cell = tria.begin_active();
       for (unsigned int index=0; cell != tria.end(); ++cell, ++index)
         if (index % (3*dim) == 0)
           cell->set_refine_flag();
       tria.execute_coarsening_and_refinement ();
     }
 
-                                  // we now have a number of cells,
-                                  // flag them with some material
-                                  // ids based on their position, in
-                                  // particular we take the quadrant
-                                  // (octant)
+  // we now have a number of cells,
+  // flag them with some material
+  // ids based on their position, in
+  // particular we take the quadrant
+  // (octant)
   typename Triangulation<dim>::active_cell_iterator
-    cell = tria.begin_active (),
-    endc = tria.end ();
+  cell = tria.begin_active (),
+  endc = tria.end ();
   for (; cell!=endc; ++cell)
     {
       unsigned int material = 0;
       for (unsigned int d=0; d<dim; ++d)
-       if (cell->center()(d) > 0)
-         material |= (1<<d);
+        if (cell->center()(d) > 0)
+          material |= (1<<d);
       Assert (material < (1<<dim), ExcInternalError());
 
       cell->set_material_id (material);
@@ -123,10 +127,10 @@ void
 check ()
 {
   Functions::CosineFunction<dim> function;
-  
+
   Triangulation<dim> tria;
   make_mesh (tria);
-  
+
   FE_Q<dim> element(3);
   DoFHandler<dim> dof(tria);
   dof.distribute_dofs(element);
@@ -136,33 +140,33 @@ check ()
 
   std::map<types::boundary_id,const Function<dim>*> neumann_bc;
   neumann_bc[0] = &function;
-  
+
   Vector<double> v (dof.n_dofs());
   VectorTools::interpolate (mapping, dof, function, v);
 
   Vector<float> error1 (tria.n_active_cells());
   Vector<float> error2 (tria.n_active_cells());
 
-                                   // compute error by looking at all cells at
-                                   // once and output this as the base line
-                                   // results. scale results so that they show
-                                   // up in the output file as a reasonable
-                                   // number
+  // compute error by looking at all cells at
+  // once and output this as the base line
+  // results. scale results so that they show
+  // up in the output file as a reasonable
+  // number
   KellyErrorEstimator<dim>::estimate (mapping, dof, q_face, neumann_bc,
                                       v, error1);
   const double scaling_factor = 10000.*error1.size()/error1.l1_norm();
   error1 *= scaling_factor;
-    
+
   deallog << "Estimated error indicators:" << std::endl;
   for (unsigned int i=0; i<error1.size(); ++i)
     deallog << error1(i) << std::endl;
 
-                                   // then do the same with different
-                                   // material ids and add up the result
+  // then do the same with different
+  // material ids and add up the result
   for (unsigned int material=0; material<(1<<dim); ++material)
     {
       deallog << "Material id=" << material << std::endl;
-        
+
       Vector<float> this_error (tria.n_active_cells());
       KellyErrorEstimator<dim>::estimate (mapping, dof, q_face, neumann_bc,
                                           v, this_error,
@@ -172,18 +176,18 @@ check ()
                                           material);
       this_error *= scaling_factor;
 
-                                       // copy the result into error2. since
-                                       // every invokation of the kelly
-                                       // estimator should only operate on
-                                       // the cells of one material,
-                                       // whenever there is something in
-                                       // this_error, the corresponding
-                                       // entry in error2 should still be
-                                       // empty
+      // copy the result into error2. since
+      // every invokation of the kelly
+      // estimator should only operate on
+      // the cells of one material,
+      // whenever there is something in
+      // this_error, the corresponding
+      // entry in error2 should still be
+      // empty
       for (unsigned int i=0; i<this_error.size(); ++i)
         {
           deallog << i << ' ' << this_error(i) << std::endl;
-            
+
           Assert ((this_error(i)==0) || (error2(i)==0),
                   ExcInternalError());
           if (this_error(i) != 0)
@@ -191,8 +195,8 @@ check ()
         }
     }
 
-                                   // now compare the results of the two
-                                   // computations
+  // now compare the results of the two
+  // computations
   Assert (error1 == error2, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -203,7 +207,7 @@ int main ()
 {
   std::ofstream logfile ("error_estimator_02/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index e9b0cdc87a2d2c5dfccc72f1f621d665bd413c2d..ed3a85d3a7e9262823610d5b6a9af2301e7dad20 100644 (file)
@@ -34,19 +34,19 @@ check_this (const FiniteElement<dim> &fe1,
   if (dim == 1)
     return;
 
-                                  // check all combinations of fe1 and fe2
+  // check all combinations of fe1 and fe2
   FullMatrix<double> face_constraints;
   try
     {
       face_constraints.reinit (fe1.dofs_per_face,
-                              fe1.dofs_per_face);
+                               fe1.dofs_per_face);
       fe1.get_face_interpolation_matrix (fe1, face_constraints);
 
       deallog << fe1.get_name()
-             << "  vs.  "
-             << fe1.get_name()
-             << std::endl;
-      output_matrix (face_constraints);      
+              << "  vs.  "
+              << fe1.get_name()
+              << std::endl;
+      output_matrix (face_constraints);
     }
   catch (...)
     {
@@ -55,14 +55,14 @@ check_this (const FiniteElement<dim> &fe1,
   try
     {
       face_constraints.reinit (fe2.dofs_per_face,
-                              fe2.dofs_per_face);
+                               fe2.dofs_per_face);
       fe2.get_face_interpolation_matrix (fe2, face_constraints);
 
       deallog << fe2.get_name()
-             << "  vs.  "
-             << fe2.get_name()
-             << std::endl;
-      output_matrix (face_constraints);      
+              << "  vs.  "
+              << fe2.get_name()
+              << std::endl;
+      output_matrix (face_constraints);
     }
   catch (...)
     {
@@ -71,15 +71,15 @@ check_this (const FiniteElement<dim> &fe1,
   if (fe1.dofs_per_face <= fe2.dofs_per_face)
     try
       {
-       face_constraints.reinit (fe2.dofs_per_face,
-                                fe1.dofs_per_face);
-       fe1.get_face_interpolation_matrix (fe2, face_constraints);
-
-       deallog << fe1.get_name()
-               << "  vs.  "
-               << fe2.get_name()
-               << std::endl;
-       output_matrix (face_constraints);      
+        face_constraints.reinit (fe2.dofs_per_face,
+                                 fe1.dofs_per_face);
+        fe1.get_face_interpolation_matrix (fe2, face_constraints);
+
+        deallog << fe1.get_name()
+                << "  vs.  "
+                << fe2.get_name()
+                << std::endl;
+        output_matrix (face_constraints);
       }
     catch (...)
       {
@@ -88,15 +88,15 @@ check_this (const FiniteElement<dim> &fe1,
   if (fe2.dofs_per_face <= fe1.dofs_per_face)
     try
       {
-       face_constraints.reinit (fe1.dofs_per_face,
-                                fe2.dofs_per_face);
-       fe2.get_face_interpolation_matrix (fe1, face_constraints);
-
-       deallog << fe2.get_name()
-               << "  vs.  "
-               << fe1.get_name()
-               << std::endl;
-       output_matrix (face_constraints);      
+        face_constraints.reinit (fe1.dofs_per_face,
+                                 fe2.dofs_per_face);
+        fe2.get_face_interpolation_matrix (fe1, face_constraints);
+
+        deallog << fe2.get_name()
+                << "  vs.  "
+                << fe1.get_name()
+                << std::endl;
+        output_matrix (face_constraints);
       }
     catch (...)
       {
index 375eb0c3d14207f56ecbebb65dfb21fc0df73d1a..7fd5c71cf09bcee30c3fa10fd270383aa6ea7b03 100644 (file)
@@ -63,58 +63,58 @@ void test ();
 template <int dim>
 class F :  public Function<dim>
 {
-  public:
-    F (const unsigned int q,
-       const unsigned int n_components)
-                   :
-                   Function<dim>(n_components),
-                   q(q)
-      {}
-    
-    virtual double value (const Point<dim> &p,
-                         const unsigned int component) const
+public:
+  F (const unsigned int q,
+     const unsigned int n_components)
+    :
+    Function<dim>(n_components),
+    q(q)
+  {}
+
+  virtual double value (const Point<dim> &p,
+                        const unsigned int component) const
+  {
+    Assert ((component == 0) && (this->n_components == 1),
+            ExcInternalError());
+    double val = 0;
+    for (unsigned int d=0; d<dim; ++d)
+      for (unsigned int i=0; i<=q; ++i)
+        val += (d+1)*(i+1)*std::pow (p[d], 1.*i);
+    return val;
+  }
+
+
+  virtual void vector_value (const Point<dim> &p,
+                             Vector<double>   &v) const
+  {
+    for (unsigned int c=0; c<v.size(); ++c)
       {
-       Assert ((component == 0) && (this->n_components == 1),
-               ExcInternalError());
-       double val = 0;
-       for (unsigned int d=0; d<dim; ++d)
-         for (unsigned int i=0; i<=q; ++i)
-           val += (d+1)*(i+1)*std::pow (p[d], 1.*i);
-       return val;
+        v(c) = 0;
+        for (unsigned int d=0; d<dim; ++d)
+          for (unsigned int i=0; i<=q; ++i)
+            v(c) += (d+1)*(i+1)*std::pow (p[d], 1.*i)+c;
       }
+  }
 
-
-    virtual void vector_value (const Point<dim> &p,
-                              Vector<double>   &v) const
-      {
-       for (unsigned int c=0; c<v.size(); ++c)
-         {
-           v(c) = 0;
-           for (unsigned int d=0; d<dim; ++d)
-             for (unsigned int i=0; i<=q; ++i)
-               v(c) += (d+1)*(i+1)*std::pow (p[d], 1.*i)+c;
-         }
-      }
-    
-  private:
-    const unsigned int q;
+private:
+  const unsigned int q;
 };
 
 
 
 DeclException1 (ExcFailedProjection,
-               double,
-               << "The projection was supposed to exactly represent the "
-               << "original function, but the relative residual is "
-               << arg1);
+                double,
+                << "The projection was supposed to exactly represent the "
+                << "original function, but the relative residual is "
+                << arg1);
 
 
 template <int dim>
 void do_project (const Triangulation<dim> &triangulation,
-                const FiniteElement<dim> &fe,
-                const unsigned int        p,
-                const unsigned int        order_difference)
-{  
+                 const FiniteElement<dim> &fe,
+                 const unsigned int        p,
+                 const unsigned int        order_difference)
+{
   DoFHandler<dim>        dof_handler(triangulation);
   dof_handler.distribute_dofs (fe);
 
@@ -122,38 +122,38 @@ void do_project (const Triangulation<dim> &triangulation,
 
   ConstraintMatrix constraints;
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          constraints);
+                                           constraints);
   constraints.close ();
 
   Vector<double> projection (dof_handler.n_dofs());
   Vector<float>  error (triangulation.n_active_cells());
   for (unsigned int q=0; q<=p+2-order_difference; ++q)
     {
-                                      // project the function
+      // project the function
       VectorTools::project (dof_handler,
-                           constraints,
-                           QGauss<dim>(p+2),
-                           F<dim> (q, fe.n_components()),
-                           projection);
-                                      // just to make sure it doesn't get
-                                      // forgotten: handle hanging node
-                                      // constraints
+                            constraints,
+                            QGauss<dim>(p+2),
+                            F<dim> (q, fe.n_components()),
+                            projection);
+      // just to make sure it doesn't get
+      // forgotten: handle hanging node
+      // constraints
       constraints.distribute (projection);
-      
-                                      // then compute the interpolation error
+
+      // then compute the interpolation error
       VectorTools::integrate_difference (dof_handler,
-                                        projection,
-                                        F<dim> (q, fe.n_components()),
-                                        error,
-                                        QGauss<dim>(std::max(p,q)+1),
-                                        VectorTools::L2_norm);
+                                         projection,
+                                         F<dim> (q, fe.n_components()),
+                                         error,
+                                         QGauss<dim>(std::max(p,q)+1),
+                                         VectorTools::L2_norm);
       deallog << fe.get_name() << ", P_" << q
-             << ", rel. error=" << error.l2_norm() / projection.l2_norm()
-             << std::endl;
-         
+              << ", rel. error=" << error.l2_norm() / projection.l2_norm()
+              << std::endl;
+
       if (q<=p-order_difference)
-       Assert (error.l2_norm() <= 1e-10*projection.l2_norm(),
-               ExcFailedProjection(error.l2_norm() / projection.l2_norm()));
+        Assert (error.l2_norm() <= 1e-10*projection.l2_norm(),
+                ExcFailedProjection(error.l2_norm() / projection.l2_norm()));
     }
 }
 
@@ -171,22 +171,22 @@ void do_project (const Triangulation<dim> &triangulation,
 // having face_orientation==false
 template <int dim>
 void test_with_wrong_face_orientation (const FiniteElement<dim> &fe,
-                                      const unsigned int        p,
-                                      const unsigned int        order_difference = 0)
+                                       const unsigned int        p,
+                                       const unsigned int        order_difference = 0)
 {
   if (dim != 3)
     return;
-  
+
   for (unsigned int i=0; i<7; ++i)
     {
       Triangulation<dim>     triangulation;
       GridGenerator::hyper_ball (triangulation);
       typename Triangulation<dim>::active_cell_iterator
-       cell = triangulation.begin_active();
+      cell = triangulation.begin_active();
       std::advance (cell, i);
       cell->set_refine_flag ();
       triangulation.execute_coarsening_and_refinement ();
-  
+
       do_project (triangulation, fe, p, order_difference);
     }
 }
@@ -198,7 +198,7 @@ int main ()
 {
   std::ofstream logfile(logname);
   deallog << std::setprecision (3);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
index 7bade108906fc0cc1aed8f542aca2caf06b740ed..5d58bd9ba57ace10c31350ab772d03cfbb58ff48 100644 (file)
@@ -66,58 +66,58 @@ void test ();
 template <int dim>
 class F :  public Function<dim>
 {
-  public:
-    F (const unsigned int q,
-       const unsigned int n_components)
-                   :
-                   Function<dim>(n_components),
-                   q(q)
-      {}
-    
-    virtual double value (const Point<dim> &p,
-                         const unsigned int component) const
+public:
+  F (const unsigned int q,
+     const unsigned int n_components)
+    :
+    Function<dim>(n_components),
+    q(q)
+  {}
+
+  virtual double value (const Point<dim> &p,
+                        const unsigned int component) const
+  {
+    Assert ((component == 0) && (this->n_components == 1),
+            ExcInternalError());
+    double val = 0;
+    for (unsigned int d=0; d<dim; ++d)
+      for (unsigned int i=0; i<=q; ++i)
+        val += (d+1)*(i+1)*std::pow (p[d], 1.*i);
+    return val;
+  }
+
+
+  virtual void vector_value (const Point<dim> &p,
+                             Vector<double>   &v) const
+  {
+    for (unsigned int c=0; c<v.size(); ++c)
       {
-       Assert ((component == 0) && (this->n_components == 1),
-               ExcInternalError());
-       double val = 0;
-       for (unsigned int d=0; d<dim; ++d)
-         for (unsigned int i=0; i<=q; ++i)
-           val += (d+1)*(i+1)*std::pow (p[d], 1.*i);
-       return val;
+        v(c) = 0;
+        for (unsigned int d=0; d<dim; ++d)
+          for (unsigned int i=0; i<=q; ++i)
+            v(c) += (d+1)*(i+1)*std::pow (p[d], 1.*i)+c;
       }
+  }
 
-
-    virtual void vector_value (const Point<dim> &p,
-                              Vector<double>   &v) const
-      {
-       for (unsigned int c=0; c<v.size(); ++c)
-         {
-           v(c) = 0;
-           for (unsigned int d=0; d<dim; ++d)
-             for (unsigned int i=0; i<=q; ++i)
-               v(c) += (d+1)*(i+1)*std::pow (p[d], 1.*i)+c;
-         }
-      }
-    
-  private:
-    const unsigned int q;
+private:
+  const unsigned int q;
 };
 
 
 
 DeclException1 (ExcFailedProjection,
-               double,
-               << "The projection was supposed to exactly represent the "
-               << "original function, but the relative residual is "
-               << arg1);
+                double,
+                << "The projection was supposed to exactly represent the "
+                << "original function, but the relative residual is "
+                << arg1);
 
 
 template <int dim>
 void do_project (const Triangulation<dim> &triangulation,
-                const FiniteElement<dim> &fe,
-                const unsigned int        p,
-                const unsigned int        order_difference)
-{  
+                 const FiniteElement<dim> &fe,
+                 const unsigned int        p,
+                 const unsigned int        order_difference)
+{
   DoFHandler<dim>        dof_handler(triangulation);
   dof_handler.distribute_dofs (fe);
 
@@ -125,38 +125,38 @@ void do_project (const Triangulation<dim> &triangulation,
 
   ConstraintMatrix constraints;
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          constraints);
+                                           constraints);
   constraints.close ();
 
   Vector<double> projection (dof_handler.n_dofs());
   Vector<float>  error (triangulation.n_active_cells());
   for (unsigned int q=0; q<=p+2-order_difference; ++q)
     {
-                                      // project the function
+      // project the function
       VectorTools::project (dof_handler,
-                           constraints,
-                           QGauss<dim>(p+2),
-                           F<dim> (q, fe.n_components()),
-                           projection);
-                                      // just to make sure it doesn't get
-                                      // forgotten: handle hanging node
-                                      // constraints
+                            constraints,
+                            QGauss<dim>(p+2),
+                            F<dim> (q, fe.n_components()),
+                            projection);
+      // just to make sure it doesn't get
+      // forgotten: handle hanging node
+      // constraints
       constraints.distribute (projection);
-      
-                                      // then compute the interpolation error
+
+      // then compute the interpolation error
       VectorTools::integrate_difference (dof_handler,
-                                        projection,
-                                        F<dim> (q, fe.n_components()),
-                                        error,
-                                        QGauss<dim>(std::max(p,q)+1),
-                                        VectorTools::L2_norm);
+                                         projection,
+                                         F<dim> (q, fe.n_components()),
+                                         error,
+                                         QGauss<dim>(std::max(p,q)+1),
+                                         VectorTools::L2_norm);
       deallog << fe.get_name() << ", P_" << q
-             << ", rel. error=" << error.l2_norm() / projection.l2_norm()
-             << std::endl;
-         
+              << ", rel. error=" << error.l2_norm() / projection.l2_norm()
+              << std::endl;
+
       if (q<=p-order_difference)
-       Assert (error.l2_norm() <= 1e-10*projection.l2_norm(),
-               ExcFailedProjection(error.l2_norm() / projection.l2_norm()));
+        Assert (error.l2_norm() <= 1e-10*projection.l2_norm(),
+                ExcFailedProjection(error.l2_norm() / projection.l2_norm()));
     }
 }
 
@@ -174,22 +174,22 @@ void do_project (const Triangulation<dim> &triangulation,
 // having face_orientation==false
 template <int dim>
 void test_with_wrong_face_orientation (const FiniteElement<dim> &fe,
-                                      const unsigned int        p,
-                                      const unsigned int        order_difference = 0)
+                                       const unsigned int        p,
+                                       const unsigned int        order_difference = 0)
 {
   if (dim != 3)
     return;
-  
+
   for (unsigned int i=0; i<7; ++i)
     {
       Triangulation<dim>     triangulation;
       GridGenerator::hyper_ball (triangulation);
       typename Triangulation<dim>::active_cell_iterator
-       cell = triangulation.begin_active();
+      cell = triangulation.begin_active();
       std::advance (cell, i);
       cell->set_refine_flag ();
       triangulation.execute_coarsening_and_refinement ();
-  
+
       do_project (triangulation, fe, p, order_difference);
     }
 }
@@ -201,7 +201,7 @@ int main ()
 {
   std::ofstream logfile(logname);
   deallog << std::setprecision (3);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
index 1f9740a42877fc13afd0a2a894b80051150865f9..557cbfe7b2a7fa34afcbbfeffbb5b5e0f42f0090 100644 (file)
@@ -54,58 +54,58 @@ void test ();
 template <int dim>
 class F :  public Function<dim>
 {
-  public:
-    F (const unsigned int q,
-       const unsigned int n_components)
-                   :
-                   Function<dim>(n_components),
-                   q(q)
-      {}
-    
-    virtual double value (const Point<dim> &p,
-                         const unsigned int component) const
+public:
+  F (const unsigned int q,
+     const unsigned int n_components)
+    :
+    Function<dim>(n_components),
+    q(q)
+  {}
+
+  virtual double value (const Point<dim> &p,
+                        const unsigned int component) const
+  {
+    Assert ((component == 0) && (this->n_components == 1),
+            ExcInternalError());
+    double val = 0;
+    for (unsigned int d=0; d<dim; ++d)
+      for (unsigned int i=0; i<=q; ++i)
+        val += (d+1)*(i+1)*std::pow (p[d], 1.*i);
+    return val;
+  }
+
+
+  virtual void vector_value (const Point<dim> &p,
+                             Vector<double>   &v) const
+  {
+    for (unsigned int c=0; c<v.size(); ++c)
       {
-       Assert ((component == 0) && (this->n_components == 1),
-               ExcInternalError());
-       double val = 0;
-       for (unsigned int d=0; d<dim; ++d)
-         for (unsigned int i=0; i<=q; ++i)
-           val += (d+1)*(i+1)*std::pow (p[d], 1.*i);
-       return val;
+        v(c) = 0;
+        for (unsigned int d=0; d<dim; ++d)
+          for (unsigned int i=0; i<=q; ++i)
+            v(c) += (d+1)*(i+1)*std::pow (p[d], 1.*i)+c;
       }
+  }
 
-
-    virtual void vector_value (const Point<dim> &p,
-                              Vector<double>   &v) const
-      {
-       for (unsigned int c=0; c<v.size(); ++c)
-         {
-           v(c) = 0;
-           for (unsigned int d=0; d<dim; ++d)
-             for (unsigned int i=0; i<=q; ++i)
-               v(c) += (d+1)*(i+1)*std::pow (p[d], 1.*i)+c;
-         }
-      }
-    
-  private:
-    const unsigned int q;
+private:
+  const unsigned int q;
 };
 
 
 
 DeclException1 (ExcFailedProjection,
-               double,
-               << "The projection was supposed to exactly represent the "
-               << "original function, but the relative residual is "
-               << arg1);
+                double,
+                << "The projection was supposed to exactly represent the "
+                << "original function, but the relative residual is "
+                << arg1);
 
 
 template <int dim>
 void do_project (const Triangulation<dim> &triangulation,
-                const FiniteElement<dim> &fe,
-                const unsigned int        p,
-                const unsigned int        order_difference)
-{  
+                 const FiniteElement<dim> &fe,
+                 const unsigned int        p,
+                 const unsigned int        order_difference)
+{
   DoFHandler<dim>        dof_handler(triangulation);
   dof_handler.distribute_dofs (fe);
 
@@ -113,38 +113,38 @@ void do_project (const Triangulation<dim> &triangulation,
 
   ConstraintMatrix constraints;
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          constraints);
+                                           constraints);
   constraints.close ();
 
   Vector<double> projection (dof_handler.n_dofs());
   Vector<float>  error (triangulation.n_active_cells());
   for (unsigned int q=0; q<=p+2-order_difference; ++q)
     {
-                                      // project the function
+      // project the function
       VectorTools::project (dof_handler,
-                           constraints,
-                           QGauss<dim>(p+2),
-                           F<dim> (q, fe.n_components()),
-                           projection);
-                                      // just to make sure it doesn't get
-                                      // forgotten: handle hanging node
-                                      // constraints
+                            constraints,
+                            QGauss<dim>(p+2),
+                            F<dim> (q, fe.n_components()),
+                            projection);
+      // just to make sure it doesn't get
+      // forgotten: handle hanging node
+      // constraints
       constraints.distribute (projection);
-      
-                                      // then compute the interpolation error
+
+      // then compute the interpolation error
       VectorTools::integrate_difference (dof_handler,
-                                        projection,
-                                        F<dim> (q, fe.n_components()),
-                                        error,
-                                        QGauss<dim>(std::max(p,q)+1),
-                                        VectorTools::L2_norm);
+                                         projection,
+                                         F<dim> (q, fe.n_components()),
+                                         error,
+                                         QGauss<dim>(std::max(p,q)+1),
+                                         VectorTools::L2_norm);
       deallog << fe.get_name() << ", P_" << q
-             << ", rel. error=" << error.l2_norm() / projection.l2_norm()
-             << std::endl;
-         
+              << ", rel. error=" << error.l2_norm() / projection.l2_norm()
+              << std::endl;
+
       if (q<=p-order_difference)
-       Assert (error.l2_norm() <= 1e-10*projection.l2_norm(),
-               ExcFailedProjection(error.l2_norm() / projection.l2_norm()));
+        Assert (error.l2_norm() <= 1e-10*projection.l2_norm(),
+                ExcFailedProjection(error.l2_norm() / projection.l2_norm()));
     }
 }
 
@@ -154,7 +154,7 @@ void do_project (const Triangulation<dim> &triangulation,
 // face_flip==false and hanging nodes. maybe it triggers all sorts of
 // assumptions that may be hidden in places
 //
-// the mesh we use is a 7 cell moebius-type in 3d, with the first and last 
+// the mesh we use is a 7 cell moebius-type in 3d, with the first and last
 // cell refined in turn. that then makes 2 meshes with 14 active cells
 // each. this also cycles through all possibilities of coarser or finer cell
 // having face_rotation==false || face_flip==false
@@ -163,33 +163,33 @@ void do_project (const Triangulation<dim> &triangulation,
 // face_flip (the standard case in which evereything is as usual is left out)
 template <int dim>
 void test_with_wrong_face_orientation (const FiniteElement<dim> &fe,
-                                      const unsigned int        p,
-                                      const unsigned int        order_difference = 0)
+                                       const unsigned int        p,
+                                       const unsigned int        order_difference = 0)
 {
   if (dim != 3)
     return;
   for (unsigned int j=1; j<4; ++j)
-                                    // j=1: face_rotation=true,  face_flip=true
-                                    // j=2: face_rotation=false, face_flip=true
-                                    // j=3: face_rotation=true,  face_flip=false
+    // j=1: face_rotation=true,  face_flip=true
+    // j=2: face_rotation=false, face_flip=true
+    // j=3: face_rotation=true,  face_flip=false
     for (unsigned int i=0; i<2; ++i)
       {
-       Triangulation<dim>     triangulation;
-       GridGenerator::moebius (triangulation,7,j,1.0,0.2);
-       typename Triangulation<dim>::active_cell_iterator
-         cell = triangulation.begin_active();
-       if (i==0)
-         {
-           std::advance (cell,6);
-           deallog<<"face_rotation="<<cell->face_rotation(2)
-                  <<", face_flip="<<cell->face_flip(2)<<std::endl;
-           cell = triangulation.begin_active();
-         }
-       std::advance (cell, i*6);
-       cell->set_refine_flag ();
-       triangulation.execute_coarsening_and_refinement ();
-  
-       do_project (triangulation, fe, p, order_difference);
+        Triangulation<dim>     triangulation;
+        GridGenerator::moebius (triangulation,7,j,1.0,0.2);
+        typename Triangulation<dim>::active_cell_iterator
+        cell = triangulation.begin_active();
+        if (i==0)
+          {
+            std::advance (cell,6);
+            deallog<<"face_rotation="<<cell->face_rotation(2)
+                   <<", face_flip="<<cell->face_flip(2)<<std::endl;
+            cell = triangulation.begin_active();
+          }
+        std::advance (cell, i*6);
+        cell->set_refine_flag ();
+        triangulation.execute_coarsening_and_refinement ();
+
+        do_project (triangulation, fe, p, order_difference);
       }
 }
 
@@ -200,7 +200,7 @@ int main ()
 {
   std::ofstream logfile(logname);
   deallog << std::setprecision (3);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
index 5b5275aa187322c6c65802ef4a9a2502899e52aa..bf3c816d199f2beae81ab567dd467a3acdcc0598 100644 (file)
@@ -44,43 +44,43 @@ template <int dim>
 void
 check ()
 {
-                                  // create a mesh with at least one cell
-                                  // that has a face with
-                                  // face_orientation==false. refine each of
-                                  // the 7 cells in turn, to make sure we
-                                  // have a face with hanging nodes that has
-                                  // face_orientation==false at least once
+  // create a mesh with at least one cell
+  // that has a face with
+  // face_orientation==false. refine each of
+  // the 7 cells in turn, to make sure we
+  // have a face with hanging nodes that has
+  // face_orientation==false at least once
   for (unsigned int i=0; i<7; ++i)
     {
       deallog << "Check " << i << std::endl;
-      
+
       Triangulation<dim> tria;
       GridGenerator::hyper_ball(tria);
 
       typename Triangulation<dim>::active_cell_iterator
-       cell = tria.begin_active();
+      cell = tria.begin_active();
       std::advance(cell,i);
       cell->set_refine_flag();
       tria.execute_coarsening_and_refinement ();
 
-                                      // attach a DoFHandler
+      // attach a DoFHandler
       FE_Q<dim> element(1);
       DoFHandler<dim> dof(tria);
       dof.distribute_dofs(element);
 
-                                      // then build hanging node
-                                      // constraints. this should trip the
-                                      // new code using the hp constraints,
-                                      // added in late July 2006
+      // then build hanging node
+      // constraints. this should trip the
+      // new code using the hp constraints,
+      // added in late July 2006
       ConstraintMatrix constraints;
       DoFTools::make_hanging_node_constraints (dof,
-                                              constraints);
+                                               constraints);
 
       for (unsigned int j=0; j<dof.n_dofs(); ++j)
-       if (constraints.is_constrained (j))
-         deallog << j << std::endl;
+        if (constraints.is_constrained (j))
+          deallog << j << std::endl;
     }
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -89,7 +89,7 @@ int main ()
 {
   std::ofstream logfile ("face_orientation_crash/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 33f639ac8eb9a61916dad441e7611302ceaf2c98..6555090cb62780d9c4ccc8bed77cc970143af824 100644 (file)
@@ -33,18 +33,18 @@ void
 check_this (const DoFHandler<dim> &dof_handler)
 {
   const FiniteElement<dim> &fe = dof_handler.get_fe();
-  
+
   for (unsigned int i = 0; i < fe.dofs_per_face; ++i)
     {
       deallog << fe.face_to_equivalent_cell_index (i)
-             << ' '
-             << fe.face_to_cell_index (i, 0)
-             << std::endl;
+              << ' '
+              << fe.face_to_cell_index (i, 0)
+              << std::endl;
       Assert (fe.face_to_equivalent_cell_index (i) ==
-             fe.face_to_cell_index (i, 0),
-             ExcInternalError());
+              fe.face_to_cell_index (i, 0),
+              ExcInternalError());
     }
-  
+
   deallog << "OK" << std::endl;
 }
 
index 799e06a9a28e38a10e97257d51f2863f9225afa2..80e6cdeb0346bb85b91cd4b4fff00534b316900a 100644 (file)
 
 double abs_zero(double a)
 {
-  if( std::abs(a) < 1e-10)
+  if ( std::abs(a) < 1e-10)
     return 0;
   else
     return a;
 }
 
 template <int dim>
-void test() {
+void test()
+{
   Triangulation<dim> tria;
   GridGenerator::hyper_cube(tria);
   tria.refine_global(8/dim);
@@ -60,27 +61,27 @@ void test() {
   deallog << "V norm: " << v1.l2_norm() << std::endl;
 
   Functions::FEFieldFunction<dim, DoFHandler<dim>, Vector<double> >
-    fef(dh, v1);
+  fef(dh, v1);
 
   VectorTools::interpolate(dh, fef, v2);
 
   v2.add(-1, v1);
   deallog << "Interpolation error: " << abs_zero(v2.l2_norm())
-         << std::endl;
+          << std::endl;
 
   Vector<double> error(tria.n_active_cells());
   QGauss<dim> quad(2);
   VectorTools::integrate_difference(dh, v1, ff,
-                                   error, quad,
-                                   VectorTools::H1_norm);
+                                    error, quad,
+                                    VectorTools::H1_norm);
   deallog << "H1 Interpolation error: "
-         << abs_zero(error.l2_norm()) << std::endl;
+          << abs_zero(error.l2_norm()) << std::endl;
   error = 0;
   VectorTools::integrate_difference(dh, v1, fef,
-                                   error, quad,
-                                   VectorTools::H1_norm);
+                                    error, quad,
+                                    VectorTools::H1_norm);
   deallog << "H1 Interpolation error with fef: "
-         << abs_zero(error.l2_norm()) << std::endl;
+          << abs_zero(error.l2_norm()) << std::endl;
 
 }
 
index d60df11fa01ff56eaddc2df857b72709f04a1086..70da9dad0c417f38d9251775ab79f301c45f7efb 100644 (file)
 template <int dim>
 class F : public Function<dim>
 {
-  public:
-    F() : Function<dim>(2) {}
-    virtual void vector_value (const Point<dim> &p,
-                              Vector<double> &v) const
-      {
-       v = 0;
-       v[0] = p.square();
-      }
+public:
+  F() : Function<dim>(2) {}
+  virtual void vector_value (const Point<dim> &p,
+                             Vector<double> &v) const
+  {
+    v = 0;
+    v[0] = p.square();
+  }
 };
 
 double abs_zero(double a)
 {
-  if( std::abs(a) < 1e-10)
+  if ( std::abs(a) < 1e-10)
     return 0;
   else
     return a;
 }
 
 template <int dim>
-void test() {
+void test()
+{
   Triangulation<dim> tria;
   GridGenerator::hyper_cube(tria);
   tria.refine_global(8/dim);
@@ -75,27 +76,27 @@ void test() {
   deallog << "V norm: " << v1.l2_norm() << std::endl;
 
   Functions::FEFieldFunction<dim, DoFHandler<dim>, Vector<double> >
-    fef(dh, v1);
+  fef(dh, v1);
 
   VectorTools::interpolate(dh, fef, v2);
 
   v2.add(-1, v1);
   deallog << "Interpolation error: " << abs_zero(v2.l2_norm())
-         << std::endl;
+          << std::endl;
 
   Vector<double> error(tria.n_active_cells());
   QGauss<dim> quad(2);
   VectorTools::integrate_difference(dh, v1, F<dim>(),
-                                   error, quad,
-                                   VectorTools::L2_norm);
+                                    error, quad,
+                                    VectorTools::L2_norm);
   deallog << "L2 Interpolation error: "
-         << abs_zero(error.l2_norm()) << std::endl;
+          << abs_zero(error.l2_norm()) << std::endl;
   error = 0;
   VectorTools::integrate_difference(dh, v1, fef,
-                                   error, quad,
-                                   VectorTools::L2_norm);
+                                    error, quad,
+                                    VectorTools::L2_norm);
   deallog << "L2 Interpolation error with fef: "
-         << abs_zero(error.l2_norm()) << std::endl;
+          << abs_zero(error.l2_norm()) << std::endl;
 
 }
 
index 2edf718b81e0b5ecf369cbb9227ffec0359cb1e9..64bf9a06a90ce8327666c999568acf1b5c6626eb 100644 (file)
 
 double abs_zero(double a)
 {
-  if( std::abs(a) < 1e-10)
+  if ( std::abs(a) < 1e-10)
     return 0;
   else
     return a;
 }
 
 template <int dim>
-void test() {
+void test()
+{
   Triangulation<dim> tria;
   GridGenerator::hyper_cube(tria);
   tria.refine_global(8/dim);
@@ -63,13 +64,13 @@ void test() {
   deallog << "V norm: " << v1.l2_norm() << std::endl;
 
   Functions::FEFieldFunction<dim, DoFHandler<dim>, Vector<double> >
-    fef(dh, v1);
+  fef(dh, v1);
 
-                                  // project the discrete function fef back
-                                  // onto the finite element space. this
-                                  // should be the identity operation and
-                                  // consequently subtracting the vector from
-                                  // itself should yield zero
+  // project the discrete function fef back
+  // onto the finite element space. this
+  // should be the identity operation and
+  // consequently subtracting the vector from
+  // itself should yield zero
   {
     ConstraintMatrix cm;
     cm.close();
@@ -78,7 +79,7 @@ void test() {
   v2.add(-1, v1);
 
   deallog << "Projection error: " << abs_zero(v2.l2_norm())
-         << std::endl;
+          << std::endl;
   Assert (v2.l2_norm() < 1e-10, ExcInternalError());
 }
 
index 9d23ec8e535caa424284ec5dda07092c70187004..279639f45ffd6f8cf42b1ca9678bbde1c7593d86 100644 (file)
 template <int dim>
 class F : public Function<dim>
 {
-  public:
-    F() : Function<dim>(2) {}
-    virtual void vector_value (const Point<dim> &p,
-                              Vector<double> &v) const
-      {
-       v = 0;
-       v[0] = p.square();
-      }
+public:
+  F() : Function<dim>(2) {}
+  virtual void vector_value (const Point<dim> &p,
+                             Vector<double> &v) const
+  {
+    v = 0;
+    v[0] = p.square();
+  }
 };
 
 
 double abs_zero(double a)
 {
-  if( std::abs(a) < 1e-10)
+  if ( std::abs(a) < 1e-10)
     return 0;
   else
     return a;
 }
 
 template <int dim>
-void test() {
+void test()
+{
   Triangulation<dim> tria;
   GridGenerator::hyper_cube(tria);
   tria.refine_global(8/dim);
@@ -79,13 +80,13 @@ void test() {
   deallog << "V norm: " << v1.l2_norm() << std::endl;
 
   Functions::FEFieldFunction<dim, DoFHandler<dim>, Vector<double> >
-    fef(dh, v1);
+  fef(dh, v1);
 
-                                  // project the discrete function fef back
-                                  // onto the finite element space. this
-                                  // should be the identity operation and
-                                  // consequently subtracting the vector from
-                                  // itself should yield zero
+  // project the discrete function fef back
+  // onto the finite element space. this
+  // should be the identity operation and
+  // consequently subtracting the vector from
+  // itself should yield zero
   {
     ConstraintMatrix cm;
     cm.close();
@@ -94,7 +95,7 @@ void test() {
   v2.add(-1, v1);
 
   deallog << "Projection error: " << abs_zero(v2.l2_norm())
-         << std::endl;
+          << std::endl;
   Assert (v2.l2_norm() < 1e-10, ExcInternalError());
 }
 
index 7bc1d92e0428a84f1119ae8186bd664681130f61..bec1a14b24092fff5b8a233bc8d3384f17214e2a 100644 (file)
@@ -16,7 +16,7 @@
 
 
 
-// Test the functionality of the laplacian in the FEFieldFunction class. 
+// Test the functionality of the laplacian in the FEFieldFunction class.
 
 #include "../tests.h"
 #include <fstream>
@@ -33,7 +33,8 @@
 #include <deal.II/numerics/vector_tools.h>
 
 template <int dim>
-void test() {
+void test()
+{
   Triangulation<dim> tria;
   GridGenerator::hyper_cube(tria);
   tria.refine_global(9/dim);
@@ -52,14 +53,14 @@ void test() {
   deallog << "V norm: " << v1.l2_norm() << std::endl;
 
   Functions::FEFieldFunction<dim, DoFHandler<dim>, Vector<double> >
-    fef(dh, v1);
+  fef(dh, v1);
 
-       //create the origin
-       Point<dim> p;
-       //compute the error of the laplacian in this point
+  //create the origin
+  Point<dim> p;
+  //compute the error of the laplacian in this point
   deallog << "Value of the laplacian in 0:" << std::endl;
   deallog << "correct value: " << ff.laplacian(p) <<", approximation: "<< fef.laplacian(p) << std::endl;
-  
+
   //now we want to test the list version
   Point<dim> p1 = Point<dim>::unit_vector(0);
   p1 = p1 * 0.5;
@@ -69,12 +70,12 @@ void test() {
   vec.push_back(p2);
   std::vector<double> values_c(2);
   std::vector<double> values_a(2);
-  
+
   //get the laplacians at these two points
   ff.laplacian_list(vec, values_c);
   fef.laplacian_list(vec, values_a);
-    deallog << "Value of the laplacian in 0.5*e1 and 0.25 * e1:" << std::endl;
-    deallog << " correct values: " <<values_c[0] << " " << values_c[1]  <<", approximations: "<<values_a[0] << " " << values_a[1] << std::endl;
+  deallog << "Value of the laplacian in 0.5*e1 and 0.25 * e1:" << std::endl;
+  deallog << " correct values: " <<values_c[0] << " " << values_c[1]  <<", approximations: "<<values_a[0] << " " << values_a[1] << std::endl;
 }
 
 int main ()
index f3b448cb497286c72dff67d32c9c0153b97a26e2..219a7dde2fd4a00d39790953e927947f1162c664 100644 (file)
@@ -16,7 +16,7 @@
 
 
 
-// Test the functionality of the laplacian in the FEFieldFunction class. 
+// Test the functionality of the laplacian in the FEFieldFunction class.
 
 #include "../tests.h"
 #include <fstream>
@@ -33,7 +33,8 @@
 #include <deal.II/numerics/vector_tools.h>
 
 template <int dim>
-void test() {
+void test()
+{
   Triangulation<dim> tria;
   GridGenerator::hyper_cube(tria);
   tria.refine_global(9/dim);
@@ -52,14 +53,14 @@ void test() {
   deallog << "V norm: " << v1.l2_norm() << std::endl;
 
   Functions::FEFieldFunction<dim, DoFHandler<dim>, Vector<double> >
-    fef(dh, v1);
+  fef(dh, v1);
 
-       //create the origin
-       Point<dim> p;
-       //compute the error of the laplacian in this point
+  //create the origin
+  Point<dim> p;
+  //compute the error of the laplacian in this point
   deallog << "Value of the laplacian in 0:" << std::endl;
   deallog << "correct value: " << ff.laplacian(p) <<", approximation: "<< fef.laplacian(p) << std::endl;
-  
+
   //now we want to test the list version
   Point<dim> p1 = Point<dim>::unit_vector(0);
   p1 = p1 * 0.5;
@@ -69,12 +70,12 @@ void test() {
   vec.push_back(p2);
   std::vector<double> values_c(2);
   std::vector<double> values_a(2);
-  
+
   //get the laplacians at these two points
   ff.laplacian_list(vec, values_c);
   fef.laplacian_list(vec, values_a);
-    deallog << "Value of the laplacian in 0.5*e1 and 0.25 * e1:" << std::endl;
-    deallog << " correct values: " <<values_c[0] << " " << values_c[1]  <<", approximations: "<<values_a[0] << " " << values_a[1] << std::endl;
+  deallog << "Value of the laplacian in 0.5*e1 and 0.25 * e1:" << std::endl;
+  deallog << " correct values: " <<values_c[0] << " " << values_c[1]  <<", approximations: "<<values_a[0] << " " << values_a[1] << std::endl;
 }
 
 int main ()
index c742a1266db9853dbedc5c89eec5c43f21a6acd8..1657596e3b01e3601302c90461bbf2b4bc3fc6e1 100644 (file)
 template <int dim>
 class F : public Function<dim>
 {
-  public:
-    virtual double value (const Point<dim> &p,
-                         const unsigned int) const
-      {
-       return p.square();
-      }
+public:
+  virtual double value (const Point<dim> &p,
+                        const unsigned int) const
+  {
+    return p.square();
+  }
 };
 
 
@@ -65,19 +65,19 @@ void test()
   Functions::FEFieldFunction<2> fe_function (dof_handler, solution);
   std::vector<Point<dim> > points;
 
-                                  // add a bunch of points. all
-                                  // points are inside the circle.
-                                  // the problem happens because we
-                                  // walk over a bunch of cells in
-                                  // the process of finding all of
-                                  // these points and then realize
-                                  // when we get to the one at the
-                                  // end that the coordinates for
-                                  // this point can't be found in the
-                                  // cell we have touched last (it's
-                                  // too far away from that cell, and
-                                  // the inverse mapping does not
-                                  // converge
+  // add a bunch of points. all
+  // points are inside the circle.
+  // the problem happens because we
+  // walk over a bunch of cells in
+  // the process of finding all of
+  // these points and then realize
+  // when we get to the one at the
+  // end that the coordinates for
+  // this point can't be found in the
+  // cell we have touched last (it's
+  // too far away from that cell, and
+  // the inverse mapping does not
+  // converge
   for (unsigned int i=0; i<20; ++i)
     for (unsigned int j=0; j<20; ++j)
       points.push_back (Point<dim>(-0.7+i*0.07,-0.7+j*0.07));
@@ -88,9 +88,9 @@ void test()
 
   for (unsigned int i=0; i<m.size(); ++i)
     Assert (std::fabs(m[i] - points[i].square())
-           <
-           1e-10 * std::fabs(m[i] + points[i].square()),
-           ExcInternalError());
+            <
+            1e-10 * std::fabs(m[i] + points[i].square()),
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
index d50f9a1512008e51dc9fce3f4bd31a7093d8fd0d..7cf920598f71f6a0ccda76e0d33cad3a479cc163 100644 (file)
 template <int dim>
 class F : public Function<dim>
 {
-  public:
-    F() : Function<dim>(2) {}
-    virtual void vector_value (const Point<dim> &p,
-                              Vector<double> &v) const
-      {
-       v = 0;
-       v[0] = p.square();
-      }
+public:
+  F() : Function<dim>(2) {}
+  virtual void vector_value (const Point<dim> &p,
+                             Vector<double> &v) const
+  {
+    v = 0;
+    v[0] = p.square();
+  }
 };
 
 
@@ -68,19 +68,19 @@ void test()
   Functions::FEFieldFunction<2> fe_function (dof_handler, solution);
   std::vector<Point<dim> > points;
 
-                                  // add a bunch of points. all
-                                  // points are inside the circle.
-                                  // the problem happens because we
-                                  // walk over a bunch of cells in
-                                  // the process of finding all of
-                                  // these points and then realize
-                                  // when we get to the one at the
-                                  // end that the coordinates for
-                                  // this point can't be found in the
-                                  // cell we have touched last (it's
-                                  // too far away from that cell, and
-                                  // the inverse mapping does not
-                                  // converge
+  // add a bunch of points. all
+  // points are inside the circle.
+  // the problem happens because we
+  // walk over a bunch of cells in
+  // the process of finding all of
+  // these points and then realize
+  // when we get to the one at the
+  // end that the coordinates for
+  // this point can't be found in the
+  // cell we have touched last (it's
+  // too far away from that cell, and
+  // the inverse mapping does not
+  // converge
   for (unsigned int i=0; i<20; ++i)
     for (unsigned int j=0; j<20; ++j)
       points.push_back (Point<dim>(-0.7+i*0.07,-0.7+j*0.07));
@@ -92,14 +92,14 @@ void test()
   for (unsigned int i=0; i<m.size(); ++i)
     {
       Assert (std::fabs(m[i](0) - points[i].square())
-             <
-             1e-10 * std::fabs(m[i](0) + points[i].square()),
-             ExcInternalError());
+              <
+              1e-10 * std::fabs(m[i](0) + points[i].square()),
+              ExcInternalError());
 
       Assert (std::fabs(m[i](1))
-             <
-             1e-10,
-             ExcInternalError());
+              <
+              1e-10,
+              ExcInternalError());
     }
 
   deallog << "OK" << std::endl;
index 1f1db0eb6148932fe49b74b38e64596d9f4a4b09..34eecf0a9133cb5fadd37504ea4c1062f80a8c7e 100644 (file)
 template <int dim>
 class F : public Function<dim>
 {
-  public:
-    virtual double value (const Point<dim> &p,
-                         const unsigned int) const
-      {
-       return p.square();
-      }
+public:
+  virtual double value (const Point<dim> &p,
+                        const unsigned int) const
+  {
+    return p.square();
+  }
 };
 
 
@@ -63,45 +63,45 @@ void test()
   DoFHandler<dim> dof_handler(triangulation);
   dof_handler.distribute_dofs(fe);
 
-                                  // interpolate a quadratic function
-                                  // into the space; this function
-                                  // can be represented exactly, so
-                                  // that we can compare again later
+  // interpolate a quadratic function
+  // into the space; this function
+  // can be represented exactly, so
+  // that we can compare again later
   Vector<double> solution(dof_handler.n_dofs());
   VectorTools::interpolate (dof_handler, F<dim>(), solution);
 
   Functions::FEFieldFunction<2> fe_function (dof_handler, solution);
   std::vector<Point<dim> > points;
 
-                                  // add only one points but also set
-                                  // the active cell to one that
-                                  // doesn't contain the current
-                                  // point.  the problem happens
-                                  // because we walk over a bunch of
-                                  // cells in the process of finding
-                                  // all of these points and then
-                                  // realize when we get to the one
-                                  // at the end that the coordinates
-                                  // for this point can't be found in
-                                  // the cell we have touched last
-                                  // (it's too far away from that
-                                  // cell, and the inverse mapping
-                                  // does not converge
+  // add only one points but also set
+  // the active cell to one that
+  // doesn't contain the current
+  // point.  the problem happens
+  // because we walk over a bunch of
+  // cells in the process of finding
+  // all of these points and then
+  // realize when we get to the one
+  // at the end that the coordinates
+  // for this point can't be found in
+  // the cell we have touched last
+  // (it's too far away from that
+  // cell, and the inverse mapping
+  // does not converge
   points.push_back (Point<dim>(-0.27999999999999992, -0.62999999999999989));
   fe_function.set_active_cell (typename DoFHandler<dim>::active_cell_iterator
-                              (&triangulation,
-                               1,
-                               4,
-                               &dof_handler));
+                               (&triangulation,
+                                1,
+                                4,
+                                &dof_handler));
 
   std::vector<double> m (points.size());
   fe_function.value_list (points, m);
 
   for (unsigned int i=0; i<m.size(); ++i)
     Assert (std::fabs(m[i] - points[i].square())
-           <
-           1e-10 * std::fabs(m[i] + points[i].square()),
-           ExcInternalError());
+            <
+            1e-10 * std::fabs(m[i] + points[i].square()),
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
index bde0af1767eda37e6b07bd6c3357ba03c1054d1b..ecd03d7b437c1c9c7121bb16ac0ef9fe4b0e09d4 100644 (file)
 template <int dim>
 class F : public Function<dim>
 {
-  public:
-    F() : Function<dim>(2) {}
-    virtual void vector_value (const Point<dim> &p,
-                              Vector<double> &v) const
-      {
-       v = 0;
-       v[0] = p.square();
-      }
+public:
+  F() : Function<dim>(2) {}
+  virtual void vector_value (const Point<dim> &p,
+                             Vector<double> &v) const
+  {
+    v = 0;
+    v[0] = p.square();
+  }
 };
 
 
@@ -67,36 +67,36 @@ void test()
   DoFHandler<dim> dof_handler(triangulation);
   dof_handler.distribute_dofs(fe);
 
-                                  // interpolate a quadratic function
-                                  // into the space; this function
-                                  // can be represented exactly, so
-                                  // that we can compare again later
+  // interpolate a quadratic function
+  // into the space; this function
+  // can be represented exactly, so
+  // that we can compare again later
   Vector<double> solution(dof_handler.n_dofs());
   VectorTools::interpolate (dof_handler, F<dim>(), solution);
 
   Functions::FEFieldFunction<2> fe_function (dof_handler, solution);
   std::vector<Point<dim> > points;
 
-                                  // add only one points but also set
-                                  // the active cell to one that
-                                  // doesn't contain the current
-                                  // point.  the problem happens
-                                  // because we walk over a bunch of
-                                  // cells in the process of finding
-                                  // all of these points and then
-                                  // realize when we get to the one
-                                  // at the end that the coordinates
-                                  // for this point can't be found in
-                                  // the cell we have touched last
-                                  // (it's too far away from that
-                                  // cell, and the inverse mapping
-                                  // does not converge
+  // add only one points but also set
+  // the active cell to one that
+  // doesn't contain the current
+  // point.  the problem happens
+  // because we walk over a bunch of
+  // cells in the process of finding
+  // all of these points and then
+  // realize when we get to the one
+  // at the end that the coordinates
+  // for this point can't be found in
+  // the cell we have touched last
+  // (it's too far away from that
+  // cell, and the inverse mapping
+  // does not converge
   points.push_back (Point<dim>(-0.27999999999999992, -0.62999999999999989));
   fe_function.set_active_cell (typename DoFHandler<dim>::active_cell_iterator
-                              (&triangulation,
-                               1,
-                               4,
-                               &dof_handler));
+                               (&triangulation,
+                                1,
+                                4,
+                                &dof_handler));
 
   std::vector<Vector<double> > m (points.size(), Vector<double>(2));
   fe_function.vector_value_list (points, m);
@@ -104,14 +104,14 @@ void test()
   for (unsigned int i=0; i<m.size(); ++i)
     {
       Assert (std::fabs(m[i](0) - points[i].square())
-             <
-             1e-10 * std::fabs(m[i](0) + points[i].square()),
-             ExcInternalError());
+              <
+              1e-10 * std::fabs(m[i](0) + points[i].square()),
+              ExcInternalError());
 
       Assert (std::fabs(m[i](1))
-             <
-             1e-10,
-             ExcInternalError());
+              <
+              1e-10,
+              ExcInternalError());
     }
 
   deallog << "OK" << std::endl;
index 391d3b4bf24009b9d63470553820cf0401482069..02cbf8ec5b131939c59f639c72efeb8f5f1b0585 100644 (file)
 template <int dim>
 class F : public Function<dim>
 {
-  public:
-    F() : Function<dim>(2) {}
-    virtual void vector_value (const Point<dim> &p,
-                              Vector<double> &v) const
-      {
-       v = 0;
-       v[0] = p.square();
-      }
+public:
+  F() : Function<dim>(2) {}
+  virtual void vector_value (const Point<dim> &p,
+                             Vector<double> &v) const
+  {
+    v = 0;
+    v[0] = p.square();
+  }
 };
 
 
@@ -67,49 +67,49 @@ void test()
   DoFHandler<dim> dof_handler(triangulation);
   dof_handler.distribute_dofs(fe);
 
-                                  // interpolate a quadratic function
-                                  // into the space; this function
-                                  // can be represented exactly, so
-                                  // that we can compare again later
+  // interpolate a quadratic function
+  // into the space; this function
+  // can be represented exactly, so
+  // that we can compare again later
   Vector<double> solution(dof_handler.n_dofs());
   VectorTools::interpolate (dof_handler, F<dim>(), solution);
 
   Functions::FEFieldFunction<2> fe_function (dof_handler, solution);
 
-                                  // add only one points but also set
-                                  // the active cell to one that
-                                  // doesn't contain the current
-                                  // point.  the problem happens
-                                  // because we walk over a bunch of
-                                  // cells in the process of finding
-                                  // all of these points and then
-                                  // realize when we get to the one
-                                  // at the end that the coordinates
-                                  // for this point can't be found in
-                                  // the cell we have touched last
-                                  // (it's too far away from that
-                                  // cell, and the inverse mapping
-                                  // does not converge
+  // add only one points but also set
+  // the active cell to one that
+  // doesn't contain the current
+  // point.  the problem happens
+  // because we walk over a bunch of
+  // cells in the process of finding
+  // all of these points and then
+  // realize when we get to the one
+  // at the end that the coordinates
+  // for this point can't be found in
+  // the cell we have touched last
+  // (it's too far away from that
+  // cell, and the inverse mapping
+  // does not converge
   Point<dim> point(-0.27999999999999992, -0.62999999999999989);
   fe_function.set_active_cell (typename DoFHandler<dim>::active_cell_iterator
-                              (&triangulation,
-                               1,
-                               4,
-                               &dof_handler));
+                               (&triangulation,
+                                1,
+                                4,
+                                &dof_handler));
 
   Vector<double> m(2);
   fe_function.vector_value (point, m);
 
   {
     Assert (std::fabs(m(0) - point.square())
-           <
-           1e-10 * std::fabs(m(0) + point.square()),
-           ExcInternalError());
+            <
+            1e-10 * std::fabs(m(0) + point.square()),
+            ExcInternalError());
 
     Assert (std::fabs(m(1))
-           <
-           1e-10,
-           ExcInternalError());
+            <
+            1e-10,
+            ExcInternalError());
   }
 
   deallog << "OK" << std::endl;
index 0c90e814bec4babcf4c214aadab17a5e2cc4ca6e..6c554fccc21ea88b8f24d8ee6bfb73a7b6398347 100644 (file)
 template <int dim>
 class F : public Function<dim>
 {
-  public:
-    F() : Function<dim>(2) {}
-
-    virtual void vector_value (const Point<dim> &p,
-                              Vector<double> &v) const
-      {
-       v[0] = p[0];
-       v[1] = 0;
-      }
-
-    virtual void vector_gradient (const Point<dim> &p,
-                                 std::vector<Tensor<1,dim> > &v) const
-      {
-       v[0] = 0;
-       v[1] = 0;
-       v[0][0] = 1;
-      }
+public:
+  F() : Function<dim>(2) {}
+
+  virtual void vector_value (const Point<dim> &p,
+                             Vector<double> &v) const
+  {
+    v[0] = p[0];
+    v[1] = 0;
+  }
+
+  virtual void vector_gradient (const Point<dim> &p,
+                                std::vector<Tensor<1,dim> > &v) const
+  {
+    v[0] = 0;
+    v[1] = 0;
+    v[0][0] = 1;
+  }
 };
 
 
@@ -76,51 +76,51 @@ void test()
   DoFHandler<dim> dof_handler(triangulation);
   dof_handler.distribute_dofs(fe);
 
-                                  // interpolate a quadratic function
-                                  // into the space; this function
-                                  // can be represented exactly, so
-                                  // that we can compare again later
+  // interpolate a quadratic function
+  // into the space; this function
+  // can be represented exactly, so
+  // that we can compare again later
   Vector<double> solution(dof_handler.n_dofs());
   VectorTools::interpolate (dof_handler, F<dim>(), solution);
 
   Functions::FEFieldFunction<2> fe_function (dof_handler, solution);
 
-                                  // add only one points but also set
-                                  // the active cell to one that
-                                  // doesn't contain the current
-                                  // point.  the problem happens
-                                  // because we walk over a bunch of
-                                  // cells in the process of finding
-                                  // all of these points and then
-                                  // realize when we get to the one
-                                  // at the end that the coordinates
-                                  // for this point can't be found in
-                                  // the cell we have touched last
-                                  // (it's too far away from that
-                                  // cell, and the inverse mapping
-                                  // does not converge
+  // add only one points but also set
+  // the active cell to one that
+  // doesn't contain the current
+  // point.  the problem happens
+  // because we walk over a bunch of
+  // cells in the process of finding
+  // all of these points and then
+  // realize when we get to the one
+  // at the end that the coordinates
+  // for this point can't be found in
+  // the cell we have touched last
+  // (it's too far away from that
+  // cell, and the inverse mapping
+  // does not converge
   Point<dim> point(-0.27999999999999992, -0.62999999999999989);
   fe_function.set_active_cell (typename DoFHandler<dim>::active_cell_iterator
-                              (&triangulation,
-                               1,
-                               4,
-                               &dof_handler));
+                               (&triangulation,
+                                1,
+                                4,
+                                &dof_handler));
 
   std::vector<Tensor<1,dim> > m(2);
   fe_function.vector_gradient (point, m);
 
   Assert (std::fabs(m[0][0] - 1)
-         <
-         1e-10 * std::fabs(m[0][0] + 1),
-         ExcInternalError());
+          <
+          1e-10 * std::fabs(m[0][0] + 1),
+          ExcInternalError());
   Assert (std::fabs(m[0][1])
-         <
-         1e-10,
-         ExcInternalError());
+          <
+          1e-10,
+          ExcInternalError());
   Assert (m[1].norm()
-         <
-         1e-10,
-         ExcInternalError());
+          <
+          1e-10,
+          ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
index 252cedcb005b64d01471fcbb2152a3afa41e7175..bc02392f4c0a23abbe5cd9578826f9c7080f0b59 100644 (file)
 template <int dim>
 class F : public Function<dim>
 {
-  public:
-    F() : Function<dim>(2) {}
-
-    virtual void vector_value (const Point<dim> &p,
-                                  Vector<double> &v) const
-      {
-       v = 0;
-       for (unsigned int i=0; i<dim; ++i)
-         v[0] += p[i]*p[i]*p[i]*p[i];
-      }
-
-    virtual void vector_laplacian (const Point<dim> &p,
-                                  Vector<double> &v) const
-      {
-       v = 0;
-       v[0] = p.square() * 4 * 3 * dim;
-      }
+public:
+  F() : Function<dim>(2) {}
+
+  virtual void vector_value (const Point<dim> &p,
+                             Vector<double> &v) const
+  {
+    v = 0;
+    for (unsigned int i=0; i<dim; ++i)
+      v[0] += p[i]*p[i]*p[i]*p[i];
+  }
+
+  virtual void vector_laplacian (const Point<dim> &p,
+                                 Vector<double> &v) const
+  {
+    v = 0;
+    v[0] = p.square() * 4 * 3 * dim;
+  }
 };
 
 
@@ -76,49 +76,49 @@ void test()
   DoFHandler<dim> dof_handler(triangulation);
   dof_handler.distribute_dofs(fe);
 
-                                  // interpolate a quadratic function
-                                  // into the space; this function
-                                  // can be represented exactly, so
-                                  // that we can compare again later
+  // interpolate a quadratic function
+  // into the space; this function
+  // can be represented exactly, so
+  // that we can compare again later
   Vector<double> solution(dof_handler.n_dofs());
   VectorTools::interpolate (dof_handler, F<dim>(), solution);
 
   Functions::FEFieldFunction<2> fe_function (dof_handler, solution);
 
-                                  // add only one points but also set
-                                  // the active cell to one that
-                                  // doesn't contain the current
-                                  // point.  the problem happens
-                                  // because we walk over a bunch of
-                                  // cells in the process of finding
-                                  // all of these points and then
-                                  // realize when we get to the one
-                                  // at the end that the coordinates
-                                  // for this point can't be found in
-                                  // the cell we have touched last
-                                  // (it's too far away from that
-                                  // cell, and the inverse mapping
-                                  // does not converge
+  // add only one points but also set
+  // the active cell to one that
+  // doesn't contain the current
+  // point.  the problem happens
+  // because we walk over a bunch of
+  // cells in the process of finding
+  // all of these points and then
+  // realize when we get to the one
+  // at the end that the coordinates
+  // for this point can't be found in
+  // the cell we have touched last
+  // (it's too far away from that
+  // cell, and the inverse mapping
+  // does not converge
   Point<dim> point(-0.27999999999999992, -0.62999999999999989);
   fe_function.set_active_cell (typename DoFHandler<dim>::active_cell_iterator
-                              (&triangulation,
-                               1,
-                               4,
-                               &dof_handler));
+                               (&triangulation,
+                                1,
+                                4,
+                                &dof_handler));
 
   Vector<double> m(2);
   fe_function.vector_laplacian (point, m);
 
   {
     Assert (std::fabs(m(0) - point.square()*4*3)
-           <
-           1e-8 * std::fabs(m(0) + point.square()*4*3),
-           ExcInternalError());
+            <
+            1e-8 * std::fabs(m(0) + point.square()*4*3),
+            ExcInternalError());
 
     Assert (std::fabs(m(1))
-           <
-           1e-10,
-           ExcInternalError());
+            <
+            1e-10,
+            ExcInternalError());
   }
 
   deallog << "OK" << std::endl;
index 1705c4ef86103bda9c34f915fea9ede1b1a586f2..8dd6c54a0165490354b70d987560765fc42e01d8 100644 (file)
 
 
 // matrices taken from the old file deal.II/source/fe/fe_q_3d.cc
-namespace FE_Q_3d 
+namespace FE_Q_3d
 {
   static const double constraint_q1[] =
   {
-       0.25,0.25,0.25,0.25,
-       0.5,0,0.5,0,
-       0,0.5,0,0.5,
-       0.5,0.5,0,0,
-       0,0,0.5,0.5
+    0.25,0.25,0.25,0.25,
+    0.5,0,0.5,0,
+    0,0.5,0,0.5,
+    0.5,0.5,0,0,
+    0,0,0.5,0.5
   };
 
   static const double constraint_q2[] =
   {
-       0,0,0,0,0,0,0,0,1,
-       0,0,0,0,1,0,0,0,0,
-       0,0,0,0,0,1,0,0,0,
-       0,0,0,0,0,0,1,0,0,
-       0,0,0,0,0,0,0,1,0,
-       0,0,0,0,0,0,0.375,-0.125,0.75,
-       0,0,0,0,0,0,-0.125,0.375,0.75,
-       0,0,0,0,0.375,-0.125,0,0,0.75,
-       0,0,0,0,-0.125,0.375,0,0,0.75,
-       0.375,0,-0.125,0,0.75,0,0,0,0,
-       -0.125,0,0.375,0,0.75,0,0,0,0,
-       0,0.375,0,-0.125,0,0.75,0,0,0,
-       0,-0.125,0,0.375,0,0.75,0,0,0,
-       0.375,-0.125,0,0,0,0,0.75,0,0,
-       -0.125,0.375,0,0,0,0,0.75,0,0,
-       0,0,0.375,-0.125,0,0,0,0.75,0,
-       0,0,-0.125,0.375,0,0,0,0.75,0,
-       0.140625,-0.046875,-0.046875,0.015625,0.28125,-0.09375,0.28125,-0.09375,0.5625,
-       -0.046875,0.140625,0.015625,-0.046875,-0.09375,0.28125,0.28125,-0.09375,0.5625,
-       -0.046875,0.015625,0.140625,-0.046875,0.28125,-0.09375,-0.09375,0.28125,0.5625,
-       0.015625,-0.046875,-0.046875,0.140625,-0.09375,0.28125,-0.09375,0.28125,0.5625
+    0,0,0,0,0,0,0,0,1,
+    0,0,0,0,1,0,0,0,0,
+    0,0,0,0,0,1,0,0,0,
+    0,0,0,0,0,0,1,0,0,
+    0,0,0,0,0,0,0,1,0,
+    0,0,0,0,0,0,0.375,-0.125,0.75,
+    0,0,0,0,0,0,-0.125,0.375,0.75,
+    0,0,0,0,0.375,-0.125,0,0,0.75,
+    0,0,0,0,-0.125,0.375,0,0,0.75,
+    0.375,0,-0.125,0,0.75,0,0,0,0,
+    -0.125,0,0.375,0,0.75,0,0,0,0,
+    0,0.375,0,-0.125,0,0.75,0,0,0,
+    0,-0.125,0,0.375,0,0.75,0,0,0,
+    0.375,-0.125,0,0,0,0,0.75,0,0,
+    -0.125,0.375,0,0,0,0,0.75,0,0,
+    0,0,0.375,-0.125,0,0,0,0.75,0,
+    0,0,-0.125,0.375,0,0,0,0.75,0,
+    0.140625,-0.046875,-0.046875,0.015625,0.28125,-0.09375,0.28125,-0.09375,0.5625,
+    -0.046875,0.140625,0.015625,-0.046875,-0.09375,0.28125,0.28125,-0.09375,0.5625,
+    -0.046875,0.015625,0.140625,-0.046875,0.28125,-0.09375,-0.09375,0.28125,0.5625,
+    0.015625,-0.046875,-0.046875,0.140625,-0.09375,0.28125,-0.09375,0.28125,0.5625
   };
 }
 
 
 namespace Matrices
 {
-  const double * const 
+  const double *const
   constraint_matrices[] =
   {
-        FE_Q_3d::constraint_q1,
-        FE_Q_3d::constraint_q2
+    FE_Q_3d::constraint_q1,
+    FE_Q_3d::constraint_q2
   };
 
-  const unsigned int 
+  const unsigned int
   n_constraint_matrices
-  = sizeof(constraint_matrices) /
-    sizeof(constraint_matrices[0]);
+    = sizeof(constraint_matrices) /
+      sizeof(constraint_matrices[0]);
 }
 
 
 
 void check ()
 {
-                                   // check for q=1,2
+  // check for q=1,2
   for (unsigned int q=1; q<=2; ++q)
     {
       deallog << "q=" << q << std::endl;
-      
+
       FE_Q<3> fe(q);
-    
+
       FullMatrix<double> x(fe.constraints().m(),
                            fe.constraints().n());
 
@@ -117,13 +117,13 @@ void check ()
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("fe_q_3d_01/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   check ();
 }
 
index 6bf8541d8191cef4d1d77269008668ed3bc20478..d3a9f153ba0b871a66b74a0bc58f880ce8df4de0 100644 (file)
 
 
 // This file implements a simple test procedure for the algorithm
-// which constructs the constraint matrices for FE_Q<3> elements 
-// of arbitrary order. After interpolating a polynomial with the 
-// degree of the ansatzspace, the hanging node constraints are   
-// distributed to the solution vector. This procedure should not 
-// change the solution vector. Hence the difference between the  
-// exact function and the FE function is measured before and     
-// after the distribution of the hanging node constraints.       
+// which constructs the constraint matrices for FE_Q<3> elements
+// of arbitrary order. After interpolating a polynomial with the
+// degree of the ansatzspace, the hanging node constraints are
+// distributed to the solution vector. This procedure should not
+// change the solution vector. Hence the difference between the
+// exact function and the FE function is measured before and
+// after the distribution of the hanging node constraints.
 
 #include "../tests.h"
 #include <deal.II/fe/fe_q.h>
 template <int dim>
 class TestFunction : public Function<dim>
 {
-  private:
-    std::vector<Polynomials::Polynomial<double> > base;
-    const unsigned int p_order;
-    
-  public:
-    TestFunction (const unsigned int p_order);
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
+private:
+  std::vector<Polynomials::Polynomial<double> > base;
+  const unsigned int p_order;
+
+public:
+  TestFunction (const unsigned int p_order);
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
 };
 
 
 template <int dim>
 TestFunction<dim>::TestFunction (const unsigned int p_order) :
-               p_order (p_order)
+  p_order (p_order)
 {
   std::vector<double> coeff(p_order);
-    
+
   for (unsigned int d = 0; d < dim; ++d)
     {
       for (unsigned int c = 0; c < p_order; ++c)
-       coeff[c] = (double) rand () / (double) RAND_MAX;
+        coeff[c] = (double) rand () / (double) RAND_MAX;
       base.push_back (Polynomials::Polynomial<double> (coeff));
-    }    
+    }
 }
 
 
 template <int dim>
 double TestFunction<dim>::value (const Point<dim>   &p,
-                                const unsigned int  /*component*/) const
+                                 const unsigned int  /*component*/) const
 {
   double val = base[0].value(p(0));
   for (unsigned int i = 1; i < dim; ++i)
@@ -96,39 +96,39 @@ double TestFunction<dim>::value (const Point<dim>   &p,
 
 
 template <int dim>
-class TestFEQConstraints 
+class TestFEQConstraints
 {
-  public:
-    TestFEQConstraints (unsigned int p_order, unsigned int refinements);
-    void run ();
-    
-  private:
-    const unsigned int refinements;
-    const unsigned int p_order;
-    
-    void refine_grid_random ();
-    void make_grid_and_dofs ();
-    
-    void test ();
-    
-    Triangulation<dim>     triangulation;
-    FE_Q<dim>              fe;
-    DoFHandler<dim>        dof_handler;
-    ConstraintMatrix     hanging_node_constraints;
+public:
+  TestFEQConstraints (unsigned int p_order, unsigned int refinements);
+  void run ();
+
+private:
+  const unsigned int refinements;
+  const unsigned int p_order;
+
+  void refine_grid_random ();
+  void make_grid_and_dofs ();
+
+  void test ();
+
+  Triangulation<dim>     triangulation;
+  FE_Q<dim>              fe;
+  DoFHandler<dim>        dof_handler;
+  ConstraintMatrix     hanging_node_constraints;
 };
 
 template <int dim>
 TestFEQConstraints<dim>::TestFEQConstraints (unsigned int p_order,
-                                            unsigned int refinements) :
-               refinements (refinements),
-               p_order (p_order),
-               fe (p_order),
-               dof_handler (triangulation)
+                                             unsigned int refinements) :
+  refinements (refinements),
+  p_order (p_order),
+  fe (p_order),
+  dof_handler (triangulation)
 {
 }
 
 
-// Actually this function creates with pseudo-random numbers errors, 
+// Actually this function creates with pseudo-random numbers errors,
 // which are then used to refine the grid. This should be a tough test for
 // the hanging nodes.
 template <int dim>
@@ -136,13 +136,13 @@ void TestFEQConstraints<dim>::refine_grid_random ()
 {
   const unsigned int n_cells = triangulation.n_active_cells();
   Vector<double> estimated_error_per_cell (n_cells);
-    
+
   for (unsigned int i = 0; i < n_cells; ++i)
     estimated_error_per_cell(i) = (double) rand () / (double) RAND_MAX;
-    
+
   GridRefinement::refine_and_coarsen_fixed_number (triangulation,
-                                                  estimated_error_per_cell,
-                                                  0.3, 0.03);
+                                                   estimated_error_per_cell,
+                                                   0.3, 0.03);
   triangulation.execute_coarsening_and_refinement ();
 }
 
@@ -152,22 +152,22 @@ void TestFEQConstraints<dim>::make_grid_and_dofs ()
 {
   GridGenerator::hyper_cube (triangulation, -1, 1);
   triangulation.refine_global (2);
-    
+
   for (unsigned int i = 0; i < refinements; ++i)
     refine_grid_random ();
-    
+
   dof_handler.distribute_dofs (fe);
-    
+
   deallog << "---------------------------------------------------------"
-         << std::endl;
+          << std::endl;
   deallog << "P-Order: " << p_order
-         << "  Number of degrees of freedom: "
-         << dof_handler.n_dofs()
-         << std::endl;
-    
+          << "  Number of degrees of freedom: "
+          << dof_handler.n_dofs()
+          << std::endl;
+
   hanging_node_constraints.clear ();
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          hanging_node_constraints);
+                                           hanging_node_constraints);
   hanging_node_constraints.close ();
 }
 
@@ -177,9 +177,9 @@ void TestFEQConstraints<dim>::test ()
 {
   TestFunction<dim> test_function (p_order);
   double l2test,
-    l2norm1,
-    l2norm2,
-    l2error;
+         l2norm1,
+         l2norm2,
+         l2error;
 
   Vector<double> solution;
   solution.reinit (dof_handler.n_dofs ());
@@ -190,39 +190,39 @@ void TestFEQConstraints<dim>::test ()
   Vector<double> norm_per_cell (triangulation.n_active_cells ());
   VectorTools::interpolate (dof_handler, test_function, solution);
 
-                                  // First error check. Simply the interpolation error of the used FE-Space
-                                  // on the given triangulation.
+  // First error check. Simply the interpolation error of the used FE-Space
+  // on the given triangulation.
   VectorTools::integrate_difference (dof_handler, solution,
-                                    ZeroFunction<dim>(1),
-                                    norm_per_cell,
-                                    quadrature,
-                                    VectorTools::L2_norm);
+                                     ZeroFunction<dim>(1),
+                                     norm_per_cell,
+                                     quadrature,
+                                     VectorTools::L2_norm);
   l2test = norm_per_cell.l2_norm ();
-  deallog << "L2-Norm of test function " 
-         << l2test << std::endl;
-    
-                                  // First error check. Simply the interpolation error of the used FE-Space
-                                  // on the given triangulation.
+  deallog << "L2-Norm of test function "
+          << l2test << std::endl;
+
+  // First error check. Simply the interpolation error of the used FE-Space
+  // on the given triangulation.
   VectorTools::integrate_difference (dof_handler, solution,
-                                    test_function,
-                                    norm_per_cell,
-                                    quadrature,
-                                    VectorTools::L2_norm);
+                                     test_function,
+                                     norm_per_cell,
+                                     quadrature,
+                                     VectorTools::L2_norm);
   l2norm1 = norm_per_cell.l2_norm () / l2test;
 
-                                  // Second error check. Interpolation error, after redistribution of the
-                                  // values onto the DoFs on the hanging nodes.
+  // Second error check. Interpolation error, after redistribution of the
+  // values onto the DoFs on the hanging nodes.
   hanging_node_constraints.distribute (solution);
   VectorTools::integrate_difference (dof_handler, solution,
-                                    test_function,
-                                    norm_per_cell,
-                                    quadrature,
-                                    VectorTools::L2_norm);
+                                     test_function,
+                                     norm_per_cell,
+                                     quadrature,
+                                     VectorTools::L2_norm);
   l2norm2 = norm_per_cell.l2_norm () / l2test;
   l2error = fabs (l2norm1 - l2norm2);
-  deallog << "Normed L2-Error 1: " << l2norm1 
-         << "  Normed L2-Error 2: " << l2norm2 << std::endl 
-         << "Normed L2-Diff: " << l2error << "   ";
+  deallog << "Normed L2-Error 1: " << l2norm1
+          << "  Normed L2-Error 2: " << l2norm2 << std::endl
+          << "Normed L2-Diff: " << l2error << "   ";
   if (l2error < 1.0e-16)
     deallog << "OK" << std::endl;
   else
@@ -231,14 +231,14 @@ void TestFEQConstraints<dim>::test ()
 
 
 template <int dim>
-void TestFEQConstraints<dim>::run () 
+void TestFEQConstraints<dim>::run ()
 {
   make_grid_and_dofs ();
   test ();
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("fe_q_constraints/output");
   deallog.attach(logfile);
@@ -246,17 +246,17 @@ int main ()
   deallog.threshold_double(1.e-10);
 
   unsigned int ref_level[] = {4,3,2};
-    
-                                  // Initialise the random generator with an
-                                  // arbitrary number. This should ensure
-                                  // reproducible results.
+
+  // Initialise the random generator with an
+  // arbitrary number. This should ensure
+  // reproducible results.
   srand (4375384);
-    
-                                  // With these parameters, the elements are
-                                  // tested up to a polynomial degree of
-                                  // 6. The triangulation is refined 2 times
-                                  // uniformly and several times (pseudo-)
-                                  // randomly.
+
+  // With these parameters, the elements are
+  // tested up to a polynomial degree of
+  // 6. The triangulation is refined 2 times
+  // uniformly and several times (pseudo-)
+  // randomly.
   TestFEQConstraints<3> *test;
   for (unsigned int p = 1; p < 4; ++p)
     {
index 648cfe4e149ddee8f8ae3e7580d4d2e45dc0fb9f..d7fe12ad89a49e74d4aae7d3f39f0b298fc7788a 100644 (file)
 template<int dim>
 void test()
 {
-  #ifdef DEAL_II_WITH_THREADS
+#ifdef DEAL_II_WITH_THREADS
 
   DeadlockKiller killer;
-  #endif
-  
-                                  // 0 components is not okay
+#endif
+
+  // 0 components is not okay
   FESystem<dim> fe(FE_Q<dim>(1), 1, FE_Q<dim>(2), 0);
   Triangulation<dim> tria;
   GridGenerator::hyper_cube(tria, 0., 1.);
   tria.refine_global(2);
-tria.begin_active()->set_refine_flag();
-tria.execute_coarsening_and_refinement();
+  tria.begin_active()->set_refine_flag();
+  tria.execute_coarsening_and_refinement();
 
   DoFHandler<dim> dofh(tria);
 
-dofh.distribute_dofs(fe);
+  dofh.distribute_dofs(fe);
 
-ConstraintMatrix cm;
+  ConstraintMatrix cm;
 
   DoFTools::make_hanging_node_constraints (dofh, cm);
   cm.close ();
 
-std::ostringstream ss;
-cm.print(ss);
+  std::ostringstream ss;
+  cm.print(ss);
+
+  deallog << ss.str() << std::endl;
 
-deallog << ss.str() << std::endl;
 
 
 
 
-  
   deallog << "ok" << std::endl;
 }
 
@@ -84,13 +84,13 @@ main()
 {
   std::ofstream logfile ("fe_system/output");
   deallog << std::setprecision(PRECISION);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
   test<2>();
-  
+
   return 0;
 }
 
index de67d1c98d575796a4de28ad46956820cf102373..375d3a72313a1352b6c29d1c66315b76c44557ee 100644 (file)
@@ -59,14 +59,14 @@ check (const FE_Q<dim>   &fe,
 
 
 #define CHECK(EL,deg,dim)\
- { FE_ ## EL<dim> EL(deg);   \
-   check(EL, #EL #deg); }
 { FE_ ## EL<dim> EL(deg);   \
+    check(EL, #EL #deg); }
 
 #define CHECK_ALL(EL,deg)\
- { CHECK(EL,deg,1); \
-   CHECK(EL,deg,2); \
-   CHECK(EL,deg,3); \
- }
 { CHECK(EL,deg,1); \
+    CHECK(EL,deg,2); \
+    CHECK(EL,deg,3); \
 }
 
 
 int
@@ -84,30 +84,30 @@ main()
       CHECK_ALL(Q,2);
       CHECK_ALL(Q,3);
       CHECK_ALL(Q,4);
-  
+
       return 0;
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index d612e90893121e52935abf157bf88b845039ce7c..9ec77bb84d7157ffdb73381a81d510b05c1f9e1f 100644 (file)
@@ -59,14 +59,14 @@ check (const FE_Q<dim>   &fe,
 
 
 #define CHECK(EL,deg,dim)\
- { FE_ ## EL<dim> EL(deg);   \
-   check(EL, #EL #deg); }
 { FE_ ## EL<dim> EL(deg);   \
+    check(EL, #EL #deg); }
 
 #define CHECK_ALL(EL,deg)\
- { CHECK(EL,deg,1); \
-   CHECK(EL,deg,2); \
-   CHECK(EL,deg,3); \
- }
 { CHECK(EL,deg,1); \
+    CHECK(EL,deg,2); \
+    CHECK(EL,deg,3); \
 }
 
 
 int
@@ -78,36 +78,36 @@ main()
       deallog << std::setprecision (2);
       deallog.attach(logfile);
       deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);
+      deallog.threshold_double(1.e-10);
 
       CHECK_ALL(Q,1);
       CHECK_ALL(Q,2);
       CHECK_ALL(Q,3);
       CHECK_ALL(Q,4);
-  
+
       return 0;
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index a1055afba02e3e238ecf97e3348942c7ad13b4fc..5b1a5f6b97f302d30a885bdc196c96e9e3009a9c 100644 (file)
@@ -34,9 +34,9 @@
 #include <string>
 
 
-// check invertability of the map from 
+// check invertability of the map from
 //   DoFTools::hierarchic_to_lexicographic_numbering
-// to  
+// to
 //   DoFTools::lexicographic_to_hierarchic_numbering
 
 
@@ -64,8 +64,8 @@ check (const FE_Q<dim>   &fe,
       Assert (n1[n2[i]] == i,
               ExcInternalError());
       Assert (n2[n1[i]] == i,
-              ExcInternalError());      
-      
+              ExcInternalError());
+
       deallog << n1[n2[i]] << " ";
     }
   deallog << std::endl;
@@ -76,14 +76,14 @@ check (const FE_Q<dim>   &fe,
 
 
 #define CHECK(EL,deg,dim)\
- { FE_ ## EL<dim> EL(deg);   \
-   check(EL, #EL #deg); }
 { FE_ ## EL<dim> EL(deg);   \
+    check(EL, #EL #deg); }
 
 #define CHECK_ALL(EL,deg)\
- { CHECK(EL,deg,1); \
-   CHECK(EL,deg,2); \
-   CHECK(EL,deg,3); \
- }
 { CHECK(EL,deg,1); \
+    CHECK(EL,deg,2); \
+    CHECK(EL,deg,3); \
 }
 
 
 int
@@ -95,36 +95,36 @@ main()
       deallog << std::setprecision (2);
       deallog.attach(logfile);
       deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);
+      deallog.threshold_double(1.e-10);
 
       CHECK_ALL(Q,1);
       CHECK_ALL(Q,2);
       CHECK_ALL(Q,3);
       CHECK_ALL(Q,4);
-  
+
       return 0;
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index c75b2aa11624b1fd0d301f70302bc27b5e2923e5..204c6d5b7b4066412ee949776456af0c4d20def0 100644 (file)
@@ -31,17 +31,17 @@ void
 check_this (const FiniteElement<dim> &fe1,
             const FiniteElement<dim> &fe2)
 {
-                                   // only check if both elements have
-                                   // support points. otherwise,
-                                   // interpolation doesn't really
-                                   // work.
+  // only check if both elements have
+  // support points. otherwise,
+  // interpolation doesn't really
+  // work.
   if ((fe1.get_unit_support_points().size() == 0) ||
       (fe2.get_unit_support_points().size() == 0))
     return;
-                                   //  likewise for non-primitive elements
+  //  likewise for non-primitive elements
   if (!fe1.is_primitive() || !fe2.is_primitive())
     return;
-  
+
   FullMatrix<double> m (fe2.dofs_per_cell,
                         fe1.dofs_per_cell);
   FETools::get_interpolation_matrix (fe1, fe2, m);
index c502a8a4e4a09b3aef3eb7aa427f68c3ae234cf4..ebaba61ca83479d090d04509e433a14627ccc21d 100644 (file)
@@ -31,17 +31,17 @@ void
 check_this (const FiniteElement<dim> &fe1,
             const FiniteElement<dim> &fe2)
 {
-                                   // only check if both elements have
-                                   // support points. otherwise,
-                                   // interpolation doesn't really
-                                   // work
+  // only check if both elements have
+  // support points. otherwise,
+  // interpolation doesn't really
+  // work
   if ((fe1.get_unit_support_points().size() == 0) ||
       (fe2.get_unit_support_points().size() == 0))
     return;
-                                   //  likewise for non-primitive elements
+  //  likewise for non-primitive elements
   if (!fe1.is_primitive() || !fe2.is_primitive())
     return;
-  
+
   FullMatrix<double> m (fe1.dofs_per_cell,
                         fe1.dofs_per_cell);
   FETools::get_back_interpolation_matrix (fe1, fe2, m);
index d52f21c810169a71fe21a7a5d27f8dc12d12c154..cbc28821e90dadf68cfe9abff74994dbcf9b61e5 100644 (file)
@@ -31,17 +31,17 @@ void
 check_this (const FiniteElement<dim> &fe1,
             const FiniteElement<dim> &fe2)
 {
-                                   // only check if both elements have
-                                   // support points. otherwise,
-                                   // interpolation doesn't really
-                                   // work
+  // only check if both elements have
+  // support points. otherwise,
+  // interpolation doesn't really
+  // work
   if ((fe1.get_unit_support_points().size() == 0) ||
       (fe2.get_unit_support_points().size() == 0))
     return;
-                                   //  likewise for non-primitive elements
+  //  likewise for non-primitive elements
   if (!fe1.is_primitive() || !fe2.is_primitive())
     return;
-  
+
   FullMatrix<double> m (fe1.dofs_per_cell,
                         fe1.dofs_per_cell);
   FETools::get_interpolation_difference_matrix (fe1, fe2, m);
index 49a115726699151f4b67d3c8055295752ea21ce9..958e44142d03de8963b9faf44bd8d2dda982fb6e 100644 (file)
@@ -31,18 +31,18 @@ void
 check_this (const FiniteElement<dim> &fe1,
             const FiniteElement<dim> &fe2)
 {
-                                   // only check if both elements have
-                                   // support points. otherwise,
-                                   // interpolation doesn't really
-                                   // work
+  // only check if both elements have
+  // support points. otherwise,
+  // interpolation doesn't really
+  // work
   if ((fe1.get_unit_support_points().size() == 0) ||
       (fe2.get_unit_support_points().size() == 0))
     return;
-                                   //  likewise for non-primitive elements
+  //  likewise for non-primitive elements
   if (!fe1.is_primitive() || !fe2.is_primitive())
     return;
-                                   // we need to have dof_constraints
-                                   // for this test
+  // we need to have dof_constraints
+  // for this test
   if (!fe2.constraints_are_implemented())
     return;
 
@@ -52,11 +52,11 @@ check_this (const FiniteElement<dim> &fe1,
   ConstraintMatrix cm;
   DoFTools::make_hanging_node_constraints (*dof2, cm);
   cm.close ();
-  
+
   Vector<double> in (dof1->n_dofs());
   for (unsigned int i=0; i<in.size(); ++i) in(i) = i;
   Vector<double> out (dof2->n_dofs());
-  
+
   FETools::interpolate (*dof1, in, *dof2, cm, out);
   output_vector (out);
 }
index 08153631ce2c9673913e49b883c75134020015d0..55136b7a8d2cb33a131aa094b558c07a5f2eb606 100644 (file)
@@ -31,18 +31,18 @@ void
 check_this (const FiniteElement<dim> &fe1,
             const FiniteElement<dim> &fe2)
 {
-                                   // only check if both elements have
-                                   // support points. otherwise,
-                                   // interpolation doesn't really
-                                   // work
+  // only check if both elements have
+  // support points. otherwise,
+  // interpolation doesn't really
+  // work
   if ((fe1.get_unit_support_points().size() == 0) ||
       (fe2.get_unit_support_points().size() == 0))
     return;
-                                   //  likewise for non-primitive elements
+  //  likewise for non-primitive elements
   if (!fe1.is_primitive() || !fe2.is_primitive())
     return;
-                                   // we need to have dof_constraints
-                                   // for this test
+  // we need to have dof_constraints
+  // for this test
   if (!fe1.constraints_are_implemented() ||
       !fe2.constraints_are_implemented())
     return;
@@ -55,11 +55,11 @@ check_this (const FiniteElement<dim> &fe1,
   DoFTools::make_hanging_node_constraints (*dof2, cm2);
   cm1.close ();
   cm2.close ();
-  
+
   Vector<double> in (dof1->n_dofs());
   for (unsigned int i=0; i<in.size(); ++i) in(i) = i;
   Vector<double> out (dof1->n_dofs());
-  
+
   FETools::back_interpolate (*dof1, cm1, in, *dof2, cm2, out);
   output_vector (out);
 }
index 15877c80973d84a208511a338d10e214ec4c8c64..95e8002f15494c80cd8c284aae627c35291af850 100644 (file)
@@ -32,18 +32,18 @@ void
 check_this (const FiniteElement<dim> &fe1,
             const FiniteElement<dim> &fe2)
 {
-                                   // only check if both elements have
-                                   // support points. otherwise,
-                                   // interpolation doesn't really
-                                   // work
+  // only check if both elements have
+  // support points. otherwise,
+  // interpolation doesn't really
+  // work
   if ((fe1.get_unit_support_points().size() == 0) ||
       (fe2.get_unit_support_points().size() == 0))
     return;
-                                   //  likewise for non-primitive elements
+  //  likewise for non-primitive elements
   if (!fe1.is_primitive() || !fe2.is_primitive())
     return;
-                                   // we need to have dof_constraints
-                                   // for this test
+  // we need to have dof_constraints
+  // for this test
   if (!fe1.constraints_are_implemented() ||
       !fe2.constraints_are_implemented())
     return;
@@ -56,11 +56,11 @@ check_this (const FiniteElement<dim> &fe1,
   DoFTools::make_hanging_node_constraints (*dof2, cm2);
   cm1.close ();
   cm2.close ();
-  
+
   parallel::distributed::Vector<double> in (dof1->n_dofs());
   for (unsigned int i=0; i<in.size(); ++i) in(i) = i;
   parallel::distributed::Vector<double> out (dof1->n_dofs());
-  
+
   FETools::back_interpolate (*dof1, cm1, in, *dof2, cm2, out);
   output_vector (out);
 }
index 3a2796a44676faad7986dd02139b595460eade41..05720ea7cd53f90668ee04e9bca04a2f18d9e838 100644 (file)
@@ -31,18 +31,18 @@ void
 check_this (const FiniteElement<dim> &fe1,
             const FiniteElement<dim> &fe2)
 {
-                                   // only check if both elements have
-                                   // support points. otherwise,
-                                   // interpolation doesn't really
-                                   // work
+  // only check if both elements have
+  // support points. otherwise,
+  // interpolation doesn't really
+  // work
   if ((fe1.get_unit_support_points().size() == 0) ||
       (fe2.get_unit_support_points().size() == 0))
     return;
-                                   //  likewise for non-primitive elements
+  //  likewise for non-primitive elements
   if (!fe1.is_primitive() || !fe2.is_primitive())
     return;
-                                   // we need to have dof_constraints
-                                   // for this test
+  // we need to have dof_constraints
+  // for this test
   if (!fe1.constraints_are_implemented() ||
       !fe2.constraints_are_implemented())
     return;
@@ -55,11 +55,11 @@ check_this (const FiniteElement<dim> &fe1,
   DoFTools::make_hanging_node_constraints (*dof2, cm2);
   cm1.close ();
   cm2.close ();
-  
+
   Vector<double> in (dof1->n_dofs());
   for (unsigned int i=0; i<in.size(); ++i) in(i) = i;
   Vector<double> out (dof1->n_dofs());
-  
+
   FETools::interpolation_difference (*dof1, cm1, in, *dof2, cm2, out);
   output_vector (out);
 }
index 02779cf486e77e0bb4a16440b8252e24dfc6a79f..8a474a21bc3c1528308debcde74e76adc4f914f7 100644 (file)
@@ -31,36 +31,36 @@ void
 check_this (const FiniteElement<dim> &fe1,
             const FiniteElement<dim> &fe2)
 {
-                                   // only check if both elements have
-                                   // support points. otherwise,
-                                   // interpolation doesn't really
-                                   // work
+  // only check if both elements have
+  // support points. otherwise,
+  // interpolation doesn't really
+  // work
   if ((fe1.get_unit_support_points().size() == 0) ||
       (fe2.get_unit_support_points().size() == 0))
     return;
-                                   //  likewise for non-primitive elements
+  //  likewise for non-primitive elements
   if (!fe1.is_primitive() || !fe2.is_primitive())
     return;
-                                   // we need to have dof_constraints
-                                   // for this test
+  // we need to have dof_constraints
+  // for this test
   if (!fe2.constraints_are_implemented())
     return;
-                                   // we need prolongation matrices in
-                                   // fe2
+  // we need prolongation matrices in
+  // fe2
   if (!fe2.isotropic_restriction_is_implemented())
     return;
-  
+
   std::auto_ptr<Triangulation<dim> > tria(make_tria<dim>());
   std::auto_ptr<DoFHandler<dim> >    dof1(make_dof_handler (*tria, fe1));
   std::auto_ptr<DoFHandler<dim> >    dof2(make_dof_handler (*tria, fe2));
   ConstraintMatrix cm;
   DoFTools::make_hanging_node_constraints (*dof2, cm);
   cm.close ();
-  
+
   Vector<double> in (dof1->n_dofs());
   for (unsigned int i=0; i<in.size(); ++i) in(i) = i;
   Vector<double> out (dof2->n_dofs());
-  
+
   FETools::extrapolate (*dof1, in, *dof2, cm, out);
   output_vector (out);
 }
index 4b9451dd08f685f058d6418eb8a76f8e47477916..2304f0b6bde46b02a8a297e8a92e7f00368e39b9 100644 (file)
@@ -33,24 +33,24 @@ check_this (const FiniteElement<dim> &fe1,
 {
   FiniteElement<dim> *p1, *p2;
 
-                                  // check that the name of the fe
-                                  // and the name of the fe that we
-                                  // re-create from this name are
-                                  // identitical. this is also a
-                                  // pretty good indication that the
-                                  // two FEs are actually the same
+  // check that the name of the fe
+  // and the name of the fe that we
+  // re-create from this name are
+  // identitical. this is also a
+  // pretty good indication that the
+  // two FEs are actually the same
   deallog << fe1.get_name();
   p1 = FETools::get_fe_from_name<dim> (fe1.get_name());
   Assert (fe1.get_name() == p1->get_name(),
-         ExcInternalError());
+          ExcInternalError());
   deallog << " ok" << std::endl;
   delete p1;
 
-                                  // same for fe2
+  // same for fe2
   deallog << fe2.get_name();
   p2 = FETools::get_fe_from_name<dim> (fe2.get_name());
   Assert (fe2.get_name() == p2->get_name(),
-         ExcInternalError());
+          ExcInternalError());
   deallog << " ok" << std::endl;
   delete p2;
 }
index d0cd4d9394ae83fef4bffa102700fd5160b77cf0..4478ff9fe0911487c7f7a12c923778c901839aca 100644 (file)
@@ -40,7 +40,7 @@ std::string modify_name (const std::string &name)
   std::string::size_type pos;
   while ((pos = new_name.find(dim_name)) != std::string::npos)
     new_name.replace (pos, 3, "<dim>");
-  
+
   return new_name;
 }
 
@@ -53,24 +53,24 @@ check_this (const FiniteElement<dim> &fe1,
 {
   FiniteElement<dim> *p1, *p2;
 
-                                  // check that the name of the fe
-                                  // and the name of the fe that we
-                                  // re-create from this name are
-                                  // identitical. this is also a
-                                  // pretty good indication that the
-                                  // two FEs are actually the same
+  // check that the name of the fe
+  // and the name of the fe that we
+  // re-create from this name are
+  // identitical. this is also a
+  // pretty good indication that the
+  // two FEs are actually the same
   deallog << modify_name<dim> (fe1.get_name());
   p1 = FETools::get_fe_from_name<dim> (modify_name<dim> (fe1.get_name()));
   Assert (fe1.get_name() == p1->get_name(),
-         ExcInternalError());
+          ExcInternalError());
   deallog << " ok" << std::endl;
   delete p1;
 
-                                  // same for fe2
+  // same for fe2
   deallog << modify_name<dim> (fe2.get_name());
   p2 = FETools::get_fe_from_name<dim> (modify_name<dim> (fe2.get_name()));
   Assert (fe2.get_name() == p2->get_name(),
-         ExcInternalError());
+          ExcInternalError());
   deallog << " ok" << std::endl;
   delete p2;
 }
index 36c17b5eb08243985ff082890bd83bc41b8757c9..39759d64c617d5f58b1e47ee14615115b430b34a 100644 (file)
@@ -39,7 +39,7 @@ std::string modify_name (const std::string &name)
   std::string::size_type pos;
   while ((pos = new_name.find(dim_name)) != std::string::npos)
     new_name.replace (pos, 3, "");
-  
+
   return new_name;
 }
 
@@ -52,24 +52,24 @@ check_this (const FiniteElement<dim> &fe1,
 {
   FiniteElement<dim> *p1, *p2;
 
-                                  // check that the name of the fe
-                                  // and the name of the fe that we
-                                  // re-create from this name are
-                                  // identitical. this is also a
-                                  // pretty good indication that the
-                                  // two FEs are actually the same
+  // check that the name of the fe
+  // and the name of the fe that we
+  // re-create from this name are
+  // identitical. this is also a
+  // pretty good indication that the
+  // two FEs are actually the same
   deallog << modify_name<dim> (fe1.get_name());
   p1 = FETools::get_fe_from_name<dim> (modify_name<dim> (fe1.get_name()));
   Assert (fe1.get_name() == p1->get_name(),
-         ExcInternalError());
+          ExcInternalError());
   deallog << " ok" << std::endl;
   delete p1;
 
-                                  // same for fe2
+  // same for fe2
   deallog << modify_name<dim> (fe2.get_name());
   p2 = FETools::get_fe_from_name<dim> (modify_name<dim> (fe2.get_name()));
   Assert (fe2.get_name() == p2->get_name(),
-         ExcInternalError());
+          ExcInternalError());
   deallog << " ok" << std::endl;
   delete p2;
 }
index 9bc2b434ea01ab9760372bd8bce1ac277c9a8cb1..6883d675d3d9537dba6051cebadc350d0811ddeb 100644 (file)
@@ -31,22 +31,22 @@ void
 check_this (const FiniteElement<dim> &fe1,
             const FiniteElement<dim> &fe2)
 {
-                                  // use a higher output accuracy for this
-                                  // test. the reason is that many of the
-                                  // constraints are negative powers of 2,
-                                  // which have exact representations with 3
-                                  // or 4 digits of accuracy, but not with
-                                  // the usual 2 digits (for example, 0.375,
-                                  // which sometimes rounds to 0.38 and
-                                  // sometimes to 0.37, depending on how
-                                  // intermediate errors have accumulated)
+  // use a higher output accuracy for this
+  // test. the reason is that many of the
+  // constraints are negative powers of 2,
+  // which have exact representations with 3
+  // or 4 digits of accuracy, but not with
+  // the usual 2 digits (for example, 0.375,
+  // which sometimes rounds to 0.38 and
+  // sometimes to 0.37, depending on how
+  // intermediate errors have accumulated)
   deallog << std::setprecision (3);
 
   if (fe1.n_components() != 1)
     return;
   if (fe1.n_components() != fe2.n_components())
     return;
-  
+
   FullMatrix<double> X (fe2.dofs_per_cell, fe1.dofs_per_cell);
   FETools::get_projection_matrix (fe1, fe2, X);
 
index 3a3824389eae4dbcd4a6e90544a2aace64dc768c..e38ba066d6fad7b95c4d8c9c32ce488af0832f61 100644 (file)
@@ -34,8 +34,8 @@ check_this (const FiniteElement<dim> &fe1,
             const FiniteElement<dim> &fe2)
 {
   deallog << (fe1.hp_constraints_are_implemented () ? "true" : "false")
-         << std::endl;
+          << std::endl;
   deallog << (fe2.hp_constraints_are_implemented () ? "true" : "false")
-         << std::endl;
+          << std::endl;
 }
 
index 66051b8a0103ccf9f0a63d40cea60ad46d347d49..a00ed55d1a1f44401dbd47c7f07ce13089c3b6bd 100644 (file)
@@ -1,6 +1,6 @@
 //----------------------------  fe_tools_common.h  ---------------------------
 //    $Id$
-//    Version: $Name$ 
+//    Version: $Name$
 //
 //    Copyright (C) 2003, 2004, 2005, 2006, 2007, 2010, 2013 by the deal.II authors
 //
@@ -48,7 +48,7 @@ check_this (const FiniteElement<dim> &fe1,
 // forward declaration of a variable with the name of the output file
 extern std::string output_file_name;
 
-  
+
 
 // output some indicators for a given matrix. we don't write out the
 // entire matrix since this would blow up our output files beyond
@@ -61,12 +61,12 @@ output_matrix (const FullMatrix<double> &m)
       deallog << "(Empty matrix)" << std::endl;
       return;
     }
-  
+
   deallog << m.l1_norm() << ' ' << m.linfty_norm()
           << std::endl;
   if (m.m() == m.n())
     deallog << m.frobenius_norm() << std::endl;
-  
+
   for (unsigned int i=0; i<std::min(m.m(),m.n()); ++i)
     deallog << m(i,i) << ' ' << m(i,std::min(m.m(),m.n())-i-1) << ' ';
   deallog << std::endl;
@@ -81,10 +81,10 @@ output_vector (const VECTOR &v)
   deallog << v.l1_norm() << ' ' << v.l2_norm() << ' ' << v.linfty_norm()
           << std::endl;
 
-                                   // write out at most 20 equispaced
-                                   // elements of the vector
+  // write out at most 20 equispaced
+  // elements of the vector
   for (unsigned int i=0; i<v.size(); i+=std::max(static_cast<typename VECTOR::size_type>(1),
-        static_cast<typename VECTOR::size_type>(v.size()/20)))
+                                                 static_cast<typename VECTOR::size_type>(v.size()/20)))
     deallog << v(i) << ' ';
   deallog << std::endl;
 }
@@ -93,7 +93,7 @@ output_vector (const VECTOR &v)
 
 
 template <int dim>
-Triangulation<dim> * make_tria ()
+Triangulation<dim> *make_tria ()
 {
   Triangulation<dim> *tria = new Triangulation<dim>();
   GridGenerator::hyper_cube(*tria, 0., 1.);
@@ -109,8 +109,8 @@ Triangulation<dim> * make_tria ()
 
 
 template <int dim>
-DoFHandler<dim> * make_dof_handler (const Triangulation<dim> &tria,
-                                    const FiniteElement<dim> &fe)
+DoFHandler<dim> *make_dof_handler (const Triangulation<dim> &tria,
+                                   const FiniteElement<dim> &fe)
 {
   DoFHandler<dim> *dof_handler = new DoFHandler<dim>(tria);
   dof_handler->distribute_dofs (fe);
@@ -128,8 +128,8 @@ check (const FiniteElement<dim> &fe1,
   deallog << "Checking " << name
           << " in " << dim << "d:"
           << std::endl;
-  
-                                   // call main function in .cc files
+
+  // call main function in .cc files
   check_this (fe1, fe2);
 }
 
@@ -138,18 +138,18 @@ check (const FiniteElement<dim> &fe1,
 
 
 #define CHECK(EL1,deg1,EL2,deg2,dim)\
- { FE_ ## EL1<dim> fe1(deg1);   \
-   FE_ ## EL2<dim> fe2(deg2);   \
-   check(fe1, fe2, #EL1 #deg1 " against " #EL2 #deg2); \
-   check(fe2, fe1, #EL2 #deg2 " against " #EL1 #deg1); \
- }
 { FE_ ## EL1<dim> fe1(deg1);   \
+    FE_ ## EL2<dim> fe2(deg2);   \
+    check(fe1, fe2, #EL1 #deg1 " against " #EL2 #deg2); \
+    check(fe2, fe1, #EL2 #deg2 " against " #EL1 #deg1); \
 }
 
 #define CHECK_SYS1(sub1_1,N1_1,sub2_1,N2_1,dim) \
- { FESystem<dim> fe1(sub1_1, N1_1);   \
-   FESystem<dim> fe2(sub2_1, N2_1);   \
-   check(fe1, fe2, #sub1_1 #N1_1 " against " #sub2_1 #N2_1); \
-   check(fe2, fe1, #sub2_1 #N2_1 " against " #sub1_1 #N1_1); \
- }
 { FESystem<dim> fe1(sub1_1, N1_1);   \
+    FESystem<dim> fe2(sub2_1, N2_1);   \
+    check(fe1, fe2, #sub1_1 #N1_1 " against " #sub2_1 #N2_1); \
+    check(fe2, fe1, #sub2_1 #N2_1 " against " #sub1_1 #N1_1); \
 }
 
 /*
 #define CHECK_SYS2(sub1,N1,sub2,N2,dim) \
@@ -162,10 +162,10 @@ check (const FiniteElement<dim> &fe1,
 
 */
 #define CHECK_ALL(EL1,deg1,EL2,deg2)\
- { CHECK(EL1,deg1,EL2,deg2,1); \
-   CHECK(EL1,deg1,EL2,deg2,2); \
-   CHECK(EL1,deg1,EL2,deg2,3); \
- }
 { CHECK(EL1,deg1,EL2,deg2,1); \
+    CHECK(EL1,deg1,EL2,deg2,2); \
+    CHECK(EL1,deg1,EL2,deg2,3); \
 }
 
 
 int
@@ -207,10 +207,10 @@ main()
       CHECK_ALL(DGP,2,DGP,2);
       CHECK_ALL(DGP,2,DGP,4);
       CHECK_ALL(DGP,3,DGP,3);
-      
+
       CHECK(Nedelec, 0, Nedelec, 0, 2);
       CHECK(Nedelec, 0, Nedelec, 0, 3);
-  
+
 
       CHECK_SYS1(FE_Q<1>(1),  3,
                  FE_Q<1>(2),  3,
@@ -243,76 +243,76 @@ main()
                  3);
 
 
-/*
-      CHECK_SYS2(FE_Q<1>(1),  3,FE_DGQ<1>(2),2,1);
-      CHECK_SYS2(FE_DGQ<1>(2),2,FE_DGP<1>(3),1,1);
-      CHECK_SYS2(FE_DGP<1>(3),1,FE_DGQ<1>(2),2,1);
-
-      CHECK_SYS2(FE_Q<2>(1),  3,FE_DGQ<2>(2),2,2);
-      CHECK_SYS2(FE_DGQ<2>(2),2,FE_DGP<2>(3),1,2);
-      CHECK_SYS2(FE_DGP<2>(3),1,FE_DGQ<2>(2),2,2);
-
-      CHECK_SYS2(FE_Q<3>(1)  ,3,FE_DGQ<3>(2),2,3);
-      CHECK_SYS2(FE_DGQ<3>(2),2,FE_DGP<3>(3),1,3);
-      CHECK_SYS2(FE_DGP<3>(3),1,FE_DGQ<3>(2),2,3);
-
-
-      CHECK_SYS3(FE_Q<1>(1),  3,FE_DGP<1>(3),1,FE_Q<1>(1),3,1);
-      CHECK_SYS3(FE_DGQ<1>(2),2,FE_DGQ<1>(2),2,FE_Q<1>(3),3,1);
-      CHECK_SYS3(FE_DGP<1>(3),1,FE_DGP<1>(3),1,FE_Q<1>(2),3,1);
-
-      CHECK_SYS3(FE_Q<2>(1),  3,FE_DGP<2>(3),1,FE_Q<2>(1),3,2);
-      CHECK_SYS3(FE_DGQ<2>(2),2,FE_DGQ<2>(2),2,FE_Q<2>(3),3,2);
-      CHECK_SYS3(FE_DGP<2>(3),1,FE_DGP<2>(3),1,FE_Q<2>(2),3,2);
-
-      CHECK_SYS3(FE_Q<3>(1),  3,FE_DGP<3>(3),1,FE_Q<3>(1),3,3);
-      CHECK_SYS3(FE_DGQ<3>(2),2,FE_DGQ<3>(2),2,FE_Q<3>(3),3,3);
-      CHECK_SYS3(FE_DGP<3>(3),1,FE_DGP<3>(3),1,FE_Q<3>(2),3,3);
-
-                                       // systems of systems  
-      CHECK_SYS3((FESystem<2>(FE_Q<2>(1),3)), 3,
-                 FE_DGQ<2>(3), 1,
-                 FE_Q<2>(1), 3,
-                 2);
-      CHECK_SYS3(FE_DGQ<2>(3), 1,
-                 FESystem<2>(FE_DGQ<2>(3),3), 1,
-                 FESystem<2>(FE_Q<2>(2),3,
-                             FE_DGQ<2>(0),1),2,
-                 2);
-
-                                       // systems with Nedelec elements
-      CHECK_SYS2 (FE_DGQ<2>(3), 1,
-                  FE_Nedelec<2>(0), 2,
-                  2);
-      CHECK_SYS3(FE_Nedelec<2>(0), 1,
-                 FESystem<2>(FE_DGQ<2>(3),3), 1,
-                 FESystem<2>(FE_Q<2>(2),3,
-                             FE_Nedelec<2>(0),2),2,
-                 2);
-*/  
+      /*
+            CHECK_SYS2(FE_Q<1>(1),  3,FE_DGQ<1>(2),2,1);
+            CHECK_SYS2(FE_DGQ<1>(2),2,FE_DGP<1>(3),1,1);
+            CHECK_SYS2(FE_DGP<1>(3),1,FE_DGQ<1>(2),2,1);
+
+            CHECK_SYS2(FE_Q<2>(1),  3,FE_DGQ<2>(2),2,2);
+            CHECK_SYS2(FE_DGQ<2>(2),2,FE_DGP<2>(3),1,2);
+            CHECK_SYS2(FE_DGP<2>(3),1,FE_DGQ<2>(2),2,2);
+
+            CHECK_SYS2(FE_Q<3>(1)  ,3,FE_DGQ<3>(2),2,3);
+            CHECK_SYS2(FE_DGQ<3>(2),2,FE_DGP<3>(3),1,3);
+            CHECK_SYS2(FE_DGP<3>(3),1,FE_DGQ<3>(2),2,3);
+
+
+            CHECK_SYS3(FE_Q<1>(1),  3,FE_DGP<1>(3),1,FE_Q<1>(1),3,1);
+            CHECK_SYS3(FE_DGQ<1>(2),2,FE_DGQ<1>(2),2,FE_Q<1>(3),3,1);
+            CHECK_SYS3(FE_DGP<1>(3),1,FE_DGP<1>(3),1,FE_Q<1>(2),3,1);
+
+            CHECK_SYS3(FE_Q<2>(1),  3,FE_DGP<2>(3),1,FE_Q<2>(1),3,2);
+            CHECK_SYS3(FE_DGQ<2>(2),2,FE_DGQ<2>(2),2,FE_Q<2>(3),3,2);
+            CHECK_SYS3(FE_DGP<2>(3),1,FE_DGP<2>(3),1,FE_Q<2>(2),3,2);
+
+            CHECK_SYS3(FE_Q<3>(1),  3,FE_DGP<3>(3),1,FE_Q<3>(1),3,3);
+            CHECK_SYS3(FE_DGQ<3>(2),2,FE_DGQ<3>(2),2,FE_Q<3>(3),3,3);
+            CHECK_SYS3(FE_DGP<3>(3),1,FE_DGP<3>(3),1,FE_Q<3>(2),3,3);
+
+                                             // systems of systems
+            CHECK_SYS3((FESystem<2>(FE_Q<2>(1),3)), 3,
+                       FE_DGQ<2>(3), 1,
+                       FE_Q<2>(1), 3,
+                       2);
+            CHECK_SYS3(FE_DGQ<2>(3), 1,
+                       FESystem<2>(FE_DGQ<2>(3),3), 1,
+                       FESystem<2>(FE_Q<2>(2),3,
+                                   FE_DGQ<2>(0),1),2,
+                       2);
+
+                                             // systems with Nedelec elements
+            CHECK_SYS2 (FE_DGQ<2>(3), 1,
+                        FE_Nedelec<2>(0), 2,
+                        2);
+            CHECK_SYS3(FE_Nedelec<2>(0), 1,
+                       FESystem<2>(FE_DGQ<2>(3),3), 1,
+                       FESystem<2>(FE_Q<2>(2),3,
+                                   FE_Nedelec<2>(0),2),2,
+                       2);
+      */
       return 0;
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 5961228dfa7b4c2db0c20a57262ca5a17c6a0d05..99c287499ab99d930303e61998dac724edc73722 100644 (file)
@@ -38,32 +38,32 @@ void
 check_this (const FiniteElement<dim> &fe,
             const FiniteElement<dim> &/*fe2*/)
 {
-                                   // only check if both elements have
-                                   // support points. otherwise,
-                                   // interpolation doesn't really
-                                   // work
+  // only check if both elements have
+  // support points. otherwise,
+  // interpolation doesn't really
+  // work
   if (fe.n_components() != 1)
     return;
 
-                                   // ignore this check if this fe has already
-                                   // been treated
+  // ignore this check if this fe has already
+  // been treated
   static std::set<std::string> already_checked;
   if (already_checked.find(fe.get_name()) != already_checked.end())
     return;
   already_checked.insert (fe.get_name());
-  
 
-                                   // test with different quadrature formulas
+
+  // test with different quadrature formulas
   QGauss<dim> q_lhs(fe.degree+1);
   QGauss<dim> q_rhs(fe.degree+1>2 ? fe.degree+1-2 : 1);
-      
+
   FullMatrix<double> X (fe.dofs_per_cell,
                         q_rhs.size());
 
   FETools::compute_projection_from_quadrature_points_matrix (fe,
                                                              q_lhs, q_rhs,
                                                              X);
-      
+
   output_matrix (X);
 }
 
index 7192bbeb7e43b04e01266b80bbf0eef1ffb2d2bc..60a74547c273c9aa350d707e5ba14ed3665fff04 100644 (file)
@@ -39,38 +39,38 @@ void
 check_this (const FiniteElement<dim> &fe,
             const FiniteElement<dim> &/*fe2*/)
 {
-                                   // only check if both elements have
-                                   // support points. otherwise,
-                                   // interpolation doesn't really
-                                   // work
+  // only check if both elements have
+  // support points. otherwise,
+  // interpolation doesn't really
+  // work
   if (fe.n_components() != 1)
     return;
 
-                                   // ignore this check if this fe has already
-                                   // been treated
+  // ignore this check if this fe has already
+  // been treated
   static std::set<std::string> already_checked;
   if (already_checked.find(fe.get_name()) != already_checked.end())
     return;
   already_checked.insert (fe.get_name());
-  
 
-                                   // test with the same quadrature formulas
-                                   // of a degree that is high enough to
-                                   // exactly capture the data
+
+  // test with the same quadrature formulas
+  // of a degree that is high enough to
+  // exactly capture the data
   QGauss<dim> q_lhs(fe.degree+1);
   QGauss<dim> q_rhs(fe.degree+1);
 
-                                   // this test can only succeed if there are
-                                   // at least as many degrees of freedom in
-                                   // the finite element as there are
-                                   // quadrature points
+  // this test can only succeed if there are
+  // at least as many degrees of freedom in
+  // the finite element as there are
+  // quadrature points
   if (fe.dofs_per_cell < q_rhs.size())
     return;
 
   deallog << "dofs_per_cell=" << fe.dofs_per_cell
           << ", n_q_points=" << q_rhs.size()
           << std::endl;
-  
+
   FullMatrix<double> X (fe.dofs_per_cell,
                         q_rhs.size());
 
@@ -78,9 +78,9 @@ check_this (const FiniteElement<dim> &fe,
                                                              q_lhs, q_rhs,
                                                              X);
 
-                                   // then compute the matrix that
-                                   // interpolates back to the quadrature
-                                   // points
+  // then compute the matrix that
+  // interpolates back to the quadrature
+  // points
   FullMatrix<double> I_q (q_rhs.size(), fe.dofs_per_cell);
   FETools::compute_interpolation_to_quadrature_points_matrix (fe, q_rhs,
                                                               I_q);
@@ -89,9 +89,9 @@ check_this (const FiniteElement<dim> &fe,
                               q_rhs.size());
   I_q.mmult (product, X);
 
-                                   // the product should be the identity
-                                   // matrix now. make sure that this is
-                                   // indeed the case
+  // the product should be the identity
+  // matrix now. make sure that this is
+  // indeed the case
   for (unsigned int i=0; i<product.m(); ++i)
     product(i,i) -= 1;
 
index ce00206b6013a93750592fab4bb33553a4e80e74..304b0f4ff7b6024a16b2e401c45554de2a8e4a2e 100644 (file)
@@ -40,32 +40,32 @@ void
 check_this (const FiniteElement<dim> &fe,
             const FiniteElement<dim> &/*fe2*/)
 {
-                                   // only check if both elements have
-                                   // support points. otherwise,
-                                   // interpolation doesn't really
-                                   // work
+  // only check if both elements have
+  // support points. otherwise,
+  // interpolation doesn't really
+  // work
   if (fe.n_components() != 1)
     return;
 
-                                   // ignore this check if this fe has already
-                                   // been treated
+  // ignore this check if this fe has already
+  // been treated
   static std::set<std::string> already_checked;
   if (already_checked.find(fe.get_name()) != already_checked.end())
     return;
   already_checked.insert (fe.get_name());
-  
 
-                                   // test with different quadrature formulas
+
+  // test with different quadrature formulas
   QGauss<dim> q_lhs(fe.degree+1);
   QGauss<dim> q_rhs(fe.degree+3);
-      
+
   FullMatrix<double> X (fe.dofs_per_cell,
                         q_rhs.size());
 
   FETools::compute_projection_from_quadrature_points_matrix (fe,
                                                              q_lhs, q_rhs,
                                                              X);
-      
+
   output_matrix (X);
 }
 
index 48743a0bc36bcdb02867aac34cf6f75143accf02..09e9146a1c3cb8ac87eedec5cd7154017f711e3a 100644 (file)
@@ -39,35 +39,35 @@ void
 check_this (const FiniteElement<dim> &fe,
             const FiniteElement<dim> &/*fe2*/)
 {
-                                   // only check if both elements have
-                                   // support points. otherwise,
-                                   // interpolation doesn't really
-                                   // work
+  // only check if both elements have
+  // support points. otherwise,
+  // interpolation doesn't really
+  // work
   if (fe.n_components() != 1)
     return;
 
-                                   // ignore this check if this fe has already
-                                   // been treated
+  // ignore this check if this fe has already
+  // been treated
   static std::set<std::string> already_checked;
   if (already_checked.find(fe.get_name()) != already_checked.end())
     return;
   already_checked.insert (fe.get_name());
 
-                                  // only test elements with support
-                                  // points
+  // only test elements with support
+  // points
   if (fe.has_support_points() == false)
     return;
 
-                                   // test with different quadrature formulas
+  // test with different quadrature formulas
   Quadrature<dim> q_rhs(fe.get_unit_support_points(),
-                       std::vector<double> (fe.dofs_per_cell,
-                                            1./fe.dofs_per_cell));
-      
+                        std::vector<double> (fe.dofs_per_cell,
+                                             1./fe.dofs_per_cell));
+
   FullMatrix<double> X (fe.dofs_per_cell,
                         q_rhs.size());
 
   Assert (X.m() == X.n(), ExcInternalError());
-  
+
   FETools::compute_projection_from_quadrature_points_matrix (fe,
                                                              q_rhs, q_rhs,
                                                              X);
index 14ba120a23fa4673272ae9eb5db8619d1ecb3d7d..07876369e60232148fbad500729347670febe37a 100644 (file)
@@ -36,7 +36,7 @@
 void check (Triangulation<2> &tria)
 {
   Point<2> p (1./3., 1./2.);
-  
+
   Triangulation<2>::active_cell_iterator cell
     = GridTools::find_active_cell_around_point (tria, p);
 
@@ -46,25 +46,25 @@ void check (Triangulation<2> &tria)
   deallog << std::endl;
 
   Assert (p.distance (cell->center()) < cell->diameter()/2,
-         ExcInternalError());
+          ExcInternalError());
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("find_cell_1/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<2> coarse_grid;
     GridGenerator::hyper_cube (coarse_grid);
     coarse_grid.refine_global (2);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<2> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     static const HyperBallBoundary<2> boundary;
@@ -74,5 +74,5 @@ int main ()
   }
 }
 
-  
-  
+
+
index 4b66242496905aacf1f1af6291699968ced22f41..896e0d27cb05533d15aca9902f1645871656da9a 100644 (file)
 /*
 #2  0x00007fffed53f20a in __backtrace_symbols (array=0x7fffffffc610, size=9)
     at ../sysdeps/generic/elf/backtracesyms.c:52
-#3  0x00007ffff585cd9d in dealii::ExceptionBase::set_fields (this=0x7fffffffc870, 
-    f=0x7ffff668dec0 "/scratch/deal-trunk/deal.II/source/fe/mapping_q1.cc", l=1803, 
+#3  0x00007ffff585cd9d in dealii::ExceptionBase::set_fields (this=0x7fffffffc870,
+    f=0x7ffff668dec0 "/scratch/deal-trunk/deal.II/source/fe/mapping_q1.cc", l=1803,
     func=0x7ffff6699be0 "dealii::Point<dim> dealii::MappingQ1<dim, spacedim>::transform_real_to_unit_cell_internal(const typename dealii::Triangulation<dim, spacedim>::cell_iterator&, const dealii::Point<spacedim>&, const dea"..., c=0x7ffff668dea5 "false", e=0x7ffff668e1c0 "(typename Mapping<dim,spacedim>::ExcTransformationFailed())")
     at /scratch/deal-trunk/deal.II/source/base/exceptions.cc:124
-#4  0x00007ffff4663508 in dealii::deal_II_exceptions::internals::issue_error_throw<dealii::Mapping<2, 2>::ExcTransformationFailed> (file=0x7ffff668dec0 "/scratch/deal-trunk/deal.II/source/fe/mapping_q1.cc", line=1803, 
-    function=0x7ffff6699be0 "dealii::Point<dim> dealii::MappingQ1<dim, spacedim>::transform_real_to_unit_cell_internal(const typename dealii::Triangulation<dim, spacedim>::cell_iterator&, const dealii::Point<spacedim>&, const dea"..., cond=0x7ffff668dea5 "false", 
+#4  0x00007ffff4663508 in dealii::deal_II_exceptions::internals::issue_error_throw<dealii::Mapping<2, 2>::ExcTransformationFailed> (file=0x7ffff668dec0 "/scratch/deal-trunk/deal.II/source/fe/mapping_q1.cc", line=1803,
+    function=0x7ffff6699be0 "dealii::Point<dim> dealii::MappingQ1<dim, spacedim>::transform_real_to_unit_cell_internal(const typename dealii::Triangulation<dim, spacedim>::cell_iterator&, const dealii::Point<spacedim>&, const dea"..., cond=0x7ffff668dea5 "false",
     exc_name=0x7ffff668e1c0 "(typename Mapping<dim,spacedim>::ExcTransformationFailed())", e=...)
     at /scratch/deal-trunk/deal.II/include/deal.II/base/exceptions.h:245
-#5  0x00007ffff46505cb in dealii::MappingQ1<2, 2>::transform_real_to_unit_cell_internal (this=0x7ffff7dd9560, 
+#5  0x00007ffff46505cb in dealii::MappingQ1<2, 2>::transform_real_to_unit_cell_internal (this=0x7ffff7dd9560,
     cell=..., p=..., initial_p_unit=..., mdata=...) at /scratch/deal-trunk/deal.II/source/fe/mapping_q1.cc:1803
-#6  0x00007ffff464dd6b in dealii::MappingQ1<2, 2>::transform_real_to_unit_cell (this=0x7ffff7dd9560, cell=..., 
+#6  0x00007ffff464dd6b in dealii::MappingQ1<2, 2>::transform_real_to_unit_cell (this=0x7ffff7dd9560, cell=...,
     p=...) at /scratch/deal-trunk/deal.II/source/fe/mapping_q1.cc:1683
 #7  0x00007ffff5a1d467 in dealii::GridTools::find_active_cell_around_point<2, dealii::DoFHandler, 2> (
     mapping=..., container=..., p=...) at /scratch/deal-trunk/deal.II/source/grid/grid_tools.cc:892
@@ -75,7 +75,7 @@ using namespace dealii;
 
 void test()
 {
-  Triangulation<2>     triangulation;     
+  Triangulation<2>     triangulation;
   FE_Q<2>              fe(1);
   DoFHandler<2> dof_handler(triangulation);
 
@@ -85,26 +85,26 @@ void test()
   grid_in1.read_msh(input_file1);
 
   dof_handler.distribute_dofs (fe);
-  
+
   Point< 2 > ePos;
   ePos(0) = 0.0653630060373507487669897386695;
   ePos(1) = 1125.59175030825804242340382189;
 
   MappingQ<2> mapping(1);
-  MappingQ1<2> & mapping2 = StaticMappingQ1< 2 >::mapping;
+  MappingQ1<2> &mapping2 = StaticMappingQ1< 2 >::mapping;
   deallog << "1:" << std::endl;
   GridTools::find_active_cell_around_point (mapping, dof_handler, ePos);
   deallog << "2:" << std::endl;
-                                  //this second call seems to hang/crash:
+  //this second call seems to hang/crash:
   GridTools::find_active_cell_around_point (mapping2, dof_handler, ePos);
   deallog << "done" << std::endl;
 }
 
-int main (int argc, char **argv) 
+int main (int argc, char **argv)
 {
   initlog(__FILE__);
 
   test();
-  
+
   return 0;
 }
index 6237fd4b7b01d8253fa716fa62606e11dee3ae00..dec1878db5bcaab8f9a5680f714870182a2ec541 100644 (file)
@@ -35,7 +35,7 @@
 void check (Triangulation<3> &tria)
 {
   Point<3> p(1./3.,1./2.,1./5.);
-  
+
   Triangulation<3>::active_cell_iterator cell
     = GridTools::find_active_cell_around_point (tria, p);
 
@@ -45,25 +45,25 @@ void check (Triangulation<3> &tria)
   deallog << std::endl;
 
   Assert (p.distance (cell->center()) < cell->diameter()/2,
-         ExcInternalError());
+          ExcInternalError());
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("find_cell_2/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_cube (coarse_grid);
     coarse_grid.refine_global (2);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     static const HyperBallBoundary<3> boundary;
@@ -73,5 +73,5 @@ int main ()
   }
 }
 
-  
-  
+
+
index e45e703cc2375adcf38718e797e4a223daa506f1..7ce01cd8a721705749e36d996d2756b73444bc37 100644 (file)
@@ -35,7 +35,7 @@
 void check (Triangulation<3> &tria)
 {
   Point<3> p(1./3.,1./2.,-1./5.);
-  
+
   Triangulation<3>::active_cell_iterator cell
     = GridTools::find_active_cell_around_point (tria, p);
 
@@ -45,39 +45,39 @@ void check (Triangulation<3> &tria)
   deallog << std::endl;
 
   Assert (p.distance (cell->center()) < cell->diameter()/2,
-         ExcInternalError());
+          ExcInternalError());
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("find_cell_3/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<3> coarse_grid;
     create_two_cubes (coarse_grid);
     coarse_grid.refine_global (1);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     create_L_shape (coarse_grid);
     coarse_grid.refine_global (1);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     coarse_grid.refine_global (1);
     check (coarse_grid);
   }
-  
+
 }
 
-  
-  
+
+
index 2d2337cb692e80fa53ca4b2a453793fefedbafed..028b0c56a694e63082d75de4d17f3fe0bd7ae125 100644 (file)
@@ -36,7 +36,7 @@
 void check (Triangulation<3> &tria)
 {
   Point<3> p (0.75,0,0);
-  
+
   Triangulation<3>::active_cell_iterator cell
     = GridTools::find_active_cell_around_point (tria, p);
 
@@ -47,22 +47,22 @@ void check (Triangulation<3> &tria)
 
   // Transform back and forth
   Point<3> pp =
-     StaticMappingQ1<3>::mapping.transform_unit_to_real_cell
-     ( cell,
-       GeometryInfo<3>::project_to_unit_cell
-       (
-         StaticMappingQ1<3>::mapping.transform_real_to_unit_cell
-         ( cell,
-           p
-           )
-         )
-       );
-                                                                       
+    StaticMappingQ1<3>::mapping.transform_unit_to_real_cell
+    ( cell,
+      GeometryInfo<3>::project_to_unit_cell
+      (
+        StaticMappingQ1<3>::mapping.transform_real_to_unit_cell
+        ( cell,
+          p
+        )
+      )
+    );
+
   Assert (p.distance (pp) < 1e-15,  ExcInternalError());
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("find_cell_4/output");
   deallog.attach(logfile);
@@ -78,11 +78,11 @@ int main ()
     }
   catch (const std::exception &exc)
     {
-                                      // we shouldn't get here...
+      // we shouldn't get here...
       deallog << "Caught an error..." << std::endl;
       deallog << exc.what() << std::endl;
     }
 }
 
-  
-  
+
+
index a79badf990b725f65e1bed010d89bafbb261799c..0abd7967a15f886ddabf5a2578bf96586020f44e 100644 (file)
@@ -39,7 +39,7 @@
 void check (Triangulation<3> &tria)
 {
   Point<3> p (0.75,0.75,0.75);
-  
+
   Triangulation<3>::active_cell_iterator cell
     = GridTools::find_active_cell_around_point (tria, p);
 
@@ -50,23 +50,23 @@ void check (Triangulation<3> &tria)
 
   // Transform back and forth
   Point<3> pp =
-     StaticMappingQ1<3>::mapping.transform_unit_to_real_cell
-     ( cell,
-       GeometryInfo<3>::project_to_unit_cell
-       (
-         StaticMappingQ1<3>::mapping.transform_real_to_unit_cell
-         ( cell,
-           p
-           )
-         )
-       );
-                                                                       
+    StaticMappingQ1<3>::mapping.transform_unit_to_real_cell
+    ( cell,
+      GeometryInfo<3>::project_to_unit_cell
+      (
+        StaticMappingQ1<3>::mapping.transform_real_to_unit_cell
+        ( cell,
+          p
+        )
+      )
+    );
+
   Assert (p.distance (pp) < 1e-15,  ExcInternalError());
 
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("find_cell_5/output");
   deallog.attach(logfile);
@@ -82,11 +82,11 @@ int main ()
     }
   catch (const std::exception &exc)
     {
-                                      // we shouldn't get here...
+      // we shouldn't get here...
       deallog << "Caught an error..." << std::endl;
       deallog << exc.what() << std::endl;
     }
 }
 
-  
-  
+
+
index d3bfb380645a4093ea130a330b8fea955e8a0402..6ba7fdd21f32adc886426693ad0d3f1f9f0e1cf3 100644 (file)
@@ -35,9 +35,9 @@
 bool inside(Triangulation<3> &tria, Point<3> &p)
 {
 
-  for(Triangulation<3>::cell_iterator cell = tria.begin(0);
-      cell != tria.end(0); ++cell)
-    if( cell->point_inside (p) )
+  for (Triangulation<3>::cell_iterator cell = tria.begin(0);
+       cell != tria.end(0); ++cell)
+    if ( cell->point_inside (p) )
       return true;
 
   return false;
@@ -59,7 +59,7 @@ void check2 ()
   for (Triangulation<3>::active_cell_iterator  cell = tria.begin_active();  cell!=tria.end();  ++cell, ++idx)
     {
       if (idx==21)
-       cell->set_refine_flag();
+        cell->set_refine_flag();
     }
   tria.execute_coarsening_and_refinement ();
 
@@ -74,23 +74,23 @@ void check1 ()
   GridGenerator::hyper_cube (tria);
   tria.refine_global (3);
 
-  for (int i=0;i<3;++i)
+  for (int i=0; i<3; ++i)
     {
-      for (int j=0;j<1000;++j)
-       {
-         Point<3> p ((rand()%1000)/1000.0,(rand()%1000)/1000.0,(rand()%1000)/1000.0);
-         if (!inside(tria, p))
-           deallog << "NOT INSIDE" << std::endl;
-         GridTools::find_active_cell_around_point(tria, p);
-       }
-
-      for(Triangulation<3>::active_cell_iterator cell = tria.begin_active();
-         cell != tria.end(); ++cell)
-       for (unsigned int f=0; f<GeometryInfo<3>::faces_per_cell; ++f)
-         {
-           if (cell->face(f)->at_boundary() && (rand()%5)==1)
-             cell->set_refine_flag();
-         }
+      for (int j=0; j<1000; ++j)
+        {
+          Point<3> p ((rand()%1000)/1000.0,(rand()%1000)/1000.0,(rand()%1000)/1000.0);
+          if (!inside(tria, p))
+            deallog << "NOT INSIDE" << std::endl;
+          GridTools::find_active_cell_around_point(tria, p);
+        }
+
+      for (Triangulation<3>::active_cell_iterator cell = tria.begin_active();
+           cell != tria.end(); ++cell)
+        for (unsigned int f=0; f<GeometryInfo<3>::faces_per_cell; ++f)
+          {
+            if (cell->face(f)->at_boundary() && (rand()%5)==1)
+              cell->set_refine_flag();
+          }
 
       tria.execute_coarsening_and_refinement();
     }
@@ -110,7 +110,7 @@ int main ()
     }
   catch (const std::exception &exc)
     {
-                                      // we shouldn't get here...
+      // we shouldn't get here...
       deallog << "Caught an error..." << std::endl;
       deallog << exc.what() << std::endl;
     }
index aee644dce10530ef0f833e4c7baa84223ab7b7c5..33dd209c69d487c39e5a1dc28215867f948fdbe8 100644 (file)
@@ -43,9 +43,9 @@
 bool inside(Triangulation<3> &tria, Point<3> &p)
 {
 
-  for(Triangulation<3>::cell_iterator cell = tria.begin(0);
-      cell != tria.end(0); ++cell)
-    if( cell->point_inside (p) )
+  for (Triangulation<3>::cell_iterator cell = tria.begin(0);
+       cell != tria.end(0); ++cell)
+    if ( cell->point_inside (p) )
       return true;
 
   return false;
@@ -65,7 +65,7 @@ void check2 ()
   for (Triangulation<3>::active_cell_iterator  cell = tria.begin_active();  cell!=tria.end();  ++cell, ++idx)
     {
       if (idx==21)
-       cell->set_refine_flag();
+        cell->set_refine_flag();
     }
   tria.execute_coarsening_and_refinement ();
 
@@ -99,7 +99,7 @@ int main ()
     }
   catch (const std::exception &exc)
     {
-                                      // we shouldn't get here...
+      // we shouldn't get here...
       deallog << "Caught an error..." << std::endl;
       deallog << exc.what() << std::endl;
     }
index ae903777076f56994f197b554c4334007335d47c..56c307f8aeed5de75c9d7c36530650e9ea5eb17f 100644 (file)
 
 #include <fstream>
 
-void create_coarse_grid(Triangulation<2>coarse_grid)
+void create_coarse_grid(Triangulation<2> &coarse_grid)
 {
 
-       static const Point<2> vertices_1[]
-         = {  Point<2> (0.,  0.),//0
-              Point<2> (1.,  0.),//1
-              Point<2> (1.,  1.),//2
-              Point<2> (0.,  1.),//3
-              Point<2> (1.3,   0.),//4
-              Point<2> (1.3, 1./2.),//5
-          };
-       const unsigned int
-         n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
-
-       const std::vector<Point<2> > vertices (&vertices_1[0],
-                                                &vertices_1[n_vertices]);
-
-       static const int cell_vertices[][GeometryInfo<2>::vertices_per_cell]
-         = {{0, 1, 3, 2},
-            {1, 4, 2, 5},
-            };
-       const unsigned int
-         n_cells = sizeof(cell_vertices) / sizeof(cell_vertices[0]);
-
-       std::vector<CellData<2> > cells (n_cells, CellData<2>());
-       for (unsigned int i=0; i<n_cells; ++i)
-         {
-           for (unsigned int j=0;
-                j<GeometryInfo<2>::vertices_per_cell;
-                ++j)
-             cells[i].vertices[j] = cell_vertices[i][j];
-           cells[i].material_id = 0;
-         }
-
-       coarse_grid.create_triangulation (vertices,
-                                         cells,
-                                         SubCellData());
+  static const Point<2> vertices_1[]
+    = {  Point<2> (0.,  0.),//0
+         Point<2> (1.,  0.),//1
+         Point<2> (1.,  1.),//2
+         Point<2> (0.,  1.),//3
+         Point<2> (1.3,   0.),//4
+         Point<2> (1.3, 1./2.),//5
+      };
+  const unsigned int
+  n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
+
+  const std::vector<Point<2> > vertices (&vertices_1[0],
+                                         &vertices_1[n_vertices]);
+
+  static const int cell_vertices[][GeometryInfo<2>::vertices_per_cell]
+  = {{0, 1, 3, 2},
+    {1, 4, 2, 5},
+  };
+  const unsigned int
+  n_cells = sizeof(cell_vertices) / sizeof(cell_vertices[0]);
+
+  std::vector<CellData<2> > cells (n_cells, CellData<2>());
+  for (unsigned int i=0; i<n_cells; ++i)
+    {
+      for (unsigned int j=0;
+           j<GeometryInfo<2>::vertices_per_cell;
+           ++j)
+        cells[i].vertices[j] = cell_vertices[i][j];
+      cells[i].material_id = 0;
+    }
+
+  coarse_grid.create_triangulation (vertices,
+                                    cells,
+                                    SubCellData());
 }
 
 
 void check (Triangulation<2> &tria)
 {
   Point<2> p (0.99, 1./2.);
-  
+
   Triangulation<2>::active_cell_iterator cell
     = GridTools::find_active_cell_around_point (tria, p);
 
@@ -85,23 +85,23 @@ void check (Triangulation<2> &tria)
   deallog << std::endl;
 
   Assert (p.distance (cell->center()) < cell->diameter()/2,
-         ExcInternalError());
+          ExcInternalError());
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("find_cell_8/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<2> coarse_grid;
     create_coarse_grid(coarse_grid);
     check (coarse_grid);
   }
 }
 
-  
-  
+
+
index 51b009e318406c5f8dadb794ed1d6e6c070be8fc..11d1500d821369f784b9541b41a0af51307f97bd 100644 (file)
 
 #include <fstream>
 
-void create_coarse_grid(Triangulation<2>coarse_grid)
+void create_coarse_grid(Triangulation<2> &coarse_grid)
 {
 
-       static const Point<2> vertices_1[]
-         = {  Point<2> (0.,  0.),//0
-              Point<2> (1.,  0.),//1
-              Point<2> (1.,  1.),//2
-              Point<2> (0.,  1.),//3
-              
-              Point<2> (1.1,   0.),//4
-              Point<2> (1.1, 1./2.),//5
-              Point<2> (1.3,   0.),//6
-              Point<2> (1.3, 1./2.),//7
-          };
-       const unsigned int
-         n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
-
-       const std::vector<Point<2> > vertices (&vertices_1[0],
-                                                &vertices_1[n_vertices]);
-
-       static const int cell_vertices[][GeometryInfo<2>::vertices_per_cell]
-         = {{0, 1, 3, 2},
-            {4, 6, 5, 7},
-            };
-       const unsigned int
-         n_cells = sizeof(cell_vertices) / sizeof(cell_vertices[0]);
-
-       std::vector<CellData<2> > cells (n_cells, CellData<2>());
-       for (unsigned int i=0; i<n_cells; ++i)
-         {
-           for (unsigned int j=0;
-                j<GeometryInfo<2>::vertices_per_cell;
-                ++j)
-             cells[i].vertices[j] = cell_vertices[i][j];
-           cells[i].material_id = 0;
-         }
-
-       coarse_grid.create_triangulation (vertices,
-                                         cells,
-                                         SubCellData());
+  static const Point<2> vertices_1[]
+    = {  Point<2> (0.,  0.),//0
+         Point<2> (1.,  0.),//1
+         Point<2> (1.,  1.),//2
+         Point<2> (0.,  1.),//3
+
+         Point<2> (1.1,   0.),//4
+         Point<2> (1.1, 1./2.),//5
+         Point<2> (1.3,   0.),//6
+         Point<2> (1.3, 1./2.),//7
+      };
+  const unsigned int
+  n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
+
+  const std::vector<Point<2> > vertices (&vertices_1[0],
+                                         &vertices_1[n_vertices]);
+
+  static const int cell_vertices[][GeometryInfo<2>::vertices_per_cell]
+  = {{0, 1, 3, 2},
+    {4, 6, 5, 7},
+  };
+  const unsigned int
+  n_cells = sizeof(cell_vertices) / sizeof(cell_vertices[0]);
+
+  std::vector<CellData<2> > cells (n_cells, CellData<2>());
+  for (unsigned int i=0; i<n_cells; ++i)
+    {
+      for (unsigned int j=0;
+           j<GeometryInfo<2>::vertices_per_cell;
+           ++j)
+        cells[i].vertices[j] = cell_vertices[i][j];
+      cells[i].material_id = 0;
+    }
+
+  coarse_grid.create_triangulation (vertices,
+                                    cells,
+                                    SubCellData());
 }
 
 
 void check (Triangulation<2> &tria)
 {
   Point<2> p (0.99, 1./2.);
-  
+
   Triangulation<2>::active_cell_iterator cell
     = GridTools::find_active_cell_around_point (tria, p);
 
@@ -88,23 +88,23 @@ void check (Triangulation<2> &tria)
   deallog << std::endl;
 
   Assert (p.distance (cell->center()) < cell->diameter()/2,
-         ExcInternalError());
+          ExcInternalError());
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("find_cell_9/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<2> coarse_grid;
     create_coarse_grid(coarse_grid);
     check (coarse_grid);
   }
 }
 
-  
-  
+
+
index f36f077b4655209c16e829bb365a8ecf80f83799..5fb137beea7b1a1b0b3af9c1f36b718617d4e57d 100644 (file)
 
 void check (Triangulation<2> &tria)
 {
-   MappingQ<2> map(3);  // Let's take a higher order mapping
-   
+  MappingQ<2> map(3);  // Let's take a higher order mapping
+
   Point<2> p (1./3., 1./2.);
-  
+
   std::pair<Triangulation<2>::active_cell_iterator, Point<2> >
-     cell = GridTools::find_active_cell_around_point (map, tria, p);
+  cell = GridTools::find_active_cell_around_point (map, tria, p);
 
   deallog << cell.first << std::endl;
   for (unsigned int v=0; v<GeometryInfo<2>::vertices_per_cell; ++v)
@@ -52,25 +52,25 @@ void check (Triangulation<2> &tria)
   deallog << std::endl;
 
   Assert (p.distance (cell.first->center()) < cell.first->diameter()/2,
-         ExcInternalError());
+          ExcInternalError());
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("find_cell_alt_1/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<2> coarse_grid;
     GridGenerator::hyper_cube (coarse_grid);
     coarse_grid.refine_global (2);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<2> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     static const HyperBallBoundary<2> boundary;
@@ -80,5 +80,5 @@ int main ()
   }
 }
 
-  
-  
+
+
index bec9408eb3c44ab8109eec5124b5a1dced7246a9..3e398a56f1af5f927363a7b3ccb05a5464bdee34 100644 (file)
 
 void check (Triangulation<3> &tria)
 {
-   MappingQ<3> map(3);
-   
+  MappingQ<3> map(3);
+
   Point<3> p(1./3.,1./2.,1./5.);
-  
+
   std::pair<Triangulation<3>::active_cell_iterator, Point<3> > cell
     = GridTools::find_active_cell_around_point (map, tria, p);
 
@@ -51,25 +51,25 @@ void check (Triangulation<3> &tria)
   deallog << std::endl << std::endl;
 
   Assert (p.distance (cell.first->center()) < cell.first->diameter()/2,
-         ExcInternalError());
+          ExcInternalError());
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("find_cell_alt_2/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_cube (coarse_grid);
     coarse_grid.refine_global (2);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     static const HyperBallBoundary<3> boundary;
@@ -79,5 +79,5 @@ int main ()
   }
 }
 
-  
-  
+
+
index 48d0cf3de682119d1e56bddab0d0ec6bc55d5e33..f1ffd53aaa0dd88eefa8e15212d4e14b3777f687 100644 (file)
 
 void check (Triangulation<3> &tria)
 {
-   MappingQ<3> map(3);
-   
+  MappingQ<3> map(3);
+
   Point<3> p(1./3.,1./2.,-1./5.);
-  
+
   std::pair<Triangulation<3>::active_cell_iterator, Point<3> > cell
     = GridTools::find_active_cell_around_point (map, tria, p);
 
@@ -50,39 +50,39 @@ void check (Triangulation<3> &tria)
   deallog << std::endl;
 
   Assert (p.distance (cell.first->center()) < cell.first->diameter()/2,
-         ExcInternalError());
+          ExcInternalError());
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("find_cell_alt_3/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<3> coarse_grid;
     create_two_cubes (coarse_grid);
     coarse_grid.refine_global (1);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     create_L_shape (coarse_grid);
     coarse_grid.refine_global (1);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     coarse_grid.refine_global (1);
     check (coarse_grid);
   }
-  
+
 }
 
-  
-  
+
+
index e900d77bb0d670ef8efec7d7f273db8a171f8338..5330115184b03a13e704bc12ac971e3e93a97aeb 100644 (file)
 
 void check (Triangulation<3> &tria)
 {
-   MappingQ1<3> map;
-   
+  MappingQ1<3> map;
+
   Point<3> p (0.75,0,0);
-  
+
   std::pair<Triangulation<3>::active_cell_iterator, Point<3> > cell
     = GridTools::find_active_cell_around_point (map, tria, p);
 
@@ -56,7 +56,7 @@ void check (Triangulation<3> &tria)
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("find_cell_alt_4/output");
   deallog.attach(logfile);
@@ -72,11 +72,11 @@ int main ()
     }
   catch (const std::exception &exc)
     {
-                                      // we shouldn't get here...
+      // we shouldn't get here...
       deallog << "Caught an error..." << std::endl;
       deallog << exc.what() << std::endl;
     }
 }
 
-  
-  
+
+
index fd05c80b3440912fa9b3a98f21c1723dbe62dab7..63840c84e6376739c39d90cc77acc619f291e4de 100644 (file)
@@ -35,9 +35,9 @@
 
 void check (Triangulation<3> &tria)
 {
-   MappingQ1<3> map;
+  MappingQ1<3> map;
   Point<3> p (0.75,0.75,0.75);
-  
+
   std::pair<Triangulation<3>::active_cell_iterator, Point<3> > cell
     = GridTools::find_active_cell_around_point (map, tria, p);
 
@@ -48,11 +48,11 @@ void check (Triangulation<3> &tria)
   deallog << std::endl;
 
   Assert (GeometryInfo<3>::distance_to_unit_cell(cell.second) < 1e-10,
-         ExcInternalError());
+          ExcInternalError());
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("find_cell_alt_5/output");
   deallog.attach(logfile);
@@ -68,11 +68,11 @@ int main ()
     }
   catch (const std::exception &exc)
     {
-                                      // we shouldn't get here...
+      // we shouldn't get here...
       deallog << "Caught an error..." << std::endl;
       deallog << exc.what() << std::endl;
     }
 }
 
-  
-  
+
+
index f2f2dc68bb5bfeb1b1de7f7056af06df04338bb4..baa359110724903bf9d96a5b6091652430e3f9d9 100644 (file)
 
 void check (Triangulation<2> &tria)
 {
-   const std::vector<Point<2> > &v = tria.get_vertices();
-   MappingQ1<2> map;
-   
-   for(unsigned i=0; i<tria.n_vertices(); i++)
-      {
-         std::pair<Triangulation<2>::active_cell_iterator, Point<2> >
-            cell = GridTools::find_active_cell_around_point(map, tria, v[i]);
-
-         deallog << "Vertex <" << v[i] << "> found in cell ";
-         for (unsigned int v=0; v<GeometryInfo<2>::vertices_per_cell; ++v)
-            deallog << "<" << cell.first->vertex(v) << "> ";
-         deallog << " [local: " << cell.second << "]" << std::endl;
-      }
+  const std::vector<Point<2> > &v = tria.get_vertices();
+  MappingQ1<2> map;
+
+  for (unsigned i=0; i<tria.n_vertices(); i++)
+    {
+      std::pair<Triangulation<2>::active_cell_iterator, Point<2> >
+      cell = GridTools::find_active_cell_around_point(map, tria, v[i]);
+
+      deallog << "Vertex <" << v[i] << "> found in cell ";
+      for (unsigned int v=0; v<GeometryInfo<2>::vertices_per_cell; ++v)
+        deallog << "<" << cell.first->vertex(v) << "> ";
+      deallog << " [local: " << cell.second << "]" << std::endl;
+    }
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("find_cell_alt_6/output");
   deallog.attach(logfile);
@@ -81,11 +81,11 @@ int main ()
     }
   catch (const std::exception &exc)
     {
-                                      // we shouldn't get here...
+      // we shouldn't get here...
       deallog << "Caught an error..." << std::endl;
       deallog << exc.what() << std::endl;
     }
 }
 
-  
-  
+
+
index e6f1d70459a1a5a7d60fa249b3ef59f74e4b1c36..256c8f7076adb9d600581c96e7f275ed0d33e0c7 100644 (file)
 
 void check (Triangulation<2> &tria)
 {
-   MappingQ<2> map(5);
-
-   // Test for a number of points, every ten degrees
-   for(unsigned int i=0; i<200; i++)
-      {
-         Point<2> p(std::sin((double)i/100.*M_PI), std::cos((double)i/100.*M_PI));
-         p *= 1.-1e-8;
-
-         std::pair<Triangulation<2>::active_cell_iterator, Point<2> > cell
-            = GridTools::find_active_cell_around_point (map, tria, p);
-
-         deallog << cell.first << std::endl;
-         for (unsigned int v=0; v<GeometryInfo<2>::vertices_per_cell; ++v)
-            deallog << "<" << cell.first->vertex(v) << "> ";
-         deallog << "[ " << cell.second << " ] ";
-
-         // Now transform back and check distance
-         Point<2> pp = map.transform_unit_to_real_cell(cell.first, GeometryInfo<2>::project_to_unit_cell(cell.second));
-         deallog << pp.distance(p) << std::endl;
-         Assert (pp.distance(p) < 1.e-12,
-                 ExcInternalError());
-      }
-  
+  MappingQ<2> map(5);
+
+  // Test for a number of points, every ten degrees
+  for (unsigned int i=0; i<200; i++)
+    {
+      Point<2> p(std::sin((double)i/100.*M_PI), std::cos((double)i/100.*M_PI));
+      p *= 1.-1e-8;
+
+      std::pair<Triangulation<2>::active_cell_iterator, Point<2> > cell
+        = GridTools::find_active_cell_around_point (map, tria, p);
+
+      deallog << cell.first << std::endl;
+      for (unsigned int v=0; v<GeometryInfo<2>::vertices_per_cell; ++v)
+        deallog << "<" << cell.first->vertex(v) << "> ";
+      deallog << "[ " << cell.second << " ] ";
+
+      // Now transform back and check distance
+      Point<2> pp = map.transform_unit_to_real_cell(cell.first, GeometryInfo<2>::project_to_unit_cell(cell.second));
+      deallog << pp.distance(p) << std::endl;
+      Assert (pp.distance(p) < 1.e-12,
+              ExcInternalError());
+    }
+
 
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("find_cell_alt_7/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<2> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     static const HyperBallBoundary<2> boundary;
@@ -79,5 +79,5 @@ int main ()
   }
 }
 
-  
-  
+
+
index e432a1514325f09995c9cfea2d87ec6bd41f35d1..f874d6b1095a535e6810543036579d4b00950dc4 100644 (file)
 
 void check (Triangulation<2> &tria)
 {
-  for(unsigned i=0; i<tria.n_vertices(); i++)
+  for (unsigned i=0; i<tria.n_vertices(); i++)
     {
       std::vector<Triangulation<2>::active_cell_iterator>
-       cells = GridTools::find_cells_adjacent_to_vertex(tria, i);
+      cells = GridTools::find_cells_adjacent_to_vertex(tria, i);
 
       deallog << "Vertex " << i << " at " << tria.get_vertices()[i] << ": " << cells.size() << " cells" << std::endl;
 
-      for(unsigned c=0; c<cells.size(); c++) {
-       for (unsigned int v=0; v<GeometryInfo<2>::vertices_per_cell; ++v)
-         deallog << "<" << cells[c]->vertex(v) << "> ";
-       deallog << std::endl;
-      }
+      for (unsigned c=0; c<cells.size(); c++)
+        {
+          for (unsigned int v=0; v<GeometryInfo<2>::vertices_per_cell; ++v)
+            deallog << "<" << cells[c]->vertex(v) << "> ";
+          deallog << std::endl;
+        }
     }
 }
 
@@ -79,7 +80,7 @@ int main ()
     }
   catch (const std::exception &exc)
     {
-                                      // we shouldn't get here...
+      // we shouldn't get here...
       deallog << "Caught an error..." << std::endl;
       deallog << exc.what() << std::endl;
     }
index 8aa7401f04689805d50cecc769d3cefe111f631e..fc9e4c486e6b7bc59148045883038682de59a7c9 100644 (file)
 
 void check (Triangulation<3> &tria)
 {
-  for(unsigned i=0; i<tria.n_vertices(); i++)
+  for (unsigned i=0; i<tria.n_vertices(); i++)
     {
       std::vector<Triangulation<3>::active_cell_iterator>
-       cells = GridTools::find_cells_adjacent_to_vertex(tria, i);
+      cells = GridTools::find_cells_adjacent_to_vertex(tria, i);
 
       deallog << "Vertex " << i << " at " << tria.get_vertices()[i] << ": " << cells.size() << " cells" << std::endl;
 
-      for(unsigned c=0; c<cells.size(); c++)
-       deallog << "   " << cells[c] << std::endl;
+      for (unsigned c=0; c<cells.size(); c++)
+        deallog << "   " << cells[c] << std::endl;
     }
 }
 
@@ -65,7 +65,7 @@ int main ()
     }
   catch (const std::exception &exc)
     {
-                                      // we shouldn't get here...
+      // we shouldn't get here...
       deallog << "Caught an error..." << std::endl;
       deallog << exc.what() << std::endl;
     }
index cca4f1ea097da87c381e780a281faebf6283837d..ea72033a3a16ae9d2f608d4287bb293bfc739b3d 100644 (file)
 
 void check (Triangulation<2> &tria)
 {
-  for(unsigned i=0; i<tria.n_vertices(); i++)
+  for (unsigned i=0; i<tria.n_vertices(); i++)
     {
       std::vector<Triangulation<2>::active_cell_iterator>
-       cells = GridTools::find_cells_adjacent_to_vertex(tria, i);
+      cells = GridTools::find_cells_adjacent_to_vertex(tria, i);
 
       deallog << "Vertex " << i << " at "
-             << tria.get_vertices()[i] << ": "
-             << cells.size() << " cells" << std::endl;
+              << tria.get_vertices()[i] << ": "
+              << cells.size() << " cells" << std::endl;
 
-      for(unsigned c=0; c<cells.size(); c++)
-       deallog << "   " << cells[c] << std::endl;
+      for (unsigned c=0; c<cells.size(); c++)
+        deallog << "   " << cells[c] << std::endl;
     }
 }
 
@@ -58,38 +58,38 @@ int main ()
 
   try
     {
-                                      // set up the vertices of the
-                                      // cells: the center plus 16
-                                      // points on the perimeter of a
-                                      // circle
+      // set up the vertices of the
+      // cells: the center plus 16
+      // points on the perimeter of a
+      // circle
       const unsigned int dim = 2;
       std::vector<Point<dim> > vertices;
       vertices.push_back (Point<dim>());
 
       for (unsigned int i=0; i<16; ++i)
-       vertices.push_back (Point<dim>(std::cos(i*2*numbers::PI/16),
-                                      std::sin(i*2*numbers::PI/16)));
+        vertices.push_back (Point<dim>(std::cos(i*2*numbers::PI/16),
+                                       std::sin(i*2*numbers::PI/16)));
 
-                                      // now create the 8 cells
+      // now create the 8 cells
       std::vector<CellData<dim> > cells;
       for (unsigned int c=0; c<8; ++c)
-       {
-         CellData<dim> d;
-         d.vertices[0] = 0;
-         d.vertices[1] = 1+2*c;
-         d.vertices[2] = 1+((2*c+2) % 16);
-         d.vertices[3] = 1+2*c+1;
-         cells.push_back(d);
-       }
+        {
+          CellData<dim> d;
+          d.vertices[0] = 0;
+          d.vertices[1] = 1+2*c;
+          d.vertices[2] = 1+((2*c+2) % 16);
+          d.vertices[3] = 1+2*c+1;
+          cells.push_back(d);
+        }
 
       Triangulation<dim> coarse_grid;
       coarse_grid.create_triangulation (vertices, cells,
-                                       SubCellData());
+                                        SubCellData());
       check (coarse_grid);
     }
   catch (const std::exception &exc)
     {
-                                      // we shouldn't get here...
+      // we shouldn't get here...
       deallog << "Caught an error..." << std::endl;
       deallog << exc.what() << std::endl;
     }
index 4562796dcaac5cafe57a80ed7ddf837d9e531ab0..338813525b2b9455863fcb510f95148bbfe7994d 100644 (file)
 
 void check (Triangulation<2> &tria)
 {
-  for(unsigned i=0; i<tria.n_vertices(); i++)
+  for (unsigned i=0; i<tria.n_vertices(); i++)
     {
       std::vector<Triangulation<2>::active_cell_iterator>
-       cells = GridTools::find_cells_adjacent_to_vertex(tria, i);
+      cells = GridTools::find_cells_adjacent_to_vertex(tria, i);
 
       deallog << "Vertex " << i << " at "
-             << tria.get_vertices()[i] << ": "
-             << cells.size() << " cells" << std::endl;
+              << tria.get_vertices()[i] << ": "
+              << cells.size() << " cells" << std::endl;
 
-      for(unsigned c=0; c<cells.size(); c++)
-       deallog << "   " << cells[c] << std::endl;
+      for (unsigned c=0; c<cells.size(); c++)
+        deallog << "   " << cells[c] << std::endl;
     }
 }
 
@@ -58,35 +58,35 @@ int main ()
 
   try
     {
-                                      // set up the vertices of the
-                                      // cells: the center plus 16
-                                      // points on the perimeter of a
-                                      // circle
+      // set up the vertices of the
+      // cells: the center plus 16
+      // points on the perimeter of a
+      // circle
       const unsigned int dim = 2;
       std::vector<Point<dim> > vertices;
       vertices.push_back (Point<dim>());
 
       for (unsigned int i=0; i<16; ++i)
-       vertices.push_back (Point<dim>(std::cos(i*2*numbers::PI/16),
-                                      std::sin(i*2*numbers::PI/16)));
+        vertices.push_back (Point<dim>(std::cos(i*2*numbers::PI/16),
+                                       std::sin(i*2*numbers::PI/16)));
 
-                                      // now create the 8 cells
+      // now create the 8 cells
       std::vector<CellData<dim> > cells;
       for (unsigned int c=0; c<8; ++c)
-       {
-         CellData<dim> d;
-         d.vertices[0] = 0;
-         d.vertices[1] = 1+2*c;
-         d.vertices[2] = 1+((2*c+2) % 16);
-         d.vertices[3] = 1+2*c+1;
-         cells.push_back(d);
-       }
+        {
+          CellData<dim> d;
+          d.vertices[0] = 0;
+          d.vertices[1] = 1+2*c;
+          d.vertices[2] = 1+((2*c+2) % 16);
+          d.vertices[3] = 1+2*c+1;
+          cells.push_back(d);
+        }
 
       Triangulation<dim> coarse_grid;
       coarse_grid.create_triangulation (vertices, cells,
-                                       SubCellData());
+                                        SubCellData());
 
-                                      // now also refine one cell
+      // now also refine one cell
       coarse_grid.begin_active()->set_refine_flag();
       coarse_grid.execute_coarsening_and_refinement();
 
@@ -94,7 +94,7 @@ int main ()
     }
   catch (const std::exception &exc)
     {
-                                      // we shouldn't get here...
+      // we shouldn't get here...
       deallog << "Caught an error..." << std::endl;
       deallog << exc.what() << std::endl;
     }
index 721dc738c53832a49b8a1a4ab0cd374c614aee3f..c595b5be71bfb9c8a970a635300e8f583f64a429 100644 (file)
 
 void check (Triangulation<3> &tria)
 {
-  for(unsigned i=0; i<tria.n_vertices(); i++)
+  for (unsigned i=0; i<tria.n_vertices(); i++)
     {
       std::vector<Triangulation<3>::active_cell_iterator>
-       cells = GridTools::find_cells_adjacent_to_vertex(tria, i);
+      cells = GridTools::find_cells_adjacent_to_vertex(tria, i);
 
       deallog << "Vertex " << i << " at "
-             << tria.get_vertices()[i] << ": "
-             << cells.size() << " cells" << std::endl;
+              << tria.get_vertices()[i] << ": "
+              << cells.size() << " cells" << std::endl;
 
-      for(unsigned c=0; c<cells.size(); c++)
-       deallog << "   " << cells[c] << std::endl;
+      for (unsigned c=0; c<cells.size(); c++)
+        deallog << "   " << cells[c] << std::endl;
     }
 }
 
@@ -57,50 +57,50 @@ int main ()
 
   try
     {
-                                      // set up the vertices of the
-                                      // cells: the center plus 16
-                                      // points on the perimeter of a
-                                      // circle
+      // set up the vertices of the
+      // cells: the center plus 16
+      // points on the perimeter of a
+      // circle
       const unsigned int dim = 3;
       std::vector<Point<dim> > vertices;
       vertices.push_back (Point<dim>(0,0,0));
 
       for (unsigned int i=0; i<16; ++i)
-       vertices.push_back (Point<dim>(std::cos(i*2*numbers::PI/16),
-                                      std::sin(i*2*numbers::PI/16),
-                                      0));
+        vertices.push_back (Point<dim>(std::cos(i*2*numbers::PI/16),
+                                       std::sin(i*2*numbers::PI/16),
+                                       0));
 
-                                      // then extrude the mesh into
-                                      // z-direction
+      // then extrude the mesh into
+      // z-direction
       for (unsigned int i=0; i<17; ++i)
-       vertices.push_back (Point<dim>(vertices[i][0],
-                                      vertices[i][1],
-                                      1));
+        vertices.push_back (Point<dim>(vertices[i][0],
+                                       vertices[i][1],
+                                       1));
 
-                                      // now create the 8 cells
+      // now create the 8 cells
       std::vector<CellData<dim> > cells;
       for (unsigned int c=0; c<8; ++c)
-       {
-         CellData<dim> d;
-         d.vertices[0] = 0;
-         d.vertices[1] = 1+2*c;
-         d.vertices[2] = 1+((2*c+2) % 16);
-         d.vertices[3] = 1+2*c+1;
+        {
+          CellData<dim> d;
+          d.vertices[0] = 0;
+          d.vertices[1] = 1+2*c;
+          d.vertices[2] = 1+((2*c+2) % 16);
+          d.vertices[3] = 1+2*c+1;
 
-         for (unsigned int v=4; v<8; ++v)
-           d.vertices[v] = d.vertices[v-4]+17;
+          for (unsigned int v=4; v<8; ++v)
+            d.vertices[v] = d.vertices[v-4]+17;
 
-         cells.push_back(d);
-       }
+          cells.push_back(d);
+        }
 
       Triangulation<dim> coarse_grid;
       coarse_grid.create_triangulation (vertices, cells,
-                                       SubCellData());
+                                        SubCellData());
       check (coarse_grid);
     }
   catch (const std::exception &exc)
     {
-                                      // we shouldn't get here...
+      // we shouldn't get here...
       deallog << "Caught an error..." << std::endl;
       deallog << exc.what() << std::endl;
     }
index 9fd817909350d22c9c548e0cadb0bec8c1f9aa9f..f0e65525509b656d63dd64e03e1836a197d3ea1d 100644 (file)
 
 void check (Triangulation<3> &tria)
 {
-  for(unsigned i=0; i<tria.n_vertices(); i++)
+  for (unsigned i=0; i<tria.n_vertices(); i++)
     {
       std::vector<Triangulation<3>::active_cell_iterator>
-       cells = GridTools::find_cells_adjacent_to_vertex(tria, i);
+      cells = GridTools::find_cells_adjacent_to_vertex(tria, i);
 
       deallog << "Vertex " << i << " at "
-             << tria.get_vertices()[i] << ": "
-             << cells.size() << " cells" << std::endl;
+              << tria.get_vertices()[i] << ": "
+              << cells.size() << " cells" << std::endl;
 
-      for(unsigned c=0; c<cells.size(); c++)
-       deallog << "   " << cells[c] << std::endl;
+      for (unsigned c=0; c<cells.size(); c++)
+        deallog << "   " << cells[c] << std::endl;
     }
 }
 
@@ -62,47 +62,47 @@ int main ()
 
   try
     {
-                                      // set up the vertices of the
-                                      // cells: the center plus 16
-                                      // points on the perimeter of a
-                                      // circle
+      // set up the vertices of the
+      // cells: the center plus 16
+      // points on the perimeter of a
+      // circle
       const unsigned int dim = 3;
       std::vector<Point<dim> > vertices;
       vertices.push_back (Point<dim>(0,0,0));
 
       for (unsigned int i=0; i<16; ++i)
-       vertices.push_back (Point<dim>(std::cos(i*2*numbers::PI/16),
-                                      std::sin(i*2*numbers::PI/16),
-                                      0));
+        vertices.push_back (Point<dim>(std::cos(i*2*numbers::PI/16),
+                                       std::sin(i*2*numbers::PI/16),
+                                       0));
 
-                                      // then extrude the mesh into
-                                      // z-direction
+      // then extrude the mesh into
+      // z-direction
       for (unsigned int i=0; i<17; ++i)
-       vertices.push_back (Point<dim>(vertices[i][0],
-                                      vertices[i][1],
-                                      1));
+        vertices.push_back (Point<dim>(vertices[i][0],
+                                       vertices[i][1],
+                                       1));
 
-                                      // now create the 8 cells
+      // now create the 8 cells
       std::vector<CellData<dim> > cells;
       for (unsigned int c=0; c<8; ++c)
-       {
-         CellData<dim> d;
-         d.vertices[0] = 0;
-         d.vertices[1] = 1+2*c;
-         d.vertices[2] = 1+((2*c+2) % 16);
-         d.vertices[3] = 1+2*c+1;
+        {
+          CellData<dim> d;
+          d.vertices[0] = 0;
+          d.vertices[1] = 1+2*c;
+          d.vertices[2] = 1+((2*c+2) % 16);
+          d.vertices[3] = 1+2*c+1;
 
-         for (unsigned int v=4; v<8; ++v)
-           d.vertices[v] = d.vertices[v-4]+17;
+          for (unsigned int v=4; v<8; ++v)
+            d.vertices[v] = d.vertices[v-4]+17;
 
-         cells.push_back(d);
-       }
+          cells.push_back(d);
+        }
 
       Triangulation<dim> coarse_grid;
       coarse_grid.create_triangulation (vertices, cells,
-                                       SubCellData());
+                                        SubCellData());
 
-                                      // now also refine one cell
+      // now also refine one cell
       coarse_grid.begin_active()->set_refine_flag();
       coarse_grid.execute_coarsening_and_refinement();
 
@@ -110,7 +110,7 @@ int main ()
     }
   catch (const std::exception &exc)
     {
-                                      // we shouldn't get here...
+      // we shouldn't get here...
       deallog << "Caught an error..." << std::endl;
       deallog << exc.what() << std::endl;
     }
index ed3ee075fa2bf30eb07e402dbc2bf005aeee0a6a..6a97f3fef39ecdebfd42dd3e84bcc02dcf1b5bed 100644 (file)
 
 void check (Triangulation<3> &tria)
 {
-   const std::vector<Point<3> > &v = tria.get_vertices();
-   for(unsigned i=0; i<v.size(); i++)
-      deallog << "[" << GridTools::find_closest_vertex(tria, v[i] + Point<3>(0.01, -0.01, 0.01)) << "] ";
-         
+  const std::vector<Point<3> > &v = tria.get_vertices();
+  for (unsigned i=0; i<v.size(); i++)
+    deallog << "[" << GridTools::find_closest_vertex(tria, v[i] + Point<3>(0.01, -0.01, 0.01)) << "] ";
+
   deallog << std::endl;
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("find_closest_vertex_1/output");
   deallog.attach(logfile);
@@ -60,11 +60,11 @@ int main ()
     }
   catch (const std::exception &exc)
     {
-                                      // we shouldn't get here...
+      // we shouldn't get here...
       deallog << "Caught an error..." << std::endl;
       deallog << exc.what() << std::endl;
     }
 }
 
-  
-  
+
+
index 312b8cb2d1389de90da0216d2e128f7e6c2ad6f2..f7efe96df4759ccb222fc32c01fc19f6d79a88ea 100644 (file)
@@ -34,9 +34,9 @@ check ()
   make_matrix (m);
 
   for (typename FullMatrix<number>::const_iterator
-        p = m.begin(); p!=m.end(); ++p)
+       p = m.begin(); p!=m.end(); ++p)
     deallog << p->row() << ' ' << p->column() << ' '
-           << p->value()
-           << std::endl;
+            << p->value()
+            << std::endl;
 }
 
index f982cd5ff776bb465b507458f23aead9c464b05c..fd06b9fa0e890cae6a27d00a0ee8e479a46552c5 100644 (file)
@@ -33,11 +33,11 @@ check ()
   FullMatrix<number> m;
   make_matrix (m);
 
-  
+
   for (typename FullMatrix<number>::const_iterator
-        p = m.begin(1); p!=m.end(1); ++p)
+       p = m.begin(1); p!=m.end(1); ++p)
     deallog << p->row() << ' ' << p->column() << ' '
-           << p->value()
-           << std::endl;
+            << p->value()
+            << std::endl;
 }
 
index e5dcb7b694fce5052426cf19a1d82ac8669f5bd1..1f6c7b0800f0dd12783d66bbfe035114bd413fc3 100644 (file)
@@ -31,11 +31,12 @@ void
 check ()
 {
   const number array[] = { 1, 2, 3, 4, 5,
-                          6, 7, 8, 9, 0,
-                          1, 2, 3, 4, 5,
-                          6, 7, 8, 9, 0,
-                          1, 2, 3, 4, 5 };
-  
+                           6, 7, 8, 9, 0,
+                           1, 2, 3, 4, 5,
+                           6, 7, 8, 9, 0,
+                           1, 2, 3, 4, 5
+                         };
+
   FullMatrix<number> m (5,5,array);
 
   print_matrix (m);
index 96376b0d5f65a6e76c09da44c2e11714cebd17ec..cf7ef6729442a52619dabb3634f6e7e787ef4eef 100644 (file)
@@ -35,7 +35,7 @@ check ()
 
   FullMatrix<number> n;
   n = m;
-  
+
   print_matrix (n);
 }
 
index a1006a185fa20ae09f010d86de44a7ccebcbd9f8..544c750f046b317adefa2d6964d0040a7c9b3aeb 100644 (file)
@@ -35,7 +35,7 @@ check ()
 
   FullMatrix<number> n;
   n.copy_from (m);
-  
+
   print_matrix (n);
 }
 
index 3f6431051e4aad792b4a77bf6189057593f6ec4c..72f0b3c161bad2a1727652e0c9372fa1add19973 100644 (file)
@@ -26,7 +26,7 @@
 #include <fstream>
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("full_matrix_1/output");
   deallog.attach(logfile);
@@ -52,8 +52,8 @@ int main ()
   for (unsigned int i=0; i<N; ++i)
     for (unsigned int j=0; j<N; ++j)
       {
-       deallog << i << ' ' << j << ' ' << f(i,j) << std::endl;
-       Assert (f(i,j) == sm(i,j), ExcInternalError());
+        deallog << i << ' ' << j << ' ' << f(i,j) << std::endl;
+        Assert (f(i,j) == sm(i,j), ExcInternalError());
       }
 
   deallog << "OK" << std::endl;
index da7308b545a0a927f80c6f6bbf89f411c98261b3..b7ef1d9768f3b8b659bb2222315bef5fc55def64 100644 (file)
@@ -32,7 +32,7 @@ check ()
 {
   FullMatrix<number> m(3,3);
   deallog << m.all_zero() << std::endl;
-  
+
   make_matrix (m);
   deallog << m.all_zero() << std::endl;
 }
index 194f523fe00fe927eddf64b38f327433920f400f..5bea78edc289217c4844ce67c8631f04d4010d76 100644 (file)
@@ -34,7 +34,7 @@ check ()
   make_matrix (m);
   Vector<number> v;
   make_vector (v);
-  
+
   deallog << m.matrix_norm_square (v) << std::endl;
 }
 
index 1e6d21dd233815990bb656a309309faffcaadbde..68c5061beb2cb40a901776be4d6cafc3240400fe 100644 (file)
@@ -37,7 +37,7 @@ check ()
   make_vector (w);
   for (unsigned int i=0; i<w.size(); ++i)
     w(i) = w(i)+1.;
-  
+
   deallog << m.matrix_scalar_product (v,w) << std::endl;
 }
 
index c8b394f6e5fab4243740517e364096e52ac7a923..6608b82f7977c2db6a9b280891362a5240883caf 100644 (file)
@@ -33,7 +33,7 @@ check ()
   for (unsigned int n=1; n<=3; ++n)
     {
       const number array[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
-    
+
       FullMatrix<number> m(n,n, array);
       print_matrix (m);
       deallog << m.determinant () << std::endl;
index a281117cf589d36fe997cc1f9c0150b0a5d5cbb6..8c265bdabbe9fce467d9c8b9d7477c82b9bed08c 100644 (file)
@@ -34,7 +34,7 @@ check ()
   make_matrix (m);
   make_matrix (n);
   m.add (3.14159, n);
-  
+
   print_matrix (m);
 }
 
index e6e2319106b575275bb40cc0ec3f82b720beedd4..5f1051242aab80ee6e09542998c45d572a55d423 100644 (file)
@@ -34,7 +34,7 @@ check ()
   make_matrix (m);
   make_matrix (n);
   m.equ (3.14159, n);
-  
+
   print_matrix (m);
 }
 
index d9c711f424e770f7b0d19b099db973e8893c3ada..3ce72436fe33e42012749b835926a877a8c56f82 100644 (file)
@@ -33,11 +33,12 @@ check ()
   for (unsigned int n=1; n<=5; ++n)
     {
       const number array[] = { 50, 2, 3, 4, 5,
-                              6, 50, 8, 9, 0,
-                              1, 2, 50, 4, 5,
-                              6, 7, 8, 50, 0,
-                              1, 2, 3, 4, 50 };
-  
+                               6, 50, 8, 9, 0,
+                               1, 2, 50, 4, 5,
+                               6, 7, 8, 50, 0,
+                               1, 2, 3, 4, 50
+                             };
+
       FullMatrix<number> m (n,n,array), p(n,n);
       p.invert (m);
       print_matrix (p);
index ad355401dccdbc6a7162e462193f5c9589503f02..f34620fae883b1169f3d206c35fd03bcf80fa7ec 100644 (file)
@@ -28,11 +28,11 @@ std::string output_file_name = "full_matrix_53/output";
 template <typename number>
 void
 calculate(const FullMatrix<number> A,
-         const FullMatrix<number> B)
+          const FullMatrix<number> B)
 {
 
   FullMatrix<number> A_r_inv(A.n(),A.m());
-  FullMatrix<number> identity(A.m(),A.m()); 
+  FullMatrix<number> identity(A.m(),A.m());
   A_r_inv.right_invert(A);
   deallog<<"A matrix"<<std::endl;
   display_matrix(A);
@@ -62,22 +62,22 @@ template <typename number>
 void
 check ()
 {
-  
+
   FullMatrix<number> A(1,2);
-  fill_matrix(A);  
+  fill_matrix(A);
 
   FullMatrix<number> B(2,1);
   fill_matrix(B);
 
-  calculate(A,B); 
+  calculate(A,B);
 
   FullMatrix<number> A1(2,3);
-  fill_matrix(A1);  
+  fill_matrix(A1);
 
   FullMatrix<number> B1(3,2);
   fill_matrix(B1);
 
-  calculate(A1,B1); 
+  calculate(A1,B1);
 
 }
 
index 510afce585939d93f2c8e04a7391aecd3b5d2087..90b27de66f33014fecb01b876e605dbff6083d5c 100644 (file)
@@ -34,7 +34,7 @@ check ()
   FullMatrix<number> m (5, 7);
   fill_matrix (m);
   print_matrix (m);
-  
+
   m.swap_col (2, 4);
   print_matrix (m);
 
index d540e2ef3b33fdbeb52c5e3bb3d79d4631b9b9be..50598ec05a1f34a90e9f7839d0d22392a9f1ecdd 100644 (file)
 std::string output_file_name = "full_matrix_56/output";
 
 const double entries2[4] =  { 0.814723686393179 ,  0.516389376684563,
-                             0.516389376684563,   0.913375856139019};
+                              0.516389376684563,   0.913375856139019
+                            };
 
 
 const double entries3[9] = {  1.808621732261680,   0.845866689167942,
-                             0.667106522517665,   0.845866689167942,
-                             1.398873167281503,   0.281706853672865,
-                             0.667106522517665,   0.281706853672865,
-                             0.741757766593798};
+                              0.667106522517665,   0.845866689167942,
+                              1.398873167281503,   0.281706853672865,
+                              0.667106522517665,   0.281706853672865,
+                              0.741757766593798
+                           };
 
 
 
 // Create a positive definite random matrix
 
-void random_matrix(FullMatrix<double>A)
+void random_matrix(FullMatrix<double> &A)
 {
-  for (unsigned int i=0; i<A.m();++i)
-    for (unsigned int j=0; j<A.n();++j)
+  for (unsigned int i=0; i<A.m(); ++i)
+    for (unsigned int j=0; j<A.n(); ++j)
       {
-       double rnd = std::rand();
-       rnd /= RAND_MAX;
-       A(i,j) = (i==j) ? A.m()+rnd : rnd;
+        double rnd = std::rand();
+        rnd /= RAND_MAX;
+        A(i,j) = (i==j) ? A.m()+rnd : rnd;
       }
 }
 
 template <typename number>
 void
 check ()
- {
+{
   deallog << std::fixed;
   deallog << std::setprecision(4);
 //  deallog.attach(logfile);
@@ -63,25 +65,25 @@ check ()
   FullMatrix<double> T2(2,2,entries2), S2(2,2), R2(2,2);
   FullMatrix<double>T3(3,3,entries3), S3(3,3), R3(3,3);
 
-                                  // These results for T2, T3, T5 were compared
-                                  // against Matlab.
+  // These results for T2, T3, T5 were compared
+  // against Matlab.
   deallog << "Original Matrix:" << std::endl;
   deallog << "================" << std::endl;
-  
+
   display_matrix(T2);
-  deallog << std::endl;    
+  deallog << std::endl;
 
   S2.cholesky(T2);
   deallog << "Cholesky Decomposition Matrix:" << std::endl;
   deallog << "==============================" << std::endl;
   display_matrix(S2);
-  deallog << std::endl;          
+  deallog << std::endl;
 
   R2.Tadd(1,S2); // R = S^t
   deallog << "Transposed Cholesky Decomposition Matrix:" << std::endl;
   deallog << "=========================================" << std::endl;
   display_matrix(R2);
-  deallog << std::endl;    
+  deallog << std::endl;
 
   R2.Tmmult(S2, R2, false);  // S = R^tR
   deallog << "Reconstructed Matrix:" << std::endl;
@@ -89,11 +91,11 @@ check ()
   display_matrix(S2);
   deallog << std::endl;
   S2.add(-1.0,T2);
-  if (S2.frobenius_norm()>1.0e-10) 
+  if (S2.frobenius_norm()>1.0e-10)
     {
       deallog << "NOT the same to 1e-10 tolerance" << std::endl;
     }
-  else 
+  else
     {
       deallog << "the SAME to 1e-10 tolerance" << std::endl;
     }
@@ -110,24 +112,24 @@ check ()
   deallog << "==============================" << std::endl;
   display_matrix(S3);
   deallog << std::endl;
-         
+
   R3.Tadd(1,S3); // R = S^t
   deallog << "Transposed Cholesky Decomposition Matrix:" << std::endl;
   deallog << "=========================================" << std::endl;
   display_matrix(R3);
   deallog << std::endl;
-      
+
   R3.Tmmult(S3, R3, false);  // S = R^tR
   deallog << "Reconstructed Matrix:" << std::endl;
   deallog << "=====================" << std::endl;
   display_matrix(S3);
   deallog << std::endl;
   S3.add(-1.0,T3);
-  if (S3.frobenius_norm()>1.0e-10) 
+  if (S3.frobenius_norm()>1.0e-10)
     {
       deallog << "NOT the same to 1e-10 tolerance" << std::endl;
     }
-  else 
+  else
     {
       deallog << "the SAME to 1e-10 tolerance" << std::endl;
     }
@@ -137,43 +139,43 @@ check ()
   FullMatrix<double> T5(5,5), S5(5,5), R5(5,5);
   random_matrix(T5);
   T5.symmetrize();
-  
+
   deallog << "Original Matrix:" << std::endl;
   deallog << "================" << std::endl;
   display_matrix(T5);
-  deallog << std::endl;    
+  deallog << std::endl;
 
   S5.cholesky(T5);
   deallog << "Cholesky Decomposition Matrix:" << std::endl;
   deallog << "==============================" << std::endl;
   display_matrix(S5);
-  deallog << std::endl;          
+  deallog << std::endl;
 
   R5.Tadd(1,S5); // R = S^t
   deallog << "Transposed Cholesky Decomposition Matrix:" << std::endl;
   deallog << "=========================================" << std::endl;
   display_matrix(R5);
-  deallog << std::endl;    
+  deallog << std::endl;
 
   R5.Tmmult(S5, R5, false);  // S = R^tR
   deallog << "Reconstructed Matrix:" << std::endl;
   deallog << "=====================" << std::endl;
   display_matrix(S5);
-  
+
   deallog << std::endl;
   S5.add(-1.0,T5);
-  if (S5.frobenius_norm()>1.0e-10) 
+  if (S5.frobenius_norm()>1.0e-10)
     {
       deallog << "NOT the same to 1e-10 tolerance" << std::endl;
     }
-  else 
+  else
     {
       deallog << "the SAME to 1e-10 tolerance" << std::endl;
     }
   deallog << std::endl;
   deallog << std::endl;
-  
+
 }
 
-      
+
 
index 33b97e35a0df7d7cb315e3d82c1e65b6cf88e980..8a6749b64f946b726ba8688f62051cf9478a1097 100644 (file)
@@ -30,14 +30,14 @@ const double ints[9] = { 0, -1., 1., -2., 2., -3., 3., -4., 4.};
 template <typename number>
 void
 check ()
- {
+{
   deallog << std::fixed;
   deallog << std::setprecision(1);
   deallog.depth_console(0);
 
   Vector<double> First4(4), Second4(4), First9(9);
   FullMatrix<double>F4(4,4),  F9(9,9);
-  
+
 
   deallog << "Original Vector V" << std::endl;
   deallog << "=================" << std::endl;
@@ -49,7 +49,7 @@ check ()
     }
   deallog << std::endl;
   deallog << std::endl;
-  
+
   deallog << "Original Vector W" << std::endl;
   deallog << "=================" << std::endl;
 
@@ -62,30 +62,30 @@ check ()
   deallog << std::endl;
 
   F4.outer_product(First4, Second4);
-  
+
   deallog << "Outer_Product of V and W" << std::endl;
   deallog << "========================" << std::endl;
   display_matrix(F4);
-  deallog << std::endl;          
+  deallog << std::endl;
   deallog << std::endl;
 
   deallog << std::endl;
-  
+
   F4.outer_product(First4, First4);
-  
+
   deallog << "Outer_Product of V and V" << std::endl;
   deallog << "========================" << std::endl;
   display_matrix(F4);
-  deallog << std::endl;          
+  deallog << std::endl;
   deallog << std::endl;
 
 
   F4.outer_product(Second4, Second4);
-  
+
   deallog << "Outer_Product of W and W" << std::endl;
   deallog << "========================" << std::endl;
   display_matrix(F4);
-  deallog << std::endl;          
+  deallog << std::endl;
   deallog << std::endl;
   deallog << std::endl;
 
@@ -101,11 +101,11 @@ check ()
   deallog << std::endl;
 
   F9.outer_product(First9, First9);
-  
+
   deallog << "Outer_Product of V and V" << std::endl;
   deallog << "========================" << std::endl;
   display_matrix(F9);
-  deallog << std::endl;          
+  deallog << std::endl;
   deallog << std::endl;
 
   deallog << std::endl;
@@ -122,14 +122,14 @@ check ()
   deallog << std::endl;
 
   F9.outer_product(First9, First9);
-  
+
   deallog << "Outer_Product of V and V" << std::endl;
   deallog << "========================" << std::endl;
   display_matrix(F9);
-  deallog << std::endl;          
+  deallog << std::endl;
   deallog << std::endl;
 
   deallog << std::endl;
 }
 
-      
+
index 366d8c351e95c443f2def518398b1fd25307cc17..0d93df5219f0e9427ab75d676966f34dfcbbb387 100644 (file)
@@ -1,6 +1,6 @@
 //----------------------------  full_matrix_common.h  ---------------------------
 //    $Id$
-//    Version: $Name$ 
+//    Version: $Name$
 //
 //    Copyright (C) 2007, 2008 by the deal.II authors
 //
@@ -84,7 +84,7 @@ print_matrix (const FullMatrix<number> &m)
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       deallog << i << ' ' << j << ' ' << m(i,j)
-             << std::endl;
+              << std::endl;
 }
 
 
@@ -95,29 +95,29 @@ print_vector (const Vector<number> &v)
 {
   for (unsigned int i=0; i<v.size(); ++i)
     deallog << i << ' ' << v(i)
-           << std::endl;
+            << std::endl;
 }
 
 template <typename number>
-void 
+void
 display_matrix(FullMatrix<number> M)
 {
   deallog<<M.m()<<"x"<<M.n()<<" matrix"<<std::endl;
-  for (unsigned int i=0;i<M.m();i++)
+  for (unsigned int i=0; i<M.m(); i++)
     {
-      for (unsigned int j=0;j<M.n();j++)
-       deallog<<M(i,j)<<" ";
+      for (unsigned int j=0; j<M.n(); j++)
+        deallog<<M(i,j)<<" ";
       deallog<<std::endl;
     }
 }
 
 
 template <typename number>
-void 
+void
 fill_matrix(FullMatrix<number> &A)
 {
-  for (unsigned int i=0; i<A.m();i++)
-    for (unsigned int j=0; j<A.n();j++)
+  for (unsigned int i=0; i<A.m(); i++)
+    for (unsigned int j=0; j<A.n(); j++)
       A(i,j)=number(i*A.n() + j+1);
 }
 
@@ -134,30 +134,30 @@ main()
 
       check<double> ();
       check<float> ();
-      
+
       return 0;
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-             << "----------------------------------------------------"
-             << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-             << exc.what() << std::endl
-             << "Aborting!" << std::endl
-             << "----------------------------------------------------"
-             << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-             << "----------------------------------------------------"
-             << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-             << "Aborting!" << std::endl
-             << "----------------------------------------------------"
-             << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 99079640ef4cc686945d0d83929307f148faca8d..2558238fbc9b3c17f0b0a1de5e298276b9bb6a26 100644 (file)
@@ -42,7 +42,7 @@ void test ()
 
   Assert (k == k, ExcInternalError());
   Assert (!(k != k), ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -62,25 +62,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 49b5a84db047728dec6ccef8ab72c408b8cdce90..444a2259ccd0670107f2eb3f113801bb6eac70fe 100644 (file)
@@ -31,18 +31,18 @@ void test (Vector<double> &v,
   FullMatrix<double> m(v.size(), v.size());
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
-        m(i,j) = ( i+2*j);
+      m(i,j) = ( i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
-  
+
   v.compress ();
   w.compress ();
 
-                                   // w:=Mv
+  // w:=Mv
   m.vmult (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -58,7 +58,7 @@ void test (Vector<double> &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("full_matrix_vector_01/output");
   deallog.attach(logfile);
@@ -74,25 +74,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 65264726c044bc8f452396f3eff77d884dae69d4..8db2f899926dae535e91a53004350b14163ce4fc 100644 (file)
@@ -32,18 +32,18 @@ void test (Vector<double> &v,
   FullMatrix<double> m(v.size(), v.size());
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
-        m(i,j) = ( i+2*j);
+      m(i,j) = ( i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
-  
+
   v.compress ();
   w.compress ();
 
-                                   // w:=Mv
+  // w:=Mv
   m.Tvmult (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -59,7 +59,7 @@ void test (Vector<double> &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("full_matrix_vector_02/output");
   deallog.attach(logfile);
@@ -75,25 +75,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index a013a43cb02462287b852d69b0225178cfc84bc2..fb2630149cdc4d0780316acfdf02f0b955f701ad 100644 (file)
@@ -32,21 +32,21 @@ void test (Vector<double> &v,
   FullMatrix<double> m(v.size(), v.size());
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
-        m(i,j) = ( i+2*j);
+      m(i,j) = ( i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       w(i) = i+1;
     }
-  
+
   v.compress ();
   w.compress ();
 
-                                   // <w,Mv>
+  // <w,Mv>
   const double s = m.matrix_scalar_product (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -65,7 +65,7 @@ void test (Vector<double> &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("full_matrix_vector_05/output");
   deallog.attach(logfile);
@@ -81,25 +81,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 9aacc6b15f9f74331b5891b03ce1939e39beecb3..e141f17e6242993d89ed64b3c6aaf4f13ab798f9 100644 (file)
@@ -31,17 +31,17 @@ void test (Vector<double> &v)
   FullMatrix<double> m(v.size(), v.size());
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
-        m(i,j) = ( i+2*j);
+      m(i,j) = ( i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
-  
+
   v.compress ();
 
-                                   // <w,Mv>
+  // <w,Mv>
   const double s = m.matrix_norm_square (v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     Assert (v(i) == i, ExcInternalError());
 
@@ -57,7 +57,7 @@ void test (Vector<double> &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("full_matrix_vector_06/output");
   deallog.attach(logfile);
@@ -72,25 +72,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 01542c2d001c3558ba05e5d1b8ba85e9d951e6e6..e4b07f4209075e875af6bf774873fcc0a61f33f8 100644 (file)
@@ -33,21 +33,21 @@ void test (Vector<double> &v,
   FullMatrix<double> m(v.size(), v.size());
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
-        m(i,j) = ( i+2*j);
+      m(i,j) = ( i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       w(i) = i+1;
     }
-      
+
   v.compress ();
   w.compress ();
 
-                                   // x=w-Mv
+  // x=w-Mv
   const double s = m.residual (x, v, w);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -67,7 +67,7 @@ void test (Vector<double> &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("full_matrix_vector_07/output");
   deallog.attach(logfile);
@@ -84,25 +84,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index f3d800552f322f5c376e335c18280bf127dff6a9..a2e78db04d5ee228c302b304ea8be911c419cbb5 100644 (file)
 
 
 template <int dim>
-class LaplaceProblem 
+class LaplaceProblem
 {
-  public:
-    LaplaceProblem ();
-    void run ();
-    
-  private:
+public:
+  LaplaceProblem ();
+  void run ();
 
-    Triangulation<dim>   triangulation;
-    FE_Q<dim>            fe;
-    DoFHandler<dim>      dof_handler;
+private:
 
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> system_matrix;
+  Triangulation<dim>   triangulation;
+  FE_Q<dim>            fe;
+  DoFHandler<dim>      dof_handler;
 
-    Vector<double>       solution;
-    Vector<double>       system_rhs;
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> system_matrix;
+
+  Vector<double>       solution;
+  Vector<double>       system_rhs;
 };
 
 
@@ -79,24 +79,24 @@ class LaplaceProblem
 
 template <int dim>
 LaplaceProblem<dim>::LaplaceProblem () :
-                fe (1),
-               dof_handler (triangulation)
+  fe (1),
+  dof_handler (triangulation)
 {}
 
 
 template <int dim>
-void LaplaceProblem<dim>::run () 
+void LaplaceProblem<dim>::run ()
 {
   deallog << "Solving problem in " << dim << " space dimensions." << std::endl;
-  
-  
+
+
+
   GridIn<dim> grid_in;
   grid_in.attach_triangulation (triangulation);
 
 
   std::ifstream input_file("gerold_1.inp");
+
 
   deallog << "read ucd data file" << std::endl;
 
@@ -106,13 +106,13 @@ void LaplaceProblem<dim>::run ()
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("gerold_1/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-                               
+
   try
     {
       LaplaceProblem<3> laplace_problem_3d;
@@ -121,26 +121,26 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
-  
+
   return 0;
 }
index 726e7361bbbbdcc1155e2db2c2da33b0ceec13b0..2dd1b70d0f1a9cd416120bfe2df6fc42bf0d428f 100644 (file)
 template <int dim>
 class LaplaceProblem
 {
-  public:
-    void run ();
-  private:
-    Triangulation<dim>   triangulation;
+public:
+  void run ();
+private:
+  Triangulation<dim>   triangulation;
 };
 
 
@@ -59,7 +59,7 @@ void LaplaceProblem<dim>::run ()
 
   SparsityPattern cell_connectivity;
   GridTools::get_face_connectivity_of_cells (triangulation,
-                                            cell_connectivity);
+                                             cell_connectivity);
   std::vector<types::global_dof_index> permutation(triangulation.n_active_cells());
   SparsityTools::reorder_Cuthill_McKee (cell_connectivity, permutation);
 
@@ -83,24 +83,24 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 
index 69bbe58034c0129cdf3b240ce8dad4f3d39e2646..d32ea5ac81e0c65cb0a2bda9a2c816149660aba9 100644 (file)
@@ -49,38 +49,38 @@ void test ()
   Triangulation<dim> triangulation;
   FE_Q<dim> fe(1);
   DoFHandler<dim> dof_handler(triangulation);
-  
+
   GridGenerator::hyper_cube (triangulation);
   triangulation.refine_global (1);
 
   dof_handler.distribute_dofs (fe);
 
-                                  // loop over all cells, active or
-                                  // not
+  // loop over all cells, active or
+  // not
   std::vector<types::global_dof_index> local_dof_indices (fe.dofs_per_cell);
   for (typename DoFHandler<dim>::cell_iterator cell=dof_handler.begin();
        cell != dof_handler.end(); ++cell)
     {
       try
-       {         
-         cell->get_dof_indices (local_dof_indices);
-       }
-      catch(...)
-       {
-         deallog << "Assertion: cell not active." << std::endl;
-         continue;
-       }
-      
-      
+        {
+          cell->get_dof_indices (local_dof_indices);
+        }
+      catch (...)
+        {
+          deallog << "Assertion: cell not active." << std::endl;
+          continue;
+        }
+
+
       deallog << "Cell = " << cell
-             << ", DoFs=";
+              << ", DoFs=";
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
-       {
-         Assert (local_dof_indices[i] != DoFHandler<dim>::invalid_dof_index,
-                 ExcInternalError());
-         deallog << local_dof_indices[i] << ' ';
-       }
-      
+        {
+          Assert (local_dof_indices[i] != DoFHandler<dim>::invalid_dof_index,
+                  ExcInternalError());
+          deallog << local_dof_indices[i] << ' ';
+        }
+
       deallog << std::endl;
     }
 }
@@ -98,7 +98,7 @@ int main ()
   test<1>();
   test<2>();
   test<3>();
-  
+
   return 0;
 }
 
index 4eff4b5e95882186cfaebce9dc4f2ee8e8474757..6cd584de6c6da4ac638e5a332bfcd30fcc1cccfb 100644 (file)
 #include <deal.II/fe/fe.h>
 #include <deal.II/fe/fe_tools.h>
 
-class Test {
+class Test
+{
 public:
-  
-  void generate(const char * myname) {
+
+  void generate(const char *myname)
+  {
     std::string name = myname;
-    
+
     fe1 = FETools::get_fe_from_name<1>(name);
     fe2 = FETools::get_fe_from_name<2>(name);
     fe3 = FETools::get_fe_from_name<3>(name);
-    
+
     deallog << "Read " << name << std::endl;
     deallog << "Generated :" << std::endl;
     deallog << fe1->get_name()  << std::endl;
     deallog << fe2->get_name()  << std::endl;
     deallog << fe3->get_name()  << std::endl;
-    
+
     delete fe1;
     delete fe2;
     delete fe3;
   }
-  
-  FiniteElement<1> * fe1;
-  FiniteElement<2> * fe2;
-  FiniteElement<3> * fe3;
+
+  FiniteElement<1> *fe1;
+  FiniteElement<2> *fe2;
+  FiniteElement<3> *fe3;
+
 };
 
-int main () 
-{  
+int main ()
+{
   std::ofstream logfile("get_fe_from_name/output");
   deallog.attach(logfile);
-  
+
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   Test gen;
-  
+
   gen.generate("FE_Q_Hierarchical(1)");
   gen.generate("FE_DGPNonparametric(1)");
   gen.generate("FE_DGQ(1)");
   gen.generate("FE_Q(1)");
-  
+
   gen.generate("FE_Q_Hierarchical(2)");
   gen.generate("FE_DGPNonparametric(2)");
   gen.generate("FE_DGQ(2)");
   gen.generate("FE_Q(2)");
-  
+
   gen.generate("FESystem[FE_Q_Hierarchical(1)^2-FE_Q_Hierarchical(1)]");
   gen.generate("FESystem[FE_DGPNonparametric(1)^2-FE_Q_Hierarchical(1)]");
   gen.generate("FESystem[FE_DGQ(1)^2-FE_Q_Hierarchical(1)]");
   gen.generate("FESystem[FE_Q(1)^2-FE_Q_Hierarchical(1)]");
-  
+
   gen.generate("FESystem[FE_Q_Hierarchical(1)^2-FE_DGPNonparametric(1)]");
   gen.generate("FESystem[FE_DGPNonparametric(1)^2-FE_DGPNonparametric(1)]");
   gen.generate("FESystem[FE_DGQ(1)^2-FE_DGPNonparametric(1)]");
   gen.generate("FESystem[FE_Q(1)^2-FE_DGPNonparametric(1)]");
-  
+
   gen.generate("FESystem[FE_Q_Hierarchical(1)^2-FE_DGQ(1)]");
   gen.generate("FESystem[FE_DGPNonparametric(1)^2-FE_DGQ(1)]");
   gen.generate("FESystem[FE_DGQ(1)^2-FE_DGQ(1)]");
   gen.generate("FESystem[FE_Q(1)^2-FE_DGQ(1)]");
-  
-  
+
+
   gen.generate("FESystem[FE_Q_Hierarchical(1)^2-FE_Q(1)]");
   gen.generate("FESystem[FE_DGPNonparametric(1)^2-FE_Q(1)]");
   gen.generate("FESystem[FE_DGQ(1)^2-FE_Q(1)]");
   gen.generate("FESystem[FE_Q(1)^2-FE_Q(1)]");
-  
+
+
   return 0;
 }
-    
+
index 839fb23af42c9e51be5f2bd327e3187284246f74..bffddc6297b3895ef80077252b4a2ec891e8c864 100644 (file)
@@ -30,7 +30,7 @@
 
 
 template<int dim>
-void test(std::ostreamout)
+void test(std::ostream &out)
 {
   Point<dim> p1;
   p1[0] = 2.;
@@ -44,25 +44,25 @@ void test(std::ostream& out)
   p3[0] = 2.;
   if (dim>1) p3[1] = 1.;
   if (dim>2) p3[2] = 4.;
-  
+
   GridOut go;
   GridOutFlags::XFig xfig_flags;
   xfig_flags.level_color = false;
   xfig_flags.fill_style = 25;
-  
+
   go.set_flags(xfig_flags);
-  
+
   GridOut::OutputFormat format = GridOut::gnuplot;
   if (dim==2) format = GridOut::xfig;
   if (dim==3) format = GridOut::dx;
-  
+
   if (true)
     {
       deallog << "hyper_cube" << std::endl;
       Triangulation<dim> tr;
       GridGenerator::hyper_cube(tr, 3., 7.);
       if (tr.n_cells() > 0)
-       go.write(tr, out, format);
+        go.write(tr, out, format);
     }
   if (true)
     {
@@ -70,7 +70,7 @@ void test(std::ostream& out)
       Triangulation<dim> tr;
       GridGenerator::subdivided_hyper_cube(tr, 3, 1., 7.);
       if (tr.n_cells() > 0)
-       go.write(tr, out, format);
+        go.write(tr, out, format);
     }
   if (true)
     {
@@ -78,7 +78,7 @@ void test(std::ostream& out)
       Triangulation<dim> tr;
       GridGenerator::hyper_rectangle(tr, p1, p2, true);
       if (tr.n_cells() > 0)
-       go.write(tr, out, format);
+        go.write(tr, out, format);
     }
   if (true)
     {
@@ -90,7 +90,7 @@ void test(std::ostream& out)
       if (dim>2) sub[2] = 4;
       GridGenerator::subdivided_hyper_rectangle(tr, sub, p1, p2, true);
       if (tr.n_cells() > 0)
-       go.write(tr, out, format);
+        go.write(tr, out, format);
     }
   if (dim==2)
     {
@@ -102,7 +102,7 @@ void test(std::ostream& out)
       if (dim>2) corners[2] = p3;
       GridGenerator::parallelogram(tr, corners, true);
       if (tr.n_cells() > 0)
-       go.write(tr, out, format);
+        go.write(tr, out, format);
     }
   if (dim>1)
     {
@@ -110,7 +110,7 @@ void test(std::ostream& out)
       Triangulation<dim> tr;
       GridGenerator::enclosed_hyper_cube(tr, 3., 7., 1., true);
       if (tr.n_cells() > 0)
-       go.write(tr, out, format);
+        go.write(tr, out, format);
     }
   if (dim>1)
     {
@@ -118,64 +118,64 @@ void test(std::ostream& out)
       Triangulation<dim> tr;
       GridGenerator::hyper_ball(tr, p1, 3.);
       if (tr.n_cells() > 0)
-       go.write(tr, out, format);
-    }  
+        go.write(tr, out, format);
+    }
   if (dim>1)
     {
       deallog << "cylinder" << std::endl;
       Triangulation<dim> tr;
       GridGenerator::cylinder(tr, 1., 3.);
       if (tr.n_cells() > 0)
-       go.write(tr, out, format);
-    }  
+        go.write(tr, out, format);
+    }
   if (dim>1)
     {
       deallog << "hyper_L" << std::endl;
       Triangulation<dim> tr;
       GridGenerator::hyper_L(tr, -1., 1.);
       if (tr.n_cells() > 0)
-       go.write(tr, out, format);
-    }  
+        go.write(tr, out, format);
+    }
   if (dim==2)
     {
       deallog << "hyper_cube_slit" << std::endl;
       Triangulation<dim> tr;
       GridGenerator::hyper_cube_slit(tr, -2., 2., true);
       if (tr.n_cells() > 0)
-       go.write(tr, out, format);
-    }  
+        go.write(tr, out, format);
+    }
   if (dim==2)
     {
       deallog << "hyper_shell" << std::endl;
       Triangulation<dim> tr;
       GridGenerator::hyper_shell(tr, p1, 4., 6.);
       if (tr.n_cells() > 0)
-       go.write(tr, out, format);
-    }  
+        go.write(tr, out, format);
+    }
   if (dim>2)
     {
       deallog << "cylinder_shell" << std::endl;
       Triangulation<dim> tr;
       GridGenerator::cylinder_shell(tr, 2., 5., 6.);
       if (tr.n_cells() > 0)
-       go.write(tr, out, format);
-    }  
+        go.write(tr, out, format);
+    }
   if (dim>1)
     {
       deallog << "half_hyper_ball" << std::endl;
       Triangulation<dim> tr;
       GridGenerator::half_hyper_ball(tr, p1, 3.);
       if (tr.n_cells() > 0)
-       go.write(tr, out, format);
-    }  
+        go.write(tr, out, format);
+    }
   if (dim==2)
     {
       deallog << "half_hyper_shell" << std::endl;
       Triangulation<dim> tr;
       GridGenerator::half_hyper_shell(tr, p1, 4., 6.);
       if (tr.n_cells() > 0)
-       go.write(tr, out, format);
-    }  
+        go.write(tr, out, format);
+    }
 }
 
 
@@ -185,7 +185,7 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   deallog.push("1d");
   test<1>(logfile);
   deallog.pop();
index 094c0fc4e0f3000586a2a55117238686e0a9d9b4..67cc36f8c96add76d58edae29e6db1b0d76dc5be 100644 (file)
@@ -32,7 +32,7 @@
 
 
 template<int dim>
-void test(std::ostreamout)
+void test(std::ostream &out)
 {
   Point<dim> p1;
   p1[0] = 2.;
@@ -50,16 +50,16 @@ void test(std::ostream& out)
   HalfHyperBallBoundary<dim> boundary_description (p1, 3);
   GridOut go;
   GridOut::OutputFormat format = GridOut::gnuplot;
-  
-    {
-      deallog << "half_hyper_ball" << std::endl;
-      Triangulation<dim> tr;
-      GridGenerator::half_hyper_ball(tr, p1, 3.);
-      tr.set_boundary (0, boundary_description);
 
-      tr.refine_global (2);
-      go.write(tr, out, format);
-    }  
+  {
+    deallog << "half_hyper_ball" << std::endl;
+    Triangulation<dim> tr;
+    GridGenerator::half_hyper_ball(tr, p1, 3.);
+    tr.set_boundary (0, boundary_description);
+
+    tr.refine_global (2);
+    go.write(tr, out, format);
+  }
 }
 
 
@@ -69,7 +69,7 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   deallog.push("3d");
   test<3>(logfile);
   deallog.pop();
index 0e83a88b5861a2a99303cf9b28653f82ca8abd87..4b5068eece782c2a57966db4d144cd25b976ee55 100644 (file)
@@ -31,7 +31,7 @@
 
 
 template<int dim>
-void test(std::ostreamout)
+void test(std::ostream &out)
 {
   Point<dim> p1;
   p1[0] = 2.;
@@ -45,10 +45,10 @@ void test(std::ostream& out)
   p3[0] = 2.;
   if (dim>1) p3[1] = 1.;
   if (dim>2) p3[2] = 4.;
-  
+
   GridOut go;
 
-                                   // uniformly subdivided mesh
+  // uniformly subdivided mesh
   if (true)
     {
       deallog << "subdivided_hyper_rectangle" << std::endl;
@@ -59,11 +59,11 @@ void test(std::ostream& out)
 
       GridGenerator::subdivided_hyper_rectangle(tr, sub, p1, p2, true);
       if (tr.n_cells() > 0)
-       go.write_gnuplot(tr, out);
+        go.write_gnuplot(tr, out);
     }
 
 
-                                   // non-uniformly subdivided mesh
+  // non-uniformly subdivided mesh
   if (true)
     {
       deallog << "subdivided_hyper_rectangle" << std::endl;
@@ -78,7 +78,7 @@ void test(std::ostream& out)
 
       GridGenerator::subdivided_hyper_rectangle(tr, sub, p1, p2, true);
       if (tr.n_cells() > 0)
-       go.write_gnuplot(tr, out);
+        go.write_gnuplot(tr, out);
     }
 }
 
@@ -89,7 +89,7 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   deallog.push("1d");
   test<1>(logfile);
   deallog.pop();
index 119d7d975b5b6d641e6690c3daed5cde3edea96c..ba9ece30f5da74ccd956917322b1ed8ed953bf1c 100644 (file)
@@ -48,7 +48,7 @@ template <> Table<2,types::material_id> material_ids<2>()
   for (unsigned int i=0; i<2; ++i)
     for (unsigned int j=0; j<3; ++j)
       t[i][j] = 1;
-                                  // produce a hole in the middle
+  // produce a hole in the middle
   t[1][1] = (types::material_id)(-1);
   return t;
 }
@@ -60,8 +60,8 @@ template <> Table<3,types::material_id> material_ids<3>()
   for (unsigned int i=0; i<2; ++i)
     for (unsigned int j=0; j<3; ++j)
       for (unsigned int k=0; k<4; ++k)
-       t[i][j][k] = 1;
-                                  // produce a hole in the middle
+        t[i][j][k] = 1;
+  // produce a hole in the middle
   t[1][1][1] = (types::material_id)(-1);
   t[1][1][2] = (types::material_id)(-1);
   return t;
@@ -70,7 +70,7 @@ template <> Table<3,types::material_id> material_ids<3>()
 
 
 template<int dim>
-void test(std::ostreamout)
+void test(std::ostream &out)
 {
   Point<dim> p1;
   p1[0] = 2.;
@@ -89,7 +89,7 @@ void test(std::ostream& out)
 
   GridOut go;
 
-                                   // uniformly subdivided mesh
+  // uniformly subdivided mesh
   if (true)
     {
       deallog << "subdivided_hyper_rectangle" << std::endl;
@@ -99,13 +99,13 @@ void test(std::ostream& out)
         sub[i] = std::vector<double> (i+2, (p2[i]-p1[i])/(i+2));
 
       GridGenerator::subdivided_hyper_rectangle(tr, sub, p1, material_ids<dim>(),
-                                               dim!=1);
+                                                dim!=1);
       if (tr.n_cells() > 0)
-       go.write_gnuplot(tr, out);
+        go.write_gnuplot(tr, out);
     }
 
 
-                                   // non-uniformly subdivided mesh
+  // non-uniformly subdivided mesh
   if (true)
     {
       deallog << "subdivided_hyper_rectangle" << std::endl;
@@ -119,9 +119,9 @@ void test(std::ostream& out)
         }
 
       GridGenerator::subdivided_hyper_rectangle(tr, sub, p1, material_ids<dim>(),
-                                               dim!=1);
+                                                dim!=1);
       if (tr.n_cells() > 0)
-       go.write_gnuplot(tr, out);
+        go.write_gnuplot(tr, out);
     }
 }
 
index 72f9ef3763f897e9cf793785f26c20b698e47d95..999ce783a6001f612086cde31a477a21d78f1a2f 100644 (file)
 
 
 template<int dim>
-void test(std::ostreamout)
+void test(std::ostream &out)
 {
   GridOut go;
   go.set_flags(GridOutFlags::Ucd(false, true));
   Triangulation<dim> tr;
-  
+
   std::vector<double> radii;
   radii.push_back(.2);
   radii.push_back(.3);
   radii.push_back(.4);
-  
-  
+
+
   std::vector<double> radiiext;
   radiiext.push_back(.3);
   radiiext.push_back(.4);
   radiiext.push_back(.5);
-  
+
   std::vector<double> Ls;
   Ls.push_back(.1);
   Ls.push_back(1);
@@ -56,40 +56,47 @@ void test(std::ostream& out)
   Nzs.push_back(3);
   Nzs.push_back(4);
 
-  for(unsigned int i=0; i<radii.size(); ++i)
-    for(unsigned int k=0; k< (dim == 2 ? 1 : Ls.size()); ++k)
-      for(unsigned int l=0; l< (dim == 2 ? 1 : Ls.size()); ++l) {
-         
-         out << "               ====================" << std::endl
-             << "Inner radius = " << radii[i] << std::endl
-             << "Outer radius = " << radiiext[i] << std::endl
-             << "Depth        = " << Ls[k] << std::endl
-             << "Nzs          = " << Nzs[l] << std::endl
-             << "No colorize    ====================" << std::endl;
-
-         // No colorize
-         try {
-           GridGenerator::hyper_cube_with_cylindrical_hole(tr, radii[i], radiiext[i], Ls[k], Nzs[l], false);
-         } catch(...) {
-           out << "Generation failed." << std::endl;
-         }
-         if (tr.n_cells() > 0)
-           go.write_ucd(tr, out);
-         
-         tr.clear();
-         
-         out << "Colorize       ====================" << std::endl;
-         try {
-           GridGenerator::hyper_cube_with_cylindrical_hole(tr, radii[i], radiiext[i], Ls[k], Nzs[l], true);
-         } catch(...) {
-           out << "Generation failed." << std::endl;
-         }
-         if (tr.n_cells() > 0)
-           go.write_ucd(tr, out);
-         tr.clear();
-         
-         out << "               ====================" << std::endl;
-       }
+  for (unsigned int i=0; i<radii.size(); ++i)
+    for (unsigned int k=0; k< (dim == 2 ? 1 : Ls.size()); ++k)
+      for (unsigned int l=0; l< (dim == 2 ? 1 : Ls.size()); ++l)
+        {
+
+          out << "               ====================" << std::endl
+              << "Inner radius = " << radii[i] << std::endl
+              << "Outer radius = " << radiiext[i] << std::endl
+              << "Depth        = " << Ls[k] << std::endl
+              << "Nzs         = " << Nzs[l] << std::endl
+              << "No colorize    ====================" << std::endl;
+
+          // No colorize
+          try
+            {
+              GridGenerator::hyper_cube_with_cylindrical_hole(tr, radii[i], radiiext[i], Ls[k], Nzs[l], false);
+            }
+          catch (...)
+            {
+              out << "Generation failed." << std::endl;
+            }
+          if (tr.n_cells() > 0)
+            go.write_ucd(tr, out);
+
+          tr.clear();
+
+          out << "Colorize       ====================" << std::endl;
+          try
+            {
+              GridGenerator::hyper_cube_with_cylindrical_hole(tr, radii[i], radiiext[i], Ls[k], Nzs[l], true);
+            }
+          catch (...)
+            {
+              out << "Generation failed." << std::endl;
+            }
+          if (tr.n_cells() > 0)
+            go.write_ucd(tr, out);
+          tr.clear();
+
+          out << "               ====================" << std::endl;
+        }
 }
 
 
index 9345f6de7500fe78d7a37f63ae53491ecc8d5c78..1d96340e725e6fc34e9d610cfb0b88ec231a40d2 100644 (file)
@@ -31,7 +31,7 @@
 
 
 template<int dim>
-void test(std::ostreamout)
+void test(std::ostream &out)
 {
   Point<dim> p1;
   p1[0] = 2.;
@@ -45,9 +45,9 @@ void test(std::ostream& out)
   p3[0] = 2.;
   if (dim>1) p3[1] = 1.;
   if (dim>2) p3[2] = 4.;
-  
 
-                                   // loop without rotation 
+
+  // loop without rotation
   if (true)
     {
       deallog <<"moebius, no rotation" << std::endl;
@@ -58,11 +58,11 @@ void test(std::ostream& out)
       go.write_ucd(tr, out);
     }
 
-                                   // loop with quarter rotation (1 * pi/2)
+  // loop with quarter rotation (1 * pi/2)
   if (true)
     {
       deallog << "---------------------------"<<std::endl
-             << "moebius, quarter rotation (1* Pi/2)" << std::endl;
+              << "moebius, quarter rotation (1* Pi/2)" << std::endl;
       Triangulation<dim> tr;
       GridGenerator::moebius(tr, 20, 1, 10.0, 2.0);
       GridOut go;
@@ -70,11 +70,11 @@ void test(std::ostream& out)
       go.write_ucd(tr, out);
     }
 
-                                   // loop with half rotation (2 * pi/2)
+  // loop with half rotation (2 * pi/2)
   if (true)
     {
       deallog << "---------------------------"<<std::endl
-             << "moebius, half rotation (2* Pi/2)" << std::endl;
+              << "moebius, half rotation (2* Pi/2)" << std::endl;
       Triangulation<dim> tr;
       GridGenerator::moebius(tr, 20, 2, 10.0, 2.0);
       GridOut go;
@@ -82,11 +82,11 @@ void test(std::ostream& out)
       go.write_ucd(tr, out);
     }
 
-                                   // loop with three quarter rotation (3 * pi/2)
+  // loop with three quarter rotation (3 * pi/2)
   if (true)
     {
       deallog << "---------------------------"<<std::endl
-             << "moebius, three quarter rotation (3* Pi/2)" << std::endl;
+              << "moebius, three quarter rotation (3* Pi/2)" << std::endl;
       Triangulation<dim> tr;
       GridGenerator::moebius(tr, 20, 3, 10.0, 2.0);
       GridOut go;
@@ -94,11 +94,11 @@ void test(std::ostream& out)
       go.write_ucd(tr, out);
     }
 
-                                   // loop with full rotation (1 * pi/2)
+  // loop with full rotation (1 * pi/2)
   if (true)
     {
       deallog << "---------------------------"<<std::endl
-             << "moebius, full rotation (2* Pi)" << std::endl;
+              << "moebius, full rotation (2* Pi)" << std::endl;
       Triangulation<dim> tr;
       GridGenerator::moebius(tr, 20, 4, 10.0, 2.0);
       GridOut go;
@@ -114,6 +114,6 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<3>(logfile);
 }
index 2bf424fcdadefb93074ba6caa28435496e26182e..cf96c5a6613dfe0f647a1bd1c4cf26ae494b3af6 100644 (file)
@@ -31,7 +31,7 @@
 
 
 template<int dim>
-void test(std::ostreamout)
+void test(std::ostream &out)
 {
   Triangulation<2> triangulation;
   Triangulation<3> tr;
@@ -50,6 +50,6 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<3>(logfile);
 }
index 837b17a3e68380bdba9323ad0e277d2c07008cf5..de05697699d6101a6a474f3e8ed94a7bdc1f52ed 100644 (file)
 #include <deal.II/grid/tria_accessor.h>
 #include <deal.II/grid/tria_iterator.h>
 #include <deal.II/grid/grid_in.h>
-  
+
 #include <fstream>
 #include <cmath>
-  
+
 
 template <int dim>
 void gmsh_grid (const char *name)
@@ -38,7 +38,7 @@ void gmsh_grid (const char *name)
   grid_in.attach_triangulation (tria);
   std::ifstream input_file(name);
   grid_in.read_msh(input_file);
-  
+
   deallog << "  " << tria.n_active_cells() << " active cells" << std::endl;
 
   int hash = 0;
@@ -51,13 +51,13 @@ void gmsh_grid (const char *name)
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("grid_in_msh_01/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-                               
+
   try
     {
       gmsh_grid<2> ("grid_in_msh_01.2d.msh");
@@ -69,26 +69,26 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
-  
+
   return 0;
 }
index 55dc331529f5f950182c779182487beff034bdc5..5d42cd3553156029afdff8a5b25dad868a2e3e7d 100644 (file)
@@ -33,7 +33,7 @@ void
 check_this (const DoFHandler<dim> &dof_handler)
 {
   deallog << dof_handler.get_fe().get_name()
-         << ": "
-         << (dof_handler.get_fe().hp_constraints_are_implemented() ? "true" : "false")
-         << std::endl;
+          << ": "
+          << (dof_handler.get_fe().hp_constraints_are_implemented() ? "true" : "false")
+          << std::endl;
 }
index 0c8e63418b0df893dfc6095fb37292b1ec5ddbae..c2397916c4b6e8c76be6a686cfc34013a1b003a3 100644 (file)
@@ -32,9 +32,9 @@
 #include <deal.II/grid/grid_generator.h>
 #include <fstream>
 #include <iomanip>
-    
 
-int main () 
+
+int main ()
 {
   std::ofstream logfile("hyper_ball_3d/output");
   deallog.attach(logfile);
@@ -42,17 +42,17 @@ int main ()
   deallog.threshold_double(1.e-10);
   deallog << std::setprecision (2);
 
-                                   // generate a hyperball in 3d
+  // generate a hyperball in 3d
   Triangulation<3> tria;
   GridGenerator::hyper_ball (tria, Point<3>(), std::sqrt(3.));
 
-                                   // output all faces. there should
-                                   // be 6 external ones, but there
-                                   // used to be a bug in the
-                                   // triangulation code that
-                                   // generated more than that, with
-                                   // some of them internal to the
-                                   // ball
+  // output all faces. there should
+  // be 6 external ones, but there
+  // used to be a bug in the
+  // triangulation code that
+  // generated more than that, with
+  // some of them internal to the
+  // ball
   unsigned int external_faces = 0;
   for (Triangulation<3>::face_iterator face=tria.begin_face();
        face!=tria.end_face(); ++face)
@@ -78,6 +78,6 @@ int main ()
   deallog << "External faces: " << external_faces << std::endl;
 
   Assert (external_faces == 6, ExcInternalError());
-  
+
   return 0;
 }
index d53c9df891779ba24d74b8e9b3ffc98af1c47fec..6f71c94ab9e25f8ea955ccd1d22435536c57b3a4 100644 (file)
 #include <fstream>
 #include <iomanip>
 
-                                // From the following include file we
-                                // will import the declaration of
-                                // H1-conforming finite element shape
-                                // functions. This family of finite
-                                // elements is called <code>FE_Q</code>, and
-                                // was used in all examples before
-                                // already to define the usual bi- or
-                                // tri-linear elements, but we will
-                                // now use it for bi-quadratic
-                                // elements:
+// From the following include file we
+// will import the declaration of
+// H1-conforming finite element shape
+// functions. This family of finite
+// elements is called <code>FE_Q</code>, and
+// was used in all examples before
+// already to define the usual bi- or
+// tri-linear elements, but we will
+// now use it for bi-quadratic
+// elements:
 #include <deal.II/fe/fe_q.h>
-                                // We will not read the grid from a
-                                // file as in the previous example,
-                                // but generate it using a function
-                                // of the library. However, we will
-                                // want to write out the locally
-                                // refined grids (just the grid, not
-                                // the solution) in each step, so we
-                                // need the following include file
-                                // instead of <code>grid_in.h</code>:
+// We will not read the grid from a
+// file as in the previous example,
+// but generate it using a function
+// of the library. However, we will
+// want to write out the locally
+// refined grids (just the grid, not
+// the solution) in each step, so we
+// need the following include file
+// instead of <code>grid_in.h</code>:
 #include <deal.II/grid/grid_out.h>
 
 
-                                // When using locally refined grids,
-                                // we will get so-called <code>hanging
-                                // nodes</code>. However, the standard
-                                // finite element methods assumes
-                                // that the discrete solution spaces
-                                // be continuous, so we need to make
-                                // sure that the degrees of freedom
-                                // on hanging nodes conform to some
-                                // constraints such that the global
-                                // solution is continuous. The
-                                // following file contains a class
-                                // which is used to handle these
-                                // constraints:
+// When using locally refined grids,
+// we will get so-called <code>hanging
+// nodes</code>. However, the standard
+// finite element methods assumes
+// that the discrete solution spaces
+// be continuous, so we need to make
+// sure that the degrees of freedom
+// on hanging nodes conform to some
+// constraints such that the global
+// solution is continuous. The
+// following file contains a class
+// which is used to handle these
+// constraints:
 #include <deal.II/lac/constraint_matrix.h>
 
-                                // In order to refine our grids
-                                // locally, we need a function from
-                                // the library that decides which
-                                // cells to flag for refinement or
-                                // coarsening based on the error
-                                // indicators we have computed. This
-                                // function is defined here:
+// In order to refine our grids
+// locally, we need a function from
+// the library that decides which
+// cells to flag for refinement or
+// coarsening based on the error
+// indicators we have computed. This
+// function is defined here:
 #include <deal.II/grid/grid_refinement.h>
 
-                                // Finally, we need a simple way to
-                                // actually compute the refinement
-                                // indicators based on some error
-                                // estimat. While in general,
-                                // adaptivity is very
-                                // problem-specific, the error
-                                // indicator in the following file
-                                // often yields quite nicely adapted
-                                // grids for a wide class of
-                                // problems.
+// Finally, we need a simple way to
+// actually compute the refinement
+// indicators based on some error
+// estimat. While in general,
+// adaptivity is very
+// problem-specific, the error
+// indicator in the following file
+// often yields quite nicely adapted
+// grids for a wide class of
+// problems.
 #include <deal.II/numerics/error_estimator.h>
 
-                                // Finally, this is as in previous
-                                // programs:
+// Finally, this is as in previous
+// programs:
 using namespace dealii;
 
 
-                                 // @sect3{The <code>LaplaceProblem</code> class template}
-
-                                // The main class is again almost
-                                // unchanged. Two additions, however,
-                                // are made: we have added the
-                                // <code>refine_grid</code> function, which is
-                                // used to adaptively refine the grid
-                                // (instead of the global refinement
-                                // in the previous examples), and a
-                                // variable which will hold the
-                                // constraints associated to the
-                                // hanging nodes. In addition, we
-                                // have added a destructor to the
-                                // class for reasons that will become
-                                // clear when we discuss its
-                                // implementation.
+// @sect3{The <code>LaplaceProblem</code> class template}
+
+// The main class is again almost
+// unchanged. Two additions, however,
+// are made: we have added the
+// <code>refine_grid</code> function, which is
+// used to adaptively refine the grid
+// (instead of the global refinement
+// in the previous examples), and a
+// variable which will hold the
+// constraints associated to the
+// hanging nodes. In addition, we
+// have added a destructor to the
+// class for reasons that will become
+// clear when we discuss its
+// implementation.
 template <int dim>
-class LaplaceProblem 
+class LaplaceProblem
 {
-  public:
-    LaplaceProblem ();
-    ~LaplaceProblem ();
-
-    void run ();
-    
-  private:
-    void setup_system ();
-    void assemble_system ();
-    void solve ();
-    void refine_grid ();
-    void output_results (const unsigned int cycle) const;
-
-    Triangulation<dim>   triangulation;
-
-    DoFHandler<dim>      dof_handler;
-    FE_Q<dim>            fe;
-
-                                    // This is the new variable in
-                                    // the main class. We need an
-                                    // object which holds a list of
-                                    // constraints originating from
-                                    // the hanging nodes:
-    ConstraintMatrix     hanging_node_constraints;
-
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> system_matrix;
-
-    Vector<double>       solution;
-    Vector<double>       system_rhs;
+public:
+  LaplaceProblem ();
+  ~LaplaceProblem ();
+
+  void run ();
+
+private:
+  void setup_system ();
+  void assemble_system ();
+  void solve ();
+  void refine_grid ();
+  void output_results (const unsigned int cycle) const;
+
+  Triangulation<dim>   triangulation;
+
+  DoFHandler<dim>      dof_handler;
+  FE_Q<dim>            fe;
+
+  // This is the new variable in
+  // the main class. We need an
+  // object which holds a list of
+  // constraints originating from
+  // the hanging nodes:
+  ConstraintMatrix     hanging_node_constraints;
+
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> system_matrix;
+
+  Vector<double>       solution;
+  Vector<double>       system_rhs;
 };
 
 
-                                 // @sect3{Nonconstant coefficients}
+// @sect3{Nonconstant coefficients}
 
-                                // The implementation of nonconstant
-                                // coefficients is copied verbatim
-                                // from step-5:
+// The implementation of nonconstant
+// coefficients is copied verbatim
+// from step-5:
 
 template <int dim>
-class Coefficient : public Function<dim> 
+class Coefficient : public Function<dim>
 {
-  public:
-    Coefficient () : Function<dim>() {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
-    
-    virtual void value_list (const std::vector<Point<dim> > &points,
-                            std::vector<double>            &values,
-                            const unsigned int              component = 0) const;
+public:
+  Coefficient () : Function<dim>() {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
+
+  virtual void value_list (const std::vector<Point<dim> > &points,
+                           std::vector<double>            &values,
+                           const unsigned int              component = 0) const;
 };
 
 
 
 template <int dim>
 double Coefficient<dim>::value (const Point<dim> &p,
-                               const unsigned int) const 
+                                const unsigned int) const
 {
   if (p.square() < 0.5*0.5)
     return 20;
@@ -198,365 +198,365 @@ double Coefficient<dim>::value (const Point<dim> &p,
 
 template <int dim>
 void Coefficient<dim>::value_list (const std::vector<Point<dim> > &points,
-                                  std::vector<double>            &values,
-                                  const unsigned int              component) const 
+                                   std::vector<double>            &values,
+                                   const unsigned int              component) const
 {
   const unsigned int n_points = points.size();
 
-  Assert (values.size() == n_points, 
-         ExcDimensionMismatch (values.size(), n_points));
-  
-  Assert (component == 0, 
-         ExcIndexRange (component, 0, 1));
-  
+  Assert (values.size() == n_points,
+          ExcDimensionMismatch (values.size(), n_points));
+
+  Assert (component == 0,
+          ExcIndexRange (component, 0, 1));
+
   for (unsigned int i=0; i<n_points; ++i)
     {
       if (points[i].square() < 0.5*0.5)
-       values[i] = 20;
+        values[i] = 20;
       else
-       values[i] = 1;
+        values[i] = 1;
     }
 }
 
 
-                                 // @sect3{The <code>LaplaceProblem</code> class implementation}
+// @sect3{The <code>LaplaceProblem</code> class implementation}
 
-                                 // @sect4{LaplaceProblem::LaplaceProblem}
+// @sect4{LaplaceProblem::LaplaceProblem}
 
-                                // The constructor of this class is
-                                // mostly the same as before, but
-                                // this time we want to use the
-                                // quadratic element. To do so, we
-                                // only have to replace the
-                                // constructor argument (which was
-                                // <code>1</code> in all previous examples) by
-                                // the desired polynomial degree
-                                // (here <code>2</code>):
+// The constructor of this class is
+// mostly the same as before, but
+// this time we want to use the
+// quadratic element. To do so, we
+// only have to replace the
+// constructor argument (which was
+// <code>1</code> in all previous examples) by
+// the desired polynomial degree
+// (here <code>2</code>):
 template <int dim>
 LaplaceProblem<dim>::LaplaceProblem () :
-               dof_handler (triangulation),
-                fe (2)
+  dof_handler (triangulation),
+  fe (2)
 {}
 
 
-                                 // @sect4{LaplaceProblem::~LaplaceProblem}
-
-                                // Here comes the added destructor of
-                                // the class. The reason why we want
-                                // to add it is a subtle change in
-                                // the order of data elements in the
-                                // class as compared to all previous
-                                // examples: the <code>dof_handler</code>
-                                // object was defined before and not
-                                // after the <code>fe</code> object. Of course
-                                // we could have left this order
-                                // unchanged, but we would like to
-                                // show what happens if the order is
-                                // reversed since this produces a
-                                // rather nasty side-effect and
-                                // results in an error which is
-                                // difficult to track down if one
-                                // does not know what happens.
-                                //
-                                // Basically what happens is the
-                                // following: when we distribute the
-                                // degrees of freedom using the
-                                // function call
-                                // <code>dof_handler.distribute_dofs()</code>,
-                                // the <code>dof_handler</code> also stores a
-                                // pointer to the finite element in
-                                // use. Since this pointer is used
-                                // every now and then until either
-                                // the degrees of freedom are
-                                // re-distributed using another
-                                // finite element object or until the
-                                // <code>dof_handler</code> object is
-                                // destroyed, it would be unwise if
-                                // we would allow the finite element
-                                // object to be deleted before the
-                                // <code>dof_handler</code> object. To
-                                // disallow this, the DoF handler
-                                // increases a counter inside the
-                                // finite element object which counts
-                                // how many objects use that finite
-                                // element (this is what the
-                                // <code>Subscriptor</code>/<code>SmartPointer</code>
-                                // class pair is used for, in case
-                                // you want something like this for
-                                // your own programs; see step-7 for
-                                // a more complete discussion
-                                // of this topic). The finite
-                                // element object will refuse its
-                                // destruction if that counter is
-                                // larger than zero, since then some
-                                // other objects might rely on the
-                                // persistence of the finite element
-                                // object. An exception will then be
-                                // thrown and the program will
-                                // usually abort upon the attempt to
-                                // destroy the finite element.
-                                //
-                                // To be fair, such exceptions about
-                                // still used objects are not
-                                // particularly popular among
-                                // programmers using deal.II, since
-                                // they only tell us that something
-                                // is wrong, namely that some other
-                                // object is still using the object
-                                // that is presently being
-                                // destructed, but most of the time
-                                // not who this user is. It is
-                                // therefore often rather
-                                // time-consuming to find out where
-                                // the problem exactly is, although
-                                // it is then usually straightforward
-                                // to remedy the situation. However,
-                                // we believe that the effort to find
-                                // invalid references to objects that
-                                // do no longer exist is less if the
-                                // problem is detected once the
-                                // reference becomes invalid, rather
-                                // than when non-existent objects are
-                                // actually accessed again, since
-                                // then usually only invalid data is
-                                // accessed, but no error is
-                                // immediately raised.
-                                //
-                                // Coming back to the present
-                                // situation, if we did not write
-                                // this destructor, the compiler will
-                                // generate code that triggers
-                                // exactly the behavior sketched
-                                // above. The reason is that member
-                                // variables of the
-                                // <code>LaplaceProblem</code> class are
-                                // destructed bottom-up (i.e. in
-                                // reverse order of their declaration
-                                // in the class), as always in
-                                // C++. Thus, the finite element
-                                // object will be destructed before
-                                // the DoF handler object, since its
-                                // declaration is below the one of
-                                // the DoF handler. This triggers the
-                                // situation above, and an exception
-                                // will be raised when the <code>fe</code>
-                                // object is destructed. What needs
-                                // to be done is to tell the
-                                // <code>dof_handler</code> object to release
-                                // its lock to the finite element. Of
-                                // course, the <code>dof_handler</code> will
-                                // only release its lock if it really
-                                // does not need the finite element
-                                // any more, i.e. when all finite
-                                // element related data is deleted
-                                // from it. For this purpose, the
-                                // <code>DoFHandler</code> class has a
-                                // function <code>clear</code> which deletes
-                                // all degrees of freedom, and
-                                // releases its lock to the finite
-                                // element. After this, you can
-                                // safely destruct the finite element
-                                // object since its internal counter
-                                // is then zero.
-                                //
-                                // For completeness, we add the
-                                // output of the exception that would
-                                // have been triggered without this
-                                // destructor, to the end of the
-                                // results section of this example.
+// @sect4{LaplaceProblem::~LaplaceProblem}
+
+// Here comes the added destructor of
+// the class. The reason why we want
+// to add it is a subtle change in
+// the order of data elements in the
+// class as compared to all previous
+// examples: the <code>dof_handler</code>
+// object was defined before and not
+// after the <code>fe</code> object. Of course
+// we could have left this order
+// unchanged, but we would like to
+// show what happens if the order is
+// reversed since this produces a
+// rather nasty side-effect and
+// results in an error which is
+// difficult to track down if one
+// does not know what happens.
+//
+// Basically what happens is the
+// following: when we distribute the
+// degrees of freedom using the
+// function call
+// <code>dof_handler.distribute_dofs()</code>,
+// the <code>dof_handler</code> also stores a
+// pointer to the finite element in
+// use. Since this pointer is used
+// every now and then until either
+// the degrees of freedom are
+// re-distributed using another
+// finite element object or until the
+// <code>dof_handler</code> object is
+// destroyed, it would be unwise if
+// we would allow the finite element
+// object to be deleted before the
+// <code>dof_handler</code> object. To
+// disallow this, the DoF handler
+// increases a counter inside the
+// finite element object which counts
+// how many objects use that finite
+// element (this is what the
+// <code>Subscriptor</code>/<code>SmartPointer</code>
+// class pair is used for, in case
+// you want something like this for
+// your own programs; see step-7 for
+// a more complete discussion
+// of this topic). The finite
+// element object will refuse its
+// destruction if that counter is
+// larger than zero, since then some
+// other objects might rely on the
+// persistence of the finite element
+// object. An exception will then be
+// thrown and the program will
+// usually abort upon the attempt to
+// destroy the finite element.
+//
+// To be fair, such exceptions about
+// still used objects are not
+// particularly popular among
+// programmers using deal.II, since
+// they only tell us that something
+// is wrong, namely that some other
+// object is still using the object
+// that is presently being
+// destructed, but most of the time
+// not who this user is. It is
+// therefore often rather
+// time-consuming to find out where
+// the problem exactly is, although
+// it is then usually straightforward
+// to remedy the situation. However,
+// we believe that the effort to find
+// invalid references to objects that
+// do no longer exist is less if the
+// problem is detected once the
+// reference becomes invalid, rather
+// than when non-existent objects are
+// actually accessed again, since
+// then usually only invalid data is
+// accessed, but no error is
+// immediately raised.
+//
+// Coming back to the present
+// situation, if we did not write
+// this destructor, the compiler will
+// generate code that triggers
+// exactly the behavior sketched
+// above. The reason is that member
+// variables of the
+// <code>LaplaceProblem</code> class are
+// destructed bottom-up (i.e. in
+// reverse order of their declaration
+// in the class), as always in
+// C++. Thus, the finite element
+// object will be destructed before
+// the DoF handler object, since its
+// declaration is below the one of
+// the DoF handler. This triggers the
+// situation above, and an exception
+// will be raised when the <code>fe</code>
+// object is destructed. What needs
+// to be done is to tell the
+// <code>dof_handler</code> object to release
+// its lock to the finite element. Of
+// course, the <code>dof_handler</code> will
+// only release its lock if it really
+// does not need the finite element
+// any more, i.e. when all finite
+// element related data is deleted
+// from it. For this purpose, the
+// <code>DoFHandler</code> class has a
+// function <code>clear</code> which deletes
+// all degrees of freedom, and
+// releases its lock to the finite
+// element. After this, you can
+// safely destruct the finite element
+// object since its internal counter
+// is then zero.
+//
+// For completeness, we add the
+// output of the exception that would
+// have been triggered without this
+// destructor, to the end of the
+// results section of this example.
 template <int dim>
-LaplaceProblem<dim>::~LaplaceProblem () 
+LaplaceProblem<dim>::~LaplaceProblem ()
 {
   dof_handler.clear ();
 }
 
 
-                                 // @sect4{LaplaceProblem::setup_system}
-
-                                // The next function is setting up
-                                // all the variables that describe
-                                // the linear finite element problem,
-                                // such as the DoF handler, the
-                                // matrices, and vectors. The
-                                // difference to what we did in
-                                // step-5 is only that we now also
-                                // have to take care of handing node
-                                // constraints. These constraints are
-                                // handled almost transparently by
-                                // the library, i.e. you only need to
-                                // know that they exist and how to
-                                // get them, but you do not have to
-                                // know how they are formed or what
-                                // exactly is done with them.
-                                //
-                                // At the beginning of the function,
-                                // you find all the things that are
-                                // the same as in step-5: setting up
-                                // the degrees of freedom (this time
-                                // we have quadratic elements, but
-                                // there is no difference from a user
-                                // code perspective to the linear --
-                                // or cubic, for that matter --
-                                // case), generating the sparsity
-                                // pattern, and initializing the
-                                // solution and right hand side
-                                // vectors. Note that the sparsity
-                                // pattern will have significantly
-                                // more entries per row now, since
-                                // there are now 9 degrees of freedom
-                                // per cell, not only four, that can
-                                // couple with each other. The
-                                // <code>dof_Handler.max_couplings_between_dofs()</code>
-                                // call will take care of this,
-                                // however:
+// @sect4{LaplaceProblem::setup_system}
+
+// The next function is setting up
+// all the variables that describe
+// the linear finite element problem,
+// such as the DoF handler, the
+// matrices, and vectors. The
+// difference to what we did in
+// step-5 is only that we now also
+// have to take care of handing node
+// constraints. These constraints are
+// handled almost transparently by
+// the library, i.e. you only need to
+// know that they exist and how to
+// get them, but you do not have to
+// know how they are formed or what
+// exactly is done with them.
+//
+// At the beginning of the function,
+// you find all the things that are
+// the same as in step-5: setting up
+// the degrees of freedom (this time
+// we have quadratic elements, but
+// there is no difference from a user
+// code perspective to the linear --
+// or cubic, for that matter --
+// case), generating the sparsity
+// pattern, and initializing the
+// solution and right hand side
+// vectors. Note that the sparsity
+// pattern will have significantly
+// more entries per row now, since
+// there are now 9 degrees of freedom
+// per cell, not only four, that can
+// couple with each other. The
+// <code>dof_Handler.max_couplings_between_dofs()</code>
+// call will take care of this,
+// however:
 template <int dim>
 void LaplaceProblem<dim>::setup_system ()
 {
   dof_handler.distribute_dofs (fe);
 
   sparsity_pattern.reinit (dof_handler.n_dofs(),
-                          dof_handler.n_dofs(),
-                          dof_handler.max_couplings_between_dofs());
+                           dof_handler.n_dofs(),
+                           dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
 
   solution.reinit (dof_handler.n_dofs());
   system_rhs.reinit (dof_handler.n_dofs());
 
-  
-                                  // After setting up all the degrees
-                                  // of freedoms, here are now the
-                                  // differences compared to step-5,
-                                  // all of which are related to
-                                  // constraints associated with the
-                                  // hanging nodes. In the class
-                                  // desclaration, we have already
-                                  // allocated space for an object
-                                  // <code>hanging_node_constraints</code>
-                                  // that will hold a list of these
-                                  // constraints (they form a matrix,
-                                  // which is reflected in the name
-                                  // of the class, but that is
-                                  // immaterial for the moment). Now
-                                  // we have to fill this
-                                  // object. This is done using the
-                                  // following function calls (the
-                                  // first clears the contents of the
-                                  // object that may still be left
-                                  // over from computations on the
-                                  // previous mesh before the last
-                                  // adaptive refinement):
+
+  // After setting up all the degrees
+  // of freedoms, here are now the
+  // differences compared to step-5,
+  // all of which are related to
+  // constraints associated with the
+  // hanging nodes. In the class
+  // desclaration, we have already
+  // allocated space for an object
+  // <code>hanging_node_constraints</code>
+  // that will hold a list of these
+  // constraints (they form a matrix,
+  // which is reflected in the name
+  // of the class, but that is
+  // immaterial for the moment). Now
+  // we have to fill this
+  // object. This is done using the
+  // following function calls (the
+  // first clears the contents of the
+  // object that may still be left
+  // over from computations on the
+  // previous mesh before the last
+  // adaptive refinement):
   hanging_node_constraints.clear ();
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          hanging_node_constraints);
-
-                                  // The next step is <code>closing</code>
-                                  // this object. For this note that,
-                                  // in principle, the
-                                  // <code>ConstraintMatrix</code> class can
-                                  // hold other constraints as well,
-                                  // i.e. constraints that do not
-                                  // stem from hanging
-                                  // nodes. Sometimes, it is useful
-                                  // to use such constraints, in
-                                  // which case they may be added to
-                                  // the <code>ConstraintMatrix</code> object
-                                  // after the hanging node
-                                  // constraints were computed. After
-                                  // all constraints have been added,
-                                  // they need to be sorted and
-                                  // rearranged to perform some
-                                  // actions more efficiently. This
-                                  // postprocessing is done using the
-                                  // <code>close()</code> function, after which
-                                  // no further constraints may be
-                                  // added any more:
+                                           hanging_node_constraints);
+
+  // The next step is <code>closing</code>
+  // this object. For this note that,
+  // in principle, the
+  // <code>ConstraintMatrix</code> class can
+  // hold other constraints as well,
+  // i.e. constraints that do not
+  // stem from hanging
+  // nodes. Sometimes, it is useful
+  // to use such constraints, in
+  // which case they may be added to
+  // the <code>ConstraintMatrix</code> object
+  // after the hanging node
+  // constraints were computed. After
+  // all constraints have been added,
+  // they need to be sorted and
+  // rearranged to perform some
+  // actions more efficiently. This
+  // postprocessing is done using the
+  // <code>close()</code> function, after which
+  // no further constraints may be
+  // added any more:
   hanging_node_constraints.close ();
 
-                                  // The constrained hanging nodes
-                                  // will later be eliminated from
-                                  // the linear system of
-                                  // equations. When doing so, some
-                                  // additional entries in the global
-                                  // matrix will be set to non-zero
-                                  // values, so we have to reserve
-                                  // some space for them here. Since
-                                  // the process of elimination of
-                                  // these constrained nodes is
-                                  // called <code>condensation</code>, the
-                                  // functions that eliminate them
-                                  // are called <code>condense</code> for both
-                                  // the system matrix and right hand
-                                  // side, as well as for the
-                                  // sparsity pattern.
+  // The constrained hanging nodes
+  // will later be eliminated from
+  // the linear system of
+  // equations. When doing so, some
+  // additional entries in the global
+  // matrix will be set to non-zero
+  // values, so we have to reserve
+  // some space for them here. Since
+  // the process of elimination of
+  // these constrained nodes is
+  // called <code>condensation</code>, the
+  // functions that eliminate them
+  // are called <code>condense</code> for both
+  // the system matrix and right hand
+  // side, as well as for the
+  // sparsity pattern.
   hanging_node_constraints.condense (sparsity_pattern);
 
-                                  // Now all non-zero entries of the
-                                  // matrix are known (i.e. those
-                                  // from regularly assembling the
-                                  // matrix and those that were
-                                  // introduced by eliminating
-                                  // constraints). We can thus close
-                                  // the sparsity pattern and remove
-                                  // unneeded space:
+  // Now all non-zero entries of the
+  // matrix are known (i.e. those
+  // from regularly assembling the
+  // matrix and those that were
+  // introduced by eliminating
+  // constraints). We can thus close
+  // the sparsity pattern and remove
+  // unneeded space:
   sparsity_pattern.compress();
 
-                                  // Finally, the so-constructed
-                                  // sparsity pattern serves as the
-                                  // basis on top of which we will
-                                  // create the sparse matrix:
+  // Finally, the so-constructed
+  // sparsity pattern serves as the
+  // basis on top of which we will
+  // create the sparse matrix:
   system_matrix.reinit (sparsity_pattern);
 }
 
-                                 // @sect4{LaplaceProblem::assemble_system}
-
-                                // Next, we have to assemble the
-                                // matrix again. There are no code
-                                // changes compared to step-5 except
-                                // for a single place: We have to use
-                                // a higher-order quadrature formula
-                                // to account for the higher
-                                // polynomial degree in the finite
-                                // element shape functions. This is
-                                // easy to change: the constructor of
-                                // the <code>QGauss</code> class takes the
-                                // number of quadrature points in
-                                // each space direction. Previously,
-                                // we had two points for bilinear
-                                // elements. Now we should use three
-                                // points for biquadratic elements.
-                                //
-                                // The rest of the code that forms
-                                // the local contributions and
-                                // transfers them into the global
-                                // objects remains unchanged. It is
-                                // worth noting, however, that under
-                                // the hood several things are
-                                // different than before. First, the
-                                // variables <code>dofs_per_cell</code> and
-                                // <code>n_q_points</code> now are 9 each,
-                                // where they were 4
-                                // before. Introducing such variables
-                                // as abbreviations is a good
-                                // strategy to make code work with
-                                // different elements without having
-                                // to change too much code. Secondly,
-                                // the <code>fe_values</code> object of course
-                                // needs to do other things as well,
-                                // since the shape functions are now
-                                // quadratic, rather than linear, in
-                                // each coordinate variable. Again,
-                                // however, this is something that is
-                                // completely transparent to user
-                                // code and nothing that you have to
-                                // worry about.
+// @sect4{LaplaceProblem::assemble_system}
+
+// Next, we have to assemble the
+// matrix again. There are no code
+// changes compared to step-5 except
+// for a single place: We have to use
+// a higher-order quadrature formula
+// to account for the higher
+// polynomial degree in the finite
+// element shape functions. This is
+// easy to change: the constructor of
+// the <code>QGauss</code> class takes the
+// number of quadrature points in
+// each space direction. Previously,
+// we had two points for bilinear
+// elements. Now we should use three
+// points for biquadratic elements.
+//
+// The rest of the code that forms
+// the local contributions and
+// transfers them into the global
+// objects remains unchanged. It is
+// worth noting, however, that under
+// the hood several things are
+// different than before. First, the
+// variables <code>dofs_per_cell</code> and
+// <code>n_q_points</code> now are 9 each,
+// where they were 4
+// before. Introducing such variables
+// as abbreviations is a good
+// strategy to make code work with
+// different elements without having
+// to change too much code. Secondly,
+// the <code>fe_values</code> object of course
+// needs to do other things as well,
+// since the shape functions are now
+// quadratic, rather than linear, in
+// each coordinate variable. Again,
+// however, this is something that is
+// completely transparent to user
+// code and nothing that you have to
+// worry about.
 template <int dim>
-void LaplaceProblem<dim>::assemble_system () 
-{  
+void LaplaceProblem<dim>::assemble_system ()
+{
   const QGauss<dim>  quadrature_formula(3);
 
-  FEValues<dim> fe_values (fe, quadrature_formula, 
-                          update_values    |  update_gradients |
-                          update_q_points  |  update_JxW_values);
+  FEValues<dim> fe_values (fe, quadrature_formula,
+                           update_values    |  update_gradients |
+                           update_q_points  |  update_JxW_values);
 
   const unsigned int   dofs_per_cell = fe.dofs_per_cell;
   const unsigned int   n_q_points    = quadrature_formula.size();
@@ -570,8 +570,8 @@ void LaplaceProblem<dim>::assemble_system ()
   std::vector<double>    coefficient_values (n_q_points);
 
   typename DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       cell_matrix = 0;
@@ -580,120 +580,120 @@ void LaplaceProblem<dim>::assemble_system ()
       fe_values.reinit (cell);
 
       coefficient.value_list (fe_values.get_quadrature_points(),
-                             coefficient_values);
-      
+                              coefficient_values);
+
       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         {
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += (coefficient_values[q_point] *
-                                  fe_values.shape_grad(i,q_point) *
-                                  fe_values.shape_grad(j,q_point) *
-                                  fe_values.JxW(q_point));
-
-           cell_rhs(i) += (fe_values.shape_value(i,q_point) *
-                           1.0 *
-                           fe_values.JxW(q_point));
-         }
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += (coefficient_values[q_point] *
+                                   fe_values.shape_grad(i,q_point) *
+                                   fe_values.shape_grad(j,q_point) *
+                                   fe_values.JxW(q_point));
+
+            cell_rhs(i) += (fe_values.shape_value(i,q_point) *
+                            1.0 *
+                            fe_values.JxW(q_point));
+          }
 
       cell->get_dof_indices (local_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           system_matrix.add (local_dof_indices[i],
-                              local_dof_indices[j],
-                              cell_matrix(i,j));
-         
-         system_rhs(local_dof_indices[i]) += cell_rhs(i);
-       }
+        {
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            system_matrix.add (local_dof_indices[i],
+                               local_dof_indices[j],
+                               cell_matrix(i,j));
+
+          system_rhs(local_dof_indices[i]) += cell_rhs(i);
+        }
     }
 
-                                  // After the system of equations
-                                  // has been assembled just as for
-                                  // the previous examples, we still
-                                  // have to eliminate the
-                                  // constraints due to hanging
-                                  // nodes. This is done using the
-                                  // following two function calls:
+  // After the system of equations
+  // has been assembled just as for
+  // the previous examples, we still
+  // have to eliminate the
+  // constraints due to hanging
+  // nodes. This is done using the
+  // following two function calls:
   hanging_node_constraints.condense (system_matrix);
   hanging_node_constraints.condense (system_rhs);
-                                  // Using them, degrees of freedom
-                                  // associated to hanging nodes have
-                                  // been removed from the linear
-                                  // system and the independent
-                                  // variables are only the regular
-                                  // nodes. The constrained nodes are
-                                  // still in the linear system
-                                  // (there is a one on the diagonal
-                                  // of the matrix and all other
-                                  // entries for this line are set to
-                                  // zero) but the computed values
-                                  // are invalid (the <code>condense</code>
-                                  // function modifies the system so
-                                  // that the values in the solution
-                                  // corresponding to constrained
-                                  // nodes are invalid, but that the
-                                  // system still has a well-defined
-                                  // solution; we compute the correct
-                                  // values for these nodes at the
-                                  // end of the <code>solve</code> function).
-
-                                  // As almost all the stuff before,
-                                  // the interpolation of boundary
-                                  // values works also for higher
-                                  // order elements without the need
-                                  // to change your code for that. We
-                                  // note that for proper results, it
-                                  // is important that the
-                                  // elimination of boundary nodes
-                                  // from the system of equations
-                                  // happens *after* the elimination
-                                  // of hanging nodes.
+  // Using them, degrees of freedom
+  // associated to hanging nodes have
+  // been removed from the linear
+  // system and the independent
+  // variables are only the regular
+  // nodes. The constrained nodes are
+  // still in the linear system
+  // (there is a one on the diagonal
+  // of the matrix and all other
+  // entries for this line are set to
+  // zero) but the computed values
+  // are invalid (the <code>condense</code>
+  // function modifies the system so
+  // that the values in the solution
+  // corresponding to constrained
+  // nodes are invalid, but that the
+  // system still has a well-defined
+  // solution; we compute the correct
+  // values for these nodes at the
+  // end of the <code>solve</code> function).
+
+  // As almost all the stuff before,
+  // the interpolation of boundary
+  // values works also for higher
+  // order elements without the need
+  // to change your code for that. We
+  // note that for proper results, it
+  // is important that the
+  // elimination of boundary nodes
+  // from the system of equations
+  // happens *after* the elimination
+  // of hanging nodes.
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           ZeroFunction<dim>(),
-                                           boundary_values);
+                                            0,
+                                            ZeroFunction<dim>(),
+                                            boundary_values);
   MatrixTools::apply_boundary_values (boundary_values,
-                                     system_matrix,
-                                     solution,
-                                     system_rhs);
+                                      system_matrix,
+                                      solution,
+                                      system_rhs);
 }
 
 
 
-                                 // @sect4{LaplaceProblem::solve}
-
-                                // We continue with gradual
-                                // improvements. The function that
-                                // solves the linear system again
-                                // uses the SSOR preconditioner, and
-                                // is again unchanged except that we
-                                // have to incorporate hanging node
-                                // constraints. As mentioned above,
-                                // the degrees of freedom
-                                // corresponding to hanging node
-                                // constraints have been removed from
-                                // the linear system by giving the
-                                // rows and columns of the matrix a
-                                // special treatment. This way, the
-                                // values for these degrees of
-                                // freedom have wrong, but
-                                // well-defined values after solving
-                                // the linear system. What we then
-                                // have to do is to use the
-                                // constraints to assign to them the
-                                // values that they should have. This
-                                // process, called <code>distributing</code>
-                                // hanging nodes, computes the values
-                                // of constrained nodes from the
-                                // values of the unconstrained ones,
-                                // and requires only a single
-                                // additional function call that you
-                                // find at the end of this function:
+// @sect4{LaplaceProblem::solve}
+
+// We continue with gradual
+// improvements. The function that
+// solves the linear system again
+// uses the SSOR preconditioner, and
+// is again unchanged except that we
+// have to incorporate hanging node
+// constraints. As mentioned above,
+// the degrees of freedom
+// corresponding to hanging node
+// constraints have been removed from
+// the linear system by giving the
+// rows and columns of the matrix a
+// special treatment. This way, the
+// values for these degrees of
+// freedom have wrong, but
+// well-defined values after solving
+// the linear system. What we then
+// have to do is to use the
+// constraints to assign to them the
+// values that they should have. This
+// process, called <code>distributing</code>
+// hanging nodes, computes the values
+// of constrained nodes from the
+// values of the unconstrained ones,
+// and requires only a single
+// additional function call that you
+// find at the end of this function:
 
 template <int dim>
-void LaplaceProblem<dim>::solve () 
+void LaplaceProblem<dim>::solve ()
 {
   SolverControl           solver_control (1000, 1e-12);
   SolverCG<>              cg (solver_control);
@@ -702,269 +702,269 @@ void LaplaceProblem<dim>::solve ()
   preconditioner.initialize(system_matrix, 1.2);
 
   cg.solve (system_matrix, solution, system_rhs,
-           preconditioner);
+            preconditioner);
 
   hanging_node_constraints.distribute (solution);
 }
 
 
-                                 // @sect4{LaplaceProblem::refine_grid}
-
-                                // Instead of global refinement, we
-                                // now use a slightly more elaborate
-                                // scheme. We will use the
-                                // <code>KellyErrorEstimator</code> class
-                                // which implements an error
-                                // estimator for the Laplace
-                                // equation; it can in principle
-                                // handle variable coefficients, but
-                                // we will not use these advanced
-                                // features, but rather use its most
-                                // simple form since we are not
-                                // interested in quantitative results
-                                // but only in a quick way to
-                                // generate locally refined grids.
-                                //
-                                // Although the error estimator
-                                // derived by Kelly et al. was
-                                // originally developed for the Laplace
-                                // equation, we have found that it is
-                                // also well suited to quickly
-                                // generate locally refined grids for
-                                // a wide class of
-                                // problems. Basically, it looks at
-                                // the jumps of the gradients of the
-                                // solution over the faces of cells
-                                // (which is a measure for the second
-                                // derivatives) and scales it by the
-                                // size of the cell. It is therefore
-                                // a measure for the local smoothness
-                                // of the solution at the place of
-                                // each cell and it is thus
-                                // understandable that it yields
-                                // reasonable grids also for
-                                // hyperbolic transport problems or
-                                // the wave equation as well,
-                                // although these grids are certainly
-                                // suboptimal compared to approaches
-                                // specially tailored to the
-                                // problem. This error estimator may
-                                // therefore be understood as a quick
-                                // way to test an adaptive program.
-                                //
-                                // The way the estimator works is to
-                                // take a <code>DoFHandler</code> object
-                                // describing the degrees of freedom
-                                // and a vector of values for each
-                                // degree of freedom as input and
-                                // compute a single indicator value
-                                // for each active cell of the
-                                // triangulation (i.e. one value for
-                                // each of the
-                                // <code>triangulation.n_active_cells()</code>
-                                // cells). To do so, it needs two
-                                // additional pieces of information:
-                                // a quadrature formula on the faces
-                                // (i.e. quadrature formula on
-                                // <code>dim-1</code> dimensional objects. We
-                                // use a 3-point Gauss rule again, a
-                                // pick that is consistent and
-                                // appropriate with the choice
-                                // bi-quadratic finite element shape
-                                // functions in this program.
-                                // (What constitutes a suitable
-                                // quadrature rule here of course
-                                // depends on knowledge of the way
-                                // the error estimator evaluates
-                                // the solution field. As said
-                                // above, the jump of the gradient
-                                // is integrated over each face,
-                                // which would be a quadratic
-                                // function on each face for the
-                                // quadratic elements in use in
-                                // this example. In fact, however,
-                                // it is the square of the jump of
-                                // the gradient, as explained in
-                                // the documentation of that class,
-                                // and that is a quartic function,
-                                // for which a 3 point Gauss
-                                // formula is sufficient since it
-                                // integrates polynomials up to
-                                // order 5 exactly.)
-                                //
-                                // Secondly, the function wants a
-                                // list of boundaries where we have
-                                // imposed Neumann value, and the
-                                // corresponding Neumann values. This
-                                // information is represented by an
-                                // object of type
-                                // <code>FunctionMap@<dim@>::type</code> that is
-                                // essentially a map from boundary
-                                // indicators to function objects
-                                // describing Neumann boundary values
-                                // (in the present example program,
-                                // we do not use Neumann boundary
-                                // values, so this map is empty, and
-                                // in fact constructed using the
-                                // default constructor of the map in
-                                // the place where the function call
-                                // expects the respective function
-                                // argument).
-                                //
-                                // The output, as mentioned is a
-                                // vector of values for all
-                                // cells. While it may make sense to
-                                // compute the *value* of a degree of
-                                // freedom very accurately, it is
-                                // usually not helpful to compute the
-                                // *error indicator* corresponding to
-                                // a cell particularly accurately. We
-                                // therefore typically use a vector
-                                // of floats instead of a vector of
-                                // doubles to represent error
-                                // indicators.
+// @sect4{LaplaceProblem::refine_grid}
+
+// Instead of global refinement, we
+// now use a slightly more elaborate
+// scheme. We will use the
+// <code>KellyErrorEstimator</code> class
+// which implements an error
+// estimator for the Laplace
+// equation; it can in principle
+// handle variable coefficients, but
+// we will not use these advanced
+// features, but rather use its most
+// simple form since we are not
+// interested in quantitative results
+// but only in a quick way to
+// generate locally refined grids.
+//
+// Although the error estimator
+// derived by Kelly et al. was
+// originally developed for the Laplace
+// equation, we have found that it is
+// also well suited to quickly
+// generate locally refined grids for
+// a wide class of
+// problems. Basically, it looks at
+// the jumps of the gradients of the
+// solution over the faces of cells
+// (which is a measure for the second
+// derivatives) and scales it by the
+// size of the cell. It is therefore
+// a measure for the local smoothness
+// of the solution at the place of
+// each cell and it is thus
+// understandable that it yields
+// reasonable grids also for
+// hyperbolic transport problems or
+// the wave equation as well,
+// although these grids are certainly
+// suboptimal compared to approaches
+// specially tailored to the
+// problem. This error estimator may
+// therefore be understood as a quick
+// way to test an adaptive program.
+//
+// The way the estimator works is to
+// take a <code>DoFHandler</code> object
+// describing the degrees of freedom
+// and a vector of values for each
+// degree of freedom as input and
+// compute a single indicator value
+// for each active cell of the
+// triangulation (i.e. one value for
+// each of the
+// <code>triangulation.n_active_cells()</code>
+// cells). To do so, it needs two
+// additional pieces of information:
+// a quadrature formula on the faces
+// (i.e. quadrature formula on
+// <code>dim-1</code> dimensional objects. We
+// use a 3-point Gauss rule again, a
+// pick that is consistent and
+// appropriate with the choice
+// bi-quadratic finite element shape
+// functions in this program.
+// (What constitutes a suitable
+// quadrature rule here of course
+// depends on knowledge of the way
+// the error estimator evaluates
+// the solution field. As said
+// above, the jump of the gradient
+// is integrated over each face,
+// which would be a quadratic
+// function on each face for the
+// quadratic elements in use in
+// this example. In fact, however,
+// it is the square of the jump of
+// the gradient, as explained in
+// the documentation of that class,
+// and that is a quartic function,
+// for which a 3 point Gauss
+// formula is sufficient since it
+// integrates polynomials up to
+// order 5 exactly.)
+//
+// Secondly, the function wants a
+// list of boundaries where we have
+// imposed Neumann value, and the
+// corresponding Neumann values. This
+// information is represented by an
+// object of type
+// <code>FunctionMap@<dim@>::type</code> that is
+// essentially a map from boundary
+// indicators to function objects
+// describing Neumann boundary values
+// (in the present example program,
+// we do not use Neumann boundary
+// values, so this map is empty, and
+// in fact constructed using the
+// default constructor of the map in
+// the place where the function call
+// expects the respective function
+// argument).
+//
+// The output, as mentioned is a
+// vector of values for all
+// cells. While it may make sense to
+// compute the *value* of a degree of
+// freedom very accurately, it is
+// usually not helpful to compute the
+// *error indicator* corresponding to
+// a cell particularly accurately. We
+// therefore typically use a vector
+// of floats instead of a vector of
+// doubles to represent error
+// indicators.
 template <int dim>
 void LaplaceProblem<dim>::refine_grid ()
 {
   Vector<float> estimated_error_per_cell (triangulation.n_active_cells());
 
   KellyErrorEstimator<dim>::estimate (dof_handler,
-                                     QGauss<dim-1>(3),
-                                     typename FunctionMap<dim>::type(),
-                                     solution,
-                                     estimated_error_per_cell);
-
-                                  // The above function returned one
-                                  // error indicator value for each
-                                  // cell in the
-                                  // <code>estimated_error_per_cell</code>
-                                  // array. Refinement is now done as
-                                  // follows: refine those 30 per
-                                  // cent of the cells with the
-                                  // highest error values, and
-                                  // coarsen the 3 per cent of cells
-                                  // with the lowest values.
-                                  //
-                                  // One can easily verify that if
-                                  // the second number were zero,
-                                  // this would approximately result
-                                  // in a doubling of cells in each
-                                  // step in two space dimensions,
-                                  // since for each of the 30 per
-                                  // cent of cells, four new would be
-                                  // replaced, while the remaining 70
-                                  // per cent of cells remain
-                                  // untouched. In practice, some
-                                  // more cells are usually produced
-                                  // since it is disallowed that a
-                                  // cell is refined twice while the
-                                  // neighbor cell is not refined; in
-                                  // that case, the neighbor cell
-                                  // would be refined as well.
-                                  //
-                                  // In many applications, the number
-                                  // of cells to be coarsened would
-                                  // be set to something larger than
-                                  // only three per cent. A non-zero
-                                  // value is useful especially if
-                                  // for some reason the initial
-                                  // (coarse) grid is already rather
-                                  // refined. In that case, it might
-                                  // be necessary to refine it in
-                                  // some regions, while coarsening
-                                  // in some other regions is
-                                  // useful. In our case here, the
-                                  // initial grid is very coarse, so
-                                  // coarsening is only necessary in
-                                  // a few regions where
-                                  // over-refinement may have taken
-                                  // place. Thus a small, non-zero
-                                  // value is appropriate here.
-                                  //
-                                  // The following function now takes
-                                  // these refinement indicators and
-                                  // flags some cells of the
-                                  // triangulation for refinement or
-                                  // coarsening using the method
-                                  // described above. It is from a
-                                  // class that implements
-                                  // several different algorithms to
-                                  // refine a triangulation based on
-                                  // cell-wise error indicators.
+                                      QGauss<dim-1>(3),
+                                      typename FunctionMap<dim>::type(),
+                                      solution,
+                                      estimated_error_per_cell);
+
+  // The above function returned one
+  // error indicator value for each
+  // cell in the
+  // <code>estimated_error_per_cell</code>
+  // array. Refinement is now done as
+  // follows: refine those 30 per
+  // cent of the cells with the
+  // highest error values, and
+  // coarsen the 3 per cent of cells
+  // with the lowest values.
+  //
+  // One can easily verify that if
+  // the second number were zero,
+  // this would approximately result
+  // in a doubling of cells in each
+  // step in two space dimensions,
+  // since for each of the 30 per
+  // cent of cells, four new would be
+  // replaced, while the remaining 70
+  // per cent of cells remain
+  // untouched. In practice, some
+  // more cells are usually produced
+  // since it is disallowed that a
+  // cell is refined twice while the
+  // neighbor cell is not refined; in
+  // that case, the neighbor cell
+  // would be refined as well.
+  //
+  // In many applications, the number
+  // of cells to be coarsened would
+  // be set to something larger than
+  // only three per cent. A non-zero
+  // value is useful especially if
+  // for some reason the initial
+  // (coarse) grid is already rather
+  // refined. In that case, it might
+  // be necessary to refine it in
+  // some regions, while coarsening
+  // in some other regions is
+  // useful. In our case here, the
+  // initial grid is very coarse, so
+  // coarsening is only necessary in
+  // a few regions where
+  // over-refinement may have taken
+  // place. Thus a small, non-zero
+  // value is appropriate here.
+  //
+  // The following function now takes
+  // these refinement indicators and
+  // flags some cells of the
+  // triangulation for refinement or
+  // coarsening using the method
+  // described above. It is from a
+  // class that implements
+  // several different algorithms to
+  // refine a triangulation based on
+  // cell-wise error indicators.
   GridRefinement::refine_and_coarsen_fixed_number (triangulation,
-                                                  estimated_error_per_cell,
-                                                  0.3, 0.03);
-
-                                  // After the previous function has
-                                  // exited, some cells are flagged
-                                  // for refinement, and some other
-                                  // for coarsening. The refinement
-                                  // or coarsening itself is not
-                                  // performed by now, however, since
-                                  // there are cases where further
-                                  // modifications of these flags is
-                                  // useful. Here, we don't want to
-                                  // do any such thing, so we can
-                                  // tell the triangulation to
-                                  // perform the actions for which
-                                  // the cells are flagged:
+                                                   estimated_error_per_cell,
+                                                   0.3, 0.03);
+
+  // After the previous function has
+  // exited, some cells are flagged
+  // for refinement, and some other
+  // for coarsening. The refinement
+  // or coarsening itself is not
+  // performed by now, however, since
+  // there are cases where further
+  // modifications of these flags is
+  // useful. Here, we don't want to
+  // do any such thing, so we can
+  // tell the triangulation to
+  // perform the actions for which
+  // the cells are flagged:
   triangulation.execute_coarsening_and_refinement ();
 }
 
 
-                                 // @sect4{LaplaceProblem::output_results}
-
-                                // At the end of computations on each
-                                // grid, and just before we continue
-                                // the next cycle with mesh
-                                // refinement, we want to output the
-                                // results from this cycle.
-                                //
-                                // In the present program, we will
-                                // not write the solution (except for
-                                // in the last step, see the next
-                                // function), but only the meshes
-                                // that we generated, as a
-                                // two-dimensional Encapsulated
-                                // Postscript (EPS) file.
-                                //
-                                // We have already seen in step-1 how
-                                // this can be achieved. The only
-                                // thing we have to change is the
-                                // generation of the file name, since
-                                // it should contain the number of
-                                // the present refinement cycle
-                                // provided to this function as an
-                                // argument. The most general way is
-                                // to use the std::stringstream class
-                                // as shown in step-5, but here's a
-                                // little hack that makes it simpler
-                                // if we know that we have less than
-                                // 10 iterations: assume that the
-                                // numbers `0' through `9' are
-                                // represented consecutively in the
-                                // character set used on your machine
-                                // (this is in fact the case in all
-                                // known character sets), then
-                                // '0'+cycle gives the character
-                                // corresponding to the present cycle
-                                // number. Of course, this will only
-                                // work if the number of cycles is
-                                // actually less than 10, and rather
-                                // than waiting for the disaster to
-                                // happen, we safeguard our little
-                                // hack with an explicit assertion at
-                                // the beginning of the function. If
-                                // this assertion is triggered,
-                                // i.e. when <code>cycle</code> is larger than
-                                // or equal to 10, an exception of
-                                // type <code>ExcNotImplemented</code> is
-                                // raised, indicating that some
-                                // functionality is not implemented
-                                // for this case (the functionality
-                                // that is missing, of course, is the
-                                // generation of file names for that
-                                // case):
+// @sect4{LaplaceProblem::output_results}
+
+// At the end of computations on each
+// grid, and just before we continue
+// the next cycle with mesh
+// refinement, we want to output the
+// results from this cycle.
+//
+// In the present program, we will
+// not write the solution (except for
+// in the last step, see the next
+// function), but only the meshes
+// that we generated, as a
+// two-dimensional Encapsulated
+// Postscript (EPS) file.
+//
+// We have already seen in step-1 how
+// this can be achieved. The only
+// thing we have to change is the
+// generation of the file name, since
+// it should contain the number of
+// the present refinement cycle
+// provided to this function as an
+// argument. The most general way is
+// to use the std::stringstream class
+// as shown in step-5, but here's a
+// little hack that makes it simpler
+// if we know that we have less than
+// 10 iterations: assume that the
+// numbers `0' through `9' are
+// represented consecutively in the
+// character set used on your machine
+// (this is in fact the case in all
+// known character sets), then
+// '0'+cycle gives the character
+// corresponding to the present cycle
+// number. Of course, this will only
+// work if the number of cycles is
+// actually less than 10, and rather
+// than waiting for the disaster to
+// happen, we safeguard our little
+// hack with an explicit assertion at
+// the beginning of the function. If
+// this assertion is triggered,
+// i.e. when <code>cycle</code> is larger than
+// or equal to 10, an exception of
+// type <code>ExcNotImplemented</code> is
+// raised, indicating that some
+// functionality is not implemented
+// for this case (the functionality
+// that is missing, of course, is the
+// generation of file names for that
+// case):
 template <int dim>
 void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
 {
@@ -973,7 +973,7 @@ void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
   std::string filename = "grid-";
   filename += ('0' + cycle);
   filename += ".eps";
-  
+
   std::ofstream output (filename.c_str());
 
   GridOut grid_out;
@@ -982,95 +982,95 @@ void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
 
 
 
-                                 // @sect4{LaplaceProblem::run}
-
-                                // The final function before
-                                // <code>main()</code> is again the main
-                                // driver of the class, <code>run()</code>. It
-                                // is similar to the one of step-5,
-                                // except that we generate a file in
-                                // the program again instead of
-                                // reading it from disk, in that we
-                                // adaptively instead of globally
-                                // refine the mesh, and that we
-                                // output the solution on the final
-                                // mesh in the present function.
-                                //
-                                // The first block in the main loop
-                                // of the function deals with mesh
-                                // generation. If this is the first
-                                // cycle of the program, instead of
-                                // reading the grid from a file on
-                                // disk as in the previous example,
-                                // we now again create it using a
-                                // library function. The domain is
-                                // again a circle, which is why we
-                                // have to provide a suitable
-                                // boundary object as well. We place
-                                // the center of the circle at the
-                                // origin and have the radius be one
-                                // (these are the two hidden
-                                // arguments to the function, which
-                                // have default values).
-                                //
-                                // You will notice by looking at the
-                                // coarse grid that it is of inferior
-                                // quality than the one which we read
-                                // from the file in the previous
-                                // example: the cells are less
-                                // equally formed. However, using the
-                                // library function this program
-                                // works in any space dimension,
-                                // which was not the case before.
-                                //
-                                // In case we find that this is not
-                                // the first cycle, we want to refine
-                                // the grid. Unlike the global
-                                // refinement employed in the last
-                                // example program, we now use the
-                                // adaptive procedure described
-                                // above.
-                                //
-                                // The rest of the loop looks as
-                                // before:
+// @sect4{LaplaceProblem::run}
+
+// The final function before
+// <code>main()</code> is again the main
+// driver of the class, <code>run()</code>. It
+// is similar to the one of step-5,
+// except that we generate a file in
+// the program again instead of
+// reading it from disk, in that we
+// adaptively instead of globally
+// refine the mesh, and that we
+// output the solution on the final
+// mesh in the present function.
+//
+// The first block in the main loop
+// of the function deals with mesh
+// generation. If this is the first
+// cycle of the program, instead of
+// reading the grid from a file on
+// disk as in the previous example,
+// we now again create it using a
+// library function. The domain is
+// again a circle, which is why we
+// have to provide a suitable
+// boundary object as well. We place
+// the center of the circle at the
+// origin and have the radius be one
+// (these are the two hidden
+// arguments to the function, which
+// have default values).
+//
+// You will notice by looking at the
+// coarse grid that it is of inferior
+// quality than the one which we read
+// from the file in the previous
+// example: the cells are less
+// equally formed. However, using the
+// library function this program
+// works in any space dimension,
+// which was not the case before.
+//
+// In case we find that this is not
+// the first cycle, we want to refine
+// the grid. Unlike the global
+// refinement employed in the last
+// example program, we now use the
+// adaptive procedure described
+// above.
+//
+// The rest of the loop looks as
+// before:
 template <int dim>
-void LaplaceProblem<dim>::run () 
+void LaplaceProblem<dim>::run ()
 {
   for (unsigned int cycle=0; cycle<8; ++cycle)
     {
       deallog << "Cycle " << cycle << ':' << std::endl;
 
       if (cycle == 0)
-       {
-         GridGenerator::hyper_ball (triangulation);
+        {
+          GridGenerator::hyper_ball (triangulation);
 
-         static const HyperBallBoundary<dim> boundary;
-         triangulation.set_boundary (0, boundary);
+          static const HyperBallBoundary<dim> boundary;
+          triangulation.set_boundary (0, boundary);
 
-         triangulation.refine_global (1);
-       }
+          triangulation.refine_global (1);
+        }
       else
-       refine_grid ();
-      
+        refine_grid ();
+
 
       deallog << "   Number of active cells:       "
-               << triangulation.n_active_cells()
-               << std::endl;
+              << triangulation.n_active_cells()
+              << std::endl;
 
       setup_system ();
 
       deallog << "   Number of degrees of freedom: "
-               << dof_handler.n_dofs()
-               << std::endl;
-      
+              << dof_handler.n_dofs()
+              << std::endl;
+
       assemble_system ();
       solve ();
     }
 
-                                  // try to find a bunch of points that are
-                                  // definitely inside the domain (we here
-                                  // have a circle of radius 1, so find
-                                  // points inside a radius of 0.9)
+  // try to find a bunch of points that are
+  // definitely inside the domain (we here
+  // have a circle of radius 1, so find
+  // points inside a radius of 0.9)
   for (int i=0; i<1000; i++)
     {
       double r = sqrt((0.9*std::rand()/RAND_MAX));
@@ -1083,140 +1083,140 @@ void LaplaceProblem<dim>::run ()
 }
 
 
-                                 // @sect3{The <code>main</code> function}
-
-                                // The main function is unaltered in
-                                // its functionality from the
-                                // previous example, but we have
-                                // taken a step of additional
-                                // caution. Sometimes, something goes
-                                // wrong (such as insufficient disk
-                                // space upon writing an output file,
-                                // not enough memory when trying to
-                                // allocate a vector or a matrix, or
-                                // if we can't read from or write to
-                                // a file for whatever reason), and
-                                // in these cases the library will
-                                // throw exceptions. Since these are
-                                // run-time problems, not programming
-                                // errors that can be fixed once and
-                                // for all, this kind of exceptions
-                                // is not switched off in optimized
-                                // mode, in contrast to the
-                                // <code>Assert</code> macro which we have
-                                // used to test against programming
-                                // errors. If uncaught, these
-                                // exceptions propagate the call tree
-                                // up to the <code>main</code> function, and
-                                // if they are not caught there
-                                // either, the program is aborted. In
-                                // many cases, like if there is not
-                                // enough memory or disk space, we
-                                // can't do anything but we can at
-                                // least print some text trying to
-                                // explain the reason why the program
-                                // failed. A way to do so is shown in
-                                // the following. It is certainly
-                                // useful to write any larger program
-                                // in this way, and you can do so by
-                                // more or less copying this function
-                                // except for the <code>try</code> block that
-                                // actually encodes the functionality
-                                // particular to the present
-                                // application.
-int main () 
+// @sect3{The <code>main</code> function}
+
+// The main function is unaltered in
+// its functionality from the
+// previous example, but we have
+// taken a step of additional
+// caution. Sometimes, something goes
+// wrong (such as insufficient disk
+// space upon writing an output file,
+// not enough memory when trying to
+// allocate a vector or a matrix, or
+// if we can't read from or write to
+// a file for whatever reason), and
+// in these cases the library will
+// throw exceptions. Since these are
+// run-time problems, not programming
+// errors that can be fixed once and
+// for all, this kind of exceptions
+// is not switched off in optimized
+// mode, in contrast to the
+// <code>Assert</code> macro which we have
+// used to test against programming
+// errors. If uncaught, these
+// exceptions propagate the call tree
+// up to the <code>main</code> function, and
+// if they are not caught there
+// either, the program is aborted. In
+// many cases, like if there is not
+// enough memory or disk space, we
+// can't do anything but we can at
+// least print some text trying to
+// explain the reason why the program
+// failed. A way to do so is shown in
+// the following. It is certainly
+// useful to write any larger program
+// in this way, and you can do so by
+// more or less copying this function
+// except for the <code>try</code> block that
+// actually encodes the functionality
+// particular to the present
+// application.
+int main ()
 {
   std::ofstream logfile ("joa_1/output");
   deallog << std::setprecision (3);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-                                  // The general idea behind the
-                                  // layout of this function is as
-                                  // follows: let's try to run the
-                                  // program as we did before...
+  // The general idea behind the
+  // layout of this function is as
+  // follows: let's try to run the
+  // program as we did before...
   try
     {
       LaplaceProblem<2> laplace_problem_2d;
       laplace_problem_2d.run ();
     }
-                                  // ...and if this should fail, try
-                                  // to gather as much information as
-                                  // possible. Specifically, if the
-                                  // exception that was thrown is an
-                                  // object of a class that is
-                                  // derived from the C++ standard
-                                  // class <code>exception</code>, then we can
-                                  // use the <code>what</code> member function
-                                  // to get a string which describes
-                                  // the reason why the exception was
-                                  // thrown. 
-                                  //
-                                  // The deal.II exception classes
-                                  // are all derived from the
-                                  // standard class, and in
-                                  // particular, the <code>exc.what()</code>
-                                  // function will return
-                                  // approximately the same string as
-                                  // would be generated if the
-                                  // exception was thrown using the
-                                  // <code>Assert</code> macro. You have seen
-                                  // the output of such an exception
-                                  // in the previous example, and you
-                                  // then know that it contains the
-                                  // file and line number of where
-                                  // the exception occured, and some
-                                  // other information. This is also
-                                  // what the following statements
-                                  // would print.
-                                  //
-                                  // Apart from this, there isn't
-                                  // much that we can do except
-                                  // exiting the program with an
-                                  // error code (this is what the
-                                  // <code>return 1;</code> does):
+  // ...and if this should fail, try
+  // to gather as much information as
+  // possible. Specifically, if the
+  // exception that was thrown is an
+  // object of a class that is
+  // derived from the C++ standard
+  // class <code>exception</code>, then we can
+  // use the <code>what</code> member function
+  // to get a string which describes
+  // the reason why the exception was
+  // thrown.
+  //
+  // The deal.II exception classes
+  // are all derived from the
+  // standard class, and in
+  // particular, the <code>exc.what()</code>
+  // function will return
+  // approximately the same string as
+  // would be generated if the
+  // exception was thrown using the
+  // <code>Assert</code> macro. You have seen
+  // the output of such an exception
+  // in the previous example, and you
+  // then know that it contains the
+  // file and line number of where
+  // the exception occured, and some
+  // other information. This is also
+  // what the following statements
+  // would print.
+  //
+  // Apart from this, there isn't
+  // much that we can do except
+  // exiting the program with an
+  // error code (this is what the
+  // <code>return 1;</code> does):
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
-                                  // If the exception that was thrown
-                                  // somewhere was not an object of a
-                                  // class derived from the standard
-                                  // <code>exception</code> class, then we
-                                  // can't do anything at all. We
-                                  // then simply print an error
-                                  // message and exit.
-  catch (...) 
+  // If the exception that was thrown
+  // somewhere was not an object of a
+  // class derived from the standard
+  // <code>exception</code> class, then we
+  // can't do anything at all. We
+  // then simply print an error
+  // message and exit.
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     }
 
-                                  // If we got to this point, there
-                                  // was no exception which
-                                  // propagated up to the main
-                                  // function (there may have been
-                                  // exceptions, but they were caught
-                                  // somewhere in the program or the
-                                  // library). Therefore, the program
-                                  // performed as was expected and we
-                                  // can return without error.
+  // If we got to this point, there
+  // was no exception which
+  // propagated up to the main
+  // function (there may have been
+  // exceptions, but they were caught
+  // somewhere in the program or the
+  // library). Therefore, the program
+  // performed as was expected and we
+  // can return without error.
   return 0;
 }
index 4c6431022a1b2d3997384cf8c6384c499e68fb46..982239680b971093e4d0cee9fbb3b2f580058081 100644 (file)
 #include <fstream>
 #include <iomanip>
 
-                      
+
 template <int dim>
 void test ()
 {
   deallog << dim << "D" << std::endl;
-  
+
   Triangulation<dim> triangulation;
   GridGenerator::hyper_cube (triangulation);
 
-                                   // refine the mesh in a random way
+  // refine the mesh in a random way
   triangulation.refine_global (4-dim);
   for (unsigned int i=0; i<11-2*dim; ++i)
     {
       typename Triangulation<dim>::active_cell_iterator
-        cell = triangulation.begin_active();
+      cell = triangulation.begin_active();
       for (unsigned int index=0; cell != triangulation.end(); ++cell, ++index)
         if (index % (3*dim) == 0)
           cell->set_refine_flag();
       triangulation.execute_coarsening_and_refinement ();
     }
-  deallog << "Number of cells: " 
-         << triangulation.n_active_cells() << std::endl;
-  
-                                   // assign quadrature, set up a
-                                   // DoFHandler, and distribute dofs
+  deallog << "Number of cells: "
+          << triangulation.n_active_cells() << std::endl;
+
+  // assign quadrature, set up a
+  // DoFHandler, and distribute dofs
   FE_Q<dim> fe(1);
   DoFHandler<dim> dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
-  deallog << "Number of dofs : " 
-         << dof_handler.n_dofs() << std::endl;
+  deallog << "Number of dofs : "
+          << dof_handler.n_dofs() << std::endl;
 
-                                   // then set up a sparsity pattern
-                                   // and two matrices and vectors on
-                                   // top of it.
+  // then set up a sparsity pattern
+  // and two matrices and vectors on
+  // top of it.
   SparsityPattern sparsity (dof_handler.n_dofs(),
                             dof_handler.n_dofs(),
                             dof_handler.max_couplings_between_dofs());
@@ -81,65 +81,65 @@ void test ()
   SparseMatrix<double> A(sparsity), B(sparsity);
   Vector<double> a1 (dof_handler.n_dofs());
 
-                                   // initialize object denoting zero
-                                   // boundary values and boundary
-                                   // constraints
+  // initialize object denoting zero
+  // boundary values and boundary
+  // constraints
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           ConstantFunction<dim>(1.),
-                                           boundary_values);
+                                            0,
+                                            ConstantFunction<dim>(1.),
+                                            boundary_values);
   ConstraintMatrix constraints;
   constraints.clear();
   DoFTools::make_zero_boundary_constraints (dof_handler,
-                                           constraints);
+                                            constraints);
   constraints.close();
 
-                                   // then fill two matrices by
-                                   // setting up bogus matrix entries
-                                   // and for A applying constraints
-                                   // right away and for B applying
-                                   // constraints later on
+  // then fill two matrices by
+  // setting up bogus matrix entries
+  // and for A applying constraints
+  // right away and for B applying
+  // constraints later on
   std::vector<types::global_dof_index> local_dofs (fe.dofs_per_cell);
   FullMatrix<double> local_matrix (fe.dofs_per_cell, fe.dofs_per_cell);
   Vector<double> local_vector (fe.dofs_per_cell);
   for (typename DoFHandler<dim>::active_cell_iterator
-         cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell != dof_handler.end(); ++cell)
     {
       cell->get_dof_indices (local_dofs);
       local_matrix = 0;
 
-                                   // create local matrices
+      // create local matrices
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
         for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
-          local_matrix(i,j) = (i+1.)*(j+1.)*(local_dofs[i]+1.)*(local_dofs[j]+1.);
+          for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
+            local_matrix(i,j) = (i+1.)*(j+1.)*(local_dofs[i]+1.)*(local_dofs[j]+1.);
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
-       local_vector(i) = (i+1.)*(local_dofs[i]+1.);
-      
-                                   // for matrix A and vector a1 apply boundary
-                                   // values
+        local_vector(i) = (i+1.)*(local_dofs[i]+1.);
+
+      // for matrix A and vector a1 apply boundary
+      // values
       MatrixTools::local_apply_boundary_values (boundary_values, local_dofs,
                                                 local_matrix, local_vector,
                                                 true);
       cell->distribute_local_to_global (local_matrix, A);
       cell->distribute_local_to_global (local_vector, a1);
 
-                                   // for matrix B cast constraint
-                                   // matrix 
+      // for matrix B cast constraint
+      // matrix
       constraints.distribute_local_to_global (local_matrix,
-                                             local_dofs,
-                                             B);
+                                              local_dofs,
+                                              B);
     }
 
-                                   // here comes the check: compare
-                                   // the l1_norm of matrices A and B,
-                                   // their difference should be zero
+  // here comes the check: compare
+  // the l1_norm of matrices A and B,
+  // their difference should be zero
   deallog << "|A| = " << A.l1_norm() << std::endl;
   deallog << "|B| = " << B.l1_norm() << std::endl;
   Assert (A.l1_norm() - B.l1_norm() == 0,
-            ExcInternalError());
+          ExcInternalError());
 }
 
 int main ()
@@ -158,25 +158,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-             << "----------------------------------------------------"
-             << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-             << exc.what() << std::endl
-             << "Aborting!" << std::endl
-             << "----------------------------------------------------"
-             << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-             << "----------------------------------------------------"
-             << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-             << "Aborting!" << std::endl
-             << "----------------------------------------------------"
-             << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 6292e8fb984d23ac376467702468e548411d54b9..a63998aaef9a4b03f70c877a380b58b9a15e4b49 100644 (file)
@@ -50,38 +50,38 @@ void test ()
 
   Triangulation<dim> triangulation;
   const Point<dim> p2 = (dim == 1 ?
-                        Point<dim>(1.) :
-                        (dim == 2 ?
-                         Point<dim>(1.,1.) :
-                         Point<dim>(1.,1.,1.)));
+                         Point<dim>(1.) :
+                         (dim == 2 ?
+                          Point<dim>(1.,1.) :
+                          Point<dim>(1.,1.,1.)));
   GridGenerator::hyper_rectangle (triangulation,
-                                 Point<dim>(), p2, true);
+                                  Point<dim>(), p2, true);
 
-                                   // refine the mesh in a random way
+  // refine the mesh in a random way
   triangulation.refine_global (4-dim);
   for (unsigned int i=0; i<11-2*dim; ++i)
     {
       typename Triangulation<dim>::active_cell_iterator
-        cell = triangulation.begin_active();
+      cell = triangulation.begin_active();
       for (unsigned int index=0; cell != triangulation.end(); ++cell, ++index)
         if (index % (3*dim) == 0)
           cell->set_refine_flag();
       triangulation.execute_coarsening_and_refinement ();
     }
   deallog << "Number of cells: "
-         << triangulation.n_active_cells() << std::endl;
+          << triangulation.n_active_cells() << std::endl;
 
-                                   // assign quadrature, set up a
-                                   // DoFHandler, and distribute dofs
+  // assign quadrature, set up a
+  // DoFHandler, and distribute dofs
   FE_Q<dim> fe(1);
   DoFHandler<dim> dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
   deallog << "Number of dofs : "
-         << dof_handler.n_dofs() << std::endl;
+          << dof_handler.n_dofs() << std::endl;
 
-                                   // then set up a sparsity pattern
-                                   // and two matrices and vectors on
-                                   // top of it.
+  // then set up a sparsity pattern
+  // and two matrices and vectors on
+  // top of it.
   SparsityPattern sparsity (dof_handler.n_dofs(),
                             dof_handler.n_dofs(),
                             dof_handler.max_couplings_between_dofs());
@@ -90,66 +90,66 @@ void test ()
   SparseMatrix<double> A(sparsity), B(sparsity);
   Vector<double> a1 (dof_handler.n_dofs());
 
-                                   // initialize object denoting zero
-                                   // boundary values and boundary
-                                   // constraints
+  // initialize object denoting zero
+  // boundary values and boundary
+  // constraints
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           1,
-                                           ConstantFunction<dim>(1.),
-                                           boundary_values);
+                                            1,
+                                            ConstantFunction<dim>(1.),
+                                            boundary_values);
   ConstraintMatrix constraints;
   constraints.clear();
   DoFTools::make_zero_boundary_constraints (dof_handler,
-                                           1,
-                                           constraints);
+                                            1,
+                                            constraints);
   constraints.close();
 
-                                   // then fill two matrices by
-                                   // setting up bogus matrix entries
-                                   // and for A applying constraints
-                                   // right away and for B applying
-                                   // constraints later on
+  // then fill two matrices by
+  // setting up bogus matrix entries
+  // and for A applying constraints
+  // right away and for B applying
+  // constraints later on
   std::vector<types::global_dof_index> local_dofs (fe.dofs_per_cell);
   FullMatrix<double> local_matrix (fe.dofs_per_cell, fe.dofs_per_cell);
   Vector<double> local_vector (fe.dofs_per_cell);
   for (typename DoFHandler<dim>::active_cell_iterator
-         cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell != dof_handler.end(); ++cell)
     {
       cell->get_dof_indices (local_dofs);
       local_matrix = 0;
 
-                                   // create local matrices
+      // create local matrices
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
         for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
-          local_matrix(i,j) = (i+1.)*(j+1.)*(local_dofs[i]+1.)*(local_dofs[j]+1.);
+          for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
+            local_matrix(i,j) = (i+1.)*(j+1.)*(local_dofs[i]+1.)*(local_dofs[j]+1.);
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
-       local_vector(i) = (i+1.)*(local_dofs[i]+1.);
+        local_vector(i) = (i+1.)*(local_dofs[i]+1.);
 
-                                   // for matrix A and vector a1 apply boundary
-                                   // values
+      // for matrix A and vector a1 apply boundary
+      // values
       MatrixTools::local_apply_boundary_values (boundary_values, local_dofs,
                                                 local_matrix, local_vector,
                                                 true);
       cell->distribute_local_to_global (local_matrix, A);
       cell->distribute_local_to_global (local_vector, a1);
 
-                                   // for matrix B cast constraint
-                                   // matrix
+      // for matrix B cast constraint
+      // matrix
       constraints.distribute_local_to_global (local_matrix,
-                                             local_dofs,
-                                             B);
+                                              local_dofs,
+                                              B);
     }
 
-                                   // here comes the check: compare
-                                   // the l1_norm of matrices A and B,
-                                   // their difference should be zero
+  // here comes the check: compare
+  // the l1_norm of matrices A and B,
+  // their difference should be zero
   deallog << "|A| = " << A.l1_norm() << std::endl;
   deallog << "|B| = " << B.l1_norm() << std::endl;
   Assert (A.l1_norm() - B.l1_norm() == 0,
-            ExcInternalError());
+          ExcInternalError());
 }
 
 int main ()
@@ -168,25 +168,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-             << "----------------------------------------------------"
-             << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-             << exc.what() << std::endl
-             << "Aborting!" << std::endl
-             << "----------------------------------------------------"
-             << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-             << "----------------------------------------------------"
-             << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-             << "Aborting!" << std::endl
-             << "----------------------------------------------------"
-             << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 296aa65b9a0ffa4d03fc7cbce3be3a5fa53ddb38..deed4a3d973130f538de39dbcac7ac3ee40ef8b3 100644 (file)
@@ -47,7 +47,7 @@ void test ()
   FE_Q<dim> p(1);
 
   FESystem<dim> fe_system(u, 2, p, 1);
-  
+
   MappingQ<dim> mapping(2);
   hp::MappingCollection<dim> mapping_collection(mapping);
 
@@ -60,25 +60,25 @@ void test ()
   //distribute dofs
   hp_dof_handler.distribute_dofs(fe_collection);
   dof_handler.distribute_dofs(fe_system);
-  
+
   //basically, dof_handler and hp_dof_handler are the same
   //so they should contain the same number of dofs.
   Assert(hp_dof_handler.n_dofs() == dof_handler.n_dofs(),ExcInternalError());
-  
+
   //now map the dofs to the support points and show them on the screen
   std::vector<Point<dim> > map(dof_handler.n_dofs());
   std::vector<Point<dim> > hp_map(hp_dof_handler.n_dofs());
-  
+
   DoFTools::map_dofs_to_support_points(mapping, dof_handler, map);
   DoFTools::map_dofs_to_support_points(mapping_collection, hp_dof_handler, hp_map);
 
-                                   // output the elements
+  // output the elements
   for (unsigned int i=0; i<hp_map.size(); i++)
-  {
-       //both maps should contain the same
-       Assert(hp_map[i]==map[i], ExcInternalError());
-    deallog << hp_map[i] << " ";
-  }
+    {
+      //both maps should contain the same
+      Assert(hp_map[i]==map[i], ExcInternalError());
+      deallog << hp_map[i] << " ";
+    }
   deallog<<std::endl;
 
 }
index 76d21ff1f8b14a99bbc47715e18582d956e4f326..6c16415ef3d950c5f38beced9faa1434206716c1 100644 (file)
@@ -46,7 +46,7 @@ void test ()
   //define DoFhandler and FEs
   FE_Q<dim> fe1(1);
   FE_Q<dim> fe2(2);
-  
+
   MappingQ<dim> mapping(1);
   hp::MappingCollection<dim> mapping_collection(mapping);
 
@@ -60,8 +60,8 @@ void test ()
   hp_dof_handler.begin_active()->set_active_fe_index(1);
   hp_dof_handler.distribute_dofs(fe_collection);
 
-  
-  
+
+
   //now map the dofs to the support points and show them on the screen
   std::vector<Point<dim> > hp_map(hp_dof_handler.n_dofs());
 
@@ -69,9 +69,9 @@ void test ()
 
   // output the elements
   for (unsigned int i=0; i<hp_map.size(); i++)
-  {
-    deallog<< " Location of " << i<<" th DoF: "<<hp_map[i] << " | ";
-  }
+    {
+      deallog<< " Location of " << i<<" th DoF: "<<hp_map[i] << " | ";
+    }
   deallog<<std::endl;
 
 }
index 622eee805bd769a6082e42626bcbb970181a168c..af572ad107b24aa235617ca9540c1a42307631ee 100644 (file)
@@ -46,7 +46,7 @@ void check (const Triangulation<dim> &tria)
   dof_handler.distribute_dofs (fe);
 
   QGauss<dim-1> q_face(3);
-  
+
   FEFaceValues<dim>    fe_face_values (mapping, fe, q_face,
                                        update_normal_vectors);
   fe_face_values.reinit (dof_handler.begin_active(), 0);
@@ -55,25 +55,25 @@ void check (const Triangulation<dim> &tria)
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("mapping_cartesian_1/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<2> coarse_grid;
     GridGenerator::hyper_cube (coarse_grid);
     check (coarse_grid);
   }
 
-  {  
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_cube (coarse_grid);
     check (coarse_grid);
-  }  
+  }
 }
 
-  
-  
+
+
index 3b0a3dd67905859cabd519fadcb7e61a161c2439..00c472ad4ecf00b0337819663014098e421b53b5 100644 (file)
@@ -64,23 +64,23 @@ using namespace dealii;
 template <int dim>
 class Displacement : public Function<dim>
 {
-  public:
-    Displacement() :
-                   Function<dim>(dim)
-      {}
-
-    double value (const Point<dim> &p,
-                 const unsigned int component) const
-      {
-       return p[component];
-      }
-
-    void vector_value (const Point<dim> &p,
-                      Vector<double> &v) const
-      {
-       for (unsigned int i=0; i<dim; ++i)
-         v(i) = p[i];
-      }
+public:
+  Displacement() :
+    Function<dim>(dim)
+  {}
+
+  double value (const Point<dim> &p,
+                const unsigned int component) const
+  {
+    return p[component];
+  }
+
+  void vector_value (const Point<dim> &p,
+                     Vector<double> &v) const
+  {
+    for (unsigned int i=0; i<dim; ++i)
+      v(i) = p[i];
+  }
 };
 
 
@@ -99,17 +99,17 @@ void test ()
   Vector<double> displacements (dof_handler.n_dofs());
 
   VectorTools::interpolate (dof_handler,
-                           Displacement<dim>(),
-                           displacements);
+                            Displacement<dim>(),
+                            displacements);
 
   MappingQ1Eulerian<dim> euler(displacements, dof_handler);
-                                  // now the actual test
+  // now the actual test
   DataOut<dim> data_out;
   data_out.attach_dof_handler(dof_handler);
   std::vector<std::string> names (dim, "displacement");
   data_out.add_data_vector(displacements,names);
 
-                                  // output with all cells curved
+  // output with all cells curved
   data_out.build_patches(euler,1,DataOut<dim>::curved_inner_cells);
   data_out.write_gnuplot(deallog.get_file_stream());
 }
index afd9a40063f92b77b932acc544adf02813b12051..db50815465cfc51e9eadca0c186bc49dd47ba1e3 100644 (file)
@@ -35,7 +35,7 @@
 #include <fstream>
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("mapping_q4_3d/output");
   deallog.attach(logfile);
@@ -57,9 +57,9 @@ int main ()
                                   update_JxW_values);
   fe_face_values.reinit (dof_handler.begin_active(), 0);
 
-                                   // if we got here, we got past the previous
-                                   // abort
+  // if we got here, we got past the previous
+  // abort
   deallog << "OK" << std::endl;
 }
 
-  
+
index 3825df9a79d348e65ca1c581eb497f93f5b5e594..3adbf23aec9e08f8ccec62f6c783634324a7ded0 100644 (file)
@@ -62,23 +62,23 @@ using namespace dealii;
 template <int dim>
 class Displacement : public Function<dim>
 {
-  public:
-    Displacement() :
-                   Function<dim>(dim)
-      {}
-
-    double value (const Point<dim> &p,
-                 const unsigned int component) const
-      {
-       return p[component];
-      }
-
-    void vector_value (const Point<dim> &p,
-                      Vector<double> &v) const
-      {
-       for (unsigned int i=0; i<dim; ++i)
-         v(i) = p[i];
-      }
+public:
+  Displacement() :
+    Function<dim>(dim)
+  {}
+
+  double value (const Point<dim> &p,
+                const unsigned int component) const
+  {
+    return p[component];
+  }
+
+  void vector_value (const Point<dim> &p,
+                     Vector<double> &v) const
+  {
+    for (unsigned int i=0; i<dim; ++i)
+      v(i) = p[i];
+  }
 };
 
 
@@ -97,17 +97,17 @@ void test ()
   Vector<double> displacements (dof_handler.n_dofs());
 
   VectorTools::interpolate (dof_handler,
-                           Displacement<dim>(),
-                           displacements);
+                            Displacement<dim>(),
+                            displacements);
 
   MappingQEulerian<dim> euler(2, displacements, dof_handler);
-                                  // now the actual test
+  // now the actual test
   DataOut<dim> data_out;
   data_out.attach_dof_handler(dof_handler);
   std::vector<std::string> names (dim, "displacement");
   data_out.add_data_vector(displacements,names);
 
-                                  // output with all cells curved
+  // output with all cells curved
   data_out.build_patches(euler,1,DataOut<dim>::curved_inner_cells);
   data_out.write_gnuplot(deallog.get_file_stream());
 }
index a4b6cb5064f41f9a0748cc4557c396e7c9318222..1cb4e83dcddb56f9184f04414175269d2a7a43ce 100644 (file)
@@ -64,23 +64,23 @@ using namespace dealii;
 template <int dim>
 class Displacement : public Function<dim>
 {
-  public:
-    Displacement() :
-                   Function<dim>(dim)
-      {}
-
-    double value (const Point<dim> &p,
-                 const unsigned int component) const
-      {
-       return p[component]*p[0]/2;
-      }
-
-    void vector_value (const Point<dim> &p,
-                      Vector<double> &v) const
-      {
-       for (unsigned int i=0; i<dim; ++i)
-         v(i) = p[i]*p[0]/2;
-      }
+public:
+  Displacement() :
+    Function<dim>(dim)
+  {}
+
+  double value (const Point<dim> &p,
+                const unsigned int component) const
+  {
+    return p[component]*p[0]/2;
+  }
+
+  void vector_value (const Point<dim> &p,
+                     Vector<double> &v) const
+  {
+    for (unsigned int i=0; i<dim; ++i)
+      v(i) = p[i]*p[0]/2;
+  }
 };
 
 
@@ -99,17 +99,17 @@ void test ()
   Vector<double> displacements (dof_handler.n_dofs());
 
   VectorTools::interpolate (dof_handler,
-                           Displacement<dim>(),
-                           displacements);
+                            Displacement<dim>(),
+                            displacements);
 
   MappingQEulerian<dim> euler(2, displacements, dof_handler);
-                                  // now the actual test
+  // now the actual test
   DataOut<dim> data_out;
   data_out.attach_dof_handler(dof_handler);
   std::vector<std::string> names (dim, "displacement");
   data_out.add_data_vector(displacements,names);
 
-                                  // output with all cells curved
+  // output with all cells curved
   data_out.build_patches(euler,1,DataOut<dim>::curved_inner_cells);
   data_out.write_gnuplot(deallog.get_file_stream());
 }
index 9e5739ed496b974306579bbc2846b27b56f54388..8da0fcb2936ba3d4927d4bfdc3a2374317b892eb 100644 (file)
@@ -65,23 +65,23 @@ using namespace dealii;
 template <int dim>
 class Displacement : public Function<dim>
 {
-  public:
-    Displacement() :
-                   Function<dim>(dim)
-      {}
-
-    double value (const Point<dim> &p,
-                 const unsigned int component) const
-      {
-       return p[component]*p.square();
-      }
-
-    void vector_value (const Point<dim> &p,
-                      Vector<double> &v) const
-      {
-       for (unsigned int i=0; i<dim; ++i)
-         v(i) = p[i]*p.square();
-      }
+public:
+  Displacement() :
+    Function<dim>(dim)
+  {}
+
+  double value (const Point<dim> &p,
+                const unsigned int component) const
+  {
+    return p[component]*p.square();
+  }
+
+  void vector_value (const Point<dim> &p,
+                     Vector<double> &v) const
+  {
+    for (unsigned int i=0; i<dim; ++i)
+      v(i) = p[i]*p.square();
+  }
 };
 
 
@@ -100,17 +100,17 @@ void test ()
   Vector<double> displacements (dof_handler.n_dofs());
 
   VectorTools::interpolate (dof_handler,
-                           Displacement<dim>(),
-                           displacements);
+                            Displacement<dim>(),
+                            displacements);
 
   MappingQEulerian<dim> euler(2, displacements, dof_handler);
-                                  // now the actual test
+  // now the actual test
   DataOut<dim> data_out;
   data_out.attach_dof_handler(dof_handler);
   std::vector<std::string> names (dim, "displacement");
   data_out.add_data_vector(displacements,names);
 
-                                  // output with all cells curved
+  // output with all cells curved
   data_out.build_patches(euler,5,DataOut<dim>::curved_inner_cells);
   data_out.write_gnuplot(deallog.get_file_stream());
 }
index 4ad025f1a97d044db3c1cad48ff66047dc69eefb..851fb0abe6579c120cf444d62377f04638587f4a 100644 (file)
@@ -41,7 +41,8 @@
 std::ofstream logfile("mapping_q_eulerian_04/output");
 
 template <int dim, int spacedim>
-void test() {
+void test()
+{
   Triangulation<dim, spacedim> tria;
   GridGenerator::hyper_cube(tria);
   FE_Q<dim, spacedim> base_fe(1);
@@ -50,7 +51,7 @@ void test() {
   DoFHandler<dim, spacedim> shift_dh(tria);
 
   shift_dh.distribute_dofs(fe);
-  
+
   Vector<double> shift(shift_dh.n_dofs());
 
   shift.add(+1);
@@ -61,36 +62,36 @@ void test() {
 
   QTrapez<dim> quad;
   MappingQ1Eulerian<dim,Vector<double>,spacedim> mapping(shift, shift_dh);
-  
-  typename Triangulation<dim,spacedim>::active_cell_iterator cell=tria.begin_active(), 
-    endc=tria.end() ;
+
+  typename Triangulation<dim,spacedim>::active_cell_iterator cell=tria.begin_active(),
+                                                             endc=tria.end() ;
   Point<spacedim> real;
   Point<dim> unit;
   double eps = 1e-10;
-  for(;cell!=endc;++cell)
+  for (; cell!=endc; ++cell)
     {
-      deallog<<cell<< std::endl;       
-      for(unsigned int q=0; q<quad.size(); ++q)
-       {
-         real = mapping.transform_unit_to_real_cell(cell, quad.point(q));
-         unit = mapping.transform_real_to_unit_cell(cell, real);
-         deallog<<quad.point(q)<< " -> " << real << std::endl;
-         if( (unit-quad.point(q)).norm()>eps)
-           deallog<<quad.point(q)<< " != " << unit << std::endl;
-       }
-    }     
-    
+      deallog<<cell<< std::endl;
+      for (unsigned int q=0; q<quad.size(); ++q)
+        {
+          real = mapping.transform_unit_to_real_cell(cell, quad.point(q));
+          unit = mapping.transform_real_to_unit_cell(cell, real);
+          deallog<<quad.point(q)<< " -> " << real << std::endl;
+          if ( (unit-quad.point(q)).norm()>eps)
+            deallog<<quad.point(q)<< " != " << unit << std::endl;
+        }
+    }
+
 }
 
-int main () 
+int main ()
 {
   deallog.attach(logfile);
   deallog.depth_console(0);
-  
+
   test<1,1>();
   test<2,2>();
   test<3,3>();
 
   return 0;
 }
-                  
+
index c7271ba62f9e081ab3c5e886f4118db8a2baed52..ece242192fd74bc230bbc4c49b07d5039aec475d 100644 (file)
@@ -41,7 +41,8 @@
 std::ofstream logfile("mapping_q_eulerian_05/output");
 
 template <int dim, int spacedim>
-void test(unsigned int degree) {
+void test(unsigned int degree)
+{
   Triangulation<dim, spacedim> tria;
   GridGenerator::hyper_cube(tria);
   FE_Q<dim, spacedim> base_fe(degree);
@@ -50,7 +51,7 @@ void test(unsigned int degree) {
   DoFHandler<dim, spacedim> shift_dh(tria);
 
   shift_dh.distribute_dofs(fe);
-  
+
   Vector<double> shift(shift_dh.n_dofs());
 
   shift.add(+1);
@@ -61,39 +62,39 @@ void test(unsigned int degree) {
 
   QTrapez<dim> quad;
   MappingQEulerian<dim,Vector<double>,spacedim> mapping(degree,shift, shift_dh);
-  
-  typename Triangulation<dim,spacedim>::active_cell_iterator cell=tria.begin_active(), 
-    endc=tria.end() ;
+
+  typename Triangulation<dim,spacedim>::active_cell_iterator cell=tria.begin_active(),
+                                                             endc=tria.end() ;
   Point<spacedim> real;
   Point<dim> unit;
   double eps = 1e-10;
-  for(;cell!=endc;++cell)
+  for (; cell!=endc; ++cell)
     {
-      deallog<<cell<< std::endl;       
-      for(unsigned int q=0; q<quad.size(); ++q)
-       {
-         real = mapping.transform_unit_to_real_cell(cell, quad.point(q));
-         unit = mapping.transform_real_to_unit_cell(cell, real);
-         deallog<<quad.point(q)<< " -> " << real << std::endl;
-         if( (unit-quad.point(q)).norm()>eps)
-           deallog<<quad.point(q)<< " != " << unit << std::endl;
-       }
-    }     
-    
+      deallog<<cell<< std::endl;
+      for (unsigned int q=0; q<quad.size(); ++q)
+        {
+          real = mapping.transform_unit_to_real_cell(cell, quad.point(q));
+          unit = mapping.transform_real_to_unit_cell(cell, real);
+          deallog<<quad.point(q)<< " -> " << real << std::endl;
+          if ( (unit-quad.point(q)).norm()>eps)
+            deallog<<quad.point(q)<< " != " << unit << std::endl;
+        }
+    }
+
 }
 
-int main () 
+int main ()
 {
   deallog.attach(logfile);
   deallog.depth_console(0);
-  
-   test<1,1>(1);
-   test<2,2>(1);
-   test<3,3>(1);
-
-   test<1,1>(2);
-   test<2,2>(2);
-   test<3,3>(2);
+
+  test<1,1>(1);
+  test<2,2>(1);
+  test<3,3>(1);
+
+  test<1,1>(2);
+  test<2,2>(2);
+  test<3,3>(2);
   return 0;
 }
-                  
+
index 876fddef1f4f5007afcbde570395de7a1a862add..a702444391ff02c16e7d6239556543e14730a3cf 100644 (file)
@@ -46,12 +46,12 @@ void test ()
 
       Vector<float> criteria (tria.n_active_cells());
       for (unsigned int i=0; i<tria.n_active_cells(); ++i)
-       criteria(i) = i;
+        criteria(i) = i;
 
       GridRefinement::refine_and_coarsen_fixed_number (tria,
-                                                      criteria,
-                                                      1./4, 1./64,
-                                                      10000);
+                                                       criteria,
+                                                       1./4, 1./64,
+                                                       10000);
       tria.execute_coarsening_and_refinement();
     }
 }
index 614a8c5f851d95e662f5f07b13d9d6e1f9e0bf7b..635c7e446c701e6957efad2138b48401fe148952 100644 (file)
@@ -38,8 +38,8 @@ template <int dim>
 void test ()
 {
   deallog << dim << "d:"
-         << std::endl;
-  
+          << std::endl;
+
   Triangulation<dim> tria;
   GridGenerator::hyper_cube (tria);
   tria.refine_global(2);
@@ -50,12 +50,12 @@ void test ()
 
       Vector<float> criteria (tria.n_active_cells());
       for (unsigned int i=0; i<tria.n_active_cells(); ++i)
-       criteria(i) = i;
+        criteria(i) = i;
 
       GridRefinement::refine_and_coarsen_fixed_fraction (tria,
-                                                        criteria,
-                                                        0.8, 0.03,
-                                                        10000);
+                                                         criteria,
+                                                         0.8, 0.03,
+                                                         10000);
       tria.execute_coarsening_and_refinement();
     }
 }
index bd94ef3123e9f10e986dcc8a10b3b92a9f517df5..73e6a9dec076df5e40c22660b059c6b7864d5f7f 100644 (file)
@@ -1,6 +1,6 @@
 //----------------------------  mesh_3d.h  ---------------------------
 //    $Id$
-//    Version: $Name$ 
+//    Version: $Name$
 //
 //    Copyright (C) 2003, 2004, 2005 by the deal.II authors
 //
@@ -30,7 +30,8 @@ void create_two_cubes (Triangulation<3> &coarse_grid)
                                Point<3>(1,1,0),
                                Point<3>(0,1,0),
                                Point<3>(2,0,0),
-                               Point<3>(2,1,0)};
+                               Point<3>(2,1,0)
+                             };
   std::vector<Point<3> > vertices;
   for (unsigned int i=0; i<6; ++i)
     vertices.push_back (points[i]);
@@ -38,10 +39,11 @@ void create_two_cubes (Triangulation<3> &coarse_grid)
     vertices.push_back (points[i] + Point<3>(0,0,-1));
 
   std::vector<CellData<3> > cells;
-    
+
   const unsigned int connectivity[2][4]
-    = { { 0,1,2,3 },
-        { 4,5,2,1 } };
+  = { { 0,1,2,3 },
+    { 4,5,2,1 }
+  };
   for (unsigned int i=0; i<2; ++i)
     {
       CellData<3> cell;
@@ -53,8 +55,8 @@ void create_two_cubes (Triangulation<3> &coarse_grid)
       cells.push_back (cell);
     }
 
-                                   // finally generate a triangulation
-                                   // out of this
+  // finally generate a triangulation
+  // out of this
   GridReordering<3>::reorder_cells (cells);
   coarse_grid.create_triangulation_compatibility (vertices, cells, SubCellData());
 }
@@ -66,16 +68,17 @@ void create_two_cubes (Triangulation<3> &coarse_grid)
 // to store the face rotation (and face flip) in each cell
 
 void create_two_cubes_rotation (Triangulation<3> &coarse_grid,
-                               const unsigned int n_rotations)
+                                const unsigned int n_rotations)
 {
   Assert(n_rotations<4, ExcNotImplemented());
-  
+
   const Point<3> points[6] = { Point<3>(0,0,0),
                                Point<3>(1,0,0),
                                Point<3>(1,1,0),
                                Point<3>(0,1,0),
                                Point<3>(2,0,0),
-                               Point<3>(2,1,0)};
+                               Point<3>(2,1,0)
+                             };
   std::vector<Point<3> > vertices;
   for (unsigned int i=0; i<6; ++i)
     vertices.push_back (points[i]);
@@ -83,25 +86,26 @@ void create_two_cubes_rotation (Triangulation<3> &coarse_grid,
     vertices.push_back (points[i] + Point<3>(0,0,-1));
 
   std::vector<CellData<3> > cells(2);
-    
+
   const unsigned int connectivity[5][8]
-                                    // first row: left cube
-                                    // second row: right cube, standard_orientation
-                                    // third row: right cube, rotated once
-                                    // forth row: right cube, rotated twice
-                                    // fifth row: right cube, rotated three times
-    = { { 0,1,2,3,6,7,8,9 },
-        { 1,4,5,2,7,10,11,8},
-        { 2,5,11,8,1,4,10,7},
-        { 8,11,10,7,2,5,4,1},
-        { 7,10,4,1,8,11,5,2} };
+  // first row: left cube
+  // second row: right cube, standard_orientation
+  // third row: right cube, rotated once
+  // forth row: right cube, rotated twice
+  // fifth row: right cube, rotated three times
+  = { { 0,1,2,3,6,7,8,9 },
+    { 1,4,5,2,7,10,11,8},
+    { 2,5,11,8,1,4,10,7},
+    { 8,11,10,7,2,5,4,1},
+    { 7,10,4,1,8,11,5,2}
+  };
   for (unsigned int j=0; j<8; ++j)
     {
       cells[0].vertices[j]   = connectivity[0][j];
       cells[1].vertices[j]   = connectivity[1+n_rotations][j];
     }
-                                   // finally generate a triangulation
-                                   // out of this
+  // finally generate a triangulation
+  // out of this
   coarse_grid.create_triangulation_compatibility (vertices, cells, SubCellData());
 }
 
@@ -111,23 +115,24 @@ void create_L_shape (Triangulation<3> &coarse_grid)
 {
   std::vector<Point<3> >    vertices;
   std::vector<CellData<3> > cells;
-  
+
   const Point<3> outer_points[7] = { Point<3>(-1,0,0),
                                      Point<3>(-1,-1,0),
                                      Point<3>(0,-1,0),
                                      Point<3>(+1,-1,0),
                                      Point<3>(+1,0,0),
                                      Point<3>(+1,+1,0),
-                                     Point<3>(0,+1,0) };
+                                     Point<3>(0,+1,0)
+                                   };
 
-                                   // first the point in the middle
-                                   // and the rest of those on the
-                                   // upper surface
+  // first the point in the middle
+  // and the rest of those on the
+  // upper surface
   vertices.push_back (Point<3>(0,0,0));
   for (unsigned int i=0; i<7; ++i)
     vertices.push_back (outer_points[i]);
 
-                                   // then points on lower surface
+  // then points on lower surface
   vertices.push_back (Point<3>(0,0,-1));
   for (unsigned int i=0; i<7; ++i)
     vertices.push_back (outer_points[i]
@@ -137,11 +142,12 @@ void create_L_shape (Triangulation<3> &coarse_grid)
   const unsigned int n_vertices_per_surface = 8;
   Assert (vertices.size() == n_vertices_per_surface*2,
           ExcInternalError());
-    
+
   const unsigned int connectivity[3][4]
-    = { { 1, 2, 3, 0 },
-        { 3, 4, 5, 0 },
-        { 0, 5, 6, 7 } };
+  = { { 1, 2, 3, 0 },
+    { 3, 4, 5, 0 },
+    { 0, 5, 6, 7 }
+  };
   for (unsigned int i=0; i<3; ++i)
     {
       CellData<3> cell;
@@ -153,8 +159,8 @@ void create_L_shape (Triangulation<3> &coarse_grid)
       cells.push_back (cell);
     }
 
-                                   // finally generate a triangulation
-                                   // out of this
+  // finally generate a triangulation
+  // out of this
   GridReordering<3>::reorder_cells (cells);
   coarse_grid.create_triangulation_compatibility (vertices, cells, SubCellData());
 }
index 6bc19bb0a3528e9417c480a2689162c21eda36d4..436a629dfbf73e54f54be581b13f2e28a9cfe729 100644 (file)
@@ -36,7 +36,7 @@
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("mesh_3d_1/output");
   deallog.attach(logfile);
@@ -46,7 +46,7 @@ int main ()
   Triangulation<3> coarse_grid;
   create_L_shape (coarse_grid);
 
-                                   // output all lines and faces
+  // output all lines and faces
   for (Triangulation<3>::active_cell_iterator cell=coarse_grid.begin_active();
        cell != coarse_grid.end(); ++cell)
     {
@@ -67,5 +67,5 @@ int main ()
     }
 }
 
-  
-  
+
+
index 2ed76937e07bb9415e5b5308972c4dd6537710ee..ebd705aa809c8c3b4ff4216566d7b9f0aba577b6 100644 (file)
@@ -62,7 +62,7 @@ void check (Triangulation<3> &tria)
 {
   deallog << "Initial check" << std::endl;
   check_this (tria);
-  
+
   for (unsigned int r=0; r<3; ++r)
     {
       tria.refine_global (1);
@@ -73,39 +73,39 @@ void check (Triangulation<3> &tria)
   coarsen_global (tria);
   deallog << "Check " << 1 << std::endl;
   check_this (tria);
-  
+
   tria.refine_global (1);
   deallog << "Check " << 2 << std::endl;
   check_this (tria);
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("mesh_3d_10/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<3> coarse_grid;
     create_two_cubes (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     create_L_shape (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     check (coarse_grid);
   }
-  
+
 }
 
-  
-  
+
+
index 576652a5cebb2f99b7ec7cc0564c319a9dca9a6d..359a19c3f6a31cb453124feff96637220b457a30 100644 (file)
@@ -74,7 +74,7 @@ void check (Triangulation<3> &tria)
 {
   deallog << "Initial check" << std::endl;
   check_this (tria);
-  
+
   for (unsigned int r=0; r<3; ++r)
     {
       tria.refine_global (1);
@@ -85,39 +85,39 @@ void check (Triangulation<3> &tria)
   coarsen_global (tria);
   deallog << "Check " << 1 << std::endl;
   check_this (tria);
-  
+
   tria.refine_global (1);
   deallog << "Check " << 2 << std::endl;
   check_this (tria);
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("mesh_3d_11/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<3> coarse_grid;
     create_two_cubes (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     create_L_shape (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     check (coarse_grid);
   }
-  
+
 }
 
-  
-  
+
+
index e456c7d6fb97a8dd269d1400f2e398854c424a9a..f4851f0350fd5923e77d7b4f48ab6f83d5ea7cd2 100644 (file)
@@ -56,7 +56,7 @@ void check_this (Triangulation<3> &tria)
   VectorTools::interpolate (dof_handler,
                             Functions::SquareFunction<3>(),
                             u);
-  
+
   KellyErrorEstimator<3>::estimate (dof_handler,
                                     QGauss<2>(2),
                                     FunctionMap<3>::type(),
@@ -73,10 +73,10 @@ void check (Triangulation<3> &tria)
 {
   (++tria.begin_active())->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
-  
+
   deallog << "Initial check" << std::endl;
   check_this (tria);
-  
+
   for (unsigned int r=0; r<2; ++r)
     {
       tria.refine_global (1);
@@ -86,32 +86,32 @@ void check (Triangulation<3> &tria)
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("mesh_3d_12/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<3> coarse_grid;
     create_two_cubes (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     create_L_shape (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     check (coarse_grid);
   }
-  
+
 }
 
-  
-  
+
+
index 3b97010962d3cde75d18e70442c029e593aab4e6..1a04317d16b7906da74b014bcf1d1026e5898703 100644 (file)
@@ -51,12 +51,12 @@ void check_this (Triangulation<3> &tria)
              subface_no<GeometryInfo<3>::max_children_per_face;
              ++subface_no)
           {
-                                             // get an iterator
-                                             // pointing to the cell
-                                             // behind the present
-                                             // subface
+            // get an iterator
+            // pointing to the cell
+            // behind the present
+            // subface
             const Triangulation<3>::cell_iterator
-              neighbor = cell->neighbor(face_no);
+            neighbor = cell->neighbor(face_no);
             const unsigned int neighbor_neighbor
               = cell->neighbor_of_neighbor (face_no);
             const bool orientation_flag
@@ -86,10 +86,10 @@ void check (Triangulation<3> &tria)
 {
   (++tria.begin_active())->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
-  
+
   deallog << "Initial check" << std::endl;
   check_this (tria);
-  
+
   for (unsigned int r=0; r<3; ++r)
     {
       tria.refine_global (1);
@@ -100,39 +100,39 @@ void check (Triangulation<3> &tria)
   coarsen_global (tria);
   deallog << "Check " << 1 << std::endl;
   check_this (tria);
-  
+
   tria.refine_global (1);
   deallog << "Check " << 2 << std::endl;
   check_this (tria);
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("mesh_3d_13/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<3> coarse_grid;
     create_two_cubes (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     create_L_shape (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     check (coarse_grid);
   }
-  
+
 }
 
-  
-  
+
+
index 6c31c2594a02fc03fce6d056aa3f92e1c557a6d7..2370b805f9dc88efd2147f6d243e815be78ee4ec 100644 (file)
@@ -52,7 +52,7 @@ void check_this (Triangulation<3> &tria)
 
   DoFHandler<3> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
-  
+
   DoFHandler<3>::active_cell_iterator cell = dof_handler.begin_active();
   for (; cell!=dof_handler.end(); ++cell)
     for (unsigned int face_no=0; face_no<GeometryInfo<3>::faces_per_cell;
@@ -64,14 +64,14 @@ void check_this (Triangulation<3> &tria)
              subface_no<GeometryInfo<3>::max_children_per_face;
              ++subface_no)
           {
-           const unsigned int neighbor_neighbor
-             = cell->neighbor_of_neighbor (face_no);
-                                            // get an iterator
-                                            // pointing to the cell
-                                            // behind the present
-                                            // subface
-           const DoFHandler<3>::active_cell_iterator neighbor_child
-             = cell->neighbor_child_on_subface(face_no,subface_no);
+            const unsigned int neighbor_neighbor
+              = cell->neighbor_of_neighbor (face_no);
+            // get an iterator
+            // pointing to the cell
+            // behind the present
+            // subface
+            const DoFHandler<3>::active_cell_iterator neighbor_child
+              = cell->neighbor_child_on_subface(face_no,subface_no);
 
             fe_face_values1.reinit (neighbor_child, neighbor_neighbor);
             fe_face_values2.reinit (cell, face_no, subface_no);
@@ -90,7 +90,7 @@ void check_this (Triangulation<3> &tria)
                          fe_face_values2.normal_vector(q)).square()
                         < 1e-20,
                         ExcInternalError());
-              }            
+              }
           }
 }
 
@@ -100,10 +100,10 @@ void check (Triangulation<3> &tria)
 {
   (++tria.begin_active())->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
-  
+
   deallog << "Initial check" << std::endl;
   check_this (tria);
-  
+
   for (unsigned int r=0; r<3; ++r)
     {
       tria.refine_global (1);
@@ -114,39 +114,39 @@ void check (Triangulation<3> &tria)
   coarsen_global (tria);
   deallog << "Check " << 1 << std::endl;
   check_this (tria);
-  
+
   tria.refine_global (1);
   deallog << "Check " << 2 << std::endl;
   check_this (tria);
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("mesh_3d_14/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<3> coarse_grid;
     create_two_cubes (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     create_L_shape (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     check (coarse_grid);
   }
-  
+
 }
 
-  
-  
+
+
index 08705aa713eb145e628cc6e886520d9f37434066..d826c63bc5255e4bc3bde4d39d6928cec509f948 100644 (file)
 void check_this (Triangulation<3> &tria)
 {
   FE_Q<3> fe(1);
-  
+
   DoFHandler<3> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
-  
+
   DoFHandler<3>::active_cell_iterator cell = dof_handler.begin_active();
   for (; cell!=dof_handler.end(); ++cell)
     for (unsigned int face_no=0; face_no<GeometryInfo<3>::faces_per_cell;
@@ -57,32 +57,32 @@ void check_this (Triangulation<3> &tria)
              subface_no<GeometryInfo<3>::max_children_per_face;
              ++subface_no)
           {
-                                             // get an iterator
-                                             // pointing to the cell
-                                             // behind the present
-                                             // subface
-
-                                            // way a) construct it ourselves,
-                                            // considering orientation and
-                                            // rotation of the face
+            // get an iterator
+            // pointing to the cell
+            // behind the present
+            // subface
+
+            // way a) construct it ourselves,
+            // considering orientation and
+            // rotation of the face
             const DoFHandler<3>::cell_iterator
-              neighbor = cell->neighbor(face_no);
+            neighbor = cell->neighbor(face_no);
             const unsigned int neighbor_neighbor
               = cell->neighbor_of_neighbor (face_no);
             const unsigned int neighbor_child_index
               = (GeometryInfo<3>::
                  child_cell_on_face(RefinementCase<3>::isotropic_refinement,neighbor_neighbor,
                                     (subface_no),
-                                   neighbor->face_orientation(neighbor_neighbor)));
+                                    neighbor->face_orientation(neighbor_neighbor)));
             const DoFHandler<3>::active_cell_iterator neighbor_child
               = neighbor->child(neighbor_child_index);
 
-                                            // way b) use the convenient
-                                            // function
-                                            // neighbor_child_on_subface
+            // way b) use the convenient
+            // function
+            // neighbor_child_on_subface
 
-                                            // make sure, that both ways yield
-                                            // the same result
+            // make sure, that both ways yield
+            // the same result
             Assert (neighbor_child ==
                     cell->neighbor_child_on_subface (face_no,
                                                      subface_no),
@@ -96,7 +96,7 @@ void check (Triangulation<3> &tria)
 {
   (++tria.begin_active())->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
-  
+
   deallog << "Initial check" << std::endl;
   check_this (tria);
 //TODO:[WB] Is there a reason to do this three times?
@@ -111,39 +111,39 @@ void check (Triangulation<3> &tria)
   coarsen_global (tria);
   deallog << "Check " << 1 << std::endl;
   check_this (tria);
-  
+
   tria.refine_global (1);
   deallog << "Check " << 2 << std::endl;
   check_this (tria);
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("mesh_3d_15/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<3> coarse_grid;
     create_two_cubes (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     create_L_shape (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     check (coarse_grid);
   }
-  
+
 }
 
-  
-  
+
+
index b86836518bb1692db484aa10dfff45dba1294326..83e1c767a518990292f011d0d0ffbe5159f9c405 100644 (file)
@@ -47,7 +47,7 @@ void check (Triangulation<3> &tria)
   dof_handler.distribute_dofs (fe);
 
   QGauss<2> q_face(3);
-  
+
   FEFaceValues<3>    fe_face_values (fe, q_face,
                                      update_normal_vectors | update_JxW_values);
   FESubfaceValues<3> fe_subface_values (fe, q_face,
@@ -58,10 +58,10 @@ void check (Triangulation<3> &tria)
     {
       Tensor<1,3> n1, n2;
 
-                                       // first integrate over faces
-                                       // and make sure that the
-                                       // result of the integration is
-                                       // close to zero
+      // first integrate over faces
+      // and make sure that the
+      // result of the integration is
+      // close to zero
       for (unsigned int f=0; f<GeometryInfo<3>::faces_per_cell; ++f)
         {
           fe_face_values.reinit (cell, f);
@@ -74,16 +74,16 @@ void check (Triangulation<3> &tria)
               << std::sqrt (n1*n1)
               << std::endl;
 
-                                       // now same for subface
-                                       // integration
+      // now same for subface
+      // integration
       for (unsigned int f=0; f<GeometryInfo<3>::faces_per_cell; ++f)
         for (unsigned int sf=0; sf<GeometryInfo<3>::max_children_per_face; ++sf)
-        {
-          fe_subface_values.reinit (cell, f, sf);
-          for (unsigned int q=0; q<q_face.size(); ++q)
-            n2 += fe_subface_values.normal_vector(q) *
-                  fe_subface_values.JxW(q);
-        }
+          {
+            fe_subface_values.reinit (cell, f, sf);
+            for (unsigned int q=0; q<q_face.size(); ++q)
+              n2 += fe_subface_values.normal_vector(q) *
+                    fe_subface_values.JxW(q);
+          }
       Assert (n2*n2 < 1e-24, ExcInternalError());
       deallog << cell << " subface integration is ok: "
               << std::sqrt (n2*n2)
@@ -92,32 +92,32 @@ void check (Triangulation<3> &tria)
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("mesh_3d_16/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<3> coarse_grid;
     create_two_cubes (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     create_L_shape (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     check (coarse_grid);
   }
-  
+
 }
 
-  
-  
+
+
index 95807d20519f9d4fb6ae1501a42d8d1c3c878068..fbd206e2f332409e4b18848048417adc1312be50 100644 (file)
@@ -47,30 +47,30 @@ void check (Triangulation<3> &tria)
     deallog << ' ' << (++tria.begin_active())->vertex_index(i);
   deallog << std::endl;
 
-  
+
   tria.begin_active()->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
-  
+
   const unsigned int dim=3;
   Triangulation<dim>::active_cell_iterator
-    cell = tria.begin_active(),
-    endc = tria.end();
-
-                                   // loop over all interior faces of active
-                                   // cells with children. there should be
-                                   // exactly one, namely the middle face of
-                                   // the big cell (the middle faces of the
-                                   // active cells on the refined side don't
-                                   // have any children)
+  cell = tria.begin_active(),
+  endc = tria.end();
+
+  // loop over all interior faces of active
+  // cells with children. there should be
+  // exactly one, namely the middle face of
+  // the big cell (the middle faces of the
+  // active cells on the refined side don't
+  // have any children)
   for (unsigned int cell_no=0; cell!=endc; ++cell, ++cell_no)
     for (unsigned int face_no=0;
          face_no<GeometryInfo<dim>::faces_per_cell;
          ++face_no)
       {
-       const Triangulation<dim>::face_iterator
-         face=cell->face(face_no);
+        const Triangulation<dim>::face_iterator
+        face=cell->face(face_no);
 
-       if (!face->at_boundary() && face->has_children())
+        if (!face->at_boundary() && face->has_children())
           {
             deallog << "Interior face with children:" << std::endl;
             deallog << "  cell=" << cell << std::endl;
@@ -83,21 +83,21 @@ void check (Triangulation<3> &tria)
             deallog << "  face orientation="
                     << (cell->face_orientation(face_no) ? "true" : "false")
                     << std::endl;
-            
+
             const Triangulation<dim>::cell_iterator neighbor
               = cell->neighbor(face_no);
 
             const unsigned int nb_of_nb
               = cell->neighbor_of_neighbor(face_no);
 
-                                             // check that
-                                             // neighbor_of_neighbor works:
+            // check that
+            // neighbor_of_neighbor works:
             Assert (neighbor->neighbor(nb_of_nb) == cell,
                     ExcInternalError());
 
             const Triangulation<dim>::face_iterator neighbor_face
               = neighbor->face(nb_of_nb);
-            
+
             deallog << "  neighbor face vertices="
                     << neighbor_face->vertex_index(0) << ' '
                     << neighbor_face->vertex_index(1) << ' '
@@ -106,7 +106,7 @@ void check (Triangulation<3> &tria)
                     << std::endl;
             deallog << "  neighbor->face_orientation(nb_of_nb)="
                     << (neighbor->face_orientation(nb_of_nb) ?
-                         "true" : "false")
+                        "true" : "false")
                     << std::endl;
 
 
@@ -119,30 +119,30 @@ void check (Triangulation<3> &tria)
                 deallog << "      center=" << face->child(subface_no)->center()
                         << std::endl;
 
-                                                 // we used to abort in the
-                                                 // following call, due to a
-                                                 // wrong Assert condition:
+                // we used to abort in the
+                // following call, due to a
+                // wrong Assert condition:
                 cell->neighbor_child_on_subface(face_no, subface_no);
               }
-         }
+          }
       }
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("mesh_3d_17/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   Triangulation<3> coarse_grid;
   GridIn<3> in;
   in.attach_triangulation(coarse_grid);
   std::ifstream ucd_file("two_cubes.inp");
   in.read_ucd(ucd_file);
   ucd_file.close();
-  
+
   check (coarse_grid);
 }
 
index 6bfa0ed20b0d4246bdbe0d6a88069011f68db85c..bc1d0d67c55de7b55e7ad7dcdc805f8df41f8ee2 100644 (file)
@@ -55,51 +55,51 @@ void test_with_wrong_face_orientation ()
   deallog << "cell=" << cell << std::endl;
   deallog << "cell->neighbor(3)=" << cell->neighbor(3) << std::endl;
   deallog << "cell->face_orientation(3)="
-         << (cell->face_orientation(3) ? "true" : "false")
-         << std::endl;
-  
+          << (cell->face_orientation(3) ? "true" : "false")
+          << std::endl;
+
   const Triangulation<3>::active_cell_iterator neighbor_child
     = cell->neighbor_child_on_subface (3, 1);
 
   deallog << "cell->neighbor_child_on_subface(3,1)=" << neighbor_child << std::endl;
   deallog << "cell->neighbor_child_on_subface(3,1)->neighbor(5)="
-         << neighbor_child->neighbor(5) << std::endl;
+          << neighbor_child->neighbor(5) << std::endl;
 
   deallog << "cell->neighbor_child_on_subface(3,1)->face_orientation(5)="
-         << (neighbor_child->face_orientation(5) ? "true" : "false")
-         << std::endl;
-  
+          << (neighbor_child->face_orientation(5) ? "true" : "false")
+          << std::endl;
+
   deallog << "cell->face(3)=" << cell->face(3) << std::endl;
   for (unsigned int i=0; i<4; ++i)
     deallog << "cell->face(3)->child(" << i << ")="
-           << cell->face(3)->child(i) << std::endl;
-  
+            << cell->face(3)->child(i) << std::endl;
+
   for (unsigned int i=0; i<6; ++i)
     deallog << "cell->neighbor(3)->face(" << i << ")="
-           << cell->neighbor(3)->face(i) << std::endl;
+            << cell->neighbor(3)->face(i) << std::endl;
 
   for (unsigned int i=0; i<6; ++i)
     deallog << "cell->neighbor_child_on_subface(3,1)->face(" << i << ")="
-           << cell->neighbor_child_on_subface(3,1)->face(i) << std::endl;
-
-                                  // The following assertion was originally in
-                                  // make_hanging_node_constraints and
-                                  // triggered for the mesh and cell here at
-                                  // hand. however, if one carefully reads the
-                                  // new comment for
-                                  // CellAccessor::neighbor_child_on_subface,
-                                  // one realizes that it should be true in any
-                                  // case, no matter whether
-                                  // cell->face_orientation()==false or not for
-                                  // the face we are presently considering. the
-                                  // original assertion failed,
-                                  // whereas with the new functionality of
-                                  // CellAccessor::neighbor_child_on_subface it
-                                  // should work. let's make sure we get the
-                                  // status we expect.
+            << cell->neighbor_child_on_subface(3,1)->face(i) << std::endl;
+
+  // The following assertion was originally in
+  // make_hanging_node_constraints and
+  // triggered for the mesh and cell here at
+  // hand. however, if one carefully reads the
+  // new comment for
+  // CellAccessor::neighbor_child_on_subface,
+  // one realizes that it should be true in any
+  // case, no matter whether
+  // cell->face_orientation()==false or not for
+  // the face we are presently considering. the
+  // original assertion failed,
+  // whereas with the new functionality of
+  // CellAccessor::neighbor_child_on_subface it
+  // should work. let's make sure we get the
+  // status we expect.
   Assert (cell->face(3)->child(1) ==
-         neighbor_child->face(cell->neighbor_of_neighbor(3)),
-         ExcInternalError());
+          neighbor_child->face(cell->neighbor_of_neighbor(3)),
+          ExcInternalError());
 }
 
 
@@ -108,7 +108,7 @@ int main ()
 {
   std::ofstream logfile(logname);
   deallog << std::setprecision (3);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
index d06cbb60e009dd853a8f7f903054bd73898b2c26..576c608772e6ea51a8e6dfea3076f282513cea50 100644 (file)
@@ -55,7 +55,7 @@ void test_with_wrong_face_orientation ()
 
   for (unsigned int i=0; i<6; ++i)
     deallog << "cell->neighbor(3)->face(" << i << ")="
-           << cell->neighbor(3)->face(i) << std::endl;
+            << cell->neighbor(3)->face(i) << std::endl;
 }
 
 
@@ -64,7 +64,7 @@ int main ()
 {
   std::ofstream logfile(logname);
   deallog << std::setprecision (3);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
index f989cf2c4fa688e7635470c018bf27b7acbfa000..41333b151041521bfd50deeab8969c0e79148cbd 100644 (file)
@@ -36,7 +36,7 @@
 #include <fstream>
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("mesh_3d_2/output");
   deallog.attach(logfile);
@@ -46,7 +46,7 @@ int main ()
   Triangulation<3> coarse_grid;
   create_two_cubes (coarse_grid);
 
-                                   // output all lines and faces
+  // output all lines and faces
   for (Triangulation<3>::active_cell_iterator cell=coarse_grid.begin_active();
        cell != coarse_grid.end(); ++cell)
     {
@@ -69,13 +69,13 @@ int main ()
                 << std::endl;
     }
 
-                                   // we know that from the second
-                                   // cell, the common face must have
-                                   // wrong orientation. check this
+  // we know that from the second
+  // cell, the common face must have
+  // wrong orientation. check this
   Assert ((++coarse_grid.begin_active())->face_orientation(5)
           == false,
           ExcInternalError());
 }
 
-  
-  
+
+
index 755a481a45248b19b5079dc402b552cbeed7da7a..604e51f71d9415909f2d6b24baa3797ec30e2db6 100644 (file)
@@ -46,14 +46,14 @@ void check_this (Triangulation<3> &tria)
                                    update_q_points | update_JxW_values);
   FEFaceValues<3> fe_face_values2 (fe, quadrature,
                                    update_q_points | update_JxW_values);
-  
+
   DoFHandler<3> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
 
   unsigned int global_datum = 0;
 
-                                   // look at all faces, not only
-                                   // active ones
+  // look at all faces, not only
+  // active ones
   for (DoFHandler<3>::cell_iterator cell=dof_handler.begin();
        cell != dof_handler.end(); ++cell)
     for (unsigned int f=0; f<GeometryInfo<3>::faces_per_cell; ++f)
@@ -64,35 +64,35 @@ void check_this (Triangulation<3> &tria)
           fe_face_values1.reinit (cell, f);
           fe_face_values2.reinit (cell->neighbor(f), nn);
 
-         for (unsigned int q=0; q<quadrature.size(); ++q)
+          for (unsigned int q=0; q<quadrature.size(); ++q)
             {
-                                               // in order to reduce
-                                               // output file size,
-                                               // only write every
-                                               // 289th datum. if the
-                                               // values differ
-                                               // anyway, then the
-                                               // assertion below will
-                                               // catch this, and if
-                                               // we compute _all_
-                                               // values wrongly, then
-                                               // outputting some will
-                                               // be ok, I guess
+              // in order to reduce
+              // output file size,
+              // only write every
+              // 289th datum. if the
+              // values differ
+              // anyway, then the
+              // assertion below will
+              // catch this, and if
+              // we compute _all_
+              // values wrongly, then
+              // outputting some will
+              // be ok, I guess
               if (global_datum++ % 17*17 == 0)
-               deallog << "Cell " << cell << ", face " << f
-                       << std::endl
-                       << "  " << fe_face_values1.quadrature_point(q)
-                       << ", " << fe_face_values1.JxW(q)
-                       << std::endl;
-              
-               Assert ((fe_face_values1.quadrature_point(q)-
-                        fe_face_values2.quadrature_point(q)).square()
-                       < 1e-20,
-                       ExcInternalError());
-
-               Assert (std::fabs(fe_face_values1.JxW(q)-
-                                 fe_face_values2.JxW(q)) < 1e-15,
-                       ExcInternalError());
+                deallog << "Cell " << cell << ", face " << f
+                        << std::endl
+                        << "  " << fe_face_values1.quadrature_point(q)
+                        << ", " << fe_face_values1.JxW(q)
+                        << std::endl;
+
+              Assert ((fe_face_values1.quadrature_point(q)-
+                       fe_face_values2.quadrature_point(q)).square()
+                      < 1e-20,
+                      ExcInternalError());
+
+              Assert (std::fabs(fe_face_values1.JxW(q)-
+                                fe_face_values2.JxW(q)) < 1e-15,
+                      ExcInternalError());
             }
         }
 }
@@ -102,25 +102,25 @@ void check (Triangulation<3> &tria)
 {
   deallog << "Initial check" << std::endl;
   check_this (tria);
-  
-   for (unsigned int r=0; r<3; ++r)
-     {
-       tria.refine_global (1);
-       deallog << "Check " << r << std::endl;
-       check_this (tria);
-     }
-
-   coarsen_global (tria);
-   deallog << "Check " << 1 << std::endl;
-   check_this (tria);
-
-   tria.refine_global (1);
-   deallog << "Check " << 2 << std::endl;
-   check_this (tria);
+
+  for (unsigned int r=0; r<3; ++r)
+    {
+      tria.refine_global (1);
+      deallog << "Check " << r << std::endl;
+      check_this (tria);
+    }
+
+  coarsen_global (tria);
+  deallog << "Check " << 1 << std::endl;
+  check_this (tria);
+
+  tria.refine_global (1);
+  deallog << "Check " << 2 << std::endl;
+  check_this (tria);
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("mesh_3d_20/output");
   deallog.attach(logfile);
@@ -144,8 +144,8 @@ int main ()
     create_two_cubes_rotation (coarse_grid,3);
     check (coarse_grid);
   }
-  
+
 }
 
-  
-  
+
+
index 85697326e2306b05c15de37e59e39af3b7eb4466..1aef2c8e2b1899a6668294d4349922371e8204aa 100644 (file)
@@ -42,53 +42,53 @@ void check_this (Triangulation<3> &tria)
   FE_Q<3> fe(1);
   DoFHandler<3> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
-  
+
   DoFHandler<3>::active_cell_iterator cell = dof_handler.begin_active();
   for (; cell!=dof_handler.end(); ++cell)
     for (unsigned int face_no=0; face_no<GeometryInfo<3>::faces_per_cell;
          ++face_no)
       if (!cell->at_boundary(face_no))
-      {
-       if (cell->neighbor(face_no)->has_children())
-                                          // we are coarser than the neighbor
-         for (unsigned int subface_no=0;
-              subface_no<cell->face(face_no)->n_children();
-              ++subface_no)
-           {
-                                              // get an iterator
-                                              // pointing to the cell
-                                              // behind the present
-                                              // subface
-             const unsigned int neighbor_neighbor
-               = cell->neighbor_of_neighbor (face_no);
-             
-             const DoFHandler<3>::active_cell_iterator neighbor_child
-               = cell->neighbor_child_on_subface(face_no,subface_no);
-
-                                              // make sure, that we find the
-                                              // way back
-             const unsigned int our_face_no=neighbor_child->neighbor_of_coarser_neighbor(neighbor_neighbor).first;
-             const unsigned int our_subface_no=neighbor_child->neighbor_of_coarser_neighbor(neighbor_neighbor).second;
-             
-             Assert (our_face_no==face_no, ExcInternalError());
-             Assert (our_subface_no==subface_no, ExcInternalError());
-             deallog << "from coarse to fine and back: OK" <<std::endl;
-           }            
-       else if (cell->neighbor(face_no)->level()<cell->level())
-                                          // the neighbor is coarser
-         {
-           const unsigned int neighbor_face_no=cell->neighbor_of_coarser_neighbor(face_no).first;
-           const unsigned int neighbor_subface_no=cell->neighbor_of_coarser_neighbor(face_no).second;
-
-                                            // try to find the way back to our cell
-           const DoFHandler<3>::active_cell_iterator our_cell=cell->neighbor(face_no)->neighbor_child_on_subface(neighbor_face_no,
-                                                                                                                 neighbor_subface_no);
-           Assert (our_cell==cell, ExcInternalError());
-           deallog << "from fine to coarse and back: OK" <<std::endl;
-         }
-      }
-  
-         
+        {
+          if (cell->neighbor(face_no)->has_children())
+            // we are coarser than the neighbor
+            for (unsigned int subface_no=0;
+                 subface_no<cell->face(face_no)->n_children();
+                 ++subface_no)
+              {
+                // get an iterator
+                // pointing to the cell
+                // behind the present
+                // subface
+                const unsigned int neighbor_neighbor
+                  = cell->neighbor_of_neighbor (face_no);
+
+                const DoFHandler<3>::active_cell_iterator neighbor_child
+                  = cell->neighbor_child_on_subface(face_no,subface_no);
+
+                // make sure, that we find the
+                // way back
+                const unsigned int our_face_no=neighbor_child->neighbor_of_coarser_neighbor(neighbor_neighbor).first;
+                const unsigned int our_subface_no=neighbor_child->neighbor_of_coarser_neighbor(neighbor_neighbor).second;
+
+                Assert (our_face_no==face_no, ExcInternalError());
+                Assert (our_subface_no==subface_no, ExcInternalError());
+                deallog << "from coarse to fine and back: OK" <<std::endl;
+              }
+          else if (cell->neighbor(face_no)->level()<cell->level())
+            // the neighbor is coarser
+            {
+              const unsigned int neighbor_face_no=cell->neighbor_of_coarser_neighbor(face_no).first;
+              const unsigned int neighbor_subface_no=cell->neighbor_of_coarser_neighbor(face_no).second;
+
+              // try to find the way back to our cell
+              const DoFHandler<3>::active_cell_iterator our_cell=cell->neighbor(face_no)->neighbor_child_on_subface(neighbor_face_no,
+                                                                 neighbor_subface_no);
+              Assert (our_cell==cell, ExcInternalError());
+              deallog << "from fine to coarse and back: OK" <<std::endl;
+            }
+        }
+
+
 }
 
 
@@ -97,10 +97,10 @@ void check (Triangulation<3> &tria)
 {
   (++tria.begin_active())->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
-  
+
   deallog << "Initial check" << std::endl;
   check_this (tria);
-  
+
   for (unsigned int r=0; r<2; ++r)
     {
       tria.refine_global (1);
@@ -111,26 +111,26 @@ void check (Triangulation<3> &tria)
   coarsen_global (tria);
   deallog << "Check " << 1 << std::endl;
   check_this (tria);
-  
+
   tria.refine_global (1);
   deallog << "Check " << 2 << std::endl;
   check_this (tria);
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("mesh_3d_21/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<3> coarse_grid;
     create_two_cubes (coarse_grid);
     check (coarse_grid);
   }
-  
+
   {
     Triangulation<3> coarse_grid;
     create_two_cubes_rotation (coarse_grid,1);
@@ -149,19 +149,19 @@ int main ()
     check (coarse_grid);
   }
 
-  {  
+  {
     Triangulation<3> coarse_grid;
     create_L_shape (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     check (coarse_grid);
   }
-  
+
 }
 
-  
-  
+
+
index 998255695a313108594c63fd8337c231dd35df49..fc1aae860a58d445a1d128180d3573d6ef297ca5 100644 (file)
@@ -63,27 +63,27 @@ using namespace std;
 template <int dim>
 class F :  public Function<dim>
 {
-  public:
-    F (const unsigned int q) : q(q) {}
-
-    virtual double value (const Point<dim> &p,
-                         const unsigned int) const
-      {
-       double v=0;
-       for (unsigned int d=0; d<dim; ++d)
-         for (unsigned int i=0; i<=q; ++i)
-           v += (d+1)*(i+1)*std::pow (p[d], 1.*i);
-       return v;
-      }
-
-  private:
-    const unsigned int q;
+public:
+  F (const unsigned int q) : q(q) {}
+
+  virtual double value (const Point<dim> &p,
+                        const unsigned int) const
+  {
+    double v=0;
+    for (unsigned int d=0; d<dim; ++d)
+      for (unsigned int i=0; i<=q; ++i)
+        v += (d+1)*(i+1)*std::pow (p[d], 1.*i);
+    return v;
+  }
+
+private:
+  const unsigned int q;
 };
 
 
 
 template <int dim>
-void test (Triangulation<dim>triangulation)
+void test (Triangulation<dim> &triangulation)
 {
   MappingQ<3> mapping(3);
   for (unsigned int p=1; p<7-dim; ++p)
@@ -95,26 +95,26 @@ void test (Triangulation<dim>& triangulation)
       Vector<double> interpolant (dof_handler.n_dofs());
       Vector<float>  error (triangulation.n_active_cells());
       for (unsigned int q=0; q<=p+2; ++q)
-       {
-                                          // interpolate the function
-         VectorTools::interpolate (mapping, dof_handler,
-                                   F<dim> (q),
-                                   interpolant);
-
-                                          // then compute the interpolation error
-         VectorTools::integrate_difference (mapping, dof_handler,
-                                            interpolant,
-                                            F<dim> (q),
-                                            error,
-                                            QGauss<dim>(q+2),
-                                            VectorTools::L2_norm);
-         deallog << fe.get_name() << ", P_" << q
-                 << ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
-                 << std::endl;
-         if (q<=p)
-           Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
-                   ExcInternalError());
-       }
+        {
+          // interpolate the function
+          VectorTools::interpolate (mapping, dof_handler,
+                                    F<dim> (q),
+                                    interpolant);
+
+          // then compute the interpolation error
+          VectorTools::integrate_difference (mapping, dof_handler,
+                                             interpolant,
+                                             F<dim> (q),
+                                             error,
+                                             QGauss<dim>(q+2),
+                                             VectorTools::L2_norm);
+          deallog << fe.get_name() << ", P_" << q
+                  << ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
+                  << std::endl;
+          if (q<=p)
+            Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
+                    ExcInternalError());
+        }
     }
 }
 
index d3dfac80b1aed7cc020a09207d3c8cb6ebc700ed..f0733995ad9ca851d0cacd9da08474ec4f449623 100644 (file)
@@ -80,23 +80,23 @@ int main ()
 
   for (unsigned int f=0; f<6; ++f)
     deallog << "face: " << f
-           << std::endl
-           << "  Face orientation status: "
-           << cell->face_orientation (f)
-           << std::endl
-           << "  On boundary: " << cell->at_boundary(f)
-           << std::endl
-           << "  Neighbor: "
-           << (cell->at_boundary(f) ? triangulation.end() : cell->neighbor(f))
-           << std::endl;
-  
+            << std::endl
+            << "  Face orientation status: "
+            << cell->face_orientation (f)
+            << std::endl
+            << "  On boundary: " << cell->at_boundary(f)
+            << std::endl
+            << "  Neighbor: "
+            << (cell->at_boundary(f) ? triangulation.end() : cell->neighbor(f))
+            << std::endl;
+
   for (double x=0; x<=1; x+=1.0/3.0)
     {
       const Point<3> p(x, 1./3., 0);
       deallog << p
-             << " in unit coordinates maps to real coordinates "
-             << mapping.transform_unit_to_real_cell(cell,p)
-             << std::endl;
+              << " in unit coordinates maps to real coordinates "
+              << mapping.transform_unit_to_real_cell(cell,p)
+              << std::endl;
     }
 }
 
index edafe3a4660f91d6969d6a2ed7ebf98bdad2318b..929cd9d400bf34a58473264797c4338c91598492 100644 (file)
@@ -51,27 +51,27 @@ using namespace std;
 template <int dim>
 class F :  public Function<dim>
 {
-  public:
-    F (const unsigned int q) : q(q) {}
-
-    virtual double value (const Point<dim> &p,
-                         const unsigned int) const
-      {
-       double v=0;
-       for (unsigned int d=0; d<dim; ++d)
-         for (unsigned int i=0; i<=q; ++i)
-           v += (d+1)*(i+1)*std::pow (p[d], 1.*i);
-       return v;
-      }
-
-  private:
-    const unsigned int q;
+public:
+  F (const unsigned int q) : q(q) {}
+
+  virtual double value (const Point<dim> &p,
+                        const unsigned int) const
+  {
+    double v=0;
+    for (unsigned int d=0; d<dim; ++d)
+      for (unsigned int i=0; i<=q; ++i)
+        v += (d+1)*(i+1)*std::pow (p[d], 1.*i);
+    return v;
+  }
+
+private:
+  const unsigned int q;
 };
 
 
 
 template <int dim>
-void test (Triangulation<dim>triangulation)
+void test (Triangulation<dim> &triangulation)
 {
   MappingQ<3> mapping(3);
   for (unsigned int p=1; p<7-dim; ++p)
@@ -83,26 +83,26 @@ void test (Triangulation<dim>& triangulation)
       Vector<double> interpolant (dof_handler.n_dofs());
       Vector<float>  error (triangulation.n_active_cells());
       for (unsigned int q=0; q<=p+2; ++q)
-       {
-                                          // interpolate the function
-         VectorTools::interpolate (mapping, dof_handler,
-                                   F<dim> (q),
-                                   interpolant);
-
-                                          // then compute the interpolation error
-         VectorTools::integrate_difference (mapping, dof_handler,
-                                            interpolant,
-                                            F<dim> (q),
-                                            error,
-                                            QGauss<dim>(q+2),
-                                            VectorTools::L2_norm);
-         deallog << fe.get_name() << ", P_" << q
-                 << ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
-                 << std::endl;
-         if (q<=p)
-           Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
-                   ExcInternalError());
-       }
+        {
+          // interpolate the function
+          VectorTools::interpolate (mapping, dof_handler,
+                                    F<dim> (q),
+                                    interpolant);
+
+          // then compute the interpolation error
+          VectorTools::integrate_difference (mapping, dof_handler,
+                                             interpolant,
+                                             F<dim> (q),
+                                             error,
+                                             QGauss<dim>(q+2),
+                                             VectorTools::L2_norm);
+          deallog << fe.get_name() << ", P_" << q
+                  << ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
+                  << std::endl;
+          if (q<=p)
+            Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
+                    ExcInternalError());
+        }
     }
 }
 
index 39f2f0f2a5d361a1f32f30af0e8d47404b4da287..76434fe4b95f913d80f94e16695f6d6d538ada31 100644 (file)
@@ -51,30 +51,30 @@ using namespace std;
 template <int dim>
 class F :  public Function<dim>
 {
-  public:
-    F (const unsigned int q) : q(q) {}
-
-    virtual double value (const Point<dim> &p,
-                         const unsigned int) const
-      {
-       double v=0;
-       for (unsigned int d=0; d<dim; ++d)
-         for (unsigned int i=0; i<=q; ++i)
-           v += (d+1)*(i+1)*std::pow (p[d], 1.*i);
-       return v;
-      }
-
-  private:
-    const unsigned int q;
+public:
+  F (const unsigned int q) : q(q) {}
+
+  virtual double value (const Point<dim> &p,
+                        const unsigned int) const
+  {
+    double v=0;
+    for (unsigned int d=0; d<dim; ++d)
+      for (unsigned int i=0; i<=q; ++i)
+        v += (d+1)*(i+1)*std::pow (p[d], 1.*i);
+    return v;
+  }
+
+private:
+  const unsigned int q;
 };
 
 
 
 template <int dim>
-void test (Triangulation<dim>triangulation)
+void test (Triangulation<dim> &triangulation)
 {
-                                  // create a MappingQ(3) which is used on ALL
-                                  // cells
+  // create a MappingQ(3) which is used on ALL
+  // cells
   MappingQ<3> mapping(3, true);
   for (unsigned int p=1; p<7-dim; ++p)
     {
@@ -85,26 +85,26 @@ void test (Triangulation<dim>& triangulation)
       Vector<double> interpolant (dof_handler.n_dofs());
       Vector<float>  error (triangulation.n_active_cells());
       for (unsigned int q=0; q<=p+2; ++q)
-       {
-                                          // interpolate the function
-         VectorTools::interpolate (mapping, dof_handler,
-                                   F<dim> (q),
-                                   interpolant);
-
-                                          // then compute the interpolation error
-         VectorTools::integrate_difference (mapping, dof_handler,
-                                            interpolant,
-                                            F<dim> (q),
-                                            error,
-                                            QGauss<dim>(q+2),
-                                            VectorTools::L2_norm);
-         deallog << fe.get_name() << ", P_" << q
-                 << ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
-                 << std::endl;
-         if (q<=p)
-           Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
-                   ExcInternalError());
-       }
+        {
+          // interpolate the function
+          VectorTools::interpolate (mapping, dof_handler,
+                                    F<dim> (q),
+                                    interpolant);
+
+          // then compute the interpolation error
+          VectorTools::integrate_difference (mapping, dof_handler,
+                                             interpolant,
+                                             F<dim> (q),
+                                             error,
+                                             QGauss<dim>(q+2),
+                                             VectorTools::L2_norm);
+          deallog << fe.get_name() << ", P_" << q
+                  << ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
+                  << std::endl;
+          if (q<=p)
+            Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
+                    ExcInternalError());
+        }
     }
 }
 
index 8e952acb2368fc00c539c2443cbfb691304936a5..6dbe32515bc1cc39bfba0b360a23557ac506634f 100644 (file)
@@ -35,7 +35,7 @@
 #include <fstream>
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("mesh_3d_3/output");
   deallog.attach(logfile);
@@ -46,10 +46,11 @@ int main ()
   create_two_cubes (coarse_grid);
 
   const Triangulation<3>::active_cell_iterator
-    cells[2] = { coarse_grid.begin_active(),
-                 ++coarse_grid.begin_active() };
+  cells[2] = { coarse_grid.begin_active(),
+               ++coarse_grid.begin_active()
+             };
 
-                                   // output all vertices
+  // output all vertices
   for (unsigned int c=0; c<2; ++c)
     for (unsigned int v=0; v<GeometryInfo<3>::vertices_per_cell; ++v)
       deallog << "Cell " << c << ", vertex " << v
@@ -57,8 +58,8 @@ int main ()
               << "  @  " << cells[c]->vertex(v)
               << std::endl;
 
-                                   // make sure by hand that certain
-                                   // vertices match up
+  // make sure by hand that certain
+  // vertices match up
   Assert (cells[0]->vertex(1) == cells[1]->vertex(4),
           ExcInternalError());
   Assert (cells[0]->vertex(3) == cells[1]->vertex(6),
@@ -69,5 +70,5 @@ int main ()
           ExcInternalError());
 }
 
-  
-  
+
+
index d6168694449117e66fe4490a917a59e483807e1d..6bb9324aff70ccfd752607d90e4e47582b266f2a 100644 (file)
@@ -35,9 +35,9 @@
 unsigned int count_wrong_faces (const Triangulation<3> &tria)
 {
   unsigned int count = 0;
-  
-                                   // count faces with "wrong"
-                                   // orientation
+
+  // count faces with "wrong"
+  // orientation
   for (Triangulation<3>::active_cell_iterator cell=tria.begin_active();
        cell != tria.end(); ++cell)
     for (unsigned int f=0; f<GeometryInfo<3>::faces_per_cell; ++f)
@@ -46,7 +46,7 @@ unsigned int count_wrong_faces (const Triangulation<3> &tria)
   return count;
 }
 
-  
+
 
 void check (Triangulation<3> &tria)
 {
@@ -59,7 +59,7 @@ void check (Triangulation<3> &tria)
       Assert (count == initial_count * (4<<(2*r)),
               ExcInternalError());
     }
-  
+
   {
     coarsen_global (tria);
     const unsigned int count = count_wrong_faces (tria);
@@ -67,7 +67,7 @@ void check (Triangulation<3> &tria)
     Assert (count == initial_count * (4<<(2*1)),
             ExcInternalError());
   }
-  
+
   {
     tria.refine_global (1);
     const unsigned int count = count_wrong_faces (tria);
@@ -77,34 +77,34 @@ void check (Triangulation<3> &tria)
   }
 }
 
-  
 
-int main () 
+
+int main ()
 {
   std::ofstream logfile("mesh_3d_4/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<3> coarse_grid;
     create_two_cubes (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     create_L_shape (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     check (coarse_grid);
   }
-  
+
 }
 
-  
-  
+
+
index 40a2eeb5e4471e50768fa00b645d63ba14d0b279..b214b77432f6585f753714ca86912a8deb74cd59 100644 (file)
@@ -34,8 +34,8 @@
 
 void check_this (Triangulation<3> &tria)
 {
-                                   // look at all faces, not only
-                                   // active ones
+  // look at all faces, not only
+  // active ones
   for (Triangulation<3>::cell_iterator cell=tria.begin();
        cell != tria.end(); ++cell)
     for (unsigned int f=0; f<GeometryInfo<3>::faces_per_cell; ++f)
@@ -58,7 +58,7 @@ void check (Triangulation<3> &tria)
 {
   deallog << "Initial check" << std::endl;
   check_this (tria);
-  
+
   for (unsigned int r=0; r<3; ++r)
     {
       tria.refine_global (1);
@@ -69,39 +69,39 @@ void check (Triangulation<3> &tria)
   coarsen_global (tria);
   deallog << "Check " << 1 << std::endl;
   check_this (tria);
-  
+
   tria.refine_global (1);
   deallog << "Check " << 2 << std::endl;
   check_this (tria);
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("mesh_3d_5/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<3> coarse_grid;
     create_two_cubes (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     create_L_shape (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     check (coarse_grid);
   }
-  
+
 }
 
-  
-  
+
+
index 7563e67b4440cd6357989decedd307bde1d8d3d9..25f93dc96c58ef1ec505b257c80c81c8583d507b 100644 (file)
@@ -48,9 +48,9 @@ void check_this (Triangulation<3> &tria)
   dof_handler.distribute_dofs (fe);
 
   unsigned int global_face = 0;
-  
-                                   // look at all faces, not only
-                                   // active ones
+
+  // look at all faces, not only
+  // active ones
   for (DoFHandler<3>::cell_iterator cell=dof_handler.begin();
        cell != dof_handler.end(); ++cell)
     for (unsigned int f=0; f<GeometryInfo<3>::faces_per_cell; ++f)
@@ -61,30 +61,30 @@ void check_this (Triangulation<3> &tria)
           fe_face_values1.reinit (cell, f);
           fe_face_values2.reinit (cell->neighbor(f), nn);
 
-                                           // in order to reduce
-                                           // output file size, only
-                                           // write every seventeenth
-                                           // normal vector. if the
-                                           // normals differ anyway,
-                                           // then the assertion below
-                                           // will catch this, and if
-                                           // we compute _all_ normals
-                                           // wrongly, then outputting
-                                           // some will be ok, I guess
+          // in order to reduce
+          // output file size, only
+          // write every seventeenth
+          // normal vector. if the
+          // normals differ anyway,
+          // then the assertion below
+          // will catch this, and if
+          // we compute _all_ normals
+          // wrongly, then outputting
+          // some will be ok, I guess
           if (global_face++ % 17 == 0)
             deallog << "Cell " << cell << ", face " << f
                     << " n=" << fe_face_values1.normal_vector(0)
                     << std::endl;
 
-                                           // normal vectors should be
-                                           // in opposite directions,
-                                           // so their sum should be
-                                           // close to zero
+          // normal vectors should be
+          // in opposite directions,
+          // so their sum should be
+          // close to zero
           Assert ((fe_face_values1.normal_vector(0) +
-                  fe_face_values2.normal_vector(0)).square()
+                   fe_face_values2.normal_vector(0)).square()
                   < 1e-20,
                   ExcInternalError());
-        }          
+        }
 }
 
 
@@ -92,7 +92,7 @@ void check (Triangulation<3> &tria)
 {
   deallog << "Initial check" << std::endl;
   check_this (tria);
-  
+
   for (unsigned int r=0; r<3; ++r)
     {
       tria.refine_global (1);
@@ -103,39 +103,39 @@ void check (Triangulation<3> &tria)
   coarsen_global (tria);
   deallog << "Check " << 1 << std::endl;
   check_this (tria);
-  
+
   tria.refine_global (1);
   deallog << "Check " << 2 << std::endl;
   check_this (tria);
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("mesh_3d_6/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<3> coarse_grid;
     create_two_cubes (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     create_L_shape (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     check (coarse_grid);
   }
-  
+
 }
 
-  
-  
+
+
index 77c6ed8b22f8d30feb8eec2bd8e2b5de502291e1..327d5d18d353059a1ec643c61df308acc93d64d6 100644 (file)
@@ -44,14 +44,14 @@ void check_this (Triangulation<3> &tria)
                                    update_q_points | update_JxW_values);
   FEFaceValues<3> fe_face_values2 (fe, quadrature,
                                    update_q_points | update_JxW_values);
-  
+
   DoFHandler<3> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
 
   unsigned int global_datum = 0;
-  
-                                   // look at all faces, not only
-                                   // active ones
+
+  // look at all faces, not only
+  // active ones
   for (DoFHandler<3>::cell_iterator cell=dof_handler.begin();
        cell != dof_handler.end(); ++cell)
     for (unsigned int f=0; f<GeometryInfo<3>::faces_per_cell; ++f)
@@ -67,23 +67,23 @@ void check_this (Triangulation<3> &tria)
 
           for (unsigned int q=0; q<quadrature.size(); ++q)
             {
-                                               // in order to reduce
-                                               // output file size,
-                                               // only write every
-                                               // 289th datum. if the
-                                               // values differ
-                                               // anyway, then the
-                                               // assertion below will
-                                               // catch this, and if
-                                               // we compute _all_
-                                               // values wrongly, then
-                                               // outputting some will
-                                               // be ok, I guess
+              // in order to reduce
+              // output file size,
+              // only write every
+              // 289th datum. if the
+              // values differ
+              // anyway, then the
+              // assertion below will
+              // catch this, and if
+              // we compute _all_
+              // values wrongly, then
+              // outputting some will
+              // be ok, I guess
               if (global_datum++ % 17*17 == 0)
                 deallog << "  " << fe_face_values1.quadrature_point(q)
                         << ", " << fe_face_values1.JxW(q)
                         << std::endl;
-              
+
               Assert ((fe_face_values1.quadrature_point(q)-
                        fe_face_values2.quadrature_point(q)).square()
                       < 1e-20,
@@ -101,7 +101,7 @@ void check (Triangulation<3> &tria)
 {
   deallog << "Initial check" << std::endl;
   check_this (tria);
-  
+
   for (unsigned int r=0; r<3; ++r)
     {
       tria.refine_global (1);
@@ -112,39 +112,39 @@ void check (Triangulation<3> &tria)
   coarsen_global (tria);
   deallog << "Check " << 1 << std::endl;
   check_this (tria);
-  
+
   tria.refine_global (1);
   deallog << "Check " << 2 << std::endl;
   check_this (tria);
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("mesh_3d_7/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<3> coarse_grid;
     create_two_cubes (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     create_L_shape (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     check (coarse_grid);
   }
-  
+
 }
 
-  
-  
+
+
index d3f41e96c5c99d83f3dd1154a5e2496906d435db..1c3827cba78996a05888f8ff5e3eba0e0b5441b0 100644 (file)
@@ -59,7 +59,7 @@ void check (Triangulation<3> &tria)
 {
   deallog << "Initial check" << std::endl;
   check_this (tria);
-  
+
   for (unsigned int r=0; r<3; ++r)
     {
       tria.refine_global (1);
@@ -70,39 +70,39 @@ void check (Triangulation<3> &tria)
   coarsen_global (tria);
   deallog << "Check " << 1 << std::endl;
   check_this (tria);
-  
+
   tria.refine_global (1);
   deallog << "Check " << 2 << std::endl;
   check_this (tria);
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("mesh_3d_8/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<3> coarse_grid;
     create_two_cubes (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     create_L_shape (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     check (coarse_grid);
   }
-  
+
 }
 
-  
-  
+
+
index 91bf4ba65904146930ba3afe9af8ef8f538f44c2..051f66158c21c5930cc979fe331470e05023466f 100644 (file)
@@ -60,7 +60,7 @@ void check (Triangulation<3> &tria)
 {
   deallog << "Initial check" << std::endl;
   check_this (tria);
-  
+
   for (unsigned int r=0; r<3; ++r)
     {
       tria.refine_global (1);
@@ -71,39 +71,39 @@ void check (Triangulation<3> &tria)
   coarsen_global (tria);
   deallog << "Check " << 1 << std::endl;
   check_this (tria);
-  
+
   tria.refine_global (1);
   deallog << "Check " << 2 << std::endl;
   check_this (tria);
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("mesh_3d_9/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<3> coarse_grid;
     create_two_cubes (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     create_L_shape (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     check (coarse_grid);
   }
-  
+
 }
 
-  
-  
+
+
index 8e0ed407b32ea83a14d3a819a0cc230c94470d2c..6e444a9e7fb2b6b6038dda8c53d792ca4bac5141 100644 (file)
 #include <fstream>
 
 
-                                // Take the example from the
-                                // documentation but instead of
-                                // running anything simply print
-                                // parameters
+// Take the example from the
+// documentation but instead of
+// running anything simply print
+// parameters
 class HelperClass : public MultipleParameterLoop::UserClass
 {
-  public:
-    virtual void create_new (unsigned int run_no)
-      { this->run_no = run_no; }
-    virtual void declare_parameters (ParameterHandler &prm);
-    virtual void run (ParameterHandler &prm);
-    unsigned int run_no;
+public:
+  virtual void create_new (unsigned int run_no)
+  {
+    this->run_no = run_no;
+  }
+  virtual void declare_parameters (ParameterHandler &prm);
+  virtual void run (ParameterHandler &prm);
+  unsigned int run_no;
 };
 
 
@@ -43,16 +45,16 @@ void HelperClass::declare_parameters (ParameterHandler &prm)
 {
   prm.enter_subsection ("Testing");
   prm.declare_entry ("string list",
-                    "a",
-                    Patterns::List(Patterns::Selection("a|b|c|d|e|f|g|h")),
-                    "docs 1");
+                     "a",
+                     Patterns::List(Patterns::Selection("a|b|c|d|e|f|g|h")),
+                     "docs 1");
   prm.declare_entry ("int",
-                    "1",
-                    Patterns::Integer());
+                     "1",
+                     Patterns::Integer());
   prm.declare_entry ("double",
-                    "3.1415926",
-                    Patterns::Double(),
-                    "docs 3");
+                     "3.1415926",
+                     Patterns::Double(),
+                     "docs 3");
   prm.leave_subsection ();
 }
 
index aa4ab0852b8b6196d8c30be59459e79ac4ea82a0..d10891c91b61a9f10029c2819dc2d8da8fbd148c 100644 (file)
 #include <fstream>
 
 
-                                // Take the example from the
-                                // documentation but instead of
-                                // running anything simply print
-                                // parameters
+// Take the example from the
+// documentation but instead of
+// running anything simply print
+// parameters
 class HelperClass : public MultipleParameterLoop::UserClass
 {
-  public:
-    virtual void create_new (unsigned int run_no)
-      { this->run_no = run_no; }
-    virtual void declare_parameters (ParameterHandler &prm);
-    virtual void run (ParameterHandler &prm);
-    unsigned int run_no;
+public:
+  virtual void create_new (unsigned int run_no)
+  {
+    this->run_no = run_no;
+  }
+  virtual void declare_parameters (ParameterHandler &prm);
+  virtual void run (ParameterHandler &prm);
+  unsigned int run_no;
 };
 
 
@@ -43,16 +45,16 @@ void HelperClass::declare_parameters (ParameterHandler &prm)
 {
   prm.enter_subsection ("Testing");
   prm.declare_entry ("string list",
-                    "a",
-                    Patterns::List(Patterns::Selection("a|b|c|d|e|f|g|h")),
-                    "docs 1");
+                     "a",
+                     Patterns::List(Patterns::Selection("a|b|c|d|e|f|g|h")),
+                     "docs 1");
   prm.declare_entry ("int",
-                    "1",
-                    Patterns::Integer());
+                     "1",
+                     Patterns::Integer());
   prm.declare_entry ("double",
-                    "3.1415926",
-                    Patterns::Double(),
-                    "docs 3");
+                     "3.1415926",
+                     Patterns::Double(),
+                     "docs 3");
   prm.leave_subsection ();
 }
 
index 9cace590b13f0386cee7e721e14c38c9f935e3fa..46f170cc2c680d417db5dd32fe215a6afae4b838 100644 (file)
@@ -33,11 +33,11 @@ check_this (const DoFHandler<dim> &dof_handler)
 {
   const FiniteElement<dim> &fe = dof_handler.get_fe();
   deallog << fe.dofs_per_vertex << ' '
-         << fe.dofs_per_line << ' '
-         << fe.dofs_per_quad << ' '
-         << fe.dofs_per_hex << std::endl;
+          << fe.dofs_per_line << ' '
+          << fe.dofs_per_quad << ' '
+          << fe.dofs_per_hex << std::endl;
   deallog << fe.template n_dofs_per_object<0>() << ' '
-         << fe.template n_dofs_per_object<1>() << ' '
-         << fe.template n_dofs_per_object<2>() << ' '
-         << fe.template n_dofs_per_object<3>() << std::endl;  
+          << fe.template n_dofs_per_object<1>() << ' '
+          << fe.template n_dofs_per_object<2>() << ' '
+          << fe.template n_dofs_per_object<3>() << std::endl;
 }
index 687ffff07401afd815faa28c2f04530e957aa14d..3ba18235e1bec29fac03e971763d43cf6c3a7fb6 100644 (file)
@@ -30,7 +30,7 @@
 #include <deal.II/grid/tria_iterator.h>
 #include <deal.II/dofs/dof_accessor.h>
 #include <deal.II/dofs/dof_tools.h>
-#include <deal.II/fe/fe_nedelec.h>     
+#include <deal.II/fe/fe_nedelec.h>
 #include <deal.II/fe/fe_values.h>
 #include <iomanip>
 #include <fstream>
@@ -54,7 +54,7 @@ void test ()
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("nedelec_1/output");
   deallog.attach(logfile);
@@ -63,6 +63,6 @@ int main ()
 
   test<2> ();
   test<3> ();
-  
+
   return 0;
 }
index da0eeba54d7ae35d4ec9877ca66134cb23da1d21..ed8832f532f98bbf41e924392d0909f3f320729a 100644 (file)
 void create_grid (Triangulation<2> &tria)
 {
   const unsigned int n_points=5;
-  
+
   const Point<2> points[n_points] = { Point<2>(0.0,0.0),
-                               Point<2>(1.0,1.0),
-                               Point<2>(2.0,2.0),
-                               Point<2>(0.0,2.0),
-                               Point<2>(2.0,0.0)};
+                                      Point<2>(1.0,1.0),
+                                      Point<2>(2.0,2.0),
+                                      Point<2>(0.0,2.0),
+                                      Point<2>(2.0,0.0)
+                                    };
   std::vector<Point<2> > vertices(n_points);
   vertices.assign(points,points+n_points);
 
@@ -68,8 +69,8 @@ void create_grid (Triangulation<2> &tria)
   cells[1].vertices[2]   = 2;
   cells[1].vertices[3]   = 1;
 
-                                   // generate a triangulation
-                                   // out of this
+  // generate a triangulation
+  // out of this
   GridReordering<2>::reorder_cells (cells);
   try
     {
@@ -77,7 +78,7 @@ void create_grid (Triangulation<2> &tria)
     }
   catch (Triangulation<2>::DistortedCellList &dcv)
     {
-                                      // ignore the exception
+      // ignore the exception
     }
 }
 
@@ -88,11 +89,11 @@ void check_neighbors (const Triangulation<2> &tria)
   for (unsigned int f=0; f<GeometryInfo<2>::faces_per_cell; ++f)
     if (cell->neighbor(f).state()==IteratorState::valid)
       {
-       const unsigned int neighbor_neighbor=cell->neighbor_of_neighbor(f);
-       deallog << "At face " << f << ": neighbor_of_neighbor="
-               << neighbor_neighbor << std::endl;
-       Assert(cell->face(f)==cell->neighbor(f)->face(neighbor_neighbor),
-              ExcMessage("Error in neighbor_of_neighbor() function!"));
+        const unsigned int neighbor_neighbor=cell->neighbor_of_neighbor(f);
+        deallog << "At face " << f << ": neighbor_of_neighbor="
+                << neighbor_neighbor << std::endl;
+        Assert(cell->face(f)==cell->neighbor(f)->face(neighbor_neighbor),
+               ExcMessage("Error in neighbor_of_neighbor() function!"));
       }
 }
 
@@ -104,7 +105,7 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   Triangulation<2> tria;
   create_grid(tria);
   check_neighbors(tria);
index 13cfbec85c1f662fcc03f80523fa814ec9f233a7..f7fbeebb14cf8e76cacab0c52e10ca0218fa2a60 100644 (file)
@@ -44,22 +44,22 @@ void check (const Triangulation<dim> &tria)
   dof_handler.distribute_dofs (fe);
 
   QGauss<dim-1> q_face(3);
-  
+
   FEFaceValues<dim>    fe_face_values (fe, q_face,
                                        update_normal_vectors | update_JxW_values);
   FESubfaceValues<dim> fe_subface_values (fe, q_face,
                                           update_normal_vectors | update_JxW_values);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-         cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell!=dof_handler.end(); ++cell)
     {
       Tensor<1,dim> n1, n2;
 
-                                       // first integrate over faces
-                                       // and make sure that the
-                                       // result of the integration is
-                                       // close to zero
+      // first integrate over faces
+      // and make sure that the
+      // result of the integration is
+      // close to zero
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
         {
           fe_face_values.reinit (cell, f);
@@ -72,8 +72,8 @@ void check (const Triangulation<dim> &tria)
               << std::sqrt (n1*n1)
               << std::endl;
 
-                                       // now same for subface
-                                       // integration
+      // now same for subface
+      // integration
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
         for (unsigned int sf=0; sf<GeometryInfo<dim>::max_children_per_face; ++sf)
           {
@@ -90,39 +90,39 @@ void check (const Triangulation<dim> &tria)
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("normals_1/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<2> coarse_grid;
     GridGenerator::hyper_cube (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_cube (coarse_grid);
     check (coarse_grid);
   }
 
-  
-  {  
+
+  {
     Triangulation<2> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     check (coarse_grid);
   }
-  
+
 }
 
-  
-  
+
+
index 6fe413858821bf144a23474c860da57532d043cb..573ca6dee5742219d22557dc407d6300e4f1c3ff 100644 (file)
@@ -54,22 +54,22 @@ void check (const Triangulation<dim> &tria,
   deallog.threshold_double(1.e-10);
 
   QGauss<dim-1> q_face(3);
-  
+
   FEFaceValues<dim>    fe_face_values (mapping, fe, q_face,
                                        update_normal_vectors | update_JxW_values);
   FESubfaceValues<dim> fe_subface_values (mapping, fe, q_face,
                                           update_normal_vectors | update_JxW_values);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-         cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell!=dof_handler.end(); ++cell)
     {
       Tensor<1,dim> n1, n2;
 
-                                       // first integrate over faces
-                                       // and make sure that the
-                                       // result of the integration is
-                                       // close to zero
+      // first integrate over faces
+      // and make sure that the
+      // result of the integration is
+      // close to zero
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
         {
           fe_face_values.reinit (cell, f);
@@ -82,8 +82,8 @@ void check (const Triangulation<dim> &tria,
               << std::sqrt (n1*n1)
               << std::endl;
 
-                                       // now same for subface
-                                       // integration
+      // now same for subface
+      // integration
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
         for (unsigned int sf=0; sf<GeometryInfo<dim>::max_children_per_face; ++sf)
           {
@@ -100,14 +100,14 @@ void check (const Triangulation<dim> &tria,
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("normals_2/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<2> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     static const HyperBallBoundary<2> boundary;
@@ -116,8 +116,8 @@ int main ()
     check (coarse_grid, 2);
     check (coarse_grid, 4);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     static const HyperBallBoundary<3> boundary;
@@ -126,8 +126,8 @@ int main ()
     check (coarse_grid, 2);
     check (coarse_grid, 3);
   }
-  
+
 }
 
-  
-  
+
+
index 0eafcac2ea790aecc089efce177d339cce0f8062..8e274e86457a14334d0b44a94849875162e0f334 100644 (file)
@@ -49,22 +49,22 @@ void check (const Triangulation<dim> &tria)
   dof_handler.distribute_dofs (fe);
 
   QGauss<dim-1> q_face(3);
-  
+
   FEFaceValues<dim>    fe_face_values (mapping, fe, q_face,
                                        update_normal_vectors | update_JxW_values);
   FESubfaceValues<dim> fe_subface_values (mapping, fe, q_face,
                                           update_normal_vectors | update_JxW_values);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-         cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell!=dof_handler.end(); ++cell)
     {
       Tensor<1,dim> n1, n2;
 
-                                       // first integrate over faces
-                                       // and make sure that the
-                                       // result of the integration is
-                                       // close to zero
+      // first integrate over faces
+      // and make sure that the
+      // result of the integration is
+      // close to zero
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
         {
           fe_face_values.reinit (cell, f);
@@ -77,8 +77,8 @@ void check (const Triangulation<dim> &tria)
               << std::sqrt (n1*n1)
               << std::endl;
 
-                                       // now same for subface
-                                       // integration
+      // now same for subface
+      // integration
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
         for (unsigned int sf=0; sf<GeometryInfo<dim>::max_children_per_face; ++sf)
           {
@@ -95,14 +95,14 @@ void check (const Triangulation<dim> &tria)
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("normals_3/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<2> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     static const HyperBallBoundary<2> boundary;
@@ -110,16 +110,16 @@ int main ()
     check (coarse_grid);
   }
 
-                                   // the C1 mapping is not fully
-                                   // implemented in 3d, unfortunately
-//   {  
+  // the C1 mapping is not fully
+  // implemented in 3d, unfortunately
+//   {
 //     Triangulation<3> coarse_grid;
 //     GridGenerator::hyper_ball (coarse_grid);
 //     static const HyperBallBoundary<3> boundary;
 //     coarse_grid.set_boundary (0, boundary);
 //     check (coarse_grid);
-//   }  
+//   }
 }
 
-  
-  
+
+
index d892d62056e4a8bf28da1dd4ac66249fdec45c48..db145a7895521790fc6c526b638c0fe7e963560b 100644 (file)
@@ -49,22 +49,22 @@ void check (const Triangulation<dim> &tria)
   dof_handler.distribute_dofs (fe);
 
   QGauss<dim-1> q_face(3);
-  
+
   FEFaceValues<dim>    fe_face_values (mapping, fe, q_face,
                                        update_normal_vectors | update_JxW_values);
   FESubfaceValues<dim> fe_subface_values (mapping, fe, q_face,
                                           update_normal_vectors | update_JxW_values);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-         cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell!=dof_handler.end(); ++cell)
     {
       Tensor<1,dim> n1, n2;
 
-                                       // first integrate over faces
-                                       // and make sure that the
-                                       // result of the integration is
-                                       // close to zero
+      // first integrate over faces
+      // and make sure that the
+      // result of the integration is
+      // close to zero
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
         {
           fe_face_values.reinit (cell, f);
@@ -77,8 +77,8 @@ void check (const Triangulation<dim> &tria)
               << std::sqrt (n1*n1)
               << std::endl;
 
-                                       // now same for subface
-                                       // integration
+      // now same for subface
+      // integration
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
         for (unsigned int sf=0; sf<GeometryInfo<dim>::max_children_per_face; ++sf)
           {
@@ -95,25 +95,25 @@ void check (const Triangulation<dim> &tria)
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("normals_4/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<2> coarse_grid;
     GridGenerator::hyper_cube (coarse_grid);
     check (coarse_grid);
   }
 
-  {  
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_cube (coarse_grid);
     check (coarse_grid);
-  }  
+  }
 }
 
-  
-  
+
+
index 9f7f78ca0d604a4217bd0d49d23c49e05993d7af..20c3c1b680278b4eb19996ab93a0e41e88b64823 100644 (file)
 #include <fstream>
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("oliver_01/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-                                   // this test only needs to compile, not run
+  // this test only needs to compile, not run
   if (false)
     {
       SparseMatrix<double>::iterator *i;
@@ -43,6 +43,6 @@ int main ()
     }
 
   deallog << "OK" << std::endl;
-  
+
   return 0;
 }
index d5d1709565a7ce6af9cce8053c839c2e4d56f841..85ca4bd718ee9e76160c568d9eb72bdec335c262 100644 (file)
@@ -36,7 +36,7 @@ void check (const char *p)
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("parameter_handler_1/output");
   deallog.attach(logfile);
@@ -44,6 +44,6 @@ int main ()
   deallog.threshold_double(1.e-10);
 
   check ("parameter_handler_1/prm");
-  
+
   return 0;
 }
index cb3c1a247e4226c9669b3b37f8b7311d6a7e70eb..0ed8009aec062da2e32bce6f71bcff43c8fe76d0 100644 (file)
@@ -37,7 +37,7 @@ void check (const char *p)
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("parameter_handler_10/output");
   deallog.attach(logfile);
@@ -45,6 +45,6 @@ int main ()
   deallog.threshold_double(1.e-10);
 
   check ("parameter_handler_10/prm");
-  
+
   return 0;
 }
index 7712ea29e1f670bfc6dfc26cd521291be47f6da6..5096921c0eb3cbdb20c4f890cb76aa9b93841b3c 100644 (file)
@@ -36,7 +36,7 @@ void check (const char *p)
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("parameter_handler_11/output");
   deallog.attach(logfile);
@@ -44,6 +44,6 @@ int main ()
   deallog.threshold_double(1.e-10);
 
   check ("parameter_handler_11/prm");
-  
+
   return 0;
 }
index 9605b6891a2bdadc849a78c143aa9e04ca24658f..a33b7f1df1e4419a311159dbf4970c00a2560dca 100644 (file)
@@ -28,8 +28,8 @@ void check (const char *p)
   ParameterHandler prm;
   prm.declare_entry ("test_13", "-1:a, 0:b, 1:c",
                      Patterns::Map(Patterns::Integer(-1,1),
-                                  Patterns::Selection("a|b|c"),
-                                  2,3));
+                                   Patterns::Selection("a|b|c"),
+                                   2,3));
 
   std::ifstream in(p);
   prm.read_input (in);
index 3c6f2110d3b197755170ef04d8fe5f41935227cc..37c7cb31576f8061aa3b852b512e877d95e7bb63 100644 (file)
@@ -39,7 +39,7 @@ void check ()
   catch (...)
     {
       deallog << "Exception caught, but none should happen here!!!"
-             << std::endl;
+              << std::endl;
     }
 
   foo.enter_subsection("bar");
index de53de4f8bc29a1309eebe9b3af400b3f550047d..387bd6dc5934533e15996aa581b2305bcee51bf5 100644 (file)
@@ -25,7 +25,7 @@
 #include <fstream>
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("parameter_handler_2/output");
   deallog.attach(logfile);
@@ -47,6 +47,6 @@ int main ()
   prm.leave_subsection ();
 
   deallog << list << std::endl;
-  
+
   return 0;
 }
index 3caab5e60323065b133950ee4b507721294d589b..139461825ef3463c502bcca524035aaa8c621ff7 100644 (file)
 #include <iomanip>
 
 
-int main () 
+int main ()
 {
-  try 
+  try
     {
       std::ofstream logfile("parameter_handler_3/output");
       deallog.attach(logfile);
       deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);
-      
+      deallog.threshold_double(1.e-10);
+
       ParameterHandler prm;
       prm.enter_subsection ("Testing");
       prm.declare_entry ("string list",
@@ -48,35 +48,35 @@ int main ()
                          Patterns::Double(),
                          "docs 3");
       prm.leave_subsection ();
-      
-                                       // read and then write parameters
+
+      // read and then write parameters
       prm.read_input("parameter_handler_3/prm");
       prm.print_parameters (logfile, ParameterHandler::Text);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
-  
+
   return 0;
 }
index 985a5e6e26c89b4a35749ae8220c34aaf30d138a..965039bd20867e0a8d416698c06a81704f6fb44b 100644 (file)
 #include <iomanip>
 
 
-int main () 
+int main ()
 {
   try
     {
       std::ofstream logfile("parameter_handler_4/output");
       deallog.attach(logfile);
       deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);
+      deallog.threshold_double(1.e-10);
 
       ParameterHandler prm;
       prm.enter_subsection ("Testing");
@@ -49,37 +49,37 @@ int main ()
                          "docs 3");
       prm.leave_subsection ();
 
-                                       // read and then write
-                                       // parameters. take same input file
-                                       // as for parameter_handler_3, but
-                                       // use different output format
+      // read and then write
+      // parameters. take same input file
+      // as for parameter_handler_3, but
+      // use different output format
       prm.read_input("parameter_handler_3/prm");
       prm.print_parameters (logfile, ParameterHandler::LaTeX);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
-  
+
   return 0;
 }
index 0d9002f53e660288a12213a8835bab1dce79df71..5f16e569c4d38a166d3a21a3c47dc89aba7bc10a 100644 (file)
@@ -39,65 +39,65 @@ int main ()
       ParameterHandler prm;
       prm.enter_subsection ("Testing");
       {
-       prm.enter_subsection ("Testing 2");
-       {
-         prm.declare_entry ("string list 2",
-                            "a",
-                            Patterns::List(Patterns::Selection("a|b|c|d|e|f|g|h")),
-                            "docs 1");
-         prm.declare_entry ("int 2",
-                            "1",
-                            Patterns::Integer());
-         prm.declare_entry ("double 2",
-                            "3.1415926",
-                            Patterns::Double(),
-                            "docs 3");
-       }
-       prm.leave_subsection ();
+        prm.enter_subsection ("Testing 2");
+        {
+          prm.declare_entry ("string list 2",
+                             "a",
+                             Patterns::List(Patterns::Selection("a|b|c|d|e|f|g|h")),
+                             "docs 1");
+          prm.declare_entry ("int 2",
+                             "1",
+                             Patterns::Integer());
+          prm.declare_entry ("double 2",
+                             "3.1415926",
+                             Patterns::Double(),
+                             "docs 3");
+        }
+        prm.leave_subsection ();
 
-       prm.declare_entry ("string list",
-                          "a",
-                          Patterns::List(Patterns::Selection("a|b|c|d|e|f|g|h")),
-                          "docs 1");
-       prm.declare_entry ("int",
-                          "1",
-                          Patterns::Integer());
-       prm.declare_entry ("double",
-                          "3.1415926",
-                          Patterns::Double(),
-                          "docs 3");
+        prm.declare_entry ("string list",
+                           "a",
+                           Patterns::List(Patterns::Selection("a|b|c|d|e|f|g|h")),
+                           "docs 1");
+        prm.declare_entry ("int",
+                           "1",
+                           Patterns::Integer());
+        prm.declare_entry ("double",
+                           "3.1415926",
+                           Patterns::Double(),
+                           "docs 3");
       }
       prm.leave_subsection ();
 
-                                       // read and then write
-                                       // parameters. take same input file
-                                       // as for parameter_handler_3, but
-                                       // use different output format
+      // read and then write
+      // parameters. take same input file
+      // as for parameter_handler_3, but
+      // use different output format
       prm.read_input("parameter_handler_3/prm");
       prm.print_parameters (logfile, ParameterHandler::LaTeX);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 
index 16ee49d02f213aa81f6507d2a81da20a1a734b79..a91f7944cdcf1f9459edcc1dfde83ec4f6ab02dd 100644 (file)
@@ -45,25 +45,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 
index 0ea7f9d97513c2ab05e1a9352da19660bb82325d..8e967a05400f75c7de1c517d0c8a813196ce36fa 100644 (file)
 #include <iomanip>
 
 
-int main () 
+int main ()
 {
   try
     {
       std::ofstream logfile("parameter_handler_5/output");
       deallog.attach(logfile);
       deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);
+      deallog.threshold_double(1.e-10);
 
       ParameterHandler prm;
       prm.declare_entry ("int",
@@ -48,27 +48,27 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
-  
+
   return 0;
 }
index faab50efc0902339f43093c0b1ac39420dea99e5..3a71d1cd223483f36c59d9698ed588c7da078bd5 100644 (file)
 #include <iomanip>
 
 
-int main () 
+int main ()
 {
-  try 
+  try
     {
       std::ofstream logfile("parameter_handler_6/output");
       deallog.attach(logfile);
       deallog.depth_console(0);
       deallog.threshold_double(1.e-10);
 
-                                       // same as parameter_handler_3
+      // same as parameter_handler_3
       ParameterHandler prm;
       prm.enter_subsection ("Testing");
       prm.declare_entry ("string list",
@@ -49,44 +49,44 @@ int main ()
                          Patterns::Double(),
                          "docs 3");
       prm.leave_subsection ();
-      
+
       prm.read_input("parameter_handler_3/prm");
 
-                                       // now set some of the entries to
-                                       // different values
+      // now set some of the entries to
+      // different values
       prm.enter_subsection ("Testing");
       prm.set ("string list", "a, c, b");
       prm.set ("int", "5");
       prm.set ("double", "2.71828");
       prm.leave_subsection ();
-      
-                                       // then write
+
+      // then write
       prm.print_parameters (logfile, ParameterHandler::Text);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
-  
+
   return 0;
 }
index 11061bdb99803aafa96f77292a1f80508a356fe4..13c7a1593dd97f02282970def9346f02fceec029 100644 (file)
 #include <iomanip>
 
 
-int main () 
+int main ()
 {
-  try 
+  try
     {
       std::ofstream logfile("parameter_handler_6_bool/output");
       deallog.attach(logfile);
       deallog.depth_console(0);
       deallog.threshold_double(1.e-10);
 
-                                       // same as parameter_handler_3
+      // same as parameter_handler_3
       ParameterHandler prm;
       prm.enter_subsection ("Testing");
       prm.declare_entry ("bool",
@@ -42,51 +42,51 @@ int main ()
                          Patterns::Bool(),
                          "docs 1");
       prm.leave_subsection ();
-      
+
       prm.read_input("parameter_handler_6_bool/prm");
 
-                                       // now set the parameter to a different
-                                       // value
+      // now set the parameter to a different
+      // value
       prm.enter_subsection ("Testing");
       prm.set ("bool", true);
       prm.leave_subsection ();
-      
-                                       // then write
+
+      // then write
       prm.print_parameters (logfile, ParameterHandler::Text);
 
-                                       // and do it again with the opposite
-                                       // value
+      // and do it again with the opposite
+      // value
       prm.enter_subsection ("Testing");
       prm.set ("bool", false);
       prm.leave_subsection ();
-      
-                                       // then write
+
+      // then write
       prm.print_parameters (logfile, ParameterHandler::Text);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
-  
+
   return 0;
 }
index 095411f8b61eb92a39b25014ec8ca134e347910c..19a97e467805a1b44e7c1a54c48be24fa2f8423f 100644 (file)
@@ -49,35 +49,35 @@ int main ()
                          "docs 3");
       prm.leave_subsection ();
 
-                                       // read and then write
-                                       // parameters. take same input file
-                                       // as for parameter_handler_3, but
-                                       // use different output format
+      // read and then write
+      // parameters. take same input file
+      // as for parameter_handler_3, but
+      // use different output format
       prm.read_input("parameter_handler_3/prm");
       prm.print_parameters (logfile, ParameterHandler::Description);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 
index 8493d3487296b75e0f9b6548573037cbed152b16..7c6face4367b87b37daa50cc0a0a665519915388 100644 (file)
@@ -39,65 +39,65 @@ int main ()
       ParameterHandler prm;
       prm.enter_subsection ("Testing testing");
       {
-       prm.declare_entry ("string list",
-                          "a",
-                          Patterns::List(Patterns::Selection("a|b|c|d|e|f|g|h")),
-                          "docs 1");
-       prm.declare_entry ("int/int",
-                          "1",
-                          Patterns::Integer());
-       prm.declare_entry ("double_double",
-                          "3.1415926",
-                          Patterns::Double(),
-                          "docs 3");
+        prm.declare_entry ("string list",
+                           "a",
+                           Patterns::List(Patterns::Selection("a|b|c|d|e|f|g|h")),
+                           "docs 1");
+        prm.declare_entry ("int/int",
+                           "1",
+                           Patterns::Integer());
+        prm.declare_entry ("double_double",
+                           "3.1415926",
+                           Patterns::Double(),
+                           "docs 3");
 
-       prm.enter_subsection ("Testing%testing");
-       {
-         prm.declare_entry ("string&list",
-                            "a,b,c",
-                            Patterns::List(Patterns::Selection("a|b|c|d|e|f|g|h")),
-                            "docs 1");
-         prm.declare_entry ("int*int",
-                            "2",
-                            Patterns::Integer());
-         prm.declare_entry ("double+double",
-                            "6.1415926",
-                            Patterns::Double(),
-                            "docs 3");
-       }
-       prm.leave_subsection ();
+        prm.enter_subsection ("Testing%testing");
+        {
+          prm.declare_entry ("string&list",
+                             "a,b,c",
+                             Patterns::List(Patterns::Selection("a|b|c|d|e|f|g|h")),
+                             "docs 1");
+          prm.declare_entry ("int*int",
+                             "2",
+                             Patterns::Integer());
+          prm.declare_entry ("double+double",
+                             "6.1415926",
+                             Patterns::Double(),
+                             "docs 3");
+        }
+        prm.leave_subsection ();
       }
       prm.leave_subsection ();
 
-                                       // read and then write
-                                       // parameters. take same input file
-                                       // as for parameter_handler_3, but
-                                       // use different output format
+      // read and then write
+      // parameters. take same input file
+      // as for parameter_handler_3, but
+      // use different output format
       prm.read_input("parameter_handler_8/prm");
       prm.print_parameters (logfile, ParameterHandler::Text);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 
index 5bf6e9f47b6b58fbcbaf42022dd589d6a0ac441f..deb35ad2a37f7cb74a9bf1b8e3ccec8611830c3c 100644 (file)
@@ -37,65 +37,65 @@ int main ()
       ParameterHandler prm;
       prm.enter_subsection ("Testing testing");
       {
-       prm.declare_entry ("string list",
-                          "a",
-                          Patterns::List(Patterns::Selection("a|b|c|d|e|f|g|h")),
-                          "docs 1");
-       prm.declare_entry ("int/int",
-                          "1",
-                          Patterns::Integer());
-       prm.declare_entry ("double_double",
-                          "3.1415926",
-                          Patterns::Double(),
-                          "docs 3");
+        prm.declare_entry ("string list",
+                           "a",
+                           Patterns::List(Patterns::Selection("a|b|c|d|e|f|g|h")),
+                           "docs 1");
+        prm.declare_entry ("int/int",
+                           "1",
+                           Patterns::Integer());
+        prm.declare_entry ("double_double",
+                           "3.1415926",
+                           Patterns::Double(),
+                           "docs 3");
 
-       prm.enter_subsection ("Testing%testing");
-       {
-         prm.declare_entry ("string&list",
-                            "a,b,c",
-                            Patterns::List(Patterns::Selection("a|b|c|d|e|f|g|h")),
-                            "docs 1");
-         prm.declare_entry ("int*int",
-                            "2",
-                            Patterns::Integer());
-         prm.declare_entry ("double+double",
-                            "6.1415926",
-                            Patterns::Double(),
-                            "docs 3");
-       }
-       prm.leave_subsection ();
+        prm.enter_subsection ("Testing%testing");
+        {
+          prm.declare_entry ("string&list",
+                             "a,b,c",
+                             Patterns::List(Patterns::Selection("a|b|c|d|e|f|g|h")),
+                             "docs 1");
+          prm.declare_entry ("int*int",
+                             "2",
+                             Patterns::Integer());
+          prm.declare_entry ("double+double",
+                             "6.1415926",
+                             Patterns::Double(),
+                             "docs 3");
+        }
+        prm.leave_subsection ();
       }
       prm.leave_subsection ();
 
-                                       // read and then write
-                                       // parameters. take same input file
-                                       // as for parameter_handler_3, but
-                                       // use different output format
+      // read and then write
+      // parameters. take same input file
+      // as for parameter_handler_3, but
+      // use different output format
       prm.read_input("parameter_handler_8/prm");
       prm.log_parameters (deallog);
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 
index a367a2662504d3e3e62f804bb624a03636ca5931..d15f07c9ee76078886fe62d191804579e970cf1c 100644 (file)
@@ -33,54 +33,54 @@ int main ()
 
   ParameterHandler prm;
   prm.declare_entry ("int1",
-                    "1",
-                    Patterns::Integer(),
-                    "doc 1");
+                     "1",
+                     Patterns::Integer(),
+                     "doc 1");
   prm.declare_entry ("int2",
-                    "2",
-                    Patterns::Integer(),
-                    "doc 2");
+                     "2",
+                     Patterns::Integer(),
+                     "doc 2");
   prm.enter_subsection ("ss1");
   {
     prm.declare_entry ("double 1",
-                      "1.234",
-                      Patterns::Double(),
-                      "doc 3");
+                       "1.234",
+                       Patterns::Double(),
+                       "doc 3");
 
     prm.enter_subsection ("ss2");
     {
       prm.declare_entry ("double 2",
-                        "4.321",
-                        Patterns::Double(),
-                        "doc 4");
+                         "4.321",
+                         Patterns::Double(),
+                         "doc 4");
     }
     prm.leave_subsection ();
   }
   prm.leave_subsection ();
 
-                                  // things with strange characters
+  // things with strange characters
   prm.enter_subsection ("Testing%testing");
   {
     prm.declare_entry ("string&list",
-                      "< & > ; /",
-                      Patterns::Anything(),
-                      "docs 1");
+                       "< & > ; /",
+                       Patterns::Anything(),
+                       "docs 1");
     prm.declare_entry ("int*int",
-                      "2",
-                      Patterns::Integer());
+                       "2",
+                       Patterns::Integer());
     prm.declare_entry ("double+double",
-                      "6.1415926",
-                      Patterns::Double(),
-                      "docs 3");
+                       "6.1415926",
+                       Patterns::Double(),
+                       "docs 3");
   }
   prm.leave_subsection ();
 
-                                  // read from XML
+  // read from XML
   std::ifstream in ("parameter_handler_read_xml/prm");
   bool result = prm.read_input_from_xml (in);
   Assert (result == true, ExcInternalError());
 
-                                  // write it out again
+  // write it out again
   prm.print_parameters (deallog.get_file_stream(), ParameterHandler::XML);
   logfile << std::endl;
 
index e13ba6b4429b28c26e88e7f88e56521979fd66fa..0b5770f7af9b2ece107f348c26a36a19d331f358 100644 (file)
@@ -34,54 +34,54 @@ int main ()
 
   ParameterHandler prm;
   prm.declare_entry ("int1",
-                    "1",
-                    Patterns::Integer(),
-                    "doc 1");
+                     "1",
+                     Patterns::Integer(),
+                     "doc 1");
   prm.declare_entry ("int2",
-                    "2",
-                    Patterns::Integer(),
-                    "doc 2");
+                     "2",
+                     Patterns::Integer(),
+                     "doc 2");
   prm.enter_subsection ("ss1");
   {
     prm.declare_entry ("double 1",
-                      "1.234",
-                      Patterns::Double(),
-                      "doc 3");
+                       "1.234",
+                       Patterns::Double(),
+                       "doc 3");
 
     prm.enter_subsection ("ss2");
     {
       prm.declare_entry ("double 2",
-                        "4.321",
-                        Patterns::Double(),
-                        "doc 4");
+                         "4.321",
+                         Patterns::Double(),
+                         "doc 4");
     }
     prm.leave_subsection ();
   }
   prm.leave_subsection ();
 
-                                  // things with strange characters
+  // things with strange characters
   prm.enter_subsection ("Testing%testing");
   {
     prm.declare_entry ("string&list",
-                      "< & > ; /",
-                      Patterns::Anything(),
-                      "docs 1");
+                       "< & > ; /",
+                       Patterns::Anything(),
+                       "docs 1");
     prm.declare_entry ("int*int",
-                      "2",
-                      Patterns::Integer());
+                       "2",
+                       Patterns::Integer());
     prm.declare_entry ("double+double",
-                      "6.1415926",
-                      Patterns::Double(),
-                      "docs 3");
+                       "6.1415926",
+                       Patterns::Double(),
+                       "docs 3");
   }
   prm.leave_subsection ();
 
-                                  // read from XML
+  // read from XML
   std::ifstream in ("parameter_handler_read_xml_error_01/prm");
   bool result = prm.read_input_from_xml (in);
   Assert (result == false, ExcInternalError());
 
   deallog << "OK" << std::endl;
-  
+
   return 0;
 }
index 1e443fbf5a58ae7219ce23ac8ae0ea1d8e4495e8..beedd2face41ce94dff1ee92dfdbc804463394d0 100644 (file)
@@ -34,54 +34,54 @@ int main ()
 
   ParameterHandler prm;
   prm.declare_entry ("int1",
-                    "1",
-                    Patterns::Integer(),
-                    "doc 1");
+                     "1",
+                     Patterns::Integer(),
+                     "doc 1");
   prm.declare_entry ("int2",
-                    "2",
-                    Patterns::Integer(),
-                    "doc 2");
+                     "2",
+                     Patterns::Integer(),
+                     "doc 2");
   prm.enter_subsection ("ss1");
   {
     prm.declare_entry ("double 1",
-                      "1.234",
-                      Patterns::Double(),
-                      "doc 3");
+                       "1.234",
+                       Patterns::Double(),
+                       "doc 3");
 
     prm.enter_subsection ("ss2");
     {
       prm.declare_entry ("double 2",
-                        "4.321",
-                        Patterns::Double(),
-                        "doc 4");
+                         "4.321",
+                         Patterns::Double(),
+                         "doc 4");
     }
     prm.leave_subsection ();
   }
   prm.leave_subsection ();
 
-                                  // things with strange characters
+  // things with strange characters
   prm.enter_subsection ("Testing%testing");
   {
     prm.declare_entry ("string&list",
-                      "< & > ; /",
-                      Patterns::Anything(),
-                      "docs 1");
+                       "< & > ; /",
+                       Patterns::Anything(),
+                       "docs 1");
     prm.declare_entry ("int*int",
-                      "2",
-                      Patterns::Integer());
+                       "2",
+                       Patterns::Integer());
     prm.declare_entry ("double+double",
-                      "6.1415926",
-                      Patterns::Double(),
-                      "docs 3");
+                       "6.1415926",
+                       Patterns::Double(),
+                       "docs 3");
   }
   prm.leave_subsection ();
 
-                                  // read from XML
+  // read from XML
   std::ifstream in ("parameter_handler_read_xml_error_02/prm");
   bool result = prm.read_input_from_xml (in);
   Assert (result == false, ExcInternalError());
 
   deallog << "OK" << std::endl;
-  
+
   return 0;
 }
index fc86216e304bcccf6da8a40d2835983b8e122597..b1387c8db805bc3cb6f6caa8b7fc526ea01af556 100644 (file)
@@ -34,54 +34,54 @@ int main ()
 
   ParameterHandler prm;
   prm.declare_entry ("int1",
-                    "1",
-                    Patterns::Integer(),
-                    "doc 1");
+                     "1",
+                     Patterns::Integer(),
+                     "doc 1");
   prm.declare_entry ("int2",
-                    "2",
-                    Patterns::Integer(),
-                    "doc 2");
+                     "2",
+                     Patterns::Integer(),
+                     "doc 2");
   prm.enter_subsection ("ss1");
   {
     prm.declare_entry ("double 1",
-                      "1.234",
-                      Patterns::Double(),
-                      "doc 3");
+                       "1.234",
+                       Patterns::Double(),
+                       "doc 3");
 
     prm.enter_subsection ("ss2");
     {
       prm.declare_entry ("double 2",
-                        "4.321",
-                        Patterns::Double(),
-                        "doc 4");
+                         "4.321",
+                         Patterns::Double(),
+                         "doc 4");
     }
     prm.leave_subsection ();
   }
   prm.leave_subsection ();
 
-                                  // things with strange characters
+  // things with strange characters
   prm.enter_subsection ("Testing%testing");
   {
     prm.declare_entry ("string&list",
-                      "< & > ; /",
-                      Patterns::Anything(),
-                      "docs 1");
+                       "< & > ; /",
+                       Patterns::Anything(),
+                       "docs 1");
     prm.declare_entry ("int*int",
-                      "2",
-                      Patterns::Integer());
+                       "2",
+                       Patterns::Integer());
     prm.declare_entry ("double+double",
-                      "6.1415926",
-                      Patterns::Double(),
-                      "docs 3");
+                       "6.1415926",
+                       Patterns::Double(),
+                       "docs 3");
   }
   prm.leave_subsection ();
 
-                                  // read from XML
+  // read from XML
   std::ifstream in ("parameter_handler_read_xml_error_03/prm");
   bool result = prm.read_input_from_xml (in);
   Assert (result == false, ExcInternalError());
 
   deallog << "OK" << std::endl;
-  
+
   return 0;
 }
index e5d54a3ecbf26c136a68fd701d3c696ae1e961e7..00cfff394101469f82d9990a2efc7c40c1379b26 100644 (file)
@@ -34,54 +34,54 @@ int main ()
 
   ParameterHandler prm;
   prm.declare_entry ("int1",
-                    "1",
-                    Patterns::Integer(),
-                    "doc 1");
+                     "1",
+                     Patterns::Integer(),
+                     "doc 1");
   prm.declare_entry ("int2",
-                    "2",
-                    Patterns::Integer(),
-                    "doc 2");
+                     "2",
+                     Patterns::Integer(),
+                     "doc 2");
   prm.enter_subsection ("ss1");
   {
     prm.declare_entry ("double 1",
-                      "1.234",
-                      Patterns::Double(),
-                      "doc 3");
+                       "1.234",
+                       Patterns::Double(),
+                       "doc 3");
 
     prm.enter_subsection ("ss2");
     {
       prm.declare_entry ("double 2",
-                        "4.321",
-                        Patterns::Double(),
-                        "doc 4");
+                         "4.321",
+                         Patterns::Double(),
+                         "doc 4");
     }
     prm.leave_subsection ();
   }
   prm.leave_subsection ();
 
-                                  // things with strange characters
+  // things with strange characters
   prm.enter_subsection ("Testing%testing");
   {
     prm.declare_entry ("string&list",
-                      "< & > ; /",
-                      Patterns::Anything(),
-                      "docs 1");
+                       "< & > ; /",
+                       Patterns::Anything(),
+                       "docs 1");
     prm.declare_entry ("int*int",
-                      "2",
-                      Patterns::Integer());
+                       "2",
+                       Patterns::Integer());
     prm.declare_entry ("double+double",
-                      "6.1415926",
-                      Patterns::Double(),
-                      "docs 3");
+                       "6.1415926",
+                       Patterns::Double(),
+                       "docs 3");
   }
   prm.leave_subsection ();
 
-                                  // read from XML
+  // read from XML
   std::ifstream in ("parameter_handler_read_xml_error_04/prm");
   bool result = prm.read_input_from_xml (in);
   Assert (result == false, ExcInternalError());
 
   deallog << "OK" << std::endl;
-  
+
   return 0;
 }
index 0330f91f04b5e67d9e32c202ac0f481850fd836b..ddcd9aec63449d8ac0a868a4f3ce17241fd00f36 100644 (file)
@@ -34,45 +34,45 @@ int main ()
 
   ParameterHandler prm;
   prm.declare_entry ("int1",
-                    "1",
-                    Patterns::Integer(),
-                    "doc 1");
+                     "1",
+                     Patterns::Integer(),
+                     "doc 1");
   prm.declare_entry ("int2",
-                    "2",
-                    Patterns::Integer(),
-                    "doc 2");
+                     "2",
+                     Patterns::Integer(),
+                     "doc 2");
   prm.enter_subsection ("ss1");
   {
     prm.declare_entry ("double 1",
-                      "1.234",
-                      Patterns::Double(),
-                      "doc 3");
+                       "1.234",
+                       Patterns::Double(),
+                       "doc 3");
 
     prm.enter_subsection ("ss2");
     {
       prm.declare_entry ("double 2",
-                        "4.321",
-                        Patterns::Double(),
-                        "doc 4");
+                         "4.321",
+                         Patterns::Double(),
+                         "doc 4");
     }
     prm.leave_subsection ();
   }
   prm.leave_subsection ();
 
-                                  // things with strange characters
+  // things with strange characters
   prm.enter_subsection ("Testing%testing");
   {
     prm.declare_entry ("string&list",
-                      "< & > ; /",
-                      Patterns::Anything(),
-                      "docs 1");
+                       "< & > ; /",
+                       Patterns::Anything(),
+                       "docs 1");
     prm.declare_entry ("int*int",
-                      "2",
-                      Patterns::Integer());
+                       "2",
+                       Patterns::Integer());
     prm.declare_entry ("double+double",
-                      "6.1415926",
-                      Patterns::Double(),
-                      "docs 3");
+                       "6.1415926",
+                       Patterns::Double(),
+                       "docs 3");
   }
   prm.leave_subsection ();
 
index cebea3acdf5dd21aae8863258804e560e0b439f2..cb75994780773ca9c33b6937db11ea20b2485951 100644 (file)
@@ -34,45 +34,45 @@ int main ()
 
   ParameterHandler prm;
   prm.declare_entry ("int1",
-                    "1",
-                    Patterns::Integer(),
-                    "doc 1");
+                     "1",
+                     Patterns::Integer(),
+                     "doc 1");
   prm.declare_entry ("int2",
-                    "2",
-                    Patterns::Integer(),
-                    "doc 2");
+                     "2",
+                     Patterns::Integer(),
+                     "doc 2");
   prm.enter_subsection ("ss1");
   {
     prm.declare_entry ("double 1",
-                      "1.234",
-                      Patterns::Double(),
-                      "doc 3");
+                       "1.234",
+                       Patterns::Double(),
+                       "doc 3");
 
     prm.enter_subsection ("ss2");
     {
       prm.declare_entry ("double 2",
-                        "4.321",
-                        Patterns::Double(),
-                        "doc 4");
+                         "4.321",
+                         Patterns::Double(),
+                         "doc 4");
     }
     prm.leave_subsection ();
   }
   prm.leave_subsection ();
 
-                                  // things with strange characters
+  // things with strange characters
   prm.enter_subsection ("Testing%testing");
   {
     prm.declare_entry ("string&list",
-                      "< & > ; /",
-                      Patterns::Anything(),
-                      "docs 1");
+                       "< & > ; /",
+                       Patterns::Anything(),
+                       "docs 1");
     prm.declare_entry ("int*int",
-                      "2",
-                      Patterns::Integer());
+                       "2",
+                       Patterns::Integer());
     prm.declare_entry ("double+double",
-                      "6.1415926",
-                      Patterns::Double(),
-                      "docs 3");
+                       "6.1415926",
+                       Patterns::Double(),
+                       "docs 3");
   }
   prm.leave_subsection ();
 
index 7b99b56b539bc0639983fd3ed7630b84d5176c95..310082492cddd4ce27cb3f463ef2ab894148a601 100644 (file)
@@ -17,7 +17,7 @@
 
 
 // This program tests the functionality of the function parser
-// wrapper. 
+// wrapper.
 
 #include "../tests.h"
 #include <fstream>
 #include <deal.II/grid/tria.h>
 #include <deal.II/grid/grid_generator.h>
 
-template <int dim> 
-void Test() {
+template <int dim>
+void Test()
+{
   // A parameter handler
   ParameterHandler prm;
-  
+
   // A triangulation
   Triangulation<dim> tria;
   GridGenerator::hyper_cube(tria,0,1);
   tria.refine_global(3);
-  
+
   // Vertices
   const std::vector<Point<dim> > &vertices = tria.get_vertices();
-  
+
   // Test vector declaration
-  for(unsigned int i=0; i<dim;++i) {
-    std::string id = 
-      "Function " + Utilities::int_to_string(dim) +
-      " - " + Utilities::int_to_string(i);
-    prm.enter_subsection(id);
-    
-    Functions::ParsedFunction<dim>::declare_parameters(prm, i+1);
-    prm.set("Function constants", "f=" + Utilities::int_to_string(i+1));
-    
-    // It is cos(pi f x_i) *t^i, numbering from zero
-    std::string expr = "cos(pi*f*x)*t";
-    if(i>0) expr+=  "; cos(pi*f*y)*t";
-    if(i>1) expr+=  "; cos(pi*f*z)*t";
-    
-    prm.set("Function expression", expr);
-    
-    Functions::ParsedFunction<dim> function(i+1);
-    function.parse_parameters(prm);
-    
-    prm.leave_subsection();
-    
-    // Now test the difference from t=0 to t=1
-    for(double t=0.; t<1; t+= .1) {
-      function.set_time(t);
-      Point<dim> p;
-      std::vector<Vector<double> > values(vertices.size(),
-                                         Vector<double>(i+1));
-      function.vector_value_list(vertices, values);
-      for(unsigned int j=0; j<vertices.size(); ++j) {
-       double delta=0.;
-       for(unsigned int di=0; di<i; ++di) {
-         delta = values[j](di) - std::cos(M_PI*(i+1)*vertices[j][di])*t;
-         if(std::abs(delta) > 1e-10) 
-           deallog << "p(" << di << "): " << vertices[j] << ", delta: " 
-                   << delta << std::endl;
-       }
-      }
+  for (unsigned int i=0; i<dim; ++i)
+    {
+      std::string id =
+        "Function " + Utilities::int_to_string(dim) +
+        " - " + Utilities::int_to_string(i);
+      prm.enter_subsection(id);
+
+      Functions::ParsedFunction<dim>::declare_parameters(prm, i+1);
+      prm.set("Function constants", "f=" + Utilities::int_to_string(i+1));
+
+      // It is cos(pi f x_i) *t^i, numbering from zero
+      std::string expr = "cos(pi*f*x)*t";
+      if (i>0) expr+=  "; cos(pi*f*y)*t";
+      if (i>1) expr+=  "; cos(pi*f*z)*t";
+
+      prm.set("Function expression", expr);
+
+      Functions::ParsedFunction<dim> function(i+1);
+      function.parse_parameters(prm);
+
+      prm.leave_subsection();
+
+      // Now test the difference from t=0 to t=1
+      for (double t=0.; t<1; t+= .1)
+        {
+          function.set_time(t);
+          Point<dim> p;
+          std::vector<Vector<double> > values(vertices.size(),
+                                              Vector<double>(i+1));
+          function.vector_value_list(vertices, values);
+          for (unsigned int j=0; j<vertices.size(); ++j)
+            {
+              double delta=0.;
+              for (unsigned int di=0; di<i; ++di)
+                {
+                  delta = values[j](di) - std::cos(M_PI*(i+1)*vertices[j][di])*t;
+                  if (std::abs(delta) > 1e-10)
+                    deallog << "p(" << di << "): " << vertices[j] << ", delta: "
+                            << delta << std::endl;
+                }
+            }
+        }
     }
-  }
   deallog << "Tested on: " << std::endl;
   prm.log_parameters(deallog);
 }
 
-int main () 
+int main ()
 {
   std::ofstream logfile("parsed_function/output");
   deallog.attach(logfile);
@@ -101,6 +106,6 @@ int main ()
   Test<3>();
 }
 
-      
 
-  
+
+
index 1133486c08c4a927bdc69b3595fa4752f0110735..1c85517598c44723b4493e8891031303f659c72d 100644 (file)
 
 
 template <int dim>
-void test () 
+void test ()
 {
   // create a 2x1 (or 2x1x1) mesh
   Triangulation<dim> triangulation;
   std::vector<unsigned int> repetitions (dim, 1);
   repetitions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle (triangulation,
-                                            repetitions,
-                                            Point<dim>(),
-                                            (dim == 2 ?
-                                             Point<dim>(2,1) :
-                                             Point<dim>(2,1,1)));
-  
+                                             repetitions,
+                                             Point<dim>(),
+                                             (dim == 2 ?
+                                              Point<dim>(2,1) :
+                                              Point<dim>(2,1,1)));
+
   FE_Q<dim>          fe(1);
   DoFHandler<dim>    dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
 
   ConstraintMatrix cm;
   DoFTools::make_periodicity_constraints (dof_handler.begin(0)->face(0),
-                                         (++dof_handler.begin(0))->face(1),
-                                         cm);
+                                          (++dof_handler.begin(0))->face(1),
+                                          cm);
   cm.print (deallog.get_file_stream());
 }
 
-    
 
-int main () 
+
+int main ()
 {
   std::ofstream logfile("periodicity_01/output");
   deallog.attach(logfile);
index 7793f489765f3a2302ad77e6329ce3ce293755f4..bb6abea3e4499e595d7203816984216fff3dfdc9 100644 (file)
 
 
 template <int dim>
-void test () 
+void test ()
 {
   deallog << dim << "D" << std::endl;
-  
+
   // create a 2x1 (or 2x1x1) mesh and refine the leftmost cell
   Triangulation<dim> triangulation;
   std::vector<unsigned int> repetitions (dim, 1);
   repetitions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle (triangulation,
-                                            repetitions,
-                                            Point<dim>(),
-                                            (dim == 2 ?
-                                             Point<dim>(2,1) :
-                                             Point<dim>(2,1,1)));
+                                             repetitions,
+                                             Point<dim>(),
+                                             (dim == 2 ?
+                                              Point<dim>(2,1) :
+                                              Point<dim>(2,1,1)));
   triangulation.begin_active()->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
-  
+
   FE_Q<dim>          fe(1);
   DoFHandler<dim>    dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
 
   ConstraintMatrix cm;
   DoFTools::make_periodicity_constraints (dof_handler.begin(0)->face(0),
-                                         (++dof_handler.begin(0))->face(1),
-                                         cm);
+                                          (++dof_handler.begin(0))->face(1),
+                                          cm);
   cm.print (deallog.get_file_stream());
 }
 
-    
 
-int main () 
+
+int main ()
 {
   std::ofstream logfile("periodicity_02/output");
   deallog.attach(logfile);
index 76033b4398d891cf86d372ca3e84a87db9f330e9..ff833ea0933d85b0d2ed9f8621aeff1c03761b14 100644 (file)
 
 
 template <int dim>
-void test () 
+void test ()
 {
   deallog << dim << "D" << std::endl;
-  
+
   // create a 2x1 (or 2x1x1) mesh and refine the leftmost cell twice
   Triangulation<dim> triangulation;
   std::vector<unsigned int> repetitions (dim, 1);
   repetitions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle (triangulation,
-                                            repetitions,
-                                            Point<dim>(),
-                                            (dim == 2 ?
-                                             Point<dim>(2,1) :
-                                             Point<dim>(2,1,1)));
+                                             repetitions,
+                                             Point<dim>(),
+                                             (dim == 2 ?
+                                              Point<dim>(2,1) :
+                                              Point<dim>(2,1,1)));
   triangulation.begin_active()->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
   triangulation.begin_active(1)->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
-  
+
   FE_Q<dim>          fe(1);
   DoFHandler<dim>    dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
 
   ConstraintMatrix cm;
   DoFTools::make_periodicity_constraints (dof_handler.begin(0)->face(0),
-                                         (++dof_handler.begin(0))->face(1),
-                                         cm);
+                                          (++dof_handler.begin(0))->face(1),
+                                          cm);
   cm.print (deallog.get_file_stream());
 }
 
-    
 
-int main () 
+
+int main ()
 {
   std::ofstream logfile("periodicity_03/output");
   deallog.attach(logfile);
index 05f7da591864d1d0c0bc6fc574d94a42e552312e..5e8f0271b9237b2cb4bd031d0814413fa70aae8d 100644 (file)
 
 
 template <int dim>
-void test () 
+void test ()
 {
   deallog << dim << "D" << std::endl;
-  
+
   // create a 2x1 (or 2x1x1) mesh and refine the leftmost cell twice
   Triangulation<dim> triangulation;
   std::vector<unsigned int> repetitions (dim, 1);
   repetitions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle (triangulation,
-                                            repetitions,
-                                            Point<dim>(),
-                                            (dim == 2 ?
-                                             Point<dim>(2,1) :
-                                             Point<dim>(2,1,1)));
+                                             repetitions,
+                                             Point<dim>(),
+                                             (dim == 2 ?
+                                              Point<dim>(2,1) :
+                                              Point<dim>(2,1,1)));
   triangulation.begin_active()->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
   triangulation.begin_active(1)->set_refine_flag ();
@@ -71,15 +71,15 @@ void test ()
   mask[1] = false;
   ConstraintMatrix cm;
   DoFTools::make_periodicity_constraints (dof_handler.begin(0)->face(0),
-                                         (++dof_handler.begin(0))->face(1),
-                                         cm,
-                                         mask);
+                                          (++dof_handler.begin(0))->face(1),
+                                          cm,
+                                          mask);
   cm.print (deallog.get_file_stream());
 }
 
-    
 
-int main () 
+
+int main ()
 {
   std::ofstream logfile("periodicity_04/output");
   deallog.attach(logfile);
index 55cf5317a1979fb059ce275d59217e318ddf832d..36748c84462873feaed7340d7179fe8457ac7e0c 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim> () {}
-
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square()+1; }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { values(0) = value(p,0); }
+public:
+  MySquareFunction () : Function<dim> () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square()+1;
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+  }
 };
 
 
 template<int dim>
 class MyExpFunction : public Function<dim>
 {
-  public:
-    MyExpFunction () : Function<dim> () {}
-
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return std::exp (p(0)); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { values(0) = value(p,0); }
+public:
+  MyExpFunction () : Function<dim> () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return std::exp (p(0));
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+  }
 };
 
 
@@ -74,18 +82,18 @@ class MyExpFunction : public Function<dim>
 template <int dim>
 void make_mesh (Triangulation<dim> &tria)
 {
-  
+
   GridGenerator::hyper_cube(tria, -1, 1);
 
-                                   // refine the mesh in a random way so as to
-                                   // generate as many cells with
-                                   // hanging nodes as possible
+  // refine the mesh in a random way so as to
+  // generate as many cells with
+  // hanging nodes as possible
   tria.refine_global (4-dim);
   const double steps[4] = { /*d=0*/ 0, 7, 3, 3 };
   for (unsigned int i=0; i<steps[dim]; ++i)
     {
       typename Triangulation<dim>::active_cell_iterator
-        cell = tria.begin_active();
+      cell = tria.begin_active();
       for (unsigned int index=0; cell != tria.end(); ++cell, ++index)
         if (index % (3*dim) == 0)
           cell->set_refine_flag();
@@ -102,36 +110,36 @@ check ()
 {
   Triangulation<dim> tria;
   make_mesh (tria);
-  
+
   FE_Q<dim> element(3);
   DoFHandler<dim> dof(tria);
   dof.distribute_dofs(element);
 
-                                   // test with two different functions: one
-                                   // that is exactly representable on the
-                                   // chosen finite element space, and one
-                                   // that isn't
+  // test with two different functions: one
+  // that is exactly representable on the
+  // chosen finite element space, and one
+  // that isn't
   for (unsigned int i=0; i<2; ++i)
     {
       static const MySquareFunction<dim>          function_1;
       static const Functions::CosineFunction<dim> function_2;
 
       const Function<dim> &
-        function = (i==0 ?
-                    static_cast<const Function<dim>&>(function_1) :
-                    static_cast<const Function<dim>&>(function_2));
-      
+      function = (i==0 ?
+                  static_cast<const Function<dim>&>(function_1) :
+                  static_cast<const Function<dim>&>(function_2));
+
       Vector<double> v (dof.n_dofs());
       VectorTools::interpolate (dof, function, v);
 
-                                       // for the following points, check the
-                                       // function value, output it, and
-                                       // verify that the value retrieved from
-                                       // the interpolated function is close
-                                       // enough to that of the real function
-                                       //
-                                       // also verify that the actual value is
-                                       // roughly correct
+      // for the following points, check the
+      // function value, output it, and
+      // verify that the value retrieved from
+      // the interpolated function is close
+      // enough to that of the real function
+      //
+      // also verify that the actual value is
+      // roughly correct
       Point<dim> p[3];
       for (unsigned int d=0; d<dim; ++d)
         {
@@ -151,9 +159,9 @@ check ()
           deallog << difference(0) << std::endl;
           Assert (std::abs(-difference(0) - function.value(p[i])) < 1e-4,
                   ExcInternalError());
-        }  
+        }
     }
-  
+
   deallog << "OK" << std::endl;
 }
 
index 537e2486e0831071c612398822dc17a86c747f84..3a37e6bcbe1612593d13651878cd90820561e97a 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim> () {}
-
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square()+1; }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { values(0) = value(p,0); }
+public:
+  MySquareFunction () : Function<dim> () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square()+1;
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+  }
 };
 
 
 template<int dim>
 class MyExpFunction : public Function<dim>
 {
-  public:
-    MyExpFunction () : Function<dim> () {}
-
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return std::exp (p(0)); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { values(0) = value(p,0); }
+public:
+  MyExpFunction () : Function<dim> () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return std::exp (p(0));
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+  }
 };
 
 
@@ -78,18 +86,18 @@ class MyExpFunction : public Function<dim>
 template <int dim>
 void make_mesh (Triangulation<dim> &tria)
 {
-  
+
   GridGenerator::hyper_cube(tria, -1, 1);
 
-                                   // refine the mesh in a random way so as to
-                                   // generate as many cells with
-                                   // hanging nodes as possible
+  // refine the mesh in a random way so as to
+  // generate as many cells with
+  // hanging nodes as possible
   tria.refine_global (4-dim);
   const double steps[4] = { /*d=0*/ 0, 7, 3, 3 };
   for (unsigned int i=0; i<steps[dim]; ++i)
     {
       typename Triangulation<dim>::active_cell_iterator
-        cell = tria.begin_active();
+      cell = tria.begin_active();
       for (unsigned int index=0; cell != tria.end(); ++cell, ++index)
         if (index % (3*dim) == 0)
           cell->set_refine_flag();
@@ -107,36 +115,36 @@ check ()
   MappingQ1<dim> mapping;
   Triangulation<dim> tria;
   make_mesh (tria);
-  
+
   FE_Q<dim> element(3);
   DoFHandler<dim> dof(tria);
   dof.distribute_dofs(element);
 
-                                   // test with two different functions: one
-                                   // that is exactly representable on the
-                                   // chosen finite element space, and one
-                                   // that isn't
+  // test with two different functions: one
+  // that is exactly representable on the
+  // chosen finite element space, and one
+  // that isn't
   for (unsigned int i=0; i<2; ++i)
     {
       static const MySquareFunction<dim>          function_1;
       static const Functions::CosineFunction<dim> function_2;
 
       const Function<dim> &
-        function = (i==0 ?
-                    static_cast<const Function<dim>&>(function_1) :
-                    static_cast<const Function<dim>&>(function_2));
-      
+      function = (i==0 ?
+                  static_cast<const Function<dim>&>(function_1) :
+                  static_cast<const Function<dim>&>(function_2));
+
       Vector<double> v (dof.n_dofs());
       VectorTools::interpolate (dof, function, v);
 
-                                       // for the following points, check the
-                                       // function value, output it, and
-                                       // verify that the value retrieved from
-                                       // the interpolated function is close
-                                       // enough to that of the real function
-                                       //
-                                       // also verify that the actual value is
-                                       // roughly correct
+      // for the following points, check the
+      // function value, output it, and
+      // verify that the value retrieved from
+      // the interpolated function is close
+      // enough to that of the real function
+      //
+      // also verify that the actual value is
+      // roughly correct
       Point<dim> p[3];
       for (unsigned int d=0; d<dim; ++d)
         {
@@ -156,9 +164,9 @@ check ()
           deallog << difference(0) << std::endl;
           Assert (std::abs(-difference(0) - function.value(p[i])) < 1e-4,
                   ExcInternalError());
-        }  
+        }
     }
-  
+
   deallog << "OK" << std::endl;
 }
 
index b4191d027854d3c64d0530cb54f0afb636a14748..5ebf1882ec79619f82e2a63b8e13b71dbbc1b188 100644 (file)
@@ -35,35 +35,36 @@ template <int dim>
 void check ()
 {
   Triangulation<dim> triangulation;
-  
+
   GridGenerator::hyper_cube (triangulation);
-  
-                                  // Now get the cell
+
+  // Now get the cell
   const typename Triangulation<dim>::cell_iterator
-    cell = triangulation.begin();
-    
+  cell = triangulation.begin();
+
   double testcoord[11][3] = {{0.5,0.5,0.5},
-                            {2,0.5,0.5},
-                            {0.5,2,0.5},
-                            {0.5,0.5,2},
-                            {-2,0.5,0.5},
-                            {0.5,-2,0.5},
-                            {0.5,0.5,-2},
-                            {0.9,0.9,0.9},
-                            {1.0,0.5,0.5},
-                            {0.9999999,0.5,0.5},
-                            {1.0000001,0.5,0.5}  };
-    
+    {2,0.5,0.5},
+    {0.5,2,0.5},
+    {0.5,0.5,2},
+    {-2,0.5,0.5},
+    {0.5,-2,0.5},
+    {0.5,0.5,-2},
+    {0.9,0.9,0.9},
+    {1.0,0.5,0.5},
+    {0.9999999,0.5,0.5},
+    {1.0000001,0.5,0.5}
+  };
+
   const bool expected2d[] = {1,0,0,1,0,0,1,1,1,1,0};
   const bool expected3d[] = {1,0,0,0,0,0,0,1,1,1,0};
-  const bool *expected=dim==2 ? expected2d : expected3d;    
+  const bool *expected=dim==2 ? expected2d : expected3d;
   for (int i=0; i<11; i++)
     {
       Point<dim> testpoint;
       testpoint(0)=testcoord[i][0];
       testpoint(1)=testcoord[i][1];
       if (dim==3)
-       testpoint(2)=testcoord[i][2];
+        testpoint(2)=testcoord[i][2];
 
       bool res = cell->point_inside(testpoint);
       deallog << testpoint << " inside " << res <<std::endl;
@@ -72,7 +73,7 @@ void check ()
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("point_inside_1/output");
   deallog.attach(logfile);
index 15d35fd9bfabe50cc6605999cff2e20aa7c30921..12d77db6057e8b05f66c2730b7ed89a9c5d5bd7a 100644 (file)
 template <int dim>
 void check ()
 {
-                                  // use a rather complicated way to
-                                  // generate a new mesh with one
-                                  // moved vertex -- one could move
-                                  // it by hand in the original
-                                  // triangulation, but this is how
-                                  // the original testcase came in,
-                                  // and it tests some more stuff, so
-                                  // why change things
+  // use a rather complicated way to
+  // generate a new mesh with one
+  // moved vertex -- one could move
+  // it by hand in the original
+  // triangulation, but this is how
+  // the original testcase came in,
+  // and it tests some more stuff, so
+  // why change things
   Triangulation<dim> triangulation;
-  
-                                  // we generate a hyper_cube and
-                                  // modify one vertex.
+
+  // we generate a hyper_cube and
+  // modify one vertex.
   GridGenerator::hyper_cube (triangulation);
-  
-                                  // Now get the cell
+
+  // Now get the cell
   const typename Triangulation<dim>::cell_iterator
-    cell = triangulation.begin();
+  cell = triangulation.begin();
   cell->vertex(0)(0)=-1.;
-                                      
-                                  // and test it.
+
+  // and test it.
   double testcoord[14][3] = {{0.5,0.5,0.5},
-                            {2,0.5,0.5},
-                            {0.5,2,0.5},
-                            {0.5,0.5,2},
-                            {-2,0.5,0.5},
-                            {0.5,-2,0.5},
-                            {0.5,0.5,-2},
-                            {0.9,0.9,0.9},
-                            {1.0,0.5,0.5},
-                            {0.9999999,0.5,0.5},
-                            {1.0000001,0.5,0.5},
-                            {-0.1,0.1,0.1},
-                            {-0.24,0.5,0.5},
-                            {-0.26,0.5,0.5}
-                            };
-    
+    {2,0.5,0.5},
+    {0.5,2,0.5},
+    {0.5,0.5,2},
+    {-2,0.5,0.5},
+    {0.5,-2,0.5},
+    {0.5,0.5,-2},
+    {0.9,0.9,0.9},
+    {1.0,0.5,0.5},
+    {0.9999999,0.5,0.5},
+    {1.0000001,0.5,0.5},
+    {-0.1,0.1,0.1},
+    {-0.24,0.5,0.5},
+    {-0.26,0.5,0.5}
+  };
+
   const bool expected2d[] = {1,0,0,1,0,0,1,1,1,1,0,1,1,1};
   const bool expected3d[] = {1,0,0,0,0,0,0,1,1,1,0,1,1,0};
   const bool *expected=dim==2 ? expected2d : expected3d;
@@ -79,17 +79,17 @@ void check ()
       testpoint(0)=testcoord[i][0];
       testpoint(1)=testcoord[i][1];
       if (dim==3)
-       testpoint(2)=testcoord[i][2];
+        testpoint(2)=testcoord[i][2];
 
       bool res = cell->point_inside(testpoint);
-      deallog << testpoint << "  \t inside " << res 
-             << " expected " << expected[i] << std::endl;
+      deallog << testpoint << "  \t inside " << res
+              << " expected " << expected[i] << std::endl;
       Assert (res == expected[i], ExcInternalError());
-    }    
+    }
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("point_inside_2/output");
   deallog.attach(logfile);
index e48dd34357471231ef4007e1c68d14a7bdef0267..a529122c4ed52c816200709b6e8a4405b7f1222e 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim> () {}
-
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square()+1; }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { values(0) = value(p,0); }
+public:
+  MySquareFunction () : Function<dim> () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square()+1;
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+  }
 };
 
 
 template<int dim>
 class MyExpFunction : public Function<dim>
 {
-  public:
-    MyExpFunction () : Function<dim> () {}
-
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return std::exp (p(0)); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { values(0) = value(p,0); }
+public:
+  MyExpFunction () : Function<dim> () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return std::exp (p(0));
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+  }
 };
 
 
@@ -73,18 +81,18 @@ class MyExpFunction : public Function<dim>
 template <int dim>
 void make_mesh (Triangulation<dim> &tria)
 {
-  
+
   GridGenerator::hyper_cube(tria, -1, 1);
 
-                                   // refine the mesh in a random way so as to
-                                   // generate as many cells with
-                                   // hanging nodes as possible
+  // refine the mesh in a random way so as to
+  // generate as many cells with
+  // hanging nodes as possible
   tria.refine_global (4-dim);
   const double steps[4] = { /*d=0*/ 0, 7, 3, 3 };
   for (unsigned int i=0; i<steps[dim]; ++i)
     {
       typename Triangulation<dim>::active_cell_iterator
-        cell = tria.begin_active();
+      cell = tria.begin_active();
       for (unsigned int index=0; cell != tria.end(); ++cell, ++index)
         if (index % (3*dim) == 0)
           cell->set_refine_flag();
@@ -101,36 +109,36 @@ check ()
 {
   Triangulation<dim> tria;
   make_mesh (tria);
-  
+
   FE_Q<dim> element(3);
   DoFHandler<dim> dof(tria);
   dof.distribute_dofs(element);
 
-                                   // test with two different functions: one
-                                   // that is exactly representable on the
-                                   // chosen finite element space, and one
-                                   // that isn't
+  // test with two different functions: one
+  // that is exactly representable on the
+  // chosen finite element space, and one
+  // that isn't
   for (unsigned int i=0; i<2; ++i)
     {
       static const MySquareFunction<dim>          function_1;
       static const Functions::CosineFunction<dim> function_2;
 
       const Function<dim> &
-        function = (i==0 ?
-                    static_cast<const Function<dim>&>(function_1) :
-                    static_cast<const Function<dim>&>(function_2));
-      
+      function = (i==0 ?
+                  static_cast<const Function<dim>&>(function_1) :
+                  static_cast<const Function<dim>&>(function_2));
+
       Vector<double> v (dof.n_dofs());
       VectorTools::interpolate (dof, function, v);
 
-                                       // for the following points, check the
-                                       // function value, output it, and
-                                       // verify that the value retrieved from
-                                       // the interpolated function is close
-                                       // enough to that of the real function
-                                       //
-                                       // also verify that the actual value is
-                                       // roughly correct
+      // for the following points, check the
+      // function value, output it, and
+      // verify that the value retrieved from
+      // the interpolated function is close
+      // enough to that of the real function
+      //
+      // also verify that the actual value is
+      // roughly correct
       Point<dim> p[3];
       for (unsigned int d=0; d<dim; ++d)
         {
@@ -147,12 +155,12 @@ check ()
           Assert (std::abs(value(0) - function.value(p[i])) < 1e-4,
                   ExcInternalError());
 
-         const double scalar_value = VectorTools::point_value (dof, v, p[i]);
+          const double scalar_value = VectorTools::point_value (dof, v, p[i]);
           Assert (std::abs(value(0) - scalar_value) < 1e-4,
                   ExcInternalError());
-        }  
+        }
     }
-  
+
   deallog << "OK" << std::endl;
 }
 
index d1db74f6b78cd7c54c0011b175fa61d9c3545625..0c7b734d77149bc83382ab08a3bd936bccc331d9 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim> () {}
-
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square()+1; }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { values(0) = value(p,0); }
+public:
+  MySquareFunction () : Function<dim> () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square()+1;
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+  }
 };
 
 
 template<int dim>
 class MyExpFunction : public Function<dim>
 {
-  public:
-    MyExpFunction () : Function<dim> () {}
-
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return std::exp (p(0)); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { values(0) = value(p,0); }
+public:
+  MyExpFunction () : Function<dim> () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return std::exp (p(0));
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+  }
 };
 
 
@@ -74,18 +82,18 @@ class MyExpFunction : public Function<dim>
 template <int dim>
 void make_mesh (Triangulation<dim> &tria)
 {
-  
+
   GridGenerator::hyper_cube(tria, -1, 1);
 
-                                   // refine the mesh in a random way so as to
-                                   // generate as many cells with
-                                   // hanging nodes as possible
+  // refine the mesh in a random way so as to
+  // generate as many cells with
+  // hanging nodes as possible
   tria.refine_global (4-dim);
   const double steps[4] = { /*d=0*/ 0, 7, 3, 3 };
   for (unsigned int i=0; i<steps[dim]; ++i)
     {
       typename Triangulation<dim>::active_cell_iterator
-        cell = tria.begin_active();
+      cell = tria.begin_active();
       for (unsigned int index=0; cell != tria.end(); ++cell, ++index)
         if (index % (3*dim) == 0)
           cell->set_refine_flag();
@@ -102,37 +110,37 @@ check ()
 {
   Triangulation<dim> tria;
   make_mesh (tria);
-  
+
   FE_Q<dim> element(3);
   DoFHandler<dim> dof(tria);
   MappingQ1<dim> mapping;
   dof.distribute_dofs(element);
 
-                                   // test with two different functions: one
-                                   // that is exactly representable on the
-                                   // chosen finite element space, and one
-                                   // that isn't
+  // test with two different functions: one
+  // that is exactly representable on the
+  // chosen finite element space, and one
+  // that isn't
   for (unsigned int i=0; i<2; ++i)
     {
       static const MySquareFunction<dim>          function_1;
       static const Functions::CosineFunction<dim> function_2;
 
       const Function<dim> &
-        function = (i==0 ?
-                    static_cast<const Function<dim>&>(function_1) :
-                    static_cast<const Function<dim>&>(function_2));
-      
+      function = (i==0 ?
+                  static_cast<const Function<dim>&>(function_1) :
+                  static_cast<const Function<dim>&>(function_2));
+
       Vector<double> v (dof.n_dofs());
       VectorTools::interpolate (dof, function, v);
 
-                                       // for the following points, check the
-                                       // function value, output it, and
-                                       // verify that the value retrieved from
-                                       // the interpolated function is close
-                                       // enough to that of the real function
-                                       //
-                                       // also verify that the actual value is
-                                       // roughly correct
+      // for the following points, check the
+      // function value, output it, and
+      // verify that the value retrieved from
+      // the interpolated function is close
+      // enough to that of the real function
+      //
+      // also verify that the actual value is
+      // roughly correct
       Point<dim> p[3];
       for (unsigned int d=0; d<dim; ++d)
         {
@@ -149,12 +157,12 @@ check ()
           Assert (std::abs(value(0) - function.value(p[i])) < 1e-4,
                   ExcInternalError());
 
-         const double scalar_value = VectorTools::point_value (mapping, dof, v, p[i]);
+          const double scalar_value = VectorTools::point_value (mapping, dof, v, p[i]);
           Assert (std::abs(value(0) - scalar_value) < 1e-4,
                   ExcInternalError());
-        }  
+        }
     }
-  
+
   deallog << "OK" << std::endl;
 }
 
index c10e91c276969de301104029bb5229bca41a7378..98ab58543307b2b62134182330e8b356994cce5e 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim> () {}
-
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square()+1; }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { values(0) = value(p,0); }
+public:
+  MySquareFunction () : Function<dim> () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square()+1;
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+  }
 };
 
 
 template<int dim>
 class MyExpFunction : public Function<dim>
 {
-  public:
-    MyExpFunction () : Function<dim> () {}
-
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return std::exp (p(0)); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { values(0) = value(p,0); }
+public:
+  MyExpFunction () : Function<dim> () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return std::exp (p(0));
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+  }
 };
 
 
@@ -74,18 +82,18 @@ class MyExpFunction : public Function<dim>
 template <int dim>
 void make_mesh (Triangulation<dim> &tria)
 {
-  
+
   GridGenerator::hyper_cube(tria, -1, 1);
 
-                                   // refine the mesh in a random way so as to
-                                   // generate as many cells with
-                                   // hanging nodes as possible
+  // refine the mesh in a random way so as to
+  // generate as many cells with
+  // hanging nodes as possible
   tria.refine_global (4-dim);
   const double steps[4] = { /*d=0*/ 0, 7, 3, 3 };
   for (unsigned int i=0; i<steps[dim]; ++i)
     {
       typename Triangulation<dim>::active_cell_iterator
-        cell = tria.begin_active();
+      cell = tria.begin_active();
       for (unsigned int index=0; cell != tria.end(); ++cell, ++index)
         if (index % (3*dim) == 0)
           cell->set_refine_flag();
@@ -102,7 +110,7 @@ check ()
 {
   Triangulation<dim> tria;
   make_mesh (tria);
-  
+
   hp::FECollection<dim> fe;
   fe.push_back (FE_Q<dim>(3));
   fe.push_back (FE_Q<dim>(4));
@@ -111,8 +119,8 @@ check ()
   hp::DoFHandler<dim> dof_handler (tria);
 
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       cell->set_active_fe_index (std::rand() % fe.size());
@@ -120,31 +128,31 @@ check ()
 
   dof_handler.distribute_dofs (fe);
 
-                                   // test with two different functions: one
-                                   // that is exactly representable on the
-                                   // chosen finite element space, and one
-                                   // that isn't
+  // test with two different functions: one
+  // that is exactly representable on the
+  // chosen finite element space, and one
+  // that isn't
   for (unsigned int i=0; i<2; ++i)
     {
       static const MySquareFunction<dim>          function_1;
       static const Functions::CosineFunction<dim> function_2;
 
       const Function<dim> &
-        function = (i==0 ?
-                    static_cast<const Function<dim>&>(function_1) :
-                    static_cast<const Function<dim>&>(function_2));
-      
+      function = (i==0 ?
+                  static_cast<const Function<dim>&>(function_1) :
+                  static_cast<const Function<dim>&>(function_2));
+
       Vector<double> v (dof_handler.n_dofs());
       VectorTools::interpolate (dof_handler, function, v);
 
-                                       // for the following points, check the
-                                       // function value, output it, and
-                                       // verify that the value retrieved from
-                                       // the interpolated function is close
-                                       // enough to that of the real function
-                                       //
-                                       // also verify that the actual value is
-                                       // roughly correct
+      // for the following points, check the
+      // function value, output it, and
+      // verify that the value retrieved from
+      // the interpolated function is close
+      // enough to that of the real function
+      //
+      // also verify that the actual value is
+      // roughly correct
       Point<dim> p[3];
       for (unsigned int d=0; d<dim; ++d)
         {
@@ -161,12 +169,12 @@ check ()
           Assert (std::abs(value(0) - function.value(p[i])) < 1e-4,
                   ExcInternalError());
 
-         const double scalar_value = VectorTools::point_value (dof_handler, v, p[i]);
+          const double scalar_value = VectorTools::point_value (dof_handler, v, p[i]);
           Assert (std::abs(value(0) - scalar_value) < 1e-4,
                   ExcInternalError());
-        }  
+        }
     }
-  
+
   deallog << "OK" << std::endl;
 }
 
index e5dd56a9d396fe00e917ae16629529b14302e99a..942c2adea4858260f37af6bb07c33fa9c17894d7 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim> () {}
-
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square()+1; }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { values(0) = value(p,0); }
+public:
+  MySquareFunction () : Function<dim> () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square()+1;
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+  }
 };
 
 
 template<int dim>
 class MyExpFunction : public Function<dim>
 {
-  public:
-    MyExpFunction () : Function<dim> () {}
-
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return std::exp (p(0)); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { values(0) = value(p,0); }
+public:
+  MyExpFunction () : Function<dim> () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return std::exp (p(0));
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+  }
 };
 
 
@@ -75,18 +83,18 @@ class MyExpFunction : public Function<dim>
 template <int dim>
 void make_mesh (Triangulation<dim> &tria)
 {
-  
+
   GridGenerator::hyper_cube(tria, -1, 1);
 
-                                   // refine the mesh in a random way so as to
-                                   // generate as many cells with
-                                   // hanging nodes as possible
+  // refine the mesh in a random way so as to
+  // generate as many cells with
+  // hanging nodes as possible
   tria.refine_global (4-dim);
   const double steps[4] = { /*d=0*/ 0, 7, 3, 3 };
   for (unsigned int i=0; i<steps[dim]; ++i)
     {
       typename Triangulation<dim>::active_cell_iterator
-        cell = tria.begin_active();
+      cell = tria.begin_active();
       for (unsigned int index=0; cell != tria.end(); ++cell, ++index)
         if (index % (3*dim) == 0)
           cell->set_refine_flag();
@@ -103,7 +111,7 @@ check ()
 {
   Triangulation<dim> tria;
   make_mesh (tria);
-  
+
   hp::FECollection<dim> fe;
   fe.push_back (FE_Q<dim>(3));
   fe.push_back (FE_Q<dim>(4));
@@ -120,8 +128,8 @@ check ()
   hp::DoFHandler<dim> dof_handler (tria);
 
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       cell->set_active_fe_index (std::rand() % fe.size());
@@ -129,31 +137,31 @@ check ()
 
   dof_handler.distribute_dofs (fe);
 
-                                   // test with two different functions: one
-                                   // that is exactly representable on the
-                                   // chosen finite element space, and one
-                                   // that isn't
+  // test with two different functions: one
+  // that is exactly representable on the
+  // chosen finite element space, and one
+  // that isn't
   for (unsigned int i=0; i<2; ++i)
     {
       static const MySquareFunction<dim>          function_1;
       static const Functions::CosineFunction<dim> function_2;
 
       const Function<dim> &
-        function = (i==0 ?
-                    static_cast<const Function<dim>&>(function_1) :
-                    static_cast<const Function<dim>&>(function_2));
-      
+      function = (i==0 ?
+                  static_cast<const Function<dim>&>(function_1) :
+                  static_cast<const Function<dim>&>(function_2));
+
       Vector<double> v (dof_handler.n_dofs());
       VectorTools::interpolate (dof_handler, function, v);
 
-                                       // for the following points, check the
-                                       // function value, output it, and
-                                       // verify that the value retrieved from
-                                       // the interpolated function is close
-                                       // enough to that of the real function
-                                       //
-                                       // also verify that the actual value is
-                                       // roughly correct
+      // for the following points, check the
+      // function value, output it, and
+      // verify that the value retrieved from
+      // the interpolated function is close
+      // enough to that of the real function
+      //
+      // also verify that the actual value is
+      // roughly correct
       Point<dim> p[3];
       for (unsigned int d=0; d<dim; ++d)
         {
@@ -168,7 +176,7 @@ check ()
           deallog << -value(0) << std::endl;
 
           Assert (std::abs(value(0) - function.value(p[i])) < 1e-4,
-                   ExcInternalError());
+                  ExcInternalError());
           VectorTools::point_value (mapping_2, dof_handler, v, p[i], value);
           deallog << -value(0) << std::endl;
 
@@ -177,14 +185,14 @@ check ()
 
           const double scalar_value_1 = VectorTools::point_value (mapping_1, dof_handler, v, p[i]);
           Assert (std::abs(value(0) - scalar_value_1) < 1e-4,
-              ExcInternalError());
+                  ExcInternalError());
 
           const double scalar_value_2 = VectorTools::point_value (mapping_2, dof_handler, v, p[i]);
           Assert (std::abs(value(0) - scalar_value_2) < 1e-4,
-              ExcInternalError());
-        }  
+                  ExcInternalError());
+        }
     }
-  
+
   deallog << "OK" << std::endl;
 }
 
index a1e5b1b3ec2a2eb55f3981c22cdebac51fa01af5..294faa01c4ad6b229b7186156bfb48a87b932120 100644 (file)
@@ -42,7 +42,7 @@ void check (const Triangulation<dim> &tria)
   dof_handler.distribute_dofs (fe);
 
   QGauss<dim-1> q_face(3);
-  
+
   FEFaceValues<dim>    fe_face_values (fe, q_face,
                                        update_q_points | update_JxW_values);
   FESubfaceValues<dim> fe_subface_values (fe, q_face,
@@ -50,13 +50,13 @@ void check (const Triangulation<dim> &tria)
 
   Point<dim> n1, n2;
   for (typename DoFHandler<dim>::active_cell_iterator
-         cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell!=dof_handler.end(); ++cell)
     {
-                                       // first integrate over faces
-                                       // and make sure that the
-                                       // result of the integration is
-                                       // close to zero
+      // first integrate over faces
+      // and make sure that the
+      // result of the integration is
+      // close to zero
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
         if (cell->at_boundary(f))
           {
@@ -65,9 +65,9 @@ void check (const Triangulation<dim> &tria)
               n1 += fe_face_values.quadrature_point(q) *
                     fe_face_values.JxW(q);
           }
-      
-                                       // now same for subface
-                                       // integration
+
+      // now same for subface
+      // integration
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
         if (cell->at_boundary(f))
           for (unsigned int sf=0; sf<GeometryInfo<dim>::max_children_per_face; ++sf)
@@ -78,7 +78,7 @@ void check (const Triangulation<dim> &tria)
                       fe_subface_values.JxW(q);
             }
     }
-  
+
   Assert (n1*n1 < 1e-24, ExcInternalError());
   deallog << " face integration is ok: "
           << std::sqrt (n1*n1)
@@ -90,39 +90,39 @@ void check (const Triangulation<dim> &tria)
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("q_point_sum_1/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<2> coarse_grid;
     GridGenerator::hyper_cube (coarse_grid, -1, 1);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_cube (coarse_grid, -1, 1);
     check (coarse_grid);
   }
 
-  
-  {  
+
+  {
     Triangulation<2> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     check (coarse_grid);
   }
-  
+
 }
 
-  
-  
+
+
index 186b092f935c20240f2e84bc1f589523b708a0e1..23a588eab8ed9b0abbae81cbf8b7c6886aa6e257 100644 (file)
@@ -50,7 +50,7 @@ void check (const Triangulation<dim> &tria,
   dof_handler.distribute_dofs (fe);
 
   QGauss<dim-1> q_face(3);
-  
+
   FEFaceValues<dim>    fe_face_values (mapping, fe, q_face,
                                        update_q_points | update_JxW_values);
   FESubfaceValues<dim> fe_subface_values (mapping, fe, q_face,
@@ -58,13 +58,13 @@ void check (const Triangulation<dim> &tria,
 
   Point<dim> n1, n2;
   for (typename DoFHandler<dim>::active_cell_iterator
-         cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell!=dof_handler.end(); ++cell)
     {
-                                       // first integrate over faces
-                                       // and make sure that the
-                                       // result of the integration is
-                                       // close to zero
+      // first integrate over faces
+      // and make sure that the
+      // result of the integration is
+      // close to zero
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
         if (cell->at_boundary(f))
           {
@@ -73,9 +73,9 @@ void check (const Triangulation<dim> &tria,
               n1 += fe_face_values.quadrature_point(q) *
                     fe_face_values.JxW(q);
           }
-      
-                                       // now same for subface
-                                       // integration
+
+      // now same for subface
+      // integration
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
         if (cell->at_boundary(f))
           for (unsigned int sf=0; sf<GeometryInfo<dim>::max_children_per_face; ++sf)
@@ -86,7 +86,7 @@ void check (const Triangulation<dim> &tria,
                       fe_subface_values.JxW(q);
             }
     }
-  
+
   Assert (n1*n1 < 1e-24, ExcInternalError());
   deallog << " face integration is ok: "
           << std::sqrt (n1*n1)
@@ -98,22 +98,22 @@ void check (const Triangulation<dim> &tria,
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("q_point_sum_2/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<2> coarse_grid;
     GridGenerator::hyper_cube (coarse_grid, -1, 1);
     check (coarse_grid, 1);
     check (coarse_grid, 2);
     check (coarse_grid, 4);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_cube (coarse_grid, -1, 1);
     check (coarse_grid, 1);
@@ -121,8 +121,8 @@ int main ()
     check (coarse_grid, 3);
   }
 
-  
-  {  
+
+  {
     Triangulation<2> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     static const HyperBallBoundary<2> boundary;
@@ -131,8 +131,8 @@ int main ()
     check (coarse_grid, 2);
     check (coarse_grid, 4);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     static const HyperBallBoundary<3> boundary;
@@ -141,8 +141,8 @@ int main ()
     check (coarse_grid, 2);
     check (coarse_grid, 3);
   }
-  
+
 }
 
-  
-  
+
+
index 32cb93baaf7715adedcfc0f04d6e14ca5d16405c..8cb1071a9f954638355d7d42b2155e5f082660a3 100644 (file)
@@ -49,7 +49,7 @@ void check (const Triangulation<dim> &tria)
   dof_handler.distribute_dofs (fe);
 
   QGauss<dim-1> q_face(3);
-  
+
   FEFaceValues<dim>    fe_face_values (mapping, fe, q_face,
                                        update_q_points | update_JxW_values);
   FESubfaceValues<dim> fe_subface_values (mapping, fe, q_face,
@@ -57,13 +57,13 @@ void check (const Triangulation<dim> &tria)
 
   Point<dim> n1, n2;
   for (typename DoFHandler<dim>::active_cell_iterator
-         cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell!=dof_handler.end(); ++cell)
     {
-                                       // first integrate over faces
-                                       // and make sure that the
-                                       // result of the integration is
-                                       // close to zero
+      // first integrate over faces
+      // and make sure that the
+      // result of the integration is
+      // close to zero
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
         if (cell->at_boundary(f))
           {
@@ -72,9 +72,9 @@ void check (const Triangulation<dim> &tria)
               n1 += fe_face_values.quadrature_point(q) *
                     fe_face_values.JxW(q);
           }
-      
-                                       // now same for subface
-                                       // integration
+
+      // now same for subface
+      // integration
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
         if (cell->at_boundary(f))
           for (unsigned int sf=0; sf<GeometryInfo<dim>::max_children_per_face; ++sf)
@@ -85,7 +85,7 @@ void check (const Triangulation<dim> &tria)
                       fe_subface_values.JxW(q);
             }
     }
-  
+
   Assert (n1*n1 < 1e-24, ExcInternalError());
   deallog << " face integration is ok: "
           << std::sqrt (n1*n1)
@@ -97,29 +97,29 @@ void check (const Triangulation<dim> &tria)
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("q_point_sum_3/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<2> coarse_grid;
     GridGenerator::hyper_cube (coarse_grid, -1, 1);
     check (coarse_grid);
   }
-  
-                                   // the C1 mapping is not fully
-                                   // implemented in 3d, unfortunately  
-//   {  
+
+  // the C1 mapping is not fully
+  // implemented in 3d, unfortunately
+//   {
 //     Triangulation<3> coarse_grid;
 //     GridGenerator::hyper_cube (coarse_grid, -1, 1);
 //     check (coarse_grid);
 //   }
 
-  
-  {  
+
+  {
     Triangulation<2> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     static const HyperBallBoundary<2> boundary;
@@ -127,17 +127,17 @@ int main ()
     check (coarse_grid);
   }
 
-                                   // the C1 mapping is not fully
-                                   // implemented in 3d, unfortunately  
-//   {  
+  // the C1 mapping is not fully
+  // implemented in 3d, unfortunately
+//   {
 //     Triangulation<3> coarse_grid;
 //     GridGenerator::hyper_ball (coarse_grid);
 //     static const HyperBallBoundary<3> boundary;
 //     coarse_grid.set_boundary (0, boundary);
 //     check (coarse_grid);
 //   }
-  
+
 }
 
-  
-  
+
+
index 6d3aa8d7aabd256c4951f5ca314ec17692dbb398..4968743b6a27c3534b572bb258e398441c585d86 100644 (file)
@@ -49,7 +49,7 @@ void check (const Triangulation<dim> &tria)
   dof_handler.distribute_dofs (fe);
 
   QGauss<dim-1> q_face(3);
-  
+
   FEFaceValues<dim>    fe_face_values (mapping, fe, q_face,
                                        update_q_points | update_JxW_values);
   FESubfaceValues<dim> fe_subface_values (mapping, fe, q_face,
@@ -57,13 +57,13 @@ void check (const Triangulation<dim> &tria)
 
   Point<dim> n1, n2;
   for (typename DoFHandler<dim>::active_cell_iterator
-         cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell!=dof_handler.end(); ++cell)
     {
-                                       // first integrate over faces
-                                       // and make sure that the
-                                       // result of the integration is
-                                       // close to zero
+      // first integrate over faces
+      // and make sure that the
+      // result of the integration is
+      // close to zero
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
         if (cell->at_boundary(f))
           {
@@ -72,9 +72,9 @@ void check (const Triangulation<dim> &tria)
               n1 += fe_face_values.quadrature_point(q) *
                     fe_face_values.JxW(q);
           }
-      
-                                       // now same for subface
-                                       // integration
+
+      // now same for subface
+      // integration
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
         if (cell->at_boundary(f))
           for (unsigned int sf=0; sf<GeometryInfo<dim>::max_children_per_face; ++sf)
@@ -85,7 +85,7 @@ void check (const Triangulation<dim> &tria)
                       fe_subface_values.JxW(q);
             }
     }
-  
+
   Assert (n1*n1 < 1e-24, ExcInternalError());
   deallog << " face integration is ok: "
           << std::sqrt (n1*n1)
@@ -97,25 +97,25 @@ void check (const Triangulation<dim> &tria)
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("q_point_sum_4/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<2> coarse_grid;
     GridGenerator::hyper_cube (coarse_grid, -1, 1);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_cube (coarse_grid, -1, 1);
     check (coarse_grid);
   }
 }
 
-  
-  
+
+
index c3ce9d9778ce532b32ef5ef8debaa38d31c8e611..c460e162c18bce2a90009a2b421bb35b430901ac 100644 (file)
@@ -44,7 +44,8 @@ void create_two_cubes (Triangulation<3> &coarse_grid)
                                Point<3>(1,1,0),
                                Point<3>(0,1,0),
                                Point<3>(2,0,0),
-                               Point<3>(2,1,0)};
+                               Point<3>(2,1,0)
+                             };
   std::vector<Point<3> > vertices;
   for (unsigned int i=0; i<6; ++i)
     vertices.push_back (points[i]);
@@ -52,10 +53,11 @@ void create_two_cubes (Triangulation<3> &coarse_grid)
     vertices.push_back (points[i] + Point<3>(0,0,-1));
 
   std::vector<CellData<3> > cells;
-    
+
   const unsigned int connectivity[2][4]
-    = { { 0,1,2,3 },
-        { 1,4,5,2 } };
+  = { { 0,1,2,3 },
+    { 1,4,5,2 }
+  };
   for (unsigned int i=0; i<2; ++i)
     {
       CellData<3> cell;
@@ -67,8 +69,8 @@ void create_two_cubes (Triangulation<3> &coarse_grid)
       cells.push_back (cell);
     }
 
-                                   // finally generate a triangulation
-                                   // out of this
+  // finally generate a triangulation
+  // out of this
   GridReordering<3>::reorder_cells (cells);
   coarse_grid.create_triangulation_compatibility (vertices, cells, SubCellData());
 }
@@ -82,7 +84,7 @@ void check (Triangulation<3> &tria)
                                    update_q_points | update_JxW_values);
   FEFaceValues<3> fe_face_values2 (fe, quadrature,
                                    update_q_points | update_JxW_values);
-  
+
   DoFHandler<3> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
 
@@ -94,15 +96,15 @@ void check (Triangulation<3> &tria)
           const unsigned int nn
             = cell->neighbor_of_neighbor (f);
 
-                                           // this test is about
-                                           // properly oriented
-                                           // faces. mesh_3d_7 does it
-                                           // for mis-oriented faces
+          // this test is about
+          // properly oriented
+          // faces. mesh_3d_7 does it
+          // for mis-oriented faces
           Assert (cell->face_orientation(f) == true,
                   ExcInternalError());
           Assert (cell->neighbor(f)->face_orientation(nn) == true,
                   ExcInternalError());
-          
+
           fe_face_values1.reinit (cell, f);
           fe_face_values2.reinit (cell->neighbor(f), nn);
 
@@ -122,7 +124,7 @@ void check (Triangulation<3> &tria)
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("q_points/output");
   deallog.attach(logfile);
@@ -134,8 +136,8 @@ int main ()
   check (coarse_grid);
 
   coarse_grid.refine_global (1);
-  check (coarse_grid);  
+  check (coarse_grid);
 }
 
-  
-  
+
+
index dd1c9089ff2cae0c00735fa74760fcc776cf798c..a1ab72d81c178be710f7ef646511e32891a115fd 100644 (file)
@@ -44,7 +44,7 @@ void check ()
   tria.begin_active()->set_refine_flag();
   tria.execute_coarsening_and_refinement ();
 
-                                  // store which cells we have here
+  // store which cells we have here
   std::vector<typename Triangulation<dim>::active_cell_iterator> cells;
   for (typename Triangulation<dim>::active_cell_iterator cell=tria.begin_active();
        cell != tria.end(); ++cell)
@@ -53,8 +53,8 @@ void check ()
   const unsigned int n_cells = tria.n_active_cells();
   deallog << n_cells << std::endl;
 
-                                  // refine the mesh globally, then coarsen
-                                  // it again globally
+  // refine the mesh globally, then coarsen
+  // it again globally
   tria.refine_global (1);
 
   for (typename Triangulation<dim>::active_cell_iterator cell=tria.begin_active();
@@ -63,23 +63,23 @@ void check ()
   tria.execute_coarsening_and_refinement ();
 
 
-                                  // verify that we get the same cells again
+  // verify that we get the same cells again
   deallog << n_cells << ' ' << tria.n_active_cells()
-         << std::endl;
-  
+          << std::endl;
+
   Assert (tria.n_active_cells() == n_cells,
-         ExcInternalError());
+          ExcInternalError());
 
   unsigned int index = 0;
   for (typename Triangulation<dim>::active_cell_iterator cell=tria.begin_active();
        cell != tria.end(); ++cell, ++index)
     Assert (cells[index] == cell,
-           ExcInternalError());
+            ExcInternalError());
 
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("refine_and_coarsen_1d/output");
   deallog.attach(logfile);
@@ -89,5 +89,5 @@ int main ()
   check<1> ();
 }
 
-  
-  
+
+
index ff1bf676362bf39cc9fd4bb8bd22687bfb5ae53e..ba5d94da4f94abfe7f4f2b82ee8ee0da7e945ea1 100644 (file)
@@ -44,7 +44,7 @@ void check ()
   tria.begin_active()->set_refine_flag();
   tria.execute_coarsening_and_refinement ();
 
-                                  // store which cells we have here
+  // store which cells we have here
   std::vector<typename Triangulation<dim>::active_cell_iterator> cells;
   for (typename Triangulation<dim>::active_cell_iterator cell=tria.begin_active();
        cell != tria.end(); ++cell)
@@ -53,8 +53,8 @@ void check ()
   const unsigned int n_cells = tria.n_active_cells();
   deallog << n_cells << std::endl;
 
-                                  // refine the mesh globally, then coarsen
-                                  // it again globally
+  // refine the mesh globally, then coarsen
+  // it again globally
   tria.refine_global (1);
 
   for (typename Triangulation<dim>::active_cell_iterator cell=tria.begin_active();
@@ -63,23 +63,23 @@ void check ()
   tria.execute_coarsening_and_refinement ();
 
 
-                                  // verify that we get the same cells again
+  // verify that we get the same cells again
   deallog << n_cells << ' ' << tria.n_active_cells()
-         << std::endl;
-  
+          << std::endl;
+
   Assert (tria.n_active_cells() == n_cells,
-         ExcInternalError());
+          ExcInternalError());
 
   unsigned int index = 0;
   for (typename Triangulation<dim>::active_cell_iterator cell=tria.begin_active();
        cell != tria.end(); ++cell, ++index)
     Assert (cells[index] == cell,
-           ExcInternalError());
+            ExcInternalError());
 
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("refine_and_coarsen_2d/output");
   deallog.attach(logfile);
@@ -89,5 +89,5 @@ int main ()
   check<2> ();
 }
 
-  
-  
+
+
index c2d34194d584f7c3f2d36f6b7f5c7365cbb51171..01ed970ddc655893e57dfeb291e29efa8e4e4ece 100644 (file)
@@ -46,7 +46,7 @@ void check ()
   tria.begin_active()->set_refine_flag();
   tria.execute_coarsening_and_refinement ();
 
-                                  // store which cells we have here
+  // store which cells we have here
   std::vector<typename Triangulation<dim>::active_cell_iterator> cells;
   for (typename Triangulation<dim>::active_cell_iterator cell=tria.begin_active();
        cell != tria.end(); ++cell)
@@ -55,8 +55,8 @@ void check ()
   const unsigned int n_cells = tria.n_active_cells();
   deallog << n_cells << std::endl;
 
-                                  // refine the mesh globally, then coarsen
-                                  // it again globally
+  // refine the mesh globally, then coarsen
+  // it again globally
   tria.refine_global (1);
 
   for (typename Triangulation<dim>::active_cell_iterator cell=tria.begin_active();
@@ -65,23 +65,23 @@ void check ()
   tria.execute_coarsening_and_refinement ();
 
 
-                                  // verify that we get the same cells again
+  // verify that we get the same cells again
   deallog << n_cells << ' ' << tria.n_active_cells()
-         << std::endl;
-  
+          << std::endl;
+
   Assert (tria.n_active_cells() == n_cells,
-         ExcInternalError());
+          ExcInternalError());
 
   unsigned int index = 0;
   for (typename Triangulation<dim>::active_cell_iterator cell=tria.begin_active();
        cell != tria.end(); ++cell, ++index)
     Assert (cells[index] == cell,
-           ExcInternalError());
+            ExcInternalError());
 
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("refine_and_coarsen_3d/output");
   deallog.attach(logfile);
@@ -91,5 +91,5 @@ int main ()
   check<3> ();
 }
 
-  
-  
+
+
index 06bb44e22e357d75a6e419b8c09d7306917990d3..c01f5483c620a59c0d74983503b4fd916c3fffe4 100644 (file)
@@ -35,7 +35,7 @@
 void do_refine (Triangulation<1> &tria)
 {
   const int dim = 1;
-  
+
   tria.refine_global (2);
   tria.begin_active()->set_refine_flag();
   tria.execute_coarsening_and_refinement ();
@@ -45,7 +45,7 @@ void do_refine (Triangulation<1> &tria)
 void do_refine (Triangulation<2> &tria)
 {
   const int dim = 2;
-  
+
   tria.refine_global (2);
   tria.begin_active()->set_refine_flag();
   tria.execute_coarsening_and_refinement ();
@@ -59,7 +59,7 @@ void do_refine (Triangulation<2> &tria)
 void do_refine (Triangulation<3> &tria)
 {
   const int dim = 3;
-  
+
   tria.refine_global (2);
   tria.begin_active()->set_refine_flag();
   tria.execute_coarsening_and_refinement ();
@@ -84,9 +84,9 @@ void check ()
   Triangulation<dim> tria;
   GridGenerator::hyper_cube (tria);
   do_refine (tria);
-                                  // refine the mesh globally and
-                                  // verify that the parent relation
-                                  // holds
+  // refine the mesh globally and
+  // verify that the parent relation
+  // holds
   tria.refine_global (1);
 
   for (typename Triangulation<dim>::cell_iterator cell = tria.begin();
@@ -94,27 +94,27 @@ void check ()
     for (unsigned int child = 0; child < cell->n_children (); ++child)
       Assert (cell->child (child)->parent () == cell,
               ExcInternalError ());
-  
-                                  // coarsen the mesh globally and
-                                  // verify that the parent relation
-                                  // holds
+
+  // coarsen the mesh globally and
+  // verify that the parent relation
+  // holds
   for (typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active ();
        cell != tria.end (); ++cell)
     cell->set_coarsen_flag ();
-  
+
   tria.execute_coarsening_and_refinement ();
-  
+
   for (typename Triangulation<dim>::cell_iterator cell = tria.begin ();
        cell != tria.end(); ++cell)
     for (unsigned int child = 0; child < cell->n_children (); ++child)
       Assert (cell->child (child)->parent () == cell,
-                 ExcInternalError());
-  
+              ExcInternalError());
+
   deallog << "OK for " << dim << "d" << std::endl;
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("refine_and_coarsen_for_parents/output");
   deallog.attach(logfile);
@@ -126,5 +126,5 @@ int main ()
   check<3> ();
 }
 
-  
-  
+
+
index 37afabd676208c26b828fbb9618488024322ebef..7c5ceacf400ed5b15a6a29bff5a9d8ba65a98eaf 100644 (file)
@@ -44,7 +44,7 @@ void do_refine (Triangulation<1> &tria)
 void do_refine (Triangulation<2> &tria)
 {
   const int dim = 2;
-  
+
   tria.refine_global (2);
   tria.begin_active()->set_refine_flag();
   tria.execute_coarsening_and_refinement ();
@@ -58,7 +58,7 @@ void do_refine (Triangulation<2> &tria)
 void do_refine (Triangulation<3> &tria)
 {
   const int dim = 3;
-  
+
   tria.refine_global (2);
   tria.begin_active()->set_refine_flag();
   tria.execute_coarsening_and_refinement ();
@@ -83,11 +83,11 @@ void check ()
   Triangulation<dim> tria;
   GridGenerator::hyper_cube (tria);
   do_refine (tria);
-                                  // refine the mesh globally and
-                                  // verify that the parent relation
-                                  // holds
+  // refine the mesh globally and
+  // verify that the parent relation
+  // holds
   tria.refine_global (1);
-  
+
   DoFHandler<dim> dof_handler (tria);
 
   for (typename DoFHandler<dim>::cell_iterator cell = dof_handler.begin();
@@ -95,27 +95,27 @@ void check ()
     for (unsigned int child = 0; child < cell->n_children (); ++child)
       Assert (cell->child (child)->parent () == cell,
               ExcInternalError ());
-  
-                                  // coarsen the mesh globally and
-                                  // verify that the parent relation
-                                  // holds
+
+  // coarsen the mesh globally and
+  // verify that the parent relation
+  // holds
   for (typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active ();
        cell != tria.end (); ++cell)
     cell->set_coarsen_flag ();
-  
+
   tria.execute_coarsening_and_refinement ();
-  
+
   for (typename DoFHandler<dim>::cell_iterator cell = dof_handler.begin ();
        cell != dof_handler.end(); ++cell)
     for (unsigned int child = 0; child < cell->n_children (); ++child)
       Assert (cell->child (child)->parent () == cell,
-                 ExcInternalError());
-  
+              ExcInternalError());
+
   deallog << "OK for " << dim << "d" << std::endl;
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("refine_and_coarsen_for_parents_02/output");
   deallog.attach(logfile);
@@ -127,5 +127,5 @@ int main ()
   check<3> ();
 }
 
-  
-  
+
+
index 51313e31ca3cf71a82c2c0be45e8f95bb506e03d..20efc5ce7e8a371e62be9a44bc5870e8132084ae 100644 (file)
@@ -44,7 +44,7 @@ void do_refine (Triangulation<1> &tria)
 void do_refine (Triangulation<2> &tria)
 {
   const int dim = 2;
-  
+
   tria.refine_global (2);
   tria.begin_active()->set_refine_flag();
   tria.execute_coarsening_and_refinement ();
@@ -58,7 +58,7 @@ void do_refine (Triangulation<2> &tria)
 void do_refine (Triangulation<3> &tria)
 {
   const int dim = 3;
-  
+
   tria.refine_global (2);
   tria.begin_active()->set_refine_flag();
   tria.execute_coarsening_and_refinement ();
@@ -83,11 +83,11 @@ void check ()
   Triangulation<dim> tria;
   GridGenerator::hyper_cube (tria);
   do_refine (tria);
-                                  // refine the mesh globally and
-                                  // verify that the parent relation
-                                  // holds
+  // refine the mesh globally and
+  // verify that the parent relation
+  // holds
   tria.refine_global (1);
-  
+
   MGDoFHandler<dim> dof_handler (tria);
 
   for (typename MGDoFHandler<dim>::cell_iterator cell = dof_handler.begin();
@@ -95,27 +95,27 @@ void check ()
     for (unsigned int child = 0; child < cell->n_children (); ++child)
       Assert (cell->child (child)->parent () == cell,
               ExcInternalError ());
-  
-                                  // coarsen the mesh globally and
-                                  // verify that the parent relation
-                                  // holds
+
+  // coarsen the mesh globally and
+  // verify that the parent relation
+  // holds
   for (typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active ();
        cell != tria.end (); ++cell)
     cell->set_coarsen_flag ();
-  
+
   tria.execute_coarsening_and_refinement ();
-  
+
   for (typename MGDoFHandler<dim>::cell_iterator cell = dof_handler.begin ();
        cell != dof_handler.end(); ++cell)
     for (unsigned int child = 0; child < cell->n_children (); ++child)
       Assert (cell->child (child)->parent () == cell,
-                 ExcInternalError());
-  
+              ExcInternalError());
+
   deallog << "OK for " << dim << "d" << std::endl;
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("refine_and_coarsen_for_parents_03/output");
   deallog.attach(logfile);
@@ -127,5 +127,5 @@ int main ()
   check<3> ();
 }
 
-  
-  
+
+
index b35328a44e1207bc4aaed10f3b7d7a240f1ca3fc..ad6add9c2e685a04888951b7460a7706d30237f2 100644 (file)
@@ -18,7 +18,7 @@
 
 // check has_support_on_face for some elements
 //
-// this program is a modified version of one by Roy Stogner, 
+// this program is a modified version of one by Roy Stogner,
 // University of Texas at Austin
 
 #include "../tests.h"
 
 
 template <int dim>
-void check (const FiniteElement<dim> &fe) {
-    for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
-         face++)
-      for (unsigned int i = 0; i < fe.dofs_per_cell; i++)
-        if (fe.has_support_on_face(i, face))
-          deallog << "Basis function " << i
-                  << " has support on face " << face << std::endl;
+void check (const FiniteElement<dim> &fe)
+{
+  for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
+       face++)
+    for (unsigned int i = 0; i < fe.dofs_per_cell; i++)
+      if (fe.has_support_on_face(i, face))
+        deallog << "Basis function " << i
+                << " has support on face " << face << std::endl;
 }
 
 
 #define check_el(fe) { deallog << #fe << std::endl; check(fe); }
 
 template <int dim>
-void check () 
+void check ()
 {
   deallog << "************ dim = " << dim << std::endl;
   check_el (FE_Q<dim>(1));
@@ -73,7 +74,7 @@ void check ()
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("roy_1/output");
   deallog.attach(logfile);
@@ -82,7 +83,7 @@ int main ()
 
 //  check<1> ();
   check<2> ();
-//  check<3> ();  
-  
+//  check<3> ();
+
   return 0;
 }
index 191b571f1674d7140e34a877901e2bb15895dded..f708940252543c9dd2b2aadfbe221b893b2cdbcb 100644 (file)
@@ -29,7 +29,7 @@
 #include <deal.II/grid/tria_iterator.h>
 #include <deal.II/dofs/dof_accessor.h>
 #include <deal.II/dofs/dof_tools.h>
-#include <deal.II/fe/fe_raviart_thomas.h>      
+#include <deal.II/fe/fe_raviart_thomas.h>
 #include <deal.II/fe/fe_values.h>
 #include <iomanip>
 #include <fstream>
@@ -59,7 +59,7 @@ void test (const unsigned int degree,
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("rt_1/output");
   deallog.attach(logfile);
index a3554c5c24eb9a9568ea7e7a33d0b7cf49ce4bd3..8548d9d8113683a9d8e92eec0c7febbdc72796bf 100644 (file)
 
 
 void evaluate_normal (DoFHandler<2>  &dof_handler,
-                     Vector<double> &solution)
+                      Vector<double> &solution)
 {
-                                  // This quadrature rule determines
-                                  // the points, where the continuity
-                                  // will be tested.
+  // This quadrature rule determines
+  // the points, where the continuity
+  // will be tested.
   QGauss<1> quad (6);
-  FEFaceValues<2> fe_v_face (dof_handler.get_fe (), quad, 
-                            UpdateFlags(update_values    |
-                                        update_q_points  |
-                                        update_gradients |
-                                        update_normal_vectors |
-                                        update_JxW_values));
-
-  FEFaceValues<2> fe_v_face_n (dof_handler.get_fe (), quad, 
-                              UpdateFlags(update_values    |
-                                          update_q_points  |
-                                          update_gradients |
-                                          update_normal_vectors |
-                                          update_JxW_values));
+  FEFaceValues<2> fe_v_face (dof_handler.get_fe (), quad,
+                             UpdateFlags(update_values    |
+                                         update_q_points  |
+                                         update_gradients |
+                                         update_normal_vectors |
+                                         update_JxW_values));
+
+  FEFaceValues<2> fe_v_face_n (dof_handler.get_fe (), quad,
+                               UpdateFlags(update_values    |
+                                           update_q_points  |
+                                           update_gradients |
+                                           update_normal_vectors |
+                                           update_JxW_values));
 
   const unsigned int   n_q_face    = quad.size();
   const unsigned int   n_components   = dof_handler.get_fe().n_components();
 
-                                  // Cell iterators
+  // Cell iterators
   DoFHandler<2>::active_cell_iterator cell = dof_handler.begin_active(),
-                                     endc = dof_handler.end();
+                                      endc = dof_handler.end();
 
   for (; cell!=endc; ++cell)
     {
       for (unsigned int f = 0; f < GeometryInfo<2>::faces_per_cell; ++f)
-       {
-         if (!cell->face(f)->at_boundary ())
-           {
-             deallog << "cell=" << cell
-                     << ", face=" << f
-                     << std::endl;
-             
-             fe_v_face.reinit (cell, f);
-               
-             const unsigned int neighbor=cell->neighbor_of_neighbor(f);
-             fe_v_face_n.reinit (cell->neighbor (f), neighbor); 
-
-                                              // Get values from
-                                              // solution vector (For
-                                              // Trap.Rule)
-             std::vector<Vector<double> > this_value
-               (n_q_face, Vector<double>(n_components));
-             fe_v_face.get_function_values (solution, this_value);
-
-                                              // Same for neighbor cell
-             std::vector<Vector<double> > this_value_n
-               (n_q_face, Vector<double>(n_components));
-             fe_v_face_n.get_function_values (solution, this_value_n);
-
-             for (unsigned int q_point=0; q_point<n_q_face; ++q_point)
-               {
-                 Point<2> vn = fe_v_face.normal_vector (q_point);
-                 double nx = vn(0);
-                 double ny = vn(1);
-                   
-                 double u = this_value[q_point](0);
-                 double v = this_value[q_point](1);
-
-                 double u_n = this_value_n[q_point](0);
-                 double v_n = this_value_n[q_point](1);
-
-                 deallog << "quadrature point " << q_point
-                         << " (u-u_n)*nx+(v-v_n)*ny="
-                         << (u-u_n) * nx + (v-v_n) * ny
-                         << ", u*nx+v*ny="
-                         << u * nx + v * ny
-                         << ", u_n*nx+v_n*ny="
-                         << u_n * nx + v_n * ny
-                         << std::endl;
-               }
-           }
-       }
+        {
+          if (!cell->face(f)->at_boundary ())
+            {
+              deallog << "cell=" << cell
+                      << ", face=" << f
+                      << std::endl;
+
+              fe_v_face.reinit (cell, f);
+
+              const unsigned int neighbor=cell->neighbor_of_neighbor(f);
+              fe_v_face_n.reinit (cell->neighbor (f), neighbor);
+
+              // Get values from
+              // solution vector (For
+              // Trap.Rule)
+              std::vector<Vector<double> > this_value
+              (n_q_face, Vector<double>(n_components));
+              fe_v_face.get_function_values (solution, this_value);
+
+              // Same for neighbor cell
+              std::vector<Vector<double> > this_value_n
+              (n_q_face, Vector<double>(n_components));
+              fe_v_face_n.get_function_values (solution, this_value_n);
+
+              for (unsigned int q_point=0; q_point<n_q_face; ++q_point)
+                {
+                  Point<2> vn = fe_v_face.normal_vector (q_point);
+                  double nx = vn(0);
+                  double ny = vn(1);
+
+                  double u = this_value[q_point](0);
+                  double v = this_value[q_point](1);
+
+                  double u_n = this_value_n[q_point](0);
+                  double v_n = this_value_n[q_point](1);
+
+                  deallog << "quadrature point " << q_point
+                          << " (u-u_n)*nx+(v-v_n)*ny="
+                          << (u-u_n) * nx + (v-v_n) * ny
+                          << ", u*nx+v*ny="
+                          << u *nx + v *ny
+                          << ", u_n*nx+v_n*ny="
+                          << u_n *nx + v_n *ny
+                          << std::endl;
+                }
+            }
+        }
     }
 }
 
@@ -141,7 +141,7 @@ int main ()
 
   Triangulation<2> tria_test;
   Point<2> p1 (0,0),
-    p2 (1, 1);
+        p2 (1, 1);
   std::vector<unsigned int> sub_div;
 
   sub_div.push_back (1);
@@ -154,20 +154,20 @@ int main ()
   DoFHandler<2> dof_handler(tria_test);
   dof_handler.distribute_dofs (fe);
 
-                                  // Fill solution vector with random
-                                  // values between 0 and 1.
+  // Fill solution vector with random
+  // values between 0 and 1.
   Vector<double> solution(dof_handler.n_dofs ());
   for (unsigned int i = 0; i < dof_handler.n_dofs (); ++i)
     solution(i) = (double) rand () / (double) RAND_MAX;
 
-                                  // Now check if the function is
-                                  // continuous in normal direction
-                                  // on uniform mesh:
+  // Now check if the function is
+  // continuous in normal direction
+  // on uniform mesh:
   deallog << "Uniform mesh test" << std::endl;
   evaluate_normal (dof_handler, solution);
 
 
-                                  // Then test same on distorted mesh
+  // Then test same on distorted mesh
   tria_test.distort_random (0.05);
   deallog << "Distorted mesh test" << std::endl;
   evaluate_normal (dof_handler, solution);
index 029ce0817ca6c104a57fa9df66a4c95b9b2801dd..d88bdf0257f938d60061c2cf14cbe2d7b727c6da 100644 (file)
 template<int dim>
 class MyFunction : public Function<dim>
 {
-  public:
-    MyFunction () : Function<dim>() {};
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int) const
-      {        double f=sin(p[0]*4);
-       if (dim>1)
-         f*=cos(p[1]*4);
-       if (dim>2)
-         f*=exp(p[2]*4);
-       return f;
-      };
+public:
+  MyFunction () : Function<dim>() {};
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int) const
+  {
+    double f=sin(p[0]*4);
+    if (dim>1)
+      f*=cos(p[1]*4);
+    if (dim>2)
+      f*=exp(p[2]*4);
+    return f;
+  };
 };
 
 
@@ -75,7 +76,7 @@ void transfer(std::ostream &out)
   DataOut<dim> q_data_out, dgq_data_out;
   ConstraintMatrix cm;
   cm.close();
-  
+
   q_dof_handler.distribute_dofs (fe_q);
   q_solution.reinit(q_dof_handler.n_dofs());
 
@@ -84,7 +85,7 @@ void transfer(std::ostream &out)
 
   VectorTools::interpolate (mapping, q_dof_handler, function, q_solution);
   VectorTools::project (mapping, dgq_dof_handler, cm,
-                       QGauss<dim>(3), function, dgq_solution);
+                        QGauss<dim>(3), function, dgq_solution);
 
   q_data_out.attach_dof_handler (q_dof_handler);
   q_data_out.add_data_vector (q_solution, "solution");
@@ -101,9 +102,9 @@ void transfer(std::ostream &out)
   SolutionTransfer<dim> q_soltrans(q_dof_handler);
   SolutionTransfer<dim> dgq_soltrans(dgq_dof_handler);
 
-                                  // test a): pure refinement
+  // test a): pure refinement
   typename Triangulation<dim>::active_cell_iterator cell=tria.begin_active(),
-                                                   endc=tria.end();
+                                                    endc=tria.end();
   ++cell;
   ++cell;
   for (; cell!=endc; ++cell)
@@ -120,7 +121,7 @@ void transfer(std::ostream &out)
   q_soltrans.refine_interpolate(q_solution, tmp_q);
   q_solution.reinit (q_dof_handler.n_dofs());
   q_solution = tmp_q;
-  
+
   Vector<double> tmp_dgq (dgq_dof_handler.n_dofs());
   dgq_soltrans.refine_interpolate(dgq_solution, tmp_dgq);
   dgq_solution.reinit (dgq_dof_handler.n_dofs());
@@ -131,20 +132,20 @@ void transfer(std::ostream &out)
   q_data_out.add_data_vector (q_solution, "solution");
   q_data_out.build_patches ();
   deallog << "Interpolated/tranferred solution after pure refinement, FE_Q"
-         << std::endl << std::endl;
+          << std::endl << std::endl;
   q_data_out.write_gnuplot (out);
 
   dgq_data_out.clear_data_vectors();
   dgq_data_out.add_data_vector (dgq_solution, "solution");
   dgq_data_out.build_patches ();
   deallog << "Interpolated/tranferred solution after pure refinement, FE_DGQ"
-         << std::endl << std::endl;
+          << std::endl << std::endl;
   dgq_data_out.write_gnuplot (out);
 
-                                  // test b): with coarsening
+  // test b): with coarsening
   q_soltrans.clear();
   dgq_soltrans.clear();
-  
+
   cell=tria.begin_active(tria.n_levels()-1);
   endc=tria.end(tria.n_levels()-1);
   cell->set_refine_flag();
@@ -152,7 +153,7 @@ void transfer(std::ostream &out)
   for (; cell!=endc; ++cell)
     cell->set_coarsen_flag();
   Vector<double> q_old_solution=q_solution,
-              dgq_old_solution=dgq_solution;
+                 dgq_old_solution=dgq_solution;
   tria.prepare_coarsening_and_refinement();
   q_soltrans.prepare_for_coarsening_and_refinement(q_old_solution);
   dgq_soltrans.prepare_for_coarsening_and_refinement(dgq_old_solution);
@@ -168,14 +169,14 @@ void transfer(std::ostream &out)
   q_data_out.add_data_vector (q_solution, "solution");
   q_data_out.build_patches ();
   deallog << "Interpolated/tranferred solution after coarsening and refinement, FE_Q"
-         << std::endl << std::endl;
+          << std::endl << std::endl;
   q_data_out.write_gnuplot (out);
 
   dgq_data_out.clear_data_vectors();
   dgq_data_out.add_data_vector (dgq_solution, "solution");
   dgq_data_out.build_patches ();
   deallog << "Interpolated/tranferred solution after coarsening and refinement, FE_DGQ"
-         << std::endl << std::endl;
+          << std::endl << std::endl;
   dgq_data_out.write_gnuplot (out);
 }
 
index c08faf42d94dc512cd220f80117cc5642117b622..5c532b5870766e39b7585fd34fe08c1fb7cea3b7 100644 (file)
 
 struct Entry
 {
-    int row;
-    int col;
-    double val;
+  int row;
+  int col;
+  double val;
 };
 
 const Entry entries[] =
 {
-      {0,0,1.87e-01},
-      {0,1,3.65e-02},
-      {0,2,3.65e-02},
-      {0,3,-1.03e-02},
-      {0,289,-1.93e-04},
-      {0,290,-9.67e-05},
-      {0,291,-9.67e-05},
-      {0,292,-4.84e-05},
-      {1,1,2.08e-01},
-      {1,0,3.65e-02},
-      {1,2,-1.03e-02},
-      {1,3,-1.03e-02},
-      {1,4,3.65e-02},
-      {1,6,-1.03e-02},
-      {1,289,-9.67e-05},
-      {1,290,-3.87e-04},
-      {1,291,-4.84e-05},
-      {1,292,-1.93e-04},
-      {1,293,-9.67e-05},
-      {1,295,-4.84e-05},
-      {2,2,2.08e-01},
-      {2,0,3.65e-02},
-      {2,1,-1.03e-02},
-      {2,3,-1.03e-02},
-      {2,5,3.65e-02},
-      {2,8,-1.03e-02},
-      {2,289,-9.67e-05},
-      {2,290,-4.84e-05},
-      {2,291,-3.87e-04},
-      {2,292,-1.93e-04},
-      {2,294,-9.67e-05},
-      {2,297,-4.84e-05},
-      {3,3,8.29e-02},
-      {3,0,-1.03e-02},
-      {3,1,-1.03e-02},
-      {3,2,-1.03e-02},
-      {3,4,-1.03e-02},
-      {3,5,-1.03e-02},
-      {3,6,-1.03e-02},
-      {3,7,-1.03e-02},
-      {3,8,-1.03e-02},
-      {3,289,-4.84e-05},
-      {3,290,-1.93e-04},
-      {3,291,-1.93e-04},
-      {3,292,-7.74e-04},
-      {3,293,-4.84e-05},
-      {3,294,-4.84e-05},
-      {3,295,-1.93e-04},
-      {3,296,-4.84e-05},
-      {3,297,-1.93e-04},
-      {4,4,2.08e-01},
-      {4,1,3.65e-02},
-      {4,3,-1.03e-02},
-      {4,6,-1.03e-02},
-      {4,9,3.65e-02},
-      {4,11,-1.03e-02},
-      {4,290,-9.67e-05},
-      {4,292,-4.84e-05},
-      {4,293,-3.87e-04},
-      {4,295,-1.93e-04},
-      {4,298,-9.67e-05},
-      {4,300,-4.84e-05},
-      {5,5,2.08e-01},
-      {5,2,3.65e-02},
-      {5,3,-1.03e-02},
-      {5,8,-1.03e-02},
-      {5,10,3.65e-02},
-      {5,15,-1.03e-02},
-      {5,291,-9.67e-05},
-      {5,292,-4.84e-05},
-      {5,294,-3.87e-04},
-      {5,297,-1.93e-04},
-      {5,299,-9.67e-05},
-      {5,304,-4.84e-05},
-      {6,6,8.29e-02},
-      {6,1,-1.03e-02},
-      {6,3,-1.03e-02},
-      {6,4,-1.03e-02},
-      {6,7,-1.03e-02},
-      {6,8,-1.03e-02},
-      {6,9,-1.03e-02},
-      {6,11,-1.03e-02},
-      {6,12,-1.03e-02},
-      {6,290,-4.84e-05},
-      {6,292,-1.93e-04},
-      {6,293,-1.93e-04},
-      {6,295,-7.74e-04},
-      {6,296,-1.93e-04},
-      {6,297,-4.84e-05},
-      {6,298,-4.84e-05},
-      {6,300,-1.93e-04},
-      {6,301,-4.84e-05},
-      {7,7,8.29e-02},
-      {7,3,-1.03e-02},
-      {7,6,-1.03e-02},
-      {7,8,-1.03e-02},
-      {7,11,-1.03e-02},
-      {7,12,-1.03e-02},
-      {7,13,-1.03e-02},
-      {7,14,-1.03e-02},
-      {7,15,-1.03e-02},
-      {7,292,-4.84e-05},
-      {7,295,-1.93e-04},
-      {7,296,-7.74e-04},
-      {7,297,-1.93e-04},
-      {7,300,-4.84e-05},
-      {7,301,-1.93e-04},
-      {7,302,-4.84e-05},
-      {7,303,-1.93e-04},
-      {7,304,-4.84e-05},
-      {8,8,8.29e-02},
-      {8,2,-1.03e-02},
-      {8,3,-1.03e-02},
-      {8,5,-1.03e-02},
-      {8,6,-1.03e-02},
-      {8,7,-1.03e-02},
-      {8,10,-1.03e-02},
-      {8,14,-1.03e-02},
-      {8,15,-1.03e-02},
-      {8,291,-4.84e-05},
-      {8,292,-1.93e-04},
-      {8,294,-1.93e-04},
-      {8,295,-4.84e-05},
-      {8,296,-1.93e-04},
-      {8,297,-7.74e-04},
-      {8,299,-4.84e-05},
-      {8,303,-4.84e-05},
-      {8,304,-1.93e-04},
-      {9,9,2.08e-01},
-      {9,4,3.65e-02},
-      {9,6,-1.03e-02},
-      {9,11,-1.03e-02},
-      {9,16,3.65e-02},
-      {9,18,-1.03e-02},
-      {9,293,-9.67e-05},
-      {9,295,-4.84e-05},
-      {9,298,-3.87e-04},
-      {9,300,-1.93e-04},
-      {9,305,-9.67e-05},
-      {9,307,-4.84e-05},
-      {10,10,2.08e-01},
-      {10,5,3.65e-02},
-      {10,8,-1.03e-02},
-      {10,15,-1.03e-02},
-      {10,17,3.65e-02},
-      {10,24,-1.03e-02},
-      {10,294,-9.67e-05},
-      {10,297,-4.84e-05},
-      {10,299,-3.87e-04},
-      {10,304,-1.93e-04},
-      {10,306,-9.67e-05},
-      {10,313,-4.84e-05},
-      {11,11,8.29e-02},
-      {11,4,-1.03e-02},
-      {11,6,-1.03e-02},
-      {11,7,-1.03e-02},
-      {11,9,-1.03e-02},
-      {11,12,-1.03e-02},
-      {11,16,-1.03e-02},
-      {11,18,-1.03e-02},
-      {11,19,-1.03e-02},
-      {11,293,-4.84e-05},
-      {11,295,-1.93e-04},
-      {11,296,-4.84e-05},
-      {11,298,-1.93e-04},
-      {11,300,-7.74e-04},
-      {11,301,-1.93e-04},
-      {11,305,-4.84e-05},
-      {11,307,-1.93e-04},
-      {11,308,-4.84e-05},
-      {12,12,8.29e-02},
-      {12,6,-1.03e-02},
-      {12,7,-1.03e-02},
-      {12,11,-1.03e-02},
-      {12,13,-1.03e-02},
-      {12,14,-1.03e-02},
-      {12,18,-1.03e-02},
-      {12,19,-1.03e-02},
-      {12,20,-1.03e-02},
-      {12,295,-4.84e-05},
-      {12,296,-1.93e-04},
-      {12,300,-1.93e-04},
-      {12,301,-7.74e-04},
-      {12,302,-1.93e-04},
-      {12,303,-4.84e-05},
-      {12,307,-4.84e-05},
-      {12,308,-1.93e-04},
-      {12,309,-4.84e-05},
-      {13,13,8.29e-02},
-      {13,7,-1.03e-02},
-      {13,12,-1.03e-02},
-      {13,14,-1.03e-02},
-      {13,19,-1.03e-02},
-      {13,20,-1.03e-02},
-      {13,21,-1.03e-02},
-      {13,22,-1.03e-02},
-      {13,23,-1.03e-02},
-      {13,296,-4.84e-05},
-      {13,301,-1.93e-04},
-      {13,302,-7.74e-04},
-      {13,303,-1.93e-04},
-      {13,308,-4.84e-05},
-      {13,309,-1.93e-04},
-      {13,310,-4.84e-05},
-      {13,311,-1.93e-04},
-      {13,312,-4.84e-05},
-      {14,14,8.29e-02},
-      {14,7,-1.03e-02},
-      {14,8,-1.03e-02},
-      {14,12,-1.03e-02},
-      {14,13,-1.03e-02},
-      {14,15,-1.03e-02},
-      {14,22,-1.03e-02},
-      {14,23,-1.03e-02},
-      {14,24,-1.03e-02},
-      {14,296,-1.93e-04},
-      {14,297,-4.84e-05},
-      {14,301,-4.84e-05},
-      {14,302,-1.93e-04},
-      {14,303,-7.74e-04},
-      {14,304,-1.93e-04},
-      {14,311,-4.84e-05},
-      {14,312,-1.93e-04},
-      {14,313,-4.84e-05},
-      {15,15,8.29e-02},
-      {15,5,-1.03e-02},
-      {15,7,-1.03e-02},
-      {15,8,-1.03e-02},
-      {15,10,-1.03e-02},
-      {15,14,-1.03e-02},
-      {15,17,-1.03e-02},
-      {15,23,-1.03e-02},
-      {15,24,-1.03e-02},
-      {15,294,-4.84e-05},
-      {15,296,-4.84e-05},
-      {15,297,-1.93e-04},
-      {15,299,-1.93e-04},
-      {15,303,-1.93e-04},
-      {15,304,-7.74e-04},
-      {15,306,-4.84e-05},
-      {15,312,-4.84e-05},
-      {15,313,-1.93e-04},
-      {16,16,2.08e-01},
-      {16,9,3.65e-02},
-      {16,11,-1.03e-02},
-      {16,18,-1.03e-02},
-      {16,25,3.65e-02},
-      {16,27,-1.03e-02},
-      {16,298,-9.67e-05},
-      {16,300,-4.84e-05},
-      {16,305,-3.87e-04},
-      {16,307,-1.93e-04},
-      {16,314,-9.67e-05},
-      {16,316,-4.84e-05},
-      {17,17,2.08e-01},
-      {17,10,3.65e-02},
-      {17,15,-1.03e-02},
-      {17,24,-1.03e-02},
-      {17,26,3.65e-02},
-      {17,33,-1.03e-02},
-      {17,299,-9.67e-05},
-      {17,304,-4.84e-05},
-      {17,306,-3.87e-04},
-      {17,313,-1.93e-04},
-      {17,315,-9.67e-05},
-      {17,322,-4.84e-05},
-      {18,18,8.29e-02},
-      {18,9,-1.03e-02},
-      {18,11,-1.03e-02},
-      {18,12,-1.03e-02},
-      {18,16,-1.03e-02},
-      {18,19,-1.03e-02},
-      {18,25,-1.03e-02},
-      {18,27,-1.03e-02},
-      {18,28,-1.03e-02},
-      {18,298,-4.84e-05},
-      {18,300,-1.93e-04},
-      {18,301,-4.84e-05},
-      {18,305,-1.93e-04},
-      {18,307,-7.74e-04},
-      {18,308,-1.93e-04},
-      {18,314,-4.84e-05},
-      {18,316,-1.93e-04},
-      {18,317,-4.84e-05},
-      {19,19,8.29e-02},
-      {19,11,-1.03e-02},
-      {19,12,-1.03e-02},
-      {19,13,-1.03e-02},
-      {19,18,-1.03e-02},
-      {19,20,-1.03e-02},
-      {19,27,-1.03e-02},
-      {19,28,-1.03e-02},
-      {19,29,-1.03e-02},
-      {19,300,-4.84e-05},
-      {19,301,-1.93e-04},
-      {19,302,-4.84e-05},
-      {19,307,-1.93e-04},
-      {19,308,-7.74e-04},
-      {19,309,-1.93e-04},
-      {19,316,-4.84e-05},
-      {19,317,-1.93e-04},
-      {19,318,-4.84e-05},
-      {20,20,8.29e-02},
-      {20,12,-1.03e-02},
-      {20,13,-1.03e-02},
-      {20,19,-1.03e-02},
-      {20,21,-1.03e-02},
-      {20,22,-1.03e-02},
-      {20,28,-1.03e-02},
-      {20,29,-1.03e-02},
-      {20,30,-1.03e-02},
-      {20,301,-4.84e-05},
-      {20,302,-1.93e-04},
-      {20,308,-1.93e-04},
-      {20,309,-7.74e-04},
-      {20,310,-1.93e-04},
-      {20,311,-4.84e-05},
-      {20,317,-4.84e-05},
-      {20,318,-1.93e-04},
-      {20,319,-4.84e-05},
-      {21,21,8.29e-02},
-      {21,13,-1.03e-02},
-      {21,20,-1.03e-02},
-      {21,22,-1.03e-02},
-      {21,29,-1.03e-02},
-      {21,30,-1.03e-02},
-      {21,31,-1.03e-02},
-      {21,32,-1.03e-02},
-      {21,35,-1.03e-02},
-      {21,302,-4.84e-05},
-      {21,309,-1.93e-04},
-      {21,310,-7.74e-04},
-      {21,311,-1.93e-04},
-      {21,318,-4.84e-05},
-      {21,319,-1.93e-04},
-      {21,320,-4.84e-05},
-      {21,321,-1.93e-04},
-      {21,324,-4.84e-05},
-      {22,22,8.29e-02},
-      {22,13,-1.03e-02},
-      {22,14,-1.03e-02},
-      {22,20,-1.03e-02},
-      {22,21,-1.03e-02},
-      {22,23,-1.03e-02},
-      {22,32,-1.03e-02},
-      {22,34,-1.03e-02},
-      {22,35,-1.03e-02},
-      {22,302,-1.93e-04},
-      {22,303,-4.84e-05},
-      {22,309,-4.84e-05},
-      {22,310,-1.93e-04},
-      {22,311,-7.74e-04},
-      {22,312,-1.93e-04},
-      {22,321,-4.84e-05},
-      {22,323,-4.84e-05},
-      {22,324,-1.93e-04},
-      {23,23,8.29e-02},
-      {23,13,-1.03e-02},
-      {23,14,-1.03e-02},
-      {23,15,-1.03e-02},
-      {23,22,-1.03e-02},
-      {23,24,-1.03e-02},
-      {23,33,-1.03e-02},
-      {23,34,-1.03e-02},
-      {23,35,-1.03e-02},
-      {23,302,-4.84e-05},
-      {23,303,-1.93e-04},
-      {23,304,-4.84e-05},
-      {23,311,-1.93e-04},
-      {23,312,-7.74e-04},
-      {23,313,-1.93e-04},
-      {23,322,-4.84e-05},
-      {23,323,-1.93e-04},
-      {23,324,-4.84e-05},
-      {24,24,8.29e-02},
-      {24,10,-1.03e-02},
-      {24,14,-1.03e-02},
-      {24,15,-1.03e-02},
-      {24,17,-1.03e-02},
-      {24,23,-1.03e-02},
-      {24,26,-1.03e-02},
-      {24,33,-1.03e-02},
-      {24,34,-1.03e-02},
-      {24,299,-4.84e-05},
-      {24,303,-4.84e-05},
-      {24,304,-1.93e-04},
-      {24,306,-1.93e-04},
-      {24,312,-1.93e-04},
-      {24,313,-7.74e-04},
-      {24,315,-4.84e-05},
-      {24,322,-1.93e-04},
-      {24,323,-4.84e-05},
-      {25,25,2.08e-01},
-      {25,16,3.65e-02},
-      {25,18,-1.03e-02},
-      {25,27,-1.03e-02},
-      {25,36,3.65e-02},
-      {25,38,-1.03e-02},
-      {25,305,-9.67e-05},
-      {25,307,-4.84e-05},
-      {25,314,-3.87e-04},
-      {25,316,-1.93e-04},
-      {25,325,-9.67e-05},
-      {25,327,-4.84e-05},
-      {26,26,2.08e-01},
-      {26,17,3.65e-02},
-      {26,24,-1.03e-02},
-      {26,33,-1.03e-02},
-      {26,37,3.65e-02},
-      {26,47,-1.03e-02},
-      {26,306,-9.67e-05},
-      {26,313,-4.84e-05},
-      {26,315,-3.87e-04},
-      {26,322,-1.93e-04},
-      {26,326,-9.67e-05},
-      {26,336,-4.84e-05},
-      {27,27,8.29e-02},
-      {27,16,-1.03e-02},
-      {27,18,-1.03e-02},
-      {27,19,-1.03e-02},
-      {27,25,-1.03e-02},
-      {27,28,-1.03e-02},
-      {27,36,-1.03e-02},
-      {27,38,-1.03e-02},
-      {27,39,-1.03e-02},
-      {27,305,-4.84e-05},
-      {27,307,-1.93e-04},
-      {27,308,-4.84e-05},
-      {27,314,-1.93e-04},
-      {27,316,-7.74e-04},
-      {27,317,-1.93e-04},
-      {27,325,-4.84e-05},
-      {27,327,-1.93e-04},
-      {27,328,-4.84e-05},
-      {28,28,8.29e-02},
-      {28,18,-1.03e-02},
-      {28,19,-1.03e-02},
-      {28,20,-1.03e-02},
-      {28,27,-1.03e-02},
-      {28,29,-1.03e-02},
-      {28,38,-1.03e-02},
-      {28,39,-1.03e-02},
-      {28,40,-1.03e-02},
-      {28,307,-4.84e-05},
-      {28,308,-1.93e-04},
-      {28,309,-4.84e-05},
-      {28,316,-1.93e-04},
-      {28,317,-7.74e-04},
-      {28,318,-1.93e-04},
-      {28,327,-4.84e-05},
-      {28,328,-1.93e-04},
-      {28,329,-4.84e-05},
-      {29,29,8.29e-02},
-      {29,19,-1.03e-02},
-      {29,20,-1.03e-02},
-      {29,21,-1.03e-02},
-      {29,28,-1.03e-02},
-      {29,30,-1.03e-02},
-      {29,39,-1.03e-02},
-      {29,40,-1.03e-02},
-      {29,41,-1.03e-02},
-      {29,308,-4.84e-05},
-      {29,309,-1.93e-04},
-      {29,310,-4.84e-05},
-      {29,317,-1.93e-04},
-      {29,318,-7.74e-04},
-      {29,319,-1.93e-04},
-      {29,328,-4.84e-05},
-      {29,329,-1.93e-04},
-      {29,330,-4.84e-05},
-      {30,30,8.29e-02},
-      {30,20,-1.03e-02},
-      {30,21,-1.03e-02},
-      {30,29,-1.03e-02},
-      {30,31,-1.03e-02},
-      {30,32,-1.03e-02},
-      {30,40,-1.03e-02},
-      {30,41,-1.03e-02},
-      {30,42,-1.03e-02},
-      {30,309,-4.84e-05},
-      {30,310,-1.93e-04},
-      {30,318,-1.93e-04},
-      {30,319,-7.74e-04},
-      {30,320,-1.93e-04},
-      {30,321,-4.84e-05},
-      {30,329,-4.84e-05},
-      {30,330,-1.93e-04},
-      {30,331,-4.84e-05},
-      {31,31,8.29e-02},
-      {31,21,-1.03e-02},
-      {31,30,-1.03e-02},
-      {31,32,-1.03e-02},
-      {31,41,-1.03e-02},
-      {31,42,-1.03e-02},
-      {31,43,-1.03e-02},
-      {31,44,-1.03e-02},
-      {31,45,-1.03e-02},
-      {31,310,-4.84e-05},
-      {31,319,-1.93e-04},
-      {31,320,-7.74e-04},
-      {31,321,-1.93e-04},
-      {31,330,-4.84e-05},
-      {31,331,-1.93e-04},
-      {31,332,-4.84e-05},
-      {31,333,-1.93e-04},
-      {31,334,-4.84e-05},
-      {32,32,8.29e-02},
-      {32,21,-1.03e-02},
-      {32,22,-1.03e-02},
-      {32,30,-1.03e-02},
-      {32,31,-1.03e-02},
-      {32,35,-1.03e-02},
-      {32,44,-1.03e-02},
-      {32,45,-1.03e-02},
-      {32,48,-1.03e-02},
-      {32,310,-1.93e-04},
-      {32,311,-4.84e-05},
-      {32,319,-4.84e-05},
-      {32,320,-1.93e-04},
-      {32,321,-7.74e-04},
-      {32,324,-1.93e-04},
-      {32,333,-4.84e-05},
-      {32,334,-1.93e-04},
-      {32,337,-4.84e-05},
-      {33,33,8.29e-02},
-      {33,17,-1.03e-02},
-      {33,23,-1.03e-02},
-      {33,24,-1.03e-02},
-      {33,26,-1.03e-02},
-      {33,34,-1.03e-02},
-      {33,37,-1.03e-02},
-      {33,46,-1.03e-02},
-      {33,47,-1.03e-02},
-      {33,306,-4.84e-05},
-      {33,312,-4.84e-05},
-      {33,313,-1.93e-04},
-      {33,315,-1.93e-04},
-      {33,322,-7.74e-04},
-      {33,323,-1.93e-04},
-      {33,326,-4.84e-05},
-      {33,335,-4.84e-05},
-      {33,336,-1.93e-04},
-      {34,34,8.29e-02},
-      {34,22,-1.03e-02},
-      {34,23,-1.03e-02},
-      {34,24,-1.03e-02},
-      {34,33,-1.03e-02},
-      {34,35,-1.03e-02},
-      {34,46,-1.03e-02},
-      {34,47,-1.03e-02},
-      {34,48,-1.03e-02},
-      {34,311,-4.84e-05},
-      {34,312,-1.93e-04},
-      {34,313,-4.84e-05},
-      {34,322,-1.93e-04},
-      {34,323,-7.74e-04},
-      {34,324,-1.93e-04},
-      {34,335,-1.93e-04},
-      {34,336,-4.84e-05},
-      {34,337,-4.84e-05},
-      {35,35,8.29e-02},
-      {35,21,-1.03e-02},
-      {35,22,-1.03e-02},
-      {35,23,-1.03e-02},
-      {35,32,-1.03e-02},
-      {35,34,-1.03e-02},
-      {35,45,-1.03e-02},
-      {35,46,-1.03e-02},
-      {35,48,-1.03e-02},
-      {35,310,-4.84e-05},
-      {35,311,-1.93e-04},
-      {35,312,-4.84e-05},
-      {35,321,-1.93e-04},
-      {35,323,-1.93e-04},
-      {35,324,-7.74e-04},
-      {35,334,-4.84e-05},
-      {35,335,-4.84e-05},
-      {35,337,-1.93e-04},
-      {36,36,2.08e-01},
-      {36,25,3.65e-02},
-      {36,27,-1.03e-02},
-      {36,38,-1.03e-02},
-      {36,49,3.65e-02},
-      {36,51,-1.03e-02},
-      {36,314,-9.67e-05},
-      {36,316,-4.84e-05},
-      {36,325,-3.87e-04},
-      {36,327,-1.93e-04},
-      {36,338,-9.67e-05},
-      {36,340,-4.84e-05},
-      {37,37,2.08e-01},
-      {37,26,3.65e-02},
-      {37,33,-1.03e-02},
-      {37,47,-1.03e-02},
-      {37,50,3.65e-02},
-      {37,63,-1.03e-02},
-      {37,315,-9.67e-05},
-      {37,322,-4.84e-05},
-      {37,326,-3.87e-04},
-      {37,336,-1.93e-04},
-      {37,339,-9.67e-05},
-      {37,352,-4.84e-05},
-      {38,38,8.29e-02},
-      {38,25,-1.03e-02},
-      {38,27,-1.03e-02},
-      {38,28,-1.03e-02},
-      {38,36,-1.03e-02},
-      {38,39,-1.03e-02},
-      {38,49,-1.03e-02},
-      {38,51,-1.03e-02},
-      {38,52,-1.03e-02},
-      {38,314,-4.84e-05},
-      {38,316,-1.93e-04},
-      {38,317,-4.84e-05},
-      {38,325,-1.93e-04},
-      {38,327,-7.74e-04},
-      {38,328,-1.93e-04},
-      {38,338,-4.84e-05},
-      {38,340,-1.93e-04},
-      {38,341,-4.84e-05},
-      {39,39,8.29e-02},
-      {39,27,-1.03e-02},
-      {39,28,-1.03e-02},
-      {39,29,-1.03e-02},
-      {39,38,-1.03e-02},
-      {39,40,-1.03e-02},
-      {39,51,-1.03e-02},
-      {39,52,-1.03e-02},
-      {39,53,-1.03e-02},
-      {39,316,-4.84e-05},
-      {39,317,-1.93e-04},
-      {39,318,-4.84e-05},
-      {39,327,-1.93e-04},
-      {39,328,-7.74e-04},
-      {39,329,-1.93e-04},
-      {39,340,-4.84e-05},
-      {39,341,-1.93e-04},
-      {39,342,-4.84e-05},
-      {40,40,8.29e-02},
-      {40,28,-1.03e-02},
-      {40,29,-1.03e-02},
-      {40,30,-1.03e-02},
-      {40,39,-1.03e-02},
-      {40,41,-1.03e-02},
-      {40,52,-1.03e-02},
-      {40,53,-1.03e-02},
-      {40,54,-1.03e-02},
-      {40,317,-4.84e-05},
-      {40,318,-1.93e-04},
-      {40,319,-4.84e-05},
-      {40,328,-1.93e-04},
-      {40,329,-7.74e-04},
-      {40,330,-1.93e-04},
-      {40,341,-4.84e-05},
-      {40,342,-1.93e-04},
-      {40,343,-4.84e-05},
-      {41,41,8.29e-02},
-      {41,29,-1.03e-02},
-      {41,30,-1.03e-02},
-      {41,31,-1.03e-02},
-      {41,40,-1.03e-02},
-      {41,42,-1.03e-02},
-      {41,53,-1.03e-02},
-      {41,54,-1.03e-02},
-      {41,55,-1.03e-02},
-      {41,318,-4.84e-05},
-      {41,319,-1.93e-04},
-      {41,320,-4.84e-05},
-      {41,329,-1.93e-04},
-      {41,330,-7.74e-04},
-      {41,331,-1.93e-04},
-      {41,342,-4.84e-05},
-      {41,343,-1.93e-04},
-      {41,344,-4.84e-05},
-      {42,42,8.29e-02},
-      {42,30,-1.03e-02},
-      {42,31,-1.03e-02},
-      {42,41,-1.03e-02},
-      {42,43,-1.03e-02},
-      {42,44,-1.03e-02},
-      {42,54,-1.03e-02},
-      {42,55,-1.03e-02},
-      {42,56,-1.03e-02},
-      {42,319,-4.84e-05},
-      {42,320,-1.93e-04},
-      {42,330,-1.93e-04},
-      {42,331,-7.74e-04},
-      {42,332,-1.93e-04},
-      {42,333,-4.84e-05},
-      {42,343,-4.84e-05},
-      {42,344,-1.93e-04},
-      {42,345,-4.84e-05},
-      {43,43,8.29e-02},
-      {43,31,-1.03e-02},
-      {43,42,-1.03e-02},
-      {43,44,-1.03e-02},
-      {43,55,-1.03e-02},
-      {43,56,-1.03e-02},
-      {43,57,-1.03e-02},
-      {43,58,-1.03e-02},
-      {43,59,-1.03e-02},
-      {43,320,-4.84e-05},
-      {43,331,-1.93e-04},
-      {43,332,-7.74e-04},
-      {43,333,-1.93e-04},
-      {43,344,-4.84e-05},
-      {43,345,-1.93e-04},
-      {43,346,-4.84e-05},
-      {43,347,-1.93e-04},
-      {43,348,-4.84e-05},
-      {44,44,8.29e-02},
-      {44,31,-1.03e-02},
-      {44,32,-1.03e-02},
-      {44,42,-1.03e-02},
-      {44,43,-1.03e-02},
-      {44,45,-1.03e-02},
-      {44,58,-1.03e-02},
-      {44,59,-1.03e-02},
-      {44,60,-1.03e-02},
-      {44,320,-1.93e-04},
-      {44,321,-4.84e-05},
-      {44,331,-4.84e-05},
-      {44,332,-1.93e-04},
-      {44,333,-7.74e-04},
-      {44,334,-1.93e-04},
-      {44,347,-4.84e-05},
-      {44,348,-1.93e-04},
-      {44,349,-4.84e-05},
-      {45,45,8.29e-02},
-      {45,31,-1.03e-02},
-      {45,32,-1.03e-02},
-      {45,35,-1.03e-02},
-      {45,44,-1.03e-02},
-      {45,48,-1.03e-02},
-      {45,59,-1.03e-02},
-      {45,60,-1.03e-02},
-      {45,61,-1.03e-02},
-      {45,320,-4.84e-05},
-      {45,321,-1.93e-04},
-      {45,324,-4.84e-05},
-      {45,333,-1.93e-04},
-      {45,334,-7.74e-04},
-      {45,337,-1.93e-04},
-      {45,348,-4.84e-05},
-      {45,349,-1.93e-04},
-      {45,350,-4.84e-05},
-      {46,46,8.29e-02},
-      {46,33,-1.03e-02},
-      {46,34,-1.03e-02},
-      {46,35,-1.03e-02},
-      {46,47,-1.03e-02},
-      {46,48,-1.03e-02},
-      {46,61,-1.03e-02},
-      {46,62,-1.03e-02},
-      {46,63,-1.03e-02},
-      {46,322,-4.84e-05},
-      {46,323,-1.93e-04},
-      {46,324,-4.84e-05},
-      {46,335,-7.74e-04},
-      {46,336,-1.93e-04},
-      {46,337,-1.93e-04},
-      {46,350,-4.84e-05},
-      {46,351,-1.93e-04},
-      {46,352,-4.84e-05},
-      {47,47,8.29e-02},
-      {47,26,-1.03e-02},
-      {47,33,-1.03e-02},
-      {47,34,-1.03e-02},
-      {47,37,-1.03e-02},
-      {47,46,-1.03e-02},
-      {47,50,-1.03e-02},
-      {47,62,-1.03e-02},
-      {47,63,-1.03e-02},
-      {47,315,-4.84e-05},
-      {47,322,-1.93e-04},
-      {47,323,-4.84e-05},
-      {47,326,-1.93e-04},
-      {47,335,-1.93e-04},
-      {47,336,-7.74e-04},
-      {47,339,-4.84e-05},
-      {47,351,-4.84e-05},
-      {47,352,-1.93e-04},
-      {48,48,8.29e-02},
-      {48,32,-1.03e-02},
-      {48,34,-1.03e-02},
-      {48,35,-1.03e-02},
-      {48,45,-1.03e-02},
-      {48,46,-1.03e-02},
-      {48,60,-1.03e-02},
-      {48,61,-1.03e-02},
-      {48,62,-1.03e-02},
-      {48,321,-4.84e-05},
-      {48,323,-4.84e-05},
-      {48,324,-1.93e-04},
-      {48,334,-1.93e-04},
-      {48,335,-1.93e-04},
-      {48,337,-7.74e-04},
-      {48,349,-4.84e-05},
-      {48,350,-1.93e-04},
-      {48,351,-4.84e-05},
-      {49,49,2.08e-01},
-      {49,36,3.65e-02},
-      {49,38,-1.03e-02},
-      {49,51,-1.03e-02},
-      {49,64,3.65e-02},
-      {49,66,-1.03e-02},
-      {49,325,-9.67e-05},
-      {49,327,-4.84e-05},
-      {49,338,-3.87e-04},
-      {49,340,-1.93e-04},
-      {49,353,-9.67e-05},
-      {49,355,-4.84e-05},
-      {50,50,2.08e-01},
-      {50,37,3.65e-02},
-      {50,47,-1.03e-02},
-      {50,63,-1.03e-02},
-      {50,65,3.65e-02},
-      {50,80,-1.03e-02},
-      {50,326,-9.67e-05},
-      {50,336,-4.84e-05},
-      {50,339,-3.87e-04},
-      {50,352,-1.93e-04},
-      {50,354,-9.67e-05},
-      {50,369,-4.84e-05},
-      {51,51,8.29e-02},
-      {51,36,-1.03e-02},
-      {51,38,-1.03e-02},
-      {51,39,-1.03e-02},
-      {51,49,-1.03e-02},
-      {51,52,-1.03e-02},
-      {51,64,-1.03e-02},
-      {51,66,-1.03e-02},
-      {51,67,-1.03e-02},
-      {51,325,-4.84e-05},
-      {51,327,-1.93e-04},
-      {51,328,-4.84e-05},
-      {51,338,-1.93e-04},
-      {51,340,-7.74e-04},
-      {51,341,-1.93e-04},
-      {51,353,-4.84e-05},
-      {51,355,-1.93e-04},
-      {51,356,-4.84e-05},
-      {52,52,8.29e-02},
-      {52,38,-1.03e-02},
-      {52,39,-1.03e-02},
-      {52,40,-1.03e-02},
-      {52,51,-1.03e-02},
-      {52,53,-1.03e-02},
-      {52,66,-1.03e-02},
-      {52,67,-1.03e-02},
-      {52,68,-1.03e-02},
-      {52,327,-4.84e-05},
-      {52,328,-1.93e-04},
-      {52,329,-4.84e-05},
-      {52,340,-1.93e-04},
-      {52,341,-7.74e-04},
-      {52,342,-1.93e-04},
-      {52,355,-4.84e-05},
-      {52,356,-1.93e-04},
-      {52,357,-4.84e-05},
-      {53,53,8.29e-02},
-      {53,39,-1.03e-02},
-      {53,40,-1.03e-02},
-      {53,41,-1.03e-02},
-      {53,52,-1.03e-02},
-      {53,54,-1.03e-02},
-      {53,67,-1.03e-02},
-      {53,68,-1.03e-02},
-      {53,69,-1.03e-02},
-      {53,328,-4.84e-05},
-      {53,329,-1.93e-04},
-      {53,330,-4.84e-05},
-      {53,341,-1.93e-04},
-      {53,342,-7.74e-04},
-      {53,343,-1.93e-04},
-      {53,356,-4.84e-05},
-      {53,357,-1.93e-04},
-      {53,358,-4.84e-05},
-      {54,54,8.29e-02},
-      {54,40,-1.03e-02},
-      {54,41,-1.03e-02},
-      {54,42,-1.03e-02},
-      {54,53,-1.03e-02},
-      {54,55,-1.03e-02},
-      {54,68,-1.03e-02},
-      {54,69,-1.03e-02},
-      {54,70,-1.03e-02},
-      {54,329,-4.84e-05},
-      {54,330,-1.93e-04},
-      {54,331,-4.84e-05},
-      {54,342,-1.93e-04},
-      {54,343,-7.74e-04},
-      {54,344,-1.93e-04},
-      {54,357,-4.84e-05},
-      {54,358,-1.93e-04},
-      {54,359,-4.84e-05},
-      {55,55,8.29e-02},
-      {55,41,-1.03e-02},
-      {55,42,-1.03e-02},
-      {55,43,-1.03e-02},
-      {55,54,-1.03e-02},
-      {55,56,-1.03e-02},
-      {55,69,-1.03e-02},
-      {55,70,-1.03e-02},
-      {55,71,-1.03e-02},
-      {55,330,-4.84e-05},
-      {55,331,-1.93e-04},
-      {55,332,-4.84e-05},
-      {55,343,-1.93e-04},
-      {55,344,-7.74e-04},
-      {55,345,-1.93e-04},
-      {55,358,-4.84e-05},
-      {55,359,-1.93e-04},
-      {55,360,-4.84e-05},
-      {56,56,8.29e-02},
-      {56,42,-1.03e-02},
-      {56,43,-1.03e-02},
-      {56,55,-1.03e-02},
-      {56,57,-1.03e-02},
-      {56,58,-1.03e-02},
-      {56,70,-1.03e-02},
-      {56,71,-1.03e-02},
-      {56,72,-1.03e-02},
-      {56,331,-4.84e-05},
-      {56,332,-1.93e-04},
-      {56,344,-1.93e-04},
-      {56,345,-7.74e-04},
-      {56,346,-1.93e-04},
-      {56,347,-4.84e-05},
-      {56,359,-4.84e-05},
-      {56,360,-1.93e-04},
-      {56,361,-4.84e-05},
-      {57,57,8.29e-02},
-      {57,43,-1.03e-02},
-      {57,56,-1.03e-02},
-      {57,58,-1.03e-02},
-      {57,71,-1.03e-02},
-      {57,72,-1.03e-02},
-      {57,73,-1.03e-02},
-      {57,74,-1.03e-02},
-      {57,75,-1.03e-02},
-      {57,332,-4.84e-05},
-      {57,345,-1.93e-04},
-      {57,346,-7.74e-04},
-      {57,347,-1.93e-04},
-      {57,360,-4.84e-05},
-      {57,361,-1.93e-04},
-      {57,362,-4.84e-05},
-      {57,363,-1.93e-04},
-      {57,364,-4.84e-05},
-      {58,58,8.29e-02},
-      {58,43,-1.03e-02},
-      {58,44,-1.03e-02},
-      {58,56,-1.03e-02},
-      {58,57,-1.03e-02},
-      {58,59,-1.03e-02},
-      {58,74,-1.03e-02},
-      {58,75,-1.03e-02},
-      {58,76,-1.03e-02},
-      {58,332,-1.93e-04},
-      {58,333,-4.84e-05},
-      {58,345,-4.84e-05},
-      {58,346,-1.93e-04},
-      {58,347,-7.74e-04},
-      {58,348,-1.93e-04},
-      {58,363,-4.84e-05},
-      {58,364,-1.93e-04},
-      {58,365,-4.84e-05},
-      {59,59,8.29e-02},
-      {59,43,-1.03e-02},
-      {59,44,-1.03e-02},
-      {59,45,-1.03e-02},
-      {59,58,-1.03e-02},
-      {59,60,-1.03e-02},
-      {59,75,-1.03e-02},
-      {59,76,-1.03e-02},
-      {59,77,-1.03e-02},
-      {59,332,-4.84e-05},
-      {59,333,-1.93e-04},
-      {59,334,-4.84e-05},
-      {59,347,-1.93e-04},
-      {59,348,-7.74e-04},
-      {59,349,-1.93e-04},
-      {59,364,-4.84e-05},
-      {59,365,-1.93e-04},
-      {59,366,-4.84e-05},
-      {60,60,8.29e-02},
-      {60,44,-1.03e-02},
-      {60,45,-1.03e-02},
-      {60,48,-1.03e-02},
-      {60,59,-1.03e-02},
-      {60,61,-1.03e-02},
-      {60,76,-1.03e-02},
-      {60,77,-1.03e-02},
-      {60,78,-1.03e-02},
-      {60,333,-4.84e-05},
-      {60,334,-1.93e-04},
-      {60,337,-4.84e-05},
-      {60,348,-1.93e-04},
-      {60,349,-7.74e-04},
-      {60,350,-1.93e-04},
-      {60,365,-4.84e-05},
-      {60,366,-1.93e-04},
-      {60,367,-4.84e-05},
-      {61,61,8.29e-02},
-      {61,45,-1.03e-02},
-      {61,46,-1.03e-02},
-      {61,48,-1.03e-02},
-      {61,60,-1.03e-02},
-      {61,62,-1.03e-02},
-      {61,77,-1.03e-02},
-      {61,78,-1.03e-02},
-      {61,79,-1.03e-02},
-      {61,334,-4.84e-05},
-      {61,335,-4.84e-05},
-      {61,337,-1.93e-04},
-      {61,349,-1.93e-04},
-      {61,350,-7.74e-04},
-      {61,351,-1.93e-04},
-      {61,366,-4.84e-05},
-      {61,367,-1.93e-04},
-      {61,368,-4.84e-05},
-      {62,62,8.29e-02},
-      {62,46,-1.03e-02},
-      {62,47,-1.03e-02},
-      {62,48,-1.03e-02},
-      {62,61,-1.03e-02},
-      {62,63,-1.03e-02},
-      {62,78,-1.03e-02},
-      {62,79,-1.03e-02},
-      {62,80,-1.03e-02},
-      {62,335,-1.93e-04},
-      {62,336,-4.84e-05},
-      {62,337,-4.84e-05},
-      {62,350,-1.93e-04},
-      {62,351,-7.74e-04},
-      {62,352,-1.93e-04},
-      {62,367,-4.84e-05},
-      {62,368,-1.93e-04},
-      {62,369,-4.84e-05},
-      {63,63,8.29e-02},
-      {63,37,-1.03e-02},
-      {63,46,-1.03e-02},
-      {63,47,-1.03e-02},
-      {63,50,-1.03e-02},
-      {63,62,-1.03e-02},
-      {63,65,-1.03e-02},
-      {63,79,-1.03e-02},
-      {63,80,-1.03e-02},
-      {63,326,-4.84e-05},
-      {63,335,-4.84e-05},
-      {63,336,-1.93e-04},
-      {63,339,-1.93e-04},
-      {63,351,-1.93e-04},
-      {63,352,-7.74e-04},
-      {63,354,-4.84e-05},
-      {63,368,-4.84e-05},
-      {63,369,-1.93e-04},
-      {64,64,2.08e-01},
-      {64,49,3.65e-02},
-      {64,51,-1.03e-02},
-      {64,66,-1.03e-02},
-      {64,81,3.65e-02},
-      {64,83,-1.03e-02},
-      {64,338,-9.67e-05},
-      {64,340,-4.84e-05},
-      {64,353,-3.87e-04},
-      {64,355,-1.93e-04},
-      {64,370,-9.67e-05},
-      {64,372,-4.84e-05},
-      {65,65,2.08e-01},
-      {65,50,3.65e-02},
-      {65,63,-1.03e-02},
-      {65,80,-1.03e-02},
-      {65,82,3.65e-02},
-      {65,93,-1.03e-02},
-      {65,339,-9.67e-05},
-      {65,352,-4.84e-05},
-      {65,354,-3.87e-04},
-      {65,369,-1.93e-04},
-      {65,371,-9.67e-05},
-      {65,382,-4.84e-05},
-      {66,66,8.29e-02},
-      {66,49,-1.03e-02},
-      {66,51,-1.03e-02},
-      {66,52,-1.03e-02},
-      {66,64,-1.03e-02},
-      {66,67,-1.03e-02},
-      {66,81,-1.03e-02},
-      {66,83,-1.03e-02},
-      {66,84,-1.03e-02},
-      {66,338,-4.84e-05},
-      {66,340,-1.93e-04},
-      {66,341,-4.84e-05},
-      {66,353,-1.93e-04},
-      {66,355,-7.74e-04},
-      {66,356,-1.93e-04},
-      {66,370,-4.84e-05},
-      {66,372,-1.93e-04},
-      {66,373,-4.84e-05},
-      {67,67,8.29e-02},
-      {67,51,-1.03e-02},
-      {67,52,-1.03e-02},
-      {67,53,-1.03e-02},
-      {67,66,-1.03e-02},
-      {67,68,-1.03e-02},
-      {67,83,-1.03e-02},
-      {67,84,-1.03e-02},
-      {67,85,-1.03e-02},
-      {67,340,-4.84e-05},
-      {67,341,-1.93e-04},
-      {67,342,-4.84e-05},
-      {67,355,-1.93e-04},
-      {67,356,-7.74e-04},
-      {67,357,-1.93e-04},
-      {67,372,-4.84e-05},
-      {67,373,-1.93e-04},
-      {67,374,-4.84e-05},
-      {68,68,8.29e-02},
-      {68,52,-1.03e-02},
-      {68,53,-1.03e-02},
-      {68,54,-1.03e-02},
-      {68,67,-1.03e-02},
-      {68,69,-1.03e-02},
-      {68,84,-1.03e-02},
-      {68,85,-1.03e-02},
-      {68,86,-1.03e-02},
-      {68,341,-4.84e-05},
-      {68,342,-1.93e-04},
-      {68,343,-4.84e-05},
-      {68,356,-1.93e-04},
-      {68,357,-7.74e-04},
-      {68,358,-1.93e-04},
-      {68,373,-4.84e-05},
-      {68,374,-1.93e-04},
-      {68,375,-4.84e-05},
-      {69,69,8.29e-02},
-      {69,53,-1.03e-02},
-      {69,54,-1.03e-02},
-      {69,55,-1.03e-02},
-      {69,68,-1.03e-02},
-      {69,70,-1.03e-02},
-      {69,85,-1.03e-02},
-      {69,86,-1.03e-02},
-      {69,87,-1.03e-02},
-      {69,342,-4.84e-05},
-      {69,343,-1.93e-04},
-      {69,344,-4.84e-05},
-      {69,357,-1.93e-04},
-      {69,358,-7.74e-04},
-      {69,359,-1.93e-04},
-      {69,374,-4.84e-05},
-      {69,375,-1.93e-04},
-      {69,376,-4.84e-05},
-      {70,70,8.29e-02},
-      {70,54,-1.03e-02},
-      {70,55,-1.03e-02},
-      {70,56,-1.03e-02},
-      {70,69,-1.03e-02},
-      {70,71,-1.03e-02},
-      {70,86,-1.03e-02},
-      {70,87,-1.03e-02},
-      {70,88,-1.03e-02},
-      {70,343,-4.84e-05},
-      {70,344,-1.93e-04},
-      {70,345,-4.84e-05},
-      {70,358,-1.93e-04},
-      {70,359,-7.74e-04},
-      {70,360,-1.93e-04},
-      {70,375,-4.84e-05},
-      {70,376,-1.93e-04},
-      {70,377,-4.84e-05},
-      {71,71,8.29e-02},
-      {71,55,-1.03e-02},
-      {71,56,-1.03e-02},
-      {71,57,-1.03e-02},
-      {71,70,-1.03e-02},
-      {71,72,-1.03e-02},
-      {71,87,-1.03e-02},
-      {71,88,-1.03e-02},
-      {71,89,-1.03e-02},
-      {71,344,-4.84e-05},
-      {71,345,-1.93e-04},
-      {71,346,-4.84e-05},
-      {71,359,-1.93e-04},
-      {71,360,-7.74e-04},
-      {71,361,-1.93e-04},
-      {71,376,-4.84e-05},
-      {71,377,-1.93e-04},
-      {71,378,-4.84e-05},
-      {72,72,8.29e-02},
-      {72,56,-1.03e-02},
-      {72,57,-1.03e-02},
-      {72,71,-1.03e-02},
-      {72,73,-1.03e-02},
-      {72,74,-1.03e-02},
-      {72,88,-1.03e-02},
-      {72,89,-1.03e-02},
-      {72,90,-1.03e-02},
-      {72,345,-4.84e-05},
-      {72,346,-1.93e-04},
-      {72,360,-1.93e-04},
-      {72,361,-7.74e-04},
-      {72,362,-1.93e-04},
-      {72,363,-4.84e-05},
-      {72,377,-4.84e-05},
-      {72,378,-1.93e-04},
-      {72,379,-4.84e-05},
-      {73,73,8.29e-02},
-      {73,57,-1.03e-02},
-      {73,72,-1.03e-02},
-      {73,74,-1.03e-02},
-      {73,89,-1.03e-02},
-      {73,90,-1.03e-02},
-      {73,91,-1.03e-02},
-      {73,92,-1.03e-02},
-      {73,99,-1.03e-02},
-      {73,346,-4.84e-05},
-      {73,361,-1.93e-04},
-      {73,362,-7.74e-04},
-      {73,363,-1.93e-04},
-      {73,378,-4.84e-05},
-      {73,379,-1.93e-04},
-      {73,380,-4.84e-05},
-      {73,381,-1.93e-04},
-      {73,388,-4.84e-05},
-      {74,74,8.29e-02},
-      {74,57,-1.03e-02},
-      {74,58,-1.03e-02},
-      {74,72,-1.03e-02},
-      {74,73,-1.03e-02},
-      {74,75,-1.03e-02},
-      {74,92,-1.03e-02},
-      {74,98,-1.03e-02},
-      {74,99,-1.03e-02},
-      {74,346,-1.93e-04},
-      {74,347,-4.84e-05},
-      {74,361,-4.84e-05},
-      {74,362,-1.93e-04},
-      {74,363,-7.74e-04},
-      {74,364,-1.93e-04},
-      {74,381,-4.84e-05},
-      {74,387,-4.84e-05},
-      {74,388,-1.93e-04},
-      {75,75,8.29e-02},
-      {75,57,-1.03e-02},
-      {75,58,-1.03e-02},
-      {75,59,-1.03e-02},
-      {75,74,-1.03e-02},
-      {75,76,-1.03e-02},
-      {75,97,-1.03e-02},
-      {75,98,-1.03e-02},
-      {75,99,-1.03e-02},
-      {75,346,-4.84e-05},
-      {75,347,-1.93e-04},
-      {75,348,-4.84e-05},
-      {75,363,-1.93e-04},
-      {75,364,-7.74e-04},
-      {75,365,-1.93e-04},
-      {75,386,-4.84e-05},
-      {75,387,-1.93e-04},
-      {75,388,-4.84e-05},
-      {76,76,8.29e-02},
-      {76,58,-1.03e-02},
-      {76,59,-1.03e-02},
-      {76,60,-1.03e-02},
-      {76,75,-1.03e-02},
-      {76,77,-1.03e-02},
-      {76,96,-1.03e-02},
-      {76,97,-1.03e-02},
-      {76,98,-1.03e-02},
-      {76,347,-4.84e-05},
-      {76,348,-1.93e-04},
-      {76,349,-4.84e-05},
-      {76,364,-1.93e-04},
-      {76,365,-7.74e-04},
-      {76,366,-1.93e-04},
-      {76,385,-4.84e-05},
-      {76,386,-1.93e-04},
-      {76,387,-4.84e-05},
-      {77,77,8.29e-02},
-      {77,59,-1.03e-02},
-      {77,60,-1.03e-02},
-      {77,61,-1.03e-02},
-      {77,76,-1.03e-02},
-      {77,78,-1.03e-02},
-      {77,95,-1.03e-02},
-      {77,96,-1.03e-02},
-      {77,97,-1.03e-02},
-      {77,348,-4.84e-05},
-      {77,349,-1.93e-04},
-      {77,350,-4.84e-05},
-      {77,365,-1.93e-04},
-      {77,366,-7.74e-04},
-      {77,367,-1.93e-04},
-      {77,384,-4.84e-05},
-      {77,385,-1.93e-04},
-      {77,386,-4.84e-05},
-      {78,78,8.29e-02},
-      {78,60,-1.03e-02},
-      {78,61,-1.03e-02},
-      {78,62,-1.03e-02},
-      {78,77,-1.03e-02},
-      {78,79,-1.03e-02},
-      {78,94,-1.03e-02},
-      {78,95,-1.03e-02},
-      {78,96,-1.03e-02},
-      {78,349,-4.84e-05},
-      {78,350,-1.93e-04},
-      {78,351,-4.84e-05},
-      {78,366,-1.93e-04},
-      {78,367,-7.74e-04},
-      {78,368,-1.93e-04},
-      {78,383,-4.84e-05},
-      {78,384,-1.93e-04},
-      {78,385,-4.84e-05},
-      {79,79,8.29e-02},
-      {79,61,-1.03e-02},
-      {79,62,-1.03e-02},
-      {79,63,-1.03e-02},
-      {79,78,-1.03e-02},
-      {79,80,-1.03e-02},
-      {79,93,-1.03e-02},
-      {79,94,-1.03e-02},
-      {79,95,-1.03e-02},
-      {79,350,-4.84e-05},
-      {79,351,-1.93e-04},
-      {79,352,-4.84e-05},
-      {79,367,-1.93e-04},
-      {79,368,-7.74e-04},
-      {79,369,-1.93e-04},
-      {79,382,-4.84e-05},
-      {79,383,-1.93e-04},
-      {79,384,-4.84e-05},
-      {80,80,8.29e-02},
-      {80,50,-1.03e-02},
-      {80,62,-1.03e-02},
-      {80,63,-1.03e-02},
-      {80,65,-1.03e-02},
-      {80,79,-1.03e-02},
-      {80,82,-1.03e-02},
-      {80,93,-1.03e-02},
-      {80,94,-1.03e-02},
-      {80,339,-4.84e-05},
-      {80,351,-4.84e-05},
-      {80,352,-1.93e-04},
-      {80,354,-1.93e-04},
-      {80,368,-1.93e-04},
-      {80,369,-7.74e-04},
-      {80,371,-4.84e-05},
-      {80,382,-1.93e-04},
-      {80,383,-4.84e-05},
-      {81,81,2.08e-01},
-      {81,64,3.65e-02},
-      {81,66,-1.03e-02},
-      {81,83,-1.03e-02},
-      {81,100,3.65e-02},
-      {81,102,-1.03e-02},
-      {81,353,-9.67e-05},
-      {81,355,-4.84e-05},
-      {81,370,-3.87e-04},
-      {81,372,-1.93e-04},
-      {81,389,-9.67e-05},
-      {81,391,-4.84e-05},
-      {82,82,2.08e-01},
-      {82,65,3.65e-02},
-      {82,80,-1.03e-02},
-      {82,93,-1.03e-02},
-      {82,101,3.65e-02},
-      {82,115,-1.03e-02},
-      {82,354,-9.67e-05},
-      {82,369,-4.84e-05},
-      {82,371,-3.87e-04},
-      {82,382,-1.93e-04},
-      {82,390,-9.67e-05},
-      {82,404,-4.84e-05},
-      {83,83,8.29e-02},
-      {83,64,-1.03e-02},
-      {83,66,-1.03e-02},
-      {83,67,-1.03e-02},
-      {83,81,-1.03e-02},
-      {83,84,-1.03e-02},
-      {83,100,-1.03e-02},
-      {83,102,-1.03e-02},
-      {83,103,-1.03e-02},
-      {83,353,-4.84e-05},
-      {83,355,-1.93e-04},
-      {83,356,-4.84e-05},
-      {83,370,-1.93e-04},
-      {83,372,-7.74e-04},
-      {83,373,-1.93e-04},
-      {83,389,-4.84e-05},
-      {83,391,-1.93e-04},
-      {83,392,-4.84e-05},
-      {84,84,8.29e-02},
-      {84,66,-1.03e-02},
-      {84,67,-1.03e-02},
-      {84,68,-1.03e-02},
-      {84,83,-1.03e-02},
-      {84,85,-1.03e-02},
-      {84,102,-1.03e-02},
-      {84,103,-1.03e-02},
-      {84,104,-1.03e-02},
-      {84,355,-4.84e-05},
-      {84,356,-1.93e-04},
-      {84,357,-4.84e-05},
-      {84,372,-1.93e-04},
-      {84,373,-7.74e-04},
-      {84,374,-1.93e-04},
-      {84,391,-4.84e-05},
-      {84,392,-1.93e-04},
-      {84,393,-4.84e-05},
-      {85,85,8.29e-02},
-      {85,67,-1.03e-02},
-      {85,68,-1.03e-02},
-      {85,69,-1.03e-02},
-      {85,84,-1.03e-02},
-      {85,86,-1.03e-02},
-      {85,103,-1.03e-02},
-      {85,104,-1.03e-02},
-      {85,105,-1.03e-02},
-      {85,356,-4.84e-05},
-      {85,357,-1.93e-04},
-      {85,358,-4.84e-05},
-      {85,373,-1.93e-04},
-      {85,374,-7.74e-04},
-      {85,375,-1.93e-04},
-      {85,392,-4.84e-05},
-      {85,393,-1.93e-04},
-      {85,394,-4.84e-05},
-      {86,86,8.29e-02},
-      {86,68,-1.03e-02},
-      {86,69,-1.03e-02},
-      {86,70,-1.03e-02},
-      {86,85,-1.03e-02},
-      {86,87,-1.03e-02},
-      {86,104,-1.03e-02},
-      {86,105,-1.03e-02},
-      {86,106,-1.03e-02},
-      {86,357,-4.84e-05},
-      {86,358,-1.93e-04},
-      {86,359,-4.84e-05},
-      {86,374,-1.93e-04},
-      {86,375,-7.74e-04},
-      {86,376,-1.93e-04},
-      {86,393,-4.84e-05},
-      {86,394,-1.93e-04},
-      {86,395,-4.84e-05},
-      {87,87,8.29e-02},
-      {87,69,-1.03e-02},
-      {87,70,-1.03e-02},
-      {87,71,-1.03e-02},
-      {87,86,-1.03e-02},
-      {87,88,-1.03e-02},
-      {87,105,-1.03e-02},
-      {87,106,-1.03e-02},
-      {87,107,-1.03e-02},
-      {87,358,-4.84e-05},
-      {87,359,-1.93e-04},
-      {87,360,-4.84e-05},
-      {87,375,-1.93e-04},
-      {87,376,-7.74e-04},
-      {87,377,-1.93e-04},
-      {87,394,-4.84e-05},
-      {87,395,-1.93e-04},
-      {87,396,-4.84e-05},
-      {88,88,8.29e-02},
-      {88,70,-1.03e-02},
-      {88,71,-1.03e-02},
-      {88,72,-1.03e-02},
-      {88,87,-1.03e-02},
-      {88,89,-1.03e-02},
-      {88,106,-1.03e-02},
-      {88,107,-1.03e-02},
-      {88,108,-1.03e-02},
-      {88,359,-4.84e-05},
-      {88,360,-1.93e-04},
-      {88,361,-4.84e-05},
-      {88,376,-1.93e-04},
-      {88,377,-7.74e-04},
-      {88,378,-1.93e-04},
-      {88,395,-4.84e-05},
-      {88,396,-1.93e-04},
-      {88,397,-4.84e-05},
-      {89,89,8.29e-02},
-      {89,71,-1.03e-02},
-      {89,72,-1.03e-02},
-      {89,73,-1.03e-02},
-      {89,88,-1.03e-02},
-      {89,90,-1.03e-02},
-      {89,107,-1.03e-02},
-      {89,108,-1.03e-02},
-      {89,109,-1.03e-02},
-      {89,360,-4.84e-05},
-      {89,361,-1.93e-04},
-      {89,362,-4.84e-05},
-      {89,377,-1.93e-04},
-      {89,378,-7.74e-04},
-      {89,379,-1.93e-04},
-      {89,396,-4.84e-05},
-      {89,397,-1.93e-04},
-      {89,398,-4.84e-05},
-      {90,90,8.29e-02},
-      {90,72,-1.03e-02},
-      {90,73,-1.03e-02},
-      {90,89,-1.03e-02},
-      {90,91,-1.03e-02},
-      {90,92,-1.03e-02},
-      {90,108,-1.03e-02},
-      {90,109,-1.03e-02},
-      {90,110,-1.03e-02},
-      {90,361,-4.84e-05},
-      {90,362,-1.93e-04},
-      {90,378,-1.93e-04},
-      {90,379,-7.74e-04},
-      {90,380,-1.93e-04},
-      {90,381,-4.84e-05},
-      {90,397,-4.84e-05},
-      {90,398,-1.93e-04},
-      {90,399,-4.84e-05},
-      {91,91,8.29e-02},
-      {91,73,-1.03e-02},
-      {91,90,-1.03e-02},
-      {91,92,-1.03e-02},
-      {91,109,-1.03e-02},
-      {91,110,-1.03e-02},
-      {91,111,-1.03e-02},
-      {91,112,-1.03e-02},
-      {91,113,-1.03e-02},
-      {91,362,-4.84e-05},
-      {91,379,-1.93e-04},
-      {91,380,-7.74e-04},
-      {91,381,-1.93e-04},
-      {91,398,-4.84e-05},
-      {91,399,-1.93e-04},
-      {91,400,-4.84e-05},
-      {91,401,-1.93e-04},
-      {91,402,-4.84e-05},
-      {92,92,8.29e-02},
-      {92,73,-1.03e-02},
-      {92,74,-1.03e-02},
-      {92,90,-1.03e-02},
-      {92,91,-1.03e-02},
-      {92,99,-1.03e-02},
-      {92,112,-1.03e-02},
-      {92,113,-1.03e-02},
-      {92,120,-1.03e-02},
-      {92,362,-1.93e-04},
-      {92,363,-4.84e-05},
-      {92,379,-4.84e-05},
-      {92,380,-1.93e-04},
-      {92,381,-7.74e-04},
-      {92,388,-1.93e-04},
-      {92,401,-4.84e-05},
-      {92,402,-1.93e-04},
-      {92,409,-4.84e-05},
-      {93,93,8.29e-02},
-      {93,65,-1.03e-02},
-      {93,79,-1.03e-02},
-      {93,80,-1.03e-02},
-      {93,82,-1.03e-02},
-      {93,94,-1.03e-02},
-      {93,101,-1.03e-02},
-      {93,114,-1.03e-02},
-      {93,115,-1.03e-02},
-      {93,354,-4.84e-05},
-      {93,368,-4.84e-05},
-      {93,369,-1.93e-04},
-      {93,371,-1.93e-04},
-      {93,382,-7.74e-04},
-      {93,383,-1.93e-04},
-      {93,390,-4.84e-05},
-      {93,403,-4.84e-05},
-      {93,404,-1.93e-04},
-      {94,94,8.29e-02},
-      {94,78,-1.03e-02},
-      {94,79,-1.03e-02},
-      {94,80,-1.03e-02},
-      {94,93,-1.03e-02},
-      {94,95,-1.03e-02},
-      {94,114,-1.03e-02},
-      {94,115,-1.03e-02},
-      {94,117,-1.03e-02},
-      {94,367,-4.84e-05},
-      {94,368,-1.93e-04},
-      {94,369,-4.84e-05},
-      {94,382,-1.93e-04},
-      {94,383,-7.74e-04},
-      {94,384,-1.93e-04},
-      {94,403,-1.93e-04},
-      {94,404,-4.84e-05},
-      {94,406,-4.84e-05},
-      {95,95,8.29e-02},
-      {95,77,-1.03e-02},
-      {95,78,-1.03e-02},
-      {95,79,-1.03e-02},
-      {95,94,-1.03e-02},
-      {95,96,-1.03e-02},
-      {95,114,-1.03e-02},
-      {95,116,-1.03e-02},
-      {95,117,-1.03e-02},
-      {95,366,-4.84e-05},
-      {95,367,-1.93e-04},
-      {95,368,-4.84e-05},
-      {95,383,-1.93e-04},
-      {95,384,-7.74e-04},
-      {95,385,-1.93e-04},
-      {95,403,-4.84e-05},
-      {95,405,-4.84e-05},
-      {95,406,-1.93e-04},
-      {96,96,8.29e-02},
-      {96,76,-1.03e-02},
-      {96,77,-1.03e-02},
-      {96,78,-1.03e-02},
-      {96,95,-1.03e-02},
-      {96,97,-1.03e-02},
-      {96,116,-1.03e-02},
-      {96,117,-1.03e-02},
-      {96,119,-1.03e-02},
-      {96,365,-4.84e-05},
-      {96,366,-1.93e-04},
-      {96,367,-4.84e-05},
-      {96,384,-1.93e-04},
-      {96,385,-7.74e-04},
-      {96,386,-1.93e-04},
-      {96,405,-1.93e-04},
-      {96,406,-4.84e-05},
-      {96,408,-4.84e-05},
-      {97,97,8.29e-02},
-      {97,75,-1.03e-02},
-      {97,76,-1.03e-02},
-      {97,77,-1.03e-02},
-      {97,96,-1.03e-02},
-      {97,98,-1.03e-02},
-      {97,116,-1.03e-02},
-      {97,118,-1.03e-02},
-      {97,119,-1.03e-02},
-      {97,364,-4.84e-05},
-      {97,365,-1.93e-04},
-      {97,366,-4.84e-05},
-      {97,385,-1.93e-04},
-      {97,386,-7.74e-04},
-      {97,387,-1.93e-04},
-      {97,405,-4.84e-05},
-      {97,407,-4.84e-05},
-      {97,408,-1.93e-04},
-      {98,98,8.29e-02},
-      {98,74,-1.03e-02},
-      {98,75,-1.03e-02},
-      {98,76,-1.03e-02},
-      {98,97,-1.03e-02},
-      {98,99,-1.03e-02},
-      {98,118,-1.03e-02},
-      {98,119,-1.03e-02},
-      {98,120,-1.03e-02},
-      {98,363,-4.84e-05},
-      {98,364,-1.93e-04},
-      {98,365,-4.84e-05},
-      {98,386,-1.93e-04},
-      {98,387,-7.74e-04},
-      {98,388,-1.93e-04},
-      {98,407,-1.93e-04},
-      {98,408,-4.84e-05},
-      {98,409,-4.84e-05},
-      {99,99,8.29e-02},
-      {99,73,-1.03e-02},
-      {99,74,-1.03e-02},
-      {99,75,-1.03e-02},
-      {99,92,-1.03e-02},
-      {99,98,-1.03e-02},
-      {99,113,-1.03e-02},
-      {99,118,-1.03e-02},
-      {99,120,-1.03e-02},
-      {99,362,-4.84e-05},
-      {99,363,-1.93e-04},
-      {99,364,-4.84e-05},
-      {99,381,-1.93e-04},
-      {99,387,-1.93e-04},
-      {99,388,-7.74e-04},
-      {99,402,-4.84e-05},
-      {99,407,-4.84e-05},
-      {99,409,-1.93e-04},
-      {100,100,2.08e-01},
-      {100,81,3.65e-02},
-      {100,83,-1.03e-02},
-      {100,102,-1.03e-02},
-      {100,121,3.65e-02},
-      {100,123,-1.03e-02},
-      {100,370,-9.67e-05},
-      {100,372,-4.84e-05},
-      {100,389,-3.87e-04},
-      {100,391,-1.93e-04},
-      {100,410,-9.67e-05},
-      {100,412,-4.84e-05},
-      {101,101,2.08e-01},
-      {101,82,3.65e-02},
-      {101,93,-1.03e-02},
-      {101,115,-1.03e-02},
-      {101,122,3.65e-02},
-      {101,140,-1.03e-02},
-      {101,371,-9.67e-05},
-      {101,382,-4.84e-05},
-      {101,390,-3.87e-04},
-      {101,404,-1.93e-04},
-      {101,411,-9.67e-05},
-      {101,429,-4.84e-05},
-      {102,102,8.29e-02},
-      {102,81,-1.03e-02},
-      {102,83,-1.03e-02},
-      {102,84,-1.03e-02},
-      {102,100,-1.03e-02},
-      {102,103,-1.03e-02},
-      {102,121,-1.03e-02},
-      {102,123,-1.03e-02},
-      {102,124,-1.03e-02},
-      {102,370,-4.84e-05},
-      {102,372,-1.93e-04},
-      {102,373,-4.84e-05},
-      {102,389,-1.93e-04},
-      {102,391,-7.74e-04},
-      {102,392,-1.93e-04},
-      {102,410,-4.84e-05},
-      {102,412,-1.93e-04},
-      {102,413,-4.84e-05},
-      {103,103,8.29e-02},
-      {103,83,-1.03e-02},
-      {103,84,-1.03e-02},
-      {103,85,-1.03e-02},
-      {103,102,-1.03e-02},
-      {103,104,-1.03e-02},
-      {103,123,-1.03e-02},
-      {103,124,-1.03e-02},
-      {103,125,-1.03e-02},
-      {103,372,-4.84e-05},
-      {103,373,-1.93e-04},
-      {103,374,-4.84e-05},
-      {103,391,-1.93e-04},
-      {103,392,-7.74e-04},
-      {103,393,-1.93e-04},
-      {103,412,-4.84e-05},
-      {103,413,-1.93e-04},
-      {103,414,-4.84e-05},
-      {104,104,8.29e-02},
-      {104,84,-1.03e-02},
-      {104,85,-1.03e-02},
-      {104,86,-1.03e-02},
-      {104,103,-1.03e-02},
-      {104,105,-1.03e-02},
-      {104,124,-1.03e-02},
-      {104,125,-1.03e-02},
-      {104,126,-1.03e-02},
-      {104,373,-4.84e-05},
-      {104,374,-1.93e-04},
-      {104,375,-4.84e-05},
-      {104,392,-1.93e-04},
-      {104,393,-7.74e-04},
-      {104,394,-1.93e-04},
-      {104,413,-4.84e-05},
-      {104,414,-1.93e-04},
-      {104,415,-4.84e-05},
-      {105,105,8.29e-02},
-      {105,85,-1.03e-02},
-      {105,86,-1.03e-02},
-      {105,87,-1.03e-02},
-      {105,104,-1.03e-02},
-      {105,106,-1.03e-02},
-      {105,125,-1.03e-02},
-      {105,126,-1.03e-02},
-      {105,127,-1.03e-02},
-      {105,374,-4.84e-05},
-      {105,375,-1.93e-04},
-      {105,376,-4.84e-05},
-      {105,393,-1.93e-04},
-      {105,394,-7.74e-04},
-      {105,395,-1.93e-04},
-      {105,414,-4.84e-05},
-      {105,415,-1.93e-04},
-      {105,416,-4.84e-05},
-      {106,106,8.29e-02},
-      {106,86,-1.03e-02},
-      {106,87,-1.03e-02},
-      {106,88,-1.03e-02},
-      {106,105,-1.03e-02},
-      {106,107,-1.03e-02},
-      {106,126,-1.03e-02},
-      {106,127,-1.03e-02},
-      {106,128,-1.03e-02},
-      {106,375,-4.84e-05},
-      {106,376,-1.93e-04},
-      {106,377,-4.84e-05},
-      {106,394,-1.93e-04},
-      {106,395,-7.74e-04},
-      {106,396,-1.93e-04},
-      {106,415,-4.84e-05},
-      {106,416,-1.93e-04},
-      {106,417,-4.84e-05},
-      {107,107,8.29e-02},
-      {107,87,-1.03e-02},
-      {107,88,-1.03e-02},
-      {107,89,-1.03e-02},
-      {107,106,-1.03e-02},
-      {107,108,-1.03e-02},
-      {107,127,-1.03e-02},
-      {107,128,-1.03e-02},
-      {107,129,-1.03e-02},
-      {107,376,-4.84e-05},
-      {107,377,-1.93e-04},
-      {107,378,-4.84e-05},
-      {107,395,-1.93e-04},
-      {107,396,-7.74e-04},
-      {107,397,-1.93e-04},
-      {107,416,-4.84e-05},
-      {107,417,-1.93e-04},
-      {107,418,-4.84e-05},
-      {108,108,8.29e-02},
-      {108,88,-1.03e-02},
-      {108,89,-1.03e-02},
-      {108,90,-1.03e-02},
-      {108,107,-1.03e-02},
-      {108,109,-1.03e-02},
-      {108,128,-1.03e-02},
-      {108,129,-1.03e-02},
-      {108,130,-1.03e-02},
-      {108,377,-4.84e-05},
-      {108,378,-1.93e-04},
-      {108,379,-4.84e-05},
-      {108,396,-1.93e-04},
-      {108,397,-7.74e-04},
-      {108,398,-1.93e-04},
-      {108,417,-4.84e-05},
-      {108,418,-1.93e-04},
-      {108,419,-4.84e-05},
-      {109,109,8.29e-02},
-      {109,89,-1.03e-02},
-      {109,90,-1.03e-02},
-      {109,91,-1.03e-02},
-      {109,108,-1.03e-02},
-      {109,110,-1.03e-02},
-      {109,129,-1.03e-02},
-      {109,130,-1.03e-02},
-      {109,131,-1.03e-02},
-      {109,378,-4.84e-05},
-      {109,379,-1.93e-04},
-      {109,380,-4.84e-05},
-      {109,397,-1.93e-04},
-      {109,398,-7.74e-04},
-      {109,399,-1.93e-04},
-      {109,418,-4.84e-05},
-      {109,419,-1.93e-04},
-      {109,420,-4.84e-05},
-      {110,110,8.29e-02},
-      {110,90,-1.03e-02},
-      {110,91,-1.03e-02},
-      {110,109,-1.03e-02},
-      {110,111,-1.03e-02},
-      {110,112,-1.03e-02},
-      {110,130,-1.03e-02},
-      {110,131,-1.03e-02},
-      {110,132,-1.03e-02},
-      {110,379,-4.84e-05},
-      {110,380,-1.93e-04},
-      {110,398,-1.93e-04},
-      {110,399,-7.74e-04},
-      {110,400,-1.93e-04},
-      {110,401,-4.84e-05},
-      {110,419,-4.84e-05},
-      {110,420,-1.93e-04},
-      {110,421,-4.84e-05},
-      {111,111,8.29e-02},
-      {111,91,-1.03e-02},
-      {111,110,-1.03e-02},
-      {111,112,-1.03e-02},
-      {111,131,-1.03e-02},
-      {111,132,-1.03e-02},
-      {111,133,-1.03e-02},
-      {111,134,-1.03e-02},
-      {111,135,-1.03e-02},
-      {111,380,-4.84e-05},
-      {111,399,-1.93e-04},
-      {111,400,-7.74e-04},
-      {111,401,-1.93e-04},
-      {111,420,-4.84e-05},
-      {111,421,-1.93e-04},
-      {111,422,-4.84e-05},
-      {111,423,-1.93e-04},
-      {111,424,-4.84e-05},
-      {112,112,8.29e-02},
-      {112,91,-1.03e-02},
-      {112,92,-1.03e-02},
-      {112,110,-1.03e-02},
-      {112,111,-1.03e-02},
-      {112,113,-1.03e-02},
-      {112,134,-1.03e-02},
-      {112,135,-1.03e-02},
-      {112,136,-1.03e-02},
-      {112,380,-1.93e-04},
-      {112,381,-4.84e-05},
-      {112,399,-4.84e-05},
-      {112,400,-1.93e-04},
-      {112,401,-7.74e-04},
-      {112,402,-1.93e-04},
-      {112,423,-4.84e-05},
-      {112,424,-1.93e-04},
-      {112,425,-4.84e-05},
-      {113,113,8.29e-02},
-      {113,91,-1.03e-02},
-      {113,92,-1.03e-02},
-      {113,99,-1.03e-02},
-      {113,112,-1.03e-02},
-      {113,120,-1.03e-02},
-      {113,135,-1.03e-02},
-      {113,136,-1.03e-02},
-      {113,141,-1.03e-02},
-      {113,380,-4.84e-05},
-      {113,381,-1.93e-04},
-      {113,388,-4.84e-05},
-      {113,401,-1.93e-04},
-      {113,402,-7.74e-04},
-      {113,409,-1.93e-04},
-      {113,424,-4.84e-05},
-      {113,425,-1.93e-04},
-      {113,430,-4.84e-05},
-      {114,114,8.29e-02},
-      {114,93,-1.03e-02},
-      {114,94,-1.03e-02},
-      {114,95,-1.03e-02},
-      {114,115,-1.03e-02},
-      {114,117,-1.03e-02},
-      {114,137,-1.03e-02},
-      {114,138,-1.03e-02},
-      {114,140,-1.03e-02},
-      {114,382,-4.84e-05},
-      {114,383,-1.93e-04},
-      {114,384,-4.84e-05},
-      {114,403,-7.74e-04},
-      {114,404,-1.93e-04},
-      {114,406,-1.93e-04},
-      {114,426,-4.84e-05},
-      {114,427,-1.93e-04},
-      {114,429,-4.84e-05},
-      {115,115,8.29e-02},
-      {115,82,-1.03e-02},
-      {115,93,-1.03e-02},
-      {115,94,-1.03e-02},
-      {115,101,-1.03e-02},
-      {115,114,-1.03e-02},
-      {115,122,-1.03e-02},
-      {115,138,-1.03e-02},
-      {115,140,-1.03e-02},
-      {115,371,-4.84e-05},
-      {115,382,-1.93e-04},
-      {115,383,-4.84e-05},
-      {115,390,-1.93e-04},
-      {115,403,-1.93e-04},
-      {115,404,-7.74e-04},
-      {115,411,-4.84e-05},
-      {115,427,-4.84e-05},
-      {115,429,-1.93e-04},
-      {116,116,8.29e-02},
-      {116,95,-1.03e-02},
-      {116,96,-1.03e-02},
-      {116,97,-1.03e-02},
-      {116,117,-1.03e-02},
-      {116,119,-1.03e-02},
-      {116,137,-1.03e-02},
-      {116,139,-1.03e-02},
-      {116,143,-1.03e-02},
-      {116,384,-4.84e-05},
-      {116,385,-1.93e-04},
-      {116,386,-4.84e-05},
-      {116,405,-7.74e-04},
-      {116,406,-1.93e-04},
-      {116,408,-1.93e-04},
-      {116,426,-4.84e-05},
-      {116,428,-1.93e-04},
-      {116,432,-4.84e-05},
-      {117,117,8.29e-02},
-      {117,94,-1.03e-02},
-      {117,95,-1.03e-02},
-      {117,96,-1.03e-02},
-      {117,114,-1.03e-02},
-      {117,116,-1.03e-02},
-      {117,137,-1.03e-02},
-      {117,138,-1.03e-02},
-      {117,139,-1.03e-02},
-      {117,383,-4.84e-05},
-      {117,384,-1.93e-04},
-      {117,385,-4.84e-05},
-      {117,403,-1.93e-04},
-      {117,405,-1.93e-04},
-      {117,406,-7.74e-04},
-      {117,426,-1.93e-04},
-      {117,427,-4.84e-05},
-      {117,428,-4.84e-05},
-      {118,118,8.29e-02},
-      {118,97,-1.03e-02},
-      {118,98,-1.03e-02},
-      {118,99,-1.03e-02},
-      {118,119,-1.03e-02},
-      {118,120,-1.03e-02},
-      {118,141,-1.03e-02},
-      {118,142,-1.03e-02},
-      {118,143,-1.03e-02},
-      {118,386,-4.84e-05},
-      {118,387,-1.93e-04},
-      {118,388,-4.84e-05},
-      {118,407,-7.74e-04},
-      {118,408,-1.93e-04},
-      {118,409,-1.93e-04},
-      {118,430,-4.84e-05},
-      {118,431,-1.93e-04},
-      {118,432,-4.84e-05},
-      {119,119,8.29e-02},
-      {119,96,-1.03e-02},
-      {119,97,-1.03e-02},
-      {119,98,-1.03e-02},
-      {119,116,-1.03e-02},
-      {119,118,-1.03e-02},
-      {119,139,-1.03e-02},
-      {119,142,-1.03e-02},
-      {119,143,-1.03e-02},
-      {119,385,-4.84e-05},
-      {119,386,-1.93e-04},
-      {119,387,-4.84e-05},
-      {119,405,-1.93e-04},
-      {119,407,-1.93e-04},
-      {119,408,-7.74e-04},
-      {119,428,-4.84e-05},
-      {119,431,-4.84e-05},
-      {119,432,-1.93e-04},
-      {120,120,8.29e-02},
-      {120,92,-1.03e-02},
-      {120,98,-1.03e-02},
-      {120,99,-1.03e-02},
-      {120,113,-1.03e-02},
-      {120,118,-1.03e-02},
-      {120,136,-1.03e-02},
-      {120,141,-1.03e-02},
-      {120,142,-1.03e-02},
-      {120,381,-4.84e-05},
-      {120,387,-4.84e-05},
-      {120,388,-1.93e-04},
-      {120,402,-1.93e-04},
-      {120,407,-1.93e-04},
-      {120,409,-7.74e-04},
-      {120,425,-4.84e-05},
-      {120,430,-1.93e-04},
-      {120,431,-4.84e-05},
-      {121,121,2.08e-01},
-      {121,100,3.65e-02},
-      {121,102,-1.03e-02},
-      {121,123,-1.03e-02},
-      {121,144,3.65e-02},
-      {121,146,-1.03e-02},
-      {121,389,-9.67e-05},
-      {121,391,-4.84e-05},
-      {121,410,-3.87e-04},
-      {121,412,-1.93e-04},
-      {121,433,-9.67e-05},
-      {121,435,-4.84e-05},
-      {122,122,2.08e-01},
-      {122,101,3.65e-02},
-      {122,115,-1.03e-02},
-      {122,140,-1.03e-02},
-      {122,145,3.65e-02},
-      {122,165,-1.03e-02},
-      {122,390,-9.67e-05},
-      {122,404,-4.84e-05},
-      {122,411,-3.87e-04},
-      {122,429,-1.93e-04},
-      {122,434,-9.67e-05},
-      {122,454,-4.84e-05},
-      {123,123,8.29e-02},
-      {123,100,-1.03e-02},
-      {123,102,-1.03e-02},
-      {123,103,-1.03e-02},
-      {123,121,-1.03e-02},
-      {123,124,-1.03e-02},
-      {123,144,-1.03e-02},
-      {123,146,-1.03e-02},
-      {123,147,-1.03e-02},
-      {123,389,-4.84e-05},
-      {123,391,-1.93e-04},
-      {123,392,-4.84e-05},
-      {123,410,-1.93e-04},
-      {123,412,-7.74e-04},
-      {123,413,-1.93e-04},
-      {123,433,-4.84e-05},
-      {123,435,-1.93e-04},
-      {123,436,-4.84e-05},
-      {124,124,8.29e-02},
-      {124,102,-1.03e-02},
-      {124,103,-1.03e-02},
-      {124,104,-1.03e-02},
-      {124,123,-1.03e-02},
-      {124,125,-1.03e-02},
-      {124,146,-1.03e-02},
-      {124,147,-1.03e-02},
-      {124,148,-1.03e-02},
-      {124,391,-4.84e-05},
-      {124,392,-1.93e-04},
-      {124,393,-4.84e-05},
-      {124,412,-1.93e-04},
-      {124,413,-7.74e-04},
-      {124,414,-1.93e-04},
-      {124,435,-4.84e-05},
-      {124,436,-1.93e-04},
-      {124,437,-4.84e-05},
-      {125,125,8.29e-02},
-      {125,103,-1.03e-02},
-      {125,104,-1.03e-02},
-      {125,105,-1.03e-02},
-      {125,124,-1.03e-02},
-      {125,126,-1.03e-02},
-      {125,147,-1.03e-02},
-      {125,148,-1.03e-02},
-      {125,149,-1.03e-02},
-      {125,392,-4.84e-05},
-      {125,393,-1.93e-04},
-      {125,394,-4.84e-05},
-      {125,413,-1.93e-04},
-      {125,414,-7.74e-04},
-      {125,415,-1.93e-04},
-      {125,436,-4.84e-05},
-      {125,437,-1.93e-04},
-      {125,438,-4.84e-05},
-      {126,126,8.29e-02},
-      {126,104,-1.03e-02},
-      {126,105,-1.03e-02},
-      {126,106,-1.03e-02},
-      {126,125,-1.03e-02},
-      {126,127,-1.03e-02},
-      {126,148,-1.03e-02},
-      {126,149,-1.03e-02},
-      {126,150,-1.03e-02},
-      {126,393,-4.84e-05},
-      {126,394,-1.93e-04},
-      {126,395,-4.84e-05},
-      {126,414,-1.93e-04},
-      {126,415,-7.74e-04},
-      {126,416,-1.93e-04},
-      {126,437,-4.84e-05},
-      {126,438,-1.93e-04},
-      {126,439,-4.84e-05},
-      {127,127,8.29e-02},
-      {127,105,-1.03e-02},
-      {127,106,-1.03e-02},
-      {127,107,-1.03e-02},
-      {127,126,-1.03e-02},
-      {127,128,-1.03e-02},
-      {127,149,-1.03e-02},
-      {127,150,-1.03e-02},
-      {127,151,-1.03e-02},
-      {127,394,-4.84e-05},
-      {127,395,-1.93e-04},
-      {127,396,-4.84e-05},
-      {127,415,-1.93e-04},
-      {127,416,-7.74e-04},
-      {127,417,-1.93e-04},
-      {127,438,-4.84e-05},
-      {127,439,-1.93e-04},
-      {127,440,-4.84e-05},
-      {128,128,8.29e-02},
-      {128,106,-1.03e-02},
-      {128,107,-1.03e-02},
-      {128,108,-1.03e-02},
-      {128,127,-1.03e-02},
-      {128,129,-1.03e-02},
-      {128,150,-1.03e-02},
-      {128,151,-1.03e-02},
-      {128,152,-1.03e-02},
-      {128,395,-4.84e-05},
-      {128,396,-1.93e-04},
-      {128,397,-4.84e-05},
-      {128,416,-1.93e-04},
-      {128,417,-7.74e-04},
-      {128,418,-1.93e-04},
-      {128,439,-4.84e-05},
-      {128,440,-1.93e-04},
-      {128,441,-4.84e-05},
-      {129,129,8.29e-02},
-      {129,107,-1.03e-02},
-      {129,108,-1.03e-02},
-      {129,109,-1.03e-02},
-      {129,128,-1.03e-02},
-      {129,130,-1.03e-02},
-      {129,151,-1.03e-02},
-      {129,152,-1.03e-02},
-      {129,153,-1.03e-02},
-      {129,396,-4.84e-05},
-      {129,397,-1.93e-04},
-      {129,398,-4.84e-05},
-      {129,417,-1.93e-04},
-      {129,418,-7.74e-04},
-      {129,419,-1.93e-04},
-      {129,440,-4.84e-05},
-      {129,441,-1.93e-04},
-      {129,442,-4.84e-05},
-      {130,130,8.29e-02},
-      {130,108,-1.03e-02},
-      {130,109,-1.03e-02},
-      {130,110,-1.03e-02},
-      {130,129,-1.03e-02},
-      {130,131,-1.03e-02},
-      {130,152,-1.03e-02},
-      {130,153,-1.03e-02},
-      {130,154,-1.03e-02},
-      {130,397,-4.84e-05},
-      {130,398,-1.93e-04},
-      {130,399,-4.84e-05},
-      {130,418,-1.93e-04},
-      {130,419,-7.74e-04},
-      {130,420,-1.93e-04},
-      {130,441,-4.84e-05},
-      {130,442,-1.93e-04},
-      {130,443,-4.84e-05},
-      {131,131,8.29e-02},
-      {131,109,-1.03e-02},
-      {131,110,-1.03e-02},
-      {131,111,-1.03e-02},
-      {131,130,-1.03e-02},
-      {131,132,-1.03e-02},
-      {131,153,-1.03e-02},
-      {131,154,-1.03e-02},
-      {131,155,-1.03e-02},
-      {131,398,-4.84e-05},
-      {131,399,-1.93e-04},
-      {131,400,-4.84e-05},
-      {131,419,-1.93e-04},
-      {131,420,-7.74e-04},
-      {131,421,-1.93e-04},
-      {131,442,-4.84e-05},
-      {131,443,-1.93e-04},
-      {131,444,-4.84e-05},
-      {132,132,8.29e-02},
-      {132,110,-1.03e-02},
-      {132,111,-1.03e-02},
-      {132,131,-1.03e-02},
-      {132,133,-1.03e-02},
-      {132,134,-1.03e-02},
-      {132,154,-1.03e-02},
-      {132,155,-1.03e-02},
-      {132,156,-1.03e-02},
-      {132,399,-4.84e-05},
-      {132,400,-1.93e-04},
-      {132,420,-1.93e-04},
-      {132,421,-7.74e-04},
-      {132,422,-1.93e-04},
-      {132,423,-4.84e-05},
-      {132,443,-4.84e-05},
-      {132,444,-1.93e-04},
-      {132,445,-4.84e-05},
-      {133,133,8.29e-02},
-      {133,111,-1.03e-02},
-      {133,132,-1.03e-02},
-      {133,134,-1.03e-02},
-      {133,155,-1.03e-02},
-      {133,156,-1.03e-02},
-      {133,157,-1.03e-02},
-      {133,158,-1.03e-02},
-      {133,159,-1.03e-02},
-      {133,400,-4.84e-05},
-      {133,421,-1.93e-04},
-      {133,422,-7.74e-04},
-      {133,423,-1.93e-04},
-      {133,444,-4.84e-05},
-      {133,445,-1.93e-04},
-      {133,446,-4.84e-05},
-      {133,447,-1.93e-04},
-      {133,448,-4.84e-05},
-      {134,134,8.29e-02},
-      {134,111,-1.03e-02},
-      {134,112,-1.03e-02},
-      {134,132,-1.03e-02},
-      {134,133,-1.03e-02},
-      {134,135,-1.03e-02},
-      {134,158,-1.03e-02},
-      {134,159,-1.03e-02},
-      {134,160,-1.03e-02},
-      {134,400,-1.93e-04},
-      {134,401,-4.84e-05},
-      {134,421,-4.84e-05},
-      {134,422,-1.93e-04},
-      {134,423,-7.74e-04},
-      {134,424,-1.93e-04},
-      {134,447,-4.84e-05},
-      {134,448,-1.93e-04},
-      {134,449,-4.84e-05},
-      {135,135,8.29e-02},
-      {135,111,-1.03e-02},
-      {135,112,-1.03e-02},
-      {135,113,-1.03e-02},
-      {135,134,-1.03e-02},
-      {135,136,-1.03e-02},
-      {135,159,-1.03e-02},
-      {135,160,-1.03e-02},
-      {135,161,-1.03e-02},
-      {135,400,-4.84e-05},
-      {135,401,-1.93e-04},
-      {135,402,-4.84e-05},
-      {135,423,-1.93e-04},
-      {135,424,-7.74e-04},
-      {135,425,-1.93e-04},
-      {135,448,-4.84e-05},
-      {135,449,-1.93e-04},
-      {135,450,-4.84e-05},
-      {136,136,8.29e-02},
-      {136,112,-1.03e-02},
-      {136,113,-1.03e-02},
-      {136,120,-1.03e-02},
-      {136,135,-1.03e-02},
-      {136,141,-1.03e-02},
-      {136,160,-1.03e-02},
-      {136,161,-1.03e-02},
-      {136,166,-1.03e-02},
-      {136,401,-4.84e-05},
-      {136,402,-1.93e-04},
-      {136,409,-4.84e-05},
-      {136,424,-1.93e-04},
-      {136,425,-7.74e-04},
-      {136,430,-1.93e-04},
-      {136,449,-4.84e-05},
-      {136,450,-1.93e-04},
-      {136,455,-4.84e-05},
-      {137,137,8.29e-02},
-      {137,114,-1.03e-02},
-      {137,116,-1.03e-02},
-      {137,117,-1.03e-02},
-      {137,138,-1.03e-02},
-      {137,139,-1.03e-02},
-      {137,162,-1.03e-02},
-      {137,163,-1.03e-02},
-      {137,164,-1.03e-02},
-      {137,403,-4.84e-05},
-      {137,405,-4.84e-05},
-      {137,406,-1.93e-04},
-      {137,426,-7.74e-04},
-      {137,427,-1.93e-04},
-      {137,428,-1.93e-04},
-      {137,451,-4.84e-05},
-      {137,452,-1.93e-04},
-      {137,453,-4.84e-05},
-      {138,138,8.29e-02},
-      {138,114,-1.03e-02},
-      {138,115,-1.03e-02},
-      {138,117,-1.03e-02},
-      {138,137,-1.03e-02},
-      {138,140,-1.03e-02},
-      {138,163,-1.03e-02},
-      {138,164,-1.03e-02},
-      {138,165,-1.03e-02},
-      {138,403,-1.93e-04},
-      {138,404,-4.84e-05},
-      {138,406,-4.84e-05},
-      {138,426,-1.93e-04},
-      {138,427,-7.74e-04},
-      {138,429,-1.93e-04},
-      {138,452,-4.84e-05},
-      {138,453,-1.93e-04},
-      {138,454,-4.84e-05},
-      {139,139,8.29e-02},
-      {139,116,-1.03e-02},
-      {139,117,-1.03e-02},
-      {139,119,-1.03e-02},
-      {139,137,-1.03e-02},
-      {139,143,-1.03e-02},
-      {139,162,-1.03e-02},
-      {139,163,-1.03e-02},
-      {139,168,-1.03e-02},
-      {139,405,-1.93e-04},
-      {139,406,-4.84e-05},
-      {139,408,-4.84e-05},
-      {139,426,-1.93e-04},
-      {139,428,-7.74e-04},
-      {139,432,-1.93e-04},
-      {139,451,-1.93e-04},
-      {139,452,-4.84e-05},
-      {139,457,-4.84e-05},
-      {140,140,8.29e-02},
-      {140,101,-1.03e-02},
-      {140,114,-1.03e-02},
-      {140,115,-1.03e-02},
-      {140,122,-1.03e-02},
-      {140,138,-1.03e-02},
-      {140,145,-1.03e-02},
-      {140,164,-1.03e-02},
-      {140,165,-1.03e-02},
-      {140,390,-4.84e-05},
-      {140,403,-4.84e-05},
-      {140,404,-1.93e-04},
-      {140,411,-1.93e-04},
-      {140,427,-1.93e-04},
-      {140,429,-7.74e-04},
-      {140,434,-4.84e-05},
-      {140,453,-4.84e-05},
-      {140,454,-1.93e-04},
-      {141,141,8.29e-02},
-      {141,113,-1.03e-02},
-      {141,118,-1.03e-02},
-      {141,120,-1.03e-02},
-      {141,136,-1.03e-02},
-      {141,142,-1.03e-02},
-      {141,161,-1.03e-02},
-      {141,166,-1.03e-02},
-      {141,167,-1.03e-02},
-      {141,402,-4.84e-05},
-      {141,407,-4.84e-05},
-      {141,409,-1.93e-04},
-      {141,425,-1.93e-04},
-      {141,430,-7.74e-04},
-      {141,431,-1.93e-04},
-      {141,450,-4.84e-05},
-      {141,455,-1.93e-04},
-      {141,456,-4.84e-05},
-      {142,142,8.29e-02},
-      {142,118,-1.03e-02},
-      {142,119,-1.03e-02},
-      {142,120,-1.03e-02},
-      {142,141,-1.03e-02},
-      {142,143,-1.03e-02},
-      {142,166,-1.03e-02},
-      {142,167,-1.03e-02},
-      {142,168,-1.03e-02},
-      {142,407,-1.93e-04},
-      {142,408,-4.84e-05},
-      {142,409,-4.84e-05},
-      {142,430,-1.93e-04},
-      {142,431,-7.74e-04},
-      {142,432,-1.93e-04},
-      {142,455,-4.84e-05},
-      {142,456,-1.93e-04},
-      {142,457,-4.84e-05},
-      {143,143,8.29e-02},
-      {143,116,-1.03e-02},
-      {143,118,-1.03e-02},
-      {143,119,-1.03e-02},
-      {143,139,-1.03e-02},
-      {143,142,-1.03e-02},
-      {143,162,-1.03e-02},
-      {143,167,-1.03e-02},
-      {143,168,-1.03e-02},
-      {143,405,-4.84e-05},
-      {143,407,-4.84e-05},
-      {143,408,-1.93e-04},
-      {143,428,-1.93e-04},
-      {143,431,-1.93e-04},
-      {143,432,-7.74e-04},
-      {143,451,-4.84e-05},
-      {143,456,-4.84e-05},
-      {143,457,-1.93e-04},
-      {144,144,2.08e-01},
-      {144,121,3.65e-02},
-      {144,123,-1.03e-02},
-      {144,146,-1.03e-02},
-      {144,169,3.65e-02},
-      {144,171,-1.03e-02},
-      {144,410,-9.67e-05},
-      {144,412,-4.84e-05},
-      {144,433,-3.87e-04},
-      {144,435,-1.93e-04},
-      {144,458,-9.67e-05},
-      {144,460,-4.84e-05},
-      {145,145,2.08e-01},
-      {145,122,3.65e-02},
-      {145,140,-1.03e-02},
-      {145,165,-1.03e-02},
-      {145,170,3.65e-02},
-      {145,193,-1.03e-02},
-      {145,411,-9.67e-05},
-      {145,429,-4.84e-05},
-      {145,434,-3.87e-04},
-      {145,454,-1.93e-04},
-      {145,459,-9.67e-05},
-      {145,482,-4.84e-05},
-      {146,146,8.29e-02},
-      {146,121,-1.03e-02},
-      {146,123,-1.03e-02},
-      {146,124,-1.03e-02},
-      {146,144,-1.03e-02},
-      {146,147,-1.03e-02},
-      {146,169,-1.03e-02},
-      {146,171,-1.03e-02},
-      {146,172,-1.03e-02},
-      {146,410,-4.84e-05},
-      {146,412,-1.93e-04},
-      {146,413,-4.84e-05},
-      {146,433,-1.93e-04},
-      {146,435,-7.74e-04},
-      {146,436,-1.93e-04},
-      {146,458,-4.84e-05},
-      {146,460,-1.93e-04},
-      {146,461,-4.84e-05},
-      {147,147,8.29e-02},
-      {147,123,-1.03e-02},
-      {147,124,-1.03e-02},
-      {147,125,-1.03e-02},
-      {147,146,-1.03e-02},
-      {147,148,-1.03e-02},
-      {147,171,-1.03e-02},
-      {147,172,-1.03e-02},
-      {147,173,-1.03e-02},
-      {147,412,-4.84e-05},
-      {147,413,-1.93e-04},
-      {147,414,-4.84e-05},
-      {147,435,-1.93e-04},
-      {147,436,-7.74e-04},
-      {147,437,-1.93e-04},
-      {147,460,-4.84e-05},
-      {147,461,-1.93e-04},
-      {147,462,-4.84e-05},
-      {148,148,8.29e-02},
-      {148,124,-1.03e-02},
-      {148,125,-1.03e-02},
-      {148,126,-1.03e-02},
-      {148,147,-1.03e-02},
-      {148,149,-1.03e-02},
-      {148,172,-1.03e-02},
-      {148,173,-1.03e-02},
-      {148,174,-1.03e-02},
-      {148,413,-4.84e-05},
-      {148,414,-1.93e-04},
-      {148,415,-4.84e-05},
-      {148,436,-1.93e-04},
-      {148,437,-7.74e-04},
-      {148,438,-1.93e-04},
-      {148,461,-4.84e-05},
-      {148,462,-1.93e-04},
-      {148,463,-4.84e-05},
-      {149,149,8.29e-02},
-      {149,125,-1.03e-02},
-      {149,126,-1.03e-02},
-      {149,127,-1.03e-02},
-      {149,148,-1.03e-02},
-      {149,150,-1.03e-02},
-      {149,173,-1.03e-02},
-      {149,174,-1.03e-02},
-      {149,175,-1.03e-02},
-      {149,414,-4.84e-05},
-      {149,415,-1.93e-04},
-      {149,416,-4.84e-05},
-      {149,437,-1.93e-04},
-      {149,438,-7.74e-04},
-      {149,439,-1.93e-04},
-      {149,462,-4.84e-05},
-      {149,463,-1.93e-04},
-      {149,464,-4.84e-05},
-      {150,150,8.29e-02},
-      {150,126,-1.03e-02},
-      {150,127,-1.03e-02},
-      {150,128,-1.03e-02},
-      {150,149,-1.03e-02},
-      {150,151,-1.03e-02},
-      {150,174,-1.03e-02},
-      {150,175,-1.03e-02},
-      {150,176,-1.03e-02},
-      {150,415,-4.84e-05},
-      {150,416,-1.93e-04},
-      {150,417,-4.84e-05},
-      {150,438,-1.93e-04},
-      {150,439,-7.74e-04},
-      {150,440,-1.93e-04},
-      {150,463,-4.84e-05},
-      {150,464,-1.93e-04},
-      {150,465,-4.84e-05},
-      {151,151,8.29e-02},
-      {151,127,-1.03e-02},
-      {151,128,-1.03e-02},
-      {151,129,-1.03e-02},
-      {151,150,-1.03e-02},
-      {151,152,-1.03e-02},
-      {151,175,-1.03e-02},
-      {151,176,-1.03e-02},
-      {151,177,-1.03e-02},
-      {151,416,-4.84e-05},
-      {151,417,-1.93e-04},
-      {151,418,-4.84e-05},
-      {151,439,-1.93e-04},
-      {151,440,-7.74e-04},
-      {151,441,-1.93e-04},
-      {151,464,-4.84e-05},
-      {151,465,-1.93e-04},
-      {151,466,-4.84e-05},
-      {152,152,8.29e-02},
-      {152,128,-1.03e-02},
-      {152,129,-1.03e-02},
-      {152,130,-1.03e-02},
-      {152,151,-1.03e-02},
-      {152,153,-1.03e-02},
-      {152,176,-1.03e-02},
-      {152,177,-1.03e-02},
-      {152,178,-1.03e-02},
-      {152,417,-4.84e-05},
-      {152,418,-1.93e-04},
-      {152,419,-4.84e-05},
-      {152,440,-1.93e-04},
-      {152,441,-7.74e-04},
-      {152,442,-1.93e-04},
-      {152,465,-4.84e-05},
-      {152,466,-1.93e-04},
-      {152,467,-4.84e-05},
-      {153,153,8.29e-02},
-      {153,129,-1.03e-02},
-      {153,130,-1.03e-02},
-      {153,131,-1.03e-02},
-      {153,152,-1.03e-02},
-      {153,154,-1.03e-02},
-      {153,177,-1.03e-02},
-      {153,178,-1.03e-02},
-      {153,179,-1.03e-02},
-      {153,418,-4.84e-05},
-      {153,419,-1.93e-04},
-      {153,420,-4.84e-05},
-      {153,441,-1.93e-04},
-      {153,442,-7.74e-04},
-      {153,443,-1.93e-04},
-      {153,466,-4.84e-05},
-      {153,467,-1.93e-04},
-      {153,468,-4.84e-05},
-      {154,154,8.29e-02},
-      {154,130,-1.03e-02},
-      {154,131,-1.03e-02},
-      {154,132,-1.03e-02},
-      {154,153,-1.03e-02},
-      {154,155,-1.03e-02},
-      {154,178,-1.03e-02},
-      {154,179,-1.03e-02},
-      {154,180,-1.03e-02},
-      {154,419,-4.84e-05},
-      {154,420,-1.93e-04},
-      {154,421,-4.84e-05},
-      {154,442,-1.93e-04},
-      {154,443,-7.74e-04},
-      {154,444,-1.93e-04},
-      {154,467,-4.84e-05},
-      {154,468,-1.93e-04},
-      {154,469,-4.84e-05},
-      {155,155,8.29e-02},
-      {155,131,-1.03e-02},
-      {155,132,-1.03e-02},
-      {155,133,-1.03e-02},
-      {155,154,-1.03e-02},
-      {155,156,-1.03e-02},
-      {155,179,-1.03e-02},
-      {155,180,-1.03e-02},
-      {155,181,-1.03e-02},
-      {155,420,-4.84e-05},
-      {155,421,-1.93e-04},
-      {155,422,-4.84e-05},
-      {155,443,-1.93e-04},
-      {155,444,-7.74e-04},
-      {155,445,-1.93e-04},
-      {155,468,-4.84e-05},
-      {155,469,-1.93e-04},
-      {155,470,-4.84e-05},
-      {156,156,8.29e-02},
-      {156,132,-1.03e-02},
-      {156,133,-1.03e-02},
-      {156,155,-1.03e-02},
-      {156,157,-1.03e-02},
-      {156,158,-1.03e-02},
-      {156,180,-1.03e-02},
-      {156,181,-1.03e-02},
-      {156,182,-1.03e-02},
-      {156,421,-4.84e-05},
-      {156,422,-1.93e-04},
-      {156,444,-1.93e-04},
-      {156,445,-7.74e-04},
-      {156,446,-1.93e-04},
-      {156,447,-4.84e-05},
-      {156,469,-4.84e-05},
-      {156,470,-1.93e-04},
-      {156,471,-4.84e-05},
-      {157,157,8.29e-02},
-      {157,133,-1.03e-02},
-      {157,156,-1.03e-02},
-      {157,158,-1.03e-02},
-      {157,181,-1.03e-02},
-      {157,182,-1.03e-02},
-      {157,183,-1.03e-02},
-      {157,184,-1.03e-02},
-      {157,188,-1.03e-02},
-      {157,422,-4.84e-05},
-      {157,445,-1.93e-04},
-      {157,446,-7.74e-04},
-      {157,447,-1.93e-04},
-      {157,470,-4.84e-05},
-      {157,471,-1.93e-04},
-      {157,472,-4.84e-05},
-      {157,473,-1.93e-04},
-      {157,477,-4.84e-05},
-      {158,158,8.29e-02},
-      {158,133,-1.03e-02},
-      {158,134,-1.03e-02},
-      {158,156,-1.03e-02},
-      {158,157,-1.03e-02},
-      {158,159,-1.03e-02},
-      {158,184,-1.03e-02},
-      {158,187,-1.03e-02},
-      {158,188,-1.03e-02},
-      {158,422,-1.93e-04},
-      {158,423,-4.84e-05},
-      {158,445,-4.84e-05},
-      {158,446,-1.93e-04},
-      {158,447,-7.74e-04},
-      {158,448,-1.93e-04},
-      {158,473,-4.84e-05},
-      {158,476,-4.84e-05},
-      {158,477,-1.93e-04},
-      {159,159,8.29e-02},
-      {159,133,-1.03e-02},
-      {159,134,-1.03e-02},
-      {159,135,-1.03e-02},
-      {159,158,-1.03e-02},
-      {159,160,-1.03e-02},
-      {159,185,-1.03e-02},
-      {159,187,-1.03e-02},
-      {159,188,-1.03e-02},
-      {159,422,-4.84e-05},
-      {159,423,-1.93e-04},
-      {159,424,-4.84e-05},
-      {159,447,-1.93e-04},
-      {159,448,-7.74e-04},
-      {159,449,-1.93e-04},
-      {159,474,-4.84e-05},
-      {159,476,-1.93e-04},
-      {159,477,-4.84e-05},
-      {160,160,8.29e-02},
-      {160,134,-1.03e-02},
-      {160,135,-1.03e-02},
-      {160,136,-1.03e-02},
-      {160,159,-1.03e-02},
-      {160,161,-1.03e-02},
-      {160,185,-1.03e-02},
-      {160,186,-1.03e-02},
-      {160,187,-1.03e-02},
-      {160,423,-4.84e-05},
-      {160,424,-1.93e-04},
-      {160,425,-4.84e-05},
-      {160,448,-1.93e-04},
-      {160,449,-7.74e-04},
-      {160,450,-1.93e-04},
-      {160,474,-1.93e-04},
-      {160,475,-4.84e-05},
-      {160,476,-4.84e-05},
-      {161,161,8.29e-02},
-      {161,135,-1.03e-02},
-      {161,136,-1.03e-02},
-      {161,141,-1.03e-02},
-      {161,160,-1.03e-02},
-      {161,166,-1.03e-02},
-      {161,185,-1.03e-02},
-      {161,186,-1.03e-02},
-      {161,192,-1.03e-02},
-      {161,424,-4.84e-05},
-      {161,425,-1.93e-04},
-      {161,430,-4.84e-05},
-      {161,449,-1.93e-04},
-      {161,450,-7.74e-04},
-      {161,455,-1.93e-04},
-      {161,474,-4.84e-05},
-      {161,475,-1.93e-04},
-      {161,481,-4.84e-05},
-      {162,162,8.29e-02},
-      {162,137,-1.03e-02},
-      {162,139,-1.03e-02},
-      {162,143,-1.03e-02},
-      {162,163,-1.03e-02},
-      {162,168,-1.03e-02},
-      {162,189,-1.03e-02},
-      {162,190,-1.03e-02},
-      {162,195,-1.03e-02},
-      {162,426,-4.84e-05},
-      {162,428,-1.93e-04},
-      {162,432,-4.84e-05},
-      {162,451,-7.74e-04},
-      {162,452,-1.93e-04},
-      {162,457,-1.93e-04},
-      {162,478,-4.84e-05},
-      {162,479,-1.93e-04},
-      {162,484,-4.84e-05},
-      {163,163,8.29e-02},
-      {163,137,-1.03e-02},
-      {163,138,-1.03e-02},
-      {163,139,-1.03e-02},
-      {163,162,-1.03e-02},
-      {163,164,-1.03e-02},
-      {163,190,-1.03e-02},
-      {163,194,-1.03e-02},
-      {163,195,-1.03e-02},
-      {163,426,-1.93e-04},
-      {163,427,-4.84e-05},
-      {163,428,-4.84e-05},
-      {163,451,-1.93e-04},
-      {163,452,-7.74e-04},
-      {163,453,-1.93e-04},
-      {163,479,-4.84e-05},
-      {163,483,-4.84e-05},
-      {163,484,-1.93e-04},
-      {164,164,8.29e-02},
-      {164,137,-1.03e-02},
-      {164,138,-1.03e-02},
-      {164,140,-1.03e-02},
-      {164,163,-1.03e-02},
-      {164,165,-1.03e-02},
-      {164,193,-1.03e-02},
-      {164,194,-1.03e-02},
-      {164,195,-1.03e-02},
-      {164,426,-4.84e-05},
-      {164,427,-1.93e-04},
-      {164,429,-4.84e-05},
-      {164,452,-1.93e-04},
-      {164,453,-7.74e-04},
-      {164,454,-1.93e-04},
-      {164,482,-4.84e-05},
-      {164,483,-1.93e-04},
-      {164,484,-4.84e-05},
-      {165,165,8.29e-02},
-      {165,122,-1.03e-02},
-      {165,138,-1.03e-02},
-      {165,140,-1.03e-02},
-      {165,145,-1.03e-02},
-      {165,164,-1.03e-02},
-      {165,170,-1.03e-02},
-      {165,193,-1.03e-02},
-      {165,194,-1.03e-02},
-      {165,411,-4.84e-05},
-      {165,427,-4.84e-05},
-      {165,429,-1.93e-04},
-      {165,434,-1.93e-04},
-      {165,453,-1.93e-04},
-      {165,454,-7.74e-04},
-      {165,459,-4.84e-05},
-      {165,482,-1.93e-04},
-      {165,483,-4.84e-05},
-      {166,166,8.29e-02},
-      {166,136,-1.03e-02},
-      {166,141,-1.03e-02},
-      {166,142,-1.03e-02},
-      {166,161,-1.03e-02},
-      {166,167,-1.03e-02},
-      {166,186,-1.03e-02},
-      {166,191,-1.03e-02},
-      {166,192,-1.03e-02},
-      {166,425,-4.84e-05},
-      {166,430,-1.93e-04},
-      {166,431,-4.84e-05},
-      {166,450,-1.93e-04},
-      {166,455,-7.74e-04},
-      {166,456,-1.93e-04},
-      {166,475,-4.84e-05},
-      {166,480,-4.84e-05},
-      {166,481,-1.93e-04},
-      {167,167,8.29e-02},
-      {167,141,-1.03e-02},
-      {167,142,-1.03e-02},
-      {167,143,-1.03e-02},
-      {167,166,-1.03e-02},
-      {167,168,-1.03e-02},
-      {167,189,-1.03e-02},
-      {167,191,-1.03e-02},
-      {167,192,-1.03e-02},
-      {167,430,-4.84e-05},
-      {167,431,-1.93e-04},
-      {167,432,-4.84e-05},
-      {167,455,-1.93e-04},
-      {167,456,-7.74e-04},
-      {167,457,-1.93e-04},
-      {167,478,-4.84e-05},
-      {167,480,-1.93e-04},
-      {167,481,-4.84e-05},
-      {168,168,8.29e-02},
-      {168,139,-1.03e-02},
-      {168,142,-1.03e-02},
-      {168,143,-1.03e-02},
-      {168,162,-1.03e-02},
-      {168,167,-1.03e-02},
-      {168,189,-1.03e-02},
-      {168,190,-1.03e-02},
-      {168,191,-1.03e-02},
-      {168,428,-4.84e-05},
-      {168,431,-4.84e-05},
-      {168,432,-1.93e-04},
-      {168,451,-1.93e-04},
-      {168,456,-1.93e-04},
-      {168,457,-7.74e-04},
-      {168,478,-1.93e-04},
-      {168,479,-4.84e-05},
-      {168,480,-4.84e-05},
-      {169,169,2.08e-01},
-      {169,144,3.65e-02},
-      {169,146,-1.03e-02},
-      {169,171,-1.03e-02},
-      {169,196,3.65e-02},
-      {169,198,-1.03e-02},
-      {169,433,-9.67e-05},
-      {169,435,-4.84e-05},
-      {169,458,-3.87e-04},
-      {169,460,-1.93e-04},
-      {169,485,-9.67e-05},
-      {169,487,-4.84e-05},
-      {170,170,2.08e-01},
-      {170,145,3.65e-02},
-      {170,165,-1.03e-02},
-      {170,193,-1.03e-02},
-      {170,197,3.65e-02},
-      {170,223,-1.03e-02},
-      {170,434,-9.67e-05},
-      {170,454,-4.84e-05},
-      {170,459,-3.87e-04},
-      {170,482,-1.93e-04},
-      {170,486,-9.67e-05},
-      {170,512,-4.84e-05},
-      {171,171,8.29e-02},
-      {171,144,-1.03e-02},
-      {171,146,-1.03e-02},
-      {171,147,-1.03e-02},
-      {171,169,-1.03e-02},
-      {171,172,-1.03e-02},
-      {171,196,-1.03e-02},
-      {171,198,-1.03e-02},
-      {171,199,-1.03e-02},
-      {171,433,-4.84e-05},
-      {171,435,-1.93e-04},
-      {171,436,-4.84e-05},
-      {171,458,-1.93e-04},
-      {171,460,-7.74e-04},
-      {171,461,-1.93e-04},
-      {171,485,-4.84e-05},
-      {171,487,-1.93e-04},
-      {171,488,-4.84e-05},
-      {172,172,8.29e-02},
-      {172,146,-1.03e-02},
-      {172,147,-1.03e-02},
-      {172,148,-1.03e-02},
-      {172,171,-1.03e-02},
-      {172,173,-1.03e-02},
-      {172,198,-1.03e-02},
-      {172,199,-1.03e-02},
-      {172,200,-1.03e-02},
-      {172,435,-4.84e-05},
-      {172,436,-1.93e-04},
-      {172,437,-4.84e-05},
-      {172,460,-1.93e-04},
-      {172,461,-7.74e-04},
-      {172,462,-1.93e-04},
-      {172,487,-4.84e-05},
-      {172,488,-1.93e-04},
-      {172,489,-4.84e-05},
-      {173,173,8.29e-02},
-      {173,147,-1.03e-02},
-      {173,148,-1.03e-02},
-      {173,149,-1.03e-02},
-      {173,172,-1.03e-02},
-      {173,174,-1.03e-02},
-      {173,199,-1.03e-02},
-      {173,200,-1.03e-02},
-      {173,201,-1.03e-02},
-      {173,436,-4.84e-05},
-      {173,437,-1.93e-04},
-      {173,438,-4.84e-05},
-      {173,461,-1.93e-04},
-      {173,462,-7.74e-04},
-      {173,463,-1.93e-04},
-      {173,488,-4.84e-05},
-      {173,489,-1.93e-04},
-      {173,490,-4.84e-05},
-      {174,174,8.29e-02},
-      {174,148,-1.03e-02},
-      {174,149,-1.03e-02},
-      {174,150,-1.03e-02},
-      {174,173,-1.03e-02},
-      {174,175,-1.03e-02},
-      {174,200,-1.03e-02},
-      {174,201,-1.03e-02},
-      {174,202,-1.03e-02},
-      {174,437,-4.84e-05},
-      {174,438,-1.93e-04},
-      {174,439,-4.84e-05},
-      {174,462,-1.93e-04},
-      {174,463,-7.74e-04},
-      {174,464,-1.93e-04},
-      {174,489,-4.84e-05},
-      {174,490,-1.93e-04},
-      {174,491,-4.84e-05},
-      {175,175,8.29e-02},
-      {175,149,-1.03e-02},
-      {175,150,-1.03e-02},
-      {175,151,-1.03e-02},
-      {175,174,-1.03e-02},
-      {175,176,-1.03e-02},
-      {175,201,-1.03e-02},
-      {175,202,-1.03e-02},
-      {175,203,-1.03e-02},
-      {175,438,-4.84e-05},
-      {175,439,-1.93e-04},
-      {175,440,-4.84e-05},
-      {175,463,-1.93e-04},
-      {175,464,-7.74e-04},
-      {175,465,-1.93e-04},
-      {175,490,-4.84e-05},
-      {175,491,-1.93e-04},
-      {175,492,-4.84e-05},
-      {176,176,8.29e-02},
-      {176,150,-1.03e-02},
-      {176,151,-1.03e-02},
-      {176,152,-1.03e-02},
-      {176,175,-1.03e-02},
-      {176,177,-1.03e-02},
-      {176,202,-1.03e-02},
-      {176,203,-1.03e-02},
-      {176,204,-1.03e-02},
-      {176,439,-4.84e-05},
-      {176,440,-1.93e-04},
-      {176,441,-4.84e-05},
-      {176,464,-1.93e-04},
-      {176,465,-7.74e-04},
-      {176,466,-1.93e-04},
-      {176,491,-4.84e-05},
-      {176,492,-1.93e-04},
-      {176,493,-4.84e-05},
-      {177,177,8.29e-02},
-      {177,151,-1.03e-02},
-      {177,152,-1.03e-02},
-      {177,153,-1.03e-02},
-      {177,176,-1.03e-02},
-      {177,178,-1.03e-02},
-      {177,203,-1.03e-02},
-      {177,204,-1.03e-02},
-      {177,205,-1.03e-02},
-      {177,440,-4.84e-05},
-      {177,441,-1.93e-04},
-      {177,442,-4.84e-05},
-      {177,465,-1.93e-04},
-      {177,466,-7.74e-04},
-      {177,467,-1.93e-04},
-      {177,492,-4.84e-05},
-      {177,493,-1.93e-04},
-      {177,494,-4.84e-05},
-      {178,178,8.29e-02},
-      {178,152,-1.03e-02},
-      {178,153,-1.03e-02},
-      {178,154,-1.03e-02},
-      {178,177,-1.03e-02},
-      {178,179,-1.03e-02},
-      {178,204,-1.03e-02},
-      {178,205,-1.03e-02},
-      {178,206,-1.03e-02},
-      {178,441,-4.84e-05},
-      {178,442,-1.93e-04},
-      {178,443,-4.84e-05},
-      {178,466,-1.93e-04},
-      {178,467,-7.74e-04},
-      {178,468,-1.93e-04},
-      {178,493,-4.84e-05},
-      {178,494,-1.93e-04},
-      {178,495,-4.84e-05},
-      {179,179,8.29e-02},
-      {179,153,-1.03e-02},
-      {179,154,-1.03e-02},
-      {179,155,-1.03e-02},
-      {179,178,-1.03e-02},
-      {179,180,-1.03e-02},
-      {179,205,-1.03e-02},
-      {179,206,-1.03e-02},
-      {179,207,-1.03e-02},
-      {179,442,-4.84e-05},
-      {179,443,-1.93e-04},
-      {179,444,-4.84e-05},
-      {179,467,-1.93e-04},
-      {179,468,-7.74e-04},
-      {179,469,-1.93e-04},
-      {179,494,-4.84e-05},
-      {179,495,-1.93e-04},
-      {179,496,-4.84e-05},
-      {180,180,8.29e-02},
-      {180,154,-1.03e-02},
-      {180,155,-1.03e-02},
-      {180,156,-1.03e-02},
-      {180,179,-1.03e-02},
-      {180,181,-1.03e-02},
-      {180,206,-1.03e-02},
-      {180,207,-1.03e-02},
-      {180,208,-1.03e-02},
-      {180,443,-4.84e-05},
-      {180,444,-1.93e-04},
-      {180,445,-4.84e-05},
-      {180,468,-1.93e-04},
-      {180,469,-7.74e-04},
-      {180,470,-1.93e-04},
-      {180,495,-4.84e-05},
-      {180,496,-1.93e-04},
-      {180,497,-4.84e-05},
-      {181,181,8.29e-02},
-      {181,155,-1.03e-02},
-      {181,156,-1.03e-02},
-      {181,157,-1.03e-02},
-      {181,180,-1.03e-02},
-      {181,182,-1.03e-02},
-      {181,207,-1.03e-02},
-      {181,208,-1.03e-02},
-      {181,209,-1.03e-02},
-      {181,444,-4.84e-05},
-      {181,445,-1.93e-04},
-      {181,446,-4.84e-05},
-      {181,469,-1.93e-04},
-      {181,470,-7.74e-04},
-      {181,471,-1.93e-04},
-      {181,496,-4.84e-05},
-      {181,497,-1.93e-04},
-      {181,498,-4.84e-05},
-      {182,182,8.29e-02},
-      {182,156,-1.03e-02},
-      {182,157,-1.03e-02},
-      {182,181,-1.03e-02},
-      {182,183,-1.03e-02},
-      {182,184,-1.03e-02},
-      {182,208,-1.03e-02},
-      {182,209,-1.03e-02},
-      {182,210,-1.03e-02},
-      {182,445,-4.84e-05},
-      {182,446,-1.93e-04},
-      {182,470,-1.93e-04},
-      {182,471,-7.74e-04},
-      {182,472,-1.93e-04},
-      {182,473,-4.84e-05},
-      {182,497,-4.84e-05},
-      {182,498,-1.93e-04},
-      {182,499,-4.84e-05},
-      {183,183,8.29e-02},
-      {183,157,-1.03e-02},
-      {183,182,-1.03e-02},
-      {183,184,-1.03e-02},
-      {183,209,-1.03e-02},
-      {183,210,-1.03e-02},
-      {183,211,-1.03e-02},
-      {183,212,-1.03e-02},
-      {183,213,-1.03e-02},
-      {183,446,-4.84e-05},
-      {183,471,-1.93e-04},
-      {183,472,-7.74e-04},
-      {183,473,-1.93e-04},
-      {183,498,-4.84e-05},
-      {183,499,-1.93e-04},
-      {183,500,-4.84e-05},
-      {183,501,-1.93e-04},
-      {183,502,-4.84e-05},
-      {184,184,8.29e-02},
-      {184,157,-1.03e-02},
-      {184,158,-1.03e-02},
-      {184,182,-1.03e-02},
-      {184,183,-1.03e-02},
-      {184,188,-1.03e-02},
-      {184,212,-1.03e-02},
-      {184,213,-1.03e-02},
-      {184,217,-1.03e-02},
-      {184,446,-1.93e-04},
-      {184,447,-4.84e-05},
-      {184,471,-4.84e-05},
-      {184,472,-1.93e-04},
-      {184,473,-7.74e-04},
-      {184,477,-1.93e-04},
-      {184,501,-4.84e-05},
-      {184,502,-1.93e-04},
-      {184,506,-4.84e-05},
-      {185,185,8.29e-02},
-      {185,159,-1.03e-02},
-      {185,160,-1.03e-02},
-      {185,161,-1.03e-02},
-      {185,186,-1.03e-02},
-      {185,187,-1.03e-02},
-      {185,214,-1.03e-02},
-      {185,215,-1.03e-02},
-      {185,216,-1.03e-02},
-      {185,448,-4.84e-05},
-      {185,449,-1.93e-04},
-      {185,450,-4.84e-05},
-      {185,474,-7.74e-04},
-      {185,475,-1.93e-04},
-      {185,476,-1.93e-04},
-      {185,503,-4.84e-05},
-      {185,504,-1.93e-04},
-      {185,505,-4.84e-05},
-      {186,186,8.29e-02},
-      {186,160,-1.03e-02},
-      {186,161,-1.03e-02},
-      {186,166,-1.03e-02},
-      {186,185,-1.03e-02},
-      {186,192,-1.03e-02},
-      {186,215,-1.03e-02},
-      {186,216,-1.03e-02},
-      {186,221,-1.03e-02},
-      {186,449,-4.84e-05},
-      {186,450,-1.93e-04},
-      {186,455,-4.84e-05},
-      {186,474,-1.93e-04},
-      {186,475,-7.74e-04},
-      {186,481,-1.93e-04},
-      {186,504,-4.84e-05},
-      {186,505,-1.93e-04},
-      {186,510,-4.84e-05},
-      {187,187,8.29e-02},
-      {187,158,-1.03e-02},
-      {187,159,-1.03e-02},
-      {187,160,-1.03e-02},
-      {187,185,-1.03e-02},
-      {187,188,-1.03e-02},
-      {187,214,-1.03e-02},
-      {187,215,-1.03e-02},
-      {187,217,-1.03e-02},
-      {187,447,-4.84e-05},
-      {187,448,-1.93e-04},
-      {187,449,-4.84e-05},
-      {187,474,-1.93e-04},
-      {187,476,-7.74e-04},
-      {187,477,-1.93e-04},
-      {187,503,-1.93e-04},
-      {187,504,-4.84e-05},
-      {187,506,-4.84e-05},
-      {188,188,8.29e-02},
-      {188,157,-1.03e-02},
-      {188,158,-1.03e-02},
-      {188,159,-1.03e-02},
-      {188,184,-1.03e-02},
-      {188,187,-1.03e-02},
-      {188,213,-1.03e-02},
-      {188,214,-1.03e-02},
-      {188,217,-1.03e-02},
-      {188,446,-4.84e-05},
-      {188,447,-1.93e-04},
-      {188,448,-4.84e-05},
-      {188,473,-1.93e-04},
-      {188,476,-1.93e-04},
-      {188,477,-7.74e-04},
-      {188,502,-4.84e-05},
-      {188,503,-4.84e-05},
-      {188,506,-1.93e-04},
-      {189,189,8.29e-02},
-      {189,162,-1.03e-02},
-      {189,167,-1.03e-02},
-      {189,168,-1.03e-02},
-      {189,190,-1.03e-02},
-      {189,191,-1.03e-02},
-      {189,218,-1.03e-02},
-      {189,219,-1.03e-02},
-      {189,220,-1.03e-02},
-      {189,451,-4.84e-05},
-      {189,456,-4.84e-05},
-      {189,457,-1.93e-04},
-      {189,478,-7.74e-04},
-      {189,479,-1.93e-04},
-      {189,480,-1.93e-04},
-      {189,507,-4.84e-05},
-      {189,508,-1.93e-04},
-      {189,509,-4.84e-05},
-      {190,190,8.29e-02},
-      {190,162,-1.03e-02},
-      {190,163,-1.03e-02},
-      {190,168,-1.03e-02},
-      {190,189,-1.03e-02},
-      {190,195,-1.03e-02},
-      {190,219,-1.03e-02},
-      {190,220,-1.03e-02},
-      {190,224,-1.03e-02},
-      {190,451,-1.93e-04},
-      {190,452,-4.84e-05},
-      {190,457,-4.84e-05},
-      {190,478,-1.93e-04},
-      {190,479,-7.74e-04},
-      {190,484,-1.93e-04},
-      {190,508,-4.84e-05},
-      {190,509,-1.93e-04},
-      {190,513,-4.84e-05},
-      {191,191,8.29e-02},
-      {191,166,-1.03e-02},
-      {191,167,-1.03e-02},
-      {191,168,-1.03e-02},
-      {191,189,-1.03e-02},
-      {191,192,-1.03e-02},
-      {191,218,-1.03e-02},
-      {191,219,-1.03e-02},
-      {191,221,-1.03e-02},
-      {191,455,-4.84e-05},
-      {191,456,-1.93e-04},
-      {191,457,-4.84e-05},
-      {191,478,-1.93e-04},
-      {191,480,-7.74e-04},
-      {191,481,-1.93e-04},
-      {191,507,-1.93e-04},
-      {191,508,-4.84e-05},
-      {191,510,-4.84e-05},
-      {192,192,8.29e-02},
-      {192,161,-1.03e-02},
-      {192,166,-1.03e-02},
-      {192,167,-1.03e-02},
-      {192,186,-1.03e-02},
-      {192,191,-1.03e-02},
-      {192,216,-1.03e-02},
-      {192,218,-1.03e-02},
-      {192,221,-1.03e-02},
-      {192,450,-4.84e-05},
-      {192,455,-1.93e-04},
-      {192,456,-4.84e-05},
-      {192,475,-1.93e-04},
-      {192,480,-1.93e-04},
-      {192,481,-7.74e-04},
-      {192,505,-4.84e-05},
-      {192,507,-4.84e-05},
-      {192,510,-1.93e-04},
-      {193,193,8.29e-02},
-      {193,145,-1.03e-02},
-      {193,164,-1.03e-02},
-      {193,165,-1.03e-02},
-      {193,170,-1.03e-02},
-      {193,194,-1.03e-02},
-      {193,197,-1.03e-02},
-      {193,222,-1.03e-02},
-      {193,223,-1.03e-02},
-      {193,434,-4.84e-05},
-      {193,453,-4.84e-05},
-      {193,454,-1.93e-04},
-      {193,459,-1.93e-04},
-      {193,482,-7.74e-04},
-      {193,483,-1.93e-04},
-      {193,486,-4.84e-05},
-      {193,511,-4.84e-05},
-      {193,512,-1.93e-04},
-      {194,194,8.29e-02},
-      {194,163,-1.03e-02},
-      {194,164,-1.03e-02},
-      {194,165,-1.03e-02},
-      {194,193,-1.03e-02},
-      {194,195,-1.03e-02},
-      {194,222,-1.03e-02},
-      {194,223,-1.03e-02},
-      {194,224,-1.03e-02},
-      {194,452,-4.84e-05},
-      {194,453,-1.93e-04},
-      {194,454,-4.84e-05},
-      {194,482,-1.93e-04},
-      {194,483,-7.74e-04},
-      {194,484,-1.93e-04},
-      {194,511,-1.93e-04},
-      {194,512,-4.84e-05},
-      {194,513,-4.84e-05},
-      {195,195,8.29e-02},
-      {195,162,-1.03e-02},
-      {195,163,-1.03e-02},
-      {195,164,-1.03e-02},
-      {195,190,-1.03e-02},
-      {195,194,-1.03e-02},
-      {195,220,-1.03e-02},
-      {195,222,-1.03e-02},
-      {195,224,-1.03e-02},
-      {195,451,-4.84e-05},
-      {195,452,-1.93e-04},
-      {195,453,-4.84e-05},
-      {195,479,-1.93e-04},
-      {195,483,-1.93e-04},
-      {195,484,-7.74e-04},
-      {195,509,-4.84e-05},
-      {195,511,-4.84e-05},
-      {195,513,-1.93e-04},
-      {196,196,2.08e-01},
-      {196,169,3.65e-02},
-      {196,171,-1.03e-02},
-      {196,198,-1.03e-02},
-      {196,225,3.65e-02},
-      {196,227,-1.03e-02},
-      {196,458,-9.67e-05},
-      {196,460,-4.84e-05},
-      {196,485,-3.87e-04},
-      {196,487,-1.93e-04},
-      {196,514,-9.67e-05},
-      {196,516,-4.84e-05},
-      {197,197,2.08e-01},
-      {197,170,3.65e-02},
-      {197,193,-1.03e-02},
-      {197,223,-1.03e-02},
-      {197,226,3.65e-02},
-      {197,255,-1.03e-02},
-      {197,459,-9.67e-05},
-      {197,482,-4.84e-05},
-      {197,486,-3.87e-04},
-      {197,512,-1.93e-04},
-      {197,515,-9.67e-05},
-      {197,544,-4.84e-05},
-      {198,198,8.29e-02},
-      {198,169,-1.03e-02},
-      {198,171,-1.03e-02},
-      {198,172,-1.03e-02},
-      {198,196,-1.03e-02},
-      {198,199,-1.03e-02},
-      {198,225,-1.03e-02},
-      {198,227,-1.03e-02},
-      {198,228,-1.03e-02},
-      {198,458,-4.84e-05},
-      {198,460,-1.93e-04},
-      {198,461,-4.84e-05},
-      {198,485,-1.93e-04},
-      {198,487,-7.74e-04},
-      {198,488,-1.93e-04},
-      {198,514,-4.84e-05},
-      {198,516,-1.93e-04},
-      {198,517,-4.84e-05},
-      {199,199,8.29e-02},
-      {199,171,-1.03e-02},
-      {199,172,-1.03e-02},
-      {199,173,-1.03e-02},
-      {199,198,-1.03e-02},
-      {199,200,-1.03e-02},
-      {199,227,-1.03e-02},
-      {199,228,-1.03e-02},
-      {199,229,-1.03e-02},
-      {199,460,-4.84e-05},
-      {199,461,-1.93e-04},
-      {199,462,-4.84e-05},
-      {199,487,-1.93e-04},
-      {199,488,-7.74e-04},
-      {199,489,-1.93e-04},
-      {199,516,-4.84e-05},
-      {199,517,-1.93e-04},
-      {199,518,-4.84e-05},
-      {200,200,8.29e-02},
-      {200,172,-1.03e-02},
-      {200,173,-1.03e-02},
-      {200,174,-1.03e-02},
-      {200,199,-1.03e-02},
-      {200,201,-1.03e-02},
-      {200,228,-1.03e-02},
-      {200,229,-1.03e-02},
-      {200,230,-1.03e-02},
-      {200,461,-4.84e-05},
-      {200,462,-1.93e-04},
-      {200,463,-4.84e-05},
-      {200,488,-1.93e-04},
-      {200,489,-7.74e-04},
-      {200,490,-1.93e-04},
-      {200,517,-4.84e-05},
-      {200,518,-1.93e-04},
-      {200,519,-4.84e-05},
-      {201,201,8.29e-02},
-      {201,173,-1.03e-02},
-      {201,174,-1.03e-02},
-      {201,175,-1.03e-02},
-      {201,200,-1.03e-02},
-      {201,202,-1.03e-02},
-      {201,229,-1.03e-02},
-      {201,230,-1.03e-02},
-      {201,231,-1.03e-02},
-      {201,462,-4.84e-05},
-      {201,463,-1.93e-04},
-      {201,464,-4.84e-05},
-      {201,489,-1.93e-04},
-      {201,490,-7.74e-04},
-      {201,491,-1.93e-04},
-      {201,518,-4.84e-05},
-      {201,519,-1.93e-04},
-      {201,520,-4.84e-05},
-      {202,202,8.29e-02},
-      {202,174,-1.03e-02},
-      {202,175,-1.03e-02},
-      {202,176,-1.03e-02},
-      {202,201,-1.03e-02},
-      {202,203,-1.03e-02},
-      {202,230,-1.03e-02},
-      {202,231,-1.03e-02},
-      {202,232,-1.03e-02},
-      {202,463,-4.84e-05},
-      {202,464,-1.93e-04},
-      {202,465,-4.84e-05},
-      {202,490,-1.93e-04},
-      {202,491,-7.74e-04},
-      {202,492,-1.93e-04},
-      {202,519,-4.84e-05},
-      {202,520,-1.93e-04},
-      {202,521,-4.84e-05},
-      {203,203,8.29e-02},
-      {203,175,-1.03e-02},
-      {203,176,-1.03e-02},
-      {203,177,-1.03e-02},
-      {203,202,-1.03e-02},
-      {203,204,-1.03e-02},
-      {203,231,-1.03e-02},
-      {203,232,-1.03e-02},
-      {203,233,-1.03e-02},
-      {203,464,-4.84e-05},
-      {203,465,-1.93e-04},
-      {203,466,-4.84e-05},
-      {203,491,-1.93e-04},
-      {203,492,-7.74e-04},
-      {203,493,-1.93e-04},
-      {203,520,-4.84e-05},
-      {203,521,-1.93e-04},
-      {203,522,-4.84e-05},
-      {204,204,8.29e-02},
-      {204,176,-1.03e-02},
-      {204,177,-1.03e-02},
-      {204,178,-1.03e-02},
-      {204,203,-1.03e-02},
-      {204,205,-1.03e-02},
-      {204,232,-1.03e-02},
-      {204,233,-1.03e-02},
-      {204,234,-1.03e-02},
-      {204,465,-4.84e-05},
-      {204,466,-1.93e-04},
-      {204,467,-4.84e-05},
-      {204,492,-1.93e-04},
-      {204,493,-7.74e-04},
-      {204,494,-1.93e-04},
-      {204,521,-4.84e-05},
-      {204,522,-1.93e-04},
-      {204,523,-4.84e-05},
-      {205,205,8.29e-02},
-      {205,177,-1.03e-02},
-      {205,178,-1.03e-02},
-      {205,179,-1.03e-02},
-      {205,204,-1.03e-02},
-      {205,206,-1.03e-02},
-      {205,233,-1.03e-02},
-      {205,234,-1.03e-02},
-      {205,235,-1.03e-02},
-      {205,466,-4.84e-05},
-      {205,467,-1.93e-04},
-      {205,468,-4.84e-05},
-      {205,493,-1.93e-04},
-      {205,494,-7.74e-04},
-      {205,495,-1.93e-04},
-      {205,522,-4.84e-05},
-      {205,523,-1.93e-04},
-      {205,524,-4.84e-05},
-      {206,206,8.29e-02},
-      {206,178,-1.03e-02},
-      {206,179,-1.03e-02},
-      {206,180,-1.03e-02},
-      {206,205,-1.03e-02},
-      {206,207,-1.03e-02},
-      {206,234,-1.03e-02},
-      {206,235,-1.03e-02},
-      {206,236,-1.03e-02},
-      {206,467,-4.84e-05},
-      {206,468,-1.93e-04},
-      {206,469,-4.84e-05},
-      {206,494,-1.93e-04},
-      {206,495,-7.74e-04},
-      {206,496,-1.93e-04},
-      {206,523,-4.84e-05},
-      {206,524,-1.93e-04},
-      {206,525,-4.84e-05},
-      {207,207,8.29e-02},
-      {207,179,-1.03e-02},
-      {207,180,-1.03e-02},
-      {207,181,-1.03e-02},
-      {207,206,-1.03e-02},
-      {207,208,-1.03e-02},
-      {207,235,-1.03e-02},
-      {207,236,-1.03e-02},
-      {207,237,-1.03e-02},
-      {207,468,-4.84e-05},
-      {207,469,-1.93e-04},
-      {207,470,-4.84e-05},
-      {207,495,-1.93e-04},
-      {207,496,-7.74e-04},
-      {207,497,-1.93e-04},
-      {207,524,-4.84e-05},
-      {207,525,-1.93e-04},
-      {207,526,-4.84e-05},
-      {208,208,8.29e-02},
-      {208,180,-1.03e-02},
-      {208,181,-1.03e-02},
-      {208,182,-1.03e-02},
-      {208,207,-1.03e-02},
-      {208,209,-1.03e-02},
-      {208,236,-1.03e-02},
-      {208,237,-1.03e-02},
-      {208,238,-1.03e-02},
-      {208,469,-4.84e-05},
-      {208,470,-1.93e-04},
-      {208,471,-4.84e-05},
-      {208,496,-1.93e-04},
-      {208,497,-7.74e-04},
-      {208,498,-1.93e-04},
-      {208,525,-4.84e-05},
-      {208,526,-1.93e-04},
-      {208,527,-4.84e-05},
-      {209,209,8.29e-02},
-      {209,181,-1.03e-02},
-      {209,182,-1.03e-02},
-      {209,183,-1.03e-02},
-      {209,208,-1.03e-02},
-      {209,210,-1.03e-02},
-      {209,237,-1.03e-02},
-      {209,238,-1.03e-02},
-      {209,239,-1.03e-02},
-      {209,470,-4.84e-05},
-      {209,471,-1.93e-04},
-      {209,472,-4.84e-05},
-      {209,497,-1.93e-04},
-      {209,498,-7.74e-04},
-      {209,499,-1.93e-04},
-      {209,526,-4.84e-05},
-      {209,527,-1.93e-04},
-      {209,528,-4.84e-05},
-      {210,210,8.29e-02},
-      {210,182,-1.03e-02},
-      {210,183,-1.03e-02},
-      {210,209,-1.03e-02},
-      {210,211,-1.03e-02},
-      {210,212,-1.03e-02},
-      {210,238,-1.03e-02},
-      {210,239,-1.03e-02},
-      {210,240,-1.03e-02},
-      {210,471,-4.84e-05},
-      {210,472,-1.93e-04},
-      {210,498,-1.93e-04},
-      {210,499,-7.74e-04},
-      {210,500,-1.93e-04},
-      {210,501,-4.84e-05},
-      {210,527,-4.84e-05},
-      {210,528,-1.93e-04},
-      {210,529,-4.84e-05},
-      {211,211,8.29e-02},
-      {211,183,-1.03e-02},
-      {211,210,-1.03e-02},
-      {211,212,-1.03e-02},
-      {211,239,-1.03e-02},
-      {211,240,-1.03e-02},
-      {211,241,-1.03e-02},
-      {211,242,-1.03e-02},
-      {211,243,-1.03e-02},
-      {211,472,-4.84e-05},
-      {211,499,-1.93e-04},
-      {211,500,-7.74e-04},
-      {211,501,-1.93e-04},
-      {211,528,-4.84e-05},
-      {211,529,-1.93e-04},
-      {211,530,-4.84e-05},
-      {211,531,-1.93e-04},
-      {211,532,-4.84e-05},
-      {212,212,8.29e-02},
-      {212,183,-1.03e-02},
-      {212,184,-1.03e-02},
-      {212,210,-1.03e-02},
-      {212,211,-1.03e-02},
-      {212,213,-1.03e-02},
-      {212,242,-1.03e-02},
-      {212,243,-1.03e-02},
-      {212,244,-1.03e-02},
-      {212,472,-1.93e-04},
-      {212,473,-4.84e-05},
-      {212,499,-4.84e-05},
-      {212,500,-1.93e-04},
-      {212,501,-7.74e-04},
-      {212,502,-1.93e-04},
-      {212,531,-4.84e-05},
-      {212,532,-1.93e-04},
-      {212,533,-4.84e-05},
-      {213,213,8.29e-02},
-      {213,183,-1.03e-02},
-      {213,184,-1.03e-02},
-      {213,188,-1.03e-02},
-      {213,212,-1.03e-02},
-      {213,217,-1.03e-02},
-      {213,243,-1.03e-02},
-      {213,244,-1.03e-02},
-      {213,245,-1.03e-02},
-      {213,472,-4.84e-05},
-      {213,473,-1.93e-04},
-      {213,477,-4.84e-05},
-      {213,501,-1.93e-04},
-      {213,502,-7.74e-04},
-      {213,506,-1.93e-04},
-      {213,532,-4.84e-05},
-      {213,533,-1.93e-04},
-      {213,534,-4.84e-05},
-      {214,214,8.29e-02},
-      {214,185,-1.03e-02},
-      {214,187,-1.03e-02},
-      {214,188,-1.03e-02},
-      {214,215,-1.03e-02},
-      {214,217,-1.03e-02},
-      {214,245,-1.03e-02},
-      {214,246,-1.03e-02},
-      {214,247,-1.03e-02},
-      {214,474,-4.84e-05},
-      {214,476,-1.93e-04},
-      {214,477,-4.84e-05},
-      {214,503,-7.74e-04},
-      {214,504,-1.93e-04},
-      {214,506,-1.93e-04},
-      {214,534,-4.84e-05},
-      {214,535,-1.93e-04},
-      {214,536,-4.84e-05},
-      {215,215,8.29e-02},
-      {215,185,-1.03e-02},
-      {215,186,-1.03e-02},
-      {215,187,-1.03e-02},
-      {215,214,-1.03e-02},
-      {215,216,-1.03e-02},
-      {215,246,-1.03e-02},
-      {215,247,-1.03e-02},
-      {215,248,-1.03e-02},
-      {215,474,-1.93e-04},
-      {215,475,-4.84e-05},
-      {215,476,-4.84e-05},
-      {215,503,-1.93e-04},
-      {215,504,-7.74e-04},
-      {215,505,-1.93e-04},
-      {215,535,-4.84e-05},
-      {215,536,-1.93e-04},
-      {215,537,-4.84e-05},
-      {216,216,8.29e-02},
-      {216,185,-1.03e-02},
-      {216,186,-1.03e-02},
-      {216,192,-1.03e-02},
-      {216,215,-1.03e-02},
-      {216,221,-1.03e-02},
-      {216,247,-1.03e-02},
-      {216,248,-1.03e-02},
-      {216,249,-1.03e-02},
-      {216,474,-4.84e-05},
-      {216,475,-1.93e-04},
-      {216,481,-4.84e-05},
-      {216,504,-1.93e-04},
-      {216,505,-7.74e-04},
-      {216,510,-1.93e-04},
-      {216,536,-4.84e-05},
-      {216,537,-1.93e-04},
-      {216,538,-4.84e-05},
-      {217,217,8.29e-02},
-      {217,184,-1.03e-02},
-      {217,187,-1.03e-02},
-      {217,188,-1.03e-02},
-      {217,213,-1.03e-02},
-      {217,214,-1.03e-02},
-      {217,244,-1.03e-02},
-      {217,245,-1.03e-02},
-      {217,246,-1.03e-02},
-      {217,473,-4.84e-05},
-      {217,476,-4.84e-05},
-      {217,477,-1.93e-04},
-      {217,502,-1.93e-04},
-      {217,503,-1.93e-04},
-      {217,506,-7.74e-04},
-      {217,533,-4.84e-05},
-      {217,534,-1.93e-04},
-      {217,535,-4.84e-05},
-      {218,218,8.29e-02},
-      {218,189,-1.03e-02},
-      {218,191,-1.03e-02},
-      {218,192,-1.03e-02},
-      {218,219,-1.03e-02},
-      {218,221,-1.03e-02},
-      {218,249,-1.03e-02},
-      {218,250,-1.03e-02},
-      {218,251,-1.03e-02},
-      {218,478,-4.84e-05},
-      {218,480,-1.93e-04},
-      {218,481,-4.84e-05},
-      {218,507,-7.74e-04},
-      {218,508,-1.93e-04},
-      {218,510,-1.93e-04},
-      {218,538,-4.84e-05},
-      {218,539,-1.93e-04},
-      {218,540,-4.84e-05},
-      {219,219,8.29e-02},
-      {219,189,-1.03e-02},
-      {219,190,-1.03e-02},
-      {219,191,-1.03e-02},
-      {219,218,-1.03e-02},
-      {219,220,-1.03e-02},
-      {219,250,-1.03e-02},
-      {219,251,-1.03e-02},
-      {219,252,-1.03e-02},
-      {219,478,-1.93e-04},
-      {219,479,-4.84e-05},
-      {219,480,-4.84e-05},
-      {219,507,-1.93e-04},
-      {219,508,-7.74e-04},
-      {219,509,-1.93e-04},
-      {219,539,-4.84e-05},
-      {219,540,-1.93e-04},
-      {219,541,-4.84e-05},
-      {220,220,8.29e-02},
-      {220,189,-1.03e-02},
-      {220,190,-1.03e-02},
-      {220,195,-1.03e-02},
-      {220,219,-1.03e-02},
-      {220,224,-1.03e-02},
-      {220,251,-1.03e-02},
-      {220,252,-1.03e-02},
-      {220,253,-1.03e-02},
-      {220,478,-4.84e-05},
-      {220,479,-1.93e-04},
-      {220,484,-4.84e-05},
-      {220,508,-1.93e-04},
-      {220,509,-7.74e-04},
-      {220,513,-1.93e-04},
-      {220,540,-4.84e-05},
-      {220,541,-1.93e-04},
-      {220,542,-4.84e-05},
-      {221,221,8.29e-02},
-      {221,186,-1.03e-02},
-      {221,191,-1.03e-02},
-      {221,192,-1.03e-02},
-      {221,216,-1.03e-02},
-      {221,218,-1.03e-02},
-      {221,248,-1.03e-02},
-      {221,249,-1.03e-02},
-      {221,250,-1.03e-02},
-      {221,475,-4.84e-05},
-      {221,480,-4.84e-05},
-      {221,481,-1.93e-04},
-      {221,505,-1.93e-04},
-      {221,507,-1.93e-04},
-      {221,510,-7.74e-04},
-      {221,537,-4.84e-05},
-      {221,538,-1.93e-04},
-      {221,539,-4.84e-05},
-      {222,222,8.29e-02},
-      {222,193,-1.03e-02},
-      {222,194,-1.03e-02},
-      {222,195,-1.03e-02},
-      {222,223,-1.03e-02},
-      {222,224,-1.03e-02},
-      {222,253,-1.03e-02},
-      {222,254,-1.03e-02},
-      {222,255,-1.03e-02},
-      {222,482,-4.84e-05},
-      {222,483,-1.93e-04},
-      {222,484,-4.84e-05},
-      {222,511,-7.74e-04},
-      {222,512,-1.93e-04},
-      {222,513,-1.93e-04},
-      {222,542,-4.84e-05},
-      {222,543,-1.93e-04},
-      {222,544,-4.84e-05},
-      {223,223,8.29e-02},
-      {223,170,-1.03e-02},
-      {223,193,-1.03e-02},
-      {223,194,-1.03e-02},
-      {223,197,-1.03e-02},
-      {223,222,-1.03e-02},
-      {223,226,-1.03e-02},
-      {223,254,-1.03e-02},
-      {223,255,-1.03e-02},
-      {223,459,-4.84e-05},
-      {223,482,-1.93e-04},
-      {223,483,-4.84e-05},
-      {223,486,-1.93e-04},
-      {223,511,-1.93e-04},
-      {223,512,-7.74e-04},
-      {223,515,-4.84e-05},
-      {223,543,-4.84e-05},
-      {223,544,-1.93e-04},
-      {224,224,8.29e-02},
-      {224,190,-1.03e-02},
-      {224,194,-1.03e-02},
-      {224,195,-1.03e-02},
-      {224,220,-1.03e-02},
-      {224,222,-1.03e-02},
-      {224,252,-1.03e-02},
-      {224,253,-1.03e-02},
-      {224,254,-1.03e-02},
-      {224,479,-4.84e-05},
-      {224,483,-4.84e-05},
-      {224,484,-1.93e-04},
-      {224,509,-1.93e-04},
-      {224,511,-1.93e-04},
-      {224,513,-7.74e-04},
-      {224,541,-4.84e-05},
-      {224,542,-1.93e-04},
-      {224,543,-4.84e-05},
-      {225,225,2.08e-01},
-      {225,196,3.65e-02},
-      {225,198,-1.03e-02},
-      {225,227,-1.03e-02},
-      {225,256,3.65e-02},
-      {225,259,-1.03e-02},
-      {225,485,-9.67e-05},
-      {225,487,-4.84e-05},
-      {225,514,-3.87e-04},
-      {225,516,-1.93e-04},
-      {225,545,-9.67e-05},
-      {225,548,-4.84e-05},
-      {226,226,2.08e-01},
-      {226,197,3.65e-02},
-      {226,223,-1.03e-02},
-      {226,255,-1.03e-02},
-      {226,258,3.65e-02},
-      {226,288,-1.03e-02},
-      {226,486,-9.67e-05},
-      {226,512,-4.84e-05},
-      {226,515,-3.87e-04},
-      {226,544,-1.93e-04},
-      {226,547,-9.67e-05},
-      {226,577,-4.84e-05},
-      {227,227,8.29e-02},
-      {227,196,-1.03e-02},
-      {227,198,-1.03e-02},
-      {227,199,-1.03e-02},
-      {227,225,-1.03e-02},
-      {227,228,-1.03e-02},
-      {227,256,-1.03e-02},
-      {227,259,-1.03e-02},
-      {227,260,-1.03e-02},
-      {227,485,-4.84e-05},
-      {227,487,-1.93e-04},
-      {227,488,-4.84e-05},
-      {227,514,-1.93e-04},
-      {227,516,-7.74e-04},
-      {227,517,-1.93e-04},
-      {227,545,-4.84e-05},
-      {227,548,-1.93e-04},
-      {227,549,-4.84e-05},
-      {228,228,8.29e-02},
-      {228,198,-1.03e-02},
-      {228,199,-1.03e-02},
-      {228,200,-1.03e-02},
-      {228,227,-1.03e-02},
-      {228,229,-1.03e-02},
-      {228,259,-1.03e-02},
-      {228,260,-1.03e-02},
-      {228,261,-1.03e-02},
-      {228,487,-4.84e-05},
-      {228,488,-1.93e-04},
-      {228,489,-4.84e-05},
-      {228,516,-1.93e-04},
-      {228,517,-7.74e-04},
-      {228,518,-1.93e-04},
-      {228,548,-4.84e-05},
-      {228,549,-1.93e-04},
-      {228,550,-4.84e-05},
-      {229,229,8.29e-02},
-      {229,199,-1.03e-02},
-      {229,200,-1.03e-02},
-      {229,201,-1.03e-02},
-      {229,228,-1.03e-02},
-      {229,230,-1.03e-02},
-      {229,260,-1.03e-02},
-      {229,261,-1.03e-02},
-      {229,262,-1.03e-02},
-      {229,488,-4.84e-05},
-      {229,489,-1.93e-04},
-      {229,490,-4.84e-05},
-      {229,517,-1.93e-04},
-      {229,518,-7.74e-04},
-      {229,519,-1.93e-04},
-      {229,549,-4.84e-05},
-      {229,550,-1.93e-04},
-      {229,551,-4.84e-05},
-      {230,230,8.29e-02},
-      {230,200,-1.03e-02},
-      {230,201,-1.03e-02},
-      {230,202,-1.03e-02},
-      {230,229,-1.03e-02},
-      {230,231,-1.03e-02},
-      {230,261,-1.03e-02},
-      {230,262,-1.03e-02},
-      {230,263,-1.03e-02},
-      {230,489,-4.84e-05},
-      {230,490,-1.93e-04},
-      {230,491,-4.84e-05},
-      {230,518,-1.93e-04},
-      {230,519,-7.74e-04},
-      {230,520,-1.93e-04},
-      {230,550,-4.84e-05},
-      {230,551,-1.93e-04},
-      {230,552,-4.84e-05},
-      {231,231,8.29e-02},
-      {231,201,-1.03e-02},
-      {231,202,-1.03e-02},
-      {231,203,-1.03e-02},
-      {231,230,-1.03e-02},
-      {231,232,-1.03e-02},
-      {231,262,-1.03e-02},
-      {231,263,-1.03e-02},
-      {231,264,-1.03e-02},
-      {231,490,-4.84e-05},
-      {231,491,-1.93e-04},
-      {231,492,-4.84e-05},
-      {231,519,-1.93e-04},
-      {231,520,-7.74e-04},
-      {231,521,-1.93e-04},
-      {231,551,-4.84e-05},
-      {231,552,-1.93e-04},
-      {231,553,-4.84e-05},
-      {232,232,8.29e-02},
-      {232,202,-1.03e-02},
-      {232,203,-1.03e-02},
-      {232,204,-1.03e-02},
-      {232,231,-1.03e-02},
-      {232,233,-1.03e-02},
-      {232,263,-1.03e-02},
-      {232,264,-1.03e-02},
-      {232,265,-1.03e-02},
-      {232,491,-4.84e-05},
-      {232,492,-1.93e-04},
-      {232,493,-4.84e-05},
-      {232,520,-1.93e-04},
-      {232,521,-7.74e-04},
-      {232,522,-1.93e-04},
-      {232,552,-4.84e-05},
-      {232,553,-1.93e-04},
-      {232,554,-4.84e-05},
-      {233,233,8.29e-02},
-      {233,203,-1.03e-02},
-      {233,204,-1.03e-02},
-      {233,205,-1.03e-02},
-      {233,232,-1.03e-02},
-      {233,234,-1.03e-02},
-      {233,264,-1.03e-02},
-      {233,265,-1.03e-02},
-      {233,266,-1.03e-02},
-      {233,492,-4.84e-05},
-      {233,493,-1.93e-04},
-      {233,494,-4.84e-05},
-      {233,521,-1.93e-04},
-      {233,522,-7.74e-04},
-      {233,523,-1.93e-04},
-      {233,553,-4.84e-05},
-      {233,554,-1.93e-04},
-      {233,555,-4.84e-05},
-      {234,234,8.29e-02},
-      {234,204,-1.03e-02},
-      {234,205,-1.03e-02},
-      {234,206,-1.03e-02},
-      {234,233,-1.03e-02},
-      {234,235,-1.03e-02},
-      {234,265,-1.03e-02},
-      {234,266,-1.03e-02},
-      {234,267,-1.03e-02},
-      {234,493,-4.84e-05},
-      {234,494,-1.93e-04},
-      {234,495,-4.84e-05},
-      {234,522,-1.93e-04},
-      {234,523,-7.74e-04},
-      {234,524,-1.93e-04},
-      {234,554,-4.84e-05},
-      {234,555,-1.93e-04},
-      {234,556,-4.84e-05},
-      {235,235,8.29e-02},
-      {235,205,-1.03e-02},
-      {235,206,-1.03e-02},
-      {235,207,-1.03e-02},
-      {235,234,-1.03e-02},
-      {235,236,-1.03e-02},
-      {235,266,-1.03e-02},
-      {235,267,-1.03e-02},
-      {235,268,-1.03e-02},
-      {235,494,-4.84e-05},
-      {235,495,-1.93e-04},
-      {235,496,-4.84e-05},
-      {235,523,-1.93e-04},
-      {235,524,-7.74e-04},
-      {235,525,-1.93e-04},
-      {235,555,-4.84e-05},
-      {235,556,-1.93e-04},
-      {235,557,-4.84e-05},
-      {236,236,8.29e-02},
-      {236,206,-1.03e-02},
-      {236,207,-1.03e-02},
-      {236,208,-1.03e-02},
-      {236,235,-1.03e-02},
-      {236,237,-1.03e-02},
-      {236,267,-1.03e-02},
-      {236,268,-1.03e-02},
-      {236,269,-1.03e-02},
-      {236,495,-4.84e-05},
-      {236,496,-1.93e-04},
-      {236,497,-4.84e-05},
-      {236,524,-1.93e-04},
-      {236,525,-7.74e-04},
-      {236,526,-1.93e-04},
-      {236,556,-4.84e-05},
-      {236,557,-1.93e-04},
-      {236,558,-4.84e-05},
-      {237,237,8.29e-02},
-      {237,207,-1.03e-02},
-      {237,208,-1.03e-02},
-      {237,209,-1.03e-02},
-      {237,236,-1.03e-02},
-      {237,238,-1.03e-02},
-      {237,268,-1.03e-02},
-      {237,269,-1.03e-02},
-      {237,270,-1.03e-02},
-      {237,496,-4.84e-05},
-      {237,497,-1.93e-04},
-      {237,498,-4.84e-05},
-      {237,525,-1.93e-04},
-      {237,526,-7.74e-04},
-      {237,527,-1.93e-04},
-      {237,557,-4.84e-05},
-      {237,558,-1.93e-04},
-      {237,559,-4.84e-05},
-      {238,238,8.29e-02},
-      {238,208,-1.03e-02},
-      {238,209,-1.03e-02},
-      {238,210,-1.03e-02},
-      {238,237,-1.03e-02},
-      {238,239,-1.03e-02},
-      {238,269,-1.03e-02},
-      {238,270,-1.03e-02},
-      {238,271,-1.03e-02},
-      {238,497,-4.84e-05},
-      {238,498,-1.93e-04},
-      {238,499,-4.84e-05},
-      {238,526,-1.93e-04},
-      {238,527,-7.74e-04},
-      {238,528,-1.93e-04},
-      {238,558,-4.84e-05},
-      {238,559,-1.93e-04},
-      {238,560,-4.84e-05},
-      {239,239,8.29e-02},
-      {239,209,-1.03e-02},
-      {239,210,-1.03e-02},
-      {239,211,-1.03e-02},
-      {239,238,-1.03e-02},
-      {239,240,-1.03e-02},
-      {239,270,-1.03e-02},
-      {239,271,-1.03e-02},
-      {239,272,-1.03e-02},
-      {239,498,-4.84e-05},
-      {239,499,-1.93e-04},
-      {239,500,-4.84e-05},
-      {239,527,-1.93e-04},
-      {239,528,-7.74e-04},
-      {239,529,-1.93e-04},
-      {239,559,-4.84e-05},
-      {239,560,-1.93e-04},
-      {239,561,-4.84e-05},
-      {240,240,8.29e-02},
-      {240,210,-1.03e-02},
-      {240,211,-1.03e-02},
-      {240,239,-1.03e-02},
-      {240,241,-1.03e-02},
-      {240,242,-1.03e-02},
-      {240,271,-1.03e-02},
-      {240,272,-1.03e-02},
-      {240,273,-1.03e-02},
-      {240,499,-4.84e-05},
-      {240,500,-1.93e-04},
-      {240,528,-1.93e-04},
-      {240,529,-7.74e-04},
-      {240,530,-1.93e-04},
-      {240,531,-4.84e-05},
-      {240,560,-4.84e-05},
-      {240,561,-1.93e-04},
-      {240,562,-4.84e-05},
-      {241,241,8.29e-02},
-      {241,211,-1.03e-02},
-      {241,240,-1.03e-02},
-      {241,242,-1.03e-02},
-      {241,257,-1.03e-02},
-      {241,272,-1.03e-02},
-      {241,273,-1.03e-02},
-      {241,274,-1.03e-02},
-      {241,275,-1.03e-02},
-      {241,500,-4.84e-05},
-      {241,529,-1.93e-04},
-      {241,530,-7.74e-04},
-      {241,531,-1.93e-04},
-      {241,546,-4.84e-05},
-      {241,561,-4.84e-05},
-      {241,562,-1.93e-04},
-      {241,563,-1.93e-04},
-      {241,564,-4.84e-05},
-      {242,242,8.29e-02},
-      {242,211,-1.03e-02},
-      {242,212,-1.03e-02},
-      {242,240,-1.03e-02},
-      {242,241,-1.03e-02},
-      {242,243,-1.03e-02},
-      {242,274,-1.03e-02},
-      {242,275,-1.03e-02},
-      {242,276,-1.03e-02},
-      {242,500,-1.93e-04},
-      {242,501,-4.84e-05},
-      {242,529,-4.84e-05},
-      {242,530,-1.93e-04},
-      {242,531,-7.74e-04},
-      {242,532,-1.93e-04},
-      {242,563,-4.84e-05},
-      {242,564,-1.93e-04},
-      {242,565,-4.84e-05},
-      {243,243,8.29e-02},
-      {243,211,-1.03e-02},
-      {243,212,-1.03e-02},
-      {243,213,-1.03e-02},
-      {243,242,-1.03e-02},
-      {243,244,-1.03e-02},
-      {243,275,-1.03e-02},
-      {243,276,-1.03e-02},
-      {243,277,-1.03e-02},
-      {243,500,-4.84e-05},
-      {243,501,-1.93e-04},
-      {243,502,-4.84e-05},
-      {243,531,-1.93e-04},
-      {243,532,-7.74e-04},
-      {243,533,-1.93e-04},
-      {243,564,-4.84e-05},
-      {243,565,-1.93e-04},
-      {243,566,-4.84e-05},
-      {244,244,8.29e-02},
-      {244,212,-1.03e-02},
-      {244,213,-1.03e-02},
-      {244,217,-1.03e-02},
-      {244,243,-1.03e-02},
-      {244,245,-1.03e-02},
-      {244,276,-1.03e-02},
-      {244,277,-1.03e-02},
-      {244,278,-1.03e-02},
-      {244,501,-4.84e-05},
-      {244,502,-1.93e-04},
-      {244,506,-4.84e-05},
-      {244,532,-1.93e-04},
-      {244,533,-7.74e-04},
-      {244,534,-1.93e-04},
-      {244,565,-4.84e-05},
-      {244,566,-1.93e-04},
-      {244,567,-4.84e-05},
-      {245,245,8.29e-02},
-      {245,213,-1.03e-02},
-      {245,214,-1.03e-02},
-      {245,217,-1.03e-02},
-      {245,244,-1.03e-02},
-      {245,246,-1.03e-02},
-      {245,277,-1.03e-02},
-      {245,278,-1.03e-02},
-      {245,279,-1.03e-02},
-      {245,502,-4.84e-05},
-      {245,503,-4.84e-05},
-      {245,506,-1.93e-04},
-      {245,533,-1.93e-04},
-      {245,534,-7.74e-04},
-      {245,535,-1.93e-04},
-      {245,566,-4.84e-05},
-      {245,567,-1.93e-04},
-      {245,568,-4.84e-05},
-      {246,246,8.29e-02},
-      {246,214,-1.03e-02},
-      {246,215,-1.03e-02},
-      {246,217,-1.03e-02},
-      {246,245,-1.03e-02},
-      {246,247,-1.03e-02},
-      {246,278,-1.03e-02},
-      {246,279,-1.03e-02},
-      {246,280,-1.03e-02},
-      {246,503,-1.93e-04},
-      {246,504,-4.84e-05},
-      {246,506,-4.84e-05},
-      {246,534,-1.93e-04},
-      {246,535,-7.74e-04},
-      {246,536,-1.93e-04},
-      {246,567,-4.84e-05},
-      {246,568,-1.93e-04},
-      {246,569,-4.84e-05},
-      {247,247,8.29e-02},
-      {247,214,-1.03e-02},
-      {247,215,-1.03e-02},
-      {247,216,-1.03e-02},
-      {247,246,-1.03e-02},
-      {247,248,-1.03e-02},
-      {247,279,-1.03e-02},
-      {247,280,-1.03e-02},
-      {247,281,-1.03e-02},
-      {247,503,-4.84e-05},
-      {247,504,-1.93e-04},
-      {247,505,-4.84e-05},
-      {247,535,-1.93e-04},
-      {247,536,-7.74e-04},
-      {247,537,-1.93e-04},
-      {247,568,-4.84e-05},
-      {247,569,-1.93e-04},
-      {247,570,-4.84e-05},
-      {248,248,8.29e-02},
-      {248,215,-1.03e-02},
-      {248,216,-1.03e-02},
-      {248,221,-1.03e-02},
-      {248,247,-1.03e-02},
-      {248,249,-1.03e-02},
-      {248,280,-1.03e-02},
-      {248,281,-1.03e-02},
-      {248,282,-1.03e-02},
-      {248,504,-4.84e-05},
-      {248,505,-1.93e-04},
-      {248,510,-4.84e-05},
-      {248,536,-1.93e-04},
-      {248,537,-7.74e-04},
-      {248,538,-1.93e-04},
-      {248,569,-4.84e-05},
-      {248,570,-1.93e-04},
-      {248,571,-4.84e-05},
-      {249,249,8.29e-02},
-      {249,216,-1.03e-02},
-      {249,218,-1.03e-02},
-      {249,221,-1.03e-02},
-      {249,248,-1.03e-02},
-      {249,250,-1.03e-02},
-      {249,281,-1.03e-02},
-      {249,282,-1.03e-02},
-      {249,283,-1.03e-02},
-      {249,505,-4.84e-05},
-      {249,507,-4.84e-05},
-      {249,510,-1.93e-04},
-      {249,537,-1.93e-04},
-      {249,538,-7.74e-04},
-      {249,539,-1.93e-04},
-      {249,570,-4.84e-05},
-      {249,571,-1.93e-04},
-      {249,572,-4.84e-05},
-      {250,250,8.29e-02},
-      {250,218,-1.03e-02},
-      {250,219,-1.03e-02},
-      {250,221,-1.03e-02},
-      {250,249,-1.03e-02},
-      {250,251,-1.03e-02},
-      {250,282,-1.03e-02},
-      {250,283,-1.03e-02},
-      {250,284,-1.03e-02},
-      {250,507,-1.93e-04},
-      {250,508,-4.84e-05},
-      {250,510,-4.84e-05},
-      {250,538,-1.93e-04},
-      {250,539,-7.74e-04},
-      {250,540,-1.93e-04},
-      {250,571,-4.84e-05},
-      {250,572,-1.93e-04},
-      {250,573,-4.84e-05},
-      {251,251,8.29e-02},
-      {251,218,-1.03e-02},
-      {251,219,-1.03e-02},
-      {251,220,-1.03e-02},
-      {251,250,-1.03e-02},
-      {251,252,-1.03e-02},
-      {251,283,-1.03e-02},
-      {251,284,-1.03e-02},
-      {251,285,-1.03e-02},
-      {251,507,-4.84e-05},
-      {251,508,-1.93e-04},
-      {251,509,-4.84e-05},
-      {251,539,-1.93e-04},
-      {251,540,-7.74e-04},
-      {251,541,-1.93e-04},
-      {251,572,-4.84e-05},
-      {251,573,-1.93e-04},
-      {251,574,-4.84e-05},
-      {252,252,8.29e-02},
-      {252,219,-1.03e-02},
-      {252,220,-1.03e-02},
-      {252,224,-1.03e-02},
-      {252,251,-1.03e-02},
-      {252,253,-1.03e-02},
-      {252,284,-1.03e-02},
-      {252,285,-1.03e-02},
-      {252,286,-1.03e-02},
-      {252,508,-4.84e-05},
-      {252,509,-1.93e-04},
-      {252,513,-4.84e-05},
-      {252,540,-1.93e-04},
-      {252,541,-7.74e-04},
-      {252,542,-1.93e-04},
-      {252,573,-4.84e-05},
-      {252,574,-1.93e-04},
-      {252,575,-4.84e-05},
-      {253,253,8.29e-02},
-      {253,220,-1.03e-02},
-      {253,222,-1.03e-02},
-      {253,224,-1.03e-02},
-      {253,252,-1.03e-02},
-      {253,254,-1.03e-02},
-      {253,285,-1.03e-02},
-      {253,286,-1.03e-02},
-      {253,287,-1.03e-02},
-      {253,509,-4.84e-05},
-      {253,511,-4.84e-05},
-      {253,513,-1.93e-04},
-      {253,541,-1.93e-04},
-      {253,542,-7.74e-04},
-      {253,543,-1.93e-04},
-      {253,574,-4.84e-05},
-      {253,575,-1.93e-04},
-      {253,576,-4.84e-05},
-      {254,254,8.29e-02},
-      {254,222,-1.03e-02},
-      {254,223,-1.03e-02},
-      {254,224,-1.03e-02},
-      {254,253,-1.03e-02},
-      {254,255,-1.03e-02},
-      {254,286,-1.03e-02},
-      {254,287,-1.03e-02},
-      {254,288,-1.03e-02},
-      {254,511,-1.93e-04},
-      {254,512,-4.84e-05},
-      {254,513,-4.84e-05},
-      {254,542,-1.93e-04},
-      {254,543,-7.74e-04},
-      {254,544,-1.93e-04},
-      {254,575,-4.84e-05},
-      {254,576,-1.93e-04},
-      {254,577,-4.84e-05},
-      {255,255,8.29e-02},
-      {255,197,-1.03e-02},
-      {255,222,-1.03e-02},
-      {255,223,-1.03e-02},
-      {255,226,-1.03e-02},
-      {255,254,-1.03e-02},
-      {255,258,-1.03e-02},
-      {255,287,-1.03e-02},
-      {255,288,-1.03e-02},
-      {255,486,-4.84e-05},
-      {255,511,-4.84e-05},
-      {255,512,-1.93e-04},
-      {255,515,-1.93e-04},
-      {255,543,-1.93e-04},
-      {255,544,-7.74e-04},
-      {255,547,-4.84e-05},
-      {255,576,-4.84e-05},
-      {255,577,-1.93e-04},
-      {256,256,1.87e-01},
-      {256,225,3.65e-02},
-      {256,227,-1.03e-02},
-      {256,259,3.65e-02},
-      {256,514,-9.67e-05},
-      {256,516,-4.84e-05},
-      {256,545,-1.93e-04},
-      {256,548,-9.67e-05},
-      {257,257,1.87e-01},
-      {257,241,-1.03e-02},
-      {257,273,3.65e-02},
-      {257,274,3.65e-02},
-      {257,530,-4.84e-05},
-      {257,546,-1.93e-04},
-      {257,562,-9.67e-05},
-      {257,563,-9.67e-05},
-      {258,258,1.87e-01},
-      {258,226,3.65e-02},
-      {258,255,-1.03e-02},
-      {258,288,3.65e-02},
-      {258,515,-9.67e-05},
-      {258,544,-4.84e-05},
-      {258,547,-1.93e-04},
-      {258,577,-9.67e-05},
-      {259,259,2.08e-01},
-      {259,225,-1.03e-02},
-      {259,227,-1.03e-02},
-      {259,228,-1.03e-02},
-      {259,256,3.65e-02},
-      {259,260,3.65e-02},
-      {259,514,-4.84e-05},
-      {259,516,-1.93e-04},
-      {259,517,-4.84e-05},
-      {259,545,-9.67e-05},
-      {259,548,-3.87e-04},
-      {259,549,-9.67e-05},
-      {260,260,2.08e-01},
-      {260,227,-1.03e-02},
-      {260,228,-1.03e-02},
-      {260,229,-1.03e-02},
-      {260,259,3.65e-02},
-      {260,261,3.65e-02},
-      {260,516,-4.84e-05},
-      {260,517,-1.93e-04},
-      {260,518,-4.84e-05},
-      {260,548,-9.67e-05},
-      {260,549,-3.87e-04},
-      {260,550,-9.67e-05},
-      {261,261,2.08e-01},
-      {261,228,-1.03e-02},
-      {261,229,-1.03e-02},
-      {261,230,-1.03e-02},
-      {261,260,3.65e-02},
-      {261,262,3.65e-02},
-      {261,517,-4.84e-05},
-      {261,518,-1.93e-04},
-      {261,519,-4.84e-05},
-      {261,549,-9.67e-05},
-      {261,550,-3.87e-04},
-      {261,551,-9.67e-05},
-      {262,262,2.08e-01},
-      {262,229,-1.03e-02},
-      {262,230,-1.03e-02},
-      {262,231,-1.03e-02},
-      {262,261,3.65e-02},
-      {262,263,3.65e-02},
-      {262,518,-4.84e-05},
-      {262,519,-1.93e-04},
-      {262,520,-4.84e-05},
-      {262,550,-9.67e-05},
-      {262,551,-3.87e-04},
-      {262,552,-9.67e-05},
-      {263,263,2.08e-01},
-      {263,230,-1.03e-02},
-      {263,231,-1.03e-02},
-      {263,232,-1.03e-02},
-      {263,262,3.65e-02},
-      {263,264,3.65e-02},
-      {263,519,-4.84e-05},
-      {263,520,-1.93e-04},
-      {263,521,-4.84e-05},
-      {263,551,-9.67e-05},
-      {263,552,-3.87e-04},
-      {263,553,-9.67e-05},
-      {264,264,2.08e-01},
-      {264,231,-1.03e-02},
-      {264,232,-1.03e-02},
-      {264,233,-1.03e-02},
-      {264,263,3.65e-02},
-      {264,265,3.65e-02},
-      {264,520,-4.84e-05},
-      {264,521,-1.93e-04},
-      {264,522,-4.84e-05},
-      {264,552,-9.67e-05},
-      {264,553,-3.87e-04},
-      {264,554,-9.67e-05},
-      {265,265,2.08e-01},
-      {265,232,-1.03e-02},
-      {265,233,-1.03e-02},
-      {265,234,-1.03e-02},
-      {265,264,3.65e-02},
-      {265,266,3.65e-02},
-      {265,521,-4.84e-05},
-      {265,522,-1.93e-04},
-      {265,523,-4.84e-05},
-      {265,553,-9.67e-05},
-      {265,554,-3.87e-04},
-      {265,555,-9.67e-05},
-      {266,266,2.08e-01},
-      {266,233,-1.03e-02},
-      {266,234,-1.03e-02},
-      {266,235,-1.03e-02},
-      {266,265,3.65e-02},
-      {266,267,3.65e-02},
-      {266,522,-4.84e-05},
-      {266,523,-1.93e-04},
-      {266,524,-4.84e-05},
-      {266,554,-9.67e-05},
-      {266,555,-3.87e-04},
-      {266,556,-9.67e-05},
-      {267,267,2.08e-01},
-      {267,234,-1.03e-02},
-      {267,235,-1.03e-02},
-      {267,236,-1.03e-02},
-      {267,266,3.65e-02},
-      {267,268,3.65e-02},
-      {267,523,-4.84e-05},
-      {267,524,-1.93e-04},
-      {267,525,-4.84e-05},
-      {267,555,-9.67e-05},
-      {267,556,-3.87e-04},
-      {267,557,-9.67e-05},
-      {268,268,2.08e-01},
-      {268,235,-1.03e-02},
-      {268,236,-1.03e-02},
-      {268,237,-1.03e-02},
-      {268,267,3.65e-02},
-      {268,269,3.65e-02},
-      {268,524,-4.84e-05},
-      {268,525,-1.93e-04},
-      {268,526,-4.84e-05},
-      {268,556,-9.67e-05},
-      {268,557,-3.87e-04},
-      {268,558,-9.67e-05},
-      {269,269,2.08e-01},
-      {269,236,-1.03e-02},
-      {269,237,-1.03e-02},
-      {269,238,-1.03e-02},
-      {269,268,3.65e-02},
-      {269,270,3.65e-02},
-      {269,525,-4.84e-05},
-      {269,526,-1.93e-04},
-      {269,527,-4.84e-05},
-      {269,557,-9.67e-05},
-      {269,558,-3.87e-04},
-      {269,559,-9.67e-05},
-      {270,270,2.08e-01},
-      {270,237,-1.03e-02},
-      {270,238,-1.03e-02},
-      {270,239,-1.03e-02},
-      {270,269,3.65e-02},
-      {270,271,3.65e-02},
-      {270,526,-4.84e-05},
-      {270,527,-1.93e-04},
-      {270,528,-4.84e-05},
-      {270,558,-9.67e-05},
-      {270,559,-3.87e-04},
-      {270,560,-9.67e-05},
-      {271,271,2.08e-01},
-      {271,238,-1.03e-02},
-      {271,239,-1.03e-02},
-      {271,240,-1.03e-02},
-      {271,270,3.65e-02},
-      {271,272,3.65e-02},
-      {271,527,-4.84e-05},
-      {271,528,-1.93e-04},
-      {271,529,-4.84e-05},
-      {271,559,-9.67e-05},
-      {271,560,-3.87e-04},
-      {271,561,-9.67e-05},
-      {272,272,2.08e-01},
-      {272,239,-1.03e-02},
-      {272,240,-1.03e-02},
-      {272,241,-1.03e-02},
-      {272,271,3.65e-02},
-      {272,273,3.65e-02},
-      {272,528,-4.84e-05},
-      {272,529,-1.93e-04},
-      {272,530,-4.84e-05},
-      {272,560,-9.67e-05},
-      {272,561,-3.87e-04},
-      {272,562,-9.67e-05},
-      {273,273,2.08e-01},
-      {273,240,-1.03e-02},
-      {273,241,-1.03e-02},
-      {273,257,3.65e-02},
-      {273,272,3.65e-02},
-      {273,274,-1.03e-02},
-      {273,529,-4.84e-05},
-      {273,530,-1.93e-04},
-      {273,546,-9.67e-05},
-      {273,561,-9.67e-05},
-      {273,562,-3.87e-04},
-      {273,563,-4.84e-05},
-      {274,274,2.08e-01},
-      {274,241,-1.03e-02},
-      {274,242,-1.03e-02},
-      {274,257,3.65e-02},
-      {274,273,-1.03e-02},
-      {274,275,3.65e-02},
-      {274,530,-1.93e-04},
-      {274,531,-4.84e-05},
-      {274,546,-9.67e-05},
-      {274,562,-4.84e-05},
-      {274,563,-3.87e-04},
-      {274,564,-9.67e-05},
-      {275,275,2.08e-01},
-      {275,241,-1.03e-02},
-      {275,242,-1.03e-02},
-      {275,243,-1.03e-02},
-      {275,274,3.65e-02},
-      {275,276,3.65e-02},
-      {275,530,-4.84e-05},
-      {275,531,-1.93e-04},
-      {275,532,-4.84e-05},
-      {275,563,-9.67e-05},
-      {275,564,-3.87e-04},
-      {275,565,-9.67e-05},
-      {276,276,2.08e-01},
-      {276,242,-1.03e-02},
-      {276,243,-1.03e-02},
-      {276,244,-1.03e-02},
-      {276,275,3.65e-02},
-      {276,277,3.65e-02},
-      {276,531,-4.84e-05},
-      {276,532,-1.93e-04},
-      {276,533,-4.84e-05},
-      {276,564,-9.67e-05},
-      {276,565,-3.87e-04},
-      {276,566,-9.67e-05},
-      {277,277,2.08e-01},
-      {277,243,-1.03e-02},
-      {277,244,-1.03e-02},
-      {277,245,-1.03e-02},
-      {277,276,3.65e-02},
-      {277,278,3.65e-02},
-      {277,532,-4.84e-05},
-      {277,533,-1.93e-04},
-      {277,534,-4.84e-05},
-      {277,565,-9.67e-05},
-      {277,566,-3.87e-04},
-      {277,567,-9.67e-05},
-      {278,278,2.08e-01},
-      {278,244,-1.03e-02},
-      {278,245,-1.03e-02},
-      {278,246,-1.03e-02},
-      {278,277,3.65e-02},
-      {278,279,3.65e-02},
-      {278,533,-4.84e-05},
-      {278,534,-1.93e-04},
-      {278,535,-4.84e-05},
-      {278,566,-9.67e-05},
-      {278,567,-3.87e-04},
-      {278,568,-9.67e-05},
-      {279,279,2.08e-01},
-      {279,245,-1.03e-02},
-      {279,246,-1.03e-02},
-      {279,247,-1.03e-02},
-      {279,278,3.65e-02},
-      {279,280,3.65e-02},
-      {279,534,-4.84e-05},
-      {279,535,-1.93e-04},
-      {279,536,-4.84e-05},
-      {279,567,-9.67e-05},
-      {279,568,-3.87e-04},
-      {279,569,-9.67e-05},
-      {280,280,2.08e-01},
-      {280,246,-1.03e-02},
-      {280,247,-1.03e-02},
-      {280,248,-1.03e-02},
-      {280,279,3.65e-02},
-      {280,281,3.65e-02},
-      {280,535,-4.84e-05},
-      {280,536,-1.93e-04},
-      {280,537,-4.84e-05},
-      {280,568,-9.67e-05},
-      {280,569,-3.87e-04},
-      {280,570,-9.67e-05},
-      {281,281,2.08e-01},
-      {281,247,-1.03e-02},
-      {281,248,-1.03e-02},
-      {281,249,-1.03e-02},
-      {281,280,3.65e-02},
-      {281,282,3.65e-02},
-      {281,536,-4.84e-05},
-      {281,537,-1.93e-04},
-      {281,538,-4.84e-05},
-      {281,569,-9.67e-05},
-      {281,570,-3.87e-04},
-      {281,571,-9.67e-05},
-      {282,282,2.08e-01},
-      {282,248,-1.03e-02},
-      {282,249,-1.03e-02},
-      {282,250,-1.03e-02},
-      {282,281,3.65e-02},
-      {282,283,3.65e-02},
-      {282,537,-4.84e-05},
-      {282,538,-1.93e-04},
-      {282,539,-4.84e-05},
-      {282,570,-9.67e-05},
-      {282,571,-3.87e-04},
-      {282,572,-9.67e-05},
-      {283,283,2.08e-01},
-      {283,249,-1.03e-02},
-      {283,250,-1.03e-02},
-      {283,251,-1.03e-02},
-      {283,282,3.65e-02},
-      {283,284,3.65e-02},
-      {283,538,-4.84e-05},
-      {283,539,-1.93e-04},
-      {283,540,-4.84e-05},
-      {283,571,-9.67e-05},
-      {283,572,-3.87e-04},
-      {283,573,-9.67e-05},
-      {284,284,2.08e-01},
-      {284,250,-1.03e-02},
-      {284,251,-1.03e-02},
-      {284,252,-1.03e-02},
-      {284,283,3.65e-02},
-      {284,285,3.65e-02},
-      {284,539,-4.84e-05},
-      {284,540,-1.93e-04},
-      {284,541,-4.84e-05},
-      {284,572,-9.67e-05},
-      {284,573,-3.87e-04},
-      {284,574,-9.67e-05},
-      {285,285,2.08e-01},
-      {285,251,-1.03e-02},
-      {285,252,-1.03e-02},
-      {285,253,-1.03e-02},
-      {285,284,3.65e-02},
-      {285,286,3.65e-02},
-      {285,540,-4.84e-05},
-      {285,541,-1.93e-04},
-      {285,542,-4.84e-05},
-      {285,573,-9.67e-05},
-      {285,574,-3.87e-04},
-      {285,575,-9.67e-05},
-      {286,286,2.08e-01},
-      {286,252,-1.03e-02},
-      {286,253,-1.03e-02},
-      {286,254,-1.03e-02},
-      {286,285,3.65e-02},
-      {286,287,3.65e-02},
-      {286,541,-4.84e-05},
-      {286,542,-1.93e-04},
-      {286,543,-4.84e-05},
-      {286,574,-9.67e-05},
-      {286,575,-3.87e-04},
-      {286,576,-9.67e-05},
-      {287,287,2.08e-01},
-      {287,253,-1.03e-02},
-      {287,254,-1.03e-02},
-      {287,255,-1.03e-02},
-      {287,286,3.65e-02},
-      {287,288,3.65e-02},
-      {287,542,-4.84e-05},
-      {287,543,-1.93e-04},
-      {287,544,-4.84e-05},
-      {287,575,-9.67e-05},
-      {287,576,-3.87e-04},
-      {287,577,-9.67e-05},
-      {288,288,2.08e-01},
-      {288,226,-1.03e-02},
-      {288,254,-1.03e-02},
-      {288,255,-1.03e-02},
-      {288,258,3.65e-02},
-      {288,287,3.65e-02},
-      {288,515,-4.84e-05},
-      {288,543,-4.84e-05},
-      {288,544,-1.93e-04},
-      {288,547,-9.67e-05},
-      {288,576,-9.67e-05},
-      {288,577,-3.87e-04},
-      {289,289,1.87e-01},
-      {289,0,1.93e-04},
-      {289,1,9.67e-05},
-      {289,2,9.67e-05},
-      {289,3,4.84e-05},
-      {289,290,3.65e-02},
-      {289,291,3.65e-02},
-      {289,292,-1.03e-02},
-      {290,290,2.08e-01},
-      {290,0,9.67e-05},
-      {290,1,3.87e-04},
-      {290,2,4.84e-05},
-      {290,3,1.93e-04},
-      {290,4,9.67e-05},
-      {290,6,4.84e-05},
-      {290,289,3.65e-02},
-      {290,291,-1.03e-02},
-      {290,292,-1.03e-02},
-      {290,293,3.65e-02},
-      {290,295,-1.03e-02},
-      {291,291,2.08e-01},
-      {291,0,9.67e-05},
-      {291,1,4.84e-05},
-      {291,2,3.87e-04},
-      {291,3,1.93e-04},
-      {291,5,9.67e-05},
-      {291,8,4.84e-05},
-      {291,289,3.65e-02},
-      {291,290,-1.03e-02},
-      {291,292,-1.03e-02},
-      {291,294,3.65e-02},
-      {291,297,-1.03e-02},
-      {292,292,8.29e-02},
-      {292,0,4.84e-05},
-      {292,1,1.93e-04},
-      {292,2,1.93e-04},
-      {292,3,7.74e-04},
-      {292,4,4.84e-05},
-      {292,5,4.84e-05},
-      {292,6,1.93e-04},
-      {292,7,4.84e-05},
-      {292,8,1.93e-04},
-      {292,289,-1.03e-02},
-      {292,290,-1.03e-02},
-      {292,291,-1.03e-02},
-      {292,293,-1.03e-02},
-      {292,294,-1.03e-02},
-      {292,295,-1.03e-02},
-      {292,296,-1.03e-02},
-      {292,297,-1.03e-02},
-      {293,293,2.08e-01},
-      {293,1,9.67e-05},
-      {293,3,4.84e-05},
-      {293,4,3.87e-04},
-      {293,6,1.93e-04},
-      {293,9,9.67e-05},
-      {293,11,4.84e-05},
-      {293,290,3.65e-02},
-      {293,292,-1.03e-02},
-      {293,295,-1.03e-02},
-      {293,298,3.65e-02},
-      {293,300,-1.03e-02},
-      {294,294,2.08e-01},
-      {294,2,9.67e-05},
-      {294,3,4.84e-05},
-      {294,5,3.87e-04},
-      {294,8,1.93e-04},
-      {294,10,9.67e-05},
-      {294,15,4.84e-05},
-      {294,291,3.65e-02},
-      {294,292,-1.03e-02},
-      {294,297,-1.03e-02},
-      {294,299,3.65e-02},
-      {294,304,-1.03e-02},
-      {295,295,8.29e-02},
-      {295,1,4.84e-05},
-      {295,3,1.93e-04},
-      {295,4,1.93e-04},
-      {295,6,7.74e-04},
-      {295,7,1.93e-04},
-      {295,8,4.84e-05},
-      {295,9,4.84e-05},
-      {295,11,1.93e-04},
-      {295,12,4.84e-05},
-      {295,290,-1.03e-02},
-      {295,292,-1.03e-02},
-      {295,293,-1.03e-02},
-      {295,296,-1.03e-02},
-      {295,297,-1.03e-02},
-      {295,298,-1.03e-02},
-      {295,300,-1.03e-02},
-      {295,301,-1.03e-02},
-      {296,296,8.29e-02},
-      {296,3,4.84e-05},
-      {296,6,1.93e-04},
-      {296,7,7.74e-04},
-      {296,8,1.93e-04},
-      {296,11,4.84e-05},
-      {296,12,1.93e-04},
-      {296,13,4.84e-05},
-      {296,14,1.93e-04},
-      {296,15,4.84e-05},
-      {296,292,-1.03e-02},
-      {296,295,-1.03e-02},
-      {296,297,-1.03e-02},
-      {296,300,-1.03e-02},
-      {296,301,-1.03e-02},
-      {296,302,-1.03e-02},
-      {296,303,-1.03e-02},
-      {296,304,-1.03e-02},
-      {297,297,8.29e-02},
-      {297,2,4.84e-05},
-      {297,3,1.93e-04},
-      {297,5,1.93e-04},
-      {297,6,4.84e-05},
-      {297,7,1.93e-04},
-      {297,8,7.74e-04},
-      {297,10,4.84e-05},
-      {297,14,4.84e-05},
-      {297,15,1.93e-04},
-      {297,291,-1.03e-02},
-      {297,292,-1.03e-02},
-      {297,294,-1.03e-02},
-      {297,295,-1.03e-02},
-      {297,296,-1.03e-02},
-      {297,299,-1.03e-02},
-      {297,303,-1.03e-02},
-      {297,304,-1.03e-02},
-      {298,298,2.08e-01},
-      {298,4,9.67e-05},
-      {298,6,4.84e-05},
-      {298,9,3.87e-04},
-      {298,11,1.93e-04},
-      {298,16,9.67e-05},
-      {298,18,4.84e-05},
-      {298,293,3.65e-02},
-      {298,295,-1.03e-02},
-      {298,300,-1.03e-02},
-      {298,305,3.65e-02},
-      {298,307,-1.03e-02},
-      {299,299,2.08e-01},
-      {299,5,9.67e-05},
-      {299,8,4.84e-05},
-      {299,10,3.87e-04},
-      {299,15,1.93e-04},
-      {299,17,9.67e-05},
-      {299,24,4.84e-05},
-      {299,294,3.65e-02},
-      {299,297,-1.03e-02},
-      {299,304,-1.03e-02},
-      {299,306,3.65e-02},
-      {299,313,-1.03e-02},
-      {300,300,8.29e-02},
-      {300,4,4.84e-05},
-      {300,6,1.93e-04},
-      {300,7,4.84e-05},
-      {300,9,1.93e-04},
-      {300,11,7.74e-04},
-      {300,12,1.93e-04},
-      {300,16,4.84e-05},
-      {300,18,1.93e-04},
-      {300,19,4.84e-05},
-      {300,293,-1.03e-02},
-      {300,295,-1.03e-02},
-      {300,296,-1.03e-02},
-      {300,298,-1.03e-02},
-      {300,301,-1.03e-02},
-      {300,305,-1.03e-02},
-      {300,307,-1.03e-02},
-      {300,308,-1.03e-02},
-      {301,301,8.29e-02},
-      {301,6,4.84e-05},
-      {301,7,1.93e-04},
-      {301,11,1.93e-04},
-      {301,12,7.74e-04},
-      {301,13,1.93e-04},
-      {301,14,4.84e-05},
-      {301,18,4.84e-05},
-      {301,19,1.93e-04},
-      {301,20,4.84e-05},
-      {301,295,-1.03e-02},
-      {301,296,-1.03e-02},
-      {301,300,-1.03e-02},
-      {301,302,-1.03e-02},
-      {301,303,-1.03e-02},
-      {301,307,-1.03e-02},
-      {301,308,-1.03e-02},
-      {301,309,-1.03e-02},
-      {302,302,8.29e-02},
-      {302,7,4.84e-05},
-      {302,12,1.93e-04},
-      {302,13,7.74e-04},
-      {302,14,1.93e-04},
-      {302,19,4.84e-05},
-      {302,20,1.93e-04},
-      {302,21,4.84e-05},
-      {302,22,1.93e-04},
-      {302,23,4.84e-05},
-      {302,296,-1.03e-02},
-      {302,301,-1.03e-02},
-      {302,303,-1.03e-02},
-      {302,308,-1.03e-02},
-      {302,309,-1.03e-02},
-      {302,310,-1.03e-02},
-      {302,311,-1.03e-02},
-      {302,312,-1.03e-02},
-      {303,303,8.29e-02},
-      {303,7,1.93e-04},
-      {303,8,4.84e-05},
-      {303,12,4.84e-05},
-      {303,13,1.93e-04},
-      {303,14,7.74e-04},
-      {303,15,1.93e-04},
-      {303,22,4.84e-05},
-      {303,23,1.93e-04},
-      {303,24,4.84e-05},
-      {303,296,-1.03e-02},
-      {303,297,-1.03e-02},
-      {303,301,-1.03e-02},
-      {303,302,-1.03e-02},
-      {303,304,-1.03e-02},
-      {303,311,-1.03e-02},
-      {303,312,-1.03e-02},
-      {303,313,-1.03e-02},
-      {304,304,8.29e-02},
-      {304,5,4.84e-05},
-      {304,7,4.84e-05},
-      {304,8,1.93e-04},
-      {304,10,1.93e-04},
-      {304,14,1.93e-04},
-      {304,15,7.74e-04},
-      {304,17,4.84e-05},
-      {304,23,4.84e-05},
-      {304,24,1.93e-04},
-      {304,294,-1.03e-02},
-      {304,296,-1.03e-02},
-      {304,297,-1.03e-02},
-      {304,299,-1.03e-02},
-      {304,303,-1.03e-02},
-      {304,306,-1.03e-02},
-      {304,312,-1.03e-02},
-      {304,313,-1.03e-02},
-      {305,305,2.08e-01},
-      {305,9,9.67e-05},
-      {305,11,4.84e-05},
-      {305,16,3.87e-04},
-      {305,18,1.93e-04},
-      {305,25,9.67e-05},
-      {305,27,4.84e-05},
-      {305,298,3.65e-02},
-      {305,300,-1.03e-02},
-      {305,307,-1.03e-02},
-      {305,314,3.65e-02},
-      {305,316,-1.03e-02},
-      {306,306,2.08e-01},
-      {306,10,9.67e-05},
-      {306,15,4.84e-05},
-      {306,17,3.87e-04},
-      {306,24,1.93e-04},
-      {306,26,9.67e-05},
-      {306,33,4.84e-05},
-      {306,299,3.65e-02},
-      {306,304,-1.03e-02},
-      {306,313,-1.03e-02},
-      {306,315,3.65e-02},
-      {306,322,-1.03e-02},
-      {307,307,8.29e-02},
-      {307,9,4.84e-05},
-      {307,11,1.93e-04},
-      {307,12,4.84e-05},
-      {307,16,1.93e-04},
-      {307,18,7.74e-04},
-      {307,19,1.93e-04},
-      {307,25,4.84e-05},
-      {307,27,1.93e-04},
-      {307,28,4.84e-05},
-      {307,298,-1.03e-02},
-      {307,300,-1.03e-02},
-      {307,301,-1.03e-02},
-      {307,305,-1.03e-02},
-      {307,308,-1.03e-02},
-      {307,314,-1.03e-02},
-      {307,316,-1.03e-02},
-      {307,317,-1.03e-02},
-      {308,308,8.29e-02},
-      {308,11,4.84e-05},
-      {308,12,1.93e-04},
-      {308,13,4.84e-05},
-      {308,18,1.93e-04},
-      {308,19,7.74e-04},
-      {308,20,1.93e-04},
-      {308,27,4.84e-05},
-      {308,28,1.93e-04},
-      {308,29,4.84e-05},
-      {308,300,-1.03e-02},
-      {308,301,-1.03e-02},
-      {308,302,-1.03e-02},
-      {308,307,-1.03e-02},
-      {308,309,-1.03e-02},
-      {308,316,-1.03e-02},
-      {308,317,-1.03e-02},
-      {308,318,-1.03e-02},
-      {309,309,8.29e-02},
-      {309,12,4.84e-05},
-      {309,13,1.93e-04},
-      {309,19,1.93e-04},
-      {309,20,7.74e-04},
-      {309,21,1.93e-04},
-      {309,22,4.84e-05},
-      {309,28,4.84e-05},
-      {309,29,1.93e-04},
-      {309,30,4.84e-05},
-      {309,301,-1.03e-02},
-      {309,302,-1.03e-02},
-      {309,308,-1.03e-02},
-      {309,310,-1.03e-02},
-      {309,311,-1.03e-02},
-      {309,317,-1.03e-02},
-      {309,318,-1.03e-02},
-      {309,319,-1.03e-02},
-      {310,310,8.29e-02},
-      {310,13,4.84e-05},
-      {310,20,1.93e-04},
-      {310,21,7.74e-04},
-      {310,22,1.93e-04},
-      {310,29,4.84e-05},
-      {310,30,1.93e-04},
-      {310,31,4.84e-05},
-      {310,32,1.93e-04},
-      {310,35,4.84e-05},
-      {310,302,-1.03e-02},
-      {310,309,-1.03e-02},
-      {310,311,-1.03e-02},
-      {310,318,-1.03e-02},
-      {310,319,-1.03e-02},
-      {310,320,-1.03e-02},
-      {310,321,-1.03e-02},
-      {310,324,-1.03e-02},
-      {311,311,8.29e-02},
-      {311,13,1.93e-04},
-      {311,14,4.84e-05},
-      {311,20,4.84e-05},
-      {311,21,1.93e-04},
-      {311,22,7.74e-04},
-      {311,23,1.93e-04},
-      {311,32,4.84e-05},
-      {311,34,4.84e-05},
-      {311,35,1.93e-04},
-      {311,302,-1.03e-02},
-      {311,303,-1.03e-02},
-      {311,309,-1.03e-02},
-      {311,310,-1.03e-02},
-      {311,312,-1.03e-02},
-      {311,321,-1.03e-02},
-      {311,323,-1.03e-02},
-      {311,324,-1.03e-02},
-      {312,312,8.29e-02},
-      {312,13,4.84e-05},
-      {312,14,1.93e-04},
-      {312,15,4.84e-05},
-      {312,22,1.93e-04},
-      {312,23,7.74e-04},
-      {312,24,1.93e-04},
-      {312,33,4.84e-05},
-      {312,34,1.93e-04},
-      {312,35,4.84e-05},
-      {312,302,-1.03e-02},
-      {312,303,-1.03e-02},
-      {312,304,-1.03e-02},
-      {312,311,-1.03e-02},
-      {312,313,-1.03e-02},
-      {312,322,-1.03e-02},
-      {312,323,-1.03e-02},
-      {312,324,-1.03e-02},
-      {313,313,8.29e-02},
-      {313,10,4.84e-05},
-      {313,14,4.84e-05},
-      {313,15,1.93e-04},
-      {313,17,1.93e-04},
-      {313,23,1.93e-04},
-      {313,24,7.74e-04},
-      {313,26,4.84e-05},
-      {313,33,1.93e-04},
-      {313,34,4.84e-05},
-      {313,299,-1.03e-02},
-      {313,303,-1.03e-02},
-      {313,304,-1.03e-02},
-      {313,306,-1.03e-02},
-      {313,312,-1.03e-02},
-      {313,315,-1.03e-02},
-      {313,322,-1.03e-02},
-      {313,323,-1.03e-02},
-      {314,314,2.08e-01},
-      {314,16,9.67e-05},
-      {314,18,4.84e-05},
-      {314,25,3.87e-04},
-      {314,27,1.93e-04},
-      {314,36,9.67e-05},
-      {314,38,4.84e-05},
-      {314,305,3.65e-02},
-      {314,307,-1.03e-02},
-      {314,316,-1.03e-02},
-      {314,325,3.65e-02},
-      {314,327,-1.03e-02},
-      {315,315,2.08e-01},
-      {315,17,9.67e-05},
-      {315,24,4.84e-05},
-      {315,26,3.87e-04},
-      {315,33,1.93e-04},
-      {315,37,9.67e-05},
-      {315,47,4.84e-05},
-      {315,306,3.65e-02},
-      {315,313,-1.03e-02},
-      {315,322,-1.03e-02},
-      {315,326,3.65e-02},
-      {315,336,-1.03e-02},
-      {316,316,8.29e-02},
-      {316,16,4.84e-05},
-      {316,18,1.93e-04},
-      {316,19,4.84e-05},
-      {316,25,1.93e-04},
-      {316,27,7.74e-04},
-      {316,28,1.93e-04},
-      {316,36,4.84e-05},
-      {316,38,1.93e-04},
-      {316,39,4.84e-05},
-      {316,305,-1.03e-02},
-      {316,307,-1.03e-02},
-      {316,308,-1.03e-02},
-      {316,314,-1.03e-02},
-      {316,317,-1.03e-02},
-      {316,325,-1.03e-02},
-      {316,327,-1.03e-02},
-      {316,328,-1.03e-02},
-      {317,317,8.29e-02},
-      {317,18,4.84e-05},
-      {317,19,1.93e-04},
-      {317,20,4.84e-05},
-      {317,27,1.93e-04},
-      {317,28,7.74e-04},
-      {317,29,1.93e-04},
-      {317,38,4.84e-05},
-      {317,39,1.93e-04},
-      {317,40,4.84e-05},
-      {317,307,-1.03e-02},
-      {317,308,-1.03e-02},
-      {317,309,-1.03e-02},
-      {317,316,-1.03e-02},
-      {317,318,-1.03e-02},
-      {317,327,-1.03e-02},
-      {317,328,-1.03e-02},
-      {317,329,-1.03e-02},
-      {318,318,8.29e-02},
-      {318,19,4.84e-05},
-      {318,20,1.93e-04},
-      {318,21,4.84e-05},
-      {318,28,1.93e-04},
-      {318,29,7.74e-04},
-      {318,30,1.93e-04},
-      {318,39,4.84e-05},
-      {318,40,1.93e-04},
-      {318,41,4.84e-05},
-      {318,308,-1.03e-02},
-      {318,309,-1.03e-02},
-      {318,310,-1.03e-02},
-      {318,317,-1.03e-02},
-      {318,319,-1.03e-02},
-      {318,328,-1.03e-02},
-      {318,329,-1.03e-02},
-      {318,330,-1.03e-02},
-      {319,319,8.29e-02},
-      {319,20,4.84e-05},
-      {319,21,1.93e-04},
-      {319,29,1.93e-04},
-      {319,30,7.74e-04},
-      {319,31,1.93e-04},
-      {319,32,4.84e-05},
-      {319,40,4.84e-05},
-      {319,41,1.93e-04},
-      {319,42,4.84e-05},
-      {319,309,-1.03e-02},
-      {319,310,-1.03e-02},
-      {319,318,-1.03e-02},
-      {319,320,-1.03e-02},
-      {319,321,-1.03e-02},
-      {319,329,-1.03e-02},
-      {319,330,-1.03e-02},
-      {319,331,-1.03e-02},
-      {320,320,8.29e-02},
-      {320,21,4.84e-05},
-      {320,30,1.93e-04},
-      {320,31,7.74e-04},
-      {320,32,1.93e-04},
-      {320,41,4.84e-05},
-      {320,42,1.93e-04},
-      {320,43,4.84e-05},
-      {320,44,1.93e-04},
-      {320,45,4.84e-05},
-      {320,310,-1.03e-02},
-      {320,319,-1.03e-02},
-      {320,321,-1.03e-02},
-      {320,330,-1.03e-02},
-      {320,331,-1.03e-02},
-      {320,332,-1.03e-02},
-      {320,333,-1.03e-02},
-      {320,334,-1.03e-02},
-      {321,321,8.29e-02},
-      {321,21,1.93e-04},
-      {321,22,4.84e-05},
-      {321,30,4.84e-05},
-      {321,31,1.93e-04},
-      {321,32,7.74e-04},
-      {321,35,1.93e-04},
-      {321,44,4.84e-05},
-      {321,45,1.93e-04},
-      {321,48,4.84e-05},
-      {321,310,-1.03e-02},
-      {321,311,-1.03e-02},
-      {321,319,-1.03e-02},
-      {321,320,-1.03e-02},
-      {321,324,-1.03e-02},
-      {321,333,-1.03e-02},
-      {321,334,-1.03e-02},
-      {321,337,-1.03e-02},
-      {322,322,8.29e-02},
-      {322,17,4.84e-05},
-      {322,23,4.84e-05},
-      {322,24,1.93e-04},
-      {322,26,1.93e-04},
-      {322,33,7.74e-04},
-      {322,34,1.93e-04},
-      {322,37,4.84e-05},
-      {322,46,4.84e-05},
-      {322,47,1.93e-04},
-      {322,306,-1.03e-02},
-      {322,312,-1.03e-02},
-      {322,313,-1.03e-02},
-      {322,315,-1.03e-02},
-      {322,323,-1.03e-02},
-      {322,326,-1.03e-02},
-      {322,335,-1.03e-02},
-      {322,336,-1.03e-02},
-      {323,323,8.29e-02},
-      {323,22,4.84e-05},
-      {323,23,1.93e-04},
-      {323,24,4.84e-05},
-      {323,33,1.93e-04},
-      {323,34,7.74e-04},
-      {323,35,1.93e-04},
-      {323,46,1.93e-04},
-      {323,47,4.84e-05},
-      {323,48,4.84e-05},
-      {323,311,-1.03e-02},
-      {323,312,-1.03e-02},
-      {323,313,-1.03e-02},
-      {323,322,-1.03e-02},
-      {323,324,-1.03e-02},
-      {323,335,-1.03e-02},
-      {323,336,-1.03e-02},
-      {323,337,-1.03e-02},
-      {324,324,8.29e-02},
-      {324,21,4.84e-05},
-      {324,22,1.93e-04},
-      {324,23,4.84e-05},
-      {324,32,1.93e-04},
-      {324,34,1.93e-04},
-      {324,35,7.74e-04},
-      {324,45,4.84e-05},
-      {324,46,4.84e-05},
-      {324,48,1.93e-04},
-      {324,310,-1.03e-02},
-      {324,311,-1.03e-02},
-      {324,312,-1.03e-02},
-      {324,321,-1.03e-02},
-      {324,323,-1.03e-02},
-      {324,334,-1.03e-02},
-      {324,335,-1.03e-02},
-      {324,337,-1.03e-02},
-      {325,325,2.08e-01},
-      {325,25,9.67e-05},
-      {325,27,4.84e-05},
-      {325,36,3.87e-04},
-      {325,38,1.93e-04},
-      {325,49,9.67e-05},
-      {325,51,4.84e-05},
-      {325,314,3.65e-02},
-      {325,316,-1.03e-02},
-      {325,327,-1.03e-02},
-      {325,338,3.65e-02},
-      {325,340,-1.03e-02},
-      {326,326,2.08e-01},
-      {326,26,9.67e-05},
-      {326,33,4.84e-05},
-      {326,37,3.87e-04},
-      {326,47,1.93e-04},
-      {326,50,9.67e-05},
-      {326,63,4.84e-05},
-      {326,315,3.65e-02},
-      {326,322,-1.03e-02},
-      {326,336,-1.03e-02},
-      {326,339,3.65e-02},
-      {326,352,-1.03e-02},
-      {327,327,8.29e-02},
-      {327,25,4.84e-05},
-      {327,27,1.93e-04},
-      {327,28,4.84e-05},
-      {327,36,1.93e-04},
-      {327,38,7.74e-04},
-      {327,39,1.93e-04},
-      {327,49,4.84e-05},
-      {327,51,1.93e-04},
-      {327,52,4.84e-05},
-      {327,314,-1.03e-02},
-      {327,316,-1.03e-02},
-      {327,317,-1.03e-02},
-      {327,325,-1.03e-02},
-      {327,328,-1.03e-02},
-      {327,338,-1.03e-02},
-      {327,340,-1.03e-02},
-      {327,341,-1.03e-02},
-      {328,328,8.29e-02},
-      {328,27,4.84e-05},
-      {328,28,1.93e-04},
-      {328,29,4.84e-05},
-      {328,38,1.93e-04},
-      {328,39,7.74e-04},
-      {328,40,1.93e-04},
-      {328,51,4.84e-05},
-      {328,52,1.93e-04},
-      {328,53,4.84e-05},
-      {328,316,-1.03e-02},
-      {328,317,-1.03e-02},
-      {328,318,-1.03e-02},
-      {328,327,-1.03e-02},
-      {328,329,-1.03e-02},
-      {328,340,-1.03e-02},
-      {328,341,-1.03e-02},
-      {328,342,-1.03e-02},
-      {329,329,8.29e-02},
-      {329,28,4.84e-05},
-      {329,29,1.93e-04},
-      {329,30,4.84e-05},
-      {329,39,1.93e-04},
-      {329,40,7.74e-04},
-      {329,41,1.93e-04},
-      {329,52,4.84e-05},
-      {329,53,1.93e-04},
-      {329,54,4.84e-05},
-      {329,317,-1.03e-02},
-      {329,318,-1.03e-02},
-      {329,319,-1.03e-02},
-      {329,328,-1.03e-02},
-      {329,330,-1.03e-02},
-      {329,341,-1.03e-02},
-      {329,342,-1.03e-02},
-      {329,343,-1.03e-02},
-      {330,330,8.29e-02},
-      {330,29,4.84e-05},
-      {330,30,1.93e-04},
-      {330,31,4.84e-05},
-      {330,40,1.93e-04},
-      {330,41,7.74e-04},
-      {330,42,1.93e-04},
-      {330,53,4.84e-05},
-      {330,54,1.93e-04},
-      {330,55,4.84e-05},
-      {330,318,-1.03e-02},
-      {330,319,-1.03e-02},
-      {330,320,-1.03e-02},
-      {330,329,-1.03e-02},
-      {330,331,-1.03e-02},
-      {330,342,-1.03e-02},
-      {330,343,-1.03e-02},
-      {330,344,-1.03e-02},
-      {331,331,8.29e-02},
-      {331,30,4.84e-05},
-      {331,31,1.93e-04},
-      {331,41,1.93e-04},
-      {331,42,7.74e-04},
-      {331,43,1.93e-04},
-      {331,44,4.84e-05},
-      {331,54,4.84e-05},
-      {331,55,1.93e-04},
-      {331,56,4.84e-05},
-      {331,319,-1.03e-02},
-      {331,320,-1.03e-02},
-      {331,330,-1.03e-02},
-      {331,332,-1.03e-02},
-      {331,333,-1.03e-02},
-      {331,343,-1.03e-02},
-      {331,344,-1.03e-02},
-      {331,345,-1.03e-02},
-      {332,332,8.29e-02},
-      {332,31,4.84e-05},
-      {332,42,1.93e-04},
-      {332,43,7.74e-04},
-      {332,44,1.93e-04},
-      {332,55,4.84e-05},
-      {332,56,1.93e-04},
-      {332,57,4.84e-05},
-      {332,58,1.93e-04},
-      {332,59,4.84e-05},
-      {332,320,-1.03e-02},
-      {332,331,-1.03e-02},
-      {332,333,-1.03e-02},
-      {332,344,-1.03e-02},
-      {332,345,-1.03e-02},
-      {332,346,-1.03e-02},
-      {332,347,-1.03e-02},
-      {332,348,-1.03e-02},
-      {333,333,8.29e-02},
-      {333,31,1.93e-04},
-      {333,32,4.84e-05},
-      {333,42,4.84e-05},
-      {333,43,1.93e-04},
-      {333,44,7.74e-04},
-      {333,45,1.93e-04},
-      {333,58,4.84e-05},
-      {333,59,1.93e-04},
-      {333,60,4.84e-05},
-      {333,320,-1.03e-02},
-      {333,321,-1.03e-02},
-      {333,331,-1.03e-02},
-      {333,332,-1.03e-02},
-      {333,334,-1.03e-02},
-      {333,347,-1.03e-02},
-      {333,348,-1.03e-02},
-      {333,349,-1.03e-02},
-      {334,334,8.29e-02},
-      {334,31,4.84e-05},
-      {334,32,1.93e-04},
-      {334,35,4.84e-05},
-      {334,44,1.93e-04},
-      {334,45,7.74e-04},
-      {334,48,1.93e-04},
-      {334,59,4.84e-05},
-      {334,60,1.93e-04},
-      {334,61,4.84e-05},
-      {334,320,-1.03e-02},
-      {334,321,-1.03e-02},
-      {334,324,-1.03e-02},
-      {334,333,-1.03e-02},
-      {334,337,-1.03e-02},
-      {334,348,-1.03e-02},
-      {334,349,-1.03e-02},
-      {334,350,-1.03e-02},
-      {335,335,8.29e-02},
-      {335,33,4.84e-05},
-      {335,34,1.93e-04},
-      {335,35,4.84e-05},
-      {335,46,7.74e-04},
-      {335,47,1.93e-04},
-      {335,48,1.93e-04},
-      {335,61,4.84e-05},
-      {335,62,1.93e-04},
-      {335,63,4.84e-05},
-      {335,322,-1.03e-02},
-      {335,323,-1.03e-02},
-      {335,324,-1.03e-02},
-      {335,336,-1.03e-02},
-      {335,337,-1.03e-02},
-      {335,350,-1.03e-02},
-      {335,351,-1.03e-02},
-      {335,352,-1.03e-02},
-      {336,336,8.29e-02},
-      {336,26,4.84e-05},
-      {336,33,1.93e-04},
-      {336,34,4.84e-05},
-      {336,37,1.93e-04},
-      {336,46,1.93e-04},
-      {336,47,7.74e-04},
-      {336,50,4.84e-05},
-      {336,62,4.84e-05},
-      {336,63,1.93e-04},
-      {336,315,-1.03e-02},
-      {336,322,-1.03e-02},
-      {336,323,-1.03e-02},
-      {336,326,-1.03e-02},
-      {336,335,-1.03e-02},
-      {336,339,-1.03e-02},
-      {336,351,-1.03e-02},
-      {336,352,-1.03e-02},
-      {337,337,8.29e-02},
-      {337,32,4.84e-05},
-      {337,34,4.84e-05},
-      {337,35,1.93e-04},
-      {337,45,1.93e-04},
-      {337,46,1.93e-04},
-      {337,48,7.74e-04},
-      {337,60,4.84e-05},
-      {337,61,1.93e-04},
-      {337,62,4.84e-05},
-      {337,321,-1.03e-02},
-      {337,323,-1.03e-02},
-      {337,324,-1.03e-02},
-      {337,334,-1.03e-02},
-      {337,335,-1.03e-02},
-      {337,349,-1.03e-02},
-      {337,350,-1.03e-02},
-      {337,351,-1.03e-02},
-      {338,338,2.08e-01},
-      {338,36,9.67e-05},
-      {338,38,4.84e-05},
-      {338,49,3.87e-04},
-      {338,51,1.93e-04},
-      {338,64,9.67e-05},
-      {338,66,4.84e-05},
-      {338,325,3.65e-02},
-      {338,327,-1.03e-02},
-      {338,340,-1.03e-02},
-      {338,353,3.65e-02},
-      {338,355,-1.03e-02},
-      {339,339,2.08e-01},
-      {339,37,9.67e-05},
-      {339,47,4.84e-05},
-      {339,50,3.87e-04},
-      {339,63,1.93e-04},
-      {339,65,9.67e-05},
-      {339,80,4.84e-05},
-      {339,326,3.65e-02},
-      {339,336,-1.03e-02},
-      {339,352,-1.03e-02},
-      {339,354,3.65e-02},
-      {339,369,-1.03e-02},
-      {340,340,8.29e-02},
-      {340,36,4.84e-05},
-      {340,38,1.93e-04},
-      {340,39,4.84e-05},
-      {340,49,1.93e-04},
-      {340,51,7.74e-04},
-      {340,52,1.93e-04},
-      {340,64,4.84e-05},
-      {340,66,1.93e-04},
-      {340,67,4.84e-05},
-      {340,325,-1.03e-02},
-      {340,327,-1.03e-02},
-      {340,328,-1.03e-02},
-      {340,338,-1.03e-02},
-      {340,341,-1.03e-02},
-      {340,353,-1.03e-02},
-      {340,355,-1.03e-02},
-      {340,356,-1.03e-02},
-      {341,341,8.29e-02},
-      {341,38,4.84e-05},
-      {341,39,1.93e-04},
-      {341,40,4.84e-05},
-      {341,51,1.93e-04},
-      {341,52,7.74e-04},
-      {341,53,1.93e-04},
-      {341,66,4.84e-05},
-      {341,67,1.93e-04},
-      {341,68,4.84e-05},
-      {341,327,-1.03e-02},
-      {341,328,-1.03e-02},
-      {341,329,-1.03e-02},
-      {341,340,-1.03e-02},
-      {341,342,-1.03e-02},
-      {341,355,-1.03e-02},
-      {341,356,-1.03e-02},
-      {341,357,-1.03e-02},
-      {342,342,8.29e-02},
-      {342,39,4.84e-05},
-      {342,40,1.93e-04},
-      {342,41,4.84e-05},
-      {342,52,1.93e-04},
-      {342,53,7.74e-04},
-      {342,54,1.93e-04},
-      {342,67,4.84e-05},
-      {342,68,1.93e-04},
-      {342,69,4.84e-05},
-      {342,328,-1.03e-02},
-      {342,329,-1.03e-02},
-      {342,330,-1.03e-02},
-      {342,341,-1.03e-02},
-      {342,343,-1.03e-02},
-      {342,356,-1.03e-02},
-      {342,357,-1.03e-02},
-      {342,358,-1.03e-02},
-      {343,343,8.29e-02},
-      {343,40,4.84e-05},
-      {343,41,1.93e-04},
-      {343,42,4.84e-05},
-      {343,53,1.93e-04},
-      {343,54,7.74e-04},
-      {343,55,1.93e-04},
-      {343,68,4.84e-05},
-      {343,69,1.93e-04},
-      {343,70,4.84e-05},
-      {343,329,-1.03e-02},
-      {343,330,-1.03e-02},
-      {343,331,-1.03e-02},
-      {343,342,-1.03e-02},
-      {343,344,-1.03e-02},
-      {343,357,-1.03e-02},
-      {343,358,-1.03e-02},
-      {343,359,-1.03e-02},
-      {344,344,8.29e-02},
-      {344,41,4.84e-05},
-      {344,42,1.93e-04},
-      {344,43,4.84e-05},
-      {344,54,1.93e-04},
-      {344,55,7.74e-04},
-      {344,56,1.93e-04},
-      {344,69,4.84e-05},
-      {344,70,1.93e-04},
-      {344,71,4.84e-05},
-      {344,330,-1.03e-02},
-      {344,331,-1.03e-02},
-      {344,332,-1.03e-02},
-      {344,343,-1.03e-02},
-      {344,345,-1.03e-02},
-      {344,358,-1.03e-02},
-      {344,359,-1.03e-02},
-      {344,360,-1.03e-02},
-      {345,345,8.29e-02},
-      {345,42,4.84e-05},
-      {345,43,1.93e-04},
-      {345,55,1.93e-04},
-      {345,56,7.74e-04},
-      {345,57,1.93e-04},
-      {345,58,4.84e-05},
-      {345,70,4.84e-05},
-      {345,71,1.93e-04},
-      {345,72,4.84e-05},
-      {345,331,-1.03e-02},
-      {345,332,-1.03e-02},
-      {345,344,-1.03e-02},
-      {345,346,-1.03e-02},
-      {345,347,-1.03e-02},
-      {345,359,-1.03e-02},
-      {345,360,-1.03e-02},
-      {345,361,-1.03e-02},
-      {346,346,8.29e-02},
-      {346,43,4.84e-05},
-      {346,56,1.93e-04},
-      {346,57,7.74e-04},
-      {346,58,1.93e-04},
-      {346,71,4.84e-05},
-      {346,72,1.93e-04},
-      {346,73,4.84e-05},
-      {346,74,1.93e-04},
-      {346,75,4.84e-05},
-      {346,332,-1.03e-02},
-      {346,345,-1.03e-02},
-      {346,347,-1.03e-02},
-      {346,360,-1.03e-02},
-      {346,361,-1.03e-02},
-      {346,362,-1.03e-02},
-      {346,363,-1.03e-02},
-      {346,364,-1.03e-02},
-      {347,347,8.29e-02},
-      {347,43,1.93e-04},
-      {347,44,4.84e-05},
-      {347,56,4.84e-05},
-      {347,57,1.93e-04},
-      {347,58,7.74e-04},
-      {347,59,1.93e-04},
-      {347,74,4.84e-05},
-      {347,75,1.93e-04},
-      {347,76,4.84e-05},
-      {347,332,-1.03e-02},
-      {347,333,-1.03e-02},
-      {347,345,-1.03e-02},
-      {347,346,-1.03e-02},
-      {347,348,-1.03e-02},
-      {347,363,-1.03e-02},
-      {347,364,-1.03e-02},
-      {347,365,-1.03e-02},
-      {348,348,8.29e-02},
-      {348,43,4.84e-05},
-      {348,44,1.93e-04},
-      {348,45,4.84e-05},
-      {348,58,1.93e-04},
-      {348,59,7.74e-04},
-      {348,60,1.93e-04},
-      {348,75,4.84e-05},
-      {348,76,1.93e-04},
-      {348,77,4.84e-05},
-      {348,332,-1.03e-02},
-      {348,333,-1.03e-02},
-      {348,334,-1.03e-02},
-      {348,347,-1.03e-02},
-      {348,349,-1.03e-02},
-      {348,364,-1.03e-02},
-      {348,365,-1.03e-02},
-      {348,366,-1.03e-02},
-      {349,349,8.29e-02},
-      {349,44,4.84e-05},
-      {349,45,1.93e-04},
-      {349,48,4.84e-05},
-      {349,59,1.93e-04},
-      {349,60,7.74e-04},
-      {349,61,1.93e-04},
-      {349,76,4.84e-05},
-      {349,77,1.93e-04},
-      {349,78,4.84e-05},
-      {349,333,-1.03e-02},
-      {349,334,-1.03e-02},
-      {349,337,-1.03e-02},
-      {349,348,-1.03e-02},
-      {349,350,-1.03e-02},
-      {349,365,-1.03e-02},
-      {349,366,-1.03e-02},
-      {349,367,-1.03e-02},
-      {350,350,8.29e-02},
-      {350,45,4.84e-05},
-      {350,46,4.84e-05},
-      {350,48,1.93e-04},
-      {350,60,1.93e-04},
-      {350,61,7.74e-04},
-      {350,62,1.93e-04},
-      {350,77,4.84e-05},
-      {350,78,1.93e-04},
-      {350,79,4.84e-05},
-      {350,334,-1.03e-02},
-      {350,335,-1.03e-02},
-      {350,337,-1.03e-02},
-      {350,349,-1.03e-02},
-      {350,351,-1.03e-02},
-      {350,366,-1.03e-02},
-      {350,367,-1.03e-02},
-      {350,368,-1.03e-02},
-      {351,351,8.29e-02},
-      {351,46,1.93e-04},
-      {351,47,4.84e-05},
-      {351,48,4.84e-05},
-      {351,61,1.93e-04},
-      {351,62,7.74e-04},
-      {351,63,1.93e-04},
-      {351,78,4.84e-05},
-      {351,79,1.93e-04},
-      {351,80,4.84e-05},
-      {351,335,-1.03e-02},
-      {351,336,-1.03e-02},
-      {351,337,-1.03e-02},
-      {351,350,-1.03e-02},
-      {351,352,-1.03e-02},
-      {351,367,-1.03e-02},
-      {351,368,-1.03e-02},
-      {351,369,-1.03e-02},
-      {352,352,8.29e-02},
-      {352,37,4.84e-05},
-      {352,46,4.84e-05},
-      {352,47,1.93e-04},
-      {352,50,1.93e-04},
-      {352,62,1.93e-04},
-      {352,63,7.74e-04},
-      {352,65,4.84e-05},
-      {352,79,4.84e-05},
-      {352,80,1.93e-04},
-      {352,326,-1.03e-02},
-      {352,335,-1.03e-02},
-      {352,336,-1.03e-02},
-      {352,339,-1.03e-02},
-      {352,351,-1.03e-02},
-      {352,354,-1.03e-02},
-      {352,368,-1.03e-02},
-      {352,369,-1.03e-02},
-      {353,353,2.08e-01},
-      {353,49,9.67e-05},
-      {353,51,4.84e-05},
-      {353,64,3.87e-04},
-      {353,66,1.93e-04},
-      {353,81,9.67e-05},
-      {353,83,4.84e-05},
-      {353,338,3.65e-02},
-      {353,340,-1.03e-02},
-      {353,355,-1.03e-02},
-      {353,370,3.65e-02},
-      {353,372,-1.03e-02},
-      {354,354,2.08e-01},
-      {354,50,9.67e-05},
-      {354,63,4.84e-05},
-      {354,65,3.87e-04},
-      {354,80,1.93e-04},
-      {354,82,9.67e-05},
-      {354,93,4.84e-05},
-      {354,339,3.65e-02},
-      {354,352,-1.03e-02},
-      {354,369,-1.03e-02},
-      {354,371,3.65e-02},
-      {354,382,-1.03e-02},
-      {355,355,8.29e-02},
-      {355,49,4.84e-05},
-      {355,51,1.93e-04},
-      {355,52,4.84e-05},
-      {355,64,1.93e-04},
-      {355,66,7.74e-04},
-      {355,67,1.93e-04},
-      {355,81,4.84e-05},
-      {355,83,1.93e-04},
-      {355,84,4.84e-05},
-      {355,338,-1.03e-02},
-      {355,340,-1.03e-02},
-      {355,341,-1.03e-02},
-      {355,353,-1.03e-02},
-      {355,356,-1.03e-02},
-      {355,370,-1.03e-02},
-      {355,372,-1.03e-02},
-      {355,373,-1.03e-02},
-      {356,356,8.29e-02},
-      {356,51,4.84e-05},
-      {356,52,1.93e-04},
-      {356,53,4.84e-05},
-      {356,66,1.93e-04},
-      {356,67,7.74e-04},
-      {356,68,1.93e-04},
-      {356,83,4.84e-05},
-      {356,84,1.93e-04},
-      {356,85,4.84e-05},
-      {356,340,-1.03e-02},
-      {356,341,-1.03e-02},
-      {356,342,-1.03e-02},
-      {356,355,-1.03e-02},
-      {356,357,-1.03e-02},
-      {356,372,-1.03e-02},
-      {356,373,-1.03e-02},
-      {356,374,-1.03e-02},
-      {357,357,8.29e-02},
-      {357,52,4.84e-05},
-      {357,53,1.93e-04},
-      {357,54,4.84e-05},
-      {357,67,1.93e-04},
-      {357,68,7.74e-04},
-      {357,69,1.93e-04},
-      {357,84,4.84e-05},
-      {357,85,1.93e-04},
-      {357,86,4.84e-05},
-      {357,341,-1.03e-02},
-      {357,342,-1.03e-02},
-      {357,343,-1.03e-02},
-      {357,356,-1.03e-02},
-      {357,358,-1.03e-02},
-      {357,373,-1.03e-02},
-      {357,374,-1.03e-02},
-      {357,375,-1.03e-02},
-      {358,358,8.29e-02},
-      {358,53,4.84e-05},
-      {358,54,1.93e-04},
-      {358,55,4.84e-05},
-      {358,68,1.93e-04},
-      {358,69,7.74e-04},
-      {358,70,1.93e-04},
-      {358,85,4.84e-05},
-      {358,86,1.93e-04},
-      {358,87,4.84e-05},
-      {358,342,-1.03e-02},
-      {358,343,-1.03e-02},
-      {358,344,-1.03e-02},
-      {358,357,-1.03e-02},
-      {358,359,-1.03e-02},
-      {358,374,-1.03e-02},
-      {358,375,-1.03e-02},
-      {358,376,-1.03e-02},
-      {359,359,8.29e-02},
-      {359,54,4.84e-05},
-      {359,55,1.93e-04},
-      {359,56,4.84e-05},
-      {359,69,1.93e-04},
-      {359,70,7.74e-04},
-      {359,71,1.93e-04},
-      {359,86,4.84e-05},
-      {359,87,1.93e-04},
-      {359,88,4.84e-05},
-      {359,343,-1.03e-02},
-      {359,344,-1.03e-02},
-      {359,345,-1.03e-02},
-      {359,358,-1.03e-02},
-      {359,360,-1.03e-02},
-      {359,375,-1.03e-02},
-      {359,376,-1.03e-02},
-      {359,377,-1.03e-02},
-      {360,360,8.29e-02},
-      {360,55,4.84e-05},
-      {360,56,1.93e-04},
-      {360,57,4.84e-05},
-      {360,70,1.93e-04},
-      {360,71,7.74e-04},
-      {360,72,1.93e-04},
-      {360,87,4.84e-05},
-      {360,88,1.93e-04},
-      {360,89,4.84e-05},
-      {360,344,-1.03e-02},
-      {360,345,-1.03e-02},
-      {360,346,-1.03e-02},
-      {360,359,-1.03e-02},
-      {360,361,-1.03e-02},
-      {360,376,-1.03e-02},
-      {360,377,-1.03e-02},
-      {360,378,-1.03e-02},
-      {361,361,8.29e-02},
-      {361,56,4.84e-05},
-      {361,57,1.93e-04},
-      {361,71,1.93e-04},
-      {361,72,7.74e-04},
-      {361,73,1.93e-04},
-      {361,74,4.84e-05},
-      {361,88,4.84e-05},
-      {361,89,1.93e-04},
-      {361,90,4.84e-05},
-      {361,345,-1.03e-02},
-      {361,346,-1.03e-02},
-      {361,360,-1.03e-02},
-      {361,362,-1.03e-02},
-      {361,363,-1.03e-02},
-      {361,377,-1.03e-02},
-      {361,378,-1.03e-02},
-      {361,379,-1.03e-02},
-      {362,362,8.29e-02},
-      {362,57,4.84e-05},
-      {362,72,1.93e-04},
-      {362,73,7.74e-04},
-      {362,74,1.93e-04},
-      {362,89,4.84e-05},
-      {362,90,1.93e-04},
-      {362,91,4.84e-05},
-      {362,92,1.93e-04},
-      {362,99,4.84e-05},
-      {362,346,-1.03e-02},
-      {362,361,-1.03e-02},
-      {362,363,-1.03e-02},
-      {362,378,-1.03e-02},
-      {362,379,-1.03e-02},
-      {362,380,-1.03e-02},
-      {362,381,-1.03e-02},
-      {362,388,-1.03e-02},
-      {363,363,8.29e-02},
-      {363,57,1.93e-04},
-      {363,58,4.84e-05},
-      {363,72,4.84e-05},
-      {363,73,1.93e-04},
-      {363,74,7.74e-04},
-      {363,75,1.93e-04},
-      {363,92,4.84e-05},
-      {363,98,4.84e-05},
-      {363,99,1.93e-04},
-      {363,346,-1.03e-02},
-      {363,347,-1.03e-02},
-      {363,361,-1.03e-02},
-      {363,362,-1.03e-02},
-      {363,364,-1.03e-02},
-      {363,381,-1.03e-02},
-      {363,387,-1.03e-02},
-      {363,388,-1.03e-02},
-      {364,364,8.29e-02},
-      {364,57,4.84e-05},
-      {364,58,1.93e-04},
-      {364,59,4.84e-05},
-      {364,74,1.93e-04},
-      {364,75,7.74e-04},
-      {364,76,1.93e-04},
-      {364,97,4.84e-05},
-      {364,98,1.93e-04},
-      {364,99,4.84e-05},
-      {364,346,-1.03e-02},
-      {364,347,-1.03e-02},
-      {364,348,-1.03e-02},
-      {364,363,-1.03e-02},
-      {364,365,-1.03e-02},
-      {364,386,-1.03e-02},
-      {364,387,-1.03e-02},
-      {364,388,-1.03e-02},
-      {365,365,8.29e-02},
-      {365,58,4.84e-05},
-      {365,59,1.93e-04},
-      {365,60,4.84e-05},
-      {365,75,1.93e-04},
-      {365,76,7.74e-04},
-      {365,77,1.93e-04},
-      {365,96,4.84e-05},
-      {365,97,1.93e-04},
-      {365,98,4.84e-05},
-      {365,347,-1.03e-02},
-      {365,348,-1.03e-02},
-      {365,349,-1.03e-02},
-      {365,364,-1.03e-02},
-      {365,366,-1.03e-02},
-      {365,385,-1.03e-02},
-      {365,386,-1.03e-02},
-      {365,387,-1.03e-02},
-      {366,366,8.29e-02},
-      {366,59,4.84e-05},
-      {366,60,1.93e-04},
-      {366,61,4.84e-05},
-      {366,76,1.93e-04},
-      {366,77,7.74e-04},
-      {366,78,1.93e-04},
-      {366,95,4.84e-05},
-      {366,96,1.93e-04},
-      {366,97,4.84e-05},
-      {366,348,-1.03e-02},
-      {366,349,-1.03e-02},
-      {366,350,-1.03e-02},
-      {366,365,-1.03e-02},
-      {366,367,-1.03e-02},
-      {366,384,-1.03e-02},
-      {366,385,-1.03e-02},
-      {366,386,-1.03e-02},
-      {367,367,8.29e-02},
-      {367,60,4.84e-05},
-      {367,61,1.93e-04},
-      {367,62,4.84e-05},
-      {367,77,1.93e-04},
-      {367,78,7.74e-04},
-      {367,79,1.93e-04},
-      {367,94,4.84e-05},
-      {367,95,1.93e-04},
-      {367,96,4.84e-05},
-      {367,349,-1.03e-02},
-      {367,350,-1.03e-02},
-      {367,351,-1.03e-02},
-      {367,366,-1.03e-02},
-      {367,368,-1.03e-02},
-      {367,383,-1.03e-02},
-      {367,384,-1.03e-02},
-      {367,385,-1.03e-02},
-      {368,368,8.29e-02},
-      {368,61,4.84e-05},
-      {368,62,1.93e-04},
-      {368,63,4.84e-05},
-      {368,78,1.93e-04},
-      {368,79,7.74e-04},
-      {368,80,1.93e-04},
-      {368,93,4.84e-05},
-      {368,94,1.93e-04},
-      {368,95,4.84e-05},
-      {368,350,-1.03e-02},
-      {368,351,-1.03e-02},
-      {368,352,-1.03e-02},
-      {368,367,-1.03e-02},
-      {368,369,-1.03e-02},
-      {368,382,-1.03e-02},
-      {368,383,-1.03e-02},
-      {368,384,-1.03e-02},
-      {369,369,8.29e-02},
-      {369,50,4.84e-05},
-      {369,62,4.84e-05},
-      {369,63,1.93e-04},
-      {369,65,1.93e-04},
-      {369,79,1.93e-04},
-      {369,80,7.74e-04},
-      {369,82,4.84e-05},
-      {369,93,1.93e-04},
-      {369,94,4.84e-05},
-      {369,339,-1.03e-02},
-      {369,351,-1.03e-02},
-      {369,352,-1.03e-02},
-      {369,354,-1.03e-02},
-      {369,368,-1.03e-02},
-      {369,371,-1.03e-02},
-      {369,382,-1.03e-02},
-      {369,383,-1.03e-02},
-      {370,370,2.08e-01},
-      {370,64,9.67e-05},
-      {370,66,4.84e-05},
-      {370,81,3.87e-04},
-      {370,83,1.93e-04},
-      {370,100,9.67e-05},
-      {370,102,4.84e-05},
-      {370,353,3.65e-02},
-      {370,355,-1.03e-02},
-      {370,372,-1.03e-02},
-      {370,389,3.65e-02},
-      {370,391,-1.03e-02},
-      {371,371,2.08e-01},
-      {371,65,9.67e-05},
-      {371,80,4.84e-05},
-      {371,82,3.87e-04},
-      {371,93,1.93e-04},
-      {371,101,9.67e-05},
-      {371,115,4.84e-05},
-      {371,354,3.65e-02},
-      {371,369,-1.03e-02},
-      {371,382,-1.03e-02},
-      {371,390,3.65e-02},
-      {371,404,-1.03e-02},
-      {372,372,8.29e-02},
-      {372,64,4.84e-05},
-      {372,66,1.93e-04},
-      {372,67,4.84e-05},
-      {372,81,1.93e-04},
-      {372,83,7.74e-04},
-      {372,84,1.93e-04},
-      {372,100,4.84e-05},
-      {372,102,1.93e-04},
-      {372,103,4.84e-05},
-      {372,353,-1.03e-02},
-      {372,355,-1.03e-02},
-      {372,356,-1.03e-02},
-      {372,370,-1.03e-02},
-      {372,373,-1.03e-02},
-      {372,389,-1.03e-02},
-      {372,391,-1.03e-02},
-      {372,392,-1.03e-02},
-      {373,373,8.29e-02},
-      {373,66,4.84e-05},
-      {373,67,1.93e-04},
-      {373,68,4.84e-05},
-      {373,83,1.93e-04},
-      {373,84,7.74e-04},
-      {373,85,1.93e-04},
-      {373,102,4.84e-05},
-      {373,103,1.93e-04},
-      {373,104,4.84e-05},
-      {373,355,-1.03e-02},
-      {373,356,-1.03e-02},
-      {373,357,-1.03e-02},
-      {373,372,-1.03e-02},
-      {373,374,-1.03e-02},
-      {373,391,-1.03e-02},
-      {373,392,-1.03e-02},
-      {373,393,-1.03e-02},
-      {374,374,8.29e-02},
-      {374,67,4.84e-05},
-      {374,68,1.93e-04},
-      {374,69,4.84e-05},
-      {374,84,1.93e-04},
-      {374,85,7.74e-04},
-      {374,86,1.93e-04},
-      {374,103,4.84e-05},
-      {374,104,1.93e-04},
-      {374,105,4.84e-05},
-      {374,356,-1.03e-02},
-      {374,357,-1.03e-02},
-      {374,358,-1.03e-02},
-      {374,373,-1.03e-02},
-      {374,375,-1.03e-02},
-      {374,392,-1.03e-02},
-      {374,393,-1.03e-02},
-      {374,394,-1.03e-02},
-      {375,375,8.29e-02},
-      {375,68,4.84e-05},
-      {375,69,1.93e-04},
-      {375,70,4.84e-05},
-      {375,85,1.93e-04},
-      {375,86,7.74e-04},
-      {375,87,1.93e-04},
-      {375,104,4.84e-05},
-      {375,105,1.93e-04},
-      {375,106,4.84e-05},
-      {375,357,-1.03e-02},
-      {375,358,-1.03e-02},
-      {375,359,-1.03e-02},
-      {375,374,-1.03e-02},
-      {375,376,-1.03e-02},
-      {375,393,-1.03e-02},
-      {375,394,-1.03e-02},
-      {375,395,-1.03e-02},
-      {376,376,8.29e-02},
-      {376,69,4.84e-05},
-      {376,70,1.93e-04},
-      {376,71,4.84e-05},
-      {376,86,1.93e-04},
-      {376,87,7.74e-04},
-      {376,88,1.93e-04},
-      {376,105,4.84e-05},
-      {376,106,1.93e-04},
-      {376,107,4.84e-05},
-      {376,358,-1.03e-02},
-      {376,359,-1.03e-02},
-      {376,360,-1.03e-02},
-      {376,375,-1.03e-02},
-      {376,377,-1.03e-02},
-      {376,394,-1.03e-02},
-      {376,395,-1.03e-02},
-      {376,396,-1.03e-02},
-      {377,377,8.29e-02},
-      {377,70,4.84e-05},
-      {377,71,1.93e-04},
-      {377,72,4.84e-05},
-      {377,87,1.93e-04},
-      {377,88,7.74e-04},
-      {377,89,1.93e-04},
-      {377,106,4.84e-05},
-      {377,107,1.93e-04},
-      {377,108,4.84e-05},
-      {377,359,-1.03e-02},
-      {377,360,-1.03e-02},
-      {377,361,-1.03e-02},
-      {377,376,-1.03e-02},
-      {377,378,-1.03e-02},
-      {377,395,-1.03e-02},
-      {377,396,-1.03e-02},
-      {377,397,-1.03e-02},
-      {378,378,8.29e-02},
-      {378,71,4.84e-05},
-      {378,72,1.93e-04},
-      {378,73,4.84e-05},
-      {378,88,1.93e-04},
-      {378,89,7.74e-04},
-      {378,90,1.93e-04},
-      {378,107,4.84e-05},
-      {378,108,1.93e-04},
-      {378,109,4.84e-05},
-      {378,360,-1.03e-02},
-      {378,361,-1.03e-02},
-      {378,362,-1.03e-02},
-      {378,377,-1.03e-02},
-      {378,379,-1.03e-02},
-      {378,396,-1.03e-02},
-      {378,397,-1.03e-02},
-      {378,398,-1.03e-02},
-      {379,379,8.29e-02},
-      {379,72,4.84e-05},
-      {379,73,1.93e-04},
-      {379,89,1.93e-04},
-      {379,90,7.74e-04},
-      {379,91,1.93e-04},
-      {379,92,4.84e-05},
-      {379,108,4.84e-05},
-      {379,109,1.93e-04},
-      {379,110,4.84e-05},
-      {379,361,-1.03e-02},
-      {379,362,-1.03e-02},
-      {379,378,-1.03e-02},
-      {379,380,-1.03e-02},
-      {379,381,-1.03e-02},
-      {379,397,-1.03e-02},
-      {379,398,-1.03e-02},
-      {379,399,-1.03e-02},
-      {380,380,8.29e-02},
-      {380,73,4.84e-05},
-      {380,90,1.93e-04},
-      {380,91,7.74e-04},
-      {380,92,1.93e-04},
-      {380,109,4.84e-05},
-      {380,110,1.93e-04},
-      {380,111,4.84e-05},
-      {380,112,1.93e-04},
-      {380,113,4.84e-05},
-      {380,362,-1.03e-02},
-      {380,379,-1.03e-02},
-      {380,381,-1.03e-02},
-      {380,398,-1.03e-02},
-      {380,399,-1.03e-02},
-      {380,400,-1.03e-02},
-      {380,401,-1.03e-02},
-      {380,402,-1.03e-02},
-      {381,381,8.29e-02},
-      {381,73,1.93e-04},
-      {381,74,4.84e-05},
-      {381,90,4.84e-05},
-      {381,91,1.93e-04},
-      {381,92,7.74e-04},
-      {381,99,1.93e-04},
-      {381,112,4.84e-05},
-      {381,113,1.93e-04},
-      {381,120,4.84e-05},
-      {381,362,-1.03e-02},
-      {381,363,-1.03e-02},
-      {381,379,-1.03e-02},
-      {381,380,-1.03e-02},
-      {381,388,-1.03e-02},
-      {381,401,-1.03e-02},
-      {381,402,-1.03e-02},
-      {381,409,-1.03e-02},
-      {382,382,8.29e-02},
-      {382,65,4.84e-05},
-      {382,79,4.84e-05},
-      {382,80,1.93e-04},
-      {382,82,1.93e-04},
-      {382,93,7.74e-04},
-      {382,94,1.93e-04},
-      {382,101,4.84e-05},
-      {382,114,4.84e-05},
-      {382,115,1.93e-04},
-      {382,354,-1.03e-02},
-      {382,368,-1.03e-02},
-      {382,369,-1.03e-02},
-      {382,371,-1.03e-02},
-      {382,383,-1.03e-02},
-      {382,390,-1.03e-02},
-      {382,403,-1.03e-02},
-      {382,404,-1.03e-02},
-      {383,383,8.29e-02},
-      {383,78,4.84e-05},
-      {383,79,1.93e-04},
-      {383,80,4.84e-05},
-      {383,93,1.93e-04},
-      {383,94,7.74e-04},
-      {383,95,1.93e-04},
-      {383,114,1.93e-04},
-      {383,115,4.84e-05},
-      {383,117,4.84e-05},
-      {383,367,-1.03e-02},
-      {383,368,-1.03e-02},
-      {383,369,-1.03e-02},
-      {383,382,-1.03e-02},
-      {383,384,-1.03e-02},
-      {383,403,-1.03e-02},
-      {383,404,-1.03e-02},
-      {383,406,-1.03e-02},
-      {384,384,8.29e-02},
-      {384,77,4.84e-05},
-      {384,78,1.93e-04},
-      {384,79,4.84e-05},
-      {384,94,1.93e-04},
-      {384,95,7.74e-04},
-      {384,96,1.93e-04},
-      {384,114,4.84e-05},
-      {384,116,4.84e-05},
-      {384,117,1.93e-04},
-      {384,366,-1.03e-02},
-      {384,367,-1.03e-02},
-      {384,368,-1.03e-02},
-      {384,383,-1.03e-02},
-      {384,385,-1.03e-02},
-      {384,403,-1.03e-02},
-      {384,405,-1.03e-02},
-      {384,406,-1.03e-02},
-      {385,385,8.29e-02},
-      {385,76,4.84e-05},
-      {385,77,1.93e-04},
-      {385,78,4.84e-05},
-      {385,95,1.93e-04},
-      {385,96,7.74e-04},
-      {385,97,1.93e-04},
-      {385,116,1.93e-04},
-      {385,117,4.84e-05},
-      {385,119,4.84e-05},
-      {385,365,-1.03e-02},
-      {385,366,-1.03e-02},
-      {385,367,-1.03e-02},
-      {385,384,-1.03e-02},
-      {385,386,-1.03e-02},
-      {385,405,-1.03e-02},
-      {385,406,-1.03e-02},
-      {385,408,-1.03e-02},
-      {386,386,8.29e-02},
-      {386,75,4.84e-05},
-      {386,76,1.93e-04},
-      {386,77,4.84e-05},
-      {386,96,1.93e-04},
-      {386,97,7.74e-04},
-      {386,98,1.93e-04},
-      {386,116,4.84e-05},
-      {386,118,4.84e-05},
-      {386,119,1.93e-04},
-      {386,364,-1.03e-02},
-      {386,365,-1.03e-02},
-      {386,366,-1.03e-02},
-      {386,385,-1.03e-02},
-      {386,387,-1.03e-02},
-      {386,405,-1.03e-02},
-      {386,407,-1.03e-02},
-      {386,408,-1.03e-02},
-      {387,387,8.29e-02},
-      {387,74,4.84e-05},
-      {387,75,1.93e-04},
-      {387,76,4.84e-05},
-      {387,97,1.93e-04},
-      {387,98,7.74e-04},
-      {387,99,1.93e-04},
-      {387,118,1.93e-04},
-      {387,119,4.84e-05},
-      {387,120,4.84e-05},
-      {387,363,-1.03e-02},
-      {387,364,-1.03e-02},
-      {387,365,-1.03e-02},
-      {387,386,-1.03e-02},
-      {387,388,-1.03e-02},
-      {387,407,-1.03e-02},
-      {387,408,-1.03e-02},
-      {387,409,-1.03e-02},
-      {388,388,8.29e-02},
-      {388,73,4.84e-05},
-      {388,74,1.93e-04},
-      {388,75,4.84e-05},
-      {388,92,1.93e-04},
-      {388,98,1.93e-04},
-      {388,99,7.74e-04},
-      {388,113,4.84e-05},
-      {388,118,4.84e-05},
-      {388,120,1.93e-04},
-      {388,362,-1.03e-02},
-      {388,363,-1.03e-02},
-      {388,364,-1.03e-02},
-      {388,381,-1.03e-02},
-      {388,387,-1.03e-02},
-      {388,402,-1.03e-02},
-      {388,407,-1.03e-02},
-      {388,409,-1.03e-02},
-      {389,389,2.08e-01},
-      {389,81,9.67e-05},
-      {389,83,4.84e-05},
-      {389,100,3.87e-04},
-      {389,102,1.93e-04},
-      {389,121,9.67e-05},
-      {389,123,4.84e-05},
-      {389,370,3.65e-02},
-      {389,372,-1.03e-02},
-      {389,391,-1.03e-02},
-      {389,410,3.65e-02},
-      {389,412,-1.03e-02},
-      {390,390,2.08e-01},
-      {390,82,9.67e-05},
-      {390,93,4.84e-05},
-      {390,101,3.87e-04},
-      {390,115,1.93e-04},
-      {390,122,9.67e-05},
-      {390,140,4.84e-05},
-      {390,371,3.65e-02},
-      {390,382,-1.03e-02},
-      {390,404,-1.03e-02},
-      {390,411,3.65e-02},
-      {390,429,-1.03e-02},
-      {391,391,8.29e-02},
-      {391,81,4.84e-05},
-      {391,83,1.93e-04},
-      {391,84,4.84e-05},
-      {391,100,1.93e-04},
-      {391,102,7.74e-04},
-      {391,103,1.93e-04},
-      {391,121,4.84e-05},
-      {391,123,1.93e-04},
-      {391,124,4.84e-05},
-      {391,370,-1.03e-02},
-      {391,372,-1.03e-02},
-      {391,373,-1.03e-02},
-      {391,389,-1.03e-02},
-      {391,392,-1.03e-02},
-      {391,410,-1.03e-02},
-      {391,412,-1.03e-02},
-      {391,413,-1.03e-02},
-      {392,392,8.29e-02},
-      {392,83,4.84e-05},
-      {392,84,1.93e-04},
-      {392,85,4.84e-05},
-      {392,102,1.93e-04},
-      {392,103,7.74e-04},
-      {392,104,1.93e-04},
-      {392,123,4.84e-05},
-      {392,124,1.93e-04},
-      {392,125,4.84e-05},
-      {392,372,-1.03e-02},
-      {392,373,-1.03e-02},
-      {392,374,-1.03e-02},
-      {392,391,-1.03e-02},
-      {392,393,-1.03e-02},
-      {392,412,-1.03e-02},
-      {392,413,-1.03e-02},
-      {392,414,-1.03e-02},
-      {393,393,8.29e-02},
-      {393,84,4.84e-05},
-      {393,85,1.93e-04},
-      {393,86,4.84e-05},
-      {393,103,1.93e-04},
-      {393,104,7.74e-04},
-      {393,105,1.93e-04},
-      {393,124,4.84e-05},
-      {393,125,1.93e-04},
-      {393,126,4.84e-05},
-      {393,373,-1.03e-02},
-      {393,374,-1.03e-02},
-      {393,375,-1.03e-02},
-      {393,392,-1.03e-02},
-      {393,394,-1.03e-02},
-      {393,413,-1.03e-02},
-      {393,414,-1.03e-02},
-      {393,415,-1.03e-02},
-      {394,394,8.29e-02},
-      {394,85,4.84e-05},
-      {394,86,1.93e-04},
-      {394,87,4.84e-05},
-      {394,104,1.93e-04},
-      {394,105,7.74e-04},
-      {394,106,1.93e-04},
-      {394,125,4.84e-05},
-      {394,126,1.93e-04},
-      {394,127,4.84e-05},
-      {394,374,-1.03e-02},
-      {394,375,-1.03e-02},
-      {394,376,-1.03e-02},
-      {394,393,-1.03e-02},
-      {394,395,-1.03e-02},
-      {394,414,-1.03e-02},
-      {394,415,-1.03e-02},
-      {394,416,-1.03e-02},
-      {395,395,8.29e-02},
-      {395,86,4.84e-05},
-      {395,87,1.93e-04},
-      {395,88,4.84e-05},
-      {395,105,1.93e-04},
-      {395,106,7.74e-04},
-      {395,107,1.93e-04},
-      {395,126,4.84e-05},
-      {395,127,1.93e-04},
-      {395,128,4.84e-05},
-      {395,375,-1.03e-02},
-      {395,376,-1.03e-02},
-      {395,377,-1.03e-02},
-      {395,394,-1.03e-02},
-      {395,396,-1.03e-02},
-      {395,415,-1.03e-02},
-      {395,416,-1.03e-02},
-      {395,417,-1.03e-02},
-      {396,396,8.29e-02},
-      {396,87,4.84e-05},
-      {396,88,1.93e-04},
-      {396,89,4.84e-05},
-      {396,106,1.93e-04},
-      {396,107,7.74e-04},
-      {396,108,1.93e-04},
-      {396,127,4.84e-05},
-      {396,128,1.93e-04},
-      {396,129,4.84e-05},
-      {396,376,-1.03e-02},
-      {396,377,-1.03e-02},
-      {396,378,-1.03e-02},
-      {396,395,-1.03e-02},
-      {396,397,-1.03e-02},
-      {396,416,-1.03e-02},
-      {396,417,-1.03e-02},
-      {396,418,-1.03e-02},
-      {397,397,8.29e-02},
-      {397,88,4.84e-05},
-      {397,89,1.93e-04},
-      {397,90,4.84e-05},
-      {397,107,1.93e-04},
-      {397,108,7.74e-04},
-      {397,109,1.93e-04},
-      {397,128,4.84e-05},
-      {397,129,1.93e-04},
-      {397,130,4.84e-05},
-      {397,377,-1.03e-02},
-      {397,378,-1.03e-02},
-      {397,379,-1.03e-02},
-      {397,396,-1.03e-02},
-      {397,398,-1.03e-02},
-      {397,417,-1.03e-02},
-      {397,418,-1.03e-02},
-      {397,419,-1.03e-02},
-      {398,398,8.29e-02},
-      {398,89,4.84e-05},
-      {398,90,1.93e-04},
-      {398,91,4.84e-05},
-      {398,108,1.93e-04},
-      {398,109,7.74e-04},
-      {398,110,1.93e-04},
-      {398,129,4.84e-05},
-      {398,130,1.93e-04},
-      {398,131,4.84e-05},
-      {398,378,-1.03e-02},
-      {398,379,-1.03e-02},
-      {398,380,-1.03e-02},
-      {398,397,-1.03e-02},
-      {398,399,-1.03e-02},
-      {398,418,-1.03e-02},
-      {398,419,-1.03e-02},
-      {398,420,-1.03e-02},
-      {399,399,8.29e-02},
-      {399,90,4.84e-05},
-      {399,91,1.93e-04},
-      {399,109,1.93e-04},
-      {399,110,7.74e-04},
-      {399,111,1.93e-04},
-      {399,112,4.84e-05},
-      {399,130,4.84e-05},
-      {399,131,1.93e-04},
-      {399,132,4.84e-05},
-      {399,379,-1.03e-02},
-      {399,380,-1.03e-02},
-      {399,398,-1.03e-02},
-      {399,400,-1.03e-02},
-      {399,401,-1.03e-02},
-      {399,419,-1.03e-02},
-      {399,420,-1.03e-02},
-      {399,421,-1.03e-02},
-      {400,400,8.29e-02},
-      {400,91,4.84e-05},
-      {400,110,1.93e-04},
-      {400,111,7.74e-04},
-      {400,112,1.93e-04},
-      {400,131,4.84e-05},
-      {400,132,1.93e-04},
-      {400,133,4.84e-05},
-      {400,134,1.93e-04},
-      {400,135,4.84e-05},
-      {400,380,-1.03e-02},
-      {400,399,-1.03e-02},
-      {400,401,-1.03e-02},
-      {400,420,-1.03e-02},
-      {400,421,-1.03e-02},
-      {400,422,-1.03e-02},
-      {400,423,-1.03e-02},
-      {400,424,-1.03e-02},
-      {401,401,8.29e-02},
-      {401,91,1.93e-04},
-      {401,92,4.84e-05},
-      {401,110,4.84e-05},
-      {401,111,1.93e-04},
-      {401,112,7.74e-04},
-      {401,113,1.93e-04},
-      {401,134,4.84e-05},
-      {401,135,1.93e-04},
-      {401,136,4.84e-05},
-      {401,380,-1.03e-02},
-      {401,381,-1.03e-02},
-      {401,399,-1.03e-02},
-      {401,400,-1.03e-02},
-      {401,402,-1.03e-02},
-      {401,423,-1.03e-02},
-      {401,424,-1.03e-02},
-      {401,425,-1.03e-02},
-      {402,402,8.29e-02},
-      {402,91,4.84e-05},
-      {402,92,1.93e-04},
-      {402,99,4.84e-05},
-      {402,112,1.93e-04},
-      {402,113,7.74e-04},
-      {402,120,1.93e-04},
-      {402,135,4.84e-05},
-      {402,136,1.93e-04},
-      {402,141,4.84e-05},
-      {402,380,-1.03e-02},
-      {402,381,-1.03e-02},
-      {402,388,-1.03e-02},
-      {402,401,-1.03e-02},
-      {402,409,-1.03e-02},
-      {402,424,-1.03e-02},
-      {402,425,-1.03e-02},
-      {402,430,-1.03e-02},
-      {403,403,8.29e-02},
-      {403,93,4.84e-05},
-      {403,94,1.93e-04},
-      {403,95,4.84e-05},
-      {403,114,7.74e-04},
-      {403,115,1.93e-04},
-      {403,117,1.93e-04},
-      {403,137,4.84e-05},
-      {403,138,1.93e-04},
-      {403,140,4.84e-05},
-      {403,382,-1.03e-02},
-      {403,383,-1.03e-02},
-      {403,384,-1.03e-02},
-      {403,404,-1.03e-02},
-      {403,406,-1.03e-02},
-      {403,426,-1.03e-02},
-      {403,427,-1.03e-02},
-      {403,429,-1.03e-02},
-      {404,404,8.29e-02},
-      {404,82,4.84e-05},
-      {404,93,1.93e-04},
-      {404,94,4.84e-05},
-      {404,101,1.93e-04},
-      {404,114,1.93e-04},
-      {404,115,7.74e-04},
-      {404,122,4.84e-05},
-      {404,138,4.84e-05},
-      {404,140,1.93e-04},
-      {404,371,-1.03e-02},
-      {404,382,-1.03e-02},
-      {404,383,-1.03e-02},
-      {404,390,-1.03e-02},
-      {404,403,-1.03e-02},
-      {404,411,-1.03e-02},
-      {404,427,-1.03e-02},
-      {404,429,-1.03e-02},
-      {405,405,8.29e-02},
-      {405,95,4.84e-05},
-      {405,96,1.93e-04},
-      {405,97,4.84e-05},
-      {405,116,7.74e-04},
-      {405,117,1.93e-04},
-      {405,119,1.93e-04},
-      {405,137,4.84e-05},
-      {405,139,1.93e-04},
-      {405,143,4.84e-05},
-      {405,384,-1.03e-02},
-      {405,385,-1.03e-02},
-      {405,386,-1.03e-02},
-      {405,406,-1.03e-02},
-      {405,408,-1.03e-02},
-      {405,426,-1.03e-02},
-      {405,428,-1.03e-02},
-      {405,432,-1.03e-02},
-      {406,406,8.29e-02},
-      {406,94,4.84e-05},
-      {406,95,1.93e-04},
-      {406,96,4.84e-05},
-      {406,114,1.93e-04},
-      {406,116,1.93e-04},
-      {406,117,7.74e-04},
-      {406,137,1.93e-04},
-      {406,138,4.84e-05},
-      {406,139,4.84e-05},
-      {406,383,-1.03e-02},
-      {406,384,-1.03e-02},
-      {406,385,-1.03e-02},
-      {406,403,-1.03e-02},
-      {406,405,-1.03e-02},
-      {406,426,-1.03e-02},
-      {406,427,-1.03e-02},
-      {406,428,-1.03e-02},
-      {407,407,8.29e-02},
-      {407,97,4.84e-05},
-      {407,98,1.93e-04},
-      {407,99,4.84e-05},
-      {407,118,7.74e-04},
-      {407,119,1.93e-04},
-      {407,120,1.93e-04},
-      {407,141,4.84e-05},
-      {407,142,1.93e-04},
-      {407,143,4.84e-05},
-      {407,386,-1.03e-02},
-      {407,387,-1.03e-02},
-      {407,388,-1.03e-02},
-      {407,408,-1.03e-02},
-      {407,409,-1.03e-02},
-      {407,430,-1.03e-02},
-      {407,431,-1.03e-02},
-      {407,432,-1.03e-02},
-      {408,408,8.29e-02},
-      {408,96,4.84e-05},
-      {408,97,1.93e-04},
-      {408,98,4.84e-05},
-      {408,116,1.93e-04},
-      {408,118,1.93e-04},
-      {408,119,7.74e-04},
-      {408,139,4.84e-05},
-      {408,142,4.84e-05},
-      {408,143,1.93e-04},
-      {408,385,-1.03e-02},
-      {408,386,-1.03e-02},
-      {408,387,-1.03e-02},
-      {408,405,-1.03e-02},
-      {408,407,-1.03e-02},
-      {408,428,-1.03e-02},
-      {408,431,-1.03e-02},
-      {408,432,-1.03e-02},
-      {409,409,8.29e-02},
-      {409,92,4.84e-05},
-      {409,98,4.84e-05},
-      {409,99,1.93e-04},
-      {409,113,1.93e-04},
-      {409,118,1.93e-04},
-      {409,120,7.74e-04},
-      {409,136,4.84e-05},
-      {409,141,1.93e-04},
-      {409,142,4.84e-05},
-      {409,381,-1.03e-02},
-      {409,387,-1.03e-02},
-      {409,388,-1.03e-02},
-      {409,402,-1.03e-02},
-      {409,407,-1.03e-02},
-      {409,425,-1.03e-02},
-      {409,430,-1.03e-02},
-      {409,431,-1.03e-02},
-      {410,410,2.08e-01},
-      {410,100,9.67e-05},
-      {410,102,4.84e-05},
-      {410,121,3.87e-04},
-      {410,123,1.93e-04},
-      {410,144,9.67e-05},
-      {410,146,4.84e-05},
-      {410,389,3.65e-02},
-      {410,391,-1.03e-02},
-      {410,412,-1.03e-02},
-      {410,433,3.65e-02},
-      {410,435,-1.03e-02},
-      {411,411,2.08e-01},
-      {411,101,9.67e-05},
-      {411,115,4.84e-05},
-      {411,122,3.87e-04},
-      {411,140,1.93e-04},
-      {411,145,9.67e-05},
-      {411,165,4.84e-05},
-      {411,390,3.65e-02},
-      {411,404,-1.03e-02},
-      {411,429,-1.03e-02},
-      {411,434,3.65e-02},
-      {411,454,-1.03e-02},
-      {412,412,8.29e-02},
-      {412,100,4.84e-05},
-      {412,102,1.93e-04},
-      {412,103,4.84e-05},
-      {412,121,1.93e-04},
-      {412,123,7.74e-04},
-      {412,124,1.93e-04},
-      {412,144,4.84e-05},
-      {412,146,1.93e-04},
-      {412,147,4.84e-05},
-      {412,389,-1.03e-02},
-      {412,391,-1.03e-02},
-      {412,392,-1.03e-02},
-      {412,410,-1.03e-02},
-      {412,413,-1.03e-02},
-      {412,433,-1.03e-02},
-      {412,435,-1.03e-02},
-      {412,436,-1.03e-02},
-      {413,413,8.29e-02},
-      {413,102,4.84e-05},
-      {413,103,1.93e-04},
-      {413,104,4.84e-05},
-      {413,123,1.93e-04},
-      {413,124,7.74e-04},
-      {413,125,1.93e-04},
-      {413,146,4.84e-05},
-      {413,147,1.93e-04},
-      {413,148,4.84e-05},
-      {413,391,-1.03e-02},
-      {413,392,-1.03e-02},
-      {413,393,-1.03e-02},
-      {413,412,-1.03e-02},
-      {413,414,-1.03e-02},
-      {413,435,-1.03e-02},
-      {413,436,-1.03e-02},
-      {413,437,-1.03e-02},
-      {414,414,8.29e-02},
-      {414,103,4.84e-05},
-      {414,104,1.93e-04},
-      {414,105,4.84e-05},
-      {414,124,1.93e-04},
-      {414,125,7.74e-04},
-      {414,126,1.93e-04},
-      {414,147,4.84e-05},
-      {414,148,1.93e-04},
-      {414,149,4.84e-05},
-      {414,392,-1.03e-02},
-      {414,393,-1.03e-02},
-      {414,394,-1.03e-02},
-      {414,413,-1.03e-02},
-      {414,415,-1.03e-02},
-      {414,436,-1.03e-02},
-      {414,437,-1.03e-02},
-      {414,438,-1.03e-02},
-      {415,415,8.29e-02},
-      {415,104,4.84e-05},
-      {415,105,1.93e-04},
-      {415,106,4.84e-05},
-      {415,125,1.93e-04},
-      {415,126,7.74e-04},
-      {415,127,1.93e-04},
-      {415,148,4.84e-05},
-      {415,149,1.93e-04},
-      {415,150,4.84e-05},
-      {415,393,-1.03e-02},
-      {415,394,-1.03e-02},
-      {415,395,-1.03e-02},
-      {415,414,-1.03e-02},
-      {415,416,-1.03e-02},
-      {415,437,-1.03e-02},
-      {415,438,-1.03e-02},
-      {415,439,-1.03e-02},
-      {416,416,8.29e-02},
-      {416,105,4.84e-05},
-      {416,106,1.93e-04},
-      {416,107,4.84e-05},
-      {416,126,1.93e-04},
-      {416,127,7.74e-04},
-      {416,128,1.93e-04},
-      {416,149,4.84e-05},
-      {416,150,1.93e-04},
-      {416,151,4.84e-05},
-      {416,394,-1.03e-02},
-      {416,395,-1.03e-02},
-      {416,396,-1.03e-02},
-      {416,415,-1.03e-02},
-      {416,417,-1.03e-02},
-      {416,438,-1.03e-02},
-      {416,439,-1.03e-02},
-      {416,440,-1.03e-02},
-      {417,417,8.29e-02},
-      {417,106,4.84e-05},
-      {417,107,1.93e-04},
-      {417,108,4.84e-05},
-      {417,127,1.93e-04},
-      {417,128,7.74e-04},
-      {417,129,1.93e-04},
-      {417,150,4.84e-05},
-      {417,151,1.93e-04},
-      {417,152,4.84e-05},
-      {417,395,-1.03e-02},
-      {417,396,-1.03e-02},
-      {417,397,-1.03e-02},
-      {417,416,-1.03e-02},
-      {417,418,-1.03e-02},
-      {417,439,-1.03e-02},
-      {417,440,-1.03e-02},
-      {417,441,-1.03e-02},
-      {418,418,8.29e-02},
-      {418,107,4.84e-05},
-      {418,108,1.93e-04},
-      {418,109,4.84e-05},
-      {418,128,1.93e-04},
-      {418,129,7.74e-04},
-      {418,130,1.93e-04},
-      {418,151,4.84e-05},
-      {418,152,1.93e-04},
-      {418,153,4.84e-05},
-      {418,396,-1.03e-02},
-      {418,397,-1.03e-02},
-      {418,398,-1.03e-02},
-      {418,417,-1.03e-02},
-      {418,419,-1.03e-02},
-      {418,440,-1.03e-02},
-      {418,441,-1.03e-02},
-      {418,442,-1.03e-02},
-      {419,419,8.29e-02},
-      {419,108,4.84e-05},
-      {419,109,1.93e-04},
-      {419,110,4.84e-05},
-      {419,129,1.93e-04},
-      {419,130,7.74e-04},
-      {419,131,1.93e-04},
-      {419,152,4.84e-05},
-      {419,153,1.93e-04},
-      {419,154,4.84e-05},
-      {419,397,-1.03e-02},
-      {419,398,-1.03e-02},
-      {419,399,-1.03e-02},
-      {419,418,-1.03e-02},
-      {419,420,-1.03e-02},
-      {419,441,-1.03e-02},
-      {419,442,-1.03e-02},
-      {419,443,-1.03e-02},
-      {420,420,8.29e-02},
-      {420,109,4.84e-05},
-      {420,110,1.93e-04},
-      {420,111,4.84e-05},
-      {420,130,1.93e-04},
-      {420,131,7.74e-04},
-      {420,132,1.93e-04},
-      {420,153,4.84e-05},
-      {420,154,1.93e-04},
-      {420,155,4.84e-05},
-      {420,398,-1.03e-02},
-      {420,399,-1.03e-02},
-      {420,400,-1.03e-02},
-      {420,419,-1.03e-02},
-      {420,421,-1.03e-02},
-      {420,442,-1.03e-02},
-      {420,443,-1.03e-02},
-      {420,444,-1.03e-02},
-      {421,421,8.29e-02},
-      {421,110,4.84e-05},
-      {421,111,1.93e-04},
-      {421,131,1.93e-04},
-      {421,132,7.74e-04},
-      {421,133,1.93e-04},
-      {421,134,4.84e-05},
-      {421,154,4.84e-05},
-      {421,155,1.93e-04},
-      {421,156,4.84e-05},
-      {421,399,-1.03e-02},
-      {421,400,-1.03e-02},
-      {421,420,-1.03e-02},
-      {421,422,-1.03e-02},
-      {421,423,-1.03e-02},
-      {421,443,-1.03e-02},
-      {421,444,-1.03e-02},
-      {421,445,-1.03e-02},
-      {422,422,8.29e-02},
-      {422,111,4.84e-05},
-      {422,132,1.93e-04},
-      {422,133,7.74e-04},
-      {422,134,1.93e-04},
-      {422,155,4.84e-05},
-      {422,156,1.93e-04},
-      {422,157,4.84e-05},
-      {422,158,1.93e-04},
-      {422,159,4.84e-05},
-      {422,400,-1.03e-02},
-      {422,421,-1.03e-02},
-      {422,423,-1.03e-02},
-      {422,444,-1.03e-02},
-      {422,445,-1.03e-02},
-      {422,446,-1.03e-02},
-      {422,447,-1.03e-02},
-      {422,448,-1.03e-02},
-      {423,423,8.29e-02},
-      {423,111,1.93e-04},
-      {423,112,4.84e-05},
-      {423,132,4.84e-05},
-      {423,133,1.93e-04},
-      {423,134,7.74e-04},
-      {423,135,1.93e-04},
-      {423,158,4.84e-05},
-      {423,159,1.93e-04},
-      {423,160,4.84e-05},
-      {423,400,-1.03e-02},
-      {423,401,-1.03e-02},
-      {423,421,-1.03e-02},
-      {423,422,-1.03e-02},
-      {423,424,-1.03e-02},
-      {423,447,-1.03e-02},
-      {423,448,-1.03e-02},
-      {423,449,-1.03e-02},
-      {424,424,8.29e-02},
-      {424,111,4.84e-05},
-      {424,112,1.93e-04},
-      {424,113,4.84e-05},
-      {424,134,1.93e-04},
-      {424,135,7.74e-04},
-      {424,136,1.93e-04},
-      {424,159,4.84e-05},
-      {424,160,1.93e-04},
-      {424,161,4.84e-05},
-      {424,400,-1.03e-02},
-      {424,401,-1.03e-02},
-      {424,402,-1.03e-02},
-      {424,423,-1.03e-02},
-      {424,425,-1.03e-02},
-      {424,448,-1.03e-02},
-      {424,449,-1.03e-02},
-      {424,450,-1.03e-02},
-      {425,425,8.29e-02},
-      {425,112,4.84e-05},
-      {425,113,1.93e-04},
-      {425,120,4.84e-05},
-      {425,135,1.93e-04},
-      {425,136,7.74e-04},
-      {425,141,1.93e-04},
-      {425,160,4.84e-05},
-      {425,161,1.93e-04},
-      {425,166,4.84e-05},
-      {425,401,-1.03e-02},
-      {425,402,-1.03e-02},
-      {425,409,-1.03e-02},
-      {425,424,-1.03e-02},
-      {425,430,-1.03e-02},
-      {425,449,-1.03e-02},
-      {425,450,-1.03e-02},
-      {425,455,-1.03e-02},
-      {426,426,8.29e-02},
-      {426,114,4.84e-05},
-      {426,116,4.84e-05},
-      {426,117,1.93e-04},
-      {426,137,7.74e-04},
-      {426,138,1.93e-04},
-      {426,139,1.93e-04},
-      {426,162,4.84e-05},
-      {426,163,1.93e-04},
-      {426,164,4.84e-05},
-      {426,403,-1.03e-02},
-      {426,405,-1.03e-02},
-      {426,406,-1.03e-02},
-      {426,427,-1.03e-02},
-      {426,428,-1.03e-02},
-      {426,451,-1.03e-02},
-      {426,452,-1.03e-02},
-      {426,453,-1.03e-02},
-      {427,427,8.29e-02},
-      {427,114,1.93e-04},
-      {427,115,4.84e-05},
-      {427,117,4.84e-05},
-      {427,137,1.93e-04},
-      {427,138,7.74e-04},
-      {427,140,1.93e-04},
-      {427,163,4.84e-05},
-      {427,164,1.93e-04},
-      {427,165,4.84e-05},
-      {427,403,-1.03e-02},
-      {427,404,-1.03e-02},
-      {427,406,-1.03e-02},
-      {427,426,-1.03e-02},
-      {427,429,-1.03e-02},
-      {427,452,-1.03e-02},
-      {427,453,-1.03e-02},
-      {427,454,-1.03e-02},
-      {428,428,8.29e-02},
-      {428,116,1.93e-04},
-      {428,117,4.84e-05},
-      {428,119,4.84e-05},
-      {428,137,1.93e-04},
-      {428,139,7.74e-04},
-      {428,143,1.93e-04},
-      {428,162,1.93e-04},
-      {428,163,4.84e-05},
-      {428,168,4.84e-05},
-      {428,405,-1.03e-02},
-      {428,406,-1.03e-02},
-      {428,408,-1.03e-02},
-      {428,426,-1.03e-02},
-      {428,432,-1.03e-02},
-      {428,451,-1.03e-02},
-      {428,452,-1.03e-02},
-      {428,457,-1.03e-02},
-      {429,429,8.29e-02},
-      {429,101,4.84e-05},
-      {429,114,4.84e-05},
-      {429,115,1.93e-04},
-      {429,122,1.93e-04},
-      {429,138,1.93e-04},
-      {429,140,7.74e-04},
-      {429,145,4.84e-05},
-      {429,164,4.84e-05},
-      {429,165,1.93e-04},
-      {429,390,-1.03e-02},
-      {429,403,-1.03e-02},
-      {429,404,-1.03e-02},
-      {429,411,-1.03e-02},
-      {429,427,-1.03e-02},
-      {429,434,-1.03e-02},
-      {429,453,-1.03e-02},
-      {429,454,-1.03e-02},
-      {430,430,8.29e-02},
-      {430,113,4.84e-05},
-      {430,118,4.84e-05},
-      {430,120,1.93e-04},
-      {430,136,1.93e-04},
-      {430,141,7.74e-04},
-      {430,142,1.93e-04},
-      {430,161,4.84e-05},
-      {430,166,1.93e-04},
-      {430,167,4.84e-05},
-      {430,402,-1.03e-02},
-      {430,407,-1.03e-02},
-      {430,409,-1.03e-02},
-      {430,425,-1.03e-02},
-      {430,431,-1.03e-02},
-      {430,450,-1.03e-02},
-      {430,455,-1.03e-02},
-      {430,456,-1.03e-02},
-      {431,431,8.29e-02},
-      {431,118,1.93e-04},
-      {431,119,4.84e-05},
-      {431,120,4.84e-05},
-      {431,141,1.93e-04},
-      {431,142,7.74e-04},
-      {431,143,1.93e-04},
-      {431,166,4.84e-05},
-      {431,167,1.93e-04},
-      {431,168,4.84e-05},
-      {431,407,-1.03e-02},
-      {431,408,-1.03e-02},
-      {431,409,-1.03e-02},
-      {431,430,-1.03e-02},
-      {431,432,-1.03e-02},
-      {431,455,-1.03e-02},
-      {431,456,-1.03e-02},
-      {431,457,-1.03e-02},
-      {432,432,8.29e-02},
-      {432,116,4.84e-05},
-      {432,118,4.84e-05},
-      {432,119,1.93e-04},
-      {432,139,1.93e-04},
-      {432,142,1.93e-04},
-      {432,143,7.74e-04},
-      {432,162,4.84e-05},
-      {432,167,4.84e-05},
-      {432,168,1.93e-04},
-      {432,405,-1.03e-02},
-      {432,407,-1.03e-02},
-      {432,408,-1.03e-02},
-      {432,428,-1.03e-02},
-      {432,431,-1.03e-02},
-      {432,451,-1.03e-02},
-      {432,456,-1.03e-02},
-      {432,457,-1.03e-02},
-      {433,433,2.08e-01},
-      {433,121,9.67e-05},
-      {433,123,4.84e-05},
-      {433,144,3.87e-04},
-      {433,146,1.93e-04},
-      {433,169,9.67e-05},
-      {433,171,4.84e-05},
-      {433,410,3.65e-02},
-      {433,412,-1.03e-02},
-      {433,435,-1.03e-02},
-      {433,458,3.65e-02},
-      {433,460,-1.03e-02},
-      {434,434,2.08e-01},
-      {434,122,9.67e-05},
-      {434,140,4.84e-05},
-      {434,145,3.87e-04},
-      {434,165,1.93e-04},
-      {434,170,9.67e-05},
-      {434,193,4.84e-05},
-      {434,411,3.65e-02},
-      {434,429,-1.03e-02},
-      {434,454,-1.03e-02},
-      {434,459,3.65e-02},
-      {434,482,-1.03e-02},
-      {435,435,8.29e-02},
-      {435,121,4.84e-05},
-      {435,123,1.93e-04},
-      {435,124,4.84e-05},
-      {435,144,1.93e-04},
-      {435,146,7.74e-04},
-      {435,147,1.93e-04},
-      {435,169,4.84e-05},
-      {435,171,1.93e-04},
-      {435,172,4.84e-05},
-      {435,410,-1.03e-02},
-      {435,412,-1.03e-02},
-      {435,413,-1.03e-02},
-      {435,433,-1.03e-02},
-      {435,436,-1.03e-02},
-      {435,458,-1.03e-02},
-      {435,460,-1.03e-02},
-      {435,461,-1.03e-02},
-      {436,436,8.29e-02},
-      {436,123,4.84e-05},
-      {436,124,1.93e-04},
-      {436,125,4.84e-05},
-      {436,146,1.93e-04},
-      {436,147,7.74e-04},
-      {436,148,1.93e-04},
-      {436,171,4.84e-05},
-      {436,172,1.93e-04},
-      {436,173,4.84e-05},
-      {436,412,-1.03e-02},
-      {436,413,-1.03e-02},
-      {436,414,-1.03e-02},
-      {436,435,-1.03e-02},
-      {436,437,-1.03e-02},
-      {436,460,-1.03e-02},
-      {436,461,-1.03e-02},
-      {436,462,-1.03e-02},
-      {437,437,8.29e-02},
-      {437,124,4.84e-05},
-      {437,125,1.93e-04},
-      {437,126,4.84e-05},
-      {437,147,1.93e-04},
-      {437,148,7.74e-04},
-      {437,149,1.93e-04},
-      {437,172,4.84e-05},
-      {437,173,1.93e-04},
-      {437,174,4.84e-05},
-      {437,413,-1.03e-02},
-      {437,414,-1.03e-02},
-      {437,415,-1.03e-02},
-      {437,436,-1.03e-02},
-      {437,438,-1.03e-02},
-      {437,461,-1.03e-02},
-      {437,462,-1.03e-02},
-      {437,463,-1.03e-02},
-      {438,438,8.29e-02},
-      {438,125,4.84e-05},
-      {438,126,1.93e-04},
-      {438,127,4.84e-05},
-      {438,148,1.93e-04},
-      {438,149,7.74e-04},
-      {438,150,1.93e-04},
-      {438,173,4.84e-05},
-      {438,174,1.93e-04},
-      {438,175,4.84e-05},
-      {438,414,-1.03e-02},
-      {438,415,-1.03e-02},
-      {438,416,-1.03e-02},
-      {438,437,-1.03e-02},
-      {438,439,-1.03e-02},
-      {438,462,-1.03e-02},
-      {438,463,-1.03e-02},
-      {438,464,-1.03e-02},
-      {439,439,8.29e-02},
-      {439,126,4.84e-05},
-      {439,127,1.93e-04},
-      {439,128,4.84e-05},
-      {439,149,1.93e-04},
-      {439,150,7.74e-04},
-      {439,151,1.93e-04},
-      {439,174,4.84e-05},
-      {439,175,1.93e-04},
-      {439,176,4.84e-05},
-      {439,415,-1.03e-02},
-      {439,416,-1.03e-02},
-      {439,417,-1.03e-02},
-      {439,438,-1.03e-02},
-      {439,440,-1.03e-02},
-      {439,463,-1.03e-02},
-      {439,464,-1.03e-02},
-      {439,465,-1.03e-02},
-      {440,440,8.29e-02},
-      {440,127,4.84e-05},
-      {440,128,1.93e-04},
-      {440,129,4.84e-05},
-      {440,150,1.93e-04},
-      {440,151,7.74e-04},
-      {440,152,1.93e-04},
-      {440,175,4.84e-05},
-      {440,176,1.93e-04},
-      {440,177,4.84e-05},
-      {440,416,-1.03e-02},
-      {440,417,-1.03e-02},
-      {440,418,-1.03e-02},
-      {440,439,-1.03e-02},
-      {440,441,-1.03e-02},
-      {440,464,-1.03e-02},
-      {440,465,-1.03e-02},
-      {440,466,-1.03e-02},
-      {441,441,8.29e-02},
-      {441,128,4.84e-05},
-      {441,129,1.93e-04},
-      {441,130,4.84e-05},
-      {441,151,1.93e-04},
-      {441,152,7.74e-04},
-      {441,153,1.93e-04},
-      {441,176,4.84e-05},
-      {441,177,1.93e-04},
-      {441,178,4.84e-05},
-      {441,417,-1.03e-02},
-      {441,418,-1.03e-02},
-      {441,419,-1.03e-02},
-      {441,440,-1.03e-02},
-      {441,442,-1.03e-02},
-      {441,465,-1.03e-02},
-      {441,466,-1.03e-02},
-      {441,467,-1.03e-02},
-      {442,442,8.29e-02},
-      {442,129,4.84e-05},
-      {442,130,1.93e-04},
-      {442,131,4.84e-05},
-      {442,152,1.93e-04},
-      {442,153,7.74e-04},
-      {442,154,1.93e-04},
-      {442,177,4.84e-05},
-      {442,178,1.93e-04},
-      {442,179,4.84e-05},
-      {442,418,-1.03e-02},
-      {442,419,-1.03e-02},
-      {442,420,-1.03e-02},
-      {442,441,-1.03e-02},
-      {442,443,-1.03e-02},
-      {442,466,-1.03e-02},
-      {442,467,-1.03e-02},
-      {442,468,-1.03e-02},
-      {443,443,8.29e-02},
-      {443,130,4.84e-05},
-      {443,131,1.93e-04},
-      {443,132,4.84e-05},
-      {443,153,1.93e-04},
-      {443,154,7.74e-04},
-      {443,155,1.93e-04},
-      {443,178,4.84e-05},
-      {443,179,1.93e-04},
-      {443,180,4.84e-05},
-      {443,419,-1.03e-02},
-      {443,420,-1.03e-02},
-      {443,421,-1.03e-02},
-      {443,442,-1.03e-02},
-      {443,444,-1.03e-02},
-      {443,467,-1.03e-02},
-      {443,468,-1.03e-02},
-      {443,469,-1.03e-02},
-      {444,444,8.29e-02},
-      {444,131,4.84e-05},
-      {444,132,1.93e-04},
-      {444,133,4.84e-05},
-      {444,154,1.93e-04},
-      {444,155,7.74e-04},
-      {444,156,1.93e-04},
-      {444,179,4.84e-05},
-      {444,180,1.93e-04},
-      {444,181,4.84e-05},
-      {444,420,-1.03e-02},
-      {444,421,-1.03e-02},
-      {444,422,-1.03e-02},
-      {444,443,-1.03e-02},
-      {444,445,-1.03e-02},
-      {444,468,-1.03e-02},
-      {444,469,-1.03e-02},
-      {444,470,-1.03e-02},
-      {445,445,8.29e-02},
-      {445,132,4.84e-05},
-      {445,133,1.93e-04},
-      {445,155,1.93e-04},
-      {445,156,7.74e-04},
-      {445,157,1.93e-04},
-      {445,158,4.84e-05},
-      {445,180,4.84e-05},
-      {445,181,1.93e-04},
-      {445,182,4.84e-05},
-      {445,421,-1.03e-02},
-      {445,422,-1.03e-02},
-      {445,444,-1.03e-02},
-      {445,446,-1.03e-02},
-      {445,447,-1.03e-02},
-      {445,469,-1.03e-02},
-      {445,470,-1.03e-02},
-      {445,471,-1.03e-02},
-      {446,446,8.29e-02},
-      {446,133,4.84e-05},
-      {446,156,1.93e-04},
-      {446,157,7.74e-04},
-      {446,158,1.93e-04},
-      {446,181,4.84e-05},
-      {446,182,1.93e-04},
-      {446,183,4.84e-05},
-      {446,184,1.93e-04},
-      {446,188,4.84e-05},
-      {446,422,-1.03e-02},
-      {446,445,-1.03e-02},
-      {446,447,-1.03e-02},
-      {446,470,-1.03e-02},
-      {446,471,-1.03e-02},
-      {446,472,-1.03e-02},
-      {446,473,-1.03e-02},
-      {446,477,-1.03e-02},
-      {447,447,8.29e-02},
-      {447,133,1.93e-04},
-      {447,134,4.84e-05},
-      {447,156,4.84e-05},
-      {447,157,1.93e-04},
-      {447,158,7.74e-04},
-      {447,159,1.93e-04},
-      {447,184,4.84e-05},
-      {447,187,4.84e-05},
-      {447,188,1.93e-04},
-      {447,422,-1.03e-02},
-      {447,423,-1.03e-02},
-      {447,445,-1.03e-02},
-      {447,446,-1.03e-02},
-      {447,448,-1.03e-02},
-      {447,473,-1.03e-02},
-      {447,476,-1.03e-02},
-      {447,477,-1.03e-02},
-      {448,448,8.29e-02},
-      {448,133,4.84e-05},
-      {448,134,1.93e-04},
-      {448,135,4.84e-05},
-      {448,158,1.93e-04},
-      {448,159,7.74e-04},
-      {448,160,1.93e-04},
-      {448,185,4.84e-05},
-      {448,187,1.93e-04},
-      {448,188,4.84e-05},
-      {448,422,-1.03e-02},
-      {448,423,-1.03e-02},
-      {448,424,-1.03e-02},
-      {448,447,-1.03e-02},
-      {448,449,-1.03e-02},
-      {448,474,-1.03e-02},
-      {448,476,-1.03e-02},
-      {448,477,-1.03e-02},
-      {449,449,8.29e-02},
-      {449,134,4.84e-05},
-      {449,135,1.93e-04},
-      {449,136,4.84e-05},
-      {449,159,1.93e-04},
-      {449,160,7.74e-04},
-      {449,161,1.93e-04},
-      {449,185,1.93e-04},
-      {449,186,4.84e-05},
-      {449,187,4.84e-05},
-      {449,423,-1.03e-02},
-      {449,424,-1.03e-02},
-      {449,425,-1.03e-02},
-      {449,448,-1.03e-02},
-      {449,450,-1.03e-02},
-      {449,474,-1.03e-02},
-      {449,475,-1.03e-02},
-      {449,476,-1.03e-02},
-      {450,450,8.29e-02},
-      {450,135,4.84e-05},
-      {450,136,1.93e-04},
-      {450,141,4.84e-05},
-      {450,160,1.93e-04},
-      {450,161,7.74e-04},
-      {450,166,1.93e-04},
-      {450,185,4.84e-05},
-      {450,186,1.93e-04},
-      {450,192,4.84e-05},
-      {450,424,-1.03e-02},
-      {450,425,-1.03e-02},
-      {450,430,-1.03e-02},
-      {450,449,-1.03e-02},
-      {450,455,-1.03e-02},
-      {450,474,-1.03e-02},
-      {450,475,-1.03e-02},
-      {450,481,-1.03e-02},
-      {451,451,8.29e-02},
-      {451,137,4.84e-05},
-      {451,139,1.93e-04},
-      {451,143,4.84e-05},
-      {451,162,7.74e-04},
-      {451,163,1.93e-04},
-      {451,168,1.93e-04},
-      {451,189,4.84e-05},
-      {451,190,1.93e-04},
-      {451,195,4.84e-05},
-      {451,426,-1.03e-02},
-      {451,428,-1.03e-02},
-      {451,432,-1.03e-02},
-      {451,452,-1.03e-02},
-      {451,457,-1.03e-02},
-      {451,478,-1.03e-02},
-      {451,479,-1.03e-02},
-      {451,484,-1.03e-02},
-      {452,452,8.29e-02},
-      {452,137,1.93e-04},
-      {452,138,4.84e-05},
-      {452,139,4.84e-05},
-      {452,162,1.93e-04},
-      {452,163,7.74e-04},
-      {452,164,1.93e-04},
-      {452,190,4.84e-05},
-      {452,194,4.84e-05},
-      {452,195,1.93e-04},
-      {452,426,-1.03e-02},
-      {452,427,-1.03e-02},
-      {452,428,-1.03e-02},
-      {452,451,-1.03e-02},
-      {452,453,-1.03e-02},
-      {452,479,-1.03e-02},
-      {452,483,-1.03e-02},
-      {452,484,-1.03e-02},
-      {453,453,8.29e-02},
-      {453,137,4.84e-05},
-      {453,138,1.93e-04},
-      {453,140,4.84e-05},
-      {453,163,1.93e-04},
-      {453,164,7.74e-04},
-      {453,165,1.93e-04},
-      {453,193,4.84e-05},
-      {453,194,1.93e-04},
-      {453,195,4.84e-05},
-      {453,426,-1.03e-02},
-      {453,427,-1.03e-02},
-      {453,429,-1.03e-02},
-      {453,452,-1.03e-02},
-      {453,454,-1.03e-02},
-      {453,482,-1.03e-02},
-      {453,483,-1.03e-02},
-      {453,484,-1.03e-02},
-      {454,454,8.29e-02},
-      {454,122,4.84e-05},
-      {454,138,4.84e-05},
-      {454,140,1.93e-04},
-      {454,145,1.93e-04},
-      {454,164,1.93e-04},
-      {454,165,7.74e-04},
-      {454,170,4.84e-05},
-      {454,193,1.93e-04},
-      {454,194,4.84e-05},
-      {454,411,-1.03e-02},
-      {454,427,-1.03e-02},
-      {454,429,-1.03e-02},
-      {454,434,-1.03e-02},
-      {454,453,-1.03e-02},
-      {454,459,-1.03e-02},
-      {454,482,-1.03e-02},
-      {454,483,-1.03e-02},
-      {455,455,8.29e-02},
-      {455,136,4.84e-05},
-      {455,141,1.93e-04},
-      {455,142,4.84e-05},
-      {455,161,1.93e-04},
-      {455,166,7.74e-04},
-      {455,167,1.93e-04},
-      {455,186,4.84e-05},
-      {455,191,4.84e-05},
-      {455,192,1.93e-04},
-      {455,425,-1.03e-02},
-      {455,430,-1.03e-02},
-      {455,431,-1.03e-02},
-      {455,450,-1.03e-02},
-      {455,456,-1.03e-02},
-      {455,475,-1.03e-02},
-      {455,480,-1.03e-02},
-      {455,481,-1.03e-02},
-      {456,456,8.29e-02},
-      {456,141,4.84e-05},
-      {456,142,1.93e-04},
-      {456,143,4.84e-05},
-      {456,166,1.93e-04},
-      {456,167,7.74e-04},
-      {456,168,1.93e-04},
-      {456,189,4.84e-05},
-      {456,191,1.93e-04},
-      {456,192,4.84e-05},
-      {456,430,-1.03e-02},
-      {456,431,-1.03e-02},
-      {456,432,-1.03e-02},
-      {456,455,-1.03e-02},
-      {456,457,-1.03e-02},
-      {456,478,-1.03e-02},
-      {456,480,-1.03e-02},
-      {456,481,-1.03e-02},
-      {457,457,8.29e-02},
-      {457,139,4.84e-05},
-      {457,142,4.84e-05},
-      {457,143,1.93e-04},
-      {457,162,1.93e-04},
-      {457,167,1.93e-04},
-      {457,168,7.74e-04},
-      {457,189,1.93e-04},
-      {457,190,4.84e-05},
-      {457,191,4.84e-05},
-      {457,428,-1.03e-02},
-      {457,431,-1.03e-02},
-      {457,432,-1.03e-02},
-      {457,451,-1.03e-02},
-      {457,456,-1.03e-02},
-      {457,478,-1.03e-02},
-      {457,479,-1.03e-02},
-      {457,480,-1.03e-02},
-      {458,458,2.08e-01},
-      {458,144,9.67e-05},
-      {458,146,4.84e-05},
-      {458,169,3.87e-04},
-      {458,171,1.93e-04},
-      {458,196,9.67e-05},
-      {458,198,4.84e-05},
-      {458,433,3.65e-02},
-      {458,435,-1.03e-02},
-      {458,460,-1.03e-02},
-      {458,485,3.65e-02},
-      {458,487,-1.03e-02},
-      {459,459,2.08e-01},
-      {459,145,9.67e-05},
-      {459,165,4.84e-05},
-      {459,170,3.87e-04},
-      {459,193,1.93e-04},
-      {459,197,9.67e-05},
-      {459,223,4.84e-05},
-      {459,434,3.65e-02},
-      {459,454,-1.03e-02},
-      {459,482,-1.03e-02},
-      {459,486,3.65e-02},
-      {459,512,-1.03e-02},
-      {460,460,8.29e-02},
-      {460,144,4.84e-05},
-      {460,146,1.93e-04},
-      {460,147,4.84e-05},
-      {460,169,1.93e-04},
-      {460,171,7.74e-04},
-      {460,172,1.93e-04},
-      {460,196,4.84e-05},
-      {460,198,1.93e-04},
-      {460,199,4.84e-05},
-      {460,433,-1.03e-02},
-      {460,435,-1.03e-02},
-      {460,436,-1.03e-02},
-      {460,458,-1.03e-02},
-      {460,461,-1.03e-02},
-      {460,485,-1.03e-02},
-      {460,487,-1.03e-02},
-      {460,488,-1.03e-02},
-      {461,461,8.29e-02},
-      {461,146,4.84e-05},
-      {461,147,1.93e-04},
-      {461,148,4.84e-05},
-      {461,171,1.93e-04},
-      {461,172,7.74e-04},
-      {461,173,1.93e-04},
-      {461,198,4.84e-05},
-      {461,199,1.93e-04},
-      {461,200,4.84e-05},
-      {461,435,-1.03e-02},
-      {461,436,-1.03e-02},
-      {461,437,-1.03e-02},
-      {461,460,-1.03e-02},
-      {461,462,-1.03e-02},
-      {461,487,-1.03e-02},
-      {461,488,-1.03e-02},
-      {461,489,-1.03e-02},
-      {462,462,8.29e-02},
-      {462,147,4.84e-05},
-      {462,148,1.93e-04},
-      {462,149,4.84e-05},
-      {462,172,1.93e-04},
-      {462,173,7.74e-04},
-      {462,174,1.93e-04},
-      {462,199,4.84e-05},
-      {462,200,1.93e-04},
-      {462,201,4.84e-05},
-      {462,436,-1.03e-02},
-      {462,437,-1.03e-02},
-      {462,438,-1.03e-02},
-      {462,461,-1.03e-02},
-      {462,463,-1.03e-02},
-      {462,488,-1.03e-02},
-      {462,489,-1.03e-02},
-      {462,490,-1.03e-02},
-      {463,463,8.29e-02},
-      {463,148,4.84e-05},
-      {463,149,1.93e-04},
-      {463,150,4.84e-05},
-      {463,173,1.93e-04},
-      {463,174,7.74e-04},
-      {463,175,1.93e-04},
-      {463,200,4.84e-05},
-      {463,201,1.93e-04},
-      {463,202,4.84e-05},
-      {463,437,-1.03e-02},
-      {463,438,-1.03e-02},
-      {463,439,-1.03e-02},
-      {463,462,-1.03e-02},
-      {463,464,-1.03e-02},
-      {463,489,-1.03e-02},
-      {463,490,-1.03e-02},
-      {463,491,-1.03e-02},
-      {464,464,8.29e-02},
-      {464,149,4.84e-05},
-      {464,150,1.93e-04},
-      {464,151,4.84e-05},
-      {464,174,1.93e-04},
-      {464,175,7.74e-04},
-      {464,176,1.93e-04},
-      {464,201,4.84e-05},
-      {464,202,1.93e-04},
-      {464,203,4.84e-05},
-      {464,438,-1.03e-02},
-      {464,439,-1.03e-02},
-      {464,440,-1.03e-02},
-      {464,463,-1.03e-02},
-      {464,465,-1.03e-02},
-      {464,490,-1.03e-02},
-      {464,491,-1.03e-02},
-      {464,492,-1.03e-02},
-      {465,465,8.29e-02},
-      {465,150,4.84e-05},
-      {465,151,1.93e-04},
-      {465,152,4.84e-05},
-      {465,175,1.93e-04},
-      {465,176,7.74e-04},
-      {465,177,1.93e-04},
-      {465,202,4.84e-05},
-      {465,203,1.93e-04},
-      {465,204,4.84e-05},
-      {465,439,-1.03e-02},
-      {465,440,-1.03e-02},
-      {465,441,-1.03e-02},
-      {465,464,-1.03e-02},
-      {465,466,-1.03e-02},
-      {465,491,-1.03e-02},
-      {465,492,-1.03e-02},
-      {465,493,-1.03e-02},
-      {466,466,8.29e-02},
-      {466,151,4.84e-05},
-      {466,152,1.93e-04},
-      {466,153,4.84e-05},
-      {466,176,1.93e-04},
-      {466,177,7.74e-04},
-      {466,178,1.93e-04},
-      {466,203,4.84e-05},
-      {466,204,1.93e-04},
-      {466,205,4.84e-05},
-      {466,440,-1.03e-02},
-      {466,441,-1.03e-02},
-      {466,442,-1.03e-02},
-      {466,465,-1.03e-02},
-      {466,467,-1.03e-02},
-      {466,492,-1.03e-02},
-      {466,493,-1.03e-02},
-      {466,494,-1.03e-02},
-      {467,467,8.29e-02},
-      {467,152,4.84e-05},
-      {467,153,1.93e-04},
-      {467,154,4.84e-05},
-      {467,177,1.93e-04},
-      {467,178,7.74e-04},
-      {467,179,1.93e-04},
-      {467,204,4.84e-05},
-      {467,205,1.93e-04},
-      {467,206,4.84e-05},
-      {467,441,-1.03e-02},
-      {467,442,-1.03e-02},
-      {467,443,-1.03e-02},
-      {467,466,-1.03e-02},
-      {467,468,-1.03e-02},
-      {467,493,-1.03e-02},
-      {467,494,-1.03e-02},
-      {467,495,-1.03e-02},
-      {468,468,8.29e-02},
-      {468,153,4.84e-05},
-      {468,154,1.93e-04},
-      {468,155,4.84e-05},
-      {468,178,1.93e-04},
-      {468,179,7.74e-04},
-      {468,180,1.93e-04},
-      {468,205,4.84e-05},
-      {468,206,1.93e-04},
-      {468,207,4.84e-05},
-      {468,442,-1.03e-02},
-      {468,443,-1.03e-02},
-      {468,444,-1.03e-02},
-      {468,467,-1.03e-02},
-      {468,469,-1.03e-02},
-      {468,494,-1.03e-02},
-      {468,495,-1.03e-02},
-      {468,496,-1.03e-02},
-      {469,469,8.29e-02},
-      {469,154,4.84e-05},
-      {469,155,1.93e-04},
-      {469,156,4.84e-05},
-      {469,179,1.93e-04},
-      {469,180,7.74e-04},
-      {469,181,1.93e-04},
-      {469,206,4.84e-05},
-      {469,207,1.93e-04},
-      {469,208,4.84e-05},
-      {469,443,-1.03e-02},
-      {469,444,-1.03e-02},
-      {469,445,-1.03e-02},
-      {469,468,-1.03e-02},
-      {469,470,-1.03e-02},
-      {469,495,-1.03e-02},
-      {469,496,-1.03e-02},
-      {469,497,-1.03e-02},
-      {470,470,8.29e-02},
-      {470,155,4.84e-05},
-      {470,156,1.93e-04},
-      {470,157,4.84e-05},
-      {470,180,1.93e-04},
-      {470,181,7.74e-04},
-      {470,182,1.93e-04},
-      {470,207,4.84e-05},
-      {470,208,1.93e-04},
-      {470,209,4.84e-05},
-      {470,444,-1.03e-02},
-      {470,445,-1.03e-02},
-      {470,446,-1.03e-02},
-      {470,469,-1.03e-02},
-      {470,471,-1.03e-02},
-      {470,496,-1.03e-02},
-      {470,497,-1.03e-02},
-      {470,498,-1.03e-02},
-      {471,471,8.29e-02},
-      {471,156,4.84e-05},
-      {471,157,1.93e-04},
-      {471,181,1.93e-04},
-      {471,182,7.74e-04},
-      {471,183,1.93e-04},
-      {471,184,4.84e-05},
-      {471,208,4.84e-05},
-      {471,209,1.93e-04},
-      {471,210,4.84e-05},
-      {471,445,-1.03e-02},
-      {471,446,-1.03e-02},
-      {471,470,-1.03e-02},
-      {471,472,-1.03e-02},
-      {471,473,-1.03e-02},
-      {471,497,-1.03e-02},
-      {471,498,-1.03e-02},
-      {471,499,-1.03e-02},
-      {472,472,8.29e-02},
-      {472,157,4.84e-05},
-      {472,182,1.93e-04},
-      {472,183,7.74e-04},
-      {472,184,1.93e-04},
-      {472,209,4.84e-05},
-      {472,210,1.93e-04},
-      {472,211,4.84e-05},
-      {472,212,1.93e-04},
-      {472,213,4.84e-05},
-      {472,446,-1.03e-02},
-      {472,471,-1.03e-02},
-      {472,473,-1.03e-02},
-      {472,498,-1.03e-02},
-      {472,499,-1.03e-02},
-      {472,500,-1.03e-02},
-      {472,501,-1.03e-02},
-      {472,502,-1.03e-02},
-      {473,473,8.29e-02},
-      {473,157,1.93e-04},
-      {473,158,4.84e-05},
-      {473,182,4.84e-05},
-      {473,183,1.93e-04},
-      {473,184,7.74e-04},
-      {473,188,1.93e-04},
-      {473,212,4.84e-05},
-      {473,213,1.93e-04},
-      {473,217,4.84e-05},
-      {473,446,-1.03e-02},
-      {473,447,-1.03e-02},
-      {473,471,-1.03e-02},
-      {473,472,-1.03e-02},
-      {473,477,-1.03e-02},
-      {473,501,-1.03e-02},
-      {473,502,-1.03e-02},
-      {473,506,-1.03e-02},
-      {474,474,8.29e-02},
-      {474,159,4.84e-05},
-      {474,160,1.93e-04},
-      {474,161,4.84e-05},
-      {474,185,7.74e-04},
-      {474,186,1.93e-04},
-      {474,187,1.93e-04},
-      {474,214,4.84e-05},
-      {474,215,1.93e-04},
-      {474,216,4.84e-05},
-      {474,448,-1.03e-02},
-      {474,449,-1.03e-02},
-      {474,450,-1.03e-02},
-      {474,475,-1.03e-02},
-      {474,476,-1.03e-02},
-      {474,503,-1.03e-02},
-      {474,504,-1.03e-02},
-      {474,505,-1.03e-02},
-      {475,475,8.29e-02},
-      {475,160,4.84e-05},
-      {475,161,1.93e-04},
-      {475,166,4.84e-05},
-      {475,185,1.93e-04},
-      {475,186,7.74e-04},
-      {475,192,1.93e-04},
-      {475,215,4.84e-05},
-      {475,216,1.93e-04},
-      {475,221,4.84e-05},
-      {475,449,-1.03e-02},
-      {475,450,-1.03e-02},
-      {475,455,-1.03e-02},
-      {475,474,-1.03e-02},
-      {475,481,-1.03e-02},
-      {475,504,-1.03e-02},
-      {475,505,-1.03e-02},
-      {475,510,-1.03e-02},
-      {476,476,8.29e-02},
-      {476,158,4.84e-05},
-      {476,159,1.93e-04},
-      {476,160,4.84e-05},
-      {476,185,1.93e-04},
-      {476,187,7.74e-04},
-      {476,188,1.93e-04},
-      {476,214,1.93e-04},
-      {476,215,4.84e-05},
-      {476,217,4.84e-05},
-      {476,447,-1.03e-02},
-      {476,448,-1.03e-02},
-      {476,449,-1.03e-02},
-      {476,474,-1.03e-02},
-      {476,477,-1.03e-02},
-      {476,503,-1.03e-02},
-      {476,504,-1.03e-02},
-      {476,506,-1.03e-02},
-      {477,477,8.29e-02},
-      {477,157,4.84e-05},
-      {477,158,1.93e-04},
-      {477,159,4.84e-05},
-      {477,184,1.93e-04},
-      {477,187,1.93e-04},
-      {477,188,7.74e-04},
-      {477,213,4.84e-05},
-      {477,214,4.84e-05},
-      {477,217,1.93e-04},
-      {477,446,-1.03e-02},
-      {477,447,-1.03e-02},
-      {477,448,-1.03e-02},
-      {477,473,-1.03e-02},
-      {477,476,-1.03e-02},
-      {477,502,-1.03e-02},
-      {477,503,-1.03e-02},
-      {477,506,-1.03e-02},
-      {478,478,8.29e-02},
-      {478,162,4.84e-05},
-      {478,167,4.84e-05},
-      {478,168,1.93e-04},
-      {478,189,7.74e-04},
-      {478,190,1.93e-04},
-      {478,191,1.93e-04},
-      {478,218,4.84e-05},
-      {478,219,1.93e-04},
-      {478,220,4.84e-05},
-      {478,451,-1.03e-02},
-      {478,456,-1.03e-02},
-      {478,457,-1.03e-02},
-      {478,479,-1.03e-02},
-      {478,480,-1.03e-02},
-      {478,507,-1.03e-02},
-      {478,508,-1.03e-02},
-      {478,509,-1.03e-02},
-      {479,479,8.29e-02},
-      {479,162,1.93e-04},
-      {479,163,4.84e-05},
-      {479,168,4.84e-05},
-      {479,189,1.93e-04},
-      {479,190,7.74e-04},
-      {479,195,1.93e-04},
-      {479,219,4.84e-05},
-      {479,220,1.93e-04},
-      {479,224,4.84e-05},
-      {479,451,-1.03e-02},
-      {479,452,-1.03e-02},
-      {479,457,-1.03e-02},
-      {479,478,-1.03e-02},
-      {479,484,-1.03e-02},
-      {479,508,-1.03e-02},
-      {479,509,-1.03e-02},
-      {479,513,-1.03e-02},
-      {480,480,8.29e-02},
-      {480,166,4.84e-05},
-      {480,167,1.93e-04},
-      {480,168,4.84e-05},
-      {480,189,1.93e-04},
-      {480,191,7.74e-04},
-      {480,192,1.93e-04},
-      {480,218,1.93e-04},
-      {480,219,4.84e-05},
-      {480,221,4.84e-05},
-      {480,455,-1.03e-02},
-      {480,456,-1.03e-02},
-      {480,457,-1.03e-02},
-      {480,478,-1.03e-02},
-      {480,481,-1.03e-02},
-      {480,507,-1.03e-02},
-      {480,508,-1.03e-02},
-      {480,510,-1.03e-02},
-      {481,481,8.29e-02},
-      {481,161,4.84e-05},
-      {481,166,1.93e-04},
-      {481,167,4.84e-05},
-      {481,186,1.93e-04},
-      {481,191,1.93e-04},
-      {481,192,7.74e-04},
-      {481,216,4.84e-05},
-      {481,218,4.84e-05},
-      {481,221,1.93e-04},
-      {481,450,-1.03e-02},
-      {481,455,-1.03e-02},
-      {481,456,-1.03e-02},
-      {481,475,-1.03e-02},
-      {481,480,-1.03e-02},
-      {481,505,-1.03e-02},
-      {481,507,-1.03e-02},
-      {481,510,-1.03e-02},
-      {482,482,8.29e-02},
-      {482,145,4.84e-05},
-      {482,164,4.84e-05},
-      {482,165,1.93e-04},
-      {482,170,1.93e-04},
-      {482,193,7.74e-04},
-      {482,194,1.93e-04},
-      {482,197,4.84e-05},
-      {482,222,4.84e-05},
-      {482,223,1.93e-04},
-      {482,434,-1.03e-02},
-      {482,453,-1.03e-02},
-      {482,454,-1.03e-02},
-      {482,459,-1.03e-02},
-      {482,483,-1.03e-02},
-      {482,486,-1.03e-02},
-      {482,511,-1.03e-02},
-      {482,512,-1.03e-02},
-      {483,483,8.29e-02},
-      {483,163,4.84e-05},
-      {483,164,1.93e-04},
-      {483,165,4.84e-05},
-      {483,193,1.93e-04},
-      {483,194,7.74e-04},
-      {483,195,1.93e-04},
-      {483,222,1.93e-04},
-      {483,223,4.84e-05},
-      {483,224,4.84e-05},
-      {483,452,-1.03e-02},
-      {483,453,-1.03e-02},
-      {483,454,-1.03e-02},
-      {483,482,-1.03e-02},
-      {483,484,-1.03e-02},
-      {483,511,-1.03e-02},
-      {483,512,-1.03e-02},
-      {483,513,-1.03e-02},
-      {484,484,8.29e-02},
-      {484,162,4.84e-05},
-      {484,163,1.93e-04},
-      {484,164,4.84e-05},
-      {484,190,1.93e-04},
-      {484,194,1.93e-04},
-      {484,195,7.74e-04},
-      {484,220,4.84e-05},
-      {484,222,4.84e-05},
-      {484,224,1.93e-04},
-      {484,451,-1.03e-02},
-      {484,452,-1.03e-02},
-      {484,453,-1.03e-02},
-      {484,479,-1.03e-02},
-      {484,483,-1.03e-02},
-      {484,509,-1.03e-02},
-      {484,511,-1.03e-02},
-      {484,513,-1.03e-02},
-      {485,485,2.08e-01},
-      {485,169,9.67e-05},
-      {485,171,4.84e-05},
-      {485,196,3.87e-04},
-      {485,198,1.93e-04},
-      {485,225,9.67e-05},
-      {485,227,4.84e-05},
-      {485,458,3.65e-02},
-      {485,460,-1.03e-02},
-      {485,487,-1.03e-02},
-      {485,514,3.65e-02},
-      {485,516,-1.03e-02},
-      {486,486,2.08e-01},
-      {486,170,9.67e-05},
-      {486,193,4.84e-05},
-      {486,197,3.87e-04},
-      {486,223,1.93e-04},
-      {486,226,9.67e-05},
-      {486,255,4.84e-05},
-      {486,459,3.65e-02},
-      {486,482,-1.03e-02},
-      {486,512,-1.03e-02},
-      {486,515,3.65e-02},
-      {486,544,-1.03e-02},
-      {487,487,8.29e-02},
-      {487,169,4.84e-05},
-      {487,171,1.93e-04},
-      {487,172,4.84e-05},
-      {487,196,1.93e-04},
-      {487,198,7.74e-04},
-      {487,199,1.93e-04},
-      {487,225,4.84e-05},
-      {487,227,1.93e-04},
-      {487,228,4.84e-05},
-      {487,458,-1.03e-02},
-      {487,460,-1.03e-02},
-      {487,461,-1.03e-02},
-      {487,485,-1.03e-02},
-      {487,488,-1.03e-02},
-      {487,514,-1.03e-02},
-      {487,516,-1.03e-02},
-      {487,517,-1.03e-02},
-      {488,488,8.29e-02},
-      {488,171,4.84e-05},
-      {488,172,1.93e-04},
-      {488,173,4.84e-05},
-      {488,198,1.93e-04},
-      {488,199,7.74e-04},
-      {488,200,1.93e-04},
-      {488,227,4.84e-05},
-      {488,228,1.93e-04},
-      {488,229,4.84e-05},
-      {488,460,-1.03e-02},
-      {488,461,-1.03e-02},
-      {488,462,-1.03e-02},
-      {488,487,-1.03e-02},
-      {488,489,-1.03e-02},
-      {488,516,-1.03e-02},
-      {488,517,-1.03e-02},
-      {488,518,-1.03e-02},
-      {489,489,8.29e-02},
-      {489,172,4.84e-05},
-      {489,173,1.93e-04},
-      {489,174,4.84e-05},
-      {489,199,1.93e-04},
-      {489,200,7.74e-04},
-      {489,201,1.93e-04},
-      {489,228,4.84e-05},
-      {489,229,1.93e-04},
-      {489,230,4.84e-05},
-      {489,461,-1.03e-02},
-      {489,462,-1.03e-02},
-      {489,463,-1.03e-02},
-      {489,488,-1.03e-02},
-      {489,490,-1.03e-02},
-      {489,517,-1.03e-02},
-      {489,518,-1.03e-02},
-      {489,519,-1.03e-02},
-      {490,490,8.29e-02},
-      {490,173,4.84e-05},
-      {490,174,1.93e-04},
-      {490,175,4.84e-05},
-      {490,200,1.93e-04},
-      {490,201,7.74e-04},
-      {490,202,1.93e-04},
-      {490,229,4.84e-05},
-      {490,230,1.93e-04},
-      {490,231,4.84e-05},
-      {490,462,-1.03e-02},
-      {490,463,-1.03e-02},
-      {490,464,-1.03e-02},
-      {490,489,-1.03e-02},
-      {490,491,-1.03e-02},
-      {490,518,-1.03e-02},
-      {490,519,-1.03e-02},
-      {490,520,-1.03e-02},
-      {491,491,8.29e-02},
-      {491,174,4.84e-05},
-      {491,175,1.93e-04},
-      {491,176,4.84e-05},
-      {491,201,1.93e-04},
-      {491,202,7.74e-04},
-      {491,203,1.93e-04},
-      {491,230,4.84e-05},
-      {491,231,1.93e-04},
-      {491,232,4.84e-05},
-      {491,463,-1.03e-02},
-      {491,464,-1.03e-02},
-      {491,465,-1.03e-02},
-      {491,490,-1.03e-02},
-      {491,492,-1.03e-02},
-      {491,519,-1.03e-02},
-      {491,520,-1.03e-02},
-      {491,521,-1.03e-02},
-      {492,492,8.29e-02},
-      {492,175,4.84e-05},
-      {492,176,1.93e-04},
-      {492,177,4.84e-05},
-      {492,202,1.93e-04},
-      {492,203,7.74e-04},
-      {492,204,1.93e-04},
-      {492,231,4.84e-05},
-      {492,232,1.93e-04},
-      {492,233,4.84e-05},
-      {492,464,-1.03e-02},
-      {492,465,-1.03e-02},
-      {492,466,-1.03e-02},
-      {492,491,-1.03e-02},
-      {492,493,-1.03e-02},
-      {492,520,-1.03e-02},
-      {492,521,-1.03e-02},
-      {492,522,-1.03e-02},
-      {493,493,8.29e-02},
-      {493,176,4.84e-05},
-      {493,177,1.93e-04},
-      {493,178,4.84e-05},
-      {493,203,1.93e-04},
-      {493,204,7.74e-04},
-      {493,205,1.93e-04},
-      {493,232,4.84e-05},
-      {493,233,1.93e-04},
-      {493,234,4.84e-05},
-      {493,465,-1.03e-02},
-      {493,466,-1.03e-02},
-      {493,467,-1.03e-02},
-      {493,492,-1.03e-02},
-      {493,494,-1.03e-02},
-      {493,521,-1.03e-02},
-      {493,522,-1.03e-02},
-      {493,523,-1.03e-02},
-      {494,494,8.29e-02},
-      {494,177,4.84e-05},
-      {494,178,1.93e-04},
-      {494,179,4.84e-05},
-      {494,204,1.93e-04},
-      {494,205,7.74e-04},
-      {494,206,1.93e-04},
-      {494,233,4.84e-05},
-      {494,234,1.93e-04},
-      {494,235,4.84e-05},
-      {494,466,-1.03e-02},
-      {494,467,-1.03e-02},
-      {494,468,-1.03e-02},
-      {494,493,-1.03e-02},
-      {494,495,-1.03e-02},
-      {494,522,-1.03e-02},
-      {494,523,-1.03e-02},
-      {494,524,-1.03e-02},
-      {495,495,8.29e-02},
-      {495,178,4.84e-05},
-      {495,179,1.93e-04},
-      {495,180,4.84e-05},
-      {495,205,1.93e-04},
-      {495,206,7.74e-04},
-      {495,207,1.93e-04},
-      {495,234,4.84e-05},
-      {495,235,1.93e-04},
-      {495,236,4.84e-05},
-      {495,467,-1.03e-02},
-      {495,468,-1.03e-02},
-      {495,469,-1.03e-02},
-      {495,494,-1.03e-02},
-      {495,496,-1.03e-02},
-      {495,523,-1.03e-02},
-      {495,524,-1.03e-02},
-      {495,525,-1.03e-02},
-      {496,496,8.29e-02},
-      {496,179,4.84e-05},
-      {496,180,1.93e-04},
-      {496,181,4.84e-05},
-      {496,206,1.93e-04},
-      {496,207,7.74e-04},
-      {496,208,1.93e-04},
-      {496,235,4.84e-05},
-      {496,236,1.93e-04},
-      {496,237,4.84e-05},
-      {496,468,-1.03e-02},
-      {496,469,-1.03e-02},
-      {496,470,-1.03e-02},
-      {496,495,-1.03e-02},
-      {496,497,-1.03e-02},
-      {496,524,-1.03e-02},
-      {496,525,-1.03e-02},
-      {496,526,-1.03e-02},
-      {497,497,8.29e-02},
-      {497,180,4.84e-05},
-      {497,181,1.93e-04},
-      {497,182,4.84e-05},
-      {497,207,1.93e-04},
-      {497,208,7.74e-04},
-      {497,209,1.93e-04},
-      {497,236,4.84e-05},
-      {497,237,1.93e-04},
-      {497,238,4.84e-05},
-      {497,469,-1.03e-02},
-      {497,470,-1.03e-02},
-      {497,471,-1.03e-02},
-      {497,496,-1.03e-02},
-      {497,498,-1.03e-02},
-      {497,525,-1.03e-02},
-      {497,526,-1.03e-02},
-      {497,527,-1.03e-02},
-      {498,498,8.29e-02},
-      {498,181,4.84e-05},
-      {498,182,1.93e-04},
-      {498,183,4.84e-05},
-      {498,208,1.93e-04},
-      {498,209,7.74e-04},
-      {498,210,1.93e-04},
-      {498,237,4.84e-05},
-      {498,238,1.93e-04},
-      {498,239,4.84e-05},
-      {498,470,-1.03e-02},
-      {498,471,-1.03e-02},
-      {498,472,-1.03e-02},
-      {498,497,-1.03e-02},
-      {498,499,-1.03e-02},
-      {498,526,-1.03e-02},
-      {498,527,-1.03e-02},
-      {498,528,-1.03e-02},
-      {499,499,8.29e-02},
-      {499,182,4.84e-05},
-      {499,183,1.93e-04},
-      {499,209,1.93e-04},
-      {499,210,7.74e-04},
-      {499,211,1.93e-04},
-      {499,212,4.84e-05},
-      {499,238,4.84e-05},
-      {499,239,1.93e-04},
-      {499,240,4.84e-05},
-      {499,471,-1.03e-02},
-      {499,472,-1.03e-02},
-      {499,498,-1.03e-02},
-      {499,500,-1.03e-02},
-      {499,501,-1.03e-02},
-      {499,527,-1.03e-02},
-      {499,528,-1.03e-02},
-      {499,529,-1.03e-02},
-      {500,500,8.29e-02},
-      {500,183,4.84e-05},
-      {500,210,1.93e-04},
-      {500,211,7.74e-04},
-      {500,212,1.93e-04},
-      {500,239,4.84e-05},
-      {500,240,1.93e-04},
-      {500,241,4.84e-05},
-      {500,242,1.93e-04},
-      {500,243,4.84e-05},
-      {500,472,-1.03e-02},
-      {500,499,-1.03e-02},
-      {500,501,-1.03e-02},
-      {500,528,-1.03e-02},
-      {500,529,-1.03e-02},
-      {500,530,-1.03e-02},
-      {500,531,-1.03e-02},
-      {500,532,-1.03e-02},
-      {501,501,8.29e-02},
-      {501,183,1.93e-04},
-      {501,184,4.84e-05},
-      {501,210,4.84e-05},
-      {501,211,1.93e-04},
-      {501,212,7.74e-04},
-      {501,213,1.93e-04},
-      {501,242,4.84e-05},
-      {501,243,1.93e-04},
-      {501,244,4.84e-05},
-      {501,472,-1.03e-02},
-      {501,473,-1.03e-02},
-      {501,499,-1.03e-02},
-      {501,500,-1.03e-02},
-      {501,502,-1.03e-02},
-      {501,531,-1.03e-02},
-      {501,532,-1.03e-02},
-      {501,533,-1.03e-02},
-      {502,502,8.29e-02},
-      {502,183,4.84e-05},
-      {502,184,1.93e-04},
-      {502,188,4.84e-05},
-      {502,212,1.93e-04},
-      {502,213,7.74e-04},
-      {502,217,1.93e-04},
-      {502,243,4.84e-05},
-      {502,244,1.93e-04},
-      {502,245,4.84e-05},
-      {502,472,-1.03e-02},
-      {502,473,-1.03e-02},
-      {502,477,-1.03e-02},
-      {502,501,-1.03e-02},
-      {502,506,-1.03e-02},
-      {502,532,-1.03e-02},
-      {502,533,-1.03e-02},
-      {502,534,-1.03e-02},
-      {503,503,8.29e-02},
-      {503,185,4.84e-05},
-      {503,187,1.93e-04},
-      {503,188,4.84e-05},
-      {503,214,7.74e-04},
-      {503,215,1.93e-04},
-      {503,217,1.93e-04},
-      {503,245,4.84e-05},
-      {503,246,1.93e-04},
-      {503,247,4.84e-05},
-      {503,474,-1.03e-02},
-      {503,476,-1.03e-02},
-      {503,477,-1.03e-02},
-      {503,504,-1.03e-02},
-      {503,506,-1.03e-02},
-      {503,534,-1.03e-02},
-      {503,535,-1.03e-02},
-      {503,536,-1.03e-02},
-      {504,504,8.29e-02},
-      {504,185,1.93e-04},
-      {504,186,4.84e-05},
-      {504,187,4.84e-05},
-      {504,214,1.93e-04},
-      {504,215,7.74e-04},
-      {504,216,1.93e-04},
-      {504,246,4.84e-05},
-      {504,247,1.93e-04},
-      {504,248,4.84e-05},
-      {504,474,-1.03e-02},
-      {504,475,-1.03e-02},
-      {504,476,-1.03e-02},
-      {504,503,-1.03e-02},
-      {504,505,-1.03e-02},
-      {504,535,-1.03e-02},
-      {504,536,-1.03e-02},
-      {504,537,-1.03e-02},
-      {505,505,8.29e-02},
-      {505,185,4.84e-05},
-      {505,186,1.93e-04},
-      {505,192,4.84e-05},
-      {505,215,1.93e-04},
-      {505,216,7.74e-04},
-      {505,221,1.93e-04},
-      {505,247,4.84e-05},
-      {505,248,1.93e-04},
-      {505,249,4.84e-05},
-      {505,474,-1.03e-02},
-      {505,475,-1.03e-02},
-      {505,481,-1.03e-02},
-      {505,504,-1.03e-02},
-      {505,510,-1.03e-02},
-      {505,536,-1.03e-02},
-      {505,537,-1.03e-02},
-      {505,538,-1.03e-02},
-      {506,506,8.29e-02},
-      {506,184,4.84e-05},
-      {506,187,4.84e-05},
-      {506,188,1.93e-04},
-      {506,213,1.93e-04},
-      {506,214,1.93e-04},
-      {506,217,7.74e-04},
-      {506,244,4.84e-05},
-      {506,245,1.93e-04},
-      {506,246,4.84e-05},
-      {506,473,-1.03e-02},
-      {506,476,-1.03e-02},
-      {506,477,-1.03e-02},
-      {506,502,-1.03e-02},
-      {506,503,-1.03e-02},
-      {506,533,-1.03e-02},
-      {506,534,-1.03e-02},
-      {506,535,-1.03e-02},
-      {507,507,8.29e-02},
-      {507,189,4.84e-05},
-      {507,191,1.93e-04},
-      {507,192,4.84e-05},
-      {507,218,7.74e-04},
-      {507,219,1.93e-04},
-      {507,221,1.93e-04},
-      {507,249,4.84e-05},
-      {507,250,1.93e-04},
-      {507,251,4.84e-05},
-      {507,478,-1.03e-02},
-      {507,480,-1.03e-02},
-      {507,481,-1.03e-02},
-      {507,508,-1.03e-02},
-      {507,510,-1.03e-02},
-      {507,538,-1.03e-02},
-      {507,539,-1.03e-02},
-      {507,540,-1.03e-02},
-      {508,508,8.29e-02},
-      {508,189,1.93e-04},
-      {508,190,4.84e-05},
-      {508,191,4.84e-05},
-      {508,218,1.93e-04},
-      {508,219,7.74e-04},
-      {508,220,1.93e-04},
-      {508,250,4.84e-05},
-      {508,251,1.93e-04},
-      {508,252,4.84e-05},
-      {508,478,-1.03e-02},
-      {508,479,-1.03e-02},
-      {508,480,-1.03e-02},
-      {508,507,-1.03e-02},
-      {508,509,-1.03e-02},
-      {508,539,-1.03e-02},
-      {508,540,-1.03e-02},
-      {508,541,-1.03e-02},
-      {509,509,8.29e-02},
-      {509,189,4.84e-05},
-      {509,190,1.93e-04},
-      {509,195,4.84e-05},
-      {509,219,1.93e-04},
-      {509,220,7.74e-04},
-      {509,224,1.93e-04},
-      {509,251,4.84e-05},
-      {509,252,1.93e-04},
-      {509,253,4.84e-05},
-      {509,478,-1.03e-02},
-      {509,479,-1.03e-02},
-      {509,484,-1.03e-02},
-      {509,508,-1.03e-02},
-      {509,513,-1.03e-02},
-      {509,540,-1.03e-02},
-      {509,541,-1.03e-02},
-      {509,542,-1.03e-02},
-      {510,510,8.29e-02},
-      {510,186,4.84e-05},
-      {510,191,4.84e-05},
-      {510,192,1.93e-04},
-      {510,216,1.93e-04},
-      {510,218,1.93e-04},
-      {510,221,7.74e-04},
-      {510,248,4.84e-05},
-      {510,249,1.93e-04},
-      {510,250,4.84e-05},
-      {510,475,-1.03e-02},
-      {510,480,-1.03e-02},
-      {510,481,-1.03e-02},
-      {510,505,-1.03e-02},
-      {510,507,-1.03e-02},
-      {510,537,-1.03e-02},
-      {510,538,-1.03e-02},
-      {510,539,-1.03e-02},
-      {511,511,8.29e-02},
-      {511,193,4.84e-05},
-      {511,194,1.93e-04},
-      {511,195,4.84e-05},
-      {511,222,7.74e-04},
-      {511,223,1.93e-04},
-      {511,224,1.93e-04},
-      {511,253,4.84e-05},
-      {511,254,1.93e-04},
-      {511,255,4.84e-05},
-      {511,482,-1.03e-02},
-      {511,483,-1.03e-02},
-      {511,484,-1.03e-02},
-      {511,512,-1.03e-02},
-      {511,513,-1.03e-02},
-      {511,542,-1.03e-02},
-      {511,543,-1.03e-02},
-      {511,544,-1.03e-02},
-      {512,512,8.29e-02},
-      {512,170,4.84e-05},
-      {512,193,1.93e-04},
-      {512,194,4.84e-05},
-      {512,197,1.93e-04},
-      {512,222,1.93e-04},
-      {512,223,7.74e-04},
-      {512,226,4.84e-05},
-      {512,254,4.84e-05},
-      {512,255,1.93e-04},
-      {512,459,-1.03e-02},
-      {512,482,-1.03e-02},
-      {512,483,-1.03e-02},
-      {512,486,-1.03e-02},
-      {512,511,-1.03e-02},
-      {512,515,-1.03e-02},
-      {512,543,-1.03e-02},
-      {512,544,-1.03e-02},
-      {513,513,8.29e-02},
-      {513,190,4.84e-05},
-      {513,194,4.84e-05},
-      {513,195,1.93e-04},
-      {513,220,1.93e-04},
-      {513,222,1.93e-04},
-      {513,224,7.74e-04},
-      {513,252,4.84e-05},
-      {513,253,1.93e-04},
-      {513,254,4.84e-05},
-      {513,479,-1.03e-02},
-      {513,483,-1.03e-02},
-      {513,484,-1.03e-02},
-      {513,509,-1.03e-02},
-      {513,511,-1.03e-02},
-      {513,541,-1.03e-02},
-      {513,542,-1.03e-02},
-      {513,543,-1.03e-02},
-      {514,514,2.08e-01},
-      {514,196,9.67e-05},
-      {514,198,4.84e-05},
-      {514,225,3.87e-04},
-      {514,227,1.93e-04},
-      {514,256,9.67e-05},
-      {514,259,4.84e-05},
-      {514,485,3.65e-02},
-      {514,487,-1.03e-02},
-      {514,516,-1.03e-02},
-      {514,545,3.65e-02},
-      {514,548,-1.03e-02},
-      {515,515,2.08e-01},
-      {515,197,9.67e-05},
-      {515,223,4.84e-05},
-      {515,226,3.87e-04},
-      {515,255,1.93e-04},
-      {515,258,9.67e-05},
-      {515,288,4.84e-05},
-      {515,486,3.65e-02},
-      {515,512,-1.03e-02},
-      {515,544,-1.03e-02},
-      {515,547,3.65e-02},
-      {515,577,-1.03e-02},
-      {516,516,8.29e-02},
-      {516,196,4.84e-05},
-      {516,198,1.93e-04},
-      {516,199,4.84e-05},
-      {516,225,1.93e-04},
-      {516,227,7.74e-04},
-      {516,228,1.93e-04},
-      {516,256,4.84e-05},
-      {516,259,1.93e-04},
-      {516,260,4.84e-05},
-      {516,485,-1.03e-02},
-      {516,487,-1.03e-02},
-      {516,488,-1.03e-02},
-      {516,514,-1.03e-02},
-      {516,517,-1.03e-02},
-      {516,545,-1.03e-02},
-      {516,548,-1.03e-02},
-      {516,549,-1.03e-02},
-      {517,517,8.29e-02},
-      {517,198,4.84e-05},
-      {517,199,1.93e-04},
-      {517,200,4.84e-05},
-      {517,227,1.93e-04},
-      {517,228,7.74e-04},
-      {517,229,1.93e-04},
-      {517,259,4.84e-05},
-      {517,260,1.93e-04},
-      {517,261,4.84e-05},
-      {517,487,-1.03e-02},
-      {517,488,-1.03e-02},
-      {517,489,-1.03e-02},
-      {517,516,-1.03e-02},
-      {517,518,-1.03e-02},
-      {517,548,-1.03e-02},
-      {517,549,-1.03e-02},
-      {517,550,-1.03e-02},
-      {518,518,8.29e-02},
-      {518,199,4.84e-05},
-      {518,200,1.93e-04},
-      {518,201,4.84e-05},
-      {518,228,1.93e-04},
-      {518,229,7.74e-04},
-      {518,230,1.93e-04},
-      {518,260,4.84e-05},
-      {518,261,1.93e-04},
-      {518,262,4.84e-05},
-      {518,488,-1.03e-02},
-      {518,489,-1.03e-02},
-      {518,490,-1.03e-02},
-      {518,517,-1.03e-02},
-      {518,519,-1.03e-02},
-      {518,549,-1.03e-02},
-      {518,550,-1.03e-02},
-      {518,551,-1.03e-02},
-      {519,519,8.29e-02},
-      {519,200,4.84e-05},
-      {519,201,1.93e-04},
-      {519,202,4.84e-05},
-      {519,229,1.93e-04},
-      {519,230,7.74e-04},
-      {519,231,1.93e-04},
-      {519,261,4.84e-05},
-      {519,262,1.93e-04},
-      {519,263,4.84e-05},
-      {519,489,-1.03e-02},
-      {519,490,-1.03e-02},
-      {519,491,-1.03e-02},
-      {519,518,-1.03e-02},
-      {519,520,-1.03e-02},
-      {519,550,-1.03e-02},
-      {519,551,-1.03e-02},
-      {519,552,-1.03e-02},
-      {520,520,8.29e-02},
-      {520,201,4.84e-05},
-      {520,202,1.93e-04},
-      {520,203,4.84e-05},
-      {520,230,1.93e-04},
-      {520,231,7.74e-04},
-      {520,232,1.93e-04},
-      {520,262,4.84e-05},
-      {520,263,1.93e-04},
-      {520,264,4.84e-05},
-      {520,490,-1.03e-02},
-      {520,491,-1.03e-02},
-      {520,492,-1.03e-02},
-      {520,519,-1.03e-02},
-      {520,521,-1.03e-02},
-      {520,551,-1.03e-02},
-      {520,552,-1.03e-02},
-      {520,553,-1.03e-02},
-      {521,521,8.29e-02},
-      {521,202,4.84e-05},
-      {521,203,1.93e-04},
-      {521,204,4.84e-05},
-      {521,231,1.93e-04},
-      {521,232,7.74e-04},
-      {521,233,1.93e-04},
-      {521,263,4.84e-05},
-      {521,264,1.93e-04},
-      {521,265,4.84e-05},
-      {521,491,-1.03e-02},
-      {521,492,-1.03e-02},
-      {521,493,-1.03e-02},
-      {521,520,-1.03e-02},
-      {521,522,-1.03e-02},
-      {521,552,-1.03e-02},
-      {521,553,-1.03e-02},
-      {521,554,-1.03e-02},
-      {522,522,8.29e-02},
-      {522,203,4.84e-05},
-      {522,204,1.93e-04},
-      {522,205,4.84e-05},
-      {522,232,1.93e-04},
-      {522,233,7.74e-04},
-      {522,234,1.93e-04},
-      {522,264,4.84e-05},
-      {522,265,1.93e-04},
-      {522,266,4.84e-05},
-      {522,492,-1.03e-02},
-      {522,493,-1.03e-02},
-      {522,494,-1.03e-02},
-      {522,521,-1.03e-02},
-      {522,523,-1.03e-02},
-      {522,553,-1.03e-02},
-      {522,554,-1.03e-02},
-      {522,555,-1.03e-02},
-      {523,523,8.29e-02},
-      {523,204,4.84e-05},
-      {523,205,1.93e-04},
-      {523,206,4.84e-05},
-      {523,233,1.93e-04},
-      {523,234,7.74e-04},
-      {523,235,1.93e-04},
-      {523,265,4.84e-05},
-      {523,266,1.93e-04},
-      {523,267,4.84e-05},
-      {523,493,-1.03e-02},
-      {523,494,-1.03e-02},
-      {523,495,-1.03e-02},
-      {523,522,-1.03e-02},
-      {523,524,-1.03e-02},
-      {523,554,-1.03e-02},
-      {523,555,-1.03e-02},
-      {523,556,-1.03e-02},
-      {524,524,8.29e-02},
-      {524,205,4.84e-05},
-      {524,206,1.93e-04},
-      {524,207,4.84e-05},
-      {524,234,1.93e-04},
-      {524,235,7.74e-04},
-      {524,236,1.93e-04},
-      {524,266,4.84e-05},
-      {524,267,1.93e-04},
-      {524,268,4.84e-05},
-      {524,494,-1.03e-02},
-      {524,495,-1.03e-02},
-      {524,496,-1.03e-02},
-      {524,523,-1.03e-02},
-      {524,525,-1.03e-02},
-      {524,555,-1.03e-02},
-      {524,556,-1.03e-02},
-      {524,557,-1.03e-02},
-      {525,525,8.29e-02},
-      {525,206,4.84e-05},
-      {525,207,1.93e-04},
-      {525,208,4.84e-05},
-      {525,235,1.93e-04},
-      {525,236,7.74e-04},
-      {525,237,1.93e-04},
-      {525,267,4.84e-05},
-      {525,268,1.93e-04},
-      {525,269,4.84e-05},
-      {525,495,-1.03e-02},
-      {525,496,-1.03e-02},
-      {525,497,-1.03e-02},
-      {525,524,-1.03e-02},
-      {525,526,-1.03e-02},
-      {525,556,-1.03e-02},
-      {525,557,-1.03e-02},
-      {525,558,-1.03e-02},
-      {526,526,8.29e-02},
-      {526,207,4.84e-05},
-      {526,208,1.93e-04},
-      {526,209,4.84e-05},
-      {526,236,1.93e-04},
-      {526,237,7.74e-04},
-      {526,238,1.93e-04},
-      {526,268,4.84e-05},
-      {526,269,1.93e-04},
-      {526,270,4.84e-05},
-      {526,496,-1.03e-02},
-      {526,497,-1.03e-02},
-      {526,498,-1.03e-02},
-      {526,525,-1.03e-02},
-      {526,527,-1.03e-02},
-      {526,557,-1.03e-02},
-      {526,558,-1.03e-02},
-      {526,559,-1.03e-02},
-      {527,527,8.29e-02},
-      {527,208,4.84e-05},
-      {527,209,1.93e-04},
-      {527,210,4.84e-05},
-      {527,237,1.93e-04},
-      {527,238,7.74e-04},
-      {527,239,1.93e-04},
-      {527,269,4.84e-05},
-      {527,270,1.93e-04},
-      {527,271,4.84e-05},
-      {527,497,-1.03e-02},
-      {527,498,-1.03e-02},
-      {527,499,-1.03e-02},
-      {527,526,-1.03e-02},
-      {527,528,-1.03e-02},
-      {527,558,-1.03e-02},
-      {527,559,-1.03e-02},
-      {527,560,-1.03e-02},
-      {528,528,8.29e-02},
-      {528,209,4.84e-05},
-      {528,210,1.93e-04},
-      {528,211,4.84e-05},
-      {528,238,1.93e-04},
-      {528,239,7.74e-04},
-      {528,240,1.93e-04},
-      {528,270,4.84e-05},
-      {528,271,1.93e-04},
-      {528,272,4.84e-05},
-      {528,498,-1.03e-02},
-      {528,499,-1.03e-02},
-      {528,500,-1.03e-02},
-      {528,527,-1.03e-02},
-      {528,529,-1.03e-02},
-      {528,559,-1.03e-02},
-      {528,560,-1.03e-02},
-      {528,561,-1.03e-02},
-      {529,529,8.29e-02},
-      {529,210,4.84e-05},
-      {529,211,1.93e-04},
-      {529,239,1.93e-04},
-      {529,240,7.74e-04},
-      {529,241,1.93e-04},
-      {529,242,4.84e-05},
-      {529,271,4.84e-05},
-      {529,272,1.93e-04},
-      {529,273,4.84e-05},
-      {529,499,-1.03e-02},
-      {529,500,-1.03e-02},
-      {529,528,-1.03e-02},
-      {529,530,-1.03e-02},
-      {529,531,-1.03e-02},
-      {529,560,-1.03e-02},
-      {529,561,-1.03e-02},
-      {529,562,-1.03e-02},
-      {530,530,8.29e-02},
-      {530,211,4.84e-05},
-      {530,240,1.93e-04},
-      {530,241,7.74e-04},
-      {530,242,1.93e-04},
-      {530,257,4.84e-05},
-      {530,272,4.84e-05},
-      {530,273,1.93e-04},
-      {530,274,1.93e-04},
-      {530,275,4.84e-05},
-      {530,500,-1.03e-02},
-      {530,529,-1.03e-02},
-      {530,531,-1.03e-02},
-      {530,546,-1.03e-02},
-      {530,561,-1.03e-02},
-      {530,562,-1.03e-02},
-      {530,563,-1.03e-02},
-      {530,564,-1.03e-02},
-      {531,531,8.29e-02},
-      {531,211,1.93e-04},
-      {531,212,4.84e-05},
-      {531,240,4.84e-05},
-      {531,241,1.93e-04},
-      {531,242,7.74e-04},
-      {531,243,1.93e-04},
-      {531,274,4.84e-05},
-      {531,275,1.93e-04},
-      {531,276,4.84e-05},
-      {531,500,-1.03e-02},
-      {531,501,-1.03e-02},
-      {531,529,-1.03e-02},
-      {531,530,-1.03e-02},
-      {531,532,-1.03e-02},
-      {531,563,-1.03e-02},
-      {531,564,-1.03e-02},
-      {531,565,-1.03e-02},
-      {532,532,8.29e-02},
-      {532,211,4.84e-05},
-      {532,212,1.93e-04},
-      {532,213,4.84e-05},
-      {532,242,1.93e-04},
-      {532,243,7.74e-04},
-      {532,244,1.93e-04},
-      {532,275,4.84e-05},
-      {532,276,1.93e-04},
-      {532,277,4.84e-05},
-      {532,500,-1.03e-02},
-      {532,501,-1.03e-02},
-      {532,502,-1.03e-02},
-      {532,531,-1.03e-02},
-      {532,533,-1.03e-02},
-      {532,564,-1.03e-02},
-      {532,565,-1.03e-02},
-      {532,566,-1.03e-02},
-      {533,533,8.29e-02},
-      {533,212,4.84e-05},
-      {533,213,1.93e-04},
-      {533,217,4.84e-05},
-      {533,243,1.93e-04},
-      {533,244,7.74e-04},
-      {533,245,1.93e-04},
-      {533,276,4.84e-05},
-      {533,277,1.93e-04},
-      {533,278,4.84e-05},
-      {533,501,-1.03e-02},
-      {533,502,-1.03e-02},
-      {533,506,-1.03e-02},
-      {533,532,-1.03e-02},
-      {533,534,-1.03e-02},
-      {533,565,-1.03e-02},
-      {533,566,-1.03e-02},
-      {533,567,-1.03e-02},
-      {534,534,8.29e-02},
-      {534,213,4.84e-05},
-      {534,214,4.84e-05},
-      {534,217,1.93e-04},
-      {534,244,1.93e-04},
-      {534,245,7.74e-04},
-      {534,246,1.93e-04},
-      {534,277,4.84e-05},
-      {534,278,1.93e-04},
-      {534,279,4.84e-05},
-      {534,502,-1.03e-02},
-      {534,503,-1.03e-02},
-      {534,506,-1.03e-02},
-      {534,533,-1.03e-02},
-      {534,535,-1.03e-02},
-      {534,566,-1.03e-02},
-      {534,567,-1.03e-02},
-      {534,568,-1.03e-02},
-      {535,535,8.29e-02},
-      {535,214,1.93e-04},
-      {535,215,4.84e-05},
-      {535,217,4.84e-05},
-      {535,245,1.93e-04},
-      {535,246,7.74e-04},
-      {535,247,1.93e-04},
-      {535,278,4.84e-05},
-      {535,279,1.93e-04},
-      {535,280,4.84e-05},
-      {535,503,-1.03e-02},
-      {535,504,-1.03e-02},
-      {535,506,-1.03e-02},
-      {535,534,-1.03e-02},
-      {535,536,-1.03e-02},
-      {535,567,-1.03e-02},
-      {535,568,-1.03e-02},
-      {535,569,-1.03e-02},
-      {536,536,8.29e-02},
-      {536,214,4.84e-05},
-      {536,215,1.93e-04},
-      {536,216,4.84e-05},
-      {536,246,1.93e-04},
-      {536,247,7.74e-04},
-      {536,248,1.93e-04},
-      {536,279,4.84e-05},
-      {536,280,1.93e-04},
-      {536,281,4.84e-05},
-      {536,503,-1.03e-02},
-      {536,504,-1.03e-02},
-      {536,505,-1.03e-02},
-      {536,535,-1.03e-02},
-      {536,537,-1.03e-02},
-      {536,568,-1.03e-02},
-      {536,569,-1.03e-02},
-      {536,570,-1.03e-02},
-      {537,537,8.29e-02},
-      {537,215,4.84e-05},
-      {537,216,1.93e-04},
-      {537,221,4.84e-05},
-      {537,247,1.93e-04},
-      {537,248,7.74e-04},
-      {537,249,1.93e-04},
-      {537,280,4.84e-05},
-      {537,281,1.93e-04},
-      {537,282,4.84e-05},
-      {537,504,-1.03e-02},
-      {537,505,-1.03e-02},
-      {537,510,-1.03e-02},
-      {537,536,-1.03e-02},
-      {537,538,-1.03e-02},
-      {537,569,-1.03e-02},
-      {537,570,-1.03e-02},
-      {537,571,-1.03e-02},
-      {538,538,8.29e-02},
-      {538,216,4.84e-05},
-      {538,218,4.84e-05},
-      {538,221,1.93e-04},
-      {538,248,1.93e-04},
-      {538,249,7.74e-04},
-      {538,250,1.93e-04},
-      {538,281,4.84e-05},
-      {538,282,1.93e-04},
-      {538,283,4.84e-05},
-      {538,505,-1.03e-02},
-      {538,507,-1.03e-02},
-      {538,510,-1.03e-02},
-      {538,537,-1.03e-02},
-      {538,539,-1.03e-02},
-      {538,570,-1.03e-02},
-      {538,571,-1.03e-02},
-      {538,572,-1.03e-02},
-      {539,539,8.29e-02},
-      {539,218,1.93e-04},
-      {539,219,4.84e-05},
-      {539,221,4.84e-05},
-      {539,249,1.93e-04},
-      {539,250,7.74e-04},
-      {539,251,1.93e-04},
-      {539,282,4.84e-05},
-      {539,283,1.93e-04},
-      {539,284,4.84e-05},
-      {539,507,-1.03e-02},
-      {539,508,-1.03e-02},
-      {539,510,-1.03e-02},
-      {539,538,-1.03e-02},
-      {539,540,-1.03e-02},
-      {539,571,-1.03e-02},
-      {539,572,-1.03e-02},
-      {539,573,-1.03e-02},
-      {540,540,8.29e-02},
-      {540,218,4.84e-05},
-      {540,219,1.93e-04},
-      {540,220,4.84e-05},
-      {540,250,1.93e-04},
-      {540,251,7.74e-04},
-      {540,252,1.93e-04},
-      {540,283,4.84e-05},
-      {540,284,1.93e-04},
-      {540,285,4.84e-05},
-      {540,507,-1.03e-02},
-      {540,508,-1.03e-02},
-      {540,509,-1.03e-02},
-      {540,539,-1.03e-02},
-      {540,541,-1.03e-02},
-      {540,572,-1.03e-02},
-      {540,573,-1.03e-02},
-      {540,574,-1.03e-02},
-      {541,541,8.29e-02},
-      {541,219,4.84e-05},
-      {541,220,1.93e-04},
-      {541,224,4.84e-05},
-      {541,251,1.93e-04},
-      {541,252,7.74e-04},
-      {541,253,1.93e-04},
-      {541,284,4.84e-05},
-      {541,285,1.93e-04},
-      {541,286,4.84e-05},
-      {541,508,-1.03e-02},
-      {541,509,-1.03e-02},
-      {541,513,-1.03e-02},
-      {541,540,-1.03e-02},
-      {541,542,-1.03e-02},
-      {541,573,-1.03e-02},
-      {541,574,-1.03e-02},
-      {541,575,-1.03e-02},
-      {542,542,8.29e-02},
-      {542,220,4.84e-05},
-      {542,222,4.84e-05},
-      {542,224,1.93e-04},
-      {542,252,1.93e-04},
-      {542,253,7.74e-04},
-      {542,254,1.93e-04},
-      {542,285,4.84e-05},
-      {542,286,1.93e-04},
-      {542,287,4.84e-05},
-      {542,509,-1.03e-02},
-      {542,511,-1.03e-02},
-      {542,513,-1.03e-02},
-      {542,541,-1.03e-02},
-      {542,543,-1.03e-02},
-      {542,574,-1.03e-02},
-      {542,575,-1.03e-02},
-      {542,576,-1.03e-02},
-      {543,543,8.29e-02},
-      {543,222,1.93e-04},
-      {543,223,4.84e-05},
-      {543,224,4.84e-05},
-      {543,253,1.93e-04},
-      {543,254,7.74e-04},
-      {543,255,1.93e-04},
-      {543,286,4.84e-05},
-      {543,287,1.93e-04},
-      {543,288,4.84e-05},
-      {543,511,-1.03e-02},
-      {543,512,-1.03e-02},
-      {543,513,-1.03e-02},
-      {543,542,-1.03e-02},
-      {543,544,-1.03e-02},
-      {543,575,-1.03e-02},
-      {543,576,-1.03e-02},
-      {543,577,-1.03e-02},
-      {544,544,8.29e-02},
-      {544,197,4.84e-05},
-      {544,222,4.84e-05},
-      {544,223,1.93e-04},
-      {544,226,1.93e-04},
-      {544,254,1.93e-04},
-      {544,255,7.74e-04},
-      {544,258,4.84e-05},
-      {544,287,4.84e-05},
-      {544,288,1.93e-04},
-      {544,486,-1.03e-02},
-      {544,511,-1.03e-02},
-      {544,512,-1.03e-02},
-      {544,515,-1.03e-02},
-      {544,543,-1.03e-02},
-      {544,547,-1.03e-02},
-      {544,576,-1.03e-02},
-      {544,577,-1.03e-02},
-      {545,545,1.87e-01},
-      {545,225,9.67e-05},
-      {545,227,4.84e-05},
-      {545,256,1.93e-04},
-      {545,259,9.67e-05},
-      {545,514,3.65e-02},
-      {545,516,-1.03e-02},
-      {545,548,3.65e-02},
-      {546,546,1.87e-01},
-      {546,241,4.84e-05},
-      {546,257,1.93e-04},
-      {546,273,9.67e-05},
-      {546,274,9.67e-05},
-      {546,530,-1.03e-02},
-      {546,562,3.65e-02},
-      {546,563,3.65e-02},
-      {547,547,1.87e-01},
-      {547,226,9.67e-05},
-      {547,255,4.84e-05},
-      {547,258,1.93e-04},
-      {547,288,9.67e-05},
-      {547,515,3.65e-02},
-      {547,544,-1.03e-02},
-      {547,577,3.65e-02},
-      {548,548,2.08e-01},
-      {548,225,4.84e-05},
-      {548,227,1.93e-04},
-      {548,228,4.84e-05},
-      {548,256,9.67e-05},
-      {548,259,3.87e-04},
-      {548,260,9.67e-05},
-      {548,514,-1.03e-02},
-      {548,516,-1.03e-02},
-      {548,517,-1.03e-02},
-      {548,545,3.65e-02},
-      {548,549,3.65e-02},
-      {549,549,2.08e-01},
-      {549,227,4.84e-05},
-      {549,228,1.93e-04},
-      {549,229,4.84e-05},
-      {549,259,9.67e-05},
-      {549,260,3.87e-04},
-      {549,261,9.67e-05},
-      {549,516,-1.03e-02},
-      {549,517,-1.03e-02},
-      {549,518,-1.03e-02},
-      {549,548,3.65e-02},
-      {549,550,3.65e-02},
-      {550,550,2.08e-01},
-      {550,228,4.84e-05},
-      {550,229,1.93e-04},
-      {550,230,4.84e-05},
-      {550,260,9.67e-05},
-      {550,261,3.87e-04},
-      {550,262,9.67e-05},
-      {550,517,-1.03e-02},
-      {550,518,-1.03e-02},
-      {550,519,-1.03e-02},
-      {550,549,3.65e-02},
-      {550,551,3.65e-02},
-      {551,551,2.08e-01},
-      {551,229,4.84e-05},
-      {551,230,1.93e-04},
-      {551,231,4.84e-05},
-      {551,261,9.67e-05},
-      {551,262,3.87e-04},
-      {551,263,9.67e-05},
-      {551,518,-1.03e-02},
-      {551,519,-1.03e-02},
-      {551,520,-1.03e-02},
-      {551,550,3.65e-02},
-      {551,552,3.65e-02},
-      {552,552,2.08e-01},
-      {552,230,4.84e-05},
-      {552,231,1.93e-04},
-      {552,232,4.84e-05},
-      {552,262,9.67e-05},
-      {552,263,3.87e-04},
-      {552,264,9.67e-05},
-      {552,519,-1.03e-02},
-      {552,520,-1.03e-02},
-      {552,521,-1.03e-02},
-      {552,551,3.65e-02},
-      {552,553,3.65e-02},
-      {553,553,2.08e-01},
-      {553,231,4.84e-05},
-      {553,232,1.93e-04},
-      {553,233,4.84e-05},
-      {553,263,9.67e-05},
-      {553,264,3.87e-04},
-      {553,265,9.67e-05},
-      {553,520,-1.03e-02},
-      {553,521,-1.03e-02},
-      {553,522,-1.03e-02},
-      {553,552,3.65e-02},
-      {553,554,3.65e-02},
-      {554,554,2.08e-01},
-      {554,232,4.84e-05},
-      {554,233,1.93e-04},
-      {554,234,4.84e-05},
-      {554,264,9.67e-05},
-      {554,265,3.87e-04},
-      {554,266,9.67e-05},
-      {554,521,-1.03e-02},
-      {554,522,-1.03e-02},
-      {554,523,-1.03e-02},
-      {554,553,3.65e-02},
-      {554,555,3.65e-02},
-      {555,555,2.08e-01},
-      {555,233,4.84e-05},
-      {555,234,1.93e-04},
-      {555,235,4.84e-05},
-      {555,265,9.67e-05},
-      {555,266,3.87e-04},
-      {555,267,9.67e-05},
-      {555,522,-1.03e-02},
-      {555,523,-1.03e-02},
-      {555,524,-1.03e-02},
-      {555,554,3.65e-02},
-      {555,556,3.65e-02},
-      {556,556,2.08e-01},
-      {556,234,4.84e-05},
-      {556,235,1.93e-04},
-      {556,236,4.84e-05},
-      {556,266,9.67e-05},
-      {556,267,3.87e-04},
-      {556,268,9.67e-05},
-      {556,523,-1.03e-02},
-      {556,524,-1.03e-02},
-      {556,525,-1.03e-02},
-      {556,555,3.65e-02},
-      {556,557,3.65e-02},
-      {557,557,2.08e-01},
-      {557,235,4.84e-05},
-      {557,236,1.93e-04},
-      {557,237,4.84e-05},
-      {557,267,9.67e-05},
-      {557,268,3.87e-04},
-      {557,269,9.67e-05},
-      {557,524,-1.03e-02},
-      {557,525,-1.03e-02},
-      {557,526,-1.03e-02},
-      {557,556,3.65e-02},
-      {557,558,3.65e-02},
-      {558,558,2.08e-01},
-      {558,236,4.84e-05},
-      {558,237,1.93e-04},
-      {558,238,4.84e-05},
-      {558,268,9.67e-05},
-      {558,269,3.87e-04},
-      {558,270,9.67e-05},
-      {558,525,-1.03e-02},
-      {558,526,-1.03e-02},
-      {558,527,-1.03e-02},
-      {558,557,3.65e-02},
-      {558,559,3.65e-02},
-      {559,559,2.08e-01},
-      {559,237,4.84e-05},
-      {559,238,1.93e-04},
-      {559,239,4.84e-05},
-      {559,269,9.67e-05},
-      {559,270,3.87e-04},
-      {559,271,9.67e-05},
-      {559,526,-1.03e-02},
-      {559,527,-1.03e-02},
-      {559,528,-1.03e-02},
-      {559,558,3.65e-02},
-      {559,560,3.65e-02},
-      {560,560,2.08e-01},
-      {560,238,4.84e-05},
-      {560,239,1.93e-04},
-      {560,240,4.84e-05},
-      {560,270,9.67e-05},
-      {560,271,3.87e-04},
-      {560,272,9.67e-05},
-      {560,527,-1.03e-02},
-      {560,528,-1.03e-02},
-      {560,529,-1.03e-02},
-      {560,559,3.65e-02},
-      {560,561,3.65e-02},
-      {561,561,2.08e-01},
-      {561,239,4.84e-05},
-      {561,240,1.93e-04},
-      {561,241,4.84e-05},
-      {561,271,9.67e-05},
-      {561,272,3.87e-04},
-      {561,273,9.67e-05},
-      {561,528,-1.03e-02},
-      {561,529,-1.03e-02},
-      {561,530,-1.03e-02},
-      {561,560,3.65e-02},
-      {561,562,3.65e-02},
-      {562,562,2.08e-01},
-      {562,240,4.84e-05},
-      {562,241,1.93e-04},
-      {562,257,9.67e-05},
-      {562,272,9.67e-05},
-      {562,273,3.87e-04},
-      {562,274,4.84e-05},
-      {562,529,-1.03e-02},
-      {562,530,-1.03e-02},
-      {562,546,3.65e-02},
-      {562,561,3.65e-02},
-      {562,563,-1.03e-02},
-      {563,563,2.08e-01},
-      {563,241,1.93e-04},
-      {563,242,4.84e-05},
-      {563,257,9.67e-05},
-      {563,273,4.84e-05},
-      {563,274,3.87e-04},
-      {563,275,9.67e-05},
-      {563,530,-1.03e-02},
-      {563,531,-1.03e-02},
-      {563,546,3.65e-02},
-      {563,562,-1.03e-02},
-      {563,564,3.65e-02},
-      {564,564,2.08e-01},
-      {564,241,4.84e-05},
-      {564,242,1.93e-04},
-      {564,243,4.84e-05},
-      {564,274,9.67e-05},
-      {564,275,3.87e-04},
-      {564,276,9.67e-05},
-      {564,530,-1.03e-02},
-      {564,531,-1.03e-02},
-      {564,532,-1.03e-02},
-      {564,563,3.65e-02},
-      {564,565,3.65e-02},
-      {565,565,2.08e-01},
-      {565,242,4.84e-05},
-      {565,243,1.93e-04},
-      {565,244,4.84e-05},
-      {565,275,9.67e-05},
-      {565,276,3.87e-04},
-      {565,277,9.67e-05},
-      {565,531,-1.03e-02},
-      {565,532,-1.03e-02},
-      {565,533,-1.03e-02},
-      {565,564,3.65e-02},
-      {565,566,3.65e-02},
-      {566,566,2.08e-01},
-      {566,243,4.84e-05},
-      {566,244,1.93e-04},
-      {566,245,4.84e-05},
-      {566,276,9.67e-05},
-      {566,277,3.87e-04},
-      {566,278,9.67e-05},
-      {566,532,-1.03e-02},
-      {566,533,-1.03e-02},
-      {566,534,-1.03e-02},
-      {566,565,3.65e-02},
-      {566,567,3.65e-02},
-      {567,567,2.08e-01},
-      {567,244,4.84e-05},
-      {567,245,1.93e-04},
-      {567,246,4.84e-05},
-      {567,277,9.67e-05},
-      {567,278,3.87e-04},
-      {567,279,9.67e-05},
-      {567,533,-1.03e-02},
-      {567,534,-1.03e-02},
-      {567,535,-1.03e-02},
-      {567,566,3.65e-02},
-      {567,568,3.65e-02},
-      {568,568,2.08e-01},
-      {568,245,4.84e-05},
-      {568,246,1.93e-04},
-      {568,247,4.84e-05},
-      {568,278,9.67e-05},
-      {568,279,3.87e-04},
-      {568,280,9.67e-05},
-      {568,534,-1.03e-02},
-      {568,535,-1.03e-02},
-      {568,536,-1.03e-02},
-      {568,567,3.65e-02},
-      {568,569,3.65e-02},
-      {569,569,2.08e-01},
-      {569,246,4.84e-05},
-      {569,247,1.93e-04},
-      {569,248,4.84e-05},
-      {569,279,9.67e-05},
-      {569,280,3.87e-04},
-      {569,281,9.67e-05},
-      {569,535,-1.03e-02},
-      {569,536,-1.03e-02},
-      {569,537,-1.03e-02},
-      {569,568,3.65e-02},
-      {569,570,3.65e-02},
-      {570,570,2.08e-01},
-      {570,247,4.84e-05},
-      {570,248,1.93e-04},
-      {570,249,4.84e-05},
-      {570,280,9.67e-05},
-      {570,281,3.87e-04},
-      {570,282,9.67e-05},
-      {570,536,-1.03e-02},
-      {570,537,-1.03e-02},
-      {570,538,-1.03e-02},
-      {570,569,3.65e-02},
-      {570,571,3.65e-02},
-      {571,571,2.08e-01},
-      {571,248,4.84e-05},
-      {571,249,1.93e-04},
-      {571,250,4.84e-05},
-      {571,281,9.67e-05},
-      {571,282,3.87e-04},
-      {571,283,9.67e-05},
-      {571,537,-1.03e-02},
-      {571,538,-1.03e-02},
-      {571,539,-1.03e-02},
-      {571,570,3.65e-02},
-      {571,572,3.65e-02},
-      {572,572,2.08e-01},
-      {572,249,4.84e-05},
-      {572,250,1.93e-04},
-      {572,251,4.84e-05},
-      {572,282,9.67e-05},
-      {572,283,3.87e-04},
-      {572,284,9.67e-05},
-      {572,538,-1.03e-02},
-      {572,539,-1.03e-02},
-      {572,540,-1.03e-02},
-      {572,571,3.65e-02},
-      {572,573,3.65e-02},
-      {573,573,2.08e-01},
-      {573,250,4.84e-05},
-      {573,251,1.93e-04},
-      {573,252,4.84e-05},
-      {573,283,9.67e-05},
-      {573,284,3.87e-04},
-      {573,285,9.67e-05},
-      {573,539,-1.03e-02},
-      {573,540,-1.03e-02},
-      {573,541,-1.03e-02},
-      {573,572,3.65e-02},
-      {573,574,3.65e-02},
-      {574,574,2.08e-01},
-      {574,251,4.84e-05},
-      {574,252,1.93e-04},
-      {574,253,4.84e-05},
-      {574,284,9.67e-05},
-      {574,285,3.87e-04},
-      {574,286,9.67e-05},
-      {574,540,-1.03e-02},
-      {574,541,-1.03e-02},
-      {574,542,-1.03e-02},
-      {574,573,3.65e-02},
-      {574,575,3.65e-02},
-      {575,575,2.08e-01},
-      {575,252,4.84e-05},
-      {575,253,1.93e-04},
-      {575,254,4.84e-05},
-      {575,285,9.67e-05},
-      {575,286,3.87e-04},
-      {575,287,9.67e-05},
-      {575,541,-1.03e-02},
-      {575,542,-1.03e-02},
-      {575,543,-1.03e-02},
-      {575,574,3.65e-02},
-      {575,576,3.65e-02},
-      {576,576,2.08e-01},
-      {576,253,4.84e-05},
-      {576,254,1.93e-04},
-      {576,255,4.84e-05},
-      {576,286,9.67e-05},
-      {576,287,3.87e-04},
-      {576,288,9.67e-05},
-      {576,542,-1.03e-02},
-      {576,543,-1.03e-02},
-      {576,544,-1.03e-02},
-      {576,575,3.65e-02},
-      {576,577,3.65e-02},
-      {577,577,2.08e-01},
-      {577,226,4.84e-05},
-      {577,254,4.84e-05},
-      {577,255,1.93e-04},
-      {577,258,9.67e-05},
-      {577,287,9.67e-05},
-      {577,288,3.87e-04},
-      {577,515,-1.03e-02},
-      {577,543,-1.03e-02},
-      {577,544,-1.03e-02},
-      {577,547,3.65e-02},
-      {577,576,3.65e-02}};
+  {0,0,1.87e-01},
+  {0,1,3.65e-02},
+  {0,2,3.65e-02},
+  {0,3,-1.03e-02},
+  {0,289,-1.93e-04},
+  {0,290,-9.67e-05},
+  {0,291,-9.67e-05},
+  {0,292,-4.84e-05},
+  {1,1,2.08e-01},
+  {1,0,3.65e-02},
+  {1,2,-1.03e-02},
+  {1,3,-1.03e-02},
+  {1,4,3.65e-02},
+  {1,6,-1.03e-02},
+  {1,289,-9.67e-05},
+  {1,290,-3.87e-04},
+  {1,291,-4.84e-05},
+  {1,292,-1.93e-04},
+  {1,293,-9.67e-05},
+  {1,295,-4.84e-05},
+  {2,2,2.08e-01},
+  {2,0,3.65e-02},
+  {2,1,-1.03e-02},
+  {2,3,-1.03e-02},
+  {2,5,3.65e-02},
+  {2,8,-1.03e-02},
+  {2,289,-9.67e-05},
+  {2,290,-4.84e-05},
+  {2,291,-3.87e-04},
+  {2,292,-1.93e-04},
+  {2,294,-9.67e-05},
+  {2,297,-4.84e-05},
+  {3,3,8.29e-02},
+  {3,0,-1.03e-02},
+  {3,1,-1.03e-02},
+  {3,2,-1.03e-02},
+  {3,4,-1.03e-02},
+  {3,5,-1.03e-02},
+  {3,6,-1.03e-02},
+  {3,7,-1.03e-02},
+  {3,8,-1.03e-02},
+  {3,289,-4.84e-05},
+  {3,290,-1.93e-04},
+  {3,291,-1.93e-04},
+  {3,292,-7.74e-04},
+  {3,293,-4.84e-05},
+  {3,294,-4.84e-05},
+  {3,295,-1.93e-04},
+  {3,296,-4.84e-05},
+  {3,297,-1.93e-04},
+  {4,4,2.08e-01},
+  {4,1,3.65e-02},
+  {4,3,-1.03e-02},
+  {4,6,-1.03e-02},
+  {4,9,3.65e-02},
+  {4,11,-1.03e-02},
+  {4,290,-9.67e-05},
+  {4,292,-4.84e-05},
+  {4,293,-3.87e-04},
+  {4,295,-1.93e-04},
+  {4,298,-9.67e-05},
+  {4,300,-4.84e-05},
+  {5,5,2.08e-01},
+  {5,2,3.65e-02},
+  {5,3,-1.03e-02},
+  {5,8,-1.03e-02},
+  {5,10,3.65e-02},
+  {5,15,-1.03e-02},
+  {5,291,-9.67e-05},
+  {5,292,-4.84e-05},
+  {5,294,-3.87e-04},
+  {5,297,-1.93e-04},
+  {5,299,-9.67e-05},
+  {5,304,-4.84e-05},
+  {6,6,8.29e-02},
+  {6,1,-1.03e-02},
+  {6,3,-1.03e-02},
+  {6,4,-1.03e-02},
+  {6,7,-1.03e-02},
+  {6,8,-1.03e-02},
+  {6,9,-1.03e-02},
+  {6,11,-1.03e-02},
+  {6,12,-1.03e-02},
+  {6,290,-4.84e-05},
+  {6,292,-1.93e-04},
+  {6,293,-1.93e-04},
+  {6,295,-7.74e-04},
+  {6,296,-1.93e-04},
+  {6,297,-4.84e-05},
+  {6,298,-4.84e-05},
+  {6,300,-1.93e-04},
+  {6,301,-4.84e-05},
+  {7,7,8.29e-02},
+  {7,3,-1.03e-02},
+  {7,6,-1.03e-02},
+  {7,8,-1.03e-02},
+  {7,11,-1.03e-02},
+  {7,12,-1.03e-02},
+  {7,13,-1.03e-02},
+  {7,14,-1.03e-02},
+  {7,15,-1.03e-02},
+  {7,292,-4.84e-05},
+  {7,295,-1.93e-04},
+  {7,296,-7.74e-04},
+  {7,297,-1.93e-04},
+  {7,300,-4.84e-05},
+  {7,301,-1.93e-04},
+  {7,302,-4.84e-05},
+  {7,303,-1.93e-04},
+  {7,304,-4.84e-05},
+  {8,8,8.29e-02},
+  {8,2,-1.03e-02},
+  {8,3,-1.03e-02},
+  {8,5,-1.03e-02},
+  {8,6,-1.03e-02},
+  {8,7,-1.03e-02},
+  {8,10,-1.03e-02},
+  {8,14,-1.03e-02},
+  {8,15,-1.03e-02},
+  {8,291,-4.84e-05},
+  {8,292,-1.93e-04},
+  {8,294,-1.93e-04},
+  {8,295,-4.84e-05},
+  {8,296,-1.93e-04},
+  {8,297,-7.74e-04},
+  {8,299,-4.84e-05},
+  {8,303,-4.84e-05},
+  {8,304,-1.93e-04},
+  {9,9,2.08e-01},
+  {9,4,3.65e-02},
+  {9,6,-1.03e-02},
+  {9,11,-1.03e-02},
+  {9,16,3.65e-02},
+  {9,18,-1.03e-02},
+  {9,293,-9.67e-05},
+  {9,295,-4.84e-05},
+  {9,298,-3.87e-04},
+  {9,300,-1.93e-04},
+  {9,305,-9.67e-05},
+  {9,307,-4.84e-05},
+  {10,10,2.08e-01},
+  {10,5,3.65e-02},
+  {10,8,-1.03e-02},
+  {10,15,-1.03e-02},
+  {10,17,3.65e-02},
+  {10,24,-1.03e-02},
+  {10,294,-9.67e-05},
+  {10,297,-4.84e-05},
+  {10,299,-3.87e-04},
+  {10,304,-1.93e-04},
+  {10,306,-9.67e-05},
+  {10,313,-4.84e-05},
+  {11,11,8.29e-02},
+  {11,4,-1.03e-02},
+  {11,6,-1.03e-02},
+  {11,7,-1.03e-02},
+  {11,9,-1.03e-02},
+  {11,12,-1.03e-02},
+  {11,16,-1.03e-02},
+  {11,18,-1.03e-02},
+  {11,19,-1.03e-02},
+  {11,293,-4.84e-05},
+  {11,295,-1.93e-04},
+  {11,296,-4.84e-05},
+  {11,298,-1.93e-04},
+  {11,300,-7.74e-04},
+  {11,301,-1.93e-04},
+  {11,305,-4.84e-05},
+  {11,307,-1.93e-04},
+  {11,308,-4.84e-05},
+  {12,12,8.29e-02},
+  {12,6,-1.03e-02},
+  {12,7,-1.03e-02},
+  {12,11,-1.03e-02},
+  {12,13,-1.03e-02},
+  {12,14,-1.03e-02},
+  {12,18,-1.03e-02},
+  {12,19,-1.03e-02},
+  {12,20,-1.03e-02},
+  {12,295,-4.84e-05},
+  {12,296,-1.93e-04},
+  {12,300,-1.93e-04},
+  {12,301,-7.74e-04},
+  {12,302,-1.93e-04},
+  {12,303,-4.84e-05},
+  {12,307,-4.84e-05},
+  {12,308,-1.93e-04},
+  {12,309,-4.84e-05},
+  {13,13,8.29e-02},
+  {13,7,-1.03e-02},
+  {13,12,-1.03e-02},
+  {13,14,-1.03e-02},
+  {13,19,-1.03e-02},
+  {13,20,-1.03e-02},
+  {13,21,-1.03e-02},
+  {13,22,-1.03e-02},
+  {13,23,-1.03e-02},
+  {13,296,-4.84e-05},
+  {13,301,-1.93e-04},
+  {13,302,-7.74e-04},
+  {13,303,-1.93e-04},
+  {13,308,-4.84e-05},
+  {13,309,-1.93e-04},
+  {13,310,-4.84e-05},
+  {13,311,-1.93e-04},
+  {13,312,-4.84e-05},
+  {14,14,8.29e-02},
+  {14,7,-1.03e-02},
+  {14,8,-1.03e-02},
+  {14,12,-1.03e-02},
+  {14,13,-1.03e-02},
+  {14,15,-1.03e-02},
+  {14,22,-1.03e-02},
+  {14,23,-1.03e-02},
+  {14,24,-1.03e-02},
+  {14,296,-1.93e-04},
+  {14,297,-4.84e-05},
+  {14,301,-4.84e-05},
+  {14,302,-1.93e-04},
+  {14,303,-7.74e-04},
+  {14,304,-1.93e-04},
+  {14,311,-4.84e-05},
+  {14,312,-1.93e-04},
+  {14,313,-4.84e-05},
+  {15,15,8.29e-02},
+  {15,5,-1.03e-02},
+  {15,7,-1.03e-02},
+  {15,8,-1.03e-02},
+  {15,10,-1.03e-02},
+  {15,14,-1.03e-02},
+  {15,17,-1.03e-02},
+  {15,23,-1.03e-02},
+  {15,24,-1.03e-02},
+  {15,294,-4.84e-05},
+  {15,296,-4.84e-05},
+  {15,297,-1.93e-04},
+  {15,299,-1.93e-04},
+  {15,303,-1.93e-04},
+  {15,304,-7.74e-04},
+  {15,306,-4.84e-05},
+  {15,312,-4.84e-05},
+  {15,313,-1.93e-04},
+  {16,16,2.08e-01},
+  {16,9,3.65e-02},
+  {16,11,-1.03e-02},
+  {16,18,-1.03e-02},
+  {16,25,3.65e-02},
+  {16,27,-1.03e-02},
+  {16,298,-9.67e-05},
+  {16,300,-4.84e-05},
+  {16,305,-3.87e-04},
+  {16,307,-1.93e-04},
+  {16,314,-9.67e-05},
+  {16,316,-4.84e-05},
+  {17,17,2.08e-01},
+  {17,10,3.65e-02},
+  {17,15,-1.03e-02},
+  {17,24,-1.03e-02},
+  {17,26,3.65e-02},
+  {17,33,-1.03e-02},
+  {17,299,-9.67e-05},
+  {17,304,-4.84e-05},
+  {17,306,-3.87e-04},
+  {17,313,-1.93e-04},
+  {17,315,-9.67e-05},
+  {17,322,-4.84e-05},
+  {18,18,8.29e-02},
+  {18,9,-1.03e-02},
+  {18,11,-1.03e-02},
+  {18,12,-1.03e-02},
+  {18,16,-1.03e-02},
+  {18,19,-1.03e-02},
+  {18,25,-1.03e-02},
+  {18,27,-1.03e-02},
+  {18,28,-1.03e-02},
+  {18,298,-4.84e-05},
+  {18,300,-1.93e-04},
+  {18,301,-4.84e-05},
+  {18,305,-1.93e-04},
+  {18,307,-7.74e-04},
+  {18,308,-1.93e-04},
+  {18,314,-4.84e-05},
+  {18,316,-1.93e-04},
+  {18,317,-4.84e-05},
+  {19,19,8.29e-02},
+  {19,11,-1.03e-02},
+  {19,12,-1.03e-02},
+  {19,13,-1.03e-02},
+  {19,18,-1.03e-02},
+  {19,20,-1.03e-02},
+  {19,27,-1.03e-02},
+  {19,28,-1.03e-02},
+  {19,29,-1.03e-02},
+  {19,300,-4.84e-05},
+  {19,301,-1.93e-04},
+  {19,302,-4.84e-05},
+  {19,307,-1.93e-04},
+  {19,308,-7.74e-04},
+  {19,309,-1.93e-04},
+  {19,316,-4.84e-05},
+  {19,317,-1.93e-04},
+  {19,318,-4.84e-05},
+  {20,20,8.29e-02},
+  {20,12,-1.03e-02},
+  {20,13,-1.03e-02},
+  {20,19,-1.03e-02},
+  {20,21,-1.03e-02},
+  {20,22,-1.03e-02},
+  {20,28,-1.03e-02},
+  {20,29,-1.03e-02},
+  {20,30,-1.03e-02},
+  {20,301,-4.84e-05},
+  {20,302,-1.93e-04},
+  {20,308,-1.93e-04},
+  {20,309,-7.74e-04},
+  {20,310,-1.93e-04},
+  {20,311,-4.84e-05},
+  {20,317,-4.84e-05},
+  {20,318,-1.93e-04},
+  {20,319,-4.84e-05},
+  {21,21,8.29e-02},
+  {21,13,-1.03e-02},
+  {21,20,-1.03e-02},
+  {21,22,-1.03e-02},
+  {21,29,-1.03e-02},
+  {21,30,-1.03e-02},
+  {21,31,-1.03e-02},
+  {21,32,-1.03e-02},
+  {21,35,-1.03e-02},
+  {21,302,-4.84e-05},
+  {21,309,-1.93e-04},
+  {21,310,-7.74e-04},
+  {21,311,-1.93e-04},
+  {21,318,-4.84e-05},
+  {21,319,-1.93e-04},
+  {21,320,-4.84e-05},
+  {21,321,-1.93e-04},
+  {21,324,-4.84e-05},
+  {22,22,8.29e-02},
+  {22,13,-1.03e-02},
+  {22,14,-1.03e-02},
+  {22,20,-1.03e-02},
+  {22,21,-1.03e-02},
+  {22,23,-1.03e-02},
+  {22,32,-1.03e-02},
+  {22,34,-1.03e-02},
+  {22,35,-1.03e-02},
+  {22,302,-1.93e-04},
+  {22,303,-4.84e-05},
+  {22,309,-4.84e-05},
+  {22,310,-1.93e-04},
+  {22,311,-7.74e-04},
+  {22,312,-1.93e-04},
+  {22,321,-4.84e-05},
+  {22,323,-4.84e-05},
+  {22,324,-1.93e-04},
+  {23,23,8.29e-02},
+  {23,13,-1.03e-02},
+  {23,14,-1.03e-02},
+  {23,15,-1.03e-02},
+  {23,22,-1.03e-02},
+  {23,24,-1.03e-02},
+  {23,33,-1.03e-02},
+  {23,34,-1.03e-02},
+  {23,35,-1.03e-02},
+  {23,302,-4.84e-05},
+  {23,303,-1.93e-04},
+  {23,304,-4.84e-05},
+  {23,311,-1.93e-04},
+  {23,312,-7.74e-04},
+  {23,313,-1.93e-04},
+  {23,322,-4.84e-05},
+  {23,323,-1.93e-04},
+  {23,324,-4.84e-05},
+  {24,24,8.29e-02},
+  {24,10,-1.03e-02},
+  {24,14,-1.03e-02},
+  {24,15,-1.03e-02},
+  {24,17,-1.03e-02},
+  {24,23,-1.03e-02},
+  {24,26,-1.03e-02},
+  {24,33,-1.03e-02},
+  {24,34,-1.03e-02},
+  {24,299,-4.84e-05},
+  {24,303,-4.84e-05},
+  {24,304,-1.93e-04},
+  {24,306,-1.93e-04},
+  {24,312,-1.93e-04},
+  {24,313,-7.74e-04},
+  {24,315,-4.84e-05},
+  {24,322,-1.93e-04},
+  {24,323,-4.84e-05},
+  {25,25,2.08e-01},
+  {25,16,3.65e-02},
+  {25,18,-1.03e-02},
+  {25,27,-1.03e-02},
+  {25,36,3.65e-02},
+  {25,38,-1.03e-02},
+  {25,305,-9.67e-05},
+  {25,307,-4.84e-05},
+  {25,314,-3.87e-04},
+  {25,316,-1.93e-04},
+  {25,325,-9.67e-05},
+  {25,327,-4.84e-05},
+  {26,26,2.08e-01},
+  {26,17,3.65e-02},
+  {26,24,-1.03e-02},
+  {26,33,-1.03e-02},
+  {26,37,3.65e-02},
+  {26,47,-1.03e-02},
+  {26,306,-9.67e-05},
+  {26,313,-4.84e-05},
+  {26,315,-3.87e-04},
+  {26,322,-1.93e-04},
+  {26,326,-9.67e-05},
+  {26,336,-4.84e-05},
+  {27,27,8.29e-02},
+  {27,16,-1.03e-02},
+  {27,18,-1.03e-02},
+  {27,19,-1.03e-02},
+  {27,25,-1.03e-02},
+  {27,28,-1.03e-02},
+  {27,36,-1.03e-02},
+  {27,38,-1.03e-02},
+  {27,39,-1.03e-02},
+  {27,305,-4.84e-05},
+  {27,307,-1.93e-04},
+  {27,308,-4.84e-05},
+  {27,314,-1.93e-04},
+  {27,316,-7.74e-04},
+  {27,317,-1.93e-04},
+  {27,325,-4.84e-05},
+  {27,327,-1.93e-04},
+  {27,328,-4.84e-05},
+  {28,28,8.29e-02},
+  {28,18,-1.03e-02},
+  {28,19,-1.03e-02},
+  {28,20,-1.03e-02},
+  {28,27,-1.03e-02},
+  {28,29,-1.03e-02},
+  {28,38,-1.03e-02},
+  {28,39,-1.03e-02},
+  {28,40,-1.03e-02},
+  {28,307,-4.84e-05},
+  {28,308,-1.93e-04},
+  {28,309,-4.84e-05},
+  {28,316,-1.93e-04},
+  {28,317,-7.74e-04},
+  {28,318,-1.93e-04},
+  {28,327,-4.84e-05},
+  {28,328,-1.93e-04},
+  {28,329,-4.84e-05},
+  {29,29,8.29e-02},
+  {29,19,-1.03e-02},
+  {29,20,-1.03e-02},
+  {29,21,-1.03e-02},
+  {29,28,-1.03e-02},
+  {29,30,-1.03e-02},
+  {29,39,-1.03e-02},
+  {29,40,-1.03e-02},
+  {29,41,-1.03e-02},
+  {29,308,-4.84e-05},
+  {29,309,-1.93e-04},
+  {29,310,-4.84e-05},
+  {29,317,-1.93e-04},
+  {29,318,-7.74e-04},
+  {29,319,-1.93e-04},
+  {29,328,-4.84e-05},
+  {29,329,-1.93e-04},
+  {29,330,-4.84e-05},
+  {30,30,8.29e-02},
+  {30,20,-1.03e-02},
+  {30,21,-1.03e-02},
+  {30,29,-1.03e-02},
+  {30,31,-1.03e-02},
+  {30,32,-1.03e-02},
+  {30,40,-1.03e-02},
+  {30,41,-1.03e-02},
+  {30,42,-1.03e-02},
+  {30,309,-4.84e-05},
+  {30,310,-1.93e-04},
+  {30,318,-1.93e-04},
+  {30,319,-7.74e-04},
+  {30,320,-1.93e-04},
+  {30,321,-4.84e-05},
+  {30,329,-4.84e-05},
+  {30,330,-1.93e-04},
+  {30,331,-4.84e-05},
+  {31,31,8.29e-02},
+  {31,21,-1.03e-02},
+  {31,30,-1.03e-02},
+  {31,32,-1.03e-02},
+  {31,41,-1.03e-02},
+  {31,42,-1.03e-02},
+  {31,43,-1.03e-02},
+  {31,44,-1.03e-02},
+  {31,45,-1.03e-02},
+  {31,310,-4.84e-05},
+  {31,319,-1.93e-04},
+  {31,320,-7.74e-04},
+  {31,321,-1.93e-04},
+  {31,330,-4.84e-05},
+  {31,331,-1.93e-04},
+  {31,332,-4.84e-05},
+  {31,333,-1.93e-04},
+  {31,334,-4.84e-05},
+  {32,32,8.29e-02},
+  {32,21,-1.03e-02},
+  {32,22,-1.03e-02},
+  {32,30,-1.03e-02},
+  {32,31,-1.03e-02},
+  {32,35,-1.03e-02},
+  {32,44,-1.03e-02},
+  {32,45,-1.03e-02},
+  {32,48,-1.03e-02},
+  {32,310,-1.93e-04},
+  {32,311,-4.84e-05},
+  {32,319,-4.84e-05},
+  {32,320,-1.93e-04},
+  {32,321,-7.74e-04},
+  {32,324,-1.93e-04},
+  {32,333,-4.84e-05},
+  {32,334,-1.93e-04},
+  {32,337,-4.84e-05},
+  {33,33,8.29e-02},
+  {33,17,-1.03e-02},
+  {33,23,-1.03e-02},
+  {33,24,-1.03e-02},
+  {33,26,-1.03e-02},
+  {33,34,-1.03e-02},
+  {33,37,-1.03e-02},
+  {33,46,-1.03e-02},
+  {33,47,-1.03e-02},
+  {33,306,-4.84e-05},
+  {33,312,-4.84e-05},
+  {33,313,-1.93e-04},
+  {33,315,-1.93e-04},
+  {33,322,-7.74e-04},
+  {33,323,-1.93e-04},
+  {33,326,-4.84e-05},
+  {33,335,-4.84e-05},
+  {33,336,-1.93e-04},
+  {34,34,8.29e-02},
+  {34,22,-1.03e-02},
+  {34,23,-1.03e-02},
+  {34,24,-1.03e-02},
+  {34,33,-1.03e-02},
+  {34,35,-1.03e-02},
+  {34,46,-1.03e-02},
+  {34,47,-1.03e-02},
+  {34,48,-1.03e-02},
+  {34,311,-4.84e-05},
+  {34,312,-1.93e-04},
+  {34,313,-4.84e-05},
+  {34,322,-1.93e-04},
+  {34,323,-7.74e-04},
+  {34,324,-1.93e-04},
+  {34,335,-1.93e-04},
+  {34,336,-4.84e-05},
+  {34,337,-4.84e-05},
+  {35,35,8.29e-02},
+  {35,21,-1.03e-02},
+  {35,22,-1.03e-02},
+  {35,23,-1.03e-02},
+  {35,32,-1.03e-02},
+  {35,34,-1.03e-02},
+  {35,45,-1.03e-02},
+  {35,46,-1.03e-02},
+  {35,48,-1.03e-02},
+  {35,310,-4.84e-05},
+  {35,311,-1.93e-04},
+  {35,312,-4.84e-05},
+  {35,321,-1.93e-04},
+  {35,323,-1.93e-04},
+  {35,324,-7.74e-04},
+  {35,334,-4.84e-05},
+  {35,335,-4.84e-05},
+  {35,337,-1.93e-04},
+  {36,36,2.08e-01},
+  {36,25,3.65e-02},
+  {36,27,-1.03e-02},
+  {36,38,-1.03e-02},
+  {36,49,3.65e-02},
+  {36,51,-1.03e-02},
+  {36,314,-9.67e-05},
+  {36,316,-4.84e-05},
+  {36,325,-3.87e-04},
+  {36,327,-1.93e-04},
+  {36,338,-9.67e-05},
+  {36,340,-4.84e-05},
+  {37,37,2.08e-01},
+  {37,26,3.65e-02},
+  {37,33,-1.03e-02},
+  {37,47,-1.03e-02},
+  {37,50,3.65e-02},
+  {37,63,-1.03e-02},
+  {37,315,-9.67e-05},
+  {37,322,-4.84e-05},
+  {37,326,-3.87e-04},
+  {37,336,-1.93e-04},
+  {37,339,-9.67e-05},
+  {37,352,-4.84e-05},
+  {38,38,8.29e-02},
+  {38,25,-1.03e-02},
+  {38,27,-1.03e-02},
+  {38,28,-1.03e-02},
+  {38,36,-1.03e-02},
+  {38,39,-1.03e-02},
+  {38,49,-1.03e-02},
+  {38,51,-1.03e-02},
+  {38,52,-1.03e-02},
+  {38,314,-4.84e-05},
+  {38,316,-1.93e-04},
+  {38,317,-4.84e-05},
+  {38,325,-1.93e-04},
+  {38,327,-7.74e-04},
+  {38,328,-1.93e-04},
+  {38,338,-4.84e-05},
+  {38,340,-1.93e-04},
+  {38,341,-4.84e-05},
+  {39,39,8.29e-02},
+  {39,27,-1.03e-02},
+  {39,28,-1.03e-02},
+  {39,29,-1.03e-02},
+  {39,38,-1.03e-02},
+  {39,40,-1.03e-02},
+  {39,51,-1.03e-02},
+  {39,52,-1.03e-02},
+  {39,53,-1.03e-02},
+  {39,316,-4.84e-05},
+  {39,317,-1.93e-04},
+  {39,318,-4.84e-05},
+  {39,327,-1.93e-04},
+  {39,328,-7.74e-04},
+  {39,329,-1.93e-04},
+  {39,340,-4.84e-05},
+  {39,341,-1.93e-04},
+  {39,342,-4.84e-05},
+  {40,40,8.29e-02},
+  {40,28,-1.03e-02},
+  {40,29,-1.03e-02},
+  {40,30,-1.03e-02},
+  {40,39,-1.03e-02},
+  {40,41,-1.03e-02},
+  {40,52,-1.03e-02},
+  {40,53,-1.03e-02},
+  {40,54,-1.03e-02},
+  {40,317,-4.84e-05},
+  {40,318,-1.93e-04},
+  {40,319,-4.84e-05},
+  {40,328,-1.93e-04},
+  {40,329,-7.74e-04},
+  {40,330,-1.93e-04},
+  {40,341,-4.84e-05},
+  {40,342,-1.93e-04},
+  {40,343,-4.84e-05},
+  {41,41,8.29e-02},
+  {41,29,-1.03e-02},
+  {41,30,-1.03e-02},
+  {41,31,-1.03e-02},
+  {41,40,-1.03e-02},
+  {41,42,-1.03e-02},
+  {41,53,-1.03e-02},
+  {41,54,-1.03e-02},
+  {41,55,-1.03e-02},
+  {41,318,-4.84e-05},
+  {41,319,-1.93e-04},
+  {41,320,-4.84e-05},
+  {41,329,-1.93e-04},
+  {41,330,-7.74e-04},
+  {41,331,-1.93e-04},
+  {41,342,-4.84e-05},
+  {41,343,-1.93e-04},
+  {41,344,-4.84e-05},
+  {42,42,8.29e-02},
+  {42,30,-1.03e-02},
+  {42,31,-1.03e-02},
+  {42,41,-1.03e-02},
+  {42,43,-1.03e-02},
+  {42,44,-1.03e-02},
+  {42,54,-1.03e-02},
+  {42,55,-1.03e-02},
+  {42,56,-1.03e-02},
+  {42,319,-4.84e-05},
+  {42,320,-1.93e-04},
+  {42,330,-1.93e-04},
+  {42,331,-7.74e-04},
+  {42,332,-1.93e-04},
+  {42,333,-4.84e-05},
+  {42,343,-4.84e-05},
+  {42,344,-1.93e-04},
+  {42,345,-4.84e-05},
+  {43,43,8.29e-02},
+  {43,31,-1.03e-02},
+  {43,42,-1.03e-02},
+  {43,44,-1.03e-02},
+  {43,55,-1.03e-02},
+  {43,56,-1.03e-02},
+  {43,57,-1.03e-02},
+  {43,58,-1.03e-02},
+  {43,59,-1.03e-02},
+  {43,320,-4.84e-05},
+  {43,331,-1.93e-04},
+  {43,332,-7.74e-04},
+  {43,333,-1.93e-04},
+  {43,344,-4.84e-05},
+  {43,345,-1.93e-04},
+  {43,346,-4.84e-05},
+  {43,347,-1.93e-04},
+  {43,348,-4.84e-05},
+  {44,44,8.29e-02},
+  {44,31,-1.03e-02},
+  {44,32,-1.03e-02},
+  {44,42,-1.03e-02},
+  {44,43,-1.03e-02},
+  {44,45,-1.03e-02},
+  {44,58,-1.03e-02},
+  {44,59,-1.03e-02},
+  {44,60,-1.03e-02},
+  {44,320,-1.93e-04},
+  {44,321,-4.84e-05},
+  {44,331,-4.84e-05},
+  {44,332,-1.93e-04},
+  {44,333,-7.74e-04},
+  {44,334,-1.93e-04},
+  {44,347,-4.84e-05},
+  {44,348,-1.93e-04},
+  {44,349,-4.84e-05},
+  {45,45,8.29e-02},
+  {45,31,-1.03e-02},
+  {45,32,-1.03e-02},
+  {45,35,-1.03e-02},
+  {45,44,-1.03e-02},
+  {45,48,-1.03e-02},
+  {45,59,-1.03e-02},
+  {45,60,-1.03e-02},
+  {45,61,-1.03e-02},
+  {45,320,-4.84e-05},
+  {45,321,-1.93e-04},
+  {45,324,-4.84e-05},
+  {45,333,-1.93e-04},
+  {45,334,-7.74e-04},
+  {45,337,-1.93e-04},
+  {45,348,-4.84e-05},
+  {45,349,-1.93e-04},
+  {45,350,-4.84e-05},
+  {46,46,8.29e-02},
+  {46,33,-1.03e-02},
+  {46,34,-1.03e-02},
+  {46,35,-1.03e-02},
+  {46,47,-1.03e-02},
+  {46,48,-1.03e-02},
+  {46,61,-1.03e-02},
+  {46,62,-1.03e-02},
+  {46,63,-1.03e-02},
+  {46,322,-4.84e-05},
+  {46,323,-1.93e-04},
+  {46,324,-4.84e-05},
+  {46,335,-7.74e-04},
+  {46,336,-1.93e-04},
+  {46,337,-1.93e-04},
+  {46,350,-4.84e-05},
+  {46,351,-1.93e-04},
+  {46,352,-4.84e-05},
+  {47,47,8.29e-02},
+  {47,26,-1.03e-02},
+  {47,33,-1.03e-02},
+  {47,34,-1.03e-02},
+  {47,37,-1.03e-02},
+  {47,46,-1.03e-02},
+  {47,50,-1.03e-02},
+  {47,62,-1.03e-02},
+  {47,63,-1.03e-02},
+  {47,315,-4.84e-05},
+  {47,322,-1.93e-04},
+  {47,323,-4.84e-05},
+  {47,326,-1.93e-04},
+  {47,335,-1.93e-04},
+  {47,336,-7.74e-04},
+  {47,339,-4.84e-05},
+  {47,351,-4.84e-05},
+  {47,352,-1.93e-04},
+  {48,48,8.29e-02},
+  {48,32,-1.03e-02},
+  {48,34,-1.03e-02},
+  {48,35,-1.03e-02},
+  {48,45,-1.03e-02},
+  {48,46,-1.03e-02},
+  {48,60,-1.03e-02},
+  {48,61,-1.03e-02},
+  {48,62,-1.03e-02},
+  {48,321,-4.84e-05},
+  {48,323,-4.84e-05},
+  {48,324,-1.93e-04},
+  {48,334,-1.93e-04},
+  {48,335,-1.93e-04},
+  {48,337,-7.74e-04},
+  {48,349,-4.84e-05},
+  {48,350,-1.93e-04},
+  {48,351,-4.84e-05},
+  {49,49,2.08e-01},
+  {49,36,3.65e-02},
+  {49,38,-1.03e-02},
+  {49,51,-1.03e-02},
+  {49,64,3.65e-02},
+  {49,66,-1.03e-02},
+  {49,325,-9.67e-05},
+  {49,327,-4.84e-05},
+  {49,338,-3.87e-04},
+  {49,340,-1.93e-04},
+  {49,353,-9.67e-05},
+  {49,355,-4.84e-05},
+  {50,50,2.08e-01},
+  {50,37,3.65e-02},
+  {50,47,-1.03e-02},
+  {50,63,-1.03e-02},
+  {50,65,3.65e-02},
+  {50,80,-1.03e-02},
+  {50,326,-9.67e-05},
+  {50,336,-4.84e-05},
+  {50,339,-3.87e-04},
+  {50,352,-1.93e-04},
+  {50,354,-9.67e-05},
+  {50,369,-4.84e-05},
+  {51,51,8.29e-02},
+  {51,36,-1.03e-02},
+  {51,38,-1.03e-02},
+  {51,39,-1.03e-02},
+  {51,49,-1.03e-02},
+  {51,52,-1.03e-02},
+  {51,64,-1.03e-02},
+  {51,66,-1.03e-02},
+  {51,67,-1.03e-02},
+  {51,325,-4.84e-05},
+  {51,327,-1.93e-04},
+  {51,328,-4.84e-05},
+  {51,338,-1.93e-04},
+  {51,340,-7.74e-04},
+  {51,341,-1.93e-04},
+  {51,353,-4.84e-05},
+  {51,355,-1.93e-04},
+  {51,356,-4.84e-05},
+  {52,52,8.29e-02},
+  {52,38,-1.03e-02},
+  {52,39,-1.03e-02},
+  {52,40,-1.03e-02},
+  {52,51,-1.03e-02},
+  {52,53,-1.03e-02},
+  {52,66,-1.03e-02},
+  {52,67,-1.03e-02},
+  {52,68,-1.03e-02},
+  {52,327,-4.84e-05},
+  {52,328,-1.93e-04},
+  {52,329,-4.84e-05},
+  {52,340,-1.93e-04},
+  {52,341,-7.74e-04},
+  {52,342,-1.93e-04},
+  {52,355,-4.84e-05},
+  {52,356,-1.93e-04},
+  {52,357,-4.84e-05},
+  {53,53,8.29e-02},
+  {53,39,-1.03e-02},
+  {53,40,-1.03e-02},
+  {53,41,-1.03e-02},
+  {53,52,-1.03e-02},
+  {53,54,-1.03e-02},
+  {53,67,-1.03e-02},
+  {53,68,-1.03e-02},
+  {53,69,-1.03e-02},
+  {53,328,-4.84e-05},
+  {53,329,-1.93e-04},
+  {53,330,-4.84e-05},
+  {53,341,-1.93e-04},
+  {53,342,-7.74e-04},
+  {53,343,-1.93e-04},
+  {53,356,-4.84e-05},
+  {53,357,-1.93e-04},
+  {53,358,-4.84e-05},
+  {54,54,8.29e-02},
+  {54,40,-1.03e-02},
+  {54,41,-1.03e-02},
+  {54,42,-1.03e-02},
+  {54,53,-1.03e-02},
+  {54,55,-1.03e-02},
+  {54,68,-1.03e-02},
+  {54,69,-1.03e-02},
+  {54,70,-1.03e-02},
+  {54,329,-4.84e-05},
+  {54,330,-1.93e-04},
+  {54,331,-4.84e-05},
+  {54,342,-1.93e-04},
+  {54,343,-7.74e-04},
+  {54,344,-1.93e-04},
+  {54,357,-4.84e-05},
+  {54,358,-1.93e-04},
+  {54,359,-4.84e-05},
+  {55,55,8.29e-02},
+  {55,41,-1.03e-02},
+  {55,42,-1.03e-02},
+  {55,43,-1.03e-02},
+  {55,54,-1.03e-02},
+  {55,56,-1.03e-02},
+  {55,69,-1.03e-02},
+  {55,70,-1.03e-02},
+  {55,71,-1.03e-02},
+  {55,330,-4.84e-05},
+  {55,331,-1.93e-04},
+  {55,332,-4.84e-05},
+  {55,343,-1.93e-04},
+  {55,344,-7.74e-04},
+  {55,345,-1.93e-04},
+  {55,358,-4.84e-05},
+  {55,359,-1.93e-04},
+  {55,360,-4.84e-05},
+  {56,56,8.29e-02},
+  {56,42,-1.03e-02},
+  {56,43,-1.03e-02},
+  {56,55,-1.03e-02},
+  {56,57,-1.03e-02},
+  {56,58,-1.03e-02},
+  {56,70,-1.03e-02},
+  {56,71,-1.03e-02},
+  {56,72,-1.03e-02},
+  {56,331,-4.84e-05},
+  {56,332,-1.93e-04},
+  {56,344,-1.93e-04},
+  {56,345,-7.74e-04},
+  {56,346,-1.93e-04},
+  {56,347,-4.84e-05},
+  {56,359,-4.84e-05},
+  {56,360,-1.93e-04},
+  {56,361,-4.84e-05},
+  {57,57,8.29e-02},
+  {57,43,-1.03e-02},
+  {57,56,-1.03e-02},
+  {57,58,-1.03e-02},
+  {57,71,-1.03e-02},
+  {57,72,-1.03e-02},
+  {57,73,-1.03e-02},
+  {57,74,-1.03e-02},
+  {57,75,-1.03e-02},
+  {57,332,-4.84e-05},
+  {57,345,-1.93e-04},
+  {57,346,-7.74e-04},
+  {57,347,-1.93e-04},
+  {57,360,-4.84e-05},
+  {57,361,-1.93e-04},
+  {57,362,-4.84e-05},
+  {57,363,-1.93e-04},
+  {57,364,-4.84e-05},
+  {58,58,8.29e-02},
+  {58,43,-1.03e-02},
+  {58,44,-1.03e-02},
+  {58,56,-1.03e-02},
+  {58,57,-1.03e-02},
+  {58,59,-1.03e-02},
+  {58,74,-1.03e-02},
+  {58,75,-1.03e-02},
+  {58,76,-1.03e-02},
+  {58,332,-1.93e-04},
+  {58,333,-4.84e-05},
+  {58,345,-4.84e-05},
+  {58,346,-1.93e-04},
+  {58,347,-7.74e-04},
+  {58,348,-1.93e-04},
+  {58,363,-4.84e-05},
+  {58,364,-1.93e-04},
+  {58,365,-4.84e-05},
+  {59,59,8.29e-02},
+  {59,43,-1.03e-02},
+  {59,44,-1.03e-02},
+  {59,45,-1.03e-02},
+  {59,58,-1.03e-02},
+  {59,60,-1.03e-02},
+  {59,75,-1.03e-02},
+  {59,76,-1.03e-02},
+  {59,77,-1.03e-02},
+  {59,332,-4.84e-05},
+  {59,333,-1.93e-04},
+  {59,334,-4.84e-05},
+  {59,347,-1.93e-04},
+  {59,348,-7.74e-04},
+  {59,349,-1.93e-04},
+  {59,364,-4.84e-05},
+  {59,365,-1.93e-04},
+  {59,366,-4.84e-05},
+  {60,60,8.29e-02},
+  {60,44,-1.03e-02},
+  {60,45,-1.03e-02},
+  {60,48,-1.03e-02},
+  {60,59,-1.03e-02},
+  {60,61,-1.03e-02},
+  {60,76,-1.03e-02},
+  {60,77,-1.03e-02},
+  {60,78,-1.03e-02},
+  {60,333,-4.84e-05},
+  {60,334,-1.93e-04},
+  {60,337,-4.84e-05},
+  {60,348,-1.93e-04},
+  {60,349,-7.74e-04},
+  {60,350,-1.93e-04},
+  {60,365,-4.84e-05},
+  {60,366,-1.93e-04},
+  {60,367,-4.84e-05},
+  {61,61,8.29e-02},
+  {61,45,-1.03e-02},
+  {61,46,-1.03e-02},
+  {61,48,-1.03e-02},
+  {61,60,-1.03e-02},
+  {61,62,-1.03e-02},
+  {61,77,-1.03e-02},
+  {61,78,-1.03e-02},
+  {61,79,-1.03e-02},
+  {61,334,-4.84e-05},
+  {61,335,-4.84e-05},
+  {61,337,-1.93e-04},
+  {61,349,-1.93e-04},
+  {61,350,-7.74e-04},
+  {61,351,-1.93e-04},
+  {61,366,-4.84e-05},
+  {61,367,-1.93e-04},
+  {61,368,-4.84e-05},
+  {62,62,8.29e-02},
+  {62,46,-1.03e-02},
+  {62,47,-1.03e-02},
+  {62,48,-1.03e-02},
+  {62,61,-1.03e-02},
+  {62,63,-1.03e-02},
+  {62,78,-1.03e-02},
+  {62,79,-1.03e-02},
+  {62,80,-1.03e-02},
+  {62,335,-1.93e-04},
+  {62,336,-4.84e-05},
+  {62,337,-4.84e-05},
+  {62,350,-1.93e-04},
+  {62,351,-7.74e-04},
+  {62,352,-1.93e-04},
+  {62,367,-4.84e-05},
+  {62,368,-1.93e-04},
+  {62,369,-4.84e-05},
+  {63,63,8.29e-02},
+  {63,37,-1.03e-02},
+  {63,46,-1.03e-02},
+  {63,47,-1.03e-02},
+  {63,50,-1.03e-02},
+  {63,62,-1.03e-02},
+  {63,65,-1.03e-02},
+  {63,79,-1.03e-02},
+  {63,80,-1.03e-02},
+  {63,326,-4.84e-05},
+  {63,335,-4.84e-05},
+  {63,336,-1.93e-04},
+  {63,339,-1.93e-04},
+  {63,351,-1.93e-04},
+  {63,352,-7.74e-04},
+  {63,354,-4.84e-05},
+  {63,368,-4.84e-05},
+  {63,369,-1.93e-04},
+  {64,64,2.08e-01},
+  {64,49,3.65e-02},
+  {64,51,-1.03e-02},
+  {64,66,-1.03e-02},
+  {64,81,3.65e-02},
+  {64,83,-1.03e-02},
+  {64,338,-9.67e-05},
+  {64,340,-4.84e-05},
+  {64,353,-3.87e-04},
+  {64,355,-1.93e-04},
+  {64,370,-9.67e-05},
+  {64,372,-4.84e-05},
+  {65,65,2.08e-01},
+  {65,50,3.65e-02},
+  {65,63,-1.03e-02},
+  {65,80,-1.03e-02},
+  {65,82,3.65e-02},
+  {65,93,-1.03e-02},
+  {65,339,-9.67e-05},
+  {65,352,-4.84e-05},
+  {65,354,-3.87e-04},
+  {65,369,-1.93e-04},
+  {65,371,-9.67e-05},
+  {65,382,-4.84e-05},
+  {66,66,8.29e-02},
+  {66,49,-1.03e-02},
+  {66,51,-1.03e-02},
+  {66,52,-1.03e-02},
+  {66,64,-1.03e-02},
+  {66,67,-1.03e-02},
+  {66,81,-1.03e-02},
+  {66,83,-1.03e-02},
+  {66,84,-1.03e-02},
+  {66,338,-4.84e-05},
+  {66,340,-1.93e-04},
+  {66,341,-4.84e-05},
+  {66,353,-1.93e-04},
+  {66,355,-7.74e-04},
+  {66,356,-1.93e-04},
+  {66,370,-4.84e-05},
+  {66,372,-1.93e-04},
+  {66,373,-4.84e-05},
+  {67,67,8.29e-02},
+  {67,51,-1.03e-02},
+  {67,52,-1.03e-02},
+  {67,53,-1.03e-02},
+  {67,66,-1.03e-02},
+  {67,68,-1.03e-02},
+  {67,83,-1.03e-02},
+  {67,84,-1.03e-02},
+  {67,85,-1.03e-02},
+  {67,340,-4.84e-05},
+  {67,341,-1.93e-04},
+  {67,342,-4.84e-05},
+  {67,355,-1.93e-04},
+  {67,356,-7.74e-04},
+  {67,357,-1.93e-04},
+  {67,372,-4.84e-05},
+  {67,373,-1.93e-04},
+  {67,374,-4.84e-05},
+  {68,68,8.29e-02},
+  {68,52,-1.03e-02},
+  {68,53,-1.03e-02},
+  {68,54,-1.03e-02},
+  {68,67,-1.03e-02},
+  {68,69,-1.03e-02},
+  {68,84,-1.03e-02},
+  {68,85,-1.03e-02},
+  {68,86,-1.03e-02},
+  {68,341,-4.84e-05},
+  {68,342,-1.93e-04},
+  {68,343,-4.84e-05},
+  {68,356,-1.93e-04},
+  {68,357,-7.74e-04},
+  {68,358,-1.93e-04},
+  {68,373,-4.84e-05},
+  {68,374,-1.93e-04},
+  {68,375,-4.84e-05},
+  {69,69,8.29e-02},
+  {69,53,-1.03e-02},
+  {69,54,-1.03e-02},
+  {69,55,-1.03e-02},
+  {69,68,-1.03e-02},
+  {69,70,-1.03e-02},
+  {69,85,-1.03e-02},
+  {69,86,-1.03e-02},
+  {69,87,-1.03e-02},
+  {69,342,-4.84e-05},
+  {69,343,-1.93e-04},
+  {69,344,-4.84e-05},
+  {69,357,-1.93e-04},
+  {69,358,-7.74e-04},
+  {69,359,-1.93e-04},
+  {69,374,-4.84e-05},
+  {69,375,-1.93e-04},
+  {69,376,-4.84e-05},
+  {70,70,8.29e-02},
+  {70,54,-1.03e-02},
+  {70,55,-1.03e-02},
+  {70,56,-1.03e-02},
+  {70,69,-1.03e-02},
+  {70,71,-1.03e-02},
+  {70,86,-1.03e-02},
+  {70,87,-1.03e-02},
+  {70,88,-1.03e-02},
+  {70,343,-4.84e-05},
+  {70,344,-1.93e-04},
+  {70,345,-4.84e-05},
+  {70,358,-1.93e-04},
+  {70,359,-7.74e-04},
+  {70,360,-1.93e-04},
+  {70,375,-4.84e-05},
+  {70,376,-1.93e-04},
+  {70,377,-4.84e-05},
+  {71,71,8.29e-02},
+  {71,55,-1.03e-02},
+  {71,56,-1.03e-02},
+  {71,57,-1.03e-02},
+  {71,70,-1.03e-02},
+  {71,72,-1.03e-02},
+  {71,87,-1.03e-02},
+  {71,88,-1.03e-02},
+  {71,89,-1.03e-02},
+  {71,344,-4.84e-05},
+  {71,345,-1.93e-04},
+  {71,346,-4.84e-05},
+  {71,359,-1.93e-04},
+  {71,360,-7.74e-04},
+  {71,361,-1.93e-04},
+  {71,376,-4.84e-05},
+  {71,377,-1.93e-04},
+  {71,378,-4.84e-05},
+  {72,72,8.29e-02},
+  {72,56,-1.03e-02},
+  {72,57,-1.03e-02},
+  {72,71,-1.03e-02},
+  {72,73,-1.03e-02},
+  {72,74,-1.03e-02},
+  {72,88,-1.03e-02},
+  {72,89,-1.03e-02},
+  {72,90,-1.03e-02},
+  {72,345,-4.84e-05},
+  {72,346,-1.93e-04},
+  {72,360,-1.93e-04},
+  {72,361,-7.74e-04},
+  {72,362,-1.93e-04},
+  {72,363,-4.84e-05},
+  {72,377,-4.84e-05},
+  {72,378,-1.93e-04},
+  {72,379,-4.84e-05},
+  {73,73,8.29e-02},
+  {73,57,-1.03e-02},
+  {73,72,-1.03e-02},
+  {73,74,-1.03e-02},
+  {73,89,-1.03e-02},
+  {73,90,-1.03e-02},
+  {73,91,-1.03e-02},
+  {73,92,-1.03e-02},
+  {73,99,-1.03e-02},
+  {73,346,-4.84e-05},
+  {73,361,-1.93e-04},
+  {73,362,-7.74e-04},
+  {73,363,-1.93e-04},
+  {73,378,-4.84e-05},
+  {73,379,-1.93e-04},
+  {73,380,-4.84e-05},
+  {73,381,-1.93e-04},
+  {73,388,-4.84e-05},
+  {74,74,8.29e-02},
+  {74,57,-1.03e-02},
+  {74,58,-1.03e-02},
+  {74,72,-1.03e-02},
+  {74,73,-1.03e-02},
+  {74,75,-1.03e-02},
+  {74,92,-1.03e-02},
+  {74,98,-1.03e-02},
+  {74,99,-1.03e-02},
+  {74,346,-1.93e-04},
+  {74,347,-4.84e-05},
+  {74,361,-4.84e-05},
+  {74,362,-1.93e-04},
+  {74,363,-7.74e-04},
+  {74,364,-1.93e-04},
+  {74,381,-4.84e-05},
+  {74,387,-4.84e-05},
+  {74,388,-1.93e-04},
+  {75,75,8.29e-02},
+  {75,57,-1.03e-02},
+  {75,58,-1.03e-02},
+  {75,59,-1.03e-02},
+  {75,74,-1.03e-02},
+  {75,76,-1.03e-02},
+  {75,97,-1.03e-02},
+  {75,98,-1.03e-02},
+  {75,99,-1.03e-02},
+  {75,346,-4.84e-05},
+  {75,347,-1.93e-04},
+  {75,348,-4.84e-05},
+  {75,363,-1.93e-04},
+  {75,364,-7.74e-04},
+  {75,365,-1.93e-04},
+  {75,386,-4.84e-05},
+  {75,387,-1.93e-04},
+  {75,388,-4.84e-05},
+  {76,76,8.29e-02},
+  {76,58,-1.03e-02},
+  {76,59,-1.03e-02},
+  {76,60,-1.03e-02},
+  {76,75,-1.03e-02},
+  {76,77,-1.03e-02},
+  {76,96,-1.03e-02},
+  {76,97,-1.03e-02},
+  {76,98,-1.03e-02},
+  {76,347,-4.84e-05},
+  {76,348,-1.93e-04},
+  {76,349,-4.84e-05},
+  {76,364,-1.93e-04},
+  {76,365,-7.74e-04},
+  {76,366,-1.93e-04},
+  {76,385,-4.84e-05},
+  {76,386,-1.93e-04},
+  {76,387,-4.84e-05},
+  {77,77,8.29e-02},
+  {77,59,-1.03e-02},
+  {77,60,-1.03e-02},
+  {77,61,-1.03e-02},
+  {77,76,-1.03e-02},
+  {77,78,-1.03e-02},
+  {77,95,-1.03e-02},
+  {77,96,-1.03e-02},
+  {77,97,-1.03e-02},
+  {77,348,-4.84e-05},
+  {77,349,-1.93e-04},
+  {77,350,-4.84e-05},
+  {77,365,-1.93e-04},
+  {77,366,-7.74e-04},
+  {77,367,-1.93e-04},
+  {77,384,-4.84e-05},
+  {77,385,-1.93e-04},
+  {77,386,-4.84e-05},
+  {78,78,8.29e-02},
+  {78,60,-1.03e-02},
+  {78,61,-1.03e-02},
+  {78,62,-1.03e-02},
+  {78,77,-1.03e-02},
+  {78,79,-1.03e-02},
+  {78,94,-1.03e-02},
+  {78,95,-1.03e-02},
+  {78,96,-1.03e-02},
+  {78,349,-4.84e-05},
+  {78,350,-1.93e-04},
+  {78,351,-4.84e-05},
+  {78,366,-1.93e-04},
+  {78,367,-7.74e-04},
+  {78,368,-1.93e-04},
+  {78,383,-4.84e-05},
+  {78,384,-1.93e-04},
+  {78,385,-4.84e-05},
+  {79,79,8.29e-02},
+  {79,61,-1.03e-02},
+  {79,62,-1.03e-02},
+  {79,63,-1.03e-02},
+  {79,78,-1.03e-02},
+  {79,80,-1.03e-02},
+  {79,93,-1.03e-02},
+  {79,94,-1.03e-02},
+  {79,95,-1.03e-02},
+  {79,350,-4.84e-05},
+  {79,351,-1.93e-04},
+  {79,352,-4.84e-05},
+  {79,367,-1.93e-04},
+  {79,368,-7.74e-04},
+  {79,369,-1.93e-04},
+  {79,382,-4.84e-05},
+  {79,383,-1.93e-04},
+  {79,384,-4.84e-05},
+  {80,80,8.29e-02},
+  {80,50,-1.03e-02},
+  {80,62,-1.03e-02},
+  {80,63,-1.03e-02},
+  {80,65,-1.03e-02},
+  {80,79,-1.03e-02},
+  {80,82,-1.03e-02},
+  {80,93,-1.03e-02},
+  {80,94,-1.03e-02},
+  {80,339,-4.84e-05},
+  {80,351,-4.84e-05},
+  {80,352,-1.93e-04},
+  {80,354,-1.93e-04},
+  {80,368,-1.93e-04},
+  {80,369,-7.74e-04},
+  {80,371,-4.84e-05},
+  {80,382,-1.93e-04},
+  {80,383,-4.84e-05},
+  {81,81,2.08e-01},
+  {81,64,3.65e-02},
+  {81,66,-1.03e-02},
+  {81,83,-1.03e-02},
+  {81,100,3.65e-02},
+  {81,102,-1.03e-02},
+  {81,353,-9.67e-05},
+  {81,355,-4.84e-05},
+  {81,370,-3.87e-04},
+  {81,372,-1.93e-04},
+  {81,389,-9.67e-05},
+  {81,391,-4.84e-05},
+  {82,82,2.08e-01},
+  {82,65,3.65e-02},
+  {82,80,-1.03e-02},
+  {82,93,-1.03e-02},
+  {82,101,3.65e-02},
+  {82,115,-1.03e-02},
+  {82,354,-9.67e-05},
+  {82,369,-4.84e-05},
+  {82,371,-3.87e-04},
+  {82,382,-1.93e-04},
+  {82,390,-9.67e-05},
+  {82,404,-4.84e-05},
+  {83,83,8.29e-02},
+  {83,64,-1.03e-02},
+  {83,66,-1.03e-02},
+  {83,67,-1.03e-02},
+  {83,81,-1.03e-02},
+  {83,84,-1.03e-02},
+  {83,100,-1.03e-02},
+  {83,102,-1.03e-02},
+  {83,103,-1.03e-02},
+  {83,353,-4.84e-05},
+  {83,355,-1.93e-04},
+  {83,356,-4.84e-05},
+  {83,370,-1.93e-04},
+  {83,372,-7.74e-04},
+  {83,373,-1.93e-04},
+  {83,389,-4.84e-05},
+  {83,391,-1.93e-04},
+  {83,392,-4.84e-05},
+  {84,84,8.29e-02},
+  {84,66,-1.03e-02},
+  {84,67,-1.03e-02},
+  {84,68,-1.03e-02},
+  {84,83,-1.03e-02},
+  {84,85,-1.03e-02},
+  {84,102,-1.03e-02},
+  {84,103,-1.03e-02},
+  {84,104,-1.03e-02},
+  {84,355,-4.84e-05},
+  {84,356,-1.93e-04},
+  {84,357,-4.84e-05},
+  {84,372,-1.93e-04},
+  {84,373,-7.74e-04},
+  {84,374,-1.93e-04},
+  {84,391,-4.84e-05},
+  {84,392,-1.93e-04},
+  {84,393,-4.84e-05},
+  {85,85,8.29e-02},
+  {85,67,-1.03e-02},
+  {85,68,-1.03e-02},
+  {85,69,-1.03e-02},
+  {85,84,-1.03e-02},
+  {85,86,-1.03e-02},
+  {85,103,-1.03e-02},
+  {85,104,-1.03e-02},
+  {85,105,-1.03e-02},
+  {85,356,-4.84e-05},
+  {85,357,-1.93e-04},
+  {85,358,-4.84e-05},
+  {85,373,-1.93e-04},
+  {85,374,-7.74e-04},
+  {85,375,-1.93e-04},
+  {85,392,-4.84e-05},
+  {85,393,-1.93e-04},
+  {85,394,-4.84e-05},
+  {86,86,8.29e-02},
+  {86,68,-1.03e-02},
+  {86,69,-1.03e-02},
+  {86,70,-1.03e-02},
+  {86,85,-1.03e-02},
+  {86,87,-1.03e-02},
+  {86,104,-1.03e-02},
+  {86,105,-1.03e-02},
+  {86,106,-1.03e-02},
+  {86,357,-4.84e-05},
+  {86,358,-1.93e-04},
+  {86,359,-4.84e-05},
+  {86,374,-1.93e-04},
+  {86,375,-7.74e-04},
+  {86,376,-1.93e-04},
+  {86,393,-4.84e-05},
+  {86,394,-1.93e-04},
+  {86,395,-4.84e-05},
+  {87,87,8.29e-02},
+  {87,69,-1.03e-02},
+  {87,70,-1.03e-02},
+  {87,71,-1.03e-02},
+  {87,86,-1.03e-02},
+  {87,88,-1.03e-02},
+  {87,105,-1.03e-02},
+  {87,106,-1.03e-02},
+  {87,107,-1.03e-02},
+  {87,358,-4.84e-05},
+  {87,359,-1.93e-04},
+  {87,360,-4.84e-05},
+  {87,375,-1.93e-04},
+  {87,376,-7.74e-04},
+  {87,377,-1.93e-04},
+  {87,394,-4.84e-05},
+  {87,395,-1.93e-04},
+  {87,396,-4.84e-05},
+  {88,88,8.29e-02},
+  {88,70,-1.03e-02},
+  {88,71,-1.03e-02},
+  {88,72,-1.03e-02},
+  {88,87,-1.03e-02},
+  {88,89,-1.03e-02},
+  {88,106,-1.03e-02},
+  {88,107,-1.03e-02},
+  {88,108,-1.03e-02},
+  {88,359,-4.84e-05},
+  {88,360,-1.93e-04},
+  {88,361,-4.84e-05},
+  {88,376,-1.93e-04},
+  {88,377,-7.74e-04},
+  {88,378,-1.93e-04},
+  {88,395,-4.84e-05},
+  {88,396,-1.93e-04},
+  {88,397,-4.84e-05},
+  {89,89,8.29e-02},
+  {89,71,-1.03e-02},
+  {89,72,-1.03e-02},
+  {89,73,-1.03e-02},
+  {89,88,-1.03e-02},
+  {89,90,-1.03e-02},
+  {89,107,-1.03e-02},
+  {89,108,-1.03e-02},
+  {89,109,-1.03e-02},
+  {89,360,-4.84e-05},
+  {89,361,-1.93e-04},
+  {89,362,-4.84e-05},
+  {89,377,-1.93e-04},
+  {89,378,-7.74e-04},
+  {89,379,-1.93e-04},
+  {89,396,-4.84e-05},
+  {89,397,-1.93e-04},
+  {89,398,-4.84e-05},
+  {90,90,8.29e-02},
+  {90,72,-1.03e-02},
+  {90,73,-1.03e-02},
+  {90,89,-1.03e-02},
+  {90,91,-1.03e-02},
+  {90,92,-1.03e-02},
+  {90,108,-1.03e-02},
+  {90,109,-1.03e-02},
+  {90,110,-1.03e-02},
+  {90,361,-4.84e-05},
+  {90,362,-1.93e-04},
+  {90,378,-1.93e-04},
+  {90,379,-7.74e-04},
+  {90,380,-1.93e-04},
+  {90,381,-4.84e-05},
+  {90,397,-4.84e-05},
+  {90,398,-1.93e-04},
+  {90,399,-4.84e-05},
+  {91,91,8.29e-02},
+  {91,73,-1.03e-02},
+  {91,90,-1.03e-02},
+  {91,92,-1.03e-02},
+  {91,109,-1.03e-02},
+  {91,110,-1.03e-02},
+  {91,111,-1.03e-02},
+  {91,112,-1.03e-02},
+  {91,113,-1.03e-02},
+  {91,362,-4.84e-05},
+  {91,379,-1.93e-04},
+  {91,380,-7.74e-04},
+  {91,381,-1.93e-04},
+  {91,398,-4.84e-05},
+  {91,399,-1.93e-04},
+  {91,400,-4.84e-05},
+  {91,401,-1.93e-04},
+  {91,402,-4.84e-05},
+  {92,92,8.29e-02},
+  {92,73,-1.03e-02},
+  {92,74,-1.03e-02},
+  {92,90,-1.03e-02},
+  {92,91,-1.03e-02},
+  {92,99,-1.03e-02},
+  {92,112,-1.03e-02},
+  {92,113,-1.03e-02},
+  {92,120,-1.03e-02},
+  {92,362,-1.93e-04},
+  {92,363,-4.84e-05},
+  {92,379,-4.84e-05},
+  {92,380,-1.93e-04},
+  {92,381,-7.74e-04},
+  {92,388,-1.93e-04},
+  {92,401,-4.84e-05},
+  {92,402,-1.93e-04},
+  {92,409,-4.84e-05},
+  {93,93,8.29e-02},
+  {93,65,-1.03e-02},
+  {93,79,-1.03e-02},
+  {93,80,-1.03e-02},
+  {93,82,-1.03e-02},
+  {93,94,-1.03e-02},
+  {93,101,-1.03e-02},
+  {93,114,-1.03e-02},
+  {93,115,-1.03e-02},
+  {93,354,-4.84e-05},
+  {93,368,-4.84e-05},
+  {93,369,-1.93e-04},
+  {93,371,-1.93e-04},
+  {93,382,-7.74e-04},
+  {93,383,-1.93e-04},
+  {93,390,-4.84e-05},
+  {93,403,-4.84e-05},
+  {93,404,-1.93e-04},
+  {94,94,8.29e-02},
+  {94,78,-1.03e-02},
+  {94,79,-1.03e-02},
+  {94,80,-1.03e-02},
+  {94,93,-1.03e-02},
+  {94,95,-1.03e-02},
+  {94,114,-1.03e-02},
+  {94,115,-1.03e-02},
+  {94,117,-1.03e-02},
+  {94,367,-4.84e-05},
+  {94,368,-1.93e-04},
+  {94,369,-4.84e-05},
+  {94,382,-1.93e-04},
+  {94,383,-7.74e-04},
+  {94,384,-1.93e-04},
+  {94,403,-1.93e-04},
+  {94,404,-4.84e-05},
+  {94,406,-4.84e-05},
+  {95,95,8.29e-02},
+  {95,77,-1.03e-02},
+  {95,78,-1.03e-02},
+  {95,79,-1.03e-02},
+  {95,94,-1.03e-02},
+  {95,96,-1.03e-02},
+  {95,114,-1.03e-02},
+  {95,116,-1.03e-02},
+  {95,117,-1.03e-02},
+  {95,366,-4.84e-05},
+  {95,367,-1.93e-04},
+  {95,368,-4.84e-05},
+  {95,383,-1.93e-04},
+  {95,384,-7.74e-04},
+  {95,385,-1.93e-04},
+  {95,403,-4.84e-05},
+  {95,405,-4.84e-05},
+  {95,406,-1.93e-04},
+  {96,96,8.29e-02},
+  {96,76,-1.03e-02},
+  {96,77,-1.03e-02},
+  {96,78,-1.03e-02},
+  {96,95,-1.03e-02},
+  {96,97,-1.03e-02},
+  {96,116,-1.03e-02},
+  {96,117,-1.03e-02},
+  {96,119,-1.03e-02},
+  {96,365,-4.84e-05},
+  {96,366,-1.93e-04},
+  {96,367,-4.84e-05},
+  {96,384,-1.93e-04},
+  {96,385,-7.74e-04},
+  {96,386,-1.93e-04},
+  {96,405,-1.93e-04},
+  {96,406,-4.84e-05},
+  {96,408,-4.84e-05},
+  {97,97,8.29e-02},
+  {97,75,-1.03e-02},
+  {97,76,-1.03e-02},
+  {97,77,-1.03e-02},
+  {97,96,-1.03e-02},
+  {97,98,-1.03e-02},
+  {97,116,-1.03e-02},
+  {97,118,-1.03e-02},
+  {97,119,-1.03e-02},
+  {97,364,-4.84e-05},
+  {97,365,-1.93e-04},
+  {97,366,-4.84e-05},
+  {97,385,-1.93e-04},
+  {97,386,-7.74e-04},
+  {97,387,-1.93e-04},
+  {97,405,-4.84e-05},
+  {97,407,-4.84e-05},
+  {97,408,-1.93e-04},
+  {98,98,8.29e-02},
+  {98,74,-1.03e-02},
+  {98,75,-1.03e-02},
+  {98,76,-1.03e-02},
+  {98,97,-1.03e-02},
+  {98,99,-1.03e-02},
+  {98,118,-1.03e-02},
+  {98,119,-1.03e-02},
+  {98,120,-1.03e-02},
+  {98,363,-4.84e-05},
+  {98,364,-1.93e-04},
+  {98,365,-4.84e-05},
+  {98,386,-1.93e-04},
+  {98,387,-7.74e-04},
+  {98,388,-1.93e-04},
+  {98,407,-1.93e-04},
+  {98,408,-4.84e-05},
+  {98,409,-4.84e-05},
+  {99,99,8.29e-02},
+  {99,73,-1.03e-02},
+  {99,74,-1.03e-02},
+  {99,75,-1.03e-02},
+  {99,92,-1.03e-02},
+  {99,98,-1.03e-02},
+  {99,113,-1.03e-02},
+  {99,118,-1.03e-02},
+  {99,120,-1.03e-02},
+  {99,362,-4.84e-05},
+  {99,363,-1.93e-04},
+  {99,364,-4.84e-05},
+  {99,381,-1.93e-04},
+  {99,387,-1.93e-04},
+  {99,388,-7.74e-04},
+  {99,402,-4.84e-05},
+  {99,407,-4.84e-05},
+  {99,409,-1.93e-04},
+  {100,100,2.08e-01},
+  {100,81,3.65e-02},
+  {100,83,-1.03e-02},
+  {100,102,-1.03e-02},
+  {100,121,3.65e-02},
+  {100,123,-1.03e-02},
+  {100,370,-9.67e-05},
+  {100,372,-4.84e-05},
+  {100,389,-3.87e-04},
+  {100,391,-1.93e-04},
+  {100,410,-9.67e-05},
+  {100,412,-4.84e-05},
+  {101,101,2.08e-01},
+  {101,82,3.65e-02},
+  {101,93,-1.03e-02},
+  {101,115,-1.03e-02},
+  {101,122,3.65e-02},
+  {101,140,-1.03e-02},
+  {101,371,-9.67e-05},
+  {101,382,-4.84e-05},
+  {101,390,-3.87e-04},
+  {101,404,-1.93e-04},
+  {101,411,-9.67e-05},
+  {101,429,-4.84e-05},
+  {102,102,8.29e-02},
+  {102,81,-1.03e-02},
+  {102,83,-1.03e-02},
+  {102,84,-1.03e-02},
+  {102,100,-1.03e-02},
+  {102,103,-1.03e-02},
+  {102,121,-1.03e-02},
+  {102,123,-1.03e-02},
+  {102,124,-1.03e-02},
+  {102,370,-4.84e-05},
+  {102,372,-1.93e-04},
+  {102,373,-4.84e-05},
+  {102,389,-1.93e-04},
+  {102,391,-7.74e-04},
+  {102,392,-1.93e-04},
+  {102,410,-4.84e-05},
+  {102,412,-1.93e-04},
+  {102,413,-4.84e-05},
+  {103,103,8.29e-02},
+  {103,83,-1.03e-02},
+  {103,84,-1.03e-02},
+  {103,85,-1.03e-02},
+  {103,102,-1.03e-02},
+  {103,104,-1.03e-02},
+  {103,123,-1.03e-02},
+  {103,124,-1.03e-02},
+  {103,125,-1.03e-02},
+  {103,372,-4.84e-05},
+  {103,373,-1.93e-04},
+  {103,374,-4.84e-05},
+  {103,391,-1.93e-04},
+  {103,392,-7.74e-04},
+  {103,393,-1.93e-04},
+  {103,412,-4.84e-05},
+  {103,413,-1.93e-04},
+  {103,414,-4.84e-05},
+  {104,104,8.29e-02},
+  {104,84,-1.03e-02},
+  {104,85,-1.03e-02},
+  {104,86,-1.03e-02},
+  {104,103,-1.03e-02},
+  {104,105,-1.03e-02},
+  {104,124,-1.03e-02},
+  {104,125,-1.03e-02},
+  {104,126,-1.03e-02},
+  {104,373,-4.84e-05},
+  {104,374,-1.93e-04},
+  {104,375,-4.84e-05},
+  {104,392,-1.93e-04},
+  {104,393,-7.74e-04},
+  {104,394,-1.93e-04},
+  {104,413,-4.84e-05},
+  {104,414,-1.93e-04},
+  {104,415,-4.84e-05},
+  {105,105,8.29e-02},
+  {105,85,-1.03e-02},
+  {105,86,-1.03e-02},
+  {105,87,-1.03e-02},
+  {105,104,-1.03e-02},
+  {105,106,-1.03e-02},
+  {105,125,-1.03e-02},
+  {105,126,-1.03e-02},
+  {105,127,-1.03e-02},
+  {105,374,-4.84e-05},
+  {105,375,-1.93e-04},
+  {105,376,-4.84e-05},
+  {105,393,-1.93e-04},
+  {105,394,-7.74e-04},
+  {105,395,-1.93e-04},
+  {105,414,-4.84e-05},
+  {105,415,-1.93e-04},
+  {105,416,-4.84e-05},
+  {106,106,8.29e-02},
+  {106,86,-1.03e-02},
+  {106,87,-1.03e-02},
+  {106,88,-1.03e-02},
+  {106,105,-1.03e-02},
+  {106,107,-1.03e-02},
+  {106,126,-1.03e-02},
+  {106,127,-1.03e-02},
+  {106,128,-1.03e-02},
+  {106,375,-4.84e-05},
+  {106,376,-1.93e-04},
+  {106,377,-4.84e-05},
+  {106,394,-1.93e-04},
+  {106,395,-7.74e-04},
+  {106,396,-1.93e-04},
+  {106,415,-4.84e-05},
+  {106,416,-1.93e-04},
+  {106,417,-4.84e-05},
+  {107,107,8.29e-02},
+  {107,87,-1.03e-02},
+  {107,88,-1.03e-02},
+  {107,89,-1.03e-02},
+  {107,106,-1.03e-02},
+  {107,108,-1.03e-02},
+  {107,127,-1.03e-02},
+  {107,128,-1.03e-02},
+  {107,129,-1.03e-02},
+  {107,376,-4.84e-05},
+  {107,377,-1.93e-04},
+  {107,378,-4.84e-05},
+  {107,395,-1.93e-04},
+  {107,396,-7.74e-04},
+  {107,397,-1.93e-04},
+  {107,416,-4.84e-05},
+  {107,417,-1.93e-04},
+  {107,418,-4.84e-05},
+  {108,108,8.29e-02},
+  {108,88,-1.03e-02},
+  {108,89,-1.03e-02},
+  {108,90,-1.03e-02},
+  {108,107,-1.03e-02},
+  {108,109,-1.03e-02},
+  {108,128,-1.03e-02},
+  {108,129,-1.03e-02},
+  {108,130,-1.03e-02},
+  {108,377,-4.84e-05},
+  {108,378,-1.93e-04},
+  {108,379,-4.84e-05},
+  {108,396,-1.93e-04},
+  {108,397,-7.74e-04},
+  {108,398,-1.93e-04},
+  {108,417,-4.84e-05},
+  {108,418,-1.93e-04},
+  {108,419,-4.84e-05},
+  {109,109,8.29e-02},
+  {109,89,-1.03e-02},
+  {109,90,-1.03e-02},
+  {109,91,-1.03e-02},
+  {109,108,-1.03e-02},
+  {109,110,-1.03e-02},
+  {109,129,-1.03e-02},
+  {109,130,-1.03e-02},
+  {109,131,-1.03e-02},
+  {109,378,-4.84e-05},
+  {109,379,-1.93e-04},
+  {109,380,-4.84e-05},
+  {109,397,-1.93e-04},
+  {109,398,-7.74e-04},
+  {109,399,-1.93e-04},
+  {109,418,-4.84e-05},
+  {109,419,-1.93e-04},
+  {109,420,-4.84e-05},
+  {110,110,8.29e-02},
+  {110,90,-1.03e-02},
+  {110,91,-1.03e-02},
+  {110,109,-1.03e-02},
+  {110,111,-1.03e-02},
+  {110,112,-1.03e-02},
+  {110,130,-1.03e-02},
+  {110,131,-1.03e-02},
+  {110,132,-1.03e-02},
+  {110,379,-4.84e-05},
+  {110,380,-1.93e-04},
+  {110,398,-1.93e-04},
+  {110,399,-7.74e-04},
+  {110,400,-1.93e-04},
+  {110,401,-4.84e-05},
+  {110,419,-4.84e-05},
+  {110,420,-1.93e-04},
+  {110,421,-4.84e-05},
+  {111,111,8.29e-02},
+  {111,91,-1.03e-02},
+  {111,110,-1.03e-02},
+  {111,112,-1.03e-02},
+  {111,131,-1.03e-02},
+  {111,132,-1.03e-02},
+  {111,133,-1.03e-02},
+  {111,134,-1.03e-02},
+  {111,135,-1.03e-02},
+  {111,380,-4.84e-05},
+  {111,399,-1.93e-04},
+  {111,400,-7.74e-04},
+  {111,401,-1.93e-04},
+  {111,420,-4.84e-05},
+  {111,421,-1.93e-04},
+  {111,422,-4.84e-05},
+  {111,423,-1.93e-04},
+  {111,424,-4.84e-05},
+  {112,112,8.29e-02},
+  {112,91,-1.03e-02},
+  {112,92,-1.03e-02},
+  {112,110,-1.03e-02},
+  {112,111,-1.03e-02},
+  {112,113,-1.03e-02},
+  {112,134,-1.03e-02},
+  {112,135,-1.03e-02},
+  {112,136,-1.03e-02},
+  {112,380,-1.93e-04},
+  {112,381,-4.84e-05},
+  {112,399,-4.84e-05},
+  {112,400,-1.93e-04},
+  {112,401,-7.74e-04},
+  {112,402,-1.93e-04},
+  {112,423,-4.84e-05},
+  {112,424,-1.93e-04},
+  {112,425,-4.84e-05},
+  {113,113,8.29e-02},
+  {113,91,-1.03e-02},
+  {113,92,-1.03e-02},
+  {113,99,-1.03e-02},
+  {113,112,-1.03e-02},
+  {113,120,-1.03e-02},
+  {113,135,-1.03e-02},
+  {113,136,-1.03e-02},
+  {113,141,-1.03e-02},
+  {113,380,-4.84e-05},
+  {113,381,-1.93e-04},
+  {113,388,-4.84e-05},
+  {113,401,-1.93e-04},
+  {113,402,-7.74e-04},
+  {113,409,-1.93e-04},
+  {113,424,-4.84e-05},
+  {113,425,-1.93e-04},
+  {113,430,-4.84e-05},
+  {114,114,8.29e-02},
+  {114,93,-1.03e-02},
+  {114,94,-1.03e-02},
+  {114,95,-1.03e-02},
+  {114,115,-1.03e-02},
+  {114,117,-1.03e-02},
+  {114,137,-1.03e-02},
+  {114,138,-1.03e-02},
+  {114,140,-1.03e-02},
+  {114,382,-4.84e-05},
+  {114,383,-1.93e-04},
+  {114,384,-4.84e-05},
+  {114,403,-7.74e-04},
+  {114,404,-1.93e-04},
+  {114,406,-1.93e-04},
+  {114,426,-4.84e-05},
+  {114,427,-1.93e-04},
+  {114,429,-4.84e-05},
+  {115,115,8.29e-02},
+  {115,82,-1.03e-02},
+  {115,93,-1.03e-02},
+  {115,94,-1.03e-02},
+  {115,101,-1.03e-02},
+  {115,114,-1.03e-02},
+  {115,122,-1.03e-02},
+  {115,138,-1.03e-02},
+  {115,140,-1.03e-02},
+  {115,371,-4.84e-05},
+  {115,382,-1.93e-04},
+  {115,383,-4.84e-05},
+  {115,390,-1.93e-04},
+  {115,403,-1.93e-04},
+  {115,404,-7.74e-04},
+  {115,411,-4.84e-05},
+  {115,427,-4.84e-05},
+  {115,429,-1.93e-04},
+  {116,116,8.29e-02},
+  {116,95,-1.03e-02},
+  {116,96,-1.03e-02},
+  {116,97,-1.03e-02},
+  {116,117,-1.03e-02},
+  {116,119,-1.03e-02},
+  {116,137,-1.03e-02},
+  {116,139,-1.03e-02},
+  {116,143,-1.03e-02},
+  {116,384,-4.84e-05},
+  {116,385,-1.93e-04},
+  {116,386,-4.84e-05},
+  {116,405,-7.74e-04},
+  {116,406,-1.93e-04},
+  {116,408,-1.93e-04},
+  {116,426,-4.84e-05},
+  {116,428,-1.93e-04},
+  {116,432,-4.84e-05},
+  {117,117,8.29e-02},
+  {117,94,-1.03e-02},
+  {117,95,-1.03e-02},
+  {117,96,-1.03e-02},
+  {117,114,-1.03e-02},
+  {117,116,-1.03e-02},
+  {117,137,-1.03e-02},
+  {117,138,-1.03e-02},
+  {117,139,-1.03e-02},
+  {117,383,-4.84e-05},
+  {117,384,-1.93e-04},
+  {117,385,-4.84e-05},
+  {117,403,-1.93e-04},
+  {117,405,-1.93e-04},
+  {117,406,-7.74e-04},
+  {117,426,-1.93e-04},
+  {117,427,-4.84e-05},
+  {117,428,-4.84e-05},
+  {118,118,8.29e-02},
+  {118,97,-1.03e-02},
+  {118,98,-1.03e-02},
+  {118,99,-1.03e-02},
+  {118,119,-1.03e-02},
+  {118,120,-1.03e-02},
+  {118,141,-1.03e-02},
+  {118,142,-1.03e-02},
+  {118,143,-1.03e-02},
+  {118,386,-4.84e-05},
+  {118,387,-1.93e-04},
+  {118,388,-4.84e-05},
+  {118,407,-7.74e-04},
+  {118,408,-1.93e-04},
+  {118,409,-1.93e-04},
+  {118,430,-4.84e-05},
+  {118,431,-1.93e-04},
+  {118,432,-4.84e-05},
+  {119,119,8.29e-02},
+  {119,96,-1.03e-02},
+  {119,97,-1.03e-02},
+  {119,98,-1.03e-02},
+  {119,116,-1.03e-02},
+  {119,118,-1.03e-02},
+  {119,139,-1.03e-02},
+  {119,142,-1.03e-02},
+  {119,143,-1.03e-02},
+  {119,385,-4.84e-05},
+  {119,386,-1.93e-04},
+  {119,387,-4.84e-05},
+  {119,405,-1.93e-04},
+  {119,407,-1.93e-04},
+  {119,408,-7.74e-04},
+  {119,428,-4.84e-05},
+  {119,431,-4.84e-05},
+  {119,432,-1.93e-04},
+  {120,120,8.29e-02},
+  {120,92,-1.03e-02},
+  {120,98,-1.03e-02},
+  {120,99,-1.03e-02},
+  {120,113,-1.03e-02},
+  {120,118,-1.03e-02},
+  {120,136,-1.03e-02},
+  {120,141,-1.03e-02},
+  {120,142,-1.03e-02},
+  {120,381,-4.84e-05},
+  {120,387,-4.84e-05},
+  {120,388,-1.93e-04},
+  {120,402,-1.93e-04},
+  {120,407,-1.93e-04},
+  {120,409,-7.74e-04},
+  {120,425,-4.84e-05},
+  {120,430,-1.93e-04},
+  {120,431,-4.84e-05},
+  {121,121,2.08e-01},
+  {121,100,3.65e-02},
+  {121,102,-1.03e-02},
+  {121,123,-1.03e-02},
+  {121,144,3.65e-02},
+  {121,146,-1.03e-02},
+  {121,389,-9.67e-05},
+  {121,391,-4.84e-05},
+  {121,410,-3.87e-04},
+  {121,412,-1.93e-04},
+  {121,433,-9.67e-05},
+  {121,435,-4.84e-05},
+  {122,122,2.08e-01},
+  {122,101,3.65e-02},
+  {122,115,-1.03e-02},
+  {122,140,-1.03e-02},
+  {122,145,3.65e-02},
+  {122,165,-1.03e-02},
+  {122,390,-9.67e-05},
+  {122,404,-4.84e-05},
+  {122,411,-3.87e-04},
+  {122,429,-1.93e-04},
+  {122,434,-9.67e-05},
+  {122,454,-4.84e-05},
+  {123,123,8.29e-02},
+  {123,100,-1.03e-02},
+  {123,102,-1.03e-02},
+  {123,103,-1.03e-02},
+  {123,121,-1.03e-02},
+  {123,124,-1.03e-02},
+  {123,144,-1.03e-02},
+  {123,146,-1.03e-02},
+  {123,147,-1.03e-02},
+  {123,389,-4.84e-05},
+  {123,391,-1.93e-04},
+  {123,392,-4.84e-05},
+  {123,410,-1.93e-04},
+  {123,412,-7.74e-04},
+  {123,413,-1.93e-04},
+  {123,433,-4.84e-05},
+  {123,435,-1.93e-04},
+  {123,436,-4.84e-05},
+  {124,124,8.29e-02},
+  {124,102,-1.03e-02},
+  {124,103,-1.03e-02},
+  {124,104,-1.03e-02},
+  {124,123,-1.03e-02},
+  {124,125,-1.03e-02},
+  {124,146,-1.03e-02},
+  {124,147,-1.03e-02},
+  {124,148,-1.03e-02},
+  {124,391,-4.84e-05},
+  {124,392,-1.93e-04},
+  {124,393,-4.84e-05},
+  {124,412,-1.93e-04},
+  {124,413,-7.74e-04},
+  {124,414,-1.93e-04},
+  {124,435,-4.84e-05},
+  {124,436,-1.93e-04},
+  {124,437,-4.84e-05},
+  {125,125,8.29e-02},
+  {125,103,-1.03e-02},
+  {125,104,-1.03e-02},
+  {125,105,-1.03e-02},
+  {125,124,-1.03e-02},
+  {125,126,-1.03e-02},
+  {125,147,-1.03e-02},
+  {125,148,-1.03e-02},
+  {125,149,-1.03e-02},
+  {125,392,-4.84e-05},
+  {125,393,-1.93e-04},
+  {125,394,-4.84e-05},
+  {125,413,-1.93e-04},
+  {125,414,-7.74e-04},
+  {125,415,-1.93e-04},
+  {125,436,-4.84e-05},
+  {125,437,-1.93e-04},
+  {125,438,-4.84e-05},
+  {126,126,8.29e-02},
+  {126,104,-1.03e-02},
+  {126,105,-1.03e-02},
+  {126,106,-1.03e-02},
+  {126,125,-1.03e-02},
+  {126,127,-1.03e-02},
+  {126,148,-1.03e-02},
+  {126,149,-1.03e-02},
+  {126,150,-1.03e-02},
+  {126,393,-4.84e-05},
+  {126,394,-1.93e-04},
+  {126,395,-4.84e-05},
+  {126,414,-1.93e-04},
+  {126,415,-7.74e-04},
+  {126,416,-1.93e-04},
+  {126,437,-4.84e-05},
+  {126,438,-1.93e-04},
+  {126,439,-4.84e-05},
+  {127,127,8.29e-02},
+  {127,105,-1.03e-02},
+  {127,106,-1.03e-02},
+  {127,107,-1.03e-02},
+  {127,126,-1.03e-02},
+  {127,128,-1.03e-02},
+  {127,149,-1.03e-02},
+  {127,150,-1.03e-02},
+  {127,151,-1.03e-02},
+  {127,394,-4.84e-05},
+  {127,395,-1.93e-04},
+  {127,396,-4.84e-05},
+  {127,415,-1.93e-04},
+  {127,416,-7.74e-04},
+  {127,417,-1.93e-04},
+  {127,438,-4.84e-05},
+  {127,439,-1.93e-04},
+  {127,440,-4.84e-05},
+  {128,128,8.29e-02},
+  {128,106,-1.03e-02},
+  {128,107,-1.03e-02},
+  {128,108,-1.03e-02},
+  {128,127,-1.03e-02},
+  {128,129,-1.03e-02},
+  {128,150,-1.03e-02},
+  {128,151,-1.03e-02},
+  {128,152,-1.03e-02},
+  {128,395,-4.84e-05},
+  {128,396,-1.93e-04},
+  {128,397,-4.84e-05},
+  {128,416,-1.93e-04},
+  {128,417,-7.74e-04},
+  {128,418,-1.93e-04},
+  {128,439,-4.84e-05},
+  {128,440,-1.93e-04},
+  {128,441,-4.84e-05},
+  {129,129,8.29e-02},
+  {129,107,-1.03e-02},
+  {129,108,-1.03e-02},
+  {129,109,-1.03e-02},
+  {129,128,-1.03e-02},
+  {129,130,-1.03e-02},
+  {129,151,-1.03e-02},
+  {129,152,-1.03e-02},
+  {129,153,-1.03e-02},
+  {129,396,-4.84e-05},
+  {129,397,-1.93e-04},
+  {129,398,-4.84e-05},
+  {129,417,-1.93e-04},
+  {129,418,-7.74e-04},
+  {129,419,-1.93e-04},
+  {129,440,-4.84e-05},
+  {129,441,-1.93e-04},
+  {129,442,-4.84e-05},
+  {130,130,8.29e-02},
+  {130,108,-1.03e-02},
+  {130,109,-1.03e-02},
+  {130,110,-1.03e-02},
+  {130,129,-1.03e-02},
+  {130,131,-1.03e-02},
+  {130,152,-1.03e-02},
+  {130,153,-1.03e-02},
+  {130,154,-1.03e-02},
+  {130,397,-4.84e-05},
+  {130,398,-1.93e-04},
+  {130,399,-4.84e-05},
+  {130,418,-1.93e-04},
+  {130,419,-7.74e-04},
+  {130,420,-1.93e-04},
+  {130,441,-4.84e-05},
+  {130,442,-1.93e-04},
+  {130,443,-4.84e-05},
+  {131,131,8.29e-02},
+  {131,109,-1.03e-02},
+  {131,110,-1.03e-02},
+  {131,111,-1.03e-02},
+  {131,130,-1.03e-02},
+  {131,132,-1.03e-02},
+  {131,153,-1.03e-02},
+  {131,154,-1.03e-02},
+  {131,155,-1.03e-02},
+  {131,398,-4.84e-05},
+  {131,399,-1.93e-04},
+  {131,400,-4.84e-05},
+  {131,419,-1.93e-04},
+  {131,420,-7.74e-04},
+  {131,421,-1.93e-04},
+  {131,442,-4.84e-05},
+  {131,443,-1.93e-04},
+  {131,444,-4.84e-05},
+  {132,132,8.29e-02},
+  {132,110,-1.03e-02},
+  {132,111,-1.03e-02},
+  {132,131,-1.03e-02},
+  {132,133,-1.03e-02},
+  {132,134,-1.03e-02},
+  {132,154,-1.03e-02},
+  {132,155,-1.03e-02},
+  {132,156,-1.03e-02},
+  {132,399,-4.84e-05},
+  {132,400,-1.93e-04},
+  {132,420,-1.93e-04},
+  {132,421,-7.74e-04},
+  {132,422,-1.93e-04},
+  {132,423,-4.84e-05},
+  {132,443,-4.84e-05},
+  {132,444,-1.93e-04},
+  {132,445,-4.84e-05},
+  {133,133,8.29e-02},
+  {133,111,-1.03e-02},
+  {133,132,-1.03e-02},
+  {133,134,-1.03e-02},
+  {133,155,-1.03e-02},
+  {133,156,-1.03e-02},
+  {133,157,-1.03e-02},
+  {133,158,-1.03e-02},
+  {133,159,-1.03e-02},
+  {133,400,-4.84e-05},
+  {133,421,-1.93e-04},
+  {133,422,-7.74e-04},
+  {133,423,-1.93e-04},
+  {133,444,-4.84e-05},
+  {133,445,-1.93e-04},
+  {133,446,-4.84e-05},
+  {133,447,-1.93e-04},
+  {133,448,-4.84e-05},
+  {134,134,8.29e-02},
+  {134,111,-1.03e-02},
+  {134,112,-1.03e-02},
+  {134,132,-1.03e-02},
+  {134,133,-1.03e-02},
+  {134,135,-1.03e-02},
+  {134,158,-1.03e-02},
+  {134,159,-1.03e-02},
+  {134,160,-1.03e-02},
+  {134,400,-1.93e-04},
+  {134,401,-4.84e-05},
+  {134,421,-4.84e-05},
+  {134,422,-1.93e-04},
+  {134,423,-7.74e-04},
+  {134,424,-1.93e-04},
+  {134,447,-4.84e-05},
+  {134,448,-1.93e-04},
+  {134,449,-4.84e-05},
+  {135,135,8.29e-02},
+  {135,111,-1.03e-02},
+  {135,112,-1.03e-02},
+  {135,113,-1.03e-02},
+  {135,134,-1.03e-02},
+  {135,136,-1.03e-02},
+  {135,159,-1.03e-02},
+  {135,160,-1.03e-02},
+  {135,161,-1.03e-02},
+  {135,400,-4.84e-05},
+  {135,401,-1.93e-04},
+  {135,402,-4.84e-05},
+  {135,423,-1.93e-04},
+  {135,424,-7.74e-04},
+  {135,425,-1.93e-04},
+  {135,448,-4.84e-05},
+  {135,449,-1.93e-04},
+  {135,450,-4.84e-05},
+  {136,136,8.29e-02},
+  {136,112,-1.03e-02},
+  {136,113,-1.03e-02},
+  {136,120,-1.03e-02},
+  {136,135,-1.03e-02},
+  {136,141,-1.03e-02},
+  {136,160,-1.03e-02},
+  {136,161,-1.03e-02},
+  {136,166,-1.03e-02},
+  {136,401,-4.84e-05},
+  {136,402,-1.93e-04},
+  {136,409,-4.84e-05},
+  {136,424,-1.93e-04},
+  {136,425,-7.74e-04},
+  {136,430,-1.93e-04},
+  {136,449,-4.84e-05},
+  {136,450,-1.93e-04},
+  {136,455,-4.84e-05},
+  {137,137,8.29e-02},
+  {137,114,-1.03e-02},
+  {137,116,-1.03e-02},
+  {137,117,-1.03e-02},
+  {137,138,-1.03e-02},
+  {137,139,-1.03e-02},
+  {137,162,-1.03e-02},
+  {137,163,-1.03e-02},
+  {137,164,-1.03e-02},
+  {137,403,-4.84e-05},
+  {137,405,-4.84e-05},
+  {137,406,-1.93e-04},
+  {137,426,-7.74e-04},
+  {137,427,-1.93e-04},
+  {137,428,-1.93e-04},
+  {137,451,-4.84e-05},
+  {137,452,-1.93e-04},
+  {137,453,-4.84e-05},
+  {138,138,8.29e-02},
+  {138,114,-1.03e-02},
+  {138,115,-1.03e-02},
+  {138,117,-1.03e-02},
+  {138,137,-1.03e-02},
+  {138,140,-1.03e-02},
+  {138,163,-1.03e-02},
+  {138,164,-1.03e-02},
+  {138,165,-1.03e-02},
+  {138,403,-1.93e-04},
+  {138,404,-4.84e-05},
+  {138,406,-4.84e-05},
+  {138,426,-1.93e-04},
+  {138,427,-7.74e-04},
+  {138,429,-1.93e-04},
+  {138,452,-4.84e-05},
+  {138,453,-1.93e-04},
+  {138,454,-4.84e-05},
+  {139,139,8.29e-02},
+  {139,116,-1.03e-02},
+  {139,117,-1.03e-02},
+  {139,119,-1.03e-02},
+  {139,137,-1.03e-02},
+  {139,143,-1.03e-02},
+  {139,162,-1.03e-02},
+  {139,163,-1.03e-02},
+  {139,168,-1.03e-02},
+  {139,405,-1.93e-04},
+  {139,406,-4.84e-05},
+  {139,408,-4.84e-05},
+  {139,426,-1.93e-04},
+  {139,428,-7.74e-04},
+  {139,432,-1.93e-04},
+  {139,451,-1.93e-04},
+  {139,452,-4.84e-05},
+  {139,457,-4.84e-05},
+  {140,140,8.29e-02},
+  {140,101,-1.03e-02},
+  {140,114,-1.03e-02},
+  {140,115,-1.03e-02},
+  {140,122,-1.03e-02},
+  {140,138,-1.03e-02},
+  {140,145,-1.03e-02},
+  {140,164,-1.03e-02},
+  {140,165,-1.03e-02},
+  {140,390,-4.84e-05},
+  {140,403,-4.84e-05},
+  {140,404,-1.93e-04},
+  {140,411,-1.93e-04},
+  {140,427,-1.93e-04},
+  {140,429,-7.74e-04},
+  {140,434,-4.84e-05},
+  {140,453,-4.84e-05},
+  {140,454,-1.93e-04},
+  {141,141,8.29e-02},
+  {141,113,-1.03e-02},
+  {141,118,-1.03e-02},
+  {141,120,-1.03e-02},
+  {141,136,-1.03e-02},
+  {141,142,-1.03e-02},
+  {141,161,-1.03e-02},
+  {141,166,-1.03e-02},
+  {141,167,-1.03e-02},
+  {141,402,-4.84e-05},
+  {141,407,-4.84e-05},
+  {141,409,-1.93e-04},
+  {141,425,-1.93e-04},
+  {141,430,-7.74e-04},
+  {141,431,-1.93e-04},
+  {141,450,-4.84e-05},
+  {141,455,-1.93e-04},
+  {141,456,-4.84e-05},
+  {142,142,8.29e-02},
+  {142,118,-1.03e-02},
+  {142,119,-1.03e-02},
+  {142,120,-1.03e-02},
+  {142,141,-1.03e-02},
+  {142,143,-1.03e-02},
+  {142,166,-1.03e-02},
+  {142,167,-1.03e-02},
+  {142,168,-1.03e-02},
+  {142,407,-1.93e-04},
+  {142,408,-4.84e-05},
+  {142,409,-4.84e-05},
+  {142,430,-1.93e-04},
+  {142,431,-7.74e-04},
+  {142,432,-1.93e-04},
+  {142,455,-4.84e-05},
+  {142,456,-1.93e-04},
+  {142,457,-4.84e-05},
+  {143,143,8.29e-02},
+  {143,116,-1.03e-02},
+  {143,118,-1.03e-02},
+  {143,119,-1.03e-02},
+  {143,139,-1.03e-02},
+  {143,142,-1.03e-02},
+  {143,162,-1.03e-02},
+  {143,167,-1.03e-02},
+  {143,168,-1.03e-02},
+  {143,405,-4.84e-05},
+  {143,407,-4.84e-05},
+  {143,408,-1.93e-04},
+  {143,428,-1.93e-04},
+  {143,431,-1.93e-04},
+  {143,432,-7.74e-04},
+  {143,451,-4.84e-05},
+  {143,456,-4.84e-05},
+  {143,457,-1.93e-04},
+  {144,144,2.08e-01},
+  {144,121,3.65e-02},
+  {144,123,-1.03e-02},
+  {144,146,-1.03e-02},
+  {144,169,3.65e-02},
+  {144,171,-1.03e-02},
+  {144,410,-9.67e-05},
+  {144,412,-4.84e-05},
+  {144,433,-3.87e-04},
+  {144,435,-1.93e-04},
+  {144,458,-9.67e-05},
+  {144,460,-4.84e-05},
+  {145,145,2.08e-01},
+  {145,122,3.65e-02},
+  {145,140,-1.03e-02},
+  {145,165,-1.03e-02},
+  {145,170,3.65e-02},
+  {145,193,-1.03e-02},
+  {145,411,-9.67e-05},
+  {145,429,-4.84e-05},
+  {145,434,-3.87e-04},
+  {145,454,-1.93e-04},
+  {145,459,-9.67e-05},
+  {145,482,-4.84e-05},
+  {146,146,8.29e-02},
+  {146,121,-1.03e-02},
+  {146,123,-1.03e-02},
+  {146,124,-1.03e-02},
+  {146,144,-1.03e-02},
+  {146,147,-1.03e-02},
+  {146,169,-1.03e-02},
+  {146,171,-1.03e-02},
+  {146,172,-1.03e-02},
+  {146,410,-4.84e-05},
+  {146,412,-1.93e-04},
+  {146,413,-4.84e-05},
+  {146,433,-1.93e-04},
+  {146,435,-7.74e-04},
+  {146,436,-1.93e-04},
+  {146,458,-4.84e-05},
+  {146,460,-1.93e-04},
+  {146,461,-4.84e-05},
+  {147,147,8.29e-02},
+  {147,123,-1.03e-02},
+  {147,124,-1.03e-02},
+  {147,125,-1.03e-02},
+  {147,146,-1.03e-02},
+  {147,148,-1.03e-02},
+  {147,171,-1.03e-02},
+  {147,172,-1.03e-02},
+  {147,173,-1.03e-02},
+  {147,412,-4.84e-05},
+  {147,413,-1.93e-04},
+  {147,414,-4.84e-05},
+  {147,435,-1.93e-04},
+  {147,436,-7.74e-04},
+  {147,437,-1.93e-04},
+  {147,460,-4.84e-05},
+  {147,461,-1.93e-04},
+  {147,462,-4.84e-05},
+  {148,148,8.29e-02},
+  {148,124,-1.03e-02},
+  {148,125,-1.03e-02},
+  {148,126,-1.03e-02},
+  {148,147,-1.03e-02},
+  {148,149,-1.03e-02},
+  {148,172,-1.03e-02},
+  {148,173,-1.03e-02},
+  {148,174,-1.03e-02},
+  {148,413,-4.84e-05},
+  {148,414,-1.93e-04},
+  {148,415,-4.84e-05},
+  {148,436,-1.93e-04},
+  {148,437,-7.74e-04},
+  {148,438,-1.93e-04},
+  {148,461,-4.84e-05},
+  {148,462,-1.93e-04},
+  {148,463,-4.84e-05},
+  {149,149,8.29e-02},
+  {149,125,-1.03e-02},
+  {149,126,-1.03e-02},
+  {149,127,-1.03e-02},
+  {149,148,-1.03e-02},
+  {149,150,-1.03e-02},
+  {149,173,-1.03e-02},
+  {149,174,-1.03e-02},
+  {149,175,-1.03e-02},
+  {149,414,-4.84e-05},
+  {149,415,-1.93e-04},
+  {149,416,-4.84e-05},
+  {149,437,-1.93e-04},
+  {149,438,-7.74e-04},
+  {149,439,-1.93e-04},
+  {149,462,-4.84e-05},
+  {149,463,-1.93e-04},
+  {149,464,-4.84e-05},
+  {150,150,8.29e-02},
+  {150,126,-1.03e-02},
+  {150,127,-1.03e-02},
+  {150,128,-1.03e-02},
+  {150,149,-1.03e-02},
+  {150,151,-1.03e-02},
+  {150,174,-1.03e-02},
+  {150,175,-1.03e-02},
+  {150,176,-1.03e-02},
+  {150,415,-4.84e-05},
+  {150,416,-1.93e-04},
+  {150,417,-4.84e-05},
+  {150,438,-1.93e-04},
+  {150,439,-7.74e-04},
+  {150,440,-1.93e-04},
+  {150,463,-4.84e-05},
+  {150,464,-1.93e-04},
+  {150,465,-4.84e-05},
+  {151,151,8.29e-02},
+  {151,127,-1.03e-02},
+  {151,128,-1.03e-02},
+  {151,129,-1.03e-02},
+  {151,150,-1.03e-02},
+  {151,152,-1.03e-02},
+  {151,175,-1.03e-02},
+  {151,176,-1.03e-02},
+  {151,177,-1.03e-02},
+  {151,416,-4.84e-05},
+  {151,417,-1.93e-04},
+  {151,418,-4.84e-05},
+  {151,439,-1.93e-04},
+  {151,440,-7.74e-04},
+  {151,441,-1.93e-04},
+  {151,464,-4.84e-05},
+  {151,465,-1.93e-04},
+  {151,466,-4.84e-05},
+  {152,152,8.29e-02},
+  {152,128,-1.03e-02},
+  {152,129,-1.03e-02},
+  {152,130,-1.03e-02},
+  {152,151,-1.03e-02},
+  {152,153,-1.03e-02},
+  {152,176,-1.03e-02},
+  {152,177,-1.03e-02},
+  {152,178,-1.03e-02},
+  {152,417,-4.84e-05},
+  {152,418,-1.93e-04},
+  {152,419,-4.84e-05},
+  {152,440,-1.93e-04},
+  {152,441,-7.74e-04},
+  {152,442,-1.93e-04},
+  {152,465,-4.84e-05},
+  {152,466,-1.93e-04},
+  {152,467,-4.84e-05},
+  {153,153,8.29e-02},
+  {153,129,-1.03e-02},
+  {153,130,-1.03e-02},
+  {153,131,-1.03e-02},
+  {153,152,-1.03e-02},
+  {153,154,-1.03e-02},
+  {153,177,-1.03e-02},
+  {153,178,-1.03e-02},
+  {153,179,-1.03e-02},
+  {153,418,-4.84e-05},
+  {153,419,-1.93e-04},
+  {153,420,-4.84e-05},
+  {153,441,-1.93e-04},
+  {153,442,-7.74e-04},
+  {153,443,-1.93e-04},
+  {153,466,-4.84e-05},
+  {153,467,-1.93e-04},
+  {153,468,-4.84e-05},
+  {154,154,8.29e-02},
+  {154,130,-1.03e-02},
+  {154,131,-1.03e-02},
+  {154,132,-1.03e-02},
+  {154,153,-1.03e-02},
+  {154,155,-1.03e-02},
+  {154,178,-1.03e-02},
+  {154,179,-1.03e-02},
+  {154,180,-1.03e-02},
+  {154,419,-4.84e-05},
+  {154,420,-1.93e-04},
+  {154,421,-4.84e-05},
+  {154,442,-1.93e-04},
+  {154,443,-7.74e-04},
+  {154,444,-1.93e-04},
+  {154,467,-4.84e-05},
+  {154,468,-1.93e-04},
+  {154,469,-4.84e-05},
+  {155,155,8.29e-02},
+  {155,131,-1.03e-02},
+  {155,132,-1.03e-02},
+  {155,133,-1.03e-02},
+  {155,154,-1.03e-02},
+  {155,156,-1.03e-02},
+  {155,179,-1.03e-02},
+  {155,180,-1.03e-02},
+  {155,181,-1.03e-02},
+  {155,420,-4.84e-05},
+  {155,421,-1.93e-04},
+  {155,422,-4.84e-05},
+  {155,443,-1.93e-04},
+  {155,444,-7.74e-04},
+  {155,445,-1.93e-04},
+  {155,468,-4.84e-05},
+  {155,469,-1.93e-04},
+  {155,470,-4.84e-05},
+  {156,156,8.29e-02},
+  {156,132,-1.03e-02},
+  {156,133,-1.03e-02},
+  {156,155,-1.03e-02},
+  {156,157,-1.03e-02},
+  {156,158,-1.03e-02},
+  {156,180,-1.03e-02},
+  {156,181,-1.03e-02},
+  {156,182,-1.03e-02},
+  {156,421,-4.84e-05},
+  {156,422,-1.93e-04},
+  {156,444,-1.93e-04},
+  {156,445,-7.74e-04},
+  {156,446,-1.93e-04},
+  {156,447,-4.84e-05},
+  {156,469,-4.84e-05},
+  {156,470,-1.93e-04},
+  {156,471,-4.84e-05},
+  {157,157,8.29e-02},
+  {157,133,-1.03e-02},
+  {157,156,-1.03e-02},
+  {157,158,-1.03e-02},
+  {157,181,-1.03e-02},
+  {157,182,-1.03e-02},
+  {157,183,-1.03e-02},
+  {157,184,-1.03e-02},
+  {157,188,-1.03e-02},
+  {157,422,-4.84e-05},
+  {157,445,-1.93e-04},
+  {157,446,-7.74e-04},
+  {157,447,-1.93e-04},
+  {157,470,-4.84e-05},
+  {157,471,-1.93e-04},
+  {157,472,-4.84e-05},
+  {157,473,-1.93e-04},
+  {157,477,-4.84e-05},
+  {158,158,8.29e-02},
+  {158,133,-1.03e-02},
+  {158,134,-1.03e-02},
+  {158,156,-1.03e-02},
+  {158,157,-1.03e-02},
+  {158,159,-1.03e-02},
+  {158,184,-1.03e-02},
+  {158,187,-1.03e-02},
+  {158,188,-1.03e-02},
+  {158,422,-1.93e-04},
+  {158,423,-4.84e-05},
+  {158,445,-4.84e-05},
+  {158,446,-1.93e-04},
+  {158,447,-7.74e-04},
+  {158,448,-1.93e-04},
+  {158,473,-4.84e-05},
+  {158,476,-4.84e-05},
+  {158,477,-1.93e-04},
+  {159,159,8.29e-02},
+  {159,133,-1.03e-02},
+  {159,134,-1.03e-02},
+  {159,135,-1.03e-02},
+  {159,158,-1.03e-02},
+  {159,160,-1.03e-02},
+  {159,185,-1.03e-02},
+  {159,187,-1.03e-02},
+  {159,188,-1.03e-02},
+  {159,422,-4.84e-05},
+  {159,423,-1.93e-04},
+  {159,424,-4.84e-05},
+  {159,447,-1.93e-04},
+  {159,448,-7.74e-04},
+  {159,449,-1.93e-04},
+  {159,474,-4.84e-05},
+  {159,476,-1.93e-04},
+  {159,477,-4.84e-05},
+  {160,160,8.29e-02},
+  {160,134,-1.03e-02},
+  {160,135,-1.03e-02},
+  {160,136,-1.03e-02},
+  {160,159,-1.03e-02},
+  {160,161,-1.03e-02},
+  {160,185,-1.03e-02},
+  {160,186,-1.03e-02},
+  {160,187,-1.03e-02},
+  {160,423,-4.84e-05},
+  {160,424,-1.93e-04},
+  {160,425,-4.84e-05},
+  {160,448,-1.93e-04},
+  {160,449,-7.74e-04},
+  {160,450,-1.93e-04},
+  {160,474,-1.93e-04},
+  {160,475,-4.84e-05},
+  {160,476,-4.84e-05},
+  {161,161,8.29e-02},
+  {161,135,-1.03e-02},
+  {161,136,-1.03e-02},
+  {161,141,-1.03e-02},
+  {161,160,-1.03e-02},
+  {161,166,-1.03e-02},
+  {161,185,-1.03e-02},
+  {161,186,-1.03e-02},
+  {161,192,-1.03e-02},
+  {161,424,-4.84e-05},
+  {161,425,-1.93e-04},
+  {161,430,-4.84e-05},
+  {161,449,-1.93e-04},
+  {161,450,-7.74e-04},
+  {161,455,-1.93e-04},
+  {161,474,-4.84e-05},
+  {161,475,-1.93e-04},
+  {161,481,-4.84e-05},
+  {162,162,8.29e-02},
+  {162,137,-1.03e-02},
+  {162,139,-1.03e-02},
+  {162,143,-1.03e-02},
+  {162,163,-1.03e-02},
+  {162,168,-1.03e-02},
+  {162,189,-1.03e-02},
+  {162,190,-1.03e-02},
+  {162,195,-1.03e-02},
+  {162,426,-4.84e-05},
+  {162,428,-1.93e-04},
+  {162,432,-4.84e-05},
+  {162,451,-7.74e-04},
+  {162,452,-1.93e-04},
+  {162,457,-1.93e-04},
+  {162,478,-4.84e-05},
+  {162,479,-1.93e-04},
+  {162,484,-4.84e-05},
+  {163,163,8.29e-02},
+  {163,137,-1.03e-02},
+  {163,138,-1.03e-02},
+  {163,139,-1.03e-02},
+  {163,162,-1.03e-02},
+  {163,164,-1.03e-02},
+  {163,190,-1.03e-02},
+  {163,194,-1.03e-02},
+  {163,195,-1.03e-02},
+  {163,426,-1.93e-04},
+  {163,427,-4.84e-05},
+  {163,428,-4.84e-05},
+  {163,451,-1.93e-04},
+  {163,452,-7.74e-04},
+  {163,453,-1.93e-04},
+  {163,479,-4.84e-05},
+  {163,483,-4.84e-05},
+  {163,484,-1.93e-04},
+  {164,164,8.29e-02},
+  {164,137,-1.03e-02},
+  {164,138,-1.03e-02},
+  {164,140,-1.03e-02},
+  {164,163,-1.03e-02},
+  {164,165,-1.03e-02},
+  {164,193,-1.03e-02},
+  {164,194,-1.03e-02},
+  {164,195,-1.03e-02},
+  {164,426,-4.84e-05},
+  {164,427,-1.93e-04},
+  {164,429,-4.84e-05},
+  {164,452,-1.93e-04},
+  {164,453,-7.74e-04},
+  {164,454,-1.93e-04},
+  {164,482,-4.84e-05},
+  {164,483,-1.93e-04},
+  {164,484,-4.84e-05},
+  {165,165,8.29e-02},
+  {165,122,-1.03e-02},
+  {165,138,-1.03e-02},
+  {165,140,-1.03e-02},
+  {165,145,-1.03e-02},
+  {165,164,-1.03e-02},
+  {165,170,-1.03e-02},
+  {165,193,-1.03e-02},
+  {165,194,-1.03e-02},
+  {165,411,-4.84e-05},
+  {165,427,-4.84e-05},
+  {165,429,-1.93e-04},
+  {165,434,-1.93e-04},
+  {165,453,-1.93e-04},
+  {165,454,-7.74e-04},
+  {165,459,-4.84e-05},
+  {165,482,-1.93e-04},
+  {165,483,-4.84e-05},
+  {166,166,8.29e-02},
+  {166,136,-1.03e-02},
+  {166,141,-1.03e-02},
+  {166,142,-1.03e-02},
+  {166,161,-1.03e-02},
+  {166,167,-1.03e-02},
+  {166,186,-1.03e-02},
+  {166,191,-1.03e-02},
+  {166,192,-1.03e-02},
+  {166,425,-4.84e-05},
+  {166,430,-1.93e-04},
+  {166,431,-4.84e-05},
+  {166,450,-1.93e-04},
+  {166,455,-7.74e-04},
+  {166,456,-1.93e-04},
+  {166,475,-4.84e-05},
+  {166,480,-4.84e-05},
+  {166,481,-1.93e-04},
+  {167,167,8.29e-02},
+  {167,141,-1.03e-02},
+  {167,142,-1.03e-02},
+  {167,143,-1.03e-02},
+  {167,166,-1.03e-02},
+  {167,168,-1.03e-02},
+  {167,189,-1.03e-02},
+  {167,191,-1.03e-02},
+  {167,192,-1.03e-02},
+  {167,430,-4.84e-05},
+  {167,431,-1.93e-04},
+  {167,432,-4.84e-05},
+  {167,455,-1.93e-04},
+  {167,456,-7.74e-04},
+  {167,457,-1.93e-04},
+  {167,478,-4.84e-05},
+  {167,480,-1.93e-04},
+  {167,481,-4.84e-05},
+  {168,168,8.29e-02},
+  {168,139,-1.03e-02},
+  {168,142,-1.03e-02},
+  {168,143,-1.03e-02},
+  {168,162,-1.03e-02},
+  {168,167,-1.03e-02},
+  {168,189,-1.03e-02},
+  {168,190,-1.03e-02},
+  {168,191,-1.03e-02},
+  {168,428,-4.84e-05},
+  {168,431,-4.84e-05},
+  {168,432,-1.93e-04},
+  {168,451,-1.93e-04},
+  {168,456,-1.93e-04},
+  {168,457,-7.74e-04},
+  {168,478,-1.93e-04},
+  {168,479,-4.84e-05},
+  {168,480,-4.84e-05},
+  {169,169,2.08e-01},
+  {169,144,3.65e-02},
+  {169,146,-1.03e-02},
+  {169,171,-1.03e-02},
+  {169,196,3.65e-02},
+  {169,198,-1.03e-02},
+  {169,433,-9.67e-05},
+  {169,435,-4.84e-05},
+  {169,458,-3.87e-04},
+  {169,460,-1.93e-04},
+  {169,485,-9.67e-05},
+  {169,487,-4.84e-05},
+  {170,170,2.08e-01},
+  {170,145,3.65e-02},
+  {170,165,-1.03e-02},
+  {170,193,-1.03e-02},
+  {170,197,3.65e-02},
+  {170,223,-1.03e-02},
+  {170,434,-9.67e-05},
+  {170,454,-4.84e-05},
+  {170,459,-3.87e-04},
+  {170,482,-1.93e-04},
+  {170,486,-9.67e-05},
+  {170,512,-4.84e-05},
+  {171,171,8.29e-02},
+  {171,144,-1.03e-02},
+  {171,146,-1.03e-02},
+  {171,147,-1.03e-02},
+  {171,169,-1.03e-02},
+  {171,172,-1.03e-02},
+  {171,196,-1.03e-02},
+  {171,198,-1.03e-02},
+  {171,199,-1.03e-02},
+  {171,433,-4.84e-05},
+  {171,435,-1.93e-04},
+  {171,436,-4.84e-05},
+  {171,458,-1.93e-04},
+  {171,460,-7.74e-04},
+  {171,461,-1.93e-04},
+  {171,485,-4.84e-05},
+  {171,487,-1.93e-04},
+  {171,488,-4.84e-05},
+  {172,172,8.29e-02},
+  {172,146,-1.03e-02},
+  {172,147,-1.03e-02},
+  {172,148,-1.03e-02},
+  {172,171,-1.03e-02},
+  {172,173,-1.03e-02},
+  {172,198,-1.03e-02},
+  {172,199,-1.03e-02},
+  {172,200,-1.03e-02},
+  {172,435,-4.84e-05},
+  {172,436,-1.93e-04},
+  {172,437,-4.84e-05},
+  {172,460,-1.93e-04},
+  {172,461,-7.74e-04},
+  {172,462,-1.93e-04},
+  {172,487,-4.84e-05},
+  {172,488,-1.93e-04},
+  {172,489,-4.84e-05},
+  {173,173,8.29e-02},
+  {173,147,-1.03e-02},
+  {173,148,-1.03e-02},
+  {173,149,-1.03e-02},
+  {173,172,-1.03e-02},
+  {173,174,-1.03e-02},
+  {173,199,-1.03e-02},
+  {173,200,-1.03e-02},
+  {173,201,-1.03e-02},
+  {173,436,-4.84e-05},
+  {173,437,-1.93e-04},
+  {173,438,-4.84e-05},
+  {173,461,-1.93e-04},
+  {173,462,-7.74e-04},
+  {173,463,-1.93e-04},
+  {173,488,-4.84e-05},
+  {173,489,-1.93e-04},
+  {173,490,-4.84e-05},
+  {174,174,8.29e-02},
+  {174,148,-1.03e-02},
+  {174,149,-1.03e-02},
+  {174,150,-1.03e-02},
+  {174,173,-1.03e-02},
+  {174,175,-1.03e-02},
+  {174,200,-1.03e-02},
+  {174,201,-1.03e-02},
+  {174,202,-1.03e-02},
+  {174,437,-4.84e-05},
+  {174,438,-1.93e-04},
+  {174,439,-4.84e-05},
+  {174,462,-1.93e-04},
+  {174,463,-7.74e-04},
+  {174,464,-1.93e-04},
+  {174,489,-4.84e-05},
+  {174,490,-1.93e-04},
+  {174,491,-4.84e-05},
+  {175,175,8.29e-02},
+  {175,149,-1.03e-02},
+  {175,150,-1.03e-02},
+  {175,151,-1.03e-02},
+  {175,174,-1.03e-02},
+  {175,176,-1.03e-02},
+  {175,201,-1.03e-02},
+  {175,202,-1.03e-02},
+  {175,203,-1.03e-02},
+  {175,438,-4.84e-05},
+  {175,439,-1.93e-04},
+  {175,440,-4.84e-05},
+  {175,463,-1.93e-04},
+  {175,464,-7.74e-04},
+  {175,465,-1.93e-04},
+  {175,490,-4.84e-05},
+  {175,491,-1.93e-04},
+  {175,492,-4.84e-05},
+  {176,176,8.29e-02},
+  {176,150,-1.03e-02},
+  {176,151,-1.03e-02},
+  {176,152,-1.03e-02},
+  {176,175,-1.03e-02},
+  {176,177,-1.03e-02},
+  {176,202,-1.03e-02},
+  {176,203,-1.03e-02},
+  {176,204,-1.03e-02},
+  {176,439,-4.84e-05},
+  {176,440,-1.93e-04},
+  {176,441,-4.84e-05},
+  {176,464,-1.93e-04},
+  {176,465,-7.74e-04},
+  {176,466,-1.93e-04},
+  {176,491,-4.84e-05},
+  {176,492,-1.93e-04},
+  {176,493,-4.84e-05},
+  {177,177,8.29e-02},
+  {177,151,-1.03e-02},
+  {177,152,-1.03e-02},
+  {177,153,-1.03e-02},
+  {177,176,-1.03e-02},
+  {177,178,-1.03e-02},
+  {177,203,-1.03e-02},
+  {177,204,-1.03e-02},
+  {177,205,-1.03e-02},
+  {177,440,-4.84e-05},
+  {177,441,-1.93e-04},
+  {177,442,-4.84e-05},
+  {177,465,-1.93e-04},
+  {177,466,-7.74e-04},
+  {177,467,-1.93e-04},
+  {177,492,-4.84e-05},
+  {177,493,-1.93e-04},
+  {177,494,-4.84e-05},
+  {178,178,8.29e-02},
+  {178,152,-1.03e-02},
+  {178,153,-1.03e-02},
+  {178,154,-1.03e-02},
+  {178,177,-1.03e-02},
+  {178,179,-1.03e-02},
+  {178,204,-1.03e-02},
+  {178,205,-1.03e-02},
+  {178,206,-1.03e-02},
+  {178,441,-4.84e-05},
+  {178,442,-1.93e-04},
+  {178,443,-4.84e-05},
+  {178,466,-1.93e-04},
+  {178,467,-7.74e-04},
+  {178,468,-1.93e-04},
+  {178,493,-4.84e-05},
+  {178,494,-1.93e-04},
+  {178,495,-4.84e-05},
+  {179,179,8.29e-02},
+  {179,153,-1.03e-02},
+  {179,154,-1.03e-02},
+  {179,155,-1.03e-02},
+  {179,178,-1.03e-02},
+  {179,180,-1.03e-02},
+  {179,205,-1.03e-02},
+  {179,206,-1.03e-02},
+  {179,207,-1.03e-02},
+  {179,442,-4.84e-05},
+  {179,443,-1.93e-04},
+  {179,444,-4.84e-05},
+  {179,467,-1.93e-04},
+  {179,468,-7.74e-04},
+  {179,469,-1.93e-04},
+  {179,494,-4.84e-05},
+  {179,495,-1.93e-04},
+  {179,496,-4.84e-05},
+  {180,180,8.29e-02},
+  {180,154,-1.03e-02},
+  {180,155,-1.03e-02},
+  {180,156,-1.03e-02},
+  {180,179,-1.03e-02},
+  {180,181,-1.03e-02},
+  {180,206,-1.03e-02},
+  {180,207,-1.03e-02},
+  {180,208,-1.03e-02},
+  {180,443,-4.84e-05},
+  {180,444,-1.93e-04},
+  {180,445,-4.84e-05},
+  {180,468,-1.93e-04},
+  {180,469,-7.74e-04},
+  {180,470,-1.93e-04},
+  {180,495,-4.84e-05},
+  {180,496,-1.93e-04},
+  {180,497,-4.84e-05},
+  {181,181,8.29e-02},
+  {181,155,-1.03e-02},
+  {181,156,-1.03e-02},
+  {181,157,-1.03e-02},
+  {181,180,-1.03e-02},
+  {181,182,-1.03e-02},
+  {181,207,-1.03e-02},
+  {181,208,-1.03e-02},
+  {181,209,-1.03e-02},
+  {181,444,-4.84e-05},
+  {181,445,-1.93e-04},
+  {181,446,-4.84e-05},
+  {181,469,-1.93e-04},
+  {181,470,-7.74e-04},
+  {181,471,-1.93e-04},
+  {181,496,-4.84e-05},
+  {181,497,-1.93e-04},
+  {181,498,-4.84e-05},
+  {182,182,8.29e-02},
+  {182,156,-1.03e-02},
+  {182,157,-1.03e-02},
+  {182,181,-1.03e-02},
+  {182,183,-1.03e-02},
+  {182,184,-1.03e-02},
+  {182,208,-1.03e-02},
+  {182,209,-1.03e-02},
+  {182,210,-1.03e-02},
+  {182,445,-4.84e-05},
+  {182,446,-1.93e-04},
+  {182,470,-1.93e-04},
+  {182,471,-7.74e-04},
+  {182,472,-1.93e-04},
+  {182,473,-4.84e-05},
+  {182,497,-4.84e-05},
+  {182,498,-1.93e-04},
+  {182,499,-4.84e-05},
+  {183,183,8.29e-02},
+  {183,157,-1.03e-02},
+  {183,182,-1.03e-02},
+  {183,184,-1.03e-02},
+  {183,209,-1.03e-02},
+  {183,210,-1.03e-02},
+  {183,211,-1.03e-02},
+  {183,212,-1.03e-02},
+  {183,213,-1.03e-02},
+  {183,446,-4.84e-05},
+  {183,471,-1.93e-04},
+  {183,472,-7.74e-04},
+  {183,473,-1.93e-04},
+  {183,498,-4.84e-05},
+  {183,499,-1.93e-04},
+  {183,500,-4.84e-05},
+  {183,501,-1.93e-04},
+  {183,502,-4.84e-05},
+  {184,184,8.29e-02},
+  {184,157,-1.03e-02},
+  {184,158,-1.03e-02},
+  {184,182,-1.03e-02},
+  {184,183,-1.03e-02},
+  {184,188,-1.03e-02},
+  {184,212,-1.03e-02},
+  {184,213,-1.03e-02},
+  {184,217,-1.03e-02},
+  {184,446,-1.93e-04},
+  {184,447,-4.84e-05},
+  {184,471,-4.84e-05},
+  {184,472,-1.93e-04},
+  {184,473,-7.74e-04},
+  {184,477,-1.93e-04},
+  {184,501,-4.84e-05},
+  {184,502,-1.93e-04},
+  {184,506,-4.84e-05},
+  {185,185,8.29e-02},
+  {185,159,-1.03e-02},
+  {185,160,-1.03e-02},
+  {185,161,-1.03e-02},
+  {185,186,-1.03e-02},
+  {185,187,-1.03e-02},
+  {185,214,-1.03e-02},
+  {185,215,-1.03e-02},
+  {185,216,-1.03e-02},
+  {185,448,-4.84e-05},
+  {185,449,-1.93e-04},
+  {185,450,-4.84e-05},
+  {185,474,-7.74e-04},
+  {185,475,-1.93e-04},
+  {185,476,-1.93e-04},
+  {185,503,-4.84e-05},
+  {185,504,-1.93e-04},
+  {185,505,-4.84e-05},
+  {186,186,8.29e-02},
+  {186,160,-1.03e-02},
+  {186,161,-1.03e-02},
+  {186,166,-1.03e-02},
+  {186,185,-1.03e-02},
+  {186,192,-1.03e-02},
+  {186,215,-1.03e-02},
+  {186,216,-1.03e-02},
+  {186,221,-1.03e-02},
+  {186,449,-4.84e-05},
+  {186,450,-1.93e-04},
+  {186,455,-4.84e-05},
+  {186,474,-1.93e-04},
+  {186,475,-7.74e-04},
+  {186,481,-1.93e-04},
+  {186,504,-4.84e-05},
+  {186,505,-1.93e-04},
+  {186,510,-4.84e-05},
+  {187,187,8.29e-02},
+  {187,158,-1.03e-02},
+  {187,159,-1.03e-02},
+  {187,160,-1.03e-02},
+  {187,185,-1.03e-02},
+  {187,188,-1.03e-02},
+  {187,214,-1.03e-02},
+  {187,215,-1.03e-02},
+  {187,217,-1.03e-02},
+  {187,447,-4.84e-05},
+  {187,448,-1.93e-04},
+  {187,449,-4.84e-05},
+  {187,474,-1.93e-04},
+  {187,476,-7.74e-04},
+  {187,477,-1.93e-04},
+  {187,503,-1.93e-04},
+  {187,504,-4.84e-05},
+  {187,506,-4.84e-05},
+  {188,188,8.29e-02},
+  {188,157,-1.03e-02},
+  {188,158,-1.03e-02},
+  {188,159,-1.03e-02},
+  {188,184,-1.03e-02},
+  {188,187,-1.03e-02},
+  {188,213,-1.03e-02},
+  {188,214,-1.03e-02},
+  {188,217,-1.03e-02},
+  {188,446,-4.84e-05},
+  {188,447,-1.93e-04},
+  {188,448,-4.84e-05},
+  {188,473,-1.93e-04},
+  {188,476,-1.93e-04},
+  {188,477,-7.74e-04},
+  {188,502,-4.84e-05},
+  {188,503,-4.84e-05},
+  {188,506,-1.93e-04},
+  {189,189,8.29e-02},
+  {189,162,-1.03e-02},
+  {189,167,-1.03e-02},
+  {189,168,-1.03e-02},
+  {189,190,-1.03e-02},
+  {189,191,-1.03e-02},
+  {189,218,-1.03e-02},
+  {189,219,-1.03e-02},
+  {189,220,-1.03e-02},
+  {189,451,-4.84e-05},
+  {189,456,-4.84e-05},
+  {189,457,-1.93e-04},
+  {189,478,-7.74e-04},
+  {189,479,-1.93e-04},
+  {189,480,-1.93e-04},
+  {189,507,-4.84e-05},
+  {189,508,-1.93e-04},
+  {189,509,-4.84e-05},
+  {190,190,8.29e-02},
+  {190,162,-1.03e-02},
+  {190,163,-1.03e-02},
+  {190,168,-1.03e-02},
+  {190,189,-1.03e-02},
+  {190,195,-1.03e-02},
+  {190,219,-1.03e-02},
+  {190,220,-1.03e-02},
+  {190,224,-1.03e-02},
+  {190,451,-1.93e-04},
+  {190,452,-4.84e-05},
+  {190,457,-4.84e-05},
+  {190,478,-1.93e-04},
+  {190,479,-7.74e-04},
+  {190,484,-1.93e-04},
+  {190,508,-4.84e-05},
+  {190,509,-1.93e-04},
+  {190,513,-4.84e-05},
+  {191,191,8.29e-02},
+  {191,166,-1.03e-02},
+  {191,167,-1.03e-02},
+  {191,168,-1.03e-02},
+  {191,189,-1.03e-02},
+  {191,192,-1.03e-02},
+  {191,218,-1.03e-02},
+  {191,219,-1.03e-02},
+  {191,221,-1.03e-02},
+  {191,455,-4.84e-05},
+  {191,456,-1.93e-04},
+  {191,457,-4.84e-05},
+  {191,478,-1.93e-04},
+  {191,480,-7.74e-04},
+  {191,481,-1.93e-04},
+  {191,507,-1.93e-04},
+  {191,508,-4.84e-05},
+  {191,510,-4.84e-05},
+  {192,192,8.29e-02},
+  {192,161,-1.03e-02},
+  {192,166,-1.03e-02},
+  {192,167,-1.03e-02},
+  {192,186,-1.03e-02},
+  {192,191,-1.03e-02},
+  {192,216,-1.03e-02},
+  {192,218,-1.03e-02},
+  {192,221,-1.03e-02},
+  {192,450,-4.84e-05},
+  {192,455,-1.93e-04},
+  {192,456,-4.84e-05},
+  {192,475,-1.93e-04},
+  {192,480,-1.93e-04},
+  {192,481,-7.74e-04},
+  {192,505,-4.84e-05},
+  {192,507,-4.84e-05},
+  {192,510,-1.93e-04},
+  {193,193,8.29e-02},
+  {193,145,-1.03e-02},
+  {193,164,-1.03e-02},
+  {193,165,-1.03e-02},
+  {193,170,-1.03e-02},
+  {193,194,-1.03e-02},
+  {193,197,-1.03e-02},
+  {193,222,-1.03e-02},
+  {193,223,-1.03e-02},
+  {193,434,-4.84e-05},
+  {193,453,-4.84e-05},
+  {193,454,-1.93e-04},
+  {193,459,-1.93e-04},
+  {193,482,-7.74e-04},
+  {193,483,-1.93e-04},
+  {193,486,-4.84e-05},
+  {193,511,-4.84e-05},
+  {193,512,-1.93e-04},
+  {194,194,8.29e-02},
+  {194,163,-1.03e-02},
+  {194,164,-1.03e-02},
+  {194,165,-1.03e-02},
+  {194,193,-1.03e-02},
+  {194,195,-1.03e-02},
+  {194,222,-1.03e-02},
+  {194,223,-1.03e-02},
+  {194,224,-1.03e-02},
+  {194,452,-4.84e-05},
+  {194,453,-1.93e-04},
+  {194,454,-4.84e-05},
+  {194,482,-1.93e-04},
+  {194,483,-7.74e-04},
+  {194,484,-1.93e-04},
+  {194,511,-1.93e-04},
+  {194,512,-4.84e-05},
+  {194,513,-4.84e-05},
+  {195,195,8.29e-02},
+  {195,162,-1.03e-02},
+  {195,163,-1.03e-02},
+  {195,164,-1.03e-02},
+  {195,190,-1.03e-02},
+  {195,194,-1.03e-02},
+  {195,220,-1.03e-02},
+  {195,222,-1.03e-02},
+  {195,224,-1.03e-02},
+  {195,451,-4.84e-05},
+  {195,452,-1.93e-04},
+  {195,453,-4.84e-05},
+  {195,479,-1.93e-04},
+  {195,483,-1.93e-04},
+  {195,484,-7.74e-04},
+  {195,509,-4.84e-05},
+  {195,511,-4.84e-05},
+  {195,513,-1.93e-04},
+  {196,196,2.08e-01},
+  {196,169,3.65e-02},
+  {196,171,-1.03e-02},
+  {196,198,-1.03e-02},
+  {196,225,3.65e-02},
+  {196,227,-1.03e-02},
+  {196,458,-9.67e-05},
+  {196,460,-4.84e-05},
+  {196,485,-3.87e-04},
+  {196,487,-1.93e-04},
+  {196,514,-9.67e-05},
+  {196,516,-4.84e-05},
+  {197,197,2.08e-01},
+  {197,170,3.65e-02},
+  {197,193,-1.03e-02},
+  {197,223,-1.03e-02},
+  {197,226,3.65e-02},
+  {197,255,-1.03e-02},
+  {197,459,-9.67e-05},
+  {197,482,-4.84e-05},
+  {197,486,-3.87e-04},
+  {197,512,-1.93e-04},
+  {197,515,-9.67e-05},
+  {197,544,-4.84e-05},
+  {198,198,8.29e-02},
+  {198,169,-1.03e-02},
+  {198,171,-1.03e-02},
+  {198,172,-1.03e-02},
+  {198,196,-1.03e-02},
+  {198,199,-1.03e-02},
+  {198,225,-1.03e-02},
+  {198,227,-1.03e-02},
+  {198,228,-1.03e-02},
+  {198,458,-4.84e-05},
+  {198,460,-1.93e-04},
+  {198,461,-4.84e-05},
+  {198,485,-1.93e-04},
+  {198,487,-7.74e-04},
+  {198,488,-1.93e-04},
+  {198,514,-4.84e-05},
+  {198,516,-1.93e-04},
+  {198,517,-4.84e-05},
+  {199,199,8.29e-02},
+  {199,171,-1.03e-02},
+  {199,172,-1.03e-02},
+  {199,173,-1.03e-02},
+  {199,198,-1.03e-02},
+  {199,200,-1.03e-02},
+  {199,227,-1.03e-02},
+  {199,228,-1.03e-02},
+  {199,229,-1.03e-02},
+  {199,460,-4.84e-05},
+  {199,461,-1.93e-04},
+  {199,462,-4.84e-05},
+  {199,487,-1.93e-04},
+  {199,488,-7.74e-04},
+  {199,489,-1.93e-04},
+  {199,516,-4.84e-05},
+  {199,517,-1.93e-04},
+  {199,518,-4.84e-05},
+  {200,200,8.29e-02},
+  {200,172,-1.03e-02},
+  {200,173,-1.03e-02},
+  {200,174,-1.03e-02},
+  {200,199,-1.03e-02},
+  {200,201,-1.03e-02},
+  {200,228,-1.03e-02},
+  {200,229,-1.03e-02},
+  {200,230,-1.03e-02},
+  {200,461,-4.84e-05},
+  {200,462,-1.93e-04},
+  {200,463,-4.84e-05},
+  {200,488,-1.93e-04},
+  {200,489,-7.74e-04},
+  {200,490,-1.93e-04},
+  {200,517,-4.84e-05},
+  {200,518,-1.93e-04},
+  {200,519,-4.84e-05},
+  {201,201,8.29e-02},
+  {201,173,-1.03e-02},
+  {201,174,-1.03e-02},
+  {201,175,-1.03e-02},
+  {201,200,-1.03e-02},
+  {201,202,-1.03e-02},
+  {201,229,-1.03e-02},
+  {201,230,-1.03e-02},
+  {201,231,-1.03e-02},
+  {201,462,-4.84e-05},
+  {201,463,-1.93e-04},
+  {201,464,-4.84e-05},
+  {201,489,-1.93e-04},
+  {201,490,-7.74e-04},
+  {201,491,-1.93e-04},
+  {201,518,-4.84e-05},
+  {201,519,-1.93e-04},
+  {201,520,-4.84e-05},
+  {202,202,8.29e-02},
+  {202,174,-1.03e-02},
+  {202,175,-1.03e-02},
+  {202,176,-1.03e-02},
+  {202,201,-1.03e-02},
+  {202,203,-1.03e-02},
+  {202,230,-1.03e-02},
+  {202,231,-1.03e-02},
+  {202,232,-1.03e-02},
+  {202,463,-4.84e-05},
+  {202,464,-1.93e-04},
+  {202,465,-4.84e-05},
+  {202,490,-1.93e-04},
+  {202,491,-7.74e-04},
+  {202,492,-1.93e-04},
+  {202,519,-4.84e-05},
+  {202,520,-1.93e-04},
+  {202,521,-4.84e-05},
+  {203,203,8.29e-02},
+  {203,175,-1.03e-02},
+  {203,176,-1.03e-02},
+  {203,177,-1.03e-02},
+  {203,202,-1.03e-02},
+  {203,204,-1.03e-02},
+  {203,231,-1.03e-02},
+  {203,232,-1.03e-02},
+  {203,233,-1.03e-02},
+  {203,464,-4.84e-05},
+  {203,465,-1.93e-04},
+  {203,466,-4.84e-05},
+  {203,491,-1.93e-04},
+  {203,492,-7.74e-04},
+  {203,493,-1.93e-04},
+  {203,520,-4.84e-05},
+  {203,521,-1.93e-04},
+  {203,522,-4.84e-05},
+  {204,204,8.29e-02},
+  {204,176,-1.03e-02},
+  {204,177,-1.03e-02},
+  {204,178,-1.03e-02},
+  {204,203,-1.03e-02},
+  {204,205,-1.03e-02},
+  {204,232,-1.03e-02},
+  {204,233,-1.03e-02},
+  {204,234,-1.03e-02},
+  {204,465,-4.84e-05},
+  {204,466,-1.93e-04},
+  {204,467,-4.84e-05},
+  {204,492,-1.93e-04},
+  {204,493,-7.74e-04},
+  {204,494,-1.93e-04},
+  {204,521,-4.84e-05},
+  {204,522,-1.93e-04},
+  {204,523,-4.84e-05},
+  {205,205,8.29e-02},
+  {205,177,-1.03e-02},
+  {205,178,-1.03e-02},
+  {205,179,-1.03e-02},
+  {205,204,-1.03e-02},
+  {205,206,-1.03e-02},
+  {205,233,-1.03e-02},
+  {205,234,-1.03e-02},
+  {205,235,-1.03e-02},
+  {205,466,-4.84e-05},
+  {205,467,-1.93e-04},
+  {205,468,-4.84e-05},
+  {205,493,-1.93e-04},
+  {205,494,-7.74e-04},
+  {205,495,-1.93e-04},
+  {205,522,-4.84e-05},
+  {205,523,-1.93e-04},
+  {205,524,-4.84e-05},
+  {206,206,8.29e-02},
+  {206,178,-1.03e-02},
+  {206,179,-1.03e-02},
+  {206,180,-1.03e-02},
+  {206,205,-1.03e-02},
+  {206,207,-1.03e-02},
+  {206,234,-1.03e-02},
+  {206,235,-1.03e-02},
+  {206,236,-1.03e-02},
+  {206,467,-4.84e-05},
+  {206,468,-1.93e-04},
+  {206,469,-4.84e-05},
+  {206,494,-1.93e-04},
+  {206,495,-7.74e-04},
+  {206,496,-1.93e-04},
+  {206,523,-4.84e-05},
+  {206,524,-1.93e-04},
+  {206,525,-4.84e-05},
+  {207,207,8.29e-02},
+  {207,179,-1.03e-02},
+  {207,180,-1.03e-02},
+  {207,181,-1.03e-02},
+  {207,206,-1.03e-02},
+  {207,208,-1.03e-02},
+  {207,235,-1.03e-02},
+  {207,236,-1.03e-02},
+  {207,237,-1.03e-02},
+  {207,468,-4.84e-05},
+  {207,469,-1.93e-04},
+  {207,470,-4.84e-05},
+  {207,495,-1.93e-04},
+  {207,496,-7.74e-04},
+  {207,497,-1.93e-04},
+  {207,524,-4.84e-05},
+  {207,525,-1.93e-04},
+  {207,526,-4.84e-05},
+  {208,208,8.29e-02},
+  {208,180,-1.03e-02},
+  {208,181,-1.03e-02},
+  {208,182,-1.03e-02},
+  {208,207,-1.03e-02},
+  {208,209,-1.03e-02},
+  {208,236,-1.03e-02},
+  {208,237,-1.03e-02},
+  {208,238,-1.03e-02},
+  {208,469,-4.84e-05},
+  {208,470,-1.93e-04},
+  {208,471,-4.84e-05},
+  {208,496,-1.93e-04},
+  {208,497,-7.74e-04},
+  {208,498,-1.93e-04},
+  {208,525,-4.84e-05},
+  {208,526,-1.93e-04},
+  {208,527,-4.84e-05},
+  {209,209,8.29e-02},
+  {209,181,-1.03e-02},
+  {209,182,-1.03e-02},
+  {209,183,-1.03e-02},
+  {209,208,-1.03e-02},
+  {209,210,-1.03e-02},
+  {209,237,-1.03e-02},
+  {209,238,-1.03e-02},
+  {209,239,-1.03e-02},
+  {209,470,-4.84e-05},
+  {209,471,-1.93e-04},
+  {209,472,-4.84e-05},
+  {209,497,-1.93e-04},
+  {209,498,-7.74e-04},
+  {209,499,-1.93e-04},
+  {209,526,-4.84e-05},
+  {209,527,-1.93e-04},
+  {209,528,-4.84e-05},
+  {210,210,8.29e-02},
+  {210,182,-1.03e-02},
+  {210,183,-1.03e-02},
+  {210,209,-1.03e-02},
+  {210,211,-1.03e-02},
+  {210,212,-1.03e-02},
+  {210,238,-1.03e-02},
+  {210,239,-1.03e-02},
+  {210,240,-1.03e-02},
+  {210,471,-4.84e-05},
+  {210,472,-1.93e-04},
+  {210,498,-1.93e-04},
+  {210,499,-7.74e-04},
+  {210,500,-1.93e-04},
+  {210,501,-4.84e-05},
+  {210,527,-4.84e-05},
+  {210,528,-1.93e-04},
+  {210,529,-4.84e-05},
+  {211,211,8.29e-02},
+  {211,183,-1.03e-02},
+  {211,210,-1.03e-02},
+  {211,212,-1.03e-02},
+  {211,239,-1.03e-02},
+  {211,240,-1.03e-02},
+  {211,241,-1.03e-02},
+  {211,242,-1.03e-02},
+  {211,243,-1.03e-02},
+  {211,472,-4.84e-05},
+  {211,499,-1.93e-04},
+  {211,500,-7.74e-04},
+  {211,501,-1.93e-04},
+  {211,528,-4.84e-05},
+  {211,529,-1.93e-04},
+  {211,530,-4.84e-05},
+  {211,531,-1.93e-04},
+  {211,532,-4.84e-05},
+  {212,212,8.29e-02},
+  {212,183,-1.03e-02},
+  {212,184,-1.03e-02},
+  {212,210,-1.03e-02},
+  {212,211,-1.03e-02},
+  {212,213,-1.03e-02},
+  {212,242,-1.03e-02},
+  {212,243,-1.03e-02},
+  {212,244,-1.03e-02},
+  {212,472,-1.93e-04},
+  {212,473,-4.84e-05},
+  {212,499,-4.84e-05},
+  {212,500,-1.93e-04},
+  {212,501,-7.74e-04},
+  {212,502,-1.93e-04},
+  {212,531,-4.84e-05},
+  {212,532,-1.93e-04},
+  {212,533,-4.84e-05},
+  {213,213,8.29e-02},
+  {213,183,-1.03e-02},
+  {213,184,-1.03e-02},
+  {213,188,-1.03e-02},
+  {213,212,-1.03e-02},
+  {213,217,-1.03e-02},
+  {213,243,-1.03e-02},
+  {213,244,-1.03e-02},
+  {213,245,-1.03e-02},
+  {213,472,-4.84e-05},
+  {213,473,-1.93e-04},
+  {213,477,-4.84e-05},
+  {213,501,-1.93e-04},
+  {213,502,-7.74e-04},
+  {213,506,-1.93e-04},
+  {213,532,-4.84e-05},
+  {213,533,-1.93e-04},
+  {213,534,-4.84e-05},
+  {214,214,8.29e-02},
+  {214,185,-1.03e-02},
+  {214,187,-1.03e-02},
+  {214,188,-1.03e-02},
+  {214,215,-1.03e-02},
+  {214,217,-1.03e-02},
+  {214,245,-1.03e-02},
+  {214,246,-1.03e-02},
+  {214,247,-1.03e-02},
+  {214,474,-4.84e-05},
+  {214,476,-1.93e-04},
+  {214,477,-4.84e-05},
+  {214,503,-7.74e-04},
+  {214,504,-1.93e-04},
+  {214,506,-1.93e-04},
+  {214,534,-4.84e-05},
+  {214,535,-1.93e-04},
+  {214,536,-4.84e-05},
+  {215,215,8.29e-02},
+  {215,185,-1.03e-02},
+  {215,186,-1.03e-02},
+  {215,187,-1.03e-02},
+  {215,214,-1.03e-02},
+  {215,216,-1.03e-02},
+  {215,246,-1.03e-02},
+  {215,247,-1.03e-02},
+  {215,248,-1.03e-02},
+  {215,474,-1.93e-04},
+  {215,475,-4.84e-05},
+  {215,476,-4.84e-05},
+  {215,503,-1.93e-04},
+  {215,504,-7.74e-04},
+  {215,505,-1.93e-04},
+  {215,535,-4.84e-05},
+  {215,536,-1.93e-04},
+  {215,537,-4.84e-05},
+  {216,216,8.29e-02},
+  {216,185,-1.03e-02},
+  {216,186,-1.03e-02},
+  {216,192,-1.03e-02},
+  {216,215,-1.03e-02},
+  {216,221,-1.03e-02},
+  {216,247,-1.03e-02},
+  {216,248,-1.03e-02},
+  {216,249,-1.03e-02},
+  {216,474,-4.84e-05},
+  {216,475,-1.93e-04},
+  {216,481,-4.84e-05},
+  {216,504,-1.93e-04},
+  {216,505,-7.74e-04},
+  {216,510,-1.93e-04},
+  {216,536,-4.84e-05},
+  {216,537,-1.93e-04},
+  {216,538,-4.84e-05},
+  {217,217,8.29e-02},
+  {217,184,-1.03e-02},
+  {217,187,-1.03e-02},
+  {217,188,-1.03e-02},
+  {217,213,-1.03e-02},
+  {217,214,-1.03e-02},
+  {217,244,-1.03e-02},
+  {217,245,-1.03e-02},
+  {217,246,-1.03e-02},
+  {217,473,-4.84e-05},
+  {217,476,-4.84e-05},
+  {217,477,-1.93e-04},
+  {217,502,-1.93e-04},
+  {217,503,-1.93e-04},
+  {217,506,-7.74e-04},
+  {217,533,-4.84e-05},
+  {217,534,-1.93e-04},
+  {217,535,-4.84e-05},
+  {218,218,8.29e-02},
+  {218,189,-1.03e-02},
+  {218,191,-1.03e-02},
+  {218,192,-1.03e-02},
+  {218,219,-1.03e-02},
+  {218,221,-1.03e-02},
+  {218,249,-1.03e-02},
+  {218,250,-1.03e-02},
+  {218,251,-1.03e-02},
+  {218,478,-4.84e-05},
+  {218,480,-1.93e-04},
+  {218,481,-4.84e-05},
+  {218,507,-7.74e-04},
+  {218,508,-1.93e-04},
+  {218,510,-1.93e-04},
+  {218,538,-4.84e-05},
+  {218,539,-1.93e-04},
+  {218,540,-4.84e-05},
+  {219,219,8.29e-02},
+  {219,189,-1.03e-02},
+  {219,190,-1.03e-02},
+  {219,191,-1.03e-02},
+  {219,218,-1.03e-02},
+  {219,220,-1.03e-02},
+  {219,250,-1.03e-02},
+  {219,251,-1.03e-02},
+  {219,252,-1.03e-02},
+  {219,478,-1.93e-04},
+  {219,479,-4.84e-05},
+  {219,480,-4.84e-05},
+  {219,507,-1.93e-04},
+  {219,508,-7.74e-04},
+  {219,509,-1.93e-04},
+  {219,539,-4.84e-05},
+  {219,540,-1.93e-04},
+  {219,541,-4.84e-05},
+  {220,220,8.29e-02},
+  {220,189,-1.03e-02},
+  {220,190,-1.03e-02},
+  {220,195,-1.03e-02},
+  {220,219,-1.03e-02},
+  {220,224,-1.03e-02},
+  {220,251,-1.03e-02},
+  {220,252,-1.03e-02},
+  {220,253,-1.03e-02},
+  {220,478,-4.84e-05},
+  {220,479,-1.93e-04},
+  {220,484,-4.84e-05},
+  {220,508,-1.93e-04},
+  {220,509,-7.74e-04},
+  {220,513,-1.93e-04},
+  {220,540,-4.84e-05},
+  {220,541,-1.93e-04},
+  {220,542,-4.84e-05},
+  {221,221,8.29e-02},
+  {221,186,-1.03e-02},
+  {221,191,-1.03e-02},
+  {221,192,-1.03e-02},
+  {221,216,-1.03e-02},
+  {221,218,-1.03e-02},
+  {221,248,-1.03e-02},
+  {221,249,-1.03e-02},
+  {221,250,-1.03e-02},
+  {221,475,-4.84e-05},
+  {221,480,-4.84e-05},
+  {221,481,-1.93e-04},
+  {221,505,-1.93e-04},
+  {221,507,-1.93e-04},
+  {221,510,-7.74e-04},
+  {221,537,-4.84e-05},
+  {221,538,-1.93e-04},
+  {221,539,-4.84e-05},
+  {222,222,8.29e-02},
+  {222,193,-1.03e-02},
+  {222,194,-1.03e-02},
+  {222,195,-1.03e-02},
+  {222,223,-1.03e-02},
+  {222,224,-1.03e-02},
+  {222,253,-1.03e-02},
+  {222,254,-1.03e-02},
+  {222,255,-1.03e-02},
+  {222,482,-4.84e-05},
+  {222,483,-1.93e-04},
+  {222,484,-4.84e-05},
+  {222,511,-7.74e-04},
+  {222,512,-1.93e-04},
+  {222,513,-1.93e-04},
+  {222,542,-4.84e-05},
+  {222,543,-1.93e-04},
+  {222,544,-4.84e-05},
+  {223,223,8.29e-02},
+  {223,170,-1.03e-02},
+  {223,193,-1.03e-02},
+  {223,194,-1.03e-02},
+  {223,197,-1.03e-02},
+  {223,222,-1.03e-02},
+  {223,226,-1.03e-02},
+  {223,254,-1.03e-02},
+  {223,255,-1.03e-02},
+  {223,459,-4.84e-05},
+  {223,482,-1.93e-04},
+  {223,483,-4.84e-05},
+  {223,486,-1.93e-04},
+  {223,511,-1.93e-04},
+  {223,512,-7.74e-04},
+  {223,515,-4.84e-05},
+  {223,543,-4.84e-05},
+  {223,544,-1.93e-04},
+  {224,224,8.29e-02},
+  {224,190,-1.03e-02},
+  {224,194,-1.03e-02},
+  {224,195,-1.03e-02},
+  {224,220,-1.03e-02},
+  {224,222,-1.03e-02},
+  {224,252,-1.03e-02},
+  {224,253,-1.03e-02},
+  {224,254,-1.03e-02},
+  {224,479,-4.84e-05},
+  {224,483,-4.84e-05},
+  {224,484,-1.93e-04},
+  {224,509,-1.93e-04},
+  {224,511,-1.93e-04},
+  {224,513,-7.74e-04},
+  {224,541,-4.84e-05},
+  {224,542,-1.93e-04},
+  {224,543,-4.84e-05},
+  {225,225,2.08e-01},
+  {225,196,3.65e-02},
+  {225,198,-1.03e-02},
+  {225,227,-1.03e-02},
+  {225,256,3.65e-02},
+  {225,259,-1.03e-02},
+  {225,485,-9.67e-05},
+  {225,487,-4.84e-05},
+  {225,514,-3.87e-04},
+  {225,516,-1.93e-04},
+  {225,545,-9.67e-05},
+  {225,548,-4.84e-05},
+  {226,226,2.08e-01},
+  {226,197,3.65e-02},
+  {226,223,-1.03e-02},
+  {226,255,-1.03e-02},
+  {226,258,3.65e-02},
+  {226,288,-1.03e-02},
+  {226,486,-9.67e-05},
+  {226,512,-4.84e-05},
+  {226,515,-3.87e-04},
+  {226,544,-1.93e-04},
+  {226,547,-9.67e-05},
+  {226,577,-4.84e-05},
+  {227,227,8.29e-02},
+  {227,196,-1.03e-02},
+  {227,198,-1.03e-02},
+  {227,199,-1.03e-02},
+  {227,225,-1.03e-02},
+  {227,228,-1.03e-02},
+  {227,256,-1.03e-02},
+  {227,259,-1.03e-02},
+  {227,260,-1.03e-02},
+  {227,485,-4.84e-05},
+  {227,487,-1.93e-04},
+  {227,488,-4.84e-05},
+  {227,514,-1.93e-04},
+  {227,516,-7.74e-04},
+  {227,517,-1.93e-04},
+  {227,545,-4.84e-05},
+  {227,548,-1.93e-04},
+  {227,549,-4.84e-05},
+  {228,228,8.29e-02},
+  {228,198,-1.03e-02},
+  {228,199,-1.03e-02},
+  {228,200,-1.03e-02},
+  {228,227,-1.03e-02},
+  {228,229,-1.03e-02},
+  {228,259,-1.03e-02},
+  {228,260,-1.03e-02},
+  {228,261,-1.03e-02},
+  {228,487,-4.84e-05},
+  {228,488,-1.93e-04},
+  {228,489,-4.84e-05},
+  {228,516,-1.93e-04},
+  {228,517,-7.74e-04},
+  {228,518,-1.93e-04},
+  {228,548,-4.84e-05},
+  {228,549,-1.93e-04},
+  {228,550,-4.84e-05},
+  {229,229,8.29e-02},
+  {229,199,-1.03e-02},
+  {229,200,-1.03e-02},
+  {229,201,-1.03e-02},
+  {229,228,-1.03e-02},
+  {229,230,-1.03e-02},
+  {229,260,-1.03e-02},
+  {229,261,-1.03e-02},
+  {229,262,-1.03e-02},
+  {229,488,-4.84e-05},
+  {229,489,-1.93e-04},
+  {229,490,-4.84e-05},
+  {229,517,-1.93e-04},
+  {229,518,-7.74e-04},
+  {229,519,-1.93e-04},
+  {229,549,-4.84e-05},
+  {229,550,-1.93e-04},
+  {229,551,-4.84e-05},
+  {230,230,8.29e-02},
+  {230,200,-1.03e-02},
+  {230,201,-1.03e-02},
+  {230,202,-1.03e-02},
+  {230,229,-1.03e-02},
+  {230,231,-1.03e-02},
+  {230,261,-1.03e-02},
+  {230,262,-1.03e-02},
+  {230,263,-1.03e-02},
+  {230,489,-4.84e-05},
+  {230,490,-1.93e-04},
+  {230,491,-4.84e-05},
+  {230,518,-1.93e-04},
+  {230,519,-7.74e-04},
+  {230,520,-1.93e-04},
+  {230,550,-4.84e-05},
+  {230,551,-1.93e-04},
+  {230,552,-4.84e-05},
+  {231,231,8.29e-02},
+  {231,201,-1.03e-02},
+  {231,202,-1.03e-02},
+  {231,203,-1.03e-02},
+  {231,230,-1.03e-02},
+  {231,232,-1.03e-02},
+  {231,262,-1.03e-02},
+  {231,263,-1.03e-02},
+  {231,264,-1.03e-02},
+  {231,490,-4.84e-05},
+  {231,491,-1.93e-04},
+  {231,492,-4.84e-05},
+  {231,519,-1.93e-04},
+  {231,520,-7.74e-04},
+  {231,521,-1.93e-04},
+  {231,551,-4.84e-05},
+  {231,552,-1.93e-04},
+  {231,553,-4.84e-05},
+  {232,232,8.29e-02},
+  {232,202,-1.03e-02},
+  {232,203,-1.03e-02},
+  {232,204,-1.03e-02},
+  {232,231,-1.03e-02},
+  {232,233,-1.03e-02},
+  {232,263,-1.03e-02},
+  {232,264,-1.03e-02},
+  {232,265,-1.03e-02},
+  {232,491,-4.84e-05},
+  {232,492,-1.93e-04},
+  {232,493,-4.84e-05},
+  {232,520,-1.93e-04},
+  {232,521,-7.74e-04},
+  {232,522,-1.93e-04},
+  {232,552,-4.84e-05},
+  {232,553,-1.93e-04},
+  {232,554,-4.84e-05},
+  {233,233,8.29e-02},
+  {233,203,-1.03e-02},
+  {233,204,-1.03e-02},
+  {233,205,-1.03e-02},
+  {233,232,-1.03e-02},
+  {233,234,-1.03e-02},
+  {233,264,-1.03e-02},
+  {233,265,-1.03e-02},
+  {233,266,-1.03e-02},
+  {233,492,-4.84e-05},
+  {233,493,-1.93e-04},
+  {233,494,-4.84e-05},
+  {233,521,-1.93e-04},
+  {233,522,-7.74e-04},
+  {233,523,-1.93e-04},
+  {233,553,-4.84e-05},
+  {233,554,-1.93e-04},
+  {233,555,-4.84e-05},
+  {234,234,8.29e-02},
+  {234,204,-1.03e-02},
+  {234,205,-1.03e-02},
+  {234,206,-1.03e-02},
+  {234,233,-1.03e-02},
+  {234,235,-1.03e-02},
+  {234,265,-1.03e-02},
+  {234,266,-1.03e-02},
+  {234,267,-1.03e-02},
+  {234,493,-4.84e-05},
+  {234,494,-1.93e-04},
+  {234,495,-4.84e-05},
+  {234,522,-1.93e-04},
+  {234,523,-7.74e-04},
+  {234,524,-1.93e-04},
+  {234,554,-4.84e-05},
+  {234,555,-1.93e-04},
+  {234,556,-4.84e-05},
+  {235,235,8.29e-02},
+  {235,205,-1.03e-02},
+  {235,206,-1.03e-02},
+  {235,207,-1.03e-02},
+  {235,234,-1.03e-02},
+  {235,236,-1.03e-02},
+  {235,266,-1.03e-02},
+  {235,267,-1.03e-02},
+  {235,268,-1.03e-02},
+  {235,494,-4.84e-05},
+  {235,495,-1.93e-04},
+  {235,496,-4.84e-05},
+  {235,523,-1.93e-04},
+  {235,524,-7.74e-04},
+  {235,525,-1.93e-04},
+  {235,555,-4.84e-05},
+  {235,556,-1.93e-04},
+  {235,557,-4.84e-05},
+  {236,236,8.29e-02},
+  {236,206,-1.03e-02},
+  {236,207,-1.03e-02},
+  {236,208,-1.03e-02},
+  {236,235,-1.03e-02},
+  {236,237,-1.03e-02},
+  {236,267,-1.03e-02},
+  {236,268,-1.03e-02},
+  {236,269,-1.03e-02},
+  {236,495,-4.84e-05},
+  {236,496,-1.93e-04},
+  {236,497,-4.84e-05},
+  {236,524,-1.93e-04},
+  {236,525,-7.74e-04},
+  {236,526,-1.93e-04},
+  {236,556,-4.84e-05},
+  {236,557,-1.93e-04},
+  {236,558,-4.84e-05},
+  {237,237,8.29e-02},
+  {237,207,-1.03e-02},
+  {237,208,-1.03e-02},
+  {237,209,-1.03e-02},
+  {237,236,-1.03e-02},
+  {237,238,-1.03e-02},
+  {237,268,-1.03e-02},
+  {237,269,-1.03e-02},
+  {237,270,-1.03e-02},
+  {237,496,-4.84e-05},
+  {237,497,-1.93e-04},
+  {237,498,-4.84e-05},
+  {237,525,-1.93e-04},
+  {237,526,-7.74e-04},
+  {237,527,-1.93e-04},
+  {237,557,-4.84e-05},
+  {237,558,-1.93e-04},
+  {237,559,-4.84e-05},
+  {238,238,8.29e-02},
+  {238,208,-1.03e-02},
+  {238,209,-1.03e-02},
+  {238,210,-1.03e-02},
+  {238,237,-1.03e-02},
+  {238,239,-1.03e-02},
+  {238,269,-1.03e-02},
+  {238,270,-1.03e-02},
+  {238,271,-1.03e-02},
+  {238,497,-4.84e-05},
+  {238,498,-1.93e-04},
+  {238,499,-4.84e-05},
+  {238,526,-1.93e-04},
+  {238,527,-7.74e-04},
+  {238,528,-1.93e-04},
+  {238,558,-4.84e-05},
+  {238,559,-1.93e-04},
+  {238,560,-4.84e-05},
+  {239,239,8.29e-02},
+  {239,209,-1.03e-02},
+  {239,210,-1.03e-02},
+  {239,211,-1.03e-02},
+  {239,238,-1.03e-02},
+  {239,240,-1.03e-02},
+  {239,270,-1.03e-02},
+  {239,271,-1.03e-02},
+  {239,272,-1.03e-02},
+  {239,498,-4.84e-05},
+  {239,499,-1.93e-04},
+  {239,500,-4.84e-05},
+  {239,527,-1.93e-04},
+  {239,528,-7.74e-04},
+  {239,529,-1.93e-04},
+  {239,559,-4.84e-05},
+  {239,560,-1.93e-04},
+  {239,561,-4.84e-05},
+  {240,240,8.29e-02},
+  {240,210,-1.03e-02},
+  {240,211,-1.03e-02},
+  {240,239,-1.03e-02},
+  {240,241,-1.03e-02},
+  {240,242,-1.03e-02},
+  {240,271,-1.03e-02},
+  {240,272,-1.03e-02},
+  {240,273,-1.03e-02},
+  {240,499,-4.84e-05},
+  {240,500,-1.93e-04},
+  {240,528,-1.93e-04},
+  {240,529,-7.74e-04},
+  {240,530,-1.93e-04},
+  {240,531,-4.84e-05},
+  {240,560,-4.84e-05},
+  {240,561,-1.93e-04},
+  {240,562,-4.84e-05},
+  {241,241,8.29e-02},
+  {241,211,-1.03e-02},
+  {241,240,-1.03e-02},
+  {241,242,-1.03e-02},
+  {241,257,-1.03e-02},
+  {241,272,-1.03e-02},
+  {241,273,-1.03e-02},
+  {241,274,-1.03e-02},
+  {241,275,-1.03e-02},
+  {241,500,-4.84e-05},
+  {241,529,-1.93e-04},
+  {241,530,-7.74e-04},
+  {241,531,-1.93e-04},
+  {241,546,-4.84e-05},
+  {241,561,-4.84e-05},
+  {241,562,-1.93e-04},
+  {241,563,-1.93e-04},
+  {241,564,-4.84e-05},
+  {242,242,8.29e-02},
+  {242,211,-1.03e-02},
+  {242,212,-1.03e-02},
+  {242,240,-1.03e-02},
+  {242,241,-1.03e-02},
+  {242,243,-1.03e-02},
+  {242,274,-1.03e-02},
+  {242,275,-1.03e-02},
+  {242,276,-1.03e-02},
+  {242,500,-1.93e-04},
+  {242,501,-4.84e-05},
+  {242,529,-4.84e-05},
+  {242,530,-1.93e-04},
+  {242,531,-7.74e-04},
+  {242,532,-1.93e-04},
+  {242,563,-4.84e-05},
+  {242,564,-1.93e-04},
+  {242,565,-4.84e-05},
+  {243,243,8.29e-02},
+  {243,211,-1.03e-02},
+  {243,212,-1.03e-02},
+  {243,213,-1.03e-02},
+  {243,242,-1.03e-02},
+  {243,244,-1.03e-02},
+  {243,275,-1.03e-02},
+  {243,276,-1.03e-02},
+  {243,277,-1.03e-02},
+  {243,500,-4.84e-05},
+  {243,501,-1.93e-04},
+  {243,502,-4.84e-05},
+  {243,531,-1.93e-04},
+  {243,532,-7.74e-04},
+  {243,533,-1.93e-04},
+  {243,564,-4.84e-05},
+  {243,565,-1.93e-04},
+  {243,566,-4.84e-05},
+  {244,244,8.29e-02},
+  {244,212,-1.03e-02},
+  {244,213,-1.03e-02},
+  {244,217,-1.03e-02},
+  {244,243,-1.03e-02},
+  {244,245,-1.03e-02},
+  {244,276,-1.03e-02},
+  {244,277,-1.03e-02},
+  {244,278,-1.03e-02},
+  {244,501,-4.84e-05},
+  {244,502,-1.93e-04},
+  {244,506,-4.84e-05},
+  {244,532,-1.93e-04},
+  {244,533,-7.74e-04},
+  {244,534,-1.93e-04},
+  {244,565,-4.84e-05},
+  {244,566,-1.93e-04},
+  {244,567,-4.84e-05},
+  {245,245,8.29e-02},
+  {245,213,-1.03e-02},
+  {245,214,-1.03e-02},
+  {245,217,-1.03e-02},
+  {245,244,-1.03e-02},
+  {245,246,-1.03e-02},
+  {245,277,-1.03e-02},
+  {245,278,-1.03e-02},
+  {245,279,-1.03e-02},
+  {245,502,-4.84e-05},
+  {245,503,-4.84e-05},
+  {245,506,-1.93e-04},
+  {245,533,-1.93e-04},
+  {245,534,-7.74e-04},
+  {245,535,-1.93e-04},
+  {245,566,-4.84e-05},
+  {245,567,-1.93e-04},
+  {245,568,-4.84e-05},
+  {246,246,8.29e-02},
+  {246,214,-1.03e-02},
+  {246,215,-1.03e-02},
+  {246,217,-1.03e-02},
+  {246,245,-1.03e-02},
+  {246,247,-1.03e-02},
+  {246,278,-1.03e-02},
+  {246,279,-1.03e-02},
+  {246,280,-1.03e-02},
+  {246,503,-1.93e-04},
+  {246,504,-4.84e-05},
+  {246,506,-4.84e-05},
+  {246,534,-1.93e-04},
+  {246,535,-7.74e-04},
+  {246,536,-1.93e-04},
+  {246,567,-4.84e-05},
+  {246,568,-1.93e-04},
+  {246,569,-4.84e-05},
+  {247,247,8.29e-02},
+  {247,214,-1.03e-02},
+  {247,215,-1.03e-02},
+  {247,216,-1.03e-02},
+  {247,246,-1.03e-02},
+  {247,248,-1.03e-02},
+  {247,279,-1.03e-02},
+  {247,280,-1.03e-02},
+  {247,281,-1.03e-02},
+  {247,503,-4.84e-05},
+  {247,504,-1.93e-04},
+  {247,505,-4.84e-05},
+  {247,535,-1.93e-04},
+  {247,536,-7.74e-04},
+  {247,537,-1.93e-04},
+  {247,568,-4.84e-05},
+  {247,569,-1.93e-04},
+  {247,570,-4.84e-05},
+  {248,248,8.29e-02},
+  {248,215,-1.03e-02},
+  {248,216,-1.03e-02},
+  {248,221,-1.03e-02},
+  {248,247,-1.03e-02},
+  {248,249,-1.03e-02},
+  {248,280,-1.03e-02},
+  {248,281,-1.03e-02},
+  {248,282,-1.03e-02},
+  {248,504,-4.84e-05},
+  {248,505,-1.93e-04},
+  {248,510,-4.84e-05},
+  {248,536,-1.93e-04},
+  {248,537,-7.74e-04},
+  {248,538,-1.93e-04},
+  {248,569,-4.84e-05},
+  {248,570,-1.93e-04},
+  {248,571,-4.84e-05},
+  {249,249,8.29e-02},
+  {249,216,-1.03e-02},
+  {249,218,-1.03e-02},
+  {249,221,-1.03e-02},
+  {249,248,-1.03e-02},
+  {249,250,-1.03e-02},
+  {249,281,-1.03e-02},
+  {249,282,-1.03e-02},
+  {249,283,-1.03e-02},
+  {249,505,-4.84e-05},
+  {249,507,-4.84e-05},
+  {249,510,-1.93e-04},
+  {249,537,-1.93e-04},
+  {249,538,-7.74e-04},
+  {249,539,-1.93e-04},
+  {249,570,-4.84e-05},
+  {249,571,-1.93e-04},
+  {249,572,-4.84e-05},
+  {250,250,8.29e-02},
+  {250,218,-1.03e-02},
+  {250,219,-1.03e-02},
+  {250,221,-1.03e-02},
+  {250,249,-1.03e-02},
+  {250,251,-1.03e-02},
+  {250,282,-1.03e-02},
+  {250,283,-1.03e-02},
+  {250,284,-1.03e-02},
+  {250,507,-1.93e-04},
+  {250,508,-4.84e-05},
+  {250,510,-4.84e-05},
+  {250,538,-1.93e-04},
+  {250,539,-7.74e-04},
+  {250,540,-1.93e-04},
+  {250,571,-4.84e-05},
+  {250,572,-1.93e-04},
+  {250,573,-4.84e-05},
+  {251,251,8.29e-02},
+  {251,218,-1.03e-02},
+  {251,219,-1.03e-02},
+  {251,220,-1.03e-02},
+  {251,250,-1.03e-02},
+  {251,252,-1.03e-02},
+  {251,283,-1.03e-02},
+  {251,284,-1.03e-02},
+  {251,285,-1.03e-02},
+  {251,507,-4.84e-05},
+  {251,508,-1.93e-04},
+  {251,509,-4.84e-05},
+  {251,539,-1.93e-04},
+  {251,540,-7.74e-04},
+  {251,541,-1.93e-04},
+  {251,572,-4.84e-05},
+  {251,573,-1.93e-04},
+  {251,574,-4.84e-05},
+  {252,252,8.29e-02},
+  {252,219,-1.03e-02},
+  {252,220,-1.03e-02},
+  {252,224,-1.03e-02},
+  {252,251,-1.03e-02},
+  {252,253,-1.03e-02},
+  {252,284,-1.03e-02},
+  {252,285,-1.03e-02},
+  {252,286,-1.03e-02},
+  {252,508,-4.84e-05},
+  {252,509,-1.93e-04},
+  {252,513,-4.84e-05},
+  {252,540,-1.93e-04},
+  {252,541,-7.74e-04},
+  {252,542,-1.93e-04},
+  {252,573,-4.84e-05},
+  {252,574,-1.93e-04},
+  {252,575,-4.84e-05},
+  {253,253,8.29e-02},
+  {253,220,-1.03e-02},
+  {253,222,-1.03e-02},
+  {253,224,-1.03e-02},
+  {253,252,-1.03e-02},
+  {253,254,-1.03e-02},
+  {253,285,-1.03e-02},
+  {253,286,-1.03e-02},
+  {253,287,-1.03e-02},
+  {253,509,-4.84e-05},
+  {253,511,-4.84e-05},
+  {253,513,-1.93e-04},
+  {253,541,-1.93e-04},
+  {253,542,-7.74e-04},
+  {253,543,-1.93e-04},
+  {253,574,-4.84e-05},
+  {253,575,-1.93e-04},
+  {253,576,-4.84e-05},
+  {254,254,8.29e-02},
+  {254,222,-1.03e-02},
+  {254,223,-1.03e-02},
+  {254,224,-1.03e-02},
+  {254,253,-1.03e-02},
+  {254,255,-1.03e-02},
+  {254,286,-1.03e-02},
+  {254,287,-1.03e-02},
+  {254,288,-1.03e-02},
+  {254,511,-1.93e-04},
+  {254,512,-4.84e-05},
+  {254,513,-4.84e-05},
+  {254,542,-1.93e-04},
+  {254,543,-7.74e-04},
+  {254,544,-1.93e-04},
+  {254,575,-4.84e-05},
+  {254,576,-1.93e-04},
+  {254,577,-4.84e-05},
+  {255,255,8.29e-02},
+  {255,197,-1.03e-02},
+  {255,222,-1.03e-02},
+  {255,223,-1.03e-02},
+  {255,226,-1.03e-02},
+  {255,254,-1.03e-02},
+  {255,258,-1.03e-02},
+  {255,287,-1.03e-02},
+  {255,288,-1.03e-02},
+  {255,486,-4.84e-05},
+  {255,511,-4.84e-05},
+  {255,512,-1.93e-04},
+  {255,515,-1.93e-04},
+  {255,543,-1.93e-04},
+  {255,544,-7.74e-04},
+  {255,547,-4.84e-05},
+  {255,576,-4.84e-05},
+  {255,577,-1.93e-04},
+  {256,256,1.87e-01},
+  {256,225,3.65e-02},
+  {256,227,-1.03e-02},
+  {256,259,3.65e-02},
+  {256,514,-9.67e-05},
+  {256,516,-4.84e-05},
+  {256,545,-1.93e-04},
+  {256,548,-9.67e-05},
+  {257,257,1.87e-01},
+  {257,241,-1.03e-02},
+  {257,273,3.65e-02},
+  {257,274,3.65e-02},
+  {257,530,-4.84e-05},
+  {257,546,-1.93e-04},
+  {257,562,-9.67e-05},
+  {257,563,-9.67e-05},
+  {258,258,1.87e-01},
+  {258,226,3.65e-02},
+  {258,255,-1.03e-02},
+  {258,288,3.65e-02},
+  {258,515,-9.67e-05},
+  {258,544,-4.84e-05},
+  {258,547,-1.93e-04},
+  {258,577,-9.67e-05},
+  {259,259,2.08e-01},
+  {259,225,-1.03e-02},
+  {259,227,-1.03e-02},
+  {259,228,-1.03e-02},
+  {259,256,3.65e-02},
+  {259,260,3.65e-02},
+  {259,514,-4.84e-05},
+  {259,516,-1.93e-04},
+  {259,517,-4.84e-05},
+  {259,545,-9.67e-05},
+  {259,548,-3.87e-04},
+  {259,549,-9.67e-05},
+  {260,260,2.08e-01},
+  {260,227,-1.03e-02},
+  {260,228,-1.03e-02},
+  {260,229,-1.03e-02},
+  {260,259,3.65e-02},
+  {260,261,3.65e-02},
+  {260,516,-4.84e-05},
+  {260,517,-1.93e-04},
+  {260,518,-4.84e-05},
+  {260,548,-9.67e-05},
+  {260,549,-3.87e-04},
+  {260,550,-9.67e-05},
+  {261,261,2.08e-01},
+  {261,228,-1.03e-02},
+  {261,229,-1.03e-02},
+  {261,230,-1.03e-02},
+  {261,260,3.65e-02},
+  {261,262,3.65e-02},
+  {261,517,-4.84e-05},
+  {261,518,-1.93e-04},
+  {261,519,-4.84e-05},
+  {261,549,-9.67e-05},
+  {261,550,-3.87e-04},
+  {261,551,-9.67e-05},
+  {262,262,2.08e-01},
+  {262,229,-1.03e-02},
+  {262,230,-1.03e-02},
+  {262,231,-1.03e-02},
+  {262,261,3.65e-02},
+  {262,263,3.65e-02},
+  {262,518,-4.84e-05},
+  {262,519,-1.93e-04},
+  {262,520,-4.84e-05},
+  {262,550,-9.67e-05},
+  {262,551,-3.87e-04},
+  {262,552,-9.67e-05},
+  {263,263,2.08e-01},
+  {263,230,-1.03e-02},
+  {263,231,-1.03e-02},
+  {263,232,-1.03e-02},
+  {263,262,3.65e-02},
+  {263,264,3.65e-02},
+  {263,519,-4.84e-05},
+  {263,520,-1.93e-04},
+  {263,521,-4.84e-05},
+  {263,551,-9.67e-05},
+  {263,552,-3.87e-04},
+  {263,553,-9.67e-05},
+  {264,264,2.08e-01},
+  {264,231,-1.03e-02},
+  {264,232,-1.03e-02},
+  {264,233,-1.03e-02},
+  {264,263,3.65e-02},
+  {264,265,3.65e-02},
+  {264,520,-4.84e-05},
+  {264,521,-1.93e-04},
+  {264,522,-4.84e-05},
+  {264,552,-9.67e-05},
+  {264,553,-3.87e-04},
+  {264,554,-9.67e-05},
+  {265,265,2.08e-01},
+  {265,232,-1.03e-02},
+  {265,233,-1.03e-02},
+  {265,234,-1.03e-02},
+  {265,264,3.65e-02},
+  {265,266,3.65e-02},
+  {265,521,-4.84e-05},
+  {265,522,-1.93e-04},
+  {265,523,-4.84e-05},
+  {265,553,-9.67e-05},
+  {265,554,-3.87e-04},
+  {265,555,-9.67e-05},
+  {266,266,2.08e-01},
+  {266,233,-1.03e-02},
+  {266,234,-1.03e-02},
+  {266,235,-1.03e-02},
+  {266,265,3.65e-02},
+  {266,267,3.65e-02},
+  {266,522,-4.84e-05},
+  {266,523,-1.93e-04},
+  {266,524,-4.84e-05},
+  {266,554,-9.67e-05},
+  {266,555,-3.87e-04},
+  {266,556,-9.67e-05},
+  {267,267,2.08e-01},
+  {267,234,-1.03e-02},
+  {267,235,-1.03e-02},
+  {267,236,-1.03e-02},
+  {267,266,3.65e-02},
+  {267,268,3.65e-02},
+  {267,523,-4.84e-05},
+  {267,524,-1.93e-04},
+  {267,525,-4.84e-05},
+  {267,555,-9.67e-05},
+  {267,556,-3.87e-04},
+  {267,557,-9.67e-05},
+  {268,268,2.08e-01},
+  {268,235,-1.03e-02},
+  {268,236,-1.03e-02},
+  {268,237,-1.03e-02},
+  {268,267,3.65e-02},
+  {268,269,3.65e-02},
+  {268,524,-4.84e-05},
+  {268,525,-1.93e-04},
+  {268,526,-4.84e-05},
+  {268,556,-9.67e-05},
+  {268,557,-3.87e-04},
+  {268,558,-9.67e-05},
+  {269,269,2.08e-01},
+  {269,236,-1.03e-02},
+  {269,237,-1.03e-02},
+  {269,238,-1.03e-02},
+  {269,268,3.65e-02},
+  {269,270,3.65e-02},
+  {269,525,-4.84e-05},
+  {269,526,-1.93e-04},
+  {269,527,-4.84e-05},
+  {269,557,-9.67e-05},
+  {269,558,-3.87e-04},
+  {269,559,-9.67e-05},
+  {270,270,2.08e-01},
+  {270,237,-1.03e-02},
+  {270,238,-1.03e-02},
+  {270,239,-1.03e-02},
+  {270,269,3.65e-02},
+  {270,271,3.65e-02},
+  {270,526,-4.84e-05},
+  {270,527,-1.93e-04},
+  {270,528,-4.84e-05},
+  {270,558,-9.67e-05},
+  {270,559,-3.87e-04},
+  {270,560,-9.67e-05},
+  {271,271,2.08e-01},
+  {271,238,-1.03e-02},
+  {271,239,-1.03e-02},
+  {271,240,-1.03e-02},
+  {271,270,3.65e-02},
+  {271,272,3.65e-02},
+  {271,527,-4.84e-05},
+  {271,528,-1.93e-04},
+  {271,529,-4.84e-05},
+  {271,559,-9.67e-05},
+  {271,560,-3.87e-04},
+  {271,561,-9.67e-05},
+  {272,272,2.08e-01},
+  {272,239,-1.03e-02},
+  {272,240,-1.03e-02},
+  {272,241,-1.03e-02},
+  {272,271,3.65e-02},
+  {272,273,3.65e-02},
+  {272,528,-4.84e-05},
+  {272,529,-1.93e-04},
+  {272,530,-4.84e-05},
+  {272,560,-9.67e-05},
+  {272,561,-3.87e-04},
+  {272,562,-9.67e-05},
+  {273,273,2.08e-01},
+  {273,240,-1.03e-02},
+  {273,241,-1.03e-02},
+  {273,257,3.65e-02},
+  {273,272,3.65e-02},
+  {273,274,-1.03e-02},
+  {273,529,-4.84e-05},
+  {273,530,-1.93e-04},
+  {273,546,-9.67e-05},
+  {273,561,-9.67e-05},
+  {273,562,-3.87e-04},
+  {273,563,-4.84e-05},
+  {274,274,2.08e-01},
+  {274,241,-1.03e-02},
+  {274,242,-1.03e-02},
+  {274,257,3.65e-02},
+  {274,273,-1.03e-02},
+  {274,275,3.65e-02},
+  {274,530,-1.93e-04},
+  {274,531,-4.84e-05},
+  {274,546,-9.67e-05},
+  {274,562,-4.84e-05},
+  {274,563,-3.87e-04},
+  {274,564,-9.67e-05},
+  {275,275,2.08e-01},
+  {275,241,-1.03e-02},
+  {275,242,-1.03e-02},
+  {275,243,-1.03e-02},
+  {275,274,3.65e-02},
+  {275,276,3.65e-02},
+  {275,530,-4.84e-05},
+  {275,531,-1.93e-04},
+  {275,532,-4.84e-05},
+  {275,563,-9.67e-05},
+  {275,564,-3.87e-04},
+  {275,565,-9.67e-05},
+  {276,276,2.08e-01},
+  {276,242,-1.03e-02},
+  {276,243,-1.03e-02},
+  {276,244,-1.03e-02},
+  {276,275,3.65e-02},
+  {276,277,3.65e-02},
+  {276,531,-4.84e-05},
+  {276,532,-1.93e-04},
+  {276,533,-4.84e-05},
+  {276,564,-9.67e-05},
+  {276,565,-3.87e-04},
+  {276,566,-9.67e-05},
+  {277,277,2.08e-01},
+  {277,243,-1.03e-02},
+  {277,244,-1.03e-02},
+  {277,245,-1.03e-02},
+  {277,276,3.65e-02},
+  {277,278,3.65e-02},
+  {277,532,-4.84e-05},
+  {277,533,-1.93e-04},
+  {277,534,-4.84e-05},
+  {277,565,-9.67e-05},
+  {277,566,-3.87e-04},
+  {277,567,-9.67e-05},
+  {278,278,2.08e-01},
+  {278,244,-1.03e-02},
+  {278,245,-1.03e-02},
+  {278,246,-1.03e-02},
+  {278,277,3.65e-02},
+  {278,279,3.65e-02},
+  {278,533,-4.84e-05},
+  {278,534,-1.93e-04},
+  {278,535,-4.84e-05},
+  {278,566,-9.67e-05},
+  {278,567,-3.87e-04},
+  {278,568,-9.67e-05},
+  {279,279,2.08e-01},
+  {279,245,-1.03e-02},
+  {279,246,-1.03e-02},
+  {279,247,-1.03e-02},
+  {279,278,3.65e-02},
+  {279,280,3.65e-02},
+  {279,534,-4.84e-05},
+  {279,535,-1.93e-04},
+  {279,536,-4.84e-05},
+  {279,567,-9.67e-05},
+  {279,568,-3.87e-04},
+  {279,569,-9.67e-05},
+  {280,280,2.08e-01},
+  {280,246,-1.03e-02},
+  {280,247,-1.03e-02},
+  {280,248,-1.03e-02},
+  {280,279,3.65e-02},
+  {280,281,3.65e-02},
+  {280,535,-4.84e-05},
+  {280,536,-1.93e-04},
+  {280,537,-4.84e-05},
+  {280,568,-9.67e-05},
+  {280,569,-3.87e-04},
+  {280,570,-9.67e-05},
+  {281,281,2.08e-01},
+  {281,247,-1.03e-02},
+  {281,248,-1.03e-02},
+  {281,249,-1.03e-02},
+  {281,280,3.65e-02},
+  {281,282,3.65e-02},
+  {281,536,-4.84e-05},
+  {281,537,-1.93e-04},
+  {281,538,-4.84e-05},
+  {281,569,-9.67e-05},
+  {281,570,-3.87e-04},
+  {281,571,-9.67e-05},
+  {282,282,2.08e-01},
+  {282,248,-1.03e-02},
+  {282,249,-1.03e-02},
+  {282,250,-1.03e-02},
+  {282,281,3.65e-02},
+  {282,283,3.65e-02},
+  {282,537,-4.84e-05},
+  {282,538,-1.93e-04},
+  {282,539,-4.84e-05},
+  {282,570,-9.67e-05},
+  {282,571,-3.87e-04},
+  {282,572,-9.67e-05},
+  {283,283,2.08e-01},
+  {283,249,-1.03e-02},
+  {283,250,-1.03e-02},
+  {283,251,-1.03e-02},
+  {283,282,3.65e-02},
+  {283,284,3.65e-02},
+  {283,538,-4.84e-05},
+  {283,539,-1.93e-04},
+  {283,540,-4.84e-05},
+  {283,571,-9.67e-05},
+  {283,572,-3.87e-04},
+  {283,573,-9.67e-05},
+  {284,284,2.08e-01},
+  {284,250,-1.03e-02},
+  {284,251,-1.03e-02},
+  {284,252,-1.03e-02},
+  {284,283,3.65e-02},
+  {284,285,3.65e-02},
+  {284,539,-4.84e-05},
+  {284,540,-1.93e-04},
+  {284,541,-4.84e-05},
+  {284,572,-9.67e-05},
+  {284,573,-3.87e-04},
+  {284,574,-9.67e-05},
+  {285,285,2.08e-01},
+  {285,251,-1.03e-02},
+  {285,252,-1.03e-02},
+  {285,253,-1.03e-02},
+  {285,284,3.65e-02},
+  {285,286,3.65e-02},
+  {285,540,-4.84e-05},
+  {285,541,-1.93e-04},
+  {285,542,-4.84e-05},
+  {285,573,-9.67e-05},
+  {285,574,-3.87e-04},
+  {285,575,-9.67e-05},
+  {286,286,2.08e-01},
+  {286,252,-1.03e-02},
+  {286,253,-1.03e-02},
+  {286,254,-1.03e-02},
+  {286,285,3.65e-02},
+  {286,287,3.65e-02},
+  {286,541,-4.84e-05},
+  {286,542,-1.93e-04},
+  {286,543,-4.84e-05},
+  {286,574,-9.67e-05},
+  {286,575,-3.87e-04},
+  {286,576,-9.67e-05},
+  {287,287,2.08e-01},
+  {287,253,-1.03e-02},
+  {287,254,-1.03e-02},
+  {287,255,-1.03e-02},
+  {287,286,3.65e-02},
+  {287,288,3.65e-02},
+  {287,542,-4.84e-05},
+  {287,543,-1.93e-04},
+  {287,544,-4.84e-05},
+  {287,575,-9.67e-05},
+  {287,576,-3.87e-04},
+  {287,577,-9.67e-05},
+  {288,288,2.08e-01},
+  {288,226,-1.03e-02},
+  {288,254,-1.03e-02},
+  {288,255,-1.03e-02},
+  {288,258,3.65e-02},
+  {288,287,3.65e-02},
+  {288,515,-4.84e-05},
+  {288,543,-4.84e-05},
+  {288,544,-1.93e-04},
+  {288,547,-9.67e-05},
+  {288,576,-9.67e-05},
+  {288,577,-3.87e-04},
+  {289,289,1.87e-01},
+  {289,0,1.93e-04},
+  {289,1,9.67e-05},
+  {289,2,9.67e-05},
+  {289,3,4.84e-05},
+  {289,290,3.65e-02},
+  {289,291,3.65e-02},
+  {289,292,-1.03e-02},
+  {290,290,2.08e-01},
+  {290,0,9.67e-05},
+  {290,1,3.87e-04},
+  {290,2,4.84e-05},
+  {290,3,1.93e-04},
+  {290,4,9.67e-05},
+  {290,6,4.84e-05},
+  {290,289,3.65e-02},
+  {290,291,-1.03e-02},
+  {290,292,-1.03e-02},
+  {290,293,3.65e-02},
+  {290,295,-1.03e-02},
+  {291,291,2.08e-01},
+  {291,0,9.67e-05},
+  {291,1,4.84e-05},
+  {291,2,3.87e-04},
+  {291,3,1.93e-04},
+  {291,5,9.67e-05},
+  {291,8,4.84e-05},
+  {291,289,3.65e-02},
+  {291,290,-1.03e-02},
+  {291,292,-1.03e-02},
+  {291,294,3.65e-02},
+  {291,297,-1.03e-02},
+  {292,292,8.29e-02},
+  {292,0,4.84e-05},
+  {292,1,1.93e-04},
+  {292,2,1.93e-04},
+  {292,3,7.74e-04},
+  {292,4,4.84e-05},
+  {292,5,4.84e-05},
+  {292,6,1.93e-04},
+  {292,7,4.84e-05},
+  {292,8,1.93e-04},
+  {292,289,-1.03e-02},
+  {292,290,-1.03e-02},
+  {292,291,-1.03e-02},
+  {292,293,-1.03e-02},
+  {292,294,-1.03e-02},
+  {292,295,-1.03e-02},
+  {292,296,-1.03e-02},
+  {292,297,-1.03e-02},
+  {293,293,2.08e-01},
+  {293,1,9.67e-05},
+  {293,3,4.84e-05},
+  {293,4,3.87e-04},
+  {293,6,1.93e-04},
+  {293,9,9.67e-05},
+  {293,11,4.84e-05},
+  {293,290,3.65e-02},
+  {293,292,-1.03e-02},
+  {293,295,-1.03e-02},
+  {293,298,3.65e-02},
+  {293,300,-1.03e-02},
+  {294,294,2.08e-01},
+  {294,2,9.67e-05},
+  {294,3,4.84e-05},
+  {294,5,3.87e-04},
+  {294,8,1.93e-04},
+  {294,10,9.67e-05},
+  {294,15,4.84e-05},
+  {294,291,3.65e-02},
+  {294,292,-1.03e-02},
+  {294,297,-1.03e-02},
+  {294,299,3.65e-02},
+  {294,304,-1.03e-02},
+  {295,295,8.29e-02},
+  {295,1,4.84e-05},
+  {295,3,1.93e-04},
+  {295,4,1.93e-04},
+  {295,6,7.74e-04},
+  {295,7,1.93e-04},
+  {295,8,4.84e-05},
+  {295,9,4.84e-05},
+  {295,11,1.93e-04},
+  {295,12,4.84e-05},
+  {295,290,-1.03e-02},
+  {295,292,-1.03e-02},
+  {295,293,-1.03e-02},
+  {295,296,-1.03e-02},
+  {295,297,-1.03e-02},
+  {295,298,-1.03e-02},
+  {295,300,-1.03e-02},
+  {295,301,-1.03e-02},
+  {296,296,8.29e-02},
+  {296,3,4.84e-05},
+  {296,6,1.93e-04},
+  {296,7,7.74e-04},
+  {296,8,1.93e-04},
+  {296,11,4.84e-05},
+  {296,12,1.93e-04},
+  {296,13,4.84e-05},
+  {296,14,1.93e-04},
+  {296,15,4.84e-05},
+  {296,292,-1.03e-02},
+  {296,295,-1.03e-02},
+  {296,297,-1.03e-02},
+  {296,300,-1.03e-02},
+  {296,301,-1.03e-02},
+  {296,302,-1.03e-02},
+  {296,303,-1.03e-02},
+  {296,304,-1.03e-02},
+  {297,297,8.29e-02},
+  {297,2,4.84e-05},
+  {297,3,1.93e-04},
+  {297,5,1.93e-04},
+  {297,6,4.84e-05},
+  {297,7,1.93e-04},
+  {297,8,7.74e-04},
+  {297,10,4.84e-05},
+  {297,14,4.84e-05},
+  {297,15,1.93e-04},
+  {297,291,-1.03e-02},
+  {297,292,-1.03e-02},
+  {297,294,-1.03e-02},
+  {297,295,-1.03e-02},
+  {297,296,-1.03e-02},
+  {297,299,-1.03e-02},
+  {297,303,-1.03e-02},
+  {297,304,-1.03e-02},
+  {298,298,2.08e-01},
+  {298,4,9.67e-05},
+  {298,6,4.84e-05},
+  {298,9,3.87e-04},
+  {298,11,1.93e-04},
+  {298,16,9.67e-05},
+  {298,18,4.84e-05},
+  {298,293,3.65e-02},
+  {298,295,-1.03e-02},
+  {298,300,-1.03e-02},
+  {298,305,3.65e-02},
+  {298,307,-1.03e-02},
+  {299,299,2.08e-01},
+  {299,5,9.67e-05},
+  {299,8,4.84e-05},
+  {299,10,3.87e-04},
+  {299,15,1.93e-04},
+  {299,17,9.67e-05},
+  {299,24,4.84e-05},
+  {299,294,3.65e-02},
+  {299,297,-1.03e-02},
+  {299,304,-1.03e-02},
+  {299,306,3.65e-02},
+  {299,313,-1.03e-02},
+  {300,300,8.29e-02},
+  {300,4,4.84e-05},
+  {300,6,1.93e-04},
+  {300,7,4.84e-05},
+  {300,9,1.93e-04},
+  {300,11,7.74e-04},
+  {300,12,1.93e-04},
+  {300,16,4.84e-05},
+  {300,18,1.93e-04},
+  {300,19,4.84e-05},
+  {300,293,-1.03e-02},
+  {300,295,-1.03e-02},
+  {300,296,-1.03e-02},
+  {300,298,-1.03e-02},
+  {300,301,-1.03e-02},
+  {300,305,-1.03e-02},
+  {300,307,-1.03e-02},
+  {300,308,-1.03e-02},
+  {301,301,8.29e-02},
+  {301,6,4.84e-05},
+  {301,7,1.93e-04},
+  {301,11,1.93e-04},
+  {301,12,7.74e-04},
+  {301,13,1.93e-04},
+  {301,14,4.84e-05},
+  {301,18,4.84e-05},
+  {301,19,1.93e-04},
+  {301,20,4.84e-05},
+  {301,295,-1.03e-02},
+  {301,296,-1.03e-02},
+  {301,300,-1.03e-02},
+  {301,302,-1.03e-02},
+  {301,303,-1.03e-02},
+  {301,307,-1.03e-02},
+  {301,308,-1.03e-02},
+  {301,309,-1.03e-02},
+  {302,302,8.29e-02},
+  {302,7,4.84e-05},
+  {302,12,1.93e-04},
+  {302,13,7.74e-04},
+  {302,14,1.93e-04},
+  {302,19,4.84e-05},
+  {302,20,1.93e-04},
+  {302,21,4.84e-05},
+  {302,22,1.93e-04},
+  {302,23,4.84e-05},
+  {302,296,-1.03e-02},
+  {302,301,-1.03e-02},
+  {302,303,-1.03e-02},
+  {302,308,-1.03e-02},
+  {302,309,-1.03e-02},
+  {302,310,-1.03e-02},
+  {302,311,-1.03e-02},
+  {302,312,-1.03e-02},
+  {303,303,8.29e-02},
+  {303,7,1.93e-04},
+  {303,8,4.84e-05},
+  {303,12,4.84e-05},
+  {303,13,1.93e-04},
+  {303,14,7.74e-04},
+  {303,15,1.93e-04},
+  {303,22,4.84e-05},
+  {303,23,1.93e-04},
+  {303,24,4.84e-05},
+  {303,296,-1.03e-02},
+  {303,297,-1.03e-02},
+  {303,301,-1.03e-02},
+  {303,302,-1.03e-02},
+  {303,304,-1.03e-02},
+  {303,311,-1.03e-02},
+  {303,312,-1.03e-02},
+  {303,313,-1.03e-02},
+  {304,304,8.29e-02},
+  {304,5,4.84e-05},
+  {304,7,4.84e-05},
+  {304,8,1.93e-04},
+  {304,10,1.93e-04},
+  {304,14,1.93e-04},
+  {304,15,7.74e-04},
+  {304,17,4.84e-05},
+  {304,23,4.84e-05},
+  {304,24,1.93e-04},
+  {304,294,-1.03e-02},
+  {304,296,-1.03e-02},
+  {304,297,-1.03e-02},
+  {304,299,-1.03e-02},
+  {304,303,-1.03e-02},
+  {304,306,-1.03e-02},
+  {304,312,-1.03e-02},
+  {304,313,-1.03e-02},
+  {305,305,2.08e-01},
+  {305,9,9.67e-05},
+  {305,11,4.84e-05},
+  {305,16,3.87e-04},
+  {305,18,1.93e-04},
+  {305,25,9.67e-05},
+  {305,27,4.84e-05},
+  {305,298,3.65e-02},
+  {305,300,-1.03e-02},
+  {305,307,-1.03e-02},
+  {305,314,3.65e-02},
+  {305,316,-1.03e-02},
+  {306,306,2.08e-01},
+  {306,10,9.67e-05},
+  {306,15,4.84e-05},
+  {306,17,3.87e-04},
+  {306,24,1.93e-04},
+  {306,26,9.67e-05},
+  {306,33,4.84e-05},
+  {306,299,3.65e-02},
+  {306,304,-1.03e-02},
+  {306,313,-1.03e-02},
+  {306,315,3.65e-02},
+  {306,322,-1.03e-02},
+  {307,307,8.29e-02},
+  {307,9,4.84e-05},
+  {307,11,1.93e-04},
+  {307,12,4.84e-05},
+  {307,16,1.93e-04},
+  {307,18,7.74e-04},
+  {307,19,1.93e-04},
+  {307,25,4.84e-05},
+  {307,27,1.93e-04},
+  {307,28,4.84e-05},
+  {307,298,-1.03e-02},
+  {307,300,-1.03e-02},
+  {307,301,-1.03e-02},
+  {307,305,-1.03e-02},
+  {307,308,-1.03e-02},
+  {307,314,-1.03e-02},
+  {307,316,-1.03e-02},
+  {307,317,-1.03e-02},
+  {308,308,8.29e-02},
+  {308,11,4.84e-05},
+  {308,12,1.93e-04},
+  {308,13,4.84e-05},
+  {308,18,1.93e-04},
+  {308,19,7.74e-04},
+  {308,20,1.93e-04},
+  {308,27,4.84e-05},
+  {308,28,1.93e-04},
+  {308,29,4.84e-05},
+  {308,300,-1.03e-02},
+  {308,301,-1.03e-02},
+  {308,302,-1.03e-02},
+  {308,307,-1.03e-02},
+  {308,309,-1.03e-02},
+  {308,316,-1.03e-02},
+  {308,317,-1.03e-02},
+  {308,318,-1.03e-02},
+  {309,309,8.29e-02},
+  {309,12,4.84e-05},
+  {309,13,1.93e-04},
+  {309,19,1.93e-04},
+  {309,20,7.74e-04},
+  {309,21,1.93e-04},
+  {309,22,4.84e-05},
+  {309,28,4.84e-05},
+  {309,29,1.93e-04},
+  {309,30,4.84e-05},
+  {309,301,-1.03e-02},
+  {309,302,-1.03e-02},
+  {309,308,-1.03e-02},
+  {309,310,-1.03e-02},
+  {309,311,-1.03e-02},
+  {309,317,-1.03e-02},
+  {309,318,-1.03e-02},
+  {309,319,-1.03e-02},
+  {310,310,8.29e-02},
+  {310,13,4.84e-05},
+  {310,20,1.93e-04},
+  {310,21,7.74e-04},
+  {310,22,1.93e-04},
+  {310,29,4.84e-05},
+  {310,30,1.93e-04},
+  {310,31,4.84e-05},
+  {310,32,1.93e-04},
+  {310,35,4.84e-05},
+  {310,302,-1.03e-02},
+  {310,309,-1.03e-02},
+  {310,311,-1.03e-02},
+  {310,318,-1.03e-02},
+  {310,319,-1.03e-02},
+  {310,320,-1.03e-02},
+  {310,321,-1.03e-02},
+  {310,324,-1.03e-02},
+  {311,311,8.29e-02},
+  {311,13,1.93e-04},
+  {311,14,4.84e-05},
+  {311,20,4.84e-05},
+  {311,21,1.93e-04},
+  {311,22,7.74e-04},
+  {311,23,1.93e-04},
+  {311,32,4.84e-05},
+  {311,34,4.84e-05},
+  {311,35,1.93e-04},
+  {311,302,-1.03e-02},
+  {311,303,-1.03e-02},
+  {311,309,-1.03e-02},
+  {311,310,-1.03e-02},
+  {311,312,-1.03e-02},
+  {311,321,-1.03e-02},
+  {311,323,-1.03e-02},
+  {311,324,-1.03e-02},
+  {312,312,8.29e-02},
+  {312,13,4.84e-05},
+  {312,14,1.93e-04},
+  {312,15,4.84e-05},
+  {312,22,1.93e-04},
+  {312,23,7.74e-04},
+  {312,24,1.93e-04},
+  {312,33,4.84e-05},
+  {312,34,1.93e-04},
+  {312,35,4.84e-05},
+  {312,302,-1.03e-02},
+  {312,303,-1.03e-02},
+  {312,304,-1.03e-02},
+  {312,311,-1.03e-02},
+  {312,313,-1.03e-02},
+  {312,322,-1.03e-02},
+  {312,323,-1.03e-02},
+  {312,324,-1.03e-02},
+  {313,313,8.29e-02},
+  {313,10,4.84e-05},
+  {313,14,4.84e-05},
+  {313,15,1.93e-04},
+  {313,17,1.93e-04},
+  {313,23,1.93e-04},
+  {313,24,7.74e-04},
+  {313,26,4.84e-05},
+  {313,33,1.93e-04},
+  {313,34,4.84e-05},
+  {313,299,-1.03e-02},
+  {313,303,-1.03e-02},
+  {313,304,-1.03e-02},
+  {313,306,-1.03e-02},
+  {313,312,-1.03e-02},
+  {313,315,-1.03e-02},
+  {313,322,-1.03e-02},
+  {313,323,-1.03e-02},
+  {314,314,2.08e-01},
+  {314,16,9.67e-05},
+  {314,18,4.84e-05},
+  {314,25,3.87e-04},
+  {314,27,1.93e-04},
+  {314,36,9.67e-05},
+  {314,38,4.84e-05},
+  {314,305,3.65e-02},
+  {314,307,-1.03e-02},
+  {314,316,-1.03e-02},
+  {314,325,3.65e-02},
+  {314,327,-1.03e-02},
+  {315,315,2.08e-01},
+  {315,17,9.67e-05},
+  {315,24,4.84e-05},
+  {315,26,3.87e-04},
+  {315,33,1.93e-04},
+  {315,37,9.67e-05},
+  {315,47,4.84e-05},
+  {315,306,3.65e-02},
+  {315,313,-1.03e-02},
+  {315,322,-1.03e-02},
+  {315,326,3.65e-02},
+  {315,336,-1.03e-02},
+  {316,316,8.29e-02},
+  {316,16,4.84e-05},
+  {316,18,1.93e-04},
+  {316,19,4.84e-05},
+  {316,25,1.93e-04},
+  {316,27,7.74e-04},
+  {316,28,1.93e-04},
+  {316,36,4.84e-05},
+  {316,38,1.93e-04},
+  {316,39,4.84e-05},
+  {316,305,-1.03e-02},
+  {316,307,-1.03e-02},
+  {316,308,-1.03e-02},
+  {316,314,-1.03e-02},
+  {316,317,-1.03e-02},
+  {316,325,-1.03e-02},
+  {316,327,-1.03e-02},
+  {316,328,-1.03e-02},
+  {317,317,8.29e-02},
+  {317,18,4.84e-05},
+  {317,19,1.93e-04},
+  {317,20,4.84e-05},
+  {317,27,1.93e-04},
+  {317,28,7.74e-04},
+  {317,29,1.93e-04},
+  {317,38,4.84e-05},
+  {317,39,1.93e-04},
+  {317,40,4.84e-05},
+  {317,307,-1.03e-02},
+  {317,308,-1.03e-02},
+  {317,309,-1.03e-02},
+  {317,316,-1.03e-02},
+  {317,318,-1.03e-02},
+  {317,327,-1.03e-02},
+  {317,328,-1.03e-02},
+  {317,329,-1.03e-02},
+  {318,318,8.29e-02},
+  {318,19,4.84e-05},
+  {318,20,1.93e-04},
+  {318,21,4.84e-05},
+  {318,28,1.93e-04},
+  {318,29,7.74e-04},
+  {318,30,1.93e-04},
+  {318,39,4.84e-05},
+  {318,40,1.93e-04},
+  {318,41,4.84e-05},
+  {318,308,-1.03e-02},
+  {318,309,-1.03e-02},
+  {318,310,-1.03e-02},
+  {318,317,-1.03e-02},
+  {318,319,-1.03e-02},
+  {318,328,-1.03e-02},
+  {318,329,-1.03e-02},
+  {318,330,-1.03e-02},
+  {319,319,8.29e-02},
+  {319,20,4.84e-05},
+  {319,21,1.93e-04},
+  {319,29,1.93e-04},
+  {319,30,7.74e-04},
+  {319,31,1.93e-04},
+  {319,32,4.84e-05},
+  {319,40,4.84e-05},
+  {319,41,1.93e-04},
+  {319,42,4.84e-05},
+  {319,309,-1.03e-02},
+  {319,310,-1.03e-02},
+  {319,318,-1.03e-02},
+  {319,320,-1.03e-02},
+  {319,321,-1.03e-02},
+  {319,329,-1.03e-02},
+  {319,330,-1.03e-02},
+  {319,331,-1.03e-02},
+  {320,320,8.29e-02},
+  {320,21,4.84e-05},
+  {320,30,1.93e-04},
+  {320,31,7.74e-04},
+  {320,32,1.93e-04},
+  {320,41,4.84e-05},
+  {320,42,1.93e-04},
+  {320,43,4.84e-05},
+  {320,44,1.93e-04},
+  {320,45,4.84e-05},
+  {320,310,-1.03e-02},
+  {320,319,-1.03e-02},
+  {320,321,-1.03e-02},
+  {320,330,-1.03e-02},
+  {320,331,-1.03e-02},
+  {320,332,-1.03e-02},
+  {320,333,-1.03e-02},
+  {320,334,-1.03e-02},
+  {321,321,8.29e-02},
+  {321,21,1.93e-04},
+  {321,22,4.84e-05},
+  {321,30,4.84e-05},
+  {321,31,1.93e-04},
+  {321,32,7.74e-04},
+  {321,35,1.93e-04},
+  {321,44,4.84e-05},
+  {321,45,1.93e-04},
+  {321,48,4.84e-05},
+  {321,310,-1.03e-02},
+  {321,311,-1.03e-02},
+  {321,319,-1.03e-02},
+  {321,320,-1.03e-02},
+  {321,324,-1.03e-02},
+  {321,333,-1.03e-02},
+  {321,334,-1.03e-02},
+  {321,337,-1.03e-02},
+  {322,322,8.29e-02},
+  {322,17,4.84e-05},
+  {322,23,4.84e-05},
+  {322,24,1.93e-04},
+  {322,26,1.93e-04},
+  {322,33,7.74e-04},
+  {322,34,1.93e-04},
+  {322,37,4.84e-05},
+  {322,46,4.84e-05},
+  {322,47,1.93e-04},
+  {322,306,-1.03e-02},
+  {322,312,-1.03e-02},
+  {322,313,-1.03e-02},
+  {322,315,-1.03e-02},
+  {322,323,-1.03e-02},
+  {322,326,-1.03e-02},
+  {322,335,-1.03e-02},
+  {322,336,-1.03e-02},
+  {323,323,8.29e-02},
+  {323,22,4.84e-05},
+  {323,23,1.93e-04},
+  {323,24,4.84e-05},
+  {323,33,1.93e-04},
+  {323,34,7.74e-04},
+  {323,35,1.93e-04},
+  {323,46,1.93e-04},
+  {323,47,4.84e-05},
+  {323,48,4.84e-05},
+  {323,311,-1.03e-02},
+  {323,312,-1.03e-02},
+  {323,313,-1.03e-02},
+  {323,322,-1.03e-02},
+  {323,324,-1.03e-02},
+  {323,335,-1.03e-02},
+  {323,336,-1.03e-02},
+  {323,337,-1.03e-02},
+  {324,324,8.29e-02},
+  {324,21,4.84e-05},
+  {324,22,1.93e-04},
+  {324,23,4.84e-05},
+  {324,32,1.93e-04},
+  {324,34,1.93e-04},
+  {324,35,7.74e-04},
+  {324,45,4.84e-05},
+  {324,46,4.84e-05},
+  {324,48,1.93e-04},
+  {324,310,-1.03e-02},
+  {324,311,-1.03e-02},
+  {324,312,-1.03e-02},
+  {324,321,-1.03e-02},
+  {324,323,-1.03e-02},
+  {324,334,-1.03e-02},
+  {324,335,-1.03e-02},
+  {324,337,-1.03e-02},
+  {325,325,2.08e-01},
+  {325,25,9.67e-05},
+  {325,27,4.84e-05},
+  {325,36,3.87e-04},
+  {325,38,1.93e-04},
+  {325,49,9.67e-05},
+  {325,51,4.84e-05},
+  {325,314,3.65e-02},
+  {325,316,-1.03e-02},
+  {325,327,-1.03e-02},
+  {325,338,3.65e-02},
+  {325,340,-1.03e-02},
+  {326,326,2.08e-01},
+  {326,26,9.67e-05},
+  {326,33,4.84e-05},
+  {326,37,3.87e-04},
+  {326,47,1.93e-04},
+  {326,50,9.67e-05},
+  {326,63,4.84e-05},
+  {326,315,3.65e-02},
+  {326,322,-1.03e-02},
+  {326,336,-1.03e-02},
+  {326,339,3.65e-02},
+  {326,352,-1.03e-02},
+  {327,327,8.29e-02},
+  {327,25,4.84e-05},
+  {327,27,1.93e-04},
+  {327,28,4.84e-05},
+  {327,36,1.93e-04},
+  {327,38,7.74e-04},
+  {327,39,1.93e-04},
+  {327,49,4.84e-05},
+  {327,51,1.93e-04},
+  {327,52,4.84e-05},
+  {327,314,-1.03e-02},
+  {327,316,-1.03e-02},
+  {327,317,-1.03e-02},
+  {327,325,-1.03e-02},
+  {327,328,-1.03e-02},
+  {327,338,-1.03e-02},
+  {327,340,-1.03e-02},
+  {327,341,-1.03e-02},
+  {328,328,8.29e-02},
+  {328,27,4.84e-05},
+  {328,28,1.93e-04},
+  {328,29,4.84e-05},
+  {328,38,1.93e-04},
+  {328,39,7.74e-04},
+  {328,40,1.93e-04},
+  {328,51,4.84e-05},
+  {328,52,1.93e-04},
+  {328,53,4.84e-05},
+  {328,316,-1.03e-02},
+  {328,317,-1.03e-02},
+  {328,318,-1.03e-02},
+  {328,327,-1.03e-02},
+  {328,329,-1.03e-02},
+  {328,340,-1.03e-02},
+  {328,341,-1.03e-02},
+  {328,342,-1.03e-02},
+  {329,329,8.29e-02},
+  {329,28,4.84e-05},
+  {329,29,1.93e-04},
+  {329,30,4.84e-05},
+  {329,39,1.93e-04},
+  {329,40,7.74e-04},
+  {329,41,1.93e-04},
+  {329,52,4.84e-05},
+  {329,53,1.93e-04},
+  {329,54,4.84e-05},
+  {329,317,-1.03e-02},
+  {329,318,-1.03e-02},
+  {329,319,-1.03e-02},
+  {329,328,-1.03e-02},
+  {329,330,-1.03e-02},
+  {329,341,-1.03e-02},
+  {329,342,-1.03e-02},
+  {329,343,-1.03e-02},
+  {330,330,8.29e-02},
+  {330,29,4.84e-05},
+  {330,30,1.93e-04},
+  {330,31,4.84e-05},
+  {330,40,1.93e-04},
+  {330,41,7.74e-04},
+  {330,42,1.93e-04},
+  {330,53,4.84e-05},
+  {330,54,1.93e-04},
+  {330,55,4.84e-05},
+  {330,318,-1.03e-02},
+  {330,319,-1.03e-02},
+  {330,320,-1.03e-02},
+  {330,329,-1.03e-02},
+  {330,331,-1.03e-02},
+  {330,342,-1.03e-02},
+  {330,343,-1.03e-02},
+  {330,344,-1.03e-02},
+  {331,331,8.29e-02},
+  {331,30,4.84e-05},
+  {331,31,1.93e-04},
+  {331,41,1.93e-04},
+  {331,42,7.74e-04},
+  {331,43,1.93e-04},
+  {331,44,4.84e-05},
+  {331,54,4.84e-05},
+  {331,55,1.93e-04},
+  {331,56,4.84e-05},
+  {331,319,-1.03e-02},
+  {331,320,-1.03e-02},
+  {331,330,-1.03e-02},
+  {331,332,-1.03e-02},
+  {331,333,-1.03e-02},
+  {331,343,-1.03e-02},
+  {331,344,-1.03e-02},
+  {331,345,-1.03e-02},
+  {332,332,8.29e-02},
+  {332,31,4.84e-05},
+  {332,42,1.93e-04},
+  {332,43,7.74e-04},
+  {332,44,1.93e-04},
+  {332,55,4.84e-05},
+  {332,56,1.93e-04},
+  {332,57,4.84e-05},
+  {332,58,1.93e-04},
+  {332,59,4.84e-05},
+  {332,320,-1.03e-02},
+  {332,331,-1.03e-02},
+  {332,333,-1.03e-02},
+  {332,344,-1.03e-02},
+  {332,345,-1.03e-02},
+  {332,346,-1.03e-02},
+  {332,347,-1.03e-02},
+  {332,348,-1.03e-02},
+  {333,333,8.29e-02},
+  {333,31,1.93e-04},
+  {333,32,4.84e-05},
+  {333,42,4.84e-05},
+  {333,43,1.93e-04},
+  {333,44,7.74e-04},
+  {333,45,1.93e-04},
+  {333,58,4.84e-05},
+  {333,59,1.93e-04},
+  {333,60,4.84e-05},
+  {333,320,-1.03e-02},
+  {333,321,-1.03e-02},
+  {333,331,-1.03e-02},
+  {333,332,-1.03e-02},
+  {333,334,-1.03e-02},
+  {333,347,-1.03e-02},
+  {333,348,-1.03e-02},
+  {333,349,-1.03e-02},
+  {334,334,8.29e-02},
+  {334,31,4.84e-05},
+  {334,32,1.93e-04},
+  {334,35,4.84e-05},
+  {334,44,1.93e-04},
+  {334,45,7.74e-04},
+  {334,48,1.93e-04},
+  {334,59,4.84e-05},
+  {334,60,1.93e-04},
+  {334,61,4.84e-05},
+  {334,320,-1.03e-02},
+  {334,321,-1.03e-02},
+  {334,324,-1.03e-02},
+  {334,333,-1.03e-02},
+  {334,337,-1.03e-02},
+  {334,348,-1.03e-02},
+  {334,349,-1.03e-02},
+  {334,350,-1.03e-02},
+  {335,335,8.29e-02},
+  {335,33,4.84e-05},
+  {335,34,1.93e-04},
+  {335,35,4.84e-05},
+  {335,46,7.74e-04},
+  {335,47,1.93e-04},
+  {335,48,1.93e-04},
+  {335,61,4.84e-05},
+  {335,62,1.93e-04},
+  {335,63,4.84e-05},
+  {335,322,-1.03e-02},
+  {335,323,-1.03e-02},
+  {335,324,-1.03e-02},
+  {335,336,-1.03e-02},
+  {335,337,-1.03e-02},
+  {335,350,-1.03e-02},
+  {335,351,-1.03e-02},
+  {335,352,-1.03e-02},
+  {336,336,8.29e-02},
+  {336,26,4.84e-05},
+  {336,33,1.93e-04},
+  {336,34,4.84e-05},
+  {336,37,1.93e-04},
+  {336,46,1.93e-04},
+  {336,47,7.74e-04},
+  {336,50,4.84e-05},
+  {336,62,4.84e-05},
+  {336,63,1.93e-04},
+  {336,315,-1.03e-02},
+  {336,322,-1.03e-02},
+  {336,323,-1.03e-02},
+  {336,326,-1.03e-02},
+  {336,335,-1.03e-02},
+  {336,339,-1.03e-02},
+  {336,351,-1.03e-02},
+  {336,352,-1.03e-02},
+  {337,337,8.29e-02},
+  {337,32,4.84e-05},
+  {337,34,4.84e-05},
+  {337,35,1.93e-04},
+  {337,45,1.93e-04},
+  {337,46,1.93e-04},
+  {337,48,7.74e-04},
+  {337,60,4.84e-05},
+  {337,61,1.93e-04},
+  {337,62,4.84e-05},
+  {337,321,-1.03e-02},
+  {337,323,-1.03e-02},
+  {337,324,-1.03e-02},
+  {337,334,-1.03e-02},
+  {337,335,-1.03e-02},
+  {337,349,-1.03e-02},
+  {337,350,-1.03e-02},
+  {337,351,-1.03e-02},
+  {338,338,2.08e-01},
+  {338,36,9.67e-05},
+  {338,38,4.84e-05},
+  {338,49,3.87e-04},
+  {338,51,1.93e-04},
+  {338,64,9.67e-05},
+  {338,66,4.84e-05},
+  {338,325,3.65e-02},
+  {338,327,-1.03e-02},
+  {338,340,-1.03e-02},
+  {338,353,3.65e-02},
+  {338,355,-1.03e-02},
+  {339,339,2.08e-01},
+  {339,37,9.67e-05},
+  {339,47,4.84e-05},
+  {339,50,3.87e-04},
+  {339,63,1.93e-04},
+  {339,65,9.67e-05},
+  {339,80,4.84e-05},
+  {339,326,3.65e-02},
+  {339,336,-1.03e-02},
+  {339,352,-1.03e-02},
+  {339,354,3.65e-02},
+  {339,369,-1.03e-02},
+  {340,340,8.29e-02},
+  {340,36,4.84e-05},
+  {340,38,1.93e-04},
+  {340,39,4.84e-05},
+  {340,49,1.93e-04},
+  {340,51,7.74e-04},
+  {340,52,1.93e-04},
+  {340,64,4.84e-05},
+  {340,66,1.93e-04},
+  {340,67,4.84e-05},
+  {340,325,-1.03e-02},
+  {340,327,-1.03e-02},
+  {340,328,-1.03e-02},
+  {340,338,-1.03e-02},
+  {340,341,-1.03e-02},
+  {340,353,-1.03e-02},
+  {340,355,-1.03e-02},
+  {340,356,-1.03e-02},
+  {341,341,8.29e-02},
+  {341,38,4.84e-05},
+  {341,39,1.93e-04},
+  {341,40,4.84e-05},
+  {341,51,1.93e-04},
+  {341,52,7.74e-04},
+  {341,53,1.93e-04},
+  {341,66,4.84e-05},
+  {341,67,1.93e-04},
+  {341,68,4.84e-05},
+  {341,327,-1.03e-02},
+  {341,328,-1.03e-02},
+  {341,329,-1.03e-02},
+  {341,340,-1.03e-02},
+  {341,342,-1.03e-02},
+  {341,355,-1.03e-02},
+  {341,356,-1.03e-02},
+  {341,357,-1.03e-02},
+  {342,342,8.29e-02},
+  {342,39,4.84e-05},
+  {342,40,1.93e-04},
+  {342,41,4.84e-05},
+  {342,52,1.93e-04},
+  {342,53,7.74e-04},
+  {342,54,1.93e-04},
+  {342,67,4.84e-05},
+  {342,68,1.93e-04},
+  {342,69,4.84e-05},
+  {342,328,-1.03e-02},
+  {342,329,-1.03e-02},
+  {342,330,-1.03e-02},
+  {342,341,-1.03e-02},
+  {342,343,-1.03e-02},
+  {342,356,-1.03e-02},
+  {342,357,-1.03e-02},
+  {342,358,-1.03e-02},
+  {343,343,8.29e-02},
+  {343,40,4.84e-05},
+  {343,41,1.93e-04},
+  {343,42,4.84e-05},
+  {343,53,1.93e-04},
+  {343,54,7.74e-04},
+  {343,55,1.93e-04},
+  {343,68,4.84e-05},
+  {343,69,1.93e-04},
+  {343,70,4.84e-05},
+  {343,329,-1.03e-02},
+  {343,330,-1.03e-02},
+  {343,331,-1.03e-02},
+  {343,342,-1.03e-02},
+  {343,344,-1.03e-02},
+  {343,357,-1.03e-02},
+  {343,358,-1.03e-02},
+  {343,359,-1.03e-02},
+  {344,344,8.29e-02},
+  {344,41,4.84e-05},
+  {344,42,1.93e-04},
+  {344,43,4.84e-05},
+  {344,54,1.93e-04},
+  {344,55,7.74e-04},
+  {344,56,1.93e-04},
+  {344,69,4.84e-05},
+  {344,70,1.93e-04},
+  {344,71,4.84e-05},
+  {344,330,-1.03e-02},
+  {344,331,-1.03e-02},
+  {344,332,-1.03e-02},
+  {344,343,-1.03e-02},
+  {344,345,-1.03e-02},
+  {344,358,-1.03e-02},
+  {344,359,-1.03e-02},
+  {344,360,-1.03e-02},
+  {345,345,8.29e-02},
+  {345,42,4.84e-05},
+  {345,43,1.93e-04},
+  {345,55,1.93e-04},
+  {345,56,7.74e-04},
+  {345,57,1.93e-04},
+  {345,58,4.84e-05},
+  {345,70,4.84e-05},
+  {345,71,1.93e-04},
+  {345,72,4.84e-05},
+  {345,331,-1.03e-02},
+  {345,332,-1.03e-02},
+  {345,344,-1.03e-02},
+  {345,346,-1.03e-02},
+  {345,347,-1.03e-02},
+  {345,359,-1.03e-02},
+  {345,360,-1.03e-02},
+  {345,361,-1.03e-02},
+  {346,346,8.29e-02},
+  {346,43,4.84e-05},
+  {346,56,1.93e-04},
+  {346,57,7.74e-04},
+  {346,58,1.93e-04},
+  {346,71,4.84e-05},
+  {346,72,1.93e-04},
+  {346,73,4.84e-05},
+  {346,74,1.93e-04},
+  {346,75,4.84e-05},
+  {346,332,-1.03e-02},
+  {346,345,-1.03e-02},
+  {346,347,-1.03e-02},
+  {346,360,-1.03e-02},
+  {346,361,-1.03e-02},
+  {346,362,-1.03e-02},
+  {346,363,-1.03e-02},
+  {346,364,-1.03e-02},
+  {347,347,8.29e-02},
+  {347,43,1.93e-04},
+  {347,44,4.84e-05},
+  {347,56,4.84e-05},
+  {347,57,1.93e-04},
+  {347,58,7.74e-04},
+  {347,59,1.93e-04},
+  {347,74,4.84e-05},
+  {347,75,1.93e-04},
+  {347,76,4.84e-05},
+  {347,332,-1.03e-02},
+  {347,333,-1.03e-02},
+  {347,345,-1.03e-02},
+  {347,346,-1.03e-02},
+  {347,348,-1.03e-02},
+  {347,363,-1.03e-02},
+  {347,364,-1.03e-02},
+  {347,365,-1.03e-02},
+  {348,348,8.29e-02},
+  {348,43,4.84e-05},
+  {348,44,1.93e-04},
+  {348,45,4.84e-05},
+  {348,58,1.93e-04},
+  {348,59,7.74e-04},
+  {348,60,1.93e-04},
+  {348,75,4.84e-05},
+  {348,76,1.93e-04},
+  {348,77,4.84e-05},
+  {348,332,-1.03e-02},
+  {348,333,-1.03e-02},
+  {348,334,-1.03e-02},
+  {348,347,-1.03e-02},
+  {348,349,-1.03e-02},
+  {348,364,-1.03e-02},
+  {348,365,-1.03e-02},
+  {348,366,-1.03e-02},
+  {349,349,8.29e-02},
+  {349,44,4.84e-05},
+  {349,45,1.93e-04},
+  {349,48,4.84e-05},
+  {349,59,1.93e-04},
+  {349,60,7.74e-04},
+  {349,61,1.93e-04},
+  {349,76,4.84e-05},
+  {349,77,1.93e-04},
+  {349,78,4.84e-05},
+  {349,333,-1.03e-02},
+  {349,334,-1.03e-02},
+  {349,337,-1.03e-02},
+  {349,348,-1.03e-02},
+  {349,350,-1.03e-02},
+  {349,365,-1.03e-02},
+  {349,366,-1.03e-02},
+  {349,367,-1.03e-02},
+  {350,350,8.29e-02},
+  {350,45,4.84e-05},
+  {350,46,4.84e-05},
+  {350,48,1.93e-04},
+  {350,60,1.93e-04},
+  {350,61,7.74e-04},
+  {350,62,1.93e-04},
+  {350,77,4.84e-05},
+  {350,78,1.93e-04},
+  {350,79,4.84e-05},
+  {350,334,-1.03e-02},
+  {350,335,-1.03e-02},
+  {350,337,-1.03e-02},
+  {350,349,-1.03e-02},
+  {350,351,-1.03e-02},
+  {350,366,-1.03e-02},
+  {350,367,-1.03e-02},
+  {350,368,-1.03e-02},
+  {351,351,8.29e-02},
+  {351,46,1.93e-04},
+  {351,47,4.84e-05},
+  {351,48,4.84e-05},
+  {351,61,1.93e-04},
+  {351,62,7.74e-04},
+  {351,63,1.93e-04},
+  {351,78,4.84e-05},
+  {351,79,1.93e-04},
+  {351,80,4.84e-05},
+  {351,335,-1.03e-02},
+  {351,336,-1.03e-02},
+  {351,337,-1.03e-02},
+  {351,350,-1.03e-02},
+  {351,352,-1.03e-02},
+  {351,367,-1.03e-02},
+  {351,368,-1.03e-02},
+  {351,369,-1.03e-02},
+  {352,352,8.29e-02},
+  {352,37,4.84e-05},
+  {352,46,4.84e-05},
+  {352,47,1.93e-04},
+  {352,50,1.93e-04},
+  {352,62,1.93e-04},
+  {352,63,7.74e-04},
+  {352,65,4.84e-05},
+  {352,79,4.84e-05},
+  {352,80,1.93e-04},
+  {352,326,-1.03e-02},
+  {352,335,-1.03e-02},
+  {352,336,-1.03e-02},
+  {352,339,-1.03e-02},
+  {352,351,-1.03e-02},
+  {352,354,-1.03e-02},
+  {352,368,-1.03e-02},
+  {352,369,-1.03e-02},
+  {353,353,2.08e-01},
+  {353,49,9.67e-05},
+  {353,51,4.84e-05},
+  {353,64,3.87e-04},
+  {353,66,1.93e-04},
+  {353,81,9.67e-05},
+  {353,83,4.84e-05},
+  {353,338,3.65e-02},
+  {353,340,-1.03e-02},
+  {353,355,-1.03e-02},
+  {353,370,3.65e-02},
+  {353,372,-1.03e-02},
+  {354,354,2.08e-01},
+  {354,50,9.67e-05},
+  {354,63,4.84e-05},
+  {354,65,3.87e-04},
+  {354,80,1.93e-04},
+  {354,82,9.67e-05},
+  {354,93,4.84e-05},
+  {354,339,3.65e-02},
+  {354,352,-1.03e-02},
+  {354,369,-1.03e-02},
+  {354,371,3.65e-02},
+  {354,382,-1.03e-02},
+  {355,355,8.29e-02},
+  {355,49,4.84e-05},
+  {355,51,1.93e-04},
+  {355,52,4.84e-05},
+  {355,64,1.93e-04},
+  {355,66,7.74e-04},
+  {355,67,1.93e-04},
+  {355,81,4.84e-05},
+  {355,83,1.93e-04},
+  {355,84,4.84e-05},
+  {355,338,-1.03e-02},
+  {355,340,-1.03e-02},
+  {355,341,-1.03e-02},
+  {355,353,-1.03e-02},
+  {355,356,-1.03e-02},
+  {355,370,-1.03e-02},
+  {355,372,-1.03e-02},
+  {355,373,-1.03e-02},
+  {356,356,8.29e-02},
+  {356,51,4.84e-05},
+  {356,52,1.93e-04},
+  {356,53,4.84e-05},
+  {356,66,1.93e-04},
+  {356,67,7.74e-04},
+  {356,68,1.93e-04},
+  {356,83,4.84e-05},
+  {356,84,1.93e-04},
+  {356,85,4.84e-05},
+  {356,340,-1.03e-02},
+  {356,341,-1.03e-02},
+  {356,342,-1.03e-02},
+  {356,355,-1.03e-02},
+  {356,357,-1.03e-02},
+  {356,372,-1.03e-02},
+  {356,373,-1.03e-02},
+  {356,374,-1.03e-02},
+  {357,357,8.29e-02},
+  {357,52,4.84e-05},
+  {357,53,1.93e-04},
+  {357,54,4.84e-05},
+  {357,67,1.93e-04},
+  {357,68,7.74e-04},
+  {357,69,1.93e-04},
+  {357,84,4.84e-05},
+  {357,85,1.93e-04},
+  {357,86,4.84e-05},
+  {357,341,-1.03e-02},
+  {357,342,-1.03e-02},
+  {357,343,-1.03e-02},
+  {357,356,-1.03e-02},
+  {357,358,-1.03e-02},
+  {357,373,-1.03e-02},
+  {357,374,-1.03e-02},
+  {357,375,-1.03e-02},
+  {358,358,8.29e-02},
+  {358,53,4.84e-05},
+  {358,54,1.93e-04},
+  {358,55,4.84e-05},
+  {358,68,1.93e-04},
+  {358,69,7.74e-04},
+  {358,70,1.93e-04},
+  {358,85,4.84e-05},
+  {358,86,1.93e-04},
+  {358,87,4.84e-05},
+  {358,342,-1.03e-02},
+  {358,343,-1.03e-02},
+  {358,344,-1.03e-02},
+  {358,357,-1.03e-02},
+  {358,359,-1.03e-02},
+  {358,374,-1.03e-02},
+  {358,375,-1.03e-02},
+  {358,376,-1.03e-02},
+  {359,359,8.29e-02},
+  {359,54,4.84e-05},
+  {359,55,1.93e-04},
+  {359,56,4.84e-05},
+  {359,69,1.93e-04},
+  {359,70,7.74e-04},
+  {359,71,1.93e-04},
+  {359,86,4.84e-05},
+  {359,87,1.93e-04},
+  {359,88,4.84e-05},
+  {359,343,-1.03e-02},
+  {359,344,-1.03e-02},
+  {359,345,-1.03e-02},
+  {359,358,-1.03e-02},
+  {359,360,-1.03e-02},
+  {359,375,-1.03e-02},
+  {359,376,-1.03e-02},
+  {359,377,-1.03e-02},
+  {360,360,8.29e-02},
+  {360,55,4.84e-05},
+  {360,56,1.93e-04},
+  {360,57,4.84e-05},
+  {360,70,1.93e-04},
+  {360,71,7.74e-04},
+  {360,72,1.93e-04},
+  {360,87,4.84e-05},
+  {360,88,1.93e-04},
+  {360,89,4.84e-05},
+  {360,344,-1.03e-02},
+  {360,345,-1.03e-02},
+  {360,346,-1.03e-02},
+  {360,359,-1.03e-02},
+  {360,361,-1.03e-02},
+  {360,376,-1.03e-02},
+  {360,377,-1.03e-02},
+  {360,378,-1.03e-02},
+  {361,361,8.29e-02},
+  {361,56,4.84e-05},
+  {361,57,1.93e-04},
+  {361,71,1.93e-04},
+  {361,72,7.74e-04},
+  {361,73,1.93e-04},
+  {361,74,4.84e-05},
+  {361,88,4.84e-05},
+  {361,89,1.93e-04},
+  {361,90,4.84e-05},
+  {361,345,-1.03e-02},
+  {361,346,-1.03e-02},
+  {361,360,-1.03e-02},
+  {361,362,-1.03e-02},
+  {361,363,-1.03e-02},
+  {361,377,-1.03e-02},
+  {361,378,-1.03e-02},
+  {361,379,-1.03e-02},
+  {362,362,8.29e-02},
+  {362,57,4.84e-05},
+  {362,72,1.93e-04},
+  {362,73,7.74e-04},
+  {362,74,1.93e-04},
+  {362,89,4.84e-05},
+  {362,90,1.93e-04},
+  {362,91,4.84e-05},
+  {362,92,1.93e-04},
+  {362,99,4.84e-05},
+  {362,346,-1.03e-02},
+  {362,361,-1.03e-02},
+  {362,363,-1.03e-02},
+  {362,378,-1.03e-02},
+  {362,379,-1.03e-02},
+  {362,380,-1.03e-02},
+  {362,381,-1.03e-02},
+  {362,388,-1.03e-02},
+  {363,363,8.29e-02},
+  {363,57,1.93e-04},
+  {363,58,4.84e-05},
+  {363,72,4.84e-05},
+  {363,73,1.93e-04},
+  {363,74,7.74e-04},
+  {363,75,1.93e-04},
+  {363,92,4.84e-05},
+  {363,98,4.84e-05},
+  {363,99,1.93e-04},
+  {363,346,-1.03e-02},
+  {363,347,-1.03e-02},
+  {363,361,-1.03e-02},
+  {363,362,-1.03e-02},
+  {363,364,-1.03e-02},
+  {363,381,-1.03e-02},
+  {363,387,-1.03e-02},
+  {363,388,-1.03e-02},
+  {364,364,8.29e-02},
+  {364,57,4.84e-05},
+  {364,58,1.93e-04},
+  {364,59,4.84e-05},
+  {364,74,1.93e-04},
+  {364,75,7.74e-04},
+  {364,76,1.93e-04},
+  {364,97,4.84e-05},
+  {364,98,1.93e-04},
+  {364,99,4.84e-05},
+  {364,346,-1.03e-02},
+  {364,347,-1.03e-02},
+  {364,348,-1.03e-02},
+  {364,363,-1.03e-02},
+  {364,365,-1.03e-02},
+  {364,386,-1.03e-02},
+  {364,387,-1.03e-02},
+  {364,388,-1.03e-02},
+  {365,365,8.29e-02},
+  {365,58,4.84e-05},
+  {365,59,1.93e-04},
+  {365,60,4.84e-05},
+  {365,75,1.93e-04},
+  {365,76,7.74e-04},
+  {365,77,1.93e-04},
+  {365,96,4.84e-05},
+  {365,97,1.93e-04},
+  {365,98,4.84e-05},
+  {365,347,-1.03e-02},
+  {365,348,-1.03e-02},
+  {365,349,-1.03e-02},
+  {365,364,-1.03e-02},
+  {365,366,-1.03e-02},
+  {365,385,-1.03e-02},
+  {365,386,-1.03e-02},
+  {365,387,-1.03e-02},
+  {366,366,8.29e-02},
+  {366,59,4.84e-05},
+  {366,60,1.93e-04},
+  {366,61,4.84e-05},
+  {366,76,1.93e-04},
+  {366,77,7.74e-04},
+  {366,78,1.93e-04},
+  {366,95,4.84e-05},
+  {366,96,1.93e-04},
+  {366,97,4.84e-05},
+  {366,348,-1.03e-02},
+  {366,349,-1.03e-02},
+  {366,350,-1.03e-02},
+  {366,365,-1.03e-02},
+  {366,367,-1.03e-02},
+  {366,384,-1.03e-02},
+  {366,385,-1.03e-02},
+  {366,386,-1.03e-02},
+  {367,367,8.29e-02},
+  {367,60,4.84e-05},
+  {367,61,1.93e-04},
+  {367,62,4.84e-05},
+  {367,77,1.93e-04},
+  {367,78,7.74e-04},
+  {367,79,1.93e-04},
+  {367,94,4.84e-05},
+  {367,95,1.93e-04},
+  {367,96,4.84e-05},
+  {367,349,-1.03e-02},
+  {367,350,-1.03e-02},
+  {367,351,-1.03e-02},
+  {367,366,-1.03e-02},
+  {367,368,-1.03e-02},
+  {367,383,-1.03e-02},
+  {367,384,-1.03e-02},
+  {367,385,-1.03e-02},
+  {368,368,8.29e-02},
+  {368,61,4.84e-05},
+  {368,62,1.93e-04},
+  {368,63,4.84e-05},
+  {368,78,1.93e-04},
+  {368,79,7.74e-04},
+  {368,80,1.93e-04},
+  {368,93,4.84e-05},
+  {368,94,1.93e-04},
+  {368,95,4.84e-05},
+  {368,350,-1.03e-02},
+  {368,351,-1.03e-02},
+  {368,352,-1.03e-02},
+  {368,367,-1.03e-02},
+  {368,369,-1.03e-02},
+  {368,382,-1.03e-02},
+  {368,383,-1.03e-02},
+  {368,384,-1.03e-02},
+  {369,369,8.29e-02},
+  {369,50,4.84e-05},
+  {369,62,4.84e-05},
+  {369,63,1.93e-04},
+  {369,65,1.93e-04},
+  {369,79,1.93e-04},
+  {369,80,7.74e-04},
+  {369,82,4.84e-05},
+  {369,93,1.93e-04},
+  {369,94,4.84e-05},
+  {369,339,-1.03e-02},
+  {369,351,-1.03e-02},
+  {369,352,-1.03e-02},
+  {369,354,-1.03e-02},
+  {369,368,-1.03e-02},
+  {369,371,-1.03e-02},
+  {369,382,-1.03e-02},
+  {369,383,-1.03e-02},
+  {370,370,2.08e-01},
+  {370,64,9.67e-05},
+  {370,66,4.84e-05},
+  {370,81,3.87e-04},
+  {370,83,1.93e-04},
+  {370,100,9.67e-05},
+  {370,102,4.84e-05},
+  {370,353,3.65e-02},
+  {370,355,-1.03e-02},
+  {370,372,-1.03e-02},
+  {370,389,3.65e-02},
+  {370,391,-1.03e-02},
+  {371,371,2.08e-01},
+  {371,65,9.67e-05},
+  {371,80,4.84e-05},
+  {371,82,3.87e-04},
+  {371,93,1.93e-04},
+  {371,101,9.67e-05},
+  {371,115,4.84e-05},
+  {371,354,3.65e-02},
+  {371,369,-1.03e-02},
+  {371,382,-1.03e-02},
+  {371,390,3.65e-02},
+  {371,404,-1.03e-02},
+  {372,372,8.29e-02},
+  {372,64,4.84e-05},
+  {372,66,1.93e-04},
+  {372,67,4.84e-05},
+  {372,81,1.93e-04},
+  {372,83,7.74e-04},
+  {372,84,1.93e-04},
+  {372,100,4.84e-05},
+  {372,102,1.93e-04},
+  {372,103,4.84e-05},
+  {372,353,-1.03e-02},
+  {372,355,-1.03e-02},
+  {372,356,-1.03e-02},
+  {372,370,-1.03e-02},
+  {372,373,-1.03e-02},
+  {372,389,-1.03e-02},
+  {372,391,-1.03e-02},
+  {372,392,-1.03e-02},
+  {373,373,8.29e-02},
+  {373,66,4.84e-05},
+  {373,67,1.93e-04},
+  {373,68,4.84e-05},
+  {373,83,1.93e-04},
+  {373,84,7.74e-04},
+  {373,85,1.93e-04},
+  {373,102,4.84e-05},
+  {373,103,1.93e-04},
+  {373,104,4.84e-05},
+  {373,355,-1.03e-02},
+  {373,356,-1.03e-02},
+  {373,357,-1.03e-02},
+  {373,372,-1.03e-02},
+  {373,374,-1.03e-02},
+  {373,391,-1.03e-02},
+  {373,392,-1.03e-02},
+  {373,393,-1.03e-02},
+  {374,374,8.29e-02},
+  {374,67,4.84e-05},
+  {374,68,1.93e-04},
+  {374,69,4.84e-05},
+  {374,84,1.93e-04},
+  {374,85,7.74e-04},
+  {374,86,1.93e-04},
+  {374,103,4.84e-05},
+  {374,104,1.93e-04},
+  {374,105,4.84e-05},
+  {374,356,-1.03e-02},
+  {374,357,-1.03e-02},
+  {374,358,-1.03e-02},
+  {374,373,-1.03e-02},
+  {374,375,-1.03e-02},
+  {374,392,-1.03e-02},
+  {374,393,-1.03e-02},
+  {374,394,-1.03e-02},
+  {375,375,8.29e-02},
+  {375,68,4.84e-05},
+  {375,69,1.93e-04},
+  {375,70,4.84e-05},
+  {375,85,1.93e-04},
+  {375,86,7.74e-04},
+  {375,87,1.93e-04},
+  {375,104,4.84e-05},
+  {375,105,1.93e-04},
+  {375,106,4.84e-05},
+  {375,357,-1.03e-02},
+  {375,358,-1.03e-02},
+  {375,359,-1.03e-02},
+  {375,374,-1.03e-02},
+  {375,376,-1.03e-02},
+  {375,393,-1.03e-02},
+  {375,394,-1.03e-02},
+  {375,395,-1.03e-02},
+  {376,376,8.29e-02},
+  {376,69,4.84e-05},
+  {376,70,1.93e-04},
+  {376,71,4.84e-05},
+  {376,86,1.93e-04},
+  {376,87,7.74e-04},
+  {376,88,1.93e-04},
+  {376,105,4.84e-05},
+  {376,106,1.93e-04},
+  {376,107,4.84e-05},
+  {376,358,-1.03e-02},
+  {376,359,-1.03e-02},
+  {376,360,-1.03e-02},
+  {376,375,-1.03e-02},
+  {376,377,-1.03e-02},
+  {376,394,-1.03e-02},
+  {376,395,-1.03e-02},
+  {376,396,-1.03e-02},
+  {377,377,8.29e-02},
+  {377,70,4.84e-05},
+  {377,71,1.93e-04},
+  {377,72,4.84e-05},
+  {377,87,1.93e-04},
+  {377,88,7.74e-04},
+  {377,89,1.93e-04},
+  {377,106,4.84e-05},
+  {377,107,1.93e-04},
+  {377,108,4.84e-05},
+  {377,359,-1.03e-02},
+  {377,360,-1.03e-02},
+  {377,361,-1.03e-02},
+  {377,376,-1.03e-02},
+  {377,378,-1.03e-02},
+  {377,395,-1.03e-02},
+  {377,396,-1.03e-02},
+  {377,397,-1.03e-02},
+  {378,378,8.29e-02},
+  {378,71,4.84e-05},
+  {378,72,1.93e-04},
+  {378,73,4.84e-05},
+  {378,88,1.93e-04},
+  {378,89,7.74e-04},
+  {378,90,1.93e-04},
+  {378,107,4.84e-05},
+  {378,108,1.93e-04},
+  {378,109,4.84e-05},
+  {378,360,-1.03e-02},
+  {378,361,-1.03e-02},
+  {378,362,-1.03e-02},
+  {378,377,-1.03e-02},
+  {378,379,-1.03e-02},
+  {378,396,-1.03e-02},
+  {378,397,-1.03e-02},
+  {378,398,-1.03e-02},
+  {379,379,8.29e-02},
+  {379,72,4.84e-05},
+  {379,73,1.93e-04},
+  {379,89,1.93e-04},
+  {379,90,7.74e-04},
+  {379,91,1.93e-04},
+  {379,92,4.84e-05},
+  {379,108,4.84e-05},
+  {379,109,1.93e-04},
+  {379,110,4.84e-05},
+  {379,361,-1.03e-02},
+  {379,362,-1.03e-02},
+  {379,378,-1.03e-02},
+  {379,380,-1.03e-02},
+  {379,381,-1.03e-02},
+  {379,397,-1.03e-02},
+  {379,398,-1.03e-02},
+  {379,399,-1.03e-02},
+  {380,380,8.29e-02},
+  {380,73,4.84e-05},
+  {380,90,1.93e-04},
+  {380,91,7.74e-04},
+  {380,92,1.93e-04},
+  {380,109,4.84e-05},
+  {380,110,1.93e-04},
+  {380,111,4.84e-05},
+  {380,112,1.93e-04},
+  {380,113,4.84e-05},
+  {380,362,-1.03e-02},
+  {380,379,-1.03e-02},
+  {380,381,-1.03e-02},
+  {380,398,-1.03e-02},
+  {380,399,-1.03e-02},
+  {380,400,-1.03e-02},
+  {380,401,-1.03e-02},
+  {380,402,-1.03e-02},
+  {381,381,8.29e-02},
+  {381,73,1.93e-04},
+  {381,74,4.84e-05},
+  {381,90,4.84e-05},
+  {381,91,1.93e-04},
+  {381,92,7.74e-04},
+  {381,99,1.93e-04},
+  {381,112,4.84e-05},
+  {381,113,1.93e-04},
+  {381,120,4.84e-05},
+  {381,362,-1.03e-02},
+  {381,363,-1.03e-02},
+  {381,379,-1.03e-02},
+  {381,380,-1.03e-02},
+  {381,388,-1.03e-02},
+  {381,401,-1.03e-02},
+  {381,402,-1.03e-02},
+  {381,409,-1.03e-02},
+  {382,382,8.29e-02},
+  {382,65,4.84e-05},
+  {382,79,4.84e-05},
+  {382,80,1.93e-04},
+  {382,82,1.93e-04},
+  {382,93,7.74e-04},
+  {382,94,1.93e-04},
+  {382,101,4.84e-05},
+  {382,114,4.84e-05},
+  {382,115,1.93e-04},
+  {382,354,-1.03e-02},
+  {382,368,-1.03e-02},
+  {382,369,-1.03e-02},
+  {382,371,-1.03e-02},
+  {382,383,-1.03e-02},
+  {382,390,-1.03e-02},
+  {382,403,-1.03e-02},
+  {382,404,-1.03e-02},
+  {383,383,8.29e-02},
+  {383,78,4.84e-05},
+  {383,79,1.93e-04},
+  {383,80,4.84e-05},
+  {383,93,1.93e-04},
+  {383,94,7.74e-04},
+  {383,95,1.93e-04},
+  {383,114,1.93e-04},
+  {383,115,4.84e-05},
+  {383,117,4.84e-05},
+  {383,367,-1.03e-02},
+  {383,368,-1.03e-02},
+  {383,369,-1.03e-02},
+  {383,382,-1.03e-02},
+  {383,384,-1.03e-02},
+  {383,403,-1.03e-02},
+  {383,404,-1.03e-02},
+  {383,406,-1.03e-02},
+  {384,384,8.29e-02},
+  {384,77,4.84e-05},
+  {384,78,1.93e-04},
+  {384,79,4.84e-05},
+  {384,94,1.93e-04},
+  {384,95,7.74e-04},
+  {384,96,1.93e-04},
+  {384,114,4.84e-05},
+  {384,116,4.84e-05},
+  {384,117,1.93e-04},
+  {384,366,-1.03e-02},
+  {384,367,-1.03e-02},
+  {384,368,-1.03e-02},
+  {384,383,-1.03e-02},
+  {384,385,-1.03e-02},
+  {384,403,-1.03e-02},
+  {384,405,-1.03e-02},
+  {384,406,-1.03e-02},
+  {385,385,8.29e-02},
+  {385,76,4.84e-05},
+  {385,77,1.93e-04},
+  {385,78,4.84e-05},
+  {385,95,1.93e-04},
+  {385,96,7.74e-04},
+  {385,97,1.93e-04},
+  {385,116,1.93e-04},
+  {385,117,4.84e-05},
+  {385,119,4.84e-05},
+  {385,365,-1.03e-02},
+  {385,366,-1.03e-02},
+  {385,367,-1.03e-02},
+  {385,384,-1.03e-02},
+  {385,386,-1.03e-02},
+  {385,405,-1.03e-02},
+  {385,406,-1.03e-02},
+  {385,408,-1.03e-02},
+  {386,386,8.29e-02},
+  {386,75,4.84e-05},
+  {386,76,1.93e-04},
+  {386,77,4.84e-05},
+  {386,96,1.93e-04},
+  {386,97,7.74e-04},
+  {386,98,1.93e-04},
+  {386,116,4.84e-05},
+  {386,118,4.84e-05},
+  {386,119,1.93e-04},
+  {386,364,-1.03e-02},
+  {386,365,-1.03e-02},
+  {386,366,-1.03e-02},
+  {386,385,-1.03e-02},
+  {386,387,-1.03e-02},
+  {386,405,-1.03e-02},
+  {386,407,-1.03e-02},
+  {386,408,-1.03e-02},
+  {387,387,8.29e-02},
+  {387,74,4.84e-05},
+  {387,75,1.93e-04},
+  {387,76,4.84e-05},
+  {387,97,1.93e-04},
+  {387,98,7.74e-04},
+  {387,99,1.93e-04},
+  {387,118,1.93e-04},
+  {387,119,4.84e-05},
+  {387,120,4.84e-05},
+  {387,363,-1.03e-02},
+  {387,364,-1.03e-02},
+  {387,365,-1.03e-02},
+  {387,386,-1.03e-02},
+  {387,388,-1.03e-02},
+  {387,407,-1.03e-02},
+  {387,408,-1.03e-02},
+  {387,409,-1.03e-02},
+  {388,388,8.29e-02},
+  {388,73,4.84e-05},
+  {388,74,1.93e-04},
+  {388,75,4.84e-05},
+  {388,92,1.93e-04},
+  {388,98,1.93e-04},
+  {388,99,7.74e-04},
+  {388,113,4.84e-05},
+  {388,118,4.84e-05},
+  {388,120,1.93e-04},
+  {388,362,-1.03e-02},
+  {388,363,-1.03e-02},
+  {388,364,-1.03e-02},
+  {388,381,-1.03e-02},
+  {388,387,-1.03e-02},
+  {388,402,-1.03e-02},
+  {388,407,-1.03e-02},
+  {388,409,-1.03e-02},
+  {389,389,2.08e-01},
+  {389,81,9.67e-05},
+  {389,83,4.84e-05},
+  {389,100,3.87e-04},
+  {389,102,1.93e-04},
+  {389,121,9.67e-05},
+  {389,123,4.84e-05},
+  {389,370,3.65e-02},
+  {389,372,-1.03e-02},
+  {389,391,-1.03e-02},
+  {389,410,3.65e-02},
+  {389,412,-1.03e-02},
+  {390,390,2.08e-01},
+  {390,82,9.67e-05},
+  {390,93,4.84e-05},
+  {390,101,3.87e-04},
+  {390,115,1.93e-04},
+  {390,122,9.67e-05},
+  {390,140,4.84e-05},
+  {390,371,3.65e-02},
+  {390,382,-1.03e-02},
+  {390,404,-1.03e-02},
+  {390,411,3.65e-02},
+  {390,429,-1.03e-02},
+  {391,391,8.29e-02},
+  {391,81,4.84e-05},
+  {391,83,1.93e-04},
+  {391,84,4.84e-05},
+  {391,100,1.93e-04},
+  {391,102,7.74e-04},
+  {391,103,1.93e-04},
+  {391,121,4.84e-05},
+  {391,123,1.93e-04},
+  {391,124,4.84e-05},
+  {391,370,-1.03e-02},
+  {391,372,-1.03e-02},
+  {391,373,-1.03e-02},
+  {391,389,-1.03e-02},
+  {391,392,-1.03e-02},
+  {391,410,-1.03e-02},
+  {391,412,-1.03e-02},
+  {391,413,-1.03e-02},
+  {392,392,8.29e-02},
+  {392,83,4.84e-05},
+  {392,84,1.93e-04},
+  {392,85,4.84e-05},
+  {392,102,1.93e-04},
+  {392,103,7.74e-04},
+  {392,104,1.93e-04},
+  {392,123,4.84e-05},
+  {392,124,1.93e-04},
+  {392,125,4.84e-05},
+  {392,372,-1.03e-02},
+  {392,373,-1.03e-02},
+  {392,374,-1.03e-02},
+  {392,391,-1.03e-02},
+  {392,393,-1.03e-02},
+  {392,412,-1.03e-02},
+  {392,413,-1.03e-02},
+  {392,414,-1.03e-02},
+  {393,393,8.29e-02},
+  {393,84,4.84e-05},
+  {393,85,1.93e-04},
+  {393,86,4.84e-05},
+  {393,103,1.93e-04},
+  {393,104,7.74e-04},
+  {393,105,1.93e-04},
+  {393,124,4.84e-05},
+  {393,125,1.93e-04},
+  {393,126,4.84e-05},
+  {393,373,-1.03e-02},
+  {393,374,-1.03e-02},
+  {393,375,-1.03e-02},
+  {393,392,-1.03e-02},
+  {393,394,-1.03e-02},
+  {393,413,-1.03e-02},
+  {393,414,-1.03e-02},
+  {393,415,-1.03e-02},
+  {394,394,8.29e-02},
+  {394,85,4.84e-05},
+  {394,86,1.93e-04},
+  {394,87,4.84e-05},
+  {394,104,1.93e-04},
+  {394,105,7.74e-04},
+  {394,106,1.93e-04},
+  {394,125,4.84e-05},
+  {394,126,1.93e-04},
+  {394,127,4.84e-05},
+  {394,374,-1.03e-02},
+  {394,375,-1.03e-02},
+  {394,376,-1.03e-02},
+  {394,393,-1.03e-02},
+  {394,395,-1.03e-02},
+  {394,414,-1.03e-02},
+  {394,415,-1.03e-02},
+  {394,416,-1.03e-02},
+  {395,395,8.29e-02},
+  {395,86,4.84e-05},
+  {395,87,1.93e-04},
+  {395,88,4.84e-05},
+  {395,105,1.93e-04},
+  {395,106,7.74e-04},
+  {395,107,1.93e-04},
+  {395,126,4.84e-05},
+  {395,127,1.93e-04},
+  {395,128,4.84e-05},
+  {395,375,-1.03e-02},
+  {395,376,-1.03e-02},
+  {395,377,-1.03e-02},
+  {395,394,-1.03e-02},
+  {395,396,-1.03e-02},
+  {395,415,-1.03e-02},
+  {395,416,-1.03e-02},
+  {395,417,-1.03e-02},
+  {396,396,8.29e-02},
+  {396,87,4.84e-05},
+  {396,88,1.93e-04},
+  {396,89,4.84e-05},
+  {396,106,1.93e-04},
+  {396,107,7.74e-04},
+  {396,108,1.93e-04},
+  {396,127,4.84e-05},
+  {396,128,1.93e-04},
+  {396,129,4.84e-05},
+  {396,376,-1.03e-02},
+  {396,377,-1.03e-02},
+  {396,378,-1.03e-02},
+  {396,395,-1.03e-02},
+  {396,397,-1.03e-02},
+  {396,416,-1.03e-02},
+  {396,417,-1.03e-02},
+  {396,418,-1.03e-02},
+  {397,397,8.29e-02},
+  {397,88,4.84e-05},
+  {397,89,1.93e-04},
+  {397,90,4.84e-05},
+  {397,107,1.93e-04},
+  {397,108,7.74e-04},
+  {397,109,1.93e-04},
+  {397,128,4.84e-05},
+  {397,129,1.93e-04},
+  {397,130,4.84e-05},
+  {397,377,-1.03e-02},
+  {397,378,-1.03e-02},
+  {397,379,-1.03e-02},
+  {397,396,-1.03e-02},
+  {397,398,-1.03e-02},
+  {397,417,-1.03e-02},
+  {397,418,-1.03e-02},
+  {397,419,-1.03e-02},
+  {398,398,8.29e-02},
+  {398,89,4.84e-05},
+  {398,90,1.93e-04},
+  {398,91,4.84e-05},
+  {398,108,1.93e-04},
+  {398,109,7.74e-04},
+  {398,110,1.93e-04},
+  {398,129,4.84e-05},
+  {398,130,1.93e-04},
+  {398,131,4.84e-05},
+  {398,378,-1.03e-02},
+  {398,379,-1.03e-02},
+  {398,380,-1.03e-02},
+  {398,397,-1.03e-02},
+  {398,399,-1.03e-02},
+  {398,418,-1.03e-02},
+  {398,419,-1.03e-02},
+  {398,420,-1.03e-02},
+  {399,399,8.29e-02},
+  {399,90,4.84e-05},
+  {399,91,1.93e-04},
+  {399,109,1.93e-04},
+  {399,110,7.74e-04},
+  {399,111,1.93e-04},
+  {399,112,4.84e-05},
+  {399,130,4.84e-05},
+  {399,131,1.93e-04},
+  {399,132,4.84e-05},
+  {399,379,-1.03e-02},
+  {399,380,-1.03e-02},
+  {399,398,-1.03e-02},
+  {399,400,-1.03e-02},
+  {399,401,-1.03e-02},
+  {399,419,-1.03e-02},
+  {399,420,-1.03e-02},
+  {399,421,-1.03e-02},
+  {400,400,8.29e-02},
+  {400,91,4.84e-05},
+  {400,110,1.93e-04},
+  {400,111,7.74e-04},
+  {400,112,1.93e-04},
+  {400,131,4.84e-05},
+  {400,132,1.93e-04},
+  {400,133,4.84e-05},
+  {400,134,1.93e-04},
+  {400,135,4.84e-05},
+  {400,380,-1.03e-02},
+  {400,399,-1.03e-02},
+  {400,401,-1.03e-02},
+  {400,420,-1.03e-02},
+  {400,421,-1.03e-02},
+  {400,422,-1.03e-02},
+  {400,423,-1.03e-02},
+  {400,424,-1.03e-02},
+  {401,401,8.29e-02},
+  {401,91,1.93e-04},
+  {401,92,4.84e-05},
+  {401,110,4.84e-05},
+  {401,111,1.93e-04},
+  {401,112,7.74e-04},
+  {401,113,1.93e-04},
+  {401,134,4.84e-05},
+  {401,135,1.93e-04},
+  {401,136,4.84e-05},
+  {401,380,-1.03e-02},
+  {401,381,-1.03e-02},
+  {401,399,-1.03e-02},
+  {401,400,-1.03e-02},
+  {401,402,-1.03e-02},
+  {401,423,-1.03e-02},
+  {401,424,-1.03e-02},
+  {401,425,-1.03e-02},
+  {402,402,8.29e-02},
+  {402,91,4.84e-05},
+  {402,92,1.93e-04},
+  {402,99,4.84e-05},
+  {402,112,1.93e-04},
+  {402,113,7.74e-04},
+  {402,120,1.93e-04},
+  {402,135,4.84e-05},
+  {402,136,1.93e-04},
+  {402,141,4.84e-05},
+  {402,380,-1.03e-02},
+  {402,381,-1.03e-02},
+  {402,388,-1.03e-02},
+  {402,401,-1.03e-02},
+  {402,409,-1.03e-02},
+  {402,424,-1.03e-02},
+  {402,425,-1.03e-02},
+  {402,430,-1.03e-02},
+  {403,403,8.29e-02},
+  {403,93,4.84e-05},
+  {403,94,1.93e-04},
+  {403,95,4.84e-05},
+  {403,114,7.74e-04},
+  {403,115,1.93e-04},
+  {403,117,1.93e-04},
+  {403,137,4.84e-05},
+  {403,138,1.93e-04},
+  {403,140,4.84e-05},
+  {403,382,-1.03e-02},
+  {403,383,-1.03e-02},
+  {403,384,-1.03e-02},
+  {403,404,-1.03e-02},
+  {403,406,-1.03e-02},
+  {403,426,-1.03e-02},
+  {403,427,-1.03e-02},
+  {403,429,-1.03e-02},
+  {404,404,8.29e-02},
+  {404,82,4.84e-05},
+  {404,93,1.93e-04},
+  {404,94,4.84e-05},
+  {404,101,1.93e-04},
+  {404,114,1.93e-04},
+  {404,115,7.74e-04},
+  {404,122,4.84e-05},
+  {404,138,4.84e-05},
+  {404,140,1.93e-04},
+  {404,371,-1.03e-02},
+  {404,382,-1.03e-02},
+  {404,383,-1.03e-02},
+  {404,390,-1.03e-02},
+  {404,403,-1.03e-02},
+  {404,411,-1.03e-02},
+  {404,427,-1.03e-02},
+  {404,429,-1.03e-02},
+  {405,405,8.29e-02},
+  {405,95,4.84e-05},
+  {405,96,1.93e-04},
+  {405,97,4.84e-05},
+  {405,116,7.74e-04},
+  {405,117,1.93e-04},
+  {405,119,1.93e-04},
+  {405,137,4.84e-05},
+  {405,139,1.93e-04},
+  {405,143,4.84e-05},
+  {405,384,-1.03e-02},
+  {405,385,-1.03e-02},
+  {405,386,-1.03e-02},
+  {405,406,-1.03e-02},
+  {405,408,-1.03e-02},
+  {405,426,-1.03e-02},
+  {405,428,-1.03e-02},
+  {405,432,-1.03e-02},
+  {406,406,8.29e-02},
+  {406,94,4.84e-05},
+  {406,95,1.93e-04},
+  {406,96,4.84e-05},
+  {406,114,1.93e-04},
+  {406,116,1.93e-04},
+  {406,117,7.74e-04},
+  {406,137,1.93e-04},
+  {406,138,4.84e-05},
+  {406,139,4.84e-05},
+  {406,383,-1.03e-02},
+  {406,384,-1.03e-02},
+  {406,385,-1.03e-02},
+  {406,403,-1.03e-02},
+  {406,405,-1.03e-02},
+  {406,426,-1.03e-02},
+  {406,427,-1.03e-02},
+  {406,428,-1.03e-02},
+  {407,407,8.29e-02},
+  {407,97,4.84e-05},
+  {407,98,1.93e-04},
+  {407,99,4.84e-05},
+  {407,118,7.74e-04},
+  {407,119,1.93e-04},
+  {407,120,1.93e-04},
+  {407,141,4.84e-05},
+  {407,142,1.93e-04},
+  {407,143,4.84e-05},
+  {407,386,-1.03e-02},
+  {407,387,-1.03e-02},
+  {407,388,-1.03e-02},
+  {407,408,-1.03e-02},
+  {407,409,-1.03e-02},
+  {407,430,-1.03e-02},
+  {407,431,-1.03e-02},
+  {407,432,-1.03e-02},
+  {408,408,8.29e-02},
+  {408,96,4.84e-05},
+  {408,97,1.93e-04},
+  {408,98,4.84e-05},
+  {408,116,1.93e-04},
+  {408,118,1.93e-04},
+  {408,119,7.74e-04},
+  {408,139,4.84e-05},
+  {408,142,4.84e-05},
+  {408,143,1.93e-04},
+  {408,385,-1.03e-02},
+  {408,386,-1.03e-02},
+  {408,387,-1.03e-02},
+  {408,405,-1.03e-02},
+  {408,407,-1.03e-02},
+  {408,428,-1.03e-02},
+  {408,431,-1.03e-02},
+  {408,432,-1.03e-02},
+  {409,409,8.29e-02},
+  {409,92,4.84e-05},
+  {409,98,4.84e-05},
+  {409,99,1.93e-04},
+  {409,113,1.93e-04},
+  {409,118,1.93e-04},
+  {409,120,7.74e-04},
+  {409,136,4.84e-05},
+  {409,141,1.93e-04},
+  {409,142,4.84e-05},
+  {409,381,-1.03e-02},
+  {409,387,-1.03e-02},
+  {409,388,-1.03e-02},
+  {409,402,-1.03e-02},
+  {409,407,-1.03e-02},
+  {409,425,-1.03e-02},
+  {409,430,-1.03e-02},
+  {409,431,-1.03e-02},
+  {410,410,2.08e-01},
+  {410,100,9.67e-05},
+  {410,102,4.84e-05},
+  {410,121,3.87e-04},
+  {410,123,1.93e-04},
+  {410,144,9.67e-05},
+  {410,146,4.84e-05},
+  {410,389,3.65e-02},
+  {410,391,-1.03e-02},
+  {410,412,-1.03e-02},
+  {410,433,3.65e-02},
+  {410,435,-1.03e-02},
+  {411,411,2.08e-01},
+  {411,101,9.67e-05},
+  {411,115,4.84e-05},
+  {411,122,3.87e-04},
+  {411,140,1.93e-04},
+  {411,145,9.67e-05},
+  {411,165,4.84e-05},
+  {411,390,3.65e-02},
+  {411,404,-1.03e-02},
+  {411,429,-1.03e-02},
+  {411,434,3.65e-02},
+  {411,454,-1.03e-02},
+  {412,412,8.29e-02},
+  {412,100,4.84e-05},
+  {412,102,1.93e-04},
+  {412,103,4.84e-05},
+  {412,121,1.93e-04},
+  {412,123,7.74e-04},
+  {412,124,1.93e-04},
+  {412,144,4.84e-05},
+  {412,146,1.93e-04},
+  {412,147,4.84e-05},
+  {412,389,-1.03e-02},
+  {412,391,-1.03e-02},
+  {412,392,-1.03e-02},
+  {412,410,-1.03e-02},
+  {412,413,-1.03e-02},
+  {412,433,-1.03e-02},
+  {412,435,-1.03e-02},
+  {412,436,-1.03e-02},
+  {413,413,8.29e-02},
+  {413,102,4.84e-05},
+  {413,103,1.93e-04},
+  {413,104,4.84e-05},
+  {413,123,1.93e-04},
+  {413,124,7.74e-04},
+  {413,125,1.93e-04},
+  {413,146,4.84e-05},
+  {413,147,1.93e-04},
+  {413,148,4.84e-05},
+  {413,391,-1.03e-02},
+  {413,392,-1.03e-02},
+  {413,393,-1.03e-02},
+  {413,412,-1.03e-02},
+  {413,414,-1.03e-02},
+  {413,435,-1.03e-02},
+  {413,436,-1.03e-02},
+  {413,437,-1.03e-02},
+  {414,414,8.29e-02},
+  {414,103,4.84e-05},
+  {414,104,1.93e-04},
+  {414,105,4.84e-05},
+  {414,124,1.93e-04},
+  {414,125,7.74e-04},
+  {414,126,1.93e-04},
+  {414,147,4.84e-05},
+  {414,148,1.93e-04},
+  {414,149,4.84e-05},
+  {414,392,-1.03e-02},
+  {414,393,-1.03e-02},
+  {414,394,-1.03e-02},
+  {414,413,-1.03e-02},
+  {414,415,-1.03e-02},
+  {414,436,-1.03e-02},
+  {414,437,-1.03e-02},
+  {414,438,-1.03e-02},
+  {415,415,8.29e-02},
+  {415,104,4.84e-05},
+  {415,105,1.93e-04},
+  {415,106,4.84e-05},
+  {415,125,1.93e-04},
+  {415,126,7.74e-04},
+  {415,127,1.93e-04},
+  {415,148,4.84e-05},
+  {415,149,1.93e-04},
+  {415,150,4.84e-05},
+  {415,393,-1.03e-02},
+  {415,394,-1.03e-02},
+  {415,395,-1.03e-02},
+  {415,414,-1.03e-02},
+  {415,416,-1.03e-02},
+  {415,437,-1.03e-02},
+  {415,438,-1.03e-02},
+  {415,439,-1.03e-02},
+  {416,416,8.29e-02},
+  {416,105,4.84e-05},
+  {416,106,1.93e-04},
+  {416,107,4.84e-05},
+  {416,126,1.93e-04},
+  {416,127,7.74e-04},
+  {416,128,1.93e-04},
+  {416,149,4.84e-05},
+  {416,150,1.93e-04},
+  {416,151,4.84e-05},
+  {416,394,-1.03e-02},
+  {416,395,-1.03e-02},
+  {416,396,-1.03e-02},
+  {416,415,-1.03e-02},
+  {416,417,-1.03e-02},
+  {416,438,-1.03e-02},
+  {416,439,-1.03e-02},
+  {416,440,-1.03e-02},
+  {417,417,8.29e-02},
+  {417,106,4.84e-05},
+  {417,107,1.93e-04},
+  {417,108,4.84e-05},
+  {417,127,1.93e-04},
+  {417,128,7.74e-04},
+  {417,129,1.93e-04},
+  {417,150,4.84e-05},
+  {417,151,1.93e-04},
+  {417,152,4.84e-05},
+  {417,395,-1.03e-02},
+  {417,396,-1.03e-02},
+  {417,397,-1.03e-02},
+  {417,416,-1.03e-02},
+  {417,418,-1.03e-02},
+  {417,439,-1.03e-02},
+  {417,440,-1.03e-02},
+  {417,441,-1.03e-02},
+  {418,418,8.29e-02},
+  {418,107,4.84e-05},
+  {418,108,1.93e-04},
+  {418,109,4.84e-05},
+  {418,128,1.93e-04},
+  {418,129,7.74e-04},
+  {418,130,1.93e-04},
+  {418,151,4.84e-05},
+  {418,152,1.93e-04},
+  {418,153,4.84e-05},
+  {418,396,-1.03e-02},
+  {418,397,-1.03e-02},
+  {418,398,-1.03e-02},
+  {418,417,-1.03e-02},
+  {418,419,-1.03e-02},
+  {418,440,-1.03e-02},
+  {418,441,-1.03e-02},
+  {418,442,-1.03e-02},
+  {419,419,8.29e-02},
+  {419,108,4.84e-05},
+  {419,109,1.93e-04},
+  {419,110,4.84e-05},
+  {419,129,1.93e-04},
+  {419,130,7.74e-04},
+  {419,131,1.93e-04},
+  {419,152,4.84e-05},
+  {419,153,1.93e-04},
+  {419,154,4.84e-05},
+  {419,397,-1.03e-02},
+  {419,398,-1.03e-02},
+  {419,399,-1.03e-02},
+  {419,418,-1.03e-02},
+  {419,420,-1.03e-02},
+  {419,441,-1.03e-02},
+  {419,442,-1.03e-02},
+  {419,443,-1.03e-02},
+  {420,420,8.29e-02},
+  {420,109,4.84e-05},
+  {420,110,1.93e-04},
+  {420,111,4.84e-05},
+  {420,130,1.93e-04},
+  {420,131,7.74e-04},
+  {420,132,1.93e-04},
+  {420,153,4.84e-05},
+  {420,154,1.93e-04},
+  {420,155,4.84e-05},
+  {420,398,-1.03e-02},
+  {420,399,-1.03e-02},
+  {420,400,-1.03e-02},
+  {420,419,-1.03e-02},
+  {420,421,-1.03e-02},
+  {420,442,-1.03e-02},
+  {420,443,-1.03e-02},
+  {420,444,-1.03e-02},
+  {421,421,8.29e-02},
+  {421,110,4.84e-05},
+  {421,111,1.93e-04},
+  {421,131,1.93e-04},
+  {421,132,7.74e-04},
+  {421,133,1.93e-04},
+  {421,134,4.84e-05},
+  {421,154,4.84e-05},
+  {421,155,1.93e-04},
+  {421,156,4.84e-05},
+  {421,399,-1.03e-02},
+  {421,400,-1.03e-02},
+  {421,420,-1.03e-02},
+  {421,422,-1.03e-02},
+  {421,423,-1.03e-02},
+  {421,443,-1.03e-02},
+  {421,444,-1.03e-02},
+  {421,445,-1.03e-02},
+  {422,422,8.29e-02},
+  {422,111,4.84e-05},
+  {422,132,1.93e-04},
+  {422,133,7.74e-04},
+  {422,134,1.93e-04},
+  {422,155,4.84e-05},
+  {422,156,1.93e-04},
+  {422,157,4.84e-05},
+  {422,158,1.93e-04},
+  {422,159,4.84e-05},
+  {422,400,-1.03e-02},
+  {422,421,-1.03e-02},
+  {422,423,-1.03e-02},
+  {422,444,-1.03e-02},
+  {422,445,-1.03e-02},
+  {422,446,-1.03e-02},
+  {422,447,-1.03e-02},
+  {422,448,-1.03e-02},
+  {423,423,8.29e-02},
+  {423,111,1.93e-04},
+  {423,112,4.84e-05},
+  {423,132,4.84e-05},
+  {423,133,1.93e-04},
+  {423,134,7.74e-04},
+  {423,135,1.93e-04},
+  {423,158,4.84e-05},
+  {423,159,1.93e-04},
+  {423,160,4.84e-05},
+  {423,400,-1.03e-02},
+  {423,401,-1.03e-02},
+  {423,421,-1.03e-02},
+  {423,422,-1.03e-02},
+  {423,424,-1.03e-02},
+  {423,447,-1.03e-02},
+  {423,448,-1.03e-02},
+  {423,449,-1.03e-02},
+  {424,424,8.29e-02},
+  {424,111,4.84e-05},
+  {424,112,1.93e-04},
+  {424,113,4.84e-05},
+  {424,134,1.93e-04},
+  {424,135,7.74e-04},
+  {424,136,1.93e-04},
+  {424,159,4.84e-05},
+  {424,160,1.93e-04},
+  {424,161,4.84e-05},
+  {424,400,-1.03e-02},
+  {424,401,-1.03e-02},
+  {424,402,-1.03e-02},
+  {424,423,-1.03e-02},
+  {424,425,-1.03e-02},
+  {424,448,-1.03e-02},
+  {424,449,-1.03e-02},
+  {424,450,-1.03e-02},
+  {425,425,8.29e-02},
+  {425,112,4.84e-05},
+  {425,113,1.93e-04},
+  {425,120,4.84e-05},
+  {425,135,1.93e-04},
+  {425,136,7.74e-04},
+  {425,141,1.93e-04},
+  {425,160,4.84e-05},
+  {425,161,1.93e-04},
+  {425,166,4.84e-05},
+  {425,401,-1.03e-02},
+  {425,402,-1.03e-02},
+  {425,409,-1.03e-02},
+  {425,424,-1.03e-02},
+  {425,430,-1.03e-02},
+  {425,449,-1.03e-02},
+  {425,450,-1.03e-02},
+  {425,455,-1.03e-02},
+  {426,426,8.29e-02},
+  {426,114,4.84e-05},
+  {426,116,4.84e-05},
+  {426,117,1.93e-04},
+  {426,137,7.74e-04},
+  {426,138,1.93e-04},
+  {426,139,1.93e-04},
+  {426,162,4.84e-05},
+  {426,163,1.93e-04},
+  {426,164,4.84e-05},
+  {426,403,-1.03e-02},
+  {426,405,-1.03e-02},
+  {426,406,-1.03e-02},
+  {426,427,-1.03e-02},
+  {426,428,-1.03e-02},
+  {426,451,-1.03e-02},
+  {426,452,-1.03e-02},
+  {426,453,-1.03e-02},
+  {427,427,8.29e-02},
+  {427,114,1.93e-04},
+  {427,115,4.84e-05},
+  {427,117,4.84e-05},
+  {427,137,1.93e-04},
+  {427,138,7.74e-04},
+  {427,140,1.93e-04},
+  {427,163,4.84e-05},
+  {427,164,1.93e-04},
+  {427,165,4.84e-05},
+  {427,403,-1.03e-02},
+  {427,404,-1.03e-02},
+  {427,406,-1.03e-02},
+  {427,426,-1.03e-02},
+  {427,429,-1.03e-02},
+  {427,452,-1.03e-02},
+  {427,453,-1.03e-02},
+  {427,454,-1.03e-02},
+  {428,428,8.29e-02},
+  {428,116,1.93e-04},
+  {428,117,4.84e-05},
+  {428,119,4.84e-05},
+  {428,137,1.93e-04},
+  {428,139,7.74e-04},
+  {428,143,1.93e-04},
+  {428,162,1.93e-04},
+  {428,163,4.84e-05},
+  {428,168,4.84e-05},
+  {428,405,-1.03e-02},
+  {428,406,-1.03e-02},
+  {428,408,-1.03e-02},
+  {428,426,-1.03e-02},
+  {428,432,-1.03e-02},
+  {428,451,-1.03e-02},
+  {428,452,-1.03e-02},
+  {428,457,-1.03e-02},
+  {429,429,8.29e-02},
+  {429,101,4.84e-05},
+  {429,114,4.84e-05},
+  {429,115,1.93e-04},
+  {429,122,1.93e-04},
+  {429,138,1.93e-04},
+  {429,140,7.74e-04},
+  {429,145,4.84e-05},
+  {429,164,4.84e-05},
+  {429,165,1.93e-04},
+  {429,390,-1.03e-02},
+  {429,403,-1.03e-02},
+  {429,404,-1.03e-02},
+  {429,411,-1.03e-02},
+  {429,427,-1.03e-02},
+  {429,434,-1.03e-02},
+  {429,453,-1.03e-02},
+  {429,454,-1.03e-02},
+  {430,430,8.29e-02},
+  {430,113,4.84e-05},
+  {430,118,4.84e-05},
+  {430,120,1.93e-04},
+  {430,136,1.93e-04},
+  {430,141,7.74e-04},
+  {430,142,1.93e-04},
+  {430,161,4.84e-05},
+  {430,166,1.93e-04},
+  {430,167,4.84e-05},
+  {430,402,-1.03e-02},
+  {430,407,-1.03e-02},
+  {430,409,-1.03e-02},
+  {430,425,-1.03e-02},
+  {430,431,-1.03e-02},
+  {430,450,-1.03e-02},
+  {430,455,-1.03e-02},
+  {430,456,-1.03e-02},
+  {431,431,8.29e-02},
+  {431,118,1.93e-04},
+  {431,119,4.84e-05},
+  {431,120,4.84e-05},
+  {431,141,1.93e-04},
+  {431,142,7.74e-04},
+  {431,143,1.93e-04},
+  {431,166,4.84e-05},
+  {431,167,1.93e-04},
+  {431,168,4.84e-05},
+  {431,407,-1.03e-02},
+  {431,408,-1.03e-02},
+  {431,409,-1.03e-02},
+  {431,430,-1.03e-02},
+  {431,432,-1.03e-02},
+  {431,455,-1.03e-02},
+  {431,456,-1.03e-02},
+  {431,457,-1.03e-02},
+  {432,432,8.29e-02},
+  {432,116,4.84e-05},
+  {432,118,4.84e-05},
+  {432,119,1.93e-04},
+  {432,139,1.93e-04},
+  {432,142,1.93e-04},
+  {432,143,7.74e-04},
+  {432,162,4.84e-05},
+  {432,167,4.84e-05},
+  {432,168,1.93e-04},
+  {432,405,-1.03e-02},
+  {432,407,-1.03e-02},
+  {432,408,-1.03e-02},
+  {432,428,-1.03e-02},
+  {432,431,-1.03e-02},
+  {432,451,-1.03e-02},
+  {432,456,-1.03e-02},
+  {432,457,-1.03e-02},
+  {433,433,2.08e-01},
+  {433,121,9.67e-05},
+  {433,123,4.84e-05},
+  {433,144,3.87e-04},
+  {433,146,1.93e-04},
+  {433,169,9.67e-05},
+  {433,171,4.84e-05},
+  {433,410,3.65e-02},
+  {433,412,-1.03e-02},
+  {433,435,-1.03e-02},
+  {433,458,3.65e-02},
+  {433,460,-1.03e-02},
+  {434,434,2.08e-01},
+  {434,122,9.67e-05},
+  {434,140,4.84e-05},
+  {434,145,3.87e-04},
+  {434,165,1.93e-04},
+  {434,170,9.67e-05},
+  {434,193,4.84e-05},
+  {434,411,3.65e-02},
+  {434,429,-1.03e-02},
+  {434,454,-1.03e-02},
+  {434,459,3.65e-02},
+  {434,482,-1.03e-02},
+  {435,435,8.29e-02},
+  {435,121,4.84e-05},
+  {435,123,1.93e-04},
+  {435,124,4.84e-05},
+  {435,144,1.93e-04},
+  {435,146,7.74e-04},
+  {435,147,1.93e-04},
+  {435,169,4.84e-05},
+  {435,171,1.93e-04},
+  {435,172,4.84e-05},
+  {435,410,-1.03e-02},
+  {435,412,-1.03e-02},
+  {435,413,-1.03e-02},
+  {435,433,-1.03e-02},
+  {435,436,-1.03e-02},
+  {435,458,-1.03e-02},
+  {435,460,-1.03e-02},
+  {435,461,-1.03e-02},
+  {436,436,8.29e-02},
+  {436,123,4.84e-05},
+  {436,124,1.93e-04},
+  {436,125,4.84e-05},
+  {436,146,1.93e-04},
+  {436,147,7.74e-04},
+  {436,148,1.93e-04},
+  {436,171,4.84e-05},
+  {436,172,1.93e-04},
+  {436,173,4.84e-05},
+  {436,412,-1.03e-02},
+  {436,413,-1.03e-02},
+  {436,414,-1.03e-02},
+  {436,435,-1.03e-02},
+  {436,437,-1.03e-02},
+  {436,460,-1.03e-02},
+  {436,461,-1.03e-02},
+  {436,462,-1.03e-02},
+  {437,437,8.29e-02},
+  {437,124,4.84e-05},
+  {437,125,1.93e-04},
+  {437,126,4.84e-05},
+  {437,147,1.93e-04},
+  {437,148,7.74e-04},
+  {437,149,1.93e-04},
+  {437,172,4.84e-05},
+  {437,173,1.93e-04},
+  {437,174,4.84e-05},
+  {437,413,-1.03e-02},
+  {437,414,-1.03e-02},
+  {437,415,-1.03e-02},
+  {437,436,-1.03e-02},
+  {437,438,-1.03e-02},
+  {437,461,-1.03e-02},
+  {437,462,-1.03e-02},
+  {437,463,-1.03e-02},
+  {438,438,8.29e-02},
+  {438,125,4.84e-05},
+  {438,126,1.93e-04},
+  {438,127,4.84e-05},
+  {438,148,1.93e-04},
+  {438,149,7.74e-04},
+  {438,150,1.93e-04},
+  {438,173,4.84e-05},
+  {438,174,1.93e-04},
+  {438,175,4.84e-05},
+  {438,414,-1.03e-02},
+  {438,415,-1.03e-02},
+  {438,416,-1.03e-02},
+  {438,437,-1.03e-02},
+  {438,439,-1.03e-02},
+  {438,462,-1.03e-02},
+  {438,463,-1.03e-02},
+  {438,464,-1.03e-02},
+  {439,439,8.29e-02},
+  {439,126,4.84e-05},
+  {439,127,1.93e-04},
+  {439,128,4.84e-05},
+  {439,149,1.93e-04},
+  {439,150,7.74e-04},
+  {439,151,1.93e-04},
+  {439,174,4.84e-05},
+  {439,175,1.93e-04},
+  {439,176,4.84e-05},
+  {439,415,-1.03e-02},
+  {439,416,-1.03e-02},
+  {439,417,-1.03e-02},
+  {439,438,-1.03e-02},
+  {439,440,-1.03e-02},
+  {439,463,-1.03e-02},
+  {439,464,-1.03e-02},
+  {439,465,-1.03e-02},
+  {440,440,8.29e-02},
+  {440,127,4.84e-05},
+  {440,128,1.93e-04},
+  {440,129,4.84e-05},
+  {440,150,1.93e-04},
+  {440,151,7.74e-04},
+  {440,152,1.93e-04},
+  {440,175,4.84e-05},
+  {440,176,1.93e-04},
+  {440,177,4.84e-05},
+  {440,416,-1.03e-02},
+  {440,417,-1.03e-02},
+  {440,418,-1.03e-02},
+  {440,439,-1.03e-02},
+  {440,441,-1.03e-02},
+  {440,464,-1.03e-02},
+  {440,465,-1.03e-02},
+  {440,466,-1.03e-02},
+  {441,441,8.29e-02},
+  {441,128,4.84e-05},
+  {441,129,1.93e-04},
+  {441,130,4.84e-05},
+  {441,151,1.93e-04},
+  {441,152,7.74e-04},
+  {441,153,1.93e-04},
+  {441,176,4.84e-05},
+  {441,177,1.93e-04},
+  {441,178,4.84e-05},
+  {441,417,-1.03e-02},
+  {441,418,-1.03e-02},
+  {441,419,-1.03e-02},
+  {441,440,-1.03e-02},
+  {441,442,-1.03e-02},
+  {441,465,-1.03e-02},
+  {441,466,-1.03e-02},
+  {441,467,-1.03e-02},
+  {442,442,8.29e-02},
+  {442,129,4.84e-05},
+  {442,130,1.93e-04},
+  {442,131,4.84e-05},
+  {442,152,1.93e-04},
+  {442,153,7.74e-04},
+  {442,154,1.93e-04},
+  {442,177,4.84e-05},
+  {442,178,1.93e-04},
+  {442,179,4.84e-05},
+  {442,418,-1.03e-02},
+  {442,419,-1.03e-02},
+  {442,420,-1.03e-02},
+  {442,441,-1.03e-02},
+  {442,443,-1.03e-02},
+  {442,466,-1.03e-02},
+  {442,467,-1.03e-02},
+  {442,468,-1.03e-02},
+  {443,443,8.29e-02},
+  {443,130,4.84e-05},
+  {443,131,1.93e-04},
+  {443,132,4.84e-05},
+  {443,153,1.93e-04},
+  {443,154,7.74e-04},
+  {443,155,1.93e-04},
+  {443,178,4.84e-05},
+  {443,179,1.93e-04},
+  {443,180,4.84e-05},
+  {443,419,-1.03e-02},
+  {443,420,-1.03e-02},
+  {443,421,-1.03e-02},
+  {443,442,-1.03e-02},
+  {443,444,-1.03e-02},
+  {443,467,-1.03e-02},
+  {443,468,-1.03e-02},
+  {443,469,-1.03e-02},
+  {444,444,8.29e-02},
+  {444,131,4.84e-05},
+  {444,132,1.93e-04},
+  {444,133,4.84e-05},
+  {444,154,1.93e-04},
+  {444,155,7.74e-04},
+  {444,156,1.93e-04},
+  {444,179,4.84e-05},
+  {444,180,1.93e-04},
+  {444,181,4.84e-05},
+  {444,420,-1.03e-02},
+  {444,421,-1.03e-02},
+  {444,422,-1.03e-02},
+  {444,443,-1.03e-02},
+  {444,445,-1.03e-02},
+  {444,468,-1.03e-02},
+  {444,469,-1.03e-02},
+  {444,470,-1.03e-02},
+  {445,445,8.29e-02},
+  {445,132,4.84e-05},
+  {445,133,1.93e-04},
+  {445,155,1.93e-04},
+  {445,156,7.74e-04},
+  {445,157,1.93e-04},
+  {445,158,4.84e-05},
+  {445,180,4.84e-05},
+  {445,181,1.93e-04},
+  {445,182,4.84e-05},
+  {445,421,-1.03e-02},
+  {445,422,-1.03e-02},
+  {445,444,-1.03e-02},
+  {445,446,-1.03e-02},
+  {445,447,-1.03e-02},
+  {445,469,-1.03e-02},
+  {445,470,-1.03e-02},
+  {445,471,-1.03e-02},
+  {446,446,8.29e-02},
+  {446,133,4.84e-05},
+  {446,156,1.93e-04},
+  {446,157,7.74e-04},
+  {446,158,1.93e-04},
+  {446,181,4.84e-05},
+  {446,182,1.93e-04},
+  {446,183,4.84e-05},
+  {446,184,1.93e-04},
+  {446,188,4.84e-05},
+  {446,422,-1.03e-02},
+  {446,445,-1.03e-02},
+  {446,447,-1.03e-02},
+  {446,470,-1.03e-02},
+  {446,471,-1.03e-02},
+  {446,472,-1.03e-02},
+  {446,473,-1.03e-02},
+  {446,477,-1.03e-02},
+  {447,447,8.29e-02},
+  {447,133,1.93e-04},
+  {447,134,4.84e-05},
+  {447,156,4.84e-05},
+  {447,157,1.93e-04},
+  {447,158,7.74e-04},
+  {447,159,1.93e-04},
+  {447,184,4.84e-05},
+  {447,187,4.84e-05},
+  {447,188,1.93e-04},
+  {447,422,-1.03e-02},
+  {447,423,-1.03e-02},
+  {447,445,-1.03e-02},
+  {447,446,-1.03e-02},
+  {447,448,-1.03e-02},
+  {447,473,-1.03e-02},
+  {447,476,-1.03e-02},
+  {447,477,-1.03e-02},
+  {448,448,8.29e-02},
+  {448,133,4.84e-05},
+  {448,134,1.93e-04},
+  {448,135,4.84e-05},
+  {448,158,1.93e-04},
+  {448,159,7.74e-04},
+  {448,160,1.93e-04},
+  {448,185,4.84e-05},
+  {448,187,1.93e-04},
+  {448,188,4.84e-05},
+  {448,422,-1.03e-02},
+  {448,423,-1.03e-02},
+  {448,424,-1.03e-02},
+  {448,447,-1.03e-02},
+  {448,449,-1.03e-02},
+  {448,474,-1.03e-02},
+  {448,476,-1.03e-02},
+  {448,477,-1.03e-02},
+  {449,449,8.29e-02},
+  {449,134,4.84e-05},
+  {449,135,1.93e-04},
+  {449,136,4.84e-05},
+  {449,159,1.93e-04},
+  {449,160,7.74e-04},
+  {449,161,1.93e-04},
+  {449,185,1.93e-04},
+  {449,186,4.84e-05},
+  {449,187,4.84e-05},
+  {449,423,-1.03e-02},
+  {449,424,-1.03e-02},
+  {449,425,-1.03e-02},
+  {449,448,-1.03e-02},
+  {449,450,-1.03e-02},
+  {449,474,-1.03e-02},
+  {449,475,-1.03e-02},
+  {449,476,-1.03e-02},
+  {450,450,8.29e-02},
+  {450,135,4.84e-05},
+  {450,136,1.93e-04},
+  {450,141,4.84e-05},
+  {450,160,1.93e-04},
+  {450,161,7.74e-04},
+  {450,166,1.93e-04},
+  {450,185,4.84e-05},
+  {450,186,1.93e-04},
+  {450,192,4.84e-05},
+  {450,424,-1.03e-02},
+  {450,425,-1.03e-02},
+  {450,430,-1.03e-02},
+  {450,449,-1.03e-02},
+  {450,455,-1.03e-02},
+  {450,474,-1.03e-02},
+  {450,475,-1.03e-02},
+  {450,481,-1.03e-02},
+  {451,451,8.29e-02},
+  {451,137,4.84e-05},
+  {451,139,1.93e-04},
+  {451,143,4.84e-05},
+  {451,162,7.74e-04},
+  {451,163,1.93e-04},
+  {451,168,1.93e-04},
+  {451,189,4.84e-05},
+  {451,190,1.93e-04},
+  {451,195,4.84e-05},
+  {451,426,-1.03e-02},
+  {451,428,-1.03e-02},
+  {451,432,-1.03e-02},
+  {451,452,-1.03e-02},
+  {451,457,-1.03e-02},
+  {451,478,-1.03e-02},
+  {451,479,-1.03e-02},
+  {451,484,-1.03e-02},
+  {452,452,8.29e-02},
+  {452,137,1.93e-04},
+  {452,138,4.84e-05},
+  {452,139,4.84e-05},
+  {452,162,1.93e-04},
+  {452,163,7.74e-04},
+  {452,164,1.93e-04},
+  {452,190,4.84e-05},
+  {452,194,4.84e-05},
+  {452,195,1.93e-04},
+  {452,426,-1.03e-02},
+  {452,427,-1.03e-02},
+  {452,428,-1.03e-02},
+  {452,451,-1.03e-02},
+  {452,453,-1.03e-02},
+  {452,479,-1.03e-02},
+  {452,483,-1.03e-02},
+  {452,484,-1.03e-02},
+  {453,453,8.29e-02},
+  {453,137,4.84e-05},
+  {453,138,1.93e-04},
+  {453,140,4.84e-05},
+  {453,163,1.93e-04},
+  {453,164,7.74e-04},
+  {453,165,1.93e-04},
+  {453,193,4.84e-05},
+  {453,194,1.93e-04},
+  {453,195,4.84e-05},
+  {453,426,-1.03e-02},
+  {453,427,-1.03e-02},
+  {453,429,-1.03e-02},
+  {453,452,-1.03e-02},
+  {453,454,-1.03e-02},
+  {453,482,-1.03e-02},
+  {453,483,-1.03e-02},
+  {453,484,-1.03e-02},
+  {454,454,8.29e-02},
+  {454,122,4.84e-05},
+  {454,138,4.84e-05},
+  {454,140,1.93e-04},
+  {454,145,1.93e-04},
+  {454,164,1.93e-04},
+  {454,165,7.74e-04},
+  {454,170,4.84e-05},
+  {454,193,1.93e-04},
+  {454,194,4.84e-05},
+  {454,411,-1.03e-02},
+  {454,427,-1.03e-02},
+  {454,429,-1.03e-02},
+  {454,434,-1.03e-02},
+  {454,453,-1.03e-02},
+  {454,459,-1.03e-02},
+  {454,482,-1.03e-02},
+  {454,483,-1.03e-02},
+  {455,455,8.29e-02},
+  {455,136,4.84e-05},
+  {455,141,1.93e-04},
+  {455,142,4.84e-05},
+  {455,161,1.93e-04},
+  {455,166,7.74e-04},
+  {455,167,1.93e-04},
+  {455,186,4.84e-05},
+  {455,191,4.84e-05},
+  {455,192,1.93e-04},
+  {455,425,-1.03e-02},
+  {455,430,-1.03e-02},
+  {455,431,-1.03e-02},
+  {455,450,-1.03e-02},
+  {455,456,-1.03e-02},
+  {455,475,-1.03e-02},
+  {455,480,-1.03e-02},
+  {455,481,-1.03e-02},
+  {456,456,8.29e-02},
+  {456,141,4.84e-05},
+  {456,142,1.93e-04},
+  {456,143,4.84e-05},
+  {456,166,1.93e-04},
+  {456,167,7.74e-04},
+  {456,168,1.93e-04},
+  {456,189,4.84e-05},
+  {456,191,1.93e-04},
+  {456,192,4.84e-05},
+  {456,430,-1.03e-02},
+  {456,431,-1.03e-02},
+  {456,432,-1.03e-02},
+  {456,455,-1.03e-02},
+  {456,457,-1.03e-02},
+  {456,478,-1.03e-02},
+  {456,480,-1.03e-02},
+  {456,481,-1.03e-02},
+  {457,457,8.29e-02},
+  {457,139,4.84e-05},
+  {457,142,4.84e-05},
+  {457,143,1.93e-04},
+  {457,162,1.93e-04},
+  {457,167,1.93e-04},
+  {457,168,7.74e-04},
+  {457,189,1.93e-04},
+  {457,190,4.84e-05},
+  {457,191,4.84e-05},
+  {457,428,-1.03e-02},
+  {457,431,-1.03e-02},
+  {457,432,-1.03e-02},
+  {457,451,-1.03e-02},
+  {457,456,-1.03e-02},
+  {457,478,-1.03e-02},
+  {457,479,-1.03e-02},
+  {457,480,-1.03e-02},
+  {458,458,2.08e-01},
+  {458,144,9.67e-05},
+  {458,146,4.84e-05},
+  {458,169,3.87e-04},
+  {458,171,1.93e-04},
+  {458,196,9.67e-05},
+  {458,198,4.84e-05},
+  {458,433,3.65e-02},
+  {458,435,-1.03e-02},
+  {458,460,-1.03e-02},
+  {458,485,3.65e-02},
+  {458,487,-1.03e-02},
+  {459,459,2.08e-01},
+  {459,145,9.67e-05},
+  {459,165,4.84e-05},
+  {459,170,3.87e-04},
+  {459,193,1.93e-04},
+  {459,197,9.67e-05},
+  {459,223,4.84e-05},
+  {459,434,3.65e-02},
+  {459,454,-1.03e-02},
+  {459,482,-1.03e-02},
+  {459,486,3.65e-02},
+  {459,512,-1.03e-02},
+  {460,460,8.29e-02},
+  {460,144,4.84e-05},
+  {460,146,1.93e-04},
+  {460,147,4.84e-05},
+  {460,169,1.93e-04},
+  {460,171,7.74e-04},
+  {460,172,1.93e-04},
+  {460,196,4.84e-05},
+  {460,198,1.93e-04},
+  {460,199,4.84e-05},
+  {460,433,-1.03e-02},
+  {460,435,-1.03e-02},
+  {460,436,-1.03e-02},
+  {460,458,-1.03e-02},
+  {460,461,-1.03e-02},
+  {460,485,-1.03e-02},
+  {460,487,-1.03e-02},
+  {460,488,-1.03e-02},
+  {461,461,8.29e-02},
+  {461,146,4.84e-05},
+  {461,147,1.93e-04},
+  {461,148,4.84e-05},
+  {461,171,1.93e-04},
+  {461,172,7.74e-04},
+  {461,173,1.93e-04},
+  {461,198,4.84e-05},
+  {461,199,1.93e-04},
+  {461,200,4.84e-05},
+  {461,435,-1.03e-02},
+  {461,436,-1.03e-02},
+  {461,437,-1.03e-02},
+  {461,460,-1.03e-02},
+  {461,462,-1.03e-02},
+  {461,487,-1.03e-02},
+  {461,488,-1.03e-02},
+  {461,489,-1.03e-02},
+  {462,462,8.29e-02},
+  {462,147,4.84e-05},
+  {462,148,1.93e-04},
+  {462,149,4.84e-05},
+  {462,172,1.93e-04},
+  {462,173,7.74e-04},
+  {462,174,1.93e-04},
+  {462,199,4.84e-05},
+  {462,200,1.93e-04},
+  {462,201,4.84e-05},
+  {462,436,-1.03e-02},
+  {462,437,-1.03e-02},
+  {462,438,-1.03e-02},
+  {462,461,-1.03e-02},
+  {462,463,-1.03e-02},
+  {462,488,-1.03e-02},
+  {462,489,-1.03e-02},
+  {462,490,-1.03e-02},
+  {463,463,8.29e-02},
+  {463,148,4.84e-05},
+  {463,149,1.93e-04},
+  {463,150,4.84e-05},
+  {463,173,1.93e-04},
+  {463,174,7.74e-04},
+  {463,175,1.93e-04},
+  {463,200,4.84e-05},
+  {463,201,1.93e-04},
+  {463,202,4.84e-05},
+  {463,437,-1.03e-02},
+  {463,438,-1.03e-02},
+  {463,439,-1.03e-02},
+  {463,462,-1.03e-02},
+  {463,464,-1.03e-02},
+  {463,489,-1.03e-02},
+  {463,490,-1.03e-02},
+  {463,491,-1.03e-02},
+  {464,464,8.29e-02},
+  {464,149,4.84e-05},
+  {464,150,1.93e-04},
+  {464,151,4.84e-05},
+  {464,174,1.93e-04},
+  {464,175,7.74e-04},
+  {464,176,1.93e-04},
+  {464,201,4.84e-05},
+  {464,202,1.93e-04},
+  {464,203,4.84e-05},
+  {464,438,-1.03e-02},
+  {464,439,-1.03e-02},
+  {464,440,-1.03e-02},
+  {464,463,-1.03e-02},
+  {464,465,-1.03e-02},
+  {464,490,-1.03e-02},
+  {464,491,-1.03e-02},
+  {464,492,-1.03e-02},
+  {465,465,8.29e-02},
+  {465,150,4.84e-05},
+  {465,151,1.93e-04},
+  {465,152,4.84e-05},
+  {465,175,1.93e-04},
+  {465,176,7.74e-04},
+  {465,177,1.93e-04},
+  {465,202,4.84e-05},
+  {465,203,1.93e-04},
+  {465,204,4.84e-05},
+  {465,439,-1.03e-02},
+  {465,440,-1.03e-02},
+  {465,441,-1.03e-02},
+  {465,464,-1.03e-02},
+  {465,466,-1.03e-02},
+  {465,491,-1.03e-02},
+  {465,492,-1.03e-02},
+  {465,493,-1.03e-02},
+  {466,466,8.29e-02},
+  {466,151,4.84e-05},
+  {466,152,1.93e-04},
+  {466,153,4.84e-05},
+  {466,176,1.93e-04},
+  {466,177,7.74e-04},
+  {466,178,1.93e-04},
+  {466,203,4.84e-05},
+  {466,204,1.93e-04},
+  {466,205,4.84e-05},
+  {466,440,-1.03e-02},
+  {466,441,-1.03e-02},
+  {466,442,-1.03e-02},
+  {466,465,-1.03e-02},
+  {466,467,-1.03e-02},
+  {466,492,-1.03e-02},
+  {466,493,-1.03e-02},
+  {466,494,-1.03e-02},
+  {467,467,8.29e-02},
+  {467,152,4.84e-05},
+  {467,153,1.93e-04},
+  {467,154,4.84e-05},
+  {467,177,1.93e-04},
+  {467,178,7.74e-04},
+  {467,179,1.93e-04},
+  {467,204,4.84e-05},
+  {467,205,1.93e-04},
+  {467,206,4.84e-05},
+  {467,441,-1.03e-02},
+  {467,442,-1.03e-02},
+  {467,443,-1.03e-02},
+  {467,466,-1.03e-02},
+  {467,468,-1.03e-02},
+  {467,493,-1.03e-02},
+  {467,494,-1.03e-02},
+  {467,495,-1.03e-02},
+  {468,468,8.29e-02},
+  {468,153,4.84e-05},
+  {468,154,1.93e-04},
+  {468,155,4.84e-05},
+  {468,178,1.93e-04},
+  {468,179,7.74e-04},
+  {468,180,1.93e-04},
+  {468,205,4.84e-05},
+  {468,206,1.93e-04},
+  {468,207,4.84e-05},
+  {468,442,-1.03e-02},
+  {468,443,-1.03e-02},
+  {468,444,-1.03e-02},
+  {468,467,-1.03e-02},
+  {468,469,-1.03e-02},
+  {468,494,-1.03e-02},
+  {468,495,-1.03e-02},
+  {468,496,-1.03e-02},
+  {469,469,8.29e-02},
+  {469,154,4.84e-05},
+  {469,155,1.93e-04},
+  {469,156,4.84e-05},
+  {469,179,1.93e-04},
+  {469,180,7.74e-04},
+  {469,181,1.93e-04},
+  {469,206,4.84e-05},
+  {469,207,1.93e-04},
+  {469,208,4.84e-05},
+  {469,443,-1.03e-02},
+  {469,444,-1.03e-02},
+  {469,445,-1.03e-02},
+  {469,468,-1.03e-02},
+  {469,470,-1.03e-02},
+  {469,495,-1.03e-02},
+  {469,496,-1.03e-02},
+  {469,497,-1.03e-02},
+  {470,470,8.29e-02},
+  {470,155,4.84e-05},
+  {470,156,1.93e-04},
+  {470,157,4.84e-05},
+  {470,180,1.93e-04},
+  {470,181,7.74e-04},
+  {470,182,1.93e-04},
+  {470,207,4.84e-05},
+  {470,208,1.93e-04},
+  {470,209,4.84e-05},
+  {470,444,-1.03e-02},
+  {470,445,-1.03e-02},
+  {470,446,-1.03e-02},
+  {470,469,-1.03e-02},
+  {470,471,-1.03e-02},
+  {470,496,-1.03e-02},
+  {470,497,-1.03e-02},
+  {470,498,-1.03e-02},
+  {471,471,8.29e-02},
+  {471,156,4.84e-05},
+  {471,157,1.93e-04},
+  {471,181,1.93e-04},
+  {471,182,7.74e-04},
+  {471,183,1.93e-04},
+  {471,184,4.84e-05},
+  {471,208,4.84e-05},
+  {471,209,1.93e-04},
+  {471,210,4.84e-05},
+  {471,445,-1.03e-02},
+  {471,446,-1.03e-02},
+  {471,470,-1.03e-02},
+  {471,472,-1.03e-02},
+  {471,473,-1.03e-02},
+  {471,497,-1.03e-02},
+  {471,498,-1.03e-02},
+  {471,499,-1.03e-02},
+  {472,472,8.29e-02},
+  {472,157,4.84e-05},
+  {472,182,1.93e-04},
+  {472,183,7.74e-04},
+  {472,184,1.93e-04},
+  {472,209,4.84e-05},
+  {472,210,1.93e-04},
+  {472,211,4.84e-05},
+  {472,212,1.93e-04},
+  {472,213,4.84e-05},
+  {472,446,-1.03e-02},
+  {472,471,-1.03e-02},
+  {472,473,-1.03e-02},
+  {472,498,-1.03e-02},
+  {472,499,-1.03e-02},
+  {472,500,-1.03e-02},
+  {472,501,-1.03e-02},
+  {472,502,-1.03e-02},
+  {473,473,8.29e-02},
+  {473,157,1.93e-04},
+  {473,158,4.84e-05},
+  {473,182,4.84e-05},
+  {473,183,1.93e-04},
+  {473,184,7.74e-04},
+  {473,188,1.93e-04},
+  {473,212,4.84e-05},
+  {473,213,1.93e-04},
+  {473,217,4.84e-05},
+  {473,446,-1.03e-02},
+  {473,447,-1.03e-02},
+  {473,471,-1.03e-02},
+  {473,472,-1.03e-02},
+  {473,477,-1.03e-02},
+  {473,501,-1.03e-02},
+  {473,502,-1.03e-02},
+  {473,506,-1.03e-02},
+  {474,474,8.29e-02},
+  {474,159,4.84e-05},
+  {474,160,1.93e-04},
+  {474,161,4.84e-05},
+  {474,185,7.74e-04},
+  {474,186,1.93e-04},
+  {474,187,1.93e-04},
+  {474,214,4.84e-05},
+  {474,215,1.93e-04},
+  {474,216,4.84e-05},
+  {474,448,-1.03e-02},
+  {474,449,-1.03e-02},
+  {474,450,-1.03e-02},
+  {474,475,-1.03e-02},
+  {474,476,-1.03e-02},
+  {474,503,-1.03e-02},
+  {474,504,-1.03e-02},
+  {474,505,-1.03e-02},
+  {475,475,8.29e-02},
+  {475,160,4.84e-05},
+  {475,161,1.93e-04},
+  {475,166,4.84e-05},
+  {475,185,1.93e-04},
+  {475,186,7.74e-04},
+  {475,192,1.93e-04},
+  {475,215,4.84e-05},
+  {475,216,1.93e-04},
+  {475,221,4.84e-05},
+  {475,449,-1.03e-02},
+  {475,450,-1.03e-02},
+  {475,455,-1.03e-02},
+  {475,474,-1.03e-02},
+  {475,481,-1.03e-02},
+  {475,504,-1.03e-02},
+  {475,505,-1.03e-02},
+  {475,510,-1.03e-02},
+  {476,476,8.29e-02},
+  {476,158,4.84e-05},
+  {476,159,1.93e-04},
+  {476,160,4.84e-05},
+  {476,185,1.93e-04},
+  {476,187,7.74e-04},
+  {476,188,1.93e-04},
+  {476,214,1.93e-04},
+  {476,215,4.84e-05},
+  {476,217,4.84e-05},
+  {476,447,-1.03e-02},
+  {476,448,-1.03e-02},
+  {476,449,-1.03e-02},
+  {476,474,-1.03e-02},
+  {476,477,-1.03e-02},
+  {476,503,-1.03e-02},
+  {476,504,-1.03e-02},
+  {476,506,-1.03e-02},
+  {477,477,8.29e-02},
+  {477,157,4.84e-05},
+  {477,158,1.93e-04},
+  {477,159,4.84e-05},
+  {477,184,1.93e-04},
+  {477,187,1.93e-04},
+  {477,188,7.74e-04},
+  {477,213,4.84e-05},
+  {477,214,4.84e-05},
+  {477,217,1.93e-04},
+  {477,446,-1.03e-02},
+  {477,447,-1.03e-02},
+  {477,448,-1.03e-02},
+  {477,473,-1.03e-02},
+  {477,476,-1.03e-02},
+  {477,502,-1.03e-02},
+  {477,503,-1.03e-02},
+  {477,506,-1.03e-02},
+  {478,478,8.29e-02},
+  {478,162,4.84e-05},
+  {478,167,4.84e-05},
+  {478,168,1.93e-04},
+  {478,189,7.74e-04},
+  {478,190,1.93e-04},
+  {478,191,1.93e-04},
+  {478,218,4.84e-05},
+  {478,219,1.93e-04},
+  {478,220,4.84e-05},
+  {478,451,-1.03e-02},
+  {478,456,-1.03e-02},
+  {478,457,-1.03e-02},
+  {478,479,-1.03e-02},
+  {478,480,-1.03e-02},
+  {478,507,-1.03e-02},
+  {478,508,-1.03e-02},
+  {478,509,-1.03e-02},
+  {479,479,8.29e-02},
+  {479,162,1.93e-04},
+  {479,163,4.84e-05},
+  {479,168,4.84e-05},
+  {479,189,1.93e-04},
+  {479,190,7.74e-04},
+  {479,195,1.93e-04},
+  {479,219,4.84e-05},
+  {479,220,1.93e-04},
+  {479,224,4.84e-05},
+  {479,451,-1.03e-02},
+  {479,452,-1.03e-02},
+  {479,457,-1.03e-02},
+  {479,478,-1.03e-02},
+  {479,484,-1.03e-02},
+  {479,508,-1.03e-02},
+  {479,509,-1.03e-02},
+  {479,513,-1.03e-02},
+  {480,480,8.29e-02},
+  {480,166,4.84e-05},
+  {480,167,1.93e-04},
+  {480,168,4.84e-05},
+  {480,189,1.93e-04},
+  {480,191,7.74e-04},
+  {480,192,1.93e-04},
+  {480,218,1.93e-04},
+  {480,219,4.84e-05},
+  {480,221,4.84e-05},
+  {480,455,-1.03e-02},
+  {480,456,-1.03e-02},
+  {480,457,-1.03e-02},
+  {480,478,-1.03e-02},
+  {480,481,-1.03e-02},
+  {480,507,-1.03e-02},
+  {480,508,-1.03e-02},
+  {480,510,-1.03e-02},
+  {481,481,8.29e-02},
+  {481,161,4.84e-05},
+  {481,166,1.93e-04},
+  {481,167,4.84e-05},
+  {481,186,1.93e-04},
+  {481,191,1.93e-04},
+  {481,192,7.74e-04},
+  {481,216,4.84e-05},
+  {481,218,4.84e-05},
+  {481,221,1.93e-04},
+  {481,450,-1.03e-02},
+  {481,455,-1.03e-02},
+  {481,456,-1.03e-02},
+  {481,475,-1.03e-02},
+  {481,480,-1.03e-02},
+  {481,505,-1.03e-02},
+  {481,507,-1.03e-02},
+  {481,510,-1.03e-02},
+  {482,482,8.29e-02},
+  {482,145,4.84e-05},
+  {482,164,4.84e-05},
+  {482,165,1.93e-04},
+  {482,170,1.93e-04},
+  {482,193,7.74e-04},
+  {482,194,1.93e-04},
+  {482,197,4.84e-05},
+  {482,222,4.84e-05},
+  {482,223,1.93e-04},
+  {482,434,-1.03e-02},
+  {482,453,-1.03e-02},
+  {482,454,-1.03e-02},
+  {482,459,-1.03e-02},
+  {482,483,-1.03e-02},
+  {482,486,-1.03e-02},
+  {482,511,-1.03e-02},
+  {482,512,-1.03e-02},
+  {483,483,8.29e-02},
+  {483,163,4.84e-05},
+  {483,164,1.93e-04},
+  {483,165,4.84e-05},
+  {483,193,1.93e-04},
+  {483,194,7.74e-04},
+  {483,195,1.93e-04},
+  {483,222,1.93e-04},
+  {483,223,4.84e-05},
+  {483,224,4.84e-05},
+  {483,452,-1.03e-02},
+  {483,453,-1.03e-02},
+  {483,454,-1.03e-02},
+  {483,482,-1.03e-02},
+  {483,484,-1.03e-02},
+  {483,511,-1.03e-02},
+  {483,512,-1.03e-02},
+  {483,513,-1.03e-02},
+  {484,484,8.29e-02},
+  {484,162,4.84e-05},
+  {484,163,1.93e-04},
+  {484,164,4.84e-05},
+  {484,190,1.93e-04},
+  {484,194,1.93e-04},
+  {484,195,7.74e-04},
+  {484,220,4.84e-05},
+  {484,222,4.84e-05},
+  {484,224,1.93e-04},
+  {484,451,-1.03e-02},
+  {484,452,-1.03e-02},
+  {484,453,-1.03e-02},
+  {484,479,-1.03e-02},
+  {484,483,-1.03e-02},
+  {484,509,-1.03e-02},
+  {484,511,-1.03e-02},
+  {484,513,-1.03e-02},
+  {485,485,2.08e-01},
+  {485,169,9.67e-05},
+  {485,171,4.84e-05},
+  {485,196,3.87e-04},
+  {485,198,1.93e-04},
+  {485,225,9.67e-05},
+  {485,227,4.84e-05},
+  {485,458,3.65e-02},
+  {485,460,-1.03e-02},
+  {485,487,-1.03e-02},
+  {485,514,3.65e-02},
+  {485,516,-1.03e-02},
+  {486,486,2.08e-01},
+  {486,170,9.67e-05},
+  {486,193,4.84e-05},
+  {486,197,3.87e-04},
+  {486,223,1.93e-04},
+  {486,226,9.67e-05},
+  {486,255,4.84e-05},
+  {486,459,3.65e-02},
+  {486,482,-1.03e-02},
+  {486,512,-1.03e-02},
+  {486,515,3.65e-02},
+  {486,544,-1.03e-02},
+  {487,487,8.29e-02},
+  {487,169,4.84e-05},
+  {487,171,1.93e-04},
+  {487,172,4.84e-05},
+  {487,196,1.93e-04},
+  {487,198,7.74e-04},
+  {487,199,1.93e-04},
+  {487,225,4.84e-05},
+  {487,227,1.93e-04},
+  {487,228,4.84e-05},
+  {487,458,-1.03e-02},
+  {487,460,-1.03e-02},
+  {487,461,-1.03e-02},
+  {487,485,-1.03e-02},
+  {487,488,-1.03e-02},
+  {487,514,-1.03e-02},
+  {487,516,-1.03e-02},
+  {487,517,-1.03e-02},
+  {488,488,8.29e-02},
+  {488,171,4.84e-05},
+  {488,172,1.93e-04},
+  {488,173,4.84e-05},
+  {488,198,1.93e-04},
+  {488,199,7.74e-04},
+  {488,200,1.93e-04},
+  {488,227,4.84e-05},
+  {488,228,1.93e-04},
+  {488,229,4.84e-05},
+  {488,460,-1.03e-02},
+  {488,461,-1.03e-02},
+  {488,462,-1.03e-02},
+  {488,487,-1.03e-02},
+  {488,489,-1.03e-02},
+  {488,516,-1.03e-02},
+  {488,517,-1.03e-02},
+  {488,518,-1.03e-02},
+  {489,489,8.29e-02},
+  {489,172,4.84e-05},
+  {489,173,1.93e-04},
+  {489,174,4.84e-05},
+  {489,199,1.93e-04},
+  {489,200,7.74e-04},
+  {489,201,1.93e-04},
+  {489,228,4.84e-05},
+  {489,229,1.93e-04},
+  {489,230,4.84e-05},
+  {489,461,-1.03e-02},
+  {489,462,-1.03e-02},
+  {489,463,-1.03e-02},
+  {489,488,-1.03e-02},
+  {489,490,-1.03e-02},
+  {489,517,-1.03e-02},
+  {489,518,-1.03e-02},
+  {489,519,-1.03e-02},
+  {490,490,8.29e-02},
+  {490,173,4.84e-05},
+  {490,174,1.93e-04},
+  {490,175,4.84e-05},
+  {490,200,1.93e-04},
+  {490,201,7.74e-04},
+  {490,202,1.93e-04},
+  {490,229,4.84e-05},
+  {490,230,1.93e-04},
+  {490,231,4.84e-05},
+  {490,462,-1.03e-02},
+  {490,463,-1.03e-02},
+  {490,464,-1.03e-02},
+  {490,489,-1.03e-02},
+  {490,491,-1.03e-02},
+  {490,518,-1.03e-02},
+  {490,519,-1.03e-02},
+  {490,520,-1.03e-02},
+  {491,491,8.29e-02},
+  {491,174,4.84e-05},
+  {491,175,1.93e-04},
+  {491,176,4.84e-05},
+  {491,201,1.93e-04},
+  {491,202,7.74e-04},
+  {491,203,1.93e-04},
+  {491,230,4.84e-05},
+  {491,231,1.93e-04},
+  {491,232,4.84e-05},
+  {491,463,-1.03e-02},
+  {491,464,-1.03e-02},
+  {491,465,-1.03e-02},
+  {491,490,-1.03e-02},
+  {491,492,-1.03e-02},
+  {491,519,-1.03e-02},
+  {491,520,-1.03e-02},
+  {491,521,-1.03e-02},
+  {492,492,8.29e-02},
+  {492,175,4.84e-05},
+  {492,176,1.93e-04},
+  {492,177,4.84e-05},
+  {492,202,1.93e-04},
+  {492,203,7.74e-04},
+  {492,204,1.93e-04},
+  {492,231,4.84e-05},
+  {492,232,1.93e-04},
+  {492,233,4.84e-05},
+  {492,464,-1.03e-02},
+  {492,465,-1.03e-02},
+  {492,466,-1.03e-02},
+  {492,491,-1.03e-02},
+  {492,493,-1.03e-02},
+  {492,520,-1.03e-02},
+  {492,521,-1.03e-02},
+  {492,522,-1.03e-02},
+  {493,493,8.29e-02},
+  {493,176,4.84e-05},
+  {493,177,1.93e-04},
+  {493,178,4.84e-05},
+  {493,203,1.93e-04},
+  {493,204,7.74e-04},
+  {493,205,1.93e-04},
+  {493,232,4.84e-05},
+  {493,233,1.93e-04},
+  {493,234,4.84e-05},
+  {493,465,-1.03e-02},
+  {493,466,-1.03e-02},
+  {493,467,-1.03e-02},
+  {493,492,-1.03e-02},
+  {493,494,-1.03e-02},
+  {493,521,-1.03e-02},
+  {493,522,-1.03e-02},
+  {493,523,-1.03e-02},
+  {494,494,8.29e-02},
+  {494,177,4.84e-05},
+  {494,178,1.93e-04},
+  {494,179,4.84e-05},
+  {494,204,1.93e-04},
+  {494,205,7.74e-04},
+  {494,206,1.93e-04},
+  {494,233,4.84e-05},
+  {494,234,1.93e-04},
+  {494,235,4.84e-05},
+  {494,466,-1.03e-02},
+  {494,467,-1.03e-02},
+  {494,468,-1.03e-02},
+  {494,493,-1.03e-02},
+  {494,495,-1.03e-02},
+  {494,522,-1.03e-02},
+  {494,523,-1.03e-02},
+  {494,524,-1.03e-02},
+  {495,495,8.29e-02},
+  {495,178,4.84e-05},
+  {495,179,1.93e-04},
+  {495,180,4.84e-05},
+  {495,205,1.93e-04},
+  {495,206,7.74e-04},
+  {495,207,1.93e-04},
+  {495,234,4.84e-05},
+  {495,235,1.93e-04},
+  {495,236,4.84e-05},
+  {495,467,-1.03e-02},
+  {495,468,-1.03e-02},
+  {495,469,-1.03e-02},
+  {495,494,-1.03e-02},
+  {495,496,-1.03e-02},
+  {495,523,-1.03e-02},
+  {495,524,-1.03e-02},
+  {495,525,-1.03e-02},
+  {496,496,8.29e-02},
+  {496,179,4.84e-05},
+  {496,180,1.93e-04},
+  {496,181,4.84e-05},
+  {496,206,1.93e-04},
+  {496,207,7.74e-04},
+  {496,208,1.93e-04},
+  {496,235,4.84e-05},
+  {496,236,1.93e-04},
+  {496,237,4.84e-05},
+  {496,468,-1.03e-02},
+  {496,469,-1.03e-02},
+  {496,470,-1.03e-02},
+  {496,495,-1.03e-02},
+  {496,497,-1.03e-02},
+  {496,524,-1.03e-02},
+  {496,525,-1.03e-02},
+  {496,526,-1.03e-02},
+  {497,497,8.29e-02},
+  {497,180,4.84e-05},
+  {497,181,1.93e-04},
+  {497,182,4.84e-05},
+  {497,207,1.93e-04},
+  {497,208,7.74e-04},
+  {497,209,1.93e-04},
+  {497,236,4.84e-05},
+  {497,237,1.93e-04},
+  {497,238,4.84e-05},
+  {497,469,-1.03e-02},
+  {497,470,-1.03e-02},
+  {497,471,-1.03e-02},
+  {497,496,-1.03e-02},
+  {497,498,-1.03e-02},
+  {497,525,-1.03e-02},
+  {497,526,-1.03e-02},
+  {497,527,-1.03e-02},
+  {498,498,8.29e-02},
+  {498,181,4.84e-05},
+  {498,182,1.93e-04},
+  {498,183,4.84e-05},
+  {498,208,1.93e-04},
+  {498,209,7.74e-04},
+  {498,210,1.93e-04},
+  {498,237,4.84e-05},
+  {498,238,1.93e-04},
+  {498,239,4.84e-05},
+  {498,470,-1.03e-02},
+  {498,471,-1.03e-02},
+  {498,472,-1.03e-02},
+  {498,497,-1.03e-02},
+  {498,499,-1.03e-02},
+  {498,526,-1.03e-02},
+  {498,527,-1.03e-02},
+  {498,528,-1.03e-02},
+  {499,499,8.29e-02},
+  {499,182,4.84e-05},
+  {499,183,1.93e-04},
+  {499,209,1.93e-04},
+  {499,210,7.74e-04},
+  {499,211,1.93e-04},
+  {499,212,4.84e-05},
+  {499,238,4.84e-05},
+  {499,239,1.93e-04},
+  {499,240,4.84e-05},
+  {499,471,-1.03e-02},
+  {499,472,-1.03e-02},
+  {499,498,-1.03e-02},
+  {499,500,-1.03e-02},
+  {499,501,-1.03e-02},
+  {499,527,-1.03e-02},
+  {499,528,-1.03e-02},
+  {499,529,-1.03e-02},
+  {500,500,8.29e-02},
+  {500,183,4.84e-05},
+  {500,210,1.93e-04},
+  {500,211,7.74e-04},
+  {500,212,1.93e-04},
+  {500,239,4.84e-05},
+  {500,240,1.93e-04},
+  {500,241,4.84e-05},
+  {500,242,1.93e-04},
+  {500,243,4.84e-05},
+  {500,472,-1.03e-02},
+  {500,499,-1.03e-02},
+  {500,501,-1.03e-02},
+  {500,528,-1.03e-02},
+  {500,529,-1.03e-02},
+  {500,530,-1.03e-02},
+  {500,531,-1.03e-02},
+  {500,532,-1.03e-02},
+  {501,501,8.29e-02},
+  {501,183,1.93e-04},
+  {501,184,4.84e-05},
+  {501,210,4.84e-05},
+  {501,211,1.93e-04},
+  {501,212,7.74e-04},
+  {501,213,1.93e-04},
+  {501,242,4.84e-05},
+  {501,243,1.93e-04},
+  {501,244,4.84e-05},
+  {501,472,-1.03e-02},
+  {501,473,-1.03e-02},
+  {501,499,-1.03e-02},
+  {501,500,-1.03e-02},
+  {501,502,-1.03e-02},
+  {501,531,-1.03e-02},
+  {501,532,-1.03e-02},
+  {501,533,-1.03e-02},
+  {502,502,8.29e-02},
+  {502,183,4.84e-05},
+  {502,184,1.93e-04},
+  {502,188,4.84e-05},
+  {502,212,1.93e-04},
+  {502,213,7.74e-04},
+  {502,217,1.93e-04},
+  {502,243,4.84e-05},
+  {502,244,1.93e-04},
+  {502,245,4.84e-05},
+  {502,472,-1.03e-02},
+  {502,473,-1.03e-02},
+  {502,477,-1.03e-02},
+  {502,501,-1.03e-02},
+  {502,506,-1.03e-02},
+  {502,532,-1.03e-02},
+  {502,533,-1.03e-02},
+  {502,534,-1.03e-02},
+  {503,503,8.29e-02},
+  {503,185,4.84e-05},
+  {503,187,1.93e-04},
+  {503,188,4.84e-05},
+  {503,214,7.74e-04},
+  {503,215,1.93e-04},
+  {503,217,1.93e-04},
+  {503,245,4.84e-05},
+  {503,246,1.93e-04},
+  {503,247,4.84e-05},
+  {503,474,-1.03e-02},
+  {503,476,-1.03e-02},
+  {503,477,-1.03e-02},
+  {503,504,-1.03e-02},
+  {503,506,-1.03e-02},
+  {503,534,-1.03e-02},
+  {503,535,-1.03e-02},
+  {503,536,-1.03e-02},
+  {504,504,8.29e-02},
+  {504,185,1.93e-04},
+  {504,186,4.84e-05},
+  {504,187,4.84e-05},
+  {504,214,1.93e-04},
+  {504,215,7.74e-04},
+  {504,216,1.93e-04},
+  {504,246,4.84e-05},
+  {504,247,1.93e-04},
+  {504,248,4.84e-05},
+  {504,474,-1.03e-02},
+  {504,475,-1.03e-02},
+  {504,476,-1.03e-02},
+  {504,503,-1.03e-02},
+  {504,505,-1.03e-02},
+  {504,535,-1.03e-02},
+  {504,536,-1.03e-02},
+  {504,537,-1.03e-02},
+  {505,505,8.29e-02},
+  {505,185,4.84e-05},
+  {505,186,1.93e-04},
+  {505,192,4.84e-05},
+  {505,215,1.93e-04},
+  {505,216,7.74e-04},
+  {505,221,1.93e-04},
+  {505,247,4.84e-05},
+  {505,248,1.93e-04},
+  {505,249,4.84e-05},
+  {505,474,-1.03e-02},
+  {505,475,-1.03e-02},
+  {505,481,-1.03e-02},
+  {505,504,-1.03e-02},
+  {505,510,-1.03e-02},
+  {505,536,-1.03e-02},
+  {505,537,-1.03e-02},
+  {505,538,-1.03e-02},
+  {506,506,8.29e-02},
+  {506,184,4.84e-05},
+  {506,187,4.84e-05},
+  {506,188,1.93e-04},
+  {506,213,1.93e-04},
+  {506,214,1.93e-04},
+  {506,217,7.74e-04},
+  {506,244,4.84e-05},
+  {506,245,1.93e-04},
+  {506,246,4.84e-05},
+  {506,473,-1.03e-02},
+  {506,476,-1.03e-02},
+  {506,477,-1.03e-02},
+  {506,502,-1.03e-02},
+  {506,503,-1.03e-02},
+  {506,533,-1.03e-02},
+  {506,534,-1.03e-02},
+  {506,535,-1.03e-02},
+  {507,507,8.29e-02},
+  {507,189,4.84e-05},
+  {507,191,1.93e-04},
+  {507,192,4.84e-05},
+  {507,218,7.74e-04},
+  {507,219,1.93e-04},
+  {507,221,1.93e-04},
+  {507,249,4.84e-05},
+  {507,250,1.93e-04},
+  {507,251,4.84e-05},
+  {507,478,-1.03e-02},
+  {507,480,-1.03e-02},
+  {507,481,-1.03e-02},
+  {507,508,-1.03e-02},
+  {507,510,-1.03e-02},
+  {507,538,-1.03e-02},
+  {507,539,-1.03e-02},
+  {507,540,-1.03e-02},
+  {508,508,8.29e-02},
+  {508,189,1.93e-04},
+  {508,190,4.84e-05},
+  {508,191,4.84e-05},
+  {508,218,1.93e-04},
+  {508,219,7.74e-04},
+  {508,220,1.93e-04},
+  {508,250,4.84e-05},
+  {508,251,1.93e-04},
+  {508,252,4.84e-05},
+  {508,478,-1.03e-02},
+  {508,479,-1.03e-02},
+  {508,480,-1.03e-02},
+  {508,507,-1.03e-02},
+  {508,509,-1.03e-02},
+  {508,539,-1.03e-02},
+  {508,540,-1.03e-02},
+  {508,541,-1.03e-02},
+  {509,509,8.29e-02},
+  {509,189,4.84e-05},
+  {509,190,1.93e-04},
+  {509,195,4.84e-05},
+  {509,219,1.93e-04},
+  {509,220,7.74e-04},
+  {509,224,1.93e-04},
+  {509,251,4.84e-05},
+  {509,252,1.93e-04},
+  {509,253,4.84e-05},
+  {509,478,-1.03e-02},
+  {509,479,-1.03e-02},
+  {509,484,-1.03e-02},
+  {509,508,-1.03e-02},
+  {509,513,-1.03e-02},
+  {509,540,-1.03e-02},
+  {509,541,-1.03e-02},
+  {509,542,-1.03e-02},
+  {510,510,8.29e-02},
+  {510,186,4.84e-05},
+  {510,191,4.84e-05},
+  {510,192,1.93e-04},
+  {510,216,1.93e-04},
+  {510,218,1.93e-04},
+  {510,221,7.74e-04},
+  {510,248,4.84e-05},
+  {510,249,1.93e-04},
+  {510,250,4.84e-05},
+  {510,475,-1.03e-02},
+  {510,480,-1.03e-02},
+  {510,481,-1.03e-02},
+  {510,505,-1.03e-02},
+  {510,507,-1.03e-02},
+  {510,537,-1.03e-02},
+  {510,538,-1.03e-02},
+  {510,539,-1.03e-02},
+  {511,511,8.29e-02},
+  {511,193,4.84e-05},
+  {511,194,1.93e-04},
+  {511,195,4.84e-05},
+  {511,222,7.74e-04},
+  {511,223,1.93e-04},
+  {511,224,1.93e-04},
+  {511,253,4.84e-05},
+  {511,254,1.93e-04},
+  {511,255,4.84e-05},
+  {511,482,-1.03e-02},
+  {511,483,-1.03e-02},
+  {511,484,-1.03e-02},
+  {511,512,-1.03e-02},
+  {511,513,-1.03e-02},
+  {511,542,-1.03e-02},
+  {511,543,-1.03e-02},
+  {511,544,-1.03e-02},
+  {512,512,8.29e-02},
+  {512,170,4.84e-05},
+  {512,193,1.93e-04},
+  {512,194,4.84e-05},
+  {512,197,1.93e-04},
+  {512,222,1.93e-04},
+  {512,223,7.74e-04},
+  {512,226,4.84e-05},
+  {512,254,4.84e-05},
+  {512,255,1.93e-04},
+  {512,459,-1.03e-02},
+  {512,482,-1.03e-02},
+  {512,483,-1.03e-02},
+  {512,486,-1.03e-02},
+  {512,511,-1.03e-02},
+  {512,515,-1.03e-02},
+  {512,543,-1.03e-02},
+  {512,544,-1.03e-02},
+  {513,513,8.29e-02},
+  {513,190,4.84e-05},
+  {513,194,4.84e-05},
+  {513,195,1.93e-04},
+  {513,220,1.93e-04},
+  {513,222,1.93e-04},
+  {513,224,7.74e-04},
+  {513,252,4.84e-05},
+  {513,253,1.93e-04},
+  {513,254,4.84e-05},
+  {513,479,-1.03e-02},
+  {513,483,-1.03e-02},
+  {513,484,-1.03e-02},
+  {513,509,-1.03e-02},
+  {513,511,-1.03e-02},
+  {513,541,-1.03e-02},
+  {513,542,-1.03e-02},
+  {513,543,-1.03e-02},
+  {514,514,2.08e-01},
+  {514,196,9.67e-05},
+  {514,198,4.84e-05},
+  {514,225,3.87e-04},
+  {514,227,1.93e-04},
+  {514,256,9.67e-05},
+  {514,259,4.84e-05},
+  {514,485,3.65e-02},
+  {514,487,-1.03e-02},
+  {514,516,-1.03e-02},
+  {514,545,3.65e-02},
+  {514,548,-1.03e-02},
+  {515,515,2.08e-01},
+  {515,197,9.67e-05},
+  {515,223,4.84e-05},
+  {515,226,3.87e-04},
+  {515,255,1.93e-04},
+  {515,258,9.67e-05},
+  {515,288,4.84e-05},
+  {515,486,3.65e-02},
+  {515,512,-1.03e-02},
+  {515,544,-1.03e-02},
+  {515,547,3.65e-02},
+  {515,577,-1.03e-02},
+  {516,516,8.29e-02},
+  {516,196,4.84e-05},
+  {516,198,1.93e-04},
+  {516,199,4.84e-05},
+  {516,225,1.93e-04},
+  {516,227,7.74e-04},
+  {516,228,1.93e-04},
+  {516,256,4.84e-05},
+  {516,259,1.93e-04},
+  {516,260,4.84e-05},
+  {516,485,-1.03e-02},
+  {516,487,-1.03e-02},
+  {516,488,-1.03e-02},
+  {516,514,-1.03e-02},
+  {516,517,-1.03e-02},
+  {516,545,-1.03e-02},
+  {516,548,-1.03e-02},
+  {516,549,-1.03e-02},
+  {517,517,8.29e-02},
+  {517,198,4.84e-05},
+  {517,199,1.93e-04},
+  {517,200,4.84e-05},
+  {517,227,1.93e-04},
+  {517,228,7.74e-04},
+  {517,229,1.93e-04},
+  {517,259,4.84e-05},
+  {517,260,1.93e-04},
+  {517,261,4.84e-05},
+  {517,487,-1.03e-02},
+  {517,488,-1.03e-02},
+  {517,489,-1.03e-02},
+  {517,516,-1.03e-02},
+  {517,518,-1.03e-02},
+  {517,548,-1.03e-02},
+  {517,549,-1.03e-02},
+  {517,550,-1.03e-02},
+  {518,518,8.29e-02},
+  {518,199,4.84e-05},
+  {518,200,1.93e-04},
+  {518,201,4.84e-05},
+  {518,228,1.93e-04},
+  {518,229,7.74e-04},
+  {518,230,1.93e-04},
+  {518,260,4.84e-05},
+  {518,261,1.93e-04},
+  {518,262,4.84e-05},
+  {518,488,-1.03e-02},
+  {518,489,-1.03e-02},
+  {518,490,-1.03e-02},
+  {518,517,-1.03e-02},
+  {518,519,-1.03e-02},
+  {518,549,-1.03e-02},
+  {518,550,-1.03e-02},
+  {518,551,-1.03e-02},
+  {519,519,8.29e-02},
+  {519,200,4.84e-05},
+  {519,201,1.93e-04},
+  {519,202,4.84e-05},
+  {519,229,1.93e-04},
+  {519,230,7.74e-04},
+  {519,231,1.93e-04},
+  {519,261,4.84e-05},
+  {519,262,1.93e-04},
+  {519,263,4.84e-05},
+  {519,489,-1.03e-02},
+  {519,490,-1.03e-02},
+  {519,491,-1.03e-02},
+  {519,518,-1.03e-02},
+  {519,520,-1.03e-02},
+  {519,550,-1.03e-02},
+  {519,551,-1.03e-02},
+  {519,552,-1.03e-02},
+  {520,520,8.29e-02},
+  {520,201,4.84e-05},
+  {520,202,1.93e-04},
+  {520,203,4.84e-05},
+  {520,230,1.93e-04},
+  {520,231,7.74e-04},
+  {520,232,1.93e-04},
+  {520,262,4.84e-05},
+  {520,263,1.93e-04},
+  {520,264,4.84e-05},
+  {520,490,-1.03e-02},
+  {520,491,-1.03e-02},
+  {520,492,-1.03e-02},
+  {520,519,-1.03e-02},
+  {520,521,-1.03e-02},
+  {520,551,-1.03e-02},
+  {520,552,-1.03e-02},
+  {520,553,-1.03e-02},
+  {521,521,8.29e-02},
+  {521,202,4.84e-05},
+  {521,203,1.93e-04},
+  {521,204,4.84e-05},
+  {521,231,1.93e-04},
+  {521,232,7.74e-04},
+  {521,233,1.93e-04},
+  {521,263,4.84e-05},
+  {521,264,1.93e-04},
+  {521,265,4.84e-05},
+  {521,491,-1.03e-02},
+  {521,492,-1.03e-02},
+  {521,493,-1.03e-02},
+  {521,520,-1.03e-02},
+  {521,522,-1.03e-02},
+  {521,552,-1.03e-02},
+  {521,553,-1.03e-02},
+  {521,554,-1.03e-02},
+  {522,522,8.29e-02},
+  {522,203,4.84e-05},
+  {522,204,1.93e-04},
+  {522,205,4.84e-05},
+  {522,232,1.93e-04},
+  {522,233,7.74e-04},
+  {522,234,1.93e-04},
+  {522,264,4.84e-05},
+  {522,265,1.93e-04},
+  {522,266,4.84e-05},
+  {522,492,-1.03e-02},
+  {522,493,-1.03e-02},
+  {522,494,-1.03e-02},
+  {522,521,-1.03e-02},
+  {522,523,-1.03e-02},
+  {522,553,-1.03e-02},
+  {522,554,-1.03e-02},
+  {522,555,-1.03e-02},
+  {523,523,8.29e-02},
+  {523,204,4.84e-05},
+  {523,205,1.93e-04},
+  {523,206,4.84e-05},
+  {523,233,1.93e-04},
+  {523,234,7.74e-04},
+  {523,235,1.93e-04},
+  {523,265,4.84e-05},
+  {523,266,1.93e-04},
+  {523,267,4.84e-05},
+  {523,493,-1.03e-02},
+  {523,494,-1.03e-02},
+  {523,495,-1.03e-02},
+  {523,522,-1.03e-02},
+  {523,524,-1.03e-02},
+  {523,554,-1.03e-02},
+  {523,555,-1.03e-02},
+  {523,556,-1.03e-02},
+  {524,524,8.29e-02},
+  {524,205,4.84e-05},
+  {524,206,1.93e-04},
+  {524,207,4.84e-05},
+  {524,234,1.93e-04},
+  {524,235,7.74e-04},
+  {524,236,1.93e-04},
+  {524,266,4.84e-05},
+  {524,267,1.93e-04},
+  {524,268,4.84e-05},
+  {524,494,-1.03e-02},
+  {524,495,-1.03e-02},
+  {524,496,-1.03e-02},
+  {524,523,-1.03e-02},
+  {524,525,-1.03e-02},
+  {524,555,-1.03e-02},
+  {524,556,-1.03e-02},
+  {524,557,-1.03e-02},
+  {525,525,8.29e-02},
+  {525,206,4.84e-05},
+  {525,207,1.93e-04},
+  {525,208,4.84e-05},
+  {525,235,1.93e-04},
+  {525,236,7.74e-04},
+  {525,237,1.93e-04},
+  {525,267,4.84e-05},
+  {525,268,1.93e-04},
+  {525,269,4.84e-05},
+  {525,495,-1.03e-02},
+  {525,496,-1.03e-02},
+  {525,497,-1.03e-02},
+  {525,524,-1.03e-02},
+  {525,526,-1.03e-02},
+  {525,556,-1.03e-02},
+  {525,557,-1.03e-02},
+  {525,558,-1.03e-02},
+  {526,526,8.29e-02},
+  {526,207,4.84e-05},
+  {526,208,1.93e-04},
+  {526,209,4.84e-05},
+  {526,236,1.93e-04},
+  {526,237,7.74e-04},
+  {526,238,1.93e-04},
+  {526,268,4.84e-05},
+  {526,269,1.93e-04},
+  {526,270,4.84e-05},
+  {526,496,-1.03e-02},
+  {526,497,-1.03e-02},
+  {526,498,-1.03e-02},
+  {526,525,-1.03e-02},
+  {526,527,-1.03e-02},
+  {526,557,-1.03e-02},
+  {526,558,-1.03e-02},
+  {526,559,-1.03e-02},
+  {527,527,8.29e-02},
+  {527,208,4.84e-05},
+  {527,209,1.93e-04},
+  {527,210,4.84e-05},
+  {527,237,1.93e-04},
+  {527,238,7.74e-04},
+  {527,239,1.93e-04},
+  {527,269,4.84e-05},
+  {527,270,1.93e-04},
+  {527,271,4.84e-05},
+  {527,497,-1.03e-02},
+  {527,498,-1.03e-02},
+  {527,499,-1.03e-02},
+  {527,526,-1.03e-02},
+  {527,528,-1.03e-02},
+  {527,558,-1.03e-02},
+  {527,559,-1.03e-02},
+  {527,560,-1.03e-02},
+  {528,528,8.29e-02},
+  {528,209,4.84e-05},
+  {528,210,1.93e-04},
+  {528,211,4.84e-05},
+  {528,238,1.93e-04},
+  {528,239,7.74e-04},
+  {528,240,1.93e-04},
+  {528,270,4.84e-05},
+  {528,271,1.93e-04},
+  {528,272,4.84e-05},
+  {528,498,-1.03e-02},
+  {528,499,-1.03e-02},
+  {528,500,-1.03e-02},
+  {528,527,-1.03e-02},
+  {528,529,-1.03e-02},
+  {528,559,-1.03e-02},
+  {528,560,-1.03e-02},
+  {528,561,-1.03e-02},
+  {529,529,8.29e-02},
+  {529,210,4.84e-05},
+  {529,211,1.93e-04},
+  {529,239,1.93e-04},
+  {529,240,7.74e-04},
+  {529,241,1.93e-04},
+  {529,242,4.84e-05},
+  {529,271,4.84e-05},
+  {529,272,1.93e-04},
+  {529,273,4.84e-05},
+  {529,499,-1.03e-02},
+  {529,500,-1.03e-02},
+  {529,528,-1.03e-02},
+  {529,530,-1.03e-02},
+  {529,531,-1.03e-02},
+  {529,560,-1.03e-02},
+  {529,561,-1.03e-02},
+  {529,562,-1.03e-02},
+  {530,530,8.29e-02},
+  {530,211,4.84e-05},
+  {530,240,1.93e-04},
+  {530,241,7.74e-04},
+  {530,242,1.93e-04},
+  {530,257,4.84e-05},
+  {530,272,4.84e-05},
+  {530,273,1.93e-04},
+  {530,274,1.93e-04},
+  {530,275,4.84e-05},
+  {530,500,-1.03e-02},
+  {530,529,-1.03e-02},
+  {530,531,-1.03e-02},
+  {530,546,-1.03e-02},
+  {530,561,-1.03e-02},
+  {530,562,-1.03e-02},
+  {530,563,-1.03e-02},
+  {530,564,-1.03e-02},
+  {531,531,8.29e-02},
+  {531,211,1.93e-04},
+  {531,212,4.84e-05},
+  {531,240,4.84e-05},
+  {531,241,1.93e-04},
+  {531,242,7.74e-04},
+  {531,243,1.93e-04},
+  {531,274,4.84e-05},
+  {531,275,1.93e-04},
+  {531,276,4.84e-05},
+  {531,500,-1.03e-02},
+  {531,501,-1.03e-02},
+  {531,529,-1.03e-02},
+  {531,530,-1.03e-02},
+  {531,532,-1.03e-02},
+  {531,563,-1.03e-02},
+  {531,564,-1.03e-02},
+  {531,565,-1.03e-02},
+  {532,532,8.29e-02},
+  {532,211,4.84e-05},
+  {532,212,1.93e-04},
+  {532,213,4.84e-05},
+  {532,242,1.93e-04},
+  {532,243,7.74e-04},
+  {532,244,1.93e-04},
+  {532,275,4.84e-05},
+  {532,276,1.93e-04},
+  {532,277,4.84e-05},
+  {532,500,-1.03e-02},
+  {532,501,-1.03e-02},
+  {532,502,-1.03e-02},
+  {532,531,-1.03e-02},
+  {532,533,-1.03e-02},
+  {532,564,-1.03e-02},
+  {532,565,-1.03e-02},
+  {532,566,-1.03e-02},
+  {533,533,8.29e-02},
+  {533,212,4.84e-05},
+  {533,213,1.93e-04},
+  {533,217,4.84e-05},
+  {533,243,1.93e-04},
+  {533,244,7.74e-04},
+  {533,245,1.93e-04},
+  {533,276,4.84e-05},
+  {533,277,1.93e-04},
+  {533,278,4.84e-05},
+  {533,501,-1.03e-02},
+  {533,502,-1.03e-02},
+  {533,506,-1.03e-02},
+  {533,532,-1.03e-02},
+  {533,534,-1.03e-02},
+  {533,565,-1.03e-02},
+  {533,566,-1.03e-02},
+  {533,567,-1.03e-02},
+  {534,534,8.29e-02},
+  {534,213,4.84e-05},
+  {534,214,4.84e-05},
+  {534,217,1.93e-04},
+  {534,244,1.93e-04},
+  {534,245,7.74e-04},
+  {534,246,1.93e-04},
+  {534,277,4.84e-05},
+  {534,278,1.93e-04},
+  {534,279,4.84e-05},
+  {534,502,-1.03e-02},
+  {534,503,-1.03e-02},
+  {534,506,-1.03e-02},
+  {534,533,-1.03e-02},
+  {534,535,-1.03e-02},
+  {534,566,-1.03e-02},
+  {534,567,-1.03e-02},
+  {534,568,-1.03e-02},
+  {535,535,8.29e-02},
+  {535,214,1.93e-04},
+  {535,215,4.84e-05},
+  {535,217,4.84e-05},
+  {535,245,1.93e-04},
+  {535,246,7.74e-04},
+  {535,247,1.93e-04},
+  {535,278,4.84e-05},
+  {535,279,1.93e-04},
+  {535,280,4.84e-05},
+  {535,503,-1.03e-02},
+  {535,504,-1.03e-02},
+  {535,506,-1.03e-02},
+  {535,534,-1.03e-02},
+  {535,536,-1.03e-02},
+  {535,567,-1.03e-02},
+  {535,568,-1.03e-02},
+  {535,569,-1.03e-02},
+  {536,536,8.29e-02},
+  {536,214,4.84e-05},
+  {536,215,1.93e-04},
+  {536,216,4.84e-05},
+  {536,246,1.93e-04},
+  {536,247,7.74e-04},
+  {536,248,1.93e-04},
+  {536,279,4.84e-05},
+  {536,280,1.93e-04},
+  {536,281,4.84e-05},
+  {536,503,-1.03e-02},
+  {536,504,-1.03e-02},
+  {536,505,-1.03e-02},
+  {536,535,-1.03e-02},
+  {536,537,-1.03e-02},
+  {536,568,-1.03e-02},
+  {536,569,-1.03e-02},
+  {536,570,-1.03e-02},
+  {537,537,8.29e-02},
+  {537,215,4.84e-05},
+  {537,216,1.93e-04},
+  {537,221,4.84e-05},
+  {537,247,1.93e-04},
+  {537,248,7.74e-04},
+  {537,249,1.93e-04},
+  {537,280,4.84e-05},
+  {537,281,1.93e-04},
+  {537,282,4.84e-05},
+  {537,504,-1.03e-02},
+  {537,505,-1.03e-02},
+  {537,510,-1.03e-02},
+  {537,536,-1.03e-02},
+  {537,538,-1.03e-02},
+  {537,569,-1.03e-02},
+  {537,570,-1.03e-02},
+  {537,571,-1.03e-02},
+  {538,538,8.29e-02},
+  {538,216,4.84e-05},
+  {538,218,4.84e-05},
+  {538,221,1.93e-04},
+  {538,248,1.93e-04},
+  {538,249,7.74e-04},
+  {538,250,1.93e-04},
+  {538,281,4.84e-05},
+  {538,282,1.93e-04},
+  {538,283,4.84e-05},
+  {538,505,-1.03e-02},
+  {538,507,-1.03e-02},
+  {538,510,-1.03e-02},
+  {538,537,-1.03e-02},
+  {538,539,-1.03e-02},
+  {538,570,-1.03e-02},
+  {538,571,-1.03e-02},
+  {538,572,-1.03e-02},
+  {539,539,8.29e-02},
+  {539,218,1.93e-04},
+  {539,219,4.84e-05},
+  {539,221,4.84e-05},
+  {539,249,1.93e-04},
+  {539,250,7.74e-04},
+  {539,251,1.93e-04},
+  {539,282,4.84e-05},
+  {539,283,1.93e-04},
+  {539,284,4.84e-05},
+  {539,507,-1.03e-02},
+  {539,508,-1.03e-02},
+  {539,510,-1.03e-02},
+  {539,538,-1.03e-02},
+  {539,540,-1.03e-02},
+  {539,571,-1.03e-02},
+  {539,572,-1.03e-02},
+  {539,573,-1.03e-02},
+  {540,540,8.29e-02},
+  {540,218,4.84e-05},
+  {540,219,1.93e-04},
+  {540,220,4.84e-05},
+  {540,250,1.93e-04},
+  {540,251,7.74e-04},
+  {540,252,1.93e-04},
+  {540,283,4.84e-05},
+  {540,284,1.93e-04},
+  {540,285,4.84e-05},
+  {540,507,-1.03e-02},
+  {540,508,-1.03e-02},
+  {540,509,-1.03e-02},
+  {540,539,-1.03e-02},
+  {540,541,-1.03e-02},
+  {540,572,-1.03e-02},
+  {540,573,-1.03e-02},
+  {540,574,-1.03e-02},
+  {541,541,8.29e-02},
+  {541,219,4.84e-05},
+  {541,220,1.93e-04},
+  {541,224,4.84e-05},
+  {541,251,1.93e-04},
+  {541,252,7.74e-04},
+  {541,253,1.93e-04},
+  {541,284,4.84e-05},
+  {541,285,1.93e-04},
+  {541,286,4.84e-05},
+  {541,508,-1.03e-02},
+  {541,509,-1.03e-02},
+  {541,513,-1.03e-02},
+  {541,540,-1.03e-02},
+  {541,542,-1.03e-02},
+  {541,573,-1.03e-02},
+  {541,574,-1.03e-02},
+  {541,575,-1.03e-02},
+  {542,542,8.29e-02},
+  {542,220,4.84e-05},
+  {542,222,4.84e-05},
+  {542,224,1.93e-04},
+  {542,252,1.93e-04},
+  {542,253,7.74e-04},
+  {542,254,1.93e-04},
+  {542,285,4.84e-05},
+  {542,286,1.93e-04},
+  {542,287,4.84e-05},
+  {542,509,-1.03e-02},
+  {542,511,-1.03e-02},
+  {542,513,-1.03e-02},
+  {542,541,-1.03e-02},
+  {542,543,-1.03e-02},
+  {542,574,-1.03e-02},
+  {542,575,-1.03e-02},
+  {542,576,-1.03e-02},
+  {543,543,8.29e-02},
+  {543,222,1.93e-04},
+  {543,223,4.84e-05},
+  {543,224,4.84e-05},
+  {543,253,1.93e-04},
+  {543,254,7.74e-04},
+  {543,255,1.93e-04},
+  {543,286,4.84e-05},
+  {543,287,1.93e-04},
+  {543,288,4.84e-05},
+  {543,511,-1.03e-02},
+  {543,512,-1.03e-02},
+  {543,513,-1.03e-02},
+  {543,542,-1.03e-02},
+  {543,544,-1.03e-02},
+  {543,575,-1.03e-02},
+  {543,576,-1.03e-02},
+  {543,577,-1.03e-02},
+  {544,544,8.29e-02},
+  {544,197,4.84e-05},
+  {544,222,4.84e-05},
+  {544,223,1.93e-04},
+  {544,226,1.93e-04},
+  {544,254,1.93e-04},
+  {544,255,7.74e-04},
+  {544,258,4.84e-05},
+  {544,287,4.84e-05},
+  {544,288,1.93e-04},
+  {544,486,-1.03e-02},
+  {544,511,-1.03e-02},
+  {544,512,-1.03e-02},
+  {544,515,-1.03e-02},
+  {544,543,-1.03e-02},
+  {544,547,-1.03e-02},
+  {544,576,-1.03e-02},
+  {544,577,-1.03e-02},
+  {545,545,1.87e-01},
+  {545,225,9.67e-05},
+  {545,227,4.84e-05},
+  {545,256,1.93e-04},
+  {545,259,9.67e-05},
+  {545,514,3.65e-02},
+  {545,516,-1.03e-02},
+  {545,548,3.65e-02},
+  {546,546,1.87e-01},
+  {546,241,4.84e-05},
+  {546,257,1.93e-04},
+  {546,273,9.67e-05},
+  {546,274,9.67e-05},
+  {546,530,-1.03e-02},
+  {546,562,3.65e-02},
+  {546,563,3.65e-02},
+  {547,547,1.87e-01},
+  {547,226,9.67e-05},
+  {547,255,4.84e-05},
+  {547,258,1.93e-04},
+  {547,288,9.67e-05},
+  {547,515,3.65e-02},
+  {547,544,-1.03e-02},
+  {547,577,3.65e-02},
+  {548,548,2.08e-01},
+  {548,225,4.84e-05},
+  {548,227,1.93e-04},
+  {548,228,4.84e-05},
+  {548,256,9.67e-05},
+  {548,259,3.87e-04},
+  {548,260,9.67e-05},
+  {548,514,-1.03e-02},
+  {548,516,-1.03e-02},
+  {548,517,-1.03e-02},
+  {548,545,3.65e-02},
+  {548,549,3.65e-02},
+  {549,549,2.08e-01},
+  {549,227,4.84e-05},
+  {549,228,1.93e-04},
+  {549,229,4.84e-05},
+  {549,259,9.67e-05},
+  {549,260,3.87e-04},
+  {549,261,9.67e-05},
+  {549,516,-1.03e-02},
+  {549,517,-1.03e-02},
+  {549,518,-1.03e-02},
+  {549,548,3.65e-02},
+  {549,550,3.65e-02},
+  {550,550,2.08e-01},
+  {550,228,4.84e-05},
+  {550,229,1.93e-04},
+  {550,230,4.84e-05},
+  {550,260,9.67e-05},
+  {550,261,3.87e-04},
+  {550,262,9.67e-05},
+  {550,517,-1.03e-02},
+  {550,518,-1.03e-02},
+  {550,519,-1.03e-02},
+  {550,549,3.65e-02},
+  {550,551,3.65e-02},
+  {551,551,2.08e-01},
+  {551,229,4.84e-05},
+  {551,230,1.93e-04},
+  {551,231,4.84e-05},
+  {551,261,9.67e-05},
+  {551,262,3.87e-04},
+  {551,263,9.67e-05},
+  {551,518,-1.03e-02},
+  {551,519,-1.03e-02},
+  {551,520,-1.03e-02},
+  {551,550,3.65e-02},
+  {551,552,3.65e-02},
+  {552,552,2.08e-01},
+  {552,230,4.84e-05},
+  {552,231,1.93e-04},
+  {552,232,4.84e-05},
+  {552,262,9.67e-05},
+  {552,263,3.87e-04},
+  {552,264,9.67e-05},
+  {552,519,-1.03e-02},
+  {552,520,-1.03e-02},
+  {552,521,-1.03e-02},
+  {552,551,3.65e-02},
+  {552,553,3.65e-02},
+  {553,553,2.08e-01},
+  {553,231,4.84e-05},
+  {553,232,1.93e-04},
+  {553,233,4.84e-05},
+  {553,263,9.67e-05},
+  {553,264,3.87e-04},
+  {553,265,9.67e-05},
+  {553,520,-1.03e-02},
+  {553,521,-1.03e-02},
+  {553,522,-1.03e-02},
+  {553,552,3.65e-02},
+  {553,554,3.65e-02},
+  {554,554,2.08e-01},
+  {554,232,4.84e-05},
+  {554,233,1.93e-04},
+  {554,234,4.84e-05},
+  {554,264,9.67e-05},
+  {554,265,3.87e-04},
+  {554,266,9.67e-05},
+  {554,521,-1.03e-02},
+  {554,522,-1.03e-02},
+  {554,523,-1.03e-02},
+  {554,553,3.65e-02},
+  {554,555,3.65e-02},
+  {555,555,2.08e-01},
+  {555,233,4.84e-05},
+  {555,234,1.93e-04},
+  {555,235,4.84e-05},
+  {555,265,9.67e-05},
+  {555,266,3.87e-04},
+  {555,267,9.67e-05},
+  {555,522,-1.03e-02},
+  {555,523,-1.03e-02},
+  {555,524,-1.03e-02},
+  {555,554,3.65e-02},
+  {555,556,3.65e-02},
+  {556,556,2.08e-01},
+  {556,234,4.84e-05},
+  {556,235,1.93e-04},
+  {556,236,4.84e-05},
+  {556,266,9.67e-05},
+  {556,267,3.87e-04},
+  {556,268,9.67e-05},
+  {556,523,-1.03e-02},
+  {556,524,-1.03e-02},
+  {556,525,-1.03e-02},
+  {556,555,3.65e-02},
+  {556,557,3.65e-02},
+  {557,557,2.08e-01},
+  {557,235,4.84e-05},
+  {557,236,1.93e-04},
+  {557,237,4.84e-05},
+  {557,267,9.67e-05},
+  {557,268,3.87e-04},
+  {557,269,9.67e-05},
+  {557,524,-1.03e-02},
+  {557,525,-1.03e-02},
+  {557,526,-1.03e-02},
+  {557,556,3.65e-02},
+  {557,558,3.65e-02},
+  {558,558,2.08e-01},
+  {558,236,4.84e-05},
+  {558,237,1.93e-04},
+  {558,238,4.84e-05},
+  {558,268,9.67e-05},
+  {558,269,3.87e-04},
+  {558,270,9.67e-05},
+  {558,525,-1.03e-02},
+  {558,526,-1.03e-02},
+  {558,527,-1.03e-02},
+  {558,557,3.65e-02},
+  {558,559,3.65e-02},
+  {559,559,2.08e-01},
+  {559,237,4.84e-05},
+  {559,238,1.93e-04},
+  {559,239,4.84e-05},
+  {559,269,9.67e-05},
+  {559,270,3.87e-04},
+  {559,271,9.67e-05},
+  {559,526,-1.03e-02},
+  {559,527,-1.03e-02},
+  {559,528,-1.03e-02},
+  {559,558,3.65e-02},
+  {559,560,3.65e-02},
+  {560,560,2.08e-01},
+  {560,238,4.84e-05},
+  {560,239,1.93e-04},
+  {560,240,4.84e-05},
+  {560,270,9.67e-05},
+  {560,271,3.87e-04},
+  {560,272,9.67e-05},
+  {560,527,-1.03e-02},
+  {560,528,-1.03e-02},
+  {560,529,-1.03e-02},
+  {560,559,3.65e-02},
+  {560,561,3.65e-02},
+  {561,561,2.08e-01},
+  {561,239,4.84e-05},
+  {561,240,1.93e-04},
+  {561,241,4.84e-05},
+  {561,271,9.67e-05},
+  {561,272,3.87e-04},
+  {561,273,9.67e-05},
+  {561,528,-1.03e-02},
+  {561,529,-1.03e-02},
+  {561,530,-1.03e-02},
+  {561,560,3.65e-02},
+  {561,562,3.65e-02},
+  {562,562,2.08e-01},
+  {562,240,4.84e-05},
+  {562,241,1.93e-04},
+  {562,257,9.67e-05},
+  {562,272,9.67e-05},
+  {562,273,3.87e-04},
+  {562,274,4.84e-05},
+  {562,529,-1.03e-02},
+  {562,530,-1.03e-02},
+  {562,546,3.65e-02},
+  {562,561,3.65e-02},
+  {562,563,-1.03e-02},
+  {563,563,2.08e-01},
+  {563,241,1.93e-04},
+  {563,242,4.84e-05},
+  {563,257,9.67e-05},
+  {563,273,4.84e-05},
+  {563,274,3.87e-04},
+  {563,275,9.67e-05},
+  {563,530,-1.03e-02},
+  {563,531,-1.03e-02},
+  {563,546,3.65e-02},
+  {563,562,-1.03e-02},
+  {563,564,3.65e-02},
+  {564,564,2.08e-01},
+  {564,241,4.84e-05},
+  {564,242,1.93e-04},
+  {564,243,4.84e-05},
+  {564,274,9.67e-05},
+  {564,275,3.87e-04},
+  {564,276,9.67e-05},
+  {564,530,-1.03e-02},
+  {564,531,-1.03e-02},
+  {564,532,-1.03e-02},
+  {564,563,3.65e-02},
+  {564,565,3.65e-02},
+  {565,565,2.08e-01},
+  {565,242,4.84e-05},
+  {565,243,1.93e-04},
+  {565,244,4.84e-05},
+  {565,275,9.67e-05},
+  {565,276,3.87e-04},
+  {565,277,9.67e-05},
+  {565,531,-1.03e-02},
+  {565,532,-1.03e-02},
+  {565,533,-1.03e-02},
+  {565,564,3.65e-02},
+  {565,566,3.65e-02},
+  {566,566,2.08e-01},
+  {566,243,4.84e-05},
+  {566,244,1.93e-04},
+  {566,245,4.84e-05},
+  {566,276,9.67e-05},
+  {566,277,3.87e-04},
+  {566,278,9.67e-05},
+  {566,532,-1.03e-02},
+  {566,533,-1.03e-02},
+  {566,534,-1.03e-02},
+  {566,565,3.65e-02},
+  {566,567,3.65e-02},
+  {567,567,2.08e-01},
+  {567,244,4.84e-05},
+  {567,245,1.93e-04},
+  {567,246,4.84e-05},
+  {567,277,9.67e-05},
+  {567,278,3.87e-04},
+  {567,279,9.67e-05},
+  {567,533,-1.03e-02},
+  {567,534,-1.03e-02},
+  {567,535,-1.03e-02},
+  {567,566,3.65e-02},
+  {567,568,3.65e-02},
+  {568,568,2.08e-01},
+  {568,245,4.84e-05},
+  {568,246,1.93e-04},
+  {568,247,4.84e-05},
+  {568,278,9.67e-05},
+  {568,279,3.87e-04},
+  {568,280,9.67e-05},
+  {568,534,-1.03e-02},
+  {568,535,-1.03e-02},
+  {568,536,-1.03e-02},
+  {568,567,3.65e-02},
+  {568,569,3.65e-02},
+  {569,569,2.08e-01},
+  {569,246,4.84e-05},
+  {569,247,1.93e-04},
+  {569,248,4.84e-05},
+  {569,279,9.67e-05},
+  {569,280,3.87e-04},
+  {569,281,9.67e-05},
+  {569,535,-1.03e-02},
+  {569,536,-1.03e-02},
+  {569,537,-1.03e-02},
+  {569,568,3.65e-02},
+  {569,570,3.65e-02},
+  {570,570,2.08e-01},
+  {570,247,4.84e-05},
+  {570,248,1.93e-04},
+  {570,249,4.84e-05},
+  {570,280,9.67e-05},
+  {570,281,3.87e-04},
+  {570,282,9.67e-05},
+  {570,536,-1.03e-02},
+  {570,537,-1.03e-02},
+  {570,538,-1.03e-02},
+  {570,569,3.65e-02},
+  {570,571,3.65e-02},
+  {571,571,2.08e-01},
+  {571,248,4.84e-05},
+  {571,249,1.93e-04},
+  {571,250,4.84e-05},
+  {571,281,9.67e-05},
+  {571,282,3.87e-04},
+  {571,283,9.67e-05},
+  {571,537,-1.03e-02},
+  {571,538,-1.03e-02},
+  {571,539,-1.03e-02},
+  {571,570,3.65e-02},
+  {571,572,3.65e-02},
+  {572,572,2.08e-01},
+  {572,249,4.84e-05},
+  {572,250,1.93e-04},
+  {572,251,4.84e-05},
+  {572,282,9.67e-05},
+  {572,283,3.87e-04},
+  {572,284,9.67e-05},
+  {572,538,-1.03e-02},
+  {572,539,-1.03e-02},
+  {572,540,-1.03e-02},
+  {572,571,3.65e-02},
+  {572,573,3.65e-02},
+  {573,573,2.08e-01},
+  {573,250,4.84e-05},
+  {573,251,1.93e-04},
+  {573,252,4.84e-05},
+  {573,283,9.67e-05},
+  {573,284,3.87e-04},
+  {573,285,9.67e-05},
+  {573,539,-1.03e-02},
+  {573,540,-1.03e-02},
+  {573,541,-1.03e-02},
+  {573,572,3.65e-02},
+  {573,574,3.65e-02},
+  {574,574,2.08e-01},
+  {574,251,4.84e-05},
+  {574,252,1.93e-04},
+  {574,253,4.84e-05},
+  {574,284,9.67e-05},
+  {574,285,3.87e-04},
+  {574,286,9.67e-05},
+  {574,540,-1.03e-02},
+  {574,541,-1.03e-02},
+  {574,542,-1.03e-02},
+  {574,573,3.65e-02},
+  {574,575,3.65e-02},
+  {575,575,2.08e-01},
+  {575,252,4.84e-05},
+  {575,253,1.93e-04},
+  {575,254,4.84e-05},
+  {575,285,9.67e-05},
+  {575,286,3.87e-04},
+  {575,287,9.67e-05},
+  {575,541,-1.03e-02},
+  {575,542,-1.03e-02},
+  {575,543,-1.03e-02},
+  {575,574,3.65e-02},
+  {575,576,3.65e-02},
+  {576,576,2.08e-01},
+  {576,253,4.84e-05},
+  {576,254,1.93e-04},
+  {576,255,4.84e-05},
+  {576,286,9.67e-05},
+  {576,287,3.87e-04},
+  {576,288,9.67e-05},
+  {576,542,-1.03e-02},
+  {576,543,-1.03e-02},
+  {576,544,-1.03e-02},
+  {576,575,3.65e-02},
+  {576,577,3.65e-02},
+  {577,577,2.08e-01},
+  {577,226,4.84e-05},
+  {577,254,4.84e-05},
+  {577,255,1.93e-04},
+  {577,258,9.67e-05},
+  {577,287,9.67e-05},
+  {577,288,3.87e-04},
+  {577,515,-1.03e-02},
+  {577,543,-1.03e-02},
+  {577,544,-1.03e-02},
+  {577,547,3.65e-02},
+  {577,576,3.65e-02}
+};
 const unsigned int n_entries = sizeof(entries)/sizeof(entries[0]);
 
 void test ()
 {
   const unsigned int N = 578;
-  
+
   SparsityPattern sp (N,N, 30);
   for (unsigned int i=0; i<n_entries; ++i)
     sp.add (entries[i].row, entries[i].col);
@@ -9661,18 +9662,18 @@ void test ()
   for (unsigned int i=0; i<n_entries; ++i)
     sm.set (entries[i].row, entries[i].col, entries[i].val);
 
-                                   // solve for a unit right hand side vector
-                                   // with BiCGStab
+  // solve for a unit right hand side vector
+  // with BiCGStab
   Vector<double> rhs(N);
   rhs(0) = 1;
   {
     const double tolerance = 1e-8;
-    
+
     typedef SolverBicgstab<> Solver;
     SolverControl           solver_control (N, tolerance);
     PrimitiveVectorMemory<> vector_memory;
     Solver                  solver (solver_control, vector_memory);
-    
+
     PreconditionSSOR<SparseMatrix<double> > preconditioner;
     preconditioner.initialize (sm, 1.2);
 
@@ -9685,15 +9686,15 @@ void test ()
     sm.residual (tmp, solution, rhs);
     deallog << "Residual: " << tmp.l2_norm() << std::endl;
 
-                                     // we should be at least under the given
-                                     // residual limit
+    // we should be at least under the given
+    // residual limit
     Assert (tmp.l2_norm() < tolerance, ExcInternalError());
   }
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("solver_01/output");
   deallog.attach(logfile);
index d3e3c190db3e3b67d08ecd41ae8a90a9ebae562b..e3ff8738673b62ef12a737e779e152f505ba9cd0 100644 (file)
@@ -29,9 +29,9 @@
 #include <deal.II/lac/sparse_ilu.h>
 #include <fstream>
 
-  
 
-int main () 
+
+int main ()
 {
   std::ofstream logfile("sparse_lu_decomposition_1/output");
   deallog.attach(logfile);
@@ -41,7 +41,7 @@ int main ()
   SmartPointer<SparseLUDecomposition<double> > sparse_decomp;
 
   deallog << "OK" << std::endl;
-  
+
   return 0;
 }
 
index 5877dae33ab4d7571de635df366ee3a9a158b696..0b27a2685d64483b1f785daa346f6b926e311f15 100644 (file)
@@ -20,7 +20,7 @@
 // SparseMatrix::set()
 
 #include "../tests.h"
-#include <deal.II/lac/sparse_matrix.h>    
+#include <deal.II/lac/sparse_matrix.h>
 #include <fstream>
 #include <iomanip>
 
@@ -35,14 +35,14 @@ void test ()
   sp.compress ();
 
   SparseMatrix<double> m(sp);
-  
-                                   // first set a few entries
+
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
 
-                                   // then make sure we retrieve the same ones
+  // then make sure we retrieve the same ones
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -74,25 +74,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 90c763763adc40bc7f2b90b3b52b17e83db3a925..ecfc518ba5f7291b7dedf60fdaa9b94583e6fce8 100644 (file)
@@ -22,7 +22,7 @@
 // since sometime in the first half of 2010).
 
 #include "../tests.h"
-#include <deal.II/lac/sparse_matrix.h>    
+#include <deal.II/lac/sparse_matrix.h>
 #include <fstream>
 #include <iomanip>
 
@@ -37,14 +37,14 @@ void test ()
   sp.compress ();
 
   SparseMatrix<double> m(sp);
-  
-                                   // first set a few entries
+
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
 
-                                   // then make sure we retrieve the same ones
+  // then make sure we retrieve the same ones
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -76,25 +76,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 65407c8fa44016c62582cf0cbba28ca457f90251..21da53929074caa586f2acf36d0c037ac5913ddf 100644 (file)
@@ -20,7 +20,7 @@
 // SparseMatrix::add()
 
 #include "../tests.h"
-#include <deal.II/lac/sparse_matrix.h>    
+#include <deal.II/lac/sparse_matrix.h>
 #include <fstream>
 
 
@@ -35,13 +35,13 @@ void test ()
 
   SparseMatrix<double> m(sp);
 
-                                   // first set a few entries
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.add (i,j, i*j*.5+.5);
 
-                                   // then make sure we retrieve the same ones
+  // then make sure we retrieve the same ones
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -73,25 +73,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index ab49dfebfd2f63654ece40477faf54bac17ac913..c14f100b8415e2eb848785f49d16ec1a50ff6d61 100644 (file)
@@ -22,7 +22,7 @@
 // problem with the deal.II matrices. worth checking anyway
 
 #include "../tests.h"
-#include <deal.II/lac/sparse_matrix.h>    
+#include <deal.II/lac/sparse_matrix.h>
 #include <fstream>
 
 
@@ -36,8 +36,8 @@ void test ()
   sp.compress ();
 
   SparseMatrix<double> m(sp);
-  
-                                   // first set a few entries
+
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -47,8 +47,8 @@ void test ()
           else
             m.add (i,j, i*j*.5+.5);
         }
-  
-                                   // then make sure we retrieve the same ones
+
+  // then make sure we retrieve the same ones
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -80,25 +80,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index ac7db5cac910232a1e40627c9964b8e785b332e0..99a590c43a2e090af1689c4d3e44bdbd6c852423 100644 (file)
@@ -25,7 +25,7 @@
 // get double the original value
 
 #include "../tests.h"
-#include <deal.II/lac/sparse_matrix.h>    
+#include <deal.II/lac/sparse_matrix.h>
 #include <fstream>
 
 
@@ -39,20 +39,20 @@ void test ()
   sp.compress ();
 
   SparseMatrix<double> m(sp);
-  
-                                   // first set a few entries
+
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
-                                   // then add the same elements again
+  // then add the same elements again
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.add (i,j, i*j*.5+.5);
-  
-                                   // then make sure we retrieve the correct
-                                   // ones
+
+  // then make sure we retrieve the correct
+  // ones
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -84,25 +84,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 389173be68576b4361e0bbf53671d70a25051c6e..48bf654efc25d5bb1ba617759c6e8db10494c17c 100644 (file)
@@ -25,7 +25,7 @@
 // get double the original value
 
 #include "../tests.h"
-#include <deal.II/lac/sparse_matrix.h>    
+#include <deal.II/lac/sparse_matrix.h>
 #include <fstream>
 
 
@@ -39,20 +39,20 @@ void test ()
   sp.compress ();
 
   SparseMatrix<double> m(sp);
-  
-                                   // first set a few entries
+
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
-                                   // then add the same elements again
+  // then add the same elements again
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.add (i,j, i*j*.5+.5);
-  
-                                   // then make sure we retrieve the correct
-                                   // ones
+
+  // then make sure we retrieve the correct
+  // ones
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -84,25 +84,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 8812805362cc3a47f59b0ffaade165a4624625ae..bcf1a0f1ad7a2b3a6985cead655fb8c37459bb42 100644 (file)
@@ -19,7 +19,7 @@
 // check querying matrix sizes
 
 #include "../tests.h"
-#include <deal.II/lac/sparse_matrix.h>    
+#include <deal.II/lac/sparse_matrix.h>
 #include <fstream>
 
 
@@ -33,7 +33,7 @@ void test ()
   sp.compress ();
 
   SparseMatrix<double> m(sp);
-  
+
   Assert (m.m() == 5, ExcInternalError());
   Assert (m.n() == 5, ExcInternalError());
 
@@ -56,25 +56,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index ab2aeab1cb4e6b1d45f81aea65a2ad055decfebd..4fdfbf38c390c5995a98b023e65e7a93aa061ca9 100644 (file)
@@ -20,7 +20,7 @@
 // SparseMatrix
 
 #include "../tests.h"
-#include <deal.II/lac/sparse_matrix.h>    
+#include <deal.II/lac/sparse_matrix.h>
 #include <fstream>
 
 
@@ -34,13 +34,13 @@ void test ()
   sp.compress ();
 
   SparseMatrix<double> m(sp);
-  
-                                   // first set a few entries. count how many
-                                   // entries we have. note that for square
-                                   // matrices we also always store the
-                                   // diagonal element, so add one per row,
-                                   // but don't count it when traversing the
-                                   // row
+
+  // first set a few entries. count how many
+  // entries we have. note that for square
+  // matrices we also always store the
+  // diagonal element, so add one per row,
+  // but don't count it when traversing the
+  // row
   unsigned int counter = 0;
   for (unsigned int i=0; i<m.m(); ++i)
     {
@@ -57,7 +57,7 @@ void test ()
   deallog << m.n_nonzero_elements() << std::endl;
   Assert (m.n_nonzero_elements() == counter,
           ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -77,25 +77,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 53cecf5afaf0dd54f84540812df032e0712a6ff9..67ee7d6f7e3a29bcf112ddfbf9cf1843e2e9a953 100644 (file)
@@ -35,10 +35,10 @@ void test ()
 
   SparseMatrix<double> m(sp);
 
-                                   // first set a few entries. count how many
-                                   // entries we have. note that for square
-                                   // matrices we also always store the
-                                   // diagonal element
+  // first set a few entries. count how many
+  // entries we have. note that for square
+  // matrices we also always store the
+  // diagonal element
   unsigned int counter = 0;
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
@@ -71,25 +71,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index c04e4d30ddf47c30d2791c2abea6e9c6ead3b168..5cff3d519dd92bfe5076b6eb3b7cc12f980ebd36 100644 (file)
@@ -19,7 +19,7 @@
 // check SparseMatrix::l1_norm
 
 #include "../tests.h"
-#include <deal.II/lac/sparse_matrix.h>    
+#include <deal.II/lac/sparse_matrix.h>
 #include <fstream>
 
 
@@ -33,19 +33,19 @@ void test ()
   sp.compress ();
 
   SparseMatrix<double> m(sp);
-  
-                                   // first set a few entries. count how many
-                                   // entries we have
+
+  // first set a few entries. count how many
+  // entries we have
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
-        m.set (i,j, i*j*.5+.5);  
+        m.set (i,j, i*j*.5+.5);
 
-                                   // compare against the exact value of the
-                                   // l1-norm (max col-sum)
+  // compare against the exact value of the
+  // l1-norm (max col-sum)
   deallog << m.l1_norm() << std::endl;
   Assert (m.l1_norm() == 7, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -65,25 +65,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 635de18b7a5fb8bb9ca675fe5b6cc0466a60ccad..6f8b8c51f8239285bcbc969409da5b444d304bce 100644 (file)
@@ -19,7 +19,7 @@
 // check SparseMatrix::linfty_norm
 
 #include "../tests.h"
-#include <deal.II/lac/sparse_matrix.h>    
+#include <deal.II/lac/sparse_matrix.h>
 #include <fstream>
 
 
@@ -33,19 +33,19 @@ void test ()
   sp.compress ();
 
   SparseMatrix<double> m(sp);
-  
-                                   // first set a few entries. count how many
-                                   // entries we have
+
+  // first set a few entries. count how many
+  // entries we have
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
-        m.set (i,j, i*j*.5+.5);  
+        m.set (i,j, i*j*.5+.5);
 
-                                   // compare against the exact value of the
-                                   // linfty-norm (max row-sum)
+  // compare against the exact value of the
+  // linfty-norm (max row-sum)
   deallog << m.linfty_norm() << std::endl;
   Assert (m.linfty_norm() == 8.5, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -65,25 +65,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 9d65fd945d20450d4682597173b8aa8eed6266a0..26688013e14afd7714b5564683b75ebcdcd22f6f 100644 (file)
@@ -19,7 +19,7 @@
 // check SparseMatrix::frobenius_norm
 
 #include "../tests.h"
-#include <deal.II/lac/sparse_matrix.h>    
+#include <deal.II/lac/sparse_matrix.h>
 #include <fstream>
 
 
@@ -33,9 +33,9 @@ void test ()
   sp.compress ();
 
   SparseMatrix<double> m(sp);
-  
-                                   // first set a few entries. count how many
-                                   // entries we have
+
+  // first set a few entries. count how many
+  // entries we have
   double norm = 0;
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
@@ -46,11 +46,11 @@ void test ()
         }
   norm = std::sqrt(norm);
 
-                                   // compare against the exact value of the
-                                   // l2-norm (max row-sum)
+  // compare against the exact value of the
+  // l2-norm (max row-sum)
   deallog << m.frobenius_norm() << std::endl;
   Assert (std::fabs((m.frobenius_norm() - norm)/norm) < 1e-14, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -70,25 +70,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 321916dc5e0ee6f7c37fa2a2ce167269f582445c..de8bbd7ad4bb04eccf8f04d4e05f777724f48b3e 100644 (file)
@@ -19,7 +19,7 @@
 // check SparseMatrix::operator *=
 
 #include "../tests.h"
-#include <deal.II/lac/sparse_matrix.h>    
+#include <deal.II/lac/sparse_matrix.h>
 #include <fstream>
 
 
@@ -33,18 +33,18 @@ void test ()
   sp.compress ();
 
   SparseMatrix<double> m(sp);
-  
-                                   // first set a few entries
+
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
 
-                                   // then multiply everything by 1.25 and
-                                   // make sure we retrieve the values we
-                                   // expect
+  // then multiply everything by 1.25 and
+  // make sure we retrieve the values we
+  // expect
   m *= 1.25;
-  
+
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -76,25 +76,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 6aaab69aa7eb7b087ac82e1ed5128d523098d245..2f59e0266e1759d7af7f7f164c98900fd677c891 100644 (file)
@@ -19,7 +19,7 @@
 // check SparseMatrix::operator /=
 
 #include "../tests.h"
-#include <deal.II/lac/sparse_matrix.h>    
+#include <deal.II/lac/sparse_matrix.h>
 #include <fstream>
 
 
@@ -33,18 +33,18 @@ void test ()
   sp.compress ();
 
   SparseMatrix<double> m(sp);
-  
-                                   // first set a few entries
+
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
 
-                                   // then divide everything by 4/3 and
-                                   // make sure we retrieve the values we
-                                   // expect
+  // then divide everything by 4/3 and
+  // make sure we retrieve the values we
+  // expect
   m /= 4./3.;
-  
+
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -76,25 +76,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index d6d570c17ce4490f174df0dec2f55851bae2cf46..52dd5626b35fb34a79f294cdb4220aa225c20075 100644 (file)
@@ -29,7 +29,7 @@
 
 void test ()
 {
-                               // set up sparse matrix
+  // set up sparse matrix
   SparsityPattern sp (5,5,3);
   for (unsigned int i=0; i<sp.n_rows(); ++i)
     for (unsigned int j=0; j<sp.n_cols(); ++j)
@@ -39,39 +39,39 @@ void test ()
 
   SparseMatrix<double> m(sp);
 
-                               // prepare structure with indices and values
+  // prepare structure with indices and values
   std::vector<types::global_dof_index> indices (m.n());
   for (unsigned int j=0; j<m.n(); ++j)
     indices[j] = j;
   std::vector<double> values (m.n());
 
-                                   // try to add entries from the list. Zeros
-                                   // should be filtered out. list is sorted
+  // try to add entries from the list. Zeros
+  // should be filtered out. list is sorted
   for (unsigned int i=0; i<m.m(); ++i)
     {
       for (unsigned int j=0; j<m.n(); ++j)
-       if ((i+2*j+1) % 3 == 0)
-         values[j] = i*j*.5+.5;
-       else
-         values[j] = 0;
+        if ((i+2*j+1) % 3 == 0)
+          values[j] = i*j*.5+.5;
+        else
+          values[j] = 0;
       m.add(i,m.m(),&indices[0], &values[0], false, true);
     }
 
-                                   // then make sure we retrieve the same ones
+  // then make sure we retrieve the same ones
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
-       {
-         Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
-       }
+        {
+          Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
+        }
       else
-       {
-         Assert (m.el(i,j) == 0, ExcInternalError());
-       }
+        {
+          Assert (m.el(i,j) == 0, ExcInternalError());
+        }
 
-                               // try to add an invalid list of indices to
-                               // first and last row, should throw an
-                               // exception
+  // try to add an invalid list of indices to
+  // first and last row, should throw an
+  // exception
   for (unsigned int i=0; i<m.m(); ++i)
     values[i] = 0.5*i - 1.5;
   try
@@ -113,25 +113,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-             << "----------------------------------------------------"
-             << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-             << exc.what() << std::endl
-             << "Aborting!" << std::endl
-             << "----------------------------------------------------"
-             << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index df2e30c4bc74cefdfa19b6f3bab0066e150f842a..a24664dab174a700fe755e777e37efd8391c8fbe 100644 (file)
@@ -29,7 +29,7 @@
 
 void test ()
 {
-                               // set up sparse matrix
+  // set up sparse matrix
   SparsityPattern sp (5,5,3);
   for (unsigned int i=0; i<sp.n_rows(); ++i)
     for (unsigned int j=0; j<sp.n_cols(); ++j)
@@ -39,35 +39,35 @@ void test ()
 
   SparseMatrix<double> m(sp);
 
-                               // prepare structure with indices and values
+  // prepare structure with indices and values
   std::vector<types::global_dof_index> indices (m.n());
   for (unsigned int j=0; j<m.n(); ++j)
     indices[j] = j;
   std::vector<double> values (m.n());
 
-                                   // try to add entries from the list. Zeros
-                                   // should be filtered out. list is sorted
+  // try to add entries from the list. Zeros
+  // should be filtered out. list is sorted
   for (unsigned int i=0; i<m.m(); ++i)
     {
       for (unsigned int j=0; j<m.n(); ++j)
-       if ((i+2*j+1) % 3 == 0)
-         values[j] = i*j*.5+.5;
-       else
-         values[j] = 0;
+        if ((i+2*j+1) % 3 == 0)
+          values[j] = i*j*.5+.5;
+        else
+          values[j] = 0;
       m.add(i,m.m(),&indices[0], &values[0], true, true);
     }
 
-                                   // then make sure we retrieve the same ones
+  // then make sure we retrieve the same ones
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
-       {
-         Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
-       }
+        {
+          Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
+        }
       else
-       {
-         Assert (m.el(i,j) == 0, ExcInternalError());
-       }
+        {
+          Assert (m.el(i,j) == 0, ExcInternalError());
+        }
 
   deallog << "OK" << std::endl;
 }
@@ -88,25 +88,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-             << "----------------------------------------------------"
-             << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-             << exc.what() << std::endl
-             << "Aborting!" << std::endl
-             << "----------------------------------------------------"
-             << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 6bc892f146038bc0b3d4cbfb15d3f36b26c561f7..4b663ef6d14200267e9ca958250be59bf0f95500 100644 (file)
@@ -29,7 +29,7 @@
 
 void test ()
 {
-                               // set up sparse matrix
+  // set up sparse matrix
   SparsityPattern sp (5,5,3);
   for (unsigned int i=0; i<sp.n_rows(); ++i)
     for (unsigned int j=0; j<sp.n_cols(); ++j)
@@ -39,36 +39,36 @@ void test ()
 
   SparseMatrix<double> m(sp);
 
-                               // prepare structure with indices and values
+  // prepare structure with indices and values
   std::vector<types::global_dof_index> indices (m.n());
   for (unsigned int j=0; j<m.n(); ++j)
     indices[j] = m.n()-1-j;
   std::vector<double> values (m.n());
 
-                                   // try to add entries from the list. Zeros
-                                   // need to be filtered out. list is not
-                                   // sorted
+  // try to add entries from the list. Zeros
+  // need to be filtered out. list is not
+  // sorted
   for (unsigned int i=0; i<m.m(); ++i)
     {
       for (unsigned int j=0; j<m.n(); ++j)
-       if ((i+2*j+1) % 3 == 0)
-         values[m.m()-1-j] = i*j*.5+.5;
-       else
-         values[m.m()-1-j] = 0;
+        if ((i+2*j+1) % 3 == 0)
+          values[m.m()-1-j] = i*j*.5+.5;
+        else
+          values[m.m()-1-j] = 0;
       m.add(i,m.m(),&indices[0], &values[0], false, false);
     }
 
-                                   // then make sure we retrieve the same ones
+  // then make sure we retrieve the same ones
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
-       {
-         Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
-       }
+        {
+          Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
+        }
       else
-       {
-         Assert (m.el(i,j) == 0, ExcInternalError());
-       }
+        {
+          Assert (m.el(i,j) == 0, ExcInternalError());
+        }
 
   deallog << "OK" << std::endl;
 }
@@ -89,25 +89,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-             << "----------------------------------------------------"
-             << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-             << exc.what() << std::endl
-             << "Aborting!" << std::endl
-             << "----------------------------------------------------"
-             << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index e5bbe06aa148339bb8327cc5a303358a9e94992e..8508a22e09f272a0f54b7b7f0c6aecfab67b13af 100644 (file)
@@ -28,7 +28,7 @@
 
 void test ()
 {
-                               // set up sparse matrix
+  // set up sparse matrix
   SparsityPattern sp (5,7,3);
   for (unsigned int i=0; i<sp.n_rows(); ++i)
     for (unsigned int j=0; j<sp.n_cols(); ++j)
@@ -38,35 +38,35 @@ void test ()
 
   SparseMatrix<double> m(sp);
 
-                               // prepare structure with indices and values
+  // prepare structure with indices and values
   std::vector<types::global_dof_index> indices (m.n());
   for (unsigned int j=0; j<m.n(); ++j)
     indices[j] = j;
   std::vector<double> values (m.n());
 
-                                   // try to add entries from the list. Zeros
-                                   // should be filtered out. list is sorted
+  // try to add entries from the list. Zeros
+  // should be filtered out. list is sorted
   for (unsigned int i=0; i<m.m(); ++i)
     {
       for (unsigned int j=0; j<m.n(); ++j)
-       if ((i+2*j+1) % 3 == 0)
-         values[j] = i*j*.5+.5;
-       else
-         values[j] = 0;
+        if ((i+2*j+1) % 3 == 0)
+          values[j] = i*j*.5+.5;
+        else
+          values[j] = 0;
       m.add(i,m.n(),&indices[0], &values[0], false, true);
     }
 
-                                   // then make sure we retrieve the same ones
+  // then make sure we retrieve the same ones
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
-       {
-         Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
-       }
+        {
+          Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
+        }
       else
-       {
-         Assert (m.el(i,j) == 0, ExcInternalError());
-       }
+        {
+          Assert (m.el(i,j) == 0, ExcInternalError());
+        }
 
   deallog << "OK" << std::endl;
 }
@@ -87,25 +87,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-             << "----------------------------------------------------"
-             << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-             << exc.what() << std::endl
-             << "Aborting!" << std::endl
-             << "----------------------------------------------------"
-             << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 081b6ed367046514ca3408aa3c9312ff1612d314..932c2b4e98a57e00bf0fecfc5483004818dc53b9 100644 (file)
@@ -28,7 +28,7 @@
 
 void test ()
 {
-                               // set up sparse matrix
+  // set up sparse matrix
   SparsityPattern sp (5,7,3);
   for (unsigned int i=0; i<sp.n_rows(); ++i)
     for (unsigned int j=0; j<sp.n_cols(); ++j)
@@ -38,35 +38,35 @@ void test ()
 
   SparseMatrix<double> m(sp);
 
-                               // prepare structure with indices and values
+  // prepare structure with indices and values
   std::vector<types::global_dof_index> indices (m.n());
   for (unsigned int i=0; i<m.n(); ++i)
     indices[i] = m.n()-1-i;
   std::vector<double> values (m.n());
 
-                                   // try to add entries from the list. Zeros
-                                   // should be filtered out. list is sorted
+  // try to add entries from the list. Zeros
+  // should be filtered out. list is sorted
   for (unsigned int i=0; i<m.m(); ++i)
     {
       for (unsigned int j=0; j<m.n(); ++j)
-       if ((i+2*j+1) % 3 == 0)
-         values[m.n()-1-j] = i*j*.5+.5;
-       else
-         values[m.n()-1-j] = 0;
+        if ((i+2*j+1) % 3 == 0)
+          values[m.n()-1-j] = i*j*.5+.5;
+        else
+          values[m.n()-1-j] = 0;
       m.add(i,m.n(),&indices[0], &values[0], false, false);
     }
 
-                                   // then make sure we retrieve the same ones
+  // then make sure we retrieve the same ones
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
-       {
-         Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
-       }
+        {
+          Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
+        }
       else
-       {
-         Assert (m.el(i,j) == 0, ExcInternalError());
-       }
+        {
+          Assert (m.el(i,j) == 0, ExcInternalError());
+        }
 
   deallog << "OK" << std::endl;
 }
@@ -87,25 +87,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-             << "----------------------------------------------------"
-             << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-             << exc.what() << std::endl
-             << "Aborting!" << std::endl
-             << "----------------------------------------------------"
-             << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index df91bc46706ccd0c4528b026a9579325dbd99abf..71595acb5ed56565997279c737d93632ffebafe6 100644 (file)
@@ -29,7 +29,7 @@
 
 void test ()
 {
-                               // set up sparse matrix
+  // set up sparse matrix
   SparsityPattern sp (5,5,3);
   for (unsigned int i=0; i<sp.n_rows(); ++i)
     for (unsigned int j=0; j<sp.n_cols(); ++j)
@@ -39,39 +39,39 @@ void test ()
 
   SparseMatrix<double> m(sp);
 
-                               // prepare structure with indices and values
+  // prepare structure with indices and values
   std::vector<types::global_dof_index> indices (m.n());
   for (unsigned int j=0; j<m.n(); ++j)
     indices[j] = j;
   std::vector<double> values (m.n());
 
-                                   // try to add entries from the list. No
-                                   // zeros to be filtered. But less than 3
-                                   // elements, so the program takes another
-                                   // path
+  // try to add entries from the list. No
+  // zeros to be filtered. But less than 3
+  // elements, so the program takes another
+  // path
   for (unsigned int i=0; i<m.m(); ++i)
     {
       unsigned int n_added = 0;
       for (unsigned int j=0; j<m.n(); ++j)
-       if ((i+2*j+1) % 3 == 0)
-         {
-           indices[n_added] = j;
-           values[n_added++] = i*j*.5+.5;
-         }
+        if ((i+2*j+1) % 3 == 0)
+          {
+            indices[n_added] = j;
+            values[n_added++] = i*j*.5+.5;
+          }
       m.add(i,n_added,&indices[0], &values[0], false, true);
     }
 
-                                   // then make sure we retrieve the same ones
+  // then make sure we retrieve the same ones
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
-       {
-         Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
-       }
+        {
+          Assert (m(i,j) == i*j*.5+.5, ExcInternalError());
+        }
       else
-       {
-         Assert (m.el(i,j) == 0, ExcInternalError());
-       }
+        {
+          Assert (m.el(i,j) == 0, ExcInternalError());
+        }
 
   deallog << "OK" << std::endl;
 }
@@ -92,25 +92,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-             << "----------------------------------------------------"
-             << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-             << exc.what() << std::endl
-             << "Aborting!" << std::endl
-             << "----------------------------------------------------"
-             << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 10b712ff1116ad0d7ede5d25700874a1bca8b546..68218a366fc593be7551c4567d2543c18c5f44ac 100644 (file)
@@ -20,7 +20,7 @@
 // for some time, leading to a linker error
 
 #include "../tests.h"
-#include <deal.II/lac/sparse_matrix.h>    
+#include <deal.II/lac/sparse_matrix.h>
 #include <fstream>
 #include <iomanip>
 
@@ -41,7 +41,7 @@ void test ()
   deallog << i->value() << std::endl;
   i++;
   deallog << i->value() << std::endl;
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -61,25 +61,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 135429896905c363b02d79071ca6760d07466f95..733b9f07b868cc909dd597e3770144e844d04cb4 100644 (file)
@@ -20,7 +20,7 @@
 // iterator
 
 #include "../tests.h"
-#include <deal.II/lac/sparse_matrix.h>    
+#include <deal.II/lac/sparse_matrix.h>
 #include <fstream>
 #include <iomanip>
 
@@ -43,7 +43,7 @@ void test ()
           ||
           (i==j))
         m.set (i,j, i*j);
-  
+
   SparseMatrix<double>::const_iterator i = m.begin();
   for (; i!=m.end(); ++i)
     {
@@ -72,25 +72,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 2cc6792c978efa8b8b7b127cd7eef22d67a21b78..83e10464c7a4f23254f44aeefc22292e0783e440 100644 (file)
@@ -20,7 +20,7 @@
 // iterator
 
 #include "../tests.h"
-#include <deal.II/lac/sparse_matrix.h>    
+#include <deal.II/lac/sparse_matrix.h>
 #include <fstream>
 #include <iomanip>
 
@@ -43,7 +43,7 @@ void test ()
           ||
           (i==j))
         m.set (i,j, i*j);
-  
+
   SparseMatrix<double>::iterator i = m.begin();
   for (; i!=m.end(); ++i)
     {
@@ -72,25 +72,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index c0cee8580445677b1beb6df75fa9749d61a4dc16..93c4da96d6f74937d608c344826623356229d72e 100644 (file)
@@ -19,7 +19,7 @@
 // and reading them back through the matrix itself
 
 #include "../tests.h"
-#include <deal.II/lac/sparse_matrix.h>    
+#include <deal.II/lac/sparse_matrix.h>
 #include <fstream>
 #include <iomanip>
 
@@ -39,7 +39,7 @@ void test ()
   SparseMatrix<double>::iterator i = m.begin();
   for (; i!=m.end(); ++i)
     i->value() = i->row()*i->column();
-  
+
   for (unsigned int i=0; i<5; ++i)
     for (unsigned int j=0; j<5; ++j)
       if (((i+2*j+1) % 3 == 0)
@@ -51,7 +51,7 @@ void test ()
           Assert (std::fabs(m.el(i,j)-i*j) < 1e-14,
                   ExcInternalError());
         }
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -71,25 +71,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 5880ee1c512516d23bb24e079cc541ea563abe19..9fabd7565135f8955449546bc9b883eb339aa319 100644 (file)
@@ -19,7 +19,7 @@
 // and reading them back through the matrix itself
 
 #include "../tests.h"
-#include <deal.II/lac/sparse_matrix.h>    
+#include <deal.II/lac/sparse_matrix.h>
 #include <fstream>
 #include <iomanip>
 
@@ -46,7 +46,7 @@ void test ()
   SparseMatrix<double>::iterator i = m.begin();
   for (; i!=m.end(); ++i)
     i->value() += i->row()*i->column();
-  
+
   for (unsigned int i=0; i<5; ++i)
     for (unsigned int j=0; j<5; ++j)
       if (((i+2*j+1) % 3 == 0)
@@ -58,7 +58,7 @@ void test ()
           Assert (std::fabs(m.el(i,j)-(1.+i*j)) < 1e-14,
                   ExcInternalError());
         }
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -78,25 +78,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 6cb083a0f7ae1ad50693e9bc8c77578f67dbfc87..4685b7cef836ddbe54cf089a557080b6a5113168 100644 (file)
@@ -19,7 +19,7 @@
 // and reading them back through the matrix itself
 
 #include "../tests.h"
-#include <deal.II/lac/sparse_matrix.h>    
+#include <deal.II/lac/sparse_matrix.h>
 #include <fstream>
 #include <iomanip>
 
@@ -46,7 +46,7 @@ void test ()
   SparseMatrix<double>::iterator i = m.begin();
   for (; i!=m.end(); ++i)
     i->value() -= i->row()*i->column();
-  
+
   for (unsigned int i=0; i<5; ++i)
     for (unsigned int j=0; j<5; ++j)
       if (((i+2*j+1) % 3 == 0)
@@ -58,7 +58,7 @@ void test ()
           Assert (std::fabs(m.el(i,j)-(1.-i*j)) < 1e-14,
                   ExcInternalError());
         }
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -78,25 +78,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index ee69cab849b685d12695354be27c8f764c8fc48a..ace05490de021d2352ce700865e29e7e69eb58ae 100644 (file)
@@ -19,7 +19,7 @@
 // and reading them back through the matrix itself
 
 #include "../tests.h"
-#include <deal.II/lac/sparse_matrix.h>    
+#include <deal.II/lac/sparse_matrix.h>
 #include <fstream>
 #include <iomanip>
 
@@ -46,7 +46,7 @@ void test ()
   SparseMatrix<double>::iterator i = m.begin();
   for (; i!=m.end(); ++i)
     i->value() *= 2;
-  
+
   for (unsigned int i=0; i<5; ++i)
     for (unsigned int j=0; j<5; ++j)
       if (((i+2*j+1) % 3 == 0)
@@ -58,7 +58,7 @@ void test ()
           Assert (std::fabs(m.el(i,j)-(2.*i*j)) < 1e-14,
                   ExcInternalError());
         }
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -78,25 +78,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index a35716036239b3dc637fc469e46b8fa82c04174e..5fb5a9143b404889f055216c6f0f0e5c881e83a0 100644 (file)
@@ -19,7 +19,7 @@
 // and reading them back through the matrix itself
 
 #include "../tests.h"
-#include <deal.II/lac/sparse_matrix.h>    
+#include <deal.II/lac/sparse_matrix.h>
 #include <fstream>
 #include <iomanip>
 
@@ -46,7 +46,7 @@ void test ()
   SparseMatrix<double>::iterator i = m.begin();
   for (; i!=m.end(); ++i)
     i->value() /= 2;
-  
+
   for (unsigned int i=0; i<5; ++i)
     for (unsigned int j=0; j<5; ++j)
       if (((i+2*j+1) % 3 == 0)
@@ -58,7 +58,7 @@ void test ()
           Assert (std::fabs(m.el(i,j)-(i*j/2.)) < 1e-14,
                   ExcInternalError());
         }
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -78,25 +78,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 71c408de908c3e83729bdc5cc60382b28ddffaa1..82179fd034a02727beabc72d93071106255aa2e3 100644 (file)
 
 void test ()
 {
-                                   // create a sparsity pattern with totally
-                                   // empty lines (not even diagonals, since
-                                   // not quadratic)
+  // create a sparsity pattern with totally
+  // empty lines (not even diagonals, since
+  // not quadratic)
   SparsityPattern sparsity(4,5,1);
   sparsity.add (1,1);
   sparsity.add (3,1);
   sparsity.compress ();
 
-                                   // attach a sparse matrix to it
+  // attach a sparse matrix to it
   SparseMatrix<double> A(sparsity);
 
-                                   // and loop over the elements of it
+  // and loop over the elements of it
   for (SparseMatrix<double>::const_iterator k=A.begin();
        k!=A.end(); ++k)
     deallog << k->row() << ' ' << k->column() << ' ' << k->value()
@@ -62,25 +62,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 3a92306cc79687fb64bf2fbc31f63b8d04724fc6..5889ec8d88a88c565386231018fc6ffee66dc1be 100644 (file)
 
 void test ()
 {
-                                   // create a sparsity pattern with totally
-                                   // empty lines (not even diagonals, since
-                                   // not quadratic)
+  // create a sparsity pattern with totally
+  // empty lines (not even diagonals, since
+  // not quadratic)
   SparsityPattern sparsity(4,5,1);
   sparsity.add (1,1);
   sparsity.add (3,1);
   sparsity.compress ();
 
-                                   // attach a sparse matrix to it
+  // attach a sparse matrix to it
   SparseMatrix<double> A(sparsity);
 
-                                   // and loop over the elements of it
+  // and loop over the elements of it
   for (SparseMatrix<double>::const_iterator k=A.begin();
        k!=A.end(); k++)
     deallog << k->row() << ' ' << k->column() << ' ' << k->value()
@@ -64,25 +64,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 0587b58d5a29a724eb6c9fc9005f440885d67f44..19e4d894336f6d88cf108b3b7f0b247b58b73910 100644 (file)
@@ -16,7 +16,7 @@
 
 
 
-// certain comparisons between sparse matrix iterators didn't compile. 
+// certain comparisons between sparse matrix iterators didn't compile.
 
 #include "../tests.h"
 #include <deal.II/lac/sparsity_pattern.h>
 
 void test ()
 {
-                                   // create a sparsity pattern with totally
-                                   // empty lines (not even diagonals, since
-                                   // not quadratic)
+  // create a sparsity pattern with totally
+  // empty lines (not even diagonals, since
+  // not quadratic)
   SparsityPattern sparsity(4,5,1);
   sparsity.add (1,1);
   sparsity.add (3,1);
   sparsity.compress ();
 
-                                   // attach a sparse matrix to it
+  // attach a sparse matrix to it
   SparseMatrix<double> A(sparsity);
 
   SparseMatrix<double>::iterator k = A.begin(),
@@ -52,7 +52,7 @@ void test ()
 
   Assert (k == k, ExcInternalError());
   Assert (!(k != k), ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -72,25 +72,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 603ffff44a7283ec0ff8ff383000c86604fb6e8a..f8999a5030f3c670c7b45991909709fde9705348 100644 (file)
 
 void test ()
 {
-                                   // create a sparsity pattern with totally
-                                   // empty lines (not even diagonals, since
-                                   // not quadratic)
+  // create a sparsity pattern with totally
+  // empty lines (not even diagonals, since
+  // not quadratic)
   SparsityPattern sparsity(4,5,1);
   sparsity.add (1,1);
   sparsity.add (3,1);
   sparsity.compress ();
 
-                                   // attach a sparse matrix to it
+  // attach a sparse matrix to it
   SparseMatrix<double> A(sparsity);
 
   SparseMatrix<double>::const_iterator k = A.begin(),
@@ -52,7 +52,7 @@ void test ()
 
   Assert (k == k, ExcInternalError());
   Assert (!(k != k), ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -72,25 +72,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 5838c1e08af3b844d668c96cd294070b922b5d56..496b6ac078e600a13672135ba0aa9a143e5613f7 100644 (file)
@@ -38,24 +38,24 @@ void test ()
 
   for (unsigned int row=0; row<sp.n_rows(); ++row)
     Assert (m.begin(row)-m.begin(row) == 0,
-           ExcInternalError());
+            ExcInternalError());
 
   for (unsigned int row=0; row<sp.n_rows(); ++row)
     Assert (m.end(row)-m.begin(row) == (int)sp.row_length(row),
-           ExcInternalError());
+            ExcInternalError());
   for (unsigned int row=0; row<sp.n_rows(); ++row)
     Assert (m.begin(row)-m.end(row) == -(int)sp.row_length(row),
-           ExcInternalError());
+            ExcInternalError());
 
   {
     unsigned int counter = 0;
     for (unsigned int row=0; row<sp.n_rows(); ++row)
       {
-       Assert (m.begin(row)-m.begin(0) == (int)counter,
-               ExcInternalError());
-       Assert (m.begin(0)-m.begin(row) == -(int)counter,
-               ExcInternalError());
-       counter += sp.row_length(row);
+        Assert (m.begin(row)-m.begin(0) == (int)counter,
+                ExcInternalError());
+        Assert (m.begin(0)-m.begin(row) == -(int)counter,
+                ExcInternalError());
+        counter += sp.row_length(row);
       }
   }
 
@@ -64,9 +64,9 @@ void test ()
   Assert (m.end(sp.n_rows()-1) - m.end() == 0, ExcInternalError());
   Assert (m.end() - m.end(sp.n_rows()-1) == 0, ExcInternalError());
   Assert (m.end() - m.begin() == (int)sp.n_nonzero_elements(),
-         ExcInternalError());
+          ExcInternalError());
   Assert (m.begin() - m.end() == -(int)sp.n_nonzero_elements(),
-         ExcInternalError());
+          ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
@@ -87,25 +87,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index af40efb00e2d3a29698ffe13478efabc5023f1e2..1c5720dca75b5e089726d63994eba95bb25a1061 100644 (file)
 void test (Vector<double> &v,
            Vector<double> &w)
 {
-                                   // set some entries in the
-                                   // matrix. actually, set them all
+  // set some entries in the
+  // matrix. actually, set them all
   SparsityPattern sp (v.size(),v.size(),v.size());
   for (unsigned int i=0; i<v.size(); ++i)
     for (unsigned int j=0; j<v.size(); ++j)
       sp.add (i,j);
   sp.compress ();
 
-                                   // then create a matrix from that
+  // then create a matrix from that
   SparseMatrix<double> m(sp);
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
-  
+
   v.compress ();
   w.compress ();
 
-                                   // w:=Mv
+  // w:=Mv
   m.vmult (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -68,7 +68,7 @@ void test (Vector<double> &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("sparse_matrix_vector_01/output");
   deallog.attach(logfile);
@@ -84,25 +84,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 14bb2518de362df03742fa821ae4d0ba36c7dbf7..ad3650fc828ef91eefbc07ec4300d3e7e5a30264 100644 (file)
 void test (Vector<double> &v,
            Vector<double> &w)
 {
-                                   // set some entries in the
-                                   // matrix. actually, set them all
+  // set some entries in the
+  // matrix. actually, set them all
   SparsityPattern sp (v.size(),v.size(),v.size());
   for (unsigned int i=0; i<v.size(); ++i)
     for (unsigned int j=0; j<v.size(); ++j)
       sp.add (i,j);
   sp.compress ();
 
-                                   // then create a matrix from that
+  // then create a matrix from that
   SparseMatrix<double> m(sp);
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
-  
+
   v.compress ();
   w.compress ();
 
-                                   // w:=Mv
+  // w:=Mv
   m.Tvmult (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -68,7 +68,7 @@ void test (Vector<double> &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("sparse_matrix_vector_02/output");
   deallog.attach(logfile);
@@ -84,25 +84,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 2c9535ca010022cc3e0458da003a832d26c1031e..d2bcc0b34f1b78740f43d629aa13b5eca03aae60 100644 (file)
 void test (Vector<double> &v,
            Vector<double> &w)
 {
-                                   // set some entries in the
-                                   // matrix. actually, set them all
+  // set some entries in the
+  // matrix. actually, set them all
   SparsityPattern sp (v.size(),v.size(),v.size());
   for (unsigned int i=0; i<v.size(); ++i)
     for (unsigned int j=0; j<v.size(); ++j)
       sp.add (i,j);
   sp.compress ();
 
-                                   // then create a matrix from that
+  // then create a matrix from that
   SparseMatrix<double> m(sp);
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       w(i) = i;
     }
-  
+
   v.compress ();
   w.compress ();
 
-                                   // w+=Mv
+  // w+=Mv
   m.vmult_add (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -71,7 +71,7 @@ void test (Vector<double> &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("sparse_matrix_vector_03/output");
   deallog.attach(logfile);
@@ -87,25 +87,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 48a13a21bf19ab2672a21744e0b8dea049081c18..0c45a323f7b7c12948ce3c0b538303f0fdec6216 100644 (file)
 void test (Vector<double> &v,
            Vector<double> &w)
 {
-                                   // set some entries in the
-                                   // matrix. actually, set them all
+  // set some entries in the
+  // matrix. actually, set them all
   SparsityPattern sp (v.size(),v.size(),v.size());
   for (unsigned int i=0; i<v.size(); ++i)
     for (unsigned int j=0; j<v.size(); ++j)
       sp.add (i,j);
   sp.compress ();
 
-                                   // then create a matrix from that
+  // then create a matrix from that
   SparseMatrix<double> m(sp);
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       w(i) = i;
     }
-  
+
   v.compress ();
   w.compress ();
 
-                                   // w:=Mv
+  // w:=Mv
   m.Tvmult_add (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -71,7 +71,7 @@ void test (Vector<double> &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("sparse_matrix_vector_04/output");
   deallog.attach(logfile);
@@ -87,25 +87,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index e1459ae78343d946ac7637569e496df6ef975897..6415b158975dd1bb60a32e67341b619dd2d3dfb1 100644 (file)
 void test (Vector<double> &v,
            Vector<double> &w)
 {
-                                   // set some entries in the
-                                   // matrix. actually, set them all
+  // set some entries in the
+  // matrix. actually, set them all
   SparsityPattern sp (v.size(),v.size(),v.size());
   for (unsigned int i=0; i<v.size(); ++i)
     for (unsigned int j=0; j<v.size(); ++j)
       sp.add (i,j);
   sp.compress ();
 
-                                   // then create a matrix from that
+  // then create a matrix from that
   SparseMatrix<double> m(sp);
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       w(i) = i+1;
     }
-  
+
   v.compress ();
   w.compress ();
 
-                                   // <w,Mv>
+  // <w,Mv>
   const double s = m.matrix_scalar_product (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -74,7 +74,7 @@ void test (Vector<double> &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("sparse_matrix_vector_05/output");
   deallog.attach(logfile);
@@ -90,25 +90,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 628f0d9a1ff81489b3c14b033950ede3213688ee..45727c3734fd1cab682c3ddbea3aa92e82b86247 100644 (file)
 
 void test (Vector<double> &v)
 {
-                                   // set some entries in the
-                                   // matrix. actually, set them all
+  // set some entries in the
+  // matrix. actually, set them all
   SparsityPattern sp (v.size(),v.size(),v.size());
   for (unsigned int i=0; i<v.size(); ++i)
     for (unsigned int j=0; j<v.size(); ++j)
       sp.add (i,j);
   sp.compress ();
 
-                                   // then create a matrix from that
+  // then create a matrix from that
   SparseMatrix<double> m(sp);
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
-  
+
   v.compress ();
 
-                                   // <w,Mv>
+  // <w,Mv>
   const double s = m.matrix_norm_square (v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     Assert (v(i) == i, ExcInternalError());
 
@@ -66,7 +66,7 @@ void test (Vector<double> &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("sparse_matrix_vector_06/output");
   deallog.attach(logfile);
@@ -81,25 +81,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 9b1f80f3c72143957013bceb20bbd12bdc6d4855..eda038e1b91a9778814acc5c5ac14f5408f1aaac 100644 (file)
@@ -30,33 +30,33 @@ void test (Vector<double> &v,
            Vector<double> &w,
            Vector<double> &x)
 {
-                                   // set some entries in the
-                                   // matrix. actually, set them all
+  // set some entries in the
+  // matrix. actually, set them all
   SparsityPattern sp (v.size(),v.size(),v.size());
   for (unsigned int i=0; i<v.size(); ++i)
     for (unsigned int j=0; j<v.size(); ++j)
       sp.add (i,j);
   sp.compress ();
 
-                                   // then create a matrix from that
+  // then create a matrix from that
   SparseMatrix<double> m(sp);
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       w(i) = i+1;
     }
-      
+
   v.compress ();
   w.compress ();
 
-                                   // x=w-Mv
+  // x=w-Mv
   const double s = m.residual (x, v, w);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -76,7 +76,7 @@ void test (Vector<double> &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("sparse_matrix_vector_07/output");
   deallog.attach(logfile);
@@ -93,25 +93,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 3aa8378cc373e0f9558f9f1c16df3ff7e21a00be..30c1b4efc317d49a4d6755c75c5a639fc54d2f0c 100644 (file)
@@ -39,12 +39,12 @@ void test ()
   for (unsigned int i=0; i<N; ++i)
     for (unsigned int j=0; j<sp.row_length (i); ++j)
       deallog << i << ' ' << j << ' ' << sp.column_number (i,j)
-              << std::endl;  
+              << std::endl;
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("sparsity_pattern_01/output");
   deallog.attach(logfile);
index 2e4b932e7450cd29021386b53bffe6a221503234..2f98fb57e4960043f5fee1d992362f120f784bd4 100644 (file)
@@ -39,12 +39,12 @@ void test ()
   for (unsigned int i=0; i<N; ++i)
     for (unsigned int j=0; j<sp.row_length (i); ++j)
       deallog << i << ' ' << j << ' ' << sp.column_number (i,j)
-              << std::endl;  
+              << std::endl;
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("sparsity_pattern_01_x/output");
   deallog.attach(logfile);
index e38fc310af5b819bc5b426cd11f24adf98db8dad..4a9a6919961d6ccf79082c3a92ae9f52c8829d73 100644 (file)
@@ -19,7 +19,7 @@
 // test SparsityPattern::iterator
 
 #include "../tests.h"
-#include <deal.II/lac/sparsity_pattern.h>    
+#include <deal.II/lac/sparsity_pattern.h>
 #include <fstream>
 #include <iomanip>
 
@@ -35,8 +35,8 @@ void test ()
 
   SparsityPattern::const_iterator i = sp.begin();
   for (; i!=sp.end(); ++i)
-    deallog << i->row() << ' ' << i->column() << std::endl;    
-  
+    deallog << i->row() << ' ' << i->column() << std::endl;
+
   deallog << "OK" << std::endl;
 }
 
@@ -56,25 +56,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 793abafe192befd9fc288555f65fb04c7c839c9a..61133ad296813fd3c86b71ebcda35a99ce56df48 100644 (file)
@@ -52,7 +52,7 @@ template <int dim>
 void gnuplot_output()
 {
   deallog << "Output of grids into gnuplot files:" << std::endl
-           << "===================================" << std::endl;
+          << "===================================" << std::endl;
 
   Triangulation<dim> triangulation;
   GridGenerator::hyper_ball (triangulation);
@@ -68,18 +68,18 @@ void gnuplot_output()
       filename_base += '0'+refinement;
 
       for (unsigned int degree=1; degree<4; ++degree)
-       {
-         deallog << "Degree = " << degree << std::endl;
+        {
+          deallog << "Degree = " << degree << std::endl;
 
-         const MappingQ<dim> mapping (degree);
+          const MappingQ<dim> mapping (degree);
 
 
-         GridOut grid_out;
-         GridOutFlags::Gnuplot gnuplot_flags(false, 30);
-         grid_out.set_flags(gnuplot_flags);
-  
-         grid_out.write_gnuplot (triangulation, deallog.get_file_stream(), &mapping);
-       }
+          GridOut grid_out;
+          GridOutFlags::Gnuplot gnuplot_flags(false, 30);
+          grid_out.set_flags(gnuplot_flags);
+
+          grid_out.write_gnuplot (triangulation, deallog.get_file_stream(), &mapping);
+        }
       deallog << std::endl;
     }
 }
@@ -88,7 +88,7 @@ template <int dim>
 void compute_pi_by_area ()
 {
   deallog << "Computation of Pi by the area:" << std::endl
-           << "==============================" << std::endl;
+          << "==============================" << std::endl;
 
   const QGauss<dim> quadrature (4);
 
@@ -98,7 +98,7 @@ void compute_pi_by_area ()
 
       Triangulation<dim> triangulation;
       GridGenerator::hyper_ball (triangulation);
-  
+
       static const HyperBallBoundary<dim> boundary;
       triangulation.set_boundary (0, boundary);
 
@@ -109,33 +109,33 @@ void compute_pi_by_area ()
       DoFHandler<dim> dof_handler (triangulation);
 
       FEValues<dim> x_fe_values (mapping, dummy_fe, quadrature,
-                               update_JxW_values);
+                                 update_JxW_values);
 
       ConvergenceTable table;
 
       for (unsigned int refinement=0; refinement<6;
-          ++refinement, triangulation.refine_global (1))
-       {
-         table.add_value("cells", triangulation.n_active_cells());
+           ++refinement, triangulation.refine_global (1))
+        {
+          table.add_value("cells", triangulation.n_active_cells());
 
-         dof_handler.distribute_dofs (dummy_fe);
+          dof_handler.distribute_dofs (dummy_fe);
 
-         long double area = 0;
+          long double area = 0;
 
-         typename DoFHandler<dim>::active_cell_iterator
-           cell = dof_handler.begin_active(),
-           endc = dof_handler.end();
-         for (; cell!=endc; ++cell)
-           {
-             x_fe_values.reinit (cell);
-             const FEValues<dim> &fe_values = x_fe_values.get_present_fe_values();
-             for (unsigned int i=0; i<fe_values.n_quadrature_points; ++i)
-               area += fe_values.JxW (i);
-           };
+          typename DoFHandler<dim>::active_cell_iterator
+          cell = dof_handler.begin_active(),
+          endc = dof_handler.end();
+          for (; cell!=endc; ++cell)
+            {
+              x_fe_values.reinit (cell);
+              const FEValues<dim> &fe_values = x_fe_values.get_present_fe_values();
+              for (unsigned int i=0; i<fe_values.n_quadrature_points; ++i)
+                area += fe_values.JxW (i);
+            };
 
-         table.add_value("eval.pi", static_cast<double> (area));
-         table.add_value("error",   static_cast<double> (std::fabs(area-pi)));
-       };
+          table.add_value("eval.pi", static_cast<double> (area));
+          table.add_value("error",   static_cast<double> (std::fabs(area-pi)));
+        };
 
       table.omit_column_from_convergence_rate_evaluation("cells");
       table.omit_column_from_convergence_rate_evaluation("eval.pi");
@@ -155,7 +155,7 @@ template <int dim>
 void compute_pi_by_perimeter ()
 {
   deallog << "Computation of Pi by the perimeter:" << std::endl
-           << "===================================" << std::endl;
+          << "===================================" << std::endl;
 
   const QGauss<dim-1> quadrature (4);
 
@@ -164,7 +164,7 @@ void compute_pi_by_perimeter ()
       deallog << "Degree = " << degree << std::endl;
       Triangulation<dim> triangulation;
       GridGenerator::hyper_ball (triangulation);
-  
+
       static const HyperBallBoundary<dim> boundary;
       triangulation.set_boundary (0, boundary);
 
@@ -174,34 +174,34 @@ void compute_pi_by_perimeter ()
       DoFHandler<dim> dof_handler (triangulation);
 
       FEFaceValues<dim> x_fe_face_values (mapping, fe, quadrature,
-                                        update_JxW_values);
+                                          update_JxW_values);
       ConvergenceTable table;
 
       for (unsigned int refinement=0; refinement<6;
-          ++refinement, triangulation.refine_global (1))
-       {
-         table.add_value("cells", triangulation.n_active_cells());
-
-         dof_handler.distribute_dofs (fe);
-
-         typename DoFHandler<dim>::active_cell_iterator
-           cell = dof_handler.begin_active(),
-           endc = dof_handler.end();
-         long double perimeter = 0;
-         for (; cell!=endc; ++cell)
-           for (unsigned int face_no=0; face_no<GeometryInfo<dim>::faces_per_cell; ++face_no)
-             if (cell->face(face_no)->at_boundary())
-               {
-                 x_fe_face_values.reinit (cell, face_no);
-                 const FEFaceValues<dim> &fe_face_values
-                   = x_fe_face_values.get_present_fe_values ();
-                 
-                 for (unsigned int i=0; i<fe_face_values.n_quadrature_points; ++i)
-                   perimeter += fe_face_values.JxW (i);
-               };
-         table.add_value("eval.pi", static_cast<double> (perimeter/2.));
-         table.add_value("error",   static_cast<double> (std::fabs(perimeter/2.-pi)));
-       };
+           ++refinement, triangulation.refine_global (1))
+        {
+          table.add_value("cells", triangulation.n_active_cells());
+
+          dof_handler.distribute_dofs (fe);
+
+          typename DoFHandler<dim>::active_cell_iterator
+          cell = dof_handler.begin_active(),
+          endc = dof_handler.end();
+          long double perimeter = 0;
+          for (; cell!=endc; ++cell)
+            for (unsigned int face_no=0; face_no<GeometryInfo<dim>::faces_per_cell; ++face_no)
+              if (cell->face(face_no)->at_boundary())
+                {
+                  x_fe_face_values.reinit (cell, face_no);
+                  const FEFaceValues<dim> &fe_face_values
+                    = x_fe_face_values.get_present_fe_values ();
+
+                  for (unsigned int i=0; i<fe_face_values.n_quadrature_points; ++i)
+                    perimeter += fe_face_values.JxW (i);
+                };
+          table.add_value("eval.pi", static_cast<double> (perimeter/2.));
+          table.add_value("error",   static_cast<double> (std::fabs(perimeter/2.-pi)));
+        };
 
       table.omit_column_from_convergence_rate_evaluation("cells");
       table.omit_column_from_convergence_rate_evaluation("eval.pi");
@@ -217,19 +217,19 @@ void compute_pi_by_perimeter ()
 }
 
 
-int main () 
+int main ()
 {
   deallog << std::setprecision(2);
   logfile << std::setprecision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   gnuplot_output<2>();
 
   compute_pi_by_area<2> ();
   compute_pi_by_perimeter<2> ();
-  
+
   return 0;
 }
index cc4dd414c95b504403a300e9c831cbac1076e06e..37430f430f08a86683010b2e092fd63fc8733d70 100644 (file)
@@ -57,44 +57,44 @@ std::ofstream logfile("step-11/output");
 
 
 template <int dim>
-class LaplaceProblem 
+class LaplaceProblem
 {
-  public:
-    LaplaceProblem (const unsigned int mapping_degree);
-    void run ();
-    
-  private:
-    void setup_system ();
-    void assemble_and_solve ();
-    void solve ();
-
-    Triangulation<dim>   triangulation;
-    FE_Q<dim>            fe;
-    DoFHandler<dim>      dof_handler;
-    MappingQ<dim>        mapping;
-
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> system_matrix;
-    ConstraintMatrix     mean_value_constraints;
-
-    Vector<double>       solution;
-    Vector<double>       system_rhs;
-
-    TableHandler         output_table;
+public:
+  LaplaceProblem (const unsigned int mapping_degree);
+  void run ();
+
+private:
+  void setup_system ();
+  void assemble_and_solve ();
+  void solve ();
+
+  Triangulation<dim>   triangulation;
+  FE_Q<dim>            fe;
+  DoFHandler<dim>      dof_handler;
+  MappingQ<dim>        mapping;
+
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> system_matrix;
+  ConstraintMatrix     mean_value_constraints;
+
+  Vector<double>       solution;
+  Vector<double>       system_rhs;
+
+  TableHandler         output_table;
 };
 
 
 
 template <int dim>
 LaplaceProblem<dim>::LaplaceProblem (const unsigned int mapping_degree) :
-                fe (1),
-               dof_handler (triangulation),
-               mapping (mapping_degree)
+  fe (1),
+  dof_handler (triangulation),
+  mapping (mapping_degree)
 {
   deallog << "Using mapping with degree " << mapping_degree << ":"
-           << std::endl
-           << "============================"
-           << std::endl;
+          << std::endl
+          << "============================"
+          << std::endl;
 }
 
 
@@ -108,24 +108,24 @@ void LaplaceProblem<dim>::setup_system ()
 
   std::vector<bool> boundary_dofs (dof_handler.n_dofs(), false);
   DoFTools::extract_boundary_dofs (dof_handler, std::vector<bool>(1,true),
-                                  boundary_dofs);
+                                   boundary_dofs);
 
   const unsigned int first_boundary_dof
     = std::distance (boundary_dofs.begin(),
-                    std::find (boundary_dofs.begin(),
-                               boundary_dofs.end(),
-                               true));
+                     std::find (boundary_dofs.begin(),
+                                boundary_dofs.end(),
+                                true));
 
   mean_value_constraints.clear ();
   mean_value_constraints.add_line (first_boundary_dof);
   for (unsigned int i=first_boundary_dof+1; i<dof_handler.n_dofs(); ++i)
     if (boundary_dofs[i] == true)
       mean_value_constraints.add_entry (first_boundary_dof,
-                                       i, -1);
+                                        i, -1);
   mean_value_constraints.close ();
 
   CompressedSparsityPattern csp (dof_handler.n_dofs(),
-                                dof_handler.n_dofs());
+                                 dof_handler.n_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, csp);
   mean_value_constraints.condense (csp);
 
@@ -136,39 +136,39 @@ void LaplaceProblem<dim>::setup_system ()
 
 
 template <int dim>
-void LaplaceProblem<dim>::assemble_and_solve () 
+void LaplaceProblem<dim>::assemble_and_solve ()
 {
 
   const unsigned int gauss_degree
     = std::max (static_cast<unsigned int>(std::ceil(1.*(mapping.get_degree()+1)/2)),
-               2U);
+                2U);
   MatrixTools::create_laplace_matrix (mapping, dof_handler,
-                                     QGauss<dim>(gauss_degree),
-                                     system_matrix);
+                                      QGauss<dim>(gauss_degree),
+                                      system_matrix);
   VectorTools::create_right_hand_side (mapping, dof_handler,
-                                      QGauss<dim>(gauss_degree),
-                                      ConstantFunction<dim>(-2),
-                                      system_rhs);
+                                       QGauss<dim>(gauss_degree),
+                                       ConstantFunction<dim>(-2),
+                                       system_rhs);
   Vector<double> tmp (system_rhs.size());
   VectorTools::create_boundary_right_hand_side (mapping, dof_handler,
-                                               QGauss<dim-1>(gauss_degree),
-                                               ConstantFunction<dim>(1),
-                                               tmp);
+                                                QGauss<dim-1>(gauss_degree),
+                                                ConstantFunction<dim>(1),
+                                                tmp);
   system_rhs += tmp;
 
   mean_value_constraints.condense (system_matrix);
-  mean_value_constraints.condense (system_rhs);  
+  mean_value_constraints.condense (system_rhs);
 
   solve ();
   mean_value_constraints.distribute (solution);
 
   Vector<float> norm_per_cell (triangulation.n_active_cells());
   VectorTools::integrate_difference (mapping, dof_handler,
-                                    solution,
-                                    ZeroFunction<dim>(),
-                                    norm_per_cell,
-                                    QGauss<dim>(gauss_degree+1),
-                                    VectorTools::H1_seminorm);
+                                     solution,
+                                     ZeroFunction<dim>(),
+                                     norm_per_cell,
+                                     QGauss<dim>(gauss_degree+1),
+                                     VectorTools::H1_seminorm);
   const double norm = norm_per_cell.l2_norm();
 
   output_table.add_value ("cells", triangulation.n_active_cells());
@@ -179,7 +179,7 @@ void LaplaceProblem<dim>::assemble_and_solve ()
 
 
 template <int dim>
-void LaplaceProblem<dim>::solve () 
+void LaplaceProblem<dim>::solve ()
 {
   SolverControl           solver_control (1000, 1e-12);
   SolverCG<>              cg (solver_control);
@@ -188,18 +188,18 @@ void LaplaceProblem<dim>::solve ()
   preconditioner.initialize(system_matrix, 1.2);
 
   cg.solve (system_matrix, solution, system_rhs,
-           preconditioner);
+            preconditioner);
 }
 
 
 
 template <int dim>
-void LaplaceProblem<dim>::run () 
+void LaplaceProblem<dim>::run ()
 {
   GridGenerator::hyper_ball (triangulation);
   static const HyperBallBoundary<dim> boundary;
   triangulation.set_boundary (0, boundary);
-  
+
   for (unsigned int cycle=0; cycle<6; ++cycle, triangulation.refine_global(1))
     {
       setup_system ();
@@ -212,42 +212,42 @@ void LaplaceProblem<dim>::run ()
   deallog << std::endl;
 }
 
-    
 
-int main () 
+
+int main ()
 {
   try
     {
       deallog << std::setprecision(2);
-  
+
       deallog.attach(logfile);
       deallog.depth_console(0);
-      deallog.threshold_double(1.e-10);  
+      deallog.threshold_double(1.e-10);
 
       for (unsigned int mapping_degree=1; mapping_degree<=3; ++mapping_degree)
-       LaplaceProblem<2>(mapping_degree).run ();
+        LaplaceProblem<2>(mapping_degree).run ();
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 
index 5e0ff184d1afdd2b9820591f5a9f754019bcb315..1b079b537a96dbcdc090fe77c3fff2a0d5956016 100644 (file)
@@ -54,40 +54,40 @@ std::ofstream logfile("step-12/output");
 template <int dim>
 class RHS:  public Function<dim>
 {
-  public:
-    virtual void value_list (const std::vector<Point<dim> > &points,
-                            std::vector<double> &values,
-                            const unsigned int component=0) const;
+public:
+  virtual void value_list (const std::vector<Point<dim> > &points,
+                           std::vector<double> &values,
+                           const unsigned int component=0) const;
 };
 
 
 template <int dim>
 class BoundaryValues:  public Function<dim>
 {
-  public:
-    virtual void value_list (const std::vector<Point<dim> > &points,
-                            std::vector<double> &values,
-                            const unsigned int component=0) const;
+public:
+  virtual void value_list (const std::vector<Point<dim> > &points,
+                           std::vector<double> &values,
+                           const unsigned int component=0) const;
 };
 
 
 template <int dim>
 class Beta
 {
-  public:
-    Beta () {}
-    void value_list (const std::vector<Point<dim> > &points,
-                    std::vector<Point<dim> > &values) const;
+public:
+  Beta () {}
+  void value_list (const std::vector<Point<dim> > &points,
+                   std::vector<Point<dim> > &values) const;
 };
 
 
 template <int dim>
 void RHS<dim>::value_list(const std::vector<Point<dim> > &points,
-                         std::vector<double> &values,
-                         const unsigned int) const
+                          std::vector<double> &values,
+                          const unsigned int) const
 {
   Assert(values.size()==points.size(),
-        ExcDimensionMismatch(values.size(),points.size()));
+         ExcDimensionMismatch(values.size(),points.size()));
 
   for (unsigned int i=0; i<values.size(); ++i)
     values[i]=0;
@@ -96,10 +96,10 @@ void RHS<dim>::value_list(const std::vector<Point<dim> > &points,
 
 template <int dim>
 void Beta<dim>::value_list(const std::vector<Point<dim> > &points,
-                          std::vector<Point<dim> > &values) const
+                           std::vector<Point<dim> > &values) const
 {
   Assert(values.size()==points.size(),
-        ExcDimensionMismatch(values.size(),points.size()));
+         ExcDimensionMismatch(values.size(),points.size()));
 
   for (unsigned int i=0; i<points.size(); ++i)
     {
@@ -115,18 +115,18 @@ void Beta<dim>::value_list(const std::vector<Point<dim> > &points,
 
 template <int dim>
 void BoundaryValues<dim>::value_list(const std::vector<Point<dim> > &points,
-                                      std::vector<double> &values,
-                                      const unsigned int) const
+                                     std::vector<double> &values,
+                                     const unsigned int) const
 {
   Assert(values.size()==points.size(),
-        ExcDimensionMismatch(values.size(),points.size()));
+         ExcDimensionMismatch(values.size(),points.size()));
 
   for (unsigned int i=0; i<values.size(); ++i)
     {
       if (points[i](0)<0.5)
-       values[i]=1.;
+        values[i]=1.;
       else
-       values[i]=0.;
+        values[i]=0.;
     }
 }
 
@@ -134,41 +134,41 @@ void BoundaryValues<dim>::value_list(const std::vector<Point<dim> > &points,
 template <int dim>
 class DGTransportEquation
 {
-  public:
-    DGTransportEquation();
-
-    void assemble_cell_term(const FEValues<dim>& fe_v,
-                           FullMatrix<double> &ui_vi_matrix,
-                           Vector<double> &cell_vector) const;
-    
-    void assemble_boundary_term(const FEFaceValues<dim>& fe_v,
-                               FullMatrix<double> &ui_vi_matrix,
-                               Vector<double> &cell_vector) const;
-    
-    void assemble_face_term1(const FEFaceValuesBase<dim>& fe_v,
-                            const FEFaceValuesBase<dim>& fe_v_neighbor,
-                            FullMatrix<double> &ui_vi_matrix,
-                            FullMatrix<double> &ue_vi_matrix) const;
-
-    void assemble_face_term2(const FEFaceValuesBase<dim>& fe_v,
-                            const FEFaceValuesBase<dim>& fe_v_neighbor,
-                            FullMatrix<double> &ui_vi_matrix,
-                            FullMatrix<double> &ue_vi_matrix,
-                            FullMatrix<double> &ui_ve_matrix,
-                            FullMatrix<double> &ue_ve_matrix) const;
-  private:
-    const Beta<dim> beta_function;
-    const RHS<dim> rhs_function;
-    const BoundaryValues<dim> boundary_function;
+public:
+  DGTransportEquation();
+
+  void assemble_cell_term(const FEValues<dim> &fe_v,
+                          FullMatrix<double> &ui_vi_matrix,
+                          Vector<double> &cell_vector) const;
+
+  void assemble_boundary_term(const FEFaceValues<dim> &fe_v,
+                              FullMatrix<double> &ui_vi_matrix,
+                              Vector<double> &cell_vector) const;
+
+  void assemble_face_term1(const FEFaceValuesBase<dim> &fe_v,
+                           const FEFaceValuesBase<dim> &fe_v_neighbor,
+                           FullMatrix<double> &ui_vi_matrix,
+                           FullMatrix<double> &ue_vi_matrix) const;
+
+  void assemble_face_term2(const FEFaceValuesBase<dim> &fe_v,
+                           const FEFaceValuesBase<dim> &fe_v_neighbor,
+                           FullMatrix<double> &ui_vi_matrix,
+                           FullMatrix<double> &ue_vi_matrix,
+                           FullMatrix<double> &ui_ve_matrix,
+                           FullMatrix<double> &ue_ve_matrix) const;
+private:
+  const Beta<dim> beta_function;
+  const RHS<dim> rhs_function;
+  const BoundaryValues<dim> boundary_function;
 };
 
 
 template <int dim>
 DGTransportEquation<dim>::DGTransportEquation ()
-               :
-               beta_function (),
-               rhs_function (),
-               boundary_function ()
+  :
+  beta_function (),
+  rhs_function (),
+  boundary_function ()
 {}
 
 
@@ -182,26 +182,26 @@ void DGTransportEquation<dim>::assemble_cell_term(
 
   std::vector<Point<dim> > beta (fe_v.n_quadrature_points);
   std::vector<double> rhs (fe_v.n_quadrature_points);
-  
+
   beta_function.value_list (fe_v.get_quadrature_points(), beta);
   rhs_function.value_list (fe_v.get_quadrature_points(), rhs);
-  
+
   for (unsigned int point=0; point<fe_v.n_quadrature_points; ++point)
-    for (unsigned int i=0; i<fe_v.dofs_per_cell; ++i) 
+    for (unsigned int i=0; i<fe_v.dofs_per_cell; ++i)
       {
-       for (unsigned int j=0; j<fe_v.dofs_per_cell; ++j)
-         ui_vi_matrix(i,j) -= beta[point]*fe_v.shape_grad(i,point)*
-                             fe_v.shape_value(j,point) *
-                             JxW[point];
-       
-       cell_vector(i) += rhs[point] * fe_v.shape_value(i,point) * JxW[point];
+        for (unsigned int j=0; j<fe_v.dofs_per_cell; ++j)
+          ui_vi_matrix(i,j) -= beta[point]*fe_v.shape_grad(i,point)*
+                               fe_v.shape_value(j,point) *
+                               JxW[point];
+
+        cell_vector(i) += rhs[point] * fe_v.shape_value(i,point) * JxW[point];
       }
 }
 
 
 template <int dim>
 void DGTransportEquation<dim>::assemble_boundary_term(
-  const FEFaceValues<dim>& fe_v,    
+  const FEFaceValues<dim> &fe_v,
   FullMatrix<double> &ui_vi_matrix,
   Vector<double> &cell_vector) const
 {
@@ -210,34 +210,34 @@ void DGTransportEquation<dim>::assemble_boundary_term(
 
   std::vector<Point<dim> > beta (fe_v.n_quadrature_points);
   std::vector<double> g(fe_v.n_quadrature_points);
-  
+
   beta_function.value_list (fe_v.get_quadrature_points(), beta);
   boundary_function.value_list (fe_v.get_quadrature_points(), g);
 
   for (unsigned int point=0; point<fe_v.n_quadrature_points; ++point)
     {
-      const double beta_n=beta[point] * normals[point];      
+      const double beta_n=beta[point] * normals[point];
       if (beta_n>0)
-       for (unsigned int i=0; i<fe_v.dofs_per_cell; ++i)
-         for (unsigned int j=0; j<fe_v.dofs_per_cell; ++j)
-           ui_vi_matrix(i,j) += beta_n *
-                              fe_v.shape_value(j,point) *
-                              fe_v.shape_value(i,point) *
-                              JxW[point];
+        for (unsigned int i=0; i<fe_v.dofs_per_cell; ++i)
+          for (unsigned int j=0; j<fe_v.dofs_per_cell; ++j)
+            ui_vi_matrix(i,j) += beta_n *
+                                 fe_v.shape_value(j,point) *
+                                 fe_v.shape_value(i,point) *
+                                 JxW[point];
       else
-       for (unsigned int i=0; i<fe_v.dofs_per_cell; ++i)
-         cell_vector(i) -= beta_n *
-                           g[point] *
-                           fe_v.shape_value(i,point) *
-                           JxW[point];
+        for (unsigned int i=0; i<fe_v.dofs_per_cell; ++i)
+          cell_vector(i) -= beta_n *
+                            g[point] *
+                            fe_v.shape_value(i,point) *
+                            JxW[point];
     }
 }
 
 
 template <int dim>
 void DGTransportEquation<dim>::assemble_face_term1(
-  const FEFaceValuesBase<dim>fe_v,
-  const FEFaceValuesBase<dim>& fe_v_neighbor,      
+  const FEFaceValuesBase<dim> &fe_v,
+  const FEFaceValuesBase<dim> &fe_v_neighbor,
   FullMatrix<double> &ui_vi_matrix,
   FullMatrix<double> &ue_vi_matrix) const
 {
@@ -251,27 +251,27 @@ void DGTransportEquation<dim>::assemble_face_term1(
     {
       const double beta_n=beta[point] * normals[point];
       if (beta_n>0)
-       for (unsigned int i=0; i<fe_v.dofs_per_cell; ++i)
-         for (unsigned int j=0; j<fe_v.dofs_per_cell; ++j)
-           ui_vi_matrix(i,j) += beta_n *
-                              fe_v.shape_value(j,point) *
-                              fe_v.shape_value(i,point) *
-                              JxW[point];
+        for (unsigned int i=0; i<fe_v.dofs_per_cell; ++i)
+          for (unsigned int j=0; j<fe_v.dofs_per_cell; ++j)
+            ui_vi_matrix(i,j) += beta_n *
+                                 fe_v.shape_value(j,point) *
+                                 fe_v.shape_value(i,point) *
+                                 JxW[point];
       else
-       for (unsigned int i=0; i<fe_v.dofs_per_cell; ++i)
-         for (unsigned int k=0; k<fe_v_neighbor.dofs_per_cell; ++k)
-           ue_vi_matrix(i,k) += beta_n *
-                               fe_v_neighbor.shape_value(k,point) *
-                               fe_v.shape_value(i,point) *
-                               JxW[point];
+        for (unsigned int i=0; i<fe_v.dofs_per_cell; ++i)
+          for (unsigned int k=0; k<fe_v_neighbor.dofs_per_cell; ++k)
+            ue_vi_matrix(i,k) += beta_n *
+                                 fe_v_neighbor.shape_value(k,point) *
+                                 fe_v.shape_value(i,point) *
+                                 JxW[point];
     }
 }
 
 
 template <int dim>
 void DGTransportEquation<dim>::assemble_face_term2(
-  const FEFaceValuesBase<dim>fe_v,
-  const FEFaceValuesBase<dim>& fe_v_neighbor,      
+  const FEFaceValuesBase<dim> &fe_v,
+  const FEFaceValuesBase<dim> &fe_v_neighbor,
   FullMatrix<double> &ui_vi_matrix,
   FullMatrix<double> &ue_vi_matrix,
   FullMatrix<double> &ui_ve_matrix,
@@ -281,44 +281,44 @@ void DGTransportEquation<dim>::assemble_face_term2(
   const std::vector<Point<dim> > &normals = fe_v.get_normal_vectors ();
 
   std::vector<Point<dim> > beta (fe_v.n_quadrature_points);
-  
+
   beta_function.value_list (fe_v.get_quadrature_points(), beta);
 
   for (unsigned int point=0; point<fe_v.n_quadrature_points; ++point)
     {
       const double beta_n=beta[point] * normals[point];
       if (beta_n>0)
-       {
-         for (unsigned int i=0; i<fe_v.dofs_per_cell; ++i)
-           for (unsigned int j=0; j<fe_v.dofs_per_cell; ++j)
-             ui_vi_matrix(i,j) += beta_n *
-                                fe_v.shape_value(j,point) *
-                                fe_v.shape_value(i,point) *
-                                JxW[point];
-
-         for (unsigned int k=0; k<fe_v_neighbor.dofs_per_cell; ++k)
-           for (unsigned int j=0; j<fe_v.dofs_per_cell; ++j)
-             ui_ve_matrix(k,j) -= beta_n *
-                                 fe_v.shape_value(j,point) *
-                                 fe_v_neighbor.shape_value(k,point) *
-                                 JxW[point];
-       }
+        {
+          for (unsigned int i=0; i<fe_v.dofs_per_cell; ++i)
+            for (unsigned int j=0; j<fe_v.dofs_per_cell; ++j)
+              ui_vi_matrix(i,j) += beta_n *
+                                   fe_v.shape_value(j,point) *
+                                   fe_v.shape_value(i,point) *
+                                   JxW[point];
+
+          for (unsigned int k=0; k<fe_v_neighbor.dofs_per_cell; ++k)
+            for (unsigned int j=0; j<fe_v.dofs_per_cell; ++j)
+              ui_ve_matrix(k,j) -= beta_n *
+                                   fe_v.shape_value(j,point) *
+                                   fe_v_neighbor.shape_value(k,point) *
+                                   JxW[point];
+        }
       else
-       {
-         for (unsigned int i=0; i<fe_v.dofs_per_cell; ++i)
-           for (unsigned int l=0; l<fe_v_neighbor.dofs_per_cell; ++l)
-             ue_vi_matrix(i,l) += beta_n *
-                                 fe_v_neighbor.shape_value(l,point) *
-                                 fe_v.shape_value(i,point) *
-                                 JxW[point];
-
-         for (unsigned int k=0; k<fe_v_neighbor.dofs_per_cell; ++k)
-           for (unsigned int l=0; l<fe_v_neighbor.dofs_per_cell; ++l)
-             ue_ve_matrix(k,l) -= beta_n *
-                                  fe_v_neighbor.shape_value(l,point) *
-                                  fe_v_neighbor.shape_value(k,point) *
-                                  JxW[point];
-       }
+        {
+          for (unsigned int i=0; i<fe_v.dofs_per_cell; ++i)
+            for (unsigned int l=0; l<fe_v_neighbor.dofs_per_cell; ++l)
+              ue_vi_matrix(i,l) += beta_n *
+                                   fe_v_neighbor.shape_value(l,point) *
+                                   fe_v.shape_value(i,point) *
+                                   JxW[point];
+
+          for (unsigned int k=0; k<fe_v_neighbor.dofs_per_cell; ++k)
+            for (unsigned int l=0; l<fe_v_neighbor.dofs_per_cell; ++l)
+              ue_ve_matrix(k,l) -= beta_n *
+                                   fe_v_neighbor.shape_value(l,point) *
+                                   fe_v_neighbor.shape_value(k,point) *
+                                   JxW[point];
+        }
     }
 }
 
@@ -326,54 +326,54 @@ void DGTransportEquation<dim>::assemble_face_term2(
 template <int dim>
 class DGMethod
 {
-  public:
-    DGMethod ();
-    ~DGMethod ();
-
-    void run ();
-    
-  private:
-    void setup_system ();
-    void assemble_system1 ();
-    void assemble_system2 ();
-    void solve (Vector<double> &solution);
-    void refine_grid ();
-    void output_results (const unsigned int cycle) const;
-    
-    Triangulation<dim>   triangulation;
-    const MappingQ1<dim> mapping;
-    
-    FE_DGQ<dim>          fe;
-    DoFHandler<dim>      dof_handler;
-
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> system_matrix;
-
-    const QGauss<dim>   quadrature;
-    const QGauss<dim-1> face_quadrature;
-    
-    Vector<double>       solution1;
-    Vector<double>       solution2;
-    Vector<double>       right_hand_side;
-    
-    const DGTransportEquation<dim> dg;
+public:
+  DGMethod ();
+  ~DGMethod ();
+
+  void run ();
+
+private:
+  void setup_system ();
+  void assemble_system1 ();
+  void assemble_system2 ();
+  void solve (Vector<double> &solution);
+  void refine_grid ();
+  void output_results (const unsigned int cycle) const;
+
+  Triangulation<dim>   triangulation;
+  const MappingQ1<dim> mapping;
+
+  FE_DGQ<dim>          fe;
+  DoFHandler<dim>      dof_handler;
+
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> system_matrix;
+
+  const QGauss<dim>   quadrature;
+  const QGauss<dim-1> face_quadrature;
+
+  Vector<double>       solution1;
+  Vector<double>       solution2;
+  Vector<double>       right_hand_side;
+
+  const DGTransportEquation<dim> dg;
 };
 
 
 template <int dim>
 DGMethod<dim>::DGMethod ()
-               :
-               mapping (),
-                fe (1),
-               dof_handler (triangulation),
-               quadrature (4),
-               face_quadrature (4),
-               dg ()
+  :
+  mapping (),
+  fe (1),
+  dof_handler (triangulation),
+  quadrature (4),
+  face_quadrature (4),
+  dg ()
 {}
 
 
 template <int dim>
-DGMethod<dim>::~DGMethod () 
+DGMethod<dim>::~DGMethod ()
 {
   dof_handler.clear ();
 }
@@ -385,14 +385,14 @@ void DGMethod<dim>::setup_system ()
   dof_handler.distribute_dofs (fe);
 
   sparsity_pattern.reinit (dof_handler.n_dofs(),
-                          dof_handler.n_dofs(),
-                          (GeometryInfo<dim>::faces_per_cell
-                           *GeometryInfo<dim>::max_children_per_face+1)*fe.dofs_per_cell);
-  
+                           dof_handler.n_dofs(),
+                           (GeometryInfo<dim>::faces_per_cell
+                            *GeometryInfo<dim>::max_children_per_face+1)*fe.dofs_per_cell);
+
   DoFTools::make_flux_sparsity_pattern (dof_handler, sparsity_pattern);
-  
+
   sparsity_pattern.compress();
-  
+
   system_matrix.reinit (sparsity_pattern);
 
   solution1.reinit (dof_handler.n_dofs());
@@ -402,7 +402,7 @@ void DGMethod<dim>::setup_system ()
 
 
 template <int dim>
-void DGMethod<dim>::assemble_system1 () 
+void DGMethod<dim>::assemble_system1 ()
 {
   const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell;
   std::vector<types::global_dof_index> dofs (dofs_per_cell);
@@ -417,12 +417,12 @@ void DGMethod<dim>::assemble_system1 ()
                                         | update_q_points
                                         | update_JxW_values
                                         | update_normal_vectors;
-  
+
   const UpdateFlags neighbor_face_update_flags = update_values;
-   
+
   FEValues<dim> fe_v (
     mapping, fe, quadrature, update_flags);
-  
+
   FEFaceValues<dim> fe_v_face (
     mapping, fe, face_quadrature, face_update_flags);
   FESubfaceValues<dim> fe_v_subface (
@@ -438,137 +438,137 @@ void DGMethod<dim>::assemble_system1 ()
   Vector<double>  cell_vector (dofs_per_cell);
 
   typename DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
 
-  for (;cell!=endc; ++cell) 
+  for (; cell!=endc; ++cell)
     {
       ui_vi_matrix = 0;
       cell_vector = 0;
-      
+
       fe_v.reinit (cell);
 
       dg.assemble_cell_term(fe_v,
-                           ui_vi_matrix,
-                           cell_vector);
+                            ui_vi_matrix,
+                            cell_vector);
 
       cell->get_dof_indices (dofs);
 
       for (unsigned int face_no=0; face_no<GeometryInfo<dim>::faces_per_cell; ++face_no)
-       {
-         typename DoFHandler<dim>::face_iterator face=cell->face(face_no);
-         
-         ue_vi_matrix = 0;
-                 
-         if (face->at_boundary())
-           {
-             fe_v_face.reinit (cell, face_no);
-
-             dg.assemble_boundary_term(fe_v_face,
-                                       ui_vi_matrix,
-                                       cell_vector);
-           }
-         else
-           {
-             typename DoFHandler<dim>::cell_iterator neighbor=
-               cell->neighbor(face_no);;
-
-             if (face->has_children())
-               {
-                 const unsigned int neighbor2=
-                   cell->neighbor_of_neighbor(face_no);
-                 
-                 
-                 for (unsigned int subface_no=0;
-                      subface_no<face->n_children(); ++subface_no)
-                   {
-                     typename DoFHandler<dim>::active_cell_iterator
-                        neighbor_child
+        {
+          typename DoFHandler<dim>::face_iterator face=cell->face(face_no);
+
+          ue_vi_matrix = 0;
+
+          if (face->at_boundary())
+            {
+              fe_v_face.reinit (cell, face_no);
+
+              dg.assemble_boundary_term(fe_v_face,
+                                        ui_vi_matrix,
+                                        cell_vector);
+            }
+          else
+            {
+              typename DoFHandler<dim>::cell_iterator neighbor=
+                cell->neighbor(face_no);;
+
+              if (face->has_children())
+                {
+                  const unsigned int neighbor2=
+                    cell->neighbor_of_neighbor(face_no);
+
+
+                  for (unsigned int subface_no=0;
+                       subface_no<face->n_children(); ++subface_no)
+                    {
+                      typename DoFHandler<dim>::active_cell_iterator
+                      neighbor_child
                         = cell->neighbor_child_on_subface (face_no, subface_no);
-                     
-                     Assert (neighbor_child->face(neighbor2) == face->child(subface_no),
-                             ExcInternalError());
-                     Assert (!neighbor_child->has_children(), ExcInternalError());
-
-                     ue_vi_matrix = 0;
-                     
-                     fe_v_subface.reinit (cell, face_no, subface_no);
-                     fe_v_face_neighbor.reinit (neighbor_child, neighbor2);
-
-                     dg.assemble_face_term1(fe_v_subface,
-                                            fe_v_face_neighbor,
-                                            ui_vi_matrix,
-                                            ue_vi_matrix);
-                     
-                     neighbor_child->get_dof_indices (dofs_neighbor);
-                                                               
-                     for (unsigned int i=0; i<dofs_per_cell; ++i)
-                       for (unsigned int k=0; k<dofs_per_cell; ++k)
-                         system_matrix.add(dofs[i], dofs_neighbor[k],
-                                           ue_vi_matrix(i,k));
-                   }
-               }
-             else
-               {
-                 if (neighbor->level() == cell->level()) 
-                   {
-                     const unsigned int neighbor2=cell->neighbor_of_neighbor(face_no);
-
-                     fe_v_face.reinit (cell, face_no);
-                     fe_v_face_neighbor.reinit (neighbor, neighbor2);
-                     
-                     dg.assemble_face_term1(fe_v_face,
-                                            fe_v_face_neighbor,
-                                            ui_vi_matrix,
-                                            ue_vi_matrix);
-                   }
-                 else
-                   {
-                     Assert(neighbor->level() < cell->level(), ExcInternalError());
-
-                     const std::pair<unsigned int, unsigned int> faceno_subfaceno=
-                       cell->neighbor_of_coarser_neighbor(face_no);
-                     const unsigned int neighbor_face_no=faceno_subfaceno.first,
-                                     neighbor_subface_no=faceno_subfaceno.second;
-
-                     Assert (neighbor->neighbor_child_on_subface (neighbor_face_no,
+
+                      Assert (neighbor_child->face(neighbor2) == face->child(subface_no),
+                              ExcInternalError());
+                      Assert (!neighbor_child->has_children(), ExcInternalError());
+
+                      ue_vi_matrix = 0;
+
+                      fe_v_subface.reinit (cell, face_no, subface_no);
+                      fe_v_face_neighbor.reinit (neighbor_child, neighbor2);
+
+                      dg.assemble_face_term1(fe_v_subface,
+                                             fe_v_face_neighbor,
+                                             ui_vi_matrix,
+                                             ue_vi_matrix);
+
+                      neighbor_child->get_dof_indices (dofs_neighbor);
+
+                      for (unsigned int i=0; i<dofs_per_cell; ++i)
+                        for (unsigned int k=0; k<dofs_per_cell; ++k)
+                          system_matrix.add(dofs[i], dofs_neighbor[k],
+                                            ue_vi_matrix(i,k));
+                    }
+                }
+              else
+                {
+                  if (neighbor->level() == cell->level())
+                    {
+                      const unsigned int neighbor2=cell->neighbor_of_neighbor(face_no);
+
+                      fe_v_face.reinit (cell, face_no);
+                      fe_v_face_neighbor.reinit (neighbor, neighbor2);
+
+                      dg.assemble_face_term1(fe_v_face,
+                                             fe_v_face_neighbor,
+                                             ui_vi_matrix,
+                                             ue_vi_matrix);
+                    }
+                  else
+                    {
+                      Assert(neighbor->level() < cell->level(), ExcInternalError());
+
+                      const std::pair<unsigned int, unsigned int> faceno_subfaceno=
+                        cell->neighbor_of_coarser_neighbor(face_no);
+                      const unsigned int neighbor_face_no=faceno_subfaceno.first,
+                                         neighbor_subface_no=faceno_subfaceno.second;
+
+                      Assert (neighbor->neighbor_child_on_subface (neighbor_face_no,
                                                                    neighbor_subface_no)
                               == cell,
                               ExcInternalError());
 
-                     fe_v_face.reinit (cell, face_no);
-                     fe_v_subface_neighbor.reinit (neighbor, neighbor_face_no,
-                                                   neighbor_subface_no);
-                     
-                     dg.assemble_face_term1(fe_v_face,
-                                            fe_v_subface_neighbor,
-                                            ui_vi_matrix,
-                                            ue_vi_matrix);
-                   }
-
-                 neighbor->get_dof_indices (dofs_neighbor);
-                                                               
-                 for (unsigned int i=0; i<dofs_per_cell; ++i)
-                   for (unsigned int k=0; k<dofs_per_cell; ++k)
-                     system_matrix.add(dofs[i], dofs_neighbor[k],
-                                       ue_vi_matrix(i,k));
-               }
-           }
-       }
-      
+                      fe_v_face.reinit (cell, face_no);
+                      fe_v_subface_neighbor.reinit (neighbor, neighbor_face_no,
+                                                    neighbor_subface_no);
+
+                      dg.assemble_face_term1(fe_v_face,
+                                             fe_v_subface_neighbor,
+                                             ui_vi_matrix,
+                                             ue_vi_matrix);
+                    }
+
+                  neighbor->get_dof_indices (dofs_neighbor);
+
+                  for (unsigned int i=0; i<dofs_per_cell; ++i)
+                    for (unsigned int k=0; k<dofs_per_cell; ++k)
+                      system_matrix.add(dofs[i], dofs_neighbor[k],
+                                        ue_vi_matrix(i,k));
+                }
+            }
+        }
+
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int j=0; j<dofs_per_cell; ++j)
-         system_matrix.add(dofs[i], dofs[j], ui_vi_matrix(i,j));
-      
+        for (unsigned int j=0; j<dofs_per_cell; ++j)
+          system_matrix.add(dofs[i], dofs[j], ui_vi_matrix(i,j));
+
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       right_hand_side(dofs[i]) += cell_vector(i);
+        right_hand_side(dofs[i]) += cell_vector(i);
     }
 }
 
 
 
 template <int dim>
-void DGMethod<dim>::assemble_system2 () 
+void DGMethod<dim>::assemble_system2 ()
 {
   const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell;
   std::vector<types::global_dof_index> dofs (dofs_per_cell);
@@ -578,12 +578,12 @@ void DGMethod<dim>::assemble_system2 ()
                                    | update_gradients
                                    | update_q_points
                                    | update_JxW_values;
-  
+
   const UpdateFlags face_update_flags = update_values
                                         | update_q_points
                                         | update_JxW_values
                                         | update_normal_vectors;
-  
+
   const UpdateFlags neighbor_face_update_flags = update_values;
 
   FEValues<dim> fe_v (
@@ -598,16 +598,16 @@ void DGMethod<dim>::assemble_system2 ()
 
   FullMatrix<double> ui_vi_matrix (dofs_per_cell, dofs_per_cell);
   FullMatrix<double> ue_vi_matrix (dofs_per_cell, dofs_per_cell);
-  
+
   FullMatrix<double> ui_ve_matrix (dofs_per_cell, dofs_per_cell);
   FullMatrix<double> ue_ve_matrix (dofs_per_cell, dofs_per_cell);
-  
+
   Vector<double>  cell_vector (dofs_per_cell);
 
   typename DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
-  for (;cell!=endc; ++cell) 
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
+  for (; cell!=endc; ++cell)
     {
       ui_vi_matrix = 0;
       cell_vector = 0;
@@ -615,123 +615,123 @@ void DGMethod<dim>::assemble_system2 ()
       fe_v.reinit (cell);
 
       dg.assemble_cell_term(fe_v,
-                           ui_vi_matrix,
-                           cell_vector);
-      
+                            ui_vi_matrix,
+                            cell_vector);
+
       cell->get_dof_indices (dofs);
 
       for (unsigned int face_no=0; face_no<GeometryInfo<dim>::faces_per_cell; ++face_no)
-       {
-         typename DoFHandler<dim>::face_iterator face=
-           cell->face(face_no);
-
-         if (face->at_boundary())
-           {
-             fe_v_face.reinit (cell, face_no);
-
-             dg.assemble_boundary_term(fe_v_face,
-                                       ui_vi_matrix,
-                                       cell_vector);
-           }
-         else
-           {
-             Assert (cell->neighbor(face_no).state() == IteratorState::valid,
-                     ExcInternalError());
-             typename DoFHandler<dim>::cell_iterator neighbor=
-               cell->neighbor(face_no);
-             if (face->has_children())
-               {
-                 const unsigned int neighbor2=
-                   cell->neighbor_of_neighbor(face_no);
-                 
-                 for (unsigned int subface_no=0;
-                      subface_no<face->n_children(); ++subface_no)
-                   {
-                     typename DoFHandler<dim>::cell_iterator neighbor_child
+        {
+          typename DoFHandler<dim>::face_iterator face=
+            cell->face(face_no);
+
+          if (face->at_boundary())
+            {
+              fe_v_face.reinit (cell, face_no);
+
+              dg.assemble_boundary_term(fe_v_face,
+                                        ui_vi_matrix,
+                                        cell_vector);
+            }
+          else
+            {
+              Assert (cell->neighbor(face_no).state() == IteratorState::valid,
+                      ExcInternalError());
+              typename DoFHandler<dim>::cell_iterator neighbor=
+                cell->neighbor(face_no);
+              if (face->has_children())
+                {
+                  const unsigned int neighbor2=
+                    cell->neighbor_of_neighbor(face_no);
+
+                  for (unsigned int subface_no=0;
+                       subface_no<face->n_children(); ++subface_no)
+                    {
+                      typename DoFHandler<dim>::cell_iterator neighbor_child
                         = cell->neighbor_child_on_subface (face_no, subface_no);
-                     Assert (neighbor_child->face(neighbor2) == face->child(subface_no),
-                             ExcInternalError());
-                     Assert (!neighbor_child->has_children(), ExcInternalError());
-                     
-                     ue_vi_matrix = 0;
-                     ui_ve_matrix = 0;
-                     ue_ve_matrix = 0;
-                     
-                     fe_v_subface.reinit (cell, face_no, subface_no);
-                     fe_v_face_neighbor.reinit (neighbor_child, neighbor2);
-
-                     dg.assemble_face_term2(fe_v_subface,
-                                            fe_v_face_neighbor,
-                                            ui_vi_matrix,
-                                            ue_vi_matrix,
-                                            ui_ve_matrix,
-                                            ue_ve_matrix);
-                 
-                     neighbor_child->get_dof_indices (dofs_neighbor);
-                                                               
-                     for (unsigned int i=0; i<dofs_per_cell; ++i)
-                       for (unsigned int j=0; j<dofs_per_cell; ++j)
-                         {
-                           system_matrix.add(dofs[i], dofs_neighbor[j],
-                                             ue_vi_matrix(i,j));
-                           system_matrix.add(dofs_neighbor[i], dofs[j],
-                                             ui_ve_matrix(i,j));
-                           system_matrix.add(dofs_neighbor[i], dofs_neighbor[j],
-                                             ue_ve_matrix(i,j));
-                         }
-                   }
-               }
-             else
-               {
-                 if (neighbor->level() == cell->level() &&
-                     neighbor->index() > cell->index()) 
-                   {
-                     const unsigned int neighbor2=cell->neighbor_of_neighbor(face_no);
-                     
-                     ue_vi_matrix = 0;
-                     ui_ve_matrix = 0;
-                     ue_ve_matrix = 0;
-                     
-                     fe_v_face.reinit (cell, face_no);
-                     fe_v_face_neighbor.reinit (neighbor, neighbor2);
-                     
-                     dg.assemble_face_term2(fe_v_face,
-                                            fe_v_face_neighbor,
-                                            ui_vi_matrix,
-                                            ue_vi_matrix,
-                                            ui_ve_matrix,
-                                            ue_ve_matrix);
-
-                     neighbor->get_dof_indices (dofs_neighbor);
-
-                     for (unsigned int i=0; i<dofs_per_cell; ++i)
-                       for (unsigned int j=0; j<dofs_per_cell; ++j)
-                         {
-                           system_matrix.add(dofs[i], dofs_neighbor[j],
-                                             ue_vi_matrix(i,j));
-                           system_matrix.add(dofs_neighbor[i], dofs[j],
-                                             ui_ve_matrix(i,j));
-                           system_matrix.add(dofs_neighbor[i], dofs_neighbor[j],
-                                             ue_ve_matrix(i,j));
-                         }
-                   }
-
-               }
-           }
-       }
-      
+                      Assert (neighbor_child->face(neighbor2) == face->child(subface_no),
+                              ExcInternalError());
+                      Assert (!neighbor_child->has_children(), ExcInternalError());
+
+                      ue_vi_matrix = 0;
+                      ui_ve_matrix = 0;
+                      ue_ve_matrix = 0;
+
+                      fe_v_subface.reinit (cell, face_no, subface_no);
+                      fe_v_face_neighbor.reinit (neighbor_child, neighbor2);
+
+                      dg.assemble_face_term2(fe_v_subface,
+                                             fe_v_face_neighbor,
+                                             ui_vi_matrix,
+                                             ue_vi_matrix,
+                                             ui_ve_matrix,
+                                             ue_ve_matrix);
+
+                      neighbor_child->get_dof_indices (dofs_neighbor);
+
+                      for (unsigned int i=0; i<dofs_per_cell; ++i)
+                        for (unsigned int j=0; j<dofs_per_cell; ++j)
+                          {
+                            system_matrix.add(dofs[i], dofs_neighbor[j],
+                                              ue_vi_matrix(i,j));
+                            system_matrix.add(dofs_neighbor[i], dofs[j],
+                                              ui_ve_matrix(i,j));
+                            system_matrix.add(dofs_neighbor[i], dofs_neighbor[j],
+                                              ue_ve_matrix(i,j));
+                          }
+                    }
+                }
+              else
+                {
+                  if (neighbor->level() == cell->level() &&
+                      neighbor->index() > cell->index())
+                    {
+                      const unsigned int neighbor2=cell->neighbor_of_neighbor(face_no);
+
+                      ue_vi_matrix = 0;
+                      ui_ve_matrix = 0;
+                      ue_ve_matrix = 0;
+
+                      fe_v_face.reinit (cell, face_no);
+                      fe_v_face_neighbor.reinit (neighbor, neighbor2);
+
+                      dg.assemble_face_term2(fe_v_face,
+                                             fe_v_face_neighbor,
+                                             ui_vi_matrix,
+                                             ue_vi_matrix,
+                                             ui_ve_matrix,
+                                             ue_ve_matrix);
+
+                      neighbor->get_dof_indices (dofs_neighbor);
+
+                      for (unsigned int i=0; i<dofs_per_cell; ++i)
+                        for (unsigned int j=0; j<dofs_per_cell; ++j)
+                          {
+                            system_matrix.add(dofs[i], dofs_neighbor[j],
+                                              ue_vi_matrix(i,j));
+                            system_matrix.add(dofs_neighbor[i], dofs[j],
+                                              ui_ve_matrix(i,j));
+                            system_matrix.add(dofs_neighbor[i], dofs_neighbor[j],
+                                              ue_ve_matrix(i,j));
+                          }
+                    }
+
+                }
+            }
+        }
+
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int j=0; j<dofs_per_cell; ++j)
-         system_matrix.add(dofs[i], dofs[j], ui_vi_matrix(i,j));
-      
+        for (unsigned int j=0; j<dofs_per_cell; ++j)
+          system_matrix.add(dofs[i], dofs[j], ui_vi_matrix(i,j));
+
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       right_hand_side(dofs[i]) += cell_vector(i);
+        right_hand_side(dofs[i]) += cell_vector(i);
     }
 }
 
 
 template <int dim>
-void DGMethod<dim>::solve (Vector<double> &solution) 
+void DGMethod<dim>::solve (Vector<double> &solution)
 {
   SolverControl           solver_control (1000, 1e-12, false, false);
   SolverRichardson<>      solver (solver_control);
@@ -741,7 +741,7 @@ void DGMethod<dim>::solve (Vector<double> &solution)
   preconditioner.initialize(system_matrix, fe.dofs_per_cell);
 
   solver.solve (system_matrix, solution, right_hand_side,
-               preconditioner);
+                preconditioner);
 }
 
 
@@ -751,19 +751,19 @@ void DGMethod<dim>::refine_grid ()
   Vector<float> gradient_indicator (triangulation.n_active_cells());
 
   DerivativeApproximation::approximate_gradient (mapping,
-                                                dof_handler,
-                                                solution2,
-                                                gradient_indicator);
+                                                 dof_handler,
+                                                 solution2,
+                                                 gradient_indicator);
 
   typename DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (unsigned int cell_no=0; cell!=endc; ++cell, ++cell_no)
     gradient_indicator(cell_no)*=std::pow(cell->diameter(), 1+1.0*dim/2);
 
   GridRefinement::refine_and_coarsen_fixed_number (triangulation,
-                                                  gradient_indicator,
-                                                  0.3, 0.1);
+                                                   gradient_indicator,
+                                                   0.3, 0.1);
 
   triangulation.execute_coarsening_and_refinement ();
 }
@@ -775,57 +775,57 @@ void DGMethod<dim>::output_results (const unsigned int cycle) const
   std::string filename = "grid-";
   filename += ('0' + cycle);
   Assert (cycle < 10, ExcInternalError());
-  
+
   filename += ".eps";
   deallog << "Writing grid to <" << filename << ">..." << std::endl;
-  
+
   GridOut grid_out;
   grid_out.write_eps (triangulation, deallog.get_file_stream());
-  
+
   filename = "sol-";
   filename += ('0' + cycle);
   Assert (cycle < 10, ExcInternalError());
-  
+
   filename += ".gnuplot";
   deallog << "Writing solution to <" << filename << ">..."
-           << std::endl << std::endl;
-  
+          << std::endl << std::endl;
+
   DataOut<dim> data_out;
   data_out.attach_dof_handler (dof_handler);
   data_out.add_data_vector (solution2, "u");
 
   data_out.build_patches ();
-  
+
   data_out.write_gnuplot(deallog.get_file_stream());
 }
 
 
 template <int dim>
-void DGMethod<dim>::run () 
+void DGMethod<dim>::run ()
 {
   for (unsigned int cycle=0; cycle<4; ++cycle)
     {
       deallog << "Cycle " << cycle << ':' << std::endl;
 
       if (cycle == 0)
-       {
-         GridGenerator::hyper_cube (triangulation);
+        {
+          GridGenerator::hyper_cube (triangulation);
 
-         triangulation.refine_global (2);
-       }
+          triangulation.refine_global (2);
+        }
       else
-       refine_grid ();
-      
+        refine_grid ();
+
 
       deallog << "   Number of active cells:       "
-               << triangulation.n_active_cells()
-               << std::endl;
+              << triangulation.n_active_cells()
+              << std::endl;
 
       setup_system ();
 
       deallog << "   Number of degrees of freedom: "
-               << dof_handler.n_dofs()
-               << std::endl;
+              << dof_handler.n_dofs()
+              << std::endl;
 
       Timer assemble_timer;
       assemble_system1 ();
@@ -842,24 +842,24 @@ void DGMethod<dim>::run ()
       solution1-=solution2;
       const double difference=solution1.linfty_norm();
       if (difference>1e-13)
-       deallog << "solution1 and solution2 differ!!" << std::endl;
+        deallog << "solution1 and solution2 differ!!" << std::endl;
       else
-       deallog << "solution1 and solution2 coincide." << std::endl;
-       
+        deallog << "solution1 and solution2 coincide." << std::endl;
+
       output_results (cycle);
     }
 }
 
-int main () 
+int main ()
 {
   try
     {
       deallog << std::setprecision(2);
       logfile << std::setprecision(2);
-  
+
       deallog.attach(logfile);
       deallog.depth_console(0);
-      deallog.threshold_double(1.e-10);  
+      deallog.threshold_double(1.e-10);
 
       DGMethod<2> dgmethod;
       dgmethod.run ();
@@ -867,27 +867,27 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
-  
+
   return 0;
 }
 
index 4ff2bcf5ef4c844607974765f7f8db4f3d2f5042..67fc18385c29ded41fe8375ad8e8128f1998e874 100644 (file)
@@ -63,26 +63,26 @@ namespace Evaluation
 {
 
   template <int dim>
-  class EvaluationBase 
+  class EvaluationBase
   {
-    public:
-      virtual ~EvaluationBase ();
-
-      void set_refinement_cycle (const unsigned int refinement_cycle);
-      
-      virtual void operator () (const DoFHandler<dim> &dof_handler,
-                               const Vector<double>  &solution) const = 0;
-    protected:
-      unsigned int refinement_cycle;
+  public:
+    virtual ~EvaluationBase ();
+
+    void set_refinement_cycle (const unsigned int refinement_cycle);
+
+    virtual void operator () (const DoFHandler<dim> &dof_handler,
+                              const Vector<double>  &solution) const = 0;
+  protected:
+    unsigned int refinement_cycle;
   };
 
 
   template <int dim>
   EvaluationBase<dim>::~EvaluationBase ()
   {}
-  
 
-  
+
+
   template <int dim>
   void
   EvaluationBase<dim>::set_refinement_cycle (const unsigned int step)
@@ -95,61 +95,61 @@ namespace Evaluation
   template <int dim>
   class PointValueEvaluation : public EvaluationBase<dim>
   {
-    public:
-      PointValueEvaluation (const Point<dim>   &evaluation_point,
-                           TableHandler       &results_table);
-      
-      virtual void operator () (const DoFHandler<dim> &dof_handler,
-                               const Vector<double>  &solution) const;
-      
-      DeclException1 (ExcEvaluationPointNotFound,
-                     Point<dim>,
-                     << "The evaluation point " << arg1
-                     << " was not found among the vertices of the present grid.");
-    private:
-      const Point<dim>  evaluation_point;
-      TableHandler     &results_table;
+  public:
+    PointValueEvaluation (const Point<dim>   &evaluation_point,
+                          TableHandler       &results_table);
+
+    virtual void operator () (const DoFHandler<dim> &dof_handler,
+                              const Vector<double>  &solution) const;
+
+    DeclException1 (ExcEvaluationPointNotFound,
+                    Point<dim>,
+                    << "The evaluation point " << arg1
+                    << " was not found among the vertices of the present grid.");
+  private:
+    const Point<dim>  evaluation_point;
+    TableHandler     &results_table;
   };
 
 
   template <int dim>
   PointValueEvaluation<dim>::
   PointValueEvaluation (const Point<dim>   &evaluation_point,
-                       TableHandler       &results_table)
-                 :
-                 evaluation_point (evaluation_point),
-                 results_table (results_table)
+                        TableHandler       &results_table)
+    :
+    evaluation_point (evaluation_point),
+    results_table (results_table)
   {}
-  
+
 
 
   template <int dim>
   void
   PointValueEvaluation<dim>::
   operator () (const DoFHandler<dim> &dof_handler,
-              const Vector<double>  &solution) const 
+               const Vector<double>  &solution) const
   {
     double point_value = 1e20;
 
     typename DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     bool evaluation_point_found = false;
     for (; (cell!=endc) && !evaluation_point_found; ++cell)
       for (unsigned int vertex=0;
-          vertex<GeometryInfo<dim>::vertices_per_cell;
-          ++vertex)
-       if (cell->vertex(vertex) == evaluation_point)
-         {
-           point_value = solution(cell->vertex_dof_index(vertex,0));
+           vertex<GeometryInfo<dim>::vertices_per_cell;
+           ++vertex)
+        if (cell->vertex(vertex) == evaluation_point)
+          {
+            point_value = solution(cell->vertex_dof_index(vertex,0));
 
-           evaluation_point_found = true;
-           break;
-         };
+            evaluation_point_found = true;
+            break;
+          };
 
     AssertThrow (evaluation_point_found,
-                ExcEvaluationPointNotFound(evaluation_point));
-    
+                 ExcEvaluationPointNotFound(evaluation_point));
+
     results_table.add_value ("DoFs", dof_handler.n_dofs());
     results_table.add_value ("u(x_0)", point_value);
   }
@@ -161,53 +161,53 @@ namespace Evaluation
   template <int dim>
   class SolutionOutput : public EvaluationBase<dim>
   {
-    public:
-      SolutionOutput (const std::string                         &output_name_base,
-                     const typename DataOut<dim>::OutputFormat  output_format);
-      
-      virtual void operator () (const DoFHandler<dim> &dof_handler,
-                               const Vector<double>  &solution) const;
-    private:
-      const std::string                         output_name_base;
-      const typename DataOut<dim>::OutputFormat output_format;
+  public:
+    SolutionOutput (const std::string                         &output_name_base,
+                    const typename DataOut<dim>::OutputFormat  output_format);
+
+    virtual void operator () (const DoFHandler<dim> &dof_handler,
+                              const Vector<double>  &solution) const;
+  private:
+    const std::string                         output_name_base;
+    const typename DataOut<dim>::OutputFormat output_format;
   };
 
 
   template <int dim>
   SolutionOutput<dim>::
   SolutionOutput (const std::string                         &output_name_base,
-                 const typename DataOut<dim>::OutputFormat  output_format)
-                 :
-                 output_name_base (output_name_base),
-                 output_format (output_format)
+                  const typename DataOut<dim>::OutputFormat  output_format)
+    :
+    output_name_base (output_name_base),
+    output_format (output_format)
   {}
-  
+
 
   template <int dim>
   void
   SolutionOutput<dim>::operator () (const DoFHandler<dim> &,
-                                   const Vector<double>  &) const
+                                    const Vector<double> &) const
   {
 //     DataOut<dim> data_out;
 //     data_out.attach_dof_handler (dof_handler);
 //     data_out.add_data_vector (solution, "solution");
 //     data_out.build_patches ();
-  
+
 //     std::ostringstream filename;
 //     filename << output_name_base << "-"
-//          << this->refinement_cycle
-//          << data_out.default_suffix (output_format)
-//          << std::ends;
-    
+//       << this->refinement_cycle
+//       << data_out.default_suffix (output_format)
+//       << std::ends;
+
 //    data_out.write (deallog.get_file_stream(), output_format);
   }
 
 
 
-  
+
 }
 
-  
+
 
 namespace LaplaceSolver
 {
@@ -215,106 +215,106 @@ namespace LaplaceSolver
   template <int dim>
   class Base
   {
-    public:
-      Base (Triangulation<dim> &coarse_grid);
-      virtual ~Base ();
-
-      virtual void solve_problem () = 0;
-      virtual void postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const = 0;
-      virtual void refine_grid () = 0;
-      virtual unsigned int n_dofs () const = 0;
-      
-    protected:
-      const SmartPointer<Triangulation<dim> > triangulation;
+  public:
+    Base (Triangulation<dim> &coarse_grid);
+    virtual ~Base ();
+
+    virtual void solve_problem () = 0;
+    virtual void postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const = 0;
+    virtual void refine_grid () = 0;
+    virtual unsigned int n_dofs () const = 0;
+
+  protected:
+    const SmartPointer<Triangulation<dim> > triangulation;
   };
 
 
   template <int dim>
   Base<dim>::Base (Triangulation<dim> &coarse_grid)
-                 :
-                 triangulation (&coarse_grid)
+    :
+    triangulation (&coarse_grid)
   {}
 
 
   template <int dim>
-  Base<dim>::~Base () 
+  Base<dim>::~Base ()
   {}
-  
+
 
 
   template <int dim>
   class Solver : public virtual Base<dim>
   {
-    public:
-      Solver (Triangulation<dim>       &triangulation,
-             const FiniteElement<dim> &fe,
-             const Quadrature<dim>    &quadrature,
-             const Function<dim>      &boundary_values);
-      virtual
-      ~Solver ();
-
-      virtual
-      void
-      solve_problem ();
-
-      virtual
-      void
-      postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const;
-
-      virtual
-      unsigned int
-      n_dofs () const;
-      
-    protected:
-      const SmartPointer<const FiniteElement<dim> >  fe;
-      const SmartPointer<const Quadrature<dim> >     quadrature;
-      DoFHandler<dim>                                dof_handler;
-      Vector<double>                                 solution;
-      const SmartPointer<const Function<dim> >       boundary_values;
-
-      virtual void assemble_rhs (Vector<double> &rhs) const = 0;
-    
-    private:
-      struct LinearSystem
-      {
-         LinearSystem (const DoFHandler<dim> &dof_handler);
-
-         void solve (Vector<double> &solution) const;
-       
-         ConstraintMatrix     hanging_node_constraints;
-         SparsityPattern      sparsity_pattern;
-         SparseMatrix<double> matrix;
-         Vector<double>       rhs;
-      };
+  public:
+    Solver (Triangulation<dim>       &triangulation,
+            const FiniteElement<dim> &fe,
+            const Quadrature<dim>    &quadrature,
+            const Function<dim>      &boundary_values);
+    virtual
+    ~Solver ();
+
+    virtual
+    void
+    solve_problem ();
+
+    virtual
+    void
+    postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const;
+
+    virtual
+    unsigned int
+    n_dofs () const;
+
+  protected:
+    const SmartPointer<const FiniteElement<dim> >  fe;
+    const SmartPointer<const Quadrature<dim> >     quadrature;
+    DoFHandler<dim>                                dof_handler;
+    Vector<double>                                 solution;
+    const SmartPointer<const Function<dim> >       boundary_values;
+
+    virtual void assemble_rhs (Vector<double> &rhs) const = 0;
+
+  private:
+    struct LinearSystem
+    {
+      LinearSystem (const DoFHandler<dim> &dof_handler);
+
+      void solve (Vector<double> &solution) const;
 
-      void
-      assemble_linear_system (LinearSystem &linear_system);
+      ConstraintMatrix     hanging_node_constraints;
+      SparsityPattern      sparsity_pattern;
+      SparseMatrix<double> matrix;
+      Vector<double>       rhs;
+    };
 
-      void
-      assemble_matrix (LinearSystem                                         &linear_system,
-                      const typename DoFHandler<dim>::active_cell_iterator &begin_cell,
-                      const typename DoFHandler<dim>::active_cell_iterator &end_cell,
-                      Threads::ThreadMutex                                 &mutex) const;
+    void
+    assemble_linear_system (LinearSystem &linear_system);
+
+    void
+    assemble_matrix (LinearSystem                                         &linear_system,
+                     const typename DoFHandler<dim>::active_cell_iterator &begin_cell,
+                     const typename DoFHandler<dim>::active_cell_iterator &end_cell,
+                     Threads::ThreadMutex                                 &mutex) const;
   };
 
 
 
   template <int dim>
   Solver<dim>::Solver (Triangulation<dim>       &triangulation,
-                      const FiniteElement<dim> &fe,
-                      const Quadrature<dim>    &quadrature,
-                      const Function<dim>      &boundary_values)
-                 :
-                 Base<dim> (triangulation),
-                 fe (&fe),
-                  quadrature (&quadrature),
-                 dof_handler (triangulation),
-                 boundary_values (&boundary_values)
+                       const FiniteElement<dim> &fe,
+                       const Quadrature<dim>    &quadrature,
+                       const Function<dim>      &boundary_values)
+    :
+    Base<dim> (triangulation),
+    fe (&fe),
+    quadrature (&quadrature),
+    dof_handler (triangulation),
+    boundary_values (&boundary_values)
   {}
 
 
   template <int dim>
-  Solver<dim>::~Solver () 
+  Solver<dim>::~Solver ()
   {
     dof_handler.clear ();
   }
@@ -348,22 +348,22 @@ namespace LaplaceSolver
   {
     return dof_handler.n_dofs();
   }
-  
+
 
   template <int dim>
   void
   Solver<dim>::assemble_linear_system (LinearSystem &linear_system)
   {
     typedef
-      typename DoFHandler<dim>::active_cell_iterator
-      active_cell_iterator;
+    typename DoFHandler<dim>::active_cell_iterator
+    active_cell_iterator;
 
     const unsigned int n_threads = multithread_info.n_default_threads;
     std::vector<std::pair<active_cell_iterator,active_cell_iterator> >
-      thread_ranges 
+    thread_ranges
       = Threads::split_range<active_cell_iterator> (dof_handler.begin_active (),
-                                                   dof_handler.end (),
-                                                   n_threads);
+                                                    dof_handler.end (),
+                                                    n_threads);
 
     Threads::ThreadMutex mutex;
     Threads::ThreadGroup<> threads;
@@ -379,18 +379,18 @@ namespace LaplaceSolver
 
     std::map<types::global_dof_index,double> boundary_value_map;
     VectorTools::interpolate_boundary_values (dof_handler,
-                                             0,
-                                             *boundary_values,
-                                             boundary_value_map);
-    
-    
+                                              0,
+                                              *boundary_values,
+                                              boundary_value_map);
+
+
     threads.join_all ();
     linear_system.hanging_node_constraints.condense (linear_system.matrix);
 
     MatrixTools::apply_boundary_values (boundary_value_map,
-                                       linear_system.matrix,
-                                       solution,
-                                       linear_system.rhs);
+                                        linear_system.matrix,
+                                        solution,
+                                        linear_system.rhs);
 
   }
 
@@ -398,12 +398,12 @@ namespace LaplaceSolver
   template <int dim>
   void
   Solver<dim>::assemble_matrix (LinearSystem                                         &linear_system,
-                               const typename DoFHandler<dim>::active_cell_iterator &begin_cell,
-                               const typename DoFHandler<dim>::active_cell_iterator &end_cell,
-                               Threads::ThreadMutex                                 &mutex) const
+                                const typename DoFHandler<dim>::active_cell_iterator &begin_cell,
+                                const typename DoFHandler<dim>::active_cell_iterator &end_cell,
+                                Threads::ThreadMutex                                 &mutex) const
   {
-    FEValues<dim> fe_values (*fe, *quadrature, 
-                            update_gradients | update_JxW_values);
+    FEValues<dim> fe_values (*fe, *quadrature,
+                             update_gradients | update_JxW_values);
 
     const unsigned int   dofs_per_cell = fe->dofs_per_cell;
     const unsigned int   n_q_points    = quadrature->size();
@@ -413,28 +413,28 @@ namespace LaplaceSolver
     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)
+         cell!=end_cell; ++cell)
       {
-       cell_matrix = 0;
+        cell_matrix = 0;
 
-       fe_values.reinit (cell);
+        fe_values.reinit (cell);
 
-       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-         for (unsigned int i=0; i<dofs_per_cell; ++i)
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += (fe_values.shape_grad(i,q_point) *
-                                  fe_values.shape_grad(j,q_point) *
-                                  fe_values.JxW(q_point));
+        for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+          for (unsigned int i=0; i<dofs_per_cell; ++i)
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += (fe_values.shape_grad(i,q_point) *
+                                   fe_values.shape_grad(j,q_point) *
+                                   fe_values.JxW(q_point));
 
 
-       cell->get_dof_indices (local_dof_indices);
+        cell->get_dof_indices (local_dof_indices);
 
         Threads::ThreadMutex::ScopedLock lock (mutex);
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           linear_system.matrix.add (local_dof_indices[i],
-                                     local_dof_indices[j],
-                                     cell_matrix(i,j));
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            linear_system.matrix.add (local_dof_indices[i],
+                                      local_dof_indices[j],
+                                      cell_matrix(i,j));
       };
   }
 
@@ -446,16 +446,16 @@ namespace LaplaceSolver
     hanging_node_constraints.clear ();
 
     void (*mhnc_p) (const DoFHandler<dim> &,
-                   ConstraintMatrix      &)
+                    ConstraintMatrix &)
       = &DoFTools::make_hanging_node_constraints;
-    
+
     Threads::Thread<>
-      mhnc_thread = Threads::spawn (mhnc_p)(dof_handler,
-                                            hanging_node_constraints);
+    mhnc_thread = Threads::spawn (mhnc_p)(dof_handler,
+                                          hanging_node_constraints);
 
     sparsity_pattern.reinit (dof_handler.n_dofs(),
-                            dof_handler.n_dofs(),
-                            dof_handler.max_couplings_between_dofs());
+                             dof_handler.n_dofs(),
+                             dof_handler.max_couplings_between_dofs());
     DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
 
     mhnc_thread.join ();
@@ -491,30 +491,30 @@ namespace LaplaceSolver
   template <int dim>
   class PrimalSolver : public Solver<dim>
   {
-    public:
-      PrimalSolver (Triangulation<dim>       &triangulation,
-                   const FiniteElement<dim> &fe,
-                   const Quadrature<dim>    &quadrature,
-                   const Function<dim>      &rhs_function,
-                   const Function<dim>      &boundary_values);
-    protected:
-      const SmartPointer<const Function<dim> > rhs_function;
-      virtual void assemble_rhs (Vector<double> &rhs) const;
+  public:
+    PrimalSolver (Triangulation<dim>       &triangulation,
+                  const FiniteElement<dim> &fe,
+                  const Quadrature<dim>    &quadrature,
+                  const Function<dim>      &rhs_function,
+                  const Function<dim>      &boundary_values);
+  protected:
+    const SmartPointer<const Function<dim> > rhs_function;
+    virtual void assemble_rhs (Vector<double> &rhs) const;
   };
 
 
   template <int dim>
   PrimalSolver<dim>::
   PrimalSolver (Triangulation<dim>       &triangulation,
-               const FiniteElement<dim> &fe,
-               const Quadrature<dim>    &quadrature,
-               const Function<dim>      &rhs_function,
-               const Function<dim>      &boundary_values)
-                 :
-                 Base<dim> (triangulation),
-                 Solver<dim> (triangulation, fe,
-                              quadrature, boundary_values),
-                  rhs_function (&rhs_function)
+                const FiniteElement<dim> &fe,
+                const Quadrature<dim>    &quadrature,
+                const Function<dim>      &rhs_function,
+                const Function<dim>      &boundary_values)
+    :
+    Base<dim> (triangulation),
+    Solver<dim> (triangulation, fe,
+                 quadrature, boundary_values),
+    rhs_function (&rhs_function)
   {}
 
 
@@ -522,10 +522,10 @@ namespace LaplaceSolver
   template <int dim>
   void
   PrimalSolver<dim>::
-  assemble_rhs (Vector<double> &rhs) const 
+  assemble_rhs (Vector<double> &rhs) const
   {
-    FEValues<dim> fe_values (*this->fe, *this->quadrature, 
-                            update_values | update_q_points  |
+    FEValues<dim> fe_values (*this->fe, *this->quadrature,
+                             update_values | update_q_points  |
                              update_JxW_values);
 
     const unsigned int   dofs_per_cell = this->fe->dofs_per_cell;
@@ -536,24 +536,24 @@ namespace LaplaceSolver
     std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     typename DoFHandler<dim>::active_cell_iterator
-      cell = this->dof_handler.begin_active(),
-      endc = this->dof_handler.end();
+    cell = this->dof_handler.begin_active(),
+    endc = this->dof_handler.end();
     for (; cell!=endc; ++cell)
       {
-       cell_rhs = 0;
-       fe_values.reinit (cell);
-       rhs_function->value_list (fe_values.get_quadrature_points(),
-                                 rhs_values);
-      
-       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-         for (unsigned int i=0; i<dofs_per_cell; ++i)
-           cell_rhs(i) += (fe_values.shape_value(i,q_point) *
-                           rhs_values[q_point] *
-                           fe_values.JxW(q_point));
-
-       cell->get_dof_indices (local_dof_indices);
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         rhs(local_dof_indices[i]) += cell_rhs(i);
+        cell_rhs = 0;
+        fe_values.reinit (cell);
+        rhs_function->value_list (fe_values.get_quadrature_points(),
+                                  rhs_values);
+
+        for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+          for (unsigned int i=0; i<dofs_per_cell; ++i)
+            cell_rhs(i) += (fe_values.shape_value(i,q_point) *
+                            rhs_values[q_point] *
+                            fe_values.JxW(q_point));
+
+        cell->get_dof_indices (local_dof_indices);
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          rhs(local_dof_indices[i]) += cell_rhs(i);
       };
   }
 
@@ -562,14 +562,14 @@ namespace LaplaceSolver
   template <int dim>
   class RefinementGlobal : public PrimalSolver<dim>
   {
-    public:
-      RefinementGlobal (Triangulation<dim>       &coarse_grid,
-                       const FiniteElement<dim> &fe,
-                       const Quadrature<dim>    &quadrature,
-                       const Function<dim>      &rhs_function,
-                       const Function<dim>      &boundary_values);
-
-      virtual void refine_grid ();
+  public:
+    RefinementGlobal (Triangulation<dim>       &coarse_grid,
+                      const FiniteElement<dim> &fe,
+                      const Quadrature<dim>    &quadrature,
+                      const Function<dim>      &rhs_function,
+                      const Function<dim>      &boundary_values);
+
+    virtual void refine_grid ();
   };
 
 
@@ -577,14 +577,14 @@ namespace LaplaceSolver
   template <int dim>
   RefinementGlobal<dim>::
   RefinementGlobal (Triangulation<dim>       &coarse_grid,
-                   const FiniteElement<dim> &fe,
-                   const Quadrature<dim>    &quadrature,
-                   const Function<dim>      &rhs_function,
-                   const Function<dim>      &boundary_values)
-                 :
-                 Base<dim> (coarse_grid),
-                  PrimalSolver<dim> (coarse_grid, fe, quadrature,
-                                    rhs_function, boundary_values)
+                    const FiniteElement<dim> &fe,
+                    const Quadrature<dim>    &quadrature,
+                    const Function<dim>      &rhs_function,
+                    const Function<dim>      &boundary_values)
+    :
+    Base<dim> (coarse_grid),
+    PrimalSolver<dim> (coarse_grid, fe, quadrature,
+                       rhs_function, boundary_values)
   {}
 
 
@@ -601,14 +601,14 @@ namespace LaplaceSolver
   template <int dim>
   class RefinementKelly : public PrimalSolver<dim>
   {
-    public:
-      RefinementKelly (Triangulation<dim>       &coarse_grid,
-                      const FiniteElement<dim> &fe,
-                      const Quadrature<dim>    &quadrature,
-                      const Function<dim>      &rhs_function,
-                      const Function<dim>      &boundary_values);
-
-      virtual void refine_grid ();
+  public:
+    RefinementKelly (Triangulation<dim>       &coarse_grid,
+                     const FiniteElement<dim> &fe,
+                     const Quadrature<dim>    &quadrature,
+                     const Function<dim>      &rhs_function,
+                     const Function<dim>      &boundary_values);
+
+    virtual void refine_grid ();
   };
 
 
@@ -616,14 +616,14 @@ namespace LaplaceSolver
   template <int dim>
   RefinementKelly<dim>::
   RefinementKelly (Triangulation<dim>       &coarse_grid,
-                  const FiniteElement<dim> &fe,
-                  const Quadrature<dim>    &quadrature,
-                  const Function<dim>      &rhs_function,
-                  const Function<dim>      &boundary_values)
-                 :
-                 Base<dim> (coarse_grid),
-                  PrimalSolver<dim> (coarse_grid, fe, quadrature,
-                                    rhs_function, boundary_values)
+                   const FiniteElement<dim> &fe,
+                   const Quadrature<dim>    &quadrature,
+                   const Function<dim>      &rhs_function,
+                   const Function<dim>      &boundary_values)
+    :
+    Base<dim> (coarse_grid),
+    PrimalSolver<dim> (coarse_grid, fe, quadrature,
+                       rhs_function, boundary_values)
   {}
 
 
@@ -634,13 +634,13 @@ namespace LaplaceSolver
   {
     Vector<float> estimated_error_per_cell (this->triangulation->n_active_cells());
     KellyErrorEstimator<dim>::estimate (this->dof_handler,
-                                       QGauss<dim-1>(3),
-                                       typename FunctionMap<dim>::type(),
-                                       this->solution,
-                                       estimated_error_per_cell);
+                                        QGauss<dim-1>(3),
+                                        typename FunctionMap<dim>::type(),
+                                        this->solution,
+                                        estimated_error_per_cell);
     GridRefinement::refine_and_coarsen_fixed_number (*this->triangulation,
-                                                    estimated_error_per_cell,
-                                                    0.3, 0.03);
+                                                     estimated_error_per_cell,
+                                                     0.3, 0.03);
     this->triangulation->execute_coarsening_and_refinement ();
   }
 
@@ -653,18 +653,18 @@ namespace LaplaceSolver
 template <int dim>
 class Solution : public Function<dim>
 {
-  public:
-    Solution () : Function<dim> () {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const;
+public:
+  Solution () : Function<dim> () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const;
 };
 
 
 template <int dim>
 double
 Solution<dim>::value (const Point<dim>   &p,
-                     const unsigned int  /*component*/) const
+                      const unsigned int  /*component*/) const
 {
   double q = p(0);
   for (unsigned int i=1; i<dim; ++i)
@@ -678,36 +678,36 @@ Solution<dim>::value (const Point<dim>   &p,
 template <int dim>
 class RightHandSide : public Function<dim>
 {
-  public:
-    RightHandSide () : Function<dim> () {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const;
+public:
+  RightHandSide () : Function<dim> () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const;
 };
 
 
 template <int dim>
 double
 RightHandSide<dim>::value (const Point<dim>   &p,
-                          const unsigned int  /*component*/) const
+                           const unsigned int  /*component*/) const
 {
   double q = p(0);
   for (unsigned int i=1; i<dim; ++i)
     q += std::sin(10*p(i)+5*p(0)*p(0));
   const double u = std::exp(q);
   double t1 = 1,
-        t2 = 0,
-        t3 = 0;
+         t2 = 0,
+         t3 = 0;
   for (unsigned int i=1; i<dim; ++i)
     {
       t1 += std::cos(10*p(i)+5*p(0)*p(0)) * 10 * p(0);
       t2 += 10*std::cos(10*p(i)+5*p(0)*p(0)) -
-           100*std::sin(10*p(i)+5*p(0)*p(0)) * p(0)*p(0);
+            100*std::sin(10*p(i)+5*p(0)*p(0)) * p(0)*p(0);
       t3 += 100*std::cos(10*p(i)+5*p(0)*p(0))*std::cos(10*p(i)+5*p(0)*p(0)) -
-           100*std::sin(10*p(i)+5*p(0)*p(0));
+            100*std::sin(10*p(i)+5*p(0)*p(0));
     };
   t1 = t1*t1;
-  
+
   return -u*(t1+t2+t3);
 }
 
@@ -717,7 +717,7 @@ RightHandSide<dim>::value (const Point<dim>   &p,
 template <int dim>
 void
 run_simulation (LaplaceSolver::Base<dim>                     &solver,
-               const std::list<Evaluation::EvaluationBase<dim> *> &postprocessor_list)
+                const std::list<Evaluation::EvaluationBase<dim> *> &postprocessor_list)
 {
   deallog << "Refinement cycle: ";
 
@@ -728,18 +728,18 @@ run_simulation (LaplaceSolver::Base<dim>                     &solver,
       solver.solve_problem ();
 
       for (typename std::list<Evaluation::EvaluationBase<dim> *>::const_iterator
-            i = postprocessor_list.begin();
-          i != postprocessor_list.end(); ++i)
-       {
-         (*i)->set_refinement_cycle (step);
-         solver.postprocess (**i);
-       };
+           i = postprocessor_list.begin();
+           i != postprocessor_list.end(); ++i)
+        {
+          (*i)->set_refinement_cycle (step);
+          solver.postprocess (**i);
+        };
 
 
       if (solver.n_dofs() < 2000)
-       solver.refine_grid ();
+        solver.refine_grid ();
       else
-       break;
+        break;
     };
 
   deallog << std::endl;
@@ -748,12 +748,12 @@ run_simulation (LaplaceSolver::Base<dim>                     &solver,
 
 
 template <int dim>
-void solve_problem (const std::string &solver_name) 
+void solve_problem (const std::string &solver_name)
 {
   const std::string header = "Running tests with \"" + solver_name +
-                            "\" refinement criterion:";
+                             "\" refinement criterion:";
   deallog << header << std::endl
-           << std::string (header.size(), '-') << std::endl;
+          << std::string (header.size(), '-') << std::endl;
 
   Triangulation<dim> triangulation;
   GridGenerator::hyper_cube (triangulation, -1, 1);
@@ -763,27 +763,27 @@ void solve_problem (const std::string &solver_name)
   const RightHandSide<dim> rhs_function;
   const Solution<dim>      boundary_values;
 
-  LaplaceSolver::Base<dim> * solver = 0;
+  LaplaceSolver::Base<dim> *solver = 0;
   if (solver_name == "global")
     solver = new LaplaceSolver::RefinementGlobal<dim> (triangulation, fe,
-                                                      quadrature,
-                                                      rhs_function,
-                                                      boundary_values);
+                                                       quadrature,
+                                                       rhs_function,
+                                                       boundary_values);
   else if (solver_name == "kelly")
     solver = new LaplaceSolver::RefinementKelly<dim> (triangulation, fe,
-                                                     quadrature,
-                                                     rhs_function,
-                                                     boundary_values);
+                                                      quadrature,
+                                                      rhs_function,
+                                                      boundary_values);
   else
     AssertThrow (false, ExcNotImplemented());
 
   TableHandler results_table;
   Evaluation::PointValueEvaluation<dim>
-    postprocessor1 (Point<dim>(0.5,0.5), results_table);
+  postprocessor1 (Point<dim>(0.5,0.5), results_table);
 
   Evaluation::SolutionOutput<dim>
-    postprocessor2 (std::string("solution-")+solver_name,
-                   DataOut<dim>::gnuplot);
+  postprocessor2 (std::string("solution-")+solver_name,
+                  DataOut<dim>::gnuplot);
 
   std::list<Evaluation::EvaluationBase<dim> *> postprocessor_list;
   postprocessor_list.push_back (&postprocessor1);
@@ -799,40 +799,40 @@ void solve_problem (const std::string &solver_name)
 
 
 
-int main () 
+int main ()
 {
   try
     {
       deallog << std::setprecision(2);
-  
+
       deallog.attach(logfile);
       deallog.depth_console(0);
       deallog.threshold_double(1.e-10);
 
       solve_problem<2> ("global");
-      solve_problem<2> ("kelly");      
+      solve_problem<2> ("kelly");
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 
index 054d6aed7b8e0465fb8b1471f8bcf665bf1aebaa..a4a756abc02093bf07f8f1366d31d5c22931f680 100644 (file)
@@ -66,15 +66,15 @@ namespace Evaluation
   template <int dim>
   class EvaluationBase
   {
-    public:
-      virtual ~EvaluationBase ();
+  public:
+    virtual ~EvaluationBase ();
 
-      void set_refinement_cycle (const unsigned int refinement_cycle);
+    void set_refinement_cycle (const unsigned int refinement_cycle);
 
-      virtual void operator () (const DoFHandler<dim> &dof_handler,
-                               const Vector<double>  &solution) const = 0;
-    protected:
-      unsigned int refinement_cycle;
+    virtual void operator () (const DoFHandler<dim> &dof_handler,
+                              const Vector<double>  &solution) const = 0;
+  protected:
+    unsigned int refinement_cycle;
   };
 
 
@@ -95,26 +95,26 @@ namespace Evaluation
   template <int dim>
   class PointValueEvaluation : public EvaluationBase<dim>
   {
-    public:
-      PointValueEvaluation (const Point<dim>   &evaluation_point);
+  public:
+    PointValueEvaluation (const Point<dim>   &evaluation_point);
 
-      virtual void operator () (const DoFHandler<dim> &dof_handler,
-                               const Vector<double>  &solution) const;
+    virtual void operator () (const DoFHandler<dim> &dof_handler,
+                              const Vector<double>  &solution) const;
 
-      DeclException1 (ExcEvaluationPointNotFound,
-                     Point<dim>,
-                     << "The evaluation point " << arg1
-                     << " was not found among the vertices of the present grid.");
-    private:
-      const Point<dim>  evaluation_point;
+    DeclException1 (ExcEvaluationPointNotFound,
+                    Point<dim>,
+                    << "The evaluation point " << arg1
+                    << " was not found among the vertices of the present grid.");
+  private:
+    const Point<dim>  evaluation_point;
   };
 
 
   template <int dim>
   PointValueEvaluation<dim>::
   PointValueEvaluation (const Point<dim>   &evaluation_point)
-                 :
-                 evaluation_point (evaluation_point)
+    :
+    evaluation_point (evaluation_point)
   {}
 
 
@@ -123,33 +123,33 @@ namespace Evaluation
   void
   PointValueEvaluation<dim>::
   operator () (const DoFHandler<dim> &dof_handler,
-              const Vector<double>  &solution) const
+               const Vector<double>  &solution) const
   {
     double point_value = 1e20;
 
     typename DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     bool evaluation_point_found = false;
     for (; (cell!=endc) && !evaluation_point_found; ++cell)
       for (unsigned int vertex=0;
-          vertex<GeometryInfo<dim>::vertices_per_cell;
-          ++vertex)
-       if (cell->vertex(vertex).distance (evaluation_point)
-           <
-           cell->diameter() * 1e-8)
-         {
-           point_value = solution(cell->vertex_dof_index(vertex,0));
-
-           evaluation_point_found = true;
-           break;
-         };
+           vertex<GeometryInfo<dim>::vertices_per_cell;
+           ++vertex)
+        if (cell->vertex(vertex).distance (evaluation_point)
+            <
+            cell->diameter() * 1e-8)
+          {
+            point_value = solution(cell->vertex_dof_index(vertex,0));
+
+            evaluation_point_found = true;
+            break;
+          };
 
     AssertThrow (evaluation_point_found,
-                ExcEvaluationPointNotFound(evaluation_point));
+                 ExcEvaluationPointNotFound(evaluation_point));
 
     deallog << "   Point value=" << point_value
-             << std::endl;
+            << std::endl;
   }
 
 
@@ -157,26 +157,26 @@ namespace Evaluation
   template <int dim>
   class PointXDerivativeEvaluation : public EvaluationBase<dim>
   {
-    public:
-      PointXDerivativeEvaluation (const Point<dim>   &evaluation_point);
+  public:
+    PointXDerivativeEvaluation (const Point<dim>   &evaluation_point);
 
-      virtual void operator () (const DoFHandler<dim> &dof_handler,
-                               const Vector<double>  &solution) const;
+    virtual void operator () (const DoFHandler<dim> &dof_handler,
+                              const Vector<double>  &solution) const;
 
-      DeclException1 (ExcEvaluationPointNotFound,
-                     Point<dim>,
-                     << "The evaluation point " << arg1
-                     << " was not found among the vertices of the present grid.");
-    private:
-      const Point<dim>  evaluation_point;
+    DeclException1 (ExcEvaluationPointNotFound,
+                    Point<dim>,
+                    << "The evaluation point " << arg1
+                    << " was not found among the vertices of the present grid.");
+  private:
+    const Point<dim>  evaluation_point;
   };
 
 
   template <int dim>
   PointXDerivativeEvaluation<dim>::
   PointXDerivativeEvaluation (const Point<dim>   &evaluation_point)
-                 :
-                 evaluation_point (evaluation_point)
+    :
+    evaluation_point (evaluation_point)
   {}
 
 
@@ -184,51 +184,51 @@ namespace Evaluation
   void
   PointXDerivativeEvaluation<dim>::
   operator () (const DoFHandler<dim> &dof_handler,
-              const Vector<double>  &solution) const
+               const Vector<double>  &solution) const
   {
     double point_derivative = 0;
 
     QTrapez<dim>  vertex_quadrature;
     FEValues<dim> fe_values (dof_handler.get_fe(),
-                            vertex_quadrature,
-                            update_gradients | update_q_points);
+                             vertex_quadrature,
+                             update_gradients | update_q_points);
     std::vector<Tensor<1,dim> >
-      solution_gradients (vertex_quadrature.size());
+    solution_gradients (vertex_quadrature.size());
 
     typename DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     unsigned int evaluation_point_hits = 0;
     for (; cell!=endc; ++cell)
       for (unsigned int vertex=0;
-          vertex<GeometryInfo<dim>::vertices_per_cell;
-          ++vertex)
-       if (cell->vertex(vertex) == evaluation_point)
-         {
-           fe_values.reinit (cell);
-           fe_values.get_function_grads (solution,
-                                         solution_gradients);
-
-           unsigned int q_point = 0;
-           for (; q_point<solution_gradients.size(); ++q_point)
-             if (fe_values.quadrature_point(q_point) ==
-                 evaluation_point)
-               break;
-
-           Assert (q_point < solution_gradients.size(),
-                   ExcInternalError());
-           point_derivative += solution_gradients[q_point][0];
-           ++evaluation_point_hits;
-
-           break;
-         };
+           vertex<GeometryInfo<dim>::vertices_per_cell;
+           ++vertex)
+        if (cell->vertex(vertex) == evaluation_point)
+          {
+            fe_values.reinit (cell);
+            fe_values.get_function_grads (solution,
+                                          solution_gradients);
+
+            unsigned int q_point = 0;
+            for (; q_point<solution_gradients.size(); ++q_point)
+              if (fe_values.quadrature_point(q_point) ==
+                  evaluation_point)
+                break;
+
+            Assert (q_point < solution_gradients.size(),
+                    ExcInternalError());
+            point_derivative += solution_gradients[q_point][0];
+            ++evaluation_point_hits;
+
+            break;
+          };
 
     AssertThrow (evaluation_point_hits > 0,
-                ExcEvaluationPointNotFound(evaluation_point));
+                 ExcEvaluationPointNotFound(evaluation_point));
 
     point_derivative /= evaluation_point_hits;
     deallog << "   Point x-derivative=" << point_derivative
-             << std::endl;
+            << std::endl;
   }
 
 
@@ -237,37 +237,37 @@ namespace Evaluation
   template <int dim>
   class GridOutput : public EvaluationBase<dim>
   {
-    public:
-      GridOutput (const std::string &output_name_base);
+  public:
+    GridOutput (const std::string &output_name_base);
 
-      virtual void operator () (const DoFHandler<dim> &dof_handler,
-                               const Vector<double>  &solution) const;
-    private:
-      const std::string output_name_base;
+    virtual void operator () (const DoFHandler<dim> &dof_handler,
+                              const Vector<double>  &solution) const;
+  private:
+    const std::string output_name_base;
   };
 
 
   template <int dim>
   GridOutput<dim>::
   GridOutput (const std::string &output_name_base)
-                 :
-                 output_name_base (output_name_base)
+    :
+    output_name_base (output_name_base)
   {}
 
 
   template <int dim>
   void
   GridOutput<dim>::operator () (const DoFHandler<dim> &dof_handler,
-                               const Vector<double>  &/*solution*/) const
+                                const Vector<double>  &/*solution*/) const
   {
     std::ostringstream filename;
     filename << output_name_base << "-"
-            << this->refinement_cycle
-            << ".eps"
-            << std::ends;
+             << this->refinement_cycle
+             << ".eps"
+             << std::ends;
 
     GridOut().write_eps (dof_handler.get_tria(),
-                        deallog.get_file_stream());
+                         deallog.get_file_stream());
   }
 }
 
@@ -282,30 +282,30 @@ namespace LaplaceSolver
   template <int dim>
   class Base
   {
-    public:
-      Base (Triangulation<dim> &coarse_grid);
-      virtual ~Base ();
+  public:
+    Base (Triangulation<dim> &coarse_grid);
+    virtual ~Base ();
 
-      virtual void solve_problem () = 0;
-      virtual void postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const = 0;
-      virtual void refine_grid () = 0;
-      virtual unsigned int n_dofs () const = 0;
+    virtual void solve_problem () = 0;
+    virtual void postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const = 0;
+    virtual void refine_grid () = 0;
+    virtual unsigned int n_dofs () const = 0;
 
-      virtual void set_refinement_cycle (const unsigned int cycle);
+    virtual void set_refinement_cycle (const unsigned int cycle);
 
-      virtual void output_solution () const = 0;
+    virtual void output_solution () const = 0;
 
-    protected:
-      const SmartPointer<Triangulation<dim> > triangulation;
+  protected:
+    const SmartPointer<Triangulation<dim> > triangulation;
 
-      unsigned int refinement_cycle;
+    unsigned int refinement_cycle;
   };
 
 
   template <int dim>
   Base<dim>::Base (Triangulation<dim> &coarse_grid)
-                 :
-                 triangulation (&coarse_grid)
+    :
+    triangulation (&coarse_grid)
   {}
 
 
@@ -327,75 +327,75 @@ namespace LaplaceSolver
   template <int dim>
   class Solver : public virtual Base<dim>
   {
-    public:
-      Solver (Triangulation<dim>       &triangulation,
-             const FiniteElement<dim> &fe,
-             const Quadrature<dim>    &quadrature,
-             const Quadrature<dim-1>  &face_quadrature,
-             const Function<dim>      &boundary_values);
-      virtual
-      ~Solver ();
-
-      virtual
-      void
-      solve_problem ();
-
-      virtual
-      void
-      postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const;
-
-      virtual
-      unsigned int
-      n_dofs () const;
-
-    protected:
-      const SmartPointer<const FiniteElement<dim> >  fe;
-      const SmartPointer<const Quadrature<dim> >     quadrature;
-      const SmartPointer<const Quadrature<dim-1> >   face_quadrature;
-      DoFHandler<dim>                                dof_handler;
-      Vector<double>                                 solution;
-      const SmartPointer<const Function<dim> >       boundary_values;
-
-      virtual void assemble_rhs (Vector<double> &rhs) const = 0;
-
-    private:
-      struct LinearSystem
-      {
-         LinearSystem (const DoFHandler<dim> &dof_handler);
+  public:
+    Solver (Triangulation<dim>       &triangulation,
+            const FiniteElement<dim> &fe,
+            const Quadrature<dim>    &quadrature,
+            const Quadrature<dim-1>  &face_quadrature,
+            const Function<dim>      &boundary_values);
+    virtual
+    ~Solver ();
+
+    virtual
+    void
+    solve_problem ();
+
+    virtual
+    void
+    postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const;
+
+    virtual
+    unsigned int
+    n_dofs () const;
+
+  protected:
+    const SmartPointer<const FiniteElement<dim> >  fe;
+    const SmartPointer<const Quadrature<dim> >     quadrature;
+    const SmartPointer<const Quadrature<dim-1> >   face_quadrature;
+    DoFHandler<dim>                                dof_handler;
+    Vector<double>                                 solution;
+    const SmartPointer<const Function<dim> >       boundary_values;
+
+    virtual void assemble_rhs (Vector<double> &rhs) const = 0;
+
+  private:
+    struct LinearSystem
+    {
+      LinearSystem (const DoFHandler<dim> &dof_handler);
 
-         void solve (Vector<double> &solution) const;
+      void solve (Vector<double> &solution) const;
 
-         ConstraintMatrix     hanging_node_constraints;
-         SparsityPattern      sparsity_pattern;
-         SparseMatrix<double> matrix;
-         Vector<double>       rhs;
-      };
+      ConstraintMatrix     hanging_node_constraints;
+      SparsityPattern      sparsity_pattern;
+      SparseMatrix<double> matrix;
+      Vector<double>       rhs;
+    };
 
-      void
-      assemble_linear_system (LinearSystem &linear_system);
+    void
+    assemble_linear_system (LinearSystem &linear_system);
 
-      void
-      assemble_matrix (LinearSystem                                         &linear_system,
-                      const typename DoFHandler<dim>::active_cell_iterator &begin_cell,
-                      const typename DoFHandler<dim>::active_cell_iterator &end_cell,
-                      Threads::ThreadMutex                                 &mutex) const;
+    void
+    assemble_matrix (LinearSystem                                         &linear_system,
+                     const typename DoFHandler<dim>::active_cell_iterator &begin_cell,
+                     const typename DoFHandler<dim>::active_cell_iterator &end_cell,
+                     Threads::ThreadMutex                                 &mutex) const;
   };
 
 
 
   template <int dim>
   Solver<dim>::Solver (Triangulation<dim>       &triangulation,
-                      const FiniteElement<dim> &fe,
-                      const Quadrature<dim>    &quadrature,
-                      const Quadrature<dim-1>  &face_quadrature,
-                      const Function<dim>      &boundary_values)
-                 :
-                 Base<dim> (triangulation),
-                 fe (&fe),
-                  quadrature (&quadrature),
-                  face_quadrature (&face_quadrature),
-                 dof_handler (triangulation),
-                 boundary_values (&boundary_values)
+                       const FiniteElement<dim> &fe,
+                       const Quadrature<dim>    &quadrature,
+                       const Quadrature<dim-1>  &face_quadrature,
+                       const Function<dim>      &boundary_values)
+    :
+    Base<dim> (triangulation),
+    fe (&fe),
+    quadrature (&quadrature),
+    face_quadrature (&face_quadrature),
+    dof_handler (triangulation),
+    boundary_values (&boundary_values)
   {}
 
 
@@ -441,55 +441,55 @@ namespace LaplaceSolver
   Solver<dim>::assemble_linear_system (LinearSystem &linear_system)
   {
     typedef
-      typename DoFHandler<dim>::active_cell_iterator
-      active_cell_iterator;
+    typename DoFHandler<dim>::active_cell_iterator
+    active_cell_iterator;
 
     const unsigned int n_threads = multithread_info.n_default_threads;
     std::vector<std::pair<active_cell_iterator,active_cell_iterator> >
-      thread_ranges
+    thread_ranges
       = Threads::split_range<active_cell_iterator> (dof_handler.begin_active (),
-                                                   dof_handler.end (),
-                                                   n_threads);
-    
+                                                    dof_handler.end (),
+                                                    n_threads);
+
     {
       Threads::ThreadMutex mutex;
       for (unsigned int thread=0; thread<n_threads; ++thread)
-       {
-         assemble_matrix
-           (linear_system,
-            thread_ranges[thread].first,
-            thread_ranges[thread].second,
-            mutex);
-       }
+        {
+          assemble_matrix
+          (linear_system,
+           thread_ranges[thread].first,
+           thread_ranges[thread].second,
+           mutex);
+        }
     }
-    
+
     assemble_rhs (linear_system.rhs);
     linear_system.hanging_node_constraints.condense (linear_system.rhs);
 
     std::map<types::global_dof_index,double> boundary_value_map;
     VectorTools::interpolate_boundary_values (dof_handler,
-                                             0,
-                                             *boundary_values,
-                                             boundary_value_map);
+                                              0,
+                                              *boundary_values,
+                                              boundary_value_map);
 
     linear_system.hanging_node_constraints.condense (linear_system.matrix);
 
     MatrixTools::apply_boundary_values (boundary_value_map,
-                                       linear_system.matrix,
-                                       solution,
-                                       linear_system.rhs);
+                                        linear_system.matrix,
+                                        solution,
+                                        linear_system.rhs);
   }
 
 
   template <int dim>
   void
   Solver<dim>::assemble_matrix (LinearSystem                                         &linear_system,
-                               const typename DoFHandler<dim>::active_cell_iterator &begin_cell,
-                               const typename DoFHandler<dim>::active_cell_iterator &end_cell,
-                               Threads::ThreadMutex                                 &mutex) const
+                                const typename DoFHandler<dim>::active_cell_iterator &begin_cell,
+                                const typename DoFHandler<dim>::active_cell_iterator &end_cell,
+                                Threads::ThreadMutex                                 &mutex) const
   {
     FEValues<dim> fe_values (*fe, *quadrature,
-                            update_gradients | update_JxW_values);
+                             update_gradients | update_JxW_values);
 
     const unsigned int   dofs_per_cell = fe->dofs_per_cell;
     const unsigned int   n_q_points    = quadrature->size();
@@ -499,27 +499,27 @@ namespace LaplaceSolver
     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)
+         cell!=end_cell; ++cell)
       {
-       cell_matrix = 0;
+        cell_matrix = 0;
 
-       fe_values.reinit (cell);
+        fe_values.reinit (cell);
 
-       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-         for (unsigned int i=0; i<dofs_per_cell; ++i)
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += (fe_values.shape_grad(i,q_point) *
-                                  fe_values.shape_grad(j,q_point) *
-                                  fe_values.JxW(q_point));
+        for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+          for (unsigned int i=0; i<dofs_per_cell; ++i)
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += (fe_values.shape_grad(i,q_point) *
+                                   fe_values.shape_grad(j,q_point) *
+                                   fe_values.JxW(q_point));
 
 
-       cell->get_dof_indices (local_dof_indices);
-       Threads::ThreadMutex::ScopedLock lock (mutex);
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           linear_system.matrix.add (local_dof_indices[i],
-                                     local_dof_indices[j],
-                                     cell_matrix(i,j));
+        cell->get_dof_indices (local_dof_indices);
+        Threads::ThreadMutex::ScopedLock lock (mutex);
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            linear_system.matrix.add (local_dof_indices[i],
+                                      local_dof_indices[j],
+                                      cell_matrix(i,j));
       };
   }
 
@@ -531,15 +531,15 @@ namespace LaplaceSolver
     hanging_node_constraints.clear ();
 
     void (*mhnc_p) (const DoFHandler<dim> &,
-                   ConstraintMatrix      &)
+                    ConstraintMatrix &)
       = &DoFTools::make_hanging_node_constraints;
 
     Threads::Thread<>
-      mhnc_thread = Threads::spawn (mhnc_p)(dof_handler, hanging_node_constraints);
+    mhnc_thread = Threads::spawn (mhnc_p)(dof_handler, hanging_node_constraints);
 
     sparsity_pattern.reinit (dof_handler.n_dofs(),
-                            dof_handler.n_dofs(),
-                            dof_handler.max_couplings_between_dofs());
+                             dof_handler.n_dofs(),
+                             dof_handler.max_couplings_between_dofs());
     DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
 
     mhnc_thread.join ();
@@ -575,48 +575,48 @@ namespace LaplaceSolver
   template <int dim>
   class PrimalSolver : public Solver<dim>
   {
-    public:
-      PrimalSolver (Triangulation<dim>       &triangulation,
-                   const FiniteElement<dim> &fe,
-                   const Quadrature<dim>    &quadrature,
-                   const Quadrature<dim-1>  &face_quadrature,
-                   const Function<dim>      &rhs_function,
-                   const Function<dim>      &boundary_values);
+  public:
+    PrimalSolver (Triangulation<dim>       &triangulation,
+                  const FiniteElement<dim> &fe,
+                  const Quadrature<dim>    &quadrature,
+                  const Quadrature<dim-1>  &face_quadrature,
+                  const Function<dim>      &rhs_function,
+                  const Function<dim>      &boundary_values);
 
-      virtual
-      void solve_problem ();
+    virtual
+    void solve_problem ();
 
-      virtual
-      unsigned int n_dofs () const;
+    virtual
+    unsigned int n_dofs () const;
 
-      virtual
-      void postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const;
+    virtual
+    void postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const;
 
-      virtual
-      void output_solution () const;
+    virtual
+    void output_solution () const;
 
-    protected:
-      const SmartPointer<const Function<dim> > rhs_function;
-      virtual void assemble_rhs (Vector<double> &rhs) const;
+  protected:
+    const SmartPointer<const Function<dim> > rhs_function;
+    virtual void assemble_rhs (Vector<double> &rhs) const;
 
-      friend class WeightedResidual<dim>;
+    friend class WeightedResidual<dim>;
   };
 
 
   template <int dim>
   PrimalSolver<dim>::
   PrimalSolver (Triangulation<dim>       &triangulation,
-               const FiniteElement<dim> &fe,
-               const Quadrature<dim>    &quadrature,
-               const Quadrature<dim-1>  &face_quadrature,
-               const Function<dim>      &rhs_function,
-               const Function<dim>      &boundary_values)
-                 :
-                 Base<dim> (triangulation),
-                 Solver<dim> (triangulation, fe,
-                              quadrature, face_quadrature,
-                              boundary_values),
-                  rhs_function (&rhs_function)
+                const FiniteElement<dim> &fe,
+                const Quadrature<dim>    &quadrature,
+                const Quadrature<dim-1>  &face_quadrature,
+                const Function<dim>      &rhs_function,
+                const Function<dim>      &boundary_values)
+    :
+    Base<dim> (triangulation),
+    Solver<dim> (triangulation, fe,
+                 quadrature, face_quadrature,
+                 boundary_values),
+    rhs_function (&rhs_function)
   {}
 
 
@@ -657,9 +657,9 @@ namespace LaplaceSolver
 
     std::ostringstream filename;
     filename << "solution-"
-            << this->refinement_cycle
-            << ".gnuplot"
-            << std::ends;
+             << this->refinement_cycle
+             << ".gnuplot"
+             << std::ends;
     data_out.write (deallog.get_file_stream(), DataOut<dim>::gnuplot);
   }
 
@@ -671,7 +671,7 @@ namespace LaplaceSolver
   assemble_rhs (Vector<double> &rhs) const
   {
     FEValues<dim> fe_values (*this->fe, *this->quadrature,
-                            update_values  | update_q_points  |
+                             update_values  | update_q_points  |
                              update_JxW_values);
 
     const unsigned int   dofs_per_cell = this->fe->dofs_per_cell;
@@ -682,26 +682,26 @@ namespace LaplaceSolver
     std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     typename DoFHandler<dim>::active_cell_iterator
-      cell = this->dof_handler.begin_active(),
-      endc = this->dof_handler.end();
+    cell = this->dof_handler.begin_active(),
+    endc = this->dof_handler.end();
     for (; cell!=endc; ++cell)
       {
-       cell_rhs = 0;
+        cell_rhs = 0;
 
-       fe_values.reinit (cell);
+        fe_values.reinit (cell);
 
-       rhs_function->value_list (fe_values.get_quadrature_points(),
-                                 rhs_values);
+        rhs_function->value_list (fe_values.get_quadrature_points(),
+                                  rhs_values);
 
-       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-         for (unsigned int i=0; i<dofs_per_cell; ++i)
-           cell_rhs(i) += (fe_values.shape_value(i,q_point) *
-                           rhs_values[q_point] *
-                           fe_values.JxW(q_point));
+        for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+          for (unsigned int i=0; i<dofs_per_cell; ++i)
+            cell_rhs(i) += (fe_values.shape_value(i,q_point) *
+                            rhs_values[q_point] *
+                            fe_values.JxW(q_point));
 
-       cell->get_dof_indices (local_dof_indices);
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         rhs(local_dof_indices[i]) += cell_rhs(i);
+        cell->get_dof_indices (local_dof_indices);
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          rhs(local_dof_indices[i]) += cell_rhs(i);
       }
   }
 
@@ -710,15 +710,15 @@ namespace LaplaceSolver
   template <int dim>
   class RefinementGlobal : public PrimalSolver<dim>
   {
-    public:
-      RefinementGlobal (Triangulation<dim>       &coarse_grid,
-                       const FiniteElement<dim> &fe,
-                       const Quadrature<dim>    &quadrature,
-                       const Quadrature<dim-1>  &face_quadrature,
-                       const Function<dim>      &rhs_function,
-                       const Function<dim>      &boundary_values);
-
-      virtual void refine_grid ();
+  public:
+    RefinementGlobal (Triangulation<dim>       &coarse_grid,
+                      const FiniteElement<dim> &fe,
+                      const Quadrature<dim>    &quadrature,
+                      const Quadrature<dim-1>  &face_quadrature,
+                      const Function<dim>      &rhs_function,
+                      const Function<dim>      &boundary_values);
+
+    virtual void refine_grid ();
   };
 
 
@@ -726,16 +726,16 @@ namespace LaplaceSolver
   template <int dim>
   RefinementGlobal<dim>::
   RefinementGlobal (Triangulation<dim>       &coarse_grid,
-                   const FiniteElement<dim> &fe,
-                   const Quadrature<dim>    &quadrature,
-                   const Quadrature<dim-1>  &face_quadrature,
-                   const Function<dim>      &rhs_function,
-                   const Function<dim>      &boundary_values)
-                 :
-                 Base<dim> (coarse_grid),
-                  PrimalSolver<dim> (coarse_grid, fe, quadrature,
-                                    face_quadrature, rhs_function,
-                                    boundary_values)
+                    const FiniteElement<dim> &fe,
+                    const Quadrature<dim>    &quadrature,
+                    const Quadrature<dim-1>  &face_quadrature,
+                    const Function<dim>      &rhs_function,
+                    const Function<dim>      &boundary_values)
+    :
+    Base<dim> (coarse_grid),
+    PrimalSolver<dim> (coarse_grid, fe, quadrature,
+                       face_quadrature, rhs_function,
+                       boundary_values)
   {}
 
 
@@ -752,15 +752,15 @@ namespace LaplaceSolver
   template <int dim>
   class RefinementKelly : public PrimalSolver<dim>
   {
-    public:
-      RefinementKelly (Triangulation<dim>       &coarse_grid,
-                      const FiniteElement<dim> &fe,
-                      const Quadrature<dim>    &quadrature,
-                      const Quadrature<dim-1>  &face_quadrature,
-                      const Function<dim>      &rhs_function,
-                      const Function<dim>      &boundary_values);
-
-      virtual void refine_grid ();
+  public:
+    RefinementKelly (Triangulation<dim>       &coarse_grid,
+                     const FiniteElement<dim> &fe,
+                     const Quadrature<dim>    &quadrature,
+                     const Quadrature<dim-1>  &face_quadrature,
+                     const Function<dim>      &rhs_function,
+                     const Function<dim>      &boundary_values);
+
+    virtual void refine_grid ();
   };
 
 
@@ -768,16 +768,16 @@ namespace LaplaceSolver
   template <int dim>
   RefinementKelly<dim>::
   RefinementKelly (Triangulation<dim>       &coarse_grid,
-                  const FiniteElement<dim> &fe,
-                  const Quadrature<dim>    &quadrature,
-                  const Quadrature<dim-1>  &face_quadrature,
-                  const Function<dim>      &rhs_function,
-                  const Function<dim>      &boundary_values)
-                 :
-                 Base<dim> (coarse_grid),
-                  PrimalSolver<dim> (coarse_grid, fe, quadrature,
-                                    face_quadrature,
-                                    rhs_function, boundary_values)
+                   const FiniteElement<dim> &fe,
+                   const Quadrature<dim>    &quadrature,
+                   const Quadrature<dim-1>  &face_quadrature,
+                   const Function<dim>      &rhs_function,
+                   const Function<dim>      &boundary_values)
+    :
+    Base<dim> (coarse_grid),
+    PrimalSolver<dim> (coarse_grid, fe, quadrature,
+                       face_quadrature,
+                       rhs_function, boundary_values)
   {}
 
 
@@ -788,13 +788,13 @@ namespace LaplaceSolver
   {
     Vector<float> estimated_error_per_cell (this->triangulation->n_active_cells());
     KellyErrorEstimator<dim>::estimate (this->dof_handler,
-                                       QGauss<dim-1>(3),
-                                       typename FunctionMap<dim>::type(),
-                                       this->solution,
-                                       estimated_error_per_cell);
+                                        QGauss<dim-1>(3),
+                                        typename FunctionMap<dim>::type(),
+                                        this->solution,
+                                        estimated_error_per_cell);
     GridRefinement::refine_and_coarsen_fixed_number (*this->triangulation,
-                                                    estimated_error_per_cell,
-                                                    0.3, 0.03);
+                                                     estimated_error_per_cell,
+                                                     0.3, 0.03);
     this->triangulation->execute_coarsening_and_refinement ();
   }
 
@@ -804,19 +804,19 @@ namespace LaplaceSolver
   template <int dim>
   class RefinementWeightedKelly : public PrimalSolver<dim>
   {
-    public:
-      RefinementWeightedKelly (Triangulation<dim>       &coarse_grid,
-                              const FiniteElement<dim> &fe,
-                              const Quadrature<dim>    &quadrature,
-                              const Quadrature<dim-1>  &face_quadrature,
-                              const Function<dim>      &rhs_function,
-                              const Function<dim>      &boundary_values,
-                              const Function<dim>      &weighting_function);
-
-      virtual void refine_grid ();
-
-    private:
-      const SmartPointer<const Function<dim> > weighting_function;
+  public:
+    RefinementWeightedKelly (Triangulation<dim>       &coarse_grid,
+                             const FiniteElement<dim> &fe,
+                             const Quadrature<dim>    &quadrature,
+                             const Quadrature<dim-1>  &face_quadrature,
+                             const Function<dim>      &rhs_function,
+                             const Function<dim>      &boundary_values,
+                             const Function<dim>      &weighting_function);
+
+    virtual void refine_grid ();
+
+  private:
+    const SmartPointer<const Function<dim> > weighting_function;
   };
 
 
@@ -824,18 +824,18 @@ namespace LaplaceSolver
   template <int dim>
   RefinementWeightedKelly<dim>::
   RefinementWeightedKelly (Triangulation<dim>       &coarse_grid,
-                          const FiniteElement<dim> &fe,
-                          const Quadrature<dim>    &quadrature,
-                          const Quadrature<dim-1>  &face_quadrature,
-                          const Function<dim>      &rhs_function,
-                          const Function<dim>      &boundary_values,
-                          const Function<dim>      &weighting_function)
-                 :
-                 Base<dim> (coarse_grid),
-                  PrimalSolver<dim> (coarse_grid, fe, quadrature,
-                                    face_quadrature,
-                                    rhs_function, boundary_values),
-                  weighting_function (&weighting_function)
+                           const FiniteElement<dim> &fe,
+                           const Quadrature<dim>    &quadrature,
+                           const Quadrature<dim-1>  &face_quadrature,
+                           const Function<dim>      &rhs_function,
+                           const Function<dim>      &boundary_values,
+                           const Function<dim>      &weighting_function)
+    :
+    Base<dim> (coarse_grid),
+    PrimalSolver<dim> (coarse_grid, fe, quadrature,
+                       face_quadrature,
+                       rhs_function, boundary_values),
+    weighting_function (&weighting_function)
   {}
 
 
@@ -846,21 +846,21 @@ namespace LaplaceSolver
   {
     Vector<float> estimated_error (this->triangulation->n_active_cells());
     KellyErrorEstimator<dim>::estimate (this->dof_handler,
-                                       *this->face_quadrature,
-                                       typename FunctionMap<dim>::type(),
-                                       this->solution,
-                                       estimated_error);
+                                        *this->face_quadrature,
+                                        typename FunctionMap<dim>::type(),
+                                        this->solution,
+                                        estimated_error);
 
     typename DoFHandler<dim>::active_cell_iterator
-      cell = this->dof_handler.begin_active(),
-      endc = this->dof_handler.end();
+    cell = this->dof_handler.begin_active(),
+    endc = this->dof_handler.end();
     for (unsigned int cell_index=0; cell!=endc; ++cell, ++cell_index)
       estimated_error(cell_index)
-       *= weighting_function->value (cell->center());
+      *= weighting_function->value (cell->center());
 
     GridRefinement::refine_and_coarsen_fixed_number (*this->triangulation,
-                                                    estimated_error,
-                                                    0.3, 0.03);
+                                                     estimated_error,
+                                                     0.3, 0.03);
     this->triangulation->execute_coarsening_and_refinement ();
   }
 
@@ -873,35 +873,35 @@ namespace Data
   template <int dim>
   struct SetUpBase : public Subscriptor
   {
-      virtual
-      const Function<dim> &  get_boundary_values () const = 0;
+    virtual
+    const Function<dim>   &get_boundary_values () const = 0;
 
-      virtual
-      const Function<dim> &  get_right_hand_side () const = 0;
+    virtual
+    const Function<dim>   &get_right_hand_side () const = 0;
 
-      virtual
-      void create_coarse_grid (Triangulation<dim> &coarse_grid) const = 0;
+    virtual
+    void create_coarse_grid (Triangulation<dim> &coarse_grid) const = 0;
   };
 
 
   template <class Traits, int dim>
   struct SetUp : public SetUpBase<dim>
   {
-      SetUp () {}
+    SetUp () {}
 
-      virtual
-      const Function<dim> &  get_boundary_values () const;
+    virtual
+    const Function<dim>   &get_boundary_values () const;
 
-      virtual
-      const Function<dim> &  get_right_hand_side () const;
+    virtual
+    const Function<dim>   &get_right_hand_side () const;
 
 
-      virtual
-      void create_coarse_grid (Triangulation<dim> &coarse_grid) const;
+    virtual
+    void create_coarse_grid (Triangulation<dim> &coarse_grid) const;
 
-    private:
-      static const typename Traits::BoundaryValues boundary_values;
-      static const typename Traits::RightHandSide  right_hand_side;
+  private:
+    static const typename Traits::BoundaryValues boundary_values;
+    static const typename Traits::RightHandSide  right_hand_side;
   };
 
   template <class Traits, int dim>
@@ -938,28 +938,28 @@ namespace Data
   template <int dim>
   struct CurvedRidges
   {
-      class BoundaryValues : public Function<dim>
-      {
-       public:
-         BoundaryValues () : Function<dim> () {}
+    class BoundaryValues : public Function<dim>
+    {
+    public:
+      BoundaryValues () : Function<dim> () {}
 
-         virtual double value (const Point<dim>   &p,
-                               const unsigned int  component) const;
-      };
+      virtual double value (const Point<dim>   &p,
+                            const unsigned int  component) const;
+    };
 
 
-      class RightHandSide : public Function<dim>
-      {
-       public:
-         RightHandSide () : Function<dim> () {}
+    class RightHandSide : public Function<dim>
+    {
+    public:
+      RightHandSide () : Function<dim> () {}
 
-         virtual double value (const Point<dim>   &p,
-                               const unsigned int  component) const;
-      };
+      virtual double value (const Point<dim>   &p,
+                            const unsigned int  component) const;
+    };
 
-      static
-      void
-      create_coarse_grid (Triangulation<dim> &coarse_grid);
+    static
+    void
+    create_coarse_grid (Triangulation<dim> &coarse_grid);
   };
 
 
@@ -967,7 +967,7 @@ namespace Data
   double
   CurvedRidges<dim>::BoundaryValues::
   value (const Point<dim>   &p,
-        const unsigned int  /*component*/) const
+         const unsigned int  /*component*/) const
   {
     double q = p(0);
     for (unsigned int i=1; i<dim; ++i)
@@ -981,22 +981,22 @@ namespace Data
   template <int dim>
   double
   CurvedRidges<dim>::RightHandSide::value (const Point<dim>   &p,
-                                          const unsigned int  /*component*/) const
+                                           const unsigned int  /*component*/) const
   {
     double q = p(0);
     for (unsigned int i=1; i<dim; ++i)
       q += std::sin(10*p(i)+5*p(0)*p(0));
     const double u = std::exp(q);
     double t1 = 1,
-          t2 = 0,
-          t3 = 0;
+           t2 = 0,
+           t3 = 0;
     for (unsigned int i=1; i<dim; ++i)
       {
-       t1 += std::cos(10*p(i)+5*p(0)*p(0)) * 10 * p(0);
-       t2 += 10*std::cos(10*p(i)+5*p(0)*p(0)) -
-             100*std::sin(10*p(i)+5*p(0)*p(0)) * p(0)*p(0);
-       t3 += 100*std::cos(10*p(i)+5*p(0)*p(0))*std::cos(10*p(i)+5*p(0)*p(0)) -
-             100*std::sin(10*p(i)+5*p(0)*p(0));
+        t1 += std::cos(10*p(i)+5*p(0)*p(0)) * 10 * p(0);
+        t2 += 10*std::cos(10*p(i)+5*p(0)*p(0)) -
+              100*std::sin(10*p(i)+5*p(0)*p(0)) * p(0)*p(0);
+        t3 += 100*std::cos(10*p(i)+5*p(0)*p(0))*std::cos(10*p(i)+5*p(0)*p(0)) -
+              100*std::sin(10*p(i)+5*p(0)*p(0));
       };
     t1 = t1*t1;
 
@@ -1018,17 +1018,17 @@ namespace Data
   template <int dim>
   struct Exercise_2_3
   {
-      typedef ZeroFunction<dim> BoundaryValues;
+    typedef ZeroFunction<dim> BoundaryValues;
 
-      class RightHandSide : public ConstantFunction<dim>
-      {
-       public:
-         RightHandSide () : ConstantFunction<dim> (1.) {}
-      };
+    class RightHandSide : public ConstantFunction<dim>
+    {
+    public:
+      RightHandSide () : ConstantFunction<dim> (1.) {}
+    };
 
-      static
-      void
-      create_coarse_grid (Triangulation<dim> &coarse_grid);
+    static
+    void
+    create_coarse_grid (Triangulation<dim> &coarse_grid);
   };
 
 
@@ -1041,68 +1041,70 @@ namespace Data
 
     static const Point<2> vertices_1[]
       = {  Point<2> (-1.,   -1.),
-            Point<2> (-1./2, -1.),
-            Point<2> (0.,    -1.),
-            Point<2> (+1./2, -1.),
-            Point<2> (+1,    -1.),
-
-            Point<2> (-1.,   -1./2.),
-            Point<2> (-1./2, -1./2.),
-            Point<2> (0.,    -1./2.),
-            Point<2> (+1./2, -1./2.),
-            Point<2> (+1,    -1./2.),
-
-            Point<2> (-1.,   0.),
-            Point<2> (-1./2, 0.),
-            Point<2> (+1./2, 0.),
-            Point<2> (+1,    0.),
-
-            Point<2> (-1.,   1./2.),
-            Point<2> (-1./2, 1./2.),
-            Point<2> (0.,    1./2.),
-            Point<2> (+1./2, 1./2.),
-            Point<2> (+1,    1./2.),
-
-            Point<2> (-1.,   1.),
-            Point<2> (-1./2, 1.),
-            Point<2> (0.,    1.),
-            Point<2> (+1./2, 1.),
-            Point<2> (+1,    1.)    };
+           Point<2> (-1./2, -1.),
+           Point<2> (0.,    -1.),
+           Point<2> (+1./2, -1.),
+           Point<2> (+1,    -1.),
+
+           Point<2> (-1.,   -1./2.),
+           Point<2> (-1./2, -1./2.),
+           Point<2> (0.,    -1./2.),
+           Point<2> (+1./2, -1./2.),
+           Point<2> (+1,    -1./2.),
+
+           Point<2> (-1.,   0.),
+           Point<2> (-1./2, 0.),
+           Point<2> (+1./2, 0.),
+           Point<2> (+1,    0.),
+
+           Point<2> (-1.,   1./2.),
+           Point<2> (-1./2, 1./2.),
+           Point<2> (0.,    1./2.),
+           Point<2> (+1./2, 1./2.),
+           Point<2> (+1,    1./2.),
+
+           Point<2> (-1.,   1.),
+           Point<2> (-1./2, 1.),
+           Point<2> (0.,    1.),
+           Point<2> (+1./2, 1.),
+           Point<2> (+1,    1.)
+        };
     const unsigned int
-      n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
+    n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
 
     const std::vector<Point<dim> > vertices (&vertices_1[0],
-                                            &vertices_1[n_vertices]);
+                                             &vertices_1[n_vertices]);
 
     static const int cell_vertices[][GeometryInfo<dim>::vertices_per_cell]
-      = {{0, 1, 5, 6},
-        {1, 2, 6, 7},
-        {2, 3, 7, 8},
-        {3, 4, 8, 9},
-        {5, 6, 10, 11},
-        {8, 9, 12, 13},
-        {10, 11, 14, 15},
-        {12, 13, 17, 18},
-        {14, 15, 19, 20},
-        {15, 16, 20, 21},
-        {16, 17, 21, 22},
-        {17, 18, 22, 23}};
+    = {{0, 1, 5, 6},
+      {1, 2, 6, 7},
+      {2, 3, 7, 8},
+      {3, 4, 8, 9},
+      {5, 6, 10, 11},
+      {8, 9, 12, 13},
+      {10, 11, 14, 15},
+      {12, 13, 17, 18},
+      {14, 15, 19, 20},
+      {15, 16, 20, 21},
+      {16, 17, 21, 22},
+      {17, 18, 22, 23}
+    };
     const unsigned int
-      n_cells = sizeof(cell_vertices) / sizeof(cell_vertices[0]);
+    n_cells = sizeof(cell_vertices) / sizeof(cell_vertices[0]);
 
     std::vector<CellData<dim> > cells (n_cells, CellData<dim>());
     for (unsigned int i=0; i<n_cells; ++i)
       {
-       for (unsigned int j=0;
-            j<GeometryInfo<dim>::vertices_per_cell;
-            ++j)
-         cells[i].vertices[j] = cell_vertices[i][j];
-       cells[i].material_id = 0;
+        for (unsigned int j=0;
+             j<GeometryInfo<dim>::vertices_per_cell;
+             ++j)
+          cells[i].vertices[j] = cell_vertices[i][j];
+        cells[i].material_id = 0;
       };
 
     coarse_grid.create_triangulation (vertices,
-                                                   cells,
-                                                   SubCellData());
+                                      cells,
+                                      SubCellData());
 
     coarse_grid.refine_global (1);
   }
@@ -1117,11 +1119,11 @@ namespace DualFunctional
   template <int dim>
   class DualFunctionalBase : public Subscriptor
   {
-    public:
-      virtual
-      void
-      assemble_rhs (const DoFHandler<dim> &dof_handler,
-                   Vector<double>        &rhs) const = 0;
+  public:
+    virtual
+    void
+    assemble_rhs (const DoFHandler<dim> &dof_handler,
+                  Vector<double>        &rhs) const = 0;
   };
 
 
@@ -1129,29 +1131,29 @@ namespace DualFunctional
   template <int dim>
   class PointValueEvaluation : public DualFunctionalBase<dim>
   {
-    public:
-      PointValueEvaluation (const Point<dim> &evaluation_point);
+  public:
+    PointValueEvaluation (const Point<dim> &evaluation_point);
 
-      virtual
-      void
-      assemble_rhs (const DoFHandler<dim> &dof_handler,
-                   Vector<double>        &rhs) const;
+    virtual
+    void
+    assemble_rhs (const DoFHandler<dim> &dof_handler,
+                  Vector<double>        &rhs) const;
 
-      DeclException1 (ExcEvaluationPointNotFound,
-                     Point<dim>,
-                     << "The evaluation point " << arg1
-                     << " was not found among the vertices of the present grid.");
+    DeclException1 (ExcEvaluationPointNotFound,
+                    Point<dim>,
+                    << "The evaluation point " << arg1
+                    << " was not found among the vertices of the present grid.");
 
-    protected:
-      const Point<dim> evaluation_point;
+  protected:
+    const Point<dim> evaluation_point;
   };
 
 
   template <int dim>
   PointValueEvaluation<dim>::
   PointValueEvaluation (const Point<dim> &evaluation_point)
-                 :
-                 evaluation_point (evaluation_point)
+    :
+    evaluation_point (evaluation_point)
   {}
 
 
@@ -1159,23 +1161,23 @@ namespace DualFunctional
   void
   PointValueEvaluation<dim>::
   assemble_rhs (const DoFHandler<dim> &dof_handler,
-               Vector<double>        &rhs) const
+                Vector<double>        &rhs) const
   {
     rhs.reinit (dof_handler.n_dofs());
 
     typename DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     for (; cell!=endc; ++cell)
       for (unsigned int vertex=0;
-          vertex<GeometryInfo<dim>::vertices_per_cell;
-          ++vertex)
-       if (cell->vertex(vertex).distance(evaluation_point)
-           < cell->diameter()*1e-8)
-         {
-           rhs(cell->vertex_dof_index(vertex,0)) = 1;
-           return;
-         };
+           vertex<GeometryInfo<dim>::vertices_per_cell;
+           ++vertex)
+        if (cell->vertex(vertex).distance(evaluation_point)
+            < cell->diameter()*1e-8)
+          {
+            rhs(cell->vertex_dof_index(vertex,0)) = 1;
+            return;
+          };
 
     AssertThrow (false, ExcEvaluationPointNotFound(evaluation_point));
   }
@@ -1185,29 +1187,29 @@ namespace DualFunctional
   template <int dim>
   class PointXDerivativeEvaluation : public DualFunctionalBase<dim>
   {
-    public:
-      PointXDerivativeEvaluation (const Point<dim> &evaluation_point);
+  public:
+    PointXDerivativeEvaluation (const Point<dim> &evaluation_point);
 
-      virtual
-      void
-      assemble_rhs (const DoFHandler<dim> &dof_handler,
-                   Vector<double>        &rhs) const;
+    virtual
+    void
+    assemble_rhs (const DoFHandler<dim> &dof_handler,
+                  Vector<double>        &rhs) const;
 
-      DeclException1 (ExcEvaluationPointNotFound,
-                     Point<dim>,
-                     << "The evaluation point " << arg1
-                     << " was not found among the vertices of the present grid.");
+    DeclException1 (ExcEvaluationPointNotFound,
+                    Point<dim>,
+                    << "The evaluation point " << arg1
+                    << " was not found among the vertices of the present grid.");
 
-    protected:
-      const Point<dim> evaluation_point;
+  protected:
+    const Point<dim> evaluation_point;
   };
 
 
   template <int dim>
   PointXDerivativeEvaluation<dim>::
   PointXDerivativeEvaluation (const Point<dim> &evaluation_point)
-                 :
-                 evaluation_point (evaluation_point)
+    :
+    evaluation_point (evaluation_point)
   {}
 
 
@@ -1215,15 +1217,15 @@ namespace DualFunctional
   void
   PointXDerivativeEvaluation<dim>::
   assemble_rhs (const DoFHandler<dim> &dof_handler,
-               Vector<double>        &rhs) const
+                Vector<double>        &rhs) const
   {
     rhs.reinit (dof_handler.n_dofs());
 
     QGauss<dim> quadrature(4);
     FEValues<dim>  fe_values (dof_handler.get_fe(), quadrature,
-                             update_gradients |
-                             update_q_points  |
-                             update_JxW_values);
+                              update_gradients |
+                              update_q_points  |
+                              update_JxW_values);
     const unsigned int n_q_points = fe_values.n_quadrature_points;
     const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell;
 
@@ -1233,30 +1235,30 @@ namespace DualFunctional
     double total_volume = 0;
 
     typename DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     for (; cell!=endc; ++cell)
       if (cell->center().distance(evaluation_point) <=
-         cell->diameter())
-       {
-         fe_values.reinit (cell);
-         cell_rhs = 0;
-
-         for (unsigned int q=0; q<n_q_points; ++q)
-           {
-             for (unsigned int i=0; i<dofs_per_cell; ++i)
-               cell_rhs(i) += fe_values.shape_grad(i,q)[0] *
-                              fe_values.JxW (q);
-             total_volume += fe_values.JxW (q);
-           };
-
-         cell->get_dof_indices (local_dof_indices);
-         for (unsigned int i=0; i<dofs_per_cell; ++i)
-           rhs(local_dof_indices[i]) += cell_rhs(i);
-       };
+          cell->diameter())
+        {
+          fe_values.reinit (cell);
+          cell_rhs = 0;
+
+          for (unsigned int q=0; q<n_q_points; ++q)
+            {
+              for (unsigned int i=0; i<dofs_per_cell; ++i)
+                cell_rhs(i) += fe_values.shape_grad(i,q)[0] *
+                               fe_values.JxW (q);
+              total_volume += fe_values.JxW (q);
+            };
+
+          cell->get_dof_indices (local_dof_indices);
+          for (unsigned int i=0; i<dofs_per_cell; ++i)
+            rhs(local_dof_indices[i]) += cell_rhs(i);
+        };
 
     AssertThrow (total_volume > 0,
-                ExcEvaluationPointNotFound(evaluation_point));
+                 ExcEvaluationPointNotFound(evaluation_point));
 
     rhs.scale (1./total_volume);
   }
@@ -1272,32 +1274,32 @@ namespace LaplaceSolver
   template <int dim>
   class DualSolver : public Solver<dim>
   {
-    public:
-      DualSolver (Triangulation<dim>       &triangulation,
-                 const FiniteElement<dim> &fe,
-                 const Quadrature<dim>    &quadrature,
-                 const Quadrature<dim-1>  &face_quadrature,
-                 const DualFunctional::DualFunctionalBase<dim> &dual_functional);
+  public:
+    DualSolver (Triangulation<dim>       &triangulation,
+                const FiniteElement<dim> &fe,
+                const Quadrature<dim>    &quadrature,
+                const Quadrature<dim-1>  &face_quadrature,
+                const DualFunctional::DualFunctionalBase<dim> &dual_functional);
 
-      virtual
-      void
-      solve_problem ();
+    virtual
+    void
+    solve_problem ();
 
-      virtual
-      unsigned int
-      n_dofs () const;
+    virtual
+    unsigned int
+    n_dofs () const;
 
-      virtual
-      void
-      postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const;
+    virtual
+    void
+    postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const;
 
-    protected:
-      const SmartPointer<const DualFunctional::DualFunctionalBase<dim> > dual_functional;
-      virtual void assemble_rhs (Vector<double> &rhs) const;
+  protected:
+    const SmartPointer<const DualFunctional::DualFunctionalBase<dim> > dual_functional;
+    virtual void assemble_rhs (Vector<double> &rhs) const;
 
-      static const ZeroFunction<dim> boundary_values;
+    static const ZeroFunction<dim> boundary_values;
 
-      friend class WeightedResidual<dim>;
+    friend class WeightedResidual<dim>;
   };
 
   template <int dim>
@@ -1306,16 +1308,16 @@ namespace LaplaceSolver
   template <int dim>
   DualSolver<dim>::
   DualSolver (Triangulation<dim>       &triangulation,
-             const FiniteElement<dim> &fe,
-             const Quadrature<dim>    &quadrature,
-             const Quadrature<dim-1>  &face_quadrature,
-             const DualFunctional::DualFunctionalBase<dim> &dual_functional)
-                 :
-                 Base<dim> (triangulation),
-                 Solver<dim> (triangulation, fe,
-                              quadrature, face_quadrature,
-                              boundary_values),
-                  dual_functional (&dual_functional)
+              const FiniteElement<dim> &fe,
+              const Quadrature<dim>    &quadrature,
+              const Quadrature<dim-1>  &face_quadrature,
+              const DualFunctional::DualFunctionalBase<dim> &dual_functional)
+    :
+    Base<dim> (triangulation),
+    Solver<dim> (triangulation, fe,
+                 quadrature, face_quadrature,
+                 boundary_values),
+    dual_functional (&dual_functional)
   {}
 
 
@@ -1358,109 +1360,109 @@ namespace LaplaceSolver
 
   template <int dim>
   class WeightedResidual : public PrimalSolver<dim>,
-                          public DualSolver<dim>
+    public DualSolver<dim>
   {
-    public:
-      WeightedResidual (Triangulation<dim>       &coarse_grid,
-                       const FiniteElement<dim> &primal_fe,
-                       const FiniteElement<dim> &dual_fe,
-                       const Quadrature<dim>    &quadrature,
-                       const Quadrature<dim-1>  &face_quadrature,
-                       const Function<dim>      &rhs_function,
-                       const Function<dim>      &boundary_values,
-                       const DualFunctional::DualFunctionalBase<dim> &dual_functional);
-
-      virtual
-      void
-      solve_problem ();
-
-      virtual
-      void
-      postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const;
-
-      virtual
-      unsigned int
-      n_dofs () const;
-
-      virtual void refine_grid ();
-
-      virtual
-      void
-      output_solution () const;
-
-    private:
-      void solve_primal_problem ();
-      void solve_dual_problem ();
-
-      typedef
-      typename DoFHandler<dim>::active_cell_iterator
-      active_cell_iterator;
-
-      typedef
-      typename std::map<typename DoFHandler<dim>::face_iterator,double>
-      FaceIntegrals;
-
-      struct CellData
-      {
-         FEValues<dim>    fe_values;
-         const SmartPointer<const Function<dim> > right_hand_side;
-
-         std::vector<double> cell_residual;
-         std::vector<double> rhs_values;
-         std::vector<double> dual_weights;
-         typename std::vector<Tensor<2,dim> > cell_grad_grads;
-         CellData (const FiniteElement<dim> &fe,
-                   const Quadrature<dim>    &quadrature,
-                   const Function<dim>      &right_hand_side);
-      };
+  public:
+    WeightedResidual (Triangulation<dim>       &coarse_grid,
+                      const FiniteElement<dim> &primal_fe,
+                      const FiniteElement<dim> &dual_fe,
+                      const Quadrature<dim>    &quadrature,
+                      const Quadrature<dim-1>  &face_quadrature,
+                      const Function<dim>      &rhs_function,
+                      const Function<dim>      &boundary_values,
+                      const DualFunctional::DualFunctionalBase<dim> &dual_functional);
 
-      struct FaceData
-      {
-         FEFaceValues<dim>    fe_face_values_cell;
-         FEFaceValues<dim>    fe_face_values_neighbor;
-         FESubfaceValues<dim> fe_subface_values_cell;
-
-         std::vector<double> jump_residual;
-         std::vector<double> dual_weights;
-         typename std::vector<Tensor<1,dim> > cell_grads;
-         typename std::vector<Tensor<1,dim> > neighbor_grads;
-         FaceData (const FiniteElement<dim> &fe,
-                   const Quadrature<dim-1>  &face_quadrature);
-      };
+    virtual
+    void
+    solve_problem ();
+
+    virtual
+    void
+    postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const;
+
+    virtual
+    unsigned int
+    n_dofs () const;
+
+    virtual void refine_grid ();
+
+    virtual
+    void
+    output_solution () const;
+
+  private:
+    void solve_primal_problem ();
+    void solve_dual_problem ();
+
+    typedef
+    typename DoFHandler<dim>::active_cell_iterator
+    active_cell_iterator;
+
+    typedef
+    typename std::map<typename DoFHandler<dim>::face_iterator,double>
+    FaceIntegrals;
+
+    struct CellData
+    {
+      FEValues<dim>    fe_values;
+      const SmartPointer<const Function<dim> > right_hand_side;
+
+      std::vector<double> cell_residual;
+      std::vector<double> rhs_values;
+      std::vector<double> dual_weights;
+      typename std::vector<Tensor<2,dim> > cell_grad_grads;
+      CellData (const FiniteElement<dim> &fe,
+                const Quadrature<dim>    &quadrature,
+                const Function<dim>      &right_hand_side);
+    };
+
+    struct FaceData
+    {
+      FEFaceValues<dim>    fe_face_values_cell;
+      FEFaceValues<dim>    fe_face_values_neighbor;
+      FESubfaceValues<dim> fe_subface_values_cell;
+
+      std::vector<double> jump_residual;
+      std::vector<double> dual_weights;
+      typename std::vector<Tensor<1,dim> > cell_grads;
+      typename std::vector<Tensor<1,dim> > neighbor_grads;
+      FaceData (const FiniteElement<dim> &fe,
+                const Quadrature<dim-1>  &face_quadrature);
+    };
 
 
 
-      void estimate_error (Vector<float> &error_indicators) const;
-
-      void estimate_some (const Vector<double> &primal_solution,
-                         const Vector<double> &dual_weights,
-                         const unsigned int    n_threads,
-                         const unsigned int    this_thread,
-                         Vector<float>        &error_indicators,
-                         FaceIntegrals        &face_integrals) const;
-
-      void
-      integrate_over_cell (const active_cell_iterator &cell,
-                          const unsigned int          cell_index,
-                          const Vector<double>       &primal_solution,
-                          const Vector<double>       &dual_weights,
-                          CellData                   &cell_data,
-                          Vector<float>              &error_indicators) const;
-
-      void
-      integrate_over_regular_face (const active_cell_iterator &cell,
-                                  const unsigned int          face_no,
-                                  const Vector<double>       &primal_solution,
-                                  const Vector<double>       &dual_weights,
-                                  FaceData                   &face_data,
-                                  FaceIntegrals              &face_integrals) const;
-      void
-      integrate_over_irregular_face (const active_cell_iterator &cell,
-                                    const unsigned int          face_no,
-                                    const Vector<double>       &primal_solution,
-                                    const Vector<double>       &dual_weights,
-                                    FaceData                   &face_data,
-                                    FaceIntegrals              &face_integrals) const;
+    void estimate_error (Vector<float> &error_indicators) const;
+
+    void estimate_some (const Vector<double> &primal_solution,
+                        const Vector<double> &dual_weights,
+                        const unsigned int    n_threads,
+                        const unsigned int    this_thread,
+                        Vector<float>        &error_indicators,
+                        FaceIntegrals        &face_integrals) const;
+
+    void
+    integrate_over_cell (const active_cell_iterator &cell,
+                         const unsigned int          cell_index,
+                         const Vector<double>       &primal_solution,
+                         const Vector<double>       &dual_weights,
+                         CellData                   &cell_data,
+                         Vector<float>              &error_indicators) const;
+
+    void
+    integrate_over_regular_face (const active_cell_iterator &cell,
+                                 const unsigned int          face_no,
+                                 const Vector<double>       &primal_solution,
+                                 const Vector<double>       &dual_weights,
+                                 FaceData                   &face_data,
+                                 FaceIntegrals              &face_integrals) const;
+    void
+    integrate_over_irregular_face (const active_cell_iterator &cell,
+                                   const unsigned int          face_no,
+                                   const Vector<double>       &primal_solution,
+                                   const Vector<double>       &dual_weights,
+                                   FaceData                   &face_data,
+                                   FaceIntegrals              &face_integrals) const;
   };
 
 
@@ -1468,15 +1470,15 @@ namespace LaplaceSolver
   template <int dim>
   WeightedResidual<dim>::CellData::
   CellData (const FiniteElement<dim> &fe,
-           const Quadrature<dim>    &quadrature,
-           const Function<dim>      &right_hand_side)
-                 :
-                 fe_values (fe, quadrature,
-                            update_values             |
-                            update_second_derivatives |
-                            update_q_points           |
-                            update_JxW_values),
-                 right_hand_side (&right_hand_side)
+            const Quadrature<dim>    &quadrature,
+            const Function<dim>      &right_hand_side)
+    :
+    fe_values (fe, quadrature,
+               update_values             |
+               update_second_derivatives |
+               update_q_points           |
+               update_JxW_values),
+    right_hand_side (&right_hand_side)
   {
     const unsigned int n_q_points
       = quadrature.size();
@@ -1492,20 +1494,20 @@ namespace LaplaceSolver
   template <int dim>
   WeightedResidual<dim>::FaceData::
   FaceData (const FiniteElement<dim> &fe,
-           const Quadrature<dim-1>  &face_quadrature)
-                 :
-                 fe_face_values_cell (fe, face_quadrature,
-                                      update_values        |
-                                      update_gradients     |
-                                      update_JxW_values    |
-                                      update_normal_vectors),
-                 fe_face_values_neighbor (fe, face_quadrature,
-                                          update_values     |
-                                          update_gradients  |
-                                          update_JxW_values |
-                                          update_normal_vectors),
-                 fe_subface_values_cell (fe, face_quadrature,
-                                         update_gradients)
+            const Quadrature<dim-1>  &face_quadrature)
+    :
+    fe_face_values_cell (fe, face_quadrature,
+                         update_values        |
+                         update_gradients     |
+                         update_JxW_values    |
+                         update_normal_vectors),
+    fe_face_values_neighbor (fe, face_quadrature,
+                             update_values     |
+                             update_gradients  |
+                             update_JxW_values |
+                             update_normal_vectors),
+    fe_subface_values_cell (fe, face_quadrature,
+                            update_gradients)
   {
     const unsigned int n_face_q_points
       = face_quadrature.size();
@@ -1522,21 +1524,21 @@ namespace LaplaceSolver
   template <int dim>
   WeightedResidual<dim>::
   WeightedResidual (Triangulation<dim>       &coarse_grid,
-                   const FiniteElement<dim> &primal_fe,
-                   const FiniteElement<dim> &dual_fe,
-                   const Quadrature<dim>    &quadrature,
-                   const Quadrature<dim-1>  &face_quadrature,
-                   const Function<dim>      &rhs_function,
-                   const Function<dim>      &bv,
-                   const DualFunctional::DualFunctionalBase<dim> &dual_functional)
-                 :
-                 Base<dim> (coarse_grid),
-                  PrimalSolver<dim> (coarse_grid, primal_fe,
-                                    quadrature, face_quadrature,
-                                    rhs_function, bv),
-                  DualSolver<dim> (coarse_grid, dual_fe,
-                                  quadrature, face_quadrature,
-                                  dual_functional)
+                    const FiniteElement<dim> &primal_fe,
+                    const FiniteElement<dim> &dual_fe,
+                    const Quadrature<dim>    &quadrature,
+                    const Quadrature<dim-1>  &face_quadrature,
+                    const Function<dim>      &rhs_function,
+                    const Function<dim>      &bv,
+                    const DualFunctional::DualFunctionalBase<dim> &dual_functional)
+    :
+    Base<dim> (coarse_grid),
+    PrimalSolver<dim> (coarse_grid, primal_fe,
+                       quadrature, face_quadrature,
+                       rhs_function, bv),
+    DualSolver<dim> (coarse_grid, dual_fe,
+                     quadrature, face_quadrature,
+                     dual_functional)
   {}
 
 
@@ -1590,12 +1592,12 @@ namespace LaplaceSolver
     estimate_error (error_indicators);
 
     for (Vector<float>::iterator i=error_indicators.begin();
-        i != error_indicators.end(); ++i)
+         i != error_indicators.end(); ++i)
       *i = std::fabs (*i);
 
     GridRefinement::refine_and_coarsen_fixed_fraction (*this->triangulation,
-                                                      error_indicators,
-                                                      0.8, 0.02);
+                                                       error_indicators,
+                                                       0.8, 0.02);
     this->triangulation->execute_coarsening_and_refinement ();
   }
 
@@ -1609,30 +1611,30 @@ namespace LaplaceSolver
 
     ConstraintMatrix primal_hanging_node_constraints;
     DoFTools::make_hanging_node_constraints (primal_solver.dof_handler,
-                                            primal_hanging_node_constraints);
+                                             primal_hanging_node_constraints);
     primal_hanging_node_constraints.close();
     Vector<double> dual_solution (primal_solver.dof_handler.n_dofs());
     FETools::interpolate (dual_solver.dof_handler,
-                         dual_solver.solution,
-                         primal_solver.dof_handler,
-                         primal_hanging_node_constraints,
-                         dual_solution);
+                          dual_solver.solution,
+                          primal_solver.dof_handler,
+                          primal_hanging_node_constraints,
+                          dual_solution);
 
     DataOut<dim> data_out;
     data_out.attach_dof_handler (primal_solver.dof_handler);
 
     data_out.add_data_vector (primal_solver.solution,
-                             "primal_solution");
+                              "primal_solution");
     data_out.add_data_vector (dual_solution,
-                             "dual_solution");
+                              "dual_solution");
 
     data_out.build_patches ();
 
     std::ostringstream filename;
     filename << "solution-"
-            << this->refinement_cycle
-            << ".gnuplot"
-            << std::ends;
+             << this->refinement_cycle
+             << ".gnuplot"
+             << std::ends;
     data_out.write (deallog.get_file_stream(), DataOut<dim>::gnuplot);
   }
 
@@ -1649,68 +1651,68 @@ namespace LaplaceSolver
 
     ConstraintMatrix dual_hanging_node_constraints;
     DoFTools::make_hanging_node_constraints (dual_solver.dof_handler,
-                                            dual_hanging_node_constraints);
+                                             dual_hanging_node_constraints);
     dual_hanging_node_constraints.close();
     Vector<double> primal_solution (dual_solver.dof_handler.n_dofs());
     FETools::interpolate (primal_solver.dof_handler,
-                         primal_solver.solution,
-                         dual_solver.dof_handler,
-                         dual_hanging_node_constraints,
-                         primal_solution);
+                          primal_solver.solution,
+                          dual_solver.dof_handler,
+                          dual_hanging_node_constraints,
+                          primal_solution);
 
     ConstraintMatrix primal_hanging_node_constraints;
     DoFTools::make_hanging_node_constraints (primal_solver.dof_handler,
-                                            primal_hanging_node_constraints);
+                                             primal_hanging_node_constraints);
     primal_hanging_node_constraints.close();
     Vector<double> dual_weights (dual_solver.dof_handler.n_dofs());
     FETools::interpolation_difference (dual_solver.dof_handler,
-                                      dual_hanging_node_constraints,
-                                      dual_solver.solution,
-                                      primal_solver.dof_handler,
-                                      primal_hanging_node_constraints,
-                                      dual_weights);
+                                       dual_hanging_node_constraints,
+                                       dual_solver.solution,
+                                       primal_solver.dof_handler,
+                                       primal_hanging_node_constraints,
+                                       dual_weights);
 
 
     FaceIntegrals face_integrals;
     for (active_cell_iterator cell=dual_solver.dof_handler.begin_active();
-        cell!=dual_solver.dof_handler.end();
-        ++cell)
+         cell!=dual_solver.dof_handler.end();
+         ++cell)
       for (unsigned int face_no=0;
-          face_no<GeometryInfo<dim>::faces_per_cell;
-          ++face_no)
-       face_integrals[cell->face(face_no)] = -1e20;
+           face_no<GeometryInfo<dim>::faces_per_cell;
+           ++face_no)
+        face_integrals[cell->face(face_no)] = -1e20;
 
     error_indicators.reinit (dual_solver.dof_handler
-                            .get_tria().n_active_cells());
+                             .get_tria().n_active_cells());
 
     const unsigned int n_threads = multithread_info.n_default_threads;
     for (unsigned int i=0; i<n_threads; ++i)
       {
-       estimate_some
-         (primal_solution,
-          dual_weights,
-          n_threads, i,
-          error_indicators,
-          face_integrals);
+        estimate_some
+        (primal_solution,
+         dual_weights,
+         n_threads, i,
+         error_indicators,
+         face_integrals);
       }
 
     unsigned int present_cell=0;
     for (active_cell_iterator cell=dual_solver.dof_handler.begin_active();
-        cell!=dual_solver.dof_handler.end();
-        ++cell, ++present_cell)
+         cell!=dual_solver.dof_handler.end();
+         ++cell, ++present_cell)
       for (unsigned int face_no=0; face_no<GeometryInfo<dim>::faces_per_cell;
-          ++face_no)
-       {
-         Assert(face_integrals.find(cell->face(face_no)) !=
-                face_integrals.end(),
-                ExcInternalError());
-         error_indicators(present_cell)
-           -= 0.5*face_integrals[cell->face(face_no)];
-       };
+           ++face_no)
+        {
+          Assert(face_integrals.find(cell->face(face_no)) !=
+                 face_integrals.end(),
+                 ExcInternalError());
+          error_indicators(present_cell)
+          -= 0.5*face_integrals[cell->face(face_no)];
+        };
     deallog << "   Estimated error="
-             << std::accumulate (error_indicators.begin(),
-                                 error_indicators.end(), 0.)
-             << std::endl;
+            << std::accumulate (error_indicators.begin(),
+                                error_indicators.end(), 0.)
+            << std::endl;
   }
 
 
@@ -1719,25 +1721,25 @@ namespace LaplaceSolver
   void
   WeightedResidual<dim>::
   estimate_some (const Vector<double> &primal_solution,
-                const Vector<double> &dual_weights,
-                const unsigned int    n_threads,
-                const unsigned int    this_thread,
-                Vector<float>        &error_indicators,
-                FaceIntegrals        &face_integrals) const
+                 const Vector<double> &dual_weights,
+                 const unsigned int    n_threads,
+                 const unsigned int    this_thread,
+                 Vector<float>        &error_indicators,
+                 FaceIntegrals        &face_integrals) const
   {
     const PrimalSolver<dim> &primal_solver = *this;
     const DualSolver<dim>   &dual_solver   = *this;
 
     CellData cell_data (*dual_solver.fe,
-                       *dual_solver.quadrature,
-                       *primal_solver.rhs_function);
+                        *dual_solver.quadrature,
+                        *primal_solver.rhs_function);
     FaceData face_data (*dual_solver.fe,
-                       *dual_solver.face_quadrature);
+                        *dual_solver.face_quadrature);
 
     active_cell_iterator cell=dual_solver.dof_handler.begin_active();
     for (unsigned int t=0;
-        (t<this_thread) && (cell!=dual_solver.dof_handler.end());
-        ++t, ++cell)
+         (t<this_thread) && (cell!=dual_solver.dof_handler.end());
+         ++t, ++cell)
       {
       }
 
@@ -1747,54 +1749,54 @@ namespace LaplaceSolver
 
     for (unsigned int cell_index=this_thread; true; )
       {
-       integrate_over_cell (cell, cell_index,
-                            primal_solution,
-                            dual_weights,
-                            cell_data,
-                            error_indicators);
-
-       for (unsigned int face_no=0;
-            face_no<GeometryInfo<dim>::faces_per_cell;
-            ++face_no)
-         {
-           if (cell->face(face_no)->at_boundary())
-             {
-               face_integrals[cell->face(face_no)] = 0;
-               continue;
-             };
-
-           if ((cell->neighbor(face_no)->has_children() == false) &&
-               (cell->neighbor(face_no)->level() == cell->level()) &&
-               (cell->neighbor(face_no)->index() < cell->index()))
-             continue;
-
-           if (cell->at_boundary(face_no) == false)
-             if (cell->neighbor(face_no)->level() < cell->level())
-               continue;
-
-
-           if (cell->face(face_no)->has_children() == false)
-             integrate_over_regular_face (cell, face_no,
-                                          primal_solution,
-                                          dual_weights,
-                                          face_data,
-                                          face_integrals);
-           else
-             integrate_over_irregular_face (cell, face_no,
-                                            primal_solution,
-                                            dual_weights,
-                                            face_data,
-                                            face_integrals);
-         };
-
-       for (unsigned int t=0;
-            ((t<n_threads) && (cell!=dual_solver.dof_handler.end()));
-            ++t, ++cell, ++cell_index)
-         {
-         }
-
-       if (cell == dual_solver.dof_handler.end())
-         break;
+        integrate_over_cell (cell, cell_index,
+                             primal_solution,
+                             dual_weights,
+                             cell_data,
+                             error_indicators);
+
+        for (unsigned int face_no=0;
+             face_no<GeometryInfo<dim>::faces_per_cell;
+             ++face_no)
+          {
+            if (cell->face(face_no)->at_boundary())
+              {
+                face_integrals[cell->face(face_no)] = 0;
+                continue;
+              };
+
+            if ((cell->neighbor(face_no)->has_children() == false) &&
+                (cell->neighbor(face_no)->level() == cell->level()) &&
+                (cell->neighbor(face_no)->index() < cell->index()))
+              continue;
+
+            if (cell->at_boundary(face_no) == false)
+              if (cell->neighbor(face_no)->level() < cell->level())
+                continue;
+
+
+            if (cell->face(face_no)->has_children() == false)
+              integrate_over_regular_face (cell, face_no,
+                                           primal_solution,
+                                           dual_weights,
+                                           face_data,
+                                           face_integrals);
+            else
+              integrate_over_irregular_face (cell, face_no,
+                                             primal_solution,
+                                             dual_weights,
+                                             face_data,
+                                             face_integrals);
+          };
+
+        for (unsigned int t=0;
+             ((t<n_threads) && (cell!=dual_solver.dof_handler.end()));
+             ++t, ++cell, ++cell_index)
+          {
+          }
+
+        if (cell == dual_solver.dof_handler.end())
+          break;
       };
   }
 
@@ -1803,27 +1805,27 @@ namespace LaplaceSolver
   template <int dim>
   void WeightedResidual<dim>::
   integrate_over_cell (const active_cell_iterator &cell,
-                      const unsigned int          cell_index,
-                      const Vector<double>       &primal_solution,
-                      const Vector<double>       &dual_weights,
-                      CellData                   &cell_data,
-                      Vector<float>              &error_indicators) const
+                       const unsigned int          cell_index,
+                       const Vector<double>       &primal_solution,
+                       const Vector<double>       &dual_weights,
+                       CellData                   &cell_data,
+                       Vector<float>              &error_indicators) const
   {
     cell_data.fe_values.reinit (cell);
     cell_data.right_hand_side
-      ->value_list (cell_data.fe_values.get_quadrature_points(),
-                   cell_data.rhs_values);
+    ->value_list (cell_data.fe_values.get_quadrature_points(),
+                  cell_data.rhs_values);
     cell_data.fe_values.get_function_2nd_derivatives (primal_solution,
-                                                     cell_data.cell_grad_grads);
+                                                      cell_data.cell_grad_grads);
 
     cell_data.fe_values.get_function_values (dual_weights,
-                                            cell_data.dual_weights);
+                                             cell_data.dual_weights);
 
     double sum = 0;
     for (unsigned int p=0; p<cell_data.fe_values.n_quadrature_points; ++p)
       sum += ((cell_data.rhs_values[p]+trace(cell_data.cell_grad_grads[p])) *
-             cell_data.dual_weights[p] *
-             cell_data.fe_values.JxW (p));
+              cell_data.dual_weights[p] *
+              cell_data.fe_values.JxW (p));
     error_indicators(cell_index) += sum;
   }
 
@@ -1832,46 +1834,46 @@ namespace LaplaceSolver
   template <int dim>
   void WeightedResidual<dim>::
   integrate_over_regular_face (const active_cell_iterator &cell,
-                              const unsigned int          face_no,
-                              const Vector<double>       &primal_solution,
-                              const Vector<double>       &dual_weights,
-                              FaceData                   &face_data,
-                              FaceIntegrals              &face_integrals) const
+                               const unsigned int          face_no,
+                               const Vector<double>       &primal_solution,
+                               const Vector<double>       &dual_weights,
+                               FaceData                   &face_data,
+                               FaceIntegrals              &face_integrals) const
   {
     const unsigned int
-      n_q_points = face_data.fe_face_values_cell.n_quadrature_points;
+    n_q_points = face_data.fe_face_values_cell.n_quadrature_points;
 
     face_data.fe_face_values_cell.reinit (cell, face_no);
     face_data.fe_face_values_cell.get_function_grads (primal_solution,
-                                                     face_data.cell_grads);
+                                                      face_data.cell_grads);
 
     Assert (cell->neighbor(face_no).state() == IteratorState::valid,
-           ExcInternalError());
+            ExcInternalError());
     const unsigned int
-      neighbor_neighbor = cell->neighbor_of_neighbor (face_no);
+    neighbor_neighbor = cell->neighbor_of_neighbor (face_no);
     const active_cell_iterator neighbor = cell->neighbor(face_no);
     face_data.fe_face_values_neighbor.reinit (neighbor, neighbor_neighbor);
     face_data.fe_face_values_neighbor.get_function_grads (primal_solution,
-                                                         face_data.neighbor_grads);
+                                                          face_data.neighbor_grads);
 
     for (unsigned int p=0; p<n_q_points; ++p)
       face_data.jump_residual[p]
-       = ((face_data.cell_grads[p] - face_data.neighbor_grads[p]) *
-          face_data.fe_face_values_cell.normal_vector(p));
+        = ((face_data.cell_grads[p] - face_data.neighbor_grads[p]) *
+           face_data.fe_face_values_cell.normal_vector(p));
 
     face_data.fe_face_values_cell.get_function_values (dual_weights,
-                                                      face_data.dual_weights);
+                                                       face_data.dual_weights);
 
     double face_integral = 0;
     for (unsigned int p=0; p<n_q_points; ++p)
       face_integral += (face_data.jump_residual[p] *
-                       face_data.dual_weights[p]  *
-                       face_data.fe_face_values_cell.JxW(p));
+                        face_data.dual_weights[p]  *
+                        face_data.fe_face_values_cell.JxW(p));
 
     Assert (face_integrals.find (cell->face(face_no)) != face_integrals.end(),
-           ExcInternalError());
+            ExcInternalError());
     Assert (face_integrals[cell->face(face_no)] == -1e20,
-           ExcInternalError());
+            ExcInternalError());
 
     face_integrals[cell->face(face_no)] = face_integral;
   }
@@ -1881,72 +1883,72 @@ namespace LaplaceSolver
   template <int dim>
   void WeightedResidual<dim>::
   integrate_over_irregular_face (const active_cell_iterator &cell,
-                                const unsigned int          face_no,
-                                const Vector<double>       &primal_solution,
-                                const Vector<double>       &dual_weights,
-                                FaceData                   &face_data,
-                                FaceIntegrals              &face_integrals) const
+                                 const unsigned int          face_no,
+                                 const Vector<double>       &primal_solution,
+                                 const Vector<double>       &dual_weights,
+                                 FaceData                   &face_data,
+                                 FaceIntegrals              &face_integrals) const
   {
     const unsigned int
-      n_q_points = face_data.fe_face_values_cell.n_quadrature_points;
+    n_q_points = face_data.fe_face_values_cell.n_quadrature_points;
 
     const typename DoFHandler<dim>::face_iterator
-      face = cell->face(face_no);
+    face = cell->face(face_no);
     const typename DoFHandler<dim>::cell_iterator
-      neighbor = cell->neighbor(face_no);
+    neighbor = cell->neighbor(face_no);
     Assert (neighbor.state() == IteratorState::valid,
-           ExcInternalError());
+            ExcInternalError());
     Assert (neighbor->has_children(),
-           ExcInternalError());
+            ExcInternalError());
 
     const unsigned int
-      neighbor_neighbor = cell->neighbor_of_neighbor (face_no);
+    neighbor_neighbor = cell->neighbor_of_neighbor (face_no);
 
     for (unsigned int subface_no=0;
-        subface_no<face->n_children(); ++subface_no)
+         subface_no<face->n_children(); ++subface_no)
       {
-       const active_cell_iterator neighbor_child
+        const active_cell_iterator neighbor_child
           = cell->neighbor_child_on_subface (face_no, subface_no);
-       Assert (neighbor_child->face(neighbor_neighbor) ==
-               cell->face(face_no)->child(subface_no),
-               ExcInternalError());
-
-       face_data.fe_subface_values_cell.reinit (cell, face_no, subface_no);
-       face_data.fe_subface_values_cell.get_function_grads (primal_solution,
-                                                            face_data.cell_grads);
-       face_data.fe_face_values_neighbor.reinit (neighbor_child,
-                                            neighbor_neighbor);
-       face_data.fe_face_values_neighbor.get_function_grads (primal_solution,
-                                                             face_data.neighbor_grads);
-
-       for (unsigned int p=0; p<n_q_points; ++p)
-         face_data.jump_residual[p]
-            = ((face_data.neighbor_grads[p] - face_data.cell_grads[p]) *
-               face_data.fe_face_values_neighbor.normal_vector(p));
-
-       face_data.fe_face_values_neighbor.get_function_values (dual_weights,
-                                                              face_data.dual_weights);
-
-       double face_integral = 0;
-       for (unsigned int p=0; p<n_q_points; ++p)
-         face_integral += (face_data.jump_residual[p] *
-                           face_data.dual_weights[p] *
-                           face_data.fe_face_values_neighbor.JxW(p));
-       face_integrals[neighbor_child->face(neighbor_neighbor)]
-         = face_integral;
+        Assert (neighbor_child->face(neighbor_neighbor) ==
+                cell->face(face_no)->child(subface_no),
+                ExcInternalError());
+
+        face_data.fe_subface_values_cell.reinit (cell, face_no, subface_no);
+        face_data.fe_subface_values_cell.get_function_grads (primal_solution,
+                                                             face_data.cell_grads);
+        face_data.fe_face_values_neighbor.reinit (neighbor_child,
+                                                  neighbor_neighbor);
+        face_data.fe_face_values_neighbor.get_function_grads (primal_solution,
+                                                              face_data.neighbor_grads);
+
+        for (unsigned int p=0; p<n_q_points; ++p)
+          face_data.jump_residual[p]
+            = ((face_data.neighbor_grads[p] - face_data.cell_grads[p]) *
+               face_data.fe_face_values_neighbor.normal_vector(p));
+
+        face_data.fe_face_values_neighbor.get_function_values (dual_weights,
+                                                               face_data.dual_weights);
+
+        double face_integral = 0;
+        for (unsigned int p=0; p<n_q_points; ++p)
+          face_integral += (face_data.jump_residual[p] *
+                            face_data.dual_weights[p] *
+                            face_data.fe_face_values_neighbor.JxW(p));
+        face_integrals[neighbor_child->face(neighbor_neighbor)]
+          = face_integral;
       };
 
     double sum = 0;
     for (unsigned int subface_no=0;
-        subface_no<face->n_children(); ++subface_no)
+         subface_no<face->n_children(); ++subface_no)
       {
-       Assert (face_integrals.find(face->child(subface_no)) !=
-               face_integrals.end(),
-               ExcInternalError());
-       Assert (face_integrals[face->child(subface_no)] != -1e20,
-               ExcInternalError());
+        Assert (face_integrals.find(face->child(subface_no)) !=
+                face_integrals.end(),
+                ExcInternalError());
+        Assert (face_integrals[face->child(subface_no)] != -1e20,
+                ExcInternalError());
 
-       sum += face_integrals[face->child(subface_no)];
+        sum += face_integrals[face->child(subface_no)];
       };
     face_integrals[face] = sum;
   }
@@ -1958,49 +1960,50 @@ namespace LaplaceSolver
 template <int dim>
 struct Framework
 {
-  public:
-    typedef Evaluation::EvaluationBase<dim> Evaluator;
-    typedef std::list<Evaluator*>           EvaluatorList;
+public:
+  typedef Evaluation::EvaluationBase<dim> Evaluator;
+  typedef std::list<Evaluator *>           EvaluatorList;
 
 
-    struct ProblemDescription
-    {
-       unsigned int primal_fe_degree;
-       unsigned int dual_fe_degree;
+  struct ProblemDescription
+  {
+    unsigned int primal_fe_degree;
+    unsigned int dual_fe_degree;
 
-       SmartPointer<const Data::SetUpBase<dim> > data;
+    SmartPointer<const Data::SetUpBase<dim> > data;
 
-       enum RefinementCriterion {
-             dual_weighted_error_estimator,
-             global_refinement,
-             kelly_indicator,
-             weighted_kelly_indicator
-       };
+    enum RefinementCriterion
+    {
+      dual_weighted_error_estimator,
+      global_refinement,
+      kelly_indicator,
+      weighted_kelly_indicator
+    };
 
-       RefinementCriterion refinement_criterion;
+    RefinementCriterion refinement_criterion;
 
-       SmartPointer<const DualFunctional::DualFunctionalBase<dim> > dual_functional;
+    SmartPointer<const DualFunctional::DualFunctionalBase<dim> > dual_functional;
 
-       EvaluatorList evaluator_list;
+    EvaluatorList evaluator_list;
 
-       SmartPointer<const Function<dim> > kelly_weight;
+    SmartPointer<const Function<dim> > kelly_weight;
 
-       unsigned int max_degrees_of_freedom;
+    unsigned int max_degrees_of_freedom;
 
-       ProblemDescription ();
-    };
+    ProblemDescription ();
+  };
 
-    static void run (const ProblemDescription &descriptor);
+  static void run (const ProblemDescription &descriptor);
 };
 
 
 template <int dim>
 Framework<dim>::ProblemDescription::ProblemDescription ()
-               :
-               primal_fe_degree (1),
-               dual_fe_degree (2),
-               refinement_criterion (dual_weighted_error_estimator),
-               max_degrees_of_freedom (5000)
+  :
+  primal_fe_degree (1),
+  dual_fe_degree (2),
+  refinement_criterion (dual_weighted_error_estimator),
+  max_degrees_of_freedom (5000)
 {}
 
 
@@ -2009,7 +2012,7 @@ template <int dim>
 void Framework<dim>::run (const ProblemDescription &descriptor)
 {
   Triangulation<dim>
-    triangulation (Triangulation<dim>::smoothing_on_refinement);
+  triangulation (Triangulation<dim>::smoothing_on_refinement);
   descriptor.data->create_coarse_grid (triangulation);
 
   const FE_Q<dim>     primal_fe(descriptor.primal_fe_degree);
@@ -2017,89 +2020,89 @@ void Framework<dim>::run (const ProblemDescription &descriptor)
   const QGauss<dim>   quadrature(descriptor.dual_fe_degree+1);
   const QGauss<dim-1> face_quadrature(descriptor.dual_fe_degree+1);
 
-  LaplaceSolver::Base<dim> * solver = 0;
+  LaplaceSolver::Base<dim> *solver = 0;
   switch (descriptor.refinement_criterion)
     {
-      case ProblemDescription::dual_weighted_error_estimator:
-      {
-       solver
-         = new LaplaceSolver::WeightedResidual<dim> (triangulation,
-                                                     primal_fe,
-                                                     dual_fe,
-                                                     quadrature,
-                                                     face_quadrature,
-                                                     descriptor.data->get_right_hand_side(),
-                                                     descriptor.data->get_boundary_values(),
-                                                     *descriptor.dual_functional);
-       break;
-      };
+    case ProblemDescription::dual_weighted_error_estimator:
+    {
+      solver
+        = new LaplaceSolver::WeightedResidual<dim> (triangulation,
+                                                    primal_fe,
+                                                    dual_fe,
+                                                    quadrature,
+                                                    face_quadrature,
+                                                    descriptor.data->get_right_hand_side(),
+                                                    descriptor.data->get_boundary_values(),
+                                                    *descriptor.dual_functional);
+      break;
+    };
 
-      case ProblemDescription::global_refinement:
-      {
-       solver
-         = new LaplaceSolver::RefinementGlobal<dim> (triangulation,
-                                                     primal_fe,
-                                                     quadrature,
-                                                     face_quadrature,
-                                                     descriptor.data->get_right_hand_side(),
-                                                     descriptor.data->get_boundary_values());
-       break;
-      };
+    case ProblemDescription::global_refinement:
+    {
+      solver
+        = new LaplaceSolver::RefinementGlobal<dim> (triangulation,
+                                                    primal_fe,
+                                                    quadrature,
+                                                    face_quadrature,
+                                                    descriptor.data->get_right_hand_side(),
+                                                    descriptor.data->get_boundary_values());
+      break;
+    };
 
-      case ProblemDescription::kelly_indicator:
-      {
-       solver
-         = new LaplaceSolver::RefinementKelly<dim> (triangulation,
-                                                    primal_fe,
-                                                    quadrature,
-                                                    face_quadrature,
-                                                    descriptor.data->get_right_hand_side(),
-                                                    descriptor.data->get_boundary_values());
-       break;
-      };
+    case ProblemDescription::kelly_indicator:
+    {
+      solver
+        = new LaplaceSolver::RefinementKelly<dim> (triangulation,
+                                                   primal_fe,
+                                                   quadrature,
+                                                   face_quadrature,
+                                                   descriptor.data->get_right_hand_side(),
+                                                   descriptor.data->get_boundary_values());
+      break;
+    };
 
-      case ProblemDescription::weighted_kelly_indicator:
-      {
-       solver
-         = new LaplaceSolver::RefinementWeightedKelly<dim> (triangulation,
-                                                            primal_fe,
-                                                            quadrature,
-                                                            face_quadrature,
-                                                            descriptor.data->get_right_hand_side(),
-                                                            descriptor.data->get_boundary_values(),
-                                                            *descriptor.kelly_weight);
-       break;
-      };
+    case ProblemDescription::weighted_kelly_indicator:
+    {
+      solver
+        = new LaplaceSolver::RefinementWeightedKelly<dim> (triangulation,
+                                                           primal_fe,
+                                                           quadrature,
+                                                           face_quadrature,
+                                                           descriptor.data->get_right_hand_side(),
+                                                           descriptor.data->get_boundary_values(),
+                                                           *descriptor.kelly_weight);
+      break;
+    };
 
-      default:
-           AssertThrow (false, ExcInternalError());
+    default:
+      AssertThrow (false, ExcInternalError());
     };
 
   for (unsigned int step=0; true; ++step)
     {
-      deallog << "Refinement cycle: "  << step
-               << std::endl;
+      deallog << "Refinement cycle: " << step
+              << std::endl;
 
       solver->set_refinement_cycle (step);
       solver->solve_problem ();
       solver->output_solution ();
 
       deallog << "   Number of degrees of freedom="
-               << solver->n_dofs() << std::endl;
+              << solver->n_dofs() << std::endl;
 
       for (typename EvaluatorList::const_iterator
-            e = descriptor.evaluator_list.begin();
-          e != descriptor.evaluator_list.end(); ++e)
-       {
-         (*e)->set_refinement_cycle (step);
-         solver->postprocess (**e);
-       };
+           e = descriptor.evaluator_list.begin();
+           e != descriptor.evaluator_list.end(); ++e)
+        {
+          (*e)->set_refinement_cycle (step);
+          solver->postprocess (**e);
+        };
 
 
       if (solver->n_dofs() < descriptor.max_degrees_of_freedom)
-       solver->refine_grid ();
+        solver->refine_grid ();
       else
-       break;
+        break;
     };
 
   deallog << std::endl;
@@ -2127,7 +2130,7 @@ int main ()
       Framework<dim>::ProblemDescription descriptor;
 
       descriptor.refinement_criterion
-       = Framework<dim>::ProblemDescription::dual_weighted_error_estimator;
+        = Framework<dim>::ProblemDescription::dual_weighted_error_estimator;
 
       descriptor.primal_fe_degree = 1;
       descriptor.dual_fe_degree   = 2;
@@ -2136,12 +2139,12 @@ int main ()
 
       const Point<dim> evaluation_point (0.75, 0.75);
       descriptor.dual_functional
-       = new DualFunctional::PointValueEvaluation<dim> (evaluation_point);
+        = new DualFunctional::PointValueEvaluation<dim> (evaluation_point);
 
       Evaluation::PointValueEvaluation<dim>
-       postprocessor1 (evaluation_point);
+      postprocessor1 (evaluation_point);
       Evaluation::GridOutput<dim>
-       postprocessor2 ("grid");
+      postprocessor2 ("grid");
 
       descriptor.evaluator_list.push_back (&postprocessor1);
       descriptor.evaluator_list.push_back (&postprocessor2);
@@ -2154,24 +2157,24 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 
index 4db2458d80ac1874772ba8d6c5de035f708769a6..5e637fb6567a16455d955f4ea53ddf2fdf06c80d 100644 (file)
@@ -70,19 +70,19 @@ double gradient_power (const Tensor<1,dim> &v,
 
 
 
-class InitializationValues : public Function<1> 
+class InitializationValues : public Function<1>
 {
-  public:
-    InitializationValues () : Function<1>() {}
-    
-    virtual double value (const Point<1>     &p,
-                         const unsigned int  component = 0) const;
+public:
+  InitializationValues () : Function<1>() {}
+
+  virtual double value (const Point<1>     &p,
+                        const unsigned int  component = 0) const;
 };
 
 
 
 double InitializationValues::value (const Point<1> &p,
-                                    const unsigned int) const 
+                                    const unsigned int) const
 {
   const double base = std::pow(p(0), 1./3.);
   const double random = 2.*rand()/RAND_MAX-1;
@@ -92,54 +92,54 @@ double InitializationValues::value (const Point<1> &p,
 
 
 template <int dim>
-class MinimizationProblem 
+class MinimizationProblem
 {
-  public:
-    MinimizationProblem  (const unsigned int run_number);
-    void run ();
-    
-  private:
-    void initialize_solution ();
-    void setup_system_on_mesh ();
-    void assemble_step ();
-    double line_search (const Vector<double> & update) const;
-    void do_step ();
-    void output_results () const;
-    void refine_grid ();
-
-    static double energy (const DoFHandler<dim> &dof_handler,
-                          const Vector<double>  &function);
-
-    const unsigned int run_number;
-    
-    Triangulation<dim>   triangulation;
-
-    FE_Q<dim>            fe;
-    DoFHandler<dim>      dof_handler;
-
-    ConstraintMatrix     hanging_node_constraints;
-    
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> matrix;
-
-    Vector<double>       present_solution;
-    Vector<double>       residual;
+public:
+  MinimizationProblem  (const unsigned int run_number);
+  void run ();
+
+private:
+  void initialize_solution ();
+  void setup_system_on_mesh ();
+  void assemble_step ();
+  double line_search (const Vector<double> &update) const;
+  void do_step ();
+  void output_results () const;
+  void refine_grid ();
+
+  static double energy (const DoFHandler<dim> &dof_handler,
+                        const Vector<double>  &function);
+
+
+  const unsigned int run_number;
+
+  Triangulation<dim>   triangulation;
+
+  FE_Q<dim>            fe;
+  DoFHandler<dim>      dof_handler;
+
+  ConstraintMatrix     hanging_node_constraints;
+
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> matrix;
+
+  Vector<double>       present_solution;
+  Vector<double>       residual;
 };
 
 
 
 template <int dim>
 MinimizationProblem<dim>::MinimizationProblem (const unsigned int run_number)
-                :
-                run_number (run_number),
-                fe (1),
-               dof_handler (triangulation)
+  :
+  run_number (run_number),
+  fe (1),
+  dof_handler (triangulation)
 {}
 
 
 template <>
-void MinimizationProblem<1>::initialize_solution () 
+void MinimizationProblem<1>::initialize_solution ()
 {
   present_solution.reinit (dof_handler.n_dofs());
   VectorTools::interpolate (dof_handler,
@@ -168,12 +168,12 @@ void MinimizationProblem<dim>::setup_system_on_mesh ()
 {
   hanging_node_constraints.clear ();
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          hanging_node_constraints);
+                                           hanging_node_constraints);
   hanging_node_constraints.close ();
 
   sparsity_pattern.reinit (dof_handler.n_dofs(),
-                          dof_handler.n_dofs(),
-                          dof_handler.max_couplings_between_dofs());
+                           dof_handler.n_dofs(),
+                           dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
 
   hanging_node_constraints.condense (sparsity_pattern);
@@ -190,8 +190,8 @@ void MinimizationProblem<dim>::assemble_step ()
   residual.reinit (dof_handler.n_dofs());
 
   QGauss<dim>  quadrature_formula(4);
-  FEValues<dim> fe_values (fe, quadrature_formula, 
-                          update_values   | update_gradients |
+  FEValues<dim> fe_values (fe, quadrature_formula,
+                           update_values   | update_gradients |
                            update_q_points | update_JxW_values);
 
   const unsigned int dofs_per_cell = fe.dofs_per_cell;
@@ -206,8 +206,8 @@ void MinimizationProblem<dim>::assemble_step ()
   std::vector<Tensor<1,dim> > local_solution_grads (n_q_points);
 
   typename DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       cell_matrix = 0;
@@ -230,14 +230,14 @@ void MinimizationProblem<dim>::assemble_step ()
           for (unsigned int i=0; i<dofs_per_cell; ++i)
             for (unsigned int j=0; j<dofs_per_cell; ++j)
               cell_matrix(i,j)
-                += (fe_values.shape_grad(i,q_point) *
-                    fe_values.shape_grad(j,q_point) *
-                    cell->diameter() *
-                    cell->diameter()
-                    +
-                    fe_values.shape_value(i,q_point) *
-                    fe_values.shape_value(j,q_point)) *
-                fe_values.JxW(q_point);
+              += (fe_values.shape_grad(i,q_point) *
+                  fe_values.shape_grad(j,q_point) *
+                  cell->diameter() *
+                  cell->diameter()
+                  +
+                  fe_values.shape_value(i,q_point) *
+                  fe_values.shape_value(j,q_point)) *
+                 fe_values.JxW(q_point);
 
           for (unsigned int i=0; i<dofs_per_cell; ++i)
             cell_rhs(i) += -((6. * x_minus_u3 *
@@ -245,26 +245,26 @@ void MinimizationProblem<dim>::assemble_step ()
                               fe_values.shape_value(i,q_point)
                               *
                               (x_minus_u3 *
-                               (u_prime * 
+                               (u_prime *
                                 fe_values.shape_grad(i,q_point))
                                -
                                (u_prime*u_prime) * u * u *
                                fe_values.shape_value(i,q_point))
-                              )
+                             )
                              *
                              fe_values.JxW(q_point));
         }
-      
+
       cell->get_dof_indices (local_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           matrix.add (local_dof_indices[i],
-                              local_dof_indices[j],
-                              cell_matrix(i,j));
-         
-         residual(local_dof_indices[i]) += cell_rhs(i);
-       }
+        {
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            matrix.add (local_dof_indices[i],
+                        local_dof_indices[j],
+                        cell_matrix(i,j));
+
+          residual(local_dof_indices[i]) += cell_rhs(i);
+        }
     }
 
   hanging_node_constraints.condense (matrix);
@@ -272,9 +272,9 @@ void MinimizationProblem<dim>::assemble_step ()
 
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           ZeroFunction<dim>(),
-                                           boundary_values);
+                                            0,
+                                            ZeroFunction<dim>(),
+                                            boundary_values);
   if (dim == 1)
     VectorTools::interpolate_boundary_values (dof_handler,
                                               1,
@@ -282,9 +282,9 @@ void MinimizationProblem<dim>::assemble_step ()
                                               boundary_values);
   Vector<double> dummy (residual.size());
   MatrixTools::apply_boundary_values (boundary_values,
-                                     matrix,
-                                     dummy,
-                                     residual);
+                                      matrix,
+                                      dummy,
+                                      residual);
 }
 
 
@@ -302,7 +302,7 @@ MinimizationProblem<dim>::line_search (const Vector<double> &update) const
       const double f_a = energy (dof_handler, tmp);
 
       const double dalpha = (alpha != 0 ? alpha/100 : 0.01);
-      
+
       tmp = present_solution;
       tmp.add (alpha+dalpha, update);
       const double f_a_plus = energy (dof_handler, tmp);
@@ -328,7 +328,7 @@ MinimizationProblem<dim>::line_search (const Vector<double> &update) const
           tmp = present_solution;
           tmp.add (alpha+step_length, update);
           const double e = energy (dof_handler, tmp);
-          
+
           if (e >= f_a)
             step_length /= 2;
           else
@@ -345,7 +345,7 @@ MinimizationProblem<dim>::line_search (const Vector<double> &update) const
 
 template <int dim>
 void MinimizationProblem<dim>::do_step ()
-{          
+{
   assemble_step ();
 
   Vector<double> update (present_solution.size());
@@ -353,7 +353,7 @@ void MinimizationProblem<dim>::do_step ()
     SolverControl           solver_control (residual.size(),
                                             1e-2*residual.l2_norm());
     SolverCG<>              solver (solver_control);
-    
+
     PreconditionSSOR<> preconditioner;
     preconditioner.initialize(matrix);
 
@@ -392,7 +392,7 @@ template <>
 void MinimizationProblem<1>::refine_grid ()
 {
   const unsigned int dim = 1;
-  
+
   Vector<float> error_indicators (triangulation.n_active_cells());
 
   QTrapez<dim> quadrature;
@@ -409,8 +409,8 @@ void MinimizationProblem<1>::refine_grid ()
   std::vector<Tensor<2,dim> > local_2nd_derivs (quadrature.size());
 
   DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active (),
-    endc = dof_handler.end ();
+  cell = dof_handler.begin_active (),
+  endc = dof_handler.end ();
   for (unsigned int cell_index = 0; cell!=endc; ++cell, ++cell_index)
     {
       fe_values.reinit (cell);
@@ -432,7 +432,7 @@ void MinimizationProblem<1>::refine_grid ()
                 5*(x-u*u*u)*u_doubleprime
                 +
                 2*u_prime*(1-3*u*u*u_prime)));
-          
+
           cell_residual_norm += (local_residual_value * local_residual_value *
                                  fe_values.JxW(q));
         }
@@ -474,23 +474,23 @@ void MinimizationProblem<1>::refine_grid ()
           DoFHandler<dim>::cell_iterator right_neighbor = cell->neighbor(1);
           while (right_neighbor->has_children())
             right_neighbor = right_neighbor->child(0);
-          
+
           neighbor_fe_values.reinit (right_neighbor);
           neighbor_fe_values.get_function_grads (present_solution, local_gradients);
 
           const double neighbor_u_prime_right = local_gradients[0][0];
 
           const double right_jump = std::pow(x_right-std::pow(u_right,3), 2) *
-                                   (std::pow(neighbor_u_prime_right,5) -
-                                    std::pow(u_prime_right,5));
+                                    (std::pow(neighbor_u_prime_right,5) -
+                                     std::pow(u_prime_right,5));
           error_indicators(cell_index) += right_jump * right_jump *
                                           cell->diameter();
-        }      
-    } 
+        }
+    }
 
   GridRefinement::refine_and_coarsen_fixed_number (triangulation,
-                                                  error_indicators,
-                                                  0.3, 0.03);
+                                                   error_indicators,
+                                                   0.3, 0.03);
   triangulation.prepare_coarsening_and_refinement();
 
   SolutionTransfer<dim> solution_transfer(dof_handler);
@@ -505,8 +505,8 @@ void MinimizationProblem<1>::refine_grid ()
 
   hanging_node_constraints.clear ();
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          hanging_node_constraints);
-  hanging_node_constraints.close ();  
+                                           hanging_node_constraints);
+  hanging_node_constraints.close ();
   hanging_node_constraints.distribute (present_solution);
 }
 
@@ -518,8 +518,8 @@ MinimizationProblem<dim>::energy (const DoFHandler<dim> &dof_handler,
                                   const Vector<double>  &function)
 {
   QGauss<dim>  quadrature_formula(4);
-  FEValues<dim> fe_values (dof_handler.get_fe(), quadrature_formula, 
-                          update_values   | update_gradients |
+  FEValues<dim> fe_values (dof_handler.get_fe(), quadrature_formula,
+                           update_values   | update_gradients |
                            update_q_points | update_JxW_values);
 
   const unsigned int   n_q_points    = quadrature_formula.size();
@@ -530,8 +530,8 @@ MinimizationProblem<dim>::energy (const DoFHandler<dim> &dof_handler,
   double energy = 0.;
 
   typename DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       fe_values.reinit (cell);
@@ -554,7 +554,7 @@ MinimizationProblem<dim>::energy (const DoFHandler<dim> &dof_handler,
 
 
 template <int dim>
-void MinimizationProblem<dim>::run () 
+void MinimizationProblem<dim>::run ()
 {
   GridGenerator::hyper_cube (triangulation, 0., 1.);
   triangulation.refine_global (4);
@@ -562,11 +562,11 @@ void MinimizationProblem<dim>::run ()
   initialize_solution ();
 
   double last_energy = energy (dof_handler, present_solution);
-  
+
   while (true)
     {
       setup_system_on_mesh ();
-      
+
       for (unsigned int iteration=0; iteration<5; ++iteration)
         do_step ();
 
@@ -580,20 +580,20 @@ void MinimizationProblem<dim>::run ()
 
       refine_grid ();
     }
-  
+
   output_results ();
-  
+
   deallog << std::endl;
 }
 
 
-int main () 
+int main ()
 {
   try
     {
       deallog << std::setprecision(2);
       logfile << std::setprecision(2);
-      
+
       deallog.attach(logfile);
       deallog.depth_console(0);
       deallog.threshold_double(1.e-10);
@@ -602,7 +602,7 @@ int main ()
       for (unsigned int realization=0; realization<n_realizations; ++realization)
         {
           deallog << "Realization " << realization << ":" << std::endl;
-  
+
           MinimizationProblem<1> minimization_problem_1d (realization);
           minimization_problem_1d.run ();
         }
@@ -610,24 +610,24 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     }
   return 0;
index 46c212fc0ad61c4f5f5257a3e0c295cfa217eb5d..a5761f861d7abea90fc7b1242f477bac22e51a9c 100644 (file)
@@ -60,38 +60,38 @@ std::ofstream logfile("step-16/output");
 
 
 template <int dim>
-class LaplaceProblem 
+class LaplaceProblem
 {
-  public:
-    LaplaceProblem ();
-    void run ();
-    
-  private:
-    void setup_system ();
-    void assemble_system ();
-    void assemble_multigrid ();
-    void solve ();
-    void output_results (const unsigned int cycle) const;
-
-    Triangulation<dim>   triangulation;
-    FE_Q<dim>            fe;
-    MGDoFHandler<dim>      mg_dof_handler;
-
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> system_matrix;
-
-    MGLevelObject<SparsityPattern> mg_sparsity;
-    MGLevelObject<SparseMatrix<float> > mg_matrices;
-    
-    Vector<double>       solution;
-    Vector<double>       system_rhs;
+public:
+  LaplaceProblem ();
+  void run ();
+
+private:
+  void setup_system ();
+  void assemble_system ();
+  void assemble_multigrid ();
+  void solve ();
+  void output_results (const unsigned int cycle) const;
+
+  Triangulation<dim>   triangulation;
+  FE_Q<dim>            fe;
+  MGDoFHandler<dim>      mg_dof_handler;
+
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> system_matrix;
+
+  MGLevelObject<SparsityPattern> mg_sparsity;
+  MGLevelObject<SparseMatrix<float> > mg_matrices;
+
+  Vector<double>       solution;
+  Vector<double>       system_rhs;
 };
 
 
 template <int dim>
 LaplaceProblem<dim>::LaplaceProblem () :
-                fe (1),
-               mg_dof_handler (triangulation)
+  fe (1),
+  mg_dof_handler (triangulation)
 {}
 
 
@@ -102,12 +102,12 @@ void LaplaceProblem<dim>::setup_system ()
   mg_dof_handler.distribute_dofs (fe);
 
   deallog << "   Number of degrees of freedom: "
-           << mg_dof_handler.n_dofs()
-           << std::endl;
+          << mg_dof_handler.n_dofs()
+          << std::endl;
 
   sparsity_pattern.reinit (mg_dof_handler.n_dofs(),
-                          mg_dof_handler.n_dofs(),
-                          mg_dof_handler.max_couplings_between_dofs());
+                           mg_dof_handler.n_dofs(),
+                           mg_dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (static_cast<const DoFHandler<dim>&>(mg_dof_handler),
                                    sparsity_pattern);
   sparsity_pattern.compress();
@@ -121,11 +121,11 @@ void LaplaceProblem<dim>::setup_system ()
   mg_matrices.resize(0, nlevels-1);
   mg_sparsity.resize(0, nlevels-1);
 
-  for (unsigned int level=0;level<nlevels;++level)
+  for (unsigned int level=0; level<nlevels; ++level)
     {
       mg_sparsity[level].reinit (mg_dof_handler.n_dofs(level),
-                                mg_dof_handler.n_dofs(level),
-                                mg_dof_handler.max_couplings_between_dofs());
+                                 mg_dof_handler.n_dofs(level),
+                                 mg_dof_handler.max_couplings_between_dofs());
       MGTools::make_sparsity_pattern (mg_dof_handler, mg_sparsity[level], level);
       mg_sparsity[level].compress();
       mg_matrices[level].reinit(mg_sparsity[level]);
@@ -133,12 +133,12 @@ void LaplaceProblem<dim>::setup_system ()
 }
 
 template <int dim>
-void LaplaceProblem<dim>::assemble_system () 
-{  
+void LaplaceProblem<dim>::assemble_system ()
+{
   QGauss<dim>  quadrature_formula(2);
 
-  FEValues<dim> fe_values (fe, quadrature_formula, 
-                          update_values   | update_gradients |
+  FEValues<dim> fe_values (fe, quadrature_formula,
+                           update_values   | update_gradients |
                            update_q_points | update_JxW_values);
 
   const unsigned int   dofs_per_cell = fe.dofs_per_cell;
@@ -150,39 +150,39 @@ void LaplaceProblem<dim>::assemble_system ()
   std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
   typename DoFHandler<dim>::active_cell_iterator cell = mg_dof_handler.begin_active(),
-                                                endc = mg_dof_handler.end();
+                                                 endc = mg_dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       cell_matrix = 0;
       cell_rhs = 0;
 
       fe_values.reinit (cell);
-      
+
       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         {
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += ((fe_values.shape_grad(i,q_point)
-                                   * fe_values.shape_grad(j,q_point))
-                                   + fe_values.shape_value(i,q_point)
-                                   * fe_values.shape_value(j,q_point))
-                                  * fe_values.JxW(q_point);
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += ((fe_values.shape_grad(i,q_point)
+                                    * fe_values.shape_grad(j,q_point))
+                                   + fe_values.shape_value(i,q_point)
+                                   * fe_values.shape_value(j,q_point))
+                                  * fe_values.JxW(q_point);
 
-           cell_rhs(i) += (fe_values.shape_value(i,q_point)
-                           * 1.0 * fe_values.JxW(q_point));
-         };
+            cell_rhs(i) += (fe_values.shape_value(i,q_point)
+                            * 1.0 * fe_values.JxW(q_point));
+          };
 
 
       cell->get_dof_indices (local_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           system_matrix.add (local_dof_indices[i],
-                              local_dof_indices[j],
-                              cell_matrix(i,j));
-         
-         system_rhs(local_dof_indices[i]) += cell_rhs(i);
-       };
+        {
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            system_matrix.add (local_dof_indices[i],
+                               local_dof_indices[j],
+                               cell_matrix(i,j));
+
+          system_rhs(local_dof_indices[i]) += cell_rhs(i);
+        };
     };
 
 }
@@ -190,12 +190,12 @@ void LaplaceProblem<dim>::assemble_system ()
 
 
 template <int dim>
-void LaplaceProblem<dim>::assemble_multigrid () 
-{  
+void LaplaceProblem<dim>::assemble_multigrid ()
+{
   QGauss<dim>  quadrature_formula(2);
 
-  FEValues<dim> fe_values (fe, quadrature_formula, 
-                          update_values   | update_gradients |
+  FEValues<dim> fe_values (fe, quadrature_formula,
+                           update_values   | update_gradients |
                            update_q_points | update_JxW_values);
 
   const unsigned int   dofs_per_cell = fe.dofs_per_cell;
@@ -206,7 +206,7 @@ void LaplaceProblem<dim>::assemble_multigrid ()
   std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
   typename MGDoFHandler<dim>::cell_iterator cell = mg_dof_handler.begin(),
-                                           endc = mg_dof_handler.end();
+                                            endc = mg_dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       const unsigned int level = cell->level();
@@ -215,25 +215,25 @@ void LaplaceProblem<dim>::assemble_multigrid ()
       fe_values.reinit (cell);
 
       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         {
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += ((fe_values.shape_grad(i,q_point)
-                                   * fe_values.shape_grad(j,q_point))
-                                  + fe_values.shape_value(i,q_point)
-                                  * fe_values.shape_value(j,q_point))
-                                 * fe_values.JxW(q_point);
-         };
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += ((fe_values.shape_grad(i,q_point)
+                                    * fe_values.shape_grad(j,q_point))
+                                   + fe_values.shape_value(i,q_point)
+                                   * fe_values.shape_value(j,q_point))
+                                  * fe_values.JxW(q_point);
+          };
 
 
       cell->get_mg_dof_indices (local_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           mg_matrices[level].add (local_dof_indices[i],
+        {
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            mg_matrices[level].add (local_dof_indices[i],
                                     local_dof_indices[j],
                                     cell_matrix(i,j));
-       };
+        };
     };
 
 }
@@ -241,7 +241,7 @@ void LaplaceProblem<dim>::assemble_multigrid ()
 
 
 template <int dim>
-void LaplaceProblem<dim>::solve () 
+void LaplaceProblem<dim>::solve ()
 {
   GrowingVectorMemory<>   vector_memory;
 
@@ -255,36 +255,36 @@ void LaplaceProblem<dim>::solve ()
 
   typedef PreconditionSOR<SparseMatrix<float> > RELAXATION;
   MGSmootherRelaxation<SparseMatrix<float>, RELAXATION, Vector<double> >
-    mg_smoother(vector_memory);
+  mg_smoother(vector_memory);
 
   RELAXATION::AdditionalData smoother_data;
   mg_smoother.initialize(mg_matrices, smoother_data);
-  
+
   mg_smoother.set_steps(2);
   mg_smoother.set_symmetric(true);
 
   MGMatrix<SparseMatrix<float>, Vector<double> >
-    mg_matrix(&mg_matrices);
+  mg_matrix(&mg_matrices);
   Multigrid<Vector<double> > mg(mg_dof_handler,
-                               mg_matrix,
-                               mg_coarse,
-                               mg_transfer,
-                               mg_smoother,
-                               mg_smoother);
+                                mg_matrix,
+                                mg_coarse,
+                                mg_transfer,
+                                mg_smoother,
+                                mg_smoother);
   PreconditionMG<dim, Vector<double>,
-    MGTransferPrebuilt<Vector<double> > >
-    preconditioner(mg_dof_handler, mg, mg_transfer);
-  
+                 MGTransferPrebuilt<Vector<double> > >
+                 preconditioner(mg_dof_handler, mg, mg_transfer);
+
   SolverControl           solver_control (1000, 1e-12);
   SolverCG<>              cg (solver_control);
 
-  
+
   cg.solve (system_matrix, solution, system_rhs,
-           preconditioner);
+            preconditioner);
 
   deallog << "   " << solver_control.last_step()
-           << " CG iterations needed to obtain convergence."
-           << std::endl;
+          << " CG iterations needed to obtain convergence."
+          << std::endl;
 }
 
 
@@ -300,8 +300,8 @@ void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
 
   std::ostringstream filename;
   filename << "solution-"
-          << cycle
-          << ".gnuplot";
+           << cycle
+           << ".gnuplot";
 
   data_out.write_gnuplot (deallog.get_file_stream());
 }
@@ -309,26 +309,26 @@ void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
 
 
 template <int dim>
-void LaplaceProblem<dim>::run () 
+void LaplaceProblem<dim>::run ()
 {
   for (unsigned int cycle=0; cycle<6; ++cycle)
     {
       deallog << "Cycle " << cycle << ':' << std::endl;
 
       if (cycle == 0)
-       {
-         GridGenerator::hyper_cube(triangulation);
-         
-       }
+        {
+          GridGenerator::hyper_cube(triangulation);
+
+        }
       else
-       triangulation.refine_global (1);
+        triangulation.refine_global (1);
 
       deallog << "   Number of active cells: "
-               << triangulation.n_active_cells()
-               << std::endl
-               << "   Total number of cells: "
-               << triangulation.n_cells()
-               << std::endl;
+              << triangulation.n_active_cells()
+              << std::endl
+              << "   Total number of cells: "
+              << triangulation.n_cells()
+              << std::endl;
 
       setup_system ();
       assemble_system ();
@@ -338,20 +338,20 @@ void LaplaceProblem<dim>::run ()
     };
 }
 
-    
 
-int main () 
+
+int main ()
 {
   deallog.depth_console (0);
   deallog << std::setprecision(2);
   logfile << std::setprecision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   LaplaceProblem<2> laplace_problem_2d;
   laplace_problem_2d.run ();
-  
+
   return 0;
 }
index 2ffb1b69cf7a4434de0e3a338d94e0e226517199..1e56c9edae76842dbaf19c600ebdc27ffc1a2f72 100644 (file)
@@ -62,38 +62,38 @@ std::ofstream logfile("step-16b/output");
 
 
 template <int dim>
-class LaplaceProblem 
+class LaplaceProblem
 {
-  public:
-    LaplaceProblem ();
-    void run ();
-    
-  private:
-    void setup_system ();
-    void assemble_system ();
-    void assemble_multigrid ();
-    void solve ();
-    void output_results (const unsigned int cycle) const;
-
-    Triangulation<dim>   triangulation;
-    FE_Q<dim>            fe;
-    DoFHandler<dim>      mg_dof_handler;
-
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> system_matrix;
-
-    MGLevelObject<SparsityPattern> mg_sparsity;
-    MGLevelObject<SparseMatrix<float> > mg_matrices;
-    
-    Vector<double>       solution;
-    Vector<double>       system_rhs;
+public:
+  LaplaceProblem ();
+  void run ();
+
+private:
+  void setup_system ();
+  void assemble_system ();
+  void assemble_multigrid ();
+  void solve ();
+  void output_results (const unsigned int cycle) const;
+
+  Triangulation<dim>   triangulation;
+  FE_Q<dim>            fe;
+  DoFHandler<dim>      mg_dof_handler;
+
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> system_matrix;
+
+  MGLevelObject<SparsityPattern> mg_sparsity;
+  MGLevelObject<SparseMatrix<float> > mg_matrices;
+
+  Vector<double>       solution;
+  Vector<double>       system_rhs;
 };
 
 
 template <int dim>
 LaplaceProblem<dim>::LaplaceProblem () :
-                fe (1),
-               mg_dof_handler (triangulation)
+  fe (1),
+  mg_dof_handler (triangulation)
 {}
 
 
@@ -105,12 +105,12 @@ void LaplaceProblem<dim>::setup_system ()
   mg_dof_handler.distribute_mg_dofs (fe);
 
   deallog << "   Number of degrees of freedom: "
-           << mg_dof_handler.n_dofs()
-           << std::endl;
+          << mg_dof_handler.n_dofs()
+          << std::endl;
 
   sparsity_pattern.reinit (mg_dof_handler.n_dofs(),
-                          mg_dof_handler.n_dofs(),
-                          mg_dof_handler.max_couplings_between_dofs());
+                           mg_dof_handler.n_dofs(),
+                           mg_dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (static_cast<const DoFHandler<dim>&>(mg_dof_handler),
                                    sparsity_pattern);
   sparsity_pattern.compress();
@@ -124,11 +124,11 @@ void LaplaceProblem<dim>::setup_system ()
   mg_matrices.resize(0, nlevels-1);
   mg_sparsity.resize(0, nlevels-1);
 
-  for (unsigned int level=0;level<nlevels;++level)
+  for (unsigned int level=0; level<nlevels; ++level)
     {
       mg_sparsity[level].reinit (mg_dof_handler.n_dofs(level),
-                                mg_dof_handler.n_dofs(level),
-                                mg_dof_handler.max_couplings_between_dofs());
+                                 mg_dof_handler.n_dofs(level),
+                                 mg_dof_handler.max_couplings_between_dofs());
       MGTools::make_sparsity_pattern (mg_dof_handler, mg_sparsity[level], level);
       mg_sparsity[level].compress();
       mg_matrices[level].reinit(mg_sparsity[level]);
@@ -136,12 +136,12 @@ void LaplaceProblem<dim>::setup_system ()
 }
 
 template <int dim>
-void LaplaceProblem<dim>::assemble_system () 
-{  
+void LaplaceProblem<dim>::assemble_system ()
+{
   QGauss<dim>  quadrature_formula(2);
 
-  FEValues<dim> fe_values (fe, quadrature_formula, 
-                          update_values   | update_gradients |
+  FEValues<dim> fe_values (fe, quadrature_formula,
+                           update_values   | update_gradients |
                            update_q_points | update_JxW_values);
 
   const unsigned int   dofs_per_cell = fe.dofs_per_cell;
@@ -153,39 +153,39 @@ void LaplaceProblem<dim>::assemble_system ()
   std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
   typename DoFHandler<dim>::active_cell_iterator cell = mg_dof_handler.begin_active(),
-                                                endc = mg_dof_handler.end();
+                                                 endc = mg_dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       cell_matrix = 0;
       cell_rhs = 0;
 
       fe_values.reinit (cell);
-      
+
       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         {
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += ((fe_values.shape_grad(i,q_point)
-                                   * fe_values.shape_grad(j,q_point))
-                                   + fe_values.shape_value(i,q_point)
-                                   * fe_values.shape_value(j,q_point))
-                                  * fe_values.JxW(q_point);
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += ((fe_values.shape_grad(i,q_point)
+                                    * fe_values.shape_grad(j,q_point))
+                                   + fe_values.shape_value(i,q_point)
+                                   * fe_values.shape_value(j,q_point))
+                                  * fe_values.JxW(q_point);
 
-           cell_rhs(i) += (fe_values.shape_value(i,q_point)
-                           * 1.0 * fe_values.JxW(q_point));
-         };
+            cell_rhs(i) += (fe_values.shape_value(i,q_point)
+                            * 1.0 * fe_values.JxW(q_point));
+          };
 
 
       cell->get_dof_indices (local_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           system_matrix.add (local_dof_indices[i],
-                              local_dof_indices[j],
-                              cell_matrix(i,j));
-         
-         system_rhs(local_dof_indices[i]) += cell_rhs(i);
-       };
+        {
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            system_matrix.add (local_dof_indices[i],
+                               local_dof_indices[j],
+                               cell_matrix(i,j));
+
+          system_rhs(local_dof_indices[i]) += cell_rhs(i);
+        };
     };
 
 }
@@ -193,12 +193,12 @@ void LaplaceProblem<dim>::assemble_system ()
 
 
 template <int dim>
-void LaplaceProblem<dim>::assemble_multigrid () 
-{  
+void LaplaceProblem<dim>::assemble_multigrid ()
+{
   QGauss<dim>  quadrature_formula(2);
 
-  FEValues<dim> fe_values (fe, quadrature_formula, 
-                          update_values   | update_gradients |
+  FEValues<dim> fe_values (fe, quadrature_formula,
+                           update_values   | update_gradients |
                            update_q_points | update_JxW_values);
 
   const unsigned int   dofs_per_cell = fe.dofs_per_cell;
@@ -209,7 +209,7 @@ void LaplaceProblem<dim>::assemble_multigrid ()
   std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
   typename MGDoFHandler<dim>::cell_iterator cell = mg_dof_handler.begin(),
-                                           endc = mg_dof_handler.end();
+                                            endc = mg_dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       const unsigned int level = cell->level();
@@ -218,25 +218,25 @@ void LaplaceProblem<dim>::assemble_multigrid ()
       fe_values.reinit (cell);
 
       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         {
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += ((fe_values.shape_grad(i,q_point)
-                                   * fe_values.shape_grad(j,q_point))
-                                  + fe_values.shape_value(i,q_point)
-                                  * fe_values.shape_value(j,q_point))
-                                 * fe_values.JxW(q_point);
-         };
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += ((fe_values.shape_grad(i,q_point)
+                                    * fe_values.shape_grad(j,q_point))
+                                   + fe_values.shape_value(i,q_point)
+                                   * fe_values.shape_value(j,q_point))
+                                  * fe_values.JxW(q_point);
+          };
 
 
       cell->get_mg_dof_indices (local_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           mg_matrices[level].add (local_dof_indices[i],
+        {
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            mg_matrices[level].add (local_dof_indices[i],
                                     local_dof_indices[j],
                                     cell_matrix(i,j));
-       };
+        };
     };
 
 }
@@ -244,7 +244,7 @@ void LaplaceProblem<dim>::assemble_multigrid ()
 
 
 template <int dim>
-void LaplaceProblem<dim>::solve () 
+void LaplaceProblem<dim>::solve ()
 {
   GrowingVectorMemory<>   vector_memory;
 
@@ -258,36 +258,36 @@ void LaplaceProblem<dim>::solve ()
 
   typedef PreconditionSOR<SparseMatrix<float> > RELAXATION;
   MGSmootherRelaxation<SparseMatrix<float>, RELAXATION, Vector<double> >
-    mg_smoother(vector_memory);
+  mg_smoother(vector_memory);
 
   RELAXATION::AdditionalData smoother_data;
   mg_smoother.initialize(mg_matrices, smoother_data);
-  
+
   mg_smoother.set_steps(2);
   mg_smoother.set_symmetric(true);
 
   MGMatrix<SparseMatrix<float>, Vector<double> >
-    mg_matrix(&mg_matrices);
+  mg_matrix(&mg_matrices);
   Multigrid<Vector<double> > mg(mg_dof_handler,
-                               mg_matrix,
-                               mg_coarse,
-                               mg_transfer,
-                               mg_smoother,
-                               mg_smoother);
+                                mg_matrix,
+                                mg_coarse,
+                                mg_transfer,
+                                mg_smoother,
+                                mg_smoother);
   PreconditionMG<dim, Vector<double>,
-    MGTransferPrebuilt<Vector<double> > >
-    preconditioner(mg_dof_handler, mg, mg_transfer);
-  
+                 MGTransferPrebuilt<Vector<double> > >
+                 preconditioner(mg_dof_handler, mg, mg_transfer);
+
   SolverControl           solver_control (1000, 1e-12);
   SolverCG<>              cg (solver_control);
 
-  
+
   cg.solve (system_matrix, solution, system_rhs,
-           preconditioner);
+            preconditioner);
 
   deallog << "   " << solver_control.last_step()
-           << " CG iterations needed to obtain convergence."
-           << std::endl;
+          << " CG iterations needed to obtain convergence."
+          << std::endl;
 }
 
 
@@ -303,8 +303,8 @@ void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
 
   std::ostringstream filename;
   filename << "solution-"
-          << cycle
-          << ".gnuplot";
+           << cycle
+           << ".gnuplot";
 
   data_out.write_gnuplot (deallog.get_file_stream());
 }
@@ -312,26 +312,26 @@ void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
 
 
 template <int dim>
-void LaplaceProblem<dim>::run () 
+void LaplaceProblem<dim>::run ()
 {
   for (unsigned int cycle=0; cycle<6; ++cycle)
     {
       deallog << "Cycle " << cycle << ':' << std::endl;
 
       if (cycle == 0)
-       {
-         GridGenerator::hyper_cube(triangulation);
-         
-       }
+        {
+          GridGenerator::hyper_cube(triangulation);
+
+        }
       else
-       triangulation.refine_global (1);
+        triangulation.refine_global (1);
 
       deallog << "   Number of active cells: "
-               << triangulation.n_active_cells()
-               << std::endl
-               << "   Total number of cells: "
-               << triangulation.n_cells()
-               << std::endl;
+              << triangulation.n_active_cells()
+              << std::endl
+              << "   Total number of cells: "
+              << triangulation.n_cells()
+              << std::endl;
 
       setup_system ();
       assemble_system ();
@@ -341,20 +341,20 @@ void LaplaceProblem<dim>::run ()
     };
 }
 
-    
 
-int main () 
+
+int main ()
 {
   deallog.depth_console (0);
   deallog << std::setprecision(2);
   logfile << std::setprecision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   LaplaceProblem<2> laplace_problem_2d;
   laplace_problem_2d.run ();
-  
+
   return 0;
 }
index f456c9d7b5b2351b4b58ce9156d638d644ec1080..1d8541bdd23e99d60fbdad876d49fbfce37a239e 100644 (file)
@@ -43,47 +43,47 @@ void make_grid (Triangulation<2> &triangulation)
 {
   const Point<2> center (1,0);
   const double inner_radius = 0.5,
-              outer_radius = 1.0;
+               outer_radius = 1.0;
   GridGenerator::hyper_shell (triangulation,
-                             center, inner_radius, outer_radius,
+                              center, inner_radius, outer_radius,
                               10);
 
   static const HyperShellBoundary<2> boundary_description(center);
   triangulation.set_boundary (0, boundary_description);
-  
+
   for (unsigned int step=0; step<5; ++step)
     {
       Triangulation<2>::active_cell_iterator
-       cell = triangulation.begin_active(),
-       endc = triangulation.end();
+      cell = triangulation.begin_active(),
+      endc = triangulation.end();
 
       for (; cell!=endc; ++cell)
-       for (unsigned int vertex=0;
-            vertex < GeometryInfo<2>::vertices_per_cell;
-            ++vertex)
-         {
+        for (unsigned int vertex=0;
+             vertex < GeometryInfo<2>::vertices_per_cell;
+             ++vertex)
+          {
             const double distance_from_center
               = center.distance (cell->vertex(vertex));
-           
-           if (std::fabs(distance_from_center - inner_radius) < 1e-10)
-             {
-               cell->set_refine_flag ();
-               break;
-             }
-         }
+
+            if (std::fabs(distance_from_center - inner_radius) < 1e-10)
+              {
+                cell->set_refine_flag ();
+                break;
+              }
+          }
 
       triangulation.execute_coarsening_and_refinement ();
     }
 }
 
 
-void distribute_dofs (DoFHandler<2> &dof_handler) 
+void distribute_dofs (DoFHandler<2> &dof_handler)
 {
   static const FE_Q<2> finite_element(1);
   dof_handler.distribute_dofs (finite_element);
 
   SparsityPattern sparsity_pattern (dof_handler.n_dofs(),
-                                   dof_handler.n_dofs(),
+                                    dof_handler.n_dofs(),
                                     20);
 
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
@@ -94,11 +94,11 @@ void distribute_dofs (DoFHandler<2> &dof_handler)
 
 
 
-void renumber_dofs (DoFHandler<2> &dof_handler) 
+void renumber_dofs (DoFHandler<2> &dof_handler)
 {
   DoFRenumbering::Cuthill_McKee (dof_handler);
   SparsityPattern sparsity_pattern (dof_handler.n_dofs(),
-                                   dof_handler.n_dofs());
+                                    dof_handler.n_dofs());
 
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
   sparsity_pattern.compress ();
@@ -110,13 +110,13 @@ void renumber_dofs (DoFHandler<2> &dof_handler)
 
 
 
-int main () 
+int main ()
 {
   deallog << std::setprecision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   Triangulation<2> triangulation;
   make_grid (triangulation);
index bc3533cf89336e3561c408f9000ab53e671d50bf..4b87d0209c5807a1e952b7390aec75c725a32892 100644 (file)
@@ -55,34 +55,34 @@ std::ofstream logfile("step-3/output");
 
 
 
-class LaplaceProblem 
+class LaplaceProblem
 {
-  public:
-    LaplaceProblem ();
-
-    void run ();
-    
-  private:
-    void make_grid_and_dofs ();
-    void assemble_system ();
-    void solve ();
-    void output_results () const;
-
-    Triangulation<2>     triangulation;
-    FE_Q<2>              fe;
-    DoFHandler<2>        dof_handler;
-
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> system_matrix;
-
-    Vector<double>       solution;
-    Vector<double>       system_rhs;
+public:
+  LaplaceProblem ();
+
+  void run ();
+
+private:
+  void make_grid_and_dofs ();
+  void assemble_system ();
+  void solve ();
+  void output_results () const;
+
+  Triangulation<2>     triangulation;
+  FE_Q<2>              fe;
+  DoFHandler<2>        dof_handler;
+
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> system_matrix;
+
+  Vector<double>       solution;
+  Vector<double>       system_rhs;
 };
 
 
 LaplaceProblem::LaplaceProblem () :
-                fe (1),
-               dof_handler (triangulation)
+  fe (1),
+  dof_handler (triangulation)
 {}
 
 
@@ -92,20 +92,20 @@ void LaplaceProblem::make_grid_and_dofs ()
   GridGenerator::hyper_cube (triangulation, -1, 1);
   triangulation.refine_global (5);
   deallog << "Number of active cells: "
-           << triangulation.n_active_cells()
-           << std::endl;
+          << triangulation.n_active_cells()
+          << std::endl;
   deallog << "Total number of cells: "
-           << triangulation.n_cells()
-           << std::endl;
-  
+          << triangulation.n_cells()
+          << std::endl;
+
   dof_handler.distribute_dofs (fe);
   deallog << "Number of degrees of freedom: "
-           << dof_handler.n_dofs()
-           << std::endl;
+          << dof_handler.n_dofs()
+          << std::endl;
 
   sparsity_pattern.reinit (dof_handler.n_dofs(),
-                          dof_handler.n_dofs(),
-                          dof_handler.max_couplings_between_dofs());
+                           dof_handler.n_dofs(),
+                           dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
   sparsity_pattern.compress();
 
@@ -117,12 +117,12 @@ void LaplaceProblem::make_grid_and_dofs ()
 
 
 
-void LaplaceProblem::assemble_system () 
+void LaplaceProblem::assemble_system ()
 {
   QGauss<2>  quadrature_formula(2);
-  FEValues<2> x_fe_values (fe, quadrature_formula, 
-                        update_values | update_gradients | update_JxW_values);
-  
+  FEValues<2> x_fe_values (fe, quadrature_formula,
+                           update_values | update_gradients | update_JxW_values);
+
   const unsigned int   dofs_per_cell = fe.dofs_per_cell;
   const unsigned int   n_q_points    = quadrature_formula.size();
 
@@ -132,63 +132,63 @@ void LaplaceProblem::assemble_system ()
   std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
   DoFHandler<2>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       x_fe_values.reinit (cell);
 
       const FEValues<2> &fe_values = x_fe_values.get_present_fe_values();
-      
+
       cell_matrix = 0;
       cell_rhs = 0;
 
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int j=0; j<dofs_per_cell; ++j)
-         for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-           cell_matrix(i,j) += (fe_values.shape_grad (i, q_point) *
-                                fe_values.shape_grad (j, q_point) *
-                                fe_values.JxW (q_point));
+        for (unsigned int j=0; j<dofs_per_cell; ++j)
+          for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+            cell_matrix(i,j) += (fe_values.shape_grad (i, q_point) *
+                                 fe_values.shape_grad (j, q_point) *
+                                 fe_values.JxW (q_point));
 
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-         cell_rhs(i) += (fe_values.shape_value (i, q_point) *
-                         1 *
-                         fe_values.JxW (q_point));
+        for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+          cell_rhs(i) += (fe_values.shape_value (i, q_point) *
+                          1 *
+                          fe_values.JxW (q_point));
 
       cell->get_dof_indices (local_dof_indices);
 
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int j=0; j<dofs_per_cell; ++j)
-         system_matrix.add (local_dof_indices[i],
-                            local_dof_indices[j],
-                            cell_matrix(i,j));
+        for (unsigned int j=0; j<dofs_per_cell; ++j)
+          system_matrix.add (local_dof_indices[i],
+                             local_dof_indices[j],
+                             cell_matrix(i,j));
 
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       system_rhs(local_dof_indices[i]) += cell_rhs(i);
+        system_rhs(local_dof_indices[i]) += cell_rhs(i);
     }
 
 
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           ZeroFunction<2>(),
-                                           boundary_values);
+                                            0,
+                                            ZeroFunction<2>(),
+                                            boundary_values);
   MatrixTools::apply_boundary_values (boundary_values,
-                                     system_matrix,
-                                     solution,
-                                     system_rhs);
+                                      system_matrix,
+                                      solution,
+                                      system_rhs);
 }
 
 
 
-void LaplaceProblem::solve () 
+void LaplaceProblem::solve ()
 {
   SolverControl           solver_control (1000, 1e-12);
   SolverCG<>              cg (solver_control);
 
   cg.solve (system_matrix, solution, system_rhs,
-           PreconditionIdentity());
+            PreconditionIdentity());
 }
 
 
@@ -205,7 +205,7 @@ void LaplaceProblem::output_results () const
 
 
 
-void LaplaceProblem::run () 
+void LaplaceProblem::run ()
 {
   make_grid_and_dofs ();
   assemble_system ();
@@ -215,14 +215,14 @@ void LaplaceProblem::run ()
 
 
 
-int main () 
+int main ()
 {
   deallog << std::setprecision(2);
   logfile << std::setprecision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   LaplaceProblem laplace_problem;
   laplace_problem.run ();
index eb867d58ee7694a22712417989001d613fddc1b4..2afb325c576ae969308cf9847ea3f5264343ead3 100644 (file)
@@ -54,51 +54,51 @@ std::ofstream logfile("step-4/output");
 
 
 template <int dim>
-class LaplaceProblem 
+class LaplaceProblem
 {
-  public:
-    LaplaceProblem ();
-    void run ();
-    
-  private:
-    void make_grid_and_dofs ();
-    void assemble_system ();
-    void solve ();
-    void output_results () const;
-
-    Triangulation<dim>   triangulation;
-    FE_Q<dim>            fe;
-    DoFHandler<dim>      dof_handler;
-
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> system_matrix;
-
-    Vector<double>       solution;
-    Vector<double>       system_rhs;
+public:
+  LaplaceProblem ();
+  void run ();
+
+private:
+  void make_grid_and_dofs ();
+  void assemble_system ();
+  void solve ();
+  void output_results () const;
+
+  Triangulation<dim>   triangulation;
+  FE_Q<dim>            fe;
+  DoFHandler<dim>      dof_handler;
+
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> system_matrix;
+
+  Vector<double>       solution;
+  Vector<double>       system_rhs;
 };
 
 
 
 template <int dim>
-class RightHandSide : public Function<dim> 
+class RightHandSide : public Function<dim>
 {
-  public:
-    RightHandSide () : Function<dim>() {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
+public:
+  RightHandSide () : Function<dim>() {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
 };
 
 
 
 template <int dim>
-class BoundaryValues : public Function<dim> 
+class BoundaryValues : public Function<dim>
 {
-  public:
-    BoundaryValues () : Function<dim>() {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
+public:
+  BoundaryValues () : Function<dim>() {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
 };
 
 
@@ -106,7 +106,7 @@ class BoundaryValues : public Function<dim>
 
 template <int dim>
 double RightHandSide<dim>::value (const Point<dim> &p,
-                                 const unsigned int /*component*/) const 
+                                  const unsigned int /*component*/) const
 {
   double return_value = 0;
   for (unsigned int i=0; i<dim; ++i)
@@ -118,7 +118,7 @@ double RightHandSide<dim>::value (const Point<dim> &p,
 
 template <int dim>
 double BoundaryValues<dim>::value (const Point<dim> &p,
-                                  const unsigned int /*component*/) const 
+                                   const unsigned int /*component*/) const
 {
   return p.square();
 }
@@ -131,8 +131,8 @@ double BoundaryValues<dim>::value (const Point<dim> &p,
 
 template <int dim>
 LaplaceProblem<dim>::LaplaceProblem () :
-                fe (1),
-               dof_handler (triangulation)
+  fe (1),
+  dof_handler (triangulation)
 {}
 
 
@@ -142,23 +142,23 @@ void LaplaceProblem<dim>::make_grid_and_dofs ()
 {
   GridGenerator::hyper_cube (triangulation, -1, 1);
   triangulation.refine_global (2);
-  
+
   deallog << "   Number of active cells: "
-           << triangulation.n_active_cells()
-           << std::endl
-           << "   Total number of cells: "
-           << triangulation.n_cells()
-           << std::endl;
+          << triangulation.n_active_cells()
+          << std::endl
+          << "   Total number of cells: "
+          << triangulation.n_cells()
+          << std::endl;
 
   dof_handler.distribute_dofs (fe);
 
   deallog << "   Number of degrees of freedom: "
-           << dof_handler.n_dofs()
-           << std::endl;
+          << dof_handler.n_dofs()
+          << std::endl;
 
   sparsity_pattern.reinit (dof_handler.n_dofs(),
-                          dof_handler.n_dofs(),
-                          dof_handler.max_couplings_between_dofs());
+                           dof_handler.n_dofs(),
+                           dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
   sparsity_pattern.compress();
 
@@ -171,15 +171,15 @@ void LaplaceProblem<dim>::make_grid_and_dofs ()
 
 
 template <int dim>
-void LaplaceProblem<dim>::assemble_system () 
-{  
+void LaplaceProblem<dim>::assemble_system ()
+{
   QGauss<dim>  quadrature_formula (2);
 
   const RightHandSide<dim> right_hand_side;
 
-  FEValues<dim> x_fe_values (fe, quadrature_formula, 
-                          update_values   | update_gradients |
-                           update_q_points | update_JxW_values);
+  FEValues<dim> x_fe_values (fe, quadrature_formula,
+                             update_values   | update_gradients |
+                             update_q_points | update_JxW_values);
 
   const unsigned int   dofs_per_cell = fe.dofs_per_cell;
   const unsigned int   n_q_points    = quadrature_formula.size();
@@ -190,66 +190,66 @@ void LaplaceProblem<dim>::assemble_system ()
   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();
+                                                 endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       x_fe_values.reinit (cell);
 
       const FEValues<dim> &fe_values = x_fe_values.get_present_fe_values();
-      
+
       cell_matrix = 0;
       cell_rhs = 0;
 
       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         {
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += (fe_values.shape_grad (i, q_point) *
-                                  fe_values.shape_grad (j, q_point) *
-                                  fe_values.JxW (q_point));
-
-           cell_rhs(i) += (fe_values.shape_value (i, q_point) *
-                           right_hand_side.value (fe_values.quadrature_point (q_point)) *
-                           fe_values.JxW (q_point));
-         }
-      
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += (fe_values.shape_grad (i, q_point) *
+                                   fe_values.shape_grad (j, q_point) *
+                                   fe_values.JxW (q_point));
+
+            cell_rhs(i) += (fe_values.shape_value (i, q_point) *
+                            right_hand_side.value (fe_values.quadrature_point (q_point)) *
+                            fe_values.JxW (q_point));
+          }
+
       cell->get_dof_indices (local_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           system_matrix.add (local_dof_indices[i],
-                              local_dof_indices[j],
-                              cell_matrix(i,j));
-         
-         system_rhs(local_dof_indices[i]) += cell_rhs(i);
-       }
+        {
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            system_matrix.add (local_dof_indices[i],
+                               local_dof_indices[j],
+                               cell_matrix(i,j));
+
+          system_rhs(local_dof_indices[i]) += cell_rhs(i);
+        }
     }
 
-  
+
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           BoundaryValues<dim>(),
-                                           boundary_values);
+                                            0,
+                                            BoundaryValues<dim>(),
+                                            boundary_values);
   MatrixTools::apply_boundary_values (boundary_values,
-                                     system_matrix,
-                                     solution,
-                                     system_rhs);
+                                      system_matrix,
+                                      solution,
+                                      system_rhs);
 }
 
 
 
 template <int dim>
-void LaplaceProblem<dim>::solve () 
+void LaplaceProblem<dim>::solve ()
 {
   SolverControl           solver_control (1000, 1e-12);
   SolverCG<>              cg (solver_control);
   cg.solve (system_matrix, solution, system_rhs,
-           PreconditionIdentity());
+            PreconditionIdentity());
 
   deallog << "   " << solver_control.last_step()
-           << " CG iterations needed to obtain convergence."
-           << std::endl;
+          << " CG iterations needed to obtain convergence."
+          << std::endl;
 }
 
 
@@ -271,10 +271,10 @@ void LaplaceProblem<dim>::output_results () const
 
 
 template <int dim>
-void LaplaceProblem<dim>::run () 
+void LaplaceProblem<dim>::run ()
 {
   deallog << "Solving problem in " << dim << " space dimensions." << std::endl;
-  
+
   make_grid_and_dofs();
   assemble_system ();
   solve ();
@@ -283,25 +283,25 @@ void LaplaceProblem<dim>::run ()
 
 
 
-int main () 
+int main ()
 {
   deallog << std::setprecision(2);
   logfile << std::setprecision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   deallog.depth_console (0);
   {
     LaplaceProblem<2> laplace_problem_2d;
     laplace_problem_2d.run ();
   }
-  
+
   {
     LaplaceProblem<3> laplace_problem_3d;
     laplace_problem_3d.run ();
   }
-  
+
   return 0;
 }
index 28c5c0f7f89f1231c1872c27ec69ae294b19f09a..0602fcdde5eadc7f2374b9d5edd3edcd40f01d0a 100644 (file)
@@ -56,50 +56,50 @@ std::ofstream logfile("step-5/output");
 
 
 template <int dim>
-class LaplaceProblem 
+class LaplaceProblem
 {
-  public:
-    LaplaceProblem ();
-    void run ();
-    
-  private:
-    void setup_system ();
-    void assemble_system ();
-    void solve ();
-    void output_results (const unsigned int cycle) const;
-
-    Triangulation<dim>   triangulation;
-    FE_Q<dim>            fe;
-    DoFHandler<dim>      dof_handler;
-
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> system_matrix;
-
-    Vector<double>       solution;
-    Vector<double>       system_rhs;
+public:
+  LaplaceProblem ();
+  void run ();
+
+private:
+  void setup_system ();
+  void assemble_system ();
+  void solve ();
+  void output_results (const unsigned int cycle) const;
+
+  Triangulation<dim>   triangulation;
+  FE_Q<dim>            fe;
+  DoFHandler<dim>      dof_handler;
+
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> system_matrix;
+
+  Vector<double>       solution;
+  Vector<double>       system_rhs;
 };
 
 
 
 template <int dim>
-class Coefficient : public Function<dim> 
+class Coefficient : public Function<dim>
 {
-  public:
-    Coefficient ()  : Function<dim>() {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
-    
-    virtual void value_list (const std::vector<Point<dim> > &points,
-                            std::vector<double>            &values,
-                            const unsigned int              component = 0) const;
+public:
+  Coefficient ()  : Function<dim>() {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
+
+  virtual void value_list (const std::vector<Point<dim> > &points,
+                           std::vector<double>            &values,
+                           const unsigned int              component = 0) const;
 };
 
 
 
 template <int dim>
 double Coefficient<dim>::value (const Point<dim> &p,
-                               const unsigned int /*component*/) const 
+                                const unsigned int /*component*/) const
 {
   if (p.square() < 0.5*0.5)
     return 20;
@@ -112,23 +112,23 @@ double Coefficient<dim>::value (const Point<dim> &p,
 
 template <int dim>
 void Coefficient<dim>::value_list (const std::vector<Point<dim> > &points,
-                                  std::vector<double>            &values,
-                                  const unsigned int              component) const 
+                                   std::vector<double>            &values,
+                                   const unsigned int              component) const
 {
-  Assert (values.size() == points.size(), 
-         ExcDimensionMismatch (values.size(), points.size()));
-  
-  Assert (component == 0, 
-         ExcIndexRange (component, 0, 1));
+  Assert (values.size() == points.size(),
+          ExcDimensionMismatch (values.size(), points.size()));
+
+  Assert (component == 0,
+          ExcIndexRange (component, 0, 1));
 
   const unsigned int n_points = points.size();
 
   for (unsigned int i=0; i<n_points; ++i)
     {
       if (points[i].square() < 0.5*0.5)
-       values[i] = 20;
+        values[i] = 20;
       else
-       values[i] = 1;
+        values[i] = 1;
     }
 }
 
@@ -137,8 +137,8 @@ void Coefficient<dim>::value_list (const std::vector<Point<dim> > &points,
 
 template <int dim>
 LaplaceProblem<dim>::LaplaceProblem () :
-                fe (1),
-               dof_handler (triangulation)
+  fe (1),
+  dof_handler (triangulation)
 {}
 
 
@@ -150,12 +150,12 @@ void LaplaceProblem<dim>::setup_system ()
   dof_handler.distribute_dofs (fe);
 
   deallog << "   Number of degrees of freedom: "
-           << dof_handler.n_dofs()
-           << std::endl;
+          << dof_handler.n_dofs()
+          << std::endl;
 
   sparsity_pattern.reinit (dof_handler.n_dofs(),
-                          dof_handler.n_dofs(),
-                          dof_handler.max_couplings_between_dofs());
+                           dof_handler.n_dofs(),
+                           dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
   sparsity_pattern.compress();
 
@@ -169,13 +169,13 @@ void LaplaceProblem<dim>::setup_system ()
 
 
 template <int dim>
-void LaplaceProblem<dim>::assemble_system () 
-{  
+void LaplaceProblem<dim>::assemble_system ()
+{
   QGauss<dim>  quadrature_formula (2);
 
-  FEValues<dim> x_fe_values (fe, quadrature_formula, 
-                          update_values    |  update_gradients |
-                          update_q_points  |  update_JxW_values);
+  FEValues<dim> x_fe_values (fe, quadrature_formula,
+                             update_values    |  update_gradients |
+                             update_q_points  |  update_JxW_values);
 
   const unsigned int   dofs_per_cell = fe.dofs_per_cell;
   const unsigned int   n_q_points    = quadrature_formula.size();
@@ -189,8 +189,8 @@ void LaplaceProblem<dim>::assemble_system ()
   std::vector<double>    coefficient_values (n_q_points);
 
   typename DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       cell_matrix = 0;
@@ -200,50 +200,50 @@ void LaplaceProblem<dim>::assemble_system ()
       const FEValues<2> &fe_values = x_fe_values.get_present_fe_values();
 
       coefficient.value_list (fe_values.get_quadrature_points(),
-                             coefficient_values);
-      
+                              coefficient_values);
+
       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         {
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += (coefficient_values[q_point] *
-                                  fe_values.shape_grad(i,q_point) *
-                                  fe_values.shape_grad(j,q_point) *
-                                  fe_values.JxW(q_point));
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += (coefficient_values[q_point] *
+                                   fe_values.shape_grad(i,q_point) *
+                                   fe_values.shape_grad(j,q_point) *
+                                   fe_values.JxW(q_point));
 
-           cell_rhs(i) += (fe_values.shape_value(i,q_point) *
-                           1.0 *
-                           fe_values.JxW(q_point));
-         }
+            cell_rhs(i) += (fe_values.shape_value(i,q_point) *
+                            1.0 *
+                            fe_values.JxW(q_point));
+          }
 
 
       cell->get_dof_indices (local_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           system_matrix.add (local_dof_indices[i],
-                              local_dof_indices[j],
-                              cell_matrix(i,j));
-         
-         system_rhs(local_dof_indices[i]) += cell_rhs(i);
-       }
+        {
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            system_matrix.add (local_dof_indices[i],
+                               local_dof_indices[j],
+                               cell_matrix(i,j));
+
+          system_rhs(local_dof_indices[i]) += cell_rhs(i);
+        }
     }
 
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           ZeroFunction<dim>(),
-                                           boundary_values);
+                                            0,
+                                            ZeroFunction<dim>(),
+                                            boundary_values);
   MatrixTools::apply_boundary_values (boundary_values,
-                                     system_matrix,
-                                     solution,
-                                     system_rhs);
+                                      system_matrix,
+                                      solution,
+                                      system_rhs);
 }
 
 
 
 template <int dim>
-void LaplaceProblem<dim>::solve () 
+void LaplaceProblem<dim>::solve ()
 {
   SolverControl           solver_control (1000, 1e-12);
   SolverCG<>              cg (solver_control);
@@ -252,11 +252,11 @@ void LaplaceProblem<dim>::solve ()
   preconditioner.initialize(system_matrix, 1.2);
 
   cg.solve (system_matrix, solution, system_rhs,
-           preconditioner);
+            preconditioner);
 
   deallog << "   " << solver_control.last_step()
-           << " CG iterations needed to obtain convergence."
-           << std::endl;
+          << " CG iterations needed to obtain convergence."
+          << std::endl;
 }
 
 
@@ -264,10 +264,10 @@ void LaplaceProblem<dim>::solve ()
 template <int dim>
 void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
 {
-                                   // reduce output a bit
+  // reduce output a bit
   if (cycle >= 2)
     return;
-  
+
   DataOut<dim,DoFHandler<dim> > data_out;
 
   data_out.attach_dof_handler (dof_handler);
@@ -288,33 +288,33 @@ void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
 
 
 template <int dim>
-void LaplaceProblem<dim>::run () 
+void LaplaceProblem<dim>::run ()
 {
   for (unsigned int cycle=0; cycle<6; ++cycle)
     {
       deallog << "Cycle " << cycle << ':' << std::endl;
 
       if (cycle != 0)
-       triangulation.refine_global (1);
+        triangulation.refine_global (1);
       else
-       {
-         GridIn<dim> grid_in;
-         grid_in.attach_triangulation (triangulation);
-         std::ifstream input_file("step-5/circle-grid.inp");
-         Assert (dim==2, ExcInternalError());
-         
-         grid_in.read_ucd (input_file);
-
-         static const HyperBallBoundary<dim> boundary;
-         triangulation.set_boundary (0, boundary);
-       }
+        {
+          GridIn<dim> grid_in;
+          grid_in.attach_triangulation (triangulation);
+          std::ifstream input_file("step-5/circle-grid.inp");
+          Assert (dim==2, ExcInternalError());
+
+          grid_in.read_ucd (input_file);
+
+          static const HyperBallBoundary<dim> boundary;
+          triangulation.set_boundary (0, boundary);
+        }
 
       deallog << "   Number of active cells: "
-               << triangulation.n_active_cells()
-               << std::endl
-               << "   Total number of cells: "
-               << triangulation.n_cells()
-               << std::endl;
+              << triangulation.n_active_cells()
+              << std::endl
+              << "   Total number of cells: "
+              << triangulation.n_cells()
+              << std::endl;
 
       setup_system ();
       assemble_system ();
@@ -325,26 +325,26 @@ void LaplaceProblem<dim>::run ()
 
 
 
-int main () 
+int main ()
 {
   deallog << std::setprecision(2);
   logfile << std::setprecision(2);
-    
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   deallog.depth_console (0);
 
   LaplaceProblem<2> laplace_problem_2d;
   laplace_problem_2d.run ();
 
-/*  
-  Coefficient<2>    coefficient;
-  std::vector<Point<2> > points (2);
-  std::vector<double>    coefficient_values (1);
-  coefficient.value_list (points, coefficient_values);
-*/
-  
+  /*
+    Coefficient<2>    coefficient;
+    std::vector<Point<2> > points (2);
+    std::vector<double>    coefficient_values (1);
+    coefficient.value_list (points, coefficient_values);
+  */
+
   return 0;
 }
index 09be3cc438197d1e642f5eec9e8a0dd05051eaf9..d81074dd7f5789333c1148b4620302eb768c31dc 100644 (file)
@@ -64,57 +64,57 @@ std::ofstream logfile("step-6/output");
 
 
 template <int dim>
-class LaplaceProblem 
+class LaplaceProblem
 {
-  public:
-    LaplaceProblem ();
-    ~LaplaceProblem ();
+public:
+  LaplaceProblem ();
+  ~LaplaceProblem ();
 
-    void run ();
-    
-  private:
-    void setup_system ();
-    void assemble_system ();
-    void solve ();
-    void refine_grid ();
-    void output_results (const unsigned int cycle) const;
+  void run ();
 
-    Triangulation<dim>   triangulation;
+private:
+  void setup_system ();
+  void assemble_system ();
+  void solve ();
+  void refine_grid ();
+  void output_results (const unsigned int cycle) const;
 
-    DoFHandler<dim>      dof_handler;
-    FE_Q<dim>            fe;
+  Triangulation<dim>   triangulation;
 
-    ConstraintMatrix     hanging_node_constraints;
+  DoFHandler<dim>      dof_handler;
+  FE_Q<dim>            fe;
 
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> system_matrix;
+  ConstraintMatrix     hanging_node_constraints;
 
-    Vector<double>       solution;
-    Vector<double>       system_rhs;
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> system_matrix;
+
+  Vector<double>       solution;
+  Vector<double>       system_rhs;
 };
 
 
 
 
 template <int dim>
-class Coefficient : public Function<dim> 
+class Coefficient : public Function<dim>
 {
-  public:
-    Coefficient () : Function<dim>() {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
-    
-    virtual void value_list (const std::vector<Point<dim> > &points,
-                            std::vector<double>            &values,
-                            const unsigned int              component = 0) const;
+public:
+  Coefficient () : Function<dim>() {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
+
+  virtual void value_list (const std::vector<Point<dim> > &points,
+                           std::vector<double>            &values,
+                           const unsigned int              component = 0) const;
 };
 
 
 
 template <int dim>
 double Coefficient<dim>::value (const Point<dim> &p,
-                               const unsigned int) const 
+                                const unsigned int) const
 {
   if (p.square() < 0.5*0.5)
     return 20;
@@ -126,23 +126,23 @@ double Coefficient<dim>::value (const Point<dim> &p,
 
 template <int dim>
 void Coefficient<dim>::value_list (const std::vector<Point<dim> > &points,
-                                  std::vector<double>            &values,
-                                  const unsigned int              component) const 
+                                   std::vector<double>            &values,
+                                   const unsigned int              component) const
 {
   const unsigned int n_points = points.size();
 
-  Assert (values.size() == n_points, 
-         ExcDimensionMismatch (values.size(), n_points));
-  
-  Assert (component == 0, 
-         ExcIndexRange (component, 0, 1));
-  
+  Assert (values.size() == n_points,
+          ExcDimensionMismatch (values.size(), n_points));
+
+  Assert (component == 0,
+          ExcIndexRange (component, 0, 1));
+
   for (unsigned int i=0; i<n_points; ++i)
     {
       if (points[i].square() < 0.5*0.5)
-       values[i] = 20;
+        values[i] = 20;
       else
-       values[i] = 1;
+        values[i] = 1;
     }
 }
 
@@ -151,14 +151,14 @@ void Coefficient<dim>::value_list (const std::vector<Point<dim> > &points,
 
 template <int dim>
 LaplaceProblem<dim>::LaplaceProblem () :
-               dof_handler (triangulation),
-                fe (2)
+  dof_handler (triangulation),
+  fe (2)
 {}
 
 
 
 template <int dim>
-LaplaceProblem<dim>::~LaplaceProblem () 
+LaplaceProblem<dim>::~LaplaceProblem ()
 {
   dof_handler.clear ();
 }
@@ -171,17 +171,17 @@ void LaplaceProblem<dim>::setup_system ()
   dof_handler.distribute_dofs (fe);
 
   sparsity_pattern.reinit (dof_handler.n_dofs(),
-                          dof_handler.n_dofs(),
-                          dof_handler.max_couplings_between_dofs());
+                           dof_handler.n_dofs(),
+                           dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
 
   solution.reinit (dof_handler.n_dofs());
   system_rhs.reinit (dof_handler.n_dofs());
 
-  
+
   hanging_node_constraints.clear ();
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          hanging_node_constraints);
+                                           hanging_node_constraints);
 
   hanging_node_constraints.close ();
 
@@ -194,13 +194,13 @@ void LaplaceProblem<dim>::setup_system ()
 
 
 template <int dim>
-void LaplaceProblem<dim>::assemble_system () 
-{  
+void LaplaceProblem<dim>::assemble_system ()
+{
   const QGauss<dim>  quadrature_formula (3);
 
-  FEValues<dim> x_fe_values (fe, quadrature_formula, 
-                          update_values    |  update_gradients |
-                          update_q_points  |  update_JxW_values);
+  FEValues<dim> x_fe_values (fe, quadrature_formula,
+                             update_values    |  update_gradients |
+                             update_q_points  |  update_JxW_values);
 
   const unsigned int   dofs_per_cell = fe.dofs_per_cell;
   const unsigned int   n_q_points    = quadrature_formula.size();
@@ -214,8 +214,8 @@ void LaplaceProblem<dim>::assemble_system ()
   std::vector<double>    coefficient_values (n_q_points);
 
   typename DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       cell_matrix = 0;
@@ -223,34 +223,34 @@ void LaplaceProblem<dim>::assemble_system ()
 
       x_fe_values.reinit (cell);
       const FEValues<dim> &fe_values = x_fe_values.get_present_fe_values();
-      
+
       coefficient.value_list (fe_values.get_quadrature_points(),
-                             coefficient_values);
-      
+                              coefficient_values);
+
       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         {
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += (coefficient_values[q_point] *
-                                  fe_values.shape_grad(i,q_point) *
-                                  fe_values.shape_grad(j,q_point) *
-                                  fe_values.JxW(q_point));
-
-           cell_rhs(i) += (fe_values.shape_value(i,q_point) *
-                           1.0 *
-                           fe_values.JxW(q_point));
-         }
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += (coefficient_values[q_point] *
+                                   fe_values.shape_grad(i,q_point) *
+                                   fe_values.shape_grad(j,q_point) *
+                                   fe_values.JxW(q_point));
+
+            cell_rhs(i) += (fe_values.shape_value(i,q_point) *
+                            1.0 *
+                            fe_values.JxW(q_point));
+          }
 
       cell->get_dof_indices (local_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           system_matrix.add (local_dof_indices[i],
-                              local_dof_indices[j],
-                              cell_matrix(i,j));
-         
-         system_rhs(local_dof_indices[i]) += cell_rhs(i);
-       }
+        {
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            system_matrix.add (local_dof_indices[i],
+                               local_dof_indices[j],
+                               cell_matrix(i,j));
+
+          system_rhs(local_dof_indices[i]) += cell_rhs(i);
+        }
     }
 
   hanging_node_constraints.condense (system_matrix);
@@ -258,13 +258,13 @@ void LaplaceProblem<dim>::assemble_system ()
 
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           ZeroFunction<dim>(),
-                                           boundary_values);
+                                            0,
+                                            ZeroFunction<dim>(),
+                                            boundary_values);
   MatrixTools::apply_boundary_values (boundary_values,
-                                     system_matrix,
-                                     solution,
-                                     system_rhs);
+                                      system_matrix,
+                                      solution,
+                                      system_rhs);
 }
 
 
@@ -272,7 +272,7 @@ void LaplaceProblem<dim>::assemble_system ()
 
 
 template <int dim>
-void LaplaceProblem<dim>::solve () 
+void LaplaceProblem<dim>::solve ()
 {
   SolverControl           solver_control (1000, 1e-12);
   SolverCG<>              cg (solver_control);
@@ -281,7 +281,7 @@ void LaplaceProblem<dim>::solve ()
   preconditioner.initialize(system_matrix, 1.2);
 
   cg.solve (system_matrix, solution, system_rhs,
-           preconditioner);
+            preconditioner);
 
   hanging_node_constraints.distribute (solution);
 }
@@ -294,14 +294,14 @@ void LaplaceProblem<dim>::refine_grid ()
   Vector<float> estimated_error_per_cell (triangulation.n_active_cells());
 
   KellyErrorEstimator<dim>::estimate (dof_handler,
-                                     QGauss<dim-1>(3),
-                                     typename FunctionMap<dim>::type(),
-                                     solution,
-                                     estimated_error_per_cell);
+                                      QGauss<dim-1>(3),
+                                      typename FunctionMap<dim>::type(),
+                                      solution,
+                                      estimated_error_per_cell);
 
   GridRefinement::refine_and_coarsen_fixed_number (triangulation,
-                                                  estimated_error_per_cell,
-                                                  0.3, 0.03);
+                                                   estimated_error_per_cell,
+                                                   0.3, 0.03);
 
   triangulation.execute_coarsening_and_refinement ();
 }
@@ -313,13 +313,13 @@ void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
 {
   if (cycle%3 != 0)
     return;
-  
+
   Assert (cycle < 10, ExcNotImplemented());
 
   std::string filename = "grid-";
   filename += ('0' + cycle);
   filename += ".eps";
-  
+
   GridOut grid_out;
   grid_out.write_eps (triangulation, deallog.get_file_stream());
 }
@@ -328,35 +328,35 @@ void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
 
 
 template <int dim>
-void LaplaceProblem<dim>::run () 
+void LaplaceProblem<dim>::run ()
 {
   for (unsigned int cycle=0; cycle<4; ++cycle)
     {
       deallog << "Cycle " << cycle << ':' << std::endl;
 
       if (cycle == 0)
-       {
-         GridGenerator::hyper_ball (triangulation);
+        {
+          GridGenerator::hyper_ball (triangulation);
 
-         static const HyperBallBoundary<dim> boundary;
-         triangulation.set_boundary (0, boundary);
+          static const HyperBallBoundary<dim> boundary;
+          triangulation.set_boundary (0, boundary);
 
-         triangulation.refine_global (1);
-       }
+          triangulation.refine_global (1);
+        }
       else
-       refine_grid ();
-      
+        refine_grid ();
+
 
       deallog << "   Number of active cells:       "
-               << triangulation.n_active_cells()
-               << std::endl;
+              << triangulation.n_active_cells()
+              << std::endl;
 
       setup_system ();
 
       deallog << "   Number of degrees of freedom: "
-               << dof_handler.n_dofs()
-               << std::endl;
-      
+              << dof_handler.n_dofs()
+              << std::endl;
+
       assemble_system ();
       solve ();
       output_results (cycle);
@@ -364,27 +364,27 @@ void LaplaceProblem<dim>::run ()
 
   DataOutBase::EpsFlags eps_flags;
   eps_flags.z_scaling = 4;
-  
+
   DataOut<dim,DoFHandler<dim> > data_out;
   data_out.set_flags (eps_flags);
 
   data_out.attach_dof_handler (dof_handler);
   data_out.add_data_vector (solution, "solution");
   data_out.build_patches ();
-  
+
   data_out.write_eps (deallog.get_file_stream());
 }
 
 
 
-int main () 
+int main ()
 {
   deallog << std::setprecision(2);
   logfile << std::setprecision(2);
-    
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   try
     {
@@ -396,25 +396,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     }
 
index 0cdd150b96007a24ff412faf9f4175952b0e5819..2e65593c032b6dc90f10719a5ea462d6d1bc86bf 100644 (file)
@@ -62,28 +62,30 @@ std::ofstream logfile("step-7/output");
 
 
 template <int dim>
-class SolutionBase 
+class SolutionBase
 {
-  protected:
-    static const unsigned int n_source_centers = 3;    
-    static const Point<dim>   source_centers[n_source_centers];
-    static const double       width;
+protected:
+  static const unsigned int n_source_centers = 3;
+  static const Point<dim>   source_centers[n_source_centers];
+  static const double       width;
 };
 
 
 template <>
 const Point<1>
 SolutionBase<1>::source_centers[SolutionBase<1>::n_source_centers]
-= { Point<1>(-1.0 / 3.0), 
-    Point<1>(0.0), 
-    Point<1>(+1.0 / 3.0)   };
+  = { Point<1>(-1.0 / 3.0),
+      Point<1>(0.0),
+      Point<1>(+1.0 / 3.0)
+    };
 
 template <>
 const Point<2>
 SolutionBase<2>::source_centers[SolutionBase<2>::n_source_centers]
-= { Point<2>(-0.5, +0.5), 
-    Point<2>(-0.5, -0.5), 
-    Point<2>(+0.5, -0.5)   };
+  = { Point<2>(-0.5, +0.5),
+      Point<2>(-0.5, -0.5),
+      Point<2>(+0.5, -0.5)
+    };
 
 template <int dim>
 const double SolutionBase<dim>::width = 1./3.;
@@ -92,51 +94,51 @@ const double SolutionBase<dim>::width = 1./3.;
 
 template <int dim>
 class Solution : public Function<dim>,
-                protected SolutionBase<dim>
+  protected SolutionBase<dim>
 {
-  public:
-    Solution () : Function<dim>() {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
-    
-    virtual Tensor<1,dim> gradient (const Point<dim>   &p,
-                                   const unsigned int  component = 0) const;
+public:
+  Solution () : Function<dim>() {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
+
+  virtual Tensor<1,dim> gradient (const Point<dim>   &p,
+                                  const unsigned int  component = 0) const;
 };
 
 
 template <int dim>
 double Solution<dim>::value (const Point<dim>   &p,
-                            const unsigned int) const
+                             const unsigned int) const
 {
   double return_value = 0;
   for (unsigned int i=0; i<this->n_source_centers; ++i)
     {
       const Point<dim> x_minus_xi = p - this->source_centers[i];
       return_value += std::exp(-x_minus_xi.square() /
-                              (this->width * this->width));
+                               (this->width * this->width));
     }
-  
+
   return return_value;
 }
 
 
 template <int dim>
 Tensor<1,dim> Solution<dim>::gradient (const Point<dim>   &p,
-                                      const unsigned int) const
+                                       const unsigned int) const
 {
   Tensor<1,dim> return_value;
 
   for (unsigned int i=0; i<this->n_source_centers; ++i)
     {
       const Point<dim> x_minus_xi = p - this->source_centers[i];
-      
+
       return_value += (-2 / (this->width * this->width) *
-                      std::exp(-x_minus_xi.square() /
-                               (this->width * this->width)) *
-                      x_minus_xi);
+                       std::exp(-x_minus_xi.square() /
+                                (this->width * this->width)) *
+                       x_minus_xi);
     }
-  
+
   return return_value;
 }
 
@@ -144,77 +146,78 @@ Tensor<1,dim> Solution<dim>::gradient (const Point<dim>   &p,
 
 template <int dim>
 class RightHandSide : public Function<dim>,
-                     protected SolutionBase<dim>
+  protected SolutionBase<dim>
 {
-  public:
-    RightHandSide () : Function<dim>() {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
+public:
+  RightHandSide () : Function<dim>() {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
 };
 
 
 template <int dim>
 double RightHandSide<dim>::value (const Point<dim>   &p,
-                                 const unsigned int) const
+                                  const unsigned int) const
 {
   double return_value = 0;
   for (unsigned int i=0; i<this->n_source_centers; ++i)
     {
       const Point<dim> x_minus_xi = p - this->source_centers[i];
-      
+
       return_value += ((2*dim - 4*x_minus_xi.square()/
-                       (this->width * this->width)) / 
-                      (this->width * this->width) *
-                      std::exp(-x_minus_xi.square() /
-                               (this->width * this->width)));
+                        (this->width * this->width)) /
+                       (this->width * this->width) *
+                       std::exp(-x_minus_xi.square() /
+                                (this->width * this->width)));
       return_value += std::exp(-x_minus_xi.square() /
-                              (this->width * this->width));
+                               (this->width * this->width));
     }
-  
+
   return return_value;
 }
 
 
 
 template <int dim>
-class HelmholtzProblem 
+class HelmholtzProblem
 {
-  public:
-    enum RefinementMode {
-         global_refinement, adaptive_refinement
-    };
-    
-    HelmholtzProblem (const FiniteElement<dim> &fe,
-                      const RefinementMode      refinement_mode);
+public:
+  enum RefinementMode
+  {
+    global_refinement, adaptive_refinement
+  };
 
-    ~HelmholtzProblem ();
+  HelmholtzProblem (const FiniteElement<dim> &fe,
+                    const RefinementMode      refinement_mode);
 
-    void run ();
-    
-  private:
-    void setup_system ();
-    void assemble_system ();
-    void solve ();
-    void refine_grid ();
-    void process_solution (const unsigned int cycle);
+  ~HelmholtzProblem ();
 
-    Triangulation<dim>                      triangulation;
-    DoFHandler<dim>                         dof_handler;
+  void run ();
 
-    SmartPointer<const FiniteElement<dim> > fe;
+private:
+  void setup_system ();
+  void assemble_system ();
+  void solve ();
+  void refine_grid ();
+  void process_solution (const unsigned int cycle);
 
-    ConstraintMatrix                        hanging_node_constraints;
+  Triangulation<dim>                      triangulation;
+  DoFHandler<dim>                         dof_handler;
 
-    SparsityPattern                         sparsity_pattern;
-    SparseMatrix<double>                    system_matrix;
+  SmartPointer<const FiniteElement<dim> > fe;
 
-    Vector<double>                          solution;
-    Vector<double>                          system_rhs;
+  ConstraintMatrix                        hanging_node_constraints;
 
-    const RefinementMode                    refinement_mode;
+  SparsityPattern                         sparsity_pattern;
+  SparseMatrix<double>                    system_matrix;
 
-    ConvergenceTable                        convergence_table;
+  Vector<double>                          solution;
+  Vector<double>                          system_rhs;
+
+  const RefinementMode                    refinement_mode;
+
+  ConvergenceTable                        convergence_table;
 };
 
 
@@ -223,15 +226,15 @@ class HelmholtzProblem
 template <int dim>
 HelmholtzProblem<dim>::HelmholtzProblem (const FiniteElement<dim> &fe,
                                          const RefinementMode refinement_mode) :
-               dof_handler (triangulation),
-               fe (&fe),
-               refinement_mode (refinement_mode)
+  dof_handler (triangulation),
+  fe (&fe),
+  refinement_mode (refinement_mode)
 {}
 
 
 
 template <int dim>
-HelmholtzProblem<dim>::~HelmholtzProblem () 
+HelmholtzProblem<dim>::~HelmholtzProblem ()
 {
   dof_handler.clear ();
 }
@@ -246,12 +249,12 @@ void HelmholtzProblem<dim>::setup_system ()
 
   hanging_node_constraints.clear ();
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          hanging_node_constraints);
+                                           hanging_node_constraints);
   hanging_node_constraints.close ();
 
   sparsity_pattern.reinit (dof_handler.n_dofs(),
-                          dof_handler.n_dofs(),
-                          dof_handler.max_couplings_between_dofs());
+                           dof_handler.n_dofs(),
+                           dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
   hanging_node_constraints.condense (sparsity_pattern);
   sparsity_pattern.compress();
@@ -265,8 +268,8 @@ void HelmholtzProblem<dim>::setup_system ()
 
 
 template <int dim>
-void HelmholtzProblem<dim>::assemble_system () 
-{  
+void HelmholtzProblem<dim>::assemble_system ()
+{
   QGauss<dim>   quadrature_formula (3);
   QGauss<dim-1> face_quadrature_formula (3);
 
@@ -279,23 +282,23 @@ void HelmholtzProblem<dim>::assemble_system ()
   Vector<double>       cell_rhs (dofs_per_cell);
 
   std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
-  
-  FEValues<dim>  x_fe_values (*fe, quadrature_formula, 
-                           update_values   | update_gradients |
-                            update_q_points | update_JxW_values);
 
-  FEFaceValues<dim> x_fe_face_values (*fe, face_quadrature_formula, 
-                                   update_values         | update_q_points  |
-                                    update_normal_vectors | update_JxW_values);
+  FEValues<dim>  x_fe_values (*fe, quadrature_formula,
+                              update_values   | update_gradients |
+                              update_q_points | update_JxW_values);
+
+  FEFaceValues<dim> x_fe_face_values (*fe, face_quadrature_formula,
+                                      update_values         | update_q_points  |
+                                      update_normal_vectors | update_JxW_values);
 
   const RightHandSide<dim> right_hand_side;
   std::vector<double>  rhs_values (n_q_points);
 
   const Solution<dim> exact_solution;
-  
+
   typename DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       cell_matrix = 0;
@@ -306,55 +309,55 @@ void HelmholtzProblem<dim>::assemble_system ()
 
       right_hand_side.value_list (fe_values.get_quadrature_points(),
                                   rhs_values);
-      
+
       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         {
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += ((fe_values.shape_grad(i,q_point) *
-                                   fe_values.shape_grad(j,q_point)
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += ((fe_values.shape_grad(i,q_point) *
+                                    fe_values.shape_grad(j,q_point)
                                     +
                                     fe_values.shape_value(i,q_point) *
-                                   fe_values.shape_value(j,q_point)) *
+                                    fe_values.shape_value(j,q_point)) *
                                    fe_values.JxW(q_point));
 
-           cell_rhs(i) += (fe_values.shape_value(i,q_point) *
-                           rhs_values [q_point] *
-                           fe_values.JxW(q_point));
-         }
+            cell_rhs(i) += (fe_values.shape_value(i,q_point) *
+                            rhs_values [q_point] *
+                            fe_values.JxW(q_point));
+          }
 
       for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
-       if (cell->face(face)->at_boundary()
+        if (cell->face(face)->at_boundary()
             &&
             (cell->face(face)->boundary_indicator() == 1))
-         {
-           x_fe_face_values.reinit (cell, face);
-           const FEFaceValues<dim> &fe_face_values
-             = x_fe_face_values.get_present_fe_values ();
-
-           for (unsigned int q_point=0; q_point<n_face_q_points; ++q_point)
-             {
-               const double neumann_value
-                 = (exact_solution.gradient (fe_face_values.quadrature_point(q_point)) *
-                    fe_face_values.normal_vector(q_point));
-
-               for (unsigned int i=0; i<dofs_per_cell; ++i)
-                 cell_rhs(i) += (neumann_value *
-                                 fe_face_values.shape_value(i,q_point) *
-                                 fe_face_values.JxW(q_point));
-             }
-         }
+          {
+            x_fe_face_values.reinit (cell, face);
+            const FEFaceValues<dim> &fe_face_values
+              = x_fe_face_values.get_present_fe_values ();
+
+            for (unsigned int q_point=0; q_point<n_face_q_points; ++q_point)
+              {
+                const double neumann_value
+                  = (exact_solution.gradient (fe_face_values.quadrature_point(q_point)) *
+                     fe_face_values.normal_vector(q_point));
+
+                for (unsigned int i=0; i<dofs_per_cell; ++i)
+                  cell_rhs(i) += (neumann_value *
+                                  fe_face_values.shape_value(i,q_point) *
+                                  fe_face_values.JxW(q_point));
+              }
+          }
 
       cell->get_dof_indices (local_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           system_matrix.add (local_dof_indices[i],
-                              local_dof_indices[j],
-                              cell_matrix(i,j));
-         
-         system_rhs(local_dof_indices[i]) += cell_rhs(i);
-       }
+        {
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            system_matrix.add (local_dof_indices[i],
+                               local_dof_indices[j],
+                               cell_matrix(i,j));
+
+          system_rhs(local_dof_indices[i]) += cell_rhs(i);
+        }
     }
 
   hanging_node_constraints.condense (system_matrix);
@@ -362,19 +365,19 @@ void HelmholtzProblem<dim>::assemble_system ()
 
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           Solution<dim>(),
-                                           boundary_values);
+                                            0,
+                                            Solution<dim>(),
+                                            boundary_values);
   MatrixTools::apply_boundary_values (boundary_values,
-                                     system_matrix,
-                                     solution,
-                                     system_rhs);
+                                      system_matrix,
+                                      solution,
+                                      system_rhs);
 }
 
 
 
 template <int dim>
-void HelmholtzProblem<dim>::solve () 
+void HelmholtzProblem<dim>::solve ()
 {
   SolverControl           solver_control (1000, 1e-12);
   SolverCG<>              cg (solver_control);
@@ -383,7 +386,7 @@ void HelmholtzProblem<dim>::solve ()
   preconditioner.initialize(system_matrix, 1.2);
 
   cg.solve (system_matrix, solution, system_rhs,
-           preconditioner);
+            preconditioner);
 
   hanging_node_constraints.distribute (solution);
 }
@@ -393,38 +396,38 @@ void HelmholtzProblem<dim>::solve ()
 template <int dim>
 void HelmholtzProblem<dim>::refine_grid ()
 {
-  switch (refinement_mode) 
+  switch (refinement_mode)
     {
-      case global_refinement:
-      {
-       triangulation.refine_global (1);
-       break;
-      }
+    case global_refinement:
+    {
+      triangulation.refine_global (1);
+      break;
+    }
 
-      case adaptive_refinement:
-      {
-       Vector<float> estimated_error_per_cell (triangulation.n_active_cells());
-
-       typename FunctionMap<dim>::type neumann_boundary;
-       KellyErrorEstimator<dim>::estimate (dof_handler,
-                                           QGauss<dim-1>(3),
-                                           neumann_boundary,
-                                           solution,
-                                           estimated_error_per_cell);
-
-       GridRefinement::refine_and_coarsen_fixed_number (triangulation,
-                                                        estimated_error_per_cell,
-                                                        0.3, 0.03);
-       
-       triangulation.execute_coarsening_and_refinement ();
-
-       break;
-      }
+    case adaptive_refinement:
+    {
+      Vector<float> estimated_error_per_cell (triangulation.n_active_cells());
 
-      default:
-      {
-        Assert (false, ExcNotImplemented());
-      }
+      typename FunctionMap<dim>::type neumann_boundary;
+      KellyErrorEstimator<dim>::estimate (dof_handler,
+                                          QGauss<dim-1>(3),
+                                          neumann_boundary,
+                                          solution,
+                                          estimated_error_per_cell);
+
+      GridRefinement::refine_and_coarsen_fixed_number (triangulation,
+                                                       estimated_error_per_cell,
+                                                       0.3, 0.03);
+
+      triangulation.execute_coarsening_and_refinement ();
+
+      break;
+    }
+
+    default:
+    {
+      Assert (false, ExcNotImplemented());
+    }
     }
 }
 
@@ -435,42 +438,42 @@ void HelmholtzProblem<dim>::process_solution (const unsigned int cycle)
 {
   Vector<float> difference_per_cell (triangulation.n_active_cells());
   VectorTools::integrate_difference (dof_handler,
-                                    solution,
-                                    Solution<dim>(),
-                                    difference_per_cell,
-                                    QGauss<dim>(3),
-                                    VectorTools::L2_norm);
+                                     solution,
+                                     Solution<dim>(),
+                                     difference_per_cell,
+                                     QGauss<dim>(3),
+                                     VectorTools::L2_norm);
   const double L2_error = difference_per_cell.l2_norm();
 
   VectorTools::integrate_difference (dof_handler,
-                                    solution,
-                                    Solution<dim>(),
-                                    difference_per_cell,
-                                    QGauss<dim>(3),
-                                    VectorTools::H1_seminorm);
+                                     solution,
+                                     Solution<dim>(),
+                                     difference_per_cell,
+                                     QGauss<dim>(3),
+                                     VectorTools::H1_seminorm);
   const double H1_error = difference_per_cell.l2_norm();
 
   const QTrapez<1>     q_trapez;
   const QIterated<dim> q_iterated (q_trapez, 5);
   VectorTools::integrate_difference (dof_handler,
-                                    solution,
-                                    Solution<dim>(),
-                                    difference_per_cell,
-                                    q_iterated,
-                                    VectorTools::Linfty_norm);
+                                     solution,
+                                     Solution<dim>(),
+                                     difference_per_cell,
+                                     q_iterated,
+                                     VectorTools::Linfty_norm);
   const double Linfty_error = difference_per_cell.linfty_norm();
 
   const unsigned int n_active_cells=triangulation.n_active_cells();
   const unsigned int n_dofs=dof_handler.n_dofs();
-  
-  deallog << "Cycle " << cycle << ':' 
-           << std::endl
-           << "   Number of active cells:       "
-           << n_active_cells
-           << std::endl
-           << "   Number of degrees of freedom: "
-           << n_dofs
-           << std::endl;
+
+  deallog << "Cycle " << cycle << ':'
+          << std::endl
+          << "   Number of active cells:       "
+          << n_active_cells
+          << std::endl
+          << "   Number of degrees of freedom: "
+          << n_dofs
+          << std::endl;
 
   convergence_table.add_value("cycle", cycle);
   convergence_table.add_value("cells", n_active_cells);
@@ -483,67 +486,67 @@ void HelmholtzProblem<dim>::process_solution (const unsigned int cycle)
 
 
 template <int dim>
-void HelmholtzProblem<dim>::run () 
+void HelmholtzProblem<dim>::run ()
 {
   for (unsigned int cycle=0; cycle<4; ++cycle)
     {
       if (cycle == 0)
-       {
-         GridGenerator::hyper_cube (triangulation, -1, 1);
-         triangulation.refine_global (1);
+        {
+          GridGenerator::hyper_cube (triangulation, -1, 1);
+          triangulation.refine_global (1);
 
           typename Triangulation<dim>::cell_iterator
-            cell = triangulation.begin (),
-            endc = triangulation.end();
-         for (; cell!=endc; ++cell)
-           for (unsigned int face=0;
+          cell = triangulation.begin (),
+          endc = triangulation.end();
+          for (; cell!=endc; ++cell)
+            for (unsigned int face=0;
                  face<GeometryInfo<dim>::faces_per_cell;
                  ++face)
-             if ((cell->face(face)->center()(0) == -1)
-                 ||
-                 (cell->face(face)->center()(1) == -1))
-               cell->face(face)->set_boundary_indicator (1);
-       }
+              if ((cell->face(face)->center()(0) == -1)
+                  ||
+                  (cell->face(face)->center()(1) == -1))
+                cell->face(face)->set_boundary_indicator (1);
+        }
       else
         refine_grid ();
-      
+
 
       setup_system ();
-      
+
       assemble_system ();
       solve ();
 
       process_solution (cycle);
     }
-  
+
 
   if (refinement_mode == adaptive_refinement)
     {
       std::string gmv_filename;
       switch (refinement_mode)
-       {
-         case global_refinement:
-               gmv_filename = "solution-global";
-               break;
-         case adaptive_refinement:
-               gmv_filename = "solution-adaptive";
-               break;
-         default:
-               Assert (false, ExcNotImplemented());
-       }
+        {
+        case global_refinement:
+          gmv_filename = "solution-global";
+          break;
+        case adaptive_refinement:
+          gmv_filename = "solution-adaptive";
+          break;
+        default:
+          Assert (false, ExcNotImplemented());
+        }
 
       switch ((*fe).degree)
-       {
-         case 1:
-               gmv_filename += "-q1";
-               break;
-         case 2:
-               gmv_filename += "-q2";
-               break;
-
-         default:
-               Assert (false, ExcNotImplemented());
-       }
+        {
+        case 1:
+          gmv_filename += "-q1";
+          break;
+        case 2:
+          gmv_filename += "-q2";
+          break;
+
+        default:
+          Assert (false, ExcNotImplemented());
+        }
 
       gmv_filename += ".gmv";
 
@@ -554,9 +557,9 @@ void HelmholtzProblem<dim>::run ()
       data_out.build_patches ((*fe).degree);
       data_out.write_gmv (deallog.get_file_stream());
     }
-  
-  
-  
+
+
+
   convergence_table.set_precision("L2", 3);
   convergence_table.set_precision("H1", 3);
   convergence_table.set_precision("Linfty", 3);
@@ -576,43 +579,43 @@ void HelmholtzProblem<dim>::run ()
 
   deallog << std::endl;
   convergence_table.write_text(deallog.get_file_stream());
-  
+
   std::string error_filename = "error";
   switch (refinement_mode)
     {
-      case global_refinement:
-            error_filename += "-global";
-            break;
-      case adaptive_refinement:
-            error_filename += "-adaptive";
-            break;
-      default:
-            Assert (false, ExcNotImplemented());
+    case global_refinement:
+      error_filename += "-global";
+      break;
+    case adaptive_refinement:
+      error_filename += "-adaptive";
+      break;
+    default:
+      Assert (false, ExcNotImplemented());
     }
 
   switch ((*fe).degree)
     {
-      case 1:
-            error_filename += "-q1";
-            break;
-      case 2:
-            error_filename += "-q2";
-            break;
-      default:
-            Assert (false, ExcNotImplemented());
+    case 1:
+      error_filename += "-q1";
+      break;
+    case 2:
+      error_filename += "-q2";
+      break;
+    default:
+      Assert (false, ExcNotImplemented());
     }
-  
+
   error_filename += ".tex";
-  
+
   convergence_table.write_tex(deallog.get_file_stream());
 
-  
+
 
   if (refinement_mode==global_refinement)
     {
       convergence_table.add_column_to_supercolumn("cycle", "n cells");
       convergence_table.add_column_to_supercolumn("cells", "n cells");
-      
+
       std::vector<std::string> new_order;
       new_order.push_back("n cells");
       new_order.push_back("H1");
@@ -620,38 +623,38 @@ void HelmholtzProblem<dim>::run ()
       convergence_table.set_column_order (new_order);
 
       convergence_table
-       .evaluate_convergence_rates("L2", ConvergenceTable::reduction_rate);
+      .evaluate_convergence_rates("L2", ConvergenceTable::reduction_rate);
       convergence_table
-       .evaluate_convergence_rates("L2", ConvergenceTable::reduction_rate_log2);
+      .evaluate_convergence_rates("L2", ConvergenceTable::reduction_rate_log2);
       convergence_table
-       .evaluate_convergence_rates("H1", ConvergenceTable::reduction_rate_log2);
+      .evaluate_convergence_rates("H1", ConvergenceTable::reduction_rate_log2);
 
       deallog << std::endl;
       convergence_table.write_text(deallog.get_file_stream());
 
       std::string conv_filename = "convergence";
       switch (refinement_mode)
-       {
-         case global_refinement:
-               conv_filename += "-global";
-               break;
-         case adaptive_refinement:
-               conv_filename += "-adaptive";
-               break;
-         default:
-               Assert (false, ExcNotImplemented());
-       }
+        {
+        case global_refinement:
+          conv_filename += "-global";
+          break;
+        case adaptive_refinement:
+          conv_filename += "-adaptive";
+          break;
+        default:
+          Assert (false, ExcNotImplemented());
+        }
       switch ((*fe).degree)
-       {
-         case 1:
-               conv_filename += "-q1";
-               break;
-         case 2:
-               conv_filename += "-q2";
-               break;
-         default:
-               Assert (false, ExcNotImplemented());
-       }
+        {
+        case 1:
+          conv_filename += "-q1";
+          break;
+        case 2:
+          conv_filename += "-q2";
+          break;
+        default:
+          Assert (false, ExcNotImplemented());
+        }
       conv_filename += ".tex";
 
       convergence_table.write_tex(deallog.get_file_stream());
@@ -659,86 +662,86 @@ void HelmholtzProblem<dim>::run ()
 }
 
 
-int main () 
+int main ()
 {
   deallog << std::setprecision(2);
   logfile << std::setprecision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   const unsigned int dim = 2;
 
   try
     {
       deallog.depth_console (0);
-      
-      
+
+
       {
-       deallog << "Solving with Q1 elements, adaptive refinement" << std::endl
-                 << "=============================================" << std::endl
-                 << std::endl;
-       
-       FE_Q<dim> fe(1);
-       HelmholtzProblem<dim>
-         helmholtz_problem_2d (fe, HelmholtzProblem<dim>::adaptive_refinement);
+        deallog << "Solving with Q1 elements, adaptive refinement" << std::endl
+                << "=============================================" << std::endl
+                << std::endl;
 
-       helmholtz_problem_2d.run ();
+        FE_Q<dim> fe(1);
+        HelmholtzProblem<dim>
+        helmholtz_problem_2d (fe, HelmholtzProblem<dim>::adaptive_refinement);
 
-       deallog << std::endl;
+        helmholtz_problem_2d.run ();
+
+        deallog << std::endl;
       }
-       
+
       {
-       deallog << "Solving with Q1 elements, global refinement" << std::endl
-                 << "===========================================" << std::endl
-                 << std::endl;
-       
-       FE_Q<dim> fe(1);
-       HelmholtzProblem<dim>
-         helmholtz_problem_2d (fe, HelmholtzProblem<dim>::global_refinement);
+        deallog << "Solving with Q1 elements, global refinement" << std::endl
+                << "===========================================" << std::endl
+                << std::endl;
+
+        FE_Q<dim> fe(1);
+        HelmholtzProblem<dim>
+        helmholtz_problem_2d (fe, HelmholtzProblem<dim>::global_refinement);
 
-       helmholtz_problem_2d.run ();
+        helmholtz_problem_2d.run ();
 
-       deallog << std::endl;
+        deallog << std::endl;
       }
-       
+
       {
-       deallog << "Solving with Q2 elements, global refinement" << std::endl
-                 << "===========================================" << std::endl
-                 << std::endl;
-       
-       FE_Q<dim> fe(2);
-       HelmholtzProblem<dim>
-         helmholtz_problem_2d (fe, HelmholtzProblem<dim>::global_refinement);
+        deallog << "Solving with Q2 elements, global refinement" << std::endl
+                << "===========================================" << std::endl
+                << std::endl;
+
+        FE_Q<dim> fe(2);
+        HelmholtzProblem<dim>
+        helmholtz_problem_2d (fe, HelmholtzProblem<dim>::global_refinement);
 
-       helmholtz_problem_2d.run ();
+        helmholtz_problem_2d.run ();
 
-       deallog << std::endl;
+        deallog << std::endl;
       }
-       
+
     }
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     }
 
index a78da97b73f1b69f294238be4fc2ede1b5ae7a5f..13821512c9fca38cf59c6b9582ca1de6540c1d61 100644 (file)
@@ -59,96 +59,96 @@ std::ofstream logfile("step-8/output");
 
 
 template <int dim>
-class ElasticProblem 
+class ElasticProblem
 {
-  public:
-    ElasticProblem ();
-    ~ElasticProblem ();
-    void run ();
-    
-  private:
-    void setup_system ();
-    void assemble_system ();
-    void solve ();
-    void refine_grid ();
-    void output_results (const unsigned int cycle) const;
-
-    Triangulation<dim>   triangulation;
-    DoFHandler<dim>      dof_handler;
-
-    FESystem<dim>        fe;
-
-    ConstraintMatrix     hanging_node_constraints;
-
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> system_matrix;
-
-    Vector<double>       solution;
-    Vector<double>       system_rhs;
+public:
+  ElasticProblem ();
+  ~ElasticProblem ();
+  void run ();
+
+private:
+  void setup_system ();
+  void assemble_system ();
+  void solve ();
+  void refine_grid ();
+  void output_results (const unsigned int cycle) const;
+
+  Triangulation<dim>   triangulation;
+  DoFHandler<dim>      dof_handler;
+
+  FESystem<dim>        fe;
+
+  ConstraintMatrix     hanging_node_constraints;
+
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> system_matrix;
+
+  Vector<double>       solution;
+  Vector<double>       system_rhs;
 };
 
 
 
 template <int dim>
-class RightHandSide :  public Function<dim> 
+class RightHandSide :  public Function<dim>
 {
-  public:
-    RightHandSide ();
-    
-    virtual void vector_value (const Point<dim> &p,
-                              Vector<double>   &values) const;
-
-    virtual void vector_value_list (const std::vector<Point<dim> > &points,
-                                   std::vector<Vector<double> >   &value_list) const;
+public:
+  RightHandSide ();
+
+  virtual void vector_value (const Point<dim> &p,
+                             Vector<double>   &values) const;
+
+  virtual void vector_value_list (const std::vector<Point<dim> > &points,
+                                  std::vector<Vector<double> >   &value_list) const;
 };
 
 
 template <int dim>
 RightHandSide<dim>::RightHandSide ()
-               :
-               Function<dim> (dim)
+  :
+  Function<dim> (dim)
 {}
 
 
 template <int dim>
 inline
 void RightHandSide<dim>::vector_value (const Point<dim> &p,
-                                      Vector<double>   &values) const 
+                                       Vector<double>   &values) const
 {
-  Assert (values.size() == dim, 
-         ExcDimensionMismatch (values.size(), dim));
+  Assert (values.size() == dim,
+          ExcDimensionMismatch (values.size(), dim));
   Assert (dim >= 2, ExcNotImplemented());
-  
+
   Point<dim> point_1, point_2;
   point_1(0) = 0.5;
   point_2(0) = -0.5;
-  
+
   if (((p-point_1).square() < 0.2*0.2) ||
       ((p-point_2).square() < 0.2*0.2))
     values(0) = 1;
   else
     values(0) = 0;
-  
+
   if (p.square() < 0.2*0.2)
     values(1) = 1;
   else
-    values(1) = 0;    
+    values(1) = 0;
 }
 
 
 
 template <int dim>
 void RightHandSide<dim>::vector_value_list (const std::vector<Point<dim> > &points,
-                                           std::vector<Vector<double> >   &value_list) const 
+                                            std::vector<Vector<double> >   &value_list) const
 {
-  Assert (value_list.size() == points.size(), 
-         ExcDimensionMismatch (value_list.size(), points.size()));
+  Assert (value_list.size() == points.size(),
+          ExcDimensionMismatch (value_list.size(), points.size()));
 
   const unsigned int n_points = points.size();
 
   for (unsigned int p=0; p<n_points; ++p)
     RightHandSide<dim>::vector_value (points[p],
-                                     value_list[p]);
+                                      value_list[p]);
 }
 
 
@@ -158,16 +158,16 @@ void RightHandSide<dim>::vector_value_list (const std::vector<Point<dim> > &poin
 
 template <int dim>
 ElasticProblem<dim>::ElasticProblem ()
-               :
-               dof_handler (triangulation),
-               fe (FE_Q<dim>(1), dim)
+  :
+  dof_handler (triangulation),
+  fe (FE_Q<dim>(1), dim)
 {}
 
 
 
 
 template <int dim>
-ElasticProblem<dim>::~ElasticProblem () 
+ElasticProblem<dim>::~ElasticProblem ()
 {
   dof_handler.clear ();
 }
@@ -180,11 +180,11 @@ void ElasticProblem<dim>::setup_system ()
   dof_handler.distribute_dofs (fe);
   hanging_node_constraints.clear ();
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          hanging_node_constraints);
+                                           hanging_node_constraints);
   hanging_node_constraints.close ();
   sparsity_pattern.reinit (dof_handler.n_dofs(),
-                          dof_handler.n_dofs(),
-                          dof_handler.max_couplings_between_dofs());
+                           dof_handler.n_dofs(),
+                           dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
 
   hanging_node_constraints.condense (sparsity_pattern);
@@ -200,13 +200,13 @@ void ElasticProblem<dim>::setup_system ()
 
 
 template <int dim>
-void ElasticProblem<dim>::assemble_system () 
-{  
+void ElasticProblem<dim>::assemble_system ()
+{
   QGauss<dim>  quadrature_formula (2);
 
-  FEValues<dim> x_fe_values (fe, quadrature_formula, 
-                          update_values   | update_gradients |
-                           update_q_points | update_JxW_values);
+  FEValues<dim> x_fe_values (fe, quadrature_formula,
+                             update_values   | update_gradients |
+                             update_q_points | update_JxW_values);
 
   const unsigned int   dofs_per_cell = fe.dofs_per_cell;
   const unsigned int   n_q_points    = quadrature_formula.size();
@@ -223,11 +223,11 @@ void ElasticProblem<dim>::assemble_system ()
 
   RightHandSide<dim>      right_hand_side;
   std::vector<Vector<double> > rhs_values (n_q_points,
-                                          Vector<double>(dim));
+                                           Vector<double>(dim));
 
 
   typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active(),
-                                                endc = dof_handler.end();
+                                                 endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       cell_matrix = 0;
@@ -235,70 +235,70 @@ void ElasticProblem<dim>::assemble_system ()
 
       x_fe_values.reinit (cell);
       const FEValues<dim> &fe_values = x_fe_values.get_present_fe_values();
-      
+
       lambda.value_list (fe_values.get_quadrature_points(), lambda_values);
       mu.value_list     (fe_values.get_quadrature_points(), mu_values);
 
       right_hand_side.vector_value_list (fe_values.get_quadrature_points(),
-                                        rhs_values);
-      
+                                         rhs_values);
+
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       {
-         const unsigned int 
-           component_i = fe.system_to_component_index(i).first;
-         
-         for (unsigned int j=0; j<dofs_per_cell; ++j) 
-           {
-             const unsigned int 
-               component_j = fe.system_to_component_index(j).first;
-             
-             for (unsigned int q_point=0; q_point<n_q_points;
-                  ++q_point)
-               {
-                 cell_matrix(i,j) 
-                   += 
-                   (
-                     (fe_values.shape_grad(i,q_point)[component_i] *
-                      fe_values.shape_grad(j,q_point)[component_j] *
-                      lambda_values[q_point])
-                     +
-                     (fe_values.shape_grad(i,q_point)[component_j] *
-                      fe_values.shape_grad(j,q_point)[component_i] *
-                      mu_values[q_point])
-                     +
-                     ((component_i == component_j) ?
-                      (fe_values.shape_grad(i,q_point) *
-                       fe_values.shape_grad(j,q_point) *
-                       mu_values[q_point])  :
-                      0)
-                   )
-                   *
-                   fe_values.JxW(q_point);
-               }
-           }
-       }
+        {
+          const unsigned int
+          component_i = fe.system_to_component_index(i).first;
+
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            {
+              const unsigned int
+              component_j = fe.system_to_component_index(j).first;
+
+              for (unsigned int q_point=0; q_point<n_q_points;
+                   ++q_point)
+                {
+                  cell_matrix(i,j)
+                  +=
+                    (
+                      (fe_values.shape_grad(i,q_point)[component_i] *
+                       fe_values.shape_grad(j,q_point)[component_j] *
+                       lambda_values[q_point])
+                      +
+                      (fe_values.shape_grad(i,q_point)[component_j] *
+                       fe_values.shape_grad(j,q_point)[component_i] *
+                       mu_values[q_point])
+                      +
+                      ((component_i == component_j) ?
+                       (fe_values.shape_grad(i,q_point) *
+                        fe_values.shape_grad(j,q_point) *
+                        mu_values[q_point])  :
+                       0)
+                    )
+                    *
+                    fe_values.JxW(q_point);
+                }
+            }
+        }
 
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       {
-         const unsigned int 
-           component_i = fe.system_to_component_index(i).first;
-         
-         for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-           cell_rhs(i) += fe_values.shape_value(i,q_point) *
-                          rhs_values[q_point](component_i) *
-                          fe_values.JxW(q_point);
-       }
+        {
+          const unsigned int
+          component_i = fe.system_to_component_index(i).first;
+
+          for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+            cell_rhs(i) += fe_values.shape_value(i,q_point) *
+                           rhs_values[q_point](component_i) *
+                           fe_values.JxW(q_point);
+        }
 
       cell->get_dof_indices (local_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           system_matrix.add (local_dof_indices[i],
-                              local_dof_indices[j],
-                              cell_matrix(i,j));
-         
-         system_rhs(local_dof_indices[i]) += cell_rhs(i);
-       }
+        {
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            system_matrix.add (local_dof_indices[i],
+                               local_dof_indices[j],
+                               cell_matrix(i,j));
+
+          system_rhs(local_dof_indices[i]) += cell_rhs(i);
+        }
     }
 
   hanging_node_constraints.condense (system_matrix);
@@ -306,20 +306,20 @@ void ElasticProblem<dim>::assemble_system ()
 
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           ZeroFunction<dim>(dim),
-                                           boundary_values);
+                                            0,
+                                            ZeroFunction<dim>(dim),
+                                            boundary_values);
   MatrixTools::apply_boundary_values (boundary_values,
-                                     system_matrix,
-                                     solution,
-                                     system_rhs);
+                                      system_matrix,
+                                      solution,
+                                      system_rhs);
 }
 
 
 
 
 template <int dim>
-void ElasticProblem<dim>::solve () 
+void ElasticProblem<dim>::solve ()
 {
   SolverControl           solver_control (1000, 1e-12);
   SolverCG<>              cg (solver_control);
@@ -328,7 +328,7 @@ void ElasticProblem<dim>::solve ()
   preconditioner.initialize(system_matrix, 1.2);
 
   cg.solve (system_matrix, solution, system_rhs,
-           preconditioner);
+            preconditioner);
 
   hanging_node_constraints.distribute (solution);
 }
@@ -342,14 +342,14 @@ void ElasticProblem<dim>::refine_grid ()
 
   typename FunctionMap<dim>::type neumann_boundary;
   KellyErrorEstimator<dim>::estimate (dof_handler,
-                                     QGauss<dim-1>(2),
-                                     neumann_boundary,
-                                     solution,
-                                     estimated_error_per_cell);
+                                      QGauss<dim-1>(2),
+                                      neumann_boundary,
+                                      solution,
+                                      estimated_error_per_cell);
 
   GridRefinement::refine_and_coarsen_fixed_number (triangulation,
-                                                  estimated_error_per_cell,
-                                                  0.3, 0.03);
+                                                   estimated_error_per_cell,
+                                                   0.3, 0.03);
 
   triangulation.execute_coarsening_and_refinement ();
 }
@@ -362,33 +362,33 @@ void ElasticProblem<dim>::output_results (const unsigned int cycle) const
   std::string filename = "solution-";
   filename += ('0' + cycle);
   Assert (cycle < 10, ExcInternalError());
-  
+
   filename += ".gmv";
 
   DataOut<dim,DoFHandler<dim> > data_out;
   data_out.attach_dof_handler (dof_handler);
 
+
 
   std::vector<std::string> solution_names;
   switch (dim)
     {
-      case 1:
-           solution_names.push_back ("displacement");
-           break;
-      case 2:
-           solution_names.push_back ("x_displacement");            
-           solution_names.push_back ("y_displacement");
-           break;
-      case 3:
-           solution_names.push_back ("x_displacement");            
-           solution_names.push_back ("y_displacement");
-           solution_names.push_back ("z_displacement");
-           break;
-      default:
-           Assert (false, ExcNotImplemented());
+    case 1:
+      solution_names.push_back ("displacement");
+      break;
+    case 2:
+      solution_names.push_back ("x_displacement");
+      solution_names.push_back ("y_displacement");
+      break;
+    case 3:
+      solution_names.push_back ("x_displacement");
+      solution_names.push_back ("y_displacement");
+      solution_names.push_back ("z_displacement");
+      break;
+    default:
+      Assert (false, ExcNotImplemented());
     }
-            
+
   data_out.add_data_vector (solution, solution_names);
   data_out.build_patches ();
   data_out.write_gmv (deallog.get_file_stream());
@@ -398,30 +398,30 @@ void ElasticProblem<dim>::output_results (const unsigned int cycle) const
 
 
 template <int dim>
-void ElasticProblem<dim>::run () 
+void ElasticProblem<dim>::run ()
 {
   for (unsigned int cycle=0; cycle<4; ++cycle)
     {
       deallog << "Cycle " << cycle << ':' << std::endl;
 
       if (cycle == 0)
-       {
-         GridGenerator::hyper_cube (triangulation, -1, 1);
-         triangulation.refine_global (2);
-       }
+        {
+          GridGenerator::hyper_cube (triangulation, -1, 1);
+          triangulation.refine_global (2);
+        }
       else
-       refine_grid ();
+        refine_grid ();
 
       deallog << "   Number of active cells:       "
-               << triangulation.n_active_cells()
-               << std::endl;
+              << triangulation.n_active_cells()
+              << std::endl;
 
       setup_system ();
 
       deallog << "   Number of degrees of freedom: "
-               << dof_handler.n_dofs()
-               << std::endl;
-      
+              << dof_handler.n_dofs()
+              << std::endl;
+
       assemble_system ();
       solve ();
       output_results (cycle);
@@ -429,14 +429,14 @@ void ElasticProblem<dim>::run ()
 }
 
 
-int main () 
+int main ()
 {
   deallog << std::setprecision(2);
   logfile << std::setprecision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   try
     {
@@ -448,25 +448,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     }
 
index 3b3f0f64d2c91277956bfa87a06853fbdeb81fe2..2c883cb6a29b0afbca67c6ad72720653336c37a7 100644 (file)
@@ -47,40 +47,40 @@ void test ()
   GridGenerator::hyper_cube(tria, -1, 1);
   tria.refine_global (2);
 
-                                  // we now have a number of cells,
-                                  // flag them with some subdomain
-                                  // ids based on their position, in
-                                  // particular we take the quadrant
-                                  // (octant)
+  // we now have a number of cells,
+  // flag them with some subdomain
+  // ids based on their position, in
+  // particular we take the quadrant
+  // (octant)
   typename Triangulation<dim>::active_cell_iterator
-    cell = tria.begin_active (),
-    endc = tria.end ();
+  cell = tria.begin_active (),
+  endc = tria.end ();
   for (; cell!=endc; ++cell)
     {
       unsigned int subdomain = 0;
       for (unsigned int d=0; d<dim; ++d)
-       if (cell->center()(d) > 0)
-         subdomain |= (1<<d);
+        if (cell->center()(d) > 0)
+          subdomain |= (1<<d);
       Assert (subdomain < (1<<dim), ExcInternalError());
 
       cell->set_subdomain_id (subdomain);
     };
 
-                                  // distribute some degrees of freedom and
-                                  // output some information on them
+  // distribute some degrees of freedom and
+  // output some information on them
   FESystem<dim> fe(FE_Q<dim>(2),dim, FE_DGQ<dim>(1), 1);
   DoFHandler<dim> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
   deallog << dof_handler.n_dofs() << std::endl;
-  
+
   std::vector<bool> selected_dofs (dof_handler.n_dofs());
   for (unsigned int subdomain=0; subdomain<(1<<dim); ++subdomain)
     {
-                                       // count number on dofs on
-                                       // subdomain. note that they add up to
-                                       // more than n_dofs() since the ones on
-                                       // the interfaces count for each
-                                       // subdomain
+      // count number on dofs on
+      // subdomain. note that they add up to
+      // more than n_dofs() since the ones on
+      // the interfaces count for each
+      // subdomain
       DoFTools::extract_subdomain_dofs (dof_handler, subdomain,
                                         selected_dofs);
       deallog << std::count (selected_dofs.begin(),
@@ -100,6 +100,6 @@ int main ()
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   return 0;
 }
index af263c1f050d8bad4e19c147808745ae77691e6b..8055b9cd9308f37f33963faa51e68dc8636b3277 100644 (file)
@@ -47,53 +47,53 @@ void test ()
   GridGenerator::hyper_cube(tria, -1, 1);
   tria.refine_global (2);
 
-                                  // we now have a number of cells,
-                                  // flag them with some subdomain
-                                  // ids based on their position, in
-                                  // particular we take the quadrant
-                                  // (octant)
+  // we now have a number of cells,
+  // flag them with some subdomain
+  // ids based on their position, in
+  // particular we take the quadrant
+  // (octant)
   typename Triangulation<dim>::active_cell_iterator
-    cell = tria.begin_active (),
-    endc = tria.end ();
+  cell = tria.begin_active (),
+  endc = tria.end ();
   for (; cell!=endc; ++cell)
     {
       unsigned int subdomain = 0;
       for (unsigned int d=0; d<dim; ++d)
-       if (cell->center()(d) > 0)
-         subdomain |= (1<<d);
+        if (cell->center()(d) > 0)
+          subdomain |= (1<<d);
       Assert (subdomain < (1<<dim), ExcInternalError());
 
       cell->set_subdomain_id (subdomain);
     };
 
-                                  // distribute some degrees of freedom and
-                                  // output some information on them
+  // distribute some degrees of freedom and
+  // output some information on them
   FESystem<dim> fe(FE_Q<dim>(2),dim, FE_DGQ<dim>(1), 1);
   DoFHandler<dim> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
   deallog << dof_handler.n_dofs() << std::endl;
-  
+
   std::vector<unsigned int> subdomain_association (dof_handler.n_dofs());
   DoFTools::get_subdomain_association (dof_handler,
                                        subdomain_association);
   for (unsigned int subdomain=0; subdomain<(1<<dim); ++subdomain)
     {
-                                       // count number on dofs on
-                                       // subdomain. this time it should add
-                                       // up, since each dof is uniquely
-                                       // associated
+      // count number on dofs on
+      // subdomain. this time it should add
+      // up, since each dof is uniquely
+      // associated
       deallog << std::count (subdomain_association.begin(),
                              subdomain_association.end(), subdomain)
               << std::endl;
     }
 
-                                   // make sure that all subdomain_ids are
-                                   // really in the allowed range. if this is
-                                   // the case, then we have also proven that
-                                   // the numbers really add up correctly,
-                                   // since every dof is assigned a valid
-                                   // subdomain id
-  for (unsigned int i=0;i<dof_handler.n_dofs(); ++i)
+  // make sure that all subdomain_ids are
+  // really in the allowed range. if this is
+  // the case, then we have also proven that
+  // the numbers really add up correctly,
+  // since every dof is assigned a valid
+  // subdomain id
+  for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
     Assert (subdomain_association[i] < (1<<dim),
             ExcInternalError());
 }
@@ -109,6 +109,6 @@ int main ()
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   return 0;
 }
index fd5b03fb71319980f28af6f06cd73efc0d94159e..424de837b260673ee92ad3bd5bc4b571b58caa0c 100644 (file)
@@ -48,27 +48,27 @@ void test ()
   GridGenerator::hyper_cube(tria, -1, 1);
   tria.refine_global (2);
 
-                                  // we now have a number of cells,
-                                  // flag them with some subdomain
-                                  // ids based on their position, in
-                                  // particular we take the quadrant
-                                  // (octant)
+  // we now have a number of cells,
+  // flag them with some subdomain
+  // ids based on their position, in
+  // particular we take the quadrant
+  // (octant)
   typename Triangulation<dim>::active_cell_iterator
-    cell = tria.begin_active (),
-    endc = tria.end ();
+  cell = tria.begin_active (),
+  endc = tria.end ();
   for (; cell!=endc; ++cell)
     {
       unsigned int subdomain = 0;
       for (unsigned int d=0; d<dim; ++d)
-       if (cell->center()(d) > 0)
-         subdomain |= (1<<d);
+        if (cell->center()(d) > 0)
+          subdomain |= (1<<d);
       Assert (subdomain < (1<<dim), ExcInternalError());
 
       cell->set_subdomain_id (subdomain);
     };
 
-                                  // distribute some degrees of freedom and
-                                  // output some information on them
+  // distribute some degrees of freedom and
+  // output some information on them
   FESystem<dim> fe(FE_Q<dim>(2),dim, FE_DGQ<dim>(1), 1);
   DoFHandler<dim> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
@@ -92,6 +92,6 @@ int main ()
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   return 0;
 }
index 8c9dde340310c96c44f434a565e4fb31f1fcc8fb..03128047b4826bd5c79b12ffd941bbf55ed723bb 100644 (file)
@@ -48,41 +48,41 @@ void test ()
   GridGenerator::hyper_cube(tria, -1, 1);
   tria.refine_global (2);
 
-                                  // we now have a number of cells,
-                                  // flag them with some subdomain
-                                  // ids based on their position, in
-                                  // particular we take the quadrant
-                                  // (octant)
+  // we now have a number of cells,
+  // flag them with some subdomain
+  // ids based on their position, in
+  // particular we take the quadrant
+  // (octant)
   typename Triangulation<dim>::active_cell_iterator
-    cell = tria.begin_active (),
-    endc = tria.end ();
+  cell = tria.begin_active (),
+  endc = tria.end ();
   for (; cell!=endc; ++cell)
     {
       unsigned int subdomain = 0;
       for (unsigned int d=0; d<dim; ++d)
-       if (cell->center()(d) > 0)
-         subdomain |= (1<<d);
+        if (cell->center()(d) > 0)
+          subdomain |= (1<<d);
       Assert (subdomain < (1<<dim), ExcInternalError());
 
       cell->set_subdomain_id (subdomain);
     };
 
-                                  // distribute some degrees of freedom and
-                                  // output some information on them
+  // distribute some degrees of freedom and
+  // output some information on them
   FESystem<dim> fe(FE_Q<dim>(2),dim, FE_DGQ<dim>(1), 1);
   DoFHandler<dim> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
   deallog << dof_handler.n_dofs() << std::endl;
 
-                                   // renumber by subdomain
+  // renumber by subdomain
   DoFRenumbering::subdomain_wise (dof_handler);
 
-                                   // then get the subdomain association of
-                                   // all dofs. this should yield consecutive
-                                   // regions of dofs with increasing
-                                   // subdomain numbers. first output these
-                                   // numbers, then also check that this is
-                                   // indeed so
+  // then get the subdomain association of
+  // all dofs. this should yield consecutive
+  // regions of dofs with increasing
+  // subdomain numbers. first output these
+  // numbers, then also check that this is
+  // indeed so
   std::vector<unsigned int> subdomain_association (dof_handler.n_dofs());
   DoFTools::get_subdomain_association (dof_handler, subdomain_association);
 
@@ -93,8 +93,8 @@ void test ()
   for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
     if (subdomain_association[i] != present_subdomain)
       {
-                                         // we must just have crossed the
-                                         // boundary to another subdomain
+        // we must just have crossed the
+        // boundary to another subdomain
         Assert (subdomain_association[i] == present_subdomain+1,
                 ExcInternalError());
         ++present_subdomain;
@@ -113,6 +113,6 @@ int main ()
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   return 0;
 }
index a0c1e864a66d8fd8ee6733f8ab9b0897c061726c..6e8ef37b3686bc0fa6a07cb9ae4d7cf5aa3019f6 100644 (file)
@@ -47,39 +47,39 @@ void test ()
   GridGenerator::hyper_cube(tria, -1, 1);
   tria.refine_global (2);
 
-                                  // we now have a number of cells,
-                                  // flag them with some subdomain
-                                  // ids based on their position, in
-                                  // particular we take the quadrant
-                                  // (octant)
+  // we now have a number of cells,
+  // flag them with some subdomain
+  // ids based on their position, in
+  // particular we take the quadrant
+  // (octant)
   typename Triangulation<dim>::active_cell_iterator
-    cell = tria.begin_active (),
-    endc = tria.end ();
+  cell = tria.begin_active (),
+  endc = tria.end ();
   for (; cell!=endc; ++cell)
     {
       unsigned int subdomain = 0;
       for (unsigned int d=0; d<dim; ++d)
-       if (cell->center()(d) > 0)
-         subdomain |= (1<<d);
+        if (cell->center()(d) > 0)
+          subdomain |= (1<<d);
       Assert (subdomain < (1<<dim), ExcInternalError());
 
       cell->set_subdomain_id (subdomain);
     };
 
-                                  // distribute some degrees of freedom and
-                                  // output some information on them
+  // distribute some degrees of freedom and
+  // output some information on them
   FESystem<dim> fe(FE_Q<dim>(2),dim, FE_DGQ<dim>(1), 1);
   DoFHandler<dim> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
   deallog << dof_handler.n_dofs() << std::endl;
-  
+
   std::vector<unsigned int> subdomain_association (dof_handler.n_dofs());
   DoFTools::get_subdomain_association (dof_handler,
                                        subdomain_association);
   for (unsigned int subdomain=0; subdomain<(1<<dim); ++subdomain)
-                                     // check that the number of dofs
-                                     // associated is also what the respective
-                                     // function returns
+    // check that the number of dofs
+    // associated is also what the respective
+    // function returns
     Assert (static_cast<unsigned int>
             (std::count (subdomain_association.begin(),
                          subdomain_association.end(), subdomain))
@@ -102,6 +102,6 @@ int main ()
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   return 0;
 }
index 2177aed09962d34ecab49dcf3b28e87adcdf3a34..1a757f25da4c61494ec49222d648819d34ccd983 100644 (file)
@@ -47,20 +47,20 @@ void test ()
   GridGenerator::hyper_cube(tria, -1, 1);
   tria.refine_global (2);
 
-                                  // we now have a number of cells,
-                                  // flag them with some subdomain
-                                  // ids based on their position, in
-                                  // particular we take the quadrant
-                                  // (octant)
+  // we now have a number of cells,
+  // flag them with some subdomain
+  // ids based on their position, in
+  // particular we take the quadrant
+  // (octant)
   typename Triangulation<dim>::active_cell_iterator
-    cell = tria.begin_active (),
-    endc = tria.end ();
+  cell = tria.begin_active (),
+  endc = tria.end ();
   for (; cell!=endc; ++cell)
     {
       unsigned int subdomain = 0;
       for (unsigned int d=0; d<dim; ++d)
-       if (cell->center()(d) > 0)
-         subdomain |= (1<<d);
+        if (cell->center()(d) > 0)
+          subdomain |= (1<<d);
       Assert (subdomain < (1<<dim), ExcInternalError());
 
       cell->set_subdomain_id (subdomain);
@@ -71,9 +71,9 @@ void test ()
                                         subdomain_association);
   for (unsigned int subdomain=0; subdomain<(1<<dim); ++subdomain)
     {
-                                       // check that the number of cells
-                                       // associated is also what the respective
-                                       // function returns
+      // check that the number of cells
+      // associated is also what the respective
+      // function returns
       Assert (static_cast<unsigned int>
               (std::count (subdomain_association.begin(),
                            subdomain_association.end(), subdomain))
@@ -82,14 +82,14 @@ void test ()
                                                                  subdomain),
               ExcInternalError());
 
-                                       // ...and that this is also the correct
-                                       // number
+      // ...and that this is also the correct
+      // number
       Assert (GridTools::count_cells_with_subdomain_association (tria,
                                                                  subdomain)
               == (tria.n_active_cells() / (1<<dim)),
               ExcInternalError());
     }
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -104,6 +104,6 @@ int main ()
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   return 0;
 }
index 3ca5236f0a1eb39c8c83d70d9ad9f5ce22e33b2f..cea67bc4d3be05455f5a8370c5e9761c28fa5641 100644 (file)
@@ -47,27 +47,27 @@ void test ()
   GridGenerator::hyper_cube(tria, -1, 1);
   tria.refine_global (2);
 
-                                  // we now have a number of cells,
-                                  // flag them with some subdomain
-                                  // ids based on their position, in
-                                  // particular we take the quadrant
-                                  // (octant)
+  // we now have a number of cells,
+  // flag them with some subdomain
+  // ids based on their position, in
+  // particular we take the quadrant
+  // (octant)
   typename Triangulation<dim>::active_cell_iterator
-    cell = tria.begin_active (),
-    endc = tria.end ();
+  cell = tria.begin_active (),
+  endc = tria.end ();
   for (; cell!=endc; ++cell)
     {
       unsigned int subdomain = 0;
       for (unsigned int d=0; d<dim; ++d)
-       if (cell->center()(d) > 0)
-         subdomain |= (1<<d);
+        if (cell->center()(d) > 0)
+          subdomain |= (1<<d);
       Assert (subdomain < (1<<dim), ExcInternalError());
 
       cell->set_subdomain_id (subdomain);
     };
 
-                                  // distribute some degrees of freedom and
-                                  // output some information on them
+  // distribute some degrees of freedom and
+  // output some information on them
   FESystem<dim> fe(FE_Q<dim>(2),dim, FE_DGQ<dim>(1), 1);
   DoFHandler<dim> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
@@ -79,18 +79,18 @@ void test ()
   for (unsigned int subdomain=0; subdomain<(1<<dim); ++subdomain)
     {
       const IndexSet index_set
-       = DoFTools::dof_indices_with_subdomain_association (dof_handler,
-                                                           subdomain);
+        = DoFTools::dof_indices_with_subdomain_association (dof_handler,
+                                                            subdomain);
 
       deallog << "Index set is "
-             << (index_set.is_contiguous() ? "" : "not ")
-             << "contiguous."
-             << std::endl;
+              << (index_set.is_contiguous() ? "" : "not ")
+              << "contiguous."
+              << std::endl;
 
       for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
-       if (subdomain_association[i] == subdomain)
-         Assert (index_set.is_element(i) == true,
-                 ExcInternalError());
+        if (subdomain_association[i] == subdomain)
+          Assert (index_set.is_element(i) == true,
+                  ExcInternalError());
     }
 
   deallog << "OK" << std::endl;
index 03a5b2b976a1f28d9cabab6990fa099a4e372945..96093f0526450091f6f963cea548b2aeef55b01b 100644 (file)
@@ -34,75 +34,75 @@ check_this (const FiniteElement<dim> &fe1,
   if (dim == 1)
     return;
 
-                                  // check all combinations of fe1 and fe2
+  // check all combinations of fe1 and fe2
   for (unsigned int subface=0; subface<GeometryInfo<dim>::max_children_per_face; ++subface)
     {
       FullMatrix<double> face_constraints;
       try
-       {
-         face_constraints.reinit (fe1.dofs_per_face,
-                                  fe1.dofs_per_face);
-         fe1.get_subface_interpolation_matrix (fe1, subface, face_constraints);
-
-         deallog << fe1.get_name()
-                 << "  vs.  "
-                 << fe1.get_name()
-                 << std::endl;
-         output_matrix (face_constraints);      
-       }
+        {
+          face_constraints.reinit (fe1.dofs_per_face,
+                                   fe1.dofs_per_face);
+          fe1.get_subface_interpolation_matrix (fe1, subface, face_constraints);
+
+          deallog << fe1.get_name()
+                  << "  vs.  "
+                  << fe1.get_name()
+                  << std::endl;
+          output_matrix (face_constraints);
+        }
       catch (...)
-       {
-       }
+        {
+        }
 
       try
-       {
-         face_constraints.reinit (fe2.dofs_per_face,
-                                  fe2.dofs_per_face);
-         fe2.get_subface_interpolation_matrix (fe2, subface, face_constraints);
-
-         deallog << fe2.get_name()
-                 << "  vs.  "
-                 << fe2.get_name()
-                 << std::endl;
-         output_matrix (face_constraints);      
-       }
+        {
+          face_constraints.reinit (fe2.dofs_per_face,
+                                   fe2.dofs_per_face);
+          fe2.get_subface_interpolation_matrix (fe2, subface, face_constraints);
+
+          deallog << fe2.get_name()
+                  << "  vs.  "
+                  << fe2.get_name()
+                  << std::endl;
+          output_matrix (face_constraints);
+        }
       catch (...)
-       {
-       }
+        {
+        }
 
       if (fe1.dofs_per_face <= fe2.dofs_per_face)
-       try
-         {
-           face_constraints.reinit (fe2.dofs_per_face,
-                                    fe1.dofs_per_face);
-           fe1.get_subface_interpolation_matrix (fe2, subface, face_constraints);
-
-           deallog << fe1.get_name()
-                   << "  vs.  "
-                   << fe2.get_name()
-                   << std::endl;
-           output_matrix (face_constraints);      
-         }
-       catch (...)
-         {
-         }
+        try
+          {
+            face_constraints.reinit (fe2.dofs_per_face,
+                                     fe1.dofs_per_face);
+            fe1.get_subface_interpolation_matrix (fe2, subface, face_constraints);
+
+            deallog << fe1.get_name()
+                    << "  vs.  "
+                    << fe2.get_name()
+                    << std::endl;
+            output_matrix (face_constraints);
+          }
+        catch (...)
+          {
+          }
 
       if (fe2.dofs_per_face <= fe1.dofs_per_face)
-       try
-         {
-           face_constraints.reinit (fe1.dofs_per_face,
-                                    fe2.dofs_per_face);
-           fe2.get_subface_interpolation_matrix (fe1, subface, face_constraints);
-
-           deallog << fe2.get_name()
-                   << "  vs.  "
-                   << fe1.get_name()
-                   << std::endl;
-           output_matrix (face_constraints);      
-         }
-       catch (...)
-         {
-         }
+        try
+          {
+            face_constraints.reinit (fe1.dofs_per_face,
+                                     fe2.dofs_per_face);
+            fe2.get_subface_interpolation_matrix (fe1, subface, face_constraints);
+
+            deallog << fe2.get_name()
+                    << "  vs.  "
+                    << fe1.get_name()
+                    << std::endl;
+            output_matrix (face_constraints);
+          }
+        catch (...)
+          {
+          }
     }
 }
 
index b7139abd6043dc5d34491fec71292f77095f780e..490e93569210f7d2fb5951e9eb7afe91d76ee170 100644 (file)
@@ -32,7 +32,7 @@
 
 
 bool predicate (const Point<3> &p,
-               const double    diameter)
+                const double    diameter)
 {
   return ((p[0]-.2)*(p[0]-.2) + (p[2]-p[1]/4)*(p[2]-p[1]/4) < diameter * diameter);
 }
@@ -53,14 +53,14 @@ int main ()
   tria.refine_global(2);
 
   deallog << "n_cells=" << tria.n_active_cells() << std::endl;
-  
-                                  // build up a map of vertex indices
-                                  // of boundary vertices to the new
-                                  // boundary points
+
+  // build up a map of vertex indices
+  // of boundary vertices to the new
+  // boundary points
   std::map<unsigned int,Point<dim> > new_points;
-  
+
   Triangulation<dim>::active_cell_iterator cell=tria.begin_active(),
-                                          endc=tria.end();
+                                           endc=tria.end();
 
   for (cell=tria.begin_active(); cell!=endc; ++cell)
     if (predicate(cell->center(), cell->diameter()))
@@ -74,8 +74,8 @@ int main ()
     if (!predicate (cell->center(), cell->diameter()))
       cell->set_coarsen_flag ();
 
-                                  // make sure there really are no refinement
-                                  // flags set
+  // make sure there really are no refinement
+  // flags set
   tria.prepare_coarsening_and_refinement();
   for (cell=tria.begin_active(); cell!=endc; ++cell)
     Assert (!cell->refine_flag_set(), ExcInternalError());
@@ -83,6 +83,6 @@ int main ()
   tria.execute_coarsening_and_refinement();
 
   deallog << "n_cells=" << tria.n_active_cells() << std::endl;
-  
+
   return 0;
 }
index 30abfd72cbfb9f1809b8b2d205bd0901c96f873b..7560dd786279287f81c862073659688a013634d5 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "../tests.h"
 #include <deal.II/base/logstream.h>
-#include <deal.II/fe/fe_system.h>              
+#include <deal.II/fe/fe_system.h>
 #include <deal.II/fe/fe_q.h>
 #include <deal.II/fe/fe_dgq.h>
 #include <deal.II/fe/fe_dgp.h>
@@ -31,7 +31,7 @@
 
 
 template <int dim>
-void check_cell1 (const FiniteElement<dim> &fe) 
+void check_cell1 (const FiniteElement<dim> &fe)
 {
   for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
     Assert (fe.get_unit_support_points()[i] ==
@@ -42,7 +42,7 @@ void check_cell1 (const FiniteElement<dim> &fe)
 
 
 template <int dim>
-void check_face1 (const FiniteElement<dim> &fe) 
+void check_face1 (const FiniteElement<dim> &fe)
 {
   for (unsigned int i=0; i<fe.dofs_per_face; ++i)
     Assert (fe.get_unit_face_support_points()[i] ==
@@ -52,13 +52,13 @@ void check_face1 (const FiniteElement<dim> &fe)
 }
 
 
-void check_face1 (const FiniteElement<1> &) 
+void check_face1 (const FiniteElement<1> &)
 {}
 
 
 
 template <int dim>
-void check1 (const FiniteElement<dim> &fe) 
+void check1 (const FiniteElement<dim> &fe)
 {
   check_cell1 (fe);
   check_face1 (fe);
@@ -67,7 +67,7 @@ void check1 (const FiniteElement<dim> &fe)
 
 template <int dim>
 void check_cell2 (const FiniteElement<dim> &fe,
-                  const unsigned int        comp) 
+                  const unsigned int        comp)
 {
   for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
     if (fe.system_to_component_index(i).first == comp)
@@ -79,25 +79,25 @@ void check_cell2 (const FiniteElement<dim> &fe,
 
 template <int dim>
 void check_face2 (const FiniteElement<dim> &fe,
-                  const unsigned int        comp) 
+                  const unsigned int        comp)
 {
-      for (unsigned int i=0; i<fe.dofs_per_face; ++i)
-        if (fe.face_system_to_component_index(i).first == comp)
-          deallog << i << " " << fe.unit_face_support_point(i)
-                  << std::endl;
-      deallog << "dim=" << dim << ", face=ok" << std::endl;
+  for (unsigned int i=0; i<fe.dofs_per_face; ++i)
+    if (fe.face_system_to_component_index(i).first == comp)
+      deallog << i << " " << fe.unit_face_support_point(i)
+              << std::endl;
+  deallog << "dim=" << dim << ", face=ok" << std::endl;
 }
 
 
 void check_face2 (const FiniteElement<1> &,
-                  const unsigned int) 
+                  const unsigned int)
 {}
 
 
 
 template <int dim>
 void check2 (const FiniteElement<dim> &fe,
-             const unsigned int        comp) 
+             const unsigned int        comp)
 {
   check_cell2 (fe, comp);
   check_face2 (fe, comp);
@@ -106,7 +106,7 @@ void check2 (const FiniteElement<dim> &fe,
 
 
 template <int dim>
-void check () 
+void check ()
 {
   check1 (FE_Q<dim>(2));
   check1 (FE_DGQ<dim>(2));
@@ -124,9 +124,9 @@ void check ()
           0);
 }
 
-    
 
-int main () 
+
+int main ()
 {
   std::ofstream logfile("unit_support_points/output");
   deallog.attach(logfile);
index 32ae7e316e64300ea774a14d6c8932e98ed2bd7a..4e83dd2b2ecac254357912e729bc8bab11a2b8fb 100644 (file)
@@ -42,7 +42,7 @@ void check2 (const FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
   const std::vector<Point<dim-1> > unit_f_s_p
-     = fe.get_unit_face_support_points ();
+    = fe.get_unit_face_support_points ();
   for (unsigned int i=0; i<unit_f_s_p.size(); ++i)
     deallog << i << ' ' << unit_f_s_p[i] << std::endl;
 }
index fe80b7ccc6ba24711b23ebee65fcce7408d522bd..e453074887c931a59a9a6a8a669c6429de478cee 100644 (file)
 // check Vector<double>::size()
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 
 
 void test (Vector<double> &v)
 {
-                                   // set only certain elements of the vector
+  // set only certain elements of the vector
   for (unsigned int i=0; i<v.size(); i+=1+i)
     v(i) = i;
 
   v.compress ();
-  
+
   Assert (v.size() == 100, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -39,7 +39,7 @@ void test (Vector<double> &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_11/output");
   deallog.attach(logfile);
@@ -54,25 +54,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 899601c4b43feaa3daf6caa6f47e6a3fa56d9fbc..a8192583916fb7e2130819c5a6087ef720bf693a 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<double>::operator() in set-mode
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -27,9 +27,9 @@
 
 void test (Vector<double> &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -39,20 +39,20 @@ void test (Vector<double> &v)
 
   v.compress ();
 
-                                   // check that they are ok, and this time
-                                   // all of them
+  // check that they are ok, and this time
+  // all of them
   for (unsigned int i=0; i<v.size(); ++i)
     Assert ((((pattern[i] == true) && (v(i) == i))
              ||
              ((pattern[i] == false) && (v(i) == 0))),
-             ExcInternalError());
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_12/output");
   deallog.attach(logfile);
@@ -67,25 +67,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 2e36c0f765e9eee94724fe3472832b3f096ee4bf..5d51e450026126c5a3cb27704b276e2695a4e28f 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<double>::operator() in add-mode
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -27,9 +27,9 @@
 
 void test (Vector<double> &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -39,20 +39,20 @@ void test (Vector<double> &v)
 
   v.compress ();
 
-                                   // check that they are ok, and this time
-                                   // all of them
+  // check that they are ok, and this time
+  // all of them
   for (unsigned int i=0; i<v.size(); ++i)
     Assert ((((pattern[i] == true) && (v(i) == i))
              ||
              ((pattern[i] == false) && (v(i) == 0))),
-             ExcInternalError());
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_13/output");
   deallog.attach(logfile);
@@ -67,25 +67,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 3844f47a1c492541add766436b93ab69689a5d4c..1a0f7397dccea38dc19fae47d47883b9775f20d4 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<double>::operator() in set/add-mode alternatingly
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -27,9 +27,9 @@
 
 void test (Vector<double> &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   bool flag = false;
   for (unsigned int i=0; i<v.size(); i+=1+i)
@@ -39,26 +39,26 @@ void test (Vector<double> &v)
       else
         v(i) = i;
       flag = !flag;
-      
+
       pattern[i] = true;
     }
 
   v.compress ();
 
-                                   // check that they are ok, and this time
-                                   // all of them
+  // check that they are ok, and this time
+  // all of them
   for (unsigned int i=0; i<v.size(); ++i)
     Assert (((pattern[i] == true) && (v(i) == i))
-           ||
-           ((pattern[i] == false) && (v(i) == 0)),
-             ExcInternalError());
+            ||
+            ((pattern[i] == false) && (v(i) == 0)),
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_14/output");
   deallog.attach(logfile);
@@ -73,25 +73,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 94e4ce2478bcc2e56cfb4ea39e2d9d3a89dd3b1e..7df23a9a79c0d9129a0cb597e7a71fb6b8f746a0 100644 (file)
@@ -20,7 +20,7 @@
 // writing to the same elements
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -28,9 +28,9 @@
 
 void test (Vector<double> &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -42,20 +42,20 @@ void test (Vector<double> &v)
 
   v.compress ();
 
-                                   // check that they are ok, and this time
-                                   // all of them
+  // check that they are ok, and this time
+  // all of them
   for (unsigned int i=0; i<v.size(); ++i)
     Assert (((pattern[i] == true) && (v(i) == 2*i))
-           ||
-           ((pattern[i] == false) && (v(i) == 0)),
-           ExcInternalError());
+            ||
+            ((pattern[i] == false) && (v(i) == 0)),
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_15/output");
   deallog.attach(logfile);
@@ -70,25 +70,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index d5f14fa888222f3a9fa7593e8324c87329f602de..f086dcfdeafc2aa0ce9c97220108c138637e5ec9 100644 (file)
@@ -20,7 +20,7 @@
 // writing and overwriting the same elements
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -28,9 +28,9 @@
 
 void test (Vector<double> &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -44,20 +44,20 @@ void test (Vector<double> &v)
 
   v.compress ();
 
-                                   // check that they are ok, and this time
-                                   // all of them
+  // check that they are ok, and this time
+  // all of them
   for (unsigned int i=0; i<v.size(); ++i)
     Assert (((pattern[i] == true) && (v(i) == i))
-           ||
-           ((pattern[i] == false) && (v(i) == 0)),
-           ExcInternalError());
+            ||
+            ((pattern[i] == false) && (v(i) == 0)),
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_16/output");
   deallog.attach(logfile);
@@ -72,25 +72,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index d0a61bd66fb3ceec8e07faad02ec458d5a613504..d92af0ef9eb5dfb22ae36b101bb5fa83125ca311 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<double>::l1_norm()
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -27,7 +27,7 @@
 
 void test (Vector<double> &v)
 {
-                                   // set some elements of the vector
+  // set some elements of the vector
   double norm = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -36,7 +36,7 @@ void test (Vector<double> &v)
     }
   v.compress ();
 
-                                   // then check the norm
+  // then check the norm
   Assert (v.l1_norm() == norm, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -44,7 +44,7 @@ void test (Vector<double> &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_17/output");
   deallog.attach(logfile);
@@ -59,25 +59,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 9da00f7d708366faf2be988eb8bfe096931e3555..39d4f5552988010598a87bfa3a046ec77704e664 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<double>::l2_norm()
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -27,7 +27,7 @@
 
 void test (Vector<double> &v)
 {
-                                   // set some elements of the vector
+  // set some elements of the vector
   double norm = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -36,7 +36,7 @@ void test (Vector<double> &v)
     }
   v.compress ();
 
-                                   // then check the norm
+  // then check the norm
   Assert (std::fabs((v.l2_norm() - std::sqrt(norm))/std::sqrt(norm)) < 1e-14, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -44,7 +44,7 @@ void test (Vector<double> &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_18/output");
   deallog.attach(logfile);
@@ -59,25 +59,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 6e52c410ec861ca4f9b4553442e2f8978fbd7e4a..ce580396857a688d2de33e0dbcdf051b9a329e4b 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<double>::linfty_norm()
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -27,7 +27,7 @@
 
 void test (Vector<double> &v)
 {
-                                   // set some elements of the vector
+  // set some elements of the vector
   double norm = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -36,7 +36,7 @@ void test (Vector<double> &v)
     }
   v.compress ();
 
-                                   // then check the norm
+  // then check the norm
   Assert (v.linfty_norm() == norm, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -44,7 +44,7 @@ void test (Vector<double> &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_19/output");
   deallog.attach(logfile);
@@ -59,25 +59,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index ea0dbf5471c593be2f8582924777df4370404dfd..9f013e1a0f234af234d2057d7b20888d33bd1b4b 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<double>::operator *=
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -27,9 +27,9 @@
 
 void test (Vector<double> &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -38,22 +38,22 @@ void test (Vector<double> &v)
     }
   v.compress ();
 
-                                   // multiply v with 5/4
+  // multiply v with 5/4
   v *= 5./4.;
 
-                                   // check that the entries are ok
+  // check that the entries are ok
   for (unsigned int i=0; i<v.size(); ++i)
     Assert (((pattern[i] == true) && (v(i) == i*5./4.))
-           ||
-           ((pattern[i] == false) && (v(i) == 0)),
-           ExcInternalError());
+            ||
+            ((pattern[i] == false) && (v(i) == 0)),
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_20/output");
   deallog.attach(logfile);
@@ -68,25 +68,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 5842b07ebd8488e45b872e960057b74b7043be27..20aa5d9d049c7ca96b66e12603540c49092fd940 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<double>::operator /=
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -27,9 +27,9 @@
 
 void test (Vector<double> &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -38,22 +38,22 @@ void test (Vector<double> &v)
     }
   v.compress ();
 
-                                   // multiply v with 3/4
+  // multiply v with 3/4
   v /= 4./3.;
 
-                                   // check that the entries are ok
+  // check that the entries are ok
   for (unsigned int i=0; i<v.size(); ++i)
     Assert (((pattern[i] == true) && (v(i) == i*3./4.))
-           ||
-           ((pattern[i] == false) && (v(i) == 0)),
-           ExcInternalError());
+            ||
+            ((pattern[i] == false) && (v(i) == 0)),
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_21/output");
   deallog.attach(logfile);
@@ -68,25 +68,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 1fc9b5607d9e384405c2c5ca79144b065c2cb34e..bbf844a7ef4a95cde75523508f6b4dd6f044368d 100644 (file)
@@ -21,7 +21,7 @@
 // should have been that the factor is != 0...
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -29,9 +29,9 @@
 
 void test (Vector<double> &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -40,22 +40,22 @@ void test (Vector<double> &v)
     }
   v.compress ();
 
-                                   // multiply v with 3/4
+  // multiply v with 3/4
   v /= -4./3.;
 
-                                   // check that the entries are ok
+  // check that the entries are ok
   for (unsigned int i=0; i<v.size(); ++i)
     Assert (((pattern[i] == true) && (v(i)-(-3.*i/4.) == 0))
-           ||
-           ((pattern[i] == false) && (v(i) == 0)),
-           ExcInternalError());
+            ||
+            ((pattern[i] == false) && (v(i) == 0)),
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_21_negative/output");
   deallog.attach(logfile);
@@ -70,25 +70,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 7e4583c202027266799bf2ad26175ccd488cbc32..98af93eba5f4c9c1fcee256da53834223c15fd9c 100644 (file)
@@ -20,7 +20,7 @@
 // orthogonal
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -29,8 +29,8 @@
 void test (Vector<double> &v,
            Vector<double> &w)
 {
-                                   // set only certain elements of each
-                                   // vector, but disjoint sets of elements
+  // set only certain elements of each
+  // vector, but disjoint sets of elements
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = i;
@@ -39,7 +39,7 @@ void test (Vector<double> &v,
   v.compress ();
   w.compress ();
 
-                                   // make sure the scalar product is zero
+  // make sure the scalar product is zero
   Assert (v*w == 0, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -47,7 +47,7 @@ void test (Vector<double> &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_22/output");
   deallog.attach(logfile);
@@ -63,25 +63,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index a23335ce0d7fffd38f6354b792f524e97846621c..c781b83f8834209c588e3a2f5626a8ec1ef13c9b 100644 (file)
@@ -20,7 +20,7 @@
 // not orthogonal
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -29,9 +29,9 @@
 void test (Vector<double> &v,
            Vector<double> &w)
 {
-                                   // set only certain elements of each
-                                   // vector, and record the expected scalar
-                                   // product
+  // set only certain elements of each
+  // vector, and record the expected scalar
+  // product
   double product = 0;
   for (unsigned int i=0; i<v.size(); ++i)
     {
@@ -42,11 +42,11 @@ void test (Vector<double> &v,
           product += i*(i+1);
         }
     }
-  
+
   v.compress ();
   w.compress ();
 
-                                   // make sure the scalar product is zero
+  // make sure the scalar product is zero
   Assert (v*w == product, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -54,7 +54,7 @@ void test (Vector<double> &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_23/output");
   deallog.attach(logfile);
@@ -70,25 +70,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 6e317205ab66c404259257ff14bbacddec2b4bd2..bc98120989a37f0701ce8d98c0c7db60acf42a6d 100644 (file)
@@ -21,7 +21,7 @@
 // may be covered by one of the other tests
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
 
 void test (Vector<double> &v)
 {
-                                   // set some entries of the vector
+  // set some entries of the vector
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = i+1.;
   v.compress ();
 
-                                   // then clear it again and make sure the
-                                   // vector is really empty
+  // then clear it again and make sure the
+  // vector is really empty
   const unsigned int sz = v.size();
   v = 0;
   Assert (v.size() == sz, ExcInternalError());
@@ -47,7 +47,7 @@ void test (Vector<double> &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_24/output");
   deallog.attach(logfile);
@@ -62,25 +62,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index ae0225107c8c58a83121f7f8f28de20f838aca71..b6daa05561cb5207322eb91a69289ec5329bb9e7 100644 (file)
@@ -18,7 +18,7 @@
 // check Vector::operator = (Scalar) with setting to zero
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
 
 void test (Vector<double> &v)
 {
-                                   // set some entries of the vector
+  // set some entries of the vector
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = i+1.;
   v.compress ();
 
-                                   // then clear it again and make sure the
-                                   // vector is really empty
+  // then clear it again and make sure the
+  // vector is really empty
   const unsigned int sz = v.size();
   v = 0;
   Assert (v.size() == sz, ExcInternalError());
@@ -43,7 +43,7 @@ void test (Vector<double> &v)
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_25/output");
   deallog.attach(logfile);
@@ -58,25 +58,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 55bb2934ffa7cfe063cfcc7bbf8a4ac54cbf93c4..77ff9c9e84e05e1e286df55142a9d6fd32decdfb 100644 (file)
@@ -19,7 +19,7 @@
 // nonzero value
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -27,7 +27,7 @@
 
 void test (Vector<double> &v)
 {
-                                   // set some entries of the vector
+  // set some entries of the vector
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = i+1.;
@@ -42,7 +42,7 @@ void test (Vector<double> &v)
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_26/output");
   deallog.attach(logfile);
@@ -57,25 +57,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 829dd00b33fead22bae5b716a469c3733f9ea5a3..5a6a819c2cc16e219c36dbc3956e68512f9f39ef 100644 (file)
 
 
 
-// check Vector<double>::operator = (Vector) 
+// check Vector<double>::operator = (Vector)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
 
 void test (Vector<double> &v)
 {
-                                   // set some entries of the vector
+  // set some entries of the vector
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = i+1.;
   v.compress ();
 
-                                   // then copy it
+  // then copy it
   Vector<double> w (v.size());
   w = v;
 
-                                   // make sure they're equal
-  deallog << v*w << ' ' << v.l2_norm() * w.l2_norm()
-          << ' ' << v*w - v.l2_norm() * w.l2_norm() << std::endl;
+  // make sure they're equal
+  deallog << v *w << ' ' << v.l2_norm() * w.l2_norm()
+          << ' ' << v *w - v.l2_norm() * w.l2_norm() << std::endl;
   Assert (std::fabs(v*w - v.l2_norm() * w.l2_norm()) < 1e-14*(v*w),
           ExcInternalError());
 
@@ -48,7 +48,7 @@ void test (Vector<double> &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_27/output");
   deallog.attach(logfile);
@@ -63,25 +63,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index c7fede967770236a0a616a3428febf255a918295..512e4ded451be6eee908fbcfda30abc0c61718cd 100644 (file)
@@ -20,7 +20,7 @@
 // resize the vector to be copied to beforehand
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
 
 void test (Vector<double> &v)
 {
-                                   // set some entries of the vector
+  // set some entries of the vector
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = i+1.;
   v.compress ();
 
-                                   // then copy it to a vector of different
-                                   // size
+  // then copy it to a vector of different
+  // size
   Vector<double> w (1);
   w = v;
 
-                                   // make sure they're equal
-  deallog << v*w << ' ' << v.l2_norm() * w.l2_norm()
-          << ' ' << v*w - v.l2_norm() * w.l2_norm() << std::endl;
+  // make sure they're equal
+  deallog << v *w << ' ' << v.l2_norm() * w.l2_norm()
+          << ' ' << v *w - v.l2_norm() * w.l2_norm() << std::endl;
   Assert (std::fabs(v*w - v.l2_norm() * w.l2_norm()) < 1e-14*(v*w),
           ExcInternalError());
 
@@ -50,7 +50,7 @@ void test (Vector<double> &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_28/output");
   deallog.attach(logfile);
@@ -65,25 +65,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 01d9c9affa1ede6ebd7722696a784f34e2ad0f0e..83b31ae90c4df1d64a6bccad0b00d0515fe33bb4 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<double>::reinit(fast)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -28,7 +28,7 @@
 void test (Vector<double> &v)
 {
   v.reinit (13, true);
-  
+
   Assert (v.size() == 13, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -36,7 +36,7 @@ void test (Vector<double> &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_29/output");
   deallog.attach(logfile);
@@ -51,25 +51,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index fdae91eb9f063460ac6819e813e603687e287ce0..2122ed39953d71ea8892321e65ff74eca957ce94 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<double>::reinit(!fast)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
 
 void test (Vector<double> &v)
 {
-                                   // set some entries of the vector
+  // set some entries of the vector
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = i+1.;
   v.compress ();
 
-                                   // then resize with setting to zero
+  // then resize with setting to zero
   v.reinit (13, false);
-  
+
   Assert (v.size() == 13, ExcInternalError());
   Assert (v.l2_norm() == 0, ExcInternalError());
 
@@ -44,7 +44,7 @@ void test (Vector<double> &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_30/output");
   deallog.attach(logfile);
@@ -59,25 +59,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 0667f1c7e69cc8baf86102d459a81a4fb729a655..ad5972c9bbd06244f8db308827fad1fa8def1b73 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<double>::l2_norm()
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -27,7 +27,7 @@
 
 void test (Vector<double> &v)
 {
-                                   // set some elements of the vector
+  // set some elements of the vector
   double norm = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -36,7 +36,7 @@ void test (Vector<double> &v)
     }
   v.compress ();
 
-                                   // then check the norm
+  // then check the norm
   Assert (std::fabs(v.norm_sqr() - norm) < 1e-14*norm,
           ExcInternalError());
 
@@ -45,7 +45,7 @@ void test (Vector<double> &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_31/output");
   deallog.attach(logfile);
@@ -60,25 +60,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index e16163418964d15acdda29cae78caa32d50a88d8..826fd8a664f95294b45d778df2343bc37f406b46 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<double>::mean_value()
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -27,7 +27,7 @@
 
 void test (Vector<double> &v)
 {
-                                   // set some elements of the vector
+  // set some elements of the vector
   double sum = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -36,7 +36,7 @@ void test (Vector<double> &v)
     }
   v.compress ();
 
-                                   // then check the norm
+  // then check the norm
   Assert (std::fabs(v.mean_value() - sum/v.size()) < 1e-14*sum/v.size(),
           ExcInternalError());
 
@@ -45,7 +45,7 @@ void test (Vector<double> &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_32/output");
   deallog.attach(logfile);
@@ -60,25 +60,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index a4602d347b6aa0172e2c5410a16d67f5b0b171f0..1ac266f297caab27076c41aedcdf6f162801147f 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<double>::lp_norm(3)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -27,7 +27,7 @@
 
 void test (Vector<double> &v)
 {
-                                   // set some elements of the vector
+  // set some elements of the vector
   double sum = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -36,7 +36,7 @@ void test (Vector<double> &v)
     }
   v.compress ();
 
-                                   // then check the norm
+  // then check the norm
   Assert (std::fabs(v.lp_norm(3) - std::pow(sum, 1./3.)) <
           1e-14*std::pow(sum, 1./3.),
           ExcInternalError());
@@ -46,7 +46,7 @@ void test (Vector<double> &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_33/output");
   deallog.attach(logfile);
@@ -61,25 +61,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 0d854e738f1673a35c83b69f100fed6ee3808923..cd87e634492e10b5e8762fb00908171fd2e2f8c2 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<double>::all_zero
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -27,7 +27,7 @@
 
 void test (Vector<double> &v)
 {
-                                   // set some elements of the vector
+  // set some elements of the vector
   double sum = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -36,10 +36,10 @@ void test (Vector<double> &v)
     }
   v.compress ();
 
-                                   // set them to zero again
+  // set them to zero again
   v = 0;
 
-                                   // then check all_zero
+  // then check all_zero
   Assert (v.all_zero() == true, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -47,7 +47,7 @@ void test (Vector<double> &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_34/output");
   deallog.attach(logfile);
@@ -62,25 +62,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 99311d30698630aa09222ec083307a699501d185..cc2f06176e9d9f20e23b81e40023bff6b787c4fd 100644 (file)
 
 
 
-// check Vector<double>::operator+=(Vector) 
+// check Vector<double>::operator+=(Vector)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
 void test (Vector<double> &v,
            Vector<double> &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       if (i%3 == 0)
         w(i) = i+1.;
     }
-  
+
   v.compress ();
   w.compress ();
 
   v += w;
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       if (i%3 == 0)
@@ -63,7 +63,7 @@ void test (Vector<double> &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_35/output");
   deallog.attach(logfile);
@@ -79,25 +79,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index d275ee0bdeacdc57538a88a001dc84d0e388ad62..d63b8a34a6b3a7a1ea9ddfce28fe5e2e58c86a08 100644 (file)
 
 
 
-// check Vector<double>::operator-=(Vector) 
+// check Vector<double>::operator-=(Vector)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
 void test (Vector<double> &v,
            Vector<double> &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       if (i%3 == 0)
         w(i) = i+1.;
     }
-  
+
   v.compress ();
   w.compress ();
 
   v -= w;
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       if (i%3 == 0)
@@ -63,7 +63,7 @@ void test (Vector<double> &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_36/output");
   deallog.attach(logfile);
@@ -79,25 +79,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 8cdb3ef74950efb9fa9310367dbc26b264913be0..5e6bc0825251d8a7832784dd1d64dde381d25d34 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<double>::add (scalar)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -29,12 +29,12 @@ void test (Vector<double> &v)
 {
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
-  
+
   v.compress ();
 
   v.add (1.);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     Assert (v(i) == i+1., ExcInternalError());
 
@@ -43,7 +43,7 @@ void test (Vector<double> &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_37/output");
   deallog.attach(logfile);
@@ -58,25 +58,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 6ea4ef6a6ab2dddad9f51cfd91c8e13ca41c9c91..0a327b5315c63943f4a34905b10709852cf21b45 100644 (file)
 
 
 
-// check Vector<double>::add(Vector) 
+// check Vector<double>::add(Vector)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -33,13 +33,13 @@ void test (Vector<double> &v,
       v(i) = i;
       w(i) = i+1.;
     }
-  
+
   v.compress ();
   w.compress ();
 
   v.add (w);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -51,7 +51,7 @@ void test (Vector<double> &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_38/output");
   deallog.attach(logfile);
@@ -67,25 +67,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 72ec18a981bfa209bbfe2f54d5a8b97c890d350e..a0934f45caf32487b8e88d7d13ec5aba1a4f1a43 100644 (file)
 
 
 
-// check Vector<double>::add(scalar, Vector) 
+// check Vector<double>::add(scalar, Vector)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -33,13 +33,13 @@ void test (Vector<double> &v,
       v(i) = i;
       w(i) = i+1.;
     }
-  
+
   v.compress ();
   w.compress ();
 
   v.add (2, w);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -51,7 +51,7 @@ void test (Vector<double> &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_39/output");
   deallog.attach(logfile);
@@ -67,25 +67,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index be693d0fc2e98f91b467bf771d0ce0d140ebbe3d..ee270a1731edf5d92971aaa4520004f18c2f726f 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<double>::add(s,V,s,V)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -35,14 +35,14 @@ void test (Vector<double> &v,
       w(i) = i+1.;
       x(i) = i+2.;
     }
-  
+
   v.compress ();
   w.compress ();
   x.compress ();
 
   v.add (2, w, 3, x);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -55,7 +55,7 @@ void test (Vector<double> &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_40/output");
   deallog.attach(logfile);
@@ -72,25 +72,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index a1330412ffba15387bdf5071cfa1783a45de2d54..fda226953dfcb029ebcb72aba05ec5e63cd6f3a5 100644 (file)
 
 
 
-// check Vector<double>::sadd(s, Vector) 
+// check Vector<double>::sadd(s, Vector)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -33,13 +33,13 @@ void test (Vector<double> &v,
       v(i) = i;
       w(i) = i+1.;
     }
-  
+
   v.compress ();
   w.compress ();
 
   v.sadd (2, w);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -51,7 +51,7 @@ void test (Vector<double> &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_41/output");
   deallog.attach(logfile);
@@ -67,25 +67,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index de8d9718c4f936cd98a39d77126116395997665d..74b3851729cdf2cc35597bca5e1e030c4efa0673 100644 (file)
 
 
 
-// check Vector<double>::sadd(scalar, scalar, Vector) 
+// check Vector<double>::sadd(scalar, scalar, Vector)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -33,13 +33,13 @@ void test (Vector<double> &v,
       v(i) = i;
       w(i) = i+1.;
     }
-  
+
   v.compress ();
   w.compress ();
 
   v.sadd (3, 2, w);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -51,7 +51,7 @@ void test (Vector<double> &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_42/output");
   deallog.attach(logfile);
@@ -67,25 +67,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index d8c5737177c50792b4de67c66a862debb2f69e61..b72354a4ac5578dd20111deddf0963739c03839b 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<double>::sadd(s,s,V,s,V)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -35,14 +35,14 @@ void test (Vector<double> &v,
       w(i) = i+1.;
       x(i) = i+2.;
     }
-  
+
   v.compress ();
   w.compress ();
   x.compress ();
 
   v.sadd (1.5, 2, w, 3, x);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -55,7 +55,7 @@ void test (Vector<double> &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_43/output");
   deallog.attach(logfile);
@@ -72,25 +72,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 91a5028d89e0f7e449fec725152d8b8ca2de7d10..cc6ef26c077af3a6c13c90aec7f77cb2676b365c 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<double>::sadd(s,s,V,s,V,s,V)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -37,7 +37,7 @@ void test (Vector<double> &v,
       x(i) = i+2.;
       y(i) = i+3.;
     }
-  
+
   v.compress ();
   w.compress ();
   x.compress ();
@@ -45,7 +45,7 @@ void test (Vector<double> &v,
 
   v.sadd (1.5, 2, w, 3, x, 4, y);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -59,7 +59,7 @@ void test (Vector<double> &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_44/output");
   deallog.attach(logfile);
@@ -77,25 +77,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 19584ff0b52c6a0228513a073c8dc42eb5882c9f..f89cce9f26aa529a39fdf75ef7bc94e1d5a318bc 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<double>::scale
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -33,13 +33,13 @@ void test (Vector<double> &v,
       v(i) = i;
       w(i) = i+1.;
     }
-  
+
   v.compress ();
   w.compress ();
 
   v.scale (w);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -51,7 +51,7 @@ void test (Vector<double> &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_45/output");
   deallog.attach(logfile);
@@ -67,25 +67,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 23a3207c457450f1ce6a746076fd4d959c80b33e..a5a56cd99c9f06f041dbcbbc5a5d690b1b77bd83 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<double>::equ (s,V)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -33,13 +33,13 @@ void test (Vector<double> &v,
       v(i) = i;
       w(i) = i+1.;
     }
-  
+
   v.compress ();
   w.compress ();
 
   v.equ (2, w);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -51,7 +51,7 @@ void test (Vector<double> &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_46/output");
   deallog.attach(logfile);
@@ -67,25 +67,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 52da500395f6c4ae71a34408be852ef0e1cbe83f..9c40a4055bdae3f919d318d650473b2fb7ed3eac 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<double>::equ (s,V,s,V)
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -35,14 +35,14 @@ void test (Vector<double> &v,
       w(i) = i+1.;
       x(i) = i+2.;
     }
-  
+
   v.compress ();
   w.compress ();
   x.compress ();
 
   v.equ (2, w, 3, x);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -55,7 +55,7 @@ void test (Vector<double> &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_47/output");
   deallog.attach(logfile);
@@ -72,25 +72,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index ad192e4f44d6d84f4f95eb6af6f7c0ca12f938b5..8a5bf8b693cb26f8cbfed73f9a9816526b0d8489 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector<double>::ratio
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -35,14 +35,14 @@ void test (Vector<double> &v,
       w(i) = i+1.;
       x(i) = i+2.;
     }
-  
+
   v.compress ();
   w.compress ();
   x.compress ();
 
   v.ratio (w, x);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -56,7 +56,7 @@ void test (Vector<double> &v,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_48/output");
   deallog.attach(logfile);
@@ -73,25 +73,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 4af8fda0eb50f7095a3d595dd17f79fcf1cc3340..627c77cd7edb0f3df89b2bb16b3b0872380d910c 100644 (file)
@@ -20,7 +20,7 @@
 // argument
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
 
 void test (Vector<double> &v)
 {
-                                   // set some entries of the vector
+  // set some entries of the vector
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = i+1.;
   v.compress ();
 
-                                   // then copy it
+  // then copy it
   Vector<double> w (v);
 
-                                   // make sure they're equal
-  deallog << v*w << ' ' << v.l2_norm() * w.l2_norm()
-          << ' ' << v*w - v.l2_norm() * w.l2_norm() << std::endl;
+  // make sure they're equal
+  deallog << v *w << ' ' << v.l2_norm() * w.l2_norm()
+          << ' ' << v *w - v.l2_norm() * w.l2_norm() << std::endl;
   Assert (std::fabs(v*w - v.l2_norm() * w.l2_norm()) < 1e-14*(v*w),
           ExcInternalError());
 
@@ -48,7 +48,7 @@ void test (Vector<double> &v)
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_49/output");
   deallog.attach(logfile);
@@ -63,25 +63,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 684c6c3dce463e6bd44ce2588b10b4c337ce898a..fe1e27a259be2bd3e8836ac6b6a5878582c3ada6 100644 (file)
@@ -19,7 +19,7 @@
 // check Vector::is_non_zero
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -27,8 +27,8 @@
 
 void test (Vector<double> &v)
 {
-                                   // set only certain elements of the
-                                   // vector. they are all positive
+  // set only certain elements of the
+  // vector. they are all positive
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -38,14 +38,14 @@ void test (Vector<double> &v)
 
   v.compress ();
 
-                                   // check that the vector is really
-                                   // non-negative
+  // check that the vector is really
+  // non-negative
   Assert (v.is_non_negative() == true, ExcInternalError());
 
-                                   // then set a single element to a negative
-                                   // value and check again
+  // then set a single element to a negative
+  // value and check again
   v(v.size()/2) = -1;
-  Assert (v.is_non_negative() == false, ExcInternalError());  
+  Assert (v.is_non_negative() == false, ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
@@ -67,25 +67,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 5e6cdb2f95a83fa0df50f15f28c9de3436d18232..3055841898046e9d403f73cb533bcfe04940ddf5 100644 (file)
@@ -20,7 +20,7 @@
 // equal
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -29,8 +29,8 @@
 void test (Vector<double> &v,
            Vector<double> &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
@@ -61,25 +61,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index b1eaa19703281a6fe66d5256021478d2e9578716..0b7254be97a656c1feeee64a2184617544282a08 100644 (file)
@@ -20,7 +20,7 @@
 // equal
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
 void test (Vector<double> &v,
            Vector<double> &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       if (i%3 == 0)
         w(i) = i+1.;
     }
-                                   // but then copy elements and make sure the
-                                   // vectors are actually equal
+  // but then copy elements and make sure the
+  // vectors are actually equal
   v = w;
   Assert (v==w, ExcInternalError());
 
@@ -63,25 +63,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 969634da6720791c5e2f4ec8f6555410b7a5e67d..5da8d2a33d683b5d0f106f8163558831ff6063ea 100644 (file)
@@ -20,7 +20,7 @@
 // equal
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -29,8 +29,8 @@
 void test (Vector<double> &v,
            Vector<double> &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
@@ -61,25 +61,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index b68609aea68155fb18aa09a116e7db5f8106f024..adbf202004677b266ac97b93515da05df099416f 100644 (file)
@@ -20,7 +20,7 @@
 // equal
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
 void test (Vector<double> &v,
            Vector<double> &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       if (i%3 == 0)
         w(i) = i+1.;
     }
-                                   // but then copy elements and make sure the
-                                   // vectors are actually equal
+  // but then copy elements and make sure the
+  // vectors are actually equal
   v = w;
   Assert (! (v.operator != (w)), ExcInternalError());
 
@@ -63,25 +63,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index bdf0ec22b33438daefabfbc3b14765e7a88da026..29e087f9d2595f7ca1669dc0ebbd5ee3bf6af6f3 100644 (file)
@@ -20,7 +20,7 @@
 // equal and different template arguments
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -29,8 +29,8 @@
 void test (Vector<double> &v,
            Vector<float> &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
@@ -62,25 +62,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index f4248b3c21851640f7209caef90a880f01c79496..9df1dcf1db9dd208d9a932f328cf86cc654d4059 100644 (file)
@@ -20,7 +20,7 @@
 // equal and different template arguments
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
 void test (Vector<double> &v,
            Vector<float> &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       if (i%3 == 0)
         w(i) = i+1.;
     }
-                                   // but then copy elements and make sure the
-                                   // vectors are actually equal
+  // but then copy elements and make sure the
+  // vectors are actually equal
   v = w;
   Assert (v==w, ExcInternalError());
   Assert (w==v, ExcInternalError());
@@ -64,25 +64,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index c03958a7f4db9ec56e270a1e83892f7d3e031c0b..d8a94bc40bcaba3022f7be18c38940196910a191 100644 (file)
@@ -20,7 +20,7 @@
 // equal and different template arguments
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
@@ -29,8 +29,8 @@
 void test (Vector<double> &v,
            Vector<float> &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
@@ -62,25 +62,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index a9c5a74f7321799229d1dea7c5827574fa2d7a5a..97d69763ba87a36f54e8d5fc7bbec8e714d2a067 100644 (file)
@@ -20,7 +20,7 @@
 // equal and different template arguments
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 #include <vector>
 void test (Vector<double> &v,
            Vector<float> &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       if (i%3 == 0)
         w(i) = i+1.;
     }
-                                   // but then copy elements and make sure the
-                                   // vectors are actually equal
+  // but then copy elements and make sure the
+  // vectors are actually equal
   v = w;
   Assert (! (v!=w), ExcInternalError());
   Assert (! (w!=v), ExcInternalError());
@@ -64,25 +64,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index bde6f1588c2400678814579c370704c5cd4b59e5..29040e09db2e102bdf71949943f27a5a16be8f9f 100644 (file)
@@ -22,7 +22,7 @@
 // now autoconf'ed.
 
 #include "../tests.h"
-#include <deal.II/lac/vector.h>    
+#include <deal.II/lac/vector.h>
 #include <fstream>
 #include <iomanip>
 
@@ -34,13 +34,13 @@ void test (Vector<double> &v)
   Vector<float> w(v);
 
   Assert (w==v, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("vector_vector_01/output");
   deallog.attach(logfile);
@@ -55,25 +55,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 7428d6fed7d094f1d11eb611be6cec534df2a49a..e4c2377dae96a522dcc24bcb0d878b11d9b74cfc 100644 (file)
@@ -43,7 +43,7 @@ void check (const Triangulation<dim> &tria)
   dof_handler.distribute_dofs (fe);
 
   QGauss<dim-1> q_face(3);
-  
+
   FEFaceValues<dim>    fe_face_values (fe, q_face,
                                        update_normal_vectors |
                                        update_q_points |
@@ -55,14 +55,14 @@ void check (const Triangulation<dim> &tria)
 
   double v1=0, v2=0;
   for (typename DoFHandler<dim>::active_cell_iterator
-         cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell!=dof_handler.end(); ++cell)
     {
 
-                                       // first integrate over faces
-                                       // and make sure that the
-                                       // result of the integration is
-                                       // close to zero
+      // first integrate over faces
+      // and make sure that the
+      // result of the integration is
+      // close to zero
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
         if (cell->at_boundary(f))
           {
@@ -73,8 +73,8 @@ void check (const Triangulation<dim> &tria)
                     fe_face_values.JxW(q);
           }
 
-                                       // now same for subface
-                                       // integration
+      // now same for subface
+      // integration
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
         if (cell->at_boundary(f))
           for (unsigned int sf=0; sf<GeometryInfo<dim>::max_children_per_face; ++sf)
@@ -97,39 +97,39 @@ void check (const Triangulation<dim> &tria)
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("volume_1/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<2> coarse_grid;
     GridGenerator::hyper_cube (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_cube (coarse_grid);
     check (coarse_grid);
   }
 
-  
-  {  
+
+  {
     Triangulation<2> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     check (coarse_grid);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     check (coarse_grid);
   }
-  
+
 }
 
-  
-  
+
+
index c1c1fcd8bc9ac998fea301532cd17061721826cc..152b992750cbbfe671a4df657e4793ff1b855006 100644 (file)
@@ -53,7 +53,7 @@ void check (const Triangulation<dim> &tria,
   dof_handler.distribute_dofs (fe);
 
   QGauss<dim-1> q_face(3);
-  
+
   FEFaceValues<dim>    fe_face_values (mapping, fe, q_face,
                                        update_normal_vectors |
                                        update_q_points |
@@ -65,14 +65,14 @@ void check (const Triangulation<dim> &tria,
 
   double v1=0, v2=0;
   for (typename DoFHandler<dim>::active_cell_iterator
-         cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell!=dof_handler.end(); ++cell)
     {
 
-                                       // first integrate over faces
-                                       // and make sure that the
-                                       // result of the integration is
-                                       // close to zero
+      // first integrate over faces
+      // and make sure that the
+      // result of the integration is
+      // close to zero
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
         if (cell->at_boundary(f))
           {
@@ -83,8 +83,8 @@ void check (const Triangulation<dim> &tria,
                     fe_face_values.JxW(q);
           }
 
-                                       // now same for subface
-                                       // integration
+      // now same for subface
+      // integration
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
         if (cell->at_boundary(f))
           for (unsigned int sf=0; sf<GeometryInfo<dim>::max_children_per_face; ++sf)
@@ -107,14 +107,14 @@ void check (const Triangulation<dim> &tria,
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("volume_2/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<2> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     static const HyperBallBoundary<2> boundary;
@@ -123,8 +123,8 @@ int main ()
     check (coarse_grid, 2);
     check (coarse_grid, 4);
   }
-  
-  {  
+
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     static const HyperBallBoundary<3> boundary;
@@ -133,8 +133,8 @@ int main ()
     check (coarse_grid, 2);
     check (coarse_grid, 3);
   }
-  
+
 }
 
-  
-  
+
+
index 7ce5a082c933b14986c6a506b8c07083d77e7c70..fc574422eb48533698b471e78ab66952f04f3f95 100644 (file)
@@ -49,7 +49,7 @@ void check (const Triangulation<dim> &tria)
   dof_handler.distribute_dofs (fe);
 
   QGauss<dim-1> q_face(3);
-  
+
   FEFaceValues<dim>    fe_face_values (mapping, fe, q_face,
                                        update_normal_vectors |
                                        update_q_points |
@@ -61,14 +61,14 @@ void check (const Triangulation<dim> &tria)
 
   double v1=0, v2=0;
   for (typename DoFHandler<dim>::active_cell_iterator
-         cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell!=dof_handler.end(); ++cell)
     {
 
-                                       // first integrate over faces
-                                       // and make sure that the
-                                       // result of the integration is
-                                       // close to zero
+      // first integrate over faces
+      // and make sure that the
+      // result of the integration is
+      // close to zero
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
         if (cell->at_boundary(f))
           {
@@ -79,8 +79,8 @@ void check (const Triangulation<dim> &tria)
                     fe_face_values.JxW(q);
           }
 
-                                       // now same for subface
-                                       // integration
+      // now same for subface
+      // integration
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
         if (cell->at_boundary(f))
           for (unsigned int sf=0; sf<GeometryInfo<dim>::max_children_per_face; ++sf)
@@ -103,14 +103,14 @@ void check (const Triangulation<dim> &tria)
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("volume_3/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<2> coarse_grid;
     GridGenerator::hyper_ball (coarse_grid);
     static const HyperBallBoundary<2> boundary;
@@ -118,16 +118,16 @@ int main ()
     check (coarse_grid);
   }
 
-                                   // the C1 mapping is not fully
-                                   // implemented in 3d, unfortunately
-//   {  
+  // the C1 mapping is not fully
+  // implemented in 3d, unfortunately
+//   {
 //     Triangulation<3> coarse_grid;
 //     GridGenerator::hyper_ball (coarse_grid);
 //     static const HyperBallBoundary<3> boundary;
 //     coarse_grid.set_boundary (0, boundary);
 //     check (coarse_grid);
-//   }  
+//   }
 }
 
-  
-  
+
+
index f0fc970f6da5eee610d71a392e64139df9bd48e4..9df59ba9c9abf789442d2c72c88176bed067dba3 100644 (file)
@@ -49,7 +49,7 @@ void check (const Triangulation<dim> &tria)
   dof_handler.distribute_dofs (fe);
 
   QGauss<dim-1> q_face(3);
-  
+
   FEFaceValues<dim>    fe_face_values (mapping, fe, q_face,
                                        update_normal_vectors |
                                        update_q_points |
@@ -61,14 +61,14 @@ void check (const Triangulation<dim> &tria)
 
   double v1=0, v2=0;
   for (typename DoFHandler<dim>::active_cell_iterator
-         cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell!=dof_handler.end(); ++cell)
     {
 
-                                       // first integrate over faces
-                                       // and make sure that the
-                                       // result of the integration is
-                                       // close to zero
+      // first integrate over faces
+      // and make sure that the
+      // result of the integration is
+      // close to zero
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
         if (cell->at_boundary(f))
           {
@@ -79,8 +79,8 @@ void check (const Triangulation<dim> &tria)
                     fe_face_values.JxW(q);
           }
 
-                                       // now same for subface
-                                       // integration
+      // now same for subface
+      // integration
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
         if (cell->at_boundary(f))
           for (unsigned int sf=0; sf<GeometryInfo<dim>::max_children_per_face; ++sf)
@@ -103,25 +103,25 @@ void check (const Triangulation<dim> &tria)
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("volume_4/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  {  
+  {
     Triangulation<2> coarse_grid;
     GridGenerator::hyper_cube (coarse_grid);
     check (coarse_grid);
   }
 
-  {  
+  {
     Triangulation<3> coarse_grid;
     GridGenerator::hyper_cube (coarse_grid);
     check (coarse_grid);
-  }  
+  }
 }
 
-  
-  
+
+
index a29621b3e1aeb1380b1bb935fb3cf3977cd078be..bca014b1f2ed2dd900db87a5b7d3bdbc7549e01a 100644 (file)
 std::ofstream logfile("bem/output");
 
 template<int spacedim>
-class BEM {
+class BEM
+{
 
 public:
 
-    BEM();
-    
-    void run();
+  BEM();
+
+  void run();
 
 private:
 
-    void make_dofs();
-    void assemble_system();
-    void solve();
-    void output_results();
+  void make_dofs();
+  void assemble_system();
+  void solve();
+  void output_results();
+
+  void read_grid(std::string filename);
+  void write_grid(std::string filename);
+
 
-    void read_grid(std::string filename);
-    void write_grid(std::string filename);
+  Triangulation<spacedim-1,spacedim>    tria;
+  FE_DGQ<spacedim-1, spacedim>          fe;
+  DoFHandler<spacedim-1, spacedim>      dof_handler;
 
+  // finite elements used to smoothen
+  // the solution (from piecewise
+  // constant to continuous piecewise
+  // quadratic)
+  FE_Q<spacedim-1, spacedim>            fe_q;
+  DoFHandler<spacedim-1, spacedim>      dof_handler_q;
 
-    Triangulation<spacedim-1,spacedim>    tria;
-    FE_DGQ<spacedim-1, spacedim>          fe;
-    DoFHandler<spacedim-1, spacedim>      dof_handler;
+  FullMatrix<double>                    system_matrix;
 
-                               // finite elements used to smoothen
-                               // the solution (from piecewise
-                               // constant to continuous piecewise
-                               // quadratic)
-    FE_Q<spacedim-1, spacedim>            fe_q;
-    DoFHandler<spacedim-1, spacedim>      dof_handler_q;
+  Vector<double>                        solution,
+         smooth_solution,
+         system_rhs,
+         tangential_derivative,
+         tangential_velocity,
+         error;
 
-    FullMatrix<double>                    system_matrix;
-    Vector<double>                        solution,
-                                         smooth_solution,
-                                          system_rhs,
-                                          tangential_derivative,
-                                          tangential_velocity,
-                                         error;
+  Point<spacedim>                       velocity;
 
-    Point<spacedim>                       velocity;
 
-                  
 
 };
 
 template <int spacedim>
 BEM<spacedim>::BEM()
-    :
-    fe(0),
-    dof_handler(tria),
-    fe_q(1),
-    dof_handler_q(tria)
+  :
+  fe(0),
+  dof_handler(tria),
+  fe_q(1),
+  dof_handler_q(tria)
 {
-    velocity[0] = 1.;
+  velocity[0] = 1.;
 }
 
 template <int spacedim>
 void
-BEM<spacedim>::run() 
+BEM<spacedim>::run()
 {
-    deallog.attach(logfile);
-    deallog.depth_console(0);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
 
-    ConvergenceTable table;
+  ConvergenceTable table;
 
-    if (spacedim == 2)
+  if (spacedim == 2)
     {
 
 
-       read_grid("grids/circle_R10.inp");
-
-       Point<spacedim> p;
-       HyperBallBoundary<spacedim-1, spacedim> boundary(p,10.);
-       tria.set_boundary(1, boundary);
-
-       // works up to cycle<9, but for testin purpose, we stop at 4
-       for(unsigned int cycle=0; cycle<4; ++cycle) 
-       {
-
-           tria.set_boundary(1, boundary);
-           tria.refine_global(1);
-
-           double side_length  = 
-               tria.begin_active()->vertex(0).norm()  // CIRCLE RADIUS
-               *2*sin( numbers::PI / tria.n_active_cells() ),
-               global_error = 0.;
-
-           table.add_value("cycle", cycle);
-           table.add_value("cells", tria.n_active_cells());
-
-           make_dofs();
-           assemble_system();
-           solve();
-           output_results();
-           
-           tria.set_boundary(1);
-       
-
-//     std::cout
-//         << "solution"
-//         << std::endl;
-//     for(unsigned int i=0; i<dof_handler.n_dofs(); ++i)
-//         std::cout
-//             << i<< " - "
-//             <<solution(i)<< std::endl;
-      
-//     std::cout
-//         << "smooth solution"
-//         << std::endl;
-//     for(unsigned int i=0; i<dof_handler_q.n_dofs(); ++i)
-//         std::cout
-//             << i<< " - "
-//             <<smooth_solution(i)<< std::endl;
-
-//     std::cout
-//         << "tangential velocity"
-//         << std::endl;
-//     for(unsigned int i=0; i<dof_handler_q.n_dofs(); ++i)
-//         std::cout
-//             << i<< " - "
-//             <<tangential_derivative(i)<< std::endl;
-
-//     std::cout<<tria.n_active_cells()<<std::endl;
-       
-//     std::cout
-//         << "cell error" << std::endl
-//         << "solution // smooth_sol // tang_deriv // tang_vel // exact_sol // error"
-//         << std::endl;
-//     for(unsigned int i=0; i<dof_handler_q.n_dofs(); ++i)
-//         std::cout
-//             << i<< " - "
-//             << solution(i) << " // "
-//             << smooth_solution(i)<< " // "
-//             << tangential_derivative(i) << " // "
-//             << tangential_velocity(i) << " // "
-//             // exact solution
-//             << 2. * velocity[0] 
-//                * sin (
-//                    numbers::PI/2. 
-//                    - (1./2.+i) * 2.*numbers::PI/tria.n_active_cells() 
-//                      )
-//             << " // "
-//             << error(i)
-//             << std::endl;
-
-//         std::cout
-//             << "global error"
-//             <<std::endl;
-           
-           for(unsigned int i=0; i<dof_handler_q.n_dofs(); ++i)
-               global_error += 
-                   pow(fabs(error(i)),2) * side_length;
-//         std::cout
-//             << global_error
-//             << std::endl;
-
-           table.add_value("L^2 norm error", global_error);
-       
-       }
+      read_grid("grids/circle_R10.inp");
+
+      Point<spacedim> p;
+      HyperBallBoundary<spacedim-1, spacedim> boundary(p,10.);
+      tria.set_boundary(1, boundary);
+
+      // works up to cycle<9, but for testin purpose, we stop at 4
+      for (unsigned int cycle=0; cycle<4; ++cycle)
+        {
+
+          tria.set_boundary(1, boundary);
+          tria.refine_global(1);
+
+          double side_length  =
+            tria.begin_active()->vertex(0).norm()  // CIRCLE RADIUS
+            *2*sin( numbers::PI / tria.n_active_cells() ),
+            global_error = 0.;
+
+          table.add_value("cycle", cycle);
+          table.add_value("cells", tria.n_active_cells());
+
+          make_dofs();
+          assemble_system();
+          solve();
+          output_results();
+
+          tria.set_boundary(1);
+
+
+//  std::cout
+//      << "solution"
+//      << std::endl;
+//  for(unsigned int i=0; i<dof_handler.n_dofs(); ++i)
+//      std::cout
+//    << i<< " - "
+//    <<solution(i)<< std::endl;
+
+//  std::cout
+//      << "smooth solution"
+//      << std::endl;
+//  for(unsigned int i=0; i<dof_handler_q.n_dofs(); ++i)
+//      std::cout
+//    << i<< " - "
+//    <<smooth_solution(i)<< std::endl;
+
+//  std::cout
+//      << "tangential velocity"
+//      << std::endl;
+//  for(unsigned int i=0; i<dof_handler_q.n_dofs(); ++i)
+//      std::cout
+//    << i<< " - "
+//    <<tangential_derivative(i)<< std::endl;
+
+//  std::cout<<tria.n_active_cells()<<std::endl;
+
+//  std::cout
+//      << "cell error" << std::endl
+//      << "solution // smooth_sol // tang_deriv // tang_vel // exact_sol // error"
+//      << std::endl;
+//  for(unsigned int i=0; i<dof_handler_q.n_dofs(); ++i)
+//      std::cout
+//    << i<< " - "
+//    << solution(i) << " // "
+//    << smooth_solution(i)<< " // "
+//    << tangential_derivative(i) << " // "
+//    << tangential_velocity(i) << " // "
+//    // exact solution
+//    << 2. * velocity[0]
+//       * sin (
+//           numbers::PI/2.
+//           - (1./2.+i) * 2.*numbers::PI/tria.n_active_cells()
+//             )
+//    << " // "
+//    << error(i)
+//    << std::endl;
+
+//      std::cout
+//    << "global error"
+//    <<std::endl;
+
+          for (unsigned int i=0; i<dof_handler_q.n_dofs(); ++i)
+            global_error +=
+              pow(fabs(error(i)),2) * side_length;
+//      std::cout
+//    << global_error
+//    << std::endl;
+
+          table.add_value("L^2 norm error", global_error);
+
+        }
     }
-    else
-       Assert(false, ExcNotImplemented());
+  else
+    Assert(false, ExcNotImplemented());
 
-    table.set_scientific("L^2 norm error", true);
-    table.evaluate_convergence_rates(
-       "L^2 norm error",ConvergenceTable::reduction_rate_log2);
+  table.set_scientific("L^2 norm error", true);
+  table.evaluate_convergence_rates(
+    "L^2 norm error",ConvergenceTable::reduction_rate_log2);
 //     table.write_text(std::cout);
 }
 
@@ -229,304 +230,304 @@ template <int spacedim>
 void
 BEM<spacedim>::make_dofs()
 {
-    dof_handler.distribute_dofs(fe);
-    dof_handler_q.distribute_dofs(fe_q);
-    
-    system_matrix.reinit(dof_handler.n_dofs(), dof_handler.n_dofs());
-    solution.reinit (dof_handler.n_dofs());
-    system_rhs.reinit (dof_handler.n_dofs());
+  dof_handler.distribute_dofs(fe);
+  dof_handler_q.distribute_dofs(fe_q);
+
+  system_matrix.reinit(dof_handler.n_dofs(), dof_handler.n_dofs());
+  solution.reinit (dof_handler.n_dofs());
+  system_rhs.reinit (dof_handler.n_dofs());
 }
 
 template <int spacedim>
 void
 BEM<spacedim>::assemble_system()
 {
-    const QGauss<spacedim-1>        quadrature_formula(2);
-    const QGaussLog<1>              qlog(1);  
-    FEValues<spacedim-1, spacedim>
-                                   fe_values_i (fe, quadrature_formula, 
-                                        update_JxW_values | 
-                                        update_cell_normal_vectors |
-                                        update_quadrature_points ),
-                                   fe_values_j (fe, quadrature_formula, 
-                                        update_JxW_values | 
-                                        update_cell_normal_vectors |
-                                        update_quadrature_points );
-   
-    const unsigned int        dofs_per_cell = fe.dofs_per_cell;
-    const unsigned int        n_q_points    = quadrature_formula.size();
-
-                                 // The following two matrices will
-                                 // be subtracted to obtain the
-                                 // system matrix.
-    FullMatrix<double>        DLP_matrix(dof_handler.n_dofs());        // DLP stands for double layer potential 
-    FullMatrix<double>        mass_matrix(dof_handler.n_dofs());
-    FullMatrix<double>        cell_mass_matrix (dofs_per_cell, dofs_per_cell);
-    FullMatrix<double>        cell_DLP_matrix (dofs_per_cell, dofs_per_cell);
-    Vector<double>            cell_rhs (dofs_per_cell);
-
-    std::vector< Point<spacedim> > cell_normals_i, cell_normals_j;
-
-    std::vector<types::global_dof_index> local_dof_indices_i (dofs_per_cell);
-    std::vector<types::global_dof_index> local_dof_indices_j (dofs_per_cell);
+  const QGauss<spacedim-1>        quadrature_formula(2);
+  const QGaussLog<1>              qlog(1);
+  FEValues<spacedim-1, spacedim>
+  fe_values_i (fe, quadrature_formula,
+               update_JxW_values |
+               update_cell_normal_vectors |
+               update_quadrature_points ),
+                                        fe_values_j (fe, quadrature_formula,
+                                                     update_JxW_values |
+                                                     update_cell_normal_vectors |
+                                                     update_quadrature_points );
+
+  const unsigned int        dofs_per_cell = fe.dofs_per_cell;
+  const unsigned int        n_q_points    = quadrature_formula.size();
+
+  // The following two matrices will
+  // be subtracted to obtain the
+  // system matrix.
+  FullMatrix<double>        DLP_matrix(dof_handler.n_dofs()); // DLP stands for double layer potential
+  FullMatrix<double>        mass_matrix(dof_handler.n_dofs());
+
+  FullMatrix<double>        cell_mass_matrix (dofs_per_cell, dofs_per_cell);
+  FullMatrix<double>        cell_DLP_matrix (dofs_per_cell, dofs_per_cell);
+  Vector<double>            cell_rhs (dofs_per_cell);
+
+  std::vector< Point<spacedim> > cell_normals_i, cell_normals_j;
+
+  std::vector<types::global_dof_index> local_dof_indices_i (dofs_per_cell);
+  std::vector<types::global_dof_index> local_dof_indices_j (dofs_per_cell);
+
 
 //     std::cout
-//     << "no. of cells: "<< tria.n_active_cells()<< std::endl 
-//     << "no. of dofs: "<< dof_handler.n_dofs()<< std::endl
-//     << "dofs per cell: "<< dofs_per_cell<< std::endl
-//     << "side length (r=10): "<< 10 * 2*sin(numbers::PI/tria.n_cells())<<std::endl ;
-     
-
-    typename DoFHandler<spacedim-1, spacedim>::active_cell_iterator
-       cell_i = dof_handler.begin_active(),
-       cell_j = dof_handler.begin_active(),
-       endc   = dof_handler.end();
-
-                               // cycle on i index
-    for (; cell_i!=endc; ++cell_i)
+//  << "no. of cells: "<< tria.n_active_cells()<< std::endl
+//  << "no. of dofs: "<< dof_handler.n_dofs()<< std::endl
+//  << "dofs per cell: "<< dofs_per_cell<< std::endl
+//  << "side length (r=10): "<< 10 * 2*sin(numbers::PI/tria.n_cells())<<std::endl ;
+
+
+  typename DoFHandler<spacedim-1, spacedim>::active_cell_iterator
+  cell_i = dof_handler.begin_active(),
+  cell_j = dof_handler.begin_active(),
+  endc   = dof_handler.end();
+
+  // cycle on i index
+  for (; cell_i!=endc; ++cell_i)
     {
 
-       fe_values_i.reinit (cell_i);
-       cell_normals_i = fe_values_i.get_cell_normal_vectors();
-       cell_i->get_dof_indices (local_dof_indices_i);
-
-//     if (cell_i->index()%100==0)
-//     std::cout
-//         << cell_i->index()<< " || ";
-//         << cell_i->vertex(0)<< " || "
-//         << velocity*cell_normals_i[0] << "; "
-//         << local_dof_indices_i[0]
-//         << std::endl;
-
-       cell_DLP_matrix = 0.;
-       cell_mass_matrix = 0.;
-       
-      
-
-
-                                 // assembling of the right hand side
-       Point<spacedim-1> 
-           a_unit(0.),
-           b_unit(1.);
-               Point<spacedim>
-           A = fe_values_i.get_mapping().
-               transform_unit_to_real_cell(cell_i, 
-                                           a_unit),
-           B = fe_values_i.get_mapping().
-               transform_unit_to_real_cell(cell_i, 
-                                           b_unit);
-    
-       cell_rhs = 0.;            
-
-
-                                 // In order to obtain the Gram
-                                 // determinant it is used JxW and
-                                 // then it is divided by the weight.
-                                 // Both the jacobian and the normals
-                                 // are constant on the cell, so they
-                                 // are taken in the first quadrature
-                                 // point.
-       double constant_factor =
-           - pow(fe_values_i.JxW (0)/fe_values_i.get_quadrature().weight(0), 2)
-           / numbers::PI
-           * velocity*cell_normals_i[0];
-
-                                 // These are constant on the cell so
-                                 // there is no need to loop on
-                                 // quadrature points. Besides, the
-                                 // cell_rhs vector element index is
-                                 // chosen = 0 because it is actually
-                                 // a 1x1 matrix. There should be a
-                                 // loop over cell dofs, but this is
-                                 // necessary just for higher degree
-                                 // elements.
-           cell_rhs(0) += 
-                constant_factor
-               *( 
-                   log( A.distance(B) ) + 8.*qlog.weight(0)
-                 );                  
-                                 // A Gauss integration is performed to compute the
-                                 // integrals on K_i X K_j in the case when i!=j.
-                                 // cycle on j index
-           for (cell_j=dof_handler.begin_active(); cell_j!=endc; ++cell_j)
-           {
-               fe_values_j.reinit (cell_j);
-               cell_normals_j = fe_values_j.get_cell_normal_vectors();
-               cell_j->get_dof_indices (local_dof_indices_j);
-
-               if (cell_j != cell_i)                             
-               {
-                                 // The mass matrix has only diagonal
-                                 // elements.
-                   mass_matrix(cell_i->index(), cell_j->index())= 0.;
-                       
-                                 // with constant elements there is
-                                 // only 1 dof per cell, so there is
-                                 // no real cycle over cell dofs
-                   for (unsigned int a=0; a<dofs_per_cell; ++a)
-                       for (unsigned int q_point_i=0; q_point_i<n_q_points; q_point_i++)
-                           for (unsigned int q_point_j=0; q_point_j<n_q_points; q_point_j++)
-                           {
-                                 // If the integration is performed
-                                 // on two different elements there
-                                 // are no singularities in the
-                                 // domain of integration, so usual
-                                 // gauss formulas can be used.
-
-                               for (unsigned int b=0; b<dofs_per_cell; ++b)
-                               {
-                                 // assembling of double layer potential 
-
-                                   cell_DLP_matrix(a,b) +=
-                                       1./numbers::PI 
-                                       * contract(
-                                           cell_normals_i[q_point_i], 
-                                           (fe_values_j.quadrature_point(q_point_j)
-                                            -
-                                            fe_values_i.quadrature_point(q_point_i))
-                                                 )
-                                       / pow(
-                                           (fe_values_j.quadrature_point(q_point_j)
-                                            -
-                                            fe_values_i.quadrature_point(q_point_i))
-                                           .norm()
-                                           ,2
-                                           )
-                                       * fe_values_i.JxW(q_point_i)
-                                       * fe_values_j.JxW(q_point_j);                       
-                                   
-//                                 if ( (cell_i->index()==0) && (cell_j->index()==5) )
-//                                     std::cout
-//                                         << "("<< cell_i->index()<<","<<cell_j->index()<<"; "
-//                                         <<q_point_i<<","<<q_point_j<<") "
-//                                         << cell_DLP_matrix(a,b)<< " | "
-//                                         << fe_values_i.quadrature_point(q_point_i)<< "||"
-//                                         << fe_values_j.quadrature_point(q_point_j)<< "|<"
-//                                         << contract(
-//                                             cell_normals_i[q_point_i], 
-//                                             (fe_values_j.quadrature_point(q_point_j)
-//                                              -
-//                                              fe_values_i.quadrature_point(q_point_i))
-//                                              )<< "<<"
-//                                         ;
-                   
-                               }
-
-
-                               
-                                 // assembling of right hand side 
-                               cell_rhs(a) += 
-                                   - 1./numbers::PI
-                                   * velocity*cell_normals_j[q_point_j]
-                                   * log( 
-                                       fe_values_i.quadrature_point(q_point_i)
-                                       .distance(
-                                           fe_values_j.quadrature_point(q_point_j)
-                                           )
-                                       )
-                                   * fe_values_i.JxW(q_point_i)
-                                   * fe_values_j.JxW(q_point_j);                           
-//             std::cout
-//                 << cell_j->index()<< " -- "
-//                 << cell_rhs(i);
-                           }
-                   for (unsigned int a=0; a<dofs_per_cell; ++a)
-                       for (unsigned int b=0; b<dofs_per_cell; ++b)
-                           DLP_matrix(local_dof_indices_i[a],local_dof_indices_j[b]) 
-                               +=
-                               cell_DLP_matrix(a,b);
-               }
-               else              // case when cell_i=cell_j
-               {
-                                 // The mass matrix is simply a
-                                 // diagonal matrix with the area of
-                                 // each element as entries.
-                   for (unsigned q_point_i=0; q_point_i<n_q_points; ++q_point_i)
-                       mass_matrix(cell_i->index(), cell_i->index()) 
-                           +=
-                           fe_values_i.JxW(q_point_i);         
-           
-                                 // The double layer potential matrix
-                                 // has no diagonal terms since the
-                                 // scalar product between the cell
-                                 // normal and the difference
-                                 // <tt>x-y<\tt> is always zero. This
-                                 // is because, if <tt>x<\tt> and
-                                 // <tt>y<\tt> are on the same
-                                 // element and the element is a
-                                 // straight segment, their
-                                 // difference is always orthogonal
-                                 // to the cell normal. 
-                   DLP_matrix(cell_i->index(), cell_i->index()) = 0.;
-               }
-
-               cell_DLP_matrix = 0.;
-
-//             std::cout
-//                 << cell_DLP_matrix(0,0)<< " - ";
-                                   
-           }
-
-//         std::cout
-//             << cell_rhs(0)<<std::endl;
-           
-           for (unsigned int a=0; a<dofs_per_cell; ++a)
-               system_rhs(local_dof_indices_i[a]) += cell_rhs(a);
-
-                                 // end of assembling of the right hand side
-
-    }                
+      fe_values_i.reinit (cell_i);
+      cell_normals_i = fe_values_i.get_cell_normal_vectors();
+      cell_i->get_dof_indices (local_dof_indices_i);
+
+//  if (cell_i->index()%100==0)
+//    std::cout
+//        << cell_i->index()<< " || ";
+//      << cell_i->vertex(0)<< " || "
+//      << velocity*cell_normals_i[0] << "; "
+//      << local_dof_indices_i[0]
+//      << std::endl;
+
+      cell_DLP_matrix = 0.;
+      cell_mass_matrix = 0.;
+
+
+
+
+      // assembling of the right hand side
+      Point<spacedim-1>
+      a_unit(0.),
+             b_unit(1.);
+      Point<spacedim>
+      A = fe_values_i.get_mapping().
+          transform_unit_to_real_cell(cell_i,
+                                      a_unit),
+          B = fe_values_i.get_mapping().
+              transform_unit_to_real_cell(cell_i,
+                                          b_unit);
+
+      cell_rhs = 0.;
+
+
+      // In order to obtain the Gram
+      // determinant it is used JxW and
+      // then it is divided by the weight.
+      // Both the jacobian and the normals
+      // are constant on the cell, so they
+      // are taken in the first quadrature
+      // point.
+      double constant_factor =
+        - pow(fe_values_i.JxW (0)/fe_values_i.get_quadrature().weight(0), 2)
+        / numbers::PI
+        * velocity*cell_normals_i[0];
+
+      // These are constant on the cell so
+      // there is no need to loop on
+      // quadrature points. Besides, the
+      // cell_rhs vector element index is
+      // chosen = 0 because it is actually
+      // a 1x1 matrix. There should be a
+      // loop over cell dofs, but this is
+      // necessary just for higher degree
+      // elements.
+      cell_rhs(0) +=
+        constant_factor
+        *(
+          log( A.distance(B) ) + 8.*qlog.weight(0)
+        );
+      // A Gauss integration is performed to compute the
+      // integrals on K_i X K_j in the case when i!=j.
+      // cycle on j index
+      for (cell_j=dof_handler.begin_active(); cell_j!=endc; ++cell_j)
+        {
+          fe_values_j.reinit (cell_j);
+          cell_normals_j = fe_values_j.get_cell_normal_vectors();
+          cell_j->get_dof_indices (local_dof_indices_j);
+
+          if (cell_j != cell_i)
+            {
+              // The mass matrix has only diagonal
+              // elements.
+              mass_matrix(cell_i->index(), cell_j->index())= 0.;
+
+              // with constant elements there is
+              // only 1 dof per cell, so there is
+              // no real cycle over cell dofs
+              for (unsigned int a=0; a<dofs_per_cell; ++a)
+                for (unsigned int q_point_i=0; q_point_i<n_q_points; q_point_i++)
+                  for (unsigned int q_point_j=0; q_point_j<n_q_points; q_point_j++)
+                    {
+                      // If the integration is performed
+                      // on two different elements there
+                      // are no singularities in the
+                      // domain of integration, so usual
+                      // gauss formulas can be used.
+
+                      for (unsigned int b=0; b<dofs_per_cell; ++b)
+                        {
+                          // assembling of double layer potential
+
+                          cell_DLP_matrix(a,b) +=
+                            1./numbers::PI
+                            * contract(
+                              cell_normals_i[q_point_i],
+                              (fe_values_j.quadrature_point(q_point_j)
+                               -
+                               fe_values_i.quadrature_point(q_point_i))
+                            )
+                            / pow(
+                              (fe_values_j.quadrature_point(q_point_j)
+                               -
+                               fe_values_i.quadrature_point(q_point_i))
+                              .norm()
+                              ,2
+                            )
+                            * fe_values_i.JxW(q_point_i)
+                            * fe_values_j.JxW(q_point_j);
+
+//            if ( (cell_i->index()==0) && (cell_j->index()==5) )
+//          std::cout
+//              << "("<< cell_i->index()<<","<<cell_j->index()<<"; "
+//              <<q_point_i<<","<<q_point_j<<") "
+//              << cell_DLP_matrix(a,b)<< " | "
+//              << fe_values_i.quadrature_point(q_point_i)<< "||"
+//              << fe_values_j.quadrature_point(q_point_j)<< "|<"
+//              << contract(
+//            cell_normals_i[q_point_i],
+//            (fe_values_j.quadrature_point(q_point_j)
+//             -
+//             fe_values_i.quadrature_point(q_point_i))
+//                   )<< "<<"
+//              ;
+
+                        }
+
+
+
+                      // assembling of right hand side
+                      cell_rhs(a) +=
+                        - 1./numbers::PI
+                        * velocity*cell_normals_j[q_point_j]
+                        * log(
+                          fe_values_i.quadrature_point(q_point_i)
+                          .distance(
+                            fe_values_j.quadrature_point(q_point_j)
+                          )
+                        )
+                        * fe_values_i.JxW(q_point_i)
+                        * fe_values_j.JxW(q_point_j);
+//    std::cout
+//        << cell_j->index()<< " -- "
+//        << cell_rhs(i);
+                    }
+              for (unsigned int a=0; a<dofs_per_cell; ++a)
+                for (unsigned int b=0; b<dofs_per_cell; ++b)
+                  DLP_matrix(local_dof_indices_i[a],local_dof_indices_j[b])
+                  +=
+                    cell_DLP_matrix(a,b);
+            }
+          else      // case when cell_i=cell_j
+            {
+              // The mass matrix is simply a
+              // diagonal matrix with the area of
+              // each element as entries.
+              for (unsigned q_point_i=0; q_point_i<n_q_points; ++q_point_i)
+                mass_matrix(cell_i->index(), cell_i->index())
+                +=
+                  fe_values_i.JxW(q_point_i);
+
+              // The double layer potential matrix
+              // has no diagonal terms since the
+              // scalar product between the cell
+              // normal and the difference
+              // <tt>x-y<\tt> is always zero. This
+              // is because, if <tt>x<\tt> and
+              // <tt>y<\tt> are on the same
+              // element and the element is a
+              // straight segment, their
+              // difference is always orthogonal
+              // to the cell normal.
+              DLP_matrix(cell_i->index(), cell_i->index()) = 0.;
+            }
+
+          cell_DLP_matrix = 0.;
+
+//    std::cout
+//        << cell_DLP_matrix(0,0)<< " - ";
+
+        }
+
+//      std::cout
+//    << cell_rhs(0)<<std::endl;
+
+      for (unsigned int a=0; a<dofs_per_cell; ++a)
+        system_rhs(local_dof_indices_i[a]) += cell_rhs(a);
+
+      // end of assembling of the right hand side
+
+    }
 
 //     TableIndices<2> table_indices(dof_handler.n_dofs(), dof_handler.n_dofs());
 
-    system_matrix.add(
-       1, mass_matrix,
-       -1, DLP_matrix
-                    );
+  system_matrix.add(
+    1, mass_matrix,
+    -1, DLP_matrix
+  );
 
 //     std::cout
-//     << "rhs"<< std::endl;
+//  << "rhs"<< std::endl;
 //     for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
-//     std::cout
-//         << system_rhs(i)<< " | "
-//         << std::endl;
+//  std::cout
+//      << system_rhs(i)<< " | "
+//      << std::endl;
 
 //     std::cout
-//     << "DLP matrix"<< std::endl;
+//  << "DLP matrix"<< std::endl;
 //     for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
 //     {
-//     for (unsigned int j=0; j<dof_handler.n_dofs(); ++j)
-//         std::cout
-//             << DLP_matrix(i,j)<< " | ";
-//     std::cout
-//         << std::endl;
+//  for (unsigned int j=0; j<dof_handler.n_dofs(); ++j)
+//      std::cout
+//    << DLP_matrix(i,j)<< " | ";
+//  std::cout
+//      << std::endl;
 //     }
 
 //     std::cout
-//     << "mass matrix"<< std::endl;
+//  << "mass matrix"<< std::endl;
 //     for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
 //     {
-//     for (unsigned int j=0; j<dof_handler.n_dofs(); ++j)
-//         std::cout
-//             << mass_matrix(i,j)<< " | ";
-//     std::cout
-//         << std::endl;
+//  for (unsigned int j=0; j<dof_handler.n_dofs(); ++j)
+//      std::cout
+//    << mass_matrix(i,j)<< " | ";
+//  std::cout
+//      << std::endl;
 //     }
 
 //     std::cout
-//     << "system matrix"<< std::endl;
+//  << "system matrix"<< std::endl;
 //     for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
 //     {
-//     for (unsigned int j=0; j<dof_handler.n_dofs(); ++j)
-//         std::cout
-//             << system_matrix(i,j)<< " | ";
-//     std::cout
-//         << std::endl;
-//     }               
-   
-       
+//  for (unsigned int j=0; j<dof_handler.n_dofs(); ++j)
+//      std::cout
+//    << system_matrix(i,j)<< " | ";
+//  std::cout
+//      << std::endl;
+//     }
+
+
 }
 
 template <int spacedim>
@@ -534,152 +535,152 @@ void
 BEM<spacedim>::solve()
 {
 
-    SolverControl      solver_control(1000, 1e-12);
-    SolverCG<>         cg(solver_control);
-
-    cg.solve( system_matrix,
-             solution,
-             system_rhs,
-             PreconditionIdentity() );
-
-                               // Smoothen the piecewise constant
-                               // solution to a continuous piecewise
-                               // quadratic function.
-    smooth_solution.reinit(dof_handler_q.n_dofs());
-
-    FETools::interpolate( dof_handler,
-                         solution,
-                         dof_handler_q,
-                         smooth_solution);
-
-                               // Calculate the tangential derivative
-                               // of the smoothened potential, that
-                               // is the tangential component of the
-                               // perturbation induced in the
-                               // velocity.
-    tangential_derivative.reinit(dof_handler_q.n_dofs());
-    tangential_velocity.reinit(dof_handler_q.n_dofs());
-    error.reinit(dof_handler_q.n_dofs());
-    QMidpoint<spacedim-1>             q_midpoint;
-    QTrapez<spacedim-1>               q_trapez;
-    const QIterated<spacedim-1>       q_iterated(q_midpoint, 1);
-
-    FEValues<spacedim-1, spacedim>    fe_values_q(fe_q,
-                                                 q_iterated,
-                                                 update_values |
-                                                 update_gradients |
-                                                 update_cell_normal_vectors );
-   
-    std::vector< Point<spacedim> > cell_normals(q_iterated.size());
-    std::vector< Point<spacedim> > cell_tangentials(q_iterated.size());
-    std::vector<types::global_dof_index> local_dof_indices (fe_q.dofs_per_cell);
-
-    typename DoFHandler<spacedim-1, spacedim>::active_cell_iterator
-       cell = dof_handler_q.begin_active(),
-       endc = dof_handler_q.end();
-    for (; cell!=endc; ++cell)
+  SolverControl      solver_control(1000, 1e-12);
+  SolverCG<>         cg(solver_control);
+
+  cg.solve( system_matrix,
+            solution,
+            system_rhs,
+            PreconditionIdentity() );
+
+  // Smoothen the piecewise constant
+  // solution to a continuous piecewise
+  // quadratic function.
+  smooth_solution.reinit(dof_handler_q.n_dofs());
+
+  FETools::interpolate( dof_handler,
+                        solution,
+                        dof_handler_q,
+                        smooth_solution);
+
+  // Calculate the tangential derivative
+  // of the smoothened potential, that
+  // is the tangential component of the
+  // perturbation induced in the
+  // velocity.
+  tangential_derivative.reinit(dof_handler_q.n_dofs());
+  tangential_velocity.reinit(dof_handler_q.n_dofs());
+  error.reinit(dof_handler_q.n_dofs());
+  QMidpoint<spacedim-1>             q_midpoint;
+  QTrapez<spacedim-1>               q_trapez;
+  const QIterated<spacedim-1>       q_iterated(q_midpoint, 1);
+
+  FEValues<spacedim-1, spacedim>    fe_values_q(fe_q,
+                                                q_iterated,
+                                                update_values |
+                                                update_gradients |
+                                                update_cell_normal_vectors );
+
+  std::vector< Point<spacedim> > cell_normals(q_iterated.size());
+  std::vector< Point<spacedim> > cell_tangentials(q_iterated.size());
+  std::vector<types::global_dof_index> local_dof_indices (fe_q.dofs_per_cell);
+
+  typename DoFHandler<spacedim-1, spacedim>::active_cell_iterator
+  cell = dof_handler_q.begin_active(),
+  endc = dof_handler_q.end();
+  for (; cell!=endc; ++cell)
     {
-       fe_values_q.reinit(cell);
-       cell->get_dof_indices (local_dof_indices);
+      fe_values_q.reinit(cell);
+      cell->get_dof_indices (local_dof_indices);
 
 //QUADRATIC INTERPOLATION OF THE POTENTIAL
-//     std::cout
-//         << "indices - ";
-//     for(unsigned int i=0; i<fe_q.dofs_per_cell; ++i)
-//         std::cout
-//             << local_dof_indices[(i==0? 0 
-//                                   : 
-//                                   i==1 ?  2
-//                                   :
-//                                   1
-//                                  )]<< ", ";
-//     std::cout<<std::endl;
-
-       
-       cell_normals = fe_values_q.get_cell_normal_vectors();
-       for(unsigned int i=0; i<q_iterated.size(); ++i)
-       {
-           cell_tangentials[i][0] = cell_normals[i][1]; 
-           cell_tangentials[i][1] = -cell_normals[i][0];
-       }
-
-                               // Create a vector where gradients at
-                               // quadrature points are
-                               // stored. Notice that the first
-                               // factor (smooth_solution..) is taken
-                               // so that it is the coefficient of
-                               // the fun_th shape function of the cell.
-       std::vector< Tensor<1,spacedim> > gradient(q_iterated.size());
-       for(unsigned int pnt=0; pnt<q_iterated.size(); ++pnt)
-           for(unsigned int fun=0; fun<fe_q.dofs_per_cell; ++fun)
-           {
-           gradient[pnt]+=
-               smooth_solution(local_dof_indices[fun])
+//  std::cout
+//      << "indices - ";
+//  for(unsigned int i=0; i<fe_q.dofs_per_cell; ++i)
+//      std::cout
+//    << local_dof_indices[(i==0? 0
+//              :
+//              i==1 ?  2
+//              :
+//              1
+//             )]<< ", ";
+//  std::cout<<std::endl;
+
+
+      cell_normals = fe_values_q.get_cell_normal_vectors();
+      for (unsigned int i=0; i<q_iterated.size(); ++i)
+        {
+          cell_tangentials[i][0] = cell_normals[i][1];
+          cell_tangentials[i][1] = -cell_normals[i][0];
+        }
+
+      // Create a vector where gradients at
+      // quadrature points are
+      // stored. Notice that the first
+      // factor (smooth_solution..) is taken
+      // so that it is the coefficient of
+      // the fun_th shape function of the cell.
+      std::vector< Tensor<1,spacedim> > gradient(q_iterated.size());
+      for (unsigned int pnt=0; pnt<q_iterated.size(); ++pnt)
+        for (unsigned int fun=0; fun<fe_q.dofs_per_cell; ++fun)
+          {
+            gradient[pnt]+=
+              smooth_solution(local_dof_indices[fun])
 //QUADRATIC INTERPOLATION OF THE POTENTIAL
-//             smooth_solution(local_dof_indices[(fun==0? 0 
-//                                                : 
-//                                                fun==1 ? 2 
-//                                                :
-//                                                1
-//                                              )]
-//                            )
-               * 
-               fe_values_q.shape_grad(fun, pnt);
-
-//         std::cout
-//             << smooth_solution(local_dof_indices[(fun==0? 0 
-//                                                   : 
-//                                                   fun==1 ? 2 
-//                                                   :
-//                                                   1
-//                                                 )])<< " | "
-//             << fe_values_q.shape_grad(fun, pnt)
-//             << std::endl;
-           }
-
-//     std::cout
-//         << "gradienti "<<std::endl;
-//     for(unsigned int pnt=0; pnt<q_iterated.size(); ++pnt)
-//         std::cout
-//             << pnt << " - "
-//             << gradient[pnt]
-//             << std::endl;
-               
-//     std::cout
-//         << "derivata tangenziale "
-//         << cell->index()
-//         << std::endl;
-
-
-       for(unsigned int pnt=0; pnt<q_iterated.size(); ++pnt)
-       {
-           tangential_derivative(cell->index())=
-               contract(
-                   gradient[pnt],
-                   cell_tangentials[pnt]  
-                       )
-               +
-               contract(velocity,
-                        cell_tangentials[0]
-                       );
-           error(cell->index())=
-               tangential_derivative(cell->index())
-               -
-               2. * velocity[0] 
-               * sin (numbers::PI/2. - (1./2.+cell->index()) * 2.*numbers::PI/tria.n_active_cells() );
-           tangential_velocity(cell->index())=
-               contract(velocity,
-                        cell_tangentials[0]
-                       );
-               
-       }
-
-// //  for(unsigned int pnt=0; pnt<q_iterated.size(); ++pnt)
-//         std::cout
-// //          << pnt <<" - "
-//             << tangential_derivative(cell->index())
-//             << std::endl;
-    }  
+//    smooth_solution(local_dof_indices[(fun==0? 0
+//               :
+//               fun==1 ? 2
+//               :
+//               1
+//             )]
+//                   )
+              *
+              fe_values_q.shape_grad(fun, pnt);
+
+//      std::cout
+//    << smooth_solution(local_dof_indices[(fun==0? 0
+//                  :
+//                  fun==1 ? 2
+//                  :
+//                  1
+//                )])<< " | "
+//    << fe_values_q.shape_grad(fun, pnt)
+//    << std::endl;
+          }
+
+//  std::cout
+//      << "gradienti "<<std::endl;
+//  for(unsigned int pnt=0; pnt<q_iterated.size(); ++pnt)
+//      std::cout
+//    << pnt << " - "
+//    << gradient[pnt]
+//    << std::endl;
+
+//    std::cout
+//      << "derivata tangenziale "
+//      << cell->index()
+//      << std::endl;
+
+
+      for (unsigned int pnt=0; pnt<q_iterated.size(); ++pnt)
+        {
+          tangential_derivative(cell->index())=
+            contract(
+              gradient[pnt],
+              cell_tangentials[pnt]
+            )
+            +
+            contract(velocity,
+                     cell_tangentials[0]
+                    );
+          error(cell->index())=
+            tangential_derivative(cell->index())
+            -
+            2. * velocity[0]
+            * sin (numbers::PI/2. - (1./2.+cell->index()) * 2.*numbers::PI/tria.n_active_cells() );
+          tangential_velocity(cell->index())=
+            contract(velocity,
+                     cell_tangentials[0]
+                    );
+
+        }
+
+// //   for(unsigned int pnt=0; pnt<q_iterated.size(); ++pnt)
+//      std::cout
+// //     << pnt <<" - "
+//    << tangential_derivative(cell->index())
+//    << std::endl;
+    }
 
 
 //     DataOut<spacedim-1, DoFHandler<spacedim-1,spacedim> > dataout;
@@ -687,12 +688,12 @@ BEM<spacedim>::solve()
 //     dataout.add_data_vector(smooth_solution, "quadratic_potential");
 //     dataout.build_patches(fe_q.degree);
 //     char outname[50];
-//     sprintf(outname, "bem/bem_gradient.vtk"); 
+//     sprintf(outname, "bem/bem_gradient.vtk");
 //     std::ofstream file(outname);
 //     dataout.write_vtk(file);
 //     dataout.write_vtk(logfile);
-    
-    
+
+
 
 }
 
@@ -701,44 +702,44 @@ void
 BEM<spacedim>::output_results()
 {
 
-    DataOut<spacedim-1, DoFHandler<spacedim-1,spacedim> > dataout;
-    dataout.attach_dof_handler(dof_handler_q);
-    dataout.add_data_vector(smooth_solution, "linear_potential");
-    dataout.add_data_vector(tangential_derivative, "tangential_velocity");
-    dataout.add_data_vector(error, "error"); 
-    dataout.build_patches();
+  DataOut<spacedim-1, DoFHandler<spacedim-1,spacedim> > dataout;
+  dataout.attach_dof_handler(dof_handler_q);
+  dataout.add_data_vector(smooth_solution, "linear_potential");
+  dataout.add_data_vector(tangential_derivative, "tangential_velocity");
+  dataout.add_data_vector(error, "error");
+  dataout.build_patches();
 //    dataout.build_patches(fe_q.degree);
-    dataout.write_vtk(logfile);
-    
+  dataout.write_vtk(logfile);
+
 }
 
 template <int spacedim>
 void
-BEM<spacedim>::read_grid(std::string filename) 
+BEM<spacedim>::read_grid(std::string filename)
 {
-    GridIn<spacedim-1, spacedim> gi;
-    gi.attach_triangulation (tria);
-    std::ifstream in (filename.c_str());
-    gi.read_ucd (in);  
+  GridIn<spacedim-1, spacedim> gi;
+  gi.attach_triangulation (tria);
+  std::ifstream in (filename.c_str());
+  gi.read_ucd (in);
 }
 
 
 template <int spacedim>
-void 
-BEM<spacedim>::write_grid(std::string filename) 
+void
+BEM<spacedim>::write_grid(std::string filename)
 {
-    GridOut grid_out;
-    grid_out.set_flags (GridOutFlags::Ucd(true));
-    grid_out.write_ucd (tria, logfile);
-    grid_out.write_msh (tria, logfile);
+  GridOut grid_out;
+  grid_out.set_flags (GridOutFlags::Ucd(true));
+  grid_out.write_ucd (tria, logfile);
+  grid_out.write_msh (tria, logfile);
 }
 
-int main () 
+int main ()
 {
-  
-    BEM<2> bem;
-    bem.run();
 
-    return 0;
+  BEM<2> bem;
+  bem.run();
+
+  return 0;
 }
-                  
+
index 9bf6caee12ad8a7ea74135d13d8f5c8a82eb39fd..e4115f23d3122fb7a864feaf32dfdb2b634a9fe3 100644 (file)
@@ -16,7 +16,7 @@
 
 
 
-// 
+//
 
 
 #include "../tests.h"
@@ -64,130 +64,131 @@ class LaplaceKernelIntegration
 {
 public:
 
-    LaplaceKernelIntegration();
-    ~LaplaceKernelIntegration();
-  
-    void run();
-    
-    void compute_SD_integral_on_cell(vector<double> &dst,
-                                    typename DoFHandler<dim,dim+1>::active_cell_iterator &cell,
-                                    const Point<dim+1> &point);
+  LaplaceKernelIntegration();
+  ~LaplaceKernelIntegration();
+
+  void run();
+
+  void compute_SD_integral_on_cell(vector<double> &dst,
+                                   typename DoFHandler<dim,dim+1>::active_cell_iterator &cell,
+                                   const Point<dim+1> &point);
 
 private:
-    double term_S(const Point<3> &r,
-                 const Point<3> &a1,
-                 const Point<3> &a2,
-                 const Point<3> &n,
-                 const double &rn_c);
+  double term_S(const Point<3> &r,
+                const Point<3> &a1,
+                const Point<3> &a2,
+                const Point<3> &n,
+                const double &rn_c);
 
-    double term_D(const Point<3> &r,
-                 const Point<3> &a1,
-                 const Point<3> &a2);
+  double term_D(const Point<3> &r,
+                const Point<3> &a1,
+                const Point<3> &a2);
 
-    SmartPointer<FEValues<dim,dim+1> > fe_values;
+  SmartPointer<FEValues<dim,dim+1> > fe_values;
 };
 
 template <>
 LaplaceKernelIntegration<2>::LaplaceKernelIntegration()
 {
-    static FE_DGP<2,3> fe(0);
-    vector<Point<2> > qps(5);
-    qps[0] = Point<2>(0,0);
-    qps[1] = Point<2>(0,1);
-    qps[2] = Point<2>(1,0);
-    qps[3] = Point<2>(1,1);
-    qps[4] = Point<2>(.5,.5);
-    vector<double> ws(5,1.);
-    static Quadrature<2> quadrature(qps, ws);
-    fe_values = new FEValues<2,3>(fe,quadrature,
-                                 update_values | 
-                                 update_jacobians |
-                                 update_normal_vectors);
+  static FE_DGP<2,3> fe(0);
+  vector<Point<2> > qps(5);
+  qps[0] = Point<2>(0,0);
+  qps[1] = Point<2>(0,1);
+  qps[2] = Point<2>(1,0);
+  qps[3] = Point<2>(1,1);
+  qps[4] = Point<2>(.5,.5);
+  vector<double> ws(5,1.);
+  static Quadrature<2> quadrature(qps, ws);
+  fe_values = new FEValues<2,3>(fe,quadrature,
+                                update_values |
+                                update_jacobians |
+                                update_normal_vectors);
 }
 
 template <int dim>
-LaplaceKernelIntegration<dim>::~LaplaceKernelIntegration() {
-    FEValues<dim,dim+1> *fp = fe_values;
-    fe_values = 0;
-    delete fp;
+LaplaceKernelIntegration<dim>::~LaplaceKernelIntegration()
+{
+  FEValues<dim,dim+1> *fp = fe_values;
+  fe_values = 0;
+  delete fp;
 }
 
 
 template <>
 void
 LaplaceKernelIntegration<2>::compute_SD_integral_on_cell(vector<double> &dst,
-                                                        DoFHandler<2,3>::active_cell_iterator &cell,
-                                                        const Point<3> &point)
+                                                         DoFHandler<2,3>::active_cell_iterator &cell,
+                                                         const Point<3> &point)
 {
-    Assert(dst.size() == 2,
-          ExcDimensionMismatch(dst.size(), 2));
-    fe_values->reinit(cell);
-    vector<DerivativeForm<1,2,3> > jacobians = fe_values->get_jacobians();
-    vector<Point<3> > normals = fe_values->get_normal_vectors();
-
-    Point<3> r,a1,a2,n,r_c,n_c;
-    r_c = point-cell->center();
-    n_c = normals[4];
-       
-    double rn_c = r_c*n_c;
-    vector<double> i_S(4);
-    vector<double> i_D(4);
-    for (unsigned int q_point=0; q_point < 4; ++q_point)
+  Assert(dst.size() == 2,
+         ExcDimensionMismatch(dst.size(), 2));
+  fe_values->reinit(cell);
+  vector<DerivativeForm<1,2,3> > jacobians = fe_values->get_jacobians();
+  vector<Point<3> > normals = fe_values->get_normal_vectors();
+
+  Point<3> r,a1,a2,n,r_c,n_c;
+  r_c = point-cell->center();
+  n_c = normals[4];
+
+  double rn_c = r_c*n_c;
+  vector<double> i_S(4);
+  vector<double> i_D(4);
+  for (unsigned int q_point=0; q_point < 4; ++q_point)
     {
-       r = point-cell->vertex(q_point);
-       a1 = transpose(jacobians[q_point])[0];
-       a2 = transpose(jacobians[q_point])[1];
-       n =  normals[q_point];
-       i_S[q_point]=term_S(r,a1,a2,n,rn_c);
-       i_D[q_point]=term_D(r,a1,a2);
+      r = point-cell->vertex(q_point);
+      a1 = transpose(jacobians[q_point])[0];
+      a2 = transpose(jacobians[q_point])[1];
+      n =  normals[q_point];
+      i_S[q_point]=term_S(r,a1,a2,n,rn_c);
+      i_D[q_point]=term_D(r,a1,a2);
     }
-    dst[0] = (i_S[3]-i_S[1]-i_S[2]+i_S[0]);
-    dst[1] = (i_D[3]-i_D[1]-i_D[2]+i_D[0]);
+  dst[0] = (i_S[3]-i_S[1]-i_S[2]+i_S[0]);
+  dst[1] = (i_D[3]-i_D[1]-i_D[2]+i_D[0]);
 
 }
 
 template <int dim>
 double
 LaplaceKernelIntegration<dim>::term_S (const Point<3> &r,
-                                      const Point<3> &a1,
-                                      const Point<3> &a2,
-                                      const Point<3> &n,
-                                      const double &rn_c)
+                                       const Point<3> &a1,
+                                       const Point<3> &a2,
+                                       const Point<3> &n,
+                                       const double &rn_c)
 {
-    Point<3> ra1, ra2, a12;
-
-    cross_product(ra1,r,a1);
-    cross_product(ra2,r,a2);
-    cross_product(a12,a1,a2);    
-    
-    double integral =
-       -1./2./numbers::PI
-       *(
-           - ra1*n/a1.norm() * asinh( r*a1/ra1.norm() )
-           + ra2*n/a2.norm() * asinh( r*a2/ra2.norm() )
-           + rn_c * atan( ra1*ra2 / (r.norm()* (r*(a12))))
-           );
-
-    return integral;
+  Point<3> ra1, ra2, a12;
+
+  cross_product(ra1,r,a1);
+  cross_product(ra2,r,a2);
+  cross_product(a12,a1,a2);
+
+  double integral =
+    -1./2./numbers::PI
+    *(
+      - ra1*n/a1.norm() * asinh( r*a1/ra1.norm() )
+      + ra2*n/a2.norm() * asinh( r*a2/ra2.norm() )
+      + rn_c * atan( ra1*ra2 / (r.norm()* (r*(a12))))
+    );
+
+  return integral;
 
 }
 
 template <int dim>
 double
 LaplaceKernelIntegration<dim>::term_D (const Point<3> &r,
-                                      const Point<3> &a1,
-                                      const Point<3> &a2)    
+                                       const Point<3> &a1,
+                                       const Point<3> &a2)
 {
-    Point<3> ra1, ra2, a12;
+  Point<3> ra1, ra2, a12;
 
-    cross_product(ra1,r,a1);
-    cross_product(ra2,r,a2);
-    cross_product(a12,a1,a2);    
-    
-    double integral = 1./2./numbers::PI
-       *atan( ra1*ra2 / (r.norm()* (r*(a12))));
+  cross_product(ra1,r,a1);
+  cross_product(ra2,r,a2);
+  cross_product(a12,a1,a2);
 
-    return integral;
+  double integral = 1./2./numbers::PI
+                    *atan( ra1*ra2 / (r.norm()* (r*(a12))));
+
+  return integral;
 
 }
 
@@ -195,48 +196,48 @@ LaplaceKernelIntegration<dim>::term_D (const Point<3> &r,
 double
 integration(Point<3> point)
 {
-    Triangulation<2,3> square;
-    GridGenerator::hyper_cube<2,3>(square,0,2);
-    DoFHandler<2,3> dof_handler(square);
-    static const FE_DGP<2,3> fe(0);
-    dof_handler.distribute_dofs(fe);
-
-    DoFHandler<2,3>::active_cell_iterator
-       cell = dof_handler.begin_active();
-
-    LaplaceKernelIntegration<2> laplace;
-    vector<double> integrals(2);
-    laplace.compute_SD_integral_on_cell(integrals,
-                                       cell,
-                                       point);
-    return integrals[0];
-     
+  Triangulation<2,3> square;
+  GridGenerator::hyper_cube<2,3>(square,0,2);
+  DoFHandler<2,3> dof_handler(square);
+  static const FE_DGP<2,3> fe(0);
+  dof_handler.distribute_dofs(fe);
+
+  DoFHandler<2,3>::active_cell_iterator
+  cell = dof_handler.begin_active();
+
+  LaplaceKernelIntegration<2> laplace;
+  vector<double> integrals(2);
+  laplace.compute_SD_integral_on_cell(integrals,
+                                      cell,
+                                      point);
+  return integrals[0];
+
 }
 
 
 
 int main()
 {
-    
-    deallog.attach(logfile);
-    deallog.depth_console(0);
-    deallog<<std::fixed;
-    deallog<<std::setprecision(5);
-
-    Point<3> point(.5, .5, 0);
-    double true_result= -3.163145629/numbers::PI;
-    deallog<< "Error on  " << point 
-       << " : " << integration(point)-true_result <<endl;
-
-    point= Point<3>(3, 3, 0);
-    true_result= -.2306783616;
-    deallog<< "Error on  " << point 
-       << " : " << integration(point)-true_result <<endl;
-
-    point= Point<3>(1.5, .5, 0);
-    true_result= -1.006860525;
-    deallog<< "Error on  " << point 
-       << " : " << integration(point)-true_result <<endl;
-
-    return 0;
+
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog<<std::fixed;
+  deallog<<std::setprecision(5);
+
+  Point<3> point(.5, .5, 0);
+  double true_result= -3.163145629/numbers::PI;
+  deallog<< "Error on  " << point
+         << " : " << integration(point)-true_result <<endl;
+
+  point= Point<3>(3, 3, 0);
+  true_result= -.2306783616;
+  deallog<< "Error on  " << point
+         << " : " << integration(point)-true_result <<endl;
+
+  point= Point<3>(1.5, .5, 0);
+  true_result= -1.006860525;
+  deallog<< "Error on  " << point
+         << " : " << integration(point)-true_result <<endl;
+
+  return 0;
 }
index 3fc9738eb8e882535fd958ab51f0444b2c1617f5..1d80e3f5d07a8a7751785277e2c7479b63611ac7 100644 (file)
@@ -41,7 +41,7 @@ using namespace std;
 
 
 template <int dim, int spacedim>
-void save_mesh(const Triangulation<dim,spacedim>tria)
+void save_mesh(const Triangulation<dim,spacedim> &tria)
 {
   GridOut grid_out;
   grid_out.write_gnuplot (tria, deallog.get_file_stream());
@@ -54,7 +54,7 @@ int main ()
   deallog.attach(logfile);
   deallog.depth_console(0);
 
-                                  // Extract the boundary of 3/4 of a sphere
+  // Extract the boundary of 3/4 of a sphere
   {
     const int dim = 3;
     deallog << "Testing hyper_cube in dim: " << dim << "..."<< endl;
@@ -64,51 +64,51 @@ int main ()
     GridGenerator::hyper_ball(volume_mesh);
     volume_mesh.set_boundary (0, boundary_description);
 
-                                    // exclude one of the 6 faces
-                                    // from the surface mesh
-                                    // extraction
+    // exclude one of the 6 faces
+    // from the surface mesh
+    // extraction
     for (Triangulation<dim>::active_cell_iterator
-          cell = volume_mesh.begin_active();
-        cell != volume_mesh.end(); ++cell)
+         cell = volume_mesh.begin_active();
+         cell != volume_mesh.end(); ++cell)
       {
-       bool done = false;
-       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
-         if (cell->at_boundary(f))
-           {
-             cell->face(f)->set_boundary_indicator(1);
-             done = true;
-             break;
-           }
-       if (done)
-         break;
+        bool done = false;
+        for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+          if (cell->at_boundary(f))
+            {
+              cell->face(f)->set_boundary_indicator(1);
+              done = true;
+              break;
+            }
+        if (done)
+          break;
       }
 
     const HyperBallBoundary<dim-1,dim> surface_description;
     Triangulation<dim-1,dim> boundary_mesh;
     boundary_mesh.set_boundary (0, surface_description);
 
-                                    // now extract a mesh of the 5
-                                    // surface faces
+    // now extract a mesh of the 5
+    // surface faces
     std::set<types::boundary_id> boundary_indicators;
     boundary_indicators.insert (0);
     GridTools::extract_boundary_mesh (volume_mesh, boundary_mesh,
-                                     boundary_indicators);
+                                      boundary_indicators);
     deallog << volume_mesh.n_active_cells () << std::endl;
     deallog << boundary_mesh.n_active_cells () << std::endl;
 
-                                    // at this point, all cells and
-                                    // edges of the surface mesh
-                                    // should have boundary indicator
-                                    // 0. set those at the boundary
-                                    // of the mesh to 1 to force
-                                    // straight line refinement, then
-                                    // refine
+    // at this point, all cells and
+    // edges of the surface mesh
+    // should have boundary indicator
+    // 0. set those at the boundary
+    // of the mesh to 1 to force
+    // straight line refinement, then
+    // refine
     for (Triangulation<dim-1,dim>::active_cell_iterator
-          cell = boundary_mesh.begin_active();
-        cell != boundary_mesh.end(); ++cell)
+         cell = boundary_mesh.begin_active();
+         cell != boundary_mesh.end(); ++cell)
       for (unsigned int f=0; f<GeometryInfo<dim-1>::faces_per_cell; ++f)
-       if (cell->at_boundary(f))
-         cell->face(f)->set_boundary_indicator(1);
+        if (cell->at_boundary(f))
+          cell->face(f)->set_boundary_indicator(1);
 
     boundary_mesh.refine_global (2);
 
index 3b2fd8673ef5949eb0af0dbce00078bddbac10d1..4d9a7bfac0844a0104aa57226331a74d0f7d5072 100644 (file)
@@ -46,7 +46,8 @@ std::ofstream logfile("data_out/output");
 
 
 template <int dim, int spacedim>
-void test(std::string filename) {
+void test(std::string filename)
+{
 
   Triangulation<dim, spacedim> triangulation;
   GridIn<dim, spacedim> gi;
@@ -59,12 +60,12 @@ void test(std::string filename) {
   DoFHandler<dim,spacedim> dof_handler (triangulation);
 
   dof_handler.distribute_dofs (fe);
-  
+
   // Output the vertex numbering
   Vector<double> numbering(dof_handler.n_dofs());
-  for(unsigned int i=0; i <numbering.size(); ++i) 
-      numbering(i) = i;
-  
+  for (unsigned int i=0; i <numbering.size(); ++i)
+    numbering(i) = i;
+
   DataOut<dim, DoFHandler<dim,spacedim> > dataout;
   dataout.attach_dof_handler(dof_handler);
   dataout.add_data_vector(numbering, "numbering");
@@ -74,7 +75,7 @@ void test(std::string filename) {
 
 
 
-int main () 
+int main ()
 {
   deallog.attach(logfile);
   deallog.depth_console(0);
index 2e3d70e278726abcecdbdb860f75caa8ff492ffd..774efc62a488fce11e77c3c831b54801813f2db5 100644 (file)
@@ -65,7 +65,7 @@ int main ()
   data_out.attach_dof_handler (dof_handler);
 
   data_out.add_data_vector (soln, "scalar_data",
-                           DataOut<dim,DoFHandler<dim, dim+1> >::type_dof_data);
+                            DataOut<dim,DoFHandler<dim, dim+1> >::type_dof_data);
   data_out.build_patches ();
   data_out.write_vtk (deallog.get_file_stream());
 
index c626eced78b9c38bbc137703793834f232df6b26..e181f9b6353eb20c07fe00635d26d8d5165c4389 100644 (file)
@@ -42,26 +42,26 @@ std::ofstream logfile("data_out_03/output");
 template <int dim>
 class Identity : public Function<dim>
 {
-  public:
-    Identity ()
-                   :
-                   Function<dim>(dim)
-      {
-      }
-
-
-    virtual double value (const Point<dim> &p,
-                         const unsigned int component) const
-      {
-       return p(component);
-      }
-
-    virtual void vector_value(const Point<dim> &p,
-                             Vector< double > & values) const
-      {
-       for (unsigned int i=0;i<dim;i++)
-         values(i) = p(i);
-      }
+public:
+  Identity ()
+    :
+    Function<dim>(dim)
+  {
+  }
+
+
+  virtual double value (const Point<dim> &p,
+                        const unsigned int component) const
+  {
+    return p(component);
+  }
+
+  virtual void vector_value(const Point<dim> &p,
+                            Vector< double > &values) const
+  {
+    for (unsigned int i=0; i<dim; i++)
+      values(i) = p(i);
+  }
 };
 
 
@@ -77,7 +77,7 @@ int main ()
   Triangulation<2,3> tria;
 
   std::map< Triangulation<2,3>::cell_iterator,
-    Triangulation<3,3>::face_iterator> surface_to_volume_mapping;
+      Triangulation<3,3>::face_iterator> surface_to_volume_mapping;
 
   HyperBallBoundary<3> boundary_description;
   Triangulation<3> volume_mesh;
@@ -95,13 +95,13 @@ int main ()
   boundary_ids.insert(0);
 
   GridTools::extract_boundary_mesh (volume_mesh, tria,
-                                   boundary_ids);
+                                    boundary_ids);
 
   // test for the position
   MappingQ<2,3>   mapping(mapping_degree,true);
 
   FESystem<2,3> fe_test (FE_Q<2,3>
-                                                           (fe_degree),3);
+                         (fe_degree),3);
   DoFHandler<2,3> dh_test(tria);
   dh_test.distribute_dofs(fe_test);
 
@@ -109,17 +109,17 @@ int main ()
   VectorTools::interpolate(mapping,dh_test,Identity<3>(),position);
 
   std::vector<DataComponentInterpretation::DataComponentInterpretation>
-    data_component_interpretation
-    (3, DataComponentInterpretation::component_is_part_of_vector);
+  data_component_interpretation
+  (3, DataComponentInterpretation::component_is_part_of_vector);
 
   std::vector<std::string> solution_names (3, "position");
 
   DataOut<2, DoFHandler<2,3> > data_out;
   data_out.attach_dof_handler (dh_test);
   data_out.add_data_vector (position, solution_names,
-                           DataOut<2,DoFHandler<2,
-                           3> >::type_dof_data,
-                           data_component_interpretation);
+                            DataOut<2,DoFHandler<2,
+                            3> >::type_dof_data,
+                            data_component_interpretation);
   data_out.build_patches (mapping, 2);
 
   data_out.write_gnuplot (deallog.get_file_stream());
index e9a0d12805187236291eefca36c09d7dc85322b9..4aa106ceae7f5a1d391acf7ae782474ac6d04c6d 100644 (file)
@@ -38,25 +38,25 @@ void test ()
   GridGenerator::hyper_cube(volume_mesh);
   GridTools::extract_boundary_mesh (volume_mesh, boundary_mesh);
   for (Triangulation<dim,spacedim>::active_cell_iterator
-        cell = boundary_mesh.begin_active();
+       cell = boundary_mesh.begin_active();
        cell != boundary_mesh.end(); ++cell)
     {
       deallog << "Cell=" << cell;
       deallog << ", direction flag="
-             << (cell->direction_flag() ? "true" : "false")
-             << std::endl;
+              << (cell->direction_flag() ? "true" : "false")
+              << std::endl;
     }
 
   boundary_mesh.refine_global(1);
 
   for (Triangulation<dim,spacedim>::active_cell_iterator
-        cell = boundary_mesh.begin_active();
+       cell = boundary_mesh.begin_active();
        cell != boundary_mesh.end(); ++cell)
     {
       deallog << "Cell=" << cell << std::endl;
       deallog << ", direction flag="
-             << (cell->direction_flag() ? "true" : "false")
-             << std::endl;
+              << (cell->direction_flag() ? "true" : "false")
+              << std::endl;
     }
 }
 
@@ -69,4 +69,4 @@ int main ()
   deallog.depth_console(0);
 
   test ();
- }
+}
index 3f69c272d08052589c3ae5b4f163a0a4f2d323a8..262f6bcd7dda1e4da8c1040bc594ec8360d2cde3 100644 (file)
@@ -38,25 +38,25 @@ void test ()
   GridGenerator::hyper_cube(volume_mesh);
   GridTools::extract_boundary_mesh (volume_mesh, boundary_mesh);
   for (Triangulation<dim,spacedim>::active_cell_iterator
-        cell = boundary_mesh.begin_active();
+       cell = boundary_mesh.begin_active();
        cell != boundary_mesh.end(); ++cell)
     {
       deallog << "Cell=" << cell;
       deallog << ", direction flag="
-             << (cell->direction_flag() ? "true" : "false")
-             << std::endl;
+              << (cell->direction_flag() ? "true" : "false")
+              << std::endl;
     }
 
   boundary_mesh.refine_global(1);
 
   for (Triangulation<dim,spacedim>::active_cell_iterator
-        cell = boundary_mesh.begin_active();
+       cell = boundary_mesh.begin_active();
        cell != boundary_mesh.end(); ++cell)
     {
       deallog << "Cell=" << cell << std::endl;
       deallog << ", direction flag="
-             << (cell->direction_flag() ? "true" : "false")
-             << std::endl;
+              << (cell->direction_flag() ? "true" : "false")
+              << std::endl;
     }
 }
 
@@ -69,4 +69,4 @@ int main ()
   deallog.depth_console(0);
 
   test ();
- }
+}
index 8fc700b5d97f3eeb83e2fd6b62f5612dac01e7d2..f425bbfd32d2bfb06b42d80a5049cb7ab1a2f832 100644 (file)
@@ -37,10 +37,10 @@ void test ()
   volume_mesh.refine_global(1);
 
   for (typename Triangulation<dim>::active_cell_iterator
-        cell = volume_mesh.begin_active();
+       cell = volume_mesh.begin_active();
        cell != volume_mesh.end(); ++cell)
     Assert (cell->direction_flag() == true,
-           ExcInternalError());
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
index d93b95014265443315c775ebf596aa0854bf8e88..be7564e7a6b90fddc9b255592df928532b55095f 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim>(2) {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square(); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { values(0) = value(p,0);
-       values(1) = value(p,1); }
+public:
+  MySquareFunction () : Function<dim>(2) {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square();
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+    values(1) = value(p,1);
+  }
 };
 
 
@@ -75,38 +79,38 @@ get_q_face <1>()
 template <int dim, int spacedim>
 void make_mesh (Triangulation<dim,spacedim> &tria)
 {
-  
+
   GridGenerator::hyper_cube(tria, -1, 1);
 
-                                   // refine the mesh in a random way so as to
-                                   // generate as many cells with
-                                   // hanging nodes as possible
+  // refine the mesh in a random way so as to
+  // generate as many cells with
+  // hanging nodes as possible
   tria.refine_global (4-dim);
   const double steps[4] = { /*d=0*/ 0, 7, 3, 3 };
   for (unsigned int i=0; i<steps[dim]; ++i)
     {
       typename Triangulation<dim,spacedim>::active_cell_iterator
-        cell = tria.begin_active();
+      cell = tria.begin_active();
       for (unsigned int index=0; cell != tria.end(); ++cell, ++index)
         if (index % (3*dim) == 0)
           cell->set_refine_flag();
       tria.execute_coarsening_and_refinement ();
     }
 
-                                  // we now have a number of cells,
-                                  // flag them with some subdomain
-                                  // ids based on their position, in
-                                  // particular we take the quadrant
-                                  // (octant)
+  // we now have a number of cells,
+  // flag them with some subdomain
+  // ids based on their position, in
+  // particular we take the quadrant
+  // (octant)
   typename Triangulation<dim,spacedim>::active_cell_iterator
-    cell = tria.begin_active (),
-    endc = tria.end ();
+  cell = tria.begin_active (),
+  endc = tria.end ();
   for (; cell!=endc; ++cell)
     {
       unsigned int subdomain = 0;
       for (unsigned int d=0; d<dim; ++d)
-       if (cell->center()(d) > 0)
-         subdomain |= (1<<d);
+        if (cell->center()(d) > 0)
+          subdomain |= (1<<d);
       Assert (subdomain < (1<<dim), ExcInternalError());
 
       cell->set_subdomain_id (subdomain);
@@ -121,10 +125,10 @@ void
 check ()
 {
   Functions::CosineFunction<spacedim> function;
-  
+
   Triangulation<dim,spacedim> tria;
   make_mesh (tria);
-  
+
   FE_Q<dim,spacedim> element(3);
   DoFHandler<dim,spacedim> dof(tria);
   dof.distribute_dofs(element);
@@ -134,53 +138,53 @@ check ()
 
   std::map<types::boundary_id,const Function<spacedim>*> neumann_bc;
   neumann_bc[0] = &function;
-  
+
   Vector<double> v (dof.n_dofs());
   VectorTools::interpolate (mapping, dof, function, v);
 
   Vector<float> error1 (tria.n_active_cells());
   Vector<float> error2 (tria.n_active_cells());
 
-                                   // compute error by looking at all cells at
-                                   // once and output this as the base line
-                                   // results. scale results so that they show
-                                   // up in the output file as a reasonable
-                                   // number
+  // compute error by looking at all cells at
+  // once and output this as the base line
+  // results. scale results so that they show
+  // up in the output file as a reasonable
+  // number
   KellyErrorEstimator<dim,spacedim>::estimate (mapping, dof, q_face, neumann_bc,
-                                              v, error1);
+                                               v, error1);
   const double scaling_factor = 10000.*error1.size()/error1.l1_norm();
   error1 *= scaling_factor;
-    
+
   deallog << "Estimated error indicators:" << std::endl;
   for (unsigned int i=0; i<error1.size(); ++i)
     deallog << error1(i) << std::endl;
 
-                                   // then do the same with different
-                                   // subdomain ids and add up the result
+  // then do the same with different
+  // subdomain ids and add up the result
   for (unsigned int subdomain=0; subdomain<(1<<spacedim); ++subdomain)
     {
       deallog << "Subdomain id=" << subdomain << std::endl;
-        
+
       Vector<float> this_error (tria.n_active_cells());
       KellyErrorEstimator<dim,spacedim>::estimate (mapping, dof, q_face, neumann_bc,
-                                                  v, this_error,
-                                                  std::vector<bool>(), 0,
-                                                  multithread_info.n_default_threads,
-                                                  subdomain);
+                                                   v, this_error,
+                                                   std::vector<bool>(), 0,
+                                                   multithread_info.n_default_threads,
+                                                   subdomain);
       this_error *= scaling_factor;
 
-                                       // copy the result into error2. since
-                                       // every invokation of the kelly
-                                       // estimator should only operate on
-                                       // the cells of one subdomain,
-                                       // whenever there is something in
-                                       // this_error, the corresponding
-                                       // entry in error2 should still be
-                                       // empty
+      // copy the result into error2. since
+      // every invokation of the kelly
+      // estimator should only operate on
+      // the cells of one subdomain,
+      // whenever there is something in
+      // this_error, the corresponding
+      // entry in error2 should still be
+      // empty
       for (unsigned int i=0; i<this_error.size(); ++i)
         {
           deallog << i << ' ' << this_error(i) << std::endl;
-            
+
           Assert ((this_error(i)==0) || (error2(i)==0),
                   ExcInternalError());
           if (this_error(i) != 0)
@@ -190,7 +194,7 @@ check ()
 
 //                                   now compare the results of the two
 //                                   computations
-   Assert (error1 == error2, ExcInternalError());
+  Assert (error1 == error2, ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
@@ -200,10 +204,10 @@ int main ()
 {
   std::ofstream logfile ("error_estimator_01/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
-  
+
   deallog.push ("1d");
   check<1,2> ();
   deallog.pop();
index ae73d053e4f53550ef8220cf0651a53e27e923f6..75de68acfadca6c7d147a7eda9d2681fb0359ea6 100644 (file)
@@ -38,46 +38,49 @@ using namespace std;
 
 template <int s_dim, int spacedim>
 bool test_vertices_orientation(const Triangulation<s_dim,spacedim> &boundary_mesh,
-                              map< typename Triangulation<s_dim,spacedim>::cell_iterator,
-                                   typename Triangulation<s_dim+1,spacedim>::face_iterator >
-                              &surface_to_volume_mapping,
-                              const int verbosity = 1)
+                               map< typename Triangulation<s_dim,spacedim>::cell_iterator,
+                               typename Triangulation<s_dim+1,spacedim>::face_iterator >
+                               &surface_to_volume_mapping,
+                               const int verbosity = 1)
 {
   typename Triangulation<s_dim,spacedim>::active_cell_iterator
-    cell = boundary_mesh.begin_active(),
-    endc = boundary_mesh.end();
+  cell = boundary_mesh.begin_active(),
+  endc = boundary_mesh.end();
   typename Triangulation<s_dim+1,spacedim>::face_iterator face;
 
   bool success = true;
 
   if (verbosity>1)
     deallog << "Vol faces" << "\t" << "Surf cell" <<
-      "\t" << "Distance" <<endl;
-
-  for (; cell!=endc; ++cell){
-
-    face = surface_to_volume_mapping [cell];
-
-    for (unsigned int k=0; k<GeometryInfo<s_dim>::vertices_per_cell; ++k)
-      {
-       Point<spacedim> diff(face->vertex(k));
-       diff -= cell->vertex(k);
-       if (verbosity>1){
-         deallog << face->vertex(k) << "\t\t";
-         deallog << cell->vertex(k) << "\t\t\t" << diff.square() << endl;
-       }
-       if (diff.square()>0){
-         success = false;
-         break;
-       }
-      }
-    if (verbosity>1) deallog << endl;
-  }
+            "\t" << "Distance" <<endl;
+
+  for (; cell!=endc; ++cell)
+    {
+
+      face = surface_to_volume_mapping [cell];
+
+      for (unsigned int k=0; k<GeometryInfo<s_dim>::vertices_per_cell; ++k)
+        {
+          Point<spacedim> diff(face->vertex(k));
+          diff -= cell->vertex(k);
+          if (verbosity>1)
+            {
+              deallog << face->vertex(k) << "\t\t";
+              deallog << cell->vertex(k) << "\t\t\t" << diff.square() << endl;
+            }
+          if (diff.square()>0)
+            {
+              success = false;
+              break;
+            }
+        }
+      if (verbosity>1) deallog << endl;
+    }
   return success;
 }
 
 template <int dim, int spacedim>
-void save_mesh(const Triangulation<dim,spacedim>tria)
+void save_mesh(const Triangulation<dim,spacedim> &tria)
 {
   GridOut grid_out;
   grid_out.write_ucd (tria, deallog.get_file_stream());
@@ -91,13 +94,14 @@ int main ()
   deallog.attach(logfile);
   deallog.depth_console(0);
 
-  { // Extract the whole boundary of a hyper-cube
+  {
+    // Extract the whole boundary of a hyper-cube
     const int dim = 2;
 
     deallog << "Testing hyper_cube in dim: " << dim << "..."<< endl;
     map< Triangulation<dim-1,dim>::cell_iterator,
-        Triangulation<dim,dim>::face_iterator>
-      surface_to_volume_mapping;
+         Triangulation<dim,dim>::face_iterator>
+         surface_to_volume_mapping;
 
     Triangulation<dim> volume_mesh;
     GridGenerator::hyper_cube(volume_mesh);
@@ -121,13 +125,14 @@ int main ()
 
   }
 
-  { // Extract the whole boundary of a hyper-cube
+  {
+    // Extract the whole boundary of a hyper-cube
     const int dim = 3;
 
     deallog << "Testing hyper_cube in dim: " << dim << "..."<< endl;
     map< Triangulation<dim-1,dim>::cell_iterator,
-        Triangulation<dim,dim>::face_iterator>
-      surface_to_volume_mapping;
+         Triangulation<dim,dim>::face_iterator>
+         surface_to_volume_mapping;
 
     Triangulation<dim> volume_mesh;
     GridGenerator::hyper_cube(volume_mesh);
@@ -152,14 +157,15 @@ int main ()
   }
 
 
-  { // Extract a piece of the boundary of a hyper-cube
+  {
+    // Extract a piece of the boundary of a hyper-cube
 
     const int dim = 3;
     deallog << "Testing hyper_cube in dim: " << dim << "..."<< endl;
 
     map< Triangulation<dim-1,dim>::cell_iterator,
-        Triangulation<dim,dim>::face_iterator>
-      surface_to_volume_mapping;
+         Triangulation<dim,dim>::face_iterator>
+         surface_to_volume_mapping;
 
     Triangulation<dim> volume_mesh;
     GridGenerator::hyper_cube(volume_mesh);
@@ -174,7 +180,7 @@ int main ()
 
     surface_to_volume_mapping
       = GridTools::extract_boundary_mesh (volume_mesh, boundary_mesh,
-                                         boundary_ids);
+                                          boundary_ids);
 
     if (test_vertices_orientation(boundary_mesh, surface_to_volume_mapping))
       deallog << "Passed.";
@@ -190,5 +196,5 @@ int main ()
 
 
 
-   return 0;
- }
+  return 0;
+}
index ad346484ca43b35b8f40f6f1f13f74e1d2bda010..729a35cc8dfc3b48843fd7afd36d991290fd39cc 100644 (file)
@@ -40,48 +40,52 @@ using namespace std;
 
 template <int s_dim, int spacedim>
 bool test_vertices_orientation(const Triangulation<s_dim,spacedim> &boundary_mesh,
-                              map< typename Triangulation<s_dim,spacedim>::cell_iterator,
-                                   typename Triangulation<s_dim+1,spacedim>::face_iterator >
-                              &surface_to_volume_mapping,
-                              const int verbosity = 1)
+                               map< typename Triangulation<s_dim,spacedim>::cell_iterator,
+                               typename Triangulation<s_dim+1,spacedim>::face_iterator >
+                               &surface_to_volume_mapping,
+                               const int verbosity = 1)
 {
   typename Triangulation<s_dim,spacedim>::active_cell_iterator
-    cell = boundary_mesh.begin_active(),
-    endc = boundary_mesh.end();
+  cell = boundary_mesh.begin_active(),
+  endc = boundary_mesh.end();
   typename Triangulation<s_dim+1,spacedim>::face_iterator face;
 
   bool success = true;
 
-  if (verbosity>1){
-    deallog << "The last column should be 0" <<endl;
-    deallog << "Vol faces" << "\t\t" << "Surf cell" <<
-      "\t\t" << "Distance" <<endl<<endl;
-  }
-
-  for (; cell!=endc; ++cell){
-
-    face = surface_to_volume_mapping [cell];
-
-    for (unsigned int k=0; k<GeometryInfo<s_dim>::vertices_per_cell; ++k)
-      {
-       Point<spacedim> diff(face->vertex(k));
-       diff -= cell->vertex(k);
-       if (verbosity>1){
-         deallog << face->vertex(k) << "\t\t";
-         deallog << cell->vertex(k) << "\t\t\t" << diff.square() << endl;
-       }
-       if (diff.square()>0){
-         success = false;
-         break;
-       }
-      }
-    if (verbosity>1) deallog << endl;
-  }
+  if (verbosity>1)
+    {
+      deallog << "The last column should be 0" <<endl;
+      deallog << "Vol faces" << "\t\t" << "Surf cell" <<
+              "\t\t" << "Distance" <<endl<<endl;
+    }
+
+  for (; cell!=endc; ++cell)
+    {
+
+      face = surface_to_volume_mapping [cell];
+
+      for (unsigned int k=0; k<GeometryInfo<s_dim>::vertices_per_cell; ++k)
+        {
+          Point<spacedim> diff(face->vertex(k));
+          diff -= cell->vertex(k);
+          if (verbosity>1)
+            {
+              deallog << face->vertex(k) << "\t\t";
+              deallog << cell->vertex(k) << "\t\t\t" << diff.square() << endl;
+            }
+          if (diff.square()>0)
+            {
+              success = false;
+              break;
+            }
+        }
+      if (verbosity>1) deallog << endl;
+    }
   return success;
 }
 
 template <int dim, int spacedim>
-void save_mesh(const Triangulation<dim,spacedim>tria)
+void save_mesh(const Triangulation<dim,spacedim> &tria)
 {
   GridOut grid_out;
   grid_out.write_gnuplot (tria, deallog.get_file_stream());
@@ -96,14 +100,15 @@ int main ()
   deallog.depth_console(0);
 
 
-  { // Extract the boundary of a hyper-sphere
+  {
+    // Extract the boundary of a hyper-sphere
 
     const int dim = 3;
     deallog << "Testing hyper_cube in dim: " << dim << "..."<< endl;
 
     map< Triangulation<dim-1,dim>::cell_iterator,
-        Triangulation<dim,dim>::face_iterator>
-      surface_to_volume_mapping;
+         Triangulation<dim,dim>::face_iterator>
+         surface_to_volume_mapping;
     Triangulation<dim> volume_mesh;
     GridGenerator::hyper_ball(volume_mesh);
 
@@ -115,10 +120,10 @@ int main ()
       = GridTools::extract_boundary_mesh (volume_mesh, boundary_mesh);
 
     Assert (test_vertices_orientation(boundary_mesh, surface_to_volume_mapping,2),
-           ExcInternalError());
+            ExcInternalError());
     save_mesh(boundary_mesh);
   }
 
 
-   return 0;
- }
+  return 0;
+}
index 0287d6c3b798b5eb4f2c622114e6cadd54f907ca..949b40c708d40fbdbc97266678e7a4cfe63c4889 100644 (file)
@@ -40,38 +40,39 @@ using namespace std;
 
 template <int s_dim, int spacedim>
 void test_vertices_orientation(const Triangulation<s_dim,spacedim> &boundary_mesh,
-                              map< typename Triangulation<s_dim,spacedim>::cell_iterator,
-                                   typename Triangulation<s_dim+1,spacedim>::face_iterator >
-                              &surface_to_volume_mapping)
+                               map< typename Triangulation<s_dim,spacedim>::cell_iterator,
+                               typename Triangulation<s_dim+1,spacedim>::face_iterator >
+                               &surface_to_volume_mapping)
 {
   typename Triangulation<s_dim,spacedim>::active_cell_iterator
-    cell = boundary_mesh.begin_active(),
-    endc = boundary_mesh.end();
+  cell = boundary_mesh.begin_active(),
+  endc = boundary_mesh.end();
   typename Triangulation<s_dim+1,spacedim>::face_iterator face;
 
-  for (; cell!=endc; ++cell){
+  for (; cell!=endc; ++cell)
+    {
 
-    face = surface_to_volume_mapping [cell];
+      face = surface_to_volume_mapping [cell];
 
-    deallog << "Surface cell: " << cell << " with vertices:" << std::endl;
-    for (unsigned int k=0; k<GeometryInfo<s_dim>::vertices_per_cell; ++k)
-      deallog << "  " << cell->vertex(k) << std::endl;
+      deallog << "Surface cell: " << cell << " with vertices:" << std::endl;
+      for (unsigned int k=0; k<GeometryInfo<s_dim>::vertices_per_cell; ++k)
+        deallog << "  " << cell->vertex(k) << std::endl;
 
-    deallog << "Volume face: " << face << " with vertices:" << std::endl;
-    for (unsigned int k=0; k<GeometryInfo<s_dim>::vertices_per_cell; ++k)
-      deallog << "  " << face->vertex(k) << std::endl;
+      deallog << "Volume face: " << face << " with vertices:" << std::endl;
+      for (unsigned int k=0; k<GeometryInfo<s_dim>::vertices_per_cell; ++k)
+        deallog << "  " << face->vertex(k) << std::endl;
 
-    for (unsigned int k=0; k<GeometryInfo<s_dim>::vertices_per_cell; ++k)
-      {
-       Point<spacedim> diff(face->vertex(k));
-       diff -= cell->vertex(k);
-       Assert (diff.square() == 0, ExcInternalError());
-      }
-  }
+      for (unsigned int k=0; k<GeometryInfo<s_dim>::vertices_per_cell; ++k)
+        {
+          Point<spacedim> diff(face->vertex(k));
+          diff -= cell->vertex(k);
+          Assert (diff.square() == 0, ExcInternalError());
+        }
+    }
 }
 
 template <int dim, int spacedim>
-void save_mesh(const Triangulation<dim,spacedim>tria)
+void save_mesh(const Triangulation<dim,spacedim> &tria)
 {
   GridOut grid_out;
   grid_out.write_gnuplot (tria, deallog.get_file_stream());
@@ -86,14 +87,15 @@ int main ()
   deallog.depth_console(0);
 
 
-  { // Extract the boundary of a hyper-sphere
+  {
+    // Extract the boundary of a hyper-sphere
 
     const int dim = 3;
     deallog << "Testing hyper_cube in dim: " << dim << "..."<< endl;
 
     map< Triangulation<dim-1,dim>::cell_iterator,
-        Triangulation<dim,dim>::face_iterator>
-      surface_to_volume_mapping;
+         Triangulation<dim,dim>::face_iterator>
+         surface_to_volume_mapping;
     const HyperBallBoundary<dim> boundary_description;
     Triangulation<dim> volume_mesh;
     GridGenerator::hyper_ball(volume_mesh);
@@ -116,5 +118,5 @@ int main ()
   }
 
 
-   return 0;
- }
+  return 0;
+}
index ae6d80898c2195bab256ac8a96cfa5a76b44a5cf..f0976c93844f4b112a25e133d835fc8c7c3232d8 100644 (file)
@@ -38,48 +38,49 @@ using namespace std;
 
 template <int s_dim, int spacedim>
 void test_vertices_orientation(const Triangulation<s_dim,spacedim> &boundary_mesh,
-                              map< typename Triangulation<s_dim,spacedim>::cell_iterator,
-                                   typename Triangulation<s_dim+1,spacedim>::face_iterator >
-                              &surface_to_volume_mapping)
+                               map< typename Triangulation<s_dim,spacedim>::cell_iterator,
+                               typename Triangulation<s_dim+1,spacedim>::face_iterator >
+                               &surface_to_volume_mapping)
 {
   typename Triangulation<s_dim,spacedim>::active_cell_iterator
-    cell = boundary_mesh.begin_active(),
-    endc = boundary_mesh.end();
+  cell = boundary_mesh.begin_active(),
+  endc = boundary_mesh.end();
   typename Triangulation<s_dim+1,spacedim>::face_iterator face;
 
-  for (; cell!=endc; ++cell){
-
-    face = surface_to_volume_mapping [cell];
-    Assert (face->at_boundary(), ExcInternalError());
-
-    deallog << "Surface cell: " << cell << " with vertices:" << std::endl;
-    for (unsigned int k=0; k<GeometryInfo<s_dim>::vertices_per_cell; ++k)
-      {
-       deallog << "  " << cell->vertex(k) << std::endl;
-       Assert (std::fabs(cell->vertex(k).distance (Point<spacedim>()) - 1) < 1e-12,
-               ExcInternalError());
-      }
-
-    deallog << "Volume face: " << face << " with vertices:" << std::endl;
-    for (unsigned int k=0; k<GeometryInfo<s_dim>::vertices_per_cell; ++k)
-      {
-       deallog << "  " << face->vertex(k) << std::endl;
-       Assert (std::fabs(face->vertex(k).distance (Point<spacedim>()) - 1) < 1e-12,
-               ExcInternalError());
-      }
-
-
-    for (unsigned int k=0; k<GeometryInfo<s_dim>::vertices_per_cell; ++k)
-      {
-       Point<spacedim> diff(face->vertex(k));
-       diff -= cell->vertex(k);
-       Assert (diff.square() == 0, ExcInternalError());
-      }
-  }
+  for (; cell!=endc; ++cell)
+    {
+
+      face = surface_to_volume_mapping [cell];
+      Assert (face->at_boundary(), ExcInternalError());
+
+      deallog << "Surface cell: " << cell << " with vertices:" << std::endl;
+      for (unsigned int k=0; k<GeometryInfo<s_dim>::vertices_per_cell; ++k)
+        {
+          deallog << "  " << cell->vertex(k) << std::endl;
+          Assert (std::fabs(cell->vertex(k).distance (Point<spacedim>()) - 1) < 1e-12,
+                  ExcInternalError());
+        }
+
+      deallog << "Volume face: " << face << " with vertices:" << std::endl;
+      for (unsigned int k=0; k<GeometryInfo<s_dim>::vertices_per_cell; ++k)
+        {
+          deallog << "  " << face->vertex(k) << std::endl;
+          Assert (std::fabs(face->vertex(k).distance (Point<spacedim>()) - 1) < 1e-12,
+                  ExcInternalError());
+        }
+
+
+      for (unsigned int k=0; k<GeometryInfo<s_dim>::vertices_per_cell; ++k)
+        {
+          Point<spacedim> diff(face->vertex(k));
+          diff -= cell->vertex(k);
+          Assert (diff.square() == 0, ExcInternalError());
+        }
+    }
 }
 
 template <int dim, int spacedim>
-void save_mesh(const Triangulation<dim,spacedim>tria)
+void save_mesh(const Triangulation<dim,spacedim> &tria)
 {
   GridOut grid_out;
   grid_out.write_gnuplot (tria, deallog.get_file_stream());
@@ -94,23 +95,24 @@ int main ()
   deallog.depth_console(0);
 
 
-  { // Extract the boundary of a hyper-sphere
+  {
+    // Extract the boundary of a hyper-sphere
 
     const int dim = 3;
     deallog << "Testing hyper_cube in dim: " << dim << "..."<< endl;
 
     map< Triangulation<dim-1,dim>::cell_iterator,
-        Triangulation<dim,dim>::face_iterator>
-      surface_to_volume_mapping;
+         Triangulation<dim,dim>::face_iterator>
+         surface_to_volume_mapping;
     const HyperBallBoundary<dim> boundary_description;
     Triangulation<dim> volume_mesh;
     GridGenerator::hyper_ball(volume_mesh);
     for (Triangulation<dim>::active_cell_iterator
-          cell = volume_mesh.begin_active();
-        cell != volume_mesh.end(); ++cell)
+         cell = volume_mesh.begin_active();
+         cell != volume_mesh.end(); ++cell)
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
-       if (cell->at_boundary(f))
-         cell->face(f)->set_all_boundary_indicators (1);
+        if (cell->at_boundary(f))
+          cell->face(f)->set_all_boundary_indicators (1);
     volume_mesh.set_boundary (1, boundary_description);
     volume_mesh.refine_global (1);
 
@@ -130,5 +132,5 @@ int main ()
   }
 
 
-   return 0;
- }
+  return 0;
+}
index 74d7d0ea46ba458f27d8a1f958f92be3c8b22408..8b388a94d0b67ba9fd082308a89bb5e30e8560db 100644 (file)
@@ -38,48 +38,49 @@ using namespace std;
 
 template <int s_dim, int spacedim>
 void test_vertices_orientation(const Triangulation<s_dim,spacedim> &boundary_mesh,
-                              map< typename Triangulation<s_dim,spacedim>::cell_iterator,
-                                   typename Triangulation<s_dim+1,spacedim>::face_iterator >
-                              &surface_to_volume_mapping)
+                               map< typename Triangulation<s_dim,spacedim>::cell_iterator,
+                               typename Triangulation<s_dim+1,spacedim>::face_iterator >
+                               &surface_to_volume_mapping)
 {
   typename Triangulation<s_dim,spacedim>::active_cell_iterator
-    cell = boundary_mesh.begin_active(),
-    endc = boundary_mesh.end();
+  cell = boundary_mesh.begin_active(),
+  endc = boundary_mesh.end();
   typename Triangulation<s_dim+1,spacedim>::face_iterator face;
 
-  for (; cell!=endc; ++cell){
-
-    face = surface_to_volume_mapping [cell];
-    Assert (face->at_boundary(), ExcInternalError());
-
-    deallog << "Surface cell: " << cell << " with vertices:" << std::endl;
-    for (unsigned int k=0; k<GeometryInfo<s_dim>::vertices_per_cell; ++k)
-      {
-       deallog << "  " << cell->vertex(k) << std::endl;
-       Assert (std::fabs(cell->vertex(k).distance (Point<spacedim>()) - 1) < 1e-12,
-               ExcInternalError());
-      }
-
-    deallog << "Volume face: " << face << " with vertices:" << std::endl;
-    for (unsigned int k=0; k<GeometryInfo<s_dim>::vertices_per_cell; ++k)
-      {
-       deallog << "  " << face->vertex(k) << std::endl;
-       Assert (std::fabs(face->vertex(k).distance (Point<spacedim>()) - 1) < 1e-12,
-               ExcInternalError());
-      }
-
-
-    for (unsigned int k=0; k<GeometryInfo<s_dim>::vertices_per_cell; ++k)
-      {
-       Point<spacedim> diff(face->vertex(k));
-       diff -= cell->vertex(k);
-       Assert (diff.square() == 0, ExcInternalError());
-      }
-  }
+  for (; cell!=endc; ++cell)
+    {
+
+      face = surface_to_volume_mapping [cell];
+      Assert (face->at_boundary(), ExcInternalError());
+
+      deallog << "Surface cell: " << cell << " with vertices:" << std::endl;
+      for (unsigned int k=0; k<GeometryInfo<s_dim>::vertices_per_cell; ++k)
+        {
+          deallog << "  " << cell->vertex(k) << std::endl;
+          Assert (std::fabs(cell->vertex(k).distance (Point<spacedim>()) - 1) < 1e-12,
+                  ExcInternalError());
+        }
+
+      deallog << "Volume face: " << face << " with vertices:" << std::endl;
+      for (unsigned int k=0; k<GeometryInfo<s_dim>::vertices_per_cell; ++k)
+        {
+          deallog << "  " << face->vertex(k) << std::endl;
+          Assert (std::fabs(face->vertex(k).distance (Point<spacedim>()) - 1) < 1e-12,
+                  ExcInternalError());
+        }
+
+
+      for (unsigned int k=0; k<GeometryInfo<s_dim>::vertices_per_cell; ++k)
+        {
+          Point<spacedim> diff(face->vertex(k));
+          diff -= cell->vertex(k);
+          Assert (diff.square() == 0, ExcInternalError());
+        }
+    }
 }
 
 template <int dim, int spacedim>
-void save_mesh(const Triangulation<dim,spacedim>tria)
+void save_mesh(const Triangulation<dim,spacedim> &tria)
 {
   GridOut grid_out;
   grid_out.write_gnuplot (tria, deallog.get_file_stream());
@@ -94,23 +95,24 @@ int main ()
   deallog.depth_console(0);
 
 
-  { // Extract the boundary of a hyper-sphere
+  {
+    // Extract the boundary of a hyper-sphere
 
     const int dim = 3;
     deallog << "Testing hyper_cube in dim: " << dim << "..."<< endl;
 
     map< Triangulation<dim-1,dim>::cell_iterator,
-        Triangulation<dim,dim>::face_iterator>
-      surface_to_volume_mapping;
+         Triangulation<dim,dim>::face_iterator>
+         surface_to_volume_mapping;
     const HyperBallBoundary<dim> boundary_description;
     Triangulation<dim> volume_mesh;
     GridGenerator::hyper_ball(volume_mesh);
     for (Triangulation<dim>::active_cell_iterator
-          cell = volume_mesh.begin_active();
-        cell != volume_mesh.end(); ++cell)
+         cell = volume_mesh.begin_active();
+         cell != volume_mesh.end(); ++cell)
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
-       if (cell->at_boundary(f) && (cell->center()[dim-1]>0))
-         cell->face(f)->set_all_boundary_indicators (1);
+        if (cell->at_boundary(f) && (cell->center()[dim-1]>0))
+          cell->face(f)->set_all_boundary_indicators (1);
 
     volume_mesh.set_boundary (1, boundary_description);
     volume_mesh.set_boundary (0, boundary_description);
@@ -126,7 +128,7 @@ int main ()
 
     surface_to_volume_mapping
       = GridTools::extract_boundary_mesh (volume_mesh, boundary_mesh,
-                                         boundary_ids);
+                                          boundary_ids);
 
     deallog << volume_mesh.n_active_cells () << std::endl;
     deallog << boundary_mesh.n_active_cells () << std::endl;
@@ -137,5 +139,5 @@ int main ()
   }
 
 
-   return 0;
- }
+  return 0;
+}
index b2218eb9832936ebd129262877a8a60e8de75358..c8bfbc29ccaedb1703c5963c9c9e6c4b45469264 100644 (file)
@@ -38,7 +38,7 @@ void test ()
 
   Triangulation<dim-1,dim> boundary_mesh;
   map<Triangulation<dim-1,dim>::cell_iterator,Triangulation<dim,dim>::face_iterator >
-    surface_to_volume_mapping;
+  surface_to_volume_mapping;
   Triangulation<dim> volume_mesh;
   GridGenerator::hyper_cube(volume_mesh);
 
@@ -52,17 +52,17 @@ void test ()
   deallog << "n_dofs=" << boundary_dh.n_dofs() << std::endl;
 
   for (DoFHandler<dim-1,dim>::active_cell_iterator
-        cell = boundary_dh.begin_active(),
-        endc = boundary_dh.end(); cell!=endc; ++cell)
+       cell = boundary_dh.begin_active(),
+       endc = boundary_dh.end(); cell!=endc; ++cell)
     {
       deallog << "Cell: " << cell << std::endl;
       for (unsigned int v=0; v<GeometryInfo<dim-1>::vertices_per_cell; ++v)
-       {
-         unsigned int index = cell->vertex_dof_index(v,0);
-         deallog << "vertex: " << v
-                 << ", global: " << cell->vertex_index(v)
-                 << " index: " << index << std::endl;
-       }
+        {
+          unsigned int index = cell->vertex_dof_index(v,0);
+          deallog << "vertex: " << v
+                  << ", global: " << cell->vertex_index(v)
+                  << " index: " << index << std::endl;
+        }
 
       deallog << std::endl;
     }
@@ -78,4 +78,4 @@ int main ()
   deallog.depth_console(0);
 
   test ();
- }
+}
index 8b87d3f602f4dd14fb0b283d3b09567bfa60bc09..f00bb4c90cfdb48b439a2ba8d227c3f2b94fc82f 100644 (file)
@@ -39,7 +39,7 @@ void test ()
 
   Triangulation<dim,spacedim> boundary_mesh;
   map<Triangulation<dim,spacedim>::cell_iterator,Triangulation<spacedim,spacedim>::face_iterator >
-    surface_to_volume_mapping;
+  surface_to_volume_mapping;
   Triangulation<spacedim> volume_mesh;
   GridGenerator::hyper_cube(volume_mesh);
   volume_mesh.refine_global(1);
@@ -48,12 +48,12 @@ void test ()
   boundary_mesh.refine_global(1);
 
   for (Triangulation<dim,spacedim>::active_cell_iterator
-        cell = boundary_mesh.begin_active();
+       cell = boundary_mesh.begin_active();
        cell != boundary_mesh.end(); ++cell)
     {
       deallog << "Cell=" << cell << std::endl;
       deallog << "   neighbors: " << cell->neighbor(0) << ' ' << cell->neighbor(1)
-             << std::endl;
+              << std::endl;
     }
 }
 
@@ -66,4 +66,4 @@ int main ()
   deallog.depth_console(0);
 
   test ();
- }
+}
index 68b97f3f24d13c284f5dbfb316f78494f879fb4c..c92143821c63dac5e9b9cedaf22df2d54dd2bcbc 100644 (file)
@@ -55,13 +55,13 @@ namespace Step38
   private:
     static const unsigned int boundary_dim = spacedim-1;
 
-    Triangulation<spacedim>                             volume_mesh_triangulation;
+    Triangulation<spacedim>          volume_mesh_triangulation;
     Triangulation<boundary_dim,spacedim>   boundary_triangulation;
 
-    FE_Q<spacedim>                                              space_fe;
+    FE_Q<spacedim>             space_fe;
     FE_Q<boundary_dim,spacedim>            boundary_fe;
 
-    DoFHandler<spacedim>                                        space_dof_handler;
+    DoFHandler<spacedim>           space_dof_handler;
     DoFHandler<boundary_dim,spacedim>      contact_dof_handler;
 
   };
@@ -70,11 +70,11 @@ namespace Step38
   template <int spacedim>
   Extract_Mesh_Test<spacedim>::
   Extract_Mesh_Test ()
-  :
-  space_fe (spacedim),
-  boundary_fe (1),
-  space_dof_handler(volume_mesh_triangulation),
-  contact_dof_handler(boundary_triangulation)
+    :
+    space_fe (spacedim),
+    boundary_fe (1),
+    space_dof_handler(volume_mesh_triangulation),
+    contact_dof_handler(boundary_triangulation)
   {}
 
   template <int spacedim>
@@ -87,19 +87,19 @@ namespace Step38
     space_dof_handler.distribute_dofs(space_fe);
 
     std::map<typename DoFHandler<boundary_dim, spacedim>::cell_iterator,
-            typename DoFHandler<spacedim>::face_iterator>
-      element_assignment =
-      GridTools::extract_boundary_mesh(space_dof_handler,
-                                      contact_dof_handler,
-                                      boundary_ids);
+        typename DoFHandler<spacedim>::face_iterator>
+        element_assignment =
+          GridTools::extract_boundary_mesh(space_dof_handler,
+                                           contact_dof_handler,
+                                           boundary_ids);
 
     contact_dof_handler.distribute_dofs(boundary_fe);
 
     typename std::map<typename DoFHandler<boundary_dim, spacedim>::cell_iterator,typename DoFHandler<spacedim>::face_iterator>::iterator Iterator;
 
-    for (Iterator = element_assignment.begin();Iterator != element_assignment.end(); ++Iterator)
+    for (Iterator = element_assignment.begin(); Iterator != element_assignment.end(); ++Iterator)
       {
-       deallog << "element_assignment maps " << Iterator->first << " onto " << Iterator->second << std::endl;
+        deallog << "element_assignment maps " << Iterator->first << " onto " << Iterator->second << std::endl;
       }
 
   }
@@ -119,4 +119,4 @@ int main ()
     Extract_Mesh_Test<2> Test;
     Test.run();
   }
- }
+}
index 0248c80d334e7a97759e9ed6c42de9c3be013ea2..401306b56d07add3932e1db3598745c58cda6f9e 100644 (file)
@@ -41,8 +41,8 @@ int main ()
       deallog << "Degree=" << degree << std::endl;
       FE_DGQ<dim,spacedim> fe(degree);
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
-         deallog << fe.get_prolongation_matrix(0)(i,j) << std::endl;
+        for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
+          deallog << fe.get_prolongation_matrix(0)(i,j) << std::endl;
     }
 
   return 0;
index d17c203d3e3f96f2767dab189043e5e0493762bf..79ba606be300ca88dd98322a36c28b4dee5ddffd 100644 (file)
@@ -47,36 +47,37 @@ int main ()
   deallog.attach(logfile);
   deallog.depth_console(0);
 
-   const unsigned int dim = 1;
+  const unsigned int dim = 1;
 
-   Triangulation<dim,dim+1>    triangulation;
-   FESystem <dim,dim+1> fe (FE_Q<dim,dim+1> (1), dim+1);
-   DoFHandler<dim,dim+1>       dof_handler(triangulation);
+  Triangulation<dim,dim+1>    triangulation;
+  FESystem <dim,dim+1> fe (FE_Q<dim,dim+1> (1), dim+1);
+  DoFHandler<dim,dim+1>       dof_handler(triangulation);
 
-   Vector<double> soln;
+  Vector<double> soln;
 
-   GridIn<dim,dim+1> grid_in;
-   grid_in.attach_triangulation (triangulation);
-   std::ifstream fname("data_out_02/square.msh");
-   grid_in.read_msh (fname);
+  GridIn<dim,dim+1> grid_in;
+  grid_in.attach_triangulation (triangulation);
+  std::ifstream fname("data_out_02/square.msh");
+  grid_in.read_msh (fname);
 
-   dof_handler.distribute_dofs (fe);
-   soln.reinit (dof_handler.n_dofs());
-   soln = 1;
+  dof_handler.distribute_dofs (fe);
+  soln.reinit (dof_handler.n_dofs());
+  soln = 1;
 
-   std::vector<Tensor<1,dim+1> > local_velocity_values (1);
-   const FEValuesExtractors::Vector velocities (0);
-   QGauss<dim>  quadrature_formula(1);
-   DoFHandler<dim,dim+1>::active_cell_iterator
-     cell     = dof_handler.begin_active(),
-     endc     = dof_handler.end();
-   FEValues<dim,dim+1> fe_v (fe, quadrature_formula, update_values);
+  std::vector<Tensor<1,dim+1> > local_velocity_values (1);
+  const FEValuesExtractors::Vector velocities (0);
+  QGauss<dim>  quadrature_formula(1);
+  DoFHandler<dim,dim+1>::active_cell_iterator
+  cell     = dof_handler.begin_active(),
+  endc     = dof_handler.end();
+  FEValues<dim,dim+1> fe_v (fe, quadrature_formula, update_values);
 
-   for (; cell!=endc; ++cell) {
-     fe_v.reinit (cell);
+  for (; cell!=endc; ++cell)
+    {
+      fe_v.reinit (cell);
 
-     fe_v[velocities].get_function_values (soln, local_velocity_values);
+      fe_v[velocities].get_function_values (soln, local_velocity_values);
 
-     deallog << local_velocity_values.at(0) << std::endl;
-   }
+      deallog << local_velocity_values.at(0) << std::endl;
+    }
 }
index 04ddfabafe08a5d564cad63fc036e25adbf5796c..02120ab21c0f5b1c1c8946bb2f13258044470d85 100644 (file)
@@ -66,25 +66,25 @@ void test(std::string filename)
   const QMidpoint<dim> q_midpoint;
 
 
-                               // finite elements used for the
-                               // projection
+  // finite elements used for the
+  // projection
   const FE_Q<dim,spacedim> fe (1);
   DoFHandler<dim,spacedim> dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
   FEValues<dim,spacedim> fe_values (fe, q_midpoint,
-                                   update_values |
-                                   update_JxW_values |
-                                   update_cell_normal_vectors |
+                                    update_values |
+                                    update_JxW_values |
+                                    update_cell_normal_vectors |
                                     update_gradients);
 
-                               // finite elements used for the
-                               // graphical representation with
-                               // data_out
+  // finite elements used for the
+  // graphical representation with
+  // data_out
   const FE_DGQ<dim,spacedim> fe_help(0);
   DoFHandler<dim,spacedim> dof_handler_help (triangulation);
   dof_handler_help.distribute_dofs (fe_help);
   FEValues<dim,spacedim> fe_values_help (fe_help, q_midpoint,
-                                    update_cell_normal_vectors);
+                                         update_cell_normal_vectors);
 
   deallog
       << "no. of cells "<< triangulation.n_cells() <<std::endl;
@@ -99,9 +99,9 @@ void test(std::string filename)
 
 
 
-                               //  definition of the exact function
-                               //  and calculation of the projected
-                               //  one
+  //  definition of the exact function
+  //  and calculation of the projected
+  //  one
   Vector<double> projected_one(dof_handler.n_dofs());
 
 //  Functions::CosineFunction<spacedim> cosine;
@@ -109,8 +109,8 @@ void test(std::string filename)
   Tensor<1,spacedim> exp;
   exp[0]=1;
   exp[1]=0;
-  if(spacedim==3)
-      exp[2]=0;
+  if (spacedim==3)
+    exp[2]=0;
   Functions::Monomial<spacedim> monomial(exp);
 
   const QGauss<dim> quad(5);
@@ -119,7 +119,7 @@ void test(std::string filename)
   VectorTools::project(dof_handler, constraints, quad, monomial, projected_one);
 
 
-                               // calculate its gradient
+  // calculate its gradient
 
   const unsigned int dofs_per_cell = fe.dofs_per_cell;
 
@@ -133,62 +133,62 @@ void test(std::string filename)
   std::vector<types::global_dof_index> local_dof_indices (fe.dofs_per_cell);
 
   typename DoFHandler<dim, spacedim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
 
   for (; cell!=endc; ++cell)
-  {
+    {
 
       fe_values.reinit(cell);
       cell-> get_dof_indices (local_dof_indices);
       cell_normals = fe_values.get_cell_normal_vectors();
 
-                               // The cell tangential is calculated
-                               // in the midpoint of the cell. For
-                               // the <2,3> case the tangential with
-                               // z component = 0 is chosen out of
-                               // the plane tangential to the
-                               // element surface.
+      // The cell tangential is calculated
+      // in the midpoint of the cell. For
+      // the <2,3> case the tangential with
+      // z component = 0 is chosen out of
+      // the plane tangential to the
+      // element surface.
       cell_tangentials[0][0] = cell_normals[0][1]
-         / sqrt( pow(cell_normals[0][0],2) + pow(cell_normals[0][1],2) );
+                               / sqrt( pow(cell_normals[0][0],2) + pow(cell_normals[0][1],2) );
       cell_tangentials[0][1] = -cell_normals[0][0]
-         / sqrt( pow(cell_normals[0][0],2) + pow(cell_normals[0][1],2) );
+                               / sqrt( pow(cell_normals[0][0],2) + pow(cell_normals[0][1],2) );
       if (spacedim == 3)
-         cell_tangentials[0][2]=0.;
+        cell_tangentials[0][2]=0.;
 
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-      {
-         shape_directional_derivative[i]=
-             contract(
-             fe_values.shape_grad(i,0),
-             cell_tangentials[0]);
-
-                               // notice that the dof_index for
-                               // fe_dgq(0) is the same as that of
-                               // the cell
-         projected_directional_derivative(cell->index())
-             +=
-             projected_one(local_dof_indices[i])
-             *
-             shape_directional_derivative[i];
-      }
+        {
+          shape_directional_derivative[i]=
+            contract(
+              fe_values.shape_grad(i,0),
+              cell_tangentials[0]);
+
+          // notice that the dof_index for
+          // fe_dgq(0) is the same as that of
+          // the cell
+          projected_directional_derivative(cell->index())
+          +=
+            projected_one(local_dof_indices[i])
+            *
+            shape_directional_derivative[i];
+        }
 
       deallog
-         << "cell no. "
-         << cell->index()<< "; "
-         << "dir.deriv. "
-         << projected_directional_derivative(cell->index())<< "; "<<std::endl;
+          << "cell no. "
+          << cell->index()<< "; "
+          << "dir.deriv. "
+          << projected_directional_derivative(cell->index())<< "; "<<std::endl;
       if (spacedim == 2)
-         deallog
-             << "exact solution "
-             << cos( 2*numbers::PI*
-                     (cell->index()+.5) / triangulation.n_cells() )
-             << std::endl;
+        deallog
+            << "exact solution "
+            << cos( 2*numbers::PI*
+                    (cell->index()+.5) / triangulation.n_cells() )
+            << std::endl;
 
 
-  }
+    }
 
-                               //  write graphical output
+  //  write graphical output
   DataOut<dim, DoFHandler<dim,spacedim> > dataout;
   dataout.attach_dof_handler(dof_handler_help);
   dataout.add_data_vector(projected_directional_derivative, "derivative");
@@ -205,18 +205,18 @@ int main ()
   deallog.depth_console(0);
   deallog.threshold_double(1.e-12);
 
-    deallog<<"Test <1,2>"<<std::endl;
-    test<1,2>("grids/circle_4.inp");
+  deallog<<"Test <1,2>"<<std::endl;
+  test<1,2>("grids/circle_4.inp");
 
-    deallog<<std::endl;
+  deallog<<std::endl;
 
-    deallog<<"Test <2,3>"<<std::endl;
-    test<2,3>("grids/sphere_1.inp");
+  deallog<<"Test <2,3>"<<std::endl;
+  test<2,3>("grids/sphere_1.inp");
 
 //     test<2,3>("grids/sphere_2.inp");
 //     test<2,3>("grids/sphere_3.inp");
 //     test<2,3>("grids/sphere_4.inp");
 
-    return 0;
+  return 0;
 }
 
index 3724aff0000e2f1ffade185a70e9f2e0bfeb8333..036af20898005f3b19d9e31f2c2a3e0e0fa23552 100644 (file)
@@ -63,8 +63,8 @@ void test(std::string filename, unsigned int degree = 1)
   std::ifstream in (filename.c_str());
   gi.read_ucd (in);
 
-                               // finite elements used for the
-                               // projection
+  // finite elements used for the
+  // projection
   const FE_Q<dim,spacedim> fe (degree);
   const MappingQ<dim, spacedim> mapping(degree);
 
@@ -79,9 +79,9 @@ void test(std::string filename, unsigned int degree = 1)
       << "no. of dofs per cell "<< fe.dofs_per_cell<< std::endl;
 
 
-                               //  definition of the exact function
-                               //  and calculation of the projected
-                               //  one
+  //  definition of the exact function
+  //  and calculation of the projected
+  //  one
   Vector<double> projected_one(dof_handler.n_dofs());
 
   Functions::CosineFunction<spacedim> the_function;
@@ -97,17 +97,17 @@ void test(std::string filename, unsigned int degree = 1)
   ConstraintMatrix constraints;
   constraints.close();
   VectorTools::project(mapping, dof_handler, constraints,
-                      quad, the_function, projected_one);
+                       quad, the_function, projected_one);
 
   deallog << "L2 norm of projected vector: "
-         << projected_one.l2_norm() << std::endl;
+          << projected_one.l2_norm() << std::endl;
 
 
-                               // compute the H1 difference
+  // compute the H1 difference
   Vector<float> difference_per_cell (triangulation.n_active_cells());
   VectorTools::integrate_difference (dof_handler, projected_one,
-                                    the_function, difference_per_cell,
-                                    quad, VectorTools::H1_norm);
+                                     the_function, difference_per_cell,
+                                     quad, VectorTools::H1_norm);
 
   deallog << "H1 error: " << difference_per_cell.l2_norm() << std::endl;
 }
@@ -121,19 +121,19 @@ int main ()
   deallog.depth_console(0);
   deallog.threshold_double(1.e-12);
 
-    deallog<<"Test <1,2>, Q1, Q2, Q3"<<std::endl;
-    test<1,2>("grids/circle_4.inp",1);
-    test<1,2>("grids/circle_4.inp",2);
-    test<1,2>("grids/circle_4.inp",3);
+  deallog<<"Test <1,2>, Q1, Q2, Q3"<<std::endl;
+  test<1,2>("grids/circle_4.inp",1);
+  test<1,2>("grids/circle_4.inp",2);
+  test<1,2>("grids/circle_4.inp",3);
 
-    deallog<<std::endl;
+  deallog<<std::endl;
 
-    deallog<<"Test <2,3>, Q1, Q2, Q3"<<std::endl;
-    test<2,3>("grids/sphere_1.inp",1);
-    test<2,3>("grids/sphere_1.inp",2);
-    test<2,3>("grids/sphere_1.inp",3);
+  deallog<<"Test <2,3>, Q1, Q2, Q3"<<std::endl;
+  test<2,3>("grids/sphere_1.inp",1);
+  test<2,3>("grids/sphere_1.inp",2);
+  test<2,3>("grids/sphere_1.inp",3);
 
 
-    return 0;
+  return 0;
 }
 
index 4e7cd81f1d2a41aa15e6cebd72b82c2385b11106..62121a8fe0c88cf00b575880fb408e20ca374b5c 100644 (file)
 std::ofstream logfile("grid_in_out/output");
 
 template <int dim, int spacedim>
-void test(std::string filename) {
-    Triangulation<dim, spacedim> tria;
-    GridIn<dim, spacedim> gi;
-    gi.attach_triangulation (tria);
-    std::ifstream in (filename.c_str());
-    gi.read_ucd (in);
-
-    GridOut grid_out;
-    grid_out.set_flags (GridOutFlags::Ucd(true));
-    grid_out.write_ucd (tria, logfile);
-    grid_out.write_msh (tria, logfile);
+void test(std::string filename)
+{
+  Triangulation<dim, spacedim> tria;
+  GridIn<dim, spacedim> gi;
+  gi.attach_triangulation (tria);
+  std::ifstream in (filename.c_str());
+  gi.read_ucd (in);
+
+  GridOut grid_out;
+  grid_out.set_flags (GridOutFlags::Ucd(true));
+  grid_out.write_ucd (tria, logfile);
+  grid_out.write_msh (tria, logfile);
 }
 
 int main ()
index 7ce037024a36e1a20c6df6bc29adfc350ce0cbbb..8b7bec21838913d9282ba3f76050e1d1438f498d 100644 (file)
 std::ofstream logfile("grid_in_out_02/output");
 
 template <int dim, int spacedim>
-void test(std::string filename) {
-    Triangulation<dim, spacedim> tria;
-    GridIn<dim, spacedim> gi;
-    gi.attach_triangulation (tria);
-    std::ifstream in (filename.c_str());
-    gi.read_ucd (in);
-
-    GridOut grid_out;
-    grid_out.write_gnuplot (tria, logfile);
+void test(std::string filename)
+{
+  Triangulation<dim, spacedim> tria;
+  GridIn<dim, spacedim> gi;
+  gi.attach_triangulation (tria);
+  std::ifstream in (filename.c_str());
+  gi.read_ucd (in);
+
+  GridOut grid_out;
+  grid_out.write_gnuplot (tria, logfile);
 }
 
 int main ()
index 43b21b05f0021abc8898beb74ce58d7a4f91a3ea..1ad1b0df50062c4a7f44cb7e2e28810de2137a82 100644 (file)
@@ -16,7 +16,7 @@
 
 
 
-// like grid_in_out but test persistent triangulation 
+// like grid_in_out but test persistent triangulation
 
 #include "../tests.h"
 #include <fstream>
 std::ofstream logfile("grid_in_out_03/output");
 
 template <int dim, int spacedim>
-void test(std::string filename) {
+void test(std::string filename)
+{
   logfile << " Tria<" << dim << "," << spacedim << ">: "
-         << filename << std::endl;
+          << filename << std::endl;
   Triangulation<dim, spacedim> tria;
   GridIn<dim, spacedim> gi;
   gi.attach_triangulation (tria);
   std::ifstream in (filename.c_str());
   gi.read_ucd (in);
-  
+
   PersistentTriangulation<dim, spacedim> ptria(tria);
   typename Triangulation<dim,spacedim>::active_cell_iterator cell;
 
   ptria.restore();
-  for(unsigned int i=0; i<2; ++i) 
+  for (unsigned int i=0; i<2; ++i)
     {
-      for(cell=ptria.begin_active(); cell != ptria.end(); ++cell)
-       if(cell->center()[0]<.5)
-         cell->set_refine_flag();
+      for (cell=ptria.begin_active(); cell != ptria.end(); ++cell)
+        if (cell->center()[0]<.5)
+          cell->set_refine_flag();
       ptria.execute_coarsening_and_refinement();
     }
-  
+
   ptria.write_flags(logfile);
 }
 
index 75ac1caa626e2ca43445b8261743123880d92189..98040bd278e2caf1ebbb643f2eb33448aa86dc12 100644 (file)
@@ -35,7 +35,8 @@
 std::ofstream logfile("grid_refinement/output");
 
 template <int dim, int spacedim>
-void test(std::string filename) {
+void test(std::string filename)
+{
   HyperBallBoundary<dim, spacedim> boundary;
   Triangulation<dim, spacedim> tria;
   tria.set_boundary(1, boundary);
@@ -46,10 +47,11 @@ void test(std::string filename) {
 
   GridOut grid_out;
   grid_out.set_flags (GridOutFlags::Ucd(true));
-  for(unsigned int cycle=0; cycle<3; ++cycle) {
-    tria.refine_global(1);
-    grid_out.write_msh (tria, logfile);
-  }
+  for (unsigned int cycle=0; cycle<3; ++cycle)
+    {
+      tria.refine_global(1);
+      grid_out.write_msh (tria, logfile);
+    }
 }
 
 int main ()
index 5d647846406583394d8349fc9526ad2bfa95be25..760ba462af55c518335eb606d0ec80dac05951b5 100644 (file)
@@ -45,13 +45,13 @@ int main ()
 
   Triangulation<dim,spacedim> boundary_mesh;
 
-                                  /*****************************************************************/
-                                  // Create Surface Mesh:  Boundary of hypercube without one face
+  /*****************************************************************/
+  // Create Surface Mesh:  Boundary of hypercube without one face
   {
     Triangulation<spacedim> volume_mesh;
     GridGenerator::hyper_cube(volume_mesh);
     Triangulation<spacedim>::active_cell_iterator
-      cell = volume_mesh.begin_active();
+    cell = volume_mesh.begin_active();
 
     cell->face(0)->set_all_boundary_indicators (1);
     std::set<types::boundary_id> boundary_ids;
@@ -61,7 +61,7 @@ int main ()
   boundary_mesh.begin_active()->set_refine_flag ();
   boundary_mesh.execute_coarsening_and_refinement ();
 
-                                  /*****************************************************************/
+  /*****************************************************************/
   FE_Q<dim,spacedim> fe(1);
   DoFHandler<dim,spacedim>  dh (boundary_mesh);
   ConstraintMatrix     hanging_node_constraints;
index 85a9ff2421e4c727c2bb24161640eb8ca8cae0e5..43f970b9612d0a839245f3570bef3c6289724269 100644 (file)
@@ -45,13 +45,13 @@ int main ()
 
   Triangulation<dim,spacedim> boundary_mesh;
 
-                                  /*****************************************************************/
-                                  // Create Surface Mesh:  Boundary of hypercube without one face
+  /*****************************************************************/
+  // Create Surface Mesh:  Boundary of hypercube without one face
   {
     Triangulation<spacedim> volume_mesh;
     GridGenerator::hyper_cube(volume_mesh);
     Triangulation<spacedim>::active_cell_iterator
-      cell = volume_mesh.begin_active();
+    cell = volume_mesh.begin_active();
 
     cell->face(0)->set_all_boundary_indicators (1);
     std::set<types::boundary_id> boundary_ids;
@@ -62,27 +62,27 @@ int main ()
   boundary_mesh.execute_coarsening_and_refinement ();
 
   Triangulation<dim,spacedim>::active_cell_iterator
-    cell = boundary_mesh.begin_active();
+  cell = boundary_mesh.begin_active();
   for (; cell!=boundary_mesh.end(); ++cell)
     {
       deallog << "Cell = " << cell << std::endl;
       deallog << "  direction_flag = " << cell->direction_flag() << std::endl;
 
       for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
-       {
-         deallog << "  face = " << face
-                 << "  (neighbor = " << cell->neighbor(face) << ")"
-                 << std::endl;
+        {
+          deallog << "  face = " << face
+                  << "  (neighbor = " << cell->neighbor(face) << ")"
+                  << std::endl;
 
-         if (cell->face(face)->has_children())
-           for (unsigned int c=0; c<cell->face(face)->n_children(); ++c)
-             {
-               deallog << "    subface = " << c << std::endl;
-               deallog << "              "
-                       << cell->neighbor_child_on_subface(face, c)
-                       << std::endl;
-             }
-       }
+          if (cell->face(face)->has_children())
+            for (unsigned int c=0; c<cell->face(face)->n_children(); ++c)
+              {
+                deallog << "    subface = " << c << std::endl;
+                deallog << "              "
+                        << cell->neighbor_child_on_subface(face, c)
+                        << std::endl;
+              }
+        }
     }
 
   return 0;
index b16aee6151f267a3fdafb32bfefd21b6ba3ed93d..6d43395194ccb0ea7eee594a0e7cd61e9ab15c30 100644 (file)
@@ -39,13 +39,13 @@ int main ()
 
   Triangulation<dim,spacedim> boundary_mesh;
 
-                                  /*****************************************************************/
-                                  // Create Surface Mesh:  Boundary of hypercube without one face
+  /*****************************************************************/
+  // Create Surface Mesh:  Boundary of hypercube without one face
   {
     Triangulation<spacedim> volume_mesh;
     GridGenerator::hyper_cube(volume_mesh);
     Triangulation<spacedim>::active_cell_iterator
-      cell = volume_mesh.begin_active();
+    cell = volume_mesh.begin_active();
 
     cell->face(0)->set_all_boundary_indicators (1);
     std::set<types::boundary_id> boundary_ids;
@@ -54,24 +54,24 @@ int main ()
   }
 
   Triangulation<dim,spacedim>::active_cell_iterator
-    cell = boundary_mesh.begin_active();
+  cell = boundary_mesh.begin_active();
   for (; cell!=boundary_mesh.end(); ++cell)
     {
       deallog << "Cell = " << cell << std::endl;
       deallog << "  direction_flag = " << cell->direction_flag() << std::endl;
 
       for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
-       {
-         deallog << "  face = " << face
-                 << "  (neighbor = " << cell->neighbor(face) << ")"
-                 << std::endl;
+        {
+          deallog << "  face = " << face
+                  << "  (neighbor = " << cell->neighbor(face) << ")"
+                  << std::endl;
 
-         if (cell->face(face)->has_children())
-           for (unsigned int c=0; c<cell->face(face)->n_children(); ++c)
-             {
-               deallog << "    subface = " << c << std::endl;
-             }
-       }
+          if (cell->face(face)->has_children())
+            for (unsigned int c=0; c<cell->face(face)->n_children(); ++c)
+              {
+                deallog << "    subface = " << c << std::endl;
+              }
+        }
     }
 
   return 0;
index 5d1204750d1a4d2c7aabd74217b8c8f137766c75..30efcc0055a9ab2be1f70b6c8499aa1f696a02df 100644 (file)
@@ -16,7 +16,7 @@
 
 
 
-// integrates the function ln(x-a)*f(x), where f(x) is a power of x on the interval [a,b]. 
+// integrates the function ln(x-a)*f(x), where f(x) is a power of x on the interval [a,b].
 // dim=1 only.
 
 #include "../tests.h"
@@ -48,9 +48,9 @@
 std::ofstream logfile("integrate_log/output");
 
 double test(const unsigned int n,
-           const unsigned int exponent, 
-           const double a, 
-           const double b) 
+            const unsigned int exponent,
+            const double a,
+            const double b)
 {
 
   const QGaussLog<1> qlog(n);
@@ -62,14 +62,14 @@ double test(const unsigned int n,
 
   Triangulation<1> tria;
   GridGenerator::hyper_cube(tria,a,b);
-  
+
   FE_Q<1> feq(1);
 
   DoFHandler<1> dh(tria);
 
   FEValues<1> fe_values(feq, qlog, update_JxW_values | update_quadrature_points),
-               fev_help(feq, qgauss, update_JxW_values | update_quadrature_points);
-  
+           fev_help(feq, qgauss, update_JxW_values | update_quadrature_points);
+
 
   dh.distribute_dofs(feq);
 
@@ -78,18 +78,18 @@ double test(const unsigned int n,
   DoFHandler<1>::active_cell_iterator cell=dh.begin_active(),
                                       endc=dh.end();
 
-  for(; cell!=endc; ++cell)
+  for (; cell!=endc; ++cell)
     {
       fe_values.reinit(cell);
       fev_help.reinit(cell);
-      for(unsigned int i=0; i<fe_values.n_quadrature_points; ++i)
-       {
-         integral+=
-           fe_values.JxW(i)
-           *
-           monomial.value(fe_values.quadrature_point(i));
-       }  
-        
+      for (unsigned int i=0; i<fe_values.n_quadrature_points; ++i)
+        {
+          integral+=
+            fe_values.JxW(i)
+            *
+            monomial.value(fe_values.quadrature_point(i));
+        }
+
 
       // The quadrature formula weights are chosen in order to
       // integrate f(x)*ln[(x-a)/(b-a)] (that is, the argument of the
@@ -99,46 +99,46 @@ double test(const unsigned int n,
       // integral of f(x)*ln(b-a) to this term to finally obtain the
       // integral of f(x)*ln(x-a).
 
-      for(unsigned int i=0; i<fev_help.n_quadrature_points; ++i)
-       {        
-         integral+=
-           fev_help.JxW(i)
-           *
-           monomial.value(fev_help.quadrature_point(i))
-           *
-           log(b-a);
-           
-       }
-    } 
-  
-  return integral; 
-  
+      for (unsigned int i=0; i<fev_help.n_quadrature_points; ++i)
+        {
+          integral+=
+            fev_help.JxW(i)
+            *
+            monomial.value(fev_help.quadrature_point(i))
+            *
+            log(b-a);
+
+        }
+    }
+
+  return integral;
+
 }
 
 unsigned int
 factorial(unsigned int a)
 {
-    if ( a == 0) return 1;
+  if ( a == 0) return 1;
 
-    if ( a-1 != 0 )
-       a *= factorial(a-1);
+  if ( a-1 != 0 )
+    a *= factorial(a-1);
 
-    return a;
+  return a;
 }
 
 double
-newton_binomial(unsigned int a, 
-               unsigned int b)
+newton_binomial(unsigned int a,
+                unsigned int b)
 {
-    double c;
-    if (a >= b)
-       c = factorial(a)
-           / factorial(b)
-           / factorial(a-b);
-    else
-       deallog<<"Error: in Newton binomial the first integer must be greater or equal to the second.";
-
-    return c;
+  double c;
+  if (a >= b)
+    c = factorial(a)
+        / factorial(b)
+        / factorial(a-b);
+  else
+    deallog<<"Error: in Newton binomial the first integer must be greater or equal to the second.";
+
+  return c;
 }
 
 int main()
@@ -147,30 +147,30 @@ int main()
   deallog.depth_console(0);
   deallog<<std::fixed;
   deallog<<std::setprecision(5);
-  const double a = 1, 
-    b = 5.;
-  
-  double exact_integral;   
+  const double a = 1,
+               b = 5.;
+
+  double exact_integral;
 
-  deallog << "Calculation of the integral of ln(x-a)*f(x) on the interval [a,b] = [" 
-         << a << ", " << b << "]"<< std::endl;
+  deallog << "Calculation of the integral of ln(x-a)*f(x) on the interval [a,b] = ["
+          << a << ", " << b << "]"<< std::endl;
   for (unsigned int j=0; j<13; ++j)
     {
-    exact_integral=0;
-    for (unsigned int k=0; k<=j; k++)
-       exact_integral +=
-           newton_binomial(j,k)
-           *pow(a,static_cast<int>(j-k))
-           *(
-             pow(b-a,static_cast<int>(k)+1) / (k+1) * log(b-a)
-               -
-             pow(b-a,static_cast<int>(k)+1) / pow(static_cast<double>(k+1), 2)
-            ); 
-    deallog << "f(x) = x^" << j << std::endl;
-    for (unsigned int i=1; i<13; ++i)
-       deallog << " No. of points = " << i << "  " 
-               << "Error: "<< test(i,j,a,b)-exact_integral  
-               << std::endl;
-    deallog<<std::endl;
-   }
+      exact_integral=0;
+      for (unsigned int k=0; k<=j; k++)
+        exact_integral +=
+          newton_binomial(j,k)
+          *pow(a,static_cast<int>(j-k))
+          *(
+            pow(b-a,static_cast<int>(k)+1) / (k+1) * log(b-a)
+            -
+            pow(b-a,static_cast<int>(k)+1) / pow(static_cast<double>(k+1), 2)
+          );
+      deallog << "f(x) = x^" << j << std::endl;
+      for (unsigned int i=1; i<13; ++i)
+        deallog << " No. of points = " << i << "  "
+                << "Error: "<< test(i,j,a,b)-exact_integral
+                << std::endl;
+      deallog<<std::endl;
+    }
 }
index 494716af9ca104899d6b24a1dae1eebf852ff73e..a73133bc716a835cc5743ab66494733f21a60164 100644 (file)
@@ -73,135 +73,148 @@ int main()
   alphas.push_back(1./3.);
   alphas.push_back(3./2.);
 
-  
-  double exact_integral;   
+
+  double exact_integral;
   double eps = 1e-10;
-  
-  for(unsigned int nos = 0; nos< origins.size(); ++nos) {
-      for(unsigned int nas = 0; nas < alphas.size(); ++nas) {
-         for(unsigned int power = 0; power<13; ++power) {
-             exact_integral = log_integral(power, origins[nos][0], alphas[nas]);
-             deallog << "==================================================" << endl;
-             deallog << "int_0^1 x^" << power 
-                     << " ln(|x-" << origins[nos] << "|/"
-                     << alphas[nas] << ") = " 
-                     << exact_integral << endl; 
-             for(unsigned int nq = 1; nq < 13; ++nq) {
-                 QGaussLogR<1> quad(nq, origins[nos], alphas[nas]);
-                 QGaussLogR<1> factored_quad(nq, origins[nos], alphas[nas], true);
-                 
-                 double approx_integral = 0;
-                 double approx_integral_factored = 0;
-                 for(unsigned int q=0; q<quad.size(); ++q) {
-                     double qpow = pow(quad.point(q)[0], (double) power);
-                     approx_integral += qpow  * quad.weight(q);
-                     qpow *= log(abs( (factored_quad.point(q)-origins[nos])[0] )/alphas[nas] );
-                     approx_integral_factored += qpow * factored_quad.weight(q);
-                 }           
-                 deallog << "   Error(n=" << quad.size()
-                         << ") = " << (approx_integral - exact_integral);
-                 if( abs(approx_integral - approx_integral_factored) > eps )
-                     deallog << ", difference between factored and unfactored: " 
-                             << abs(approx_integral - approx_integral_factored);
-                 deallog << endl;
-             }
-         }
-         deallog << "==================================================" << endl;
-      }
-  }
+
+  for (unsigned int nos = 0; nos< origins.size(); ++nos)
+    {
+      for (unsigned int nas = 0; nas < alphas.size(); ++nas)
+        {
+          for (unsigned int power = 0; power<13; ++power)
+            {
+              exact_integral = log_integral(power, origins[nos][0], alphas[nas]);
+              deallog << "==================================================" << endl;
+              deallog << "int_0^1 x^" << power
+                      << " ln(|x-" << origins[nos] << "|/"
+                      << alphas[nas] << ") = "
+                      << exact_integral << endl;
+              for (unsigned int nq = 1; nq < 13; ++nq)
+                {
+                  QGaussLogR<1> quad(nq, origins[nos], alphas[nas]);
+                  QGaussLogR<1> factored_quad(nq, origins[nos], alphas[nas], true);
+
+                  double approx_integral = 0;
+                  double approx_integral_factored = 0;
+                  for (unsigned int q=0; q<quad.size(); ++q)
+                    {
+                      double qpow = pow(quad.point(q)[0], (double) power);
+                      approx_integral += qpow  * quad.weight(q);
+                      qpow *= log(abs( (factored_quad.point(q)-origins[nos])[0] )/alphas[nas] );
+                      approx_integral_factored += qpow * factored_quad.weight(q);
+                    }
+
+                  deallog << "   Error(n=" << quad.size()
+                          << ") = " << (approx_integral - exact_integral);
+                  if ( abs(approx_integral - approx_integral_factored) > eps )
+                    deallog << ", difference between factored and unfactored: "
+                            << abs(approx_integral - approx_integral_factored);
+                  deallog << endl;
+                }
+            }
+          deallog << "==================================================" << endl;
+        }
+    }
 }
 
 
 
-double log_integral(const unsigned int N, const double point, const double alpha) {
-    double result = 0;
-    if(point == 0) {
-       result = - (1.+log(alpha)*N +log(alpha)) / (2 * N + N*N + 1);
-    } else if(point == 1) {
-       switch(N) {
-       case 0:
-           result = -0.1e1 - log(alpha);
-           break; 
-       case 1:
-           result = -log(alpha) / 0.2e1 - 0.3e1 / 0.4e1;
-           break; 
-       case 2:
-           result = -log(alpha) / 0.3e1 - 0.11e2 / 0.18e2;
-           break; 
-       case 3:
-           result = -log(alpha) / 0.4e1 - 0.25e2 / 0.48e2;
-           break; 
-       case 4:
-           result = -0.137e3 / 0.300e3 - log(alpha) / 0.5e1;
-           break; 
-       case 5:
-           result = -log(alpha) / 0.6e1 - 0.49e2 / 0.120e3;
-           break; 
-       case 6:
-           result = -log(alpha) / 0.7e1 - 0.363e3 / 0.980e3;
-           break; 
-       case 7:
-           result = -log(alpha) / 0.8e1 - 0.761e3 / 0.2240e4;
-           break; 
-       case 8:
-           result = -0.7129e4 / 0.22680e5 - log(alpha) / 0.9e1;
-           break; 
-       case 9:
-           result = -log(alpha) / 0.10e2 - 0.7381e4 / 0.25200e5;
-           break; 
-       case 10:
-           result = -log(alpha) / 0.11e2 - 0.83711e5 / 0.304920e6;
-           break; 
-       case 11:
-           result = -0.86021e5 / 0.332640e6 - log(alpha) / 0.12e2;
-           break; 
-       case 12:
-           result = -log(alpha) / 0.13e2 - 0.1145993e7 / 0.4684680e7;
-           break;
-       }
-    } else {
-       switch(N) {
-       case 0:
-           result = point * log(point) + log(0.1e1 - point) - log(alpha) - 0.1e1 - point * log(0.1e1 - point);
-           break; 
-       case 1:
-           result = pow(point, 0.2e1) * log(point) / 0.2e1 - pow(point, 0.2e1) * log(0.1e1 - point) / 0.2e1 + log(0.1e1 - point) / 0.2e1 - log(alpha) / 0.2e1 - 0.1e1 / 0.4e1 - point / 0.2e1;
-           break; 
-       case 2:
-           result = pow(point, 0.3e1) * log(point) / 0.3e1 - point / 0.6e1 - pow(point, 0.3e1) * log(0.1e1 - point) / 0.3e1 - pow(point, 0.2e1) / 0.3e1 + log(0.1e1 - point) / 0.3e1 - log(alpha) / 0.3e1 - 0.1e1 / 0.9e1;
-           break; 
-       case 3:
-           result = pow(point, 0.4e1) * log(point) / 0.4e1 + log(0.1e1 - point) / 0.4e1 - log(alpha) / 0.4e1 - pow(point, 0.4e1) * log(0.1e1 - point) / 0.4e1 - point / 0.12e2 - pow(point, 0.3e1) / 0.4e1 - pow(point, 0.2e1) / 0.8e1 - 0.1e1 / 0.16e2;
-           break; 
-       case 4:
-           result = pow(point, 0.5e1) * log(point) / 0.5e1 - 0.1e1 / 0.25e2 + log(0.1e1 - point) / 0.5e1 - log(alpha) / 0.5e1 - pow(point, 0.4e1) / 0.5e1 - point / 0.20e2 - pow(point, 0.5e1) * log(0.1e1 - point) / 0.5e1 - pow(point, 0.2e1) / 0.15e2 - pow(point, 0.3e1) / 0.10e2;
-           break; 
-       case 5:
-           result = pow(point, 0.6e1) * log(point) / 0.6e1 - pow(point, 0.3e1) / 0.18e2 - pow(point, 0.5e1) / 0.6e1 - point / 0.30e2 - pow(point, 0.2e1) / 0.24e2 - pow(point, 0.6e1) * log(0.1e1 - point) / 0.6e1 + log(0.1e1 - point) / 0.6e1 - log(alpha) / 0.6e1 - 0.1e1 / 0.36e2 - pow(point, 0.4e1) / 0.12e2;
-           break; 
-       case 6:
-           result = pow(point, 0.7e1) * log(point) / 0.7e1 - pow(point, 0.4e1) / 0.21e2 - pow(point, 0.5e1) / 0.14e2 - point / 0.42e2 - pow(point, 0.2e1) / 0.35e2 - pow(point, 0.7e1) * log(0.1e1 - point) / 0.7e1 - pow(point, 0.3e1) / 0.28e2 - 0.1e1 / 0.49e2 - pow(point, 0.6e1) / 0.7e1 + log(0.1e1 - point) / 0.7e1 - log(alpha) / 0.7e1;
-           break; 
-       case 7:
-           result = pow(point, 0.8e1) * log(point) / 0.8e1 - 0.1e1 / 0.64e2 + log(0.1e1 - point) / 0.8e1 - log(alpha) / 0.8e1 - pow(point, 0.6e1) / 0.16e2 - pow(point, 0.8e1) * log(0.1e1 - point) / 0.8e1 - pow(point, 0.5e1) / 0.24e2 - pow(point, 0.3e1) / 0.40e2 - pow(point, 0.7e1) / 0.8e1 - pow(point, 0.2e1) / 0.48e2 - point / 0.56e2 - pow(point, 0.4e1) / 0.32e2;
-           break; 
-       case 8:
-           result = pow(point, 0.9e1) * log(point) / 0.9e1 - pow(point, 0.4e1) / 0.45e2 - pow(point, 0.9e1) * log(0.1e1 - point) / 0.9e1 - pow(point, 0.6e1) / 0.27e2 - pow(point, 0.2e1) / 0.63e2 + log(0.1e1 - point) / 0.9e1 - log(alpha) / 0.9e1 - pow(point, 0.8e1) / 0.9e1 - 0.1e1 / 0.81e2 - pow(point, 0.5e1) / 0.36e2 - point / 0.72e2 - pow(point, 0.3e1) / 0.54e2 - pow(point, 0.7e1) / 0.18e2;
-           break; 
-       case 9:
-           result = pow(point, 0.10e2) * log(point) / 0.10e2 + log(0.1e1 - point) / 0.10e2 - log(alpha) / 0.10e2 - pow(point, 0.2e1) / 0.80e2 - 0.1e1 / 0.100e3 - point / 0.90e2 - pow(point, 0.4e1) / 0.60e2 - pow(point, 0.9e1) / 0.10e2 - pow(point, 0.8e1) / 0.20e2 - pow(point, 0.6e1) / 0.40e2 - pow(point, 0.5e1) / 0.50e2 - pow(point, 0.3e1) / 0.70e2 - pow(point, 0.10e2) * log(0.1e1 - point) / 0.10e2 - pow(point, 0.7e1) / 0.30e2;
-           break; 
-       case 10:
-           result = pow(point, 0.11e2) * log(point) / 0.11e2 + log(0.1e1 - point) / 0.11e2 - log(alpha) / 0.11e2 - pow(point, 0.2e1) / 0.99e2 - pow(point, 0.11e2) * log(0.1e1 - point) / 0.11e2 - 0.1e1 / 0.121e3 - pow(point, 0.3e1) / 0.88e2 - pow(point, 0.4e1) / 0.77e2 - pow(point, 0.8e1) / 0.33e2 - pow(point, 0.5e1) / 0.66e2 - pow(point, 0.10e2) / 0.11e2 - pow(point, 0.7e1) / 0.44e2 - pow(point, 0.9e1) / 0.22e2 - point / 0.110e3 - pow(point, 0.6e1) / 0.55e2;
-           break; 
-       case 11:
-           result = pow(point, 0.12e2) * log(point) / 0.12e2 - pow(point, 0.8e1) / 0.48e2 - pow(point, 0.2e1) / 0.120e3 - pow(point, 0.11e2) / 0.12e2 - pow(point, 0.4e1) / 0.96e2 - pow(point, 0.10e2) / 0.24e2 - pow(point, 0.5e1) / 0.84e2 - 0.1e1 / 0.144e3 - pow(point, 0.3e1) / 0.108e3 - point / 0.132e3 - pow(point, 0.9e1) / 0.36e2 + log(0.1e1 - point) / 0.12e2 - log(alpha) / 0.12e2 - pow(point, 0.7e1) / 0.60e2 - pow(point, 0.6e1) / 0.72e2 - pow(point, 0.12e2) * log(0.1e1 - point) / 0.12e2;
-           break; 
-       case 12:
-           result = pow(point, 0.13e2) * log(point) / 0.13e2 - pow(point, 0.4e1) / 0.117e3 - pow(point, 0.7e1) / 0.78e2 - pow(point, 0.5e1) / 0.104e3 - pow(point, 0.11e2) / 0.26e2 - pow(point, 0.13e2) * log(0.1e1 - point) / 0.13e2 - pow(point, 0.3e1) / 0.130e3 - pow(point, 0.6e1) / 0.91e2 - point / 0.156e3 - pow(point, 0.2e1) / 0.143e3 - pow(point, 0.10e2) / 0.39e2 + log(0.1e1 - point) / 0.13e2 - log(alpha) / 0.13e2 - 0.1e1 / 0.169e3 - pow(point, 0.9e1) / 0.52e2 - pow(point, 0.12e2) / 0.13e2 - pow(point, 0.8e1) / 0.65e2;
-           break;
-       }
+double log_integral(const unsigned int N, const double point, const double alpha)
+{
+  double result = 0;
+  if (point == 0)
+    {
+      result = - (1.+log(alpha)*N +log(alpha)) / (2 * N + N*N + 1);
+    }
+  else if (point == 1)
+    {
+      switch (N)
+        {
+        case 0:
+          result = -0.1e1 - log(alpha);
+          break;
+        case 1:
+          result = -log(alpha) / 0.2e1 - 0.3e1 / 0.4e1;
+          break;
+        case 2:
+          result = -log(alpha) / 0.3e1 - 0.11e2 / 0.18e2;
+          break;
+        case 3:
+          result = -log(alpha) / 0.4e1 - 0.25e2 / 0.48e2;
+          break;
+        case 4:
+          result = -0.137e3 / 0.300e3 - log(alpha) / 0.5e1;
+          break;
+        case 5:
+          result = -log(alpha) / 0.6e1 - 0.49e2 / 0.120e3;
+          break;
+        case 6:
+          result = -log(alpha) / 0.7e1 - 0.363e3 / 0.980e3;
+          break;
+        case 7:
+          result = -log(alpha) / 0.8e1 - 0.761e3 / 0.2240e4;
+          break;
+        case 8:
+          result = -0.7129e4 / 0.22680e5 - log(alpha) / 0.9e1;
+          break;
+        case 9:
+          result = -log(alpha) / 0.10e2 - 0.7381e4 / 0.25200e5;
+          break;
+        case 10:
+          result = -log(alpha) / 0.11e2 - 0.83711e5 / 0.304920e6;
+          break;
+        case 11:
+          result = -0.86021e5 / 0.332640e6 - log(alpha) / 0.12e2;
+          break;
+        case 12:
+          result = -log(alpha) / 0.13e2 - 0.1145993e7 / 0.4684680e7;
+          break;
+        }
+    }
+  else
+    {
+      switch (N)
+        {
+        case 0:
+          result = point * log(point) + log(0.1e1 - point) - log(alpha) - 0.1e1 - point * log(0.1e1 - point);
+          break;
+        case 1:
+          result = pow(point, 0.2e1) * log(point) / 0.2e1 - pow(point, 0.2e1) * log(0.1e1 - point) / 0.2e1 + log(0.1e1 - point) / 0.2e1 - log(alpha) / 0.2e1 - 0.1e1 / 0.4e1 - point / 0.2e1;
+          break;
+        case 2:
+          result = pow(point, 0.3e1) * log(point) / 0.3e1 - point / 0.6e1 - pow(point, 0.3e1) * log(0.1e1 - point) / 0.3e1 - pow(point, 0.2e1) / 0.3e1 + log(0.1e1 - point) / 0.3e1 - log(alpha) / 0.3e1 - 0.1e1 / 0.9e1;
+          break;
+        case 3:
+          result = pow(point, 0.4e1) * log(point) / 0.4e1 + log(0.1e1 - point) / 0.4e1 - log(alpha) / 0.4e1 - pow(point, 0.4e1) * log(0.1e1 - point) / 0.4e1 - point / 0.12e2 - pow(point, 0.3e1) / 0.4e1 - pow(point, 0.2e1) / 0.8e1 - 0.1e1 / 0.16e2;
+          break;
+        case 4:
+          result = pow(point, 0.5e1) * log(point) / 0.5e1 - 0.1e1 / 0.25e2 + log(0.1e1 - point) / 0.5e1 - log(alpha) / 0.5e1 - pow(point, 0.4e1) / 0.5e1 - point / 0.20e2 - pow(point, 0.5e1) * log(0.1e1 - point) / 0.5e1 - pow(point, 0.2e1) / 0.15e2 - pow(point, 0.3e1) / 0.10e2;
+          break;
+        case 5:
+          result = pow(point, 0.6e1) * log(point) / 0.6e1 - pow(point, 0.3e1) / 0.18e2 - pow(point, 0.5e1) / 0.6e1 - point / 0.30e2 - pow(point, 0.2e1) / 0.24e2 - pow(point, 0.6e1) * log(0.1e1 - point) / 0.6e1 + log(0.1e1 - point) / 0.6e1 - log(alpha) / 0.6e1 - 0.1e1 / 0.36e2 - pow(point, 0.4e1) / 0.12e2;
+          break;
+        case 6:
+          result = pow(point, 0.7e1) * log(point) / 0.7e1 - pow(point, 0.4e1) / 0.21e2 - pow(point, 0.5e1) / 0.14e2 - point / 0.42e2 - pow(point, 0.2e1) / 0.35e2 - pow(point, 0.7e1) * log(0.1e1 - point) / 0.7e1 - pow(point, 0.3e1) / 0.28e2 - 0.1e1 / 0.49e2 - pow(point, 0.6e1) / 0.7e1 + log(0.1e1 - point) / 0.7e1 - log(alpha) / 0.7e1;
+          break;
+        case 7:
+          result = pow(point, 0.8e1) * log(point) / 0.8e1 - 0.1e1 / 0.64e2 + log(0.1e1 - point) / 0.8e1 - log(alpha) / 0.8e1 - pow(point, 0.6e1) / 0.16e2 - pow(point, 0.8e1) * log(0.1e1 - point) / 0.8e1 - pow(point, 0.5e1) / 0.24e2 - pow(point, 0.3e1) / 0.40e2 - pow(point, 0.7e1) / 0.8e1 - pow(point, 0.2e1) / 0.48e2 - point / 0.56e2 - pow(point, 0.4e1) / 0.32e2;
+          break;
+        case 8:
+          result = pow(point, 0.9e1) * log(point) / 0.9e1 - pow(point, 0.4e1) / 0.45e2 - pow(point, 0.9e1) * log(0.1e1 - point) / 0.9e1 - pow(point, 0.6e1) / 0.27e2 - pow(point, 0.2e1) / 0.63e2 + log(0.1e1 - point) / 0.9e1 - log(alpha) / 0.9e1 - pow(point, 0.8e1) / 0.9e1 - 0.1e1 / 0.81e2 - pow(point, 0.5e1) / 0.36e2 - point / 0.72e2 - pow(point, 0.3e1) / 0.54e2 - pow(point, 0.7e1) / 0.18e2;
+          break;
+        case 9:
+          result = pow(point, 0.10e2) * log(point) / 0.10e2 + log(0.1e1 - point) / 0.10e2 - log(alpha) / 0.10e2 - pow(point, 0.2e1) / 0.80e2 - 0.1e1 / 0.100e3 - point / 0.90e2 - pow(point, 0.4e1) / 0.60e2 - pow(point, 0.9e1) / 0.10e2 - pow(point, 0.8e1) / 0.20e2 - pow(point, 0.6e1) / 0.40e2 - pow(point, 0.5e1) / 0.50e2 - pow(point, 0.3e1) / 0.70e2 - pow(point, 0.10e2) * log(0.1e1 - point) / 0.10e2 - pow(point, 0.7e1) / 0.30e2;
+          break;
+        case 10:
+          result = pow(point, 0.11e2) * log(point) / 0.11e2 + log(0.1e1 - point) / 0.11e2 - log(alpha) / 0.11e2 - pow(point, 0.2e1) / 0.99e2 - pow(point, 0.11e2) * log(0.1e1 - point) / 0.11e2 - 0.1e1 / 0.121e3 - pow(point, 0.3e1) / 0.88e2 - pow(point, 0.4e1) / 0.77e2 - pow(point, 0.8e1) / 0.33e2 - pow(point, 0.5e1) / 0.66e2 - pow(point, 0.10e2) / 0.11e2 - pow(point, 0.7e1) / 0.44e2 - pow(point, 0.9e1) / 0.22e2 - point / 0.110e3 - pow(point, 0.6e1) / 0.55e2;
+          break;
+        case 11:
+          result = pow(point, 0.12e2) * log(point) / 0.12e2 - pow(point, 0.8e1) / 0.48e2 - pow(point, 0.2e1) / 0.120e3 - pow(point, 0.11e2) / 0.12e2 - pow(point, 0.4e1) / 0.96e2 - pow(point, 0.10e2) / 0.24e2 - pow(point, 0.5e1) / 0.84e2 - 0.1e1 / 0.144e3 - pow(point, 0.3e1) / 0.108e3 - point / 0.132e3 - pow(point, 0.9e1) / 0.36e2 + log(0.1e1 - point) / 0.12e2 - log(alpha) / 0.12e2 - pow(point, 0.7e1) / 0.60e2 - pow(point, 0.6e1) / 0.72e2 - pow(point, 0.12e2) * log(0.1e1 - point) / 0.12e2;
+          break;
+        case 12:
+          result = pow(point, 0.13e2) * log(point) / 0.13e2 - pow(point, 0.4e1) / 0.117e3 - pow(point, 0.7e1) / 0.78e2 - pow(point, 0.5e1) / 0.104e3 - pow(point, 0.11e2) / 0.26e2 - pow(point, 0.13e2) * log(0.1e1 - point) / 0.13e2 - pow(point, 0.3e1) / 0.130e3 - pow(point, 0.6e1) / 0.91e2 - point / 0.156e3 - pow(point, 0.2e1) / 0.143e3 - pow(point, 0.10e2) / 0.39e2 + log(0.1e1 - point) / 0.13e2 - log(alpha) / 0.13e2 - 0.1e1 / 0.169e3 - pow(point, 0.9e1) / 0.52e2 - pow(point, 0.12e2) / 0.13e2 - pow(point, 0.8e1) / 0.65e2;
+          break;
+        }
     }
-    return result;
+  return result;
 }
index 24c87c40e46b38abd6abd9645b4307a681ae7953..4b94c9eca736a08774897af4f1e0050820f70725 100644 (file)
 
 using namespace std;
 
-// The exact integrals were computed with 20 digits precision using Maple. 
+// The exact integrals were computed with 20 digits precision using Maple.
 double exact_integral_one_over_r(const unsigned int i,
-                                const unsigned int j,
-                                const unsigned int vertex_index);
+                                 const unsigned int j,
+                                 const unsigned int vertex_index);
 
 ofstream logfile("integrate_one_over_r/output");
 
 int main()
 {
-    deallog.attach(logfile);
-    deallog.depth_console(0);
-    deallog<< std::fixed;
-    
-    deallog << endl 
-           << "Calculation of the integral of f(x,y)*1/R on [0,1]x[0,1]" << endl
-           << "for f(x,y) = x^i y^j, with i,j ranging from 0 to 5, and R being" << endl
-           << "the distance from (x,y) to four vertices of the square." << endl 
-           << endl;
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog<< std::fixed;
 
-    double eps = 1e-10;
+  deallog << endl
+          << "Calculation of the integral of f(x,y)*1/R on [0,1]x[0,1]" << endl
+          << "for f(x,y) = x^i y^j, with i,j ranging from 0 to 5, and R being" << endl
+          << "the distance from (x,y) to four vertices of the square." << endl
+          << endl;
 
-    for(unsigned int m=1; m<7; ++m) {
-       deallog << " =========Quadrature Order: " << m 
-               << " =============================== " << endl;
-       deallog << " ============================================================ " << endl;
-       for(unsigned int index=0; index<4; ++index) {
-           deallog << " ===============Vertex Index: " << index 
-                   << " ============================= " << endl;
-           QGaussOneOverR<2> quad(m, index);
-           QGaussOneOverR<2> quad_de(m, index, true);
-           for (unsigned int i=0; i<6; ++i) {
-               for (unsigned int j=0; j<6; ++j) {
-                  
-                   double exact_integral  = exact_integral_one_over_r(index, i,j);
-                   double approx_integral = 0;
-                   double approx_integral_2 = 0;
-                   
-                   for (unsigned int q=0; q< quad.size(); ++q) {
-                       double x = quad.point(q)[0];
-                       double y = quad.point(q)[1];
-                       approx_integral += ( pow(x, (double)i) * 
-                                            pow(y, (double)j) * 
-                                            quad.weight(q) );
-                       approx_integral_2 += ( pow(x, (double)i) * 
-                                              pow(y, (double)j) * 
-                                              quad_de.weight(q) /
-                                              (quad_de.point(q)-GeometryInfo<2>::unit_cell_vertex(index)).norm());
-                   }
+  double eps = 1e-10;
 
-                   deallog << "f(x,y) = x^" << i
-                           << " y^" << j 
-                           << ", Error = " 
-                           << approx_integral - exact_integral;
-                   if (std::abs(approx_integral-approx_integral_2) < eps)
-                       deallog << endl;
-                   else 
-                       deallog <<  ", desing: "  
-                               << approx_integral_2 - exact_integral << endl;
-               }
-           }
-       }
+  for (unsigned int m=1; m<7; ++m)
+    {
+      deallog << " =========Quadrature Order: " << m
+              << " =============================== " << endl;
+      deallog << " ============================================================ " << endl;
+      for (unsigned int index=0; index<4; ++index)
+        {
+          deallog << " ===============Vertex Index: " << index
+                  << " ============================= " << endl;
+          QGaussOneOverR<2> quad(m, index);
+          QGaussOneOverR<2> quad_de(m, index, true);
+          for (unsigned int i=0; i<6; ++i)
+            {
+              for (unsigned int j=0; j<6; ++j)
+                {
+
+                  double exact_integral  = exact_integral_one_over_r(index, i,j);
+                  double approx_integral = 0;
+                  double approx_integral_2 = 0;
+
+                  for (unsigned int q=0; q< quad.size(); ++q)
+                    {
+                      double x = quad.point(q)[0];
+                      double y = quad.point(q)[1];
+                      approx_integral += ( pow(x, (double)i) *
+                                           pow(y, (double)j) *
+                                           quad.weight(q) );
+                      approx_integral_2 += ( pow(x, (double)i) *
+                                             pow(y, (double)j) *
+                                             quad_de.weight(q) /
+                                             (quad_de.point(q)-GeometryInfo<2>::unit_cell_vertex(index)).norm());
+                    }
+
+                  deallog << "f(x,y) = x^" << i
+                          << " y^" << j
+                          << ", Error = "
+                          << approx_integral - exact_integral;
+                  if (std::abs(approx_integral-approx_integral_2) < eps)
+                    deallog << endl;
+                  else
+                    deallog <<  ", desing: "
+                            << approx_integral_2 - exact_integral << endl;
+                }
+            }
+        }
     }
 }
 
 double exact_integral_one_over_r(const unsigned int vertex_index,
-                                const unsigned int i,
-                                const unsigned int j) {
-    Assert(vertex_index < 4, ExcInternalError());
-    Assert(i<6, ExcNotImplemented());
-    Assert(j<6, ExcNotImplemented());
-    
-    // The integrals are computed using the following maple snippet of
-    // code:
-    // 
-    //  sing_int := proc(index, N, M) 
-    //     if index = 0 then 
-    //        return int(int(x^N *y^M/sqrt(x^2+y^2), x=0.0..1.0), y=0.0..1.0);
-    //     elif index = 1 then
-    //        return int(int(x^N *y^M/sqrt((x-1)^2+y^2), x=0.0..1.0), y=0.0..1.0);
-    //     elif index = 2 then 
-    //        return int(int(x^N *y^M/sqrt(x^2+(y-1)^2), x=0.0..1.0), y=0.0..1.0);
-    //     elif index = 3 then 
-    //        return int(int((1-x)^N *(1-y)^M/sqrt(x^2+y^2), x=0.0..1.0), y=0.0..1.0);
-    //     end if;
-    //  end proc;
-    //  Digits := 20;
-    //  for i from 3 to 3 do
-    //     for n from 0 to 5 do 
-    //     for m from 0 to 5 do
-    //           C( v[i+1][n+1][m+1] = sing_int(i, n, m), resultname="a");
-    //        end do;
-    //     end do;
-    //  end do;
+                                 const unsigned int i,
+                                 const unsigned int j)
+{
+  Assert(vertex_index < 4, ExcInternalError());
+  Assert(i<6, ExcNotImplemented());
+  Assert(j<6, ExcNotImplemented());
+
+  // The integrals are computed using the following maple snippet of
+  // code:
+  //
+  //  sing_int := proc(index, N, M)
+  //     if index = 0 then
+  //        return int(int(x^N *y^M/sqrt(x^2+y^2), x=0.0..1.0), y=0.0..1.0);
+  //     elif index = 1 then
+  //        return int(int(x^N *y^M/sqrt((x-1)^2+y^2), x=0.0..1.0), y=0.0..1.0);
+  //     elif index = 2 then
+  //        return int(int(x^N *y^M/sqrt(x^2+(y-1)^2), x=0.0..1.0), y=0.0..1.0);
+  //     elif index = 3 then
+  //        return int(int((1-x)^N *(1-y)^M/sqrt(x^2+y^2), x=0.0..1.0), y=0.0..1.0);
+  //     end if;
+  //  end proc;
+  //  Digits := 20;
+  //  for i from 3 to 3 do
+  //     for n from 0 to 5 do
+  //      for m from 0 to 5 do
+  //           C( v[i+1][n+1][m+1] = sing_int(i, n, m), resultname="a");
+  //        end do;
+  //     end do;
+  //  end do;
 
-    static double v[4][6][6] = {{{0}}};
-    if(v[0][0][0] == 0) {
-       v[0][0][0] = 0.17627471740390860505e1;
-       v[0][0][1] = 0.64779357469631903702e0;
-       v[0][0][2] = 0.38259785823210634567e0;
-       v[0][0][3] = 0.26915893322379450224e0;
-       v[0][0][4] = 0.20702239737104695572e0;
-       v[0][0][5] = 0.16800109713227567467e0;
-       v[0][1][0] = 0.64779357469631903702e0;
-       v[0][1][1] = 0.27614237491539669920e0;
-       v[0][1][2] = 0.17015838751246776515e0;
-       v[0][1][3] = 0.12189514164974600651e0;
-       v[0][1][4] = 0.94658660368131133694e-1;
-       v[0][1][5] = 0.77263794021029438797e-1;
-       v[0][2][0] = 0.38259785823210634567e0;
-       v[0][2][1] = 0.17015838751246776515e0;
-       v[0][2][2] = 0.10656799507071040471e0;
-       v[0][2][3] = 0.76947022258735165920e-1;
-       v[0][2][4] = 0.60022626787495395021e-1;
-       v[0][2][5] = 0.49131622931360879320e-1;
-       v[0][3][0] = 0.26915893322379450224e0;
-       v[0][3][1] = 0.12189514164974600651e0;
-       v[0][3][2] = 0.76947022258735165919e-1;
-       v[0][3][3] = 0.55789184535895709637e-1;
-       v[0][3][4] = 0.43625068213915842136e-1;
-       v[0][3][5] = 0.35766126849971778500e-1;
-       v[0][4][0] = 0.20702239737104695572e0;
-       v[0][4][1] = 0.94658660368131133694e-1;
-       v[0][4][2] = 0.60022626787495395021e-1;
-       v[0][4][3] = 0.43625068213915842137e-1;
-       v[0][4][4] = 0.34164088852375945192e-1;
-       v[0][4][5] = 0.28037139560980277614e-1;
-       v[0][5][0] = 0.16800109713227567467e0;
-       v[0][5][1] = 0.77263794021029438797e-1;
-       v[0][5][2] = 0.49131622931360879320e-1;
-       v[0][5][3] = 0.35766126849971778501e-1;
-       v[0][5][4] = 0.28037139560980277614e-1;
-       v[0][5][5] = 0.23024181049838367777e-1;
-       v[1][0][0] = 0.17627471740390860505e1;
-       v[1][0][1] = 0.64779357469631903702e0;
-       v[1][0][2] = 0.38259785823210634567e0;
-       v[1][0][3] = 0.26915893322379450224e0;
-       v[1][0][4] = 0.20702239737104695572e0;
-       v[1][0][5] = 0.16800109713227567467e0;
-       v[1][1][0] = 0.11149535993427670134e1;
-       v[1][1][1] = 0.37165119978092233782e0;
-       v[1][1][2] = 0.21243947071963858053e0;
-       v[1][1][3] = 0.14726379157404849573e0;
-       v[1][1][4] = 0.11236373700291582202e0;
-       v[1][1][5] = 0.90737303111246235871e-1;
-       v[1][2][0] = 0.84975788287855432210e0;
-       v[1][2][1] = 0.26566721237799340376e0;
-       v[1][2][2] = 0.14884907827788122009e0;
-       v[1][2][3] = 0.10231567218303765515e0;
-       v[1][2][4] = 0.77727703422280083352e-1;
-       v[1][2][5] = 0.62605132021577676395e-1;
-       v[1][3][0] = 0.69800109142265347423e0;
-       v[1][3][1] = 0.20794647083778622837e0;
-       v[1][3][2] = 0.11487965864809909847e0;
-       v[1][3][3] = 0.78525390514866270852e-1;
-       v[1][3][4] = 0.59489228415223897572e-1;
-       v[1][3][5] = 0.47838457013298217744e-1;
-       v[1][4][0] = 0.59754668912231692323e0;
-       v[1][4][1] = 0.17125249387868593878e0;
-       v[1][4][2] = 0.93606816359052444729e-1;
-       v[1][4][3] = 0.63728830247554475330e-1;
-       v[1][4][4] = 0.48187332620207367724e-1;
-       v[1][4][5] = 0.38708290797416359020e-1;
-       v[1][5][0] = 0.52527944036356840363e0;
-       v[1][5][1] = 0.14574366656617935708e0;
-       v[1][5][2] = 0.78997159795636003667e-1;
-       v[1][5][3] = 0.53620816423066464705e-1;
-       v[1][5][4] = 0.40487985967086264433e-1;
-       v[1][5][5] = 0.32498604596082509165e-1;
-       v[2][0][0] = 0.17627471740390860505e1;
-       v[2][0][1] = 0.11149535993427670134e1;
-       v[2][0][2] = 0.84975788287855432210e0;
-       v[2][0][3] = 0.69800109142265347419e0;
-       v[2][0][4] = 0.59754668912231692318e0;
-       v[2][0][5] = 0.52527944036356840362e0;
-       v[2][1][0] = 0.64779357469631903702e0;
-       v[2][1][1] = 0.37165119978092233782e0;
-       v[2][1][2] = 0.26566721237799340376e0;
-       v[2][1][3] = 0.20794647083778622835e0;
-       v[2][1][4] = 0.17125249387868593876e0;
-       v[2][1][5] = 0.14574366656617935708e0;
-       v[2][2][0] = 0.38259785823210634567e0;
-       v[2][2][1] = 0.21243947071963858053e0;
-       v[2][2][2] = 0.14884907827788122009e0;
-       v[2][2][3] = 0.11487965864809909845e0;
-       v[2][2][4] = 0.93606816359052444712e-1;
-       v[2][2][5] = 0.78997159795636003667e-1;
-       v[2][3][0] = 0.26915893322379450223e0;
-       v[2][3][1] = 0.14726379157404849572e0;
-       v[2][3][2] = 0.10231567218303765514e0;
-       v[2][3][3] = 0.78525390514866270835e-1;
-       v[2][3][4] = 0.63728830247554475311e-1;
-       v[2][3][5] = 0.53620816423066464702e-1;
-       v[2][4][0] = 0.20702239737104695572e0;
-       v[2][4][1] = 0.11236373700291582202e0;
-       v[2][4][2] = 0.77727703422280083352e-1;
-       v[2][4][3] = 0.59489228415223897563e-1;
-       v[2][4][4] = 0.48187332620207367713e-1;
-       v[2][4][5] = 0.40487985967086264434e-1;
-       v[2][5][0] = 0.16800109713227567468e0;
-       v[2][5][1] = 0.90737303111246235879e-1;
-       v[2][5][2] = 0.62605132021577676399e-1;
-       v[2][5][3] = 0.47838457013298217740e-1;
-       v[2][5][4] = 0.38708290797416359014e-1;
-       v[2][5][5] = 0.32498604596082509169e-1;
-       v[3][0][0] = 0.17627471740390860505e1;
-       v[3][0][1] = 0.11149535993427670134e1;
-       v[3][0][2] = 0.84975788287855432210e0;
-       v[3][0][3] = 0.69800109142265347419e0;
-       v[3][0][4] = 0.59754668912231692318e0;
-       v[3][0][5] = 0.52527944036356840362e0;
-       v[3][1][0] = 0.11149535993427670134e1;
-       v[3][1][1] = 0.74330239956184467563e0;
-       v[3][1][2] = 0.58409067050056091834e0;
-       v[3][1][3] = 0.49005462058486724584e0;
-       v[3][1][4] = 0.42629419524363098443e0;
-       v[3][1][5] = 0.37953577379738904654e0;
-       v[3][2][0] = 0.84975788287855432210e0;
-       v[3][2][1] = 0.58409067050056091834e0;
-       v[3][2][2] = 0.46727253640044873467e0;
-       v[3][2][3] = 0.39698780839518011595e0;
-       v[3][2][4] = 0.34864851772399749038e0;
-       v[3][2][5] = 0.31278926702684569312e0;
-       v[3][3][0] = 0.69800109142265347423e0;
-       v[3][3][1] = 0.49005462058486724586e0;
-       v[3][3][2] = 0.39698780839518011599e0;
-       v[3][3][3] = 0.34027526433872581371e0;
-       v[3][3][4] = 0.30088082631586196583e0;
-       v[3][3][5] = 0.27141910362887187844e0;
-       v[3][4][0] = 0.59754668912231692323e0;
-       v[3][4][1] = 0.42629419524363098445e0;
-       v[3][4][2] = 0.34864851772399749044e0;
-       v[3][4][3] = 0.30088082631586196576e0;
-       v[3][4][4] = 0.26744962339187730308e0;
-       v[3][4][5] = 0.24229245314748740295e0;
-       v[3][5][0] = 0.52527944036356840363e0;
-       v[3][5][1] = 0.37953577379738904655e0;
-       v[3][5][2] = 0.31278926702684569301e0;
-       v[3][5][3] = 0.27141910362887187862e0;
-       v[3][5][4] = 0.24229245314748740263e0;
-       v[3][5][5] = 0.22026586649771582089e0;
+  static double v[4][6][6] = {{{0}}};
+  if (v[0][0][0] == 0)
+    {
+      v[0][0][0] = 0.17627471740390860505e1;
+      v[0][0][1] = 0.64779357469631903702e0;
+      v[0][0][2] = 0.38259785823210634567e0;
+      v[0][0][3] = 0.26915893322379450224e0;
+      v[0][0][4] = 0.20702239737104695572e0;
+      v[0][0][5] = 0.16800109713227567467e0;
+      v[0][1][0] = 0.64779357469631903702e0;
+      v[0][1][1] = 0.27614237491539669920e0;
+      v[0][1][2] = 0.17015838751246776515e0;
+      v[0][1][3] = 0.12189514164974600651e0;
+      v[0][1][4] = 0.94658660368131133694e-1;
+      v[0][1][5] = 0.77263794021029438797e-1;
+      v[0][2][0] = 0.38259785823210634567e0;
+      v[0][2][1] = 0.17015838751246776515e0;
+      v[0][2][2] = 0.10656799507071040471e0;
+      v[0][2][3] = 0.76947022258735165920e-1;
+      v[0][2][4] = 0.60022626787495395021e-1;
+      v[0][2][5] = 0.49131622931360879320e-1;
+      v[0][3][0] = 0.26915893322379450224e0;
+      v[0][3][1] = 0.12189514164974600651e0;
+      v[0][3][2] = 0.76947022258735165919e-1;
+      v[0][3][3] = 0.55789184535895709637e-1;
+      v[0][3][4] = 0.43625068213915842136e-1;
+      v[0][3][5] = 0.35766126849971778500e-1;
+      v[0][4][0] = 0.20702239737104695572e0;
+      v[0][4][1] = 0.94658660368131133694e-1;
+      v[0][4][2] = 0.60022626787495395021e-1;
+      v[0][4][3] = 0.43625068213915842137e-1;
+      v[0][4][4] = 0.34164088852375945192e-1;
+      v[0][4][5] = 0.28037139560980277614e-1;
+      v[0][5][0] = 0.16800109713227567467e0;
+      v[0][5][1] = 0.77263794021029438797e-1;
+      v[0][5][2] = 0.49131622931360879320e-1;
+      v[0][5][3] = 0.35766126849971778501e-1;
+      v[0][5][4] = 0.28037139560980277614e-1;
+      v[0][5][5] = 0.23024181049838367777e-1;
+      v[1][0][0] = 0.17627471740390860505e1;
+      v[1][0][1] = 0.64779357469631903702e0;
+      v[1][0][2] = 0.38259785823210634567e0;
+      v[1][0][3] = 0.26915893322379450224e0;
+      v[1][0][4] = 0.20702239737104695572e0;
+      v[1][0][5] = 0.16800109713227567467e0;
+      v[1][1][0] = 0.11149535993427670134e1;
+      v[1][1][1] = 0.37165119978092233782e0;
+      v[1][1][2] = 0.21243947071963858053e0;
+      v[1][1][3] = 0.14726379157404849573e0;
+      v[1][1][4] = 0.11236373700291582202e0;
+      v[1][1][5] = 0.90737303111246235871e-1;
+      v[1][2][0] = 0.84975788287855432210e0;
+      v[1][2][1] = 0.26566721237799340376e0;
+      v[1][2][2] = 0.14884907827788122009e0;
+      v[1][2][3] = 0.10231567218303765515e0;
+      v[1][2][4] = 0.77727703422280083352e-1;
+      v[1][2][5] = 0.62605132021577676395e-1;
+      v[1][3][0] = 0.69800109142265347423e0;
+      v[1][3][1] = 0.20794647083778622837e0;
+      v[1][3][2] = 0.11487965864809909847e0;
+      v[1][3][3] = 0.78525390514866270852e-1;
+      v[1][3][4] = 0.59489228415223897572e-1;
+      v[1][3][5] = 0.47838457013298217744e-1;
+      v[1][4][0] = 0.59754668912231692323e0;
+      v[1][4][1] = 0.17125249387868593878e0;
+      v[1][4][2] = 0.93606816359052444729e-1;
+      v[1][4][3] = 0.63728830247554475330e-1;
+      v[1][4][4] = 0.48187332620207367724e-1;
+      v[1][4][5] = 0.38708290797416359020e-1;
+      v[1][5][0] = 0.52527944036356840363e0;
+      v[1][5][1] = 0.14574366656617935708e0;
+      v[1][5][2] = 0.78997159795636003667e-1;
+      v[1][5][3] = 0.53620816423066464705e-1;
+      v[1][5][4] = 0.40487985967086264433e-1;
+      v[1][5][5] = 0.32498604596082509165e-1;
+      v[2][0][0] = 0.17627471740390860505e1;
+      v[2][0][1] = 0.11149535993427670134e1;
+      v[2][0][2] = 0.84975788287855432210e0;
+      v[2][0][3] = 0.69800109142265347419e0;
+      v[2][0][4] = 0.59754668912231692318e0;
+      v[2][0][5] = 0.52527944036356840362e0;
+      v[2][1][0] = 0.64779357469631903702e0;
+      v[2][1][1] = 0.37165119978092233782e0;
+      v[2][1][2] = 0.26566721237799340376e0;
+      v[2][1][3] = 0.20794647083778622835e0;
+      v[2][1][4] = 0.17125249387868593876e0;
+      v[2][1][5] = 0.14574366656617935708e0;
+      v[2][2][0] = 0.38259785823210634567e0;
+      v[2][2][1] = 0.21243947071963858053e0;
+      v[2][2][2] = 0.14884907827788122009e0;
+      v[2][2][3] = 0.11487965864809909845e0;
+      v[2][2][4] = 0.93606816359052444712e-1;
+      v[2][2][5] = 0.78997159795636003667e-1;
+      v[2][3][0] = 0.26915893322379450223e0;
+      v[2][3][1] = 0.14726379157404849572e0;
+      v[2][3][2] = 0.10231567218303765514e0;
+      v[2][3][3] = 0.78525390514866270835e-1;
+      v[2][3][4] = 0.63728830247554475311e-1;
+      v[2][3][5] = 0.53620816423066464702e-1;
+      v[2][4][0] = 0.20702239737104695572e0;
+      v[2][4][1] = 0.11236373700291582202e0;
+      v[2][4][2] = 0.77727703422280083352e-1;
+      v[2][4][3] = 0.59489228415223897563e-1;
+      v[2][4][4] = 0.48187332620207367713e-1;
+      v[2][4][5] = 0.40487985967086264434e-1;
+      v[2][5][0] = 0.16800109713227567468e0;
+      v[2][5][1] = 0.90737303111246235879e-1;
+      v[2][5][2] = 0.62605132021577676399e-1;
+      v[2][5][3] = 0.47838457013298217740e-1;
+      v[2][5][4] = 0.38708290797416359014e-1;
+      v[2][5][5] = 0.32498604596082509169e-1;
+      v[3][0][0] = 0.17627471740390860505e1;
+      v[3][0][1] = 0.11149535993427670134e1;
+      v[3][0][2] = 0.84975788287855432210e0;
+      v[3][0][3] = 0.69800109142265347419e0;
+      v[3][0][4] = 0.59754668912231692318e0;
+      v[3][0][5] = 0.52527944036356840362e0;
+      v[3][1][0] = 0.11149535993427670134e1;
+      v[3][1][1] = 0.74330239956184467563e0;
+      v[3][1][2] = 0.58409067050056091834e0;
+      v[3][1][3] = 0.49005462058486724584e0;
+      v[3][1][4] = 0.42629419524363098443e0;
+      v[3][1][5] = 0.37953577379738904654e0;
+      v[3][2][0] = 0.84975788287855432210e0;
+      v[3][2][1] = 0.58409067050056091834e0;
+      v[3][2][2] = 0.46727253640044873467e0;
+      v[3][2][3] = 0.39698780839518011595e0;
+      v[3][2][4] = 0.34864851772399749038e0;
+      v[3][2][5] = 0.31278926702684569312e0;
+      v[3][3][0] = 0.69800109142265347423e0;
+      v[3][3][1] = 0.49005462058486724586e0;
+      v[3][3][2] = 0.39698780839518011599e0;
+      v[3][3][3] = 0.34027526433872581371e0;
+      v[3][3][4] = 0.30088082631586196583e0;
+      v[3][3][5] = 0.27141910362887187844e0;
+      v[3][4][0] = 0.59754668912231692323e0;
+      v[3][4][1] = 0.42629419524363098445e0;
+      v[3][4][2] = 0.34864851772399749044e0;
+      v[3][4][3] = 0.30088082631586196576e0;
+      v[3][4][4] = 0.26744962339187730308e0;
+      v[3][4][5] = 0.24229245314748740295e0;
+      v[3][5][0] = 0.52527944036356840363e0;
+      v[3][5][1] = 0.37953577379738904655e0;
+      v[3][5][2] = 0.31278926702684569301e0;
+      v[3][5][3] = 0.27141910362887187862e0;
+      v[3][5][4] = 0.24229245314748740263e0;
+      v[3][5][5] = 0.22026586649771582089e0;
     }
-    return v[vertex_index][i][j];
+  return v[vertex_index][i][j];
 }
index 7c9a59cef558961678c54c64aa23e18e101bbcf7..b690cdc703f80437b5a9805c368c5f40c53b1438 100644 (file)
 std::ofstream logfile("interpolate_boundary_values_01/output");
 
 template <int dim, int spacedim>
-void test(std::string filename) {
-    Triangulation<dim, spacedim> tria;
-    GridIn<dim, spacedim> gi;
-    gi.attach_triangulation (tria);
-    std::ifstream in (filename.c_str());
-    gi.read_ucd (in);
-
-    deallog << tria.n_active_cells() << " active cells" << std::endl;
-
-    FE_Q<dim,spacedim> fe(2);
-    DoFHandler<dim,spacedim> dof_handler (tria);
-    dof_handler.distribute_dofs (fe);
-
-    deallog << dof_handler.n_dofs() << " degrees of freedom" << std::endl;
-
-    std::map<types::global_dof_index, double> bv;
-    VectorTools::interpolate_boundary_values (dof_handler,
-                                             0,
-                                             Functions::SquareFunction<spacedim>(),
-                                             bv);
-    deallog << bv.size() << " boundary degrees of freedom" << std::endl;
-
-    for (std::map<types::global_dof_index, double>::const_iterator i = bv.begin();
-        i != bv.end(); ++i)
-      deallog << i->first << ' ' << i->second << std::endl;
-
-    for (typename DoFHandler<dim,spacedim>::active_cell_iterator
-          cell = dof_handler.begin_active(); cell != dof_handler.end(); ++cell)
-      for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
-       if (cell->at_boundary(f))
-         for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
-           for (unsigned int i=0; i<fe.dofs_per_vertex; ++i)
-             {
-               Assert (bv.find(cell->face(f)->vertex_dof_index(v,i))
-                       != bv.end(),
-                       ExcInternalError());
-               Assert (bv[cell->face(f)->vertex_dof_index(v,i)]
-                       ==
-                       Functions::SquareFunction<spacedim>()
-                       .value(cell->face(f)->vertex(v),i),
-                       ExcInternalError());
-             }
+void test(std::string filename)
+{
+  Triangulation<dim, spacedim> tria;
+  GridIn<dim, spacedim> gi;
+  gi.attach_triangulation (tria);
+  std::ifstream in (filename.c_str());
+  gi.read_ucd (in);
+
+  deallog << tria.n_active_cells() << " active cells" << std::endl;
+
+  FE_Q<dim,spacedim> fe(2);
+  DoFHandler<dim,spacedim> dof_handler (tria);
+  dof_handler.distribute_dofs (fe);
+
+  deallog << dof_handler.n_dofs() << " degrees of freedom" << std::endl;
+
+  std::map<types::global_dof_index, double> bv;
+  VectorTools::interpolate_boundary_values (dof_handler,
+                                            0,
+                                            Functions::SquareFunction<spacedim>(),
+                                            bv);
+  deallog << bv.size() << " boundary degrees of freedom" << std::endl;
+
+  for (std::map<types::global_dof_index, double>::const_iterator i = bv.begin();
+       i != bv.end(); ++i)
+    deallog << i->first << ' ' << i->second << std::endl;
+
+  for (typename DoFHandler<dim,spacedim>::active_cell_iterator
+       cell = dof_handler.begin_active(); cell != dof_handler.end(); ++cell)
+    for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+      if (cell->at_boundary(f))
+        for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
+          for (unsigned int i=0; i<fe.dofs_per_vertex; ++i)
+            {
+              Assert (bv.find(cell->face(f)->vertex_dof_index(v,i))
+                      != bv.end(),
+                      ExcInternalError());
+              Assert (bv[cell->face(f)->vertex_dof_index(v,i)]
+                      ==
+                      Functions::SquareFunction<spacedim>()
+                      .value(cell->face(f)->vertex(v),i),
+                      ExcInternalError());
+            }
 }
 
 
index 393fb8d47faee676b1fc52a6264b58663cbe5b17..c19723bb79d80b7947d0130d7244517668a60138 100644 (file)
@@ -37,60 +37,61 @@ std::ofstream logfile("interpolate_boundary_values_01_vector_valued/output");
 template <int dim>
 class X : public Function<dim>
 {
-  public:
-    X() : Function<dim>(dim) {}
-
-    double value (const Point<dim> &p,
-                 const unsigned int component) const
-      {
-       return p[component];
-      }
+public:
+  X() : Function<dim>(dim) {}
+
+  double value (const Point<dim> &p,
+                const unsigned int component) const
+  {
+    return p[component];
+  }
 };
 
 
 template <int dim, int spacedim>
-void test(std::string filename) {
-    Triangulation<dim, spacedim> tria;
-    GridIn<dim, spacedim> gi;
-    gi.attach_triangulation (tria);
-    std::ifstream in (filename.c_str());
-    gi.read_ucd (in);
-
-    deallog << tria.n_active_cells() << " active cells" << std::endl;
-
-    FESystem<dim,spacedim> fe(FE_Q<dim,spacedim> (2), spacedim);
-    DoFHandler<dim,spacedim> dof_handler (tria);
-    dof_handler.distribute_dofs (fe);
-
-    deallog << dof_handler.n_dofs() << " degrees of freedom" << std::endl;
-
-    std::map<types::global_dof_index, double> bv;
-    VectorTools::interpolate_boundary_values (dof_handler,
-                                             0,
-                                             X<spacedim>(),
-                                             bv);
-    deallog << bv.size() << " boundary degrees of freedom" << std::endl;
-
-    for (std::map<types::global_dof_index, double>::const_iterator i = bv.begin();
-        i != bv.end(); ++i)
-      deallog << i->first << ' ' << i->second << std::endl;
-
-    for (typename DoFHandler<dim,spacedim>::active_cell_iterator
-          cell = dof_handler.begin_active(); cell != dof_handler.end(); ++cell)
-      for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
-       if (cell->at_boundary(f))
-         for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
-           for (unsigned int i=0; i<fe.dofs_per_vertex; ++i)
-             {
-               Assert (bv.find(cell->face(f)->vertex_dof_index(v,i))
-                       != bv.end(),
-                       ExcInternalError());
-               Assert (bv[cell->face(f)->vertex_dof_index(v,i)]
-                       ==
-                       X<spacedim>()
-                       .value(cell->face(f)->vertex(v),i),
-                       ExcInternalError());
-             }
+void test(std::string filename)
+{
+  Triangulation<dim, spacedim> tria;
+  GridIn<dim, spacedim> gi;
+  gi.attach_triangulation (tria);
+  std::ifstream in (filename.c_str());
+  gi.read_ucd (in);
+
+  deallog << tria.n_active_cells() << " active cells" << std::endl;
+
+  FESystem<dim,spacedim> fe(FE_Q<dim,spacedim> (2), spacedim);
+  DoFHandler<dim,spacedim> dof_handler (tria);
+  dof_handler.distribute_dofs (fe);
+
+  deallog << dof_handler.n_dofs() << " degrees of freedom" << std::endl;
+
+  std::map<types::global_dof_index, double> bv;
+  VectorTools::interpolate_boundary_values (dof_handler,
+                                            0,
+                                            X<spacedim>(),
+                                            bv);
+  deallog << bv.size() << " boundary degrees of freedom" << std::endl;
+
+  for (std::map<types::global_dof_index, double>::const_iterator i = bv.begin();
+       i != bv.end(); ++i)
+    deallog << i->first << ' ' << i->second << std::endl;
+
+  for (typename DoFHandler<dim,spacedim>::active_cell_iterator
+       cell = dof_handler.begin_active(); cell != dof_handler.end(); ++cell)
+    for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+      if (cell->at_boundary(f))
+        for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
+          for (unsigned int i=0; i<fe.dofs_per_vertex; ++i)
+            {
+              Assert (bv.find(cell->face(f)->vertex_dof_index(v,i))
+                      != bv.end(),
+                      ExcInternalError());
+              Assert (bv[cell->face(f)->vertex_dof_index(v,i)]
+                      ==
+                      X<spacedim>()
+                      .value(cell->face(f)->vertex(v),i),
+                      ExcInternalError());
+            }
 }
 
 
index 0cc617a5eee7617f083953a0bffe4f84f21fca53..bb4e12b70111f765f5184896b012fa026dd0e08f 100644 (file)
 
 std::ofstream logfile("interpolate_boundary_values_02/output");
 
-void test() {
+void test()
+{
   const int dim = 1;
   const int spacedim = 2;
 
-    Triangulation<dim, spacedim> tria;
-    GridGenerator::hyper_cube (tria);
-    deallog << tria.n_active_cells() << " active cells" << std::endl;
-
-    FE_Q<dim,spacedim> fe(2);
-    DoFHandler<dim,spacedim> dof_handler (tria);
-    dof_handler.distribute_dofs (fe);
-
-    deallog << dof_handler.n_dofs() << " degrees of freedom" << std::endl;
-
-                                    // test left and right boundary
-                                    // separatel
-    for (unsigned int boundary_id=0; boundary_id<2; ++boundary_id)
-      {
-       std::map<types::global_dof_index, double> bv;
-       VectorTools::interpolate_boundary_values (dof_handler,
-                                                 boundary_id,
-                                                 Functions::SquareFunction<spacedim>(),
-                                                 bv);
-       deallog << bv.size() << " boundary degrees of freedom" << std::endl;
-
-       for (std::map<types::global_dof_index, double>::const_iterator i = bv.begin();
-            i != bv.end(); ++i)
-         deallog << i->first << ' ' << i->second << std::endl;
-
-       for (DoFHandler<dim,spacedim>::active_cell_iterator
-              cell = dof_handler.begin_active(); cell != dof_handler.end(); ++cell)
-         for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
-           if (cell->at_boundary(f) &&
-               (cell->face(f)->boundary_indicator() == boundary_id))
-             for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
-               for (unsigned int i=0; i<fe.dofs_per_vertex; ++i)
-                 {
-                   Assert (bv.find(cell->face(f)->vertex_dof_index(v,i))
-                           != bv.end(),
-                           ExcInternalError());
-                   Assert (bv[cell->face(f)->vertex_dof_index(v,i)]
-                           ==
-                           Functions::SquareFunction<spacedim>()
-                           .value(cell->face(f)->vertex(v),i),
-                           ExcInternalError());
-                 }
-      }
+  Triangulation<dim, spacedim> tria;
+  GridGenerator::hyper_cube (tria);
+  deallog << tria.n_active_cells() << " active cells" << std::endl;
+
+  FE_Q<dim,spacedim> fe(2);
+  DoFHandler<dim,spacedim> dof_handler (tria);
+  dof_handler.distribute_dofs (fe);
+
+  deallog << dof_handler.n_dofs() << " degrees of freedom" << std::endl;
+
+  // test left and right boundary
+  // separatel
+  for (unsigned int boundary_id=0; boundary_id<2; ++boundary_id)
+    {
+      std::map<types::global_dof_index, double> bv;
+      VectorTools::interpolate_boundary_values (dof_handler,
+                                                boundary_id,
+                                                Functions::SquareFunction<spacedim>(),
+                                                bv);
+      deallog << bv.size() << " boundary degrees of freedom" << std::endl;
+
+      for (std::map<types::global_dof_index, double>::const_iterator i = bv.begin();
+           i != bv.end(); ++i)
+        deallog << i->first << ' ' << i->second << std::endl;
+
+      for (DoFHandler<dim,spacedim>::active_cell_iterator
+           cell = dof_handler.begin_active(); cell != dof_handler.end(); ++cell)
+        for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+          if (cell->at_boundary(f) &&
+              (cell->face(f)->boundary_indicator() == boundary_id))
+            for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
+              for (unsigned int i=0; i<fe.dofs_per_vertex; ++i)
+                {
+                  Assert (bv.find(cell->face(f)->vertex_dof_index(v,i))
+                          != bv.end(),
+                          ExcInternalError());
+                  Assert (bv[cell->face(f)->vertex_dof_index(v,i)]
+                          ==
+                          Functions::SquareFunction<spacedim>()
+                          .value(cell->face(f)->vertex(v),i),
+                          ExcInternalError());
+                }
+    }
 }
 
 
index cdb9f76b192c7da8b1139664d55a8ff9417fbda7..62db68b2b37c1153321b98c990c2e348eaadaaf5 100644 (file)
@@ -37,63 +37,64 @@ std::ofstream logfile("interpolate_boundary_values_02_vector_valued/output");
 template <int dim>
 class X : public Function<dim>
 {
-  public:
-    X() : Function<dim>(dim) {}
-
-    double value (const Point<dim> &p,
-                 const unsigned int component) const
-      {
-       return p[component];
-      }
+public:
+  X() : Function<dim>(dim) {}
+
+  double value (const Point<dim> &p,
+                const unsigned int component) const
+  {
+    return p[component];
+  }
 };
 
-void test() {
+void test()
+{
   const int dim = 1;
   const int spacedim = 2;
 
-    Triangulation<dim, spacedim> tria;
-    GridGenerator::hyper_cube (tria);
-    deallog << tria.n_active_cells() << " active cells" << std::endl;
-
-    FESystem<dim,spacedim> fe(FE_Q<dim,spacedim>(2), spacedim);
-    DoFHandler<dim,spacedim> dof_handler (tria);
-    dof_handler.distribute_dofs (fe);
-
-    deallog << dof_handler.n_dofs() << " degrees of freedom" << std::endl;
-
-                                    // test left and right boundary
-                                    // separatel
-    for (unsigned int boundary_id=0; boundary_id<2; ++boundary_id)
-      {
-       std::map<types::global_dof_index, double> bv;
-       VectorTools::interpolate_boundary_values (dof_handler,
-                                                 boundary_id,
-                                                 X<spacedim>(),
-                                                 bv);
-       deallog << bv.size() << " boundary degrees of freedom" << std::endl;
-
-       for (std::map<types::global_dof_index, double>::const_iterator i = bv.begin();
-            i != bv.end(); ++i)
-         deallog << i->first << ' ' << i->second << std::endl;
-
-       for (DoFHandler<dim,spacedim>::active_cell_iterator
-              cell = dof_handler.begin_active(); cell != dof_handler.end(); ++cell)
-         for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
-           if (cell->at_boundary(f) &&
-               (cell->face(f)->boundary_indicator() == boundary_id))
-             for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
-               for (unsigned int i=0; i<fe.dofs_per_vertex; ++i)
-                 {
-                   Assert (bv.find(cell->face(f)->vertex_dof_index(v,i))
-                           != bv.end(),
-                           ExcInternalError());
-                   Assert (bv[cell->face(f)->vertex_dof_index(v,i)]
-                           ==
-                           X<spacedim>()
-                           .value(cell->face(f)->vertex(v),i),
-                           ExcInternalError());
-                 }
-      }
+  Triangulation<dim, spacedim> tria;
+  GridGenerator::hyper_cube (tria);
+  deallog << tria.n_active_cells() << " active cells" << std::endl;
+
+  FESystem<dim,spacedim> fe(FE_Q<dim,spacedim>(2), spacedim);
+  DoFHandler<dim,spacedim> dof_handler (tria);
+  dof_handler.distribute_dofs (fe);
+
+  deallog << dof_handler.n_dofs() << " degrees of freedom" << std::endl;
+
+  // test left and right boundary
+  // separatel
+  for (unsigned int boundary_id=0; boundary_id<2; ++boundary_id)
+    {
+      std::map<types::global_dof_index, double> bv;
+      VectorTools::interpolate_boundary_values (dof_handler,
+                                                boundary_id,
+                                                X<spacedim>(),
+                                                bv);
+      deallog << bv.size() << " boundary degrees of freedom" << std::endl;
+
+      for (std::map<types::global_dof_index, double>::const_iterator i = bv.begin();
+           i != bv.end(); ++i)
+        deallog << i->first << ' ' << i->second << std::endl;
+
+      for (DoFHandler<dim,spacedim>::active_cell_iterator
+           cell = dof_handler.begin_active(); cell != dof_handler.end(); ++cell)
+        for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+          if (cell->at_boundary(f) &&
+              (cell->face(f)->boundary_indicator() == boundary_id))
+            for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
+              for (unsigned int i=0; i<fe.dofs_per_vertex; ++i)
+                {
+                  Assert (bv.find(cell->face(f)->vertex_dof_index(v,i))
+                          != bv.end(),
+                          ExcInternalError());
+                  Assert (bv[cell->face(f)->vertex_dof_index(v,i)]
+                          ==
+                          X<spacedim>()
+                          .value(cell->face(f)->vertex(v),i),
+                          ExcInternalError());
+                }
+    }
 }
 
 
index 2a9656f19eafc322b6c2873dc2e1ce8a62cb3a56..a396de8c9d22761c76394d47bd9ff94a864044e3 100644 (file)
 
 std::ofstream logfile("interpolate_boundary_values_03/output");
 
-void test() {
+void test()
+{
   const int dim = 1;
   const int spacedim = 2;
-  
+
   Triangulation<dim, spacedim> tria;
   Triangulation<spacedim> volume_mesh;
   GridGenerator::half_hyper_ball(volume_mesh);
   std::set<types::boundary_id> boundary_ids;
   boundary_ids.insert(0);
-  
+
   GridTools::extract_boundary_mesh (volume_mesh, tria,boundary_ids);
-    
+
   deallog << tria.n_active_cells() << " active cells" << std::endl;
 
   FE_Q<dim,spacedim> fe(1);
@@ -53,39 +54,39 @@ void test() {
   dof_handler.distribute_dofs (fe);
 
   deallog << dof_handler.n_dofs() << " degrees of freedom" << std::endl;
-  
-                                  // test left and right boundary
-                                  // separately
+
+  // test left and right boundary
+  // separately
   for (unsigned int boundary_id=0; boundary_id<2; ++boundary_id)
     {
       std::map<types::global_dof_index, double> bv;
       VectorTools::interpolate_boundary_values (dof_handler,
-                                               boundary_id,
-                                               Functions::SquareFunction<spacedim>(),
-                                               bv);
+                                                boundary_id,
+                                                Functions::SquareFunction<spacedim>(),
+                                                bv);
       deallog << bv.size() << " boundary degrees of freedom" << std::endl;
-      
+
       for (std::map<types::global_dof_index, double>::const_iterator i = bv.begin();
-          i != bv.end(); ++i)
-       deallog << i->first << ' ' << i->second << std::endl;
-      
+           i != bv.end(); ++i)
+        deallog << i->first << ' ' << i->second << std::endl;
+
       for (DoFHandler<dim,spacedim>::active_cell_iterator
-            cell = dof_handler.begin_active(); cell != dof_handler.end(); ++cell)
-       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
-         if (cell->at_boundary(f) &&
-             (cell->face(f)->boundary_indicator() == boundary_id))
-           for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
-             for (unsigned int i=0; i<fe.dofs_per_vertex; ++i)
-               {
-                 Assert (bv.find(cell->face(f)->vertex_dof_index(v,i))
-                         != bv.end(),
-                         ExcInternalError());
-                 Assert (bv[cell->face(f)->vertex_dof_index(v,i)]
-                         ==
-                         Functions::SquareFunction<spacedim>()
-                         .value(cell->face(f)->vertex(v),i),
-                         ExcInternalError());
-               }
+           cell = dof_handler.begin_active(); cell != dof_handler.end(); ++cell)
+        for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+          if (cell->at_boundary(f) &&
+              (cell->face(f)->boundary_indicator() == boundary_id))
+            for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
+              for (unsigned int i=0; i<fe.dofs_per_vertex; ++i)
+                {
+                  Assert (bv.find(cell->face(f)->vertex_dof_index(v,i))
+                          != bv.end(),
+                          ExcInternalError());
+                  Assert (bv[cell->face(f)->vertex_dof_index(v,i)]
+                          ==
+                          Functions::SquareFunction<spacedim>()
+                          .value(cell->face(f)->vertex(v),i),
+                          ExcInternalError());
+                }
     }
 }
 
@@ -95,9 +96,9 @@ int main ()
 {
   deallog.attach(logfile);
   deallog.depth_console(0);
-  
+
   test();
-  
+
   return 0;
 }
 
index 56dfa0055963c3b3fe4697781be44db5ff73d950..303cacb9fe7da787ad7d42d178d1792b0a67d36c 100644 (file)
@@ -43,58 +43,59 @@ using namespace dealii;
 
 std::ofstream logfile("interpolate_boundary_values_1d_closed_ring/output");
 
-void test() {
+void test()
+{
   const unsigned int dim = 1;
   const unsigned int spacedim=2;
 
   Triangulation<dim,spacedim> tria;
   std::map<Triangulation<dim,spacedim>::cell_iterator,Triangulation<spacedim,spacedim>::face_iterator >
-    surface_to_volume_mapping;
+  surface_to_volume_mapping;
   Triangulation<spacedim> volume_mesh;
   GridGenerator::hyper_cube(volume_mesh);
 
   surface_to_volume_mapping
     = GridTools::extract_boundary_mesh (volume_mesh, tria);
 
-    FE_Q<dim,spacedim> fe(2);
-    DoFHandler<dim,spacedim> dof_handler (tria);
-    dof_handler.distribute_dofs (fe);
-
-    deallog << dof_handler.n_dofs() << " degrees of freedom" << std::endl;
-
-                                    // test left and right boundary
-                                    // separatel
-    for (unsigned int boundary_id=0; boundary_id<2; ++boundary_id)
-      {
-       std::map<types::global_dof_index, double> bv;
-       VectorTools::interpolate_boundary_values (dof_handler,
-                                                 boundary_id,
-                                                 Functions::SquareFunction<spacedim>(),
-                                                 bv);
-       deallog << bv.size() << " boundary degrees of freedom" << std::endl;
-
-       for (std::map<types::global_dof_index, double>::const_iterator i = bv.begin();
-            i != bv.end(); ++i)
-         deallog << i->first << ' ' << i->second << std::endl;
-
-       for (DoFHandler<dim,spacedim>::active_cell_iterator
-              cell = dof_handler.begin_active(); cell != dof_handler.end(); ++cell)
-         for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
-           if (cell->at_boundary(f) &&
-               (cell->face(f)->boundary_indicator() == boundary_id))
-             for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
-               for (unsigned int i=0; i<fe.dofs_per_vertex; ++i)
-                 {
-                   Assert (bv.find(cell->face(f)->vertex_dof_index(v,i))
-                           != bv.end(),
-                           ExcInternalError());
-                   Assert (bv[cell->face(f)->vertex_dof_index(v,i)]
-                           ==
-                           Functions::SquareFunction<spacedim>()
-                           .value(cell->face(f)->vertex(v),i),
-                           ExcInternalError());
-                 }
-      }
+  FE_Q<dim,spacedim> fe(2);
+  DoFHandler<dim,spacedim> dof_handler (tria);
+  dof_handler.distribute_dofs (fe);
+
+  deallog << dof_handler.n_dofs() << " degrees of freedom" << std::endl;
+
+  // test left and right boundary
+  // separatel
+  for (unsigned int boundary_id=0; boundary_id<2; ++boundary_id)
+    {
+      std::map<types::global_dof_index, double> bv;
+      VectorTools::interpolate_boundary_values (dof_handler,
+                                                boundary_id,
+                                                Functions::SquareFunction<spacedim>(),
+                                                bv);
+      deallog << bv.size() << " boundary degrees of freedom" << std::endl;
+
+      for (std::map<types::global_dof_index, double>::const_iterator i = bv.begin();
+           i != bv.end(); ++i)
+        deallog << i->first << ' ' << i->second << std::endl;
+
+      for (DoFHandler<dim,spacedim>::active_cell_iterator
+           cell = dof_handler.begin_active(); cell != dof_handler.end(); ++cell)
+        for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+          if (cell->at_boundary(f) &&
+              (cell->face(f)->boundary_indicator() == boundary_id))
+            for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_face; ++v)
+              for (unsigned int i=0; i<fe.dofs_per_vertex; ++i)
+                {
+                  Assert (bv.find(cell->face(f)->vertex_dof_index(v,i))
+                          != bv.end(),
+                          ExcInternalError());
+                  Assert (bv[cell->face(f)->vertex_dof_index(v,i)]
+                          ==
+                          Functions::SquareFunction<spacedim>()
+                          .value(cell->face(f)->vertex(v),i),
+                          ExcInternalError());
+                }
+    }
 }
 
 
index 94d2599273dc9d92a84f0a53ace04188062d4990..294b7bbb28adc8b88315ed22749d84435a00dc8a 100644 (file)
@@ -46,7 +46,8 @@ std::ofstream logfile("interpolation/output");
 
 
 template <int dim, int spacedim>
-void test(std::string filename, unsigned int n) {
+void test(std::string filename, unsigned int n)
+{
 
   Triangulation<dim, spacedim> triangulation;
   GridIn<dim, spacedim> gi;
@@ -59,37 +60,37 @@ void test(std::string filename, unsigned int n) {
   DoFHandler<dim,spacedim> dof_handler (triangulation);
 
   dof_handler.distribute_dofs (fe);
-  
+
   // Now we interpolate the constant function on the mesh, and check
   // that this is consistent with what we expect.
   Vector<double> real_one(dof_handler.n_dofs());
   Vector<double> interpolated_one(dof_handler.n_dofs());
-  for(unsigned int i=0; i <real_one.size(); ++i) 
-      real_one(i) = 1.;
-  
+  for (unsigned int i=0; i <real_one.size(); ++i)
+    real_one(i) = 1.;
+
   ConstantFunction<spacedim> constant(1.);
   VectorTools::interpolate(dof_handler, constant, interpolated_one);
-  
+
   real_one.add(-1, interpolated_one);
-  
-  deallog << "L2 Norm of difference: " 
-         << real_one.l2_norm() << std::endl
-         <<  "Linfty Norm of difference: " 
-         << real_one.linfty_norm() << std::endl;
+
+  deallog << "L2 Norm of difference: "
+          << real_one.l2_norm() << std::endl
+          <<  "Linfty Norm of difference: "
+          << real_one.linfty_norm() << std::endl;
 }
 
 
 
-int main () 
+int main ()
 {
   deallog.attach(logfile);
   deallog.depth_console(0);
-  
-  for(unsigned int n=1; n<8; ++n) 
+
+  for (unsigned int n=1; n<8; ++n)
     {
       deallog << "Test<1,2>, finite element q_" << n << std::endl;
       test<1,2>("grids/circle_2.inp",n);
-      
+
       deallog << "Test<1,2>, finite element q_" << n << std::endl;
       test<2,3>("grids/sphere_2.inp",n);
     }
index 832e1ecbee1b959257db568b4517a1f7e5675f27..0196eee1b12f34af99cce4c9d4f24be757824d21 100644 (file)
@@ -47,7 +47,8 @@ std::ofstream logfile("interpolation_2/output");
 
 
 template <int dim, int spacedim>
-void test(std::string filename) {
+void test(std::string filename)
+{
 
   Triangulation<dim, spacedim> triangulation;
   GridIn<dim, spacedim> gi;
@@ -60,14 +61,14 @@ void test(std::string filename) {
   DoFHandler<dim,spacedim> dof_handler (triangulation);
 
   dof_handler.distribute_dofs (fe);
-  
+
   // Now we interpolate the constant function on the mesh, and check
   // that this is consistent with what we expect.
   Vector<double> interpolated_one(dof_handler.n_dofs());
-  
+
   Functions::CosineFunction<spacedim> cosine;
   VectorTools::interpolate(dof_handler, cosine, interpolated_one);
-  
+
   DataOut<dim, DoFHandler<dim,spacedim> > dataout;
   dataout.attach_dof_handler(dof_handler);
   dataout.add_data_vector(interpolated_one, "numbering");
@@ -77,11 +78,11 @@ void test(std::string filename) {
 
 
 
-int main () 
+int main ()
 {
   deallog.attach(logfile);
   deallog.depth_console(0);
-  
+
   deallog << "Test<1,2>" << std::endl;
   test<1,2>("grids/circle_2.inp");
 
index 069c5dc5cce0b44d70841c4db80f0fe892486359..fbf6d8541f7d4e8a047cc663f1654964bc052f52 100644 (file)
 
 std::ofstream logfile("interpolation_3/output");
 
-// Test interpolation on system of finite elements. 
+// Test interpolation on system of finite elements.
 
 template <int dim, int spacedim>
-void test(std::string filename) {
+void test(std::string filename)
+{
 
   Triangulation<dim, spacedim> triangulation;
   GridIn<dim, spacedim> gi;
@@ -63,20 +64,20 @@ void test(std::string filename) {
   DoFHandler<dim,spacedim> dof_handler (triangulation);
 
   dof_handler.distribute_dofs (fe);
-  
+
   // Now we interpolate the constant function on the mesh, and check
   // that this is consistent with what we expect.
   Vector<double> interpolated_one(dof_handler.n_dofs());
-  
+
   FunctionParser<spacedim> func(spacedim);
   std::map<std::string, double> maps;
-  if(spacedim == 2)
-      func.initialize("x,y", "x^2; y^2", maps);
+  if (spacedim == 2)
+    func.initialize("x,y", "x^2; y^2", maps);
   else
-      func.initialize("x,y,z", "x^2; y^2; z^2", maps);
-  
+    func.initialize("x,y,z", "x^2; y^2; z^2", maps);
+
   VectorTools::interpolate(dof_handler, func, interpolated_one);
-  
+
   DataOut<dim, DoFHandler<dim,spacedim> > dataout;
   dataout.attach_dof_handler(dof_handler);
   dataout.add_data_vector(interpolated_one, "test");
@@ -86,11 +87,11 @@ void test(std::string filename) {
 
 
 
-int main () 
+int main ()
 {
   deallog.attach(logfile);
   deallog.depth_console(0);
-  
+
   deallog << "Test<1,2>" << std::endl;
   test<1,2>("grids/circle_2.inp");
 
index 7caf2c96022cbe3f4436fa9cd70355528b0551aa..b6b285a43c0848b1204f2f92daec894da13cd3ee 100644 (file)
@@ -53,26 +53,26 @@ void test ()
   QGauss<dim-1> quadrature(2);
   MappingQ1<dim-1,dim> mapping;
   FE_Q<dim-1,dim> fe (1);
-  
+
   FEValues<dim-1,dim> fe_values (mapping, fe, quadrature, update_cell_normal_vectors);
-  
+
   for (typename Triangulation<dim-1,dim>::active_cell_iterator
-        cell = boundary_mesh.begin_active(); cell != boundary_mesh.end();
+       cell = boundary_mesh.begin_active(); cell != boundary_mesh.end();
        ++cell)
     {
       deallog << "Cell = " << cell
-             << ", with center at " << cell->center()
-             << std::endl;
+              << ", with center at " << cell->center()
+              << std::endl;
       fe_values.reinit (cell);
 
       for (unsigned int q=0; q<quadrature.size(); ++q)
-       deallog << "  cell_normal[" << q << "] = "
-               << fe_values.cell_normal_vector(q)
-               << std::endl;
+        deallog << "  cell_normal[" << q << "] = "
+                << fe_values.cell_normal_vector(q)
+                << std::endl;
     }
 }
 
-  
+
 
 int main ()
 {
index c54bc8727d4abf19eb36cc0a8b6bcc461003d854..134fbfd0d9cfd9ea9959a83520285c6f71be0204 100644 (file)
@@ -50,26 +50,26 @@ void test ()
   QGauss<dim-1> quadrature(dim == 2 ? 3 : 2);
   MappingQ<dim-1,dim> mapping(2);
   FE_Q<dim-1,dim> fe (1);
-  
+
   FEValues<dim-1,dim> fe_values (mapping, fe, quadrature, update_cell_normal_vectors);
-  
+
   for (typename Triangulation<dim-1,dim>::active_cell_iterator
-        cell = boundary_mesh.begin_active(); cell != boundary_mesh.end();
+       cell = boundary_mesh.begin_active(); cell != boundary_mesh.end();
        ++cell)
     {
       deallog << "Cell = " << cell
-             << ", with center at " << cell->center()
-             << std::endl;
+              << ", with center at " << cell->center()
+              << std::endl;
       fe_values.reinit (cell);
 
       for (unsigned int q=0; q<quadrature.size(); ++q)
-       deallog << "  cell_normal[" << q << "] = "
-               << fe_values.cell_normal_vector(q)
-               << std::endl;
+        deallog << "  cell_normal[" << q << "] = "
+                << fe_values.cell_normal_vector(q)
+                << std::endl;
     }
 }
 
-  
+
 
 int main ()
 {
index b730b0c8994d269ea44619d779b2dcdebd2440da..99dd87f1390dc388b922b23b40a1ecb2871706c2 100644 (file)
@@ -43,16 +43,16 @@ void test (unsigned int degree)
   MappingQ<dim-1,dim> mapping(degree);
   Point<dim> p;
 
-                                  // Try to project a point on the
-                                  // surface
-  for(unsigned int i=0; i<dim; ++i)
+  // Try to project a point on the
+  // surface
+  for (unsigned int i=0; i<dim; ++i)
     p[i] = .2;
 
   Point<dim-1> q =
     mapping.transform_real_to_unit_cell(mesh.begin_active(), p);
 
   deallog << "Mapping Q("<< degree<< "): P: " << p
-         << ", on unit: " << q << std::endl;
+          << ", on unit: " << q << std::endl;
 
 }
 
index ad819e15d317fe0c18ad052e8aa724e73b1176e8..aea9d7fc58f49a905e92fedc4d9be882ca68ea18 100644 (file)
@@ -37,7 +37,8 @@
 std::ofstream logfile("mapping_q1/output");
 
 template <int dim, int spacedim>
-void test(std::string filename) {
+void test(std::string filename)
+{
   Triangulation<dim, spacedim> tria;
   GridIn<dim, spacedim> gi;
   gi.attach_triangulation (tria);
@@ -50,37 +51,37 @@ void test(std::string filename) {
 
   QTrapez<dim> quad;
   MappingQ1<dim,spacedim> mapping;
-  typename Triangulation<dim,spacedim>::active_cell_iterator cell=tria.begin_active(), 
-    endc=tria.end() ;
+  typename Triangulation<dim,spacedim>::active_cell_iterator cell=tria.begin_active(),
+                                                             endc=tria.end() ;
   Point<spacedim> real;
   Point<dim> unit;
   double eps = 1e-10;
-  for(;cell!=endc;++cell)
+  for (; cell!=endc; ++cell)
     {
-      deallog<<cell<< std::endl;        
-      for(unsigned int q=0; q<quad.size(); ++q)
-       {
-         real = mapping.transform_unit_to_real_cell(cell, quad.point(q));
-         unit = mapping.transform_real_to_unit_cell(cell, real);
-         deallog<<quad.point(q)<< " -> " << real << std::endl;
-         if( (unit-quad.point(q)).norm()>eps)
-           deallog<< "Error: "
-                  << quad.point(q)<< " != "
-                  << unit << std::endl;
-       }
-    }     
-    
+      deallog<<cell<< std::endl;
+      for (unsigned int q=0; q<quad.size(); ++q)
+        {
+          real = mapping.transform_unit_to_real_cell(cell, quad.point(q));
+          unit = mapping.transform_real_to_unit_cell(cell, real);
+          deallog<<quad.point(q)<< " -> " << real << std::endl;
+          if ( (unit-quad.point(q)).norm()>eps)
+            deallog<< "Error: "
+                   << quad.point(q)<< " != "
+                   << unit << std::endl;
+        }
+    }
+
 }
 
-int main () 
+int main ()
 {
   deallog.attach(logfile);
   deallog.depth_console(0);
-  
+
   test<1,2>("grids/circle_1.inp");
   test<2,3>("grids/square.inp");
   test<2,3>("grids/sphere_1.inp");
 
   return 0;
 }
-                  
+
index 81c0d7428d2e51b65f49c0e36168a41e99de00b8..4885107dec51ebcccfb13d8d404da0e4c218320f 100644 (file)
 std::ofstream logfile("mapping_q1_eulerian/output");
 
 template <int dim, int spacedim>
-void test(std::string filename) {
+void test(std::string filename)
+{
   Triangulation<dim, spacedim> tria;
   FE_Q<dim, spacedim> base_fe(1);
   FESystem<dim, spacedim> fe(base_fe, spacedim);
 
   DoFHandler<dim, spacedim> shift_dh(tria);
-  
+
   GridIn<dim, spacedim> gi;
   gi.attach_triangulation (tria);
   std::ifstream in (filename.c_str());
   gi.read_ucd (in);
 
   shift_dh.distribute_dofs(fe);
-  
+
   Vector<double> shift(shift_dh.n_dofs());
 
   shift.add(+1);
@@ -64,36 +65,36 @@ void test(std::string filename) {
 
   QTrapez<dim> quad;
   MappingQ1Eulerian<dim,Vector<double>,spacedim> mapping(shift, shift_dh);
-  
-  typename Triangulation<dim,spacedim>::active_cell_iterator cell=tria.begin_active(), 
-    endc=tria.end() ;
+
+  typename Triangulation<dim,spacedim>::active_cell_iterator cell=tria.begin_active(),
+                                                             endc=tria.end() ;
   Point<spacedim> real;
   Point<dim> unit;
   double eps = 1e-10;
-  for(;cell!=endc;++cell)
+  for (; cell!=endc; ++cell)
     {
-      deallog<<cell<< std::endl;       
-      for(unsigned int q=0; q<quad.size(); ++q)
-       {
-         real = mapping.transform_unit_to_real_cell(cell, quad.point(q));
-         unit = mapping.transform_real_to_unit_cell(cell, real);
-         deallog<<quad.point(q)<< " -> " << real << std::endl;
-         if( (unit-quad.point(q)).norm()>eps)
-           deallog<<quad.point(q)<< " ->-> " << unit << std::endl;
-       }
-    }     
-    
+      deallog<<cell<< std::endl;
+      for (unsigned int q=0; q<quad.size(); ++q)
+        {
+          real = mapping.transform_unit_to_real_cell(cell, quad.point(q));
+          unit = mapping.transform_real_to_unit_cell(cell, real);
+          deallog<<quad.point(q)<< " -> " << real << std::endl;
+          if ( (unit-quad.point(q)).norm()>eps)
+            deallog<<quad.point(q)<< " ->-> " << unit << std::endl;
+        }
+    }
+
 }
 
-int main () 
+int main ()
 {
   deallog.attach(logfile);
   deallog.depth_console(0);
-  
+
   test<1,2>("grids/circle_1.inp");
   test<2,3>("grids/square.inp");
   test<2,3>("grids/sphere_1.inp");
 
   return 0;
 }
-                  
+
index 08038c2082dda7c719ac7f579b21757315623460..7ba13b321f03180bb9ea791e62e0aa440555dc95 100644 (file)
 std::ofstream logfile("mapping_q_eulerian/output");
 
 template <int dim, int spacedim>
-void test(std::string filename, unsigned int degree) {
+void test(std::string filename, unsigned int degree)
+{
   Triangulation<dim, spacedim> tria;
   FE_Q<dim, spacedim> base_fe(degree);
   FESystem<dim, spacedim> fe(base_fe, spacedim);
 
   DoFHandler<dim, spacedim> shift_dh(tria);
-  
+
   GridIn<dim, spacedim> gi;
   gi.attach_triangulation (tria);
   std::ifstream in (filename.c_str());
   gi.read_ucd (in);
 
   shift_dh.distribute_dofs(fe);
-  
+
   Vector<double> shift(shift_dh.n_dofs());
 
   shift.add(+1);
@@ -64,41 +65,41 @@ void test(std::string filename, unsigned int degree) {
 
   QTrapez<dim> quad;
   MappingQEulerian<dim,Vector<double>,spacedim> mapping(degree, shift, shift_dh);
-  
-  typename Triangulation<dim,spacedim>::active_cell_iterator cell=tria.begin_active(), 
-    endc=tria.end() ;
+
+  typename Triangulation<dim,spacedim>::active_cell_iterator cell=tria.begin_active(),
+                                                             endc=tria.end() ;
   Point<spacedim> real;
   Point<dim> unit;
   double eps = 1e-10;
-  for(;cell!=endc;++cell)
+  for (; cell!=endc; ++cell)
     {
-      deallog<<cell<< std::endl;       
-      for(unsigned int q=0; q<quad.size(); ++q)
-       {
-         real = mapping.transform_unit_to_real_cell(cell, quad.point(q));
-         unit = mapping.transform_real_to_unit_cell(cell, real);
-         deallog<<quad.point(q)<< " -> " << real << std::endl;
-         if( (unit-quad.point(q)).norm()>eps)
-           deallog<<"Error: "<< quad.point(q)
-                  << " != " << unit << std::endl;
-       }
-    }     
-    
+      deallog<<cell<< std::endl;
+      for (unsigned int q=0; q<quad.size(); ++q)
+        {
+          real = mapping.transform_unit_to_real_cell(cell, quad.point(q));
+          unit = mapping.transform_real_to_unit_cell(cell, real);
+          deallog<<quad.point(q)<< " -> " << real << std::endl;
+          if ( (unit-quad.point(q)).norm()>eps)
+            deallog<<"Error: "<< quad.point(q)
+                   << " != " << unit << std::endl;
+        }
+    }
+
 }
 
-int main () 
+int main ()
 {
   deallog.attach(logfile);
   deallog.depth_console(0);
-  
- test<1,2>("grids/circle_1.inp",1);
- test<1,2>("grids/circle_1.inp",2);
- test<2,3>("grids/square.inp",1);
- test<2,3>("grids/square.inp",2);
- test<2,3>("grids/sphere_1.inp",1);
+
 test<1,2>("grids/circle_1.inp",1);
 test<1,2>("grids/circle_1.inp",2);
 test<2,3>("grids/square.inp",1);
 test<2,3>("grids/square.inp",2);
 test<2,3>("grids/sphere_1.inp",1);
 // test<2,3>("grids/problem.inp",1);
   test<2,3>("grids/sphere_1.inp",2);
 
   return 0;
 }
-                  
+
index e364be878de7cbef2d372491d636374f97676ea0..e4e4d4fda26d622ec8cbaca88ededcea7071f829 100644 (file)
@@ -60,8 +60,8 @@ void test()
   VectorTools::interpolate(dof_handler, cosine, x);
 
   const double mean = VectorTools::compute_mean_value (dof_handler,
-                                                      QGauss<dim>(2),
-                                                      x, 0);
+                                                       QGauss<dim>(2),
+                                                       x, 0);
   // we have a symmetric domain and a symmetric function. the result
   // should be close to zero
   Assert (std::fabs(mean) < 1e-15, ExcInternalError());
@@ -70,11 +70,11 @@ void test()
 
 
 
-int main () 
+int main ()
 {
   deallog.attach(logfile);
   deallog.depth_console(0);
-  
+
   test<1,2>();
   test<2,3>();
 }
index 352706ee14c888ad30b354dc27c598efb0e1fcbf..bae554ba33875e8415f008090eb035ac580a78cb 100644 (file)
@@ -34,7 +34,7 @@
 #include <grid/tria_boundary_lib.h>
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("mesh_bug/output");
 
@@ -46,14 +46,14 @@ int main ()
 
   const std::vector<Point<3> > &vertices = tria.get_vertices();
 
-  for(unsigned int i=0; i<vertices.size(); ++i)
-    if(vertices[i](2)>1e-7)
+  for (unsigned int i=0; i<vertices.size(); ++i)
+    if (vertices[i](2)>1e-7)
       std::cout << "Error!" << std::endl;
-  
-  
+
+
   GridOut go;
   go.write_ucd(tria, logfile);
 
   return 0;
 }
-                  
+
index d9c7c41a8a0b586cad47e82122fee0eca0ea1b28..84c825f7081266ee716e942fff7bdeb1fd31e361 100644 (file)
@@ -39,36 +39,36 @@ void test ()
 {
   Triangulation<dim,dim> volume_mesh;
   GridGenerator::hyper_cube(volume_mesh);
-  
+
   Triangulation<dim-1,dim> tria;
   GridTools::extract_boundary_mesh (volume_mesh, tria);
-  
+
   FE_Q<dim-1,dim> fe (1);
   DoFHandler<dim-1,dim> dh(tria);
   MappingQ<dim-1,dim> mapping(1,true);
-  
+
   dh.distribute_dofs (fe);
-  
+
   FEFaceValues<dim-1,dim> fe_face_values (mapping, fe, QTrapez<dim-2>(),
-                                         update_normal_vectors);
+                                          update_normal_vectors);
 
   for (typename DoFHandler<dim-1,dim>::active_cell_iterator
-        cell = dh.begin_active();
+       cell = dh.begin_active();
        cell != dh.end(); ++cell)
     {
       deallog << "Face centered at " << cell->center()
-             << std::endl;
+              << std::endl;
 
       for (unsigned int f=0; f<GeometryInfo<dim-1>::faces_per_cell; ++f)
-       {
-         deallog << "  Edge centered at " << cell->face(f)->center()
-                 << std::endl;
-      
-         fe_face_values.reinit (cell,f);
-         for (unsigned int q=0; q<fe_face_values.n_quadrature_points; ++q)
-           deallog << "    normal_vector=" << fe_face_values.normal_vector(q)
-                   << std::endl;
-       }
+        {
+          deallog << "  Edge centered at " << cell->face(f)->center()
+                  << std::endl;
+
+          fe_face_values.reinit (cell,f);
+          for (unsigned int q=0; q<fe_face_values.n_quadrature_points; ++q)
+            deallog << "    normal_vector=" << fe_face_values.normal_vector(q)
+                    << std::endl;
+        }
     }
 }
 
@@ -82,6 +82,6 @@ int main ()
 
 //  test<2> ();
   test<3> ();
-  
+
   return 0;
 }
index 64907709f9b9c812748e6a500454a5523c3574a2..55809696ac6d041db463a98d4f2b87a6388d70f4 100644 (file)
@@ -50,7 +50,8 @@ std::ofstream logfile("projection/output");
 
 
 template <int dim, int spacedim>
-void test(std::string filename, unsigned int n) {
+void test(std::string filename, unsigned int n)
+{
 
   Triangulation<dim, spacedim> triangulation;
   GridIn<dim, spacedim> gi;
@@ -63,7 +64,7 @@ void test(std::string filename, unsigned int n) {
   DoFHandler<dim,spacedim> dof_handler (triangulation);
 
   dof_handler.distribute_dofs (fe);
-  
+
   // Now we project the constant function on the mesh, and check
   // that this is consistent with what we expect.
   Vector<double> projected_one(dof_handler.n_dofs());
@@ -74,7 +75,7 @@ void test(std::string filename, unsigned int n) {
   ConstraintMatrix constraints;
   constraints.close();
   VectorTools::project(dof_handler, constraints, quad, cosine, projected_one);
+
   DataOut<dim, DoFHandler<dim,spacedim> > dataout;
   dataout.attach_dof_handler(dof_handler);
   dataout.add_data_vector(projected_one, "projection");
@@ -84,16 +85,16 @@ void test(std::string filename, unsigned int n) {
 
 
 
-int main () 
+int main ()
 {
   deallog.attach(logfile);
   deallog.depth_console(0);
-  
+
   for (unsigned int n=1; n<5; n++)
     {
       deallog << "Test<1,2>, continous finite element q_" << n << std::endl;
       test<1,2>("grids/circle_2.inp",n);
-      
+
       deallog << "Test<2,3>, continous finite element q_" << n << std::endl;
       test<2,3>("grids/sphere_2.inp",n);
     }
index 73ff9760f4c90e600bed29459314b0ab8ceeaccf..1335827792f70fed653eeb6a3074d07c36fdf676 100644 (file)
@@ -51,7 +51,8 @@ std::ofstream logfile("projection_dgp/output");
 
 
 template <int dim, int spacedim>
-void test(std::string filename, unsigned int n) {
+void test(std::string filename, unsigned int n)
+{
 
   Triangulation<dim, spacedim> triangulation;
   GridIn<dim, spacedim> gi;
@@ -64,7 +65,7 @@ void test(std::string filename, unsigned int n) {
   DoFHandler<dim,spacedim> dof_handler (triangulation);
 
   dof_handler.distribute_dofs (fe);
-  
+
   // Now we interpolate the constant function on the mesh, and check
   // that this is consistent with what we expect.
   Vector<double> interpolated_one(dof_handler.n_dofs());
@@ -75,7 +76,7 @@ void test(std::string filename, unsigned int n) {
   ConstraintMatrix constraints;
   constraints.close();
   VectorTools::project(dof_handler, constraints, quad, cosine, interpolated_one);
+
   DataOut<dim, DoFHandler<dim,spacedim> > dataout;
   dataout.attach_dof_handler(dof_handler);
   dataout.add_data_vector(interpolated_one, "numbering");
@@ -85,18 +86,18 @@ void test(std::string filename, unsigned int n) {
 
 
 
-int main () 
+int main ()
 {
   deallog.attach(logfile);
   deallog.depth_console(0);
-  
+
   for (unsigned int n=1; n<5; n++)
     {
       deallog << "Test<1,2>, continous finite element q_" << n << std::endl;
       test<1,2>("grids/circle_2.inp",n);
-      
-     deallog << "Test<2,3>, continous finite element q_" << n << std::endl;
-     test<2,3>("grids/sphere_2.inp",n);
+
+      deallog << "Test<2,3>, continous finite element q_" << n << std::endl;
+      test<2,3>("grids/sphere_2.inp",n);
     }
   return 0;
 }
index d3a001c09584411b1227d5cec3d4b30109d4b450..33fd91d69f454fdc619b752219bdbea476d88f92 100644 (file)
@@ -53,14 +53,14 @@ void test(std::string filename)
   DoFRenumbering::component_wise (dof_handler);
 
   for (typename DoFHandler<dim,spacedim>::active_cell_iterator
-        cell = dof_handler.begin_active(); cell!=dof_handler.end(); ++cell)
+       cell = dof_handler.begin_active(); cell!=dof_handler.end(); ++cell)
     {
       std::vector<types::global_dof_index> x (cell->get_fe().dofs_per_cell);
       cell->get_dof_indices (x);
 
       deallog << cell << std::endl;
       for (unsigned int i=0; i<x.size(); ++i)
-       deallog << "  " << x[i] << std::endl;
+        deallog << "  " << x[i] << std::endl;
     }
 }
 
index 1e4db54a3041bf4b168c92f40596205d082c1b1a..8d22812b9b462d95449e5df766b93771bc5422ea 100644 (file)
@@ -60,11 +60,11 @@ int main ()
 
   Triangulation<dim,spacedim> boundary_mesh;
 
-                                  // create a line in 2d
+  // create a line in 2d
   GridGenerator::hyper_cube (boundary_mesh);
 
-                                  // attach a piecewise constant
-                                  // element to this one cell
+  // attach a piecewise constant
+  // element to this one cell
   FE_DGQ<dim,spacedim> fe(0);
   DoFHandler<dim,spacedim>  dh (boundary_mesh);
   dh.distribute_dofs(fe);
@@ -77,11 +77,11 @@ int main ()
     deallog << solution(i) << std::endl;
 
 
-                                  // Do some refinement
+  // Do some refinement
   boundary_mesh.begin_active()->set_refine_flag ();
 
   SolutionTransfer<dim, Vector<double>, DoFHandler<dim,spacedim> >
-    soltrans(dh);
+  soltrans(dh);
 
   boundary_mesh.prepare_coarsening_and_refinement();
 
@@ -90,8 +90,8 @@ int main ()
 
   dh.distribute_dofs(fe);
 
-                                  // get the interpolated solution
-                                  // back
+  // get the interpolated solution
+  // back
   Vector<double> tmp(dh.n_dofs());
   tmp = 2;
   soltrans.interpolate(solution, tmp);
index 0650351b942433a93c57a290770adb02a7f77d8d..4e9cf1937b75907bdece92a81d6abb3dc9386ef1 100644 (file)
@@ -44,76 +44,77 @@ std::ofstream logfile("surface/output");
 // which are more and more refined, and prints the error on the
 // output.
 template <int dim, int spacedim>
-void test(std::string filename) {
+void test(std::string filename)
+{
+
+  Triangulation<dim, spacedim> triangulation;
+  GridIn<dim, spacedim> gi;
 
-    Triangulation<dim, spacedim> triangulation;
-    GridIn<dim, spacedim> gi;
+  gi.attach_triangulation (triangulation);
+  std::ifstream in (filename.c_str());
+  gi.read_ucd (in);
 
-    gi.attach_triangulation (triangulation);
-    std::ifstream in (filename.c_str());
-    gi.read_ucd (in);
+  const QGauss<dim> quadrature(2);
+  const FE_Q<dim,spacedim> dummy_fe (1);
+  DoFHandler<dim,spacedim> dof_handler (triangulation);
 
-    const QGauss<dim> quadrature(2);
-    const FE_Q<dim,spacedim> dummy_fe (1);
-    DoFHandler<dim,spacedim> dof_handler (triangulation);
+  FEValues<dim,spacedim> fe_values (dummy_fe, quadrature,
+                                    update_JxW_values |
+                                    update_cell_normal_vectors |
+                                    update_quadrature_points);
 
-    FEValues<dim,spacedim> fe_values (dummy_fe, quadrature,
-                                     update_JxW_values | 
-                                     update_cell_normal_vectors | 
-                                     update_quadrature_points);
-  
-    dof_handler.distribute_dofs (dummy_fe);
+  dof_handler.distribute_dofs (dummy_fe);
 
-    double area = 0;
-    double normals = 0;
+  double area = 0;
+  double normals = 0;
 
-    typename DoFHandler<dim,spacedim>::active_cell_iterator
-       cell = dof_handler.begin_active(),
-       endc = dof_handler.end();
+  typename DoFHandler<dim,spacedim>::active_cell_iterator
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
 
-    std::vector<Point<spacedim> > expectedcellnormals(fe_values.n_quadrature_points);
+  std::vector<Point<spacedim> > expectedcellnormals(fe_values.n_quadrature_points);
 
-    for (; cell!=endc; ++cell)
+  for (; cell!=endc; ++cell)
     {
-       fe_values.reinit (cell);    
-       const std::vector<Point<spacedim> > & cellnormals = fe_values.get_cell_normal_vectors();
-       const std::vector<Point<spacedim> > & quad_points = fe_values.get_quadrature_points();
-      
-       for (unsigned int i=0; i<fe_values.n_quadrature_points; ++i)
-       {
-           expectedcellnormals[i] = quad_points[i]/quad_points[i].norm();
-           area += fe_values.JxW (i);
-           normals += (expectedcellnormals[i]-cellnormals[i]).norm();
-       }
+      fe_values.reinit (cell);
+      const std::vector<Point<spacedim> > &cellnormals = fe_values.get_cell_normal_vectors();
+      const std::vector<Point<spacedim> > &quad_points = fe_values.get_quadrature_points();
+
+      for (unsigned int i=0; i<fe_values.n_quadrature_points; ++i)
+        {
+          expectedcellnormals[i] = quad_points[i]/quad_points[i].norm();
+          area += fe_values.JxW (i);
+          normals += (expectedcellnormals[i]-cellnormals[i]).norm();
+        }
     };
 
-    deallog<<"Approximate measure of hyper sphere = "<<area<<std::endl;
-    deallog<<"Error = "<<std::fabs(dim*2*numbers::PI-area)<<std::endl;
-    deallog << "Average error in norms: " 
-           << ( normals/dof_handler.get_tria().n_active_cells()
-                /fe_values.n_quadrature_points) 
-           << std::endl;
+  deallog<<"Approximate measure of hyper sphere = "<<area<<std::endl;
+  deallog<<"Error = "<<std::fabs(dim*2*numbers::PI-area)<<std::endl;
+  deallog << "Average error in norms: "
+          << ( normals/dof_handler.get_tria().n_active_cells()
+               /fe_values.n_quadrature_points)
+          << std::endl;
 
 }
 
 
 
-int main () 
+int main ()
 {
-    deallog.attach(logfile);
-    deallog.depth_console(0);
-  
-    deallog<<"Test <1,2>"<<std::endl;
-    test<1,2>("grids/circle_1.inp");
-    test<1,2>("grids/circle_2.inp");
-    test<1,2>("grids/circle_3.inp");
-    test<1,2>("grids/circle_4.inp");
-
-    deallog<<"Test <2,3>"<<std::endl;
-    test<2,3>("grids/sphere_1.inp"); 
-    test<2,3>("grids/sphere_2.inp");
-    test<2,3>("grids/sphere_3.inp");
-    test<2,3>("grids/sphere_4.inp");
-  
-    return 0;
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+
+  deallog<<"Test <1,2>"<<std::endl;
+  test<1,2>("grids/circle_1.inp");
+  test<1,2>("grids/circle_2.inp");
+  test<1,2>("grids/circle_3.inp");
+  test<1,2>("grids/circle_4.inp");
+
+  deallog<<"Test <2,3>"<<std::endl;
+  test<2,3>("grids/sphere_1.inp");
+  test<2,3>("grids/sphere_2.inp");
+  test<2,3>("grids/sphere_3.inp");
+  test<2,3>("grids/sphere_4.inp");
+
+  return 0;
 }
index 06a4c76fc300950df5f589654e8de542257bdfb4..ab0139188c4a8bbc12fb9b1e107f6244f82e29ac 100644 (file)
@@ -31,52 +31,52 @@ std::ofstream logfile("tensor_matrix_conversion/output");
 
 
 template <typename number>
-void 
+void
 fill_matrix(FullMatrix<number> &A)
 {
-  for (unsigned int i=0; i<A.m();i++)
-    for (unsigned int j=0; j<A.n();j++)
+  for (unsigned int i=0; i<A.m(); i++)
+    for (unsigned int j=0; j<A.n(); j++)
       A(i,j)=number(i*A.n() + j+1);
 }
 
 template <typename number>
-void 
+void
 display_matrix(FullMatrix<number> M)
 {
   deallog<<M.m()<<"x"<<M.n()<<" matrix"<<std::endl;
-  for (unsigned int i=0;i<M.m();i++)
+  for (unsigned int i=0; i<M.m(); i++)
     {
-      for (unsigned int j=0;j<M.n();j++)
-       deallog<<M(i,j)<<" ";
+      for (unsigned int j=0; j<M.n(); j++)
+        deallog<<M(i,j)<<" ";
       deallog<<std::endl;
     }
 }
 
 template <int b>
-void 
+void
 fill_tensor_2(Tensor<2,b> &T)
 {
-  for (unsigned int i=0; i<b;i++)
-    for (unsigned int j=0; j<b;j++)
+  for (unsigned int i=0; i<b; i++)
+    for (unsigned int j=0; j<b; j++)
       T[i][j]=i*b + j+1;
 }
 
 
 template <int b>
-void 
+void
 display_tensor_2(Tensor<2,b> &T)
 {
   deallog<<b<<"x"<<b<<" tensor"<<std::endl;
-  for (unsigned int i=0; i<b;i++)
+  for (unsigned int i=0; i<b; i++)
     {
-      for (unsigned int j=0; j<b;j++)    
-       deallog<<T[i][j]<<" ";
+      for (unsigned int j=0; j<b; j++)
+        deallog<<T[i][j]<<" ";
       deallog<<std::endl;
     }
-       
+
 }
 
-int main () 
+int main ()
 {
 
   deallog.attach(logfile);
@@ -89,11 +89,11 @@ int main ()
   for (unsigned int n=0; n<3; n++)
     for (unsigned int i=0; i<10-n; i++)
       for (unsigned int j=0; j<10-n; j++)
-      {
-       A1.copy_from(T1,0,n,0,n,i,j);
-       display_matrix(A1);
-       A1 = 0;
-      }
+        {
+          A1.copy_from(T1,0,n,0,n,i,j);
+          display_matrix(A1);
+          A1 = 0;
+        }
 
   FullMatrix<double> A2(3,3);
   fill_matrix(A2);
@@ -101,14 +101,14 @@ int main ()
   for (unsigned int n=0; n<3; n++)
     for (unsigned int i=0; i<3-n; i++)
       for (unsigned int j=0; j<3-n; j++)
-      {
-       A2.copy_to(T2,0,n,0,n,i,j);
-       display_tensor_2(T2);
-       T2 = 0;
-      }
+        {
+          A2.copy_to(T2,0,n,0,n,i,j);
+          display_tensor_2(T2);
+          T2 = 0;
+        }
 
 
 
   return 0;
 }
-                  
+
index 4f679a9aa11a52c4d551e13a366944a7c2884f23..8e35edfed56eb5e5e892599ff72394a173d2911c 100644 (file)
@@ -45,7 +45,7 @@ Point<dim> warp (const Point<dim> &p)
 
 
 template <int dim, int spacedim>
-void save_mesh(const Triangulation<dim,spacedim>tria)
+void save_mesh(const Triangulation<dim,spacedim> &tria)
 {
   GridOut grid_out;
   grid_out.write_gnuplot (tria, deallog.get_file_stream());
@@ -59,32 +59,32 @@ int main ()
   deallog.depth_console(0);
 
   Triangulation<2,3> triangulation;
-  
+
   HyperBallBoundary<3> boundary_description;
   Triangulation<3> volume_mesh;
   GridGenerator::half_hyper_ball(volume_mesh);
-  
+
   volume_mesh.set_boundary (1, boundary_description);
   volume_mesh.set_boundary (0, boundary_description);
   volume_mesh.refine_global (3);
-  
+
   static HyperBallBoundary<3-1,3> surface_description;
   triangulation.set_boundary (1, surface_description);
   triangulation.set_boundary (0, surface_description);
-  
+
   std::set<types::boundary_id> boundary_ids;
   boundary_ids.insert(0);
-  
+
   GridTools::extract_boundary_mesh (volume_mesh, triangulation,
-                                   boundary_ids);
+                                    boundary_ids);
   triangulation.set_boundary (1);
   triangulation.set_boundary (0);
   GridTools::transform (&warp<3>, triangulation);
 
   deallog << "Surface mesh has " << triangulation.n_active_cells()
-         << " cells."
-         << std::endl;
+          << " cells."
+          << std::endl;
   save_mesh (triangulation);
-  
+
   return 0;
 }
index c58c8d62d14d1c0d10bc9a0a2bd26fcada213ae7..fe4fa138caa2510b8914c0c2639ca477ff04240c 100644 (file)
@@ -30,8 +30,8 @@
 
 
 template <class ACCESSOR>
-LogStream&
-operator << (LogStream& log, const TriaIterator<ACCESSOR>& i)
+LogStream &
+operator << (LogStream &log, const TriaIterator<ACCESSOR> &i)
 {
   log << ACCESSOR::dimension << ' '
       << ACCESSOR::structure_dimension << ' '
@@ -42,18 +42,18 @@ operator << (LogStream& log, const TriaIterator<ACCESSOR>& i)
 
 
 template <class DH>
-void test_in_dim(const DH& d1, const DH& d2)
+void test_in_dim(const DH &d1, const DH &d2)
 {
   typename DH::active_cell_iterator a = d1.begin_active();
   typename DH::cell_iterator l = d1.begin(d1.get_tria().n_levels()-1);
 
   deallog << "a " << a << std::endl
-         << "l " << l << std::endl;
+          << "l " << l << std::endl;
 }
 
 
 template<int dim>
-void init_tria (Triangulation<dim>tr)
+void init_tria (Triangulation<dim> &tr)
 {
   GridGenerator::hyper_cube(tr);
   tr.refine_global(4-dim);
@@ -61,9 +61,9 @@ void init_tria (Triangulation<dim>& tr)
 
 
 template<int dim>
-void init_dofs (DoFHandler<dim>dof,
-               const Triangulation<dim>& tr,
-               const FiniteElement<dim>& fe)
+void init_dofs (DoFHandler<dim> &dof,
+                const Triangulation<dim> &tr,
+                const FiniteElement<dim> &fe)
 {
   dof.initialize(tr, fe);
 }
index c58c8d62d14d1c0d10bc9a0a2bd26fcada213ae7..fe4fa138caa2510b8914c0c2639ca477ff04240c 100644 (file)
@@ -30,8 +30,8 @@
 
 
 template <class ACCESSOR>
-LogStream&
-operator << (LogStream& log, const TriaIterator<ACCESSOR>& i)
+LogStream &
+operator << (LogStream &log, const TriaIterator<ACCESSOR> &i)
 {
   log << ACCESSOR::dimension << ' '
       << ACCESSOR::structure_dimension << ' '
@@ -42,18 +42,18 @@ operator << (LogStream& log, const TriaIterator<ACCESSOR>& i)
 
 
 template <class DH>
-void test_in_dim(const DH& d1, const DH& d2)
+void test_in_dim(const DH &d1, const DH &d2)
 {
   typename DH::active_cell_iterator a = d1.begin_active();
   typename DH::cell_iterator l = d1.begin(d1.get_tria().n_levels()-1);
 
   deallog << "a " << a << std::endl
-         << "l " << l << std::endl;
+          << "l " << l << std::endl;
 }
 
 
 template<int dim>
-void init_tria (Triangulation<dim>tr)
+void init_tria (Triangulation<dim> &tr)
 {
   GridGenerator::hyper_cube(tr);
   tr.refine_global(4-dim);
@@ -61,9 +61,9 @@ void init_tria (Triangulation<dim>& tr)
 
 
 template<int dim>
-void init_dofs (DoFHandler<dim>dof,
-               const Triangulation<dim>& tr,
-               const FiniteElement<dim>& fe)
+void init_dofs (DoFHandler<dim> &dof,
+                const Triangulation<dim> &tr,
+                const FiniteElement<dim> &fe)
 {
   dof.initialize(tr, fe);
 }
index badc4867fcaaa594bfe422b16b944d9df42d02bc..1fbc6b3214c82d62ef9f8209bddc27ac6cd4cb92 100644 (file)
@@ -26,8 +26,8 @@
 
 
 template <int dim>
-void test_grid(const Triangulation<dim>tr,
-              const FiniteElement<dim>& fe)
+void test_grid(const Triangulation<dim> &tr,
+               const FiniteElement<dim> &fe)
 {
   MGDoFHandler<dim> mgdof(tr);
   mgdof.distribute_dofs(fe);
@@ -37,43 +37,43 @@ void test_grid(const Triangulation<dim>& tr,
 
   deallog << "Global dofs    " << mgdof.n_dofs() << std::endl;
   deallog << "Global blocks ";
-  for (unsigned int i=0;i<bi.global().size();++i)
-      deallog << ' ' << bi.global().block_size(i);
+  for (unsigned int i=0; i<bi.global().size(); ++i)
+    deallog << ' ' << bi.global().block_size(i);
   deallog << std::endl;
 
-  for (unsigned int l=0;l<tr.n_levels();++l)
+  for (unsigned int l=0; l<tr.n_levels(); ++l)
     {
       deallog << "Level dofs     " << mgdof.n_dofs(l) << std::endl;
       deallog << "Level block[" << l << ']';
-      for (unsigned int i=0;i<bi.level(l).size();++i)
-       deallog << ' ' << bi.level(l).block_size(i);
+      for (unsigned int i=0; i<bi.level(l).size(); ++i)
+        deallog << ' ' << bi.level(l).block_size(i);
       deallog << std::endl;
     }
-  
+
   deallog << "Local blocks  ";
-  for (unsigned int i=0;i<bi.local().size();++i)
-      deallog << ' ' << bi.local().block_size(i);
+  for (unsigned int i=0; i<bi.local().size(); ++i)
+    deallog << ' ' << bi.local().block_size(i);
   deallog << std::endl;
 
   std::vector<unsigned int> renumbered(fe.dofs_per_cell);
-  
+
   deallog << "Renumbering   ";
-  for (unsigned int i=0;i<fe.dofs_per_cell;++i)
+  for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
     {
       deallog << ' ' << bi.renumber(i);
       renumbered[bi.renumber(i)] = i;
     }
   deallog << std::endl;
-  
+
   deallog << "Inverse       ";
-  for (unsigned int i=0;i<fe.dofs_per_cell;++i)
+  for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
     deallog << ' ' << renumbered[i];
   deallog << std::endl;
 }
 
 
 template<int dim>
-void test_fe (const FiniteElement<dim>fe)
+void test_fe (const FiniteElement<dim> &fe)
 {
   Triangulation<dim> tr;
   GridGenerator::hyper_cube(tr);
@@ -82,22 +82,22 @@ void test_fe (const FiniteElement<dim>& fe)
 }
 
 
-int main () 
+int main ()
 {
   initlog(__FILE__);
-  
+
   FE_Q<2> q21(1);
   FE_Q<2> q22(2);
   FESystem<2> s2(q21, 3, q22, 2);
-  
+
   test_fe(q21);
   test_fe(q22);
   test_fe(s2);
-  
+
   FE_Q<3> q31(1);
   FE_Q<3> q32(2);
   FESystem<3> s3(q31, 3, q32, 2);
-  
+
   test_fe(q31);
   test_fe(q32);
   test_fe(s3);
index aa86dc4be0ed43a5ecfb054ca654667c4f4da1fa..a166d4e277c8f639957da28c983d46b82c15ec4c 100644 (file)
@@ -30,8 +30,8 @@
 
 
 template <int dim>
-void test_grid(const Triangulation<dim>tr,
-              const FiniteElement<dim>& fe)
+void test_grid(const Triangulation<dim> &tr,
+               const FiniteElement<dim> &fe)
 {
   DoFHandler<dim> mgdof(tr);
   mgdof.distribute_dofs(fe);
@@ -39,46 +39,46 @@ void test_grid(const Triangulation<dim>& tr,
   BlockInfo bi;
   bi.initialize(mgdof, false, false);
   bi.initialize_local(mgdof);
-  
+
   deallog << "Global dofs    " << mgdof.n_dofs() << std::endl;
   deallog << "Global blocks ";
-  for (unsigned int i=0;i<bi.global().size();++i)
-      deallog << ' ' << bi.global().block_size(i);
+  for (unsigned int i=0; i<bi.global().size(); ++i)
+    deallog << ' ' << bi.global().block_size(i);
   deallog << std::endl;
 
-  for (unsigned int l=0;l<tr.n_levels();++l)
+  for (unsigned int l=0; l<tr.n_levels(); ++l)
     {
       deallog << "Level dofs     " << mgdof.n_dofs(l) << std::endl;
       deallog << "Level block[" << l << ']';
-      for (unsigned int i=0;i<bi.level(l).size();++i)
-       deallog << ' ' << bi.level(l).block_size(i);
+      for (unsigned int i=0; i<bi.level(l).size(); ++i)
+        deallog << ' ' << bi.level(l).block_size(i);
       deallog << std::endl;
     }
-  
+
   deallog << "Local blocks  ";
-  for (unsigned int i=0;i<bi.local().size();++i)
-      deallog << ' ' << bi.local().block_size(i);
+  for (unsigned int i=0; i<bi.local().size(); ++i)
+    deallog << ' ' << bi.local().block_size(i);
   deallog << std::endl;
 
   std::vector<unsigned int> renumbered(fe.dofs_per_cell);
-  
+
   deallog << "Renumbering   ";
-  for (unsigned int i=0;i<fe.dofs_per_cell;++i)
+  for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
     {
       deallog << ' ' << bi.renumber(i);
       renumbered[bi.renumber(i)] = i;
     }
   deallog << std::endl;
-  
+
   deallog << "Inverse       ";
-  for (unsigned int i=0;i<fe.dofs_per_cell;++i)
+  for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
     deallog << ' ' << renumbered[i];
   deallog << std::endl;
 }
 
 
 template<int dim>
-void test_fe (const FiniteElement<dim>fe)
+void test_fe (const FiniteElement<dim> &fe)
 {
   Triangulation<dim> tr;
   GridGenerator::hyper_cube(tr);
@@ -87,22 +87,22 @@ void test_fe (const FiniteElement<dim>& fe)
 }
 
 
-int main () 
+int main ()
 {
   initlog(__FILE__);
-  
+
   FE_Q<2> q21(1);
   FE_Q<2> q22(2);
   FESystem<2> s2(q21, 3, q22, 2);
-  
+
   test_fe(q21);
   test_fe(q22);
   test_fe(s2);
-  
+
   FE_Q<3> q31(1);
   FE_Q<3> q32(2);
   FESystem<3> s3(q31, 3, q32, 2);
-  
+
   test_fe(q31);
   test_fe(q32);
   test_fe(s3);
index 5e6446222ecb1f3c9fedac7af5888be69f20101a..29663aaee744f8cff0d4a4f7a16cd8e86361d483 100644 (file)
@@ -1,6 +1,6 @@
 //----------------------------------------------------------------------
 //    $Id$
-//    Version: $Name$ 
+//    Version: $Name$
 //
 //    Copyright (C) 2011 by the deal.II authors
 //
@@ -29,19 +29,19 @@ using namespace dealii;
 
 
 void
-print_patches (const SparsityPatternbl)
+print_patches (const SparsityPattern &bl)
 {
-  for (unsigned int i=0;i<bl.n_rows();++i)
+  for (unsigned int i=0; i<bl.n_rows(); ++i)
     {
       deallog << "Block " << std::setw(3) << i;
       std::vector<unsigned int> entries;
-      for (SparsityPattern::row_iterator b = bl.row_begin(i);b != bl.row_end(i);++b)
-       entries.push_back(*b);
-      
+      for (SparsityPattern::row_iterator b = bl.row_begin(i); b != bl.row_end(i); ++b)
+        entries.push_back(*b);
+
       std::sort(entries.begin(), entries.end());
-      
-      for (unsigned int i=0;i<entries.size();++i)
-       deallog << ' ' << std::setw(4) << entries[i];
+
+      for (unsigned int i=0; i<entries.size(); ++i)
+        deallog << ' ' << std::setw(4) << entries[i];
       deallog << std::endl;
     }
 }
@@ -49,14 +49,14 @@ print_patches (const SparsityPattern& bl)
 
 template <int dim>
 void test_global_refinement(
-  void (*test_block_list)(const Triangulation<dim>& tr, const FiniteElement<dim>& fe))
+  void (*test_block_list)(const Triangulation<dim> &tr, const FiniteElement<dim> &fe))
 {
   Triangulation<dim> trc, trl;
   GridGenerator::hyper_cube(trc);
   trc.refine_global(2);
   GridGenerator::hyper_L(trl);
   trl.refine_global(1);
-  
+
   FE_DGQ<dim> fe1(0);
   FE_DGQ<dim> fe2(1);
 //  FE_Q<dim> fe3(1);
@@ -64,7 +64,7 @@ void test_global_refinement(
   FE_RaviartThomas<dim> fe5(1);
   FE_Nedelec<dim> fe6(0);
   FE_Nedelec<dim> fe7(1);
-  
+
   deallog.push("Square");
   test_block_list(trc, fe1);
   test_block_list(trc, fe2);
index c786b44ad3d464e599f06507c10903e7b40950b9..3011295ad2b56e9ee9ba9db8fa01d354317cfcc8 100644 (file)
 
 template <int dim>
 void
-test_block_list(const Triangulation<dim>& tr, const FiniteElement<dim>& fe)
+test_block_list(const Triangulation<dim> &tr, const FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
-  
+
   MGDoFHandler<dim> dof;
   dof.initialize(tr, fe);
-  
-  
+
+
   const unsigned int level = tr.n_levels()-1;
-  
+
   SparsityPattern bl(tr.n_cells(level), dof.n_dofs(level), fe.dofs_per_cell);
   DoFTools::make_cell_patches(bl, dof, level);
   bl.compress();
-  
-  for (unsigned int i=0;i<bl.n_rows();++i)
+
+  for (unsigned int i=0; i<bl.n_rows(); ++i)
     {
       deallog << "Block " << std::setw(3) << i;
       std::vector<unsigned int> entries;
-      for (SparsityPattern::row_iterator b = bl.row_begin(i);b != bl.row_end(i);++b)
-       entries.push_back(*b);
+      for (SparsityPattern::row_iterator b = bl.row_begin(i); b != bl.row_end(i); ++b)
+        entries.push_back(*b);
 
       std::sort(entries.begin(), entries.end());
 
-      for (unsigned int i=0;i<entries.size();++i)
-       deallog << ' ' << std::setw(4) << entries[i];
+      for (unsigned int i=0; i<entries.size(); ++i)
+        deallog << ' ' << std::setw(4) << entries[i];
       deallog << std::endl;
     }
 }
index d9ce6ddd837c0b63aceafb63a0596ca7f590ed1d..1b70769e5c35560322a857ebd6be080dd177da3b 100644 (file)
@@ -19,7 +19,7 @@
 
 template <int dim>
 void
-test_block_list(const Triangulation<dim>& tr, const FiniteElement<dim>& fe)
+test_block_list(const Triangulation<dim> &tr, const FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
 
index f79b577dd438f58a499ab9f590fc1c01067b3451..8742c3feb44eacd35c2e46486a4d4ef0b40668a8 100644 (file)
 
 template <int dim>
 void
-test_block_list(const Triangulation<dim>& tr, const FiniteElement<dim>& fe)
+test_block_list(const Triangulation<dim> &tr, const FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
-  
+
   MGDoFHandler<dim> dof;
-  dof.initialize(tr, fe); 
-  
+  dof.initialize(tr, fe);
+
   const unsigned int level = tr.n_levels()-1;
 
   {
index 498ee4806789141e7cb0d3b1d07462299ea026b1..f9ce442f6e9be684d4ed480195afab4b21a18a1e 100644 (file)
 
 template <int dim>
 void
-test_block_list(const Triangulation<dim>& tr, const FiniteElement<dim>& fe)
+test_block_list(const Triangulation<dim> &tr, const FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
-  
+
   MGDoFHandler<dim> dof;
-  dof.initialize(tr, fe); 
-  
+  dof.initialize(tr, fe);
+
   const unsigned int level = tr.n_levels()-1;
 
   {
index 6b7d4dc546a1b23e07a923a66d3ca3b2e68a73fa..c4120c02d46e72eb5bc0c694c47f8cea7150f751 100644 (file)
@@ -15,7 +15,7 @@
 // ---------------------------------------------------------------------
 
 /* Author: Wolfgang Bangerth, University of Heidelberg, 2000 */
-/* Program is based on /examples/step-3 
+/* Program is based on /examples/step-3
    Purpose: compare the results when using a normal matrix and
    a block matrix
 */
 
 
 template <class Vector, class Matrix, class Sparsity>
-class LaplaceProblem 
+class LaplaceProblem
 {
-  public:
-    LaplaceProblem (const unsigned int n_blocks);
+public:
+  LaplaceProblem (const unsigned int n_blocks);
 
-    void run ();
-    void reinit_sparsity ();
-    void reinit_vectors ();
-    
-    Vector       solution;
+  void run ();
+  void reinit_sparsity ();
+  void reinit_vectors ();
 
-  private:
-    void make_grid_and_dofs ();
-    void assemble_system ();
-    void solve ();
+  Vector       solution;
 
-    const unsigned int n_blocks;
+private:
+  void make_grid_and_dofs ();
+  void assemble_system ();
+  void solve ();
 
-    Triangulation<2>     triangulation;
-    FE_Q<2>              fe;
-    DoFHandler<2>        dof_handler;
+  const unsigned int n_blocks;
 
-    Sparsity      sparsity_pattern;
-    Matrix        system_matrix;
+  Triangulation<2>     triangulation;
+  FE_Q<2>              fe;
+  DoFHandler<2>        dof_handler;
 
-    Vector       system_rhs;
+  Sparsity      sparsity_pattern;
+  Matrix        system_matrix;
+
+  Vector       system_rhs;
 };
 
 
 template <class Vector, class Matrix, class Sparsity>
 LaplaceProblem<Vector,Matrix,Sparsity>::LaplaceProblem (const unsigned int n_blocks) :
-               n_blocks (n_blocks),
-               fe(1),
-               dof_handler (triangulation)
+  n_blocks (n_blocks),
+  fe(1),
+  dof_handler (triangulation)
 {
   sparsity_pattern.reinit (n_blocks, n_blocks);
 }
@@ -98,18 +98,18 @@ LaplaceProblem<Vector,Matrix,Sparsity>::LaplaceProblem (const unsigned int n_blo
 
 template <>
 LaplaceProblem<Vector<double>,SparseMatrix<double>,SparsityPattern>::LaplaceProblem (const unsigned int n_blocks) :
-               n_blocks (n_blocks),
-               fe(1),
-               dof_handler (triangulation)
+  n_blocks (n_blocks),
+  fe(1),
+  dof_handler (triangulation)
 {}
 
 
 
 template <>
 LaplaceProblem<Vector<float>,SparseMatrix<float>,SparsityPattern>::LaplaceProblem (const unsigned int n_blocks) :
-               n_blocks (n_blocks),
-               fe(1),
-               dof_handler (triangulation)
+  n_blocks (n_blocks),
+  fe(1),
+  dof_handler (triangulation)
 {}
 
 
@@ -120,17 +120,17 @@ void LaplaceProblem<Vector,Matrix,Sparsity>::make_grid_and_dofs ()
   GridGenerator::hyper_cube (triangulation, -1, 1);
   triangulation.refine_global (3);
   deallog << "Number of active cells: "
-       << triangulation.n_active_cells()
-       << std::endl;
+          << triangulation.n_active_cells()
+          << std::endl;
   deallog << "Total number of cells: "
-       << triangulation.n_cells()
-       << std::endl;
-  
+          << triangulation.n_cells()
+          << std::endl;
+
   dof_handler.distribute_dofs (fe);
 
   deallog << "Number of degrees of freedom: "
-       << dof_handler.n_dofs()
-       << std::endl;
+          << dof_handler.n_dofs()
+          << std::endl;
 
   reinit_sparsity ();
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
@@ -142,17 +142,17 @@ void LaplaceProblem<Vector,Matrix,Sparsity>::make_grid_and_dofs ()
 
 
 template <>
-void LaplaceProblem<Vector<double>,SparseMatrix<double>,SparsityPattern>::reinit_sparsity () 
+void LaplaceProblem<Vector<double>,SparseMatrix<double>,SparsityPattern>::reinit_sparsity ()
 {
   sparsity_pattern.reinit (dof_handler.n_dofs(),
-                          dof_handler.n_dofs(),
-                          dof_handler.max_couplings_between_dofs());
+                           dof_handler.n_dofs(),
+                           dof_handler.max_couplings_between_dofs());
 }
 
 
 
 template <>
-void LaplaceProblem<Vector<double>,SparseMatrix<double>,SparsityPattern>::reinit_vectors () 
+void LaplaceProblem<Vector<double>,SparseMatrix<double>,SparsityPattern>::reinit_vectors ()
 {
   solution.reinit (dof_handler.n_dofs());
   system_rhs.reinit (dof_handler.n_dofs());
@@ -161,17 +161,17 @@ void LaplaceProblem<Vector<double>,SparseMatrix<double>,SparsityPattern>::reinit
 
 
 template <>
-void LaplaceProblem<Vector<float>,SparseMatrix<float>,SparsityPattern>::reinit_sparsity () 
+void LaplaceProblem<Vector<float>,SparseMatrix<float>,SparsityPattern>::reinit_sparsity ()
 {
   sparsity_pattern.reinit (dof_handler.n_dofs(),
-                          dof_handler.n_dofs(),
-                          dof_handler.max_couplings_between_dofs());
+                           dof_handler.n_dofs(),
+                           dof_handler.max_couplings_between_dofs());
 }
 
 
 
 template <>
-void LaplaceProblem<Vector<float>,SparseMatrix<float>,SparsityPattern>::reinit_vectors () 
+void LaplaceProblem<Vector<float>,SparseMatrix<float>,SparsityPattern>::reinit_vectors ()
 {
   solution.reinit (dof_handler.n_dofs());
   system_rhs.reinit (dof_handler.n_dofs());
@@ -180,91 +180,91 @@ void LaplaceProblem<Vector<float>,SparseMatrix<float>,SparsityPattern>::reinit_v
 
 
 template <>
-void LaplaceProblem<BlockVector<double>,BlockSparseMatrix<double>,BlockSparsityPattern>::reinit_sparsity () 
+void LaplaceProblem<BlockVector<double>,BlockSparseMatrix<double>,BlockSparsityPattern>::reinit_sparsity ()
 {
   switch (n_blocks)
     {
-      case 2:
-      {
-       const types::global_dof_index n_dofs = dof_handler.n_dofs();
-       const types::global_dof_index block_size[2] = { n_dofs/3, n_dofs - n_dofs/3 };
-       
-       for (unsigned int i=0; i<2; ++i)
-         for (unsigned int j=0; j<2; ++j)
-           sparsity_pattern.block(i,j).reinit (block_size[i], block_size[j],
-                                               dof_handler.max_couplings_between_dofs());
-       sparsity_pattern.collect_sizes ();
-
-       break;
-      };
-
-      case 3:
-      {
-       const types::global_dof_index n_dofs = dof_handler.n_dofs();
-       const types::global_dof_index block_size[3] = { n_dofs/5, n_dofs/7, n_dofs - n_dofs/5 - n_dofs/7 };
-       
-       for (unsigned int i=0; i<3; ++i)
-         for (unsigned int j=0; j<3; ++j)
-           sparsity_pattern.block(i,j).reinit (block_size[i], block_size[j],
-                                               dof_handler.max_couplings_between_dofs());
-       sparsity_pattern.collect_sizes ();
-
-       break;
-      };
-
-      default:
-           AssertThrow (false, ExcNotImplemented());
-    }; 
+    case 2:
+    {
+      const types::global_dof_index n_dofs = dof_handler.n_dofs();
+      const types::global_dof_index block_size[2] = { n_dofs/3, n_dofs - n_dofs/3 };
+
+      for (unsigned int i=0; i<2; ++i)
+        for (unsigned int j=0; j<2; ++j)
+          sparsity_pattern.block(i,j).reinit (block_size[i], block_size[j],
+                                              dof_handler.max_couplings_between_dofs());
+      sparsity_pattern.collect_sizes ();
+
+      break;
+    };
+
+    case 3:
+    {
+      const types::global_dof_index n_dofs = dof_handler.n_dofs();
+      const types::global_dof_index block_size[3] = { n_dofs/5, n_dofs/7, n_dofs - n_dofs/5 - n_dofs/7 };
+
+      for (unsigned int i=0; i<3; ++i)
+        for (unsigned int j=0; j<3; ++j)
+          sparsity_pattern.block(i,j).reinit (block_size[i], block_size[j],
+                                              dof_handler.max_couplings_between_dofs());
+      sparsity_pattern.collect_sizes ();
+
+      break;
+    };
+
+    default:
+      AssertThrow (false, ExcNotImplemented());
+    };
 }
 
 
 
 template <>
-void LaplaceProblem<BlockVector<double>,BlockSparseMatrix<double>,BlockSparsityPattern>::reinit_vectors () 
+void LaplaceProblem<BlockVector<double>,BlockSparseMatrix<double>,BlockSparsityPattern>::reinit_vectors ()
 {
   switch (n_blocks)
     {
-      case 2:
-      {
-       const types::global_dof_index n_dofs = dof_handler.n_dofs();
-       const types::global_dof_index block_size_[2] = { n_dofs/3, n_dofs - n_dofs/3 };
-       const std::vector<types::global_dof_index> block_size (&block_size_[0],
-                                              &block_size_[2]);
-       
-       solution.reinit (block_size);
-       system_rhs.reinit (block_size);
-
-       break;
-      };
-       
-      case 3:
-      {
-       const types::global_dof_index n_dofs = dof_handler.n_dofs();
-       const types::global_dof_index block_size_[3] = { n_dofs/5, n_dofs/7, n_dofs - n_dofs/5 - n_dofs/7 };
-       const std::vector<types::global_dof_index> block_size (&block_size_[0],
-                                              &block_size_[3]);
-       
-       solution.reinit (block_size);
-       system_rhs.reinit (block_size);
-
-       break;
-      };
-       
-      default:
-           AssertThrow (false, ExcNotImplemented());
+    case 2:
+    {
+      const types::global_dof_index n_dofs = dof_handler.n_dofs();
+      const types::global_dof_index block_size_[2] = { n_dofs/3, n_dofs - n_dofs/3 };
+      const std::vector<types::global_dof_index> block_size (&block_size_[0],
+                                                             &block_size_[2]);
+
+      solution.reinit (block_size);
+      system_rhs.reinit (block_size);
+
+      break;
+    };
+
+    case 3:
+    {
+      const types::global_dof_index n_dofs = dof_handler.n_dofs();
+      const types::global_dof_index block_size_[3] = { n_dofs/5, n_dofs/7, n_dofs - n_dofs/5 - n_dofs/7 };
+      const std::vector<types::global_dof_index> block_size (&block_size_[0],
+                                                             &block_size_[3]);
+
+      solution.reinit (block_size);
+      system_rhs.reinit (block_size);
+
+      break;
+    };
+
+    default:
+      AssertThrow (false, ExcNotImplemented());
     };
 }
 
 
 
 template <class Vector, class Matrix, class Sparsity>
-void LaplaceProblem<Vector,Matrix,Sparsity>::assemble_system () 
+void LaplaceProblem<Vector,Matrix,Sparsity>::assemble_system ()
 {
   QGauss<2>  quadrature_formula(2);
-  FEValues<2> fe_values (fe, quadrature_formula, 
-                        UpdateFlags(update_values    |
-                                    update_gradients |
-                                    update_JxW_values));
+  FEValues<2> fe_values (fe, quadrature_formula,
+                         UpdateFlags(update_values    |
+                                     update_gradients |
+                                     update_JxW_values));
 
   const unsigned int   dofs_per_cell = fe.dofs_per_cell;
   const unsigned int   n_q_points    = quadrature_formula.size();
@@ -275,7 +275,7 @@ void LaplaceProblem<Vector,Matrix,Sparsity>::assemble_system ()
   std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
   DoFHandler<2>::active_cell_iterator cell = dof_handler.begin_active(),
-                                     endc = dof_handler.end();
+                                      endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       fe_values.reinit (cell);
@@ -284,45 +284,45 @@ void LaplaceProblem<Vector,Matrix,Sparsity>::assemble_system ()
       cell_rhs = 0;
 
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int j=0; j<dofs_per_cell; ++j)
-         for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-           cell_matrix(i,j) += (fe_values.shape_grad (i, q_point) *
-                                fe_values.shape_grad (j, q_point) *
-                                fe_values.JxW (q_point));
+        for (unsigned int j=0; j<dofs_per_cell; ++j)
+          for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+            cell_matrix(i,j) += (fe_values.shape_grad (i, q_point) *
+                                 fe_values.shape_grad (j, q_point) *
+                                 fe_values.JxW (q_point));
 
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-         cell_rhs(i) += (fe_values.shape_value (i, q_point) *
-                         1 *
-                         fe_values.JxW (q_point));
+        for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+          cell_rhs(i) += (fe_values.shape_value (i, q_point) *
+                          1 *
+                          fe_values.JxW (q_point));
 
       cell->get_dof_indices (local_dof_indices);
 
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int j=0; j<dofs_per_cell; ++j)
-         system_matrix.add (local_dof_indices[i],
-                            local_dof_indices[j],
-                            cell_matrix(i,j));
+        for (unsigned int j=0; j<dofs_per_cell; ++j)
+          system_matrix.add (local_dof_indices[i],
+                             local_dof_indices[j],
+                             cell_matrix(i,j));
 
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       system_rhs(local_dof_indices[i]) += cell_rhs(i);
+        system_rhs(local_dof_indices[i]) += cell_rhs(i);
     };
 
 
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           ZeroFunction<2>(),
-                                           boundary_values);
+                                            0,
+                                            ZeroFunction<2>(),
+                                            boundary_values);
   MatrixTools::apply_boundary_values (boundary_values,
-                                     system_matrix,
-                                     solution,
-                                     system_rhs);
+                                      system_matrix,
+                                      solution,
+                                      system_rhs);
 }
 
 
 template <class Vector, class Matrix, class Sparsity>
-void LaplaceProblem<Vector,Matrix,Sparsity>::solve () 
+void LaplaceProblem<Vector,Matrix,Sparsity>::solve ()
 {
   SolverControl           solver_control (1000, 1e-12, false, false);
   PrimitiveVectorMemory<Vector> vector_memory;
@@ -330,14 +330,14 @@ void LaplaceProblem<Vector,Matrix,Sparsity>::solve ()
 
   PreconditionJacobi<Matrix> preconditioner;
   preconditioner.initialize (system_matrix, 0.8);
-  
+
   cg.solve (system_matrix, solution, system_rhs,
-           preconditioner);
+            preconditioner);
 }
 
 
 template <class Vector, class Matrix, class Sparsity>
-void LaplaceProblem<Vector,Matrix,Sparsity>::run () 
+void LaplaceProblem<Vector,Matrix,Sparsity>::run ()
 {
   make_grid_and_dofs ();
   assemble_system ();
@@ -345,105 +345,105 @@ void LaplaceProblem<Vector,Matrix,Sparsity>::run ()
 
   for (unsigned int i=0; i<solution.size(); ++i)
     deallog
-                                      //<< typeid(Vector).name ()
-                                      //<< ' '
-                                      //<< typeid(Matrix).name ()
-                                      //<< '-'
-           << i << ' ' << solution(i) << std::endl;
+    //<< typeid(Vector).name ()
+    //<< ' '
+    //<< typeid(Matrix).name ()
+    //<< '-'
+        << i << ' ' << solution(i) << std::endl;
 }
 
-    
 
-int main () 
+
+int main ()
 {
   std::ofstream logfile("block_matrices/output");
   deallog << std::setprecision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
 
-                                  // vector of solution vectors
+
+  // vector of solution vectors
   std::vector<std::vector<double> > solutions;
 
   if (true)
     {
       LaplaceProblem<Vector<double>,SparseMatrix<double>,SparsityPattern>
-       laplace_problem (2);
+      laplace_problem (2);
       laplace_problem.run ();
-      
+
       solutions.push_back (std::vector<double>());
       solutions.back().resize (laplace_problem.solution.size());
       for (unsigned int i=0; i<laplace_problem.solution.size(); ++i)
-       solutions.back()[i] = laplace_problem.solution(i);
+        solutions.back()[i] = laplace_problem.solution(i);
     };
-  
+
   if (true)
     {
       LaplaceProblem<Vector<float>,SparseMatrix<float>,SparsityPattern>
-       laplace_problem (3);
+      laplace_problem (3);
       laplace_problem.run ();
-      
+
       solutions.push_back (std::vector<double>());
       solutions.back().resize (laplace_problem.solution.size());
       for (unsigned int i=0; i<laplace_problem.solution.size(); ++i)
-       solutions.back()[i] = laplace_problem.solution(i);
+        solutions.back()[i] = laplace_problem.solution(i);
     };
-  
+
   if (true)
     {
       LaplaceProblem<BlockVector<double>,BlockSparseMatrix<double>,BlockSparsityPattern>
-       laplace_problem (2);
+      laplace_problem (2);
       laplace_problem.run ();
-      
+
       solutions.push_back (std::vector<double>());
       solutions.back().resize (laplace_problem.solution.size());
       for (unsigned int i=0; i<laplace_problem.solution.size(); ++i)
-       solutions.back()[i] = laplace_problem.solution(i);
+        solutions.back()[i] = laplace_problem.solution(i);
     };
 
   if (true)
     {
       LaplaceProblem<BlockVector<double>,BlockSparseMatrix<double>,BlockSparsityPattern>
-       laplace_problem (3);  
+      laplace_problem (3);
       laplace_problem.run ();
-      
+
       solutions.push_back (std::vector<double>());
       solutions.back().resize (laplace_problem.solution.size());
       for (unsigned int i=0; i<laplace_problem.solution.size(); ++i)
-       solutions.back()[i] = laplace_problem.solution(i);
+        solutions.back()[i] = laplace_problem.solution(i);
     };
 
   const unsigned int n_datasets = solutions.size();
   deallog << "Checking " << n_datasets << " data sets." << std::endl;
-  
+
   for (unsigned int i=1; i<n_datasets; ++i)
     Assert (solutions[i].size() == solutions[i].size(),
-           ExcInternalError());
-  
+            ExcInternalError());
+
   deallog << std::setprecision(16);
   for (unsigned int i=1; i<n_datasets; ++i)
     {
-                                      // relative accuracy. data set
-                                      // 1 is computed using floats
-                                      // instead of doubles, so lower
-                                      // our requirements
+      // relative accuracy. data set
+      // 1 is computed using floats
+      // instead of doubles, so lower
+      // our requirements
       const double accuracy = (i==1 ? 1e-6 : 1e-12);
-      
+
       for (unsigned int j=0; j<solutions[0].size(); ++j)
-       if ( std::fabs(solutions[i][j] - solutions[0][j]) >
-            accuracy*std::fabs(solutions[i][j] + solutions[0][j]))
-         {
-           deallog << "Discrepancy: i=" << i << ", j=" << j
-                   << ", sol[i][j]=" << solutions[i][j]
-                   << ", sol[0][j]=" << solutions[0][j]
-                   << std::endl;
-           deallog << std::flush;
-           Assert (false, ExcInternalError());
-         };
+        if ( std::fabs(solutions[i][j] - solutions[0][j]) >
+             accuracy*std::fabs(solutions[i][j] + solutions[0][j]))
+          {
+            deallog << "Discrepancy: i=" << i << ", j=" << j
+                    << ", sol[i][j]=" << solutions[i][j]
+                    << ", sol[0][j]=" << solutions[0][j]
+                    << std::endl;
+            deallog << std::flush;
+            Assert (false, ExcInternalError());
+          };
     };
-  
-    
+
+
   return 0;
 }
index 6ae3a56e039c26b3d12dc175ec70205684218088..3bd448f554369770c37a941dbb12ebd951d5a7b5 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim>(2) {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return 100*(component+1)*p.square()*std::sin(p.square()); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { for (unsigned int d=0; d<this->n_components; ++d) values(d) = value(p,d); }
+public:
+  MySquareFunction () : Function<dim>(2) {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return 100*(component+1)*p.square()*std::sin(p.square());
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    for (unsigned int d=0; d<this->n_components; ++d) values(d) = value(p,d);
+  }
 };
 
 
@@ -77,18 +81,18 @@ boundary_q (const DoFHandler<1> &)
 void write_map (const std::map<types::global_dof_index,double> &bv)
 {
   for (std::map<types::global_dof_index,double>::const_iterator
-        i=bv.begin(); i!=bv.end(); ++i)
+       i=bv.begin(); i!=bv.end(); ++i)
     deallog << i->first << ' ' << i->second <<std::endl;
 }
 
-      
+
 
 
 template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     {
       GridGenerator::hyper_ball(tr, Point<dim>(), 1);
@@ -106,61 +110,61 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // use a cubic mapping to make
-                                  // things a little more complicated
+  // use a cubic mapping to make
+  // things a little more complicated
   MappingQ<dim> mapping(3);
 
-  
-                                  // list of finite elements for
-                                  // which we want check, and
-                                  // associated list of boundary
-                                  // value functions
+
+  // list of finite elements for
+  // which we want check, and
+  // associated list of boundary
+  // value functions
   std::vector<const FiniteElement<dim>*> fe_list;
   std::vector<const Function<dim>*> function_list;
 
-                                  // FE1: a system of a quadratic and
-                                  // a linear element
+  // FE1: a system of a quadratic and
+  // a linear element
   fe_list.push_back (new FESystem<dim> (FE_Q<dim>(2), 1, FE_Q<dim>(1), 1));
   function_list.push_back (new MySquareFunction<dim>());
 
-                                  // FE2: a linear element, to make
-                                  // things simple
+  // FE2: a linear element, to make
+  // things simple
   fe_list.push_back (new FE_Q<dim> (1));
   function_list.push_back (new Functions::SquareFunction<dim>());
-  
-                                  // check all of them
+
+  // check all of them
   for (unsigned int i=0; i<fe_list.size(); ++i)
     {
       const FiniteElement<dim> &fe = *fe_list[i];
-      
+
       DoFHandler<dim> dof(tr);
       dof.distribute_dofs(fe);
 
       typename FunctionMap<dim>::type function_map;
       function_map[0] = function_list[i];
 
-                                      // interpolate boundary values
+      // interpolate boundary values
       deallog << "Interpolated boundary values" << std::endl;
       std::map<types::global_dof_index,double> interpolated_bv;
       VectorTools::interpolate_boundary_values (mapping, dof, function_map,
-                                               interpolated_bv, std::vector<bool>());
+                                                interpolated_bv, std::vector<bool>());
       write_map (interpolated_bv);
 
-                                      // project boundary values
-                                      // presently this is not
-                                      // implemented for 3d
+      // project boundary values
+      // presently this is not
+      // implemented for 3d
       if (dim != 3)
-       {
-         deallog << "Projected boundary values" << std::endl;
-         std::map<types::global_dof_index,double> projected_bv;
-         VectorTools::project_boundary_values (mapping, dof, function_map,
-                                               boundary_q(dof), projected_bv);
-         write_map (projected_bv);
-       };
+        {
+          deallog << "Projected boundary values" << std::endl;
+          std::map<types::global_dof_index,double> projected_bv;
+          VectorTools::project_boundary_values (mapping, dof, function_map,
+                                                boundary_q(dof), projected_bv);
+          write_map (projected_bv);
+        };
     };
-  
-      
-                                  // delete objects now no more needed
+
+
+  // delete objects now no more needed
   for (unsigned int i=0; i<fe_list.size(); ++i)
     {
       delete fe_list[i];
@@ -171,9 +175,9 @@ check ()
 
 int main ()
 {
-  initlog(__FILE__);  
+  initlog(__FILE__);
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
 
   deallog.push ("1d");
   check<1> ();
index 5d60ada18869c7e7552771ac285ff2229b0c09cb..ef28f0040b0909742d1d511ed478640694e8605f 100644 (file)
@@ -50,19 +50,19 @@ void test()
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature, update_values);
 
-                                  // initialize FEValues with the first cell
+  // initialize FEValues with the first cell
   fe_values.reinit (dof.begin_active());
 
-                                  // then make this first cell invalid by
-                                  // coarsening it away
+  // then make this first cell invalid by
+  // coarsening it away
   for (unsigned int c=0; c<GeometryInfo<dim>::max_children_per_cell; ++c)
     tr.begin(1)->child(c)->set_coarsen_flag();
   tr.execute_coarsening_and_refinement ();
   dof.distribute_dofs(fe);
 
-                                  // initialize FEValues with what is now the
-                                  // first cell. this used to fail (see the
-                                  // reason given at the top)
+  // initialize FEValues with what is now the
+  // first cell. this used to fail (see the
+  // reason given at the top)
   fe_values.reinit (dof.begin_active());
 
   deallog << "OK" << std::endl;
@@ -75,7 +75,7 @@ int main()
   deallog << std::setprecision (4);
   deallog.threshold_double(1.e-7);
 
-  test<1>();  
+  test<1>();
   test<2>();
   test<3>();
 }
index e9b97f933a563ac0f5e82dbaf34d516c18811bf9..1ca5a5343cb7ce53b32fbc78a1ca18678475a083 100644 (file)
@@ -45,13 +45,13 @@ void test()
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature, update_values);
 
-                                  // initialize FEValues with the first cell
+  // initialize FEValues with the first cell
   fe_values.reinit (tr.begin_active());
 
-                                  // then invalidate the cell iterator
+  // then invalidate the cell iterator
   tr.refine_global (1);
-                                  // and invalidate it again. this
-                                  // shouldn't do any further harm
+  // and invalidate it again. this
+  // shouldn't do any further harm
   tr.refine_global (1);
 
   deallog << "OK" << std::endl;
index 9eabd900a1ae7f787f8da51bfebde605f0e0193f..27d00dba5d879f6457be1fe5611035796e2f65be 100644 (file)
@@ -44,29 +44,29 @@ bool
 satisfies_level1_at_vertex_rule (const Triangulation<dim> &tr)
 {
   std::vector<unsigned int> min_adjacent_cell_level (tr.n_vertices(),
-                                                    tr.n_levels());
+                                                     tr.n_levels());
   std::vector<unsigned int> max_adjacent_cell_level (tr.n_vertices(),
-                                                    0);
-      
+                                                     0);
+
   for (typename Triangulation<dim>::active_cell_iterator
-        cell = tr.begin_active();
+       cell = tr.begin_active();
        cell != tr.end(); ++cell)
     for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
       {
-       min_adjacent_cell_level[cell->vertex_index(v)]
-         = std::min<unsigned int>
-         (min_adjacent_cell_level[cell->vertex_index(v)],
-          cell->level());
-       max_adjacent_cell_level[cell->vertex_index(v)]
-         = std::max<unsigned int> (min_adjacent_cell_level[cell->vertex_index(v)],
-                                   cell->level());
+        min_adjacent_cell_level[cell->vertex_index(v)]
+          = std::min<unsigned int>
+            (min_adjacent_cell_level[cell->vertex_index(v)],
+             cell->level());
+        max_adjacent_cell_level[cell->vertex_index(v)]
+          = std::max<unsigned int> (min_adjacent_cell_level[cell->vertex_index(v)],
+                                    cell->level());
       }
 
   for (unsigned int k=0; k<tr.n_vertices(); ++k)
     if (tr.vertex_used(k))
       if (max_adjacent_cell_level[k] -
-         min_adjacent_cell_level[k] > 1)
-       return false;
+          min_adjacent_cell_level[k] > 1)
+        return false;
   return true;
 }
 
@@ -82,42 +82,42 @@ void test()
   const unsigned int n_refinements[] = { 0, 13, 11, 6 };
   for (unsigned int i=0; i<n_refinements[dim]; ++i)
     {
-                                      // refine one-fifth of cells randomly
+      // refine one-fifth of cells randomly
       std::vector<bool> flags (triangulation.n_active_cells(), false);
       for (unsigned int k=0; k<flags.size()/5 + 1; ++k)
-       flags[rand() % flags.size()] = true;
-                                      // make sure there's at least one that
-                                      // will be refined
+        flags[rand() % flags.size()] = true;
+      // make sure there's at least one that
+      // will be refined
       flags[0] = true;
 
-                                      // refine triangulation
+      // refine triangulation
       unsigned int index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = triangulation.begin_active();
-          cell != triangulation.end(); ++cell, ++index)
-       if (flags[index])
-         cell->set_refine_flag();
+           cell = triangulation.begin_active();
+           cell != triangulation.end(); ++cell, ++index)
+        if (flags[index])
+          cell->set_refine_flag();
       Assert (index == triangulation.n_active_cells(), ExcInternalError());
 
-                                      // flag all other cells for coarsening
-                                      // (this should ensure that at least
-                                      // some of them will actually be
-                                      // coarsened)
+      // flag all other cells for coarsening
+      // (this should ensure that at least
+      // some of them will actually be
+      // coarsened)
       index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = triangulation.begin_active();
-          cell != triangulation.end(); ++cell, ++index)
-       if (!flags[index])
-         cell->set_coarsen_flag();
-          
+           cell = triangulation.begin_active();
+           cell != triangulation.end(); ++cell, ++index)
+        if (!flags[index])
+          cell->set_coarsen_flag();
+
       triangulation.execute_coarsening_and_refinement ();
 
-                                      // verify that none of the cells
-                                      // violates the level-1-at-vertex rule
+      // verify that none of the cells
+      // violates the level-1-at-vertex rule
       Assert (satisfies_level1_at_vertex_rule (triangulation),
-             ExcInternalError());      
+              ExcInternalError());
     }
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -126,7 +126,7 @@ int main()
 {
   initlog(__FILE__);
   deallog.threshold_double(1.e-10);
-  
+
   deallog.push("2d");
   test<2>();
   deallog.pop();
index 586ef6a203b4efe6c9a22ea7eda02eb30d8580ed..f86a6cf1c8291f716eb2408f283441677183449b 100644 (file)
@@ -45,29 +45,29 @@ bool
 satisfies_level1_at_vertex_rule (const Triangulation<dim> &tr)
 {
   std::vector<unsigned int> min_adjacent_cell_level (tr.n_vertices(),
-                                                    tr.n_levels());
+                                                     tr.n_levels());
   std::vector<unsigned int> max_adjacent_cell_level (tr.n_vertices(),
-                                                    0);
-      
+                                                     0);
+
   for (typename Triangulation<dim>::active_cell_iterator
-        cell = tr.begin_active();
+       cell = tr.begin_active();
        cell != tr.end(); ++cell)
     for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
       {
-       min_adjacent_cell_level[cell->vertex_index(v)]
-         = std::min<unsigned int>
-         (min_adjacent_cell_level[cell->vertex_index(v)],
-          cell->level());
-       max_adjacent_cell_level[cell->vertex_index(v)]
-         = std::max<unsigned int> (min_adjacent_cell_level[cell->vertex_index(v)],
-                                   cell->level());
+        min_adjacent_cell_level[cell->vertex_index(v)]
+          = std::min<unsigned int>
+            (min_adjacent_cell_level[cell->vertex_index(v)],
+             cell->level());
+        max_adjacent_cell_level[cell->vertex_index(v)]
+          = std::max<unsigned int> (min_adjacent_cell_level[cell->vertex_index(v)],
+                                    cell->level());
       }
 
   for (unsigned int k=0; k<tr.n_vertices(); ++k)
     if (tr.vertex_used(k))
       if (max_adjacent_cell_level[k] -
-         min_adjacent_cell_level[k] > 1)
-       return false;
+          min_adjacent_cell_level[k] > 1)
+        return false;
   return true;
 }
 
@@ -82,62 +82,62 @@ void test()
 
   for (unsigned int i=0; i<20; ++i)
     {
-                                      // refine one-fifth of cells randomly
+      // refine one-fifth of cells randomly
       std::vector<bool> flags (triangulation.n_active_cells(), false);
       for (unsigned int k=0; k<flags.size()/5 + 1; ++k)
-       flags[rand() % flags.size()] = true;
-                                      // make sure there's at least one that
-                                      // will be refined
+        flags[rand() % flags.size()] = true;
+      // make sure there's at least one that
+      // will be refined
       flags[0] = true;
 
-                                      // refine triangulation
+      // refine triangulation
       unsigned int index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = triangulation.begin_active();
-          cell != triangulation.end(); ++cell, ++index)
-       if (flags[index])
-         cell->set_refine_flag();
+           cell = triangulation.begin_active();
+           cell != triangulation.end(); ++cell, ++index)
+        if (flags[index])
+          cell->set_refine_flag();
       Assert (index == triangulation.n_active_cells(), ExcInternalError());
 
-                                      // flag all other cells for coarsening
-                                      // (this should ensure that at least
-                                      // some of them will actually be
-                                      // coarsened)
+      // flag all other cells for coarsening
+      // (this should ensure that at least
+      // some of them will actually be
+      // coarsened)
       index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = triangulation.begin_active();
-          cell != triangulation.end(); ++cell, ++index)
-       if (!flags[index])
-         cell->set_coarsen_flag();
+           cell = triangulation.begin_active();
+           cell != triangulation.end(); ++cell, ++index)
+        if (!flags[index])
+          cell->set_coarsen_flag();
 
       GridOut go;
       go.write_gnuplot (triangulation, deallog.get_file_stream());
 
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = triangulation.begin_active();
-          cell != triangulation.end(); ++cell)
-       if (cell->refine_flag_set())
-         {
-           deallog << cell->center() << ' ' << cell->level() << std::endl;
-           deallog << cell->center() << ' ' << 0 << std::endl;
-           deallog << std::endl;
-         }
-      
-
-      
+           cell = triangulation.begin_active();
+           cell != triangulation.end(); ++cell)
+        if (cell->refine_flag_set())
+          {
+            deallog << cell->center() << ' ' << cell->level() << std::endl;
+            deallog << cell->center() << ' ' << 0 << std::endl;
+            deallog << std::endl;
+          }
+
+
+
       triangulation.execute_coarsening_and_refinement ();
 
-                                      // verify that none of the cells
-                                      // violates the level-1-at-vertex rule
+      // verify that none of the cells
+      // violates the level-1-at-vertex rule
       Assert (satisfies_level1_at_vertex_rule (triangulation),
-             ExcInternalError());
+              ExcInternalError());
 
 
       deallog << "Iteration " << i
-             << ": cells=" << triangulation.n_active_cells()
-             << std::endl;
+              << ": cells=" << triangulation.n_active_cells()
+              << std::endl;
     }
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -146,7 +146,7 @@ int main()
 {
   initlog(__FILE__);
   deallog.threshold_double(1.e-10);
-  
+
   deallog.push("1d");
   test<1>();
   deallog.pop();
index a822713a4e4b7fc5ee251401cc4e9b8fbc342bdb..a2d2bc2d317b31dbe010709cc69ece8c48450b13 100644 (file)
@@ -41,29 +41,29 @@ bool
 satisfies_level1_at_vertex_rule (const Triangulation<dim> &tr)
 {
   std::vector<unsigned int> min_adjacent_cell_level (tr.n_vertices(),
-                                                    tr.n_levels());
+                                                     tr.n_levels());
   std::vector<unsigned int> max_adjacent_cell_level (tr.n_vertices(),
-                                                    0);
-      
+                                                     0);
+
   for (typename Triangulation<dim>::active_cell_iterator
-        cell = tr.begin_active();
+       cell = tr.begin_active();
        cell != tr.end(); ++cell)
     for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
       {
-       min_adjacent_cell_level[cell->vertex_index(v)]
-         = std::min<unsigned int>
-         (min_adjacent_cell_level[cell->vertex_index(v)],
-          cell->level());
-       max_adjacent_cell_level[cell->vertex_index(v)]
-         = std::max<unsigned int> (min_adjacent_cell_level[cell->vertex_index(v)],
-                                   cell->level());
+        min_adjacent_cell_level[cell->vertex_index(v)]
+          = std::min<unsigned int>
+            (min_adjacent_cell_level[cell->vertex_index(v)],
+             cell->level());
+        max_adjacent_cell_level[cell->vertex_index(v)]
+          = std::max<unsigned int> (min_adjacent_cell_level[cell->vertex_index(v)],
+                                    cell->level());
       }
 
   for (unsigned int k=0; k<tr.n_vertices(); ++k)
     if (tr.vertex_used(k))
       if (max_adjacent_cell_level[k] -
-         min_adjacent_cell_level[k] > 1)
-       return false;
+          min_adjacent_cell_level[k] > 1)
+        return false;
   return true;
 }
 
@@ -80,26 +80,26 @@ void test()
     triangulation.begin(1)->child(c)->set_refine_flag();
   for (unsigned int c=0; c<GeometryInfo<dim>::max_children_per_cell; ++c)
     triangulation.last(1)->child(c)->set_coarsen_flag();
-  
+
   triangulation.prepare_coarsening_and_refinement ();
 
   for (typename Triangulation<dim>::active_cell_iterator
-        cell = triangulation.begin_active();
+       cell = triangulation.begin_active();
        cell != triangulation.end(); ++cell)
     deallog << cell << ' '
-           << (cell->refine_flag_set() ?
-               "to be refined" :
-               (cell->coarsen_flag_set() ?
-                "to be coarsened" :
-                ""))
-           << std::endl;
-  
+            << (cell->refine_flag_set() ?
+                "to be refined" :
+                (cell->coarsen_flag_set() ?
+                 "to be coarsened" :
+                 ""))
+            << std::endl;
+
   triangulation.execute_coarsening_and_refinement ();
-      
-                                  // verify that none of the cells
-                                  // violates the level-1-at-vertex rule
+
+  // verify that none of the cells
+  // violates the level-1-at-vertex rule
   Assert (satisfies_level1_at_vertex_rule (triangulation),
-         ExcInternalError());
+          ExcInternalError());
 }
 
 
@@ -107,7 +107,7 @@ int main()
 {
   initlog(__FILE__);
   deallog.threshold_double(1.e-10);
-  
+
   deallog.push("1d");
   test<1>();
   deallog.pop();
index 3c959347f3afd37f71507cffc332eda54e79fd26..f861fc275c0b8b6f601671481ca403627a87323c 100644 (file)
@@ -43,7 +43,7 @@ void test ()
   tria.refine_global (1);
   tria.begin_active()->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
-  tria.refine_global (1);  
+  tria.refine_global (1);
 
   hp::FECollection<dim> fe_collection;
   fe_collection.push_back(FE_Q<dim> (1));
@@ -54,10 +54,10 @@ void test ()
   hp::DoFHandler<dim> dof_handler(tria);
 
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell != dof_handler.end(); ++cell)
     cell->set_active_fe_index (rand() % fe_collection.size());
-  
+
   dof_handler.distribute_dofs(fe_collection);
 
   ConstraintMatrix cm;
@@ -70,9 +70,9 @@ int main ()
 {
   initlog(__FILE__);
   deallogfile << std::setprecision(2);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 482038a8ad3da77f7bbc3383bb3ba0f667981743..60a7719b7c15e6944494160a7b7c1194298c2241 100644 (file)
 std::ofstream logfile("constraints/output");
 
 
-void make_tria (Triangulation<3> &tria, int step) 
+void make_tria (Triangulation<3> &tria, int step)
 {
   switch (step)
     {
-      case 0:
-      case 1:
-      {
-                                        // two cells packed behind each
-                                        // other. if step==0, refine back one,
-                                        // otherwise the one in front
-       const Point<3> vertices[12] = { Point<3>(0,0,0),
-                                       Point<3>(1,0,0),
-                                       Point<3>(1,0,1),
-                                       Point<3>(0,0,1),
-                                       
-                                       Point<3>(0,1,0),                                 
-                                       Point<3>(1,1,0),
-                                       Point<3>(1,1,1),
-                                       Point<3>(0,1,1),
-                                       
-                                       Point<3>(0,2,0),                                 
-                                       Point<3>(1,2,0),
-                                       Point<3>(1,2,1),
-                                       Point<3>(0,2,1)    };
-       const int cell_vertices[2][8] = { { 0,1,2,3,4,5,6,7 }, { 4,5,6,7,8,9,10,11 } };
-       std::vector<CellData<3> > cells (2, CellData<3>());
-       for (unsigned int cell=0; cell<2; ++cell)
-         for (unsigned int j=0; j<8; ++j)
-           cells[cell].vertices[j] = cell_vertices[cell][j];
-       cells[0].material_id = 0;
-       cells[1].material_id = 0;
-  
-       tria.create_triangulation_compatibility (
-         std::vector<Point<3> >(&vertices[0], &vertices[12]),
-                                  cells,
-                                  SubCellData());       // no boundary information
-
-       if (step==0)
-         tria.last_active()->set_refine_flag();
-       else
-         tria.begin_active()->set_refine_flag();
-       tria.execute_coarsening_and_refinement ();
-
-       break;
-      };
+    case 0:
+    case 1:
+    {
+      // two cells packed behind each
+      // other. if step==0, refine back one,
+      // otherwise the one in front
+      const Point<3> vertices[12] = { Point<3>(0,0,0),
+                                      Point<3>(1,0,0),
+                                      Point<3>(1,0,1),
+                                      Point<3>(0,0,1),
 
-      case 2:
-      case 3:
-      {
-                                        // two cells packed next to each
-                                        // other. if step==2, refine right one,
-                                        // otherwise the left one
-       const Point<3> vertices[12] = { Point<3>(0,0,0),
-                                       Point<3>(1,0,0),
-                                       Point<3>(1,0,1),
-                                       Point<3>(0,0,1),
-                                       
-                                       Point<3>(0,1,0),                                 
-                                       Point<3>(1,1,0),
-                                       Point<3>(1,1,1),
-                                       Point<3>(0,1,1),
-                                       
-                                       Point<3>(2,0,0),                                 
-                                       Point<3>(2,0,1),
-                                       Point<3>(2,1,0),
-                                       Point<3>(2,1,1)    };
-       const int cell_vertices[2][8] = { { 0,1,2,3,4,5,6,7 }, { 1,8,9,2,5,10,11,6 } };
-       std::vector<CellData<3> > cells (2, CellData<3>());
-       for (unsigned int cell=0; cell<2; ++cell)
-         for (unsigned int j=0; j<8; ++j)
-           cells[cell].vertices[j] = cell_vertices[cell][j];
-       cells[0].material_id = 0;
-       cells[1].material_id = 0;
-  
-       tria.create_triangulation_compatibility (
-         std::vector<Point<3> >(&vertices[0], &vertices[12]),
-                                  cells,
-                                  SubCellData());       // no boundary information
-
-       if (step==2)
-         tria.last_active()->set_refine_flag();
-       else
-         tria.begin_active()->set_refine_flag();
-       tria.execute_coarsening_and_refinement ();
-
-       break;
-      };
+                                      Point<3>(0,1,0),
+                                      Point<3>(1,1,0),
+                                      Point<3>(1,1,1),
+                                      Point<3>(0,1,1),
 
-      case 4:
-      case 5:
-      {
-                                        // two cells packed on top of each
-                                        // other. if step==4, refine top one,
-                                        // otherwise the bottom one
-       const Point<3> vertices[12] = { Point<3>(0,0,0),
-                                       Point<3>(1,0,0),
-                                       Point<3>(1,0,1),
-                                       Point<3>(0,0,1),
-                                       
-                                       Point<3>(0,1,0),                                 
-                                       Point<3>(1,1,0),
-                                       Point<3>(1,1,1),
-                                       Point<3>(0,1,1),
-                                       
-                                       Point<3>(1,0,2),
-                                       Point<3>(0,0,2),
-                                       Point<3>(1,1,2),
-                                       Point<3>(0,1,2)    };
-       const int cell_vertices[2][8] = { { 0,1,2,3,4,5,6,7 }, { 3, 2, 8, 9 , 7, 6, 10, 11} };
-       std::vector<CellData<3> > cells (2, CellData<3>());
-       for (unsigned int cell=0; cell<2; ++cell)
-         for (unsigned int j=0; j<8; ++j)
-           cells[cell].vertices[j] = cell_vertices[cell][j];
-       cells[0].material_id = 0;
-       cells[1].material_id = 0;
-       
-       tria.create_triangulation_compatibility (
-         std::vector<Point<3> >(&vertices[0], &vertices[12]),
-                                  cells,
-                                  SubCellData());       // no boundary information
-       
-       if (step==4)
-         tria.last_active()->set_refine_flag();
-       else
-         tria.begin_active()->set_refine_flag();
-       tria.execute_coarsening_and_refinement ();
-       
-       break;
-      };
+                                      Point<3>(0,2,0),
+                                      Point<3>(1,2,0),
+                                      Point<3>(1,2,1),
+                                      Point<3>(0,2,1)
+                                    };
+      const int cell_vertices[2][8] = { { 0,1,2,3,4,5,6,7 }, { 4,5,6,7,8,9,10,11 } };
+      std::vector<CellData<3> > cells (2, CellData<3>());
+      for (unsigned int cell=0; cell<2; ++cell)
+        for (unsigned int j=0; j<8; ++j)
+          cells[cell].vertices[j] = cell_vertices[cell][j];
+      cells[0].material_id = 0;
+      cells[1].material_id = 0;
+
+      tria.create_triangulation_compatibility (
+        std::vector<Point<3> >(&vertices[0], &vertices[12]),
+        cells,
+        SubCellData());       // no boundary information
+
+      if (step==0)
+        tria.last_active()->set_refine_flag();
+      else
+        tria.begin_active()->set_refine_flag();
+      tria.execute_coarsening_and_refinement ();
+
+      break;
+    };
+
+    case 2:
+    case 3:
+    {
+      // two cells packed next to each
+      // other. if step==2, refine right one,
+      // otherwise the left one
+      const Point<3> vertices[12] = { Point<3>(0,0,0),
+                                      Point<3>(1,0,0),
+                                      Point<3>(1,0,1),
+                                      Point<3>(0,0,1),
+
+                                      Point<3>(0,1,0),
+                                      Point<3>(1,1,0),
+                                      Point<3>(1,1,1),
+                                      Point<3>(0,1,1),
+
+                                      Point<3>(2,0,0),
+                                      Point<3>(2,0,1),
+                                      Point<3>(2,1,0),
+                                      Point<3>(2,1,1)
+                                    };
+      const int cell_vertices[2][8] = { { 0,1,2,3,4,5,6,7 }, { 1,8,9,2,5,10,11,6 } };
+      std::vector<CellData<3> > cells (2, CellData<3>());
+      for (unsigned int cell=0; cell<2; ++cell)
+        for (unsigned int j=0; j<8; ++j)
+          cells[cell].vertices[j] = cell_vertices[cell][j];
+      cells[0].material_id = 0;
+      cells[1].material_id = 0;
+
+      tria.create_triangulation_compatibility (
+        std::vector<Point<3> >(&vertices[0], &vertices[12]),
+        cells,
+        SubCellData());       // no boundary information
+
+      if (step==2)
+        tria.last_active()->set_refine_flag();
+      else
+        tria.begin_active()->set_refine_flag();
+      tria.execute_coarsening_and_refinement ();
+
+      break;
+    };
+
+    case 4:
+    case 5:
+    {
+      // two cells packed on top of each
+      // other. if step==4, refine top one,
+      // otherwise the bottom one
+      const Point<3> vertices[12] = { Point<3>(0,0,0),
+                                      Point<3>(1,0,0),
+                                      Point<3>(1,0,1),
+                                      Point<3>(0,0,1),
+
+                                      Point<3>(0,1,0),
+                                      Point<3>(1,1,0),
+                                      Point<3>(1,1,1),
+                                      Point<3>(0,1,1),
+
+                                      Point<3>(1,0,2),
+                                      Point<3>(0,0,2),
+                                      Point<3>(1,1,2),
+                                      Point<3>(0,1,2)
+                                    };
+      const int cell_vertices[2][8] = { { 0,1,2,3,4,5,6,7 }, { 3, 2, 8, 9 , 7, 6, 10, 11} };
+      std::vector<CellData<3> > cells (2, CellData<3>());
+      for (unsigned int cell=0; cell<2; ++cell)
+        for (unsigned int j=0; j<8; ++j)
+          cells[cell].vertices[j] = cell_vertices[cell][j];
+      cells[0].material_id = 0;
+      cells[1].material_id = 0;
+
+      tria.create_triangulation_compatibility (
+        std::vector<Point<3> >(&vertices[0], &vertices[12]),
+        cells,
+        SubCellData());       // no boundary information
+
+      if (step==4)
+        tria.last_active()->set_refine_flag();
+      else
+        tria.begin_active()->set_refine_flag();
+      tria.execute_coarsening_and_refinement ();
 
+      break;
+    };
+
+
+    case 6:
+    case 7:
+    case 8:
+    {
+      // four cells, with several refined
+      // (see below)
+      const Point<3> vertices[18] = { Point<3>(0,0,0),
+                                      Point<3>(1,0,0),
+                                      Point<3>(1,0,1),
+                                      Point<3>(0,0,1),
+
+                                      Point<3>(0,1,0),
+                                      Point<3>(1,1,0),
+                                      Point<3>(1,1,1),
+                                      Point<3>(0,1,1),
+
+                                      Point<3>(2,0,0),
+                                      Point<3>(2,0,1),
+                                      Point<3>(2,1,0),
+                                      Point<3>(2,1,1),
 
-      case 6:
-      case 7:
-      case 8:
-      {
-                                        // four cells, with several refined
-                                        // (see below)
-       const Point<3> vertices[18] = { Point<3>(0,0,0),
-                                       Point<3>(1,0,0),
-                                       Point<3>(1,0,1),
-                                       Point<3>(0,0,1),
-                                       
-                                       Point<3>(0,1,0),                                 
-                                       Point<3>(1,1,0),
-                                       Point<3>(1,1,1),
-                                       Point<3>(0,1,1),
-                                       
-                                       Point<3>(2,0,0),                                 
-                                       Point<3>(2,0,1),
-                                       Point<3>(2,1,0),
-                                       Point<3>(2,1,1),
-                                       
-                                       Point<3>(0,2,0),                                 
-                                       Point<3>(1,2,0),
-                                       Point<3>(1,2,1),
-                                       Point<3>(0,2,1),
-                                       
-                                       Point<3>(2,2,0),
-                                       Point<3>(2,2,1)  };
-
-       const int cell_vertices[4][8] = { { 0,1,2,3,4,5,6,7 },
-                                         { 1,8,9,2,5,10,11,6 },
-                                         { 4,5,6,7,12,13,14,15},
-                                         { 5,10,11,6,13,16,17,14} };
-       std::vector<CellData<3> > cells (4, CellData<3>());
-       for (unsigned int cell=0; cell<4; ++cell)
-         for (unsigned int j=0; j<8; ++j)
-           cells[cell].vertices[j] = cell_vertices[cell][j];
-       cells[0].material_id = 0;
-       cells[1].material_id = 0;
-       cells[2].material_id = 0;
-       cells[3].material_id = 0;
-  
-       tria.create_triangulation_compatibility (
-         std::vector<Point<3> >(&vertices[0], &vertices[18]),
-                                  cells,
-                                  SubCellData());       // no boundary information
-
-       switch (step)
-         {
-           case 6:
-                 tria.begin_active()->set_refine_flag ();
-                 break;
-
-           case 7:
-                 tria.begin_active()->set_refine_flag ();
-                 (++tria.begin_active())->set_refine_flag ();
-                 break;
-           case 8:
-                 tria.begin_active()->set_refine_flag ();
-                 (++(++(++tria.begin_active())))->set_refine_flag ();
-                 break;
-         };
-                 
-       tria.execute_coarsening_and_refinement ();
-       
-       break;
+                                      Point<3>(0,2,0),
+                                      Point<3>(1,2,0),
+                                      Point<3>(1,2,1),
+                                      Point<3>(0,2,1),
+
+                                      Point<3>(2,2,0),
+                                      Point<3>(2,2,1)
+                                    };
+
+      const int cell_vertices[4][8] = { { 0,1,2,3,4,5,6,7 },
+        { 1,8,9,2,5,10,11,6 },
+        { 4,5,6,7,12,13,14,15},
+        { 5,10,11,6,13,16,17,14}
       };
+      std::vector<CellData<3> > cells (4, CellData<3>());
+      for (unsigned int cell=0; cell<4; ++cell)
+        for (unsigned int j=0; j<8; ++j)
+          cells[cell].vertices[j] = cell_vertices[cell][j];
+      cells[0].material_id = 0;
+      cells[1].material_id = 0;
+      cells[2].material_id = 0;
+      cells[3].material_id = 0;
+
+      tria.create_triangulation_compatibility (
+        std::vector<Point<3> >(&vertices[0], &vertices[18]),
+        cells,
+        SubCellData());       // no boundary information
+
+      switch (step)
+        {
+        case 6:
+          tria.begin_active()->set_refine_flag ();
+          break;
+
+        case 7:
+          tria.begin_active()->set_refine_flag ();
+          (++tria.begin_active())->set_refine_flag ();
+          break;
+        case 8:
+          tria.begin_active()->set_refine_flag ();
+          (++(++(++tria.begin_active())))->set_refine_flag ();
+          break;
+        };
+
+      tria.execute_coarsening_and_refinement ();
+
+      break;
+    };
     };
 }
 
@@ -255,41 +260,41 @@ int main ()
   deallog.threshold_double(1.e-10);
 
   FiniteElement<3> *fe = 0;
-  
+
   for (unsigned int element=0; element<2; ++element)
     {
       switch (element)
-       {
-         case 0:
-               fe = new FE_Q<3>(1);
-               break;
-         case 1:
-               fe = new FE_Q<3>(2);
-               break;
-       };
-      
+        {
+        case 0:
+          fe = new FE_Q<3>(1);
+          break;
+        case 1:
+          fe = new FE_Q<3>(2);
+          break;
+        };
+
       for (int step=0; step<9; ++step)
-       {
-         deallog << "Element=" << element << ", Step=" << step << std::endl;
-         
-         Triangulation<3> tria;
-         make_tria (tria, step);
-         GridOut().write_gnuplot (tria, logfile);
-         
-         DoFHandler<3> dof (tria);
-         dof.distribute_dofs (*fe);
-      
-         ConstraintMatrix constraints;
-         DoFTools::make_hanging_node_constraints (dof, constraints);
-         constraints.close ();
-      
-         constraints.print (logfile);
-      
-                                          // release fe
-         dof.clear ();
-
-         deallog << std::endl;
-       };
+        {
+          deallog << "Element=" << element << ", Step=" << step << std::endl;
+
+          Triangulation<3> tria;
+          make_tria (tria, step);
+          GridOut().write_gnuplot (tria, logfile);
+
+          DoFHandler<3> dof (tria);
+          dof.distribute_dofs (*fe);
+
+          ConstraintMatrix constraints;
+          DoFTools::make_hanging_node_constraints (dof, constraints);
+          constraints.close ();
+
+          constraints.print (logfile);
+
+          // release fe
+          dof.clear ();
+
+          deallog << std::endl;
+        };
 
       delete fe;
     };
index e2ff56231a254750381b1f3f2a044083ff9a5a7a..0ae8365d7c44472768bc098192fd7f22e3b857f9 100644 (file)
@@ -78,14 +78,14 @@ int main ()
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-                                  // setting up some constants
+  // setting up some constants
   const unsigned int dim = 2;
   const unsigned int solid_dim = 2*dim;
   const unsigned int fluid_dim = dim+1;
   const unsigned int mesh_dim  = dim;
   const unsigned int total_dim = solid_dim + fluid_dim + mesh_dim;
 
-                                  // make the tria and domain
+  // make the tria and domain
   Triangulation<dim>   tria;
 
   GridGenerator::hyper_cube (tria);
@@ -93,31 +93,31 @@ int main ()
 
   Point<dim> real_cell_center;
 
-                                  // create a solid domain (0) in the
-                                  // lower left hand corner of a 2x2 grid
-                                  // the rest is fluid/mesh (1)
+  // create a solid domain (0) in the
+  // lower left hand corner of a 2x2 grid
+  // the rest is fluid/mesh (1)
 
   for (Triangulation<dim>::active_cell_iterator
-        cell = tria.begin_active();
+       cell = tria.begin_active();
        cell != tria.end(); ++cell)
     {
       real_cell_center = cell->center();
       if (real_cell_center(0) < 0.5
-         && real_cell_center(1) < 0.5 )
-       cell->set_material_id (0); // solid
+          && real_cell_center(1) < 0.5 )
+        cell->set_material_id (0); // solid
       else
-       cell->set_material_id (1); //fluid
+        cell->set_material_id (1); //fluid
     }//cell
 
-                                  //create the FE spaces for the solid and the fluid/mesh
-                                  //each are padded with FE_Nothing to be equal length
+  //create the FE spaces for the solid and the fluid/mesh
+  //each are padded with FE_Nothing to be equal length
 
   std::string solid_fe_name = "FESystem[FE_Q(2)^2-FE_Q(2)^2-FE_Nothing()^2-FE_Nothing()-FE_Nothing()^2]";
   std::string fluid_fe_name = "FESystem[FE_Nothing()^2-FE_Nothing()^2-FE_Q(2)^2-FE_Q(1)-FE_Q(2)^2]";
 
   hp::FECollection<dim> fe_collection;
-  FiniteElement<dim> * solid_fe = FETools::get_fe_from_name<dim>(solid_fe_name);
-  FiniteElement<dim> * fluid_fe = FETools::get_fe_from_name<dim>(fluid_fe_name);
+  FiniteElement<dim> *solid_fe = FETools::get_fe_from_name<dim>(solid_fe_name);
+  FiniteElement<dim> *fluid_fe = FETools::get_fe_from_name<dim>(fluid_fe_name);
 
   deallog << "Solid FE Space: " << solid_fe->get_name() << std::endl;
   deallog << "Fluid/Mesh FE Space: " << fluid_fe->get_name() << std::endl;
@@ -128,13 +128,13 @@ int main ()
   hp::DoFHandler<dim> dh(tria);
 
   for (hp::DoFHandler<dim>::active_cell_iterator
-        cell = dh.begin_active();
+       cell = dh.begin_active();
        cell != dh.end(); ++cell)
     {
       if (int(cell->material_id()) == 0)
-       cell->set_active_fe_index (0);
+        cell->set_active_fe_index (0);
       else
-       cell->set_active_fe_index (1);
+        cell->set_active_fe_index (1);
     }//cell
   dh.distribute_dofs(fe_collection);
 
@@ -143,11 +143,11 @@ int main ()
   for (unsigned int comp=0; comp < total_dim; comp++)
     {
       if ( comp < solid_dim )
-       block_component[comp] = 0;
+        block_component[comp] = 0;
       else if ( comp < solid_dim+fluid_dim )
-       block_component[comp] = 1;
+        block_component[comp] = 1;
       else
-       block_component[comp] = 2;
+        block_component[comp] = 2;
     }//comp
 
   std::vector<types::global_dof_index> dofs_per_block(3,0);//3 blocks, count dofs:
@@ -155,7 +155,7 @@ int main ()
 
   DoFRenumbering::component_wise(dh, block_component);
 
-                                  //build the sparsitypattern
+  //build the sparsitypattern
 
   BlockSparsityPattern   block_sparsity_pattern;
   {
@@ -174,50 +174,50 @@ int main ()
 
     csp.collect_sizes();
 
-                                    //enforce coupling across cells and interface
+    //enforce coupling across cells and interface
 
     Table<2,DoFTools::Coupling> cell_coupling (fe_collection.n_components(), fe_collection.n_components());
     Table<2,DoFTools::Coupling> face_coupling (fe_collection.n_components(), fe_collection.n_components());
 
     for (unsigned int c=0; c<fe_collection.n_components(); ++c)
       {
-       for (unsigned int d=0; d<fe_collection.n_components(); ++d)
-         {
-           if (((c<solid_dim) && (d<solid_dim)) //couples solid dims with solid dims
-               ||
-               (((c>=solid_dim) && (d>=solid_dim)) //couples fluid dims and mesh dims
-                && !((c==solid_dim+dim) && (d==solid_dim+dim)))) //fluid pressure does not couple with itself
-             {
-               cell_coupling[c][d] = DoFTools::always;
-               cell_coupling[d][c] = DoFTools::always;
-             }//cell_coupling
-
-           if ((c<solid_dim) && (d>=solid_dim)) //couples solid dims with fluid and mesh dims on the interface
-             {
-               face_coupling[c][d] = DoFTools::always;
-               face_coupling[d][c] = DoFTools::always;
-             }//face_coupling
-         }//d
+        for (unsigned int d=0; d<fe_collection.n_components(); ++d)
+          {
+            if (((c<solid_dim) && (d<solid_dim)) //couples solid dims with solid dims
+                ||
+                (((c>=solid_dim) && (d>=solid_dim)) //couples fluid dims and mesh dims
+                 && !((c==solid_dim+dim) && (d==solid_dim+dim)))) //fluid pressure does not couple with itself
+              {
+                cell_coupling[c][d] = DoFTools::always;
+                cell_coupling[d][c] = DoFTools::always;
+              }//cell_coupling
+
+            if ((c<solid_dim) && (d>=solid_dim)) //couples solid dims with fluid and mesh dims on the interface
+              {
+                face_coupling[c][d] = DoFTools::always;
+                face_coupling[d][c] = DoFTools::always;
+              }//face_coupling
+          }//d
       }//c
     DoFTools::make_flux_sparsity_pattern (dh, csp, cell_coupling, face_coupling);
     block_sparsity_pattern.copy_from (csp);
   }
 
-                                  // build matrices and vectors
+  // build matrices and vectors
 
   BlockSparseMatrix<double> system_matrix(block_sparsity_pattern);
   BlockVector<double> system_rhs(dofs_per_block);
 
-                                  // set up constraints for solution and solution update
-                                  /**
-                                   * These constraints enforce that the solid displacement
-                                   * and mesh displacement are the same on the interface.
-                                   *
-                                   * They also constrain that the solid velocity
-                                   * and fluid velocity are the same on the interface
-                                   *
-                                   * The interface check is simplified for this 2x2 case
-                                   */
+  // set up constraints for solution and solution update
+  /**
+   * These constraints enforce that the solid displacement
+   * and mesh displacement are the same on the interface.
+   *
+   * They also constrain that the solid velocity
+   * and fluid velocity are the same on the interface
+   *
+   * The interface check is simplified for this 2x2 case
+   */
 
   ConstraintMatrix constraints;
 
@@ -230,88 +230,91 @@ int main ()
   std::vector<std::pair<unsigned int, unsigned int> > solid_mesh_pairs;
 
   for (hp::DoFHandler<dim>::active_cell_iterator
-        cell = dh.begin_active(); cell!=dh.end(); ++cell) //loops over the cells
+       cell = dh.begin_active(); cell!=dh.end(); ++cell) //loops over the cells
     {
       if (int(cell->material_id()) == 1)
-       {//Only loop over cells in the fluid region
-         for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
-           {
-             if (!cell->at_boundary(f))
-               {
-                 bool face_is_on_interface = false;
-                                                  //checks to see if cell face neighbor is in the solid domain
-                 if (int(cell->neighbor(f)->material_id()) == 0 )
-                   face_is_on_interface = true;
-
-                 if (face_is_on_interface)
-                   {
-                     std::vector<unsigned int> solid_disp_dof, solid_vel_dof, fluid_vel_dof, mesh_disp_dof;
-
-                     cell->face(f)->get_dof_indices (solid_face_dof_indices, 0);
-                     cell->face(f)->get_dof_indices (fl_msh_face_dof_indices, 1);
-
-                     for (unsigned int i=0; i<dofs_per_solid_face; ++i)
-                       {
-                         unsigned int comp = solid_fe->face_system_to_component_index(i).first;
-                         if (comp <dim)
-                           solid_disp_dof.push_back(i);
-                         if (comp >= dim && comp < solid_dim)
-                           solid_vel_dof.push_back(i);
-                       }//i
-                     for (unsigned int i=0; i<dofs_per_fl_msh_face; ++i)
-                       {
-                         unsigned int comp = fluid_fe->face_system_to_component_index(i).first;
-                         if (comp >= solid_dim && comp < solid_dim+dim)
-                           fluid_vel_dof.push_back(i);
-                         if (comp>=solid_dim+fluid_dim)
-                           mesh_disp_dof.push_back(i);
-                       }//i
-
-                     for (unsigned int i=0; i<solid_vel_dof.size(); ++i)
-                       {//in this example solid_vel_dof.size()==fluid_vel_dof.size()
-                         constraints.add_line  (fl_msh_face_dof_indices[fluid_vel_dof[i]]);
-                         constraints.add_entry (fl_msh_face_dof_indices[fluid_vel_dof[i]],
-                                                solid_face_dof_indices[solid_vel_dof[i]], 1.0);
-
-                         solid_fluid_pairs.push_back(std::pair<unsigned int,unsigned int>
-                                                     (solid_face_dof_indices[solid_vel_dof[i]],
-                                                      fl_msh_face_dof_indices[fluid_vel_dof[i]]));
-                       }//i
-                     for (unsigned int i=0; i<solid_disp_dof.size(); ++i)
-                       {
-                         constraints.add_line  (fl_msh_face_dof_indices[mesh_disp_dof[i]]);
-                         constraints.add_entry (fl_msh_face_dof_indices[mesh_disp_dof[i]],
-                                                solid_face_dof_indices[solid_disp_dof[i]], 1.0);
-
-                         solid_mesh_pairs.push_back(std::pair<unsigned int,unsigned int>
-                                                    (solid_face_dof_indices[solid_disp_dof[i]],
-                                                     fl_msh_face_dof_indices[mesh_disp_dof[i]]));
-                       }
-                   }//at interface check
-               }//not at boundary check
-           }//face
-       }//is this in the fluid material region?
+        {
+          //Only loop over cells in the fluid region
+          for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+            {
+              if (!cell->at_boundary(f))
+                {
+                  bool face_is_on_interface = false;
+                  //checks to see if cell face neighbor is in the solid domain
+                  if (int(cell->neighbor(f)->material_id()) == 0 )
+                    face_is_on_interface = true;
+
+                  if (face_is_on_interface)
+                    {
+                      std::vector<unsigned int> solid_disp_dof, solid_vel_dof, fluid_vel_dof, mesh_disp_dof;
+
+                      cell->face(f)->get_dof_indices (solid_face_dof_indices, 0);
+                      cell->face(f)->get_dof_indices (fl_msh_face_dof_indices, 1);
+
+                      for (unsigned int i=0; i<dofs_per_solid_face; ++i)
+                        {
+                          unsigned int comp = solid_fe->face_system_to_component_index(i).first;
+                          if (comp <dim)
+                            solid_disp_dof.push_back(i);
+                          if (comp >= dim && comp < solid_dim)
+                            solid_vel_dof.push_back(i);
+                        }//i
+                      for (unsigned int i=0; i<dofs_per_fl_msh_face; ++i)
+                        {
+                          unsigned int comp = fluid_fe->face_system_to_component_index(i).first;
+                          if (comp >= solid_dim && comp < solid_dim+dim)
+                            fluid_vel_dof.push_back(i);
+                          if (comp>=solid_dim+fluid_dim)
+                            mesh_disp_dof.push_back(i);
+                        }//i
+
+                      for (unsigned int i=0; i<solid_vel_dof.size(); ++i)
+                        {
+                          //in this example solid_vel_dof.size()==fluid_vel_dof.size()
+                          constraints.add_line  (fl_msh_face_dof_indices[fluid_vel_dof[i]]);
+                          constraints.add_entry (fl_msh_face_dof_indices[fluid_vel_dof[i]],
+                                                 solid_face_dof_indices[solid_vel_dof[i]], 1.0);
+
+                          solid_fluid_pairs.push_back(std::pair<unsigned int,unsigned int>
+                                                      (solid_face_dof_indices[solid_vel_dof[i]],
+                                                       fl_msh_face_dof_indices[fluid_vel_dof[i]]));
+                        }//i
+                      for (unsigned int i=0; i<solid_disp_dof.size(); ++i)
+                        {
+                          constraints.add_line  (fl_msh_face_dof_indices[mesh_disp_dof[i]]);
+                          constraints.add_entry (fl_msh_face_dof_indices[mesh_disp_dof[i]],
+                                                 solid_face_dof_indices[solid_disp_dof[i]], 1.0);
+
+                          solid_mesh_pairs.push_back(std::pair<unsigned int,unsigned int>
+                                                     (solid_face_dof_indices[solid_disp_dof[i]],
+                                                      fl_msh_face_dof_indices[mesh_disp_dof[i]]));
+                        }
+                    }//at interface check
+                }//not at boundary check
+            }//face
+        }//is this in the fluid material region?
     }//cell
 
   constraints.close();
 
-                                  // prints out which dofs are coupled
+  // prints out which dofs are coupled
   deallog<<"---------------Coupled dofs---------------"<<std::endl;
   for (unsigned int i=0; i<solid_fluid_pairs.size(); i++)
     {
       deallog<<"solid dof: "<< solid_fluid_pairs[i].first
-              <<", fluid dof: "<<solid_fluid_pairs[i].second<<std::endl;
+             <<", fluid dof: "<<solid_fluid_pairs[i].second<<std::endl;
     }
   for (unsigned int i=0; i<solid_fluid_pairs.size(); i++)
     {
       deallog<<"solid dof: "<<solid_mesh_pairs[i].first
-              <<", mesh dof: "<<solid_mesh_pairs[i].second<<std::endl;
+             <<", mesh dof: "<<solid_mesh_pairs[i].second<<std::endl;
     }
   deallog<<"------------------------------------------"<<std::endl;
 
 
-                                  //code crashes in the fluid assembly, mocked up below
-  {//fluid assembly
+  //code crashes in the fluid assembly, mocked up below
+  {
+    //fluid assembly
     const unsigned int dofs_per_cell   = fluid_fe->dofs_per_cell;
 
     FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
@@ -320,33 +323,33 @@ int main ()
     std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     for (hp::DoFHandler<dim>::active_cell_iterator
-          cell = dh.begin_active();
-        cell!=dh.end();
-        ++cell) //loops over the cells
+         cell = dh.begin_active();
+         cell!=dh.end();
+         ++cell) //loops over the cells
       {
-       if (int(cell->material_id()) == 1)//are we in the fluid region?
-         {
-           cell->get_dof_indices (local_dof_indices);
+        if (int(cell->material_id()) == 1)//are we in the fluid region?
+          {
+            cell->get_dof_indices (local_dof_indices);
 
-                                            // normally the governing equations would be added
-                                            // to the cell matrix and right hand side here
+            // normally the governing equations would be added
+            // to the cell matrix and right hand side here
 
-           deallog<<"I am about to distribute cell: "<<cell<<std::endl;
-           deallog<<"Cell: "<<cell<<" has it's center at "<<cell->center()<<std::endl;
+            deallog<<"I am about to distribute cell: "<<cell<<std::endl;
+            deallog<<"Cell: "<<cell<<" has it's center at "<<cell->center()<<std::endl;
 
-           constraints.distribute_local_to_global(
-             cell_matrix,
-             cell_rhs,
-             local_dof_indices,
-             system_matrix,
-             system_rhs);
+            constraints.distribute_local_to_global(
+              cell_matrix,
+              cell_rhs,
+              local_dof_indices,
+              system_matrix,
+              system_rhs);
 
-         }//is this in the fluid material region?
+          }//is this in the fluid material region?
 
       }//cell
 
   }//assemble fluid system
 
-   return 0;
+  return 0;
 }
 
index 0fee2d193982dc117b3c7c38c9a64b949f1ebeee..2448c5d923aec1a95d27f23627a3f54aaa647696 100644 (file)
@@ -52,10 +52,10 @@ void test ()
   GridGenerator::hyper_cube (tria);
   tria.refine_global(1);
 
-                               // refine some of the cells.
+  // refine some of the cells.
   typename Triangulation<dim>::active_cell_iterator
-    cell = tria.begin_active(),
-    endc = tria.end();
+  cell = tria.begin_active(),
+  endc = tria.end();
   for (unsigned int counter = 0; cell!=endc; ++cell, ++counter)
     if (counter % 5 == 0)
       cell->set_refine_flag();
@@ -80,56 +80,56 @@ void test ()
   {
     std::map<types::global_dof_index,double> boundary_values;
     VectorTools::interpolate_boundary_values (dof,
-                                             0,
-                                             ConstantFunction<dim>(1.),
-                                             boundary_values);
-    std::map<types::global_dof_index,double>::const_iterator boundary_value = 
+                                              0,
+                                              ConstantFunction<dim>(1.),
+                                              boundary_values);
+    std::map<types::global_dof_index,double>::const_iterator boundary_value =
       boundary_values.begin();
     for ( ; boundary_value !=boundary_values.end(); ++boundary_value)
       {
-       if (!correct_constraints.is_constrained(boundary_value->first))
-         {
-           correct_constraints.add_line(boundary_value->first);
-           correct_constraints.set_inhomogeneity (boundary_value->first,
-                                                  boundary_value->second);
-         }
+        if (!correct_constraints.is_constrained(boundary_value->first))
+          {
+            correct_constraints.add_line(boundary_value->first);
+            correct_constraints.set_inhomogeneity (boundary_value->first,
+                                                   boundary_value->second);
+          }
       }
   }
   correct_constraints.close();
 
   deallog << "Number of DoFs: " << dof.n_dofs() << std::endl
-         << "Number of hanging nodes: "
-         << library_constraints.n_constraints() << std::endl
-         << "Total number of constraints: "
-         << correct_constraints.n_constraints() << std::endl;
+          << "Number of hanging nodes: "
+          << library_constraints.n_constraints() << std::endl
+          << "Total number of constraints: "
+          << correct_constraints.n_constraints() << std::endl;
 
   VectorTools::interpolate_boundary_values (dof, 0, ConstantFunction<dim>(1.),
-                                           library_constraints);
+                                            library_constraints);
   library_constraints.close();
 
-                               // the two constraint matrices should look the
-                               // same, so go through them and check
+  // the two constraint matrices should look the
+  // same, so go through them and check
   deallog << "Check that both constraint matrices are identical... ";
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
     {
       Assert (correct_constraints.is_constrained(i) ==
-             library_constraints.is_constrained(i), ExcInternalError());
-      typedef const std::vector<std::pair<types::global_dof_index, double> >constraint_format;
+              library_constraints.is_constrained(i), ExcInternalError());
+      typedef const std::vector<std::pair<types::global_dof_index, double> > &constraint_format;
       if (correct_constraints.is_constrained(i))
-       {
-         constraint_format correct = *correct_constraints.get_constraint_entries(i);
-         constraint_format library = *library_constraints.get_constraint_entries(i);
-         Assert (correct.size() == library.size(), ExcInternalError());
-         for (unsigned int q=0; q<correct.size(); ++q)
-           {
-             Assert (correct[q].first == library[q].first, ExcInternalError());
-             Assert (std::fabs(correct[q].second-library[q].second) < 1e-14,
-                     ExcInternalError());
-           }
-         Assert (std::fabs(correct_constraints.get_inhomogeneity(i)-
-                           library_constraints.get_inhomogeneity(i))<1e-14,
-                 ExcInternalError());
-       }
+        {
+          constraint_format correct = *correct_constraints.get_constraint_entries(i);
+          constraint_format library = *library_constraints.get_constraint_entries(i);
+          Assert (correct.size() == library.size(), ExcInternalError());
+          for (unsigned int q=0; q<correct.size(); ++q)
+            {
+              Assert (correct[q].first == library[q].first, ExcInternalError());
+              Assert (std::fabs(correct[q].second-library[q].second) < 1e-14,
+                      ExcInternalError());
+            }
+          Assert (std::fabs(correct_constraints.get_inhomogeneity(i)-
+                            library_constraints.get_inhomogeneity(i))<1e-14,
+                  ExcInternalError());
+        }
     }
   deallog << "OK." << std::endl;
 }
index b8ce5c75d1b8a76a5062362afad626889a7a9a07..186824e692ddb6162b3d61cf20e1d4feff2a10f9 100644 (file)
@@ -61,7 +61,7 @@ void test ()
   ConstraintMatrix constraints;
   DoFTools::make_hanging_node_constraints (dof, constraints);
   VectorTools::interpolate_boundary_values (dof, 1, ZeroFunction<dim>(),
-                                           constraints);
+                                            constraints);
   constraints.close();
 
   SparsityPattern sparsity;
@@ -76,41 +76,41 @@ void test ()
   FullMatrix<double> local_mat (fe.dofs_per_cell, fe.dofs_per_cell);
   std::vector<types::global_dof_index> local_dof_indices (fe.dofs_per_cell);
 
-                               // loop over cells, fill local matrix with
-                               // random values, insert both into sparse and
-                               // full matrix. Make some random entries equal
-                               // to zero
+  // loop over cells, fill local matrix with
+  // random values, insert both into sparse and
+  // full matrix. Make some random entries equal
+  // to zero
   typename DoFHandler<dim>::active_cell_iterator
-    cell = dof.begin_active(), endc = dof.end();
+  cell = dof.begin_active(), endc = dof.end();
   unsigned int counter = 0;
   for ( ; cell != endc; ++cell)
     {
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe.dofs_per_cell; ++j, ++counter)
-         if (counter % 42 == 0)
-           local_mat(i,j) = 0;
-         else
-           local_mat (i,j) = (double)rand() / RAND_MAX;
+        for (unsigned int j=0; j<fe.dofs_per_cell; ++j, ++counter)
+          if (counter % 42 == 0)
+            local_mat(i,j) = 0;
+          else
+            local_mat (i,j) = (double)rand() / RAND_MAX;
       cell->get_dof_indices (local_dof_indices);
       constraints.distribute_local_to_global (local_mat, local_dof_indices,
-                                             sparse);
+                                              sparse);
       constraints.distribute_local_to_global (local_mat, local_dof_indices,
-                                             full);
+                                              full);
     }
 
-                               // now check that the entries are indeed the
-                               // same by copying the sparse matrix into a
-                               // full matrix and checking the Frobenius norm
-                               // of the difference matrix
+  // now check that the entries are indeed the
+  // same by copying the sparse matrix into a
+  // full matrix and checking the Frobenius norm
+  // of the difference matrix
   FullMatrix<double> ref;
   ref.copy_from (sparse);
   full.add (-1., ref);
   deallog << "Difference between full and sparse matrix: "
-         << full.frobenius_norm() << std::endl;
+          << full.frobenius_norm() << std::endl;
 }
 
 
-int main () 
+int main ()
 {
   deallog << std::setprecision (2);
   logfile << std::setprecision (2);
index 7d7a5e01f12865d2aa262200858f970e7e24d428..4326c3d393f79f8bd93f89fb48507f5c7a6b22c7 100644 (file)
@@ -63,7 +63,7 @@ void test (unsigned int chunk_size)
   ConstraintMatrix constraints;
   DoFTools::make_hanging_node_constraints (dof, constraints);
   VectorTools::interpolate_boundary_values (dof, 1, ZeroFunction<dim>(),
-                                           constraints);
+                                            constraints);
   constraints.close();
 
   SparsityPattern sparsity;
@@ -80,41 +80,41 @@ void test (unsigned int chunk_size)
   FullMatrix<double> local_mat (fe.dofs_per_cell, fe.dofs_per_cell);
   std::vector<types::global_dof_index> local_dof_indices (fe.dofs_per_cell);
 
-                               // loop over cells, fill local matrix with
-                               // random values, insert both into sparse and
-                               // full matrix. Make some random entries equal
-                               // to zero
+  // loop over cells, fill local matrix with
+  // random values, insert both into sparse and
+  // full matrix. Make some random entries equal
+  // to zero
   typename DoFHandler<dim>::active_cell_iterator
-    cell = dof.begin_active(), endc = dof.end();
+  cell = dof.begin_active(), endc = dof.end();
   unsigned int counter = 0;
   for ( ; cell != endc; ++cell)
     {
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe.dofs_per_cell; ++j, ++counter)
-         if (counter % 42 == 0)
-           local_mat(i,j) = 0;
-         else
-           local_mat (i,j) = (double)rand() / RAND_MAX;
+        for (unsigned int j=0; j<fe.dofs_per_cell; ++j, ++counter)
+          if (counter % 42 == 0)
+            local_mat(i,j) = 0;
+          else
+            local_mat (i,j) = (double)rand() / RAND_MAX;
       cell->get_dof_indices (local_dof_indices);
       constraints.distribute_local_to_global (local_mat, local_dof_indices,
-                                             sparse);
+                                              sparse);
       constraints.distribute_local_to_global (local_mat, local_dof_indices,
-                                             chunk_sparse);
+                                              chunk_sparse);
     }
 
-                               // now check that the entries are indeed the
-                               // same
+  // now check that the entries are indeed the
+  // same
   double frobenius = 0.;
   for (unsigned int i=0; i<sparse.m(); ++i)
     for (unsigned int j=0; j<sparse.n(); ++j)
       frobenius += numbers::NumberTraits<double>::abs_square(sparse.el(i,j) -
                                                              chunk_sparse.el(i,j));
   deallog << "Difference between chunk and sparse matrix: "
-         << std::sqrt(frobenius) << std::endl;
+          << std::sqrt(frobenius) << std::endl;
 }
 
 
-int main () 
+int main ()
 {
   deallog << std::setprecision (2);
   logfile << std::setprecision (2);
index 76bd4903b7416f8869802526b7bba1bd8aea7687..00dcc5fbcda3ac827dda24c61580d8444578fa34 100644 (file)
@@ -33,46 +33,46 @@ void merge_check ()
 {
   deallog << "Checking ConstraintMatrix::merge" << std::endl;
 
-                                  // check twice, once with closed
-                                  // objects, once with open ones
+  // check twice, once with closed
+  // objects, once with open ones
   for (unsigned int run=0; run<2; ++run)
     {
       deallog << "Checking with " << (run == 0 ? "open" : "closed")
-             << " objects" << std::endl;
-      
-                                      // check that the `merge' function
-                                      // works correctly
+              << " objects" << std::endl;
+
+      // check that the `merge' function
+      // works correctly
       ConstraintMatrix c1, c2;
 
-                                      // enter simple line
+      // enter simple line
       c1.add_line (0);
       c1.add_entry (0, 11, 1.);
-                                      // add more complex line
+      // add more complex line
       c1.add_line (1);
       c1.add_entry (1, 3, 0.5);
       c1.add_entry (1, 4, 0.5);
-  
-                                      // fill second constraints
-                                      // object with one trivial line
-                                      // and one which further
-                                      // constrains one of the
-                                      // entries in the first object
+
+      // fill second constraints
+      // object with one trivial line
+      // and one which further
+      // constrains one of the
+      // entries in the first object
       c2.add_line (10);
       c2.add_entry (10, 11, 1.);
       c2.add_line (3);
       c2.add_entry (3, 12, 0.25);
       c2.add_entry (3, 13, 0.75);
 
-                                      // in one of the two runs,
-                                      // close the objects
+      // in one of the two runs,
+      // close the objects
       if (run == 1)
-       {
-         c1.close ();
-         c2.close ();
-       };
+        {
+          c1.close ();
+          c2.close ();
+        };
 
-                                      // now merge the two and print the
-                                      // results
+      // now merge the two and print the
+      // results
       c1.merge (c2);
       c1.print (logfile);
     };
index 8e7d75483b9013c8b1b33558a163746b2f437304..e302be9040c956f62965d09c2a2825582d8c8a32 100644 (file)
@@ -34,52 +34,52 @@ void merge_check ()
 {
   deallog << "Checking ConstraintMatrix::merge" << std::endl;
 
-                                  // check twice, once with closed
-                                  // objects, once with open ones
+  // check twice, once with closed
+  // objects, once with open ones
   for (unsigned int run=0; run<2; ++run)
     {
       deallog << "Checking with " << (run == 0 ? "open" : "closed")
-             << " objects" << std::endl;
-      
-                                      // check that the `merge' function
-                                      // works correctly
+              << " objects" << std::endl;
+
+      // check that the `merge' function
+      // works correctly
       ConstraintMatrix c1, c2;
 
-                                      // enter simple line
+      // enter simple line
       c1.add_line (0);
       c1.add_entry (0, 11, 1.);
       c1.set_inhomogeneity (0, 42);
-      
-                                      // add more complex line
+
+      // add more complex line
       c1.add_line (1);
       c1.add_entry (1, 3, 0.5);
       c1.add_entry (1, 4, 0.5);
       c1.set_inhomogeneity (1, 100);
-  
-                                      // fill second constraints
-                                      // object with one trivial line
-                                      // and one which further
-                                      // constrains one of the
-                                      // entries in the first object
+
+      // fill second constraints
+      // object with one trivial line
+      // and one which further
+      // constrains one of the
+      // entries in the first object
       c2.add_line (10);
       c2.add_entry (10, 11, 1.);
       c2.set_inhomogeneity (10, 142);
-      
+
       c2.add_line (3);
       c2.add_entry (3, 12, 0.25);
       c2.add_entry (3, 13, 0.75);
       c2.set_inhomogeneity (3, 242);
 
-                                      // in one of the two runs,
-                                      // close the objects
+      // in one of the two runs,
+      // close the objects
       if (run == 1)
-       {
-         c1.close ();
-         c2.close ();
-       };
+        {
+          c1.close ();
+          c2.close ();
+        };
 
-                                      // now merge the two and print the
-                                      // results
+      // now merge the two and print the
+      // results
       c1.merge (c2);
       c1.print (logfile);
     };
index 68ee5ec87d21e39c1f5c538abf3653b6150b93c0..764c390195efba5fe390cbeb79fbfdd8ced3f29f 100644 (file)
@@ -34,46 +34,46 @@ void merge_check ()
 {
   deallog << "Checking ConstraintMatrix::merge" << std::endl;
 
-                                  // check twice, once with closed
-                                  // objects, once with open ones
+  // check twice, once with closed
+  // objects, once with open ones
   for (unsigned int run=0; run<2; ++run)
     {
       deallog << "Checking with " << (run == 0 ? "open" : "closed")
-             << " objects" << std::endl;
-      
-                                      // check that the `merge' function
-                                      // works correctly
+              << " objects" << std::endl;
+
+      // check that the `merge' function
+      // works correctly
       ConstraintMatrix c1, c2;
 
-                                      // enter simple line
+      // enter simple line
       c1.add_line (0);
       c1.add_entry (0, 11, 1.);
       c1.set_inhomogeneity (0, 42);
-      
-                                      // fill second constraints
-                                      // object that has a conflict
+
+      // fill second constraints
+      // object that has a conflict
       c2.add_line (0);
       c2.add_entry (0, 13, 2.);
       c2.set_inhomogeneity (0, 142);
-                                      // in one of the two runs,
-                                      // close the objects
+      // in one of the two runs,
+      // close the objects
       if (run == 1)
-       {
-         c1.close ();
-         c2.close ();
-       };
+        {
+          c1.close ();
+          c2.close ();
+        };
 
-                                      // now merge the two and print the
-                                      // results
+      // now merge the two and print the
+      // results
       try
-       {
-         c1.merge (c2, ConstraintMatrix::no_conflicts_allowed);
-       }
+        {
+          c1.merge (c2, ConstraintMatrix::no_conflicts_allowed);
+        }
       catch (...)
-       {
-         deallog << "OK" << std::endl;
-       }
-      
+        {
+          deallog << "OK" << std::endl;
+        }
+
       c1.print (logfile);
     }
 }
index 0ce5cf3f07ab089c577675b79fe435d8173eca59..4a219b6d883d00965e00bf4f4df0a31f958310bf 100644 (file)
@@ -34,46 +34,46 @@ void merge_check ()
 {
   deallog << "Checking ConstraintMatrix::merge" << std::endl;
 
-                                  // check twice, once with closed
-                                  // objects, once with open ones
+  // check twice, once with closed
+  // objects, once with open ones
   for (unsigned int run=0; run<2; ++run)
     {
       deallog << "Checking with " << (run == 0 ? "open" : "closed")
-             << " objects" << std::endl;
-      
-                                      // check that the `merge' function
-                                      // works correctly
+              << " objects" << std::endl;
+
+      // check that the `merge' function
+      // works correctly
       ConstraintMatrix c1, c2;
 
-                                      // enter simple line
+      // enter simple line
       c1.add_line (0);
       c1.add_entry (0, 11, 1.);
       c1.set_inhomogeneity (0, 42);
-      
-                                      // fill second constraints
-                                      // object that has a conflict
+
+      // fill second constraints
+      // object that has a conflict
       c2.add_line (0);
       c2.add_entry (0, 13, 2.);
       c2.set_inhomogeneity (0, 142);
-                                      // in one of the two runs,
-                                      // close the objects
+      // in one of the two runs,
+      // close the objects
       if (run == 1)
-       {
-         c1.close ();
-         c2.close ();
-       };
+        {
+          c1.close ();
+          c2.close ();
+        };
 
-                                      // now merge the two and print the
-                                      // results
+      // now merge the two and print the
+      // results
       try
-       {
-         c1.merge (c2, ConstraintMatrix::left_object_wins);
-       }
+        {
+          c1.merge (c2, ConstraintMatrix::left_object_wins);
+        }
       catch (...)
-       {
-         Assert (false, ExcInternalError());
-       }
-      
+        {
+          Assert (false, ExcInternalError());
+        }
+
       c1.print (logfile);
     }
 }
index 12d423d998481247b9ffb02e9289b1fb2a3461cd..393e785fd196736ed8ec303f6ba0b6cf64cfb616 100644 (file)
@@ -34,46 +34,46 @@ void merge_check ()
 {
   deallog << "Checking ConstraintMatrix::merge" << std::endl;
 
-                                  // check twice, once with closed
-                                  // objects, once with open ones
+  // check twice, once with closed
+  // objects, once with open ones
   for (unsigned int run=0; run<2; ++run)
     {
       deallog << "Checking with " << (run == 0 ? "open" : "closed")
-             << " objects" << std::endl;
-      
-                                      // check that the `merge' function
-                                      // works correctly
+              << " objects" << std::endl;
+
+      // check that the `merge' function
+      // works correctly
       ConstraintMatrix c1, c2;
 
-                                      // enter simple line
+      // enter simple line
       c1.add_line (0);
       c1.add_entry (0, 11, 1.);
       c1.set_inhomogeneity (0, 42);
-      
-                                      // fill second constraints
-                                      // object that has a conflict
+
+      // fill second constraints
+      // object that has a conflict
       c2.add_line (0);
       c2.add_entry (0, 13, 2.);
       c2.set_inhomogeneity (0, 142);
-                                      // in one of the two runs,
-                                      // close the objects
+      // in one of the two runs,
+      // close the objects
       if (run == 1)
-       {
-         c1.close ();
-         c2.close ();
-       };
+        {
+          c1.close ();
+          c2.close ();
+        };
 
-                                      // now merge the two and print the
-                                      // results
+      // now merge the two and print the
+      // results
       try
-       {
-         c1.merge (c2, ConstraintMatrix::right_object_wins);
-       }
+        {
+          c1.merge (c2, ConstraintMatrix::right_object_wins);
+        }
       catch (...)
-       {
-         Assert (false, ExcInternalError());
-       }
-      
+        {
+          Assert (false, ExcInternalError());
+        }
+
       c1.print (logfile);
     }
 }
index 5cb1d8902fb1c8ec9b676ea324d1d2eacaa3c8d4..bfd014192b992eb35a70fd0211925e22a0d6dae7 100644 (file)
@@ -36,18 +36,18 @@ void merge_check ()
 {
   deallog << "Checking ConstraintMatrix::merge" << std::endl;
 
-                                  // check twice, once with closed
-                                  // objects, once with open ones
+  // check twice, once with closed
+  // objects, once with open ones
   for (unsigned int run=0; run<2; ++run)
     {
       deallog << "Checking with " << (run == 0 ? "open" : "closed")
-             << " objects" << std::endl;
-      
-                                      // check that the `merge' function
-                                      // works correctly
+              << " objects" << std::endl;
+
+      // check that the `merge' function
+      // works correctly
       ConstraintMatrix c1, c2;
 
-                                      // enter simple line
+      // enter simple line
       c1.add_line (0);
       c1.add_entry (0, 11, 1.);
       c1.set_inhomogeneity (0, 42);
@@ -55,31 +55,31 @@ void merge_check ()
       c1.add_line (13);
       c1.add_entry (13, 2, 0.5);
       c1.set_inhomogeneity (13, 2);
-      
-                                      // fill second constraints
-                                      // object that has a conflict
+
+      // fill second constraints
+      // object that has a conflict
       c2.add_line (0);
       c2.add_entry (0, 13, 2.);
       c2.set_inhomogeneity (0, 142);
-                                      // in one of the two runs,
-                                      // close the objects
+      // in one of the two runs,
+      // close the objects
       if (run == 1)
-       {
-         c1.close ();
-         c2.close ();
-       };
+        {
+          c1.close ();
+          c2.close ();
+        };
 
-                                      // now merge the two and print the
-                                      // results
+      // now merge the two and print the
+      // results
       try
-       {
-         c1.merge (c2, ConstraintMatrix::right_object_wins);
-       }
+        {
+          c1.merge (c2, ConstraintMatrix::right_object_wins);
+        }
       catch (...)
-       {
-         Assert (false, ExcInternalError());
-       }
-      
+        {
+          Assert (false, ExcInternalError());
+        }
+
       c1.print (logfile);
     }
 }
index f82530e51c4627e889901e1cde18622278c83a71..4d228f745cb404c940f975160c8f4bb8b5d2346b 100644 (file)
@@ -37,18 +37,18 @@ void merge_check ()
 {
   deallog << "Checking ConstraintMatrix::merge" << std::endl;
 
-                                  // check twice, once with closed
-                                  // objects, once with open ones
+  // check twice, once with closed
+  // objects, once with open ones
   for (unsigned int run=0; run<2; ++run)
     {
       deallog << "Checking with " << (run == 0 ? "open" : "closed")
-             << " objects" << std::endl;
-      
-                                      // check that the `merge' function
-                                      // works correctly
+              << " objects" << std::endl;
+
+      // check that the `merge' function
+      // works correctly
       ConstraintMatrix c1, c2;
 
-                                      // enter simple line
+      // enter simple line
       c1.add_line (0);
       c1.add_entry (0, 11, 1.);
       c1.set_inhomogeneity (0, 42);
@@ -60,31 +60,31 @@ void merge_check ()
       c1.add_line (2);
       c1.add_entry (2, 0, 0.25);
       c1.set_inhomogeneity (2, 22);
-      
-                                      // fill second constraints
-                                      // object that has a conflict
+
+      // fill second constraints
+      // object that has a conflict
       c2.add_line (0);
       c2.add_entry (0, 13, 2.);
       c2.set_inhomogeneity (0, 142);
-                                      // in one of the two runs,
-                                      // close the objects
+      // in one of the two runs,
+      // close the objects
       if (run == 1)
-       {
-         c1.close ();
-         c2.close ();
-       };
+        {
+          c1.close ();
+          c2.close ();
+        };
 
-                                      // now merge the two and print the
-                                      // results
+      // now merge the two and print the
+      // results
       try
-       {
-         c1.merge (c2, ConstraintMatrix::right_object_wins);
-       }
+        {
+          c1.merge (c2, ConstraintMatrix::right_object_wins);
+        }
       catch (...)
-       {
-         Assert (false, ExcInternalError());
-       }
-      
+        {
+          Assert (false, ExcInternalError());
+        }
+
       c1.print (logfile);
     }
 }
index 7befc081fd984b18a506b4675618f745c26743fb..9489efcf71e598664b938face3137641b8e05b10 100644 (file)
@@ -35,17 +35,17 @@ void merge_check ()
 {
   deallog << "Checking ConstraintMatrix::merge with localized lines" << std::endl;
 
-                               // set local lines to a very large range that
-                               // surely triggers an error if the
-                               // implementation is wrong
+  // set local lines to a very large range that
+  // surely triggers an error if the
+  // implementation is wrong
   IndexSet local_lines (100000000);
   local_lines.add_range (99999890, 99999900);
   local_lines.add_range (99999990,100000000);
   local_lines.compress();
 
-                               // the test is the same as
-                               // constraints_merge_02, but we add very large
-                               // indices here
+  // the test is the same as
+  // constraints_merge_02, but we add very large
+  // indices here
   const unsigned int index_0  = local_lines.nth_index_in_set(0);
   const unsigned int index_1  = local_lines.nth_index_in_set(1);
   const unsigned int index_3  = local_lines.nth_index_in_set(3);
@@ -56,35 +56,35 @@ void merge_check ()
   const unsigned int index_13 = local_lines.nth_index_in_set(13);
 
   deallog << "Number of local lines: "
-         << local_lines.n_elements() << std::endl;
+          << local_lines.n_elements() << std::endl;
 
-                                  // check twice, once with closed
-                                  // objects, once with open ones
+  // check twice, once with closed
+  // objects, once with open ones
   for (unsigned int run=0; run<2; ++run)
     {
       deallog << "Checking with " << (run == 0 ? "open" : "closed")
-             << " objects" << std::endl;
+              << " objects" << std::endl;
 
-                                      // check that the `merge' function
-                                      // works correctly
+      // check that the `merge' function
+      // works correctly
       ConstraintMatrix c1 (local_lines), c2 (local_lines);
 
-                                      // enter simple line
+      // enter simple line
       c1.add_line          (index_0);
       c1.add_entry         (index_0, index_11, 1.);
       c1.set_inhomogeneity (index_0, 42);
 
-                                      // add more complex line
+      // add more complex line
       c1.add_line          (index_1);
       c1.add_entry         (index_1, index_3,  0.5);
       c1.add_entry         (index_1, index_4,  0.5);
       c1.set_inhomogeneity (index_1, 100);
 
-                                      // fill second constraints
-                                      // object with one trivial line
-                                      // and one which further
-                                      // constrains one of the
-                                      // entries in the first object
+      // fill second constraints
+      // object with one trivial line
+      // and one which further
+      // constrains one of the
+      // entries in the first object
       c2.add_line          (index_10);
       c2.add_entry         (index_10, index_11, 1.);
       c2.set_inhomogeneity (index_10, 142);
@@ -94,16 +94,16 @@ void merge_check ()
       c2.add_entry         (index_3, index_13, 0.75);
       c2.set_inhomogeneity (index_3, 242);
 
-                                      // in one of the two runs,
-                                      // close the objects
+      // in one of the two runs,
+      // close the objects
       if (run == 1)
-       {
-         c1.close ();
-         c2.close ();
-       };
+        {
+          c1.close ();
+          c2.close ();
+        };
 
-                                      // now merge the two and print the
-                                      // results
+      // now merge the two and print the
+      // results
       c1.merge (c2);
       c1.print (logfile);
     };
index f656ec6e2f9f4de9dcfc2c2eb1d0078b24a761cc..1b61bd7b375ba782db38607e55a0721c4350522d 100644 (file)
@@ -37,37 +37,37 @@ void merge_check ()
 {
   deallog << "Checking ConstraintMatrix::merge with localized lines" << std::endl;
 
-                               // set local lines to a very large range that
-                               // surely triggers an error if the
-                               // implementation is wrong
+  // set local lines to a very large range that
+  // surely triggers an error if the
+  // implementation is wrong
   IndexSet local_lines (100000000);
   local_lines.add_range (99999890, 99999900);
   local_lines.add_range (99999990,100000000);
   local_lines.compress();
 
-                               // the test is the same as
-                               // constraints_merge_02, but we add very large
-                               // indices here
+  // the test is the same as
+  // constraints_merge_02, but we add very large
+  // indices here
   const unsigned int index_0  = local_lines.nth_index_in_set(0);
   const unsigned int index_2  = local_lines.nth_index_in_set(2);
   const unsigned int index_11 = local_lines.nth_index_in_set(11);
   const unsigned int index_13 = local_lines.nth_index_in_set(13);
 
   deallog << "Number of local lines: "
-         << local_lines.n_elements() << std::endl;
+          << local_lines.n_elements() << std::endl;
 
-                                  // check twice, once with closed
-                                  // objects, once with open ones
+  // check twice, once with closed
+  // objects, once with open ones
   for (unsigned int run=0; run<2; ++run)
     {
       deallog << "Checking with " << (run == 0 ? "open" : "closed")
-             << " objects" << std::endl;
+              << " objects" << std::endl;
 
-                                      // check that the `merge' function
-                                      // works correctly
+      // check that the `merge' function
+      // works correctly
       ConstraintMatrix c1 (local_lines), c2 (local_lines);
 
-                                      // enter simple line
+      // enter simple line
       c1.add_line          (index_0);
       c1.add_entry         (index_0, index_11, 1.);
       c1.set_inhomogeneity (index_0, 42);
@@ -76,29 +76,29 @@ void merge_check ()
       c1.add_entry         (index_13, index_2, 0.5);
       c1.set_inhomogeneity (index_13, 2);
 
-                                      // fill second constraints
-                                      // object that has a conflict
+      // fill second constraints
+      // object that has a conflict
       c2.add_line          (index_0);
       c2.add_entry         (index_0, index_13, 2.);
       c2.set_inhomogeneity (index_0, 142);
-                                      // in one of the two runs,
-                                      // close the objects
+      // in one of the two runs,
+      // close the objects
       if (run == 1)
-       {
-         c1.close ();
-         c2.close ();
-       };
+        {
+          c1.close ();
+          c2.close ();
+        };
 
-                                      // now merge the two and print the
-                                      // results
+      // now merge the two and print the
+      // results
       try
-       {
-         c1.merge (c2, ConstraintMatrix::right_object_wins);
-       }
+        {
+          c1.merge (c2, ConstraintMatrix::right_object_wins);
+        }
       catch (...)
-       {
-         Assert (false, ExcInternalError());
-       }
+        {
+          Assert (false, ExcInternalError());
+        }
 
       c1.print (logfile);
     }
index 1a0e8a3b7f17079cbe74997234eb1ad953eb7355..3e9da66b3ace959b2817565804ee11b1dfe6a7b5 100644 (file)
@@ -56,7 +56,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -67,22 +67,22 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FE_Q<dim> element(2);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   DoFTools::make_sparsity_pattern (dof, sparsity);
   ConstraintMatrix constraints;
@@ -90,30 +90,30 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
 
   Functions::ExpFunction<dim> rhs_function;
-  
+
   Vector<double> rhs (dof.n_dofs());
-  
+
   MatrixTools::
-    create_laplace_matrix (mapping, dof,
-                       quadrature, matrix,
-                       rhs_function, rhs);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_laplace_matrix (mapping, dof,
+                         quadrature, matrix,
+                         rhs_function, rhs);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 
   deallog << "RHS vector: " << std::endl;
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
@@ -126,7 +126,7 @@ int main ()
 {
   std::ofstream logfile ("create_laplace_matrix_01/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 13345fd61d15806dd45e8e1e73824000298b94d1..5710de825ca39e5e226abac7a577cf9170342038 100644 (file)
@@ -57,7 +57,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -68,22 +68,22 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FE_Q<dim> element(2);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   DoFTools::make_sparsity_pattern (dof, sparsity);
   ConstraintMatrix constraints;
@@ -91,25 +91,25 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
-  
+
   MatrixTools::
-    create_laplace_matrix (mapping, dof,
-                       quadrature, matrix);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_laplace_matrix (mapping, dof,
+                         quadrature, matrix);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 }
 
 
@@ -118,7 +118,7 @@ int main ()
 {
   std::ofstream logfile ("create_laplace_matrix_01b/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index b8ba34609191702facf3824d132f86f406e1891b..95f62a231f534cc250fbc765b663950901034fb9 100644 (file)
@@ -55,7 +55,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -66,23 +66,23 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FESystem<dim> element(FE_Q<dim>(1), 1,
-                       FE_Q<dim>(2), 1);
+                        FE_Q<dim>(2), 1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   std::vector<std::vector<bool> > mask (2, std::vector<bool>(2, false));
   mask[0][0] = mask[1][1] = true;
@@ -92,30 +92,30 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
 
   Functions::ExpFunction<dim> rhs_function;
-  
+
   Vector<double> rhs (dof.n_dofs());
-  
+
   MatrixTools::
-    create_laplace_matrix (mapping, dof,
-                       quadrature, matrix,
-                       rhs_function, rhs);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_laplace_matrix (mapping, dof,
+                         quadrature, matrix,
+                         rhs_function, rhs);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 
   deallog << "RHS vector: " << std::endl;
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
@@ -128,7 +128,7 @@ int main ()
 {
   std::ofstream logfile ("create_laplace_matrix_02/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 964e38ade4bb8ff523be929705d761d16407bbb6..cabe84d96d7d60c4ed06f4dcfc9195b1b79705bf 100644 (file)
@@ -56,7 +56,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -67,23 +67,23 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FESystem<dim> element(FE_Q<dim>(1), 1,
-                       FE_Q<dim>(2), 1);
+                        FE_Q<dim>(2), 1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   std::vector<std::vector<bool> > mask (2, std::vector<bool>(2, false));
   mask[0][0] = mask[1][1] = true;
@@ -93,25 +93,25 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
 
   MatrixTools::
-    create_laplace_matrix (mapping, dof,
-                       quadrature, matrix);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_laplace_matrix (mapping, dof,
+                         quadrature, matrix);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 }
 
 
@@ -120,7 +120,7 @@ int main ()
 {
   std::ofstream logfile ("create_laplace_matrix_02b/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 6250a4207ce181dd4c2697727679e59feeb7eff4..398a304fbddf5684917147b56b5719a5e7bad937 100644 (file)
@@ -55,7 +55,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -66,22 +66,22 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FE_Q<dim> element(2);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   DoFTools::make_sparsity_pattern (dof, sparsity);
   ConstraintMatrix constraints;
@@ -89,31 +89,31 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
 
   Functions::ExpFunction<dim> rhs_function;
-  
+
   Vector<double> rhs (dof.n_dofs());
-  
+
   MatrixTools::
-    create_laplace_matrix (mapping, dof,
-                       quadrature, matrix,
-                       rhs_function, rhs,
-                       &rhs_function);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_laplace_matrix (mapping, dof,
+                         quadrature, matrix,
+                         rhs_function, rhs,
+                         &rhs_function);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 
   deallog << "RHS vector: " << std::endl;
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
@@ -126,7 +126,7 @@ int main ()
 {
   std::ofstream logfile ("create_laplace_matrix_03/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 6ce50419bbc7f1b1478ae4823159e64d51695e55..0d3d24059226a982e4a6108eaa4f069f153f26a4 100644 (file)
@@ -56,7 +56,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -67,22 +67,22 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FE_Q<dim> element(2);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   DoFTools::make_sparsity_pattern (dof, sparsity);
   ConstraintMatrix constraints;
@@ -90,28 +90,28 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
 
   Functions::ExpFunction<dim> coefficient;
-  
+
   MatrixTools::
-    create_laplace_matrix (mapping, dof,
-                       quadrature, matrix,
-                       &coefficient);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_laplace_matrix (mapping, dof,
+                         quadrature, matrix,
+                         &coefficient);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 }
 
 
@@ -120,7 +120,7 @@ int main ()
 {
   std::ofstream logfile ("create_laplace_matrix_03b/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 692c864e4a0d42f34c7435a98407cd6f233eb208..2ca33b7f41737c156b701feede953ec513db3c40 100644 (file)
@@ -54,7 +54,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -65,23 +65,23 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FESystem<dim> element(FE_Q<dim>(1), 1,
-                       FE_Q<dim>(2), 1);
+                        FE_Q<dim>(2), 1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   std::vector<std::vector<bool> > mask (2, std::vector<bool>(2, false));
   mask[0][0] = mask[1][1] = true;
@@ -91,31 +91,31 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
 
   Functions::ExpFunction<dim> rhs_function;
-  
+
   Vector<double> rhs (dof.n_dofs());
-  
+
   MatrixTools::
-    create_laplace_matrix (mapping, dof,
-                       quadrature, matrix,
-                       rhs_function, rhs,
-                       &rhs_function);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_laplace_matrix (mapping, dof,
+                         quadrature, matrix,
+                         rhs_function, rhs,
+                         &rhs_function);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 
   deallog << "RHS vector: " << std::endl;
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
@@ -128,7 +128,7 @@ int main ()
 {
   std::ofstream logfile ("create_laplace_matrix_04/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index b4923b501ca28e73166090fc2e265869c4acf175..24b7c0fbc2fc54051efb27472f574553ee7782c6 100644 (file)
@@ -55,7 +55,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -66,23 +66,23 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FESystem<dim> element(FE_Q<dim>(1), 1,
-                       FE_Q<dim>(2), 1);
+                        FE_Q<dim>(2), 1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   std::vector<std::vector<bool> > mask (2, std::vector<bool>(2, false));
   mask[0][0] = mask[1][1] = true;
@@ -92,28 +92,28 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
 
   Functions::ExpFunction<dim> coefficient;
-  
+
   MatrixTools::
-    create_laplace_matrix (mapping, dof,
-                       quadrature, matrix,
-                       &coefficient);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_laplace_matrix (mapping, dof,
+                         quadrature, matrix,
+                         &coefficient);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 }
 
 
@@ -122,7 +122,7 @@ int main ()
 {
   std::ofstream logfile ("create_laplace_matrix_04b/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index dea889033dc57ca0205b0df05cd32f60fb776074..a60b36f1f9371a47dc3fcf5e1ae2df7155c7813a 100644 (file)
@@ -61,16 +61,16 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FE_Q<dim> element(2);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
@@ -81,9 +81,9 @@ check ()
                                            constraints);
   constraints.close ();
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity;
   {
     CompressedSparsityPattern csp(dof.n_dofs(), dof.n_dofs());
@@ -100,9 +100,9 @@ check ()
   Vector<double> rhs (dof.n_dofs()), rhs_ref(dof.n_dofs());
 
   MatrixTools::
-    create_laplace_matrix (mapping, dof,
-                           quadrature, matrix_ref,
-                           rhs_function, rhs_ref);
+  create_laplace_matrix (mapping, dof,
+                         quadrature, matrix_ref,
+                         rhs_function, rhs_ref);
   constraints.condense(matrix_ref, rhs_ref);
 
   const Function<dim> *const dummy = 0;
index ac508ac55831412fafec5114539459ce58acb1a1..a3e19328ada49f365499b6e72baa8a7b4439a0bd 100644 (file)
@@ -61,17 +61,17 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FESystem<dim> element(FE_Q<dim>(1), 1,
-                       FE_Q<dim>(2), 1);
+                        FE_Q<dim>(2), 1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
@@ -82,9 +82,9 @@ check ()
                                            constraints);
   constraints.close ();
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity;
   {
     Table<2,DoFTools::Coupling> mask (2, 2);
@@ -104,9 +104,9 @@ check ()
   Vector<double> rhs (dof.n_dofs()), rhs_ref(dof.n_dofs());
 
   MatrixTools::
-    create_laplace_matrix (mapping, dof,
-                           quadrature, matrix_ref,
-                           rhs_function, rhs_ref);
+  create_laplace_matrix (mapping, dof,
+                         quadrature, matrix_ref,
+                         rhs_function, rhs_ref);
   constraints.condense(matrix_ref, rhs_ref);
 
   const Function<dim> *const dummy = 0;
index 6029b27277560493f6fbd875ec65a3ebec07022f..a32375f41e4030162948f96ec0bf0a2d6a949f20 100644 (file)
@@ -62,17 +62,17 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FESystem<dim> element(FE_Q<dim>(1), 1,
-                       FE_Q<dim>(2), 1);
+                        FE_Q<dim>(2), 1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
@@ -83,9 +83,9 @@ check ()
                                            constraints);
   constraints.close ();
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity;
   {
     Table<2,DoFTools::Coupling> mask (2, 2);
@@ -101,8 +101,8 @@ check ()
   matrix_ref.reinit (sparsity);
 
   MatrixTools::
-    create_laplace_matrix (mapping, dof,
-                           quadrature, matrix_ref);
+  create_laplace_matrix (mapping, dof,
+                         quadrature, matrix_ref);
   constraints.condense(matrix_ref);
 
   const Function<dim> *const dummy = 0;
index 9a062d9509548731cd6e874336ad86548e63e237..8d1de5787df0bcb6ac363e8f21187dbde4b43a57 100644 (file)
@@ -61,16 +61,16 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FE_Q<dim> element(2);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
@@ -81,9 +81,9 @@ check ()
                                            constraints);
   constraints.close ();
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity;
   {
     CompressedSparsityPattern csp(dof.n_dofs(), dof.n_dofs());
@@ -100,10 +100,10 @@ check ()
   Vector<double> rhs (dof.n_dofs()), rhs_ref(dof.n_dofs());
 
   MatrixTools::
-    create_laplace_matrix (mapping, dof,
-                           quadrature, matrix_ref,
-                           rhs_function, rhs_ref,
-                           &rhs_function);
+  create_laplace_matrix (mapping, dof,
+                         quadrature, matrix_ref,
+                         rhs_function, rhs_ref,
+                         &rhs_function);
   constraints.condense(matrix_ref, rhs_ref);
 
   MatrixTools::create_laplace_matrix (mapping, dof, quadrature, matrix,
index 75373a0680905dbb4da30a2729c815d688f057b4..7126a1ea326f85f9b83c4009af6f37b5da7f2320 100644 (file)
@@ -61,17 +61,17 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FESystem<dim> element(FE_Q<dim>(1), 1,
-                       FE_Q<dim>(2), 1);
+                        FE_Q<dim>(2), 1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
@@ -82,9 +82,9 @@ check ()
                                            constraints);
   constraints.close ();
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity;
   {
     Table<2,DoFTools::Coupling> mask (2, 2);
@@ -104,10 +104,10 @@ check ()
   Vector<double> rhs (dof.n_dofs()), rhs_ref(dof.n_dofs());
 
   MatrixTools::
-    create_laplace_matrix (mapping, dof,
-                           quadrature, matrix_ref,
-                           rhs_function, rhs_ref,
-                           &rhs_function);
+  create_laplace_matrix (mapping, dof,
+                         quadrature, matrix_ref,
+                         rhs_function, rhs_ref,
+                         &rhs_function);
   constraints.condense(matrix_ref, rhs_ref);
 
   MatrixTools::create_laplace_matrix (mapping, dof, quadrature, matrix,
index 0861101ec1ea546b43924a6ad80a5840385f763d..006d25241ccd1968fb4f64153e2067c08dac2411 100644 (file)
@@ -67,22 +67,22 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FE_Q<dim> element(2);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   DoFTools::make_sparsity_pattern (dof, sparsity);
   ConstraintMatrix constraints;
@@ -99,21 +99,21 @@ check ()
   Vector<double> rhs (dof.n_dofs());
 
   MatrixTools::
-    create_mass_matrix (mapping, dof,
-                       quadrature, matrix,
-                       rhs_function, rhs);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_mass_matrix (mapping, dof,
+                      quadrature, matrix,
+                      rhs_function, rhs);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 
   deallog << "RHS vector: " << std::endl;
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
index 0e7f3dca33e473ccbf0b2c2bcf3e85b8846f6347..d77510ae5eb0fd07ad6cb7d0042730f398b582cd 100644 (file)
@@ -57,7 +57,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -68,22 +68,22 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FE_Q<dim> element(2);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   DoFTools::make_sparsity_pattern (dof, sparsity);
   ConstraintMatrix constraints;
@@ -91,25 +91,25 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
-  
+
   MatrixTools::
-    create_mass_matrix (mapping, dof,
-                       quadrature, matrix);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_mass_matrix (mapping, dof,
+                      quadrature, matrix);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 }
 
 
@@ -118,7 +118,7 @@ int main ()
 {
   std::ofstream logfile ("create_mass_matrix_01b/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 2025e103593c63616c382d0600cb57aa00cc23c9..aafcc8e5776ea84ff1e2f9ca383556dc4beb8dc3 100644 (file)
@@ -55,7 +55,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -66,23 +66,23 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FESystem<dim> element(FE_Q<dim>(1), 1,
-                       FE_Q<dim>(2), 1);
+                        FE_Q<dim>(2), 1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   std::vector<std::vector<bool> > mask (2, std::vector<bool>(2, false));
   mask[0][0] = mask[1][1] = true;
@@ -92,30 +92,30 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
 
   Functions::ExpFunction<dim> rhs_function;
-  
+
   Vector<double> rhs (dof.n_dofs());
-  
+
   MatrixTools::
-    create_mass_matrix (mapping, dof,
-                       quadrature, matrix,
-                       rhs_function, rhs);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_mass_matrix (mapping, dof,
+                      quadrature, matrix,
+                      rhs_function, rhs);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 
   deallog << "RHS vector: " << std::endl;
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
@@ -128,7 +128,7 @@ int main ()
 {
   std::ofstream logfile ("create_mass_matrix_02/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index c1de5f7bf5430c2787de0a5a9bff3acbcf2b2716..ba0a7bc47d52f0370c839ddae856cb80ac65896c 100644 (file)
@@ -56,7 +56,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -67,23 +67,23 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FESystem<dim> element(FE_Q<dim>(1), 1,
-                       FE_Q<dim>(2), 1);
+                        FE_Q<dim>(2), 1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   std::vector<std::vector<bool> > mask (2, std::vector<bool>(2, false));
   mask[0][0] = mask[1][1] = true;
@@ -93,25 +93,25 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
 
   MatrixTools::
-    create_mass_matrix (mapping, dof,
-                       quadrature, matrix);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_mass_matrix (mapping, dof,
+                      quadrature, matrix);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 }
 
 
@@ -120,7 +120,7 @@ int main ()
 {
   std::ofstream logfile ("create_mass_matrix_02b/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 22e8b19a45d73c29cf9233c8ba900b0087217e22..198e23d201a712921a71d46d34f789e4255efb0c 100644 (file)
@@ -55,7 +55,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -66,22 +66,22 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FE_Q<dim> element(2);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   DoFTools::make_sparsity_pattern (dof, sparsity);
   ConstraintMatrix constraints;
@@ -89,31 +89,31 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
 
   Functions::ExpFunction<dim> rhs_function;
-  
+
   Vector<double> rhs (dof.n_dofs());
-  
+
   MatrixTools::
-    create_mass_matrix (mapping, dof,
-                       quadrature, matrix,
-                       rhs_function, rhs,
-                       &rhs_function);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_mass_matrix (mapping, dof,
+                      quadrature, matrix,
+                      rhs_function, rhs,
+                      &rhs_function);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 
   deallog << "RHS vector: " << std::endl;
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
@@ -126,7 +126,7 @@ int main ()
 {
   std::ofstream logfile ("create_mass_matrix_03/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 76c1e1e4e10c0d6645badaa2ebfe511d5624cb6e..7ed1500493aa81e79c1ef78b86779b6574d965a0 100644 (file)
@@ -56,7 +56,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -67,22 +67,22 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FE_Q<dim> element(2);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   DoFTools::make_sparsity_pattern (dof, sparsity);
   ConstraintMatrix constraints;
@@ -90,28 +90,28 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
 
   Functions::ExpFunction<dim> coefficient;
-  
+
   MatrixTools::
-    create_mass_matrix (mapping, dof,
-                       quadrature, matrix,
-                       &coefficient);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_mass_matrix (mapping, dof,
+                      quadrature, matrix,
+                      &coefficient);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 }
 
 
@@ -120,7 +120,7 @@ int main ()
 {
   std::ofstream logfile ("create_mass_matrix_03b/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 423a04fa1c48c07dec1038a8642bcf3aa75522a3..03a2e002a11461ec56872e5bb467e3a0e63b0053 100644 (file)
@@ -54,7 +54,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -65,23 +65,23 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FESystem<dim> element(FE_Q<dim>(1), 1,
-                       FE_Q<dim>(2), 1);
+                        FE_Q<dim>(2), 1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   std::vector<std::vector<bool> > mask (2, std::vector<bool>(2, false));
   mask[0][0] = mask[1][1] = true;
@@ -91,31 +91,31 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
 
   Functions::ExpFunction<dim> rhs_function;
-  
+
   Vector<double> rhs (dof.n_dofs());
-  
+
   MatrixTools::
-    create_mass_matrix (mapping, dof,
-                       quadrature, matrix,
-                       rhs_function, rhs,
-                       &rhs_function);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_mass_matrix (mapping, dof,
+                      quadrature, matrix,
+                      rhs_function, rhs,
+                      &rhs_function);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 
   deallog << "RHS vector: " << std::endl;
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
@@ -128,7 +128,7 @@ int main ()
 {
   std::ofstream logfile ("create_mass_matrix_04/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 4af71bf0e496dbeac85bc63f449c067d7119e3ef..e14c7afd7f45095cc0c3e7c6cfa58da001db2656 100644 (file)
@@ -55,7 +55,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -66,23 +66,23 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FESystem<dim> element(FE_Q<dim>(1), 1,
-                       FE_Q<dim>(2), 1);
+                        FE_Q<dim>(2), 1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   std::vector<std::vector<bool> > mask (2, std::vector<bool>(2, false));
   mask[0][0] = mask[1][1] = true;
@@ -92,28 +92,28 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
 
   Functions::ExpFunction<dim> coefficient;
-  
+
   MatrixTools::
-    create_mass_matrix (mapping, dof,
-                       quadrature, matrix,
-                       &coefficient);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_mass_matrix (mapping, dof,
+                      quadrature, matrix,
+                      &coefficient);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 }
 
 
@@ -122,7 +122,7 @@ int main ()
 {
   std::ofstream logfile ("create_mass_matrix_04b/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index e5bb8c8504fce4b8fe8a2cb24d3029f0d41ebeff..329cf4b29d08c3fc97a3e85bef2fa8861c5ccddb 100644 (file)
@@ -47,7 +47,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -58,25 +58,25 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of non-primitive elements
+  // create a system element composed
+  // of non-primitive elements
   FESystem<dim> element(FE_RaviartThomas<dim>(1), 2);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different blocks should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different blocks should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   std::vector<std::vector<bool> > mask (dim*2,
-                                       std::vector<bool>(dim*2, false));
+                                        std::vector<bool>(dim*2, false));
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       mask[i][j] = true;
@@ -89,25 +89,25 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
 
   MatrixTools::
-    create_mass_matrix (mapping, dof,
-                       quadrature, matrix);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_mass_matrix (mapping, dof,
+                      quadrature, matrix);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 }
 
 
@@ -116,7 +116,7 @@ int main ()
 {
   std::ofstream logfile ("create_mass_matrix_05/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 0ba68049171bfee73f453ef677a1bb0044a47f01..3c4456c1175aef35ef937e64c783af6ddcf897ea 100644 (file)
@@ -61,16 +61,16 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FE_Q<dim> element(2);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
@@ -81,9 +81,9 @@ check ()
                                            constraints);
   constraints.close ();
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity;
   {
     CompressedSparsityPattern csp(dof.n_dofs(), dof.n_dofs());
@@ -100,9 +100,9 @@ check ()
   Vector<double> rhs (dof.n_dofs()), rhs_ref(dof.n_dofs());
 
   MatrixTools::
-    create_mass_matrix (mapping, dof,
-                       quadrature, matrix_ref,
-                       rhs_function, rhs_ref);
+  create_mass_matrix (mapping, dof,
+                      quadrature, matrix_ref,
+                      rhs_function, rhs_ref);
   constraints.condense(matrix_ref, rhs_ref);
 
   const Function<dim> *const dummy = 0;
index 37570247e9f78c63927a62b92b2605ef7e03c9a1..f2790eb80ef66ee72fb8891fee2287393d7af080 100644 (file)
@@ -61,17 +61,17 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FESystem<dim> element(FE_Q<dim>(1), 1,
-                       FE_Q<dim>(2), 1);
+                        FE_Q<dim>(2), 1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
@@ -82,9 +82,9 @@ check ()
                                            constraints);
   constraints.close ();
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity;
   {
     Table<2,DoFTools::Coupling> mask (2, 2);
@@ -104,9 +104,9 @@ check ()
   Vector<double> rhs (dof.n_dofs()), rhs_ref(dof.n_dofs());
 
   MatrixTools::
-    create_mass_matrix (mapping, dof,
-                       quadrature, matrix_ref,
-                       rhs_function, rhs_ref);
+  create_mass_matrix (mapping, dof,
+                      quadrature, matrix_ref,
+                      rhs_function, rhs_ref);
   constraints.condense(matrix_ref, rhs_ref);
 
   const Function<dim> *const dummy = 0;
index 19d2e0ebc5a79b4dd800f9be43db307a87db81a9..59d2fa19bc3b4824189b1ef91d1d1315810127f3 100644 (file)
@@ -62,17 +62,17 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FESystem<dim> element(FE_Q<dim>(1), 1,
-                       FE_Q<dim>(2), 1);
+                        FE_Q<dim>(2), 1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
@@ -83,9 +83,9 @@ check ()
                                            constraints);
   constraints.close ();
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity;
   {
     Table<2,DoFTools::Coupling> mask (2, 2);
@@ -101,8 +101,8 @@ check ()
   matrix_ref.reinit (sparsity);
 
   MatrixTools::
-    create_mass_matrix (mapping, dof,
-                       quadrature, matrix_ref);
+  create_mass_matrix (mapping, dof,
+                      quadrature, matrix_ref);
   constraints.condense(matrix_ref);
 
   const Function<dim> *const dummy = 0;
index 018e422ff491906da251d6d9b24ea1a508d0c68e..2ff87c0489eb43afc6f823a7e3cd2da03f2a2d72 100644 (file)
@@ -61,16 +61,16 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FE_Q<dim> element(2);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
@@ -81,9 +81,9 @@ check ()
                                            constraints);
   constraints.close ();
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity;
   {
     CompressedSparsityPattern csp(dof.n_dofs(), dof.n_dofs());
@@ -100,10 +100,10 @@ check ()
   Vector<double> rhs (dof.n_dofs()), rhs_ref(dof.n_dofs());
 
   MatrixTools::
-    create_mass_matrix (mapping, dof,
-                       quadrature, matrix_ref,
-                       rhs_function, rhs_ref,
-                        &rhs_function);
+  create_mass_matrix (mapping, dof,
+                      quadrature, matrix_ref,
+                      rhs_function, rhs_ref,
+                      &rhs_function);
   constraints.condense(matrix_ref, rhs_ref);
 
   MatrixTools::create_mass_matrix (mapping, dof, quadrature, matrix,
index fb82707335b7b5821dac85e076cb32ad11696554..25e0f6796ded0b96ff4e44517a778e440676866e 100644 (file)
@@ -61,17 +61,17 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FESystem<dim> element(FE_Q<dim>(1), 1,
-                       FE_Q<dim>(2), 1);
+                        FE_Q<dim>(2), 1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
@@ -82,9 +82,9 @@ check ()
                                            constraints);
   constraints.close ();
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity;
   {
     Table<2,DoFTools::Coupling> mask (2, 2);
@@ -104,10 +104,10 @@ check ()
   Vector<double> rhs (dof.n_dofs()), rhs_ref(dof.n_dofs());
 
   MatrixTools::
-    create_mass_matrix (mapping, dof,
-                       quadrature, matrix_ref,
-                       rhs_function, rhs_ref,
-                        &rhs_function);
+  create_mass_matrix (mapping, dof,
+                      quadrature, matrix_ref,
+                      rhs_function, rhs_ref,
+                      &rhs_function);
   constraints.condense(matrix_ref, rhs_ref);
 
   MatrixTools::create_mass_matrix (mapping, dof, quadrature, matrix,
index 13a30f0154ff7cd9b223564cca6710d8c18cc8b2..b718ebe6aa6372f753af50deaff0e394b1bb2a65 100644 (file)
@@ -44,12 +44,12 @@ check ()
   dof.distribute_dofs (fe);
   Point<dim> orientation;
   Point<dim> p (tria.begin_active ()->center ());
-  
+
   for (unsigned int i = 0; i < dim; ++i)
     orientation (i) = i;
-  
+
   Vector<double> vector (dof.n_dofs ());
-  
+
   VectorTools::create_point_source_vector (dof, p, orientation, vector);
 
   for (unsigned int i = 0; i < dof.n_dofs(); ++i)
@@ -62,7 +62,7 @@ int main ()
 {
   std::ofstream logfile ("create_point_source/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index c3d2953c413e19ad8dc3d805a7444468c53ddaa3..56cdeb3007e6fa79c0a36275bd03634735f56526 100644 (file)
@@ -41,7 +41,7 @@ check ()
   Triangulation<dim> tria;
   GridGenerator::hyper_cube (tria);
   hp::FECollection<dim> fe_collection;
-  
+
   for (unsigned int i = 1; i <= tria.n_active_cells (); ++i)
     fe_collection.push_back (FESystem<dim> (FE_Q<dim> (i), dim));
 
@@ -49,12 +49,12 @@ check ()
   dof.distribute_dofs (fe_collection);
   Point<dim> orientation;
   Point<dim> p (tria.begin_active ()->center ());
-  
+
   for (unsigned int i = 0; i < dim; ++i)
     orientation (i) = i;
-  
+
   Vector<double> vector (dof.n_dofs ());
-  
+
   VectorTools::create_point_source_vector (dof, p, orientation, vector);
 
   for (unsigned int i = 0; i < dof.n_dofs(); ++i)
@@ -67,7 +67,7 @@ int main ()
 {
   std::ofstream logfile ("create_point_source_hp/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index ea5b98dc947781aabf0b214681110fd75b572529..6cd61496c527438e4b92d0f083fd2ac823142083 100644 (file)
@@ -49,20 +49,20 @@ std::ofstream logfile("data_out/output");
 template <int dim>
 class LaplaceProblem
 {
-  public:
-    LaplaceProblem ();
-    void run ();
+public:
+  LaplaceProblem ();
+  void run ();
 
-  private:
-    void make_grid_and_dofs ();
-    void solve ();
-    void output_results () const;
+private:
+  void make_grid_and_dofs ();
+  void solve ();
+  void output_results () const;
 
-    Triangulation<dim>   triangulation;
-    FE_Q<dim>            fe;
-    DoFHandler<dim>      dof_handler;
+  Triangulation<dim>   triangulation;
+  FE_Q<dim>            fe;
+  DoFHandler<dim>      dof_handler;
 
-    Vector<double>       solution;
+  Vector<double>       solution;
 };
 
 
@@ -86,17 +86,17 @@ void LaplaceProblem<dim>::make_grid_and_dofs ()
 
 
   deallog << "   Number of active cells: "
-         << triangulation.n_active_cells()
-         << std::endl
-         << "   Total number of cells: "
-         << triangulation.n_cells()
-         << std::endl;
+          << triangulation.n_active_cells()
+          << std::endl
+          << "   Total number of cells: "
+          << triangulation.n_cells()
+          << std::endl;
 
   dof_handler.distribute_dofs (fe);
 
   deallog << "   Number of degrees of freedom: "
-         << dof_handler.n_dofs()
-         << std::endl;
+          << dof_handler.n_dofs()
+          << std::endl;
 
   solution.reinit (dof_handler.n_dofs());
 }
@@ -107,8 +107,8 @@ void LaplaceProblem<dim>::make_grid_and_dofs ()
 template <int dim>
 void LaplaceProblem<dim>::solve ()
 {
-                                  // dummy solve. just insert some
-                                  // arbitrary values
+  // dummy solve. just insert some
+  // arbitrary values
   for (unsigned int i=0; i<solution.size(); ++i)
     solution(i) = i;
 }
@@ -120,7 +120,7 @@ void LaplaceProblem<2>::output_results () const
 {
   const unsigned int dim = 2;
 
-                                  // test regular output in 2d
+  // test regular output in 2d
   if (true)
     {
       DataOut<dim> data_out;
@@ -136,7 +136,7 @@ void LaplaceProblem<2>::output_results () const
       data_out.write_eps (logfile);
     };
 
-                                  // test DataOutRotation in 2d
+  // test DataOutRotation in 2d
   if (true)
     {
       DataOutRotation<dim> data_out;
@@ -158,7 +158,7 @@ void LaplaceProblem<3>::output_results () const
 {
   const unsigned int dim = 3;
 
-                                  // test regular output in 3d
+  // test regular output in 3d
   if (true)
     {
       DataOut<dim> data_out;
@@ -172,9 +172,9 @@ void LaplaceProblem<3>::output_results () const
       data_out.write_ucd (logfile);
     };
 
-                                  // test DataOutFaces in 3d. note:
-                                  // not all output formats support
-                                  // this
+  // test DataOutFaces in 3d. note:
+  // not all output formats support
+  // this
   if (true)
     {
       DataOutFaces<dim> data_out;
index 21f77a6ac16328f26167599062b42e3adee695d2..27fb3e308a2738ffa59f29fc5a317bad432ef170 100644 (file)
@@ -47,28 +47,28 @@ std::ofstream logfile("data_out_postprocessor_01/output");
 template <int dim>
 class LaplaceProblem
 {
-  public:
-    LaplaceProblem ();
-    void run ();
+public:
+  LaplaceProblem ();
+  void run ();
 
-  private:
-    void make_grid_and_dofs ();
-    void solve ();
-    void output_results () const;
+private:
+  void make_grid_and_dofs ();
+  void solve ();
+  void output_results () const;
 
-    Triangulation<dim>   triangulation;
-    FESystem<dim>            fe;
-    DoFHandler<dim>      dof_handler;
+  Triangulation<dim>   triangulation;
+  FESystem<dim>            fe;
+  DoFHandler<dim>      dof_handler;
 
-    Vector<double>       solution;
+  Vector<double>       solution;
 };
 
 
 template <int dim>
 LaplaceProblem<dim>::LaplaceProblem ()
-               :
-               fe (FE_Q<dim>(1),2),
-               dof_handler (triangulation)
+  :
+  fe (FE_Q<dim>(1),2),
+  dof_handler (triangulation)
 {}
 
 
@@ -90,26 +90,26 @@ void LaplaceProblem<dim>::make_grid_and_dofs ()
 template <int dim>
 class SinesAndCosines : public Function<dim>
 {
-  public:
-    SinesAndCosines ()
-                   :
-                   Function<dim> (2)
-      {}
-
-    double value (const Point<dim> &p,
-                 const unsigned int component) const
+public:
+  SinesAndCosines ()
+    :
+    Function<dim> (2)
+  {}
+
+  double value (const Point<dim> &p,
+                const unsigned int component) const
+  {
+    switch (component)
       {
-       switch (component)
-         {
-           case 0:
-                 return std::sin (p.norm());
-           case 1:
-                 return std::cos (p.norm());
-           default:
-                 Assert (false, ExcNotImplemented());
-                 return 0;
-         }
+      case 0:
+        return std::sin (p.norm());
+      case 1:
+        return std::cos (p.norm());
+      default:
+        Assert (false, ExcNotImplemented());
+        return 0;
       }
+  }
 };
 
 
@@ -117,57 +117,57 @@ class SinesAndCosines : public Function<dim>
 template <int dim>
 void LaplaceProblem<dim>::solve ()
 {
-                                  // dummy solve. just insert some
-                                  // values as mentioned at the top
-                                  // of the file
+  // dummy solve. just insert some
+  // values as mentioned at the top
+  // of the file
   VectorTools::interpolate (dof_handler,
-                           SinesAndCosines<dim>(),
-                           solution);
+                            SinesAndCosines<dim>(),
+                            solution);
 }
 
 
 template <int dim>
 class MyPostprocessor : public DataPostprocessor<dim>
 {
-  public:
-    virtual std::vector<std::string> get_names () const
+public:
+  virtual std::vector<std::string> get_names () const
+  {
+    return std::vector<std::string>(1,"magnitude");
+  }
+
+  virtual
+  std::vector<DataComponentInterpretation::DataComponentInterpretation>
+  get_data_component_interpretation () const
+  {
+    return
+      std::vector<DataComponentInterpretation::DataComponentInterpretation>
+      (1,DataComponentInterpretation::component_is_scalar);
+  }
+
+  virtual UpdateFlags get_needed_update_flags () const
+  {
+    return update_values;
+  }
+
+  virtual
+  void
+  compute_derived_quantities_vector (const std::vector<Vector<double> >              &uh,
+                                     const std::vector<std::vector<Tensor<1,dim> > > &,
+                                     const std::vector<std::vector<Tensor<2,dim> > > &,
+                                     const std::vector<Point<dim> > &,
+                                     const std::vector<Point<dim> > &,
+                                     std::vector<Vector<double> >                    &computed_quantities) const
+  {
+    for (unsigned int q=0; q<uh.size(); ++q)
       {
-       return std::vector<std::string>(1,"magnitude");
-      }
-
-    virtual
-    std::vector<DataComponentInterpretation::DataComponentInterpretation>
-    get_data_component_interpretation () const
-      {
-       return
-         std::vector<DataComponentInterpretation::DataComponentInterpretation>
-         (1,DataComponentInterpretation::component_is_scalar);
-      }
+        Assert (computed_quantities[q].size() == 1,
+                ExcInternalError());
 
-    virtual UpdateFlags get_needed_update_flags () const
-      {
-       return update_values;
-      }
-
-    virtual
-    void
-    compute_derived_quantities_vector (const std::vector<Vector<double> >              &uh,
-                                      const std::vector<std::vector<Tensor<1,dim> > > &,
-                                      const std::vector<std::vector<Tensor<2,dim> > > &,
-                                      const std::vector<Point<dim> >                  &,
-                                      const std::vector<Point<dim> >                  &,
-                                      std::vector<Vector<double> >                    &computed_quantities) const
-      {
-       for (unsigned int q=0; q<uh.size(); ++q)
-         {
-           Assert (computed_quantities[q].size() == 1,
-                   ExcInternalError());
-
-           computed_quantities[q](0) = uh[q](0)*uh[q](0) + uh[q](1)*uh[q](1);
-           Assert (std::fabs(computed_quantities[q](0)-1) < 1e-12,
-                   ExcInternalError());
-         }
+        computed_quantities[q](0) = uh[q](0)*uh[q](0) + uh[q](1)*uh[q](1);
+        Assert (std::fabs(computed_quantities[q](0)-1) < 1e-12,
+                ExcInternalError());
       }
+  }
 };
 
 
index 90b4b247b02c4e383fd27a9e035811b4d1cc54ef..a51d60330bb85858df403f2da6b8d3d2120127f7 100644 (file)
@@ -50,28 +50,28 @@ std::ofstream logfile("data_out_postprocessor_scalar_01/output");
 template <int dim>
 class LaplaceProblem
 {
-  public:
-    LaplaceProblem ();
-    void run ();
+public:
+  LaplaceProblem ();
+  void run ();
 
-  private:
-    void make_grid_and_dofs ();
-    void solve ();
-    void output_results () const;
+private:
+  void make_grid_and_dofs ();
+  void solve ();
+  void output_results () const;
 
-    Triangulation<dim>   triangulation;
-    FESystem<dim>            fe;
-    DoFHandler<dim>      dof_handler;
+  Triangulation<dim>   triangulation;
+  FESystem<dim>            fe;
+  DoFHandler<dim>      dof_handler;
 
-    Vector<double>       solution;
+  Vector<double>       solution;
 };
 
 
 template <int dim>
 LaplaceProblem<dim>::LaplaceProblem ()
-               :
-               fe (FE_Q<dim>(1),2),
-               dof_handler (triangulation)
+  :
+  fe (FE_Q<dim>(1),2),
+  dof_handler (triangulation)
 {}
 
 
@@ -93,26 +93,26 @@ void LaplaceProblem<dim>::make_grid_and_dofs ()
 template <int dim>
 class SinesAndCosines : public Function<dim>
 {
-  public:
-    SinesAndCosines ()
-                   :
-                   Function<dim> (2)
-      {}
-
-    double value (const Point<dim> &p,
-                 const unsigned int component) const
+public:
+  SinesAndCosines ()
+    :
+    Function<dim> (2)
+  {}
+
+  double value (const Point<dim> &p,
+                const unsigned int component) const
+  {
+    switch (component)
       {
-       switch (component)
-         {
-           case 0:
-                 return std::sin (p.norm());
-           case 1:
-                 return std::cos (p.norm());
-           default:
-                 Assert (false, ExcNotImplemented());
-                 return 0;
-         }
+      case 0:
+        return std::sin (p.norm());
+      case 1:
+        return std::cos (p.norm());
+      default:
+        Assert (false, ExcNotImplemented());
+        return 0;
       }
+  }
 };
 
 
@@ -120,43 +120,43 @@ class SinesAndCosines : public Function<dim>
 template <int dim>
 void LaplaceProblem<dim>::solve ()
 {
-                                  // dummy solve. just insert some
-                                  // values as mentioned at the top
-                                  // of the file
+  // dummy solve. just insert some
+  // values as mentioned at the top
+  // of the file
   VectorTools::interpolate (dof_handler,
-                           SinesAndCosines<dim>(),
-                           solution);
+                            SinesAndCosines<dim>(),
+                            solution);
 }
 
 
 template <int dim>
 class MyPostprocessor : public DataPostprocessorScalar<dim>
 {
-  public:
-    MyPostprocessor ()
-                   :
-                   DataPostprocessorScalar<dim> ("magnitude", update_values)
-      {}
-
-    virtual
-    void
-    compute_derived_quantities_vector (const std::vector<Vector<double> >              &uh,
-                                      const std::vector<std::vector<Tensor<1,dim> > > &,
-                                      const std::vector<std::vector<Tensor<2,dim> > > &,
-                                      const std::vector<Point<dim> >                  &,
-                                      const std::vector<Point<dim> >                  &,
-                                      std::vector<Vector<double> >                    &computed_quantities) const
+public:
+  MyPostprocessor ()
+    :
+    DataPostprocessorScalar<dim> ("magnitude", update_values)
+  {}
+
+  virtual
+  void
+  compute_derived_quantities_vector (const std::vector<Vector<double> >              &uh,
+                                     const std::vector<std::vector<Tensor<1,dim> > > &,
+                                     const std::vector<std::vector<Tensor<2,dim> > > &,
+                                     const std::vector<Point<dim> > &,
+                                     const std::vector<Point<dim> > &,
+                                     std::vector<Vector<double> >                    &computed_quantities) const
+  {
+    for (unsigned int q=0; q<uh.size(); ++q)
       {
-       for (unsigned int q=0; q<uh.size(); ++q)
-         {
-           Assert (computed_quantities[q].size() == 1,
-                   ExcInternalError());
-
-           computed_quantities[q](0) = uh[q](0)*uh[q](0) + uh[q](1)*uh[q](1);
-           Assert (std::fabs(computed_quantities[q](0)-1) < 1e-12,
-                   ExcInternalError());
-         }
+        Assert (computed_quantities[q].size() == 1,
+                ExcInternalError());
+
+        computed_quantities[q](0) = uh[q](0)*uh[q](0) + uh[q](1)*uh[q](1);
+        Assert (std::fabs(computed_quantities[q](0)-1) < 1e-12,
+                ExcInternalError());
       }
+  }
 };
 
 
index 90baa2472d4f3146e3806a965de9981ae2e043b2..134b2a98a62be92ce2c3a43417e76a3dc4d379f5 100644 (file)
@@ -50,28 +50,28 @@ std::ofstream logfile("data_out_postprocessor_vector_01/output");
 template <int dim>
 class LaplaceProblem
 {
-  public:
-    LaplaceProblem ();
-    void run ();
+public:
+  LaplaceProblem ();
+  void run ();
 
-  private:
-    void make_grid_and_dofs ();
-    void solve ();
-    void output_results () const;
+private:
+  void make_grid_and_dofs ();
+  void solve ();
+  void output_results () const;
 
-    Triangulation<dim>   triangulation;
-    FESystem<dim>            fe;
-    DoFHandler<dim>      dof_handler;
+  Triangulation<dim>   triangulation;
+  FESystem<dim>            fe;
+  DoFHandler<dim>      dof_handler;
 
-    Vector<double>       solution;
+  Vector<double>       solution;
 };
 
 
 template <int dim>
 LaplaceProblem<dim>::LaplaceProblem ()
-               :
-               fe (FE_Q<dim>(1),2),
-               dof_handler (triangulation)
+  :
+  fe (FE_Q<dim>(1),2),
+  dof_handler (triangulation)
 {}
 
 
@@ -93,26 +93,26 @@ void LaplaceProblem<dim>::make_grid_and_dofs ()
 template <int dim>
 class SinesAndCosines : public Function<dim>
 {
-  public:
-    SinesAndCosines ()
-                   :
-                   Function<dim> (2)
-      {}
-
-    double value (const Point<dim> &p,
-                 const unsigned int component) const
+public:
+  SinesAndCosines ()
+    :
+    Function<dim> (2)
+  {}
+
+  double value (const Point<dim> &p,
+                const unsigned int component) const
+  {
+    switch (component)
       {
-       switch (component)
-         {
-           case 0:
-                 return std::sin (p.norm());
-           case 1:
-                 return std::cos (p.norm());
-           default:
-                 Assert (false, ExcNotImplemented());
-                 return 0;
-         }
+      case 0:
+        return std::sin (p.norm());
+      case 1:
+        return std::cos (p.norm());
+      default:
+        Assert (false, ExcNotImplemented());
+        return 0;
       }
+  }
 };
 
 
@@ -120,44 +120,44 @@ class SinesAndCosines : public Function<dim>
 template <int dim>
 void LaplaceProblem<dim>::solve ()
 {
-                                  // dummy solve. just insert some
-                                  // values as mentioned at the top
-                                  // of the file
+  // dummy solve. just insert some
+  // values as mentioned at the top
+  // of the file
   VectorTools::interpolate (dof_handler,
-                           SinesAndCosines<dim>(),
-                           solution);
+                            SinesAndCosines<dim>(),
+                            solution);
 }
 
 
 template <int dim>
 class MyPostprocessor : public DataPostprocessorVector<dim>
 {
-  public:
-    MyPostprocessor ()
-                   :
-                   DataPostprocessorVector<dim> ("magnitude_times_d", update_values)
-      {}
-
-    virtual
-    void
-    compute_derived_quantities_vector (const std::vector<Vector<double> >              &uh,
-                                      const std::vector<std::vector<Tensor<1,dim> > > &,
-                                      const std::vector<std::vector<Tensor<2,dim> > > &,
-                                      const std::vector<Point<dim> >                  &,
-                                      const std::vector<Point<dim> >                  &,
-                                      std::vector<Vector<double> >                    &computed_quantities) const
+public:
+  MyPostprocessor ()
+    :
+    DataPostprocessorVector<dim> ("magnitude_times_d", update_values)
+  {}
+
+  virtual
+  void
+  compute_derived_quantities_vector (const std::vector<Vector<double> >              &uh,
+                                     const std::vector<std::vector<Tensor<1,dim> > > &,
+                                     const std::vector<std::vector<Tensor<2,dim> > > &,
+                                     const std::vector<Point<dim> > &,
+                                     const std::vector<Point<dim> > &,
+                                     std::vector<Vector<double> >                    &computed_quantities) const
+  {
+    for (unsigned int q=0; q<uh.size(); ++q)
       {
-       for (unsigned int q=0; q<uh.size(); ++q)
-         {
-           Assert (computed_quantities[q].size() == dim,
-                   ExcInternalError());
-
-           for (unsigned int d=0; d<dim; ++d)
-             computed_quantities[q](d) = uh[q](0)*uh[q](0) + uh[q](1)*uh[q](1);
-           Assert (std::fabs(computed_quantities[q](0)-1) < 1e-12,
-                   ExcInternalError());
-         }
+        Assert (computed_quantities[q].size() == dim,
+                ExcInternalError());
+
+        for (unsigned int d=0; d<dim; ++d)
+          computed_quantities[q](d) = uh[q](0)*uh[q](0) + uh[q](1)*uh[q](1);
+        Assert (std::fabs(computed_quantities[q](0)-1) < 1e-12,
+                ExcInternalError());
       }
+  }
 };
 
 
index 12f34db02f233aa96679e40c2084582b19166120..a26cf02a8382f60291ed3edb06e0a2911d17d0af 100644 (file)
@@ -42,8 +42,8 @@ void
 check ()
 {
   Functions::CosineFunction<dim> cosine;
-  
-  Triangulation<dim> tr;  
+
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -53,7 +53,7 @@ check ()
   tr.execute_coarsening_and_refinement ();
   if (dim==1)
     tr.refine_global(2);
-  
+
   FE_Q<dim> element(3);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
@@ -65,14 +65,14 @@ check ()
   Vector<float> second (tr.n_active_cells());
 
   DerivativeApproximation::
-    approximate_gradient (dof, v, gradient);
+  approximate_gradient (dof, v, gradient);
   DerivativeApproximation::
-    approximate_second_derivative (dof, v, second);
-  
+  approximate_second_derivative (dof, v, second);
+
   deallog << "Approximated gradient:" << std::endl;
   for (unsigned int i=0; i<gradient.size(); ++i)
     deallog << gradient(i)*100 << std::endl;
-  
+
   deallog << "Approximated second derivative:" << std::endl;
   for (unsigned int i=0; i<gradient.size(); ++i)
     deallog << second(i)*100 << std::endl;
@@ -82,7 +82,7 @@ int main ()
 {
   std::ofstream logfile ("derivative_approximation/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index db61b206566d3ba7a750c61965b833d3e987ac92..b99b170bbaea945f6c227307513eb50bbb896ced 100644 (file)
@@ -46,19 +46,21 @@ const double a=4,b=5;
 template<int dim>
 class MyFunction : public Function<dim>
 {
-  public:
-    MyFunction () : Function<dim>() {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int) const
-      {        return sin(p[0]*a)*cos(p[1]*b); }
+public:
+  MyFunction () : Function<dim>() {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int) const
+  {
+    return sin(p[0]*a)*cos(p[1]*b);
+  }
 };
 
 template <int dim>
 void exact_gradient(Point<dim> &p, Tensor<1,dim> &grad)
 {
   double x=p[0],y=p[1];
-  
+
   grad[0]=a*cos(a*x)*cos(b*y);
   grad[1]=-b*sin(a*x)*sin(b*y);
 }
@@ -67,7 +69,7 @@ template <int dim>
 void exact_second(Point<dim> &p, Tensor<2,dim> &sec)
 {
   double x=p[0],y=p[1];
-  
+
   sec[0][0]=-a*a*sin(a*x)*cos(b*y);
 //  sec[0][1]=-a*b*cos(a*x)*sin(b*y);
   sec[1][0]=sec[0][1]=-a*b*cos(a*x)*sin(b*y);
@@ -78,43 +80,65 @@ template <int dim>
 void exact_third(Point<dim> &p, Tensor<3,dim> &third)
 {
   double x=p[0],y=p[1];
-                                  // array of function and its derivatives
+  // array of function and its derivatives
   double dx[4]=
-    {sin(a*x),
-     a*cos(a*x),
-     -a*a*sin(a*x),
-     -a*a*a*cos(a*x)};
+  {
+    sin(a*x),
+    a*cos(a*x),
+    -a *a*sin(a*x),
+    -a *a *a*cos(a*x)
+  };
   double dy[4]=
-    {cos(b*y),
-     -b*sin(b*y),
-     -b*b*cos(b*y),
-     b*b*b*sin(b*y)};
+  {
+    cos(b*y),
+    -b*sin(b*y),
+    -b *b*cos(b*y),
+    b *b *b*sin(b*y)
+  };
 
   for (int i=0; i<dim; ++i)
     for (int j=0; j<dim; ++j)
       for (int k=0; k<dim; ++k)
-       {
-         int zeros=0, ones=0;
-         switch(i)
-           {
-             case 0: ++zeros; break;
-             case 1: ++ones;  break;
-             default: third[i][j][k]=0; continue;
-           }
-         switch(j)
-           {
-             case 0: ++zeros; break;
-             case 1: ++ones;  break;
-             default: third[i][j][k]=0; continue;
-           }
-         switch(k)
-           {
-             case 0: ++zeros; break;
-             case 1: ++ones;  break;
-             default: third[i][j][k]=0; continue;
-           }
-         third[i][j][k]=dx[zeros]*dy[ones];
-       }
+        {
+          int zeros=0, ones=0;
+          switch (i)
+            {
+            case 0:
+              ++zeros;
+              break;
+            case 1:
+              ++ones;
+              break;
+            default:
+              third[i][j][k]=0;
+              continue;
+            }
+          switch (j)
+            {
+            case 0:
+              ++zeros;
+              break;
+            case 1:
+              ++ones;
+              break;
+            default:
+              third[i][j][k]=0;
+              continue;
+            }
+          switch (k)
+            {
+            case 0:
+              ++zeros;
+              break;
+            case 1:
+              ++ones;
+              break;
+            default:
+              third[i][j][k]=0;
+              continue;
+            }
+          third[i][j][k]=dx[zeros]*dy[ones];
+        }
 }
 
 
@@ -131,89 +155,89 @@ void derivatives()
   MappingQ1<dim> mapping;
   QMidpoint<dim> q_midpoint;
   FEValues<dim> fe_values(mapping, fe, q_midpoint, update_q_points);
-  
+
   dof_handler.distribute_dofs (fe);
   solution.reinit(dof_handler.n_dofs());
 
   VectorTools::interpolate (mapping, dof_handler, function, solution);
 
   typename DoFHandler<dim>::active_cell_iterator
-    cell=dof_handler.begin_active(),
-    endc=dof_handler.end();
-  
+  cell=dof_handler.begin_active(),
+  endc=dof_handler.end();
+
   for (; cell!=endc; ++cell)
     {
-                                      // get derivative approximations
+      // get derivative approximations
       Tensor<1,dim> grad, ex_grad;
       Tensor<2,dim> second, ex_second;
       Tensor<3,dim> third, ex_third;
 
       DerivativeApproximation::approximate_derivative_tensor
-       (mapping,
-        dof_handler,
-        solution,
-        cell,
-        grad,
-        0);
+      (mapping,
+       dof_handler,
+       solution,
+       cell,
+       grad,
+       0);
       double normgrad=DerivativeApproximation::derivative_norm(grad);
-      
+
       DerivativeApproximation::approximate_derivative_tensor
-       (mapping,
-        dof_handler,
-        solution,
-        cell,
-        second,
-        0);
+      (mapping,
+       dof_handler,
+       solution,
+       cell,
+       second,
+       0);
       double normsecond=DerivativeApproximation::derivative_norm(second);
-      
+
       DerivativeApproximation::approximate_derivative_tensor
-       (mapping,
-        dof_handler,
-        solution,
-        cell,
-        third,
-        0);
+      (mapping,
+       dof_handler,
+       solution,
+       cell,
+       third,
+       0);
       double normthird=DerivativeApproximation::derivative_norm(third);
 
-                                      // symmetry of second derivative
+      // symmetry of second derivative
       Assert(second==transpose(second),
-            ExcMessage("Second derivative is not symmetric"));
+             ExcMessage("Second derivative is not symmetric"));
 
-                                      // symmetry of third derivative note,
-                                      // that this is only part of the truth,
-                                      // we would have to test more here to be
-                                      // really sure, but this should be enough
+      // symmetry of third derivative note,
+      // that this is only part of the truth,
+      // we would have to test more here to be
+      // really sure, but this should be enough
       for (unsigned int i=0; i<dim; ++i)
-       Assert(third[i]==transpose(third[i]),
-              ExcMessage("Third derivative is not symmetric"));
+        Assert(third[i]==transpose(third[i]),
+               ExcMessage("Third derivative is not symmetric"));
 
-                                      // get exact derivatives
+      // get exact derivatives
       fe_values.reinit(cell);
       std::vector<Point<dim> > q_point;
       q_point=fe_values.get_quadrature_points();
-      
+
       exact_gradient(q_point[0],ex_grad);
       exact_second  (q_point[0],ex_second);
       exact_third   (q_point[0],ex_third);
-      
+
       double ex_normgrad  =DerivativeApproximation::derivative_norm(ex_grad);
       double ex_normsecond=DerivativeApproximation::derivative_norm(ex_second);
       double ex_normthird =DerivativeApproximation::derivative_norm(ex_third);
-      
-                                      // output of all values for comparison
+
+      // output of all values for comparison
       deallog<<"cell "<<cell<<endl;
       deallog<<"approx. gradient: "
-            <<grad<<" , norm: "<<normgrad<<endl
-            <<"  exact gradient: "
-            <<ex_grad<<" , norm: "<<ex_normgrad<<endl;
+             <<grad<<" , norm: "<<normgrad<<endl
+             <<"  exact gradient: "
+             <<ex_grad<<" , norm: "<<ex_normgrad<<endl;
       deallog<<"approx. second derivative (hessian): "
-            <<second<<" , norm: "<<normsecond<<endl
-            <<"  exact second derivative (hessian): "
-            <<ex_second<<" , norm: "<<ex_normsecond<<endl;
+             <<second<<" , norm: "<<normsecond<<endl
+             <<"  exact second derivative (hessian): "
+             <<ex_second<<" , norm: "<<ex_normsecond<<endl;
       deallog<<"approx. third derivative: "
-            <<third<<" , norm: "<<normthird<<endl
-            <<"  exact third derivative: "
-            <<ex_third<<" , norm: "<<ex_normthird<<endl<<endl;
+             <<third<<" , norm: "<<normthird<<endl
+             <<"  exact third derivative: "
+             <<ex_third<<" , norm: "<<ex_normthird<<endl<<endl;
     }
 
 }
index c917f8d78f458c478cb4e4dd99eecef32c258f38..78bfc3c67f85f754d45e97a09c64d6c1a6f2207c 100644 (file)
@@ -46,27 +46,27 @@ const bool errors = false;
 template <int dim>
 void
 check (const unsigned int level,
-       const Mapping<dim>mapping,
-       const FiniteElement<dim>element,
-       const Quadrature<dim>quadrature)
+       const Mapping<dim> &mapping,
+       const FiniteElement<dim> &element,
+       const Quadrature<dim> &quadrature)
 {
   Triangulation<dim> tr;
 
   Functions::CosineFunction<dim> cosine;
-  
+
   DoFHandler<dim> dof(tr);
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
     GridGenerator::hyper_cube(tr, -1,1);
-  
+
   tr.refine_global (level);
-  
+
   dof.distribute_dofs(element);
 
   FEValues<dim> fe (mapping, element, quadrature,
-                   update_values
-                   | update_q_points | update_JxW_values);
+                    update_values
+                    | update_q_points | update_JxW_values);
 
   std::vector <types::global_dof_index> global_dofs (element.dofs_per_cell);
   std::vector <double> function (quadrature.size());
@@ -75,52 +75,52 @@ check (const unsigned int level,
   Vector<double> f (dof.n_dofs ());
 
   SparsityPattern A_pattern (dof.n_dofs (), dof.n_dofs (),
-                            dof.max_couplings_between_dofs());
+                             dof.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern(dof, A_pattern);
   A_pattern.compress ();
-  
+
   SparseMatrix<double> A(A_pattern);
-  
+
   typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active();
   const typename DoFHandler<dim>::cell_iterator end = dof.end();
 
-  for (; cell != end;++cell)
+  for (; cell != end; ++cell)
     {
       fe.reinit(cell);
       cell->get_dof_indices (global_dofs);
       cosine.value_list (fe.get_quadrature_points(), function);
 
-      for (unsigned int k=0;k<quadrature.size();++k)
-       {
-         double dx = fe.JxW (k);
-
-         for (unsigned int i=0;i<element.dofs_per_cell;++i)
-           {
-             const double v = fe.shape_value (i,k);
-             double rhs = dx * v * (function[k]);
-
-             f(global_dofs[i]) += rhs;
-             for (unsigned int j=0;j<element.dofs_per_cell;++j)
-               {
-                 const double u = fe.shape_value (j,k);
-                 double el = dx * (u*v/* + (Du*Dv) */);
-                 A.add (global_dofs[i], global_dofs[j], el);
-               }
-           }
-       }
+      for (unsigned int k=0; k<quadrature.size(); ++k)
+        {
+          double dx = fe.JxW (k);
+
+          for (unsigned int i=0; i<element.dofs_per_cell; ++i)
+            {
+              const double v = fe.shape_value (i,k);
+              double rhs = dx * v * (function[k]);
+
+              f(global_dofs[i]) += rhs;
+              for (unsigned int j=0; j<element.dofs_per_cell; ++j)
+                {
+                  const double u = fe.shape_value (j,k);
+                  double el = dx * (u*v/* + (Du*Dv) */);
+                  A.add (global_dofs[i], global_dofs[j], el);
+                }
+            }
+        }
     }
 
   SolverControl control (1000, 1.e-10, false, false);
   PrimitiveVectorMemory<Vector<double> > mem;
   SolverCG<Vector<double> > solver (control, mem);
   PreconditionIdentity prec;
-  
+
   solver.solve (A, u, f, prec);
 
   FEValues<dim> fe2 (mapping, element, quadrature,
-                    update_values | update_gradients
-                    | update_second_derivatives
-                    | update_q_points | update_JxW_values);
+                     update_values | update_gradients
+                     | update_second_derivatives
+                     | update_q_points | update_JxW_values);
 
   double l2 = 0.;
   double h1 = 0.;
@@ -131,41 +131,41 @@ check (const unsigned int level,
   std::vector<Tensor<1,dim> > Df (quadrature.size());
   std::vector<Tensor<2,dim> > DDu (quadrature.size());
   std::vector<Tensor<2,dim> > DDf (quadrature.size());
-  
-  for (cell = dof.begin_active(); cell != end;++cell)
+
+  for (cell = dof.begin_active(); cell != end; ++cell)
     {
       fe2.reinit (cell);
-      
+
       cosine.value_list (fe2.get_quadrature_points(), function);
       cosine.gradient_list (fe2.get_quadrature_points(), Df);
       cosine.hessian_list (fe2.get_quadrature_points(), DDf);
       fe2.get_function_values (u, u_local);
       fe2.get_function_grads (u, Du);
       fe2.get_function_2nd_derivatives (u,DDu);
-      
-      for (unsigned int k=0;k<quadrature.size();++k)
-       {
-         const double dx = fe.JxW (k);
-         double e =  u_local[k];
-         if (errors) e -= function[k];
-         l2 += dx*e*e;
-         for (unsigned int i=0;i<dim;++i)
-           {
-             e = Du[k][i];
-             if (errors) e -= Df[k][i];
-             h1 += dx*e*e;
-             for (unsigned int j=0;j<dim;++j)
-               {
-                 e = DDu[k][i][j];
-                 if (errors) e -= DDf[k][i][j];
-                 h2 += dx*e*e;
-               }
-           }
-       }
+
+      for (unsigned int k=0; k<quadrature.size(); ++k)
+        {
+          const double dx = fe.JxW (k);
+          double e =  u_local[k];
+          if (errors) e -= function[k];
+          l2 += dx*e*e;
+          for (unsigned int i=0; i<dim; ++i)
+            {
+              e = Du[k][i];
+              if (errors) e -= Df[k][i];
+              h1 += dx*e*e;
+              for (unsigned int j=0; j<dim; ++j)
+                {
+                  e = DDu[k][i][j];
+                  if (errors) e -= DDf[k][i][j];
+                  h2 += dx*e*e;
+                }
+            }
+        }
     }
-      deallog << "L2: " << l2 << std::endl;
-      deallog << "H1: " << h1 << std::endl;
-      deallog << "H2: " << h2 << std::endl;  
+  deallog << "L2: " << l2 << std::endl;
+  deallog << "H1: " << h1 << std::endl;
+  deallog << "H2: " << h2 << std::endl;
 }
 
 template <int dim>
@@ -186,7 +186,7 @@ void loop ()
       elements.push_back (new FE_Q<dim> (3));
       elements.push_back (new FE_Q<dim> (4));
     }
-  
+
   elements.push_back (new FE_DGQ<dim> (1));
   elements.push_back (new FE_DGQ<dim> (2));
   if (dim<3)
@@ -194,13 +194,13 @@ void loop ()
       elements.push_back (new FE_DGQ<dim> (3));
       elements.push_back (new FE_DGQ<dim> (4));
     }
-  
-  for (unsigned int m=0;m<maps.size();++m)
-    for (unsigned int e=0;e<elements.size();++e)
-    {
-      check (1, *maps[m], *elements[e], gauss);
+
+  for (unsigned int m=0; m<maps.size(); ++m)
+    for (unsigned int e=0; e<elements.size(); ++e)
+      {
+        check (1, *maps[m], *elements[e], gauss);
 //      check (2, *maps[m], *elements[e], gauss);
-    }
+      }
 }
 
 
@@ -208,7 +208,7 @@ int main ()
 {
   std::ofstream logfile ("derivatives/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   if (!errors) deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
index 6a88cd1c44cb16d13110b479f6bd3b2dd10b7813..fde9281cc5e3269df5339050c93b1444ef7cb4d0 100644 (file)
@@ -52,11 +52,11 @@ void test ()
   dof_handler.distribute_dofs (fe);
 
   typename DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active();
+  cell = dof_handler.begin_active();
   ++cell;
 
   typename DoFHandler<dim>::face_iterator
-    face = dof_handler.begin_active()->face(0);
+  face = dof_handler.begin_active()->face(0);
   face = cell->face(0);
   deallog << cell->face(0) << ' ' << face << std::endl;
   Assert (cell->face(0) == face, ExcInternalError());
index f3048a98c991ba58b92cfb6f55acf837569e3620..2179b16b550dcc7addf0b61b2c8d9e53e545ffc9 100644 (file)
@@ -44,7 +44,7 @@ void test()
   Triangulation<dim> triangulation (Triangulation<dim>::limit_level_difference_at_vertices);
 
   FESystem<dim> fe (FE_Q<dim>(3),2,
-                   FE_DGQ<dim>(1),1);
+                    FE_DGQ<dim>(1),1);
 
   DoFHandler<dim> dof_handler (triangulation);
 
@@ -54,33 +54,33 @@ void test()
   const unsigned int n_refinements[] = { 0, 4, 3, 2 };
   for (unsigned int i=0; i<n_refinements[dim]; ++i)
     {
-                                      // refine one-fifth of cells randomly
+      // refine one-fifth of cells randomly
       std::vector<bool> flags (triangulation.n_active_cells(), false);
       for (unsigned int k=0; k<flags.size()/5 + 1; ++k)
-       flags[rand() % flags.size()] = true;
-                                      // make sure there's at least one that
-                                      // will be refined
+        flags[rand() % flags.size()] = true;
+      // make sure there's at least one that
+      // will be refined
       flags[0] = true;
 
-                                      // refine triangulation
+      // refine triangulation
       unsigned int index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = triangulation.begin_active();
-          cell != triangulation.end(); ++cell, ++index)
-       if (flags[index])
-         cell->set_refine_flag();
+           cell = triangulation.begin_active();
+           cell != triangulation.end(); ++cell, ++index)
+        if (flags[index])
+          cell->set_refine_flag();
       Assert (index == triangulation.n_active_cells(), ExcInternalError());
 
-                                      // flag all other cells for coarsening
-                                      // (this should ensure that at least
-                                      // some of them will actually be
-                                      // coarsened)
+      // flag all other cells for coarsening
+      // (this should ensure that at least
+      // some of them will actually be
+      // coarsened)
       index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = triangulation.begin_active();
-          cell != triangulation.end(); ++cell, ++index)
-       if (!flags[index])
-         cell->set_coarsen_flag();
+           cell = triangulation.begin_active();
+           cell != triangulation.end(); ++cell, ++index)
+        if (!flags[index])
+          cell->set_coarsen_flag();
 
       triangulation.execute_coarsening_and_refinement ();
       dof_handler.distribute_dofs (fe);
@@ -92,15 +92,15 @@ void test()
       all.add_range (0, N);
 
       Assert (dof_handler.n_locally_owned_dofs() == N,
-             ExcInternalError());
+              ExcInternalError());
       Assert (dof_handler.locally_owned_dofs() == all,
-             ExcInternalError());
+              ExcInternalError());
       Assert (dof_handler.n_locally_owned_dofs_per_processor() ==
-             std::vector<types::global_dof_index> (1,N),
-             ExcInternalError());
+              std::vector<types::global_dof_index> (1,N),
+              ExcInternalError());
       Assert (dof_handler.locally_owned_dofs_per_processor() ==
-             std::vector<IndexSet>(1,all),
-             ExcInternalError());
+              std::vector<IndexSet>(1,all),
+              ExcInternalError());
     }
 }
 
index 89a8dc0af4381e9e080e6338b2de2d9f5b782e42..3559fa7c05a58e2b89c4f1a245026e4ab42d4ab8 100644 (file)
@@ -42,7 +42,7 @@ void test()
   Triangulation<dim> triangulation (Triangulation<dim>::limit_level_difference_at_vertices);
 
   FESystem<dim> fe (FE_Q<dim>(3),2,
-                   FE_DGQ<dim>(1),1);
+                    FE_DGQ<dim>(1),1);
 
   DoFHandler<dim> dof_handler (triangulation);
 
@@ -52,33 +52,33 @@ void test()
   const unsigned int n_refinements[] = { 0, 4, 3, 2 };
   for (unsigned int i=0; i<n_refinements[dim]; ++i)
     {
-                                      // refine one-fifth of cells randomly
+      // refine one-fifth of cells randomly
       std::vector<bool> flags (triangulation.n_active_cells(), false);
       for (unsigned int k=0; k<flags.size()/5 + 1; ++k)
-       flags[rand() % flags.size()] = true;
-                                      // make sure there's at least one that
-                                      // will be refined
+        flags[rand() % flags.size()] = true;
+      // make sure there's at least one that
+      // will be refined
       flags[0] = true;
 
-                                      // refine triangulation
+      // refine triangulation
       unsigned int index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = triangulation.begin_active();
-          cell != triangulation.end(); ++cell, ++index)
-       if (flags[index])
-         cell->set_refine_flag();
+           cell = triangulation.begin_active();
+           cell != triangulation.end(); ++cell, ++index)
+        if (flags[index])
+          cell->set_refine_flag();
       Assert (index == triangulation.n_active_cells(), ExcInternalError());
 
-                                      // flag all other cells for coarsening
-                                      // (this should ensure that at least
-                                      // some of them will actually be
-                                      // coarsened)
+      // flag all other cells for coarsening
+      // (this should ensure that at least
+      // some of them will actually be
+      // coarsened)
       index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = triangulation.begin_active();
-          cell != triangulation.end(); ++cell, ++index)
-       if (!flags[index])
-         cell->set_coarsen_flag();
+           cell = triangulation.begin_active();
+           cell != triangulation.end(); ++cell, ++index)
+        if (!flags[index])
+          cell->set_coarsen_flag();
 
       triangulation.execute_coarsening_and_refinement ();
       dof_handler.distribute_dofs (fe);
@@ -90,22 +90,22 @@ void test()
       all.add_range (0, N);
 
       Assert (dof_handler.n_locally_owned_dofs() == N,
-             ExcInternalError());
+              ExcInternalError());
       Assert (dof_handler.locally_owned_dofs() == all,
-             ExcInternalError());
+              ExcInternalError());
       Assert (dof_handler.n_locally_owned_dofs_per_processor() ==
-             std::vector<types::global_dof_index> (1,N),
-             ExcInternalError());
+              std::vector<types::global_dof_index> (1,N),
+              ExcInternalError());
       Assert (dof_handler.locally_owned_dofs_per_processor() ==
-             std::vector<IndexSet>(1,all),
-             ExcInternalError());
+              std::vector<IndexSet>(1,all),
+              ExcInternalError());
 
       dof_handler.clear();
       deallog << "those should be zero: "
-             << dof_handler.n_locally_owned_dofs()
-             << " " << dof_handler.n_locally_owned_dofs_per_processor().size()
-             << " " << dof_handler.n_dofs()
-             << std::endl;
+              << dof_handler.n_locally_owned_dofs()
+              << " " << dof_handler.n_locally_owned_dofs_per_processor().size()
+              << " " << dof_handler.n_dofs()
+              << std::endl;
     }
 }
 
index e50e48c060aff53363e0cb2f3fe692fe619446d3..14b5907adcf512d6318d2a951c8d30b26598be28 100644 (file)
@@ -51,7 +51,7 @@ print_dofs (const DoFHandler<dim> &dof)
       deallog << "Cell " << cell << " -- ";
       cell->get_dof_indices (v);
       for (unsigned int i=0; i<v.size(); ++i)
-       deallog << v[i] << ' ';
+        deallog << v[i] << ' ';
       deallog << std::endl;
     }
 }
@@ -69,7 +69,7 @@ print_dofs (const MGDoFHandler<dim> &dof, unsigned int level)
       deallog << "Cell " << cell << " -- ";
       cell->get_mg_dof_indices (v);
       for (unsigned int i=0; i<v.size(); ++i)
-       deallog << v[i] << ' ';
+        deallog << v[i] << ' ';
       deallog << std::endl;
     }
 }
@@ -77,21 +77,21 @@ print_dofs (const MGDoFHandler<dim> &dof, unsigned int level)
 
 template <int dim>
 void
-check_renumbering(MGDoFHandler<dim>mgdof, bool discontinuous)
+check_renumbering(MGDoFHandler<dim> &mgdof, bool discontinuous)
 {
-  const FiniteElement<dim>element = mgdof.get_fe();
-  DoFHandler<dim>dof = mgdof;
+  const FiniteElement<dim> &element = mgdof.get_fe();
+  DoFHandler<dim> &dof = mgdof;
 
-                                  // Prepare a reordering of
-                                  // components for later use
+  // Prepare a reordering of
+  // components for later use
   std::vector<unsigned int> order(element.n_components());
   for (unsigned int i=0; i<order.size(); ++i) order[i] = order.size()-i-1;
 
   Point<dim> direction;
-  for (unsigned int i=0;i<dim;++i)
+  for (unsigned int i=0; i<dim; ++i)
     direction(i) = std::pow(10.,static_cast<double>(i));
 
-                                  // Check global ordering
+  // Check global ordering
   print_dofs (dof);
 
   if (discontinuous)
@@ -117,8 +117,8 @@ check_renumbering(MGDoFHandler<dim>& mgdof, bool discontinuous)
   DoFRenumbering::sort_selected_dofs_back (dof, selected_dofs);
   print_dofs (dof);
 
-                                  // Check level ordering
-  for (unsigned int level=0;level<dof.get_tria().n_levels();++level)
+  // Check level ordering
+  for (unsigned int level=0; level<dof.get_tria().n_levels(); ++level)
     {
       print_dofs (mgdof, level);
 
@@ -129,17 +129,17 @@ check_renumbering(MGDoFHandler<dim>& mgdof, bool discontinuous)
 //        print_dofs (mgdof, level);
 
       if (discontinuous)
-       {
-         DoFRenumbering::downstream(mgdof, level, direction);
-       }
-
-                                       // renumber the non-MG part of the
-                                       // DoFHandler again. this is probably
-                                       // not what was meant in the first
-                                       // place, but is compatible with the
-                                       // behavior of the
-                                       // DoFRenumbering::component_wise set
-                                       // of functions before December 2005
+        {
+          DoFRenumbering::downstream(mgdof, level, direction);
+        }
+
+      // renumber the non-MG part of the
+      // DoFHandler again. this is probably
+      // not what was meant in the first
+      // place, but is compatible with the
+      // behavior of the
+      // DoFRenumbering::component_wise set
+      // of functions before December 2005
       DoFRenumbering::component_wise (static_cast<DoFHandler<dim>&>(mgdof),
                                       order);
       print_dofs (mgdof, level);
index 867554a1755de8e1b07b284941fab72ed15d6e2f..bf43c42837d894c7e54fd1f499798a85e3296d83 100644 (file)
@@ -43,7 +43,7 @@ template <int dim>
 void
 print_dofs (const DoFHandler<dim> &dof)
 {
-  const FiniteElement<dim>fe = dof.get_fe();
+  const FiniteElement<dim> &fe = dof.get_fe();
   std::vector<types::global_dof_index> v (fe.dofs_per_cell);
   std_cxx1x::shared_ptr<FEValues<dim> > fevalues;
 
@@ -58,14 +58,14 @@ print_dofs (const DoFHandler<dim> &dof)
     {
       Point<dim> p = cell->center();
       if (fevalues.get() != 0)
-       fevalues->reinit(cell);
+        fevalues->reinit(cell);
 
       cell->get_dof_indices (v);
       for (unsigned int i=0; i<v.size(); ++i)
-       if (fevalues.get() != 0)
-         deallog << fevalues->quadrature_point(i) << '\t' << v[i] << std::endl;
-       else
-         deallog << p << '\t' << v[i] << std::endl;
+        if (fevalues.get() != 0)
+          deallog << fevalues->quadrature_point(i) << '\t' << v[i] << std::endl;
+        else
+          deallog << p << '\t' << v[i] << std::endl;
       deallog << std::endl;
     }
 }
@@ -76,7 +76,7 @@ template <int dim>
 void
 print_dofs (const MGDoFHandler<dim> &dof, unsigned int level)
 {
-  const FiniteElement<dim>fe = dof.get_fe();
+  const FiniteElement<dim> &fe = dof.get_fe();
   std::vector<types::global_dof_index> v (fe.dofs_per_cell);
   std_cxx1x::shared_ptr<FEValues<dim> > fevalues;
 
@@ -91,14 +91,14 @@ print_dofs (const MGDoFHandler<dim> &dof, unsigned int level)
     {
       Point<dim> p = cell->center();
       if (fevalues.get() != 0)
-       fevalues->reinit(cell);
+        fevalues->reinit(cell);
 
       cell->get_mg_dof_indices (v);
       for (unsigned int i=0; i<v.size(); ++i)
-       if (fevalues.get() != 0)
-         deallog << fevalues->quadrature_point(i) << '\t' << v[i] << std::endl;
-       else
-         deallog << p << '\t' << v[i] << std::endl;
+        if (fevalues.get() != 0)
+          deallog << fevalues->quadrature_point(i) << '\t' << v[i] << std::endl;
+        else
+          deallog << p << '\t' << v[i] << std::endl;
       deallog << std::endl;
     }
 }
@@ -106,26 +106,26 @@ print_dofs (const MGDoFHandler<dim> &dof, unsigned int level)
 
 template <int dim>
 void
-check_renumbering(MGDoFHandler<dim>mgdof)
+check_renumbering(MGDoFHandler<dim> &mgdof)
 {
-  const FiniteElement<dim>element = mgdof.get_fe();
-  DoFHandler<dim>dof = mgdof;
+  const FiniteElement<dim> &element = mgdof.get_fe();
+  DoFHandler<dim> &dof = mgdof;
   deallog << element.get_name() << std::endl;
 
-                                  // Prepare a reordering of
-                                  // components for later use
+  // Prepare a reordering of
+  // components for later use
   std::vector<unsigned int> order(element.n_components());
   for (unsigned int i=0; i<order.size(); ++i) order[i] = order.size()-i-1;
 
   Point<dim> direction;
-  for (unsigned int i=0;i<dim;++i)
+  for (unsigned int i=0; i<dim; ++i)
     direction(i) = -5.0001+i;
 
   deallog << std::endl << "Downstream numbering cell-wise" << std::endl;
   DoFRenumbering::downstream(dof, direction);
   print_dofs (dof);
-                                  // Check level ordering
-  for (unsigned int level=0;level<dof.get_tria().n_levels();++level)
+  // Check level ordering
+  for (unsigned int level=0; level<dof.get_tria().n_levels(); ++level)
     {
       deallog << "Level " << level << std::endl;
       DoFRenumbering::downstream(mgdof, level, direction);
@@ -135,8 +135,8 @@ check_renumbering(MGDoFHandler<dim>& mgdof)
   deallog << std::endl << "Downstream numbering dof-wise" << std::endl;
   DoFRenumbering::downstream(dof, direction, true);
   print_dofs (dof);
-                                  // Check level ordering
-  for (unsigned int level=0;level<dof.get_tria().n_levels();++level)
+  // Check level ordering
+  for (unsigned int level=0; level<dof.get_tria().n_levels(); ++level)
     {
       deallog << "Level " << level << std::endl;
       DoFRenumbering::downstream(mgdof, level, direction, true);
index 458d4278291f9d5a8e36a308fb9c8046bacc1a19..1fb0720e938a063766b53e735645aba2cf2bc4b0 100644 (file)
@@ -43,7 +43,7 @@ template <int dim>
 void
 print_dofs (const DoFHandler<dim> &dof)
 {
-  const FiniteElement<dim>fe = dof.get_fe();
+  const FiniteElement<dim> &fe = dof.get_fe();
   std::vector<types::global_dof_index> v (fe.dofs_per_cell);
   std_cxx1x::shared_ptr<FEValues<dim> > fevalues;
 
@@ -58,14 +58,14 @@ print_dofs (const DoFHandler<dim> &dof)
     {
       Point<dim> p = cell->center();
       if (fevalues.get() != 0)
-       fevalues->reinit(cell);
+        fevalues->reinit(cell);
 
       cell->get_dof_indices (v);
       for (unsigned int i=0; i<v.size(); ++i)
-       if (fevalues.get() != 0)
-         deallog << fevalues->quadrature_point(i) << '\t' << v[i] << std::endl;
-       else
-         deallog << p << '\t' << v[i] << std::endl;
+        if (fevalues.get() != 0)
+          deallog << fevalues->quadrature_point(i) << '\t' << v[i] << std::endl;
+        else
+          deallog << p << '\t' << v[i] << std::endl;
       deallog << std::endl;
     }
 }
@@ -74,9 +74,9 @@ print_dofs (const DoFHandler<dim> &dof)
 
 template <int dim>
 void
-check_renumbering(DoFHandler<dim>dof)
+check_renumbering(DoFHandler<dim> &dof)
 {
-  const FiniteElement<dim>element = dof.get_fe();
+  const FiniteElement<dim> &element = dof.get_fe();
   deallog << element.get_name() << std::endl;
 
   DoFRenumbering::Cuthill_McKee(dof);
@@ -105,7 +105,7 @@ check ()
 
   {
     FESystem<dim> fe(FE_DGQ<dim>(1),1,
-                    FE_Q<dim>(2),dim);
+                     FE_Q<dim>(2),dim);
     DoFHandler<dim> dof(tr);
 
     dof.distribute_dofs(fe);
index bea23fc33a7fb7f677cf021d33b94e613b2d10d7..aada85a6f1245d197981d1f58e9d2f595fde0997 100644 (file)
@@ -43,7 +43,7 @@ template <int dim>
 void
 print_dofs (const DoFHandler<dim> &dof)
 {
-  const FiniteElement<dim>fe = dof.get_fe();
+  const FiniteElement<dim> &fe = dof.get_fe();
   std::vector<types::global_dof_index> v (fe.dofs_per_cell);
   std_cxx1x::shared_ptr<FEValues<dim> > fevalues;
 
@@ -58,14 +58,14 @@ print_dofs (const DoFHandler<dim> &dof)
     {
       Point<dim> p = cell->center();
       if (fevalues.get() != 0)
-       fevalues->reinit(cell);
+        fevalues->reinit(cell);
 
       cell->get_dof_indices (v);
       for (unsigned int i=0; i<v.size(); ++i)
-       if (fevalues.get() != 0)
-         deallog << fevalues->quadrature_point(i) << '\t' << v[i] << std::endl;
-       else
-         deallog << p << '\t' << v[i] << std::endl;
+        if (fevalues.get() != 0)
+          deallog << fevalues->quadrature_point(i) << '\t' << v[i] << std::endl;
+        else
+          deallog << p << '\t' << v[i] << std::endl;
       deallog << std::endl;
     }
 }
@@ -74,9 +74,9 @@ print_dofs (const DoFHandler<dim> &dof)
 
 template <int dim>
 void
-check_renumbering(DoFHandler<dim>dof)
+check_renumbering(DoFHandler<dim> &dof)
 {
-  const FiniteElement<dim>element = dof.get_fe();
+  const FiniteElement<dim> &element = dof.get_fe();
   deallog << element.get_name() << std::endl;
 
   DoFRenumbering::boost::Cuthill_McKee(dof);
@@ -105,7 +105,7 @@ check ()
 
   {
     FESystem<dim> fe(FE_DGQ<dim>(1),1,
-                    FE_Q<dim>(2),dim);
+                     FE_Q<dim>(2),dim);
     DoFHandler<dim> dof(tr);
 
     dof.distribute_dofs(fe);
index f29e32a48806082c77d8fd53f35999ff5dc17ed4..fa01980a5f4c79d31ad3414e98e2d25c9bad1016 100644 (file)
@@ -52,7 +52,7 @@ print_dofs (const DoFHandler<dim> &dof)
       cell->get_dof_indices (v);
       deallog << "cell=" << cell << std::endl;
       for (unsigned int i=0; i<v.size(); ++i)
-       deallog << v[i] << std::endl;
+        deallog << v[i] << std::endl;
     }
 }
 
@@ -68,7 +68,7 @@ check ()
 
   FESystem<dim> fe(FE_Q<dim>(2),2);
   DoFHandler<dim> dof(tr);
-  
+
   dof.distribute_dofs(fe);
   std::vector<types::global_dof_index> new_dofs (dof.n_dofs());
   DoFRenumbering::boost::compute_Cuthill_McKee(new_dofs, dof);
index 0dc0fb7a54babd84f1c9a72980c3087e023107f4..cf452e88e25ee7525c98694ce880e38844fd3d7b 100644 (file)
@@ -43,7 +43,7 @@ template <int dim>
 void
 print_dofs (const DoFHandler<dim> &dof)
 {
-  const FiniteElement<dim>fe = dof.get_fe();
+  const FiniteElement<dim> &fe = dof.get_fe();
   std::vector<types::global_dof_index> v (fe.dofs_per_cell);
   std_cxx1x::shared_ptr<FEValues<dim> > fevalues;
 
@@ -58,14 +58,14 @@ print_dofs (const DoFHandler<dim> &dof)
     {
       Point<dim> p = cell->center();
       if (fevalues.get() != 0)
-       fevalues->reinit(cell);
+        fevalues->reinit(cell);
 
       cell->get_dof_indices (v);
       for (unsigned int i=0; i<v.size(); ++i)
-       if (fevalues.get() != 0)
-         deallog << fevalues->quadrature_point(i) << '\t' << v[i] << std::endl;
-       else
-         deallog << p << '\t' << v[i] << std::endl;
+        if (fevalues.get() != 0)
+          deallog << fevalues->quadrature_point(i) << '\t' << v[i] << std::endl;
+        else
+          deallog << p << '\t' << v[i] << std::endl;
       deallog << std::endl;
     }
 }
@@ -74,9 +74,9 @@ print_dofs (const DoFHandler<dim> &dof)
 
 template <int dim>
 void
-check_renumbering(DoFHandler<dim>dof)
+check_renumbering(DoFHandler<dim> &dof)
 {
-  const FiniteElement<dim>element = dof.get_fe();
+  const FiniteElement<dim> &element = dof.get_fe();
   deallog << element.get_name() << std::endl;
 
   DoFRenumbering::boost::king_ordering(dof);
@@ -105,7 +105,7 @@ check ()
 
   {
     FESystem<dim> fe(FE_DGQ<dim>(1),1,
-                    FE_Q<dim>(2),dim);
+                     FE_Q<dim>(2),dim);
     DoFHandler<dim> dof(tr);
 
     dof.distribute_dofs(fe);
index c54c8188d83682ddb4e75b7d3e32365b6e81a261..8ef4708abed868675a3ac0e6248c6fb4d2d34b27 100644 (file)
@@ -43,7 +43,7 @@ template <int dim>
 void
 print_dofs (const DoFHandler<dim> &dof)
 {
-  const FiniteElement<dim>fe = dof.get_fe();
+  const FiniteElement<dim> &fe = dof.get_fe();
   std::vector<types::global_dof_index> v (fe.dofs_per_cell);
   std_cxx1x::shared_ptr<FEValues<dim> > fevalues;
 
@@ -58,14 +58,14 @@ print_dofs (const DoFHandler<dim> &dof)
     {
       Point<dim> p = cell->center();
       if (fevalues.get() != 0)
-       fevalues->reinit(cell);
+        fevalues->reinit(cell);
 
       cell->get_dof_indices (v);
       for (unsigned int i=0; i<v.size(); ++i)
-       if (fevalues.get() != 0)
-         deallog << fevalues->quadrature_point(i) << '\t' << v[i] << std::endl;
-       else
-         deallog << p << '\t' << v[i] << std::endl;
+        if (fevalues.get() != 0)
+          deallog << fevalues->quadrature_point(i) << '\t' << v[i] << std::endl;
+        else
+          deallog << p << '\t' << v[i] << std::endl;
       deallog << std::endl;
     }
 }
@@ -74,9 +74,9 @@ print_dofs (const DoFHandler<dim> &dof)
 
 template <int dim>
 void
-check_renumbering(DoFHandler<dim>dof)
+check_renumbering(DoFHandler<dim> &dof)
 {
-  const FiniteElement<dim>element = dof.get_fe();
+  const FiniteElement<dim> &element = dof.get_fe();
   deallog << element.get_name() << std::endl;
 
   DoFRenumbering::boost::minimum_degree(dof);
@@ -105,7 +105,7 @@ check ()
 
   {
     FESystem<dim> fe(FE_DGQ<dim>(1),1,
-                    FE_Q<dim>(2),dim);
+                     FE_Q<dim>(2),dim);
     DoFHandler<dim> dof(tr);
 
     dof.distribute_dofs(fe);
index 70498ea737c292a8126b0434eb20c1cfaf143ad6..8640b03a7e05ced710465191a906e21489ec0a1e 100644 (file)
@@ -42,7 +42,7 @@ template <int dim>
 void
 print_dofs (const DoFHandler<dim> &dof)
 {
-  const FiniteElement<dim>fe = dof.get_fe();
+  const FiniteElement<dim> &fe = dof.get_fe();
   std::vector<types::global_dof_index> v (fe.dofs_per_cell);
   std_cxx1x::shared_ptr<FEValues<dim> > fevalues;
 
@@ -57,14 +57,14 @@ print_dofs (const DoFHandler<dim> &dof)
     {
       Point<dim> p = cell->center();
       if (fevalues.get() != 0)
-       fevalues->reinit(cell);
+        fevalues->reinit(cell);
 
       cell->get_dof_indices (v);
       for (unsigned int i=0; i<v.size(); ++i)
-       if (fevalues.get() != 0)
-         deallog << fevalues->quadrature_point(i) << '\t' << v[i] << std::endl;
-       else
-         deallog << p << '\t' << v[i] << std::endl;
+        if (fevalues.get() != 0)
+          deallog << fevalues->quadrature_point(i) << '\t' << v[i] << std::endl;
+        else
+          deallog << p << '\t' << v[i] << std::endl;
       deallog << std::endl;
     }
 }
@@ -73,13 +73,13 @@ print_dofs (const DoFHandler<dim> &dof)
 
 template <int dim>
 void
-check_renumbering(DoFHandler<dim>dof)
+check_renumbering(DoFHandler<dim> &dof)
 {
-  const FiniteElement<dim>element = dof.get_fe();
+  const FiniteElement<dim> &element = dof.get_fe();
   deallog << element.get_name() << std::endl;
 
   DoFRenumbering::boost::Cuthill_McKee(dof);
-  for (unsigned int level=0;level<dof.get_tria().n_levels();++level)
+  for (unsigned int level=0; level<dof.get_tria().n_levels(); ++level)
     DoFRenumbering::Cuthill_McKee(dof, level);
   print_dofs (dof);
 }
@@ -107,7 +107,7 @@ check ()
 
   {
     FESystem<dim> fe(FE_DGQ<dim>(1),1,
-                    FE_Q<dim>(2),dim);
+                     FE_Q<dim>(2),dim);
     DoFHandler<dim> dof(tr);
 
     dof.distribute_dofs(fe);
index bc450673e8a482dcbdd148662d1b360e4686349f..f91737a821f391cea17c1c2bc02e96df0bade27d 100644 (file)
@@ -39,9 +39,9 @@
 
 template <int dim, class stream>
 void
-print_dofs (const DoFHandler<dim> &dof, stream & out)
+print_dofs (const DoFHandler<dim> &dof, stream &out)
 {
-  const FiniteElement<dim>fe = dof.get_fe();
+  const FiniteElement<dim> &fe = dof.get_fe();
   std::vector<types::global_dof_index> v (fe.dofs_per_cell);
   std_cxx1x::shared_ptr<FEValues<dim> > fevalues;
 
@@ -56,14 +56,14 @@ print_dofs (const DoFHandler<dim> &dof, stream & out)
     {
       Point<dim> p = cell->center();
       if (fevalues.get() != 0)
-       fevalues->reinit(cell);
+        fevalues->reinit(cell);
 
       cell->get_dof_indices (v);
       for (unsigned int i=0; i<v.size(); ++i)
-       if (fevalues.get() != 0)
-         out << fevalues->quadrature_point(i) << '\t' << v[i] << std::endl;
-       else
-         out << p << '\t' << v[i] << std::endl;
+        if (fevalues.get() != 0)
+          out << fevalues->quadrature_point(i) << '\t' << v[i] << std::endl;
+        else
+          out << p << '\t' << v[i] << std::endl;
       out << std::endl;
     }
 }
@@ -93,7 +93,7 @@ check ()
   print_dofs(dof, o2);
 
   if (o1.str()==o2.str())
-       deallog << "OK" << std::endl;
+    deallog << "OK" << std::endl;
 
 }
 
index e2477cd1cc2953b3fa9c5061557fcdb890d3b5e5..0209a067252e1911a8ccd085fd485beff85866de 100644 (file)
 
 template <int dim, class stream>
 void
-print_dofs (const DoFHandler<dim> &dof, stream & out)
+print_dofs (const DoFHandler<dim> &dof, stream &out)
 {
   out << std::setprecision (2);
   out << std::fixed;
-  const FiniteElement<dim>fe = dof.get_fe();
+  const FiniteElement<dim> &fe = dof.get_fe();
   std::vector<types::global_dof_index> v (fe.dofs_per_cell);
   std_cxx1x::shared_ptr<FEValues<dim> > fevalues;
 
@@ -59,14 +59,14 @@ print_dofs (const DoFHandler<dim> &dof, stream & out)
     {
       Point<dim> p = cell->center();
       if (fevalues.get() != 0)
-       fevalues->reinit(cell);
+        fevalues->reinit(cell);
 
       cell->get_dof_indices (v);
       for (unsigned int i=0; i<v.size(); ++i)
-       if (fevalues.get() != 0)
-         out << fevalues->quadrature_point(i) << '\t' << v[i] << std::endl;
-       else
-         out << p << '\t' << v[i] << std::endl;
+        if (fevalues.get() != 0)
+          out << fevalues->quadrature_point(i) << '\t' << v[i] << std::endl;
+        else
+          out << p << '\t' << v[i] << std::endl;
     }
 }
 
@@ -99,9 +99,9 @@ check ()
   deallog << o2.str();
 
   if (o1.str()!=o2.str())
-       deallog << "OK" << std::endl;
+    deallog << "OK" << std::endl;
   else
-       Assert(false, ExcInternalError());
+    Assert(false, ExcInternalError());
 
   DoFRenumbering::hierarchical(dof);
   print_dofs(dof, o3);
@@ -109,9 +109,9 @@ check ()
 
   // doing renumbering twice does not change the result?!
   if (o2.str()==o3.str())
-       deallog << "OK" << std::endl;
+    deallog << "OK" << std::endl;
   else
-       Assert(false, ExcInternalError());
+    Assert(false, ExcInternalError());
 
 }
 
index 388855afbd15d1863c4fe62bd127d75b3c94730e..c6769d4d0c38df9a8f0240da17357bdb8f0faf5d 100644 (file)
@@ -48,35 +48,35 @@ class Ball
   :
   public StraightBoundary<dim>
 {
-  public:
-    virtual Point<dim>
-    get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const
-      {
-       Point<dim> middle = StraightBoundary<dim>::get_new_point_on_line(line);
-      
-       for (int i=0; i<dim; ++i)
-         middle(i) -= .5;
-       middle *= std::sqrt(static_cast<double>(dim)) / (std::sqrt(middle.square())*2);
-       for (int i=0; i<dim; ++i)
-         middle(i) += .5;
-      
-       return middle;
-      }
-
-
-    virtual Point<dim>
-    get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const
-      {
-       Point<dim> middle = StraightBoundary<dim>::get_new_point_on_quad(quad);
-      
-       for (int i=0; i<dim; ++i)
-         middle(i) -= .5;
-       middle *= std::sqrt(static_cast<double>(dim)) / (std::sqrt(middle.square())*2);
-       for (int i=0; i<dim; ++i)
-         middle(i) += .5;
-      
-       return middle;
-      }
+public:
+  virtual Point<dim>
+  get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const
+  {
+    Point<dim> middle = StraightBoundary<dim>::get_new_point_on_line(line);
+
+    for (int i=0; i<dim; ++i)
+      middle(i) -= .5;
+    middle *= std::sqrt(static_cast<double>(dim)) / (std::sqrt(middle.square())*2);
+    for (int i=0; i<dim; ++i)
+      middle(i) += .5;
+
+    return middle;
+  }
+
+
+  virtual Point<dim>
+  get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const
+  {
+    Point<dim> middle = StraightBoundary<dim>::get_new_point_on_quad(quad);
+
+    for (int i=0; i<dim; ++i)
+      middle(i) -= .5;
+    middle *= std::sqrt(static_cast<double>(dim)) / (std::sqrt(middle.square())*2);
+    for (int i=0; i<dim; ++i)
+      middle(i) += .5;
+
+    return middle;
+  }
 };
 
 
@@ -85,12 +85,12 @@ class CurvedLine
   :
   public StraightBoundary<dim>
 {
-  public:
-    virtual Point<dim>
-    get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const;
+public:
+  virtual Point<dim>
+  get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const;
 
-    virtual Point<dim>
-    get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const;
+  virtual Point<dim>
+  get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const;
 };
 
 
@@ -100,45 +100,44 @@ CurvedLine<dim>::get_new_point_on_line (const typename Triangulation<dim>::line_
 {
   Point<dim> middle = StraightBoundary<dim>::get_new_point_on_line (line);
 
-                                  // if the line is at the top of bottom
-                                  // face: do a special treatment on
-                                  // this line. Note that if the
-                                  // z-value of the midpoint is either
-                                  // 0 or 1, then the z-values of all
-                                  // vertices of the line is like that
+  // if the line is at the top of bottom
+  // face: do a special treatment on
+  // this line. Note that if the
+  // z-value of the midpoint is either
+  // 0 or 1, then the z-values of all
+  // vertices of the line is like that
   if (dim>=3)
     if (((middle(2) == 0) || (middle(2) == 1))
-                                      // find out, if the line is in the
-                                      // interior of the top or bottom face
-                                      // of the domain, or at the edge.
-                                      // lines at the edge need to undergo
-                                      // the usual treatment, while for
-                                      // interior lines taking the midpoint
-                                      // is sufficient
-                                      //
-                                      // note: the trick with the boundary
-                                      // id was invented after the above was
-                                      // written, so we are not very strict
-                                      // here with using these flags
-       && (line->boundary_indicator() == 1))
+        // find out, if the line is in the
+        // interior of the top or bottom face
+        // of the domain, or at the edge.
+        // lines at the edge need to undergo
+        // the usual treatment, while for
+        // interior lines taking the midpoint
+        // is sufficient
+        //
+        // note: the trick with the boundary
+        // id was invented after the above was
+        // written, so we are not very strict
+        // here with using these flags
+        && (line->boundary_indicator() == 1))
       return middle;
 
 
   double x=middle(0),
-        y=middle(1);
-  
+         y=middle(1);
+
   if (y<x)
     if (y<1-x)
       middle(1) = 0.04*std::sin(6*3.141592*middle(0));
     else
       middle(0) = 1+0.04*std::sin(6*3.141592*middle(1));
-  
+
+  else if (y<1-x)
+    middle(0) = 0.04*std::sin(6*3.141592*middle(1));
   else
-    if (y<1-x)
-      middle(0) = 0.04*std::sin(6*3.141592*middle(1));
-    else
-      middle(1) = 1+0.04*std::sin(6*3.141592*middle(0));
-  
+    middle(1) = 1+0.04*std::sin(6*3.141592*middle(0));
+
   return middle;
 }
 
@@ -150,30 +149,29 @@ CurvedLine<dim>::get_new_point_on_quad (const typename Triangulation<dim>::quad_
 {
   Point<dim> middle = StraightBoundary<dim>::get_new_point_on_quad (quad);
 
-                                  // if the face is at the top of bottom
-                                  // face: do not move the midpoint in
-                                  // x/y direction. Note that if the
-                                  // z-value of the midpoint is either
-                                  // 0 or 1, then the z-values of all
-                                  // vertices of the quad is like that
+  // if the face is at the top of bottom
+  // face: do not move the midpoint in
+  // x/y direction. Note that if the
+  // z-value of the midpoint is either
+  // 0 or 1, then the z-values of all
+  // vertices of the quad is like that
   if ((middle(2) == 0) || (middle(2) == 1))
     return middle;
-  
+
   double x=middle(0),
-        y=middle(1);
-  
+         y=middle(1);
+
   if (y<x)
     if (y<1-x)
       middle(1) = 0.04*std::sin(6*3.141592*middle(0));
     else
       middle(0) = 1+0.04*std::sin(6*3.141592*middle(1));
-  
+
+  else if (y<1-x)
+    middle(0) = 0.04*std::sin(6*3.141592*middle(1));
   else
-    if (y<1-x)
-      middle(0) = 0.04*std::sin(6*3.141592*middle(1));
-    else
-      middle(1) = 1+0.04*std::sin(6*3.141592*middle(0));
-  
+    middle(1) = 1+0.04*std::sin(6*3.141592*middle(0));
+
   return middle;
 }
 
@@ -182,30 +180,30 @@ CurvedLine<dim>::get_new_point_on_quad (const typename Triangulation<dim>::quad_
 template <int dim>
 class TestCases
 {
-  public:
-    TestCases ();
-    virtual ~TestCases ();
-    
-    virtual void create_new ();
-    virtual void run (const unsigned int testcase);
-
-  private:
-    Triangulation<dim> *tria;
-    DoFHandler<dim>    *dof;
-    CurvedLine<dim> curved_line;
-    Ball<dim> ball;
+public:
+  TestCases ();
+  virtual ~TestCases ();
+
+  virtual void create_new ();
+  virtual void run (const unsigned int testcase);
+
+private:
+  Triangulation<dim> *tria;
+  DoFHandler<dim>    *dof;
+  CurvedLine<dim> curved_line;
+  Ball<dim> ball;
 };
 
 
 
 template <int dim>
 TestCases<dim>::TestCases () :
-               tria(0), dof(0) {}
+  tria(0), dof(0) {}
 
 
 
 template <int dim>
-TestCases<dim>::~TestCases () 
+TestCases<dim>::~TestCases ()
 {
   if (dof)  delete dof;
   if (tria) delete tria;
@@ -231,72 +229,72 @@ template <int dim>
 void TestCases<dim>::run (const unsigned int test_case)
 {
   deallog << "Dimension = " << dim
-       << ", Test case = " << test_case << std::endl
-       << std::endl;
-  
-  deallog << "    Making grid..." << std::endl;  
-  
-  switch (test_case) 
+          << ", Test case = " << test_case << std::endl
+          << std::endl;
+
+  deallog << "    Making grid..." << std::endl;
+
+  switch (test_case)
+    {
+    case 1:
+    {
+      // refine first cell
+      tria->begin_active()->set_refine_flag();
+      tria->execute_coarsening_and_refinement ();
+      // refine first active cell
+      // on coarsest level
+      tria->begin_active()->set_refine_flag ();
+      tria->execute_coarsening_and_refinement ();
+
+      typename Triangulation<dim>::active_cell_iterator cell;
+      for (int i=0; i<(dim==2 ? 3 : 2); ++i)
+        {
+          // refine the presently
+          // second last cell 17
+          // times
+          cell = tria->last_active(tria->n_levels()-1);
+          --cell;
+          cell->set_refine_flag ();
+          tria->execute_coarsening_and_refinement ();
+        };
+
+      break;
+    }
+
+    case 2:
+    case 3:
     {
-      case 1: 
-      {
-                                        // refine first cell
-       tria->begin_active()->set_refine_flag();
-       tria->execute_coarsening_and_refinement ();
-                                        // refine first active cell
-                                        // on coarsest level
-       tria->begin_active()->set_refine_flag ();
-       tria->execute_coarsening_and_refinement ();
-
-       typename Triangulation<dim>::active_cell_iterator cell;
-       for (int i=0; i<(dim==2 ? 3 : 2); ++i) 
-         {
-                                            // refine the presently
-                                            // second last cell 17
-                                            // times
-           cell = tria->last_active(tria->n_levels()-1);
-           --cell;
-           cell->set_refine_flag ();
-           tria->execute_coarsening_and_refinement ();
-         };
-
-       break;
-      }
-      
-      case 2:
-      case 3:
-      {
-       if (dim==3)
-         {
-           tria->begin_active()->face(4)->set_boundary_indicator(1);
-           tria->begin_active()->face(5)->set_boundary_indicator(1);
-         };
-       
-                                        // set the boundary function
-       tria->set_boundary(1, (test_case==2)
-                          ? ((Boundary<dim>&)ball) : ((Boundary<dim>&)curved_line));
-       
-                                        // refine once
-       tria->begin_active()->set_refine_flag();
-       tria->execute_coarsening_and_refinement ();
-       
-       typename Triangulation<dim>::active_cell_iterator cell, endc;
-       for (int i=0; i<4-dim; ++i) 
-         {
-           cell = tria->begin_active();
-           endc = tria->end();
-           
-                                            // refine all
-                                            // boundary cells
-           for (; cell!=endc; ++cell)
-             if (cell->at_boundary())
-               cell->set_refine_flag();
-           
-           tria->execute_coarsening_and_refinement();
-         };
-       
-       break;
-      }
+      if (dim==3)
+        {
+          tria->begin_active()->face(4)->set_boundary_indicator(1);
+          tria->begin_active()->face(5)->set_boundary_indicator(1);
+        };
+
+      // set the boundary function
+      tria->set_boundary(1, (test_case==2)
+                         ? ((Boundary<dim> &)ball) : ((Boundary<dim> &)curved_line));
+
+      // refine once
+      tria->begin_active()->set_refine_flag();
+      tria->execute_coarsening_and_refinement ();
+
+      typename Triangulation<dim>::active_cell_iterator cell, endc;
+      for (int i=0; i<4-dim; ++i)
+        {
+          cell = tria->begin_active();
+          endc = tria->end();
+
+          // refine all
+          // boundary cells
+          for (; cell!=endc; ++cell)
+            if (cell->at_boundary())
+              cell->set_refine_flag();
+
+          tria->execute_coarsening_and_refinement();
+        };
+
+      break;
+    }
     };
 
 
@@ -306,9 +304,9 @@ void TestCases<dim>::run (const unsigned int test_case)
 
   deallog << "    Renumbering degrees of freedom..." << std::endl;
   DoFRenumbering::Cuthill_McKee (*dof);
-    
+
   SparsityPattern sparsity (dof->n_dofs(),
-                           dof->max_couplings_between_dofs());
+                            dof->max_couplings_between_dofs());
 
 
   DoFTools::make_sparsity_pattern (*dof, sparsity);
@@ -318,28 +316,28 @@ void TestCases<dim>::run (const unsigned int test_case)
   sparsity.print_gnuplot (logfile);
 
 
-                                  // computing constraints
+  // computing constraints
   deallog << "    Computing constraints..." << std::endl;
   ConstraintMatrix constraints;
   DoFTools::make_hanging_node_constraints (*dof, constraints);
   constraints.close ();
   constraints.condense (sparsity);
-  
+
   deallog << "    Writing condensed sparsity pattern..." << std::endl;
   sparsity.print_gnuplot (logfile);
 
 
   deallog << std::endl
-         << "    Total number of cells         = " << tria->n_cells() << std::endl
-         << "    Total number of active cells  = " << tria->n_active_cells() << std::endl
-         << "    Number of DoFs                = " << dof->n_dofs() << std::endl
-         << "    Number of constraints         = " << constraints.n_constraints() << std::endl
-         << "    Unconstrained matrix bandwidth= " << unconstrained_bandwidth << std::endl
-         << "    Constrained matrix bandwidth  = " << sparsity.bandwidth()
-         << std::endl << std::endl;
-
-                                  // release the lock that dof has to the
-                                  // finite element object
+          << "    Total number of cells         = " << tria->n_cells() << std::endl
+          << "    Total number of active cells  = " << tria->n_active_cells() << std::endl
+          << "    Number of DoFs                = " << dof->n_dofs() << std::endl
+          << "    Number of constraints         = " << constraints.n_constraints() << std::endl
+          << "    Unconstrained matrix bandwidth= " << unconstrained_bandwidth << std::endl
+          << "    Constrained matrix bandwidth  = " << sparsity.bandwidth()
+          << std::endl << std::endl;
+
+  // release the lock that dof has to the
+  // finite element object
   dof->clear ();
 }
 
@@ -364,7 +362,7 @@ int main ()
       tests.create_new ();
       tests.run (test_case);
     };
-  
+
   return 0;
 }
 
index 67b234a8d34dc998df264ccc2659ebbd9d87be51..4d5db1474c2229b71ca88f01cc50a8f59b3c4268 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim>(2) {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square(); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { values(0) = value(p,0);
-       values(1) = value(p,1); }
+public:
+  MySquareFunction () : Function<dim>(2) {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square();
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+    values(1) = value(p,1);
+  }
 };
 
 
 
 template <int dim>
 Quadrature<dim-1> &
-get_q_face (Function<dim>&)
+get_q_face (Function<dim> &)
 {
   static QGauss<dim-1> q(4);
   return q;
@@ -66,7 +70,7 @@ get_q_face (Function<dim>&)
 
 
 Quadrature<0> &
-get_q_face (Function<1>&)
+get_q_face (Function<1> &)
 {
   Quadrature<0> *q = 0;
   return *q;
@@ -80,8 +84,8 @@ void
 check ()
 {
   Functions::CosineFunction<dim> function;
-  
-  Triangulation<dim> tr;  
+
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -91,7 +95,7 @@ check ()
   tr.execute_coarsening_and_refinement ();
   if (dim==1)
     tr.refine_global(2);
-  
+
   FE_Q<dim> element(3);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
@@ -101,14 +105,14 @@ check ()
 
   std::map<types::boundary_id,const Function<dim>*> neumann_bc;
   neumann_bc[0] = &function;
-  
+
   Vector<double> v (dof.n_dofs());
   VectorTools::interpolate (mapping, dof, function, v);
 
   Vector<float> error (tr.n_active_cells());
 
   KellyErrorEstimator<dim>::estimate (mapping, dof, q_face, neumann_bc,
-                                     v, error);
+                                      v, error);
 
   deallog << "Estimated error:" << std::endl;
   for (unsigned int i=0; i<error.size(); ++i)
@@ -120,7 +124,7 @@ int main ()
 {
   std::ofstream logfile ("error_estimator/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 7f04571b7c1c602b68a6fc1b0e20687ba1b0a161..02b7260344868ee3e1e7fc1a4f76e561e88b7ca9 100644 (file)
@@ -44,14 +44,14 @@ check ()
 {
   Functions::CosineFunction<spacedim> function;
   Triangulation<dim,spacedim> tr;
-  
+
   GridGenerator::hyper_cube(tr, -1,1);
 
   tr.refine_global (1);
   tr.begin_active()->set_refine_flag ();
   tr.execute_coarsening_and_refinement ();
-  
+
+
   FE_Q<dim,spacedim> element(3);
   DoFHandler<dim,spacedim> dof(tr);
   dof.distribute_dofs(element);
@@ -61,14 +61,14 @@ check ()
 
   std::map<types::boundary_id,const Function<spacedim>*> neumann_bc;
   neumann_bc[0] = &function;
-  
+
   Vector<double> v (dof.n_dofs());
   VectorTools::interpolate (mapping, dof, function, v);
 
   Vector<float> error (tr.n_active_cells());
 
   KellyErrorEstimator<dim,spacedim>::estimate (mapping, dof, q_face, neumann_bc,
-                                              v, error);
+                                               v, error);
 
   deallog << "Estimated error:" << std::endl;
   for (unsigned int i=0; i<error.size(); ++i)
@@ -80,11 +80,11 @@ int main ()
 {
   std::ofstream logfile ("error_estimator_01/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
+
   deallog.push ("2d_2");
   check<2,2> ();
   deallog.pop ();
index d6e3c39373f36bc278804d4fca9c847044d1cbc1..ac84d06d9dc786b7974f5f323b305455a35b3772 100644 (file)
 
 
 void create_triangulation(const unsigned int case_no,
-                         Triangulation<1> &tria)
+                          Triangulation<1> &tria)
 {
   switch (case_no)
     {
-      case 0:
-           GridGenerator::hyper_cube(tria, 1., 3.);
-           break;
-      case 1:
-           GridGenerator::hyper_cube(tria, 1., 4.);
-           break;
-      default:
-           Assert(false, ExcNotImplemented());
+    case 0:
+      GridGenerator::hyper_cube(tria, 1., 3.);
+      break;
+    case 1:
+      GridGenerator::hyper_cube(tria, 1., 4.);
+      break;
+    default:
+      Assert(false, ExcNotImplemented());
     };
 }
 
 
 void create_triangulation(const unsigned int case_no,
-                         Triangulation<2> &tria)
+                          Triangulation<2> &tria)
 {
   switch (case_no)
     {
-      case 0:
-           GridGenerator::hyper_cube(tria, 1., 3.);
-           break;
-      case 1:
-      {
-       GridGenerator::hyper_cube(tria, 1., 3.);
-       Point<2> &v0=tria.begin_active()->vertex(0);
-       v0(0) = 0.;
-       Point<2> &v2=tria.begin_active()->vertex(3);
-       v2(0) = 5.;
-       v2(1) = 4.;
-       break;
-      }
-      default:
-           Assert(false, ExcNotImplemented());
+    case 0:
+      GridGenerator::hyper_cube(tria, 1., 3.);
+      break;
+    case 1:
+    {
+      GridGenerator::hyper_cube(tria, 1., 3.);
+      Point<2> &v0=tria.begin_active()->vertex(0);
+      v0(0) = 0.;
+      Point<2> &v2=tria.begin_active()->vertex(3);
+      v2(0) = 5.;
+      v2(1) = 4.;
+      break;
+    }
+    default:
+      Assert(false, ExcNotImplemented());
     };
 }
 
 
 void create_triangulation(const unsigned int case_no,
-                         Triangulation<3> &tria)
+                          Triangulation<3> &tria)
 {
   switch (case_no)
     {
-      case 0:
-           GridGenerator::hyper_cube(tria, 1., 3.);
-           break;
-      case 1:
-      {
-       GridGenerator::hyper_cube(tria, 1., 3.);
-       Point<3> &v0=tria.begin_active()->vertex(0);
-       v0(0) = 0.;
-       break;
-      }
-      default:
-           Assert(false, ExcNotImplemented());
+    case 0:
+      GridGenerator::hyper_cube(tria, 1., 3.);
+      break;
+    case 1:
+    {
+      GridGenerator::hyper_cube(tria, 1., 3.);
+      Point<3> &v0=tria.begin_active()->vertex(0);
+      v0(0) = 0.;
+      break;
+    }
+    default:
+      Assert(false, ExcNotImplemented());
     };
 }
 
@@ -99,7 +99,7 @@ void test()
       create_triangulation(case_no, tria);
       deallog << "dim " << dim << ", case " << case_no << ": ";
       for (unsigned int i=0; i<dim; ++i)
-       deallog << tria.begin_active()->extent_in_direction(i) << ' ';
+        deallog << tria.begin_active()->extent_in_direction(i) << ' ';
       deallog << std::endl;
       tria.clear();
     }
index 810a9e744aa9cbb0449c07fe209ebf2a952b5b54..08232d9678a2de7e58ea552daf3d2a213716786d 100644 (file)
@@ -51,28 +51,28 @@ check ()
   tr.refine_global (1);
 
   FESystem<dim> element (FE_Q<dim>(1), 1,
-                        FE_RaviartThomas<dim>(0), 1,
-                        FE_Q<dim>(1), 1,
-                        FE_Nedelec<dim>(0), 1);
+                         FE_RaviartThomas<dim>(0), 1,
+                         FE_Q<dim>(1), 1,
+                         FE_Nedelec<dim>(0), 1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // try all possible component
-                                  // masks, which we encode as bit
-                                  // strings
+  // try all possible component
+  // masks, which we encode as bit
+  // strings
   for (unsigned int int_mask=0; int_mask<(1U<<element.n_components()); ++int_mask)
-  {
-    std::vector<bool> component_mask (element.n_components());
-    for (unsigned int c=0; c<element.n_components(); ++c)
-      component_mask[c] = (int_mask & (1<<c));
-
-    std::vector<bool> dofs (dof.n_dofs());
-    DoFTools::extract_dofs (dof, ComponentMask(component_mask), dofs);
-
-    for (unsigned int d=0; d<dof.n_dofs(); ++d)
-      deallog << dofs[d];
-    deallog << std::endl;
-  }
+    {
+      std::vector<bool> component_mask (element.n_components());
+      for (unsigned int c=0; c<element.n_components(); ++c)
+        component_mask[c] = (int_mask & (1<<c));
+
+      std::vector<bool> dofs (dof.n_dofs());
+      DoFTools::extract_dofs (dof, ComponentMask(component_mask), dofs);
+
+      for (unsigned int d=0; d<dof.n_dofs(); ++d)
+        deallog << dofs[d];
+      deallog << std::endl;
+    }
 }
 
 
index 9ab061dbebbdb4a190728c14c39108281c920c5f..d213292efaea8f01dea37f99f34321dd605af3c5 100644 (file)
@@ -50,33 +50,33 @@ check ()
   GridGenerator::hyper_cube(tr, -1,1);
   tr.refine_global (1);
 
-                                  // create an FECollection and set
-                                  // one cell to use the second
-                                  // element of this collection
+  // create an FECollection and set
+  // one cell to use the second
+  // element of this collection
   hp::FECollection<dim> element;
   for (unsigned int i=0; i<2; ++i)
     element.push_back (FESystem<dim> (FE_Q<dim>(1+i), 1,
-                                     FE_Nedelec<dim>(0), 1));
+                                      FE_Nedelec<dim>(0), 1));
   hp::DoFHandler<dim> dof(tr);
   dof.begin_active()->set_active_fe_index(1);
   dof.distribute_dofs(element);
 
-                                  // try all possible component
-                                  // masks, which we encode as bit
-                                  // strings
+  // try all possible component
+  // masks, which we encode as bit
+  // strings
   for (unsigned int int_mask=0; int_mask<(1U<<element.n_components()); ++int_mask)
-  {
-    std::vector<bool> component_mask (element.n_components());
-    for (unsigned int c=0; c<element.n_components(); ++c)
-      component_mask[c] = (int_mask & (1<<c));
-
-    std::vector<bool> dofs (dof.n_dofs());
-    DoFTools::extract_dofs (dof, ComponentMask(component_mask), dofs);
-
-    for (unsigned int d=0; d<dof.n_dofs(); ++d)
-      deallog << dofs[d];
-    deallog << std::endl;
-  }
+    {
+      std::vector<bool> component_mask (element.n_components());
+      for (unsigned int c=0; c<element.n_components(); ++c)
+        component_mask[c] = (int_mask & (1<<c));
+
+      std::vector<bool> dofs (dof.n_dofs());
+      DoFTools::extract_dofs (dof, ComponentMask(component_mask), dofs);
+
+      for (unsigned int d=0; d<dof.n_dofs(); ++d)
+        deallog << dofs[d];
+      deallog << std::endl;
+    }
 }
 
 
index 2ffcb678492896c7e76b88f9dd2a7e45c0f71449..e71fc9e712d745219ebe8aa001a4a642ec9d0679 100644 (file)
@@ -52,32 +52,32 @@ check ()
   tr.execute_coarsening_and_refinement();
 
   FESystem<dim> element (FE_Q<dim>(2), 1,
-                        FE_Nedelec<dim>(0), 1);
+                         FE_Nedelec<dim>(0), 1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
   dof.distribute_mg_dofs(element);
 
-                                  // try all possible component
-                                  // masks, which we encode as bit
-                                  // strings
+  // try all possible component
+  // masks, which we encode as bit
+  // strings
   for (unsigned int int_mask=0; int_mask<(1U<<element.n_components()); ++int_mask)
-  {
-    std::vector<bool> component_mask (element.n_components());
-    for (unsigned int c=0; c<element.n_components(); ++c)
-      component_mask[c] = (int_mask & (1<<c));
-
-    for (unsigned int level=0; level<tr.n_levels(); ++level)
-      {
-       deallog << "level=" << level << std::endl;
-
-       std::vector<bool> dofs (dof.n_dofs(level));
-       DoFTools::extract_level_dofs (level, dof, ComponentMask(component_mask), dofs);
-
-       for (unsigned int d=0; d<dofs.size(); ++d)
-         deallog << dofs[d];
-       deallog << std::endl;
-      }
-  }
+    {
+      std::vector<bool> component_mask (element.n_components());
+      for (unsigned int c=0; c<element.n_components(); ++c)
+        component_mask[c] = (int_mask & (1<<c));
+
+      for (unsigned int level=0; level<tr.n_levels(); ++level)
+        {
+          deallog << "level=" << level << std::endl;
+
+          std::vector<bool> dofs (dof.n_dofs(level));
+          DoFTools::extract_level_dofs (level, dof, ComponentMask(component_mask), dofs);
+
+          for (unsigned int d=0; d<dofs.size(); ++d)
+            deallog << dofs[d];
+          deallog << std::endl;
+        }
+    }
 }
 
 
index 364481bee205e295a4f79545758cb8ead34ff285..11e81aafbe32f5fd730321493b46f6c59e206030 100644 (file)
@@ -53,15 +53,15 @@ check ()
   GridGenerator::hyper_cube(tr, -1,1);
   tr.refine_global (1);
 
-                                  // use a simpler finite element
-                                  // than in the _01x test
+  // use a simpler finite element
+  // than in the _01x test
   FESystem<dim> element (FE_DGQ<dim>(0), 1,
-                        FE_Nedelec<dim>(0), 1);
+                         FE_Nedelec<dim>(0), 1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a mask that only has the
-                                  // first component set
+  // use a mask that only has the
+  // first component set
   std::vector<bool> component_mask (element.n_components(), false);
   component_mask[0] = true;
 
index 5af296161b8d08e8f89bd36e482cd46225d87087..955e5be02edc3c540c85dedc7dbd46e423cca506 100644 (file)
@@ -60,9 +60,9 @@ check ()
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a mask that only has the one
-                                  // component set and cycle over
-                                  // which one that is
+  // use a mask that only has the one
+  // component set and cycle over
+  // which one that is
   for (unsigned int comp=0; comp<element.n_components(); ++comp)
     {
       std::vector<bool> component_mask (element.n_components(), false);
@@ -72,7 +72,7 @@ check ()
       DoFTools::extract_dofs (dof, ComponentMask(component_mask), dofs);
 
       for (unsigned int d=0; d<dof.n_dofs(); ++d)
-       deallog << dofs[d];
+        deallog << dofs[d];
       deallog << std::endl;
     }
 }
index a27a07b423592eb1c028fa740d22bc0fc5b9b761..c3603d4b6057207ead3080ca37d83e97241c197c 100644 (file)
@@ -51,28 +51,28 @@ check ()
   tr.refine_global (1);
 
   FESystem<dim> element (FE_Q<dim>(1), 1,
-                        FE_RaviartThomas<dim>(0), 1,
-                        FE_Q<dim>(1), 1,
-                        FE_Nedelec<dim>(0), 1);
+                         FE_RaviartThomas<dim>(0), 1,
+                         FE_Q<dim>(1), 1,
+                         FE_Nedelec<dim>(0), 1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // try all possible block
-                                  // masks, which we encode as bit
-                                  // strings
+  // try all possible block
+  // masks, which we encode as bit
+  // strings
   for (unsigned int int_mask=0; int_mask<(1U<<element.n_blocks()); ++int_mask)
-  {
-    std::vector<bool> component_mask (element.n_blocks());
-    for (unsigned int c=0; c<element.n_blocks(); ++c)
-      component_mask[c] = (int_mask & (1<<c));
-
-    std::vector<bool> dofs (dof.n_dofs());
-    DoFTools::extract_dofs (dof, BlockMask(component_mask), dofs);
-
-    for (unsigned int d=0; d<dof.n_dofs(); ++d)
-      deallog << dofs[d];
-    deallog << std::endl;
-  }
+    {
+      std::vector<bool> component_mask (element.n_blocks());
+      for (unsigned int c=0; c<element.n_blocks(); ++c)
+        component_mask[c] = (int_mask & (1<<c));
+
+      std::vector<bool> dofs (dof.n_dofs());
+      DoFTools::extract_dofs (dof, BlockMask(component_mask), dofs);
+
+      for (unsigned int d=0; d<dof.n_dofs(); ++d)
+        deallog << dofs[d];
+      deallog << std::endl;
+    }
 }
 
 
index 12cf5351c8edc12577819666cdc2e230820dae87..46775e5638e9f8f8b031a6f58489e65875774487 100644 (file)
@@ -50,33 +50,33 @@ check ()
   GridGenerator::hyper_cube(tr, -1,1);
   tr.refine_global (1);
 
-                                  // create an FECollection and set
-                                  // one cell to use the second
-                                  // element of this collection
+  // create an FECollection and set
+  // one cell to use the second
+  // element of this collection
   hp::FECollection<dim> element;
   for (unsigned int i=0; i<2; ++i)
     element.push_back (FESystem<dim> (FE_Q<dim>(1+i), 1,
-                                     FE_Nedelec<dim>(0), 1));
+                                      FE_Nedelec<dim>(0), 1));
   hp::DoFHandler<dim> dof(tr);
   dof.begin_active()->set_active_fe_index(1);
   dof.distribute_dofs(element);
 
-                                  // try all possible block
-                                  // masks, which we encode as bit
-                                  // strings
+  // try all possible block
+  // masks, which we encode as bit
+  // strings
   for (unsigned int int_mask=0; int_mask<(1U<<element[0].n_blocks()); ++int_mask)
-  {
-    std::vector<bool> component_mask (element[0].n_blocks());
-    for (unsigned int c=0; c<element[0].n_blocks(); ++c)
-      component_mask[c] = (int_mask & (1<<c));
-
-    std::vector<bool> dofs (dof.n_dofs());
-    DoFTools::extract_dofs (dof, BlockMask(component_mask), dofs);
-
-    for (unsigned int d=0; d<dof.n_dofs(); ++d)
-      deallog << dofs[d];
-    deallog << std::endl;
-  }
+    {
+      std::vector<bool> component_mask (element[0].n_blocks());
+      for (unsigned int c=0; c<element[0].n_blocks(); ++c)
+        component_mask[c] = (int_mask & (1<<c));
+
+      std::vector<bool> dofs (dof.n_dofs());
+      DoFTools::extract_dofs (dof, BlockMask(component_mask), dofs);
+
+      for (unsigned int d=0; d<dof.n_dofs(); ++d)
+        deallog << dofs[d];
+      deallog << std::endl;
+    }
 }
 
 
index 5cd96128ecf956864b211af9f619007d5299ea3e..a695c9af2dddeec7aa6e7153868ba5c677324f59 100644 (file)
@@ -54,31 +54,31 @@ check ()
   tr.execute_coarsening_and_refinement();
 
   FESystem<dim> element (FE_Q<dim>(2), 1,
-                        FE_Nedelec<dim>(0), 1);
+                         FE_Nedelec<dim>(0), 1);
   MGDoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // try all possible block
-                                  // masks, which we encode as bit
-                                  // strings
+  // try all possible block
+  // masks, which we encode as bit
+  // strings
   for (unsigned int int_mask=0; int_mask<(1U<<element[0].n_blocks()); ++int_mask)
-  {
-    std::vector<bool> component_mask (element[0].n_blocks());
-    for (unsigned int c=0; c<element[0].n_blocks(); ++c)
-      component_mask[c] = (int_mask & (1<<c));
-
-    for (unsigned int level=0; level<tr.n_levels(); ++level)
-      {
-       deallog << "level=" << level << std::endl;
-
-       std::vector<bool> dofs (dof.n_dofs(level));
-       DoFTools::extract_level_dofs (level, dof, BlockMask(component_mask), dofs);
-
-       for (unsigned int d=0; d<dofs.size(); ++d)
-         deallog << dofs[d];
-       deallog << std::endl;
-      }
-  }
+    {
+      std::vector<bool> component_mask (element[0].n_blocks());
+      for (unsigned int c=0; c<element[0].n_blocks(); ++c)
+        component_mask[c] = (int_mask & (1<<c));
+
+      for (unsigned int level=0; level<tr.n_levels(); ++level)
+        {
+          deallog << "level=" << level << std::endl;
+
+          std::vector<bool> dofs (dof.n_dofs(level));
+          DoFTools::extract_level_dofs (level, dof, BlockMask(component_mask), dofs);
+
+          for (unsigned int d=0; d<dofs.size(); ++d)
+            deallog << dofs[d];
+          deallog << std::endl;
+        }
+    }
 }
 
 
index c62f4beabb81a699ed81ba6daaf6167d7a8ffc35..a2fa5a03c7dcdfb13b851164863c220a0d90cf2e 100644 (file)
@@ -51,23 +51,23 @@ check ()
   tr.refine_global (1);
 
   FESystem<dim> element (FE_Q<dim>(1), 1,
-                        FE_Q<dim>(2), 2);
+                         FE_Q<dim>(2), 2);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // try all possible components
+  // try all possible components
   for (unsigned int c=0; c<element.n_components(); ++c)
-  {
-    Vector<double> in(tr.n_active_cells());
-    for (unsigned int i=0; i<in.size(); ++i)
-      in[i] = i;
-    Vector<double> out(dof.n_dofs());
-    DoFTools::distribute_cell_to_dof_vector (dof, in, out, c);
-
-    for (unsigned int d=0; d<dof.n_dofs(); ++d)
-      deallog << out[d] << std::endl;
-    deallog << std::endl;
-  }
+    {
+      Vector<double> in(tr.n_active_cells());
+      for (unsigned int i=0; i<in.size(); ++i)
+        in[i] = i;
+      Vector<double> out(dof.n_dofs());
+      DoFTools::distribute_cell_to_dof_vector (dof, in, out, c);
+
+      for (unsigned int d=0; d<dof.n_dofs(); ++d)
+        deallog << out[d] << std::endl;
+      deallog << std::endl;
+    }
 }
 
 
index 7c6582221502563a6c9c13ed0e7cb3259fdb36a2..80be002cbac0a894330c060d4410a259064510cf 100644 (file)
@@ -50,32 +50,32 @@ check ()
   tr.refine_global (1);
 
   FESystem<dim> element (FE_Q<dim>(1), 1,
-                        FE_RaviartThomas<dim>(0), 1,
-                        FE_Q<dim>(1), 1,
-                        FE_Nedelec<dim>(0), 1);
+                         FE_RaviartThomas<dim>(0), 1,
+                         FE_Q<dim>(1), 1,
+                         FE_Nedelec<dim>(0), 1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // try all possible component
-                                  // masks, which we encode as bit
-                                  // strings
+  // try all possible component
+  // masks, which we encode as bit
+  // strings
   for (unsigned int int_mask=0; int_mask<(1U<<element.n_components()); ++int_mask)
-  {
-    std::vector<bool> component_mask (element.n_components());
-    for (unsigned int c=0; c<element.n_components(); ++c)
-      component_mask[c] = (int_mask & (1<<c));
-
-    std::vector<std::vector<bool> > constant_modes;
-    DoFTools::extract_constant_modes (dof, component_mask, constant_modes);
-
-    for (unsigned int d=0; d<constant_modes.size(); ++d)
-      {
-       deallog << "constant mode " << d << std::endl;
-       for (unsigned int e=0; e<constant_modes[d].size(); ++e)
-         deallog << constant_modes[d][e];
-       deallog << std::endl;
-      }
-  }
+    {
+      std::vector<bool> component_mask (element.n_components());
+      for (unsigned int c=0; c<element.n_components(); ++c)
+        component_mask[c] = (int_mask & (1<<c));
+
+      std::vector<std::vector<bool> > constant_modes;
+      DoFTools::extract_constant_modes (dof, component_mask, constant_modes);
+
+      for (unsigned int d=0; d<constant_modes.size(); ++d)
+        {
+          deallog << "constant mode " << d << std::endl;
+          for (unsigned int e=0; e<constant_modes[d].size(); ++e)
+            deallog << constant_modes[d][e];
+          deallog << std::endl;
+        }
+    }
 }
 
 
index 1b82505fcdb22ed5ea1628ec3d7f9fcf34445b9e..61716e082dc802ebf14c74d988c2d346bd8fe50f 100644 (file)
@@ -51,9 +51,9 @@ check ()
   tr.refine_global (1);
 
   FESystem<dim> element (FE_Q<dim>(1), 1,
-                        FE_RaviartThomas<dim>(0), 1,
-                        FE_Q<dim>(1), 1,
-                        FE_Nedelec<dim>(0), 1);
+                         FE_RaviartThomas<dim>(0), 1,
+                         FE_Q<dim>(1), 1,
+                         FE_Nedelec<dim>(0), 1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
index a4c2e72d0101fa58de720e4325aea7e1f0cf09ce..c25e3ab14dea8b88d9529bb00d2a358f265087f2 100644 (file)
@@ -50,13 +50,13 @@ check ()
   GridGenerator::hyper_cube(tr, -1,1);
   tr.refine_global (1);
 
-                                  // create an FECollection and set
-                                  // one cell to use the second
-                                  // element of this collection
+  // create an FECollection and set
+  // one cell to use the second
+  // element of this collection
   hp::FECollection<dim> element;
   for (unsigned int i=0; i<2; ++i)
     element.push_back (FESystem<dim> (FE_Q<dim>(1+i), 1,
-                                     FE_Nedelec<dim>(0), 1));
+                                      FE_Nedelec<dim>(0), 1));
   hp::DoFHandler<dim> dof(tr);
   dof.begin_active()->set_active_fe_index(1);
   dof.distribute_dofs(element);
index cd7d9a5731916b40b4f9b7134f6348ec8561c28e..38d6df17a8eaeb20b05029740c104bfa59ac5f2c 100644 (file)
@@ -51,9 +51,9 @@ check ()
   tr.refine_global (1);
 
   FESystem<dim> element (FE_Q<dim>(1), 1,
-                        FE_RaviartThomas<dim>(0), 1,
-                        FE_Q<dim>(1), 1,
-                        FE_Nedelec<dim>(0), 1);
+                         FE_RaviartThomas<dim>(0), 1,
+                         FE_Q<dim>(1), 1,
+                         FE_Nedelec<dim>(0), 1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
index 5dc27e938eddd49e66da7324bc397581a0dc7a1a..4dac12fddcda01173d7fe6032ffacde5f1f80fa6 100644 (file)
@@ -50,13 +50,13 @@ check ()
   GridGenerator::hyper_cube(tr, -1,1);
   tr.refine_global (1);
 
-                                  // create an FECollection and set
-                                  // one cell to use the second
-                                  // element of this collection
+  // create an FECollection and set
+  // one cell to use the second
+  // element of this collection
   hp::FECollection<dim> element;
   for (unsigned int i=0; i<2; ++i)
     element.push_back (FESystem<dim> (FE_Q<dim>(1+i), 1,
-                                     FE_Nedelec<dim>(0), 1));
+                                      FE_Nedelec<dim>(0), 1));
   hp::DoFHandler<dim> dof(tr);
   dof.begin_active()->set_active_fe_index(1);
   dof.distribute_dofs(element);
index 2b093c40d04214fd322a71e11a393f7ccf1e174c..88a290d13d54e95d563a5e173469c33e4ba07a72 100644 (file)
@@ -41,7 +41,7 @@ std::ofstream logfile("face_orientations_3d/output");
 void test (const char *filename)
 {
   deallog << "Reading " << filename << std::endl;
-  
+
   Triangulation<3> tria;
   GridIn<3> gi;
   gi.attach_triangulation (tria);
@@ -59,13 +59,13 @@ void test (const char *filename)
         {
           ++misoriented_faces;
 
-                                           // check that the face is
-                                           // correctly oriented from
-                                           // the other side at
-                                           // least. note that if this
-                                           // face is misoriented,
-                                           // then there must be a
-                                           // neighbor over there
+          // check that the face is
+          // correctly oriented from
+          // the other side at
+          // least. note that if this
+          // face is misoriented,
+          // then there must be a
+          // neighbor over there
           Assert (cell->neighbor(f)
                   ->face_orientation(cell->neighbor_of_neighbor(f))
                   == true,
index a4d55b6f1121e052c8a9c5b8836cad2b82e21ece..c8dea5c45259b2cb9cd2489fd0e5807d736096de 100644 (file)
@@ -41,41 +41,41 @@ void
 check ()
 {
   Triangulation<dim> triangulation;
-  
+
   GridGenerator::subdivided_hyper_cube (triangulation, 2);
   hp::FECollection<dim> fe_collection;
-  
+
   for (unsigned int i = 1; i <= triangulation.n_active_cells (); ++i)
     fe_collection.push_back (FE_Q<dim> (i));
-  
+
   hp::DoFHandler<dim> dof_handler (triangulation);
-  
+
   dof_handler.distribute_dofs (fe_collection);
-  
+
   Vector<double> vector (dof_handler.n_dofs ());
-  
+
   for (unsigned int i = 0; i < dof_handler.n_dofs (); ++i)
     vector (i) = i;
-  
+
   Functions::FEFieldFunction<dim, hp::DoFHandler<dim> >
-    fe_field (dof_handler, vector);
+  fe_field (dof_handler, vector);
   QGauss<dim> quadrature (5);
-  
+
   deallog << "values:" <<std::endl;
-  
+
   std::vector<double> values (quadrature.size ());
-  
+
   fe_field.value_list (quadrature.get_points (), values);
-  
+
   for (unsigned int q_point = 0; q_point < quadrature.size (); ++q_point)
     deallog << values[q_point] << std::endl;
-  
+
   deallog << "gradients:" <<std::endl;
-  
+
   std::vector<Tensor<1, dim> > gradients (quadrature.size ());
-  
+
   fe_field.gradient_list (quadrature.get_points (), gradients);
-  
+
   for (unsigned int q_point = 0; q_point < quadrature.size (); ++q_point)
     deallog << gradients[q_point] << std::endl;
 }
@@ -83,9 +83,9 @@ check ()
 
 int main ()
 {
-  initlog(__FILE__);  
+  initlog(__FILE__);
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
 
   deallog.push ("1d");
   check<1> ();
index e010a0831e80f05afee8aece3c0677329bd1400a..508eb69c83b20491e254a40eb93b4aeb19e54e91 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients | update_hessians);
+                           update_values | update_gradients | update_hessians);
   fe_values.reinit (dof.begin_active());
-  
+
   for (unsigned int c=0; c<fe.n_components(); ++c)
     {
       FEValuesExtractors::Scalar single_component (c);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-         {
-           deallog << "i=" << i << ", q=" << q << std::endl;
-           deallog << "   "
-                   << fe_values[single_component].value (i,q) << ' ';
-           for (unsigned int k=0; k<dim; ++k)
-             deallog << fe_values[single_component].gradient (i,q) << ' ';
-           deallog << std::endl;
-           for (unsigned int k=0; k<dim; ++k)
-             for (unsigned int l=0; l<dim; ++l)
-               deallog << fe_values[single_component].hessian (i,q)[k][l] << std::endl;
-
-           Assert (fe_values[single_component].value (i,q)
-                   ==
-                   fe_values.shape_value_component (i,q,c),
-                   ExcInternalError());
-
-           Assert (fe_values[single_component].gradient (i,q)
-                   ==
-                   fe_values.shape_grad_component (i,q,c),
-                   ExcInternalError());
-
-           Assert (fe_values[single_component].hessian (i,q)
-                   ==
-                   fe_values.shape_hessian_component (i,q,c),
-                   ExcInternalError());
-         }
+        for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+          {
+            deallog << "i=" << i << ", q=" << q << std::endl;
+            deallog << "   "
+                    << fe_values[single_component].value (i,q) << ' ';
+            for (unsigned int k=0; k<dim; ++k)
+              deallog << fe_values[single_component].gradient (i,q) << ' ';
+            deallog << std::endl;
+            for (unsigned int k=0; k<dim; ++k)
+              for (unsigned int l=0; l<dim; ++l)
+                deallog << fe_values[single_component].hessian (i,q)[k][l] << std::endl;
+
+            Assert (fe_values[single_component].value (i,q)
+                    ==
+                    fe_values.shape_value_component (i,q,c),
+                    ExcInternalError());
+
+            Assert (fe_values[single_component].gradient (i,q)
+                    ==
+                    fe_values.shape_grad_component (i,q,c),
+                    ExcInternalError());
+
+            Assert (fe_values[single_component].hessian (i,q)
+                    ==
+                    fe_values.shape_hessian_component (i,q,c),
+                    ExcInternalError());
+          }
     }
 }
 
@@ -99,8 +99,8 @@ void test_hyper_sphere()
   tr.set_boundary (0, boundary);
 
   FESystem<dim> fe (FE_Q<dim>(1), 1,
-                   FE_Q<dim>(2), 2,
-                   FE_DGQ<dim>(3), dim);
+                    FE_Q<dim>(2), 2,
+                    FE_DGQ<dim>(3), dim);
   test(tr, fe);
 }
 
index a00c5dab7142419c6deeb361a8560b36df7b2898..bb552f094602220c35e92d5a2b3bed88526ce534 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients | update_hessians);
+                           update_values | update_gradients | update_hessians);
   fe_values.reinit (dof.begin_active());
-  
+
   for (unsigned int c=0; c<fe.n_components(); ++c)
-                                    // use a vector extractor if there
-                                    // are sufficiently many components
-                                    // left after the current component
-                                    // 'c'
+    // use a vector extractor if there
+    // are sufficiently many components
+    // left after the current component
+    // 'c'
     if (c+dim <= fe.n_components())
       {
-       FEValuesExtractors::Vector vec_components (c);
-
-       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             deallog << "i=" << i << ", q=" << q << std::endl;
-             deallog << "   "
-                     << fe_values[vec_components].value (i,q) << ' ';
-             for (unsigned int k=0; k<dim; ++k)
-               deallog << fe_values[vec_components].gradient (i,q)[k] << ' ';
-             deallog << fe_values[vec_components].divergence (i,q) << ' ';
-             for (unsigned int k=0; k<dim; ++k)
-               for (unsigned int l=0; l<dim; ++l)
-                 deallog << fe_values[vec_components].symmetric_gradient (i,q)[k][l] << ' ';
-             deallog << std::endl;
-             for (unsigned int k=0; k<dim; ++k)
-               for (unsigned int l=0; l<dim; ++l)
-                 for (unsigned int m=0; m<dim; ++m)
-                   deallog << fe_values[vec_components].hessian (i,q)[k][l][m]
-                           << std::endl;
-                 
-             for (unsigned int d=0; d<dim; ++d)
-               {
-                 Assert (fe_values[vec_components].value (i,q)[d]
-                         ==
-                         fe_values.shape_value_component (i,q,c+d),
-                         ExcInternalError());
-
-                 Assert (fe_values[vec_components].gradient (i,q)[d]
-                         ==
-                         fe_values.shape_grad_component (i,q,c+d),
-                         ExcInternalError());
-
-                 Assert (fe_values[vec_components].symmetric_gradient (i,q)
-                         ==
-                         (fe_values[vec_components].gradient(i,q) +
-                          transpose(fe_values[vec_components].gradient(i,q)))/2,
-                         ExcInternalError());
-                     
-                 Assert (fe_values[vec_components].hessian (i,q)[d]
-                         ==
-                         fe_values.shape_hessian_component (i,q,c+d),
-                         ExcInternalError());
-               }
-
-             Assert (fe_values[vec_components].divergence (i,q)
-                     ==
-                     trace (fe_values[vec_components].gradient (i,q)),
-                     ExcInternalError());
-           }
+        FEValuesExtractors::Vector vec_components (c);
+
+        for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              deallog << "i=" << i << ", q=" << q << std::endl;
+              deallog << "   "
+                      << fe_values[vec_components].value (i,q) << ' ';
+              for (unsigned int k=0; k<dim; ++k)
+                deallog << fe_values[vec_components].gradient (i,q)[k] << ' ';
+              deallog << fe_values[vec_components].divergence (i,q) << ' ';
+              for (unsigned int k=0; k<dim; ++k)
+                for (unsigned int l=0; l<dim; ++l)
+                  deallog << fe_values[vec_components].symmetric_gradient (i,q)[k][l] << ' ';
+              deallog << std::endl;
+              for (unsigned int k=0; k<dim; ++k)
+                for (unsigned int l=0; l<dim; ++l)
+                  for (unsigned int m=0; m<dim; ++m)
+                    deallog << fe_values[vec_components].hessian (i,q)[k][l][m]
+                            << std::endl;
+
+              for (unsigned int d=0; d<dim; ++d)
+                {
+                  Assert (fe_values[vec_components].value (i,q)[d]
+                          ==
+                          fe_values.shape_value_component (i,q,c+d),
+                          ExcInternalError());
+
+                  Assert (fe_values[vec_components].gradient (i,q)[d]
+                          ==
+                          fe_values.shape_grad_component (i,q,c+d),
+                          ExcInternalError());
+
+                  Assert (fe_values[vec_components].symmetric_gradient (i,q)
+                          ==
+                          (fe_values[vec_components].gradient(i,q) +
+                           transpose(fe_values[vec_components].gradient(i,q)))/2,
+                          ExcInternalError());
+
+                  Assert (fe_values[vec_components].hessian (i,q)[d]
+                          ==
+                          fe_values.shape_hessian_component (i,q,c+d),
+                          ExcInternalError());
+                }
+
+              Assert (fe_values[vec_components].divergence (i,q)
+                      ==
+                      trace (fe_values[vec_components].gradient (i,q)),
+                      ExcInternalError());
+            }
       }
 }
 
@@ -124,8 +124,8 @@ void test_hyper_sphere()
   tr.set_boundary (0, boundary);
 
   FESystem<dim> fe (FE_Q<dim>(1), 1,
-                   FE_Q<dim>(2), 2,
-                   FE_DGQ<dim>(3), dim);
+                    FE_Q<dim>(2), 2,
+                    FE_DGQ<dim>(3), dim);
   test(tr, fe);
 }
 
index b528567d74253e2720a8e7b42f173de34b7a67e5..9bddf6a5316f421c8e4b7ed799b4f5f374653536 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients | update_hessians);
+                           update_values | update_gradients | update_hessians);
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active(); cell != dof.end(); ++cell)
+       cell = dof.begin_active(); cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
-  
+
       for (unsigned int c=0; c<fe.n_components(); ++c)
-       {
-         FEValuesExtractors::Scalar single_component (c);
-
-         for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-           for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-             {
-               deallog << "i=" << i << ", q=" << q << std::endl;
-               deallog << "   "
-                       << fe_values[single_component].value (i,q) << ' ';
-               for (unsigned int k=0; k<dim; ++k)
-                 deallog << fe_values[single_component].gradient (i,q)[k] << ' ';
-               deallog << std::endl;
-               for (unsigned int k=0; k<dim; ++k)
-                 for (unsigned int l=0; l<dim; ++l)
-                   deallog << fe_values[single_component].hessian (i,q)[k][l] << std::endl;
-
-               Assert (fe_values[single_component].value (i,q)
-                       ==
-                       fe_values.shape_value_component (i,q,c),
-                       ExcInternalError());
-
-               Assert (fe_values[single_component].gradient (i,q)
-                       ==
-                       fe_values.shape_grad_component (i,q,c),
-                       ExcInternalError());
-
-               Assert (fe_values[single_component].hessian (i,q)
-                       ==
-                       fe_values.shape_hessian_component (i,q,c),
-                       ExcInternalError());
-             }
-       }
+        {
+          FEValuesExtractors::Scalar single_component (c);
+
+          for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
+            for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+              {
+                deallog << "i=" << i << ", q=" << q << std::endl;
+                deallog << "   "
+                        << fe_values[single_component].value (i,q) << ' ';
+                for (unsigned int k=0; k<dim; ++k)
+                  deallog << fe_values[single_component].gradient (i,q)[k] << ' ';
+                deallog << std::endl;
+                for (unsigned int k=0; k<dim; ++k)
+                  for (unsigned int l=0; l<dim; ++l)
+                    deallog << fe_values[single_component].hessian (i,q)[k][l] << std::endl;
+
+                Assert (fe_values[single_component].value (i,q)
+                        ==
+                        fe_values.shape_value_component (i,q,c),
+                        ExcInternalError());
+
+                Assert (fe_values[single_component].gradient (i,q)
+                        ==
+                        fe_values.shape_grad_component (i,q,c),
+                        ExcInternalError());
+
+                Assert (fe_values[single_component].hessian (i,q)
+                        ==
+                        fe_values.shape_hessian_component (i,q,c),
+                        ExcInternalError());
+              }
+        }
     }
 }
 
@@ -105,8 +105,8 @@ void test_hyper_sphere()
   tr.set_boundary (0, boundary);
 
   FESystem<dim> fe (FE_Q<dim>(1), 1,
-                   FE_RaviartThomas<dim>(1), 1,
-                   FE_Nedelec<dim>(0), 1);
+                    FE_RaviartThomas<dim>(1), 1,
+                    FE_Nedelec<dim>(0), 1);
   test(tr, fe);
 }
 
index 4e9ee52b8f2f8c1cf8e54e67cb362e3856be88a4..929a4ec56c4097790aad2fcfea54963d357de8d1 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients | update_hessians);
+                           update_values | update_gradients | update_hessians);
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active(); cell != dof.end(); ++cell)
+       cell = dof.begin_active(); cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int c=0; c<fe.n_components(); ++c)
-                                        // use a vector extractor if there
-                                        // are sufficiently many components
-                                        // left after the current component
-                                        // 'c'
-       if (c+dim <= fe.n_components())
-         {
-           FEValuesExtractors::Vector vec_components (c);
-
-           for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-             for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-               {
-                 deallog << "i=" << i << ", q=" << q << std::endl;
-                 deallog << "   ";
-                 for (unsigned int k=0; k<dim; ++k)
-                   deallog << fe_values[vec_components].value (i,q)[k] << ' ';
-                 for (unsigned int k=0; k<dim; ++k)
-                   for (unsigned int l=0; l<dim; ++l)
-                     deallog << fe_values[vec_components].gradient (i,q)[k][l] << ' ';
-                 deallog << std::endl;
-                 for (unsigned int k=0; k<dim; ++k)
-                   for (unsigned int l=0; l<dim; ++l)
-                     for (unsigned int m=0; m<dim; ++m)
-                       deallog << fe_values[vec_components].symmetric_gradient (i,q)[k][l]
-                               << ' '
-                               << fe_values[vec_components].hessian (i,q)[k][l][m]
-                               << std::endl;
-
-                 for (unsigned int d=0; d<dim; ++d)
-                   {
-                     Assert (fe_values[vec_components].value (i,q)[d]
-                             ==
-                             fe_values.shape_value_component (i,q,c+d),
-                             ExcInternalError());
-
-                     Assert (fe_values[vec_components].gradient (i,q)[d]
-                             ==
-                             fe_values.shape_grad_component (i,q,c+d),
-                             ExcInternalError());
-
-                     Assert (fe_values[vec_components].symmetric_gradient (i,q)
-                             ==
-                             (fe_values[vec_components].gradient(i,q) +
-                              transpose(fe_values[vec_components].gradient(i,q)))/2,
-                             ExcInternalError());
-
-                     Assert (fe_values[vec_components].hessian (i,q)[d]
-                             ==
-                             fe_values.shape_hessian_component (i,q,c+d),
-                             ExcInternalError());
-                   }
-               }
-         }
+        // use a vector extractor if there
+        // are sufficiently many components
+        // left after the current component
+        // 'c'
+        if (c+dim <= fe.n_components())
+          {
+            FEValuesExtractors::Vector vec_components (c);
+
+            for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
+              for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+                {
+                  deallog << "i=" << i << ", q=" << q << std::endl;
+                  deallog << "   ";
+                  for (unsigned int k=0; k<dim; ++k)
+                    deallog << fe_values[vec_components].value (i,q)[k] << ' ';
+                  for (unsigned int k=0; k<dim; ++k)
+                    for (unsigned int l=0; l<dim; ++l)
+                      deallog << fe_values[vec_components].gradient (i,q)[k][l] << ' ';
+                  deallog << std::endl;
+                  for (unsigned int k=0; k<dim; ++k)
+                    for (unsigned int l=0; l<dim; ++l)
+                      for (unsigned int m=0; m<dim; ++m)
+                        deallog << fe_values[vec_components].symmetric_gradient (i,q)[k][l]
+                                << ' '
+                                << fe_values[vec_components].hessian (i,q)[k][l][m]
+                                << std::endl;
+
+                  for (unsigned int d=0; d<dim; ++d)
+                    {
+                      Assert (fe_values[vec_components].value (i,q)[d]
+                              ==
+                              fe_values.shape_value_component (i,q,c+d),
+                              ExcInternalError());
+
+                      Assert (fe_values[vec_components].gradient (i,q)[d]
+                              ==
+                              fe_values.shape_grad_component (i,q,c+d),
+                              ExcInternalError());
+
+                      Assert (fe_values[vec_components].symmetric_gradient (i,q)
+                              ==
+                              (fe_values[vec_components].gradient(i,q) +
+                               transpose(fe_values[vec_components].gradient(i,q)))/2,
+                              ExcInternalError());
+
+                      Assert (fe_values[vec_components].hessian (i,q)[d]
+                              ==
+                              fe_values.shape_hessian_component (i,q,c+d),
+                              ExcInternalError());
+                    }
+                }
+          }
     }
 }
 
@@ -125,8 +125,8 @@ void test_hyper_sphere()
   tr.set_boundary (0, boundary);
 
   FESystem<dim> fe (FE_Q<dim>(1), 1,
-                   FE_RaviartThomas<dim>(1), 1,
-                   FE_Nedelec<dim>(0), 1);
+                    FE_RaviartThomas<dim>(1), 1,
+                    FE_Nedelec<dim>(0), 1);
   test(tr, fe);
 }
 
index b6be16b576226cbb0a3d9e0daa86954736c20241..54e06df4a292aba22579011b0341929b33504042 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -50,32 +50,32 @@ void test (const Triangulation<dim>& tr,
   Vector<double> fe_function(dof.n_dofs());
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
     fe_function(i) = i+1;
-  
+
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients | update_hessians);
+                           update_values | update_gradients | update_hessians);
   fe_values.reinit (dof.begin_active());
 
   std::vector<double> scalar_values (quadrature.size());
   std::vector<Vector<double> > vector_values (quadrature.size(),
-                                             Vector<double>(fe.n_components()));
+                                              Vector<double>(fe.n_components()));
 
   fe_values.get_function_values (fe_function, vector_values);
-  
+
   for (unsigned int c=0; c<fe.n_components(); ++c)
     {
       FEValuesExtractors::Scalar single_component (c);
       fe_values[single_component].get_function_values (fe_function,
-                                                      scalar_values);
+                                                       scalar_values);
       deallog << "component=" << c << std::endl;
-      
+
       for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-       {
-         deallog << scalar_values[q] << std::endl;
-         Assert (std::fabs (scalar_values[q] - vector_values[q](c))
-                 <= 1e-12 * std::fabs (scalar_values[q]),
-                 ExcInternalError());
-       }
+        {
+          deallog << scalar_values[q] << std::endl;
+          Assert (std::fabs (scalar_values[q] - vector_values[q](c))
+                  <= 1e-12 * std::fabs (scalar_values[q]),
+                  ExcInternalError());
+        }
     }
 }
 
@@ -91,8 +91,8 @@ void test_hyper_sphere()
   tr.set_boundary (0, boundary);
 
   FESystem<dim> fe (FE_Q<dim>(1), 1,
-                   FE_Q<dim>(2), 2,
-                   FE_DGQ<dim>(3), dim);
+                    FE_Q<dim>(2), 2,
+                    FE_DGQ<dim>(3), dim);
   test(tr, fe);
 }
 
index 3afb8e29ac49c168842f1fc9a852a2bf60275022..e92f4fc6196f35af5784e4be3a645e07268afcca 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -50,33 +50,33 @@ void test (const Triangulation<dim>& tr,
   Vector<double> fe_function(dof.n_dofs());
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
     fe_function(i) = i+1;
-  
+
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients | update_hessians);
+                           update_values | update_gradients | update_hessians);
   fe_values.reinit (dof.begin_active());
 
   std::vector<Tensor<1,dim> > scalar_values (quadrature.size());
   std::vector<std::vector<Tensor<1,dim> > >
-    vector_values (quadrature.size(),
-                  std::vector<Tensor<1,dim> >(fe.n_components()));
+  vector_values (quadrature.size(),
+                 std::vector<Tensor<1,dim> >(fe.n_components()));
 
   fe_values.get_function_gradients (fe_function, vector_values);
-  
+
   for (unsigned int c=0; c<fe.n_components(); ++c)
     {
       FEValuesExtractors::Scalar single_component (c);
       fe_values[single_component].get_function_gradients (fe_function,
-                                                         scalar_values);
+                                                          scalar_values);
       deallog << "component=" << c << std::endl;
-      
+
       for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-       {
-         deallog << scalar_values[q] << std::endl;
-         Assert ((scalar_values[q] - vector_values[q][c]).norm()
-                 <= 1e-12 * scalar_values[q].norm(),
-                 ExcInternalError());
-       }
+        {
+          deallog << scalar_values[q] << std::endl;
+          Assert ((scalar_values[q] - vector_values[q][c]).norm()
+                  <= 1e-12 * scalar_values[q].norm(),
+                  ExcInternalError());
+        }
     }
 }
 
@@ -92,8 +92,8 @@ void test_hyper_sphere()
   tr.set_boundary (0, boundary);
 
   FESystem<dim> fe (FE_Q<dim>(1), 1,
-                   FE_Q<dim>(2), 2,
-                   FE_DGQ<dim>(3), dim);
+                    FE_Q<dim>(2), 2,
+                    FE_DGQ<dim>(3), dim);
   test(tr, fe);
 }
 
index 6a2869b96d1a74043e7fbab569376af889944d35..2e9e144b357121cee3295a7fc8a275899a1a11fd 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -50,33 +50,33 @@ void test (const Triangulation<dim>& tr,
   Vector<double> fe_function(dof.n_dofs());
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
     fe_function(i) = i+1;
-  
+
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients | update_hessians);
+                           update_values | update_gradients | update_hessians);
   fe_values.reinit (dof.begin_active());
 
   std::vector<Tensor<2,dim> > scalar_values (quadrature.size());
   std::vector<std::vector<Tensor<2,dim> > >
-    vector_values (quadrature.size(),
-                  std::vector<Tensor<2,dim> >(fe.n_components()));
+  vector_values (quadrature.size(),
+                 std::vector<Tensor<2,dim> >(fe.n_components()));
 
   fe_values.get_function_hessians (fe_function, vector_values);
-  
+
   for (unsigned int c=0; c<fe.n_components(); ++c)
     {
       FEValuesExtractors::Scalar single_component (c);
       fe_values[single_component].get_function_hessians (fe_function,
-                                                        scalar_values);
+                                                         scalar_values);
       deallog << "component=" << c << std::endl;
-      
+
       for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-       {
-         deallog << scalar_values[q] << std::endl;
-         Assert ((scalar_values[q] - vector_values[q][c]).norm()
-                 <= 1e-12 * scalar_values[q].norm(),
-                 ExcInternalError());
-       }
+        {
+          deallog << scalar_values[q] << std::endl;
+          Assert ((scalar_values[q] - vector_values[q][c]).norm()
+                  <= 1e-12 * scalar_values[q].norm(),
+                  ExcInternalError());
+        }
     }
 }
 
@@ -92,8 +92,8 @@ void test_hyper_sphere()
   tr.set_boundary (0, boundary);
 
   FESystem<dim> fe (FE_Q<dim>(1), 1,
-                   FE_Q<dim>(2), 2,
-                   FE_DGQ<dim>(3), dim);
+                    FE_Q<dim>(2), 2,
+                    FE_DGQ<dim>(3), dim);
   test(tr, fe);
 }
 
index f4506edcae49b1612676e03ba0639ca493b6b361..4ecc8200f3324a70e5c55570d8c565a6f12bc617 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -52,32 +52,32 @@ void test (const Triangulation<dim>& tr,
   Vector<double> fe_function(dof.n_dofs());
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
     fe_function(i) = i+1;
-  
+
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients | update_hessians);
+                           update_values | update_gradients | update_hessians);
   fe_values.reinit (dof.begin_active());
 
   std::vector<double> scalar_values (quadrature.size());
   std::vector<Vector<double> > vector_values (quadrature.size(),
-                                             Vector<double>(fe.n_components()));
+                                              Vector<double>(fe.n_components()));
 
   fe_values.get_function_values (fe_function, vector_values);
-  
+
   for (unsigned int c=0; c<fe.n_components(); ++c)
     {
       FEValuesExtractors::Scalar single_component (c);
       fe_values[single_component].get_function_values (fe_function,
-                                                      scalar_values);
+                                                       scalar_values);
       deallog << "component=" << c << std::endl;
-      
+
       for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-       {
-         deallog << scalar_values[q] << std::endl;
-         Assert (std::fabs (scalar_values[q] - vector_values[q](c))
-                 <= 1e-12 * std::fabs (scalar_values[q]),
-                 ExcInternalError());
-       }
+        {
+          deallog << scalar_values[q] << std::endl;
+          Assert (std::fabs (scalar_values[q] - vector_values[q](c))
+                  <= 1e-12 * std::fabs (scalar_values[q]),
+                  ExcInternalError());
+        }
     }
 }
 
@@ -93,8 +93,8 @@ void test_hyper_sphere()
   tr.set_boundary (0, boundary);
 
   FESystem<dim> fe (FE_Q<dim>(1), 1,
-                   FE_RaviartThomas<dim>(1), 1,
-                   FE_Nedelec<dim>(0), 1);
+                    FE_RaviartThomas<dim>(1), 1,
+                    FE_Nedelec<dim>(0), 1);
   test(tr, fe);
 }
 
index 5ac5aff2b58d1f321dee417207cd6b4f74b34750..06dc69f23dccb820dff64ca8a24f42f795344158 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -55,13 +55,13 @@ void test (const Triangulation<dim>& tr,
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients | update_hessians);
+                           update_values | update_gradients | update_hessians);
   fe_values.reinit (dof.begin_active());
 
   std::vector<Tensor<1,dim> > scalar_values (quadrature.size());
   std::vector<std::vector<Tensor<1,dim> > >
-    vector_values (quadrature.size(),
-                  std::vector<Tensor<1,dim> >(fe.n_components()));
+  vector_values (quadrature.size(),
+                 std::vector<Tensor<1,dim> >(fe.n_components()));
 
   fe_values.get_function_gradients (fe_function, vector_values);
 
@@ -69,18 +69,18 @@ void test (const Triangulation<dim>& tr,
     {
       FEValuesExtractors::Scalar single_component (c);
       fe_values[single_component].get_function_gradients (fe_function,
-                                                         scalar_values);
+                                                          scalar_values);
       deallog << "component=" << c << std::endl;
 
       for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-       {
-         for (unsigned int d=0; d<dim; ++d)
-           deallog << scalar_values[q][d] << (d<dim-1 ? " " : "");
-         deallog << std::endl;
-         Assert ((scalar_values[q] - vector_values[q][c]).norm()
-                 <= 1e-12 * scalar_values[q].norm(),
-                 ExcInternalError());
-       }
+        {
+          for (unsigned int d=0; d<dim; ++d)
+            deallog << scalar_values[q][d] << (d<dim-1 ? " " : "");
+          deallog << std::endl;
+          Assert ((scalar_values[q] - vector_values[q][c]).norm()
+                  <= 1e-12 * scalar_values[q].norm(),
+                  ExcInternalError());
+        }
     }
 }
 
@@ -96,8 +96,8 @@ void test_hyper_sphere()
   tr.set_boundary (0, boundary);
 
   FESystem<dim> fe (FE_Q<dim>(1), 1,
-                   FE_RaviartThomas<dim>(1), 1,
-                   FE_Nedelec<dim>(0), 1);
+                    FE_RaviartThomas<dim>(1), 1,
+                    FE_Nedelec<dim>(0), 1);
   test(tr, fe);
 }
 
index ff3a8a06d6edb98d808b05cb563ec7041e044455..a39b14aa20c9a680631f94c7650abc0772b913de 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -55,13 +55,13 @@ void test (const Triangulation<dim>& tr,
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients | update_hessians);
+                           update_values | update_gradients | update_hessians);
   fe_values.reinit (dof.begin_active());
 
   std::vector<Tensor<2,dim> > scalar_values (quadrature.size());
   std::vector<std::vector<Tensor<2,dim> > >
-    vector_values (quadrature.size(),
-                  std::vector<Tensor<2,dim> >(fe.n_components()));
+  vector_values (quadrature.size(),
+                 std::vector<Tensor<2,dim> >(fe.n_components()));
 
   fe_values.get_function_hessians (fe_function, vector_values);
 
@@ -69,19 +69,19 @@ void test (const Triangulation<dim>& tr,
     {
       FEValuesExtractors::Scalar single_component (c);
       fe_values[single_component].get_function_hessians (fe_function,
-                                                        scalar_values);
+                                                         scalar_values);
       deallog << "component=" << c << std::endl;
 
       for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-       {
-         for (unsigned int d=0; d<dim; ++d)
-           for (unsigned int e=0; e<dim; ++e)
-             deallog << scalar_values[q][d][e] << (d<dim-1 || e<dim-1 ? " " : "");
-         deallog << std::endl;
-         Assert ((scalar_values[q] - vector_values[q][c]).norm()
-                 <= 1e-12 * scalar_values[q].norm(),
-                 ExcInternalError());
-       }
+        {
+          for (unsigned int d=0; d<dim; ++d)
+            for (unsigned int e=0; e<dim; ++e)
+              deallog << scalar_values[q][d][e] << (d<dim-1 || e<dim-1 ? " " : "");
+          deallog << std::endl;
+          Assert ((scalar_values[q] - vector_values[q][c]).norm()
+                  <= 1e-12 * scalar_values[q].norm(),
+                  ExcInternalError());
+        }
     }
 }
 
@@ -97,8 +97,8 @@ void test_hyper_sphere()
   tr.set_boundary (0, boundary);
 
   FESystem<dim> fe (FE_Q<dim>(1), 1,
-                   FE_RaviartThomas<dim>(1), 1,
-                   FE_Nedelec<dim>(0), 1);
+                    FE_RaviartThomas<dim>(1), 1,
+                    FE_Nedelec<dim>(0), 1);
   test(tr, fe);
 }
 
index 5eebe55ddb19fd9559dbd3a06fb8628b24a417c1..199476af3fab6bc2e42115cf7124680268e3dc9d 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -58,13 +58,13 @@ void test (const Triangulation<dim>& tr,
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients | update_hessians);
+                           update_values | update_gradients | update_hessians);
   fe_values.reinit (dof.begin_active());
 
   std::vector<Tensor<2,dim> > scalar_values (quadrature.size());
   std::vector<std::vector<Tensor<2,dim> > >
-    vector_values (quadrature.size(),
-                  std::vector<Tensor<2,dim> >(fe.n_components()));
+  vector_values (quadrature.size(),
+                 std::vector<Tensor<2,dim> >(fe.n_components()));
 
   fe_values.get_function_hessians (fe_function, vector_values);
 
@@ -72,20 +72,20 @@ void test (const Triangulation<dim>& tr,
     {
       FEValuesExtractors::Scalar single_component (c);
       fe_values[single_component].get_function_hessians (fe_function,
-                                                        scalar_values);
+                                                         scalar_values);
       deallog << "component=" << c << std::endl;
 
       for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-       {
-         for (unsigned int d=0; d<dim; ++d)
-           for (unsigned int e=0; e<dim; ++e)
-             deallog << scalar_values[q][d][e] << (d<dim-1 || e<dim-1 ? " " : "");
-         deallog << std::endl;
-
-         Assert ((scalar_values[q] - vector_values[q][c]).norm()
-                 <= 1e-12 * scalar_values[q].norm(),
-                 ExcInternalError());
-       }
+        {
+          for (unsigned int d=0; d<dim; ++d)
+            for (unsigned int e=0; e<dim; ++e)
+              deallog << scalar_values[q][d][e] << (d<dim-1 || e<dim-1 ? " " : "");
+          deallog << std::endl;
+
+          Assert ((scalar_values[q] - vector_values[q][c]).norm()
+                  <= 1e-12 * scalar_values[q].norm(),
+                  ExcInternalError());
+        }
     }
 }
 
index 667de19ee5522e9043b83349e02e65e5e79ad481..0ed490de0ba07cfb2b377766982b90ce29c7c3b0 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -58,13 +58,13 @@ void test (const Triangulation<dim>& tr,
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients | update_hessians);
+                           update_values | update_gradients | update_hessians);
   fe_values.reinit (dof.begin_active());
 
   std::vector<Tensor<2,dim> > scalar_values (quadrature.size());
   std::vector<std::vector<Tensor<2,dim> > >
-    vector_values (quadrature.size(),
-                  std::vector<Tensor<2,dim> >(fe.n_components()));
+  vector_values (quadrature.size(),
+                 std::vector<Tensor<2,dim> >(fe.n_components()));
 
   fe_values.get_function_hessians (fe_function, vector_values);
 
@@ -72,20 +72,20 @@ void test (const Triangulation<dim>& tr,
     {
       FEValuesExtractors::Scalar single_component (c);
       fe_values[single_component].get_function_hessians (fe_function,
-                                                        scalar_values);
+                                                         scalar_values);
       deallog << "component=" << c << std::endl;
 
       for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-       {
-         for (unsigned int d=0; d<dim; ++d)
-           for (unsigned int e=0; e<dim; ++e)
-             deallog << scalar_values[q][d][e] << (d<dim-1 || e<dim-1 ? " " : "");
-         deallog << std::endl;
-
-         Assert ((scalar_values[q] - vector_values[q][c]).norm()
-                 <= 1e-12 * scalar_values[q].norm(),
-                 ExcInternalError());
-       }
+        {
+          for (unsigned int d=0; d<dim; ++d)
+            for (unsigned int e=0; e<dim; ++e)
+              deallog << scalar_values[q][d][e] << (d<dim-1 || e<dim-1 ? " " : "");
+          deallog << std::endl;
+
+          Assert ((scalar_values[q] - vector_values[q][c]).norm()
+                  <= 1e-12 * scalar_values[q].norm(),
+                  ExcInternalError());
+        }
     }
 }
 
index 743905b39281bebc726b0b7f53f5d9b24ac89da9..3a448b6fdf115c5418a27e613bd84f38f173b57f 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -58,13 +58,13 @@ void test (const Triangulation<dim>& tr,
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients | update_hessians);
+                           update_values | update_gradients | update_hessians);
   fe_values.reinit (dof.begin_active());
 
   std::vector<Tensor<2,dim> > scalar_values (quadrature.size());
   std::vector<std::vector<Tensor<2,dim> > >
-    vector_values (quadrature.size(),
-                  std::vector<Tensor<2,dim> >(fe.n_components()));
+  vector_values (quadrature.size(),
+                 std::vector<Tensor<2,dim> >(fe.n_components()));
 
   fe_values.get_function_hessians (fe_function, vector_values);
 
@@ -72,20 +72,20 @@ void test (const Triangulation<dim>& tr,
     {
       FEValuesExtractors::Scalar single_component (c);
       fe_values[single_component].get_function_hessians (fe_function,
-                                                        scalar_values);
+                                                         scalar_values);
       deallog << "component=" << c << std::endl;
 
       for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-       {
-         for (unsigned int d=0; d<dim; ++d)
-           for (unsigned int e=0; e<dim; ++e)
-             deallog << scalar_values[q][d][e] << (d<dim-1 || e<dim-1 ? " " : "");
-         deallog << std::endl;
-
-         Assert ((scalar_values[q] - vector_values[q][c]).norm()
-                 <= 1e-12 * scalar_values[q].norm(),
-                 ExcInternalError());
-       }
+        {
+          for (unsigned int d=0; d<dim; ++d)
+            for (unsigned int e=0; e<dim; ++e)
+              deallog << scalar_values[q][d][e] << (d<dim-1 || e<dim-1 ? " " : "");
+          deallog << std::endl;
+
+          Assert ((scalar_values[q] - vector_values[q][c]).norm()
+                  <= 1e-12 * scalar_values[q].norm(),
+                  ExcInternalError());
+        }
     }
 }
 
index 6cb3d7634d5e03271c85cc3c8e39d26199df6a4f..69ef0735fcd3959419818f19cd5532d35686f32c 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -57,33 +57,33 @@ void test (const Triangulation<dim>& tr,
   Vector<double> fe_function(dof.n_dofs());
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
     fe_function(i) = i+1;
-  
+
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients | update_hessians);
+                           update_values | update_gradients | update_hessians);
   fe_values.reinit (dof.begin_active());
 
   std::vector<double> scalar_values (quadrature.size());
   std::vector<Vector<double> >
-    vector_values (quadrature.size(),
-                  Vector<double>(fe.n_components()));
+  vector_values (quadrature.size(),
+                 Vector<double>(fe.n_components()));
 
   fe_values.get_function_values (fe_function, vector_values);
-  
+
   for (unsigned int c=0; c<fe.n_components(); ++c)
     {
       FEValuesExtractors::Scalar single_component (c);
       fe_values[single_component].get_function_values (fe_function,
-                                                      scalar_values);
+                                                       scalar_values);
       deallog << "component=" << c << std::endl;
-      
+
       for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-       {
-         deallog << scalar_values[q] << std::endl;
-         Assert (std::fabs(scalar_values[q] - vector_values[q](c))
-                 <= 1e-12 * std::fabs(scalar_values[q]),
-                 ExcInternalError());
-       }
+        {
+          deallog << scalar_values[q] << std::endl;
+          Assert (std::fabs(scalar_values[q] - vector_values[q](c))
+                  <= 1e-12 * std::fabs(scalar_values[q]),
+                  ExcInternalError());
+        }
     }
 }
 
@@ -99,8 +99,8 @@ void test_hyper_sphere()
   tr.set_boundary (0, boundary);
 
   FESystem<dim> fe (FE_Q<dim>(1), 1,
-                   FE_RaviartThomas<dim>(1), 1,
-                   FE_Nedelec<dim>(0), 1);
+                    FE_RaviartThomas<dim>(1), 1,
+                    FE_Nedelec<dim>(0), 1);
   test(tr, fe);
 }
 
index e957a40ea822fe5ea7eb6d0754d057ec618c449f..bb2e1d7a62242d6fb71fbb9c48d73ec342fccd38 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -50,38 +50,38 @@ void test (const Triangulation<dim>& tr,
   Vector<double> fe_function(dof.n_dofs());
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
     fe_function(i) = i+1;
-  
+
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients | update_hessians);
+                           update_values | update_gradients | update_hessians);
   fe_values.reinit (dof.begin_active());
 
   std::vector<Tensor<1,dim> > selected_vector_values (quadrature.size());
   std::vector<Vector<double> > vector_values (quadrature.size(),
-                                             Vector<double>(fe.n_components()));
+                                              Vector<double>(fe.n_components()));
 
   fe_values.get_function_values (fe_function, vector_values);
-  
+
   for (unsigned int c=0; c<fe.n_components(); ++c)
-                                    // use a vector extractor if there
-                                    // are sufficiently many components
-                                    // left after the current component
-                                    // 'c'
+    // use a vector extractor if there
+    // are sufficiently many components
+    // left after the current component
+    // 'c'
     if (c+dim <= fe.n_components())
       {
-       FEValuesExtractors::Vector vector_components (c);
-       fe_values[vector_components].get_function_values (fe_function,
-                                                        selected_vector_values);
-       deallog << "component=" << c << std::endl;
-      
-       for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-         for (unsigned int d=0; d<dim; ++d)
-           {
-             deallog << selected_vector_values[q][d] << std::endl;
-             Assert (std::fabs (selected_vector_values[q][d] - vector_values[q](c+d))
-                     <= 1e-12 * selected_vector_values[q].norm(),
-                     ExcInternalError());
-           }
+        FEValuesExtractors::Vector vector_components (c);
+        fe_values[vector_components].get_function_values (fe_function,
+                                                          selected_vector_values);
+        deallog << "component=" << c << std::endl;
+
+        for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+          for (unsigned int d=0; d<dim; ++d)
+            {
+              deallog << selected_vector_values[q][d] << std::endl;
+              Assert (std::fabs (selected_vector_values[q][d] - vector_values[q](c+d))
+                      <= 1e-12 * selected_vector_values[q].norm(),
+                      ExcInternalError());
+            }
       }
 }
 
@@ -97,8 +97,8 @@ void test_hyper_sphere()
   tr.set_boundary (0, boundary);
 
   FESystem<dim> fe (FE_Q<dim>(1), 1,
-                   FE_Q<dim>(2), 2,
-                   FE_DGQ<dim>(3), dim);
+                    FE_Q<dim>(2), 2,
+                    FE_DGQ<dim>(3), dim);
   test(tr, fe);
 }
 
index 8cdada460588b37789fdc48914384d2f59bcddb7..30c978d5c41af1b296a03c2c217d215eaf9e19aa 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -50,39 +50,39 @@ void test (const Triangulation<dim>& tr,
   Vector<double> fe_function(dof.n_dofs());
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
     fe_function(i) = i+1;
-  
+
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients | update_hessians);
+                           update_values | update_gradients | update_hessians);
   fe_values.reinit (dof.begin_active());
 
   std::vector<Tensor<2,dim> > selected_vector_values (quadrature.size());
   std::vector<std::vector<Tensor<1,dim> > >
-    vector_values (quadrature.size(),
-                  std::vector<Tensor<1,dim> >(fe.n_components()));
+  vector_values (quadrature.size(),
+                 std::vector<Tensor<1,dim> >(fe.n_components()));
 
   fe_values.get_function_gradients (fe_function, vector_values);
-  
+
   for (unsigned int c=0; c<fe.n_components(); ++c)
-                                    // use a vector extractor if there
-                                    // are sufficiently many components
-                                    // left after the current component
-                                    // 'c'
+    // use a vector extractor if there
+    // are sufficiently many components
+    // left after the current component
+    // 'c'
     if (c+dim <= fe.n_components())
       {
-       FEValuesExtractors::Vector vector_components (c);
-       fe_values[vector_components].get_function_gradients (fe_function,
-                                                           selected_vector_values);
-       deallog << "component=" << c << std::endl;
-      
-       for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-         for (unsigned int d=0; d<dim; ++d)
-           {
-             deallog << selected_vector_values[q][d] << std::endl;
-             Assert ((selected_vector_values[q][d] - vector_values[q][c+d]).norm()
-                     <= 1e-12 * selected_vector_values[q][d].norm(),
-                     ExcInternalError());
-         }
+        FEValuesExtractors::Vector vector_components (c);
+        fe_values[vector_components].get_function_gradients (fe_function,
+                                                             selected_vector_values);
+        deallog << "component=" << c << std::endl;
+
+        for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+          for (unsigned int d=0; d<dim; ++d)
+            {
+              deallog << selected_vector_values[q][d] << std::endl;
+              Assert ((selected_vector_values[q][d] - vector_values[q][c+d]).norm()
+                      <= 1e-12 * selected_vector_values[q][d].norm(),
+                      ExcInternalError());
+            }
       }
 }
 
@@ -98,8 +98,8 @@ void test_hyper_sphere()
   tr.set_boundary (0, boundary);
 
   FESystem<dim> fe (FE_Q<dim>(1), 1,
-                   FE_Q<dim>(2), 2,
-                   FE_DGQ<dim>(3), dim);
+                    FE_Q<dim>(2), 2,
+                    FE_DGQ<dim>(3), dim);
   test(tr, fe);
 }
 
index 2012ee5957108aca1d42ffd9d98fd32956e7214e..c04d5f0fe254e6e965a2b0840df354a80e691d36 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -50,39 +50,39 @@ void test (const Triangulation<dim>& tr,
   Vector<double> fe_function(dof.n_dofs());
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
     fe_function(i) = i+1;
-  
+
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients | update_hessians);
+                           update_values | update_gradients | update_hessians);
   fe_values.reinit (dof.begin_active());
 
   std::vector<Tensor<3,dim> > selected_vector_values (quadrature.size());
   std::vector<std::vector<Tensor<2,dim> > >
-    vector_values (quadrature.size(),
-                  std::vector<Tensor<2,dim> >(fe.n_components()));
+  vector_values (quadrature.size(),
+                 std::vector<Tensor<2,dim> >(fe.n_components()));
 
   fe_values.get_function_hessians (fe_function, vector_values);
-  
+
   for (unsigned int c=0; c<fe.n_components(); ++c)
-                                    // use a vector extractor if there
-                                    // are sufficiently many components
-                                    // left after the current component
-                                    // 'c'
+    // use a vector extractor if there
+    // are sufficiently many components
+    // left after the current component
+    // 'c'
     if (c+dim <= fe.n_components())
       {
-       FEValuesExtractors::Vector vector_components (c);
-       fe_values[vector_components].get_function_hessians (fe_function,
-                                                          selected_vector_values);
-       deallog << "component=" << c << std::endl;
-      
-       for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-         for (unsigned int d=0; d<dim; ++d)
-           {
-             deallog << selected_vector_values[q][d] << std::endl;
-             Assert ((selected_vector_values[q][d] - vector_values[q][c+d]).norm()
-                     <= 1e-12 * selected_vector_values[q][d].norm(),
-                     ExcInternalError());
-           }
+        FEValuesExtractors::Vector vector_components (c);
+        fe_values[vector_components].get_function_hessians (fe_function,
+                                                            selected_vector_values);
+        deallog << "component=" << c << std::endl;
+
+        for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+          for (unsigned int d=0; d<dim; ++d)
+            {
+              deallog << selected_vector_values[q][d] << std::endl;
+              Assert ((selected_vector_values[q][d] - vector_values[q][c+d]).norm()
+                      <= 1e-12 * selected_vector_values[q][d].norm(),
+                      ExcInternalError());
+            }
       }
 }
 
@@ -98,8 +98,8 @@ void test_hyper_sphere()
   tr.set_boundary (0, boundary);
 
   FESystem<dim> fe (FE_Q<dim>(1), 1,
-                   FE_Q<dim>(2), 2,
-                   FE_DGQ<dim>(3), dim);
+                    FE_Q<dim>(2), 2,
+                    FE_DGQ<dim>(3), dim);
   test(tr, fe);
 }
 
index cff65c57a229306f7a478932e4a751184c1dbb78..44ecf90ee06561441ca83142607bdf4ca1b59d64 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -52,40 +52,40 @@ void test (const Triangulation<dim>& tr,
   Vector<double> fe_function(dof.n_dofs());
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
     fe_function(i) = i+1;
-  
+
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients | update_hessians);
+                           update_values | update_gradients | update_hessians);
   fe_values.reinit (dof.begin_active());
 
   std::vector<Tensor<1,dim> > selected_vector_values (quadrature.size());
   std::vector<Vector<double> > vector_values (quadrature.size(),
-                                             Vector<double>(fe.n_components()));
+                                              Vector<double>(fe.n_components()));
 
   fe_values.get_function_values (fe_function, vector_values);
-  
+
   for (unsigned int c=0; c<fe.n_components(); ++c)
-                                    // use a vector extractor if there
-                                    // are sufficiently many components
-                                    // left after the current component
-                                    // 'c'
+    // use a vector extractor if there
+    // are sufficiently many components
+    // left after the current component
+    // 'c'
     if (c+dim <= fe.n_components())
       {
-       FEValuesExtractors::Vector vector_components (c);
-       fe_values[vector_components].get_function_values (fe_function,
-                                                        selected_vector_values);
-       deallog << "component=" << c << std::endl;
-      
-       for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-         for (unsigned int d=0; d<dim; ++d)
-           {
-             deallog << selected_vector_values[q][d] << std::endl;
-             Assert ((std::fabs (selected_vector_values[q][d] - vector_values[q](c+d))
-                      <= 1e-12 * selected_vector_values[q].norm())
-                     ||
-                     (selected_vector_values[q].norm() < 1e-12),
-                     ExcInternalError());
-           }
+        FEValuesExtractors::Vector vector_components (c);
+        fe_values[vector_components].get_function_values (fe_function,
+                                                          selected_vector_values);
+        deallog << "component=" << c << std::endl;
+
+        for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+          for (unsigned int d=0; d<dim; ++d)
+            {
+              deallog << selected_vector_values[q][d] << std::endl;
+              Assert ((std::fabs (selected_vector_values[q][d] - vector_values[q](c+d))
+                       <= 1e-12 * selected_vector_values[q].norm())
+                      ||
+                      (selected_vector_values[q].norm() < 1e-12),
+                      ExcInternalError());
+            }
       }
 }
 
@@ -101,8 +101,8 @@ void test_hyper_sphere()
   tr.set_boundary (0, boundary);
 
   FESystem<dim> fe (FE_Q<dim>(1), 1,
-                   FE_RaviartThomas<dim>(1), 1,
-                   FE_Nedelec<dim>(0), 1);
+                    FE_RaviartThomas<dim>(1), 1,
+                    FE_Nedelec<dim>(0), 1);
   test(tr, fe);
 }
 
index 19d42885b1c3ebb6b70da141dbb09cde069508a5..e031f921569bd321bcf158552fb78b9ad655d598 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -55,38 +55,38 @@ void test (const Triangulation<dim>& tr,
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients | update_hessians);
+                           update_values | update_gradients | update_hessians);
   fe_values.reinit (dof.begin_active());
 
   std::vector<Tensor<2,dim> > selected_vector_values (quadrature.size());
   std::vector<std::vector<Tensor<1,dim> > >
-    vector_values (quadrature.size(),
-                  std::vector<Tensor<1,dim> >(fe.n_components()));
+  vector_values (quadrature.size(),
+                 std::vector<Tensor<1,dim> >(fe.n_components()));
 
   fe_values.get_function_gradients (fe_function, vector_values);
 
   for (unsigned int c=0; c<fe.n_components(); ++c)
-                                    // use a vector extractor if there
-                                    // are sufficiently many components
-                                    // left after the current component
-                                    // 'c'
+    // use a vector extractor if there
+    // are sufficiently many components
+    // left after the current component
+    // 'c'
     if (c+dim <= fe.n_components())
       {
-       FEValuesExtractors::Vector vector_components (c);
-       fe_values[vector_components].get_function_gradients (fe_function,
-                                                           selected_vector_values);
-       deallog << "component=" << c << std::endl;
-
-       for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-         for (unsigned int d=0; d<dim; ++d)
-           {
-             for (unsigned int e=0; e<dim; ++e)
-               deallog << selected_vector_values[q][d][e] << (e<dim-1 ? " " : "");
-             deallog << std::endl;
-             Assert ((selected_vector_values[q][d] - vector_values[q][c+d]).norm()
-                     <= 1e-12 * selected_vector_values[q][d].norm(),
-                     ExcInternalError());
-           }
+        FEValuesExtractors::Vector vector_components (c);
+        fe_values[vector_components].get_function_gradients (fe_function,
+                                                             selected_vector_values);
+        deallog << "component=" << c << std::endl;
+
+        for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+          for (unsigned int d=0; d<dim; ++d)
+            {
+              for (unsigned int e=0; e<dim; ++e)
+                deallog << selected_vector_values[q][d][e] << (e<dim-1 ? " " : "");
+              deallog << std::endl;
+              Assert ((selected_vector_values[q][d] - vector_values[q][c+d]).norm()
+                      <= 1e-12 * selected_vector_values[q][d].norm(),
+                      ExcInternalError());
+            }
       }
 }
 
@@ -102,8 +102,8 @@ void test_hyper_sphere()
   tr.set_boundary (0, boundary);
 
   FESystem<dim> fe (FE_Q<dim>(1), 1,
-                   FE_RaviartThomas<dim>(1), 1,
-                   FE_Nedelec<dim>(0), 1);
+                    FE_RaviartThomas<dim>(1), 1,
+                    FE_Nedelec<dim>(0), 1);
   test(tr, fe);
 }
 
index de5625f8ac9f3e28dc04bdedfd96511396fe17fd..a6334795e571b818fefb526fccb211684c15eb9c 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -55,39 +55,39 @@ void test (const Triangulation<dim>& tr,
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients | update_hessians);
+                           update_values | update_gradients | update_hessians);
   fe_values.reinit (dof.begin_active());
 
   std::vector<Tensor<3,dim> > selected_vector_values (quadrature.size());
   std::vector<std::vector<Tensor<2,dim> > >
-    vector_values (quadrature.size(),
-                  std::vector<Tensor<2,dim> >(fe.n_components()));
+  vector_values (quadrature.size(),
+                 std::vector<Tensor<2,dim> >(fe.n_components()));
 
   fe_values.get_function_hessians (fe_function, vector_values);
 
   for (unsigned int c=0; c<fe.n_components(); ++c)
-                                    // use a vector extractor if there
-                                    // are sufficiently many components
-                                    // left after the current component
-                                    // 'c'
+    // use a vector extractor if there
+    // are sufficiently many components
+    // left after the current component
+    // 'c'
     if (c+dim <= fe.n_components())
       {
-       FEValuesExtractors::Vector vector_components (c);
-       fe_values[vector_components].get_function_hessians (fe_function,
-                                                          selected_vector_values);
-       deallog << "component=" << c << std::endl;
-
-       for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-         for (unsigned int d=0; d<dim; ++d)
-           {
-             for (unsigned int e=0; e<dim; ++e)
-               for (unsigned int f=0; f<dim; ++f)
-                 deallog << selected_vector_values[q][d][e][f] << (e<dim-1 && f<dim-1 ? " " : "");
-             deallog << std::endl;
-             Assert ((selected_vector_values[q][d] - vector_values[q][c+d]).norm()
-                     <= 1e-12 * selected_vector_values[q][d].norm(),
-                     ExcInternalError());
-           }
+        FEValuesExtractors::Vector vector_components (c);
+        fe_values[vector_components].get_function_hessians (fe_function,
+                                                            selected_vector_values);
+        deallog << "component=" << c << std::endl;
+
+        for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+          for (unsigned int d=0; d<dim; ++d)
+            {
+              for (unsigned int e=0; e<dim; ++e)
+                for (unsigned int f=0; f<dim; ++f)
+                  deallog << selected_vector_values[q][d][e][f] << (e<dim-1 && f<dim-1 ? " " : "");
+              deallog << std::endl;
+              Assert ((selected_vector_values[q][d] - vector_values[q][c+d]).norm()
+                      <= 1e-12 * selected_vector_values[q][d].norm(),
+                      ExcInternalError());
+            }
       }
 }
 
@@ -103,8 +103,8 @@ void test_hyper_sphere()
   tr.set_boundary (0, boundary);
 
   FESystem<dim> fe (FE_Q<dim>(1), 1,
-                   FE_RaviartThomas<dim>(1), 1,
-                   FE_Nedelec<dim>(0), 1);
+                    FE_RaviartThomas<dim>(1), 1,
+                    FE_Nedelec<dim>(0), 1);
   test(tr, fe);
 }
 
index cb2d5f4d2d84675b0a1c1fa1f5059450c6ec1dac..660a502147424e9c33e4bd765ebf7f8f7c0710fe 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -50,43 +50,43 @@ void test (const Triangulation<dim>& tr,
   Vector<double> fe_function(dof.n_dofs());
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
     fe_function(i) = i+1;
-  
+
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients | update_hessians);
+                           update_values | update_gradients | update_hessians);
   fe_values.reinit (dof.begin_active());
 
   std::vector<SymmetricTensor<2,dim> > selected_vector_values (quadrature.size());
   std::vector<std::vector<Tensor<1,dim> > >
-    vector_values (quadrature.size(),
-                  std::vector<Tensor<1,dim> >(fe.n_components()));
+  vector_values (quadrature.size(),
+                 std::vector<Tensor<1,dim> >(fe.n_components()));
 
   fe_values.get_function_gradients (fe_function, vector_values);
-  
+
   for (unsigned int c=0; c<fe.n_components(); ++c)
-                                    // use a vector extractor if there
-                                    // are sufficiently many components
-                                    // left after the current component
-                                    // 'c'
+    // use a vector extractor if there
+    // are sufficiently many components
+    // left after the current component
+    // 'c'
     if (c+dim <= fe.n_components())
       {
-       FEValuesExtractors::Vector vector_components (c);
-       fe_values[vector_components].get_function_symmetric_gradients (fe_function,
-                                                                      selected_vector_values);
-       deallog << "component=" << c << std::endl;
-      
-       for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-         {
-           deallog << selected_vector_values[q] << std::endl;
-
-           Tensor<2,dim> grad;
-           for (unsigned int d=0; d<dim; ++d)
-             grad[d] = vector_values[q][c+d];
-           
-           Assert ((selected_vector_values[q] - symmetrize(grad)).norm()
-                   <= 1e-12 * selected_vector_values[q].norm(),
-                   ExcInternalError());
-         }
+        FEValuesExtractors::Vector vector_components (c);
+        fe_values[vector_components].get_function_symmetric_gradients (fe_function,
+            selected_vector_values);
+        deallog << "component=" << c << std::endl;
+
+        for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+          {
+            deallog << selected_vector_values[q] << std::endl;
+
+            Tensor<2,dim> grad;
+            for (unsigned int d=0; d<dim; ++d)
+              grad[d] = vector_values[q][c+d];
+
+            Assert ((selected_vector_values[q] - symmetrize(grad)).norm()
+                    <= 1e-12 * selected_vector_values[q].norm(),
+                    ExcInternalError());
+          }
       }
 }
 
@@ -102,8 +102,8 @@ void test_hyper_sphere()
   tr.set_boundary (0, boundary);
 
   FESystem<dim> fe (FE_Q<dim>(1), 1,
-                   FE_Q<dim>(2), 2,
-                   FE_DGQ<dim>(3), dim);
+                    FE_Q<dim>(2), 2,
+                    FE_DGQ<dim>(3), dim);
   test(tr, fe);
 }
 
index 13132948999db423a946409c2b62e93d9ec3ec52..94ad1383a7f9a4a6fe1b2096f372d1a88022de2d 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -55,43 +55,43 @@ void test (const Triangulation<dim>& tr,
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients | update_hessians);
+                           update_values | update_gradients | update_hessians);
   fe_values.reinit (dof.begin_active());
 
   std::vector<SymmetricTensor<2,dim> > selected_vector_values (quadrature.size());
   std::vector<std::vector<Tensor<1,dim> > >
-    vector_values (quadrature.size(),
-                  std::vector<Tensor<1,dim> >(fe.n_components()));
+  vector_values (quadrature.size(),
+                 std::vector<Tensor<1,dim> >(fe.n_components()));
 
   fe_values.get_function_gradients (fe_function, vector_values);
 
   for (unsigned int c=0; c<fe.n_components(); ++c)
-                                    // use a vector extractor if there
-                                    // are sufficiently many components
-                                    // left after the current component
-                                    // 'c'
+    // use a vector extractor if there
+    // are sufficiently many components
+    // left after the current component
+    // 'c'
     if (c+dim <= fe.n_components())
       {
-       FEValuesExtractors::Vector vector_components (c);
-       fe_values[vector_components].get_function_symmetric_gradients (fe_function,
-                                                                      selected_vector_values);
-       deallog << "component=" << c << std::endl;
-
-       for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-         {
-           for (unsigned int d=0; d<dim; ++d)
-             for (unsigned int e=0; e<dim; ++e)
-               deallog << selected_vector_values[q][d][e] << (d<dim-1 || e<dim-1 ? " " : "");
-           deallog << std::endl;
-
-           Tensor<2,dim> grad;
-           for (unsigned int d=0; d<dim; ++d)
-             grad[d] = vector_values[q][c+d];
-
-           Assert ((selected_vector_values[q] - symmetrize(grad)).norm()
-                   <= 1e-12 * selected_vector_values[q].norm(),
-                   ExcInternalError());
-         }
+        FEValuesExtractors::Vector vector_components (c);
+        fe_values[vector_components].get_function_symmetric_gradients (fe_function,
+            selected_vector_values);
+        deallog << "component=" << c << std::endl;
+
+        for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+          {
+            for (unsigned int d=0; d<dim; ++d)
+              for (unsigned int e=0; e<dim; ++e)
+                deallog << selected_vector_values[q][d][e] << (d<dim-1 || e<dim-1 ? " " : "");
+            deallog << std::endl;
+
+            Tensor<2,dim> grad;
+            for (unsigned int d=0; d<dim; ++d)
+              grad[d] = vector_values[q][c+d];
+
+            Assert ((selected_vector_values[q] - symmetrize(grad)).norm()
+                    <= 1e-12 * selected_vector_values[q].norm(),
+                    ExcInternalError());
+          }
       }
 }
 
@@ -107,8 +107,8 @@ void test_hyper_sphere()
   tr.set_boundary (0, boundary);
 
   FESystem<dim> fe (FE_Q<dim>(1), 1,
-                   FE_RaviartThomas<dim>(1), 1,
-                   FE_Nedelec<dim>(0), 1);
+                    FE_RaviartThomas<dim>(1), 1,
+                    FE_Nedelec<dim>(0), 1);
   test(tr, fe);
 }
 
index 2205a9bad29593f4d0a697f8b19ff15795a45d2f..fcd60889c27f1119e5b22569eb80a02e1d6ea77a 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -50,43 +50,43 @@ void test (const Triangulation<dim>& tr,
   Vector<double> fe_function(dof.n_dofs());
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
     fe_function(i) = i+1;
-  
+
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients | update_hessians);
+                           update_values | update_gradients | update_hessians);
   fe_values.reinit (dof.begin_active());
 
   std::vector<double> selected_vector_values (quadrature.size());
   std::vector<std::vector<Tensor<1,dim> > >
-    vector_values (quadrature.size(),
-                  std::vector<Tensor<1,dim> >(fe.n_components()));
+  vector_values (quadrature.size(),
+                 std::vector<Tensor<1,dim> >(fe.n_components()));
 
   fe_values.get_function_gradients (fe_function, vector_values);
-  
+
   for (unsigned int c=0; c<fe.n_components(); ++c)
-                                    // use a vector extractor if there
-                                    // are sufficiently many components
-                                    // left after the current component
-                                    // 'c'
+    // use a vector extractor if there
+    // are sufficiently many components
+    // left after the current component
+    // 'c'
     if (c+dim <= fe.n_components())
       {
-       FEValuesExtractors::Vector vector_components (c);
-       fe_values[vector_components].get_function_divergences (fe_function,
-                                                              selected_vector_values);
-       deallog << "component=" << c << std::endl;
-      
-       for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-         {
-           deallog << selected_vector_values[q] << std::endl;
-
-           Tensor<2,dim> grad;
-           for (unsigned int d=0; d<dim; ++d)
-             grad[d] = vector_values[q][c+d];
-           
-           Assert (std::fabs(selected_vector_values[q] - trace(grad))
-                   <= 1e-12 * std::fabs(selected_vector_values[q]),
-                   ExcInternalError());
-         }
+        FEValuesExtractors::Vector vector_components (c);
+        fe_values[vector_components].get_function_divergences (fe_function,
+                                                               selected_vector_values);
+        deallog << "component=" << c << std::endl;
+
+        for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+          {
+            deallog << selected_vector_values[q] << std::endl;
+
+            Tensor<2,dim> grad;
+            for (unsigned int d=0; d<dim; ++d)
+              grad[d] = vector_values[q][c+d];
+
+            Assert (std::fabs(selected_vector_values[q] - trace(grad))
+                    <= 1e-12 * std::fabs(selected_vector_values[q]),
+                    ExcInternalError());
+          }
       }
 }
 
@@ -102,8 +102,8 @@ void test_hyper_sphere()
   tr.set_boundary (0, boundary);
 
   FESystem<dim> fe (FE_Q<dim>(1), 1,
-                   FE_Q<dim>(2), 2,
-                   FE_DGQ<dim>(3), dim);
+                    FE_Q<dim>(2), 2,
+                    FE_DGQ<dim>(3), dim);
   test(tr, fe);
 }
 
index cf11cdc8e5fd69f8d2b9060f0913a6a7a65da9d2..c8ca01d9b77b2825b6e3c562d152fe3add389025 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -52,45 +52,45 @@ void test (const Triangulation<dim>& tr,
   Vector<double> fe_function(dof.n_dofs());
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
     fe_function(i) = i+1;
-  
+
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients | update_hessians);
+                           update_values | update_gradients | update_hessians);
   fe_values.reinit (dof.begin_active());
 
   std::vector<double> selected_vector_values (quadrature.size());
   std::vector<std::vector<Tensor<1,dim> > >
-    vector_values (quadrature.size(),
-                  std::vector<Tensor<1,dim> >(fe.n_components()));
+  vector_values (quadrature.size(),
+                 std::vector<Tensor<1,dim> >(fe.n_components()));
 
   fe_values.get_function_gradients (fe_function, vector_values);
-  
+
   for (unsigned int c=0; c<fe.n_components(); ++c)
-                                    // use a vector extractor if there
-                                    // are sufficiently many components
-                                    // left after the current component
-                                    // 'c'
+    // use a vector extractor if there
+    // are sufficiently many components
+    // left after the current component
+    // 'c'
     if (c+dim <= fe.n_components())
       {
-       FEValuesExtractors::Vector vector_components (c);
-       fe_values[vector_components].get_function_divergences (fe_function,
-                                                              selected_vector_values);
-       deallog << "component=" << c << std::endl;
-      
-       for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-         {
-           deallog << selected_vector_values[q] << std::endl;
-
-           Tensor<2,dim> grad;
-           for (unsigned int d=0; d<dim; ++d)
-             grad[d] = vector_values[q][c+d];
-           
-           Assert ((std::fabs(selected_vector_values[q] - trace(grad))
-                    <= 1e-12 * std::fabs(selected_vector_values[q]))
-                   ||
-                   (std::fabs(selected_vector_values[q]) <= 1e-10),
-                   ExcInternalError());
-         }
+        FEValuesExtractors::Vector vector_components (c);
+        fe_values[vector_components].get_function_divergences (fe_function,
+                                                               selected_vector_values);
+        deallog << "component=" << c << std::endl;
+
+        for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+          {
+            deallog << selected_vector_values[q] << std::endl;
+
+            Tensor<2,dim> grad;
+            for (unsigned int d=0; d<dim; ++d)
+              grad[d] = vector_values[q][c+d];
+
+            Assert ((std::fabs(selected_vector_values[q] - trace(grad))
+                     <= 1e-12 * std::fabs(selected_vector_values[q]))
+                    ||
+                    (std::fabs(selected_vector_values[q]) <= 1e-10),
+                    ExcInternalError());
+          }
       }
 }
 
@@ -106,8 +106,8 @@ void test_hyper_sphere()
   tr.set_boundary (0, boundary);
 
   FESystem<dim> fe (FE_Q<dim>(1), 1,
-                   FE_RaviartThomas<dim>(1), 1,
-                   FE_Nedelec<dim>(0), 1);
+                    FE_RaviartThomas<dim>(1), 1,
+                    FE_Nedelec<dim>(0), 1);
   test(tr, fe);
 }
 
index 61ba081d07e6a0915cdc08f954e1c3fbc461b276..89c42097d05eeb6649b8661b693205d220ec1305 100644 (file)
@@ -52,38 +52,38 @@ using namespace dealii;
 template <int dim>
 class MixedElastoPlasticity
 {
-  public:
-    MixedElastoPlasticity(const unsigned int degree);
-    void run();
-  private:
-    void make_grid_and_dofs();
-    void assemble_system();
+public:
+  MixedElastoPlasticity(const unsigned int degree);
+  void run();
+private:
+  void make_grid_and_dofs();
+  void assemble_system();
 
-    const unsigned int degree;
-    const unsigned int n_stress_components; // components of stress
-    const unsigned int n_gamma_components; // scalar plastic multiplier
+  const unsigned int degree;
+  const unsigned int n_stress_components; // components of stress
+  const unsigned int n_gamma_components; // scalar plastic multiplier
 
 
-    Triangulation<dim> triangulation;
-    FESystem<dim> fe;
-    DoFHandler<dim> dof_handler;
+  Triangulation<dim> triangulation;
+  FESystem<dim> fe;
+  DoFHandler<dim> dof_handler;
 
-    BlockSparsityPattern sparsity_pattern;
-    BlockSparseMatrix<double> system_matrix;
+  BlockSparsityPattern sparsity_pattern;
+  BlockSparseMatrix<double> system_matrix;
 
-    BlockVector<double> solution;
-    BlockVector<double> system_rhs;
+  BlockVector<double> solution;
+  BlockVector<double> system_rhs;
 
 };
 
 template <int dim>
 MixedElastoPlasticity<dim>::MixedElastoPlasticity(const unsigned int degree):
-               degree(degree),
-               n_stress_components((dim*(dim + 1)) / 2),
-               n_gamma_components(1),
-               fe( FE_Q<dim>(degree), n_stress_components,
-                   FE_Q<dim>(degree), n_gamma_components),
-               dof_handler(triangulation)
+  degree(degree),
+  n_stress_components((dim*(dim + 1)) / 2),
+  n_gamma_components(1),
+  fe( FE_Q<dim>(degree), n_stress_components,
+      FE_Q<dim>(degree), n_gamma_components),
+  dof_handler(triangulation)
 {
 }
 
@@ -96,18 +96,18 @@ void MixedElastoPlasticity<dim>::make_grid_and_dofs()
   dof_handler.distribute_dofs(fe);
 
   deallog << "Number of stress components: "
-         << n_stress_components
-         << "\tNumber of gamma components: "
-         << n_gamma_components << std::endl;
+          << n_stress_components
+          << "\tNumber of gamma components: "
+          << n_gamma_components << std::endl;
 
-                                  // stress -> 0 gamma -> 1
+  // stress -> 0 gamma -> 1
   std::vector<unsigned int> block_component(n_stress_components + n_gamma_components, 1);
   for (unsigned int ii = 0; ii < n_stress_components; ii++)
     block_component[ii] = 0;
 
   DoFRenumbering::component_wise(dof_handler);
 
-                                  // total number of dof per block component
+  // total number of dof per block component
   std::vector<types::global_dof_index> dofs_per_block(2);
   DoFTools::count_dofs_per_block(dof_handler, dofs_per_block, block_component);
 
@@ -115,20 +115,20 @@ void MixedElastoPlasticity<dim>::make_grid_and_dofs()
   const unsigned int n_gamma_dof = dofs_per_block[1];
 
   deallog << "Number of active cells: "
-         << triangulation.n_active_cells()
-         << std::endl
-         << "Total number of cells: "
-         << triangulation.n_cells()
-         << std::endl
-         << "Number of degrees of freedom: "
-         << dof_handler.n_dofs()
-         << " = (" << n_stress_dof << " + "
-         << n_gamma_dof << ")"
-         << std::endl;
-
-                                  // following step-22 use of simple
-                                  // compressed block sparsity
-                                  // pattern for efficiency
+          << triangulation.n_active_cells()
+          << std::endl
+          << "Total number of cells: "
+          << triangulation.n_cells()
+          << std::endl
+          << "Number of degrees of freedom: "
+          << dof_handler.n_dofs()
+          << " = (" << n_stress_dof << " + "
+          << n_gamma_dof << ")"
+          << std::endl;
+
+  // following step-22 use of simple
+  // compressed block sparsity
+  // pattern for efficiency
   {
     BlockCompressedSimpleSparsityPattern csp(2, 2);
 
@@ -164,12 +164,12 @@ void MixedElastoPlasticity<dim>::assemble_system()
   QGauss<dim> quadrature_formula(1);
 
   FEValues<dim> fe_values(fe, quadrature_formula,
-                         update_values | update_gradients
-                         | update_quadrature_points | update_JxW_values);
+                          update_values | update_gradients
+                          | update_quadrature_points | update_JxW_values);
 
   const unsigned int dofs_per_cell = fe.dofs_per_cell;
   deallog << "dofs_per_cell: " << fe.dofs_per_cell << std::endl;
-  
+
   FullMatrix<double> local_matrix(dofs_per_cell, dofs_per_cell);
   Vector<double> local_rhs(dofs_per_cell);
 
@@ -180,8 +180,8 @@ void MixedElastoPlasticity<dim>::assemble_system()
   const FEValuesExtractors::Scalar gamma(n_stress_components);
 
   deallog   << "fe.dofs_per_cell: " << fe.dofs_per_cell
-           << "\tquadrature_formula.size(): " << quadrature_formula.size()
-           << std::endl;
+            << "\tquadrature_formula.size(): " << quadrature_formula.size()
+            << std::endl;
 
   std::vector<Tensor<1,dim> > local_divergences (quadrature_formula.size());
   std::vector<SymmetricTensor<2,dim> > local_values (quadrature_formula.size());
@@ -193,9 +193,9 @@ void MixedElastoPlasticity<dim>::assemble_system()
 
   for (unsigned int q=0; q<quadrature_formula.size(); ++q)
     deallog << local_values[q]
-           << std::endl
-           << local_divergences[q]
-           << std::endl;
+            << std::endl
+            << local_divergences[q]
+            << std::endl;
 }
 
 template <int dim>
index bcd271657b1d01bbb03b730d9e711738cbd86988..43caefe34931f10d17bf21e9ff18843e57e7fac1 100644 (file)
@@ -52,38 +52,38 @@ using namespace dealii;
 template <int dim>
 class MixedElastoPlasticity
 {
-  public:
-    MixedElastoPlasticity(const unsigned int degree);
-    void run();
-  private:
-    void make_grid_and_dofs();
-    void assemble_system();
+public:
+  MixedElastoPlasticity(const unsigned int degree);
+  void run();
+private:
+  void make_grid_and_dofs();
+  void assemble_system();
 
-    const unsigned int degree;
-    const unsigned int n_stress_components; // components of stress
-    const unsigned int n_gamma_components; // scalar plastic multiplier
+  const unsigned int degree;
+  const unsigned int n_stress_components; // components of stress
+  const unsigned int n_gamma_components; // scalar plastic multiplier
 
 
-    Triangulation<dim> triangulation;
-    FESystem<dim> fe;
-    DoFHandler<dim> dof_handler;
+  Triangulation<dim> triangulation;
+  FESystem<dim> fe;
+  DoFHandler<dim> dof_handler;
 
-    BlockSparsityPattern sparsity_pattern;
-    BlockSparseMatrix<double> system_matrix;
+  BlockSparsityPattern sparsity_pattern;
+  BlockSparseMatrix<double> system_matrix;
 
-    BlockVector<double> solution;
-    BlockVector<double> system_rhs;
+  BlockVector<double> solution;
+  BlockVector<double> system_rhs;
 
 };
 
 template <int dim>
 MixedElastoPlasticity<dim>::MixedElastoPlasticity(const unsigned int degree):
-               degree(degree),
-               n_stress_components(dim*dim),
-               n_gamma_components(1),
-               fe( FE_Q<dim>(degree), n_stress_components,
-                   FE_Q<dim>(degree), n_gamma_components),
-               dof_handler(triangulation)
+  degree(degree),
+  n_stress_components(dim *dim),
+  n_gamma_components(1),
+  fe( FE_Q<dim>(degree), n_stress_components,
+      FE_Q<dim>(degree), n_gamma_components),
+  dof_handler(triangulation)
 {
 }
 
@@ -96,18 +96,18 @@ void MixedElastoPlasticity<dim>::make_grid_and_dofs()
   dof_handler.distribute_dofs(fe);
 
   deallog << "Number of stress components: "
-         << n_stress_components
-         << "\tNumber of gamma components: "
-         << n_gamma_components << std::endl;
+          << n_stress_components
+          << "\tNumber of gamma components: "
+          << n_gamma_components << std::endl;
 
-                                  // stress -> 0 gamma -> 1
+  // stress -> 0 gamma -> 1
   std::vector<unsigned int> block_component(n_stress_components + n_gamma_components, 1);
   for (unsigned int ii = 0; ii < n_stress_components; ii++)
     block_component[ii] = 0;
 
   DoFRenumbering::component_wise(dof_handler);
 
-                                  // total number of dof per block component
+  // total number of dof per block component
   std::vector<unsigned int> dofs_per_block(2);
   DoFTools::count_dofs_per_block(dof_handler, dofs_per_block, block_component);
 
@@ -115,20 +115,20 @@ void MixedElastoPlasticity<dim>::make_grid_and_dofs()
   const unsigned int n_gamma_dof = dofs_per_block[1];
 
   deallog << "Number of active cells: "
-         << triangulation.n_active_cells()
-         << std::endl
-         << "Total number of cells: "
-         << triangulation.n_cells()
-         << std::endl
-         << "Number of degrees of freedom: "
-         << dof_handler.n_dofs()
-         << " = (" << n_stress_dof << " + "
-         << n_gamma_dof << ")"
-         << std::endl;
-
-                                  // following step-22 use of simple
-                                  // compressed block sparsity
-                                  // pattern for efficiency
+          << triangulation.n_active_cells()
+          << std::endl
+          << "Total number of cells: "
+          << triangulation.n_cells()
+          << std::endl
+          << "Number of degrees of freedom: "
+          << dof_handler.n_dofs()
+          << " = (" << n_stress_dof << " + "
+          << n_gamma_dof << ")"
+          << std::endl;
+
+  // following step-22 use of simple
+  // compressed block sparsity
+  // pattern for efficiency
   {
     BlockCompressedSimpleSparsityPattern csp(2, 2);
 
@@ -164,12 +164,12 @@ void MixedElastoPlasticity<dim>::assemble_system()
   QGauss<dim> quadrature_formula(1);
 
   FEValues<dim> fe_values(fe, quadrature_formula,
-                         update_values | update_gradients
-                         | update_quadrature_points | update_JxW_values);
+                          update_values | update_gradients
+                          | update_quadrature_points | update_JxW_values);
 
   const unsigned int dofs_per_cell = fe.dofs_per_cell;
   deallog << "dofs_per_cell: " << fe.dofs_per_cell << std::endl;
-  
+
   FullMatrix<double> local_matrix(dofs_per_cell, dofs_per_cell);
   Vector<double> local_rhs(dofs_per_cell);
 
@@ -180,8 +180,8 @@ void MixedElastoPlasticity<dim>::assemble_system()
   const FEValuesExtractors::Scalar gamma(n_stress_components);
 
   deallog   << "fe.dofs_per_cell: " << fe.dofs_per_cell
-           << "\tquadrature_formula.size(): " << quadrature_formula.size()
-           << std::endl;
+            << "\tquadrature_formula.size(): " << quadrature_formula.size()
+            << std::endl;
 
   std::vector<Tensor<1,dim> > local_divergences (quadrature_formula.size());
   std::vector<Tensor<2,dim> > local_values (quadrature_formula.size());
@@ -193,9 +193,9 @@ void MixedElastoPlasticity<dim>::assemble_system()
 
   for (unsigned int q=0; q<quadrature_formula.size(); ++q)
     deallog << local_values[q]
-           << std::endl
-           << local_divergences[q]
-           << std::endl;
+            << std::endl
+            << local_divergences[q]
+            << std::endl;
 }
 
 template <int dim>
index ddfd51e0e5ab6e707a2541ebc666a19eac0906ac..477513b6937a03e4bc9d9fa272402383b0359412 100644 (file)
@@ -44,37 +44,37 @@ using namespace dealii;
 
 template <int dim>
 class MixedElastoPlasticity
-       {
-       public:
-               MixedElastoPlasticity(const unsigned int degree);
-               void run();
-       private:
-               void make_grid_and_dofs();
-               void assemble_system();
+{
+public:
+  MixedElastoPlasticity(const unsigned int degree);
+  void run();
+private:
+  void make_grid_and_dofs();
+  void assemble_system();
 
-               const unsigned int degree;
-               const unsigned int n_stress_components; // components of stress
-               const unsigned int n_gamma_components; // scalar plastic multiplier
+  const unsigned int degree;
+  const unsigned int n_stress_components; // components of stress
+  const unsigned int n_gamma_components; // scalar plastic multiplier
 
-               Triangulation<dim> triangulation;
-               FESystem<dim> fe;
-               DoFHandler<dim> dof_handler;
+  Triangulation<dim> triangulation;
+  FESystem<dim> fe;
+  DoFHandler<dim> dof_handler;
 
-               BlockSparsityPattern sparsity_pattern;
-               BlockSparseMatrix<double> system_matrix;
-               BlockVector<double> solution;
-       };
+  BlockSparsityPattern sparsity_pattern;
+  BlockSparseMatrix<double> system_matrix;
+  BlockVector<double> solution;
+};
 
 
 
 template <int dim>
 MixedElastoPlasticity<dim>::MixedElastoPlasticity(const unsigned int degree):
-degree(degree),
-n_stress_components((dim*(dim + 1)) / 2),
-n_gamma_components(1),
-fe( FE_Q<dim>(degree), n_stress_components,
-   FE_Q<dim>(degree), n_gamma_components),
-dof_handler(triangulation)
+  degree(degree),
+  n_stress_components((dim*(dim + 1)) / 2),
+  n_gamma_components(1),
+  fe( FE_Q<dim>(degree), n_stress_components,
+      FE_Q<dim>(degree), n_gamma_components),
+  dof_handler(triangulation)
 {
 }
 
@@ -83,60 +83,60 @@ dof_handler(triangulation)
 template <int dim>
 void MixedElastoPlasticity<dim>::make_grid_and_dofs()
 {
-       GridGenerator::hyper_cube(triangulation, 0, 1);
-       triangulation.refine_global(0);
-
-       dof_handler.distribute_dofs(fe);
-
-       deallog << "Number of stress components: "
-       << n_stress_components
-       << "\tNumber of gamma components: "
-       << n_gamma_components << std::endl;
-
-       // stress -> 0 gamma -> 1
-       std::vector<unsigned int> block_component(n_stress_components + n_gamma_components, 1);
-       for (unsigned int ii = 0; ii < n_stress_components; ii++)
-               block_component[ii] = 0;
-
-       DoFRenumbering::component_wise(dof_handler);
-
-       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_stress_dof = dofs_per_block[0];
-       const unsigned int n_gamma_dof = dofs_per_block[1];
-
-       deallog << "Number of active cells: "
-       << triangulation.n_active_cells()
-       << std::endl
-       << "Total number of cells: "
-       << triangulation.n_cells()
-       << std::endl
-       << "Number of degrees of freedom: "
-       << dof_handler.n_dofs()
-       << " = (" << n_stress_dof << " + "
-       << n_gamma_dof << ")"
-       << std::endl;
-
-       {
-               BlockCompressedSimpleSparsityPattern csp(2, 2);
-
-               csp.block(0, 0).reinit(n_stress_dof, n_stress_dof);
-               csp.block(1, 0).reinit(n_gamma_dof, n_stress_dof);
-               csp.block(0, 1).reinit(n_stress_dof, n_gamma_dof);
-               csp.block(1, 1).reinit(n_gamma_dof, n_gamma_dof);
-               csp.collect_sizes();
-
-               DoFTools::make_sparsity_pattern(dof_handler, csp);
-               sparsity_pattern.copy_from(csp);
-       }
-
-       system_matrix.reinit(sparsity_pattern);
-
-       solution.reinit(2);
-       solution.block(0).reinit(n_stress_dof);
-       solution.block(1).reinit(n_gamma_dof);
-       solution.collect_sizes();
+  GridGenerator::hyper_cube(triangulation, 0, 1);
+  triangulation.refine_global(0);
+
+  dof_handler.distribute_dofs(fe);
+
+  deallog << "Number of stress components: "
+          << n_stress_components
+          << "\tNumber of gamma components: "
+          << n_gamma_components << std::endl;
+
+  // stress -> 0 gamma -> 1
+  std::vector<unsigned int> block_component(n_stress_components + n_gamma_components, 1);
+  for (unsigned int ii = 0; ii < n_stress_components; ii++)
+    block_component[ii] = 0;
+
+  DoFRenumbering::component_wise(dof_handler);
+
+  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_stress_dof = dofs_per_block[0];
+  const unsigned int n_gamma_dof = dofs_per_block[1];
+
+  deallog << "Number of active cells: "
+          << triangulation.n_active_cells()
+          << std::endl
+          << "Total number of cells: "
+          << triangulation.n_cells()
+          << std::endl
+          << "Number of degrees of freedom: "
+          << dof_handler.n_dofs()
+          << " = (" << n_stress_dof << " + "
+          << n_gamma_dof << ")"
+          << std::endl;
+
+  {
+    BlockCompressedSimpleSparsityPattern csp(2, 2);
+
+    csp.block(0, 0).reinit(n_stress_dof, n_stress_dof);
+    csp.block(1, 0).reinit(n_gamma_dof, n_stress_dof);
+    csp.block(0, 1).reinit(n_stress_dof, n_gamma_dof);
+    csp.block(1, 1).reinit(n_gamma_dof, n_gamma_dof);
+    csp.collect_sizes();
+
+    DoFTools::make_sparsity_pattern(dof_handler, csp);
+    sparsity_pattern.copy_from(csp);
+  }
+
+  system_matrix.reinit(sparsity_pattern);
+
+  solution.reinit(2);
+  solution.block(0).reinit(n_stress_dof);
+  solution.block(1).reinit(n_gamma_dof);
+  solution.collect_sizes();
 }
 
 
@@ -144,84 +144,85 @@ void MixedElastoPlasticity<dim>::make_grid_and_dofs()
 template <int dim>
 void MixedElastoPlasticity<dim>::assemble_system()
 {
-       QGauss<dim> quadrature_formula(1);
-
-       FEValues<dim> fe_values(fe, quadrature_formula,
-                                                       update_values | update_gradients
-                                                       | update_quadrature_points | update_JxW_values);
-
-       const unsigned int dofs_per_cell = fe.dofs_per_cell;
-       deallog << "dofs_per_cell: " << fe.dofs_per_cell << std::endl;
-
-       std::vector<types::global_dof_index> local_dof_indices(dofs_per_cell);
-
-       const FEValuesExtractors::SymmetricTensor<2> stress(0);
-       const FEValuesExtractors::Scalar gamma(n_stress_components);
-
-       deallog   << "fe.dofs_per_cell: " << fe.dofs_per_cell
-       << "\tquadrature_formula.size(): " << quadrature_formula.size()
-       << std::endl;
-
-       // constant stress and constant gamma distribution accross cell
-       const double stress_value = 125.0;
-       const double gamma_value = 1.0;
-
-       typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active();
-       {
-               fe_values.reinit (cell);
-               cell->get_dof_indices (local_dof_indices);
-               for (unsigned int i = 0; i < dofs_per_cell; ++i) {
-                       // 0 = stress (symmetric 2nd order tensor), 1 = Gamma (scalar) interpolation fields
-                       const unsigned int i_group = fe.system_to_base_index(i).first.first;
-                       // the index of the non-zero shape function
-                       const unsigned int i_index = fe.system_to_base_index(i).first.second;
-                       // the support point (node) id
-                       const unsigned int i_node = fe.system_to_base_index(i).second;
-
-                       deallog << "\t" << i << "\t" << i_group << "\t" << i_index << "\t" << i_node;
-
-
-                       if (i_group == 0) // if i corresponds to tensor stress
-                               solution(local_dof_indices[i]) = stress_value;
-                       else  // i corresponds to scalar gamma
-                               solution(local_dof_indices[i]) = gamma_value;
-
-                       deallog << "\t" << solution(local_dof_indices[i]) << std::endl;
-               }
-
-
-               std::vector<Tensor<1,dim> > local_divergences (quadrature_formula.size());
-               std::vector<SymmetricTensor<2,dim> > local_values (quadrature_formula.size());
-               std::vector<double > local_scalar_values (quadrature_formula.size());
-
-               fe_values.reinit (dof_handler.begin_active());
-               fe_values[stress].get_function_values (solution, local_values);
-               fe_values[stress].get_function_divergences (solution, local_divergences);
-               fe_values[gamma].get_function_values (solution, local_scalar_values);
-
-               // expect the nodal stress value at the quadrature point
-               // constant stress field, therefore expect zero divergence
-               // constant gamma field, therefore nodal value should equal value at quadrature point
-               for (unsigned int q=0; q<quadrature_formula.size(); ++q)
-               {
-                       deallog << local_values[q]
-                       << std::endl
-                       << local_divergences[q]
-                       << std::endl
-                       << local_scalar_values[q]
-                       << std::endl;
-
-                       for (unsigned int m = 0; m < dim; m++)
-                       {
-                               for (unsigned int n = 0; n< dim; n++)
-                                       Assert ( (local_values[q])[m][n] == stress_value, ExcInternalError());
-
-                               Assert ( (local_divergences[q])[m] == 0.0, ExcInternalError());
-                               Assert ( local_scalar_values[q] == gamma_value, ExcInternalError());
-
-                       }
-               }
-       }
+  QGauss<dim> quadrature_formula(1);
+
+  FEValues<dim> fe_values(fe, quadrature_formula,
+                          update_values | update_gradients
+                          | update_quadrature_points | update_JxW_values);
+
+  const unsigned int dofs_per_cell = fe.dofs_per_cell;
+  deallog << "dofs_per_cell: " << fe.dofs_per_cell << std::endl;
+
+  std::vector<types::global_dof_index> local_dof_indices(dofs_per_cell);
+
+  const FEValuesExtractors::SymmetricTensor<2> stress(0);
+  const FEValuesExtractors::Scalar gamma(n_stress_components);
+
+  deallog   << "fe.dofs_per_cell: " << fe.dofs_per_cell
+            << "\tquadrature_formula.size(): " << quadrature_formula.size()
+            << std::endl;
+
+  // constant stress and constant gamma distribution accross cell
+  const double stress_value = 125.0;
+  const double gamma_value = 1.0;
+
+  typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active();
+  {
+    fe_values.reinit (cell);
+    cell->get_dof_indices (local_dof_indices);
+    for (unsigned int i = 0; i < dofs_per_cell; ++i)
+      {
+        // 0 = stress (symmetric 2nd order tensor), 1 = Gamma (scalar) interpolation fields
+        const unsigned int i_group = fe.system_to_base_index(i).first.first;
+        // the index of the non-zero shape function
+        const unsigned int i_index = fe.system_to_base_index(i).first.second;
+        // the support point (node) id
+        const unsigned int i_node = fe.system_to_base_index(i).second;
+
+        deallog << "\t" << i << "\t" << i_group << "\t" << i_index << "\t" << i_node;
+
+
+        if (i_group == 0) // if i corresponds to tensor stress
+          solution(local_dof_indices[i]) = stress_value;
+        else  // i corresponds to scalar gamma
+          solution(local_dof_indices[i]) = gamma_value;
+
+        deallog << "\t" << solution(local_dof_indices[i]) << std::endl;
+      }
+
+
+    std::vector<Tensor<1,dim> > local_divergences (quadrature_formula.size());
+    std::vector<SymmetricTensor<2,dim> > local_values (quadrature_formula.size());
+    std::vector<double > local_scalar_values (quadrature_formula.size());
+
+    fe_values.reinit (dof_handler.begin_active());
+    fe_values[stress].get_function_values (solution, local_values);
+    fe_values[stress].get_function_divergences (solution, local_divergences);
+    fe_values[gamma].get_function_values (solution, local_scalar_values);
+
+    // expect the nodal stress value at the quadrature point
+    // constant stress field, therefore expect zero divergence
+    // constant gamma field, therefore nodal value should equal value at quadrature point
+    for (unsigned int q=0; q<quadrature_formula.size(); ++q)
+      {
+        deallog << local_values[q]
+                << std::endl
+                << local_divergences[q]
+                << std::endl
+                << local_scalar_values[q]
+                << std::endl;
+
+        for (unsigned int m = 0; m < dim; m++)
+          {
+            for (unsigned int n = 0; n< dim; n++)
+              Assert ( (local_values[q])[m][n] == stress_value, ExcInternalError());
+
+            Assert ( (local_divergences[q])[m] == 0.0, ExcInternalError());
+            Assert ( local_scalar_values[q] == gamma_value, ExcInternalError());
+
+          }
+      }
+  }
 }
 
 
@@ -229,24 +230,24 @@ void MixedElastoPlasticity<dim>::assemble_system()
 template <int dim>
 void MixedElastoPlasticity<dim>::run()
 {
-       make_grid_and_dofs();
-       assemble_system();
+  make_grid_and_dofs();
+  assemble_system();
 }
 
 
 
 int main()
 {
-       std::ofstream logfile ("fe_values_view_22/output");
-       deallog << std::setprecision (3);
+  std::ofstream logfile ("fe_values_view_22/output");
+  deallog << std::setprecision (3);
 
-       deallog.attach(logfile);
-       deallog.depth_console (0);
-       deallog.threshold_double(1.e-7);
+  deallog.attach(logfile);
+  deallog.depth_console (0);
+  deallog.threshold_double(1.e-7);
 
-       MixedElastoPlasticity < 3 > elasto_plasticity(1);
-       elasto_plasticity.run();
+  MixedElastoPlasticity < 3 > elasto_plasticity(1);
+  elasto_plasticity.run();
 
-       return 0;
+  return 0;
 }
 
index 8d8fa6cf2224f93e5685915c80b8331dabc895b8..9b5a5b6ca78c0fb7011bad129f132076c6c4be77 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -50,36 +50,36 @@ void test (const Triangulation<dim>& tr,
   Vector<double> fe_function(dof.n_dofs());
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
     fe_function(i) = (i+1)*(i+2);
-  
+
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients);
+                           update_values | update_gradients);
   fe_values.reinit (dof.begin_active());
 
-                                  // let the FEValues object compute the
-                                  // divergences at quadrature points
+  // let the FEValues object compute the
+  // divergences at quadrature points
   std::vector<Tensor<1,dim> > divergences (quadrature.size());
   FEValuesExtractors::SymmetricTensor<2> extractor(0);
   fe_values[extractor]
-    .get_function_divergences (fe_function, divergences);
+  .get_function_divergences (fe_function, divergences);
 
-                                  // now do the same "by hand"
+  // now do the same "by hand"
   std::vector<types::global_dof_index> local_dof_indices (fe.dofs_per_cell);
   dof.begin_active()->get_dof_indices (local_dof_indices);
-  
+
   for (unsigned int q=0; q<quadrature.size(); ++q)
     {
       Tensor<1,dim> div_alt;
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
-       div_alt += fe_values[extractor].divergence (i,q) *
-                  fe_function(local_dof_indices[i]);
-      
+        div_alt += fe_values[extractor].divergence (i,q) *
+                   fe_function(local_dof_indices[i]);
+
       deallog << "q_point=" << q << std::endl
-             << "   method 1: " << divergences[q] << std::endl
-             << "   method 2: " << div_alt << std::endl
-             << std::endl;
+              << "   method 1: " << divergences[q] << std::endl
+              << "   method 2: " << div_alt << std::endl
+              << std::endl;
       Assert ((divergences[q] - div_alt).norm() <= divergences[q].norm(),
-             ExcInternalError());
+              ExcInternalError());
     }
 }
 
@@ -95,7 +95,7 @@ void test_hyper_sphere()
   tr.set_boundary (0, boundary);
 
   FESystem<dim> fe (FE_Q<dim>(1),
-                   SymmetricTensor<2,dim>::n_independent_components);
+                    SymmetricTensor<2,dim>::n_independent_components);
   test(tr, fe);
 }
 
index 24e686bc8d8e2f36b016aa6f4bd516b9b1141b41..ed976789ed97c9f55ae392a8d31279e44d886020 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -50,36 +50,36 @@ void test (const Triangulation<dim>& tr,
   Vector<double> fe_function(dof.n_dofs());
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
     fe_function(i) = (i+1)*(i+2);
-  
+
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients);
+                           update_values | update_gradients);
   fe_values.reinit (dof.begin_active());
 
-                                  // let the FEValues object compute the
-                                  // divergences at quadrature points
+  // let the FEValues object compute the
+  // divergences at quadrature points
   std::vector<Tensor<1,dim> > divergences (quadrature.size());
   FEValuesExtractors::Tensor<2> extractor(0);
   fe_values[extractor]
-    .get_function_divergences (fe_function, divergences);
+  .get_function_divergences (fe_function, divergences);
 
-                                  // now do the same "by hand"
+  // now do the same "by hand"
   std::vector<unsigned int> local_dof_indices (fe.dofs_per_cell);
   dof.begin_active()->get_dof_indices (local_dof_indices);
-  
+
   for (unsigned int q=0; q<quadrature.size(); ++q)
     {
       Tensor<1,dim> div_alt;
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
-       div_alt += fe_values[extractor].divergence (i,q) *
-                  fe_function(local_dof_indices[i]);
-      
+        div_alt += fe_values[extractor].divergence (i,q) *
+                   fe_function(local_dof_indices[i]);
+
       deallog << "q_point=" << q << std::endl
-             << "   method 1: " << divergences[q] << std::endl
-             << "   method 2: " << div_alt << std::endl
-             << std::endl;
+              << "   method 1: " << divergences[q] << std::endl
+              << "   method 2: " << div_alt << std::endl
+              << std::endl;
       Assert ((divergences[q] - div_alt).norm() <= divergences[q].norm(),
-             ExcInternalError());
+              ExcInternalError());
     }
 }
 
@@ -95,7 +95,7 @@ void test_hyper_sphere()
   tr.set_boundary (0, boundary);
 
   FESystem<dim> fe (FE_Q<dim>(1),
-                   Tensor<2,dim>::n_independent_components);
+                    Tensor<2,dim>::n_independent_components);
   test(tr, fe);
 }
 
index 8670bad8dabb6271afcb80b50402948892269675..d625efe5fd0252e74e1d67c8767fe6af3ef54b96 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -50,30 +50,30 @@ void test (const Triangulation<dim>& tr,
   Vector<double> fe_function(dof.n_dofs());
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
     fe_function(i) = i+1;
-  
+
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients);
+                           update_values | update_gradients);
   fe_values.reinit (dof.begin_active());
 
-                                  // let the FEValues object compute the
-                                  // divergences at quadrature points
+  // let the FEValues object compute the
+  // divergences at quadrature points
   std::vector<Tensor<1,dim> > divergences (quadrature.size());
   FEValuesExtractors::SymmetricTensor<2> extractor(0);
   fe_values[extractor]
-    .get_function_divergences (fe_function, divergences);
+  .get_function_divergences (fe_function, divergences);
 
-                                  // now do the same "by hand"
+  // now do the same "by hand"
   std::vector<types::global_dof_index> local_dof_indices (fe.dofs_per_cell);
   dof.begin_active()->get_dof_indices (local_dof_indices);
-  
+
   for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
     {
       deallog << "i=" << i << std::endl;
-      
+
       for (unsigned int q=0; q<quadrature.size(); ++q)
-       deallog << "  q_point=" << q << std::endl
-               << "    div= " << fe_values[extractor].divergence (i,q) << std::endl;
+        deallog << "  q_point=" << q << std::endl
+                << "    div= " << fe_values[extractor].divergence (i,q) << std::endl;
     }
 }
 
@@ -89,7 +89,7 @@ void test_hyper_sphere()
   tr.set_boundary (0, boundary);
 
   FESystem<dim> fe (FE_Q<dim>(1),
-                   SymmetricTensor<2,dim>::n_independent_components);
+                    SymmetricTensor<2,dim>::n_independent_components);
   test(tr, fe);
 }
 
index 2ca3765d2ef4be49577475e96337125fbc83cfc6..7f8bd77b33795005e2a02c7498d8a74d33b81ea9 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -50,30 +50,30 @@ void test (const Triangulation<dim>& tr,
   Vector<double> fe_function(dof.n_dofs());
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
     fe_function(i) = i+1;
-  
+
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients);
+                           update_values | update_gradients);
   fe_values.reinit (dof.begin_active());
 
-                                  // let the FEValues object compute the
-                                  // divergences at quadrature points
+  // let the FEValues object compute the
+  // divergences at quadrature points
   std::vector<Tensor<1,dim> > divergences (quadrature.size());
   FEValuesExtractors::Tensor<2> extractor(0);
   fe_values[extractor]
-    .get_function_divergences (fe_function, divergences);
+  .get_function_divergences (fe_function, divergences);
 
-                                  // now do the same "by hand"
+  // now do the same "by hand"
   std::vector<unsigned int> local_dof_indices (fe.dofs_per_cell);
   dof.begin_active()->get_dof_indices (local_dof_indices);
-  
+
   for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
     {
       deallog << "i=" << i << std::endl;
-      
+
       for (unsigned int q=0; q<quadrature.size(); ++q)
-       deallog << "  q_point=" << q << std::endl
-               << "    div= " << fe_values[extractor].divergence (i,q) << std::endl;
+        deallog << "  q_point=" << q << std::endl
+                << "    div= " << fe_values[extractor].divergence (i,q) << std::endl;
     }
 }
 
@@ -89,7 +89,7 @@ void test_hyper_sphere()
   tr.set_boundary (0, boundary);
 
   FESystem<dim> fe (FE_Q<dim>(1),
-                   Tensor<2,dim>::n_independent_components);
+                    Tensor<2,dim>::n_independent_components);
   test(tr, fe);
 }
 
index a8d2b0b7382a196a6525dbd2efc963b5f7b9fead..eb25c61b9bbbbb99c62d27003cf280b99cb2d3b1 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -52,17 +52,17 @@ void test (const Triangulation<dim>& tr,
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients | update_q_points);
+                           update_values | update_gradients | update_q_points);
   fe_values.reinit (dof.begin_active());
 
-                                  // let the FEValues object compute the
-                                  // divergences at quadrature points
+  // let the FEValues object compute the
+  // divergences at quadrature points
   std::vector<Tensor<1,dim> > divergences (quadrature.size());
   FEValuesExtractors::SymmetricTensor<2> extractor(0);
   fe_values[extractor]
-    .get_function_divergences (fe_function, divergences);
+  .get_function_divergences (fe_function, divergences);
 
-                                  // now do the same "by hand"
+  // now do the same "by hand"
   std::vector<types::global_dof_index> local_dof_indices (fe.dofs_per_cell);
   dof.begin_active()->get_dof_indices (local_dof_indices);
 
@@ -71,9 +71,9 @@ void test (const Triangulation<dim>& tr,
       deallog << "i=" << i << std::endl;
 
       for (unsigned int q=0; q<quadrature.size(); ++q)
-       deallog << "  q_point=" << fe_values.quadrature_point(q) << std::endl
-               << "    value= " << fe_values[extractor].value (i,q) << std::endl
-               << "    div= " << fe_values[extractor].divergence (i,q) << std::endl;
+        deallog << "  q_point=" << fe_values.quadrature_point(q) << std::endl
+                << "    value= " << fe_values[extractor].value (i,q) << std::endl
+                << "    div= " << fe_values[extractor].divergence (i,q) << std::endl;
     }
 }
 
@@ -86,7 +86,7 @@ void test_hyper_cube()
   GridGenerator::hyper_cube(tr);
 
   FESystem<dim> fe (FE_Q<dim>(1),
-                   SymmetricTensor<2,dim>::n_independent_components);
+                    SymmetricTensor<2,dim>::n_independent_components);
   test(tr, fe);
 }
 
index 4aecb276c466adea3a98c7c9fb348a76a4064ef4..f1fe7ad95c44e76b86bbd7a256eddf1cc4429cc8 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -52,17 +52,17 @@ void test (const Triangulation<dim>& tr,
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients | update_q_points);
+                           update_values | update_gradients | update_q_points);
   fe_values.reinit (dof.begin_active());
 
-                                  // let the FEValues object compute the
-                                  // divergences at quadrature points
+  // let the FEValues object compute the
+  // divergences at quadrature points
   std::vector<Tensor<1,dim> > divergences (quadrature.size());
   FEValuesExtractors::Tensor<2> extractor(0);
   fe_values[extractor]
-    .get_function_divergences (fe_function, divergences);
+  .get_function_divergences (fe_function, divergences);
 
-                                  // now do the same "by hand"
+  // now do the same "by hand"
   std::vector<unsigned int> local_dof_indices (fe.dofs_per_cell);
   dof.begin_active()->get_dof_indices (local_dof_indices);
 
@@ -71,9 +71,9 @@ void test (const Triangulation<dim>& tr,
       deallog << "i=" << i << std::endl;
 
       for (unsigned int q=0; q<quadrature.size(); ++q)
-       deallog << "  q_point=" << fe_values.quadrature_point(q) << std::endl
-               << "    value= " << fe_values[extractor].value (i,q) << std::endl
-               << "    div= " << fe_values[extractor].divergence (i,q) << std::endl;
+        deallog << "  q_point=" << fe_values.quadrature_point(q) << std::endl
+                << "    value= " << fe_values[extractor].value (i,q) << std::endl
+                << "    div= " << fe_values[extractor].divergence (i,q) << std::endl;
     }
 }
 
@@ -86,7 +86,7 @@ void test_hyper_cube()
   GridGenerator::hyper_cube(tr);
 
   FESystem<dim> fe (FE_Q<dim>(1),
-                   Tensor<2,dim>::n_independent_components);
+                    Tensor<2,dim>::n_independent_components);
   test(tr, fe);
 }
 
index bacec5e63f22b7613610c1907ffd83dd39c7b27f..0305aacb26b9629dd77aca5df76c95045fcfec0e 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values);
+                           update_values);
   fe_values.reinit (dof.begin_active());
 
   FEValuesExtractors::Scalar extr; // invalid object
@@ -57,7 +57,7 @@ void test (const Triangulation<dim>& tr,
 
   Assert (false, ExcMessage ("No exception!?"));
 
-  ok:
+ok:
   ;
 }
 
index 90a0a0f54a5cc569af02aeea6d3d89d300608629..cda1e4c97c71c0c6fa9b7d9ad1be4fa45db9e078 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values);
+                           update_values);
   fe_values.reinit (dof.begin_active());
 
   FEValuesExtractors::Vector extr; // invalid object
@@ -57,7 +57,7 @@ void test (const Triangulation<dim>& tr,
 
   Assert (false, ExcMessage ("No exception!?"));
 
-  ok:
+ok:
   ;
 }
 
index 154c1b50547ccc2f2015552e7a820d07a6925d89..b7ae2c32061e24c07ce48eb6721ad2cb9f3c44e1 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values);
+                           update_values);
   fe_values.reinit (dof.begin_active());
 
   FEValuesExtractors::SymmetricTensor<2> extr; // invalid object
@@ -57,7 +57,7 @@ void test (const Triangulation<dim>& tr,
 
   Assert (false, ExcMessage ("No exception!?"));
 
-  ok:
+ok:
   ;
 }
 
index e475df40675def928f75ce891125b7eaf85a8e1b..d7e828aadf9b7e1e10887b3e1259f478a1eb41f7 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values);
+                           update_values);
   fe_values.reinit (dof.begin_active());
 
   FEValuesExtractors::Tensor<2> extr; // invalid object
@@ -57,7 +57,7 @@ void test (const Triangulation<dim>& tr,
 
   Assert (false, ExcMessage ("No exception!?"));
 
-  ok:
+ok:
   ;
 }
 
index 2dc7ebb7cde140618cd52f425500e5834f795ec0..4255a3b121eda20a90b628ddf4ae4b76514ac0a1 100644 (file)
@@ -59,7 +59,7 @@ private:
   const unsigned int degree;
   const unsigned int n_stress_components; // components of stress
   const unsigned int n_gamma_components; // scalar plastic multiplier
-    
+
 
   Triangulation<dim> triangulation;
   FESystem<dim> fe;
@@ -75,12 +75,12 @@ private:
 
 template <int dim>
 MixedElastoPlasticity<dim>::MixedElastoPlasticity(const unsigned int degree):
-degree(degree),
-n_stress_components(dim*dim),
-n_gamma_components(1),
-fe( FE_Q<dim>(degree), n_stress_components,
-    FE_Q<dim>(degree), n_gamma_components),
-dof_handler(triangulation)
+  degree(degree),
+  n_stress_components(dim *dim),
+  n_gamma_components(1),
+  fe( FE_Q<dim>(degree), n_stress_components,
+      FE_Q<dim>(degree), n_gamma_components),
+  dof_handler(triangulation)
 {
 }
 
@@ -93,15 +93,15 @@ void MixedElastoPlasticity<dim>::make_grid_and_dofs()
   dof_handler.distribute_dofs(fe);
 
   deallog << "Number of stress components: "
-            << n_stress_components
-            << "\tNumber of gamma components: "
-            << n_gamma_components << std::endl;  
-    
+          << n_stress_components
+          << "\tNumber of gamma components: "
+          << n_gamma_components << std::endl;
+
   // stress -> 0 gamma -> 1
   std::vector<unsigned int> block_component(n_stress_components + n_gamma_components, 1);
   for (unsigned int ii = 0; ii < n_stress_components; ii++)
     block_component[ii] = 0;
-    
+
   DoFRenumbering::component_wise(dof_handler);
 
   // total number of dof per block component
@@ -112,16 +112,16 @@ void MixedElastoPlasticity<dim>::make_grid_and_dofs()
   const unsigned int n_gamma_dof = dofs_per_block[1];
 
   deallog << "Number of active cells: "
-            << triangulation.n_active_cells()
-            << std::endl
-            << "Total number of cells: "
-            << triangulation.n_cells()
-            << std::endl
-            << "Number of degrees of freedom: "
-            << dof_handler.n_dofs()
-            << " = (" << n_stress_dof << " + "
-            << n_gamma_dof << ")"
-            << std::endl;
+          << triangulation.n_active_cells()
+          << std::endl
+          << "Total number of cells: "
+          << triangulation.n_cells()
+          << std::endl
+          << "Number of degrees of freedom: "
+          << dof_handler.n_dofs()
+          << " = (" << n_stress_dof << " + "
+          << n_gamma_dof << ")"
+          << std::endl;
 
   // following step-22 use of simple compressed block sparsity pattern for efficiency
   {
@@ -167,21 +167,21 @@ void MixedElastoPlasticity<dim>::assemble_system()
 
   std::vector<unsigned int> local_dof_indices(dofs_per_cell);
 
-    
+
   const FEValuesExtractors::Tensor<2> stress_extr(0);//rank2
   const FEValuesExtractors::Scalar gamma_extr(n_stress_components);
 
   deallog   << "fe.dofs_per_cell: " << fe.dofs_per_cell
-             << "\tquadrature_formula.size(): " << quadrature_formula.size()
-             << std::endl;
-                
+            << "\tquadrature_formula.size(): " << quadrature_formula.size()
+            << std::endl;
+
   typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active(),
-                                                endc = dof_handler.end();
-                                                   
+                                                 endc = dof_handler.end();
+
 
   std::vector<Tensor<1,dim> > div_values(n_q_points);
   std::vector<Tensor<2,dim> > stress_values(n_q_points);
-                                                                     
+
   unsigned int cc = 0;
   for (; cell!=endc; ++cell) //loop over all cells
     {
@@ -190,7 +190,7 @@ void MixedElastoPlasticity<dim>::assemble_system()
       cell_rhs = 0;
 
       fe_values.reinit (cell); //compute requested values for a given cell
-        
+
       fe_values[stress_extr].get_function_values(solution,stress_values);
       fe_values[stress_extr].get_function_divergences(solution,div_values);
     }
@@ -209,17 +209,19 @@ void check()
 {
   static const unsigned int dim = 3;
   {
-    for (unsigned int i = 0; i < dim; i++) {
-      for (unsigned int j = 0; j < dim; j++) {
-       TableIndices<2> indices(i,j);
-       unsigned int unrolled = Tensor<2,dim>::component_to_unrolled_index(indices);
-       deallog<<i<<" "<<j<<" -> "<<unrolled<<std::endl;
-       indices = Tensor<2,dim>::unrolled_to_component_indices(unrolled);
-       deallog<<unrolled<<" -> "<<indices[0]<<" "<<indices[1]<<std::endl;
+    for (unsigned int i = 0; i < dim; i++)
+      {
+        for (unsigned int j = 0; j < dim; j++)
+          {
+            TableIndices<2> indices(i,j);
+            unsigned int unrolled = Tensor<2,dim>::component_to_unrolled_index(indices);
+            deallog<<i<<" "<<j<<" -> "<<unrolled<<std::endl;
+            indices = Tensor<2,dim>::unrolled_to_component_indices(unrolled);
+            deallog<<unrolled<<" -> "<<indices[0]<<" "<<indices[1]<<std::endl;
+          }
       }
-    }
   }
-       
+
   MixedElastoPlasticity < 3 > elasto_plasticity(1);
   elasto_plasticity.run();
 
index 0146e63633de35238768f164634098e9426500d0..0eef1655ba6b7cc9e0cfc527097f7ec6c8330cd7 100644 (file)
@@ -37,9 +37,9 @@ std::ofstream logfile("filtered_iterator/output");
 
 
 DeclException2 (ExcNumberMismatch,
-               int, int,
-               << "The numbers " << arg1 << " and " << arg2
-               << " should be equation, but are not.");
+                int, int,
+                << "The numbers " << arg1 << " and " << arg2
+                << " should be equation, but are not.");
 
 
 
@@ -55,7 +55,7 @@ bool level_equal_to_3 (const Iterator c)
 
 template <typename Iterator>
 bool level_equal_to (const Iterator     c,
-                    const unsigned int level)
+                     const unsigned int level)
 {
   return (static_cast<unsigned int>(c->level()) == level);
 }
@@ -70,120 +70,120 @@ void test ()
   tria.execute_coarsening_and_refinement ();
   tria.refine_global (2);
 
-                                  // we now have a number of cells,
-                                  // flag them with some subdomain
-                                  // ids based on their position, in
-                                  // particular we take the quadrant
-                                  // (octant)
+  // we now have a number of cells,
+  // flag them with some subdomain
+  // ids based on their position, in
+  // particular we take the quadrant
+  // (octant)
   active_cell_iterator cell = tria.begin_active (),
-                      endc = tria.end ();
+                       endc = tria.end ();
   for (; cell!=endc; ++cell)
     {
       unsigned int subdomain = 0;
       for (unsigned int d=0; d<2; ++d)
-       if (cell->center()(d) > 0)
-         subdomain |= (1<<d);
+        if (cell->center()(d) > 0)
+          subdomain |= (1<<d);
       Assert (subdomain < (1<<2), ExcInternalError());
 
       cell->set_subdomain_id (subdomain);
     };
 
 
-                                  // check 1: count number of cells
-                                  // on some level
+  // check 1: count number of cells
+  // on some level
   if (true)
     {
       const IteratorFilters::LevelEqualTo predicate(3);
       FilteredIterator<active_cell_iterator>
-       begin (predicate),
-       end   (predicate, tria.end());
+      begin (predicate),
+            end   (predicate, tria.end());
       begin.set_to_next_positive (tria.begin_active ());
-      
+
       Assert (std::distance (begin, end) ==
-             static_cast<signed int>(tria.n_active_cells (3)),
-             ExcInternalError());
+              static_cast<signed int>(tria.n_active_cells (3)),
+              ExcInternalError());
       logfile << "Check 1: "
-             << (std::distance (begin, end) ==
-                 static_cast<signed int>(tria.n_active_cells (3))
-                 ?
-                 "OK" : "Failed")
-             << std::endl;
+              << (std::distance (begin, end) ==
+                  static_cast<signed int>(tria.n_active_cells (3))
+                  ?
+                  "OK" : "Failed")
+              << std::endl;
     };
 
 
-                                  // check 2: count number of cells
-                                  // on some level in a different way
+  // check 2: count number of cells
+  // on some level in a different way
   if (true)
     {
       bool (*predicate) (const active_cell_iterator)
-       = &level_equal_to_3<active_cell_iterator>;
+        = &level_equal_to_3<active_cell_iterator>;
       FilteredIterator<active_cell_iterator>
-       begin (predicate, tria.begin_active (3)),
-       end   (predicate, tria.end());
-      
+      begin (predicate, tria.begin_active (3)),
+            end   (predicate, tria.end());
+
       Assert (std::distance (begin, end) ==
-             static_cast<signed int>(tria.n_active_cells (3)),
-             ExcInternalError());
+              static_cast<signed int>(tria.n_active_cells (3)),
+              ExcInternalError());
       logfile << "Check 2: "
-             << (std::distance (begin, end) ==
-                 static_cast<signed int>(tria.n_active_cells (3))
-                 ?
-                 "OK" : "Failed")
-             << std::endl;
+              << (std::distance (begin, end) ==
+                  static_cast<signed int>(tria.n_active_cells (3))
+                  ?
+                  "OK" : "Failed")
+              << std::endl;
     };
 
 
-                                  // check 3: count number of cells
-                                  // on some level in yet a different
-                                  // way
+  // check 3: count number of cells
+  // on some level in yet a different
+  // way
   if (true)
     {
       bool (*predicate) (const active_cell_iterator, const unsigned int)
-       = &level_equal_to<active_cell_iterator>;
+        = &level_equal_to<active_cell_iterator>;
       FilteredIterator<active_cell_iterator>
-       begin (std::bind2nd (std::ptr_fun(predicate), 3),
-              tria.begin_active (3)),
-       end   (std::bind2nd (std::ptr_fun(predicate), 3),
-              tria.end());
-      
+      begin (std::bind2nd (std::ptr_fun(predicate), 3),
+             tria.begin_active (3)),
+                               end   (std::bind2nd (std::ptr_fun(predicate), 3),
+                                      tria.end());
+
       Assert (std::distance (begin, end) ==
-             static_cast<signed int>(tria.n_active_cells (3)),
-             ExcInternalError());
+              static_cast<signed int>(tria.n_active_cells (3)),
+              ExcInternalError());
       logfile << "Check 3: "
-             << (std::distance (begin, end) ==
-                 static_cast<signed int>(tria.n_active_cells (3))
-                 ?
-                 "OK" : "Failed")
-             << std::endl;
+              << (std::distance (begin, end) ==
+                  static_cast<signed int>(tria.n_active_cells (3))
+                  ?
+                  "OK" : "Failed")
+              << std::endl;
     };
 
 
-                                  // check 4: and yet another possibility
+  // check 4: and yet another possibility
   if (true)
     {
       typedef FilteredIterator<active_cell_iterator> FI;
-            
+
       bool (*predicate) (const active_cell_iterator, const unsigned int)
-       = &level_equal_to<active_cell_iterator>;
+        = &level_equal_to<active_cell_iterator>;
       Assert (std::distance (FI(std::bind2nd (std::ptr_fun(predicate), 3))
-                            .set_to_next_positive(tria.begin_active()),
-                            FI(std::bind2nd (std::ptr_fun(predicate), 3), tria.end())) ==
-             static_cast<signed int>(tria.n_active_cells (3)),
-             ExcInternalError());
+                             .set_to_next_positive(tria.begin_active()),
+                             FI(std::bind2nd (std::ptr_fun(predicate), 3), tria.end())) ==
+              static_cast<signed int>(tria.n_active_cells (3)),
+              ExcInternalError());
       logfile << "Check 4: "
-             << (std::distance (FI(std::bind2nd (std::ptr_fun(predicate), 3))
-                                .set_to_next_positive(tria.begin_active()),
-                                FI(std::bind2nd (std::ptr_fun(predicate), 3), tria.end())) ==
-                 static_cast<signed int>(tria.n_active_cells (3))
-                 ?
-                 "OK" : "Failed")
-             << std::endl;
+              << (std::distance (FI(std::bind2nd (std::ptr_fun(predicate), 3))
+                                 .set_to_next_positive(tria.begin_active()),
+                                 FI(std::bind2nd (std::ptr_fun(predicate), 3), tria.end())) ==
+                  static_cast<signed int>(tria.n_active_cells (3))
+                  ?
+                  "OK" : "Failed")
+              << std::endl;
     };
 
 
-                                  // check 5: check that we loop over
-                                  // all cells with a given subdomain
-                                  // id
+  // check 5: check that we loop over
+  // all cells with a given subdomain
+  // id
   if (true)
     {
       typedef FilteredIterator<active_cell_iterator> FI;
@@ -192,30 +192,30 @@ void test ()
       cell.set_to_next_positive (tria.begin_active());
       active_cell_iterator endc (tria.end());
       active_cell_iterator cell1 = tria.begin_active ();
-      
+
       while (cell1->subdomain_id () != 1)
-       ++cell1;
+        ++cell1;
 
       while (true)
-       {
-                                          // move filtered iterator ahead
-         ++cell;
-                                          // move unfiltered iterator
-                                          // ahead
-         ++cell1;
-         while ((cell1 != endc) &&
-                (cell1->subdomain_id () != 1))
-           ++cell1;
-
-         Assert (cell == cell1, ExcInternalError());
-         Assert (cell1 == cell, ExcInternalError());
-
-         if (cell.state() != IteratorState::valid)
-           break;
-       };
+        {
+          // move filtered iterator ahead
+          ++cell;
+          // move unfiltered iterator
+          // ahead
+          ++cell1;
+          while ((cell1 != endc) &&
+                 (cell1->subdomain_id () != 1))
+            ++cell1;
+
+          Assert (cell == cell1, ExcInternalError());
+          Assert (cell1 == cell, ExcInternalError());
+
+          if (cell.state() != IteratorState::valid)
+            break;
+        };
       Assert (cell == endc, ExcInternalError());
       Assert (cell1 == endc, ExcInternalError());
-      
+
       logfile << "Check 5: OK" << std::endl;
     };
 }
@@ -229,7 +229,7 @@ int main ()
   deallog.threshold_double(1.e-10);
 
   test ();
-  
+
   return 0;
 }
 
index ff13b8f7d92cb202b77c5e2af7825c7dd3c3705c..da051cd77fe3f0b8c9bf62816af7add6aaf70c8c 100644 (file)
@@ -37,9 +37,9 @@ std::ofstream logfile("filtered_iterator_02/output");
 
 
 DeclException2 (ExcNumberMismatch,
-               int, int,
-               << "The numbers " << arg1 << " and " << arg2
-               << " should be equation, but are not.");
+                int, int,
+                << "The numbers " << arg1 << " and " << arg2
+                << " should be equation, but are not.");
 
 
 
@@ -55,7 +55,7 @@ bool level_equal_to_3 (const Iterator c)
 
 template <typename Iterator>
 bool level_equal_to (const Iterator     c,
-                    const unsigned int level)
+                     const unsigned int level)
 {
   return (static_cast<unsigned int>(c->level()) == level);
 }
@@ -70,119 +70,119 @@ void test ()
   tria.execute_coarsening_and_refinement ();
   tria.refine_global (2);
 
-                                  // we now have a number of cells,
-                                  // flag them with some subdomain
-                                  // ids based on their position, in
-                                  // particular we take the quadrant
-                                  // (octant)
+  // we now have a number of cells,
+  // flag them with some subdomain
+  // ids based on their position, in
+  // particular we take the quadrant
+  // (octant)
   active_cell_iterator cell = tria.begin_active (),
-                      endc = tria.end ();
+                       endc = tria.end ();
   for (; cell!=endc; ++cell)
     {
       unsigned int subdomain = 0;
       for (unsigned int d=0; d<2; ++d)
-       if (cell->center()(d) > 0)
-         subdomain |= (1<<d);
+        if (cell->center()(d) > 0)
+          subdomain |= (1<<d);
       Assert (subdomain < (1<<2), ExcInternalError());
 
       cell->set_subdomain_id (subdomain);
     };
 
 
-                                  // check 1: count number of cells
-                                  // on some level
+  // check 1: count number of cells
+  // on some level
   if (true)
     {
       const IteratorFilters::LevelEqualTo predicate(3);
       FilteredIterator<active_cell_iterator>
-       begin = make_filtered_iterator(tria.begin_active(), predicate),
-       end = make_filtered_iterator (static_cast<active_cell_iterator>(tria.end()), predicate);
-      
+      begin = make_filtered_iterator(tria.begin_active(), predicate),
+      end = make_filtered_iterator (static_cast<active_cell_iterator>(tria.end()), predicate);
+
       Assert (std::distance (begin, end) ==
-             static_cast<signed int>(tria.n_active_cells (3)),
-             ExcInternalError());
+              static_cast<signed int>(tria.n_active_cells (3)),
+              ExcInternalError());
       logfile << "Check 1: "
-             << (std::distance (begin, end) ==
-                 static_cast<signed int>(tria.n_active_cells (3))
-                 ?
-                 "OK" : "Failed")
-             << std::endl;
+              << (std::distance (begin, end) ==
+                  static_cast<signed int>(tria.n_active_cells (3))
+                  ?
+                  "OK" : "Failed")
+              << std::endl;
     };
 
 
-                                  // check 2: count number of cells
-                                  // on some level in a different way
+  // check 2: count number of cells
+  // on some level in a different way
   if (true)
     {
       bool (*predicate) (const active_cell_iterator)
-       = &level_equal_to_3<active_cell_iterator>;
+        = &level_equal_to_3<active_cell_iterator>;
       FilteredIterator<active_cell_iterator>
-       begin (predicate, tria.begin_active (3)),
-       end   (predicate, tria.end());
-      
+      begin (predicate, tria.begin_active (3)),
+            end   (predicate, tria.end());
+
       Assert (std::distance (begin, end) ==
-             static_cast<signed int>(tria.n_active_cells (3)),
-             ExcInternalError());
+              static_cast<signed int>(tria.n_active_cells (3)),
+              ExcInternalError());
       logfile << "Check 2: "
-             << (std::distance (begin, end) ==
-                 static_cast<signed int>(tria.n_active_cells (3))
-                 ?
-                 "OK" : "Failed")
-             << std::endl;
+              << (std::distance (begin, end) ==
+                  static_cast<signed int>(tria.n_active_cells (3))
+                  ?
+                  "OK" : "Failed")
+              << std::endl;
     };
 
 
-                                  // check 3: count number of cells
-                                  // on some level in yet a different
-                                  // way
+  // check 3: count number of cells
+  // on some level in yet a different
+  // way
   if (true)
     {
       bool (*predicate) (const active_cell_iterator, const unsigned int)
-       = &level_equal_to<active_cell_iterator>;
+        = &level_equal_to<active_cell_iterator>;
       FilteredIterator<active_cell_iterator>
-       begin (std::bind2nd (std::ptr_fun(predicate), 3),
-              tria.begin_active (3)),
-       end   (std::bind2nd (std::ptr_fun(predicate), 3),
-              tria.end());
-      
+      begin (std::bind2nd (std::ptr_fun(predicate), 3),
+             tria.begin_active (3)),
+                               end   (std::bind2nd (std::ptr_fun(predicate), 3),
+                                      tria.end());
+
       Assert (std::distance (begin, end) ==
-             static_cast<signed int>(tria.n_active_cells (3)),
-             ExcInternalError());
+              static_cast<signed int>(tria.n_active_cells (3)),
+              ExcInternalError());
       logfile << "Check 3: "
-             << (std::distance (begin, end) ==
-                 static_cast<signed int>(tria.n_active_cells (3))
-                 ?
-                 "OK" : "Failed")
-             << std::endl;
+              << (std::distance (begin, end) ==
+                  static_cast<signed int>(tria.n_active_cells (3))
+                  ?
+                  "OK" : "Failed")
+              << std::endl;
     };
 
 
-                                  // check 4: and yet another possibility
+  // check 4: and yet another possibility
   if (true)
     {
       typedef FilteredIterator<active_cell_iterator> FI;
-            
+
       bool (*predicate) (const active_cell_iterator, const unsigned int)
-       = &level_equal_to<active_cell_iterator>;
+        = &level_equal_to<active_cell_iterator>;
       Assert (std::distance (FI(std::bind2nd (std::ptr_fun(predicate), 3))
-                            .set_to_next_positive(tria.begin_active()),
-                            FI(std::bind2nd (std::ptr_fun(predicate), 3), tria.end())) ==
-             static_cast<signed int>(tria.n_active_cells (3)),
-             ExcInternalError());
+                             .set_to_next_positive(tria.begin_active()),
+                             FI(std::bind2nd (std::ptr_fun(predicate), 3), tria.end())) ==
+              static_cast<signed int>(tria.n_active_cells (3)),
+              ExcInternalError());
       logfile << "Check 4: "
-             << (std::distance (FI(std::bind2nd (std::ptr_fun(predicate), 3))
-                                .set_to_next_positive(tria.begin_active()),
-                                FI(std::bind2nd (std::ptr_fun(predicate), 3), tria.end())) ==
-                 static_cast<signed int>(tria.n_active_cells (3))
-                 ?
-                 "OK" : "Failed")
-             << std::endl;
+              << (std::distance (FI(std::bind2nd (std::ptr_fun(predicate), 3))
+                                 .set_to_next_positive(tria.begin_active()),
+                                 FI(std::bind2nd (std::ptr_fun(predicate), 3), tria.end())) ==
+                  static_cast<signed int>(tria.n_active_cells (3))
+                  ?
+                  "OK" : "Failed")
+              << std::endl;
     };
 
 
-                                  // check 5: check that we loop over
-                                  // all cells with a given subdomain
-                                  // id
+  // check 5: check that we loop over
+  // all cells with a given subdomain
+  // id
   if (true)
     {
       typedef FilteredIterator<active_cell_iterator> FI;
@@ -191,30 +191,30 @@ void test ()
       cell.set_to_next_positive (tria.begin_active());
       active_cell_iterator endc (tria.end());
       active_cell_iterator cell1 = tria.begin_active ();
-      
+
       while (cell1->subdomain_id () != 1)
-       ++cell1;
+        ++cell1;
 
       while (true)
-       {
-                                          // move filtered iterator ahead
-         ++cell;
-                                          // move unfiltered iterator
-                                          // ahead
-         ++cell1;
-         while ((cell1 != endc) &&
-                (cell1->subdomain_id () != 1))
-           ++cell1;
-
-         Assert (cell == cell1, ExcInternalError());
-         Assert (cell1 == cell, ExcInternalError());
-
-         if (cell.state() != IteratorState::valid)
-           break;
-       };
+        {
+          // move filtered iterator ahead
+          ++cell;
+          // move unfiltered iterator
+          // ahead
+          ++cell1;
+          while ((cell1 != endc) &&
+                 (cell1->subdomain_id () != 1))
+            ++cell1;
+
+          Assert (cell == cell1, ExcInternalError());
+          Assert (cell1 == cell, ExcInternalError());
+
+          if (cell.state() != IteratorState::valid)
+            break;
+        };
       Assert (cell == endc, ExcInternalError());
       Assert (cell1 == endc, ExcInternalError());
-      
+
       logfile << "Check 5: OK" << std::endl;
     };
 }
@@ -228,7 +228,7 @@ int main ()
   deallog.threshold_double(1.e-10);
 
   test ();
-  
+
   return 0;
 }
 
index 832c823a3b88edcc97c90f8c42be1e228babfef3..5b8ad505d24b1d66a06fae74deda91afec72c449 100644 (file)
@@ -37,9 +37,9 @@ std::ofstream logfile("filtered_iterator_03/output");
 
 
 DeclException2 (ExcNumberMismatch,
-               int, int,
-               << "The numbers " << arg1 << " and " << arg2
-               << " should be equation, but are not.");
+                int, int,
+                << "The numbers " << arg1 << " and " << arg2
+                << " should be equation, but are not.");
 
 
 
@@ -64,44 +64,44 @@ void test ()
   tria.execute_coarsening_and_refinement ();
   tria.refine_global (2);
 
-                                  // we now have a number of cells,
-                                  // flag them with some subdomain
-                                  // ids based on their position, in
-                                  // particular we take the quadrant
-                                  // (octant)
+  // we now have a number of cells,
+  // flag them with some subdomain
+  // ids based on their position, in
+  // particular we take the quadrant
+  // (octant)
   active_cell_iterator cell = tria.begin_active (),
-                      endc = tria.end ();
+                       endc = tria.end ();
   for (; cell!=endc; ++cell)
     {
       unsigned int subdomain = 0;
       for (unsigned int d=0; d<2; ++d)
-       if (cell->center()(d) > 0)
-         subdomain |= (1<<d);
+        if (cell->center()(d) > 0)
+          subdomain |= (1<<d);
       Assert (subdomain < (1<<2), ExcInternalError());
 
       cell->set_subdomain_id (subdomain);
     };
 
 
-                                  // check 1: count number of cells
-                                  // on some level
+  // check 1: count number of cells
+  // on some level
   if (true)
     {
       FilteredIterator<active_cell_iterator>
-       begin = make_filtered_iterator(tria.begin_active(), &always_true<active_cell_iterator>),
-       end = make_filtered_iterator (static_cast<active_cell_iterator>(tria.end()), &always_true<active_cell_iterator>);
-      
+      begin = make_filtered_iterator(tria.begin_active(), &always_true<active_cell_iterator>),
+      end = make_filtered_iterator (static_cast<active_cell_iterator>(tria.end()), &always_true<active_cell_iterator>);
+
       Assert (std::distance (begin, end) ==
-             static_cast<signed int>(tria.n_active_cells ()),
-             ExcInternalError());
+              static_cast<signed int>(tria.n_active_cells ()),
+              ExcInternalError());
       deallog << std::distance(begin,end) << ' '
-             << tria.n_active_cells() << std::endl;
+              << tria.n_active_cells() << std::endl;
       logfile << "Check 1: "
-             << (std::distance (begin, end) ==
-                 static_cast<signed int>(tria.n_active_cells ())
-                 ?
-                 "OK" : "Failed")
-             << std::endl;
+              << (std::distance (begin, end) ==
+                  static_cast<signed int>(tria.n_active_cells ())
+                  ?
+                  "OK" : "Failed")
+              << std::endl;
     };
 }
 
@@ -114,7 +114,7 @@ int main ()
   deallog.threshold_double(1.e-10);
 
   test ();
-  
+
   return 0;
 }
 
index 0376cb41074225b4fb29994862aff7e536953bb1..f8cffa5addee181c6df52e00078c044c5b661a00 100644 (file)
 
 
 
-  
+
 void
 solve_filtered (std::map<types::global_dof_index,double> &bv,
-               SparseMatrix<double>          &A,
-               Vector<double>                &u,
-               Vector<double>                &f)
+                SparseMatrix<double>          &A,
+                Vector<double>                &u,
+                Vector<double>                &f)
 {
   FilteredMatrix<Vector<double> > A1 (A);
   A1.add_constraints (bv);
-  
+
   SolverControl control (1000, 1.e-10, false, false);
   PrimitiveVectorMemory<Vector<double> > mem;
   SolverCG<Vector<double> > solver (control, mem);
@@ -59,17 +59,17 @@ solve_filtered (std::map<types::global_dof_index,double> &bv,
   FilteredMatrix<Vector<double> > fprec;
   prec.initialize (A, 1.2);
   fprec.initialize(prec);
-  
+
   Vector<double> f1 (f.size());
   f1 = f;
   A1.apply_constraints (f1, true);
-  
+
   solver.solve (A1, u, f1, fprec);
 
   for (std::map<types::global_dof_index,double>::const_iterator i=bv.begin();
        i!=bv.end(); ++i)
     Assert (std::fabs(u(i->first) - i->second) < 1e-8,
-           ExcInternalError());
+            ExcInternalError());
 }
 
 
@@ -77,18 +77,18 @@ solve_filtered (std::map<types::global_dof_index,double> &bv,
 template <int dim>
 void
 solve_eliminated (std::map<types::global_dof_index,double> &bv,
-                 SparseMatrix<double>          &A,
-                 Vector<double>                &u,
-                 Vector<double>                &f)
+                  SparseMatrix<double>          &A,
+                  Vector<double>                &u,
+                  Vector<double>                &f)
 {
   MatrixTools::apply_boundary_values (bv, A, u, f);
-  
+
   SolverControl control (1000, 1.e-10, false, false);
   PrimitiveVectorMemory<Vector<double> > mem;
   SolverCG<Vector<double> > solver (control, mem);
   PreconditionJacobi<> prec;
   prec.initialize (A, 1.2);
-  
+
   solver.solve (A, u, f, prec);
 }
 
@@ -101,24 +101,24 @@ check ()
   Triangulation<dim> tr;
 
   Functions::CosineFunction<dim> cosine;
-  
+
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
-  GridGenerator::hyper_cube(tr, -1,1);
-  
+    GridGenerator::hyper_cube(tr, -1,1);
+
   tr.refine_global (5-dim);
-  
+
   MappingQ<dim> mapping(2);
   FE_Q<dim> element(1);
   QGauss<dim> quadrature(4);
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
-  
+
   FEValues<dim> fe (mapping, element, quadrature,
-                   update_values | update_gradients
-                   | update_q_points | update_JxW_values);
+                    update_values | update_gradients
+                    | update_q_points | update_JxW_values);
 
   std::vector <types::global_dof_index> global_dofs (element.dofs_per_cell);
   std::vector <double> function (quadrature.size());
@@ -126,72 +126,72 @@ check ()
   Vector<double> f (dof.n_dofs ());
 
   SparsityPattern A_pattern (dof.n_dofs (), dof.n_dofs (),
-                            dof.max_couplings_between_dofs());
+                             dof.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern(dof, A_pattern);
   A_pattern.compress ();
-  
+
   SparseMatrix<double> A(A_pattern);
-  
+
   typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active();
   const typename DoFHandler<dim>::cell_iterator end = dof.end();
 
-  for (; cell != end;++cell)
+  for (; cell != end; ++cell)
     {
       fe.reinit(cell);
       cell->get_dof_indices (global_dofs);
       cosine.value_list (fe.get_quadrature_points(), function);
 
-      for (unsigned int k=0;k<quadrature.size();++k)
-       {
-         double dx = fe.JxW (k);
-         
-         for (unsigned int i=0;i<element.dofs_per_cell;++i)
-           {
-             const double v = fe.shape_value (i,k);
-             const Tensor<1,dim> grad_v = fe.shape_grad(i,k);
-             
-             double rhs = dx * v * (function[k]);
-
-             f(global_dofs[i]) += rhs;
-             for (unsigned int j=0;j<element.dofs_per_cell;++j)
-               {
-                 const Tensor<1,dim> grad_u = fe.shape_grad (j,k);
-                 double el = dx * (grad_u*grad_v);
-                 A.add (global_dofs[i], global_dofs[j], el);
-               }
-           }
-       }
+      for (unsigned int k=0; k<quadrature.size(); ++k)
+        {
+          double dx = fe.JxW (k);
+
+          for (unsigned int i=0; i<element.dofs_per_cell; ++i)
+            {
+              const double v = fe.shape_value (i,k);
+              const Tensor<1,dim> grad_v = fe.shape_grad(i,k);
+
+              double rhs = dx * v * (function[k]);
+
+              f(global_dofs[i]) += rhs;
+              for (unsigned int j=0; j<element.dofs_per_cell; ++j)
+                {
+                  const Tensor<1,dim> grad_u = fe.shape_grad (j,k);
+                  double el = dx * (grad_u*grad_v);
+                  A.add (global_dofs[i], global_dofs[j], el);
+                }
+            }
+        }
     }
 
-                                  // interpolate boundary values
+  // interpolate boundary values
   std::map<types::global_dof_index,double> bv;
   VectorTools::interpolate_boundary_values (mapping, dof, 0, cosine, bv, std::vector<bool>());
-                                  // the cosine has too many zero
-                                  // values on the boundary of the
-                                  // domain, so reset the elements to
-                                  // some other value
+  // the cosine has too many zero
+  // values on the boundary of the
+  // domain, so reset the elements to
+  // some other value
   for (typename std::map<types::global_dof_index,double>::iterator i=bv.begin();
        i!=bv.end(); ++i)
     i->second = std::sin(i->second+0.5)+1.0;
 
-                                  // first solve filtered. this does
-                                  // not change the matrix
+  // first solve filtered. this does
+  // not change the matrix
   Vector<double> u_filtered (dof.n_dofs ());
   solve_filtered (bv, A, u_filtered, f);
-  
-                                  // then solve by eliminating in the
-                                  // matrix. since this changes the
-                                  // matrix, this call must come
-                                  // second
+
+  // then solve by eliminating in the
+  // matrix. since this changes the
+  // matrix, this call must come
+  // second
   Vector<double> u_eliminated (dof.n_dofs ());
   solve_eliminated<dim> (bv, A, u_eliminated, f);
 
-                                  // output and check
+  // output and check
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
     {
       deallog << u_filtered(i) << std::endl;
       Assert (std::fabs(u_filtered(i) - u_eliminated(i)) < 1e-8,
-             ExcInternalError());
+              ExcInternalError());
     };
 }
 
@@ -200,7 +200,7 @@ int main ()
 {
   std::ofstream logfile ("filtered_matrix/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
index 170d0d4db119f7c5bfb8b0017bfe031cc37c99fe..e08ea054d341de4fa6a69ef6543dc453f70d7939 100644 (file)
 template<int dim>
 void test()
 {
-                                   // create 2 triangulations with the
-                                   // same coarse grid, and refine
-                                   // them differently
+  // create 2 triangulations with the
+  // same coarse grid, and refine
+  // them differently
   Triangulation<dim> tria[2];
 
   GridGenerator::hyper_cube (tria[0]);
   GridGenerator::hyper_cube (tria[1]);
-  
+
   tria[0].refine_global (2);
   tria[1].refine_global (2);
 
   tria[0].begin_active()->set_refine_flag();
   tria[0].execute_coarsening_and_refinement ();
-  
+
   tria[1].last_active()->set_refine_flag();
   tria[1].execute_coarsening_and_refinement ();
 
@@ -52,9 +52,9 @@ void test()
   tria[1].execute_coarsening_and_refinement ();
 
   typedef
-    std::list<std::pair<typename Triangulation<dim>::cell_iterator,
-                        typename Triangulation<dim>::cell_iterator> >
-    CellList;
+  std::list<std::pair<typename Triangulation<dim>::cell_iterator,
+      typename Triangulation<dim>::cell_iterator> >
+      CellList;
 
   const CellList cell_list
     = GridTools::get_finest_common_cells (tria[0], tria[1]);
index fab794b1a07e324a6a3210a25b56323d30c20410..efba757a5aca773d6d6b3a1e90b57a79a1b5afd1 100644 (file)
 template<int dim>
 void test()
 {
-                                   // create 2 triangulations with the
-                                   // same coarse grid, and refine
-                                   // them differently
+  // create 2 triangulations with the
+  // same coarse grid, and refine
+  // them differently
   Triangulation<dim> tria[2];
 
   GridGenerator::hyper_cube (tria[0]);
   GridGenerator::hyper_cube (tria[1]);
-  
+
   tria[0].refine_global (2);
   tria[1].refine_global (2);
 
   tria[0].begin_active()->set_refine_flag();
   tria[0].execute_coarsening_and_refinement ();
-  
+
   tria[1].last_active()->set_refine_flag();
   tria[1].execute_coarsening_and_refinement ();
 
@@ -53,11 +53,11 @@ void test()
 
   DoFHandler<dim> dh0 (tria[0]);
   DoFHandler<dim> dh1 (tria[1]);
-  
+
   typedef
-    std::list<std::pair<typename DoFHandler<dim>::cell_iterator,
-                        typename DoFHandler<dim>::cell_iterator> >
-    CellList;
+  std::list<std::pair<typename DoFHandler<dim>::cell_iterator,
+      typename DoFHandler<dim>::cell_iterator> >
+      CellList;
 
   const CellList cell_list
     = GridTools::get_finest_common_cells (dh0, dh1);
index 825ce1ef528b7a587cec94962afff190d5f63c65..3bb1fd2741df760b38d876b5cbd1c4da7c46fcd9 100644 (file)
 template<int dim>
 void test()
 {
-                                   // create 2 triangulations with the
-                                   // same coarse grid, and refine
-                                   // them differently
+  // create 2 triangulations with the
+  // same coarse grid, and refine
+  // them differently
   Triangulation<dim> tria[2];
 
   GridGenerator::hyper_cube (tria[0]);
   GridGenerator::hyper_cube (tria[1]);
-  
+
   tria[0].refine_global (2);
   tria[1].refine_global (2);
 
   tria[0].begin_active()->set_refine_flag();
   tria[0].execute_coarsening_and_refinement ();
-  
+
   tria[1].last_active()->set_refine_flag();
   tria[1].execute_coarsening_and_refinement ();
 
@@ -53,11 +53,11 @@ void test()
 
   hp::DoFHandler<dim> dh0 (tria[0]);
   hp::DoFHandler<dim> dh1 (tria[1]);
-  
+
   typedef
-    std::list<std::pair<typename hp::DoFHandler<dim>::cell_iterator,
-                        typename hp::DoFHandler<dim>::cell_iterator> >
-    CellList;
+  std::list<std::pair<typename hp::DoFHandler<dim>::cell_iterator,
+      typename hp::DoFHandler<dim>::cell_iterator> >
+      CellList;
 
   const CellList cell_list
     = GridTools::get_finest_common_cells (dh0, dh1);
index 89c5fca2aac3f9d3ce24196759497eb903852a9d..30625d86f1f987bbe3a1efc3e0d69c399472cd99 100644 (file)
 template<int dim>
 void test()
 {
-                                   // create 2 triangulations with the
-                                   // same coarse grid, and refine
-                                   // them differently
+  // create 2 triangulations with the
+  // same coarse grid, and refine
+  // them differently
   Triangulation<dim> tria[2];
 
   GridGenerator::hyper_cube (tria[0]);
   GridGenerator::hyper_cube (tria[1]);
-  
+
   tria[0].refine_global (2);
   tria[1].refine_global (2);
 
   tria[0].begin_active()->set_refine_flag();
   tria[0].execute_coarsening_and_refinement ();
-  
+
   tria[1].last_active()->set_refine_flag();
   tria[1].execute_coarsening_and_refinement ();
 
@@ -53,11 +53,11 @@ void test()
 
   MGDoFHandler<dim> dh0 (tria[0]);
   MGDoFHandler<dim> dh1 (tria[1]);
-  
+
   typedef
-    std::list<std::pair<typename MGDoFHandler<dim>::cell_iterator,
-                        typename MGDoFHandler<dim>::cell_iterator> >
-    CellList;
+  std::list<std::pair<typename MGDoFHandler<dim>::cell_iterator,
+      typename MGDoFHandler<dim>::cell_iterator> >
+      CellList;
 
   const CellList cell_list
     = GridTools::get_finest_common_cells (dh0, dh1);
index d44d6c6751989197f4fc3fc36576681a7909c5ff..b1180a1a143ce73f7853474cf5673dacbc4dc9aa 100644 (file)
@@ -39,8 +39,8 @@ void check_rect1 (unsigned int n, bool color, bool log)
   Point<dim> left;
   Point<dim> right;
   std::vector<unsigned int> subdivisions(dim);
-  
-  for (unsigned int d=0;d<dim;++d)
+
+  for (unsigned int d=0; d<dim; ++d)
     {
       left(d) = -1.;
       right(d) = d+2;
@@ -48,21 +48,21 @@ void check_rect1 (unsigned int n, bool color, bool log)
     }
   Triangulation<dim> tria;
   GridGenerator::subdivided_hyper_rectangle(tria, subdivisions, left, right, color);
-  
+
   GridOut grid_out;
   if (dim == 2)
     {
       if (log)
-       grid_out.write_xfig (tria, logfile);
+        grid_out.write_xfig (tria, logfile);
       else
-       grid_out.write_xfig (tria, std::cout);
+        grid_out.write_xfig (tria, std::cout);
     }
   else
     {
       if (log)
-       grid_out.write_dx (tria, logfile);
+        grid_out.write_dx (tria, logfile);
       else
-       grid_out.write_dx (tria, std::cout);
+        grid_out.write_dx (tria, std::cout);
     }
 }
 
index 2898985bfb5b176739ddd3c8e0d068804c9fc4d2..d3a1421e14f75fc81f010ae4bdcefa0a60655651 100644 (file)
@@ -42,7 +42,7 @@ template<int dim>
 void check (double r1, double r2, unsigned int n)
 {
   deallog << "dim=" << dim << std::endl;
-  
+
   Point<dim> center;
   Triangulation<dim> tria (Triangulation<dim>::none, true);
   GridGenerator::hyper_shell (tria, center, r1, r2, n, true);
@@ -52,20 +52,20 @@ void check (double r1, double r2, unsigned int n)
   for (unsigned int i=0; i<2; ++i)
     {
       try
-       {
-         tria.refine_global(1);
-       }
+        {
+          tria.refine_global(1);
+        }
       catch (typename Triangulation<dim>::DistortedCellList &dcv)
-       {
-         deallog << "Found " << dcv.distorted_cells.size()
-                 << " distorted cells" << std::endl;
+        {
+          deallog << "Found " << dcv.distorted_cells.size()
+                  << " distorted cells" << std::endl;
 
-         typename Triangulation<dim>::DistortedCellList
-           subset = GridTools::fix_up_distorted_child_cells (dcv,
-                                                             tria);
-         deallog << subset.distorted_cells.size()
-                 << " distorted cells remaining" << std::endl;
-       }
+          typename Triangulation<dim>::DistortedCellList
+          subset = GridTools::fix_up_distorted_child_cells (dcv,
+                                                            tria);
+          deallog << subset.distorted_cells.size()
+                  << " distorted cells remaining" << std::endl;
+        }
     }
 
   GridOut grid_out;
@@ -82,7 +82,7 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   check<2> (4., 5., 10);
   check<3> (3., 5., 6);
 }
index e95abdcf8ab02425424fa1bed5b444f55e8e858d..0b9526e70a2a63d06e465e009a6e49b84768a0bb 100644 (file)
@@ -58,6 +58,6 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   check<3> (.5, 1, 6);
 }
index d16efd2e7a4ceaea0d7c9fa7915c6e27f19a227e..6abf8cf79ff8a28a4c236931e9fdc1bda6dae2a2 100644 (file)
@@ -58,6 +58,6 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   check<3> (.5, 1, 12);
 }
index ed973f8ceabfdc6355915a44c539804f66ce9a7f..5ba1eb456ed9b9d04c26ef71cb64fe446cd78d8d 100644 (file)
@@ -57,6 +57,6 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   check<3> (.5, 1, 96);
 }
index c4869217e1b1ae22f9500db3e59a66e03900b29d..1469a4f893676928bf239d67dcae03c1d9a978ee 100644 (file)
@@ -52,24 +52,24 @@ void check (const unsigned int n)
   Triangulation<dim> tria (Triangulation<dim>::none);
   GridGenerator::hyper_shell (tria, center, 0.5, 1, n, true);
 
-                                  // this is the test that failed
-                                  // before
+  // this is the test that failed
+  // before
   for (typename Triangulation<dim>::active_cell_iterator
-        cell = tria.begin_active();
+       cell = tria.begin_active();
        cell != tria.end(); ++cell)
     for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
       Assert (cell->face(f)->at_boundary() == cell->at_boundary(f),
-             ExcInternalError());
+              ExcInternalError());
 
-                                  // also output something slightly
-                                  // more useful
+  // also output something slightly
+  // more useful
   for (typename Triangulation<dim>::active_cell_iterator
-        cell = tria.begin_active();
+       cell = tria.begin_active();
        cell != tria.end(); ++cell)
     for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
       if (cell->at_boundary(f))
-       deallog << cell->face(f) << ' ' << (int)cell->face(f)->boundary_indicator()
-               << ' ' << cell->face(f)->center().norm() << std::endl;
+        deallog << cell->face(f) << ' ' << (int)cell->face(f)->boundary_indicator()
+                << ' ' << cell->face(f)->center().norm() << std::endl;
 }
 
 
index 998bfd54a8bbde79017a39e5e75749756abc0612..5107755df8eefa3bc8cf9cba35e2e5cedbb0bb90 100644 (file)
@@ -53,22 +53,22 @@ void test1 ()
 template <int dim>
 void test2 ()
 {
-                                   // read a much larger grid (30k
-                                   // cells). with the old grid
-                                   // reordering scheme, this took >90
-                                   // minutes (exact timing not
-                                   // available, program was killed
-                                   // before), with the new one it
-                                   // takes less than 8 seconds
-                                  //
-                                  // note that the input file is no good: it
-                                  // contains two pairs of two cells, where
-                                  // the two members of each pair share 3
-                                  // vertices (in 2d) -- this can of course
-                                  // not work properly. it makes the
-                                  // grid_in_02 testcase fail when using this
-                                  // input file, but grid_in_02/2d.xda is a
-                                  // corrected input file.
+  // read a much larger grid (30k
+  // cells). with the old grid
+  // reordering scheme, this took >90
+  // minutes (exact timing not
+  // available, program was killed
+  // before), with the new one it
+  // takes less than 8 seconds
+  //
+  // note that the input file is no good: it
+  // contains two pairs of two cells, where
+  // the two members of each pair share 3
+  // vertices (in 2d) -- this can of course
+  // not work properly. it makes the
+  // grid_in_02 testcase fail when using this
+  // input file, but grid_in_02/2d.xda is a
+  // corrected input file.
   Triangulation<dim> tria (Triangulation<dim>::none, true);
   GridIn<dim> gi;
   gi.attach_triangulation (tria);
@@ -79,11 +79,11 @@ void test2 ()
     }
   catch (typename Triangulation<dim>::DistortedCellList &dcv)
     {
-                                      // ignore the exception that we
-                                      // get because the mesh has
-                                      // distorted cells
+      // ignore the exception that we
+      // get because the mesh has
+      // distorted cells
       deallog << dcv.distorted_cells.size() << " cells are distorted."
-             << std::endl;
+              << std::endl;
     }
 
 
@@ -113,7 +113,7 @@ void test3 ()
 
 template<int dim>
 void check_file (const std::string name,
-                typename GridIn<dim>::Format format)
+                 typename GridIn<dim>::Format format)
 {
   Triangulation<dim> tria (Triangulation<dim>::none, true);
   GridIn<dim> gi;
@@ -124,15 +124,15 @@ void check_file (const std::string name,
     }
   catch (typename Triangulation<dim>::DistortedCellList &dcv)
     {
-                                      // ignore the exception
+      // ignore the exception
       deallog << dcv.distorted_cells.size() << " cells are distorted."
-             << std::endl;
+              << std::endl;
     }
 
   deallog << name
-         << '\t' << tria.n_vertices()
-         << '\t' << tria.n_cells()
-         << std::endl;
+          << '\t' << tria.n_vertices()
+          << '\t' << tria.n_cells()
+          << std::endl;
 }
 
 void filename_resolution()
@@ -152,7 +152,7 @@ int main ()
 
   test1<2> ();
   test2<2> ();
-                                  // test3 needs NetCDF
+  // test3 needs NetCDF
 //    test3<2> ();
 
   filename_resolution();
index d73292a5cbd1c696ee628a4d0d44ff35e16af034..bf35c0c57ac0af30dfd279b0ee21324338387901 100644 (file)
@@ -46,13 +46,13 @@ std::ofstream logfile("grid_in_02/output");
 template <int dim>
 void test2 ()
 {
-                                   // read a much larger grid (30k
-                                   // cells). with the old grid
-                                   // reordering scheme, this took >90
-                                   // minutes (exact timing not
-                                   // available, program was killed
-                                   // before), with the new one it
-                                   // takes less than 8 seconds
+  // read a much larger grid (30k
+  // cells). with the old grid
+  // reordering scheme, this took >90
+  // minutes (exact timing not
+  // available, program was killed
+  // before), with the new one it
+  // takes less than 8 seconds
   Triangulation<dim> tria (Triangulation<dim>::none, true);
   GridIn<dim> gi;
   gi.attach_triangulation (tria);
@@ -63,24 +63,24 @@ void test2 ()
     }
   catch (typename Triangulation<dim>::DistortedCellList &dcv)
     {
-                                      // ignore the exception that we
-                                      // get because the mesh has
-                                      // distorted cells
+      // ignore the exception that we
+      // get because the mesh has
+      // distorted cells
       deallog << dcv.distorted_cells.size() << " cells are distorted."
-             << std::endl;
+              << std::endl;
     }
 
   Triangulation<2>::active_cell_iterator
-    cell = tria.begin_active(),
-    endc = tria.end();
+  cell = tria.begin_active(),
+  endc = tria.end();
   for (; cell != endc; ++cell)
     for (unsigned int f=0; f<GeometryInfo<2>::faces_per_cell; ++f)
       for (unsigned int e=0; e<GeometryInfo<2>::faces_per_cell; ++e)
-       if (f != e)
-         if (!cell->at_boundary(e) && !cell->at_boundary(f))
-           Assert (cell->neighbor(e) !=
-                   cell->neighbor(f),
-                   ExcInternalError());
+        if (f != e)
+          if (!cell->at_boundary(e) && !cell->at_boundary(f))
+            Assert (cell->neighbor(e) !=
+                    cell->neighbor(f),
+                    ExcInternalError());
   deallog << "OK" << std::endl;
 }
 
index 1dd20cb60a271358e738b093aa8a720fcc69137f..9ad9f9a9c25b4df76ad7eef7b5606064cde794fc 100644 (file)
@@ -43,7 +43,7 @@ void test (const char *filename)
   const unsigned int dim = 3;
 
   deallog << "Reading " << filename << std::endl;
-  
+
   Triangulation<3> tria;
   GridIn<3> gi;
   gi.attach_triangulation (tria);
@@ -56,8 +56,8 @@ void test (const char *filename)
   catch (std::exception &exc)
     {
       deallog << "  caught exception:" << std::endl
-             << exc.what()
-             << std::endl;
+              << exc.what()
+              << std::endl;
       return;
     }
 
@@ -78,7 +78,7 @@ void test1()
   GridIn<3> gi;
   gi.attach_triangulation (tria);
   gi.read ("grid_in_3d/1.nc");
-  
+
   GridOut grid_out;
   std::ofstream gnufile("square.gnuplot");
   grid_out.write_gnuplot (tria, gnufile);
@@ -104,8 +104,8 @@ int main ()
   test ("grid_in_3d/evil_2.in");
   test ("grid_in_3d/evil_3.in");
   test ("grid_in_3d/evil_4.in");
-  
-                                  // test1 needs NetCDF
+
+  // test1 needs NetCDF
 //    test1 ();
 }
 
index 55666256509dca1874d9423b13ff807649ea433f..1c3313391bd15f967250a27781685597536968f4 100644 (file)
@@ -61,8 +61,8 @@ void test (const char *filename)
   catch (std::exception &exc)
     {
       deallog << "  caught exception:" << std::endl
-             << exc.what()
-             << std::endl;
+              << exc.what()
+              << std::endl;
       return;
     }
 
index c6e64eacb86674e6fdef983afe1bb95c62415dfb..a70784187cefb194c199ce8832efeb8480b3d12b 100644 (file)
@@ -38,16 +38,16 @@ std::ofstream logfile("grid_in_msh/output");
 
 template<int dim>
 void check_file (const std::string name,
-                typename GridIn<dim>::Format format)
+                 typename GridIn<dim>::Format format)
 {
   Triangulation<dim> tria;
   GridIn<dim> gi;
   gi.attach_triangulation (tria);
   gi.read(name, format);
   deallog << name
-         << '\t' << tria.n_vertices()
-         << '\t' << tria.n_cells()
-         << std::endl;
+          << '\t' << tria.n_vertices()
+          << '\t' << tria.n_cells()
+          << std::endl;
 
   GridOut grid_out;
   grid_out.write_gnuplot (tria, deallog.get_file_stream());
index 5e2b3bcc4c0b13dc9bc1f879e66b0d41679f6aec..5a070b128ee8d94352c9c561ceb5b1599dc8be11 100644 (file)
@@ -40,16 +40,16 @@ std::ofstream logfile("grid_in_msh_02/output");
 
 template<int dim>
 void check_file (const std::string name,
-                typename GridIn<dim>::Format format)
+                 typename GridIn<dim>::Format format)
 {
   Triangulation<dim> tria;
   GridIn<dim> gi;
   gi.attach_triangulation (tria);
   gi.read(name, format);
   deallog << name
-         << '\t' << tria.n_vertices()
-         << '\t' << tria.n_cells()
-         << std::endl;
+          << '\t' << tria.n_vertices()
+          << '\t' << tria.n_cells()
+          << std::endl;
 
   GridOut grid_out;
   grid_out.write_gnuplot (tria, deallog.get_file_stream());
index ab899c5f7263b5719bc62fad163fc40e9816c973..a9b1c5f1de16bd1133616b194634f67d4e84d321 100644 (file)
@@ -40,16 +40,16 @@ std::ofstream logfile("grid_in_msh_03/output");
 
 template<int dim>
 void check_file (const std::string name,
-                typename GridIn<dim>::Format format)
+                 typename GridIn<dim>::Format format)
 {
   Triangulation<dim> tria;
   GridIn<dim> gi;
   gi.attach_triangulation (tria);
   gi.read(name, format);
   deallog << name
-         << '\t' << tria.n_vertices()
-         << '\t' << tria.n_cells()
-         << std::endl;
+          << '\t' << tria.n_vertices()
+          << '\t' << tria.n_cells()
+          << std::endl;
 
   GridOut grid_out;
   grid_out.write_gnuplot (tria, deallog.get_file_stream());
index ef36aed5dcaf317c6815470c387ef0d7e0fa5c6d..a3d0006cbcb5d4a29cf819af69e55a9bb3a82d8f 100644 (file)
@@ -40,16 +40,16 @@ std::ofstream logfile("grid_in_msh_version_1/output");
 
 template<int dim>
 void check_file (const std::string name,
-                typename GridIn<dim>::Format format)
+                 typename GridIn<dim>::Format format)
 {
   Triangulation<dim> tria;
   GridIn<dim> gi;
   gi.attach_triangulation (tria);
   gi.read(name, format);
   deallog << name
-         << '\t' << tria.n_vertices()
-         << '\t' << tria.n_cells()
-         << std::endl;
+          << '\t' << tria.n_vertices()
+          << '\t' << tria.n_cells()
+          << std::endl;
 
   GridOut grid_out;
   grid_out.write_gnuplot (tria, deallog.get_file_stream());
index 883915237be25e41fd919cfa285840531aa7aa16..f3ff3f0fe3d01ffb04420d18c7508b7665abff31 100644 (file)
@@ -39,16 +39,16 @@ std::ofstream logfile("grid_in_msh_version_2/output");
 
 template<int dim>
 void check_file (const std::string name,
-                typename GridIn<dim>::Format format)
+                 typename GridIn<dim>::Format format)
 {
   Triangulation<dim> tria;
   GridIn<dim> gi;
   gi.attach_triangulation (tria);
   gi.read(name, format);
   deallog << name
-         << '\t' << tria.n_vertices()
-         << '\t' << tria.n_cells()
-         << std::endl;
+          << '\t' << tria.n_vertices()
+          << '\t' << tria.n_cells()
+          << std::endl;
 
   GridOut grid_out;
   grid_out.write_gnuplot (tria, deallog.get_file_stream());
index 9fd62fee6ae78845b9108113020c6a262dd02d96..dd755da38aa173cc4d4abe386424acf026965883 100644 (file)
@@ -31,15 +31,15 @@ std::ofstream logfile("grid_in_tecplot/output");
 
 template <int dim>
 void test (const std::string &infilename)
-{  
+{
   Triangulation<dim> tria;
   GridIn<dim> gi;
   gi.attach_triangulation (tria);
   gi.read (infilename);
 
   logfile<<"------------------------------------------"<<std::endl
-        <<"output for grid in "<<infilename<<std::endl;
-  
+         <<"output for grid in "<<infilename<<std::endl;
+
   GridOut grid_out;
   grid_out.set_flags (GridOutFlags::Ucd(true));
   grid_out.write_ucd (tria, logfile);
index bb80e607a598dbd0913292f6625e74b1947ca7fb..e92ecda87a7edff1784472aa28a9d4e1e61e0941 100644 (file)
@@ -41,16 +41,16 @@ std::ofstream logfile("grid_in_unv_2d/output");
 
 template<int dim>
 void check_file (const std::string name,
-                typename GridIn<dim>::Format format)
+                 typename GridIn<dim>::Format format)
 {
   Triangulation<dim> tria;
   GridIn<dim> gi;
   gi.attach_triangulation (tria);
   gi.read(name, format);
   deallog << name
-         << '\t' << tria.n_vertices()
-         << '\t' << tria.n_cells()
-         << std::endl;
+          << '\t' << tria.n_vertices()
+          << '\t' << tria.n_cells()
+          << std::endl;
 
   GridOut grid_out;
   grid_out.write_gnuplot (tria, deallog.get_file_stream());
index 27bfb5c7a28ec768fb68f75e5a7c5b0e9b9ba118..04ddf3635ec4e2915ff0e30a1c15a7617b9e7e9d 100644 (file)
@@ -41,16 +41,16 @@ std::ofstream logfile("grid_in_unv_3d/output");
 
 template<int dim>
 void check_file (const std::string name,
-                typename GridIn<dim>::Format format)
+                 typename GridIn<dim>::Format format)
 {
   Triangulation<dim> tria;
   GridIn<dim> gi;
   gi.attach_triangulation (tria);
   gi.read(name, format);
   deallog << name
-         << '\t' << tria.n_vertices()
-         << '\t' << tria.n_cells()
-         << std::endl;
+          << '\t' << tria.n_vertices()
+          << '\t' << tria.n_cells()
+          << std::endl;
 
   GridOut grid_out;
   grid_out.write_gnuplot (tria, deallog.get_file_stream());
index 342257b813aa653931b44324083b54e4f22718bb..dd96a8fb252e1302a85a378919d503ab5dbe7f44 100644 (file)
@@ -38,14 +38,14 @@ void test (bool second_case=false)
   if (dim==3)
     {
       for (unsigned int i=4; i<GeometryInfo<dim>::vertices_per_cell; ++i)
-       vertices[i](2)=-1;
+        vertices[i](2)=-1;
       vertices[5](1)=1;
       vertices[6](0)=1;
       vertices[6](1)=1;
       vertices[7](0)=1;
     }
   std::vector<CellData<dim> > cells(1);
-  for (unsigned int i=0;i<GeometryInfo<dim>::vertices_per_cell; ++i)
+  for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
     cells[0].vertices[i]=i;
 
   if (dim==3 && second_case)
@@ -53,7 +53,7 @@ void test (bool second_case=false)
       std::swap(cells[0].vertices[1],cells[0].vertices[3]);
       std::swap(cells[0].vertices[5],cells[0].vertices[7]);
       for (unsigned int i=4; i<GeometryInfo<dim>::vertices_per_cell; ++i)
-       vertices[i](2)=1;
+        vertices[i](2)=1;
     }
 
   SubCellData subcelldata;
@@ -63,9 +63,9 @@ void test (bool second_case=false)
   tria.create_triangulation_compatibility(vertices,cells,subcelldata);
 
   logfile<<"---------------------------------------------"
-        <<std::endl<<"dim="<<dim
-        <<(second_case ? ", second case" : ", first case")
-        <<std::endl<<std::endl;
+         <<std::endl<<"dim="<<dim
+         <<(second_case ? ", second case" : ", first case")
+         <<std::endl<<std::endl;
 
   GridOut grid_out;
   grid_out.set_flags (GridOutFlags::Ucd(true));
index b9ccecbca5e02ab6a10f45b08d7c5c433d62fe06..282408d6d13aa606886c8abc192d9dfe50988bd3 100644 (file)
@@ -34,7 +34,7 @@ std::ofstream logfile("grid_out/output");
 
 template <int dim>
 void test ()
-{  
+{
   Triangulation<dim> tria;
   static const HyperBallBoundary<dim> x;
   if (dim == 2)
@@ -45,10 +45,10 @@ void test ()
   else
     GridGenerator::hyper_cube (tria);
   tria.refine_global(1);
-  
+
   GridOut grid_out;
   GridOutFlags::Eps<2> eps2(GridOutFlags::EpsFlagsBase::width,
-                           300, .5, false, 5, true);
+                            300, .5, false, 5, true);
   grid_out.set_flags (eps2);
 
   if (dim != 1)
index c789ffd1324ca425be65995a57a47fa5aeb0418e..b521d3d872122e99f64113555df202e51668f6dc 100644 (file)
@@ -40,11 +40,11 @@ std::ofstream logfile("grid_out_02/output");
 
 template <int dim>
 void test ()
-{  
+{
   Triangulation<dim> tria;
   GridGenerator::hyper_cube (tria);
   tria.refine_global(2);
-  
+
   GridOut grid_out;
   grid_out.write_dx (tria, logfile);
 
index b3c9b867f54c8835facef0415cc29a79798fc32c..8b001c64002b1166359a7ae6009fba92835fca10 100644 (file)
 
 
 template<int dim>
-void test(std::ostreamout)
+void test(std::ostream &out)
 {
   GridOut go;
   go.set_flags(GridOutFlags::Ucd(false, true, true));
   go.set_flags(GridOutFlags::Msh(true, true));
   Triangulation<dim> tr;
-  
+
   GridGenerator::hyper_cube_with_cylindrical_hole(tr, .3, .4, 1, 1, false);
   CylinderBoundary<dim> boundary(.3, 2);
   tr.set_boundary(1, boundary);
@@ -50,10 +50,10 @@ void test(std::ostream& out)
   tr.refine_global(1);
   deallog << "Writing refined from constructor" << std::endl;
   go.write_ucd(tr, out);
-  
+
   tr.set_boundary(1);
   tr.clear();
-  
+
   GridIn<dim> gi;
   gi.attach_triangulation(tr);
   {
@@ -67,13 +67,13 @@ void test(std::ostream& out)
   tr.refine_global(1);
   deallog << "Writing refined from file" << std::endl;
   go.write_ucd(tr, out);
-  
+
   {
     std::ofstream grid_file("grid_output_input/grid.msh");
     go.write_msh(tr, grid_file);
     grid_file.close();
   }
-  
+
   tr.set_boundary(1);
   tr.clear();
 }
@@ -84,7 +84,7 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   deallog.push("3d");
   test<3>(logfile);
   deallog.pop();
index e67d63900bb5b13c386e71ea406d586dcf7252e5..1f3c2612a2b2cfc5a8c51c87ecc1b2ab9fc59826 100644 (file)
@@ -55,7 +55,7 @@ void check_parallelepiped (bool colorize, bool log)
       corners[0] = Point<dim> (0.0, 0.5);
       corners[1] = Point<dim> (0.5, 0.0);
       break;
-      
+
     case 3:
       corners[0] = Point<dim> (0.0, 0.5, 0.5);
       corners[1] = Point<dim> (0.5, 0.0, 0.5);
@@ -65,10 +65,10 @@ void check_parallelepiped (bool colorize, bool log)
     default:
       Assert (false, ExcInternalError ());
     }
-  
+
   Triangulation<dim> triangulation;
   GridGenerator::parallelepiped (triangulation, corners, colorize);
-  
+
   GridOut grid_out;
 
   if (log)
@@ -82,7 +82,7 @@ void check_parallelepiped (bool colorize, bool log)
 
 int main ()
 {
-  // Check parallelepiped 
+  // Check parallelepiped
   check_parallelepiped<1> (false, true);
   check_parallelepiped<2> (false, true);
   check_parallelepiped<3> (true,  true);
index 1dc8c7d0b8904ad00e30cc0e3a8129b08877fae0..620f509fd37a2490eac0a8fd2a9a4244e63b5b14 100644 (file)
@@ -47,10 +47,10 @@ void check_1d_parallelepiped_by_comparison (bool log)
   // parallelepiped.
   Point<1> (corners) [1];
   corners[0] = Point<1> (0.5);
-  
+
   Triangulation<1> triangulation_parallelepiped;
   GridGenerator::parallelepiped (triangulation_parallelepiped, corners, false);
-  
+
   Triangulation<1> triangulation_cube;
   GridGenerator::hyper_cube (triangulation_cube, 0., 0.5);
 
@@ -58,10 +58,10 @@ void check_1d_parallelepiped_by_comparison (bool log)
     {
       logfile << "\ncheck 1d parallelepiped (hyper_cube): ";
       if (GridTools::have_same_coarse_mesh (triangulation_parallelepiped,
-                                           triangulation_cube))
-       logfile << "OK";
+                                            triangulation_cube))
+        logfile << "OK";
       else
-       logfile << "not OK... coarse grids are different but they should be the same";
+        logfile << "not OK... coarse grids are different but they should be the same";
     }
 }
 
@@ -74,7 +74,7 @@ void check_2d_parallelepiped_by_comparison (bool log)
   Point<2> (corners) [2];
   corners[0] = Point<2> (0.0, 0.5);
   corners[1] = Point<2> (0.5, 0.0);
-  
+
   Triangulation<2> triangulation_parallelepiped;
   GridGenerator::parallelepiped (triangulation_parallelepiped, corners, false);
 
@@ -85,17 +85,17 @@ void check_2d_parallelepiped_by_comparison (bool log)
     {
       logfile << "\ncheck 2d parallelepiped (parallelogram): ";
       if (GridTools::have_same_coarse_mesh (triangulation_parallelepiped,
-                                           triangulation_parallelogram))
-       logfile << "OK";
+                                            triangulation_parallelogram))
+        logfile << "OK";
 
       else
-       logfile << "not OK... coarse grids are different but they should be the same";
+        logfile << "not OK... coarse grids are different but they should be the same";
     }
 }
 
 int main ()
 {
-  // Check parallelepiped 
+  // Check parallelepiped
   check_1d_parallelepiped_by_comparison (true);
   check_2d_parallelepiped_by_comparison (true);
   logfile << "\n";
index 06987d30f4b6357de57986b9c7e2b464e38731e9..e6afd18b3c767c3ad558c426d50da7e6f48a1d2e 100644 (file)
@@ -45,59 +45,59 @@ std::ofstream logfile ("grid_parallelepiped_02/output");
 template<int dim>
 void check_nd_parallelepiped_by_comparison (bool log)
 {
-  
+
   // build corners for this particular dim that are known to give the
   // same output order as subdivided parallelepiped:
   Point<dim> (corners) [dim];
-  
+
   switch (dim)
     {
     case 1:
-      {
-       corners[0] = Point<dim> (0.50);
-       break;
-      }
-      
+    {
+      corners[0] = Point<dim> (0.50);
+      break;
+    }
+
     case 2:
-      {
-       corners[0] = Point<dim> (0.25, 0.50);
-       corners[1] = Point<dim> (0.50, 0.25);
-       break;
-      }
+    {
+      corners[0] = Point<dim> (0.25, 0.50);
+      corners[1] = Point<dim> (0.50, 0.25);
+      break;
+    }
 
     case 3:
-      {
-       corners[0] = Point<dim> (0.25, 0.50, 0.50);
-       corners[1] = Point<dim> (0.50, 0.25, 0.50);
-       corners[2] = Point<dim> (0.50, 0.50, 0.25);
-       break;
-      }
-      
+    {
+      corners[0] = Point<dim> (0.25, 0.50, 0.50);
+      corners[1] = Point<dim> (0.50, 0.25, 0.50);
+      corners[2] = Point<dim> (0.50, 0.50, 0.25);
+      break;
+    }
+
     default:
       Assert (false, ExcInternalError ());
     };
-  
+
   Triangulation<dim> triangulation_parallelepiped;
   GridGenerator::parallelepiped (triangulation_parallelepiped, corners, false);
-  
+
   Triangulation<dim> triangulation_subdivided_parallelepiped;
   GridGenerator::subdivided_parallelepiped (triangulation_subdivided_parallelepiped, 1, corners, false);
-  
+
   if (log)
     {
       logfile << "\ncheck " << dim << "d parallelepiped (subdivided_parallelepiped): ";
       if (GridTools::have_same_coarse_mesh (triangulation_parallelepiped,
-                                           triangulation_subdivided_parallelepiped))
-       logfile << "OK";
-      
+                                            triangulation_subdivided_parallelepiped))
+        logfile << "OK";
+
       else
-       logfile << "not OK... coarse grids are different but they should be the same";
+        logfile << "not OK... coarse grids are different but they should be the same";
     }
 }
 
 int main ()
 {
-  // Check parallelepiped 
+  // Check parallelepiped
   check_nd_parallelepiped_by_comparison<1> (true);
   check_nd_parallelepiped_by_comparison<2> (true);
   check_nd_parallelepiped_by_comparison<3> (true);
index 74b75fddc6b33dc0b05091c27e1607e0fef1714e..9196c2eb8d505fa9ac414c79572165499cc9060d 100644 (file)
@@ -55,7 +55,7 @@ void check_subdivided_parallelepiped (bool colorize, bool log)
       corners[0] = Point<dim> (0.25, 0.50);
       corners[1] = Point<dim> (0.50, 0.25);
       break;
-      
+
     case 3:
       corners[0] = Point<dim> (0.25, 0.50, 0.50);
       corners[1] = Point<dim> (0.50, 0.25, 0.50);
@@ -66,12 +66,12 @@ void check_subdivided_parallelepiped (bool colorize, bool log)
       Assert (false, ExcInternalError ());
     }
 
-  // The number of subdivisions can be anything reasonable:  
+  // The number of subdivisions can be anything reasonable:
   const unsigned int n_subdivisions = (2*dim+1);
 
   Triangulation<dim> triangulation;
   GridGenerator::subdivided_parallelepiped (triangulation, n_subdivisions, corners, colorize);
-  
+
   GridOut grid_out;
 
   if (log)
@@ -85,7 +85,7 @@ void check_subdivided_parallelepiped (bool colorize, bool log)
 
 int main ()
 {
-  // Check parallelepiped 
+  // Check parallelepiped
   check_subdivided_parallelepiped<1> (false, true);
   check_subdivided_parallelepiped<2> (false, true);
   check_subdivided_parallelepiped<3> (true,  true);
index ffa083f86159c06541ed5debb76a15f6606e4cf6..c284132aeb931418ca01a5bb3ccd956154b395aa 100644 (file)
@@ -42,33 +42,35 @@ template <int dim>
 class Ball :
   public StraightBoundary<dim>
 {
-  public:
-    virtual Point<dim>
-    get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const {
-      Point<dim> middle = StraightBoundary<dim>::get_new_point_on_line(line);
-      
-      for (int i=0; i<dim; ++i)
-       middle(i) -= .5;
-      middle *= std::sqrt(static_cast<double>(dim)) / (std::sqrt(middle.square())*2);
-      for (int i=0; i<dim; ++i)
-       middle(i) += .5;
-      
-      return middle;
-    }
+public:
+  virtual Point<dim>
+  get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const
+  {
+    Point<dim> middle = StraightBoundary<dim>::get_new_point_on_line(line);
+
+    for (int i=0; i<dim; ++i)
+      middle(i) -= .5;
+    middle *= std::sqrt(static_cast<double>(dim)) / (std::sqrt(middle.square())*2);
+    for (int i=0; i<dim; ++i)
+      middle(i) += .5;
 
+    return middle;
+  }
 
-    virtual Point<dim>
-    get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const {
-      Point<dim> middle = StraightBoundary<dim>::get_new_point_on_quad(quad);
-      
-      for (int i=0; i<dim; ++i)
-       middle(i) -= .5;
-      middle *= std::sqrt(static_cast<double>(dim)) / (std::sqrt(middle.square())*2);
-      for (int i=0; i<dim; ++i)
-       middle(i) += .5;
-      
-      return middle;
-    }
+
+  virtual Point<dim>
+  get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const
+  {
+    Point<dim> middle = StraightBoundary<dim>::get_new_point_on_quad(quad);
+
+    for (int i=0; i<dim; ++i)
+      middle(i) -= .5;
+    middle *= std::sqrt(static_cast<double>(dim)) / (std::sqrt(middle.square())*2);
+    for (int i=0; i<dim; ++i)
+      middle(i) += .5;
+
+    return middle;
+  }
 };
 
 
@@ -76,12 +78,12 @@ template <int dim>
 class CurvedLine :
   public StraightBoundary<dim>
 {
-  public:
-    virtual Point<dim>
-    get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const;
+public:
+  virtual Point<dim>
+  get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const;
 
-    virtual Point<dim>
-    get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const;
+  virtual Point<dim>
+  get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const;
 };
 
 
@@ -91,45 +93,44 @@ CurvedLine<dim>::get_new_point_on_line (const typename Triangulation<dim>::line_
 {
   Point<dim> middle = StraightBoundary<dim>::get_new_point_on_line (line);
 
-                                  // if the line is at the top of bottom
-                                  // face: do a special treatment on
-                                  // this line. Note that if the
-                                  // z-value of the midpoint is either
-                                  // 0 or 1, then the z-values of all
-                                  // vertices of the line is like that
+  // if the line is at the top of bottom
+  // face: do a special treatment on
+  // this line. Note that if the
+  // z-value of the midpoint is either
+  // 0 or 1, then the z-values of all
+  // vertices of the line is like that
   if (dim>=3)
     if (((middle(2) == 0) || (middle(2) == 1))
-                                        // find out, if the line is in the
-                                        // interior of the top or bottom face
-                                        // of the domain, or at the edge.
-                                        // lines at the edge need to undergo
-                                        // the usual treatment, while for
-                                        // interior lines taking the midpoint
-                                        // is sufficient
-                                        //
-                                        // note: the trick with the boundary
-                                        // id was invented after the above was
-                                        // written, so we are not very strict
-                                        // here with using these flags
-       && (line->boundary_indicator() == 1))
+        // find out, if the line is in the
+        // interior of the top or bottom face
+        // of the domain, or at the edge.
+        // lines at the edge need to undergo
+        // the usual treatment, while for
+        // interior lines taking the midpoint
+        // is sufficient
+        //
+        // note: the trick with the boundary
+        // id was invented after the above was
+        // written, so we are not very strict
+        // here with using these flags
+        && (line->boundary_indicator() == 1))
       return middle;
 
 
   double x=middle(0),
-        y=middle(1);
-  
+         y=middle(1);
+
   if (y<x)
     if (y<1-x)
       middle(1) = 0.04*std::sin(6*3.141592*middle(0));
     else
       middle(0) = 1+0.04*std::sin(6*3.141592*middle(1));
-  
+
+  else if (y<1-x)
+    middle(0) = 0.04*std::sin(6*3.141592*middle(1));
   else
-    if (y<1-x)
-      middle(0) = 0.04*std::sin(6*3.141592*middle(1));
-    else
-      middle(1) = 1+0.04*std::sin(6*3.141592*middle(0));
-  
+    middle(1) = 1+0.04*std::sin(6*3.141592*middle(0));
+
   return middle;
 }
 
@@ -140,30 +141,29 @@ CurvedLine<dim>::get_new_point_on_quad (const typename Triangulation<dim>::quad_
 {
   Point<dim> middle = StraightBoundary<dim>::get_new_point_on_quad (quad);
 
-                                  // if the face is at the top of bottom
-                                  // face: do not move the midpoint in
-                                  // x/y direction. Note that if the
-                                  // z-value of the midpoint is either
-                                  // 0 or 1, then the z-values of all
-                                  // vertices of the quad is like that
+  // if the face is at the top of bottom
+  // face: do not move the midpoint in
+  // x/y direction. Note that if the
+  // z-value of the midpoint is either
+  // 0 or 1, then the z-values of all
+  // vertices of the quad is like that
   if ((middle(2) == 0) || (middle(2) == 1))
     return middle;
-  
+
   double x=middle(0),
-        y=middle(1);
-  
+         y=middle(1);
+
   if (y<x)
     if (y<1-x)
       middle(1) = 0.04*std::sin(6*3.141592*middle(0));
     else
       middle(0) = 1+0.04*std::sin(6*3.141592*middle(1));
-  
+
+  else if (y<1-x)
+    middle(0) = 0.04*std::sin(6*3.141592*middle(1));
   else
-    if (y<1-x)
-      middle(0) = 0.04*std::sin(6*3.141592*middle(1));
-    else
-      middle(1) = 1+0.04*std::sin(6*3.141592*middle(0));
-  
+    middle(1) = 1+0.04*std::sin(6*3.141592*middle(0));
+
   return middle;
 }
 
@@ -173,15 +173,15 @@ void test (const int test_case)
 {
   char testname[100];
   sprintf(testname, "Test%d.dim%d", test_case , dim);
-  
+
   deallog.push(testname);
   deallog << "Start" << std::endl;
-  
+
   Triangulation<dim> tria;
   GridGenerator::hyper_cube(tria);
 
   tria.begin_active()->set_material_id(3);
-  
+
   if ((dim==1) && ((test_case==2) || (test_case==3)))
     {
       deallog << "Impossible for this dimension." << std::endl;
@@ -189,83 +189,83 @@ void test (const int test_case)
     };
 
 
-  switch (test_case) 
+  switch (test_case)
+    {
+    case 1:
     {
-      case 1: 
-      {
-       
-                                        // refine first cell
-       tria.begin_active()->set_refine_flag();
-       tria.execute_coarsening_and_refinement ();
-       
-                                        // refine first active cell
-                                        // on coarsest level
-       tria.begin_active()->set_refine_flag ();
-       tria.execute_coarsening_and_refinement ();
-
-       typename Triangulation<dim>::active_cell_iterator cell;
-       for (int i=0; i<(dim==2 ? 3 : 2); ++i) 
-         {
-                                            // refine the presently
-                                            // last cell several
-                                            // times
-           cell = tria.last_active(tria.n_levels()-1);
-           cell->set_refine_flag ();
-           tria.execute_coarsening_and_refinement ();
-         };
-       
-       break;
-      }
-      
-      case 2:
-      case 3:
-      {
-       if (dim==3)
-         {
-           tria.begin_active()->face(4)->set_boundary_indicator(1);
-           tria.begin_active()->face(5)->set_boundary_indicator(1);
-         };
+
+      // refine first cell
+      tria.begin_active()->set_refine_flag();
+      tria.execute_coarsening_and_refinement ();
+
+      // refine first active cell
+      // on coarsest level
+      tria.begin_active()->set_refine_flag ();
+      tria.execute_coarsening_and_refinement ();
+
+      typename Triangulation<dim>::active_cell_iterator cell;
+      for (int i=0; i<(dim==2 ? 3 : 2); ++i)
+        {
+          // refine the presently
+          // last cell several
+          // times
+          cell = tria.last_active(tria.n_levels()-1);
+          cell->set_refine_flag ();
+          tria.execute_coarsening_and_refinement ();
+        };
+
+      break;
+    }
+
+    case 2:
+    case 3:
+    {
+      if (dim==3)
+        {
+          tria.begin_active()->face(4)->set_boundary_indicator(1);
+          tria.begin_active()->face(5)->set_boundary_indicator(1);
+        };
 
 
 // set the boundary function
-       Ball<dim>       ball;
-       CurvedLine<dim> curved_line;
-       if (test_case==2)
-         tria.set_boundary (1, ball);
-       else
-         tria.set_boundary (1, curved_line);
-       
-                                        // refine once
-       tria.begin_active()->set_refine_flag();
-       tria.execute_coarsening_and_refinement ();
-       
-       typename Triangulation<dim>::active_cell_iterator cell, endc;
-       const unsigned int steps[4] = { 0, 2, 2, 2 };
-       for (unsigned int i=0; i<steps[dim]; ++i) 
-         {
-           cell = tria.begin_active();
-           endc = tria.end();
-           
-                                            // refine all
-                                            // boundary cells
-           for (; cell!=endc; ++cell)
-             if (cell->at_boundary())
-               cell->set_refine_flag();
-           
-           tria.execute_coarsening_and_refinement();
-         };
-
-       tria.set_boundary (1);
-       break;
-      }
+      Ball<dim>       ball;
+      CurvedLine<dim> curved_line;
+      if (test_case==2)
+        tria.set_boundary (1, ball);
+      else
+        tria.set_boundary (1, curved_line);
+
+      // refine once
+      tria.begin_active()->set_refine_flag();
+      tria.execute_coarsening_and_refinement ();
+
+      typename Triangulation<dim>::active_cell_iterator cell, endc;
+      const unsigned int steps[4] = { 0, 2, 2, 2 };
+      for (unsigned int i=0; i<steps[dim]; ++i)
+        {
+          cell = tria.begin_active();
+          endc = tria.end();
+
+          // refine all
+          // boundary cells
+          for (; cell!=endc; ++cell)
+            if (cell->at_boundary())
+              cell->set_refine_flag();
+
+          tria.execute_coarsening_and_refinement();
+        };
+
+      tria.set_boundary (1);
+      break;
+    }
     }
 
   GridOut go;
-  go.set_flags (GridOutFlags::Ucd(true));  
+  go.set_flags (GridOutFlags::Ucd(true));
   go.write_ucd (tria, logfile);
 
   deallog << "     Total number of cells        = " << tria.n_cells() << std::endl
-         << "     Total number of active cells = " << tria.n_active_cells() << std::endl;
+          << "     Total number of active cells = " << tria.n_active_cells() << std::endl;
 
   deallog.pop();
 }
@@ -278,11 +278,11 @@ int main ()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   for (unsigned int i=1; i<=3; ++i)
     test<2> (i);
   for (unsigned int i=1; i<=3; ++i)
     test<3> (i);
-  
+
   return 0;
 }
index 8e17a87f554330f3ed95bc363bd4d757d7350e59..b1ab1572824ec3f14feb04f7f69ecebb81763182 100644 (file)
@@ -34,40 +34,40 @@ std::ofstream logfile("grid_tools/output");
 template <int dim>
 void test1 ()
 {
-                                  // test 1: hypercube
+  // test 1: hypercube
   if (true)
     {
       Triangulation<dim> tria;
       GridGenerator::hyper_cube(tria);
 
       for (unsigned int i=0; i<2; ++i)
-       {
-         tria.refine_global(2);
-         deallog << dim << "d, "
-                 << "hypercube diameter, "
-                 << i*2
-                 << " refinements: "
-                 << GridTools::diameter (tria)
-                 << std::endl;
-       };
+        {
+          tria.refine_global(2);
+          deallog << dim << "d, "
+                  << "hypercube diameter, "
+                  << i*2
+                  << " refinements: "
+                  << GridTools::diameter (tria)
+                  << std::endl;
+        };
     };
 
-                                  // test 2: hyperball
+  // test 2: hyperball
   if (dim == 2)
     {
       Triangulation<dim> tria;
       GridGenerator::hyper_ball(tria, Point<dim>(), 1);
 
       for (unsigned int i=0; i<2; ++i)
-       {
-         tria.refine_global(2);
-         deallog << dim << "d, "
-                 << "hyperball diameter, "
-                 << i*2
-                 << " refinements: "
-                 << GridTools::diameter (tria)
-                 << std::endl;
-       };
+        {
+          tria.refine_global(2);
+          deallog << dim << "d, "
+                  << "hyperball diameter, "
+                  << i*2
+                  << " refinements: "
+                  << GridTools::diameter (tria)
+                  << std::endl;
+        };
     };
 }
 
@@ -80,7 +80,7 @@ void test2 ()
 
   logfile << "Unchanged grid:" << std::endl;
   GridOut().write_gnuplot (tria, logfile);
-  
+
   logfile << "Shifted grid:" << std::endl;
   const Point<2> shift(1,2);
   GridTools::shift (shift, tria);
@@ -105,7 +105,7 @@ int main ()
   test1<3> ();
 
   test2 ();
-  
+
   return 0;
 }
 
index c684d5f9f8039958d1b6983ca3fa822b5bfd19f7..fbe8b1aecf10336c386251a2816976439caf345b 100644 (file)
@@ -36,22 +36,22 @@ std::ofstream logfile("grid_tools_02/output");
 template <int dim>
 void test1 ()
 {
-                                  // test 1: hypercube
+  // test 1: hypercube
   if (true)
     {
       Triangulation<dim,dim+1> tria;
       GridGenerator::hyper_cube(tria);
 
       for (unsigned int i=0; i<2; ++i)
-       {
-         tria.refine_global(2);
-         deallog << dim << "d, "
-                 << "hypercube diameter, "
-                 << i*2
-                 << " refinements: "
-                 << GridTools::diameter (tria)
-                 << std::endl;
-       }
+        {
+          tria.refine_global(2);
+          deallog << dim << "d, "
+                  << "hypercube diameter, "
+                  << i*2
+                  << " refinements: "
+                  << GridTools::diameter (tria)
+                  << std::endl;
+        }
     }
 }
 
index c293193c5bb699f70cb62492b09033f8e61439f5..890a04344833134a56a1bdea57528533e6656588 100644 (file)
@@ -36,25 +36,25 @@ std::ofstream logfile("grid_tools_03/output");
 template <int dim>
 void test1 ()
 {
-                                  // test 1: hypercube
+  // test 1: hypercube
   if (true)
     {
       Triangulation<dim> tria;
       GridGenerator::hyper_cube(tria);
 
       for (unsigned int i=0; i<2; ++i)
-       {
-         tria.refine_global(2);
-         deallog << dim << "d, "
-                 << "hypercube volume, "
-                 << i*2
-                 << " refinements: "
-                 << GridTools::volume (tria)
-                 << std::endl;
-       };
+        {
+          tria.refine_global(2);
+          deallog << dim << "d, "
+                  << "hypercube volume, "
+                  << i*2
+                  << " refinements: "
+                  << GridTools::volume (tria)
+                  << std::endl;
+        };
     };
 
-                                  // test 2: hyperball
+  // test 2: hyperball
   if (dim >= 2)
     {
       Triangulation<dim> tria;
@@ -64,19 +64,19 @@ void test1 ()
       tria.set_boundary (0, boundary);
 
       for (unsigned int i=0; i<4; ++i)
-       {
-         tria.refine_global(1);
-         deallog << dim << "d, "
-                 << "hyperball volume, "
-                 << i
-                 << " refinements: "
-                 << GridTools::volume (tria)
-                 << std::endl;
-       }
+        {
+          tria.refine_global(1);
+          deallog << dim << "d, "
+                  << "hyperball volume, "
+                  << i
+                  << " refinements: "
+                  << GridTools::volume (tria)
+                  << std::endl;
+        }
       deallog << "exact value="
-             << (dim==2 ? numbers::PI :
-                 4./3.*numbers::PI)
-             << std::endl;
+              << (dim==2 ? numbers::PI :
+                  4./3.*numbers::PI)
+              << std::endl;
     }
 }
 
index 68b4f2a16d31225e89a01107cc77b9e87fba752d..7a2e03e1c9f5fd9202d0d5fdefd36f876f5bb07a 100644 (file)
@@ -36,22 +36,22 @@ std::ofstream logfile("grid_tools_04/output");
 template <int dim>
 void test1 ()
 {
-                                  // test 1: hypercube
+  // test 1: hypercube
   if (true)
     {
       Triangulation<dim,dim+1> tria;
       GridGenerator::hyper_cube(tria);
 
       for (unsigned int i=0; i<2; ++i)
-       {
-         tria.refine_global(2);
-         deallog << dim << "d, "
-                 << "hypercube volume, "
-                 << i*2
-                 << " refinements: "
-                 << GridTools::volume (tria)
-                 << std::endl;
-       };
+        {
+          tria.refine_global(2);
+          deallog << dim << "d, "
+                  << "hypercube volume, "
+                  << i*2
+                  << " refinements: "
+                  << GridTools::volume (tria)
+                  << std::endl;
+        };
     };
 }
 
index acb6aed46ec022d9ae1aaa9417699e0ec7986f0f..e099e85470ed87bd96ae8f9490b6f601a77bb269 100644 (file)
@@ -45,127 +45,135 @@ using namespace dealii;
 /* The 2D case */
 void generate_grid(Triangulation<2> &triangulation, int orientation)
 {
-    Point<2> vertices_1[]
-      = {
-           Point<2> (-1.,-3.),
-           Point<2> (+1.,-3.),
-           Point<2> (-1.,-1.),
-           Point<2> (+1.,-1.),
-           Point<2> (-1.,+1.),
-           Point<2> (+1.,+1.),
-           Point<2> (-1.,+3.),
-           Point<2> (+1.,+3.),
-        };
-    std::vector<Point<2> > vertices (&vertices_1[0], &vertices_1[8]);
-
-    std::vector<CellData<2> > cells (2, CellData<2>());
-
-    /* cell 0 */
-    int cell_vertices_0[GeometryInfo<2>::vertices_per_cell] = {0, 1,  2,  3};
-
-    /* cell 1 */
-    int cell_vertices_1[2][GeometryInfo<2>::vertices_per_cell]
-      = {
-        {4,5,6,7},
-        {7,6,5,4},
-      };
-
-    for (unsigned int j=0;j<GeometryInfo<2>::vertices_per_cell;++j) {
+  Point<2> vertices_1[]
+  =
+  {
+    Point<2> (-1.,-3.),
+    Point<2> (+1.,-3.),
+    Point<2> (-1.,-1.),
+    Point<2> (+1.,-1.),
+    Point<2> (-1.,+1.),
+    Point<2> (+1.,+1.),
+    Point<2> (-1.,+3.),
+    Point<2> (+1.,+3.),
+  };
+  std::vector<Point<2> > vertices (&vertices_1[0], &vertices_1[8]);
+
+  std::vector<CellData<2> > cells (2, CellData<2>());
+
+  /* cell 0 */
+  int cell_vertices_0[GeometryInfo<2>::vertices_per_cell] = {0, 1,  2,  3};
+
+  /* cell 1 */
+  int cell_vertices_1[2][GeometryInfo<2>::vertices_per_cell]
+  =
+  {
+    {4,5,6,7},
+    {7,6,5,4},
+  };
+
+  for (unsigned int j=0; j<GeometryInfo<2>::vertices_per_cell; ++j)
+    {
       cells[0].vertices[j] = cell_vertices_0[j];
       cells[1].vertices[j] = cell_vertices_1[orientation][j];
     }
-    cells[0].material_id = 0;
-    cells[1].material_id = 0;
+  cells[0].material_id = 0;
+  cells[1].material_id = 0;
 
-    triangulation.create_triangulation(vertices, cells, SubCellData());
+  triangulation.create_triangulation(vertices, cells, SubCellData());
 
-    Triangulation<2>::cell_iterator cell_1 = triangulation.begin();
-    Triangulation<2>::cell_iterator cell_2 = cell_1++;
-    Triangulation<2>::face_iterator face_1;
-    Triangulation<2>::face_iterator face_2;
+  Triangulation<2>::cell_iterator cell_1 = triangulation.begin();
+  Triangulation<2>::cell_iterator cell_2 = cell_1++;
+  Triangulation<2>::face_iterator face_1;
+  Triangulation<2>::face_iterator face_2;
 
-    // Look for the two outermost faces:
-    for (unsigned int j=0;j<GeometryInfo<2>::faces_per_cell;++j) {
+  // Look for the two outermost faces:
+  for (unsigned int j=0; j<GeometryInfo<2>::faces_per_cell; ++j)
+    {
       if (cell_1->face(j)->center()(1) > 2.9)
         face_1 = cell_1->face(j);
       if (cell_2->face(j)->center()(1) < -2.9)
         face_2 = cell_2->face(j);
     }
-    face_1->set_boundary_indicator(42);
-    face_2->set_boundary_indicator(43);
+  face_1->set_boundary_indicator(42);
+  face_2->set_boundary_indicator(43);
 
-    triangulation.refine_global(1);
+  triangulation.refine_global(1);
 }
 
 
 /* The 3D case */
 void generate_grid(Triangulation<3> &triangulation, int orientation)
 {
-    Point<3> vertices_1[]
-      = {
-           Point<3> (-1.,-1.,-3.),
-           Point<3> (+1.,-1.,-3.),
-           Point<3> (-1.,+1.,-3.),
-           Point<3> (+1.,+1.,-3.),
-           Point<3> (-1.,-1.,-1.),
-           Point<3> (+1.,-1.,-1.),
-           Point<3> (-1.,+1.,-1.),
-           Point<3> (+1.,+1.,-1.),
-           Point<3> (-1.,-1.,+1.),
-           Point<3> (+1.,-1.,+1.),
-           Point<3> (-1.,+1.,+1.),
-           Point<3> (+1.,+1.,+1.),
-           Point<3> (-1.,-1.,+3.),
-           Point<3> (+1.,-1.,+3.),
-           Point<3> (-1.,+1.,+3.),
-           Point<3> (+1.,+1.,+3.)
-        };
-    std::vector<Point<3> > vertices (&vertices_1[0], &vertices_1[16]);
-
-    std::vector<CellData<3> > cells (2, CellData<3>());
-
-    /* cell 0 */
-    int cell_vertices_0[GeometryInfo<3>::vertices_per_cell] = {0, 1,  2,  3,  4,  5,  6,  7};
-
-    /* cell 1 */
-    int cell_vertices_1[8][GeometryInfo<3>::vertices_per_cell]
-      = {
-        {8,9,10,11,12,13,14,15},
-        {9,11,8,10,13,15,12,14},
-        {11,10,9,8,15,14,13,12},
-        {10,8,11,9,14,12,15,13},
-        {13,12,15,14,9,8,11,10},
-        {12,14,13,15,8,10,9,11},
-        {14,15,12,13,10,11,8,9},
-        {15,13,14,12,11,9,10,8},
-      };
-
-    for (unsigned int j=0;j<GeometryInfo<3>::vertices_per_cell;++j) {
+  Point<3> vertices_1[]
+  =
+  {
+    Point<3> (-1.,-1.,-3.),
+    Point<3> (+1.,-1.,-3.),
+    Point<3> (-1.,+1.,-3.),
+    Point<3> (+1.,+1.,-3.),
+    Point<3> (-1.,-1.,-1.),
+    Point<3> (+1.,-1.,-1.),
+    Point<3> (-1.,+1.,-1.),
+    Point<3> (+1.,+1.,-1.),
+    Point<3> (-1.,-1.,+1.),
+    Point<3> (+1.,-1.,+1.),
+    Point<3> (-1.,+1.,+1.),
+    Point<3> (+1.,+1.,+1.),
+    Point<3> (-1.,-1.,+3.),
+    Point<3> (+1.,-1.,+3.),
+    Point<3> (-1.,+1.,+3.),
+    Point<3> (+1.,+1.,+3.)
+  };
+  std::vector<Point<3> > vertices (&vertices_1[0], &vertices_1[16]);
+
+  std::vector<CellData<3> > cells (2, CellData<3>());
+
+  /* cell 0 */
+  int cell_vertices_0[GeometryInfo<3>::vertices_per_cell] = {0, 1,  2,  3,  4,  5,  6,  7};
+
+  /* cell 1 */
+  int cell_vertices_1[8][GeometryInfo<3>::vertices_per_cell]
+  =
+  {
+    {8,9,10,11,12,13,14,15},
+    {9,11,8,10,13,15,12,14},
+    {11,10,9,8,15,14,13,12},
+    {10,8,11,9,14,12,15,13},
+    {13,12,15,14,9,8,11,10},
+    {12,14,13,15,8,10,9,11},
+    {14,15,12,13,10,11,8,9},
+    {15,13,14,12,11,9,10,8},
+  };
+
+  for (unsigned int j=0; j<GeometryInfo<3>::vertices_per_cell; ++j)
+    {
       cells[0].vertices[j] = cell_vertices_0[j];
       cells[1].vertices[j] = cell_vertices_1[orientation][j];
     }
-    cells[0].material_id = 0;
-    cells[1].material_id = 0;
+  cells[0].material_id = 0;
+  cells[1].material_id = 0;
 
 
-    triangulation.create_triangulation(vertices, cells, SubCellData());
+  triangulation.create_triangulation(vertices, cells, SubCellData());
 
-    Triangulation<3>::cell_iterator cell_1 = triangulation.begin();
-    Triangulation<3>::cell_iterator cell_2 = cell_1++;
-    Triangulation<3>::face_iterator face_1;
-    Triangulation<3>::face_iterator face_2;
+  Triangulation<3>::cell_iterator cell_1 = triangulation.begin();
+  Triangulation<3>::cell_iterator cell_2 = cell_1++;
+  Triangulation<3>::face_iterator face_1;
+  Triangulation<3>::face_iterator face_2;
 
-    // Look for the two outermost faces:
-    for (unsigned int j=0;j<GeometryInfo<3>::faces_per_cell;++j) {
+  // Look for the two outermost faces:
+  for (unsigned int j=0; j<GeometryInfo<3>::faces_per_cell; ++j)
+    {
       if (cell_1->face(j)->center()(2) > 2.9)
         face_1 = cell_1->face(j);
       if (cell_2->face(j)->center()(2) < -2.9)
         face_2 = cell_2->face(j);
     }
-    face_1->set_boundary_indicator(42);
-    face_2->set_boundary_indicator(43);
+  face_1->set_boundary_indicator(42);
+  face_2->set_boundary_indicator(43);
 
-    triangulation.refine_global(1);
+  triangulation.refine_global(1);
 }
 
 
@@ -181,20 +189,20 @@ void print_match(const FaceIterator &face_1,
   static const int dim = FaceIterator::AccessorType::dimension;
 
   deallog << "face 1";
-  for (unsigned int j=0;j<GeometryInfo<dim>::vertices_per_face;++j)
+  for (unsigned int j=0; j<GeometryInfo<dim>::vertices_per_face; ++j)
     deallog << " :: " << face_1->vertex(j);
   deallog << std::endl;
 
   deallog << "face 2";
-  for (unsigned int j=0;j<GeometryInfo<dim>::vertices_per_face;++j)
+  for (unsigned int j=0; j<GeometryInfo<dim>::vertices_per_face; ++j)
     deallog << " :: " << face_2->vertex(j);
   deallog << std::endl;
 
   deallog << "orientation: " << orientation[0]
-            << "  flip: " << orientation[1]
-            << "  rotation: " << orientation[2]
-            << std::endl
-            << std::endl;
+          << "  flip: " << orientation[1]
+          << "  rotation: " << orientation[2]
+          << std::endl
+          << std::endl;
 }
 
 int main()
@@ -207,71 +215,73 @@ int main()
 
   deallog << "Test for 2D: Hypercube" << std::endl << std::endl;
 
-  for(int i = 0; i < 2; ++i) {
-    // Generate a triangulation and match:
-    Triangulation<2> triangulation;
+  for (int i = 0; i < 2; ++i)
+    {
+      // Generate a triangulation and match:
+      Triangulation<2> triangulation;
 
-    generate_grid(triangulation, i);
+      generate_grid(triangulation, i);
 
-    typedef Triangulation<2>::face_iterator FaceIterator;
-    typedef std::map<FaceIterator, std::pair<FaceIterator, std::bitset<3> > > FaceMap;
-    FaceMap test = GridTools::collect_periodic_face_pairs (triangulation, 42, 43, 1,
-                                                           dealii::Tensor<1,2>());
+      typedef Triangulation<2>::face_iterator FaceIterator;
+      typedef std::map<FaceIterator, std::pair<FaceIterator, std::bitset<3> > > FaceMap;
+      FaceMap test = GridTools::collect_periodic_face_pairs (triangulation, 42, 43, 1,
+                                                             dealii::Tensor<1,2>());
 
-    deallog << "Triangulation: " << i << std::endl;
-    deallog << "Coarse match: " << test.size() << std::endl;
+      deallog << "Triangulation: " << i << std::endl;
+      deallog << "Coarse match: " << test.size() << std::endl;
 
-    for (FaceMap::iterator facepair = test.begin(); facepair != test.end(); ++facepair)
-      print_match(facepair->first, facepair->second.first, facepair->second.second);
+      for (FaceMap::iterator facepair = test.begin(); facepair != test.end(); ++facepair)
+        print_match(facepair->first, facepair->second.first, facepair->second.second);
 
 
-    typedef Triangulation<2>::active_face_iterator FaceIterator2;
-    typedef std::map<FaceIterator2, std::pair<FaceIterator2, std::bitset<3> > > FaceMap2;
-    FaceMap2 test2 = GridTools::collect_periodic_face_pairs (triangulation.begin_active_face(),
-                                                            triangulation.end_face(),
-                                                            42, 43,
-                                                            1,
-                                                            dealii::Tensor<1,2>());
+      typedef Triangulation<2>::active_face_iterator FaceIterator2;
+      typedef std::map<FaceIterator2, std::pair<FaceIterator2, std::bitset<3> > > FaceMap2;
+      FaceMap2 test2 = GridTools::collect_periodic_face_pairs (triangulation.begin_active_face(),
+                                                               triangulation.end_face(),
+                                                               42, 43,
+                                                               1,
+                                                               dealii::Tensor<1,2>());
 
-    deallog << "Fine match: " << test2.size() << std::endl;
+      deallog << "Fine match: " << test2.size() << std::endl;
 
-    for (FaceMap2::iterator facepair = test2.begin(); facepair != test2.end(); ++facepair)
-      print_match(facepair->first, facepair->second.first, facepair->second.second);
-  }
+      for (FaceMap2::iterator facepair = test2.begin(); facepair != test2.end(); ++facepair)
+        print_match(facepair->first, facepair->second.first, facepair->second.second);
+    }
 
   deallog << "Test for 3D: Hypercube" << std::endl << std::endl;
 
-  for(int i = 0; i < 8; ++i) {
-    // Generate a triangulation and match:
-    Triangulation<3> triangulation;
+  for (int i = 0; i < 8; ++i)
+    {
+      // Generate a triangulation and match:
+      Triangulation<3> triangulation;
 
-    generate_grid(triangulation, i);
+      generate_grid(triangulation, i);
 
-    typedef Triangulation<3>::face_iterator FaceIterator;
-    typedef std::map<FaceIterator, std::pair<FaceIterator, std::bitset<3> > > FaceMap;
-    FaceMap test = GridTools::collect_periodic_face_pairs (triangulation, 42, 43, 2,
-                                                           dealii::Tensor<1,3>());
+      typedef Triangulation<3>::face_iterator FaceIterator;
+      typedef std::map<FaceIterator, std::pair<FaceIterator, std::bitset<3> > > FaceMap;
+      FaceMap test = GridTools::collect_periodic_face_pairs (triangulation, 42, 43, 2,
+                                                             dealii::Tensor<1,3>());
 
-    deallog << "Triangulation: " << i << std::endl;
-    deallog << "Coarse match: " << test.size() << std::endl;
+      deallog << "Triangulation: " << i << std::endl;
+      deallog << "Coarse match: " << test.size() << std::endl;
 
-    for (FaceMap::iterator facepair = test.begin(); facepair != test.end(); ++facepair)
-      print_match(facepair->first, facepair->second.first, facepair->second.second);
+      for (FaceMap::iterator facepair = test.begin(); facepair != test.end(); ++facepair)
+        print_match(facepair->first, facepair->second.first, facepair->second.second);
 
 
-    typedef Triangulation<3>::active_face_iterator FaceIterator2;
-    typedef std::map<FaceIterator2, std::pair<FaceIterator2, std::bitset<3> > > FaceMap2;
-    FaceMap2 test2 = GridTools::collect_periodic_face_pairs (triangulation.begin_active_face(),
-                                                            triangulation.end_face(),
-                                                            42, 43,
-                                                            2,
-                                                            dealii::Tensor<1,3>());
+      typedef Triangulation<3>::active_face_iterator FaceIterator2;
+      typedef std::map<FaceIterator2, std::pair<FaceIterator2, std::bitset<3> > > FaceMap2;
+      FaceMap2 test2 = GridTools::collect_periodic_face_pairs (triangulation.begin_active_face(),
+                                                               triangulation.end_face(),
+                                                               42, 43,
+                                                               2,
+                                                               dealii::Tensor<1,3>());
 
-    deallog << "Fine match: " << test2.size() << std::endl;
+      deallog << "Fine match: " << test2.size() << std::endl;
 
-    for (FaceMap2::iterator facepair = test2.begin(); facepair != test2.end(); ++facepair)
-      print_match(facepair->first, facepair->second.first, facepair->second.second);
-  }
+      for (FaceMap2::iterator facepair = test2.begin(); facepair != test2.end(); ++facepair)
+        print_match(facepair->first, facepair->second.first, facepair->second.second);
+    }
 
   return 0;
 }
index c2f0f5d1994a6343d3bec9407e85d143018900a8..4b04d096039611d5274f453d6b7dc5e2d90b2a58 100644 (file)
@@ -42,58 +42,58 @@ int main ()
   const double outer_radius=5.;
   GridGenerator::hyper_shell(tria, origin, inner_radius, outer_radius, 8);
   tria.refine_global(2);
-  
-                                  // build up a map of vertex indices
-                                  // of boundary vertices to the new
-                                  // boundary points
+
+  // build up a map of vertex indices
+  // of boundary vertices to the new
+  // boundary points
   std::map<types::global_dof_index,Point<dim> > new_points;
-  
-                                  // new center and new radius
-                                  // of the inner circle.
+
+  // new center and new radius
+  // of the inner circle.
   const Point<dim> n_center(0,-1);
   const double n_radius=0.5;
 
   Triangulation<dim>::cell_iterator cell=tria.begin_active(),
-                                            endc=tria.end();
+                                    endc=tria.end();
   Triangulation<dim>::face_iterator face;
   for (; cell!=endc; ++cell)
     {
       if (cell->at_boundary())
-       for (unsigned int face_no=0; face_no<GeometryInfo<dim>::faces_per_cell; ++face_no)
-         {
-           face=cell->face(face_no);
-           if (face->at_boundary())
-             for (unsigned int vertex_no=0;
-                  vertex_no<GeometryInfo<dim>::vertices_per_face; ++vertex_no)
-               {
-                 const Point<dim> &v=face->vertex(vertex_no);
-                 if (std::fabs(std::sqrt(v.square())-outer_radius)<1e-12)
-                   {
-                                                      // leave the
-                                                      // point, where
-                                                      // they are.
-                     new_points.insert(std::pair<types::global_dof_index, Point<dim> > (
-                       face->vertex_index(vertex_no), v));
-                   }
-                 else if (std::fabs(std::sqrt(v.square())-inner_radius)<1e-12)
-                   {
-                                                      // move the
-                                                      // center of
-                                                      // the inner
-                                                      // circle to
-                                                      // (-1,0) and
-                                                      // take half
-                                                      // the radius
-                                                      // of the
-                                                      // circle.
-                     new_points.insert(std::pair<types::global_dof_index, Point<dim> > (
-                       face->vertex_index(vertex_no), n_radius/inner_radius*v+n_center));
-                     face->set_boundary_indicator(1);
-                   }
-                 else
-                   Assert(false, ExcInternalError());
-               }  
-         }
+        for (unsigned int face_no=0; face_no<GeometryInfo<dim>::faces_per_cell; ++face_no)
+          {
+            face=cell->face(face_no);
+            if (face->at_boundary())
+              for (unsigned int vertex_no=0;
+                   vertex_no<GeometryInfo<dim>::vertices_per_face; ++vertex_no)
+                {
+                  const Point<dim> &v=face->vertex(vertex_no);
+                  if (std::fabs(std::sqrt(v.square())-outer_radius)<1e-12)
+                    {
+                      // leave the
+                      // point, where
+                      // they are.
+                      new_points.insert(std::pair<types::global_dof_index, Point<dim> > (
+                                          face->vertex_index(vertex_no), v));
+                    }
+                  else if (std::fabs(std::sqrt(v.square())-inner_radius)<1e-12)
+                    {
+                      // move the
+                      // center of
+                      // the inner
+                      // circle to
+                      // (-1,0) and
+                      // take half
+                      // the radius
+                      // of the
+                      // circle.
+                      new_points.insert(std::pair<types::global_dof_index, Point<dim> > (
+                                          face->vertex_index(vertex_no), n_radius/inner_radius*v+n_center));
+                      face->set_boundary_indicator(1);
+                    }
+                  else
+                    Assert(false, ExcInternalError());
+                }
+          }
     }
 
   GridGenerator::laplace_transformation (tria, new_points);
@@ -105,6 +105,6 @@ int main ()
   grid_out.write_eps(tria, eps_stream2, &mapping);
 
   tria.clear();
-  
+
   return 0;
 }
index f38ca31b9cf88fc21aa5ad316e843e862c095dcc..e9880aa74cd468f5d7764b8695e6b7fe0a0c32ec 100644 (file)
@@ -40,14 +40,14 @@ int main ()
   tria.set_boundary(0, boundary);
   GridGenerator::cylinder(tria, 1, .7);
   tria.refine_global(2);
-  
-                                  // build up a map of vertex indices
-                                  // of boundary vertices to the new
-                                  // boundary points
+
+  // build up a map of vertex indices
+  // of boundary vertices to the new
+  // boundary points
   std::map<types::global_dof_index,Point<dim> > new_points;
-  
+
   Triangulation<dim>::active_cell_iterator cell=tria.begin_active(),
-                                          endc=tria.end();
+                                           endc=tria.end();
 
   for (cell=tria.begin_active(); cell!=endc; ++cell)
     if ((cell->center()[0]-.2)*(cell->center()[0]-.2) +
@@ -58,45 +58,45 @@ int main ()
 
   for (cell=tria.begin_active(); cell!=endc; ++cell)
     if ((cell->center()[0]-.2)*(cell->center()[0]-.2) +
-       (cell->center()[2]-cell->center()[1]/4)*(cell->center()[2]-cell->center()[1]/4)
-       < cell->diameter() * cell->diameter())
+        (cell->center()[2]-cell->center()[1]/4)*(cell->center()[2]-cell->center()[1]/4)
+        < cell->diameter() * cell->diameter())
       cell->set_refine_flag ();
     else
       cell->set_coarsen_flag ();
   tria.execute_coarsening_and_refinement();
 
-  
+
   Triangulation<dim>::face_iterator face;
   for (cell=tria.begin_active(); cell!=endc; ++cell)
     for (unsigned int face_no=0; face_no<GeometryInfo<dim>::faces_per_cell; ++face_no)
       {
-       face=cell->face(face_no);
-       if (face->at_boundary())
-         for (unsigned int vertex_no=0;
-              vertex_no<GeometryInfo<dim>::vertices_per_face; ++vertex_no)
-           {
-             const Point<dim> &old_vertex=face->vertex(vertex_no);
-
-             Point<dim> new_vertex (old_vertex[0],
-                                    old_vertex[1],
-                                    (old_vertex[0] <= 0 ?
-                                     old_vertex[2]/2 :
-                                     old_vertex[2]/(2+4*old_vertex[0]*old_vertex[0])));
-             
-             new_points[face->vertex_index(vertex_no)] = new_vertex;
-           }  
+        face=cell->face(face_no);
+        if (face->at_boundary())
+          for (unsigned int vertex_no=0;
+               vertex_no<GeometryInfo<dim>::vertices_per_face; ++vertex_no)
+            {
+              const Point<dim> &old_vertex=face->vertex(vertex_no);
+
+              Point<dim> new_vertex (old_vertex[0],
+                                     old_vertex[1],
+                                     (old_vertex[0] <= 0 ?
+                                      old_vertex[2]/2 :
+                                      old_vertex[2]/(2+4*old_vertex[0]*old_vertex[0])));
+
+              new_points[face->vertex_index(vertex_no)] = new_vertex;
+            }
       }
 
   GridGenerator::laplace_transformation (tria, new_points);
-    
-  
+
+
   GridOut grid_out;
   std::ofstream out("grid_transform_3d/output");
   out.precision (5);
   out << std::fixed;
   grid_out.write_gnuplot(tria, out);
-  
+
   tria.clear();
-  
+
   return 0;
 }
index 97b34946daef8a7c9d6976aa451909ce442d5c64..e5470346fafb84d70f2bf589b306aeccd5fe6fe7 100644 (file)
 template<int dim>
 void test()
 {
-                                   // create 3 triangulations
+  // create 3 triangulations
   Triangulation<dim> tria[3];
 
   GridGenerator::hyper_cube (tria[0]);
   tria[0].refine_global (1);
-  
+
   GridGenerator::hyper_cube (tria[1]);
   GridTools::scale (2, tria[1]);
   tria[1].refine_global (2);
@@ -47,7 +47,7 @@ void test()
       GridGenerator::hyper_cube (tria[2]);
       GridTools::shift (Point<dim>(2.), tria[2]);
     }
-      
+
   tria[2].refine_global (3);
 
   for (unsigned int i=0; i<3; ++i)
@@ -57,7 +57,7 @@ void test()
                 ==
                 (i == j),
                 ExcInternalError());
-        
+
         deallog << "meshes " << i << " and " << j << ": "
                 << (GridTools::have_same_coarse_mesh (tria[i], tria[j])
                     ?
index 004b59b98527ba8137f9ffca8e9d4f2ba3f2a69a..a0d5d28773b264b58399a7160352068a21c2d6bc 100644 (file)
 template<int dim>
 void test()
 {
-                                   // create 3 triangulations
+  // create 3 triangulations
   Triangulation<dim> tria[3];
 
   GridGenerator::hyper_cube (tria[0]);
   tria[0].refine_global (1);
-  
+
   GridGenerator::hyper_cube (tria[1]);
   GridTools::scale (2, tria[1]);
   tria[1].refine_global (2);
@@ -47,15 +47,15 @@ void test()
       GridGenerator::hyper_cube (tria[2]);
       GridTools::shift (Point<dim>(2.), tria[2]);
     }
-      
+
   tria[2].refine_global (3);
 
   DoFHandler<dim> dh0 (tria[0]);
   DoFHandler<dim> dh1 (tria[1]);
   DoFHandler<dim> dh2 (tria[2]);
-  
+
   DoFHandler<dim> *dof_handler[3] = { &dh0, &dh1, &dh2 };
-  
+
   for (unsigned int i=0; i<3; ++i)
     for (unsigned int j=0; j<3; ++j)
       {
@@ -63,7 +63,7 @@ void test()
                 ==
                 (i == j),
                 ExcInternalError());
-        
+
         deallog << "meshes " << i << " and " << j << ": "
                 << (GridTools::have_same_coarse_mesh (*dof_handler[i], *dof_handler[j])
                     ?
index cd42132b8aef0a17c80288d452740c249261fc0a..4eaa255a9172b3751b80e5309d295310f5965935 100644 (file)
 template<int dim>
 void test()
 {
-                                   // create 3 triangulations
+  // create 3 triangulations
   Triangulation<dim> tria[3];
 
   GridGenerator::hyper_cube (tria[0]);
   tria[0].refine_global (1);
-  
+
   GridGenerator::hyper_cube (tria[1]);
   GridTools::scale (2, tria[1]);
   tria[1].refine_global (2);
@@ -47,15 +47,15 @@ void test()
       GridGenerator::hyper_cube (tria[2]);
       GridTools::shift (Point<dim>(2.), tria[2]);
     }
-      
+
   tria[2].refine_global (3);
 
   hp::DoFHandler<dim> dh0 (tria[0]);
   hp::DoFHandler<dim> dh1 (tria[1]);
   hp::DoFHandler<dim> dh2 (tria[2]);
-  
+
   hp::DoFHandler<dim> *dof_handler[3] = { &dh0, &dh1, &dh2 };
-  
+
   for (unsigned int i=0; i<3; ++i)
     for (unsigned int j=0; j<3; ++j)
       {
@@ -63,7 +63,7 @@ void test()
                 ==
                 (i == j),
                 ExcInternalError());
-        
+
         deallog << "meshes " << i << " and " << j << ": "
                 << (GridTools::have_same_coarse_mesh (*dof_handler[i], *dof_handler[j])
                     ?
index 35239d73b61e08cee87ed7dc1e1e8d0c5650b1a2..0811cbb6d08ace71280b705a9c88c2ffd807a8fa 100644 (file)
 template<int dim>
 void test()
 {
-                                   // create 3 triangulations
+  // create 3 triangulations
   Triangulation<dim> tria[3];
 
   GridGenerator::hyper_cube (tria[0]);
   tria[0].refine_global (1);
-  
+
   GridGenerator::hyper_cube (tria[1]);
   GridTools::scale (2, tria[1]);
   tria[1].refine_global (2);
@@ -47,15 +47,15 @@ void test()
       GridGenerator::hyper_cube (tria[2]);
       GridTools::shift (Point<dim>(2.), tria[2]);
     }
-      
+
   tria[2].refine_global (3);
 
   MGDoFHandler<dim> dh0 (tria[0]);
   MGDoFHandler<dim> dh1 (tria[1]);
   MGDoFHandler<dim> dh2 (tria[2]);
-  
+
   MGDoFHandler<dim> *dof_handler[3] = { &dh0, &dh1, &dh2 };
-  
+
   for (unsigned int i=0; i<3; ++i)
     for (unsigned int j=0; j<3; ++j)
       {
@@ -63,7 +63,7 @@ void test()
                 ==
                 (i == j),
                 ExcInternalError());
-        
+
         deallog << "meshes " << i << " and " << j << ": "
                 << (GridTools::have_same_coarse_mesh (*dof_handler[i], *dof_handler[j])
                     ?
index 728fdd0ea501b16443a7a22762071fc5584a2b5d..f8904f1abcde3b3d67f48af6b20757bfd3aaaef4 100644 (file)
@@ -8,18 +8,18 @@
  */
 class Helmholtz
 {
-  public:
-    template<int dim, class MATRIX, class VECTOR>
-    void build_all(MATRIX& A,
-                  VECTOR& f,
-                  const DoFHandler<dim>& dof,
-                  const Quadrature<dim>& quadrature,
-                  const Function<dim>& rhs);
+public:
+  template<int dim, class MATRIX, class VECTOR>
+  void build_all(MATRIX &A,
+                 VECTOR &f,
+                 const DoFHandler<dim> &dof,
+                 const Quadrature<dim> &quadrature,
+                 const Function<dim> &rhs);
 
-    template<int dim, class MATRIX>
-    void build_mgmatrix(MGLevelObject<MATRIX>& A,
-                  const MGDoFHandler<dim>& dof,
-                  const Quadrature<dim>& quadrature);
+  template<int dim, class MATRIX>
+  void build_mgmatrix(MGLevelObject<MATRIX> &A,
+                      const MGDoFHandler<dim> &dof,
+                      const Quadrature<dim> &quadrature);
 };
 
 #include "helmholtz1.th"
index 1d31826e579afd14b3adb6bfc58c2b67cd8644bc..86809599b7911a94cc353ad54bfad70c4eb7d4db 100644 (file)
@@ -59,44 +59,44 @@ std::ofstream logfile("inhomogeneous_constraints/output");
 using namespace dealii;
 
 template <int dim>
-class LaplaceProblem 
+class LaplaceProblem
 {
-  public:
-    LaplaceProblem ();
-    ~LaplaceProblem ();
-
-    void run ();
-    
-  private:
-    void setup_system ();
-    void test_equality ();
-    void assemble_reference ();
-    void assemble_test_1 ();
-    void assemble_test_2 ();
-    void solve ();
-    void create_coarse_grid ();
-    void estimate_smoothness (Vector<float> &smoothness_indicators) const;
-    void postprocess ();
-
-    Triangulation<dim>   triangulation;
-
-    hp::DoFHandler<dim>      dof_handler;
-    hp::FECollection<dim>    fe_collection;
-    hp::QCollection<dim>     quadrature_collection;
-    hp::QCollection<dim-1>   face_quadrature_collection;
-
-    ConstraintMatrix     hanging_nodes_only;
-    ConstraintMatrix     test_all_constraints;
-
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> reference_matrix;
-    SparseMatrix<double> test_matrix;
-
-    Vector<double>       solution;
-    Vector<double>       reference_rhs;
-    Vector<double>       test_rhs;
-
-    const unsigned int max_degree;
+public:
+  LaplaceProblem ();
+  ~LaplaceProblem ();
+
+  void run ();
+
+private:
+  void setup_system ();
+  void test_equality ();
+  void assemble_reference ();
+  void assemble_test_1 ();
+  void assemble_test_2 ();
+  void solve ();
+  void create_coarse_grid ();
+  void estimate_smoothness (Vector<float> &smoothness_indicators) const;
+  void postprocess ();
+
+  Triangulation<dim>   triangulation;
+
+  hp::DoFHandler<dim>      dof_handler;
+  hp::FECollection<dim>    fe_collection;
+  hp::QCollection<dim>     quadrature_collection;
+  hp::QCollection<dim-1>   face_quadrature_collection;
+
+  ConstraintMatrix     hanging_nodes_only;
+  ConstraintMatrix     test_all_constraints;
+
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> reference_matrix;
+  SparseMatrix<double> test_matrix;
+
+  Vector<double>       solution;
+  Vector<double>       reference_rhs;
+  Vector<double>       test_rhs;
+
+  const unsigned int max_degree;
 };
 
 
@@ -104,18 +104,18 @@ class LaplaceProblem
 template <int dim>
 class BoundaryValues : public Function<dim>
 {
-  public:
-    BoundaryValues () : Function<dim> () {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const;
+public:
+  BoundaryValues () : Function<dim> () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const;
 };
 
 
 template <int dim>
 double
 BoundaryValues<dim>::value (const Point<dim>   &p,
-                          const unsigned int  /*component*/) const
+                            const unsigned int  /*component*/) const
 {
   double sum = 0;
   for (unsigned int d=0; d<dim; ++d)
@@ -127,18 +127,18 @@ BoundaryValues<dim>::value (const Point<dim>   &p,
 template <int dim>
 class RightHandSide : public Function<dim>
 {
-  public:
-    RightHandSide () : Function<dim> () {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const;
+public:
+  RightHandSide () : Function<dim> () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const;
 };
 
 
 template <int dim>
 double
 RightHandSide<dim>::value (const Point<dim>   &p,
-                          const unsigned int  /*component*/) const
+                           const unsigned int  /*component*/) const
 {
   double product = 1;
   for (unsigned int d=0; d<dim; ++d)
@@ -149,29 +149,29 @@ RightHandSide<dim>::value (const Point<dim>   &p,
 
 template <int dim>
 LaplaceProblem<dim>::LaplaceProblem ()
-               :
-               dof_handler (triangulation),
-               max_degree (5)
+  :
+  dof_handler (triangulation),
+  max_degree (5)
 {
   if (dim == 2)
     for (unsigned int degree=2; degree<=max_degree; ++degree)
       {
-       fe_collection.push_back (FE_Q<dim>(degree));
-       quadrature_collection.push_back (QGauss<dim>(degree+1));
-       face_quadrature_collection.push_back (QGauss<dim-1>(degree+1));
+        fe_collection.push_back (FE_Q<dim>(degree));
+        quadrature_collection.push_back (QGauss<dim>(degree+1));
+        face_quadrature_collection.push_back (QGauss<dim-1>(degree+1));
       }
   else
     for (unsigned int degree=1; degree<max_degree-1; ++degree)
       {
-       fe_collection.push_back (FE_Q<dim>(degree));
-       quadrature_collection.push_back (QGauss<dim>(degree+1));
-       face_quadrature_collection.push_back (QGauss<dim-1>(degree+1));
+        fe_collection.push_back (FE_Q<dim>(degree));
+        quadrature_collection.push_back (QGauss<dim>(degree+1));
+        face_quadrature_collection.push_back (QGauss<dim-1>(degree+1));
       }
 }
 
 
 template <int dim>
-LaplaceProblem<dim>::~LaplaceProblem () 
+LaplaceProblem<dim>::~LaplaceProblem ()
 {
   dof_handler.clear ();
 }
@@ -190,41 +190,41 @@ void LaplaceProblem<dim>::setup_system ()
   test_all_constraints.clear ();
 
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          hanging_nodes_only);
+                                           hanging_nodes_only);
   hanging_nodes_only.close ();
 
-                                  // add boundary conditions as inhomogeneous
-                                  // constraints here, do it after having
-                                  // added the hanging node constraints in
-                                  // order to be consistent and skip dofs
-                                  // that are already constrained (i.e., are
-                                  // hanging nodes on the boundary in 3D). In
-                                  // contrast to step-27, we choose a sine
-                                  // function.
+  // add boundary conditions as inhomogeneous
+  // constraints here, do it after having
+  // added the hanging node constraints in
+  // order to be consistent and skip dofs
+  // that are already constrained (i.e., are
+  // hanging nodes on the boundary in 3D). In
+  // contrast to step-27, we choose a sine
+  // function.
   {
     test_all_constraints.merge (hanging_nodes_only);
     std::map<types::global_dof_index,double> boundary_values;
     VectorTools::interpolate_boundary_values (dof_handler,
-                                             0,
-                                             BoundaryValues<dim>(),
-                                             boundary_values);
+                                              0,
+                                              BoundaryValues<dim>(),
+                                              boundary_values);
     std::map<types::global_dof_index,double>::const_iterator boundary_value = boundary_values.begin();
     for ( ; boundary_value !=boundary_values.end(); ++boundary_value)
       {
-       if (!test_all_constraints.is_constrained(boundary_value->first))
-         {
-           test_all_constraints.add_line(boundary_value->first);
-           test_all_constraints.set_inhomogeneity (boundary_value->first, 
-                                                   boundary_value->second);
-         }
+        if (!test_all_constraints.is_constrained(boundary_value->first))
+          {
+            test_all_constraints.add_line(boundary_value->first);
+            test_all_constraints.set_inhomogeneity (boundary_value->first,
+                                                    boundary_value->second);
+          }
       }
   }
   test_all_constraints.close ();
 
   CompressedSimpleSparsityPattern csp (dof_handler.n_dofs(),
-                                      dof_handler.n_dofs());
+                                       dof_handler.n_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, csp,
-                                  hanging_nodes_only, true);
+                                   hanging_nodes_only, true);
   sparsity_pattern.copy_from (csp);
 
   reference_matrix.reinit (sparsity_pattern);
@@ -233,44 +233,44 @@ void LaplaceProblem<dim>::setup_system ()
 
 
 
-                                  // test whether we are equal with the
-                                  // standard matrix and right hand side
+// test whether we are equal with the
+// standard matrix and right hand side
 template <int dim>
 void LaplaceProblem<dim>::test_equality ()
 {
-                                  // need to manually go through the
-                                  // matrix, since we can have different
-                                  // entries in constrained lines.
+  // need to manually go through the
+  // matrix, since we can have different
+  // entries in constrained lines.
   for (unsigned int i=0; i<reference_matrix.m(); ++i)
     {
       SparseMatrix<double>::const_iterator reference = reference_matrix.begin(i);
       SparseMatrix<double>::iterator test = test_matrix.begin(i);
       if (test_all_constraints.is_constrained(i) == false)
-       {
-         for ( ; test != test_matrix.end(i); ++test, ++reference)
-             test->value() -= reference->value();
-       }
+        {
+          for ( ; test != test_matrix.end(i); ++test, ++reference)
+            test->value() -= reference->value();
+        }
       else
-       for ( ; test != test_matrix.end(i); ++test)
-         test->value() = 0;
+        for ( ; test != test_matrix.end(i); ++test)
+          test->value() = 0;
     }
 
-  deallog << "  Matrix difference norm: " 
-         << test_matrix.frobenius_norm() << std::endl;
+  deallog << "  Matrix difference norm: "
+          << test_matrix.frobenius_norm() << std::endl;
   Assert (test_matrix.frobenius_norm() < 1e-13, ExcInternalError());
 
-                                  // same here -- Dirichlet lines will have
-                                  // nonzero rhs, whereas we will have zero
-                                  // rhs when using inhomogeneous
-                                  // constraints.
+  // same here -- Dirichlet lines will have
+  // nonzero rhs, whereas we will have zero
+  // rhs when using inhomogeneous
+  // constraints.
   for (unsigned int i=0; i<reference_matrix.m(); ++i)
     if (test_all_constraints.is_constrained(i) == false)
       test_rhs(i) -= reference_rhs(i);
     else
       test_rhs(i) = 0;
 
-  deallog << "  RHS difference norm: " 
-         << test_rhs.l2_norm() << std::endl;
+  deallog << "  RHS difference norm: "
+          << test_rhs.l2_norm() << std::endl;
 
   Assert (test_rhs.l2_norm() < 1e-14, ExcInternalError());
 }
@@ -279,15 +279,15 @@ void LaplaceProblem<dim>::test_equality ()
 
 
 template <int dim>
-void LaplaceProblem<dim>::assemble_reference () 
+void LaplaceProblem<dim>::assemble_reference ()
 {
   reference_matrix = 0;
   reference_rhs = 0;
 
   hp::FEValues<dim> hp_fe_values (fe_collection,
-                                 quadrature_collection, 
-                                 update_values    |  update_gradients |
-                                 update_quadrature_points  |  update_JxW_values);
+                                  quadrature_collection,
+                                  update_values    |  update_gradients |
+                                  update_quadrature_points  |  update_JxW_values);
 
   const RightHandSide<dim> rhs_function;
 
@@ -295,10 +295,10 @@ void LaplaceProblem<dim>::assemble_reference ()
   Vector<double>       cell_rhs;
 
   std::vector<types::global_dof_index> local_dof_indices;
-  
+
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       const unsigned int   dofs_per_cell = cell->get_fe().dofs_per_cell;
@@ -310,75 +310,75 @@ void LaplaceProblem<dim>::assemble_reference ()
       cell_rhs = 0;
 
       hp_fe_values.reinit (cell);
-      
+
       const FEValues<dim> &fe_values = hp_fe_values.get_present_fe_values ();
 
       std::vector<double>  rhs_values (fe_values.n_quadrature_points);
       rhs_function.value_list (fe_values.get_quadrature_points(),
-                              rhs_values);
-      
+                               rhs_values);
+
       for (unsigned int q_point=0;
-          q_point<fe_values.n_quadrature_points;
-          ++q_point)
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         {
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += (fe_values.shape_grad(i,q_point) *
-                                  fe_values.shape_grad(j,q_point) *
-                                  fe_values.JxW(q_point));
-
-           cell_rhs(i) += (fe_values.shape_value(i,q_point) *
-                           rhs_values[q_point] *
-                           fe_values.JxW(q_point));
-         }
+           q_point<fe_values.n_quadrature_points;
+           ++q_point)
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += (fe_values.shape_grad(i,q_point) *
+                                   fe_values.shape_grad(j,q_point) *
+                                   fe_values.JxW(q_point));
+
+            cell_rhs(i) += (fe_values.shape_value(i,q_point) *
+                            rhs_values[q_point] *
+                            fe_values.JxW(q_point));
+          }
 
       local_dof_indices.resize (dofs_per_cell);
       cell->get_dof_indices (local_dof_indices);
 
       reference_matrix.add(local_dof_indices, cell_matrix);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       reference_rhs(local_dof_indices[i]) += cell_rhs(i);
+        reference_rhs(local_dof_indices[i]) += cell_rhs(i);
     }
 
   hanging_nodes_only.condense (reference_matrix, reference_rhs);
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           BoundaryValues<dim>(),
-                                           boundary_values);
+                                            0,
+                                            BoundaryValues<dim>(),
+                                            boundary_values);
   MatrixTools::apply_boundary_values (boundary_values,
-                                     reference_matrix,
-                                     solution,
-                                     reference_rhs);
+                                      reference_matrix,
+                                      solution,
+                                      reference_rhs);
 
-  deallog << "  Reference matrix nonzeros: " << reference_matrix.n_nonzero_elements() 
-         << ", actually: " << reference_matrix.n_actually_nonzero_elements (1e-10) 
-         << std::endl;
+  deallog << "  Reference matrix nonzeros: " << reference_matrix.n_nonzero_elements()
+          << ", actually: " << reference_matrix.n_actually_nonzero_elements (1e-10)
+          << std::endl;
 }
 
 
 
 template <int dim>
-void LaplaceProblem<dim>::assemble_test_1 () 
+void LaplaceProblem<dim>::assemble_test_1 ()
 {
   test_matrix = 0;
   test_rhs = 0;
 
   hp::FEValues<dim> hp_fe_values (fe_collection,
-                                 quadrature_collection, 
-                                 update_values    |  update_gradients |
-                                 update_quadrature_points  |  update_JxW_values);
+                                  quadrature_collection,
+                                  update_values    |  update_gradients |
+                                  update_quadrature_points  |  update_JxW_values);
 
   const RightHandSide<dim> rhs_function;
-  
+
   FullMatrix<double>   cell_matrix;
   Vector<double>       cell_rhs;
 
   std::vector<types::global_dof_index> local_dof_indices;
-  
+
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       const unsigned int   dofs_per_cell = cell->get_fe().dofs_per_cell;
@@ -390,41 +390,41 @@ void LaplaceProblem<dim>::assemble_test_1 ()
       cell_rhs = 0;
 
       hp_fe_values.reinit (cell);
-      
+
       const FEValues<dim> &fe_values = hp_fe_values.get_present_fe_values ();
 
       std::vector<double>  rhs_values (fe_values.n_quadrature_points);
       rhs_function.value_list (fe_values.get_quadrature_points(),
-                              rhs_values);
-      
+                               rhs_values);
+
       for (unsigned int q_point=0;
-          q_point<fe_values.n_quadrature_points;
-          ++q_point)
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         {
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += (fe_values.shape_grad(i,q_point) *
-                                  fe_values.shape_grad(j,q_point) *
-                                  fe_values.JxW(q_point));
-
-           cell_rhs(i) += (fe_values.shape_value(i,q_point) *
-                           rhs_values[q_point] *
-                           fe_values.JxW(q_point));
-         }
+           q_point<fe_values.n_quadrature_points;
+           ++q_point)
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += (fe_values.shape_grad(i,q_point) *
+                                   fe_values.shape_grad(j,q_point) *
+                                   fe_values.JxW(q_point));
+
+            cell_rhs(i) += (fe_values.shape_value(i,q_point) *
+                            rhs_values[q_point] *
+                            fe_values.JxW(q_point));
+          }
 
       local_dof_indices.resize (dofs_per_cell);
       cell->get_dof_indices (local_dof_indices);
 
       test_matrix.add(local_dof_indices, cell_matrix);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       test_rhs(local_dof_indices[i]) += cell_rhs(i);
-       
+        test_rhs(local_dof_indices[i]) += cell_rhs(i);
+
     }
 
   test_all_constraints.condense (test_matrix, test_rhs);
-  deallog << "  Test matrix 1 nonzeros: " << test_matrix.n_nonzero_elements() 
-         << ", actually: " << test_matrix.n_actually_nonzero_elements (1e-10) 
-         << std::endl;
+  deallog << "  Test matrix 1 nonzeros: " << test_matrix.n_nonzero_elements()
+          << ", actually: " << test_matrix.n_actually_nonzero_elements (1e-10)
+          << std::endl;
 
   test_equality();
 }
@@ -432,26 +432,26 @@ void LaplaceProblem<dim>::assemble_test_1 ()
 
 
 template <int dim>
-void LaplaceProblem<dim>::assemble_test_2 () 
+void LaplaceProblem<dim>::assemble_test_2 ()
 {
   test_matrix = 0;
   test_rhs = 0;
 
   hp::FEValues<dim> hp_fe_values (fe_collection,
-                                 quadrature_collection, 
-                                 update_values    |  update_gradients |
-                                 update_quadrature_points  |  update_JxW_values);
+                                  quadrature_collection,
+                                  update_values    |  update_gradients |
+                                  update_quadrature_points  |  update_JxW_values);
 
   const RightHandSide<dim> rhs_function;
-  
+
   FullMatrix<double>   cell_matrix;
   Vector<double>       cell_rhs;
 
   std::vector<types::global_dof_index> local_dof_indices;
-  
+
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       const unsigned int   dofs_per_cell = cell->get_fe().dofs_per_cell;
@@ -463,62 +463,62 @@ void LaplaceProblem<dim>::assemble_test_2 ()
       cell_rhs = 0;
 
       hp_fe_values.reinit (cell);
-      
+
       const FEValues<dim> &fe_values = hp_fe_values.get_present_fe_values ();
 
       std::vector<double>  rhs_values (fe_values.n_quadrature_points);
       rhs_function.value_list (fe_values.get_quadrature_points(),
-                              rhs_values);
-      
+                               rhs_values);
+
       for (unsigned int q_point=0;
-          q_point<fe_values.n_quadrature_points;
-          ++q_point)
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         {
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += (fe_values.shape_grad(i,q_point) *
-                                  fe_values.shape_grad(j,q_point) *
-                                  fe_values.JxW(q_point));
-
-           cell_rhs(i) += (fe_values.shape_value(i,q_point) *
-                           rhs_values[q_point] *
-                           fe_values.JxW(q_point));
-         }
+           q_point<fe_values.n_quadrature_points;
+           ++q_point)
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += (fe_values.shape_grad(i,q_point) *
+                                   fe_values.shape_grad(j,q_point) *
+                                   fe_values.JxW(q_point));
+
+            cell_rhs(i) += (fe_values.shape_value(i,q_point) *
+                            rhs_values[q_point] *
+                            fe_values.JxW(q_point));
+          }
 
       local_dof_indices.resize (dofs_per_cell);
       cell->get_dof_indices (local_dof_indices);
 
       test_all_constraints.distribute_local_to_global (cell_matrix,
-                                                      cell_rhs,
-                                                      local_dof_indices,
-                                                      test_matrix,
-                                                      test_rhs);
+                                                       cell_rhs,
+                                                       local_dof_indices,
+                                                       test_matrix,
+                                                       test_rhs);
     }
-  deallog << "  Test matrix 2 nonzeros: " << test_matrix.n_nonzero_elements() 
-         << ", actually: " << test_matrix.n_actually_nonzero_elements (1e-10) 
-         << std::endl;
+  deallog << "  Test matrix 2 nonzeros: " << test_matrix.n_nonzero_elements()
+          << ", actually: " << test_matrix.n_actually_nonzero_elements (1e-10)
+          << std::endl;
   test_equality();
 }
 
 
 
 template <int dim>
-void LaplaceProblem<dim>::solve () 
+void LaplaceProblem<dim>::solve ()
 {
   SolverControl           solver_control (reference_rhs.size(),
-                                         1e-8*reference_rhs.l2_norm());
+                                          1e-8*reference_rhs.l2_norm());
   SolverCG<>              cg (solver_control);
 
   PreconditionSSOR<> preconditioner;
   preconditioner.initialize(reference_matrix, 1.2);
 
   cg.solve (reference_matrix, solution, reference_rhs,
-           preconditioner);
+            preconditioner);
 
   Vector<double> solution_test (solution);
   hanging_nodes_only.distribute (solution);
 
-                               // test also distribute function
+  // test also distribute function
   test_all_constraints.distribute(solution_test);
   solution_test -= solution;
   deallog << "Distribute error: " << solution_test.l2_norm () << std::endl;
@@ -534,8 +534,8 @@ void LaplaceProblem<dim>::postprocess ()
     estimated_error_per_cell(i) = i;
 
   GridRefinement::refine_and_coarsen_fixed_number (triangulation,
-                                                  estimated_error_per_cell,
-                                                  0.3, 0.03);
+                                                   estimated_error_per_cell,
+                                                   0.3, 0.03);
   triangulation.execute_coarsening_and_refinement ();
 }
 
@@ -544,58 +544,60 @@ template <>
 void LaplaceProblem<2>::create_coarse_grid ()
 {
   const unsigned int dim = 2;
-  
+
   static const Point<2> vertices_1[]
     = {  Point<2> (-1.,   -1.),
          Point<2> (-1./2, -1.),
          Point<2> (0.,    -1.),
          Point<2> (+1./2, -1.),
          Point<2> (+1,    -1.),
-            
+
          Point<2> (-1.,   -1./2.),
          Point<2> (-1./2, -1./2.),
          Point<2> (0.,    -1./2.),
          Point<2> (+1./2, -1./2.),
          Point<2> (+1,    -1./2.),
-            
+
          Point<2> (-1.,   0.),
          Point<2> (-1./2, 0.),
          Point<2> (+1./2, 0.),
          Point<2> (+1,    0.),
-            
+
          Point<2> (-1.,   1./2.),
          Point<2> (-1./2, 1./2.),
          Point<2> (0.,    1./2.),
          Point<2> (+1./2, 1./2.),
          Point<2> (+1,    1./2.),
-            
+
          Point<2> (-1.,   1.),
          Point<2> (-1./2, 1.),
-         Point<2> (0.,    1.),                   
+         Point<2> (0.,    1.),
          Point<2> (+1./2, 1.),
-         Point<2> (+1,    1.)    };
+         Point<2> (+1,    1.)
+      };
   const unsigned int
-    n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
+  n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
   const std::vector<Point<dim> > vertices (&vertices_1[0],
                                            &vertices_1[n_vertices]);
   static const int cell_vertices[][GeometryInfo<dim>::vertices_per_cell]
-    = {{0, 1, 5, 6},
-       {1, 2, 6, 7},
-       {2, 3, 7, 8},
-       {3, 4, 8, 9},
-       {5, 6, 10, 11},
-       {8, 9, 12, 13},
-       {10, 11, 14, 15},
-       {12, 13, 17, 18},
-       {14, 15, 19, 20},
-       {15, 16, 20, 21},
-       {16, 17, 21, 22},
-       {17, 18, 22, 23}};
+  = {{0, 1, 5, 6},
+    {1, 2, 6, 7},
+    {2, 3, 7, 8},
+    {3, 4, 8, 9},
+    {5, 6, 10, 11},
+    {8, 9, 12, 13},
+    {10, 11, 14, 15},
+    {12, 13, 17, 18},
+    {14, 15, 19, 20},
+    {15, 16, 20, 21},
+    {16, 17, 21, 22},
+    {17, 18, 22, 23}
+  };
   const unsigned int
-    n_cells = sizeof(cell_vertices) / sizeof(cell_vertices[0]);
+  n_cells = sizeof(cell_vertices) / sizeof(cell_vertices[0]);
 
   std::vector<CellData<dim> > cells (n_cells, CellData<dim>());
-  for (unsigned int i=0; i<n_cells; ++i) 
+  for (unsigned int i=0; i<n_cells; ++i)
     {
       for (unsigned int j=0;
            j<GeometryInfo<dim>::vertices_per_cell;
@@ -605,8 +607,8 @@ void LaplaceProblem<2>::create_coarse_grid ()
     }
 
   triangulation.create_triangulation (vertices,
-                                    cells,
-                                    SubCellData());
+                                      cells,
+                                      SubCellData());
   triangulation.refine_global (2);
 }
 
@@ -621,28 +623,28 @@ void LaplaceProblem<3>::create_coarse_grid ()
 
 
 template <int dim>
-void LaplaceProblem<dim>::run () 
+void LaplaceProblem<dim>::run ()
 {
   for (unsigned int cycle=0; cycle<3; ++cycle)
     {
       if (cycle == 0)
-       create_coarse_grid ();
+        create_coarse_grid ();
 
       setup_system ();
 
       deallog << std::endl << std::endl
-             << "   Number of active cells:             "
-             << triangulation.n_active_cells()
-             << std::endl
-             << "   Number of degrees of freedom:       "
-             << dof_handler.n_dofs()
-             << std::endl
-             << "   Number of hanging node constraints: "
-             << hanging_nodes_only.n_constraints()
-             << std::endl
-             << "   Total number of constraints:        "
-             << test_all_constraints.n_constraints()
-             << std::endl;
+              << "   Number of active cells:             "
+              << triangulation.n_active_cells()
+              << std::endl
+              << "   Number of degrees of freedom:       "
+              << dof_handler.n_dofs()
+              << std::endl
+              << "   Number of hanging node constraints: "
+              << hanging_nodes_only.n_constraints()
+              << std::endl
+              << "   Total number of constraints:        "
+              << test_all_constraints.n_constraints()
+              << std::endl;
 
       assemble_reference ();
       assemble_test_1 ();
@@ -650,13 +652,13 @@ void LaplaceProblem<dim>::run ()
 
       solve ();
       if (cycle < 2)
-       postprocess ();
+        postprocess ();
     }
 }
 
 
-                                  // this function is copied verbatim from
-                                  // step-27
+// this function is copied verbatim from
+// step-27
 template <int dim>
 void
 LaplaceProblem<dim>::
@@ -668,135 +670,135 @@ estimate_smoothness (Vector<float> &smoothness_indicators) const
   std::vector<unsigned int>   k_vectors_magnitude;
   switch (dim)
     {
-      case 2:
-      {
-       for (unsigned int i=0; i<N; ++i)
-         for (unsigned int j=0; j<N; ++j)
-           if (!((i==0) && (j==0))
-               &&
-               (i*i + j*j < N*N))
-             {
-               k_vectors.push_back (Point<dim>(numbers::PI * i,
-                                               numbers::PI * j));
-               k_vectors_magnitude.push_back (i*i+j*j);
-             }
-       
-       break;
-      }
+    case 2:
+    {
+      for (unsigned int i=0; i<N; ++i)
+        for (unsigned int j=0; j<N; ++j)
+          if (!((i==0) && (j==0))
+              &&
+              (i*i + j*j < N*N))
+            {
+              k_vectors.push_back (Point<dim>(numbers::PI * i,
+                                              numbers::PI * j));
+              k_vectors_magnitude.push_back (i*i+j*j);
+            }
+
+      break;
+    }
 
-      case 3:
-      {
-       for (unsigned int i=0; i<N; ++i)
-         for (unsigned int j=0; j<N; ++j)
-           for (unsigned int k=0; k<N; ++k)
-             if (!((i==0) && (j==0) && (k==0))
-                 &&
-                 (i*i + j*j + k*k < N*N))
-               {
-                 k_vectors.push_back (Point<dim>(numbers::PI * i,
-                                                 numbers::PI * j,
-                                                 numbers::PI * k));
-                 k_vectors_magnitude.push_back (i*i+j*j+k*k);
-             }
-       
-       break;
-      }
-      
-      default:
-           Assert (false, ExcNotImplemented());
+    case 3:
+    {
+      for (unsigned int i=0; i<N; ++i)
+        for (unsigned int j=0; j<N; ++j)
+          for (unsigned int k=0; k<N; ++k)
+            if (!((i==0) && (j==0) && (k==0))
+                &&
+                (i*i + j*j + k*k < N*N))
+              {
+                k_vectors.push_back (Point<dim>(numbers::PI * i,
+                                                numbers::PI * j,
+                                                numbers::PI * k));
+                k_vectors_magnitude.push_back (i*i+j*j+k*k);
+              }
+
+      break;
+    }
+
+    default:
+      Assert (false, ExcNotImplemented());
     }
 
   const unsigned n_fourier_modes = k_vectors.size();
   std::vector<double> ln_k (n_fourier_modes);
   for (unsigned int i=0; i<n_fourier_modes; ++i)
     ln_k[i] = std::log (k_vectors[i].norm());
-  
+
   std::vector<Table<2,std::complex<double> > >
-    fourier_transform_matrices (fe_collection.size());
+  fourier_transform_matrices (fe_collection.size());
   QGauss<1>      base_quadrature (2);
   QIterated<dim> quadrature (base_quadrature, N);
 
   for (unsigned int fe=0; fe<fe_collection.size(); ++fe)
     {
       fourier_transform_matrices[fe].reinit (n_fourier_modes,
-                                            fe_collection[fe].dofs_per_cell);
+                                             fe_collection[fe].dofs_per_cell);
 
       for (unsigned int k=0; k<n_fourier_modes; ++k)
-       for (unsigned int j=0; j<fe_collection[fe].dofs_per_cell; ++j)
-         {
-           std::complex<double> sum = 0;
-           for (unsigned int q=0; q<quadrature.size(); ++q)
-             {
-               const Point<dim> x_q = quadrature.point(q);
-               sum += std::exp(std::complex<double>(0,1) *
-                               (k_vectors[k] * x_q)) *
-                      fe_collection[fe].shape_value(j,x_q) *
-                      quadrature.weight(q);
-             }
-           fourier_transform_matrices[fe](k,j)
-             = sum / std::pow(2*numbers::PI, 1.*dim/2);
-         }
+        for (unsigned int j=0; j<fe_collection[fe].dofs_per_cell; ++j)
+          {
+            std::complex<double> sum = 0;
+            for (unsigned int q=0; q<quadrature.size(); ++q)
+              {
+                const Point<dim> x_q = quadrature.point(q);
+                sum += std::exp(std::complex<double>(0,1) *
+                                (k_vectors[k] * x_q)) *
+                       fe_collection[fe].shape_value(j,x_q) *
+                       quadrature.weight(q);
+              }
+            fourier_transform_matrices[fe](k,j)
+              = sum / std::pow(2*numbers::PI, 1.*dim/2);
+          }
     }
 
   std::vector<std::complex<double> > fourier_coefficients (n_fourier_modes);
   Vector<double>                     local_dof_values;
 
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (unsigned int index=0; cell!=endc; ++cell, ++index)
     {
       local_dof_values.reinit (cell->get_fe().dofs_per_cell);
       cell->get_dof_values (solution, local_dof_values);
 
       for (unsigned int f=0; f<n_fourier_modes; ++f)
-       {
-         fourier_coefficients[f] = 0;
-         
-         for (unsigned int i=0; i<cell->get_fe().dofs_per_cell; ++i)
-           fourier_coefficients[f] += 
-             fourier_transform_matrices[cell->active_fe_index()](f,i)
-             *
-             local_dof_values(i);
-       }
+        {
+          fourier_coefficients[f] = 0;
+
+          for (unsigned int i=0; i<cell->get_fe().dofs_per_cell; ++i)
+            fourier_coefficients[f] +=
+              fourier_transform_matrices[cell->active_fe_index()](f,i)
+              *
+              local_dof_values(i);
+        }
 
       std::map<unsigned int, double> k_to_max_U_map;
       for (unsigned int f=0; f<n_fourier_modes; ++f)
-       if ((k_to_max_U_map.find (k_vectors_magnitude[f]) ==
-            k_to_max_U_map.end())
-           ||
-           (k_to_max_U_map[k_vectors_magnitude[f]] <
-            std::abs (fourier_coefficients[f])))
-         k_to_max_U_map[k_vectors_magnitude[f]]
-           = std::abs (fourier_coefficients[f]);
+        if ((k_to_max_U_map.find (k_vectors_magnitude[f]) ==
+             k_to_max_U_map.end())
+            ||
+            (k_to_max_U_map[k_vectors_magnitude[f]] <
+             std::abs (fourier_coefficients[f])))
+          k_to_max_U_map[k_vectors_magnitude[f]]
+            = std::abs (fourier_coefficients[f]);
       double  sum_1           = 0,
-             sum_ln_k        = 0,
-             sum_ln_k_square = 0,
-             sum_ln_U        = 0,
-             sum_ln_U_ln_k   = 0;
+              sum_ln_k        = 0,
+              sum_ln_k_square = 0,
+              sum_ln_U        = 0,
+              sum_ln_U_ln_k   = 0;
       for (unsigned int f=0; f<n_fourier_modes; ++f)
-       if (k_to_max_U_map[k_vectors_magnitude[f]] ==
-           std::abs (fourier_coefficients[f]))
-         {
-           sum_1 += 1;
-           sum_ln_k += ln_k[f];
-           sum_ln_k_square += ln_k[f]*ln_k[f];
-           sum_ln_U += std::log (std::abs (fourier_coefficients[f]));
-           sum_ln_U_ln_k += std::log (std::abs (fourier_coefficients[f])) *
-                            ln_k[f];
-         }
+        if (k_to_max_U_map[k_vectors_magnitude[f]] ==
+            std::abs (fourier_coefficients[f]))
+          {
+            sum_1 += 1;
+            sum_ln_k += ln_k[f];
+            sum_ln_k_square += ln_k[f]*ln_k[f];
+            sum_ln_U += std::log (std::abs (fourier_coefficients[f]));
+            sum_ln_U_ln_k += std::log (std::abs (fourier_coefficients[f])) *
+                             ln_k[f];
+          }
 
       const double mu
-       = (1./(sum_1*sum_ln_k_square - sum_ln_k*sum_ln_k)
-          *
-          (sum_ln_k*sum_ln_U - sum_1*sum_ln_U_ln_k));
+        = (1./(sum_1*sum_ln_k_square - sum_ln_k*sum_ln_k)
+           *
+           (sum_ln_k*sum_ln_U - sum_1*sum_ln_U_ln_k));
 
       smoothness_indicators(index) = mu - 1.*dim/2;
     }
 }
 
 
-int main () 
+int main ()
 {
   deallog << std::setprecision (2);
   logfile << std::setprecision (2);
index 2a066fbd84fa433e54cbf1a760af69de0aba1faf..7ae13f2362f3d7c7c26674eff53f8f5df8056802 100644 (file)
@@ -70,36 +70,36 @@ void test(bool use_inhomogeneity_for_rhs)
   cm.close();
   cm.print(logfile);
 
-  
+
   CompressedSimpleSparsityPattern csp(5,5);
-  for (unsigned int i=0;i<5;++i)
+  for (unsigned int i=0; i<5; ++i)
     csp.add(i,i);
-    
+
   SparsityPattern sp;
   sp.copy_from(csp);
   SparseMatrix<double> mat(sp);
   Vector<double> rhs(5);
 
   std::vector<types::global_dof_index> local_dofs;
-  for (unsigned int i=0;i<5;++i)
+  for (unsigned int i=0; i<5; ++i)
     local_dofs.push_back(i);
 
   FullMatrix<double> local_mat(5,5);
   Vector<double> local_vec(5);
-  for (unsigned int i=0;i<5;++i)
+  for (unsigned int i=0; i<5; ++i)
     local_mat(i,i)=2.0;
-  
+
   local_vec = 0;
 
   cm.distribute_local_to_global(local_mat, local_vec, local_dofs, mat, rhs, use_inhomogeneity_for_rhs);
 
   mat.print(logfile);
   rhs.print(logfile);
-  
+
 }
 
 
-int main () 
+int main ()
 {
   deallog << std::setprecision (2);
   logfile << std::setprecision (2);
@@ -109,7 +109,7 @@ int main ()
 
   // Use the constraints for the right-hand-side
   {
-    test(true);        
+    test(true);
   }
 
   // Don not use the constraints for the right-hand-side
index 9aa7ab18f1cc36f80078d1ec571a635793c828a7..5224966109258e0568517d38df901a9487f45f7f 100644 (file)
@@ -73,11 +73,11 @@ void test(bool use_inhomogeneity_for_rhs)
   cm.close();
   cm.print(logfile);
 
-  
+
   CompressedSimpleSparsityPattern csp(8,8);
-  for (unsigned int i=0;i<8;++i)
+  for (unsigned int i=0; i<8; ++i)
     csp.add(i,i);
-    
+
   SparsityPattern sp;
   sp.copy_from(csp);
   SparseMatrix<double> mat(sp);
@@ -86,19 +86,19 @@ void test(bool use_inhomogeneity_for_rhs)
   // "assemble":
 
   std::vector<types::global_dof_index> local_dofs1;
-  for (unsigned int i=0;i<5;++i)
+  for (unsigned int i=0; i<5; ++i)
     local_dofs1.push_back(i);
 
   std::vector<types::global_dof_index> local_dofs2;
   local_dofs2.push_back(1);
-  for (unsigned int i=1;i<5;++i)
+  for (unsigned int i=1; i<5; ++i)
     local_dofs2.push_back(3+i);
 
   FullMatrix<double> local_mat(5,5);
   Vector<double> local_vec(5);
-  for (unsigned int i=0;i<5;++i)
+  for (unsigned int i=0; i<5; ++i)
     local_mat(i,i)=2.0;
-  
+
   local_vec = 1;
 
   cm.distribute_local_to_global(local_mat, local_vec, local_dofs1, mat, rhs, use_inhomogeneity_for_rhs);
@@ -109,18 +109,18 @@ void test(bool use_inhomogeneity_for_rhs)
   rhs.print(logfile);
 
   Vector<double> solution(8);
-  for (unsigned int i=0;i<8;++i)
+  for (unsigned int i=0; i<8; ++i)
     {
       solution(i)=rhs(i)/mat(i,i);
     }
 
   solution.print(logfile);
   cm.distribute(solution);
-  solution.print(logfile);  
+  solution.print(logfile);
 }
 
 
-int main () 
+int main ()
 {
   deallog << std::setprecision (2);
   logfile << std::setprecision (2);
@@ -130,7 +130,7 @@ int main ()
 
   // Use the constraints for the right-hand-side
   {
-    test(true);        
+    test(true);
   }
 
   // Don not use the constraints for the right-hand-side
index c257afccdddfb1e6c6b5d77d6ae6f188ad1697cd..93c1ab1a412f6d5169b45803439e088111c42d14 100644 (file)
@@ -60,9 +60,9 @@ using namespace dealii;
 void test(bool use_constraint_matrix)
 {
   CompressedSimpleSparsityPattern csp(8,8);
-  for (unsigned int i=0;i<8;++i)
+  for (unsigned int i=0; i<8; ++i)
     csp.add(i,i);
-    
+
   SparsityPattern sp;
   sp.copy_from(csp);
   SparseMatrix<double> mat(sp);
@@ -72,25 +72,25 @@ void test(bool use_constraint_matrix)
   // "assemble":
 
   std::vector<types::global_dof_index> local_dofs1;
-  for (unsigned int i=0;i<5;++i)
+  for (unsigned int i=0; i<5; ++i)
     local_dofs1.push_back(i);
 
   std::vector<types::global_dof_index> local_dofs2;
   local_dofs2.push_back(1);
-  for (unsigned int i=1;i<5;++i)
+  for (unsigned int i=1; i<5; ++i)
     local_dofs2.push_back(3+i);
 
   FullMatrix<double> local_mat(5,5);
   Vector<double> local_vec(5);
-  for (unsigned int i=0;i<5;++i)
+  for (unsigned int i=0; i<5; ++i)
     local_mat(i,i)=2.0;
-  
+
   local_vec = 1;
 
   if (use_constraint_matrix == true)
     {
       ConstraintMatrix cm;
-      
+
       cm.add_line(1);
       cm.set_inhomogeneity(1, -5.0);
       cm.add_line(3);
@@ -107,40 +107,40 @@ void test(bool use_constraint_matrix)
   else
     {
       for (unsigned int i=0; i<5; i++)
-       {
-         mat.add (local_dofs1[i], local_dofs1[i], local_mat (i,i));
-         rhs (local_dofs1[i]) += local_vec (i);
-       }
+        {
+          mat.add (local_dofs1[i], local_dofs1[i], local_mat (i,i));
+          rhs (local_dofs1[i]) += local_vec (i);
+        }
 
       for (unsigned int i=0; i<5; i++)
-       {
-         mat.add (local_dofs2[i], local_dofs2[i], local_mat (i,i));
-         rhs (local_dofs2[i]) += local_vec (i);
-       }
+        {
+          mat.add (local_dofs2[i], local_dofs2[i], local_mat (i,i));
+          rhs (local_dofs2[i]) += local_vec (i);
+        }
 
       std::map<types::global_dof_index,double> boundary_values;
       boundary_values.insert (std::pair<types::global_dof_index,double>(1, -5.0));
       boundary_values.insert (std::pair<types::global_dof_index,double>(3, 2.0));
       boundary_values.insert (std::pair<types::global_dof_index,double>(4, 0.0));
       MatrixTools::apply_boundary_values (boundary_values,
-                                         mat,
-                                         solution,
-                                         rhs);
+                                          mat,
+                                          solution,
+                                          rhs);
     }
 
   mat.print(logfile);
   rhs.print(logfile);
 
-  for (unsigned int i=0;i<8;++i)
+  for (unsigned int i=0; i<8; ++i)
     {
       solution(i)=rhs(i)/mat(i,i);
     }
 
-  solution.print(logfile);  
+  solution.print(logfile);
 }
 
 
-int main () 
+int main ()
 {
   deallog << std::setprecision (2);
   logfile << std::setprecision (2);
@@ -150,7 +150,7 @@ int main ()
 
   // Use the constraints for the right-hand-side
   {
-    test(true);        
+    test(true);
   }
 
   // Don not use the constraints for the right-hand-side
index 1ba9b70ef11630f3d15ad4ad71868970ff6a8f77..8a51ed02bc52f8f8528aa89ccf891ec96112827a 100644 (file)
@@ -54,33 +54,33 @@ using namespace dealii;
 template <int dim>
 class AdvectionProblem
 {
-  public:
-    AdvectionProblem ();
-    ~AdvectionProblem ();
+public:
+  AdvectionProblem ();
+  ~AdvectionProblem ();
 
-    void run ();
+  void run ();
 
-  private:
-    void setup_system ();
-    void test_equality ();
-    void assemble_reference ();
-    void assemble_test_1 ();
-    void assemble_test_2 ();
+private:
+  void setup_system ();
+  void test_equality ();
+  void assemble_reference ();
+  void assemble_test_1 ();
+  void assemble_test_2 ();
 
-    Triangulation<dim>        triangulation;
+  Triangulation<dim>        triangulation;
 
-    DoFHandler<dim>           dof_handler;
-    FESystem<dim>             fe;
+  DoFHandler<dim>           dof_handler;
+  FESystem<dim>             fe;
 
-    ConstraintMatrix          hanging_nodes_only;
-    ConstraintMatrix          test_all_constraints;
+  ConstraintMatrix          hanging_nodes_only;
+  ConstraintMatrix          test_all_constraints;
 
-    BlockSparsityPattern      sparsity_pattern;
-    BlockSparseMatrix<double> reference_matrix;
-    BlockSparseMatrix<double> test_matrix;
+  BlockSparsityPattern      sparsity_pattern;
+  BlockSparseMatrix<double> reference_matrix;
+  BlockSparseMatrix<double> test_matrix;
 
-    BlockVector<double>       reference_rhs;
-    BlockVector<double>       test_rhs;
+  BlockVector<double>       reference_rhs;
+  BlockVector<double>       test_rhs;
 };
 
 
@@ -88,18 +88,18 @@ class AdvectionProblem
 template <int dim>
 class RightHandSide : public Function<dim>
 {
-  public:
-    RightHandSide () : Function<dim> () {}
+public:
+  RightHandSide () : Function<dim> () {}
 
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const;
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const;
 };
 
 
 template <int dim>
 double
 RightHandSide<dim>::value (const Point<dim>   &p,
-                          const unsigned int  /*component*/) const
+                           const unsigned int  /*component*/) const
 {
   double product = 1;
   for (unsigned int d=0; d<dim; ++d)
@@ -110,9 +110,9 @@ RightHandSide<dim>::value (const Point<dim>   &p,
 
 template <int dim>
 AdvectionProblem<dim>::AdvectionProblem ()
-               :
-                dof_handler (triangulation),
-               fe (FE_Q<dim>(2),2)
+  :
+  dof_handler (triangulation),
+  fe (FE_Q<dim>(2),2)
 {}
 
 
@@ -131,27 +131,27 @@ void AdvectionProblem<dim>::setup_system ()
   hanging_nodes_only.clear ();
   test_all_constraints.clear ();
 
-                                  // add boundary conditions as
-                                  // inhomogeneous constraints here.
+  // add boundary conditions as
+  // inhomogeneous constraints here.
   {
     std::map<types::global_dof_index,double> boundary_values;
     VectorTools::interpolate_boundary_values (dof_handler,
-                                             0,
-                                             ConstantFunction<dim>(1.,2),
-                                             boundary_values);
+                                              0,
+                                              ConstantFunction<dim>(1.,2),
+                                              boundary_values);
     std::map<types::global_dof_index,double>::const_iterator boundary_value =
       boundary_values.begin();
     for ( ; boundary_value !=boundary_values.end(); ++boundary_value)
       {
-       test_all_constraints.add_line(boundary_value->first);
-       test_all_constraints.set_inhomogeneity (boundary_value->first,
-                                               boundary_value->second);
+        test_all_constraints.add_line(boundary_value->first);
+        test_all_constraints.set_inhomogeneity (boundary_value->first,
+                                                boundary_value->second);
       }
   }
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          hanging_nodes_only);
+                                           hanging_nodes_only);
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          test_all_constraints);
+                                           test_all_constraints);
   hanging_nodes_only.close ();
   test_all_constraints.close ();
 
@@ -166,7 +166,7 @@ void AdvectionProblem<dim>::setup_system ()
   }
 
   DoFTools::make_sparsity_pattern (dof_handler, csp,
-                                  hanging_nodes_only, true);
+                                   hanging_nodes_only, true);
   sparsity_pattern.copy_from (csp);
 
   reference_matrix.reinit (sparsity_pattern);
@@ -181,57 +181,57 @@ void AdvectionProblem<dim>::setup_system ()
 
 
 
-                                  // test whether we are equal with the
-                                  // standard matrix and right hand side
+// test whether we are equal with the
+// standard matrix and right hand side
 template <int dim>
 void AdvectionProblem<dim>::test_equality ()
 {
-                                  // need to manually go through the
-                                  // matrix, since we can have different
-                                  // entries in constrained lines because
-                                  // the diagonal is set differently
+  // need to manually go through the
+  // matrix, since we can have different
+  // entries in constrained lines because
+  // the diagonal is set differently
 
   const BlockIndices &
-    index_mapping = sparsity_pattern.get_column_indices();
+  index_mapping = sparsity_pattern.get_column_indices();
 
   for (unsigned int i=0; i<reference_matrix.m(); ++i)
     {
       const unsigned int block_row = index_mapping.global_to_local(i).first;
       const unsigned int index_in_block = index_mapping.global_to_local(i).second;
       for (unsigned int block_col=0; block_col<sparsity_pattern.n_block_cols();
-          ++block_col)
-       {
-         SparseMatrix<double>::const_iterator reference =
-           reference_matrix.block(block_row,block_col).begin(index_in_block);
-         SparseMatrix<double>::iterator test =
-           test_matrix.block(block_row,block_col).begin(index_in_block);
-         if (test_all_constraints.is_constrained(i) == false)
-           {
-             for ( ; test != test_matrix.block(block_row,block_col).end(index_in_block);
-                   ++test, ++reference)
-               test->value() -= reference->value();
-           }
-         else
-           for ( ; test != test_matrix.block(block_row,block_col).end(index_in_block);
-                 ++test)
-             test->value() = 0;
-       }
+           ++block_col)
+        {
+          SparseMatrix<double>::const_iterator reference =
+            reference_matrix.block(block_row,block_col).begin(index_in_block);
+          SparseMatrix<double>::iterator test =
+            test_matrix.block(block_row,block_col).begin(index_in_block);
+          if (test_all_constraints.is_constrained(i) == false)
+            {
+              for ( ; test != test_matrix.block(block_row,block_col).end(index_in_block);
+                    ++test, ++reference)
+                test->value() -= reference->value();
+            }
+          else
+            for ( ; test != test_matrix.block(block_row,block_col).end(index_in_block);
+                  ++test)
+              test->value() = 0;
+        }
     }
 
   double frobenius_norm = 0.;
-  for (unsigned int row=0;row<sparsity_pattern.n_block_rows(); ++row)
-    for (unsigned int col=0;col<sparsity_pattern.n_block_cols(); ++col)
+  for (unsigned int row=0; row<sparsity_pattern.n_block_rows(); ++row)
+    for (unsigned int col=0; col<sparsity_pattern.n_block_cols(); ++col)
       frobenius_norm += test_matrix.block(row,col).frobenius_norm() *
-       test_matrix.block(row,col).frobenius_norm();
+                        test_matrix.block(row,col).frobenius_norm();
   frobenius_norm = std::sqrt(frobenius_norm);
 
   deallog << "  Matrix difference norm: " << frobenius_norm << std::endl;
   Assert (frobenius_norm < 1e-13, ExcInternalError());
 
-                                  // same here -- Dirichlet lines will have
-                                  // nonzero rhs, whereas we will have zero
-                                  // rhs when using inhomogeneous
-                                  // constraints.
+  // same here -- Dirichlet lines will have
+  // nonzero rhs, whereas we will have zero
+  // rhs when using inhomogeneous
+  // constraints.
   for (unsigned int i=0; i<reference_matrix.m(); ++i)
     if (test_all_constraints.is_constrained(i) == false)
       test_rhs(i) -= reference_rhs(i);
@@ -239,7 +239,7 @@ void AdvectionProblem<dim>::test_equality ()
       test_rhs(i) = 0;
 
   deallog << "  RHS difference norm: "
-         << test_rhs.l2_norm() << std::endl;
+          << test_rhs.l2_norm() << std::endl;
 
   Assert (test_rhs.l2_norm() < 1e-14, ExcInternalError());
 }
@@ -255,8 +255,8 @@ void AdvectionProblem<dim>::assemble_reference ()
 
   QGauss<dim> quadrature_formula (3);
   FEValues<dim> fe_values (fe, quadrature_formula,
-                          update_values    |  update_gradients |
-                          update_quadrature_points  |  update_JxW_values);
+                           update_values    |  update_gradients |
+                           update_quadrature_points  |  update_JxW_values);
 
   const RightHandSide<dim> rhs_function;
   const unsigned int dofs_per_cell = fe.dofs_per_cell;
@@ -269,8 +269,8 @@ void AdvectionProblem<dim>::assemble_reference ()
   std::vector<double>  rhs_values (n_q_points);
 
   typename DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       cell_matrix = 0;
@@ -278,7 +278,7 @@ void AdvectionProblem<dim>::assemble_reference ()
       fe_values.reinit (cell);
 
       rhs_function.value_list (fe_values.get_quadrature_points(),
-                              rhs_values);
+                               rhs_values);
 
       Tensor<1,dim> advection_direction;
       advection_direction[0] = 1;
@@ -286,49 +286,49 @@ void AdvectionProblem<dim>::assemble_reference ()
       advection_direction[dim-1] = -1;
 
       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         {
-           const unsigned int comp_i = fe.system_to_component_index(i).first;
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             {
-               const unsigned int comp_j = fe.system_to_component_index(j).first;
-               if (comp_i == comp_j)
-                 cell_matrix(i,j) += (fe_values.shape_value(i,q_point) *
-                                      advection_direction *
-                                      fe_values.shape_grad(j,q_point) *
-                                      fe_values.JxW(q_point));
-             }
-
-           cell_rhs(i) += (fe_values.shape_value(i,q_point) *
-                           rhs_values[q_point] *
-                           fe_values.JxW(q_point));
-         }
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
+            const unsigned int comp_i = fe.system_to_component_index(i).first;
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              {
+                const unsigned int comp_j = fe.system_to_component_index(j).first;
+                if (comp_i == comp_j)
+                  cell_matrix(i,j) += (fe_values.shape_value(i,q_point) *
+                                       advection_direction *
+                                       fe_values.shape_grad(j,q_point) *
+                                       fe_values.JxW(q_point));
+              }
+
+            cell_rhs(i) += (fe_values.shape_value(i,q_point) *
+                            rhs_values[q_point] *
+                            fe_values.JxW(q_point));
+          }
 
       local_dof_indices.resize (dofs_per_cell);
       cell->get_dof_indices (local_dof_indices);
 
       reference_matrix.add(local_dof_indices, cell_matrix);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       reference_rhs(local_dof_indices[i]) += cell_rhs(i);
+        reference_rhs(local_dof_indices[i]) += cell_rhs(i);
     }
 
   hanging_nodes_only.condense (reference_matrix, reference_rhs);
 
-                                  // use some other rhs vector as dummy for
-                                  // application of Dirichlet conditions
+  // use some other rhs vector as dummy for
+  // application of Dirichlet conditions
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           ConstantFunction<dim>(1.,2),
-                                           boundary_values);
+                                            0,
+                                            ConstantFunction<dim>(1.,2),
+                                            boundary_values);
   MatrixTools::apply_boundary_values (boundary_values,
-                                     reference_matrix,
-                                     test_rhs,
-                                     reference_rhs);
+                                      reference_matrix,
+                                      test_rhs,
+                                      reference_rhs);
 
   deallog << "  Reference matrix nonzeros: " << reference_matrix.n_nonzero_elements()
-         << ", actually: " << reference_matrix.n_actually_nonzero_elements (1e-10)
-         << std::endl;
+          << ", actually: " << reference_matrix.n_actually_nonzero_elements (1e-10)
+          << std::endl;
 }
 
 
@@ -342,8 +342,8 @@ void AdvectionProblem<dim>::assemble_test_1 ()
 
   QGauss<dim> quadrature_formula (3);
   FEValues<dim> fe_values (fe, quadrature_formula,
-                          update_values    |  update_gradients |
-                          update_quadrature_points  |  update_JxW_values);
+                           update_values    |  update_gradients |
+                           update_quadrature_points  |  update_JxW_values);
 
   const RightHandSide<dim> rhs_function;
   const unsigned int dofs_per_cell = fe.dofs_per_cell;
@@ -356,8 +356,8 @@ void AdvectionProblem<dim>::assemble_test_1 ()
   std::vector<double>  rhs_values (n_q_points);
 
   typename DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       cell_matrix = 0;
@@ -365,7 +365,7 @@ void AdvectionProblem<dim>::assemble_test_1 ()
       fe_values.reinit (cell);
 
       rhs_function.value_list (fe_values.get_quadrature_points(),
-                              rhs_values);
+                               rhs_values);
 
       Tensor<1,dim> advection_direction;
       advection_direction[0] = 1;
@@ -373,37 +373,37 @@ void AdvectionProblem<dim>::assemble_test_1 ()
       advection_direction[dim-1] = -1;
 
       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         {
-           const unsigned int comp_i = fe.system_to_component_index(i).first;
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             {
-               const unsigned int comp_j = fe.system_to_component_index(j).first;
-               if (comp_i == comp_j)
-                 cell_matrix(i,j) += (fe_values.shape_value(i,q_point) *
-                                      advection_direction *
-                                      fe_values.shape_grad(j,q_point) *
-                                      fe_values.JxW(q_point));
-             }
-
-           cell_rhs(i) += (fe_values.shape_value(i,q_point) *
-                           rhs_values[q_point] *
-                           fe_values.JxW(q_point));
-         }
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
+            const unsigned int comp_i = fe.system_to_component_index(i).first;
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              {
+                const unsigned int comp_j = fe.system_to_component_index(j).first;
+                if (comp_i == comp_j)
+                  cell_matrix(i,j) += (fe_values.shape_value(i,q_point) *
+                                       advection_direction *
+                                       fe_values.shape_grad(j,q_point) *
+                                       fe_values.JxW(q_point));
+              }
+
+            cell_rhs(i) += (fe_values.shape_value(i,q_point) *
+                            rhs_values[q_point] *
+                            fe_values.JxW(q_point));
+          }
 
       local_dof_indices.resize (dofs_per_cell);
       cell->get_dof_indices (local_dof_indices);
 
       test_matrix.add(local_dof_indices, cell_matrix);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       test_rhs(local_dof_indices[i]) += cell_rhs(i);
+        test_rhs(local_dof_indices[i]) += cell_rhs(i);
 
     }
 
   test_all_constraints.condense (test_matrix, test_rhs);
   deallog << "  Test matrix 1 nonzeros: " << test_matrix.n_nonzero_elements()
-         << ", actually: " << test_matrix.n_actually_nonzero_elements (1e-10)
-         << std::endl;
+          << ", actually: " << test_matrix.n_actually_nonzero_elements (1e-10)
+          << std::endl;
 
   test_equality();
 }
@@ -418,8 +418,8 @@ void AdvectionProblem<dim>::assemble_test_2 ()
 
   QGauss<dim> quadrature_formula (3);
   FEValues<dim> fe_values (fe, quadrature_formula,
-                          update_values    |  update_gradients |
-                          update_quadrature_points  |  update_JxW_values);
+                           update_values    |  update_gradients |
+                           update_quadrature_points  |  update_JxW_values);
 
   const RightHandSide<dim> rhs_function;
   const unsigned int dofs_per_cell = fe.dofs_per_cell;
@@ -432,8 +432,8 @@ void AdvectionProblem<dim>::assemble_test_2 ()
   std::vector<double>  rhs_values (n_q_points);
 
   typename DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       cell_matrix = 0;
@@ -441,7 +441,7 @@ void AdvectionProblem<dim>::assemble_test_2 ()
       fe_values.reinit (cell);
 
       rhs_function.value_list (fe_values.get_quadrature_points(),
-                              rhs_values);
+                               rhs_values);
 
       Tensor<1,dim> advection_direction;
       advection_direction[0] = 1;
@@ -449,36 +449,36 @@ void AdvectionProblem<dim>::assemble_test_2 ()
       advection_direction[dim-1] = -1;
 
       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         {
-           const unsigned int comp_i = fe.system_to_component_index(i).first;
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             {
-               const unsigned int comp_j = fe.system_to_component_index(j).first;
-               if (comp_i == comp_j)
-                 cell_matrix(i,j) += (fe_values.shape_value(i,q_point) *
-                                      advection_direction *
-                                      fe_values.shape_grad(j,q_point) *
-                                      fe_values.JxW(q_point));
-             }
-
-           cell_rhs(i) += (fe_values.shape_value(i,q_point) *
-                           rhs_values[q_point] *
-                           fe_values.JxW(q_point));
-         }
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
+            const unsigned int comp_i = fe.system_to_component_index(i).first;
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              {
+                const unsigned int comp_j = fe.system_to_component_index(j).first;
+                if (comp_i == comp_j)
+                  cell_matrix(i,j) += (fe_values.shape_value(i,q_point) *
+                                       advection_direction *
+                                       fe_values.shape_grad(j,q_point) *
+                                       fe_values.JxW(q_point));
+              }
+
+            cell_rhs(i) += (fe_values.shape_value(i,q_point) *
+                            rhs_values[q_point] *
+                            fe_values.JxW(q_point));
+          }
 
       local_dof_indices.resize (dofs_per_cell);
       cell->get_dof_indices (local_dof_indices);
 
       test_all_constraints.distribute_local_to_global (cell_matrix,
-                                                      cell_rhs,
-                                                      local_dof_indices,
-                                                      test_matrix,
-                                                      test_rhs);
+                                                       cell_rhs,
+                                                       local_dof_indices,
+                                                       test_matrix,
+                                                       test_rhs);
     }
   deallog << "  Test matrix 2 nonzeros: " << test_matrix.n_nonzero_elements()
-         << ", actually: " << test_matrix.n_actually_nonzero_elements (1e-10)
-         << std::endl;
+          << ", actually: " << test_matrix.n_actually_nonzero_elements (1e-10)
+          << std::endl;
   test_equality();
 }
 
@@ -489,36 +489,36 @@ void AdvectionProblem<dim>::run ()
   GridGenerator::hyper_cube (triangulation);
   triangulation.refine_global (4-dim);
 
-                                  // manually refine the first two cells to
-                                  // create some hanging nodes
+  // manually refine the first two cells to
+  // create some hanging nodes
   {
     typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active();
     cell->set_refine_flag();
   }
   triangulation.execute_coarsening_and_refinement();
   {
-                                    // find the last cell and mark it
-                                    // for refinement
+    // find the last cell and mark it
+    // for refinement
     for (typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active();
-        cell != dof_handler.end(); ++cell)
+         cell != dof_handler.end(); ++cell)
       if (++typename DoFHandler<dim>::active_cell_iterator(cell) ==
-         dof_handler.end())
-       cell->set_refine_flag();
+          dof_handler.end())
+        cell->set_refine_flag();
   }
   triangulation.execute_coarsening_and_refinement();
 
   setup_system ();
 
   deallog << std::endl << std::endl
-         << "  Number of active cells:       "
-         << triangulation.n_active_cells()
-         << std::endl
-         << "  Number of degrees of freedom: "
-         << dof_handler.n_dofs()
-         << std::endl
-         << "  Number of constraints       : "
-         << hanging_nodes_only.n_constraints()
-         << std::endl;
+          << "  Number of active cells:       "
+          << triangulation.n_active_cells()
+          << std::endl
+          << "  Number of degrees of freedom: "
+          << dof_handler.n_dofs()
+          << std::endl
+          << "  Number of constraints       : "
+          << hanging_nodes_only.n_constraints()
+          << std::endl;
 
   assemble_reference ();
   assemble_test_1 ();
index c6dbcb74f7e31ada635bcc42bb09caafb70fbf05..e15d28c303b1217221b23bfa14ee262b43df0031 100644 (file)
@@ -53,33 +53,33 @@ using namespace dealii;
 template <int dim>
 class AdvectionProblem
 {
-  public:
-    AdvectionProblem ();
-    ~AdvectionProblem ();
+public:
+  AdvectionProblem ();
+  ~AdvectionProblem ();
 
-    void run ();
+  void run ();
 
-  private:
-    void setup_system ();
-    void test_equality ();
-    void assemble_reference ();
-    void assemble_test_1 ();
-    void assemble_test_2 ();
+private:
+  void setup_system ();
+  void test_equality ();
+  void assemble_reference ();
+  void assemble_test_1 ();
+  void assemble_test_2 ();
 
-    Triangulation<dim>   triangulation;
+  Triangulation<dim>   triangulation;
 
-    DoFHandler<dim>      dof_handler;
-    FE_Q<dim>            fe;
+  DoFHandler<dim>      dof_handler;
+  FE_Q<dim>            fe;
 
-    ConstraintMatrix     hanging_nodes_only;
-    ConstraintMatrix     test_all_constraints;
+  ConstraintMatrix     hanging_nodes_only;
+  ConstraintMatrix     test_all_constraints;
 
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> reference_matrix;
-    SparseMatrix<double> test_matrix;
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> reference_matrix;
+  SparseMatrix<double> test_matrix;
 
-    Vector<double>       reference_rhs;
-    Vector<double>       test_rhs;
+  Vector<double>       reference_rhs;
+  Vector<double>       test_rhs;
 };
 
 
@@ -87,18 +87,18 @@ class AdvectionProblem
 template <int dim>
 class RightHandSide : public Function<dim>
 {
-  public:
-    RightHandSide () : Function<dim> () {}
+public:
+  RightHandSide () : Function<dim> () {}
 
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const;
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const;
 };
 
 
 template <int dim>
 double
 RightHandSide<dim>::value (const Point<dim>   &p,
-                          const unsigned int  /*component*/) const
+                           const unsigned int  /*component*/) const
 {
   double product = 1;
   for (unsigned int d=0; d<dim; ++d)
@@ -109,9 +109,9 @@ RightHandSide<dim>::value (const Point<dim>   &p,
 
 template <int dim>
 AdvectionProblem<dim>::AdvectionProblem ()
-               :
-                dof_handler (triangulation),
-               fe (2)
+  :
+  dof_handler (triangulation),
+  fe (2)
 {}
 
 
@@ -133,36 +133,36 @@ void AdvectionProblem<dim>::setup_system ()
   hanging_nodes_only.clear ();
   test_all_constraints.clear ();
 
-                                  // add boundary conditions as
-                                  // inhomogeneous constraints here. just
-                                  // take the right hand side function as
-                                  // boundary function
+  // add boundary conditions as
+  // inhomogeneous constraints here. just
+  // take the right hand side function as
+  // boundary function
   {
     std::map<types::global_dof_index,double> boundary_values;
     VectorTools::interpolate_boundary_values (dof_handler,
-                                             0,
-                                             RightHandSide<dim>(),
-                                             boundary_values);
+                                              0,
+                                              RightHandSide<dim>(),
+                                              boundary_values);
     std::map<types::global_dof_index,double>::const_iterator boundary_value =
       boundary_values.begin();
     for ( ; boundary_value !=boundary_values.end(); ++boundary_value)
       {
-       test_all_constraints.add_line(boundary_value->first);
-       test_all_constraints.set_inhomogeneity (boundary_value->first,
-                                               boundary_value->second);
+        test_all_constraints.add_line(boundary_value->first);
+        test_all_constraints.set_inhomogeneity (boundary_value->first,
+                                                boundary_value->second);
       }
   }
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          hanging_nodes_only);
+                                           hanging_nodes_only);
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          test_all_constraints);
+                                           test_all_constraints);
   hanging_nodes_only.close ();
   test_all_constraints.close ();
 
   CompressedSimpleSparsityPattern csp (dof_handler.n_dofs(),
-                                      dof_handler.n_dofs());
+                                       dof_handler.n_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, csp,
-                                  hanging_nodes_only, true);
+                                   hanging_nodes_only, true);
   sparsity_pattern.copy_from (csp);
 
   reference_matrix.reinit (sparsity_pattern);
@@ -171,36 +171,36 @@ void AdvectionProblem<dim>::setup_system ()
 
 
 
-                                  // test whether we are equal with the
-                                  // standard matrix and right hand side
+// test whether we are equal with the
+// standard matrix and right hand side
 template <int dim>
 void AdvectionProblem<dim>::test_equality ()
 {
-                                  // need to manually go through the
-                                  // matrix, since we can have different
-                                  // entries in constrained lines.
+  // need to manually go through the
+  // matrix, since we can have different
+  // entries in constrained lines.
   for (unsigned int i=0; i<reference_matrix.m(); ++i)
     {
       SparseMatrix<double>::const_iterator reference = reference_matrix.begin(i);
       SparseMatrix<double>::iterator test = test_matrix.begin(i);
       if (test_all_constraints.is_constrained(i) == false)
-       {
-         for ( ; test != test_matrix.end(i); ++test, ++reference)
-             test->value() -= reference->value();
-       }
+        {
+          for ( ; test != test_matrix.end(i); ++test, ++reference)
+            test->value() -= reference->value();
+        }
       else
-       for ( ; test != test_matrix.end(i); ++test)
-         test->value() = 0;
+        for ( ; test != test_matrix.end(i); ++test)
+          test->value() = 0;
     }
 
   deallog << "  Matrix difference norm: "
-         << test_matrix.frobenius_norm() << std::endl;
+          << test_matrix.frobenius_norm() << std::endl;
   Assert (test_matrix.frobenius_norm() < 1e-13, ExcInternalError());
 
-                                  // same here -- Dirichlet lines will have
-                                  // nonzero rhs, whereas we will have zero
-                                  // rhs when using inhomogeneous
-                                  // constraints.
+  // same here -- Dirichlet lines will have
+  // nonzero rhs, whereas we will have zero
+  // rhs when using inhomogeneous
+  // constraints.
   for (unsigned int i=0; i<reference_matrix.m(); ++i)
     if (test_all_constraints.is_constrained(i) == false)
       test_rhs(i) -= reference_rhs(i);
@@ -208,7 +208,7 @@ void AdvectionProblem<dim>::test_equality ()
       test_rhs(i) = 0;
 
   deallog << "  RHS difference norm: "
-         << test_rhs.l2_norm() << std::endl;
+          << test_rhs.l2_norm() << std::endl;
 
   Assert (test_rhs.l2_norm() < 1e-14, ExcInternalError());
 }
@@ -224,8 +224,8 @@ void AdvectionProblem<dim>::assemble_reference ()
 
   QGauss<dim> quadrature_formula (3);
   FEValues<dim> fe_values (fe, quadrature_formula,
-                          update_values    |  update_gradients |
-                          update_quadrature_points  |  update_JxW_values);
+                           update_values    |  update_gradients |
+                           update_quadrature_points  |  update_JxW_values);
 
   const RightHandSide<dim> rhs_function;
   const unsigned int dofs_per_cell = fe.dofs_per_cell;
@@ -238,8 +238,8 @@ void AdvectionProblem<dim>::assemble_reference ()
   std::vector<double>  rhs_values (n_q_points);
 
   typename DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       cell_matrix = 0;
@@ -247,7 +247,7 @@ void AdvectionProblem<dim>::assemble_reference ()
       fe_values.reinit (cell);
 
       rhs_function.value_list (fe_values.get_quadrature_points(),
-                              rhs_values);
+                               rhs_values);
 
       Tensor<1,dim> advection_direction;
       advection_direction[0] = 1;
@@ -255,44 +255,44 @@ void AdvectionProblem<dim>::assemble_reference ()
       advection_direction[dim-1] = -1;
 
       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         {
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += (fe_values.shape_value(i,q_point) *
-                                  advection_direction *
-                                  fe_values.shape_grad(j,q_point) *
-                                  fe_values.JxW(q_point));
-
-           cell_rhs(i) += (fe_values.shape_value(i,q_point) *
-                           rhs_values[q_point] *
-                           fe_values.JxW(q_point));
-         }
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += (fe_values.shape_value(i,q_point) *
+                                   advection_direction *
+                                   fe_values.shape_grad(j,q_point) *
+                                   fe_values.JxW(q_point));
+
+            cell_rhs(i) += (fe_values.shape_value(i,q_point) *
+                            rhs_values[q_point] *
+                            fe_values.JxW(q_point));
+          }
 
       local_dof_indices.resize (dofs_per_cell);
       cell->get_dof_indices (local_dof_indices);
 
       reference_matrix.add(local_dof_indices, cell_matrix);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       reference_rhs(local_dof_indices[i]) += cell_rhs(i);
+        reference_rhs(local_dof_indices[i]) += cell_rhs(i);
     }
 
   hanging_nodes_only.condense (reference_matrix, reference_rhs);
 
-                                  // use some other rhs vector as dummy for
-                                  // application of Dirichlet conditions
+  // use some other rhs vector as dummy for
+  // application of Dirichlet conditions
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           RightHandSide<dim>(),
-                                           boundary_values);
+                                            0,
+                                            RightHandSide<dim>(),
+                                            boundary_values);
   MatrixTools::apply_boundary_values (boundary_values,
-                                     reference_matrix,
-                                     test_rhs,
-                                     reference_rhs);
+                                      reference_matrix,
+                                      test_rhs,
+                                      reference_rhs);
 
   deallog << "  Reference matrix nonzeros: " << reference_matrix.n_nonzero_elements()
-         << ", actually: " << reference_matrix.n_actually_nonzero_elements (1e-12)
-         << std::endl;
+          << ", actually: " << reference_matrix.n_actually_nonzero_elements (1e-12)
+          << std::endl;
 }
 
 
@@ -306,8 +306,8 @@ void AdvectionProblem<dim>::assemble_test_1 ()
 
   QGauss<dim> quadrature_formula (3);
   FEValues<dim> fe_values (fe, quadrature_formula,
-                          update_values    |  update_gradients |
-                          update_quadrature_points  |  update_JxW_values);
+                           update_values    |  update_gradients |
+                           update_quadrature_points  |  update_JxW_values);
 
   const RightHandSide<dim> rhs_function;
   const unsigned int dofs_per_cell = fe.dofs_per_cell;
@@ -320,8 +320,8 @@ void AdvectionProblem<dim>::assemble_test_1 ()
   std::vector<double>  rhs_values (n_q_points);
 
   typename DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       cell_matrix = 0;
@@ -329,7 +329,7 @@ void AdvectionProblem<dim>::assemble_test_1 ()
       fe_values.reinit (cell);
 
       rhs_function.value_list (fe_values.get_quadrature_points(),
-                              rhs_values);
+                               rhs_values);
 
       Tensor<1,dim> advection_direction;
       advection_direction[0] = 1;
@@ -337,32 +337,32 @@ void AdvectionProblem<dim>::assemble_test_1 ()
       advection_direction[dim-1] = -1;
 
       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         {
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += (fe_values.shape_value(i,q_point) *
-                                  advection_direction *
-                                  fe_values.shape_grad(j,q_point) *
-                                  fe_values.JxW(q_point));
-
-           cell_rhs(i) += (fe_values.shape_value(i,q_point) *
-                           rhs_values[q_point] *
-                           fe_values.JxW(q_point));
-         }
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += (fe_values.shape_value(i,q_point) *
+                                   advection_direction *
+                                   fe_values.shape_grad(j,q_point) *
+                                   fe_values.JxW(q_point));
+
+            cell_rhs(i) += (fe_values.shape_value(i,q_point) *
+                            rhs_values[q_point] *
+                            fe_values.JxW(q_point));
+          }
 
       local_dof_indices.resize (dofs_per_cell);
       cell->get_dof_indices (local_dof_indices);
 
       test_matrix.add(local_dof_indices, cell_matrix);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       test_rhs(local_dof_indices[i]) += cell_rhs(i);
+        test_rhs(local_dof_indices[i]) += cell_rhs(i);
 
     }
 
   test_all_constraints.condense (test_matrix, test_rhs);
   deallog << "  Test matrix 1 nonzeros: " << test_matrix.n_nonzero_elements()
-         << ", actually: " << test_matrix.n_actually_nonzero_elements (1e-12)
-         << std::endl;
+          << ", actually: " << test_matrix.n_actually_nonzero_elements (1e-12)
+          << std::endl;
 
   test_equality();
 }
@@ -377,8 +377,8 @@ void AdvectionProblem<dim>::assemble_test_2 ()
 
   QGauss<dim> quadrature_formula (3);
   FEValues<dim> fe_values (fe, quadrature_formula,
-                          update_values    |  update_gradients |
-                          update_quadrature_points  |  update_JxW_values);
+                           update_values    |  update_gradients |
+                           update_quadrature_points  |  update_JxW_values);
 
   const RightHandSide<dim> rhs_function;
   const unsigned int dofs_per_cell = fe.dofs_per_cell;
@@ -391,8 +391,8 @@ void AdvectionProblem<dim>::assemble_test_2 ()
   std::vector<double>  rhs_values (n_q_points);
 
   typename DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       cell_matrix = 0;
@@ -400,7 +400,7 @@ void AdvectionProblem<dim>::assemble_test_2 ()
       fe_values.reinit (cell);
 
       rhs_function.value_list (fe_values.get_quadrature_points(),
-                              rhs_values);
+                               rhs_values);
 
       Tensor<1,dim> advection_direction;
       advection_direction[0] = 1;
@@ -408,31 +408,31 @@ void AdvectionProblem<dim>::assemble_test_2 ()
       advection_direction[dim-1] = -1;
 
       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         {
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += (fe_values.shape_value(i,q_point) *
-                                  advection_direction *
-                                  fe_values.shape_grad(j,q_point) *
-                                  fe_values.JxW(q_point));
-
-           cell_rhs(i) += (fe_values.shape_value(i,q_point) *
-                           rhs_values[q_point] *
-                           fe_values.JxW(q_point));
-         }
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += (fe_values.shape_value(i,q_point) *
+                                   advection_direction *
+                                   fe_values.shape_grad(j,q_point) *
+                                   fe_values.JxW(q_point));
+
+            cell_rhs(i) += (fe_values.shape_value(i,q_point) *
+                            rhs_values[q_point] *
+                            fe_values.JxW(q_point));
+          }
 
       local_dof_indices.resize (dofs_per_cell);
       cell->get_dof_indices (local_dof_indices);
 
       test_all_constraints.distribute_local_to_global (cell_matrix,
-                                                      cell_rhs,
-                                                      local_dof_indices,
-                                                      test_matrix,
-                                                      test_rhs);
+                                                       cell_rhs,
+                                                       local_dof_indices,
+                                                       test_matrix,
+                                                       test_rhs);
     }
   deallog << "  Test matrix 2 nonzeros: " << test_matrix.n_nonzero_elements()
-         << ", actually: " << test_matrix.n_actually_nonzero_elements (1e-12)
-         << std::endl;
+          << ", actually: " << test_matrix.n_actually_nonzero_elements (1e-12)
+          << std::endl;
   test_equality();
 }
 
@@ -443,37 +443,37 @@ void AdvectionProblem<dim>::run ()
   GridGenerator::hyper_ball (triangulation);
   triangulation.refine_global (3-dim);
 
-                                  // manually refine the first two cells
-                                  // and then one of these cells once again
-                                  // to create some hanging nodes
+  // manually refine the first two cells
+  // and then one of these cells once again
+  // to create some hanging nodes
   {
     typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active();
     cell->set_refine_flag();
   }
   triangulation.execute_coarsening_and_refinement();
   {
-                                    // find the last cell and mark it
-                                    // for refinement
+    // find the last cell and mark it
+    // for refinement
     for (typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active();
-        cell != dof_handler.end(); ++cell)
+         cell != dof_handler.end(); ++cell)
       if (++typename DoFHandler<dim>::active_cell_iterator(cell) ==
-         dof_handler.end())
-       cell->set_refine_flag();
+          dof_handler.end())
+        cell->set_refine_flag();
   }
   triangulation.execute_coarsening_and_refinement();
 
   setup_system ();
 
   deallog << std::endl << std::endl
-         << "  Number of active cells:       "
-         << triangulation.n_active_cells()
-         << std::endl
-         << "  Number of degrees of freedom: "
-         << dof_handler.n_dofs()
-         << std::endl
-         << "  Number of constraints       : "
-         << hanging_nodes_only.n_constraints()
-         << std::endl;
+          << "  Number of active cells:       "
+          << triangulation.n_active_cells()
+          << std::endl
+          << "  Number of degrees of freedom: "
+          << dof_handler.n_dofs()
+          << std::endl
+          << "  Number of constraints       : "
+          << hanging_nodes_only.n_constraints()
+          << std::endl;
 
   assemble_reference ();
   assemble_test_1 ();
index d6ebdd18ae0435575d804b4f934bd78482e37697..fb437615b7066a2393618d920d6de7d2b7a48fa9 100644 (file)
@@ -57,45 +57,45 @@ using namespace dealii;
 template <int dim>
 class LaplaceProblem
 {
-  public:
-    LaplaceProblem ();
-    void run ();
+public:
+  LaplaceProblem ();
+  void run ();
 
-  private:
-    void setup_system ();
-    void assemble_system ();
-    void solve ();
+private:
+  void setup_system ();
+  void assemble_system ();
+  void solve ();
 
-    Triangulation<dim>   triangulation;
-    FE_Q<dim>            fe;
-    DoFHandler<dim>      dof_handler;
+  Triangulation<dim>   triangulation;
+  FE_Q<dim>            fe;
+  DoFHandler<dim>      dof_handler;
 
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> system_matrix;
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> system_matrix;
 
-    Vector<double>       solution;
-    Vector<double>       system_rhs;
-    ConstraintMatrix     constraints;
+  Vector<double>       solution;
+  Vector<double>       system_rhs;
+  ConstraintMatrix     constraints;
 };
 
 template <int dim>
 class Coefficient : public Function<dim>
 {
-  public:
-    Coefficient ()  : Function<dim>() {}
+public:
+  Coefficient ()  : Function<dim>() {}
 
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
 
-    virtual void value_list (const std::vector<Point<dim> > &points,
-                            std::vector<double>            &values,
-                            const unsigned int              component = 0) const;
+  virtual void value_list (const std::vector<Point<dim> > &points,
+                           std::vector<double>            &values,
+                           const unsigned int              component = 0) const;
 };
 
 
 template <int dim>
 double Coefficient<dim>::value (const Point<dim> &p,
-                               const unsigned int /*component*/) const
+                                const unsigned int /*component*/) const
 {
   if (p.square() < 0.5*0.5)
     return 20;
@@ -106,30 +106,30 @@ double Coefficient<dim>::value (const Point<dim> &p,
 
 template <int dim>
 void Coefficient<dim>::value_list (const std::vector<Point<dim> > &points,
-                                  std::vector<double>            &values,
-                                  const unsigned int              component) const
+                                   std::vector<double>            &values,
+                                   const unsigned int              component) const
 {
   Assert (values.size() == points.size(),
-         ExcDimensionMismatch (values.size(), points.size()));
+          ExcDimensionMismatch (values.size(), points.size()));
   Assert (component == 0,
-         ExcIndexRange (component, 0, 1));
+          ExcIndexRange (component, 0, 1));
 
   const unsigned int n_points = points.size();
 
   for (unsigned int i=0; i<n_points; ++i)
     {
       if (points[i].square() < 0.5*0.5)
-       values[i] = 20;
+        values[i] = 20;
       else
-       values[i] = 1;
+        values[i] = 1;
     }
 }
 
 
 template <int dim>
 LaplaceProblem<dim>::LaplaceProblem () :
-                fe (1),
-               dof_handler (triangulation)
+  fe (1),
+  dof_handler (triangulation)
 {}
 
 
@@ -140,18 +140,18 @@ void LaplaceProblem<dim>::setup_system ()
   dof_handler.distribute_dofs (fe);
 
   deallog << "   Number of degrees of freedom: "
-           << dof_handler.n_dofs()
-           << std::endl;
+          << dof_handler.n_dofs()
+          << std::endl;
 
   constraints.clear();
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           ConstantFunction<dim>(1),
-                                           constraints);
+                                            0,
+                                            ConstantFunction<dim>(1),
+                                            constraints);
   constraints.close();
   sparsity_pattern.reinit (dof_handler.n_dofs(),
-                          dof_handler.n_dofs(),
-                          dof_handler.max_couplings_between_dofs());
+                           dof_handler.n_dofs(),
+                           dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern, constraints, false);
   sparsity_pattern.compress();
 
@@ -170,8 +170,8 @@ void LaplaceProblem<dim>::assemble_system ()
   Vector<double> test(dof_handler.n_dofs());
 
   FEValues<dim> fe_values (fe, quadrature_formula,
-                          update_values    |  update_gradients |
-                          update_quadrature_points  |  update_JxW_values);
+                           update_values    |  update_gradients |
+                           update_quadrature_points  |  update_JxW_values);
 
   const unsigned int   dofs_per_cell = fe.dofs_per_cell;
   const unsigned int   n_q_points    = quadrature_formula.size();
@@ -185,8 +185,8 @@ void LaplaceProblem<dim>::assemble_system ()
   std::vector<double>    coefficient_values (n_q_points);
 
   typename DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       cell_matrix = 0;
@@ -195,45 +195,45 @@ void LaplaceProblem<dim>::assemble_system ()
       fe_values.reinit (cell);
 
       coefficient.value_list (fe_values.get_quadrature_points(),
-                             coefficient_values);
+                              coefficient_values);
 
       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         {
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += ((coefficient_values[q_point] *
-                                   fe_values.shape_grad(i,q_point) *
-                                   fe_values.shape_grad(j,q_point)
-                                   +
-                                   fe_values.shape_grad(i,q_point)[0] *
-                                   fe_values.shape_value(j,q_point)
-                  )*fe_values.JxW(q_point));
-
-           cell_rhs(i) += (fe_values.shape_value(i,q_point) *
-                           1.0 *
-                           fe_values.JxW(q_point));
-         }
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += ((coefficient_values[q_point] *
+                                    fe_values.shape_grad(i,q_point) *
+                                    fe_values.shape_grad(j,q_point)
+                                    +
+                                    fe_values.shape_grad(i,q_point)[0] *
+                                    fe_values.shape_value(j,q_point)
+                                   )*fe_values.JxW(q_point));
+
+            cell_rhs(i) += (fe_values.shape_value(i,q_point) *
+                            1.0 *
+                            fe_values.JxW(q_point));
+          }
 
 
       cell->get_dof_indices (local_dof_indices);
 
-                                  // use standard function with matrix and
-                                  // vector argument
+      // use standard function with matrix and
+      // vector argument
       constraints.distribute_local_to_global(cell_matrix, cell_rhs,
-                                            local_dof_indices,
-                                            system_matrix, system_rhs);
+                                             local_dof_indices,
+                                             system_matrix, system_rhs);
 
-                                  // now do just the right hand side (with
-                                  // local matrix for eliminating
-                                  // inhomogeneities)
+      // now do just the right hand side (with
+      // local matrix for eliminating
+      // inhomogeneities)
       constraints.distribute_local_to_global(cell_rhs,
-                                            local_dof_indices,
-                                            test, cell_matrix);
+                                             local_dof_indices,
+                                             test, cell_matrix);
 
     }
 
-                                  // and compare whether we really got the
-                                  // same right hand side vector
+  // and compare whether we really got the
+  // same right hand side vector
   test -= system_rhs;
   Assert (test.l2_norm() <= 1e-12, ExcInternalError());
 }
@@ -248,13 +248,13 @@ void LaplaceProblem<dim>::solve ()
   preconditioner.initialize(system_matrix, 1.2);
 
   bicgstab.solve (system_matrix, solution, system_rhs,
-                 preconditioner);
+                  preconditioner);
 
   constraints.distribute (solution);
 
   deallog << "   " << solver_control.last_step()
-         << " Bicgstab iterations needed to obtain convergence."
-         << std::endl;
+          << " Bicgstab iterations needed to obtain convergence."
+          << std::endl;
 }
 
 
@@ -267,34 +267,34 @@ void LaplaceProblem<dim>::run ()
       deallog << "Cycle " << cycle << ':' << std::endl;
 
       if (cycle != 0)
-       triangulation.refine_global (1);
+        triangulation.refine_global (1);
       else
-       {
-         GridGenerator::hyper_cube (triangulation, -1, 1);
-         triangulation.refine_global (4-dim);
-         {
-           typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active();
-           cell->set_refine_flag();
-         }
-         triangulation.execute_coarsening_and_refinement();
-         {
-                                            // find the last cell and mark it
-                                            // for refinement
-           for (typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active();
-                cell != dof_handler.end(); ++cell)
-             if (++typename DoFHandler<dim>::active_cell_iterator(cell) ==
-                 dof_handler.end())
-               cell->set_refine_flag();
-         }
-         triangulation.execute_coarsening_and_refinement();
-       }
+        {
+          GridGenerator::hyper_cube (triangulation, -1, 1);
+          triangulation.refine_global (4-dim);
+          {
+            typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active();
+            cell->set_refine_flag();
+          }
+          triangulation.execute_coarsening_and_refinement();
+          {
+            // find the last cell and mark it
+            // for refinement
+            for (typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active();
+                 cell != dof_handler.end(); ++cell)
+              if (++typename DoFHandler<dim>::active_cell_iterator(cell) ==
+                  dof_handler.end())
+                cell->set_refine_flag();
+          }
+          triangulation.execute_coarsening_and_refinement();
+        }
 
       deallog << "   Number of active cells: "
-             << triangulation.n_active_cells()
-             << std::endl
-             << "   Total number of cells: "
-             << triangulation.n_cells()
-             << std::endl;
+              << triangulation.n_active_cells()
+              << std::endl
+              << "   Total number of cells: "
+              << triangulation.n_cells()
+              << std::endl;
 
       setup_system ();
       assemble_system ();
index 6a2abf66f3165668cca037b678caa1aac3f355ef..1ab324eace45ea3a006fd50997de999cce4eaf05 100644 (file)
@@ -49,63 +49,63 @@ template <int dim>
 void check ()
 {
   deallog << "Checking in " << dim << " space dimensions"
-         << std::endl
-         << "---------------------------------------" << std::endl;
-  
-                                  // create two grids
+          << std::endl
+          << "---------------------------------------" << std::endl;
+
+  // create two grids
   Triangulation<dim> tria_1, tria_2;
   GridGenerator::hyper_cube (tria_1, -1, 1);
   tria_1.refine_global (4-dim);
   tria_2.copy_triangulation (tria_1);
-  
-                                  // create two different fe's:
-                                  // create two really perverse
-                                  // finite elements to check for
-                                  // obscure effects when mixing
-                                  // different FEs and creating
-                                  // constraints in between them
-                                  //
-                                  // note that presently dq2 elements
-                                  // are not implemented in 3d, so
-                                  // take special measures
+
+  // create two different fe's:
+  // create two really perverse
+  // finite elements to check for
+  // obscure effects when mixing
+  // different FEs and creating
+  // constraints in between them
+  //
+  // note that presently dq2 elements
+  // are not implemented in 3d, so
+  // take special measures
   const FE_DGQ<dim> fe_constant(0);
   const FE_Q<dim>    fe_quadratic(2);
   const FE_DGQ<dim> fe_dq_linear(1);
   const FE_DGQ<dim> *fe_dq_quadratic = (dim != 3
-                                        ?
-                                        new FE_DGQ<dim>(2)
-                                        :
-                                        0);
-
-                                  // define composed finite
-                                  // elements. to limit memory
-                                  // consumption in 3d to reasonable
-                                  // values, use simpler finite
-                                  // elements there
+                                        ?
+                                        new FE_DGQ<dim>(2)
+                                        :
+                                        0);
+
+  // define composed finite
+  // elements. to limit memory
+  // consumption in 3d to reasonable
+  // values, use simpler finite
+  // elements there
   const FESystem<dim>
-    *fe_1 = (dim != 3
-            ?
-            new FESystem<dim>(fe_quadratic,     4,
-                              *fe_dq_quadratic, 2,
-                              fe_constant,      12)
-            :
-            new FESystem<dim>(fe_dq_linear,     1,
-                              fe_constant,      1)
-            );
+  *fe_1 = (dim != 3
+           ?
+           new FESystem<dim>(fe_quadratic,     4,
+                             *fe_dq_quadratic, 2,
+                             fe_constant,      12)
+           :
+           new FESystem<dim>(fe_dq_linear,     1,
+                             fe_constant,      1)
+          );
 
   const FESystem<dim>
-    *fe_2 = (dim != 3
-            ?
-            new FESystem<dim>(fe_constant,      1,
-                              *fe_dq_quadratic, 2,
-                              fe_quadratic,     5)
-            :
-            new FESystem<dim>(fe_constant,      1,
-                              fe_dq_linear,     1)
-            );
-  
-                                  // make several loops to refine the
-                                  // two grids
+  *fe_2 = (dim != 3
+           ?
+           new FESystem<dim>(fe_constant,      1,
+                             *fe_dq_quadratic, 2,
+                             fe_quadratic,     5)
+           :
+           new FESystem<dim>(fe_constant,      1,
+                             fe_dq_linear,     1)
+          );
+
+  // make several loops to refine the
+  // two grids
   for (unsigned int i=0; i<3; ++i)
     {
       deallog << "Refinement step " << i << std::endl;
@@ -116,117 +116,117 @@ void check ()
       dof_1.distribute_dofs (*fe_1);
       dof_2.distribute_dofs (*fe_2);
 
-                                      // if not in 3d, check
-                                      // renumbering functions as
-                                      // well. in 3d, elements are
-                                      // entirely discontinuous here,
-                                      // so renumbering functions
-                                      // don't work
+      // if not in 3d, check
+      // renumbering functions as
+      // well. in 3d, elements are
+      // entirely discontinuous here,
+      // so renumbering functions
+      // don't work
       if (dim != 3)
-       {
-         DoFRenumbering::Cuthill_McKee (dof_1);
-         DoFRenumbering::Cuthill_McKee (dof_2);
-       };
+        {
+          DoFRenumbering::Cuthill_McKee (dof_1);
+          DoFRenumbering::Cuthill_McKee (dof_2);
+        };
 
       deallog << "  Grid 1: " << tria_1.n_active_cells() << " cells, "
-             << dof_1.n_dofs() << " dofs" << std::endl;
+              << dof_1.n_dofs() << " dofs" << std::endl;
       deallog << "  Grid 2: " << tria_2.n_active_cells() << " cells, "
-             << dof_2.n_dofs() << " dofs" << std::endl;
-      
-                                      // now compute intergrid
-                                      // constraints
+              << dof_2.n_dofs() << " dofs" << std::endl;
+
+      // now compute intergrid
+      // constraints
       InterGridMap<DoFHandler<dim> > intergrid_map;
       intergrid_map.make_mapping (dof_1, dof_2);
       ConstraintMatrix intergrid_constraints;
 
       if (dim != 3)
-       {
-                                          // dq quadratic
-         DoFTools::compute_intergrid_constraints (dof_1, 5, dof_2, 2, 
-                                                  intergrid_map,
-                                                  intergrid_constraints);
-                                          // dq constant
-         DoFTools::compute_intergrid_constraints (dof_1, 8, dof_2, 0, 
-                                                  intergrid_map,
-                                                  intergrid_constraints);
-       }
+        {
+          // dq quadratic
+          DoFTools::compute_intergrid_constraints (dof_1, 5, dof_2, 2,
+                                                   intergrid_map,
+                                                   intergrid_constraints);
+          // dq constant
+          DoFTools::compute_intergrid_constraints (dof_1, 8, dof_2, 0,
+                                                   intergrid_map,
+                                                   intergrid_constraints);
+        }
       else
-                                        // 3d
-       {
-                                          // dq linear
-         DoFTools::compute_intergrid_constraints (dof_1, 0, dof_2, 1, 
-                                                  intergrid_map,
-                                                  intergrid_constraints);
-                                          // dq constant
-         DoFTools::compute_intergrid_constraints (dof_1, 1, dof_2, 0, 
-                                                  intergrid_map,
-                                                  intergrid_constraints);
-       };
-
-      
-                                      // continuous
-                                      // quadratic. continuous
-                                      // elements only work for 1d at
-                                      // present!
+        // 3d
+        {
+          // dq linear
+          DoFTools::compute_intergrid_constraints (dof_1, 0, dof_2, 1,
+                                                   intergrid_map,
+                                                   intergrid_constraints);
+          // dq constant
+          DoFTools::compute_intergrid_constraints (dof_1, 1, dof_2, 0,
+                                                   intergrid_map,
+                                                   intergrid_constraints);
+        };
+
+
+      // continuous
+      // quadratic. continuous
+      // elements only work for 1d at
+      // present!
       if (dim == 1)
-       DoFTools::compute_intergrid_constraints (dof_1, 3, dof_2, 5, 
-                                                intergrid_map,
-                                                intergrid_constraints);
-      
+        DoFTools::compute_intergrid_constraints (dof_1, 3, dof_2, 5,
+                                                 intergrid_map,
+                                                 intergrid_constraints);
+
       intergrid_constraints.print (logfile);
-      
 
-                                      // now refine grids a little,
-                                      // but make sure that grid 2 is
-                                      // always more refined than
-                                      // grid 1
+
+
+      // now refine grids a little,
+      // but make sure that grid 2 is
+      // always more refined than
+      // grid 1
       typename DoFHandler<dim>::cell_iterator cell, endc;
       cell = dof_1.begin();
       endc = dof_1.end();
       for (unsigned int index=0; cell!=endc; ++cell)
-       if (cell->active())
-         {
-           ++index;
-           if (index % 3 == 0) 
-             {
-               cell->set_refine_flag ();
-
-                                                // make sure that the
-                                                // corrsponding cell
-                                                // on grid 2 is also
-                                                // refined if that
-                                                // has not yet
-                                                // happened
-               typename DoFHandler<dim>::cell_iterator cell2 (&tria_2,
-                                                              cell->level(),
-                                                              cell->index(),
-                                                              &dof_2);
-               if (!cell2->has_children())
-                 cell2->set_refine_flag();
-             };
-         };
+        if (cell->active())
+          {
+            ++index;
+            if (index % 3 == 0)
+              {
+                cell->set_refine_flag ();
+
+                // make sure that the
+                // corrsponding cell
+                // on grid 2 is also
+                // refined if that
+                // has not yet
+                // happened
+                typename DoFHandler<dim>::cell_iterator cell2 (&tria_2,
+                                                               cell->level(),
+                                                               cell->index(),
+                                                               &dof_2);
+                if (!cell2->has_children())
+                  cell2->set_refine_flag();
+              };
+          };
 
       tria_1.execute_coarsening_and_refinement ();
       tria_2.execute_coarsening_and_refinement ();
 
-                                      // next refine grid 2 a little more
+      // next refine grid 2 a little more
       cell = dof_2.begin();
       endc = dof_2.end();
       for (unsigned int index=0; cell!=endc; ++cell)
-       if (cell->active())
-         {
-           ++index;
-           if (index % 3 == 1)
-             cell->set_refine_flag ();
-         };
-      
+        if (cell->active())
+          {
+            ++index;
+            if (index % 3 == 1)
+              cell->set_refine_flag ();
+          };
+
       tria_2.execute_coarsening_and_refinement ();
 
-                                      // use the following instead of
-                                      // the previous block when
-                                      // testing continuous elements
-                                      // in 2d
+      // use the following instead of
+      // the previous block when
+      // testing continuous elements
+      // in 2d
 //      tria_2.refine_global(1);
     };
 
index cf17a323187c17208f57f26acdd93171af1a8de1..dac68c853b5824b52af512cb9abcad48f442a91f 100644 (file)
@@ -40,10 +40,10 @@ template <int dim>
 void check ()
 {
   deallog << "Checking in " << dim << " space dimensions"
-         << std::endl
-         << "---------------------------------------" << std::endl;
-  
-                                  // create two grids
+          << std::endl
+          << "---------------------------------------" << std::endl;
+
+  // create two grids
   Triangulation<dim> tria_1, tria_2;
   GridGenerator::hyper_cube (tria_1, -1, 1);
   tria_1.refine_global (5-dim);
@@ -51,64 +51,64 @@ void check ()
 
   FE_Q<dim> fe_1(1);
   FE_Q<dim> fe_2(2);
-  
-                                  // make several loops to refine the
-                                  // two grids
+
+  // make several loops to refine the
+  // two grids
   for (unsigned int i=0; i<3; ++i)
     {
       deallog << "Refinement step " << i << std::endl;
-      
+
       DoFHandler<dim> dof_1 (tria_1);
       DoFHandler<dim> dof_2 (tria_2);
 
       dof_1.distribute_dofs (fe_1);
       dof_2.distribute_dofs (fe_2);
 
-                                      // create some mapping
+      // create some mapping
       InterGridMap<DoFHandler<dim> > intergrid_map_1;
       InterGridMap<DoFHandler<dim> > intergrid_map_2;
       intergrid_map_1.make_mapping (dof_1, dof_2);
       intergrid_map_2.make_mapping (dof_2, dof_1);
 
-                                      // write out the mapping
+      // write out the mapping
       typename DoFHandler<dim>::cell_iterator cell=dof_1.begin(),
-                                             endc=dof_1.end();
+                                              endc=dof_1.end();
       for (; cell!=endc; ++cell)
-       {
-         deallog << cell
-                 << "->"
-                 << intergrid_map_1[cell]
-                 << "->"
-                 << intergrid_map_2[intergrid_map_1[cell]]
-                 << std::endl;
+        {
+          deallog << cell
+                  << "->"
+                  << intergrid_map_1[cell]
+                  << "->"
+                  << intergrid_map_2[intergrid_map_1[cell]]
+                  << std::endl;
 // note that not necessarily intergrid_map_2[intergrid_map_1[cell]] ==
 // cell, since the meshes have different refinement steps.
-       };
-      
+        };
 
 
-                                      // now refine grids a little,
-                                      // but differently. this
-                                      // produces quite random grids
+
+      // now refine grids a little,
+      // but differently. this
+      // produces quite random grids
       cell = dof_1.begin();
       for (unsigned int index=0; cell!=endc; ++cell)
-       if (cell->active())
-         {
-           ++index;
-           if (index % 3 == 0)
-             cell->set_refine_flag ();
-         };
+        if (cell->active())
+          {
+            ++index;
+            if (index % 3 == 0)
+              cell->set_refine_flag ();
+          };
 
       cell = dof_2.begin();
       endc = dof_2.end();
       for (unsigned int index=0; cell!=endc; ++cell)
-       if (cell->active())
-         {
-           ++index;
-           if (index % 3 == 1)
-             cell->set_refine_flag ();
-         };
-      
+        if (cell->active())
+          {
+            ++index;
+            if (index % 3 == 1)
+              cell->set_refine_flag ();
+          };
+
       tria_1.execute_coarsening_and_refinement ();
       tria_2.execute_coarsening_and_refinement ();
     };
@@ -120,7 +120,7 @@ int main ()
 {
   std::ofstream logfile("intergrid_map/output");
   deallog << std::setprecision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
index 229e1b834cefc1e7d3979c94417848365b96a7ba..fb75b39d523a1601620fb74d2f6efa1f3e936838 100644 (file)
 #include <deal.II/dofs/dof_tools.h>
 #include <deal.II/numerics/vector_tools.h>
 
-                                 // We need a FESystem
+// We need a FESystem
 #include <deal.II/fe/fe_system.h>
 
-                                 // we need RT-elements
-                                 // and Q1-elements
+// we need RT-elements
+// and Q1-elements
 #include <deal.II/fe/fe_q.h>
 #include <deal.II/fe/fe_raviart_thomas.h>
 
 template <int dim>
 class VectorBoundaryValues :  public Function<dim>
 {
-  public:
-    VectorBoundaryValues ();
-    virtual void vector_value (const Point<dim> &p,
-                               Vector<double>   &values) const;
+public:
+  VectorBoundaryValues ();
+  virtual void vector_value (const Point<dim> &p,
+                             Vector<double>   &values) const;
 };
 
 template <int dim>
 VectorBoundaryValues<dim>::VectorBoundaryValues () :
-                Function<dim> (dim+1)
+  Function<dim> (dim+1)
 {}
 
 template <int dim>
@@ -68,8 +68,8 @@ void VectorBoundaryValues<dim>::vector_value (const Point<dim> &,
 {
   Assert (values.size() == dim+1,
           ExcDimensionMismatch (values.size(), dim+1));
-  
-  for (unsigned int d=0;d<dim+1;++d)
+
+  for (unsigned int d=0; d<dim+1; ++d)
     values(d) = 13.;//+d;
 }
 
@@ -78,28 +78,28 @@ void VectorBoundaryValues<dim>::vector_value (const Point<dim> &,
 template <int dim>
 class FindBug
 {
-  public:
-    FindBug ();
-    void run ();
-  private:
-    void make_grid_and_dofs ();
-    void dirichlet_conditions ();
-
-    Triangulation<dim>     triangulation;
-    FESystem<dim>              fe;
-    DoFHandler<dim>        dof_handler;
-    Vector<double>          solution;
+public:
+  FindBug ();
+  void run ();
+private:
+  void make_grid_and_dofs ();
+  void dirichlet_conditions ();
+
+  Triangulation<dim>     triangulation;
+  FESystem<dim>              fe;
+  DoFHandler<dim>        dof_handler;
+  Vector<double>          solution;
 };
 
 
-                                 // Construct FESystem with
-                                 // first component: Q1-Element,
-                                 // second component: lowest order DG_Element
+// Construct FESystem with
+// first component: Q1-Element,
+// second component: lowest order DG_Element
 template <int dim>
 FindBug<dim>::FindBug () :
-                fe (FE_RaviartThomas<dim>(0), 1,
-                    FE_Q<dim>(1), 1),
-                dof_handler (triangulation)
+  fe (FE_RaviartThomas<dim>(0), 1,
+      FE_Q<dim>(1), 1),
+  dof_handler (triangulation)
 {}
 
 
@@ -137,13 +137,13 @@ void FindBug<dim>::dirichlet_conditions ()
   std::vector<bool> component_mask(dim+1, false);
   component_mask[dim] = true;
 
-                                   // This is just for the final
-                                   // output-test
+  // This is just for the final
+  // output-test
   for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
     dirichlet_dofs[i] = 1.;
 
 
-                                   // Here comes the crucial call....
+  // Here comes the crucial call....
   VectorTools::interpolate_boundary_values (dof_handler,
                                             0,
                                             VectorBoundaryValues<dim> (),
@@ -155,19 +155,19 @@ void FindBug<dim>::dirichlet_conditions ()
   std::set<types::boundary_id> boundary_indicators;
   boundary_indicators.insert (0);
 
-                                   // get a list of those boundary DoFs which
-                                   // we want to be fixed:
+  // get a list of those boundary DoFs which
+  // we want to be fixed:
   DoFTools::extract_boundary_dofs (dof_handler,
                                    component_mask,
                                    fixed_dofs,
                                    boundary_indicators);
 
-                                   // (Primitive) Check if the DoFs
-                                   // where adjusted correctly (note
-                                   // that we have preset all values
-                                   // to 1, and interpolate_b_v should
-                                   // have overwritten those for
-                                   // component 0 by 0)
+  // (Primitive) Check if the DoFs
+  // where adjusted correctly (note
+  // that we have preset all values
+  // to 1, and interpolate_b_v should
+  // have overwritten those for
+  // component 0 by 0)
   for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
     {
       if (fixed_dofs[i] == true)
@@ -180,9 +180,9 @@ void FindBug<dim>::dirichlet_conditions ()
         };
     };
 
-                                   // check 1 has obviously succeeded,
-                                   // so also check a more complicated
-                                   // boundary value function
+  // check 1 has obviously succeeded,
+  // so also check a more complicated
+  // boundary value function
   dirichlet_dofs.clear ();
   VectorTools::interpolate_boundary_values (dof_handler,
                                             0,
@@ -214,7 +214,7 @@ int main ()
 
   FindBug<2>().run ();
   FindBug<3>().run ();
-  
+
   return 0;
 }
 
index 933a90ff9c7c7bd12cd62338f43a43e26c91cc7d..b90b81d0be94b48007d525644f43f4195439d92c 100644 (file)
@@ -69,7 +69,7 @@ void test ()
                                             boundary_values);
   deallog << boundary_values.size() << std::endl;
   for (std::map<types::global_dof_index,double>::const_iterator
-        p = boundary_values.begin();
+       p = boundary_values.begin();
        p != boundary_values.end(); ++p)
     deallog << p->first << ' ' << p->second << std::endl;
 }
index 140f03752b84e3e3cee06c93dc59c7f18c30ea36..87e31c96a16f0ab4f9a6cb75a5d5d5afc259fb8a 100644 (file)
 template <int dim>
 class F :  public Function<dim>
 {
-  public:
-    F (const unsigned int q) : q(q) {}
-    
-    virtual double value (const Point<dim> &p,
-                         const unsigned int) const
-      {
-       double v=0;
-       for (unsigned int d=0; d<dim; ++d)
-         for (unsigned int i=0; i<=q; ++i)
-           v += (d+1)*(i+1)*std::pow (p[d], 1.*i);
-       return v;
-      }
-
-  private:
-    const unsigned int q;
+public:
+  F (const unsigned int q) : q(q) {}
+
+  virtual double value (const Point<dim> &p,
+                        const unsigned int) const
+  {
+    double v=0;
+    for (unsigned int d=0; d<dim; ++d)
+      for (unsigned int i=0; i<=q; ++i)
+        v += (d+1)*(i+1)*std::pow (p[d], 1.*i);
+    return v;
+  }
+
+private:
+  const unsigned int q;
 };
 
 
@@ -79,27 +79,27 @@ void test ()
       Vector<double> interpolant (dof_handler.n_dofs());
       Vector<float>  error (triangulation.n_active_cells());
       for (unsigned int q=0; q<=p+2; ++q)
-       {
-                                          // interpolate the function
-         VectorTools::interpolate (dof_handler,
-                                   F<dim> (q),
-                                   interpolant);
-      
-                                          // then compute the interpolation error
-         VectorTools::integrate_difference (dof_handler,
-                                            interpolant,
-                                            F<dim> (q),
-                                            error,
-                                            QGauss<dim>(q+2),
-                                            VectorTools::L2_norm);
-         if (q<=p)
-           Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
-                   ExcInternalError());
-
-         deallog << fe.get_name() << ", P_" << q
-                 << ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
-                 << std::endl;
-       }
+        {
+          // interpolate the function
+          VectorTools::interpolate (dof_handler,
+                                    F<dim> (q),
+                                    interpolant);
+
+          // then compute the interpolation error
+          VectorTools::integrate_difference (dof_handler,
+                                             interpolant,
+                                             F<dim> (q),
+                                             error,
+                                             QGauss<dim>(q+2),
+                                             VectorTools::L2_norm);
+          if (q<=p)
+            Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
+                    ExcInternalError());
+
+          deallog << fe.get_name() << ", P_" << q
+                  << ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
+                  << std::endl;
+        }
     }
 }
 
@@ -109,7 +109,7 @@ int main ()
 {
   std::ofstream logfile("interpolate_dgq_01/output");
   deallog << std::setprecision (3);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
index a7e8abccfbf3505eb47bde55bd29e0676ac90343..1b7b595295b6469d42d5933c93d599926fe2c19b 100644 (file)
 template <int dim>
 class F :  public Function<dim>
 {
-  public:
-    F (const unsigned int q) : q(q) {}
-    
-    virtual double value (const Point<dim> &p,
-                         const unsigned int) const
-      {
-       double v=0;
-       for (unsigned int d=0; d<dim; ++d)
-         for (unsigned int i=0; i<=q; ++i)
-           v += (d+1)*(i+1)*std::pow (p[d], 1.*i);
-       return v;
-      }
-
-  private:
-    const unsigned int q;
+public:
+  F (const unsigned int q) : q(q) {}
+
+  virtual double value (const Point<dim> &p,
+                        const unsigned int) const
+  {
+    double v=0;
+    for (unsigned int d=0; d<dim; ++d)
+      for (unsigned int i=0; i<=q; ++i)
+        v += (d+1)*(i+1)*std::pow (p[d], 1.*i);
+    return v;
+  }
+
+private:
+  const unsigned int q;
 };
 
 
@@ -73,7 +73,7 @@ void test ()
   triangulation.refine_global (1);
   triangulation.begin_active()->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
-  triangulation.refine_global (1);  
+  triangulation.refine_global (1);
 
   for (unsigned int p=1; p<6-dim; ++p)
     {
@@ -84,32 +84,32 @@ void test ()
       ConstraintMatrix constraints;
       DoFTools::make_hanging_node_constraints (dof_handler, constraints);
       constraints.close ();
-      
+
       Vector<double> interpolant (dof_handler.n_dofs());
       Vector<float>  error (triangulation.n_active_cells());
       for (unsigned int q=0; q<=p+2; ++q)
-       {
-                                          // interpolate the function
-         VectorTools::interpolate (dof_handler,
-                                   F<dim> (q),
-                                   interpolant);
-         constraints.distribute (interpolant);
-         
-                                          // then compute the interpolation error
-         VectorTools::integrate_difference (dof_handler,
-                                            interpolant,
-                                            F<dim> (q),
-                                            error,
-                                            QGauss<dim>(q+2),
-                                            VectorTools::L2_norm);
-         if (q<=p)
-           Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
-                   ExcInternalError());
-
-         deallog << fe.get_name() << ", P_" << q
-                 << ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
-                 << std::endl;
-       }
+        {
+          // interpolate the function
+          VectorTools::interpolate (dof_handler,
+                                    F<dim> (q),
+                                    interpolant);
+          constraints.distribute (interpolant);
+
+          // then compute the interpolation error
+          VectorTools::integrate_difference (dof_handler,
+                                             interpolant,
+                                             F<dim> (q),
+                                             error,
+                                             QGauss<dim>(q+2),
+                                             VectorTools::L2_norm);
+          if (q<=p)
+            Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
+                    ExcInternalError());
+
+          deallog << fe.get_name() << ", P_" << q
+                  << ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
+                  << std::endl;
+        }
     }
 }
 
@@ -119,7 +119,7 @@ int main ()
 {
   std::ofstream logfile("interpolate_dgq_02/output");
   deallog << std::setprecision (3);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
index 60891b7ded7d773269b2c81d6f8ba5b214532313..608e0f8dfaa7b23952651dbae5d660f0356eb08e 100644 (file)
 template <int dim>
 class F :  public Function<dim>
 {
-  public:
-    F (const unsigned int q) : q(q) {}
-    
-    virtual double value (const Point<dim> &p,
-                         const unsigned int) const
-      {
-       double v=0;
-       for (unsigned int d=0; d<dim; ++d)
-         for (unsigned int i=0; i<=q; ++i)
-           v += (d+1)*(i+1)*std::pow (p[d], 1.*i);
-       return v;
-      }
-
-  private:
-    const unsigned int q;
+public:
+  F (const unsigned int q) : q(q) {}
+
+  virtual double value (const Point<dim> &p,
+                        const unsigned int) const
+  {
+    double v=0;
+    for (unsigned int d=0; d<dim; ++d)
+      for (unsigned int i=0; i<=q; ++i)
+        v += (d+1)*(i+1)*std::pow (p[d], 1.*i);
+    return v;
+  }
+
+private:
+  const unsigned int q;
 };
 
 
@@ -79,27 +79,27 @@ void test ()
       Vector<double> interpolant (dof_handler.n_dofs());
       Vector<float>  error (triangulation.n_active_cells());
       for (unsigned int q=0; q<=p+2; ++q)
-       {
-                                          // interpolate the function
-         VectorTools::interpolate (dof_handler,
-                                   F<dim> (q),
-                                   interpolant);
-      
-                                          // then compute the interpolation error
-         VectorTools::integrate_difference (dof_handler,
-                                            interpolant,
-                                            F<dim> (q),
-                                            error,
-                                            QGauss<dim>(q+2),
-                                            VectorTools::L2_norm);
-         if (q<=p)
-           Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
-                   ExcInternalError());
-
-         deallog << fe.get_name() << ", P_" << q
-                 << ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
-                 << std::endl;
-       }
+        {
+          // interpolate the function
+          VectorTools::interpolate (dof_handler,
+                                    F<dim> (q),
+                                    interpolant);
+
+          // then compute the interpolation error
+          VectorTools::integrate_difference (dof_handler,
+                                             interpolant,
+                                             F<dim> (q),
+                                             error,
+                                             QGauss<dim>(q+2),
+                                             VectorTools::L2_norm);
+          if (q<=p)
+            Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
+                    ExcInternalError());
+
+          deallog << fe.get_name() << ", P_" << q
+                  << ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
+                  << std::endl;
+        }
     }
 }
 
@@ -109,7 +109,7 @@ int main ()
 {
   std::ofstream logfile("interpolate_q_01/output");
   deallog << std::setprecision (3);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
index 1782c29ed83a3933ceab6457e479c8de8957ee18..d42752295ef2ad5beef40a4af0b05f79486c5bc0 100644 (file)
 template <int dim>
 class F :  public Function<dim>
 {
-  public:
-    F (const unsigned int q) : q(q) {}
-    
-    virtual double value (const Point<dim> &p,
-                         const unsigned int) const
-      {
-       double v=0;
-       for (unsigned int d=0; d<dim; ++d)
-         for (unsigned int i=0; i<=q; ++i)
-           v += (d+1)*(i+1)*std::pow (p[d], 1.*i);
-       return v;
-      }
-
-  private:
-    const unsigned int q;
+public:
+  F (const unsigned int q) : q(q) {}
+
+  virtual double value (const Point<dim> &p,
+                        const unsigned int) const
+  {
+    double v=0;
+    for (unsigned int d=0; d<dim; ++d)
+      for (unsigned int i=0; i<=q; ++i)
+        v += (d+1)*(i+1)*std::pow (p[d], 1.*i);
+    return v;
+  }
+
+private:
+  const unsigned int q;
 };
 
 
@@ -73,7 +73,7 @@ void test ()
   triangulation.refine_global (1);
   triangulation.begin_active()->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
-  triangulation.refine_global (1);  
+  triangulation.refine_global (1);
 
   for (unsigned int p=1; p<6-dim; ++p)
     {
@@ -84,32 +84,32 @@ void test ()
       ConstraintMatrix constraints;
       DoFTools::make_hanging_node_constraints (dof_handler, constraints);
       constraints.close ();
-      
+
       Vector<double> interpolant (dof_handler.n_dofs());
       Vector<float>  error (triangulation.n_active_cells());
       for (unsigned int q=0; q<=p+2; ++q)
-       {
-                                          // interpolate the function
-         VectorTools::interpolate (dof_handler,
-                                   F<dim> (q),
-                                   interpolant);
-         constraints.distribute (interpolant);
-         
-                                          // then compute the interpolation error
-         VectorTools::integrate_difference (dof_handler,
-                                            interpolant,
-                                            F<dim> (q),
-                                            error,
-                                            QGauss<dim>(q+2),
-                                            VectorTools::L2_norm);
-         if (q<=p)
-           Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
-                   ExcInternalError());
-
-         deallog << fe.get_name() << ", P_" << q
-                 << ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
-                 << std::endl;
-       }
+        {
+          // interpolate the function
+          VectorTools::interpolate (dof_handler,
+                                    F<dim> (q),
+                                    interpolant);
+          constraints.distribute (interpolant);
+
+          // then compute the interpolation error
+          VectorTools::integrate_difference (dof_handler,
+                                             interpolant,
+                                             F<dim> (q),
+                                             error,
+                                             QGauss<dim>(q+2),
+                                             VectorTools::L2_norm);
+          if (q<=p)
+            Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
+                    ExcInternalError());
+
+          deallog << fe.get_name() << ", P_" << q
+                  << ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
+                  << std::endl;
+        }
     }
 }
 
@@ -119,7 +119,7 @@ int main ()
 {
   std::ofstream logfile("interpolate_q_02/output");
   deallog << std::setprecision (3);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
index 3e37057383ded5640fe64b8412265d230e10a6f2..c79b6807e168f2ec8062a3653b79a644e9e86175 100644 (file)
 template <int dim>
 class F :  public Function<dim>
 {
-  public:
-    F (const unsigned int q) : Function<dim>(3), q(q) {}
-    
-    virtual void vector_value (const Point<dim> &p,
-                              Vector<double>   &v) const
+public:
+  F (const unsigned int q) : Function<dim>(3), q(q) {}
+
+  virtual void vector_value (const Point<dim> &p,
+                             Vector<double>   &v) const
+  {
+    for (unsigned int c=0; c<v.size(); ++c)
       {
-       for (unsigned int c=0; c<v.size(); ++c)
-         {
-           v(c) = 0;
-           for (unsigned int d=0; d<dim; ++d)
-             for (unsigned int i=0; i<=q; ++i)
-               v(c) += (d+1)*(i+1)*std::pow (p[d], 1.*i)+c;
-         }
+        v(c) = 0;
+        for (unsigned int d=0; d<dim; ++d)
+          for (unsigned int i=0; i<=q; ++i)
+            v(c) += (d+1)*(i+1)*std::pow (p[d], 1.*i)+c;
       }
+  }
 
-  private:
-    const unsigned int q;
+private:
+  const unsigned int q;
 };
 
 
@@ -78,34 +78,34 @@ void test ()
       FE_Q<dim> fe_1(p);
       FE_Q<dim> fe_2(p+1);
       FESystem<dim>              fe(fe_1, 2,
-                                   fe_2, 1);
+                                    fe_2, 1);
       DoFHandler<dim>        dof_handler(triangulation);
       dof_handler.distribute_dofs (fe);
 
       Vector<double> interpolant (dof_handler.n_dofs());
       Vector<float>  error (triangulation.n_active_cells());
       for (unsigned int q=0; q<=p+2; ++q)
-       {
-                                          // interpolate the function
-         VectorTools::interpolate (dof_handler,
-                                   F<dim> (q),
-                                   interpolant);
-      
-                                          // then compute the interpolation error
-         VectorTools::integrate_difference (dof_handler,
-                                            interpolant,
-                                            F<dim> (q),
-                                            error,
-                                            QGauss<dim>(q+2),
-                                            VectorTools::L2_norm);
-         if (q<=p)
-           Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
-                   ExcInternalError());
-
-         deallog << fe.get_name() << ", P_" << q
-                 << ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
-                 << std::endl;
-       }
+        {
+          // interpolate the function
+          VectorTools::interpolate (dof_handler,
+                                    F<dim> (q),
+                                    interpolant);
+
+          // then compute the interpolation error
+          VectorTools::integrate_difference (dof_handler,
+                                             interpolant,
+                                             F<dim> (q),
+                                             error,
+                                             QGauss<dim>(q+2),
+                                             VectorTools::L2_norm);
+          if (q<=p)
+            Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
+                    ExcInternalError());
+
+          deallog << fe.get_name() << ", P_" << q
+                  << ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
+                  << std::endl;
+        }
     }
 }
 
@@ -115,7 +115,7 @@ int main ()
 {
   std::ofstream logfile("interpolate_q_system_01/output");
   deallog << std::setprecision (3);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
index b89b5aafdf6824aa5a01a73672548bc1d59d1fe0..9208919f9e103fad0229509ac533c467d81fc212 100644 (file)
 template <int dim>
 class F :  public Function<dim>
 {
-  public:
-    F (const unsigned int q) : Function<dim>(3), q(q) {}
-    
-    virtual void vector_value (const Point<dim> &p,
-                              Vector<double>   &v) const
+public:
+  F (const unsigned int q) : Function<dim>(3), q(q) {}
+
+  virtual void vector_value (const Point<dim> &p,
+                             Vector<double>   &v) const
+  {
+    for (unsigned int c=0; c<v.size(); ++c)
       {
-       for (unsigned int c=0; c<v.size(); ++c)
-         {
-           v(c) = 0;
-           for (unsigned int d=0; d<dim; ++d)
-             for (unsigned int i=0; i<=q; ++i)
-               v(c) += (d+1)*(i+1)*std::pow (p[d], 1.*i)+c;
-         }
+        v(c) = 0;
+        for (unsigned int d=0; d<dim; ++d)
+          for (unsigned int i=0; i<=q; ++i)
+            v(c) += (d+1)*(i+1)*std::pow (p[d], 1.*i)+c;
       }
+  }
 
-  private:
-    const unsigned int q;
+private:
+  const unsigned int q;
 };
 
 
@@ -76,7 +76,7 @@ void test ()
   triangulation.refine_global (1);
   triangulation.begin_active()->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
-  triangulation.refine_global (1);  
+  triangulation.refine_global (1);
 
   for (unsigned int p=1; p<6-dim; ++p)
     {
@@ -93,28 +93,28 @@ void test ()
       Vector<double> interpolant (dof_handler.n_dofs());
       Vector<float>  error (triangulation.n_active_cells());
       for (unsigned int q=0; q<=p+2; ++q)
-       {
-                                          // interpolate the function
-         VectorTools::interpolate (dof_handler,
-                                   F<dim> (q),
-                                   interpolant);
-         constraints.distribute (interpolant);
-      
-                                          // then compute the interpolation error
-         VectorTools::integrate_difference (dof_handler,
-                                            interpolant,
-                                            F<dim> (q),
-                                            error,
-                                            QGauss<dim>(q+2),
-                                            VectorTools::L2_norm);
-         if (q<=p)
-           Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
-                   ExcInternalError());
-
-         deallog << fe.get_name() << ", P_" << q
-                 << ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
-                 << std::endl;
-       }
+        {
+          // interpolate the function
+          VectorTools::interpolate (dof_handler,
+                                    F<dim> (q),
+                                    interpolant);
+          constraints.distribute (interpolant);
+
+          // then compute the interpolation error
+          VectorTools::integrate_difference (dof_handler,
+                                             interpolant,
+                                             F<dim> (q),
+                                             error,
+                                             QGauss<dim>(q+2),
+                                             VectorTools::L2_norm);
+          if (q<=p)
+            Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
+                    ExcInternalError());
+
+          deallog << fe.get_name() << ", P_" << q
+                  << ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
+                  << std::endl;
+        }
     }
 }
 
@@ -124,7 +124,7 @@ int main ()
 {
   std::ofstream logfile("interpolate_q_system_02/output");
   deallog << std::setprecision (3);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
index ba331b472ec8eddba2f46b3a2c925a31b236528c..500e67e42a5585fa4e9f35ae79a1b4438a864ebf 100644 (file)
@@ -50,149 +50,150 @@ char logname[] = "kelly_crash_02/output";
 void test ()
 {
   const unsigned int dim = 3;
-  
+
   static const Point<3> vertices_1[]
-    = 
-    {
-                                          // points on the lower surface
-         Point<dim>(0,  0, -4),
-         Point<dim>(std::cos(0*numbers::PI/6),
-                    std::sin(0*numbers::PI/6),
-                    -4),
-         Point<dim>(std::cos(2*numbers::PI/6),
-                    std::sin(2*numbers::PI/6),
-                    -4),
-         Point<dim>(std::cos(4*numbers::PI/6),
-                    std::sin(4*numbers::PI/6),
-                    -4),
-         Point<dim>(std::cos(6*numbers::PI/6),
-                    std::sin(6*numbers::PI/6),
-                    -4),
-         Point<dim>(std::cos(8*numbers::PI/6),
-                    std::sin(8*numbers::PI/6),
-                    -4),
-         Point<dim>(std::cos(10*numbers::PI/6),
-                    std::sin(10*numbers::PI/6),
-                    -4),
-
-                                          // same points on the top
-                                          // of the stem, with
-                                          // indentation in the middle
-         Point<dim>(0,  0, 4-std::sqrt(2.)/2),
-         Point<dim>(std::cos(0*numbers::PI/6),
-                    std::sin(0*numbers::PI/6),
-                    4),
-         Point<dim>(std::cos(2*numbers::PI/6),
-                    std::sin(2*numbers::PI/6),
-                    4),
-         Point<dim>(std::cos(4*numbers::PI/6),
-                    std::sin(4*numbers::PI/6),
-                    4),
-         Point<dim>(std::cos(6*numbers::PI/6),
-                    std::sin(6*numbers::PI/6),
-                    4),
-         Point<dim>(std::cos(8*numbers::PI/6),
-                    std::sin(8*numbers::PI/6),
-                    4),
-         Point<dim>(std::cos(10*numbers::PI/6),
-                    std::sin(10*numbers::PI/6),
-                    4),
-
-                                          // point at top of chevron
-         Point<dim>(0,0,4+std::sqrt(2.)/2),
-
-                                          // points at the top of the
-                                          // first extension
-                                          // points 15-18
-         Point<dim>(0,  0, 7) + Point<dim> (std::cos(2*numbers::PI/6),
-                                            std::sin(2*numbers::PI/6),
-                                            0) * 4,
-         Point<dim>(std::cos(0*numbers::PI/6),
-                    std::sin(0*numbers::PI/6),
-                    7) + Point<dim> (std::cos(2*numbers::PI/6),
-                                     std::sin(2*numbers::PI/6),
-                                     0) * 4,
-         Point<dim>(std::cos(2*numbers::PI/6),
-                    std::sin(2*numbers::PI/6),
-                    7) + Point<dim> (std::cos(2*numbers::PI/6),
-                                     std::sin(2*numbers::PI/6),
-                                     0) * 4,
-         Point<dim>(std::cos(4*numbers::PI/6),
-                    std::sin(4*numbers::PI/6),
-                    7) + Point<dim> (std::cos(2*numbers::PI/6),
-                                     std::sin(2*numbers::PI/6),
-                                     0) * 4,
-
-                                          // points at the top of the
-                                          // second extension
-                                          // points 19-22
-         Point<dim>(0,  0, 7) + Point<dim> (std::cos(6*numbers::PI/6),
-                                            std::sin(6*numbers::PI/6),
-                                            0) * 4,
-         Point<dim>(std::cos(4*numbers::PI/6),
-                    std::sin(4*numbers::PI/6),
-                    7) + Point<dim> (std::cos(6*numbers::PI/6),
-                                     std::sin(6*numbers::PI/6),
-                                     0) * 4,
-         Point<dim>(std::cos(6*numbers::PI/6),
-                    std::sin(6*numbers::PI/6),
-                    7) + Point<dim> (std::cos(6*numbers::PI/6),
-                                     std::sin(6*numbers::PI/6),
-                                     0) * 4,
-         Point<dim>(std::cos(8*numbers::PI/6),
-                    std::sin(8*numbers::PI/6),
-                    7) + Point<dim> (std::cos(6*numbers::PI/6),
-                                     std::sin(6*numbers::PI/6),
-                                     0) * 4,
-
-                                          // points at the top of the
-                                          // third extension
-                                          // points 23-26
-         Point<dim>(0,  0, 7) + Point<dim> (std::cos(10*numbers::PI/6),
-                                            std::sin(10*numbers::PI/6),
-                                            0) * 4,
-         Point<dim>(std::cos(8*numbers::PI/6),
-                    std::sin(8*numbers::PI/6),
-                    7) + Point<dim> (std::cos(10*numbers::PI/6),
-                                     std::sin(10*numbers::PI/6),
-                                     0) * 4,
-         Point<dim>(std::cos(10*numbers::PI/6),
-                    std::sin(10*numbers::PI/6),
-                    7) + Point<dim> (std::cos(10*numbers::PI/6),
-                                     std::sin(10*numbers::PI/6),
-                                     0) * 4,
-         Point<dim>(std::cos(0*numbers::PI/6),
-                    std::sin(0*numbers::PI/6),
-                    7) + Point<dim> (std::cos(10*numbers::PI/6),
-                                     std::sin(10*numbers::PI/6),
-                                     0) * 4,
-         
-    };
-  
+  =
+  {
+    // points on the lower surface
+    Point<dim>(0,  0, -4),
+    Point<dim>(std::cos(0*numbers::PI/6),
+    std::sin(0*numbers::PI/6),
+    -4),
+    Point<dim>(std::cos(2*numbers::PI/6),
+    std::sin(2*numbers::PI/6),
+    -4),
+    Point<dim>(std::cos(4*numbers::PI/6),
+    std::sin(4*numbers::PI/6),
+    -4),
+    Point<dim>(std::cos(6*numbers::PI/6),
+    std::sin(6*numbers::PI/6),
+    -4),
+    Point<dim>(std::cos(8*numbers::PI/6),
+    std::sin(8*numbers::PI/6),
+    -4),
+    Point<dim>(std::cos(10*numbers::PI/6),
+    std::sin(10*numbers::PI/6),
+    -4),
+
+    // same points on the top
+    // of the stem, with
+    // indentation in the middle
+    Point<dim>(0,  0, 4-std::sqrt(2.)/2),
+    Point<dim>(std::cos(0*numbers::PI/6),
+    std::sin(0*numbers::PI/6),
+    4),
+    Point<dim>(std::cos(2*numbers::PI/6),
+    std::sin(2*numbers::PI/6),
+    4),
+    Point<dim>(std::cos(4*numbers::PI/6),
+    std::sin(4*numbers::PI/6),
+    4),
+    Point<dim>(std::cos(6*numbers::PI/6),
+    std::sin(6*numbers::PI/6),
+    4),
+    Point<dim>(std::cos(8*numbers::PI/6),
+    std::sin(8*numbers::PI/6),
+    4),
+    Point<dim>(std::cos(10*numbers::PI/6),
+    std::sin(10*numbers::PI/6),
+    4),
+
+    // point at top of chevron
+    Point<dim>(0,0,4+std::sqrt(2.)/2),
+
+    // points at the top of the
+    // first extension
+    // points 15-18
+    Point<dim>(0,  0, 7) + Point<dim> (std::cos(2*numbers::PI/6),
+    std::sin(2*numbers::PI/6),
+    0) * 4,
+    Point<dim>(std::cos(0*numbers::PI/6),
+    std::sin(0*numbers::PI/6),
+    7) + Point<dim> (std::cos(2*numbers::PI/6),
+    std::sin(2*numbers::PI/6),
+    0) * 4,
+    Point<dim>(std::cos(2*numbers::PI/6),
+    std::sin(2*numbers::PI/6),
+    7) + Point<dim> (std::cos(2*numbers::PI/6),
+    std::sin(2*numbers::PI/6),
+    0) * 4,
+    Point<dim>(std::cos(4*numbers::PI/6),
+    std::sin(4*numbers::PI/6),
+    7) + Point<dim> (std::cos(2*numbers::PI/6),
+    std::sin(2*numbers::PI/6),
+    0) * 4,
+
+    // points at the top of the
+    // second extension
+    // points 19-22
+    Point<dim>(0,  0, 7) + Point<dim> (std::cos(6*numbers::PI/6),
+    std::sin(6*numbers::PI/6),
+    0) * 4,
+    Point<dim>(std::cos(4*numbers::PI/6),
+    std::sin(4*numbers::PI/6),
+    7) + Point<dim> (std::cos(6*numbers::PI/6),
+    std::sin(6*numbers::PI/6),
+    0) * 4,
+    Point<dim>(std::cos(6*numbers::PI/6),
+    std::sin(6*numbers::PI/6),
+    7) + Point<dim> (std::cos(6*numbers::PI/6),
+    std::sin(6*numbers::PI/6),
+    0) * 4,
+    Point<dim>(std::cos(8*numbers::PI/6),
+    std::sin(8*numbers::PI/6),
+    7) + Point<dim> (std::cos(6*numbers::PI/6),
+    std::sin(6*numbers::PI/6),
+    0) * 4,
+
+    // points at the top of the
+    // third extension
+    // points 23-26
+    Point<dim>(0,  0, 7) + Point<dim> (std::cos(10*numbers::PI/6),
+    std::sin(10*numbers::PI/6),
+    0) * 4,
+    Point<dim>(std::cos(8*numbers::PI/6),
+    std::sin(8*numbers::PI/6),
+    7) + Point<dim> (std::cos(10*numbers::PI/6),
+    std::sin(10*numbers::PI/6),
+    0) * 4,
+    Point<dim>(std::cos(10*numbers::PI/6),
+    std::sin(10*numbers::PI/6),
+    7) + Point<dim> (std::cos(10*numbers::PI/6),
+    std::sin(10*numbers::PI/6),
+    0) * 4,
+    Point<dim>(std::cos(0*numbers::PI/6),
+    std::sin(0*numbers::PI/6),
+    7) + Point<dim> (std::cos(10*numbers::PI/6),
+    std::sin(10*numbers::PI/6),
+    0) * 4,
+
+  };
+
   const unsigned int
-    n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
+  n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
   const std::vector<Point<dim> > vertices (&vertices_1[0],
                                            &vertices_1[n_vertices]);
   static const int cell_vertices[][GeometryInfo<dim>::vertices_per_cell]
-    = {
-                                          // the three cells in the stem
-         {0, 2, 4, 3, 7, 9, 11, 10},
-         {6, 0, 5, 4, 13, 7, 12, 11},
-         {6, 1, 0, 2, 13, 8, 7, 9},
-                                          // the chevron at the center
-         {13, 8, 7, 9, 12, 14, 11, 10},
-                                          // first extension
-         {14, 8, 10, 9, 15, 16, 18, 17},
-                                          // second extension
-         {11, 12, 10, 14, 21, 22, 20, 19},
-                                          // third extension
-         {12, 13, 14, 8, 24, 25, 23, 26},
-    };
+  =
+  {
+    // the three cells in the stem
+    {0, 2, 4, 3, 7, 9, 11, 10},
+    {6, 0, 5, 4, 13, 7, 12, 11},
+    {6, 1, 0, 2, 13, 8, 7, 9},
+    // the chevron at the center
+    {13, 8, 7, 9, 12, 14, 11, 10},
+    // first extension
+    {14, 8, 10, 9, 15, 16, 18, 17},
+    // second extension
+    {11, 12, 10, 14, 21, 22, 20, 19},
+    // third extension
+    {12, 13, 14, 8, 24, 25, 23, 26},
+  };
   const unsigned int
-    n_cells = sizeof(cell_vertices) / sizeof(cell_vertices[0]);
+  n_cells = sizeof(cell_vertices) / sizeof(cell_vertices[0]);
 
   std::vector<CellData<dim> > cells (n_cells, CellData<dim>());
-  for (unsigned int i=0; i<n_cells; ++i) 
+  for (unsigned int i=0; i<n_cells; ++i)
     {
       for (unsigned int j=0;
            j<GeometryInfo<dim>::vertices_per_cell;
@@ -203,41 +204,41 @@ void test ()
 
   Triangulation<3> triangulation;
   triangulation.create_triangulation (vertices,
-                                     cells,
-                                     SubCellData());
+                                      cells,
+                                      SubCellData());
 
   for (Triangulation<dim>::active_cell_iterator
-        cell = triangulation.begin_active();
+       cell = triangulation.begin_active();
        cell != triangulation.end(); ++cell)
     for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
       if ((cell->face(f)->center()[2] != -4)
-         &&
-         (cell->face(f)->center()[2] != 7)
-         &&
-         (cell->face(f)->at_boundary()))
-       cell->face(f)->set_boundary_indicator (1);
-  
+          &&
+          (cell->face(f)->center()[2] != 7)
+          &&
+          (cell->face(f)->at_boundary()))
+        cell->face(f)->set_boundary_indicator (1);
+
   triangulation.refine_global (1);
 
   for (Triangulation<dim>::active_cell_iterator
-        cell = triangulation.begin_active();
+       cell = triangulation.begin_active();
        cell != triangulation.end(); ++cell)
     for (unsigned int face_no=0;
-        face_no<GeometryInfo<dim>::faces_per_cell; ++face_no)
+         face_no<GeometryInfo<dim>::faces_per_cell; ++face_no)
       Assert (cell->at_boundary(face_no)
-             ==
-             cell->face(face_no)->at_boundary(),
-             ExcInternalError());
+              ==
+              cell->face(face_no)->at_boundary(),
+              ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile(logname);
   logfile.precision (3);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
index a037a0947fed341949d62f77fa9d5ccd72a8389d..71f2b8f9f327a505c691873f4df6a450439a807a 100644 (file)
@@ -36,27 +36,27 @@ std::ofstream logfile("line_coarsening_3d/output");
 // this is not accounted for (for n_cells>5) and the child lines are deleted,
 // although they are still needed.
 void create_star_structured_cylinder (Triangulation<3> &coarse_grid,
-                                     const unsigned int n_cells)
+                                      const unsigned int n_cells)
 {
   Assert(n_cells>1, ExcNotImplemented());
-  
+
   std::vector<Point<3> > points(2*(1+2*n_cells));
   points[0] = Point<3>();
   points[1] = Point<3>(1,0,0);
   for (unsigned int i=0; i<2*n_cells-1; ++i)
     {
       points[2+i]=Point<3>(std::cos(numbers::PI/n_cells*(i+1)),
-                          std::sin(numbers::PI/n_cells*(i+1)),
-                          0);
+                           std::sin(numbers::PI/n_cells*(i+1)),
+                           0);
     }
-  
+
   for (unsigned int i=0; i<2*n_cells+1; ++i)
     {
       points[1+2*n_cells+i]=points[i]+Point<3>(0,0,-1);
     }
-  
+
   std::vector<CellData<3> > cells(n_cells);
-    
+
   for (unsigned int c=0; c<n_cells; ++c)
     {
       cells[c].vertices[0]   = 0;
@@ -68,8 +68,8 @@ void create_star_structured_cylinder (Triangulation<3> &coarse_grid,
       cells[c].vertices[6]   = 2+2*c+2*n_cells+1;
       cells[c].vertices[7]   = (3+2*c)%(2*n_cells)+2*n_cells+1;
     }
-                                   // finally generate a triangulation
-                                   // out of this
+  // finally generate a triangulation
+  // out of this
   coarse_grid.create_triangulation_compatibility (points, cells, SubCellData());
 }
 
@@ -77,12 +77,12 @@ void create_star_structured_cylinder (Triangulation<3> &coarse_grid,
 void check ()
 {
   const unsigned int dim=3;
-                                   // create tria
+
+  // create tria
   Triangulation<dim> tria;
   create_star_structured_cylinder(tria,6);
-                                  // out of the six cells, refine the first and
-                                  // fourth
+  // out of the six cells, refine the first and
+  // fourth
   Triangulation<3>::active_cell_iterator cell=tria.begin_active();
   cell->set_refine_flag();
   ++cell;
@@ -90,19 +90,19 @@ void check ()
   ++cell;
   cell->set_refine_flag();
   tria.execute_coarsening_and_refinement ();
-                                  // write grid to file
+  // write grid to file
   GridOut go;
-  go.set_flags (GridOutFlags::Ucd(true));  
+  go.set_flags (GridOutFlags::Ucd(true));
   go.write_ucd(tria,logfile);
-                                  // coarsen the first cell again
+  // coarsen the first cell again
   cell=tria.begin_active(1);
-  for (unsigned int c=0;c<8; ++c)
+  for (unsigned int c=0; c<8; ++c)
     {
       cell->set_coarsen_flag();
       ++cell;
     }
   tria.execute_coarsening_and_refinement ();
-  
+
   go.write_ucd(tria,logfile);
 }
 
index 1f021791c6b13a767130a9d684f3db43ee9941a7..c87f3a00804ef2cfc376494d67ca16f904502921 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim>(2) {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square(); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { values(0) = value(p,0);
-       values(1) = value(p,1); }
+public:
+  MySquareFunction () : Function<dim>(2) {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square();
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+    values(1) = value(p,1);
+  }
 };
 
 
@@ -63,48 +67,48 @@ class MySquareFunction : public Function<dim>
 template <int dim>
 void
 check_boundary (const DoFHandler<dim> &dof,
-               const Mapping<dim>    &mapping)
+                const Mapping<dim>    &mapping)
 {
   MySquareFunction<dim> coefficient;
   typename FunctionMap<dim>::type function_map;
   function_map[0] = &coefficient;
 
   QGauss<dim-1> face_quadrature(6);
-  
+
   std::vector<types::global_dof_index> dof_to_boundary_mapping;
   DoFTools::map_dof_to_boundary_indices (dof,
-                                        dof_to_boundary_mapping);
+                                         dof_to_boundary_mapping);
 
   SparsityPattern sparsity(dof.n_boundary_dofs(function_map),
-                          dof.max_couplings_between_boundary_dofs());
+                           dof.max_couplings_between_boundary_dofs());
   DoFTools::make_boundary_sparsity_pattern (dof,
-                                           function_map,
-                                           dof_to_boundary_mapping,
-                                           sparsity);
+                                            function_map,
+                                            dof_to_boundary_mapping,
+                                            sparsity);
   sparsity.compress ();
 
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
-  
+
   Vector<double> rhs (dof.n_boundary_dofs(function_map));
   MatrixTools::
-    create_boundary_mass_matrix (mapping, dof,
-                                face_quadrature, matrix,
-                                function_map, rhs,
-                                dof_to_boundary_mapping,
-                                &coefficient);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_boundary_mass_matrix (mapping, dof,
+                               face_quadrature, matrix,
+                               function_map, rhs,
+                               dof_to_boundary_mapping,
+                               &coefficient);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     matrix.global_entry(i) *= 100;
-  
-                                  // finally write out matrix
+
+  // finally write out matrix
   matrix.print (deallog.get_file_stream());
 }
 
@@ -112,7 +116,7 @@ check_boundary (const DoFHandler<dim> &dof,
 
 void
 check_boundary (const DoFHandler<1> &,
-               const Mapping<1>    &)
+                const Mapping<1> &)
 {}
 
 
@@ -122,7 +126,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -133,23 +137,23 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FESystem<dim> element(FE_Q<dim>(1), 1,
-                       FE_Q<dim>(2), 1);
+                        FE_Q<dim>(2), 1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   std::vector<std::vector<bool> > mask (2, std::vector<bool>(2, false));
   mask[0][0] = mask[1][1] = true;
@@ -159,11 +163,11 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
 
   Functions::ExpFunction<dim> coefficient;
-  
+
   typename FunctionMap<dim>::type function_map;
   function_map[0] = &coefficient;
 
@@ -171,31 +175,31 @@ check ()
     {
       matrix.reinit(sparsity);
       switch (test)
-       {
-         case 0:
-               MatrixTools::
-                 create_mass_matrix (mapping, dof,
-                                     quadrature, matrix, &coefficient);
-               break;
-         case 1:
-               MatrixTools::
-                 create_laplace_matrix (mapping, dof,
-                                        quadrature, matrix, &coefficient);
-               break;
-         default:
-               Assert (false, ExcInternalError());
-       };
-
-                                      // since we only generate
-                                      // output with two digits after
-                                      // the dot, and since matrix
-                                      // entries are usually in the
-                                      // range of 1 or below,
-                                      // multiply matrix by 100 to
-                                      // make test more sensitive
+        {
+        case 0:
+          MatrixTools::
+          create_mass_matrix (mapping, dof,
+                              quadrature, matrix, &coefficient);
+          break;
+        case 1:
+          MatrixTools::
+          create_laplace_matrix (mapping, dof,
+                                 quadrature, matrix, &coefficient);
+          break;
+        default:
+          Assert (false, ExcInternalError());
+        };
+
+      // since we only generate
+      // output with two digits after
+      // the dot, and since matrix
+      // entries are usually in the
+      // range of 1 or below,
+      // multiply matrix by 100 to
+      // make test more sensitive
       for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
-       deallog.get_file_stream() << matrix.global_entry(i) * 100
-                                 << std::endl;
+        deallog.get_file_stream() << matrix.global_entry(i) * 100
+                                  << std::endl;
     };
 
   if (dim > 1)
@@ -208,9 +212,9 @@ int main ()
 {
   std::ofstream logfile ("matrices/output");
   logfile << std::setprecision (2);
-  logfile << std::fixed;  
+  logfile << std::fixed;
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index ecef945b9942838e62213a37e147edb54e297e07..854c24fc964f961e642e61848af429494a0ce2a2 100644 (file)
@@ -34,44 +34,44 @@ std::ofstream logfile("maximal_cell_diameter/output");
 template <int dim>
 void test1 ()
 {
-                                  // test 1: hypercube
+  // test 1: hypercube
   if (true)
     {
       Triangulation<dim> tria;
       GridGenerator::hyper_cube(tria);
 
       for (unsigned int i=0; i<2; ++i)
-       {
-         tria.refine_global(2);
-         deallog << dim << "d, "
-                 << "max diameter: "
-                 << GridTools::maximal_cell_diameter (tria)
-                 << std::endl;
-         Assert (GridTools::maximal_cell_diameter (tria)
-                 >=
-                 GridTools::minimal_cell_diameter (tria),
-                 ExcInternalError());
-       };
+        {
+          tria.refine_global(2);
+          deallog << dim << "d, "
+                  << "max diameter: "
+                  << GridTools::maximal_cell_diameter (tria)
+                  << std::endl;
+          Assert (GridTools::maximal_cell_diameter (tria)
+                  >=
+                  GridTools::minimal_cell_diameter (tria),
+                  ExcInternalError());
+        };
     };
 
-                                  // test 2: hyperball
+  // test 2: hyperball
   if (dim >= 2)
     {
       Triangulation<dim> tria;
       GridGenerator::hyper_ball(tria, Point<dim>(), 1);
 
       for (unsigned int i=0; i<2; ++i)
-       {
-         tria.refine_global(2);
-         deallog << dim << "d, "
-                 << "max diameter: "
-                 << GridTools::maximal_cell_diameter (tria)
-                 << std::endl;
-         Assert (GridTools::maximal_cell_diameter (tria)
-                 >=
-                 GridTools::minimal_cell_diameter (tria),
-                 ExcInternalError());
-       };
+        {
+          tria.refine_global(2);
+          deallog << dim << "d, "
+                  << "max diameter: "
+                  << GridTools::maximal_cell_diameter (tria)
+                  << std::endl;
+          Assert (GridTools::maximal_cell_diameter (tria)
+                  >=
+                  GridTools::minimal_cell_diameter (tria),
+                  ExcInternalError());
+        };
     };
 }
 
index f8972ae2640ff91e2c333f29e6d9501994497974..23797aaea7f4d208a01aa0ae60ac53278b0e5a18 100644 (file)
@@ -30,7 +30,7 @@
 
 template<int dim>
 void create_triangulation(const unsigned int,
-                         Triangulation<dim> &)
+                          Triangulation<dim> &)
 {
   Assert(false, ExcNotImplemented());
 }
@@ -38,48 +38,48 @@ void create_triangulation(const unsigned int,
 
 template<>
 void create_triangulation(const unsigned int case_no,
-                         Triangulation<2> &tria)
+                          Triangulation<2> &tria)
 {
   switch (case_no)
     {
-      case 0:
-           GridGenerator::hyper_cube(tria, 1., 3.);
-           break;
-      case 1:
-      {
-       GridGenerator::hyper_cube(tria, 1., 3.);
-       Point<2> &v0=tria.begin_active()->vertex(0);
-       v0(0) = 0.;
-       Point<2> &v2=tria.begin_active()->vertex(3);
-       v2(0) = 5.;
-       v2(1) = 4.;
-//         exact_areas.push_back(7.);
-       break;
-      }
-      default:
-           Assert(false, ExcNotImplemented());
+    case 0:
+      GridGenerator::hyper_cube(tria, 1., 3.);
+      break;
+    case 1:
+    {
+      GridGenerator::hyper_cube(tria, 1., 3.);
+      Point<2> &v0=tria.begin_active()->vertex(0);
+      v0(0) = 0.;
+      Point<2> &v2=tria.begin_active()->vertex(3);
+      v2(0) = 5.;
+      v2(1) = 4.;
+//      exact_areas.push_back(7.);
+      break;
+    }
+    default:
+      Assert(false, ExcNotImplemented());
     };
 }
 
 
 template<>
 void create_triangulation(const unsigned int case_no,
-                         Triangulation<3> &tria)
+                          Triangulation<3> &tria)
 {
   switch (case_no)
     {
-      case 0:
-           GridGenerator::hyper_cube(tria, 1., 3.);
-           break;
-      case 1:
-      {
-       GridGenerator::hyper_cube(tria, 1., 3.);
-       Point<3> &v0=tria.begin_active()->vertex(0);
-       v0(0) = 0.;
-       break;
-      }
-      default:
-           Assert(false, ExcNotImplemented());
+    case 0:
+      GridGenerator::hyper_cube(tria, 1., 3.);
+      break;
+    case 1:
+    {
+      GridGenerator::hyper_cube(tria, 1., 3.);
+      Point<3> &v0=tria.begin_active()->vertex(0);
+      v0(0) = 0.;
+      break;
+    }
+    default:
+      Assert(false, ExcNotImplemented());
     };
 }
 
@@ -92,11 +92,11 @@ void test()
     {
       create_triangulation(case_no, tria);
       deallog << "dim" << dim << ":case" << case_no << ":measure="
-             << tria.begin_active()->measure() << std::endl;
+              << tria.begin_active()->measure() << std::endl;
       deallog << "dim" << dim << ":case" << case_no << ":center="
-             << tria.begin_active()->center() << std::endl;
+              << tria.begin_active()->center() << std::endl;
       deallog << "dim" << dim << ":case" << case_no << ":barycenter="
-             << tria.begin_active()->barycenter() << std::endl;
+              << tria.begin_active()->barycenter() << std::endl;
       tria.clear();
     }
 }
index 436adb3c5c018837055793263e2b2d9d5b00079b..8fce576c88734e2a5bad5a06fb9a89933bc232a0 100644 (file)
@@ -30,7 +30,7 @@
 
 template<int dim>
 void create_triangulation(const unsigned int,
-                         Triangulation<dim> &)
+                          Triangulation<dim> &)
 {
   Assert(false, ExcNotImplemented());
 }
@@ -38,54 +38,54 @@ void create_triangulation(const unsigned int,
 
 template<>
 void create_triangulation(const unsigned int case_no,
-                         Triangulation<2> &tria)
+                          Triangulation<2> &tria)
 {
   switch (case_no)
     {
-      case 0:
-           GridGenerator::hyper_cube(tria, 1., 3.);
-           break;
-      case 1:
-      {
-       GridGenerator::hyper_cube(tria, 1., 3.);
-       Point<2> &v0=tria.begin_active()->vertex(0);
-       v0(0) = 0.;
-       break;
-       }
-               case 2:
-      {
-       GridGenerator::hyper_cube(tria, 1., 3.);
-       Point<2> &v0=tria.begin_active()->vertex(0);
-       v0(0) = 0.;
-       Point<2> &v3=tria.begin_active()->vertex(3);
-       v3(0) = 4.;
-       break;
-      }
-      default:
-           Assert(false, ExcNotImplemented());
+    case 0:
+      GridGenerator::hyper_cube(tria, 1., 3.);
+      break;
+    case 1:
+    {
+      GridGenerator::hyper_cube(tria, 1., 3.);
+      Point<2> &v0=tria.begin_active()->vertex(0);
+      v0(0) = 0.;
+      break;
+    }
+    case 2:
+    {
+      GridGenerator::hyper_cube(tria, 1., 3.);
+      Point<2> &v0=tria.begin_active()->vertex(0);
+      v0(0) = 0.;
+      Point<2> &v3=tria.begin_active()->vertex(3);
+      v3(0) = 4.;
+      break;
+    }
+    default:
+      Assert(false, ExcNotImplemented());
     };
 }
 
 
 template<>
 void create_triangulation(const unsigned int case_no,
-                         Triangulation<3> &tria)
+                          Triangulation<3> &tria)
 {
   switch (case_no)
     {
-      case 0:
-           GridGenerator::hyper_cube(tria, 1., 3.);
-           break;
-      case 1:
-               case 2:// like case 1
-      {
-       GridGenerator::hyper_cube(tria, 1., 3.);
-       Point<3> &v0=tria.begin_active()->vertex(0);
-       v0(0) = 0.;
-       break;
-      }
-         default:
-           Assert(false, ExcNotImplemented());
+    case 0:
+      GridGenerator::hyper_cube(tria, 1., 3.);
+      break;
+    case 1:
+    case 2:// like case 1
+    {
+      GridGenerator::hyper_cube(tria, 1., 3.);
+      Point<3> &v0=tria.begin_active()->vertex(0);
+      v0(0) = 0.;
+      break;
+    }
+    default:
+      Assert(false, ExcNotImplemented());
     };
 }
 
@@ -98,11 +98,11 @@ void test()
     {
       create_triangulation(case_no, tria);
       deallog << "dim" << dim << ":case" << case_no << ":diameter="
-             << tria.begin_active()->diameter() << std::endl;
+              << tria.begin_active()->diameter() << std::endl;
       deallog << "dim" << dim << ":case" << case_no << ":extent_in_direction="
-             << tria.begin_active()->extent_in_direction(0) << std::endl;
+              << tria.begin_active()->extent_in_direction(0) << std::endl;
       deallog << "dim" << dim << ":case" << case_no << ":minimum_vertex_distance="
-             << tria.begin_active()->minimum_vertex_distance() << std::endl;
+              << tria.begin_active()->minimum_vertex_distance() << std::endl;
       tria.clear();
     }
 }
index a89e2c3219c74afb7c56206c65a692d3161a5aec..ee0c478fce6983ea9c92079c40772e212418958c 100644 (file)
@@ -63,30 +63,30 @@ using namespace dealii;
 template <int dim>
 class Step6
 {
-  public:
-    Step6 ();
-    ~Step6 ();
+public:
+  Step6 ();
+  ~Step6 ();
 
-    void run ();
+  void run ();
 
-  private:
-    void setup_system ();
-    void assemble_system ();
-    void solve ();
-    void refine_grid ();
+private:
+  void setup_system ();
+  void assemble_system ();
+  void solve ();
+  void refine_grid ();
 
-    Triangulation<dim>   triangulation;
+  Triangulation<dim>   triangulation;
 
-    DoFHandler<dim>      dof_handler;
-    FE_Q<dim>            fe;
+  DoFHandler<dim>      dof_handler;
+  FE_Q<dim>            fe;
 
-    ConstraintMatrix     hanging_node_constraints;
+  ConstraintMatrix     hanging_node_constraints;
 
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> system_matrix;
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> system_matrix;
 
-    Vector<double>       solution;
-    Vector<double>       system_rhs;
+  Vector<double>       solution;
+  Vector<double>       system_rhs;
 };
 
 
@@ -95,15 +95,15 @@ class Step6
 template <int dim>
 class Coefficient : public Function<dim>
 {
-  public:
-    Coefficient () : Function<dim>() {}
+public:
+  Coefficient () : Function<dim>() {}
 
-    virtual double value (const Point<dim>   &p,
-                          const unsigned int  component = 0) const;
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
 
-    virtual void value_list (const std::vector<Point<dim> > &points,
-                             std::vector<double>            &values,
-                             const unsigned int              component = 0) const;
+  virtual void value_list (const std::vector<Point<dim> > &points,
+                           std::vector<double>            &values,
+                           const unsigned int              component = 0) const;
 };
 
 
@@ -147,9 +147,9 @@ void Coefficient<dim>::value_list (const std::vector<Point<dim> > &points,
 
 template <int dim>
 Step6<dim>::Step6 ()
-                :
-                dof_handler (triangulation),
-                fe (2)
+  :
+  dof_handler (triangulation),
+  fe (2)
 {}
 
 
@@ -209,8 +209,8 @@ void Step6<dim>::assemble_system ()
   std::vector<double>    coefficient_values (n_q_points);
 
   typename DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       cell_matrix = 0;
@@ -315,54 +315,54 @@ void Step6<dim>::run ()
 
       if (cycle == 0)
         {
-         if (dim > 1)
-           {
-             GridGenerator::hyper_ball (triangulation);
-
-             static const HyperBallBoundary<dim> boundary;
-             triangulation.set_boundary (0, boundary);
-
-             triangulation.refine_global (1);
-           }
-         else
-           {
-             GridGenerator::hyper_cube (triangulation);
-             triangulation.refine_global (3);
-           }
+          if (dim > 1)
+            {
+              GridGenerator::hyper_ball (triangulation);
+
+              static const HyperBallBoundary<dim> boundary;
+              triangulation.set_boundary (0, boundary);
+
+              triangulation.refine_global (1);
+            }
+          else
+            {
+              GridGenerator::hyper_cube (triangulation);
+              triangulation.refine_global (3);
+            }
         }
       else
         refine_grid ();
 
 
       deallog << "   Number of active cells:       "
-             << triangulation.n_active_cells()
-             << std::endl;
+              << triangulation.n_active_cells()
+              << std::endl;
 
       setup_system ();
 
       deallog << "   Number of degrees of freedom: "
-             << dof_handler.n_dofs()
-             << std::endl;
+              << dof_handler.n_dofs()
+              << std::endl;
 
       assemble_system ();
       solve ();
 
       deallog << "Memory consumption -- Triangulation: " << triangulation.memory_consumption()
-             << std::endl;
+              << std::endl;
       deallog << "Memory consumption -- DoFHandler:    " << dof_handler.memory_consumption()
-             << std::endl;
+              << std::endl;
       deallog << "Memory consumption -- FE:            " << fe.memory_consumption()
-             << std::endl;
+              << std::endl;
       deallog << "Memory consumption -- Constraints:   " << hanging_node_constraints.memory_consumption()
-             << std::endl;
+              << std::endl;
       deallog << "Memory consumption -- Sparsity:      " << sparsity_pattern.memory_consumption()
-             << std::endl;
+              << std::endl;
       deallog << "Memory consumption -- Matrix:        " << system_matrix.memory_consumption()
-             << std::endl;
+              << std::endl;
       deallog << "Memory consumption -- Solution:      " << solution.memory_consumption()
-             << std::endl;
+              << std::endl;
       deallog << "Memory consumption -- Rhs:           " << system_rhs.memory_consumption()
-             << std::endl;
+              << std::endl;
     }
 
   DataOutBase::EpsFlags eps_flags;
@@ -376,7 +376,7 @@ void Step6<dim>::run ()
   data_out.build_patches ();
 
   deallog << "Memory consumption -- DataOut:       " << data_out.memory_consumption()
-         << std::endl;
+          << std::endl;
 }
 
 
index 6b655dbf377db589f1ca75ce7c6f4b7d3a3faaf9..4f0cbda71277569a7373bf15090f5ad6c7cd009d 100644 (file)
@@ -53,34 +53,34 @@ void test (const int testcase)
   Point<dim> shift;
   switch (testcase)
     {
-      case 0:
-           shift[0] = 2;
-           break;
-      case 1:
-           shift[0] = 1;
-           break;
-      case 2:
-           for (unsigned int d=0; d<dim; ++d)
-             shift[d] = 1;
-           break;
-      default:
-           Assert (false, ExcNotImplemented());
+    case 0:
+      shift[0] = 2;
+      break;
+    case 1:
+      shift[0] = 1;
+      break;
+    case 2:
+      for (unsigned int d=0; d<dim; ++d)
+        shift[d] = 1;
+      break;
+    default:
+      Assert (false, ExcNotImplemented());
     }
   GridTools::shift (shift, tria_2);
 
-                                  // fill tria_3 with something, to
-                                  // make sure that the function we
-                                  // call later can deal with prior
-                                  // content
+  // fill tria_3 with something, to
+  // make sure that the function we
+  // call later can deal with prior
+  // content
   GridGenerator::hyper_cube(tria_3);
 
-                                  // now merge triangulations
+  // now merge triangulations
   GridGenerator::merge_triangulations (tria_1, tria_2, tria_3);
 
   GridOut().write_gnuplot (tria_3, logfile);
 
   deallog << "     Total number of cells        = " << tria_3.n_cells() << std::endl
-         << "     Total number of vertices = " << tria_3.n_used_vertices() << std::endl;
+          << "     Total number of vertices = " << tria_3.n_used_vertices() << std::endl;
 }
 
 
index 77a91559710bb1e63dca688e161f84a3b5cec476..09e9a10286b368515da72fa8448afdbe9430a2d9 100644 (file)
@@ -78,53 +78,53 @@ void test ()
   GridGenerator::hyper_cube (triangulation);
   triangulation.refine_global (2);
 
-                                  // refine the offspring of one of the cells
-                                  // on level 1
+  // refine the offspring of one of the cells
+  // on level 1
   for (unsigned int i=0; i<4; ++i)
     triangulation.begin(1)->child(i)->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
 
   deallog << "n_active_cells = " << triangulation.n_active_cells()
-         << std::endl;
+          << std::endl;
 
 
   for (Triangulation<2>::cell_iterator
-        cell = triangulation.begin();
+       cell = triangulation.begin();
        cell != triangulation.end(); ++cell)
     {
       deallog << "Cell = " << cell
-             << (cell->active() ? " is active " : " is not active ");
+              << (cell->active() ? " is active " : " is not active ");
       if (!cell->active())
-       {
-         deallog << "and has children: ";
-         for (unsigned int i=0; i<4; ++i)
-           deallog << cell->child(i) << ' ';
-       }
+        {
+          deallog << "and has children: ";
+          for (unsigned int i=0; i<4; ++i)
+            deallog << cell->child(i) << ' ';
+        }
       deallog << std::endl;
     }
-  
-                                      // now flag everything for coarsening
-                                      // again
+
+  // now flag everything for coarsening
+  // again
   for (Triangulation<2>::active_cell_iterator
-        cell = triangulation.begin_active();
+       cell = triangulation.begin_active();
        cell != triangulation.end(); ++cell)
     cell->set_coarsen_flag ();
   triangulation.execute_coarsening_and_refinement ();
 
   deallog << "n_active_cells = " << triangulation.n_active_cells()
-         << std::endl;
-  
+          << std::endl;
+
   for (Triangulation<2>::cell_iterator
-        cell = triangulation.begin();
+       cell = triangulation.begin();
        cell != triangulation.end(); ++cell)
     {
       Assert ((cell->refine_flag_set() == false)
-             &&
-             (cell->coarsen_flag_set() == false),
-             ExcInternalError());
+              &&
+              (cell->coarsen_flag_set() == false),
+              ExcInternalError());
       if (!cell->active())
-       Assert (cell_is_patch_level_1<2>(cell),
-               ExcInternalError());
+        Assert (cell_is_patch_level_1<2>(cell),
+                ExcInternalError());
     }
 
   deallog << "OK" << std::endl;
@@ -132,11 +132,11 @@ void test ()
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile(logname);
   logfile.precision (3);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
@@ -147,25 +147,25 @@ int main ()
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
 
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     }
 
index 383498899050b90d33fa9f66ff1e261158dfcbe4..e04826dfded359ef6e2ff2bf2f09382e95245882 100644 (file)
@@ -48,63 +48,63 @@ using namespace dealii;
 
 void test ()
 {
-                                  // generate a 100x3 mesh
+  // generate a 100x3 mesh
   Triangulation<2> triangulation (Triangulation<2>::eliminate_unrefined_islands);
   std::vector<unsigned int> ref(2);
   ref[0] = 100;
   ref[1] = 3;
   GridGenerator::subdivided_hyper_rectangle (triangulation, ref,
-                                            Point<2>(), Point<2>(100,3));
+                                             Point<2>(), Point<2>(100,3));
 
-                                  // refine all cells at the lower
-                                  // boundary. we then have 600 cells
+  // refine all cells at the lower
+  // boundary. we then have 600 cells
   for (Triangulation<2>::cell_iterator
-        cell = triangulation.begin();
+       cell = triangulation.begin();
        cell != triangulation.end(); ++cell)
     if (cell->center()[1] < 1)
       cell->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
   deallog << "n_active_cells = " << triangulation.n_active_cells()
-         << std::endl;
-
-                                  // now mark all cells at the top
-                                  // boundary for refinement with the
-                                  // exception of the top right
-                                  // one. this means that the only
-                                  // cell that qualifies the island
-                                  // condition is the one in the
-                                  // center at the left boundary
-                                  // (bottom neighbor already
-                                  // refined, top neighbor to be
-                                  // refined). but upon it being
-                                  // flagged, its right neighbor will
-                                  // also qualify, and then the right
-                                  // neighbor of that one, etc. in
-                                  // total, the old algorithm needs
-                                  // 102 iterations through the
-                                  // prepare_c_and_r loop (one for
-                                  // each of the cells in the middle
-                                  // stripe, plus two for apparently
-                                  // other things). after the changes
-                                  // to tria.cc, we now need 2
-                                  // iterations
+          << std::endl;
+
+  // now mark all cells at the top
+  // boundary for refinement with the
+  // exception of the top right
+  // one. this means that the only
+  // cell that qualifies the island
+  // condition is the one in the
+  // center at the left boundary
+  // (bottom neighbor already
+  // refined, top neighbor to be
+  // refined). but upon it being
+  // flagged, its right neighbor will
+  // also qualify, and then the right
+  // neighbor of that one, etc. in
+  // total, the old algorithm needs
+  // 102 iterations through the
+  // prepare_c_and_r loop (one for
+  // each of the cells in the middle
+  // stripe, plus two for apparently
+  // other things). after the changes
+  // to tria.cc, we now need 2
+  // iterations
   for (Triangulation<2>::cell_iterator
-        cell = triangulation.begin();
+       cell = triangulation.begin();
        cell != triangulation.end(); ++cell)
     if (cell->center()[1] > 2)
       if (cell->center()[0] < 99)
-       cell->set_refine_flag ();
+        cell->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
 
-                                  // output the new number of
-                                  // cells. should now be 1200 since
-                                  // we have refined every cell in
-                                  // the mesh. unfortunately, there
-                                  // is no way to test actually test
-                                  // the number of iterations in
-                                  // prepare_c_and_r :-(
+  // output the new number of
+  // cells. should now be 1200 since
+  // we have refined every cell in
+  // the mesh. unfortunately, there
+  // is no way to test actually test
+  // the number of iterations in
+  // prepare_c_and_r :-(
   deallog << "n_active_cells = " << triangulation.n_active_cells()
-         << std::endl;
+          << std::endl;
 }
 
 
@@ -124,25 +124,25 @@ int main ()
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
 
       return 1;
     }
   catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     }
 
index ab1b4ba60af86017daab4303a7deb71658a36f22..c49bf62ee37632d3a06a9c8699fd40adb1010fde 100644 (file)
@@ -36,7 +36,7 @@ int main ()
 {
   std::ofstream logfile("mg_dof_handler/output");
   deallog << std::setprecision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
@@ -47,13 +47,13 @@ int main ()
 
   FE_DGQ<dim> fe(1);
   MGDoFHandler<dim> dof_handler(tria);
-  
+
   tria.begin_active()->set_refine_flag();
   tria.execute_coarsening_and_refinement();
 
   Triangulation<dim>::active_cell_iterator
-    cell=tria.begin_active(),
-    endc=tria.end();
+  cell=tria.begin_active(),
+  endc=tria.end();
   for (; cell!=endc; ++cell)
     cell->set_coarsen_flag();
   tria.execute_coarsening_and_refinement();
index fa0b3089316b625b36230fa17a02a866beed5866..bebeb4bffd224652b013ddcc192baa0ac5626218 100644 (file)
@@ -34,36 +34,36 @@ std::ofstream logfile("minimal_cell_diameter/output");
 template <int dim>
 void test1 ()
 {
-                                  // test 1: hypercube
+  // test 1: hypercube
   if (true)
     {
       Triangulation<dim> tria;
       GridGenerator::hyper_cube(tria);
 
       for (unsigned int i=0; i<2; ++i)
-       {
-         tria.refine_global(2);
-         deallog << dim << "d, "
-                 << "min diameter: "
-                 << GridTools::minimal_cell_diameter (tria)
-                 << std::endl;
-       };
+        {
+          tria.refine_global(2);
+          deallog << dim << "d, "
+                  << "min diameter: "
+                  << GridTools::minimal_cell_diameter (tria)
+                  << std::endl;
+        };
     };
 
-                                  // test 2: hyperball
+  // test 2: hyperball
   if (dim >= 2)
     {
       Triangulation<dim> tria;
       GridGenerator::hyper_ball(tria, Point<dim>(), 1);
 
       for (unsigned int i=0; i<2; ++i)
-       {
-         tria.refine_global(2);
-         deallog << dim << "d, "
-                 << "min diameter: "
-                 << GridTools::minimal_cell_diameter (tria)
-                 << std::endl;
-       };
+        {
+          tria.refine_global(2);
+          deallog << dim << "d, "
+                  << "min diameter: "
+                  << GridTools::minimal_cell_diameter (tria)
+                  << std::endl;
+        };
     };
 }
 
index ae937ee50c206d7e5db1d578547d8af0690a5f63..bbe9655293839e30b7e0742ae35892748cab0ae1 100644 (file)
@@ -28,76 +28,76 @@ using namespace dealii;
 
 class SquareRoot : public Subscriptor
 {
-  public:
-    void start_vector (Vector<double>& start) const;
-    void residual (NamedData<Vector<double>*>& out, 
-        const NamedData<Vector<double>*>& in);
-    void solve (NamedData<Vector<double>*>& out, 
-        const NamedData<Vector<double>*>& in);
+public:
+  void start_vector (Vector<double> &start) const;
+  void residual (NamedData<Vector<double>*> &out,
+                 const NamedData<Vector<double>*> &in);
+  void solve (NamedData<Vector<double>*> &out,
+              const NamedData<Vector<double>*> &in);
 };
 
-class SquareRootResidual : public 
-                       Algorithms::Operator<Vector<double> >
+class SquareRootResidual : public
+  Algorithms::Operator<Vector<double> >
 {
-    SmartPointer<SquareRoot, SquareRootResidual>
-      discretization;
-  public:
-
-    SquareRootResidual(SquareRoot& problem)
-      : discretization(&problem)
-    {}
-
-    virtual void operator ()(
-        NamedData<Vector<double>*>& out, 
-        const NamedData<Vector<double>*>& in) 
-    {
-      discretization->residual(out,in);
-    }
+  SmartPointer<SquareRoot, SquareRootResidual>
+  discretization;
+public:
+
+  SquareRootResidual(SquareRoot &problem)
+    : discretization(&problem)
+  {}
+
+  virtual void operator ()(
+    NamedData<Vector<double>*> &out,
+    const NamedData<Vector<double>*> &in)
+  {
+    discretization->residual(out,in);
+  }
 };
 
-class SquareRootSolver : public 
-                       Algorithms::Operator<Vector<double> >
+class SquareRootSolver : public
+  Algorithms::Operator<Vector<double> >
 {
-    SmartPointer<SquareRoot, SquareRootSolver>
-      solver;
-  public:
-
-    SquareRootSolver(SquareRoot& problem)
-      : solver(&problem)
-    {}
-
-    virtual void operator ()(
-        NamedData<Vector<double>*>& out, 
-        const NamedData<Vector<double>*>& in) 
-    {
-      solver->solve(out,in);
-    }
+  SmartPointer<SquareRoot, SquareRootSolver>
+  solver;
+public:
+
+  SquareRootSolver(SquareRoot &problem)
+    : solver(&problem)
+  {}
+
+  virtual void operator ()(
+    NamedData<Vector<double>*> &out,
+    const NamedData<Vector<double>*> &in)
+  {
+    solver->solve(out,in);
+  }
 };
 
 void SquareRoot::residual (
-    NamedData<Vector<double>*>& out, 
-    const NamedData<Vector<double>*>& in) 
+  NamedData<Vector<double>*> &out,
+  const NamedData<Vector<double>*> &in)
 {
   //residuum = 0
   *out(0) = 0.;
-  const Vector<double> &x = *in(in.find("Newton iterate")); 
+  const Vector<double> &x = *in(in.find("Newton iterate"));
   *out(0) = x*x - 2.;
 }
 
 void SquareRoot::solve (
-    NamedData<Vector<double>*>& out, 
-    const NamedData<Vector<double>*>& in)
+  NamedData<Vector<double>*> &out,
+  const NamedData<Vector<double>*> &in)
 {
   *out(0) = 0;
-  const Vector<double> &x = *in(in.find("Newton iterate")); 
+  const Vector<double> &x = *in(in.find("Newton iterate"));
   const Vector<double> &r = *in(in.find("Newton residual"));
 
   (*out(0))(0) = 1./2./x(0)* r(0);
-} 
+}
 
 
 
-void test () 
+void test ()
 {
   SquareRoot square_root;
   SquareRootSolver sq_solver (square_root);
@@ -106,8 +106,8 @@ void test ()
   Algorithms::OutputOperator<Vector<double> > output;
 
   Algorithms::Newton<Vector<double> > newton(
-      sq_residual,
-      sq_solver); 
+    sq_residual,
+    sq_solver);
   newton.initialize(output);
 
   NamedData<Vector<double>*> in_data;
@@ -115,7 +115,7 @@ void test ()
 
   Vector<double> solution (1);
   solution = 10.;
-  Vector<double>p = &solution;
+  Vector<double> *p = &solution;
   out_data.add(p, "solution");
 
   newton.control.set_reduction(1.e-20);
@@ -125,8 +125,8 @@ void test ()
   deallog << " square root " << (*out_data(0))(0) << std::endl;
 }
 
-  
-  
+
+
 
 int main()
 {
index d2d2ed753eb4e0b5578c57c0ea3ff8aea1359660..66653cfd1492fbe5678a7da81aa12dcadeb04d55 100644 (file)
@@ -37,8 +37,8 @@
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-                     const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -46,13 +46,13 @@ void test (const Triangulation<dim>& tr,
   for (unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
     {
       deallog << "FE=" << fe.get_name()
-             << ", case=" << i
-             << std::endl;
+              << ", case=" << i
+              << std::endl;
 
       std::set<types::boundary_id> boundary_ids;
       for (unsigned int j=0; j<=i; ++j)
-       boundary_ids.insert (j);
-      
+        boundary_ids.insert (j);
+
       ConstraintMatrix cm;
       VectorTools::compute_no_normal_flux_constraints (dof, 0, boundary_ids, cm);
 
@@ -69,7 +69,7 @@ void test_hyper_cube()
 
   for (unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
     tr.begin_active()->face(i)->set_boundary_indicator (i);
-  
+
   tr.refine_global(2);
 
   for (unsigned int degree=1; degree<4; ++degree)
@@ -84,7 +84,7 @@ int main()
 {
   std::ofstream logfile ("no_flux_01/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
   deallog.threshold_double(1.e-12);
index cbb88ac636595c17158557fe3225630b359afeaa..2340508cba7f063bb79c19c8bffdf10e8be99872 100644 (file)
@@ -39,8 +39,8 @@
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-                     const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -48,13 +48,13 @@ void test (const Triangulation<dim>& tr,
   for (unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
     {
       deallog << "FE=" << fe.get_name()
-             << ", case=" << i
-             << std::endl;
+              << ", case=" << i
+              << std::endl;
 
       std::set<types::boundary_id> boundary_ids;
       for (unsigned int j=0; j<=i; ++j)
-       boundary_ids.insert (j);
-      
+        boundary_ids.insert (j);
+
       ConstraintMatrix cm;
       VectorTools::compute_no_normal_flux_constraints (dof, 1, boundary_ids, cm);
 
@@ -71,14 +71,14 @@ void test_hyper_cube()
 
   for (unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
     tr.begin_active()->face(i)->set_boundary_indicator (i);
-  
+
   tr.refine_global(2);
 
   for (unsigned int degree=1; degree<4; ++degree)
     {
       FESystem<dim> fe (FE_Q<dim>(degree+1), 1,
-                       FE_Q<dim>(degree), dim,
-                       FE_Q<dim>(degree+1), 1);
+                        FE_Q<dim>(degree), dim,
+                        FE_Q<dim>(degree+1), 1);
       test(tr, fe);
     }
 }
@@ -88,7 +88,7 @@ int main()
 {
   std::ofstream logfile ("no_flux_02/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
   deallog.threshold_double(1.e-12);
index 17e4a864132dbe9bbc8322f7d171470c0dd461b0..3dde558101801426b05b40564227128143956754 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-                     const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   std::set<types::boundary_id> boundary_ids;
   boundary_ids.insert (0);
-      
+
   ConstraintMatrix cm;
   VectorTools::compute_no_normal_flux_constraints (dof, 0, boundary_ids, cm);
 
@@ -68,7 +68,7 @@ void test_hyper_sphere()
 
   static const HyperBallBoundary<dim> boundary;
   tr.set_boundary (0, boundary);
-  
+
   tr.refine_global(2);
 
   for (unsigned int degree=1; degree<4; ++degree)
index 7b1e6bc43d04956908dc3ab4208362c76494a67b..dddb88c016df9f6c301b89a924817036bef8f1af 100644 (file)
 template <int dim>
 class RadialFunction : public Function<dim>
 {
-  public:
-    RadialFunction() : Function<dim> (dim) {}
+public:
+  RadialFunction() : Function<dim> (dim) {}
 
-    virtual void vector_value (const Point<dim> &p,
-                              Vector<double> &v) const
+  virtual void vector_value (const Point<dim> &p,
+                             Vector<double> &v) const
+  {
+    Assert (v.size() == dim, ExcInternalError());
+
+    switch (dim)
       {
-       Assert (v.size() == dim, ExcInternalError());
-
-       switch (dim)
-         {
-           case 2:
-                 v(0) = p[0] + p[1];
-                 v(1) = p[1] - p[0];
-                 break;
-           case 3:
-                 v(0) = p[0] + p[1];
-                 v(1) = p[1] - p[0];
-                 v(2) = p[2];
-                 break;
-           default:
-                 Assert (false, ExcNotImplemented());
-         }
+      case 2:
+        v(0) = p[0] + p[1];
+        v(1) = p[1] - p[0];
+        break;
+      case 3:
+        v(0) = p[0] + p[1];
+        v(1) = p[1] - p[0];
+        v(2) = p[2];
+        break;
+      default:
+        Assert (false, ExcNotImplemented());
       }
+  }
 };
 
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   std::set<types::boundary_id> boundary_ids;
   boundary_ids.insert (0);
@@ -97,7 +97,7 @@ void test (const Triangulation<dim>& tr,
 
   cm.distribute (v);
 
-                                  // remove small entries
+  // remove small entries
   for (unsigned int i=0; i<v.size(); ++i)
     if (std::fabs (v(i)) < 1e-12)
       v(i) = 0;
@@ -106,12 +106,12 @@ void test (const Triangulation<dim>& tr,
   data_out.attach_dof_handler (dh);
 
   std::vector<DataComponentInterpretation::DataComponentInterpretation>
-    data_component_interpretation
-    (dim, DataComponentInterpretation::component_is_part_of_vector);
+  data_component_interpretation
+  (dim, DataComponentInterpretation::component_is_part_of_vector);
 
   data_out.add_data_vector (v, "x",
-                           DataOut<dim>::type_dof_data,
-                           data_component_interpretation);
+                            DataOut<dim>::type_dof_data,
+                            data_component_interpretation);
   data_out.build_patches (fe.degree);
 
   data_out.write_vtk (deallog.get_file_stream());
index 5c30f9661dc6e06654d3a1fe9efbb408199952a9..ff37c5cd6f8a49ce3eb849c01ca97358e2a0f904 100644 (file)
@@ -47,8 +47,8 @@
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-                     const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -58,12 +58,12 @@ void test (const Triangulation<dim>& tr,
   for (unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
     {
       deallog << "FE=" << fe.get_name()
-             << ", case=" << i
-             << std::endl;
+              << ", case=" << i
+              << std::endl;
 
       std::set<types::boundary_id> boundary_ids;
       for (unsigned int j=0; j<=i; ++j)
-       boundary_ids.insert (j);
+        boundary_ids.insert (j);
 
       ConstraintMatrix cm;
       VectorTools::compute_no_normal_flux_constraints (dof, 0, boundary_ids, cm);
@@ -87,7 +87,7 @@ void test_hyper_cube()
   for (unsigned int degree=1; degree<4; ++degree)
     {
       FESystem<dim> fe (FE_Q<dim>(degree), dim,
-                       FE_DGP<dim>(degree+1), 1);
+                        FE_DGP<dim>(degree+1), 1);
       test(tr, fe);
     }
 }
index 8c8b1d820a3c7bf1d4899da283c6cfdfa5f37ef5..6e1fac5e0498e76280ca64042e0516ff8dfbba8c 100644 (file)
@@ -43,26 +43,26 @@ void test_hyper_cube()
 {
   Triangulation<dim> tr;
   GridGenerator::hyper_rectangle(tr, Point<dim>(), Point<dim>(1,1,1), true);
-  
+
   FESystem<dim> fe (FE_Q<dim>(2), dim);
 
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   std::set<types::boundary_id> boundary_ids;
   boundary_ids.insert (1);
   boundary_ids.insert (3);
-  
+
   ConstraintMatrix cm;
   const MappingQ<dim> mapping(4);
   VectorTools::compute_no_normal_flux_constraints (dof, 0,
-                                                  boundary_ids, cm,
-                                                  mapping);
+                                                   boundary_ids, cm,
+                                                   mapping);
   cm.close();
-      
+
   cm.print (deallog.get_file_stream ());
 }
 
@@ -71,7 +71,7 @@ int main()
 {
   std::ofstream logfile ("no_flux_06/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
   deallog.threshold_double(1.e-12);
index 7ea2bde901c2df51499f287149a37f7b646ee023..fb6aac300ba16ae585fcbb6fef2e9a3cb15ba89a 100644 (file)
@@ -45,8 +45,8 @@
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-                     const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -66,9 +66,9 @@ void test_hyper_cube()
 {
   Triangulation<dim> tr;
 
-                                  // create a hypercube, then shear
-                                  // its top surface to make the
-                                  // result non-square
+  // create a hypercube, then shear
+  // its top surface to make the
+  // result non-square
   GridGenerator::hyper_cube(tr);
   Point<dim> shift;
   for (unsigned int i=GeometryInfo<dim>::vertices_per_cell/2;
index c8d549d49d399fb505d283d5ca388f66d0212f8e..720412ddce5fa789687210daf921cbf53ba15e44 100644 (file)
@@ -46,10 +46,10 @@ void
 check ()
 {
   Triangulation<dim> tr;
-   GridGenerator::half_hyper_shell (tr,
-                             Point<dim>(),
-                             0.5,
-                             1,0);
+  GridGenerator::half_hyper_shell (tr,
+                                   Point<dim>(),
+                                   0.5,
+                                   1,0);
 
   ConstraintMatrix cm;
   MappingQ<dim> mapping(1);
index ade57e725e14190b5e0ae4e40700e63d394647e9..65800f65913d663c063d7d143c7d32671bf7e994 100644 (file)
 
 
 void
-colorize_sixty_deg_hyper_shell(Triangulation<3> & tria,
-                              const Point<3>& center,
-                              const double inner_radius,
-                              const double outer_radius)
+colorize_sixty_deg_hyper_shell(Triangulation<3> &tria,
+                               const Point<3> &center,
+                               const double inner_radius,
+                               const double outer_radius)
 {
 
-                                  //    if (tria.n_cells() != 4)
-                                  //      AssertThrow (false, ExcNotImplemented());
+  //    if (tria.n_cells() != 4)
+  //      AssertThrow (false, ExcNotImplemented());
 
   double middle = (outer_radius-inner_radius)/2e0 + inner_radius;
   double eps = 1e-3*middle;
   Triangulation<3>::cell_iterator cell = tria.begin();
 
-  for (;cell!=tria.end();++cell)
-    for(unsigned int f=0; f<GeometryInfo<3>::faces_per_cell; ++f)
+  for (; cell!=tria.end(); ++cell)
+    for (unsigned int f=0; f<GeometryInfo<3>::faces_per_cell; ++f)
       {
-        if(!cell->face(f)->at_boundary())
+        if (!cell->face(f)->at_boundary())
           continue;
 
         double radius = cell->face(f)->center().norm() - center.norm();
         if (std::fabs(cell->face(f)->center()(2) - sqrt(3.)*cell->face(f)->center()(0)) < eps ) // z = sqrt(3)x set boundary 2
           {
             cell->face(f)->set_boundary_indicator(2);
-            for (unsigned int j=0;j<GeometryInfo<3>::lines_per_face;++j)
-              if(cell->face(f)->line(j)->at_boundary())
+            for (unsigned int j=0; j<GeometryInfo<3>::lines_per_face; ++j)
+              if (cell->face(f)->line(j)->at_boundary())
                 if (std::fabs(cell->face(f)->line(j)->vertex(0).norm() - cell->face(f)->line(j)->vertex(1).norm()) > eps)
                   cell->face(f)->line(j)->set_boundary_indicator(2);
           }
         else if (std::fabs(cell->face(f)->center()(2) + sqrt(3.)*cell->face(f)->center()(0)) < eps) // z = -sqrt(3)x set boundary 3
           {
             cell->face(f)->set_boundary_indicator(3);
-            for (unsigned int j=0;j<GeometryInfo<3>::lines_per_face;++j)
-              if(cell->face(f)->line(j)->at_boundary())
+            for (unsigned int j=0; j<GeometryInfo<3>::lines_per_face; ++j)
+              if (cell->face(f)->line(j)->at_boundary())
                 if (std::fabs(cell->face(f)->line(j)->vertex(0).norm() - cell->face(f)->line(j)->vertex(1).norm()) > eps)
                   cell->face(f)->line(j)->set_boundary_indicator(3);
           }
         else if (std::fabs(cell->face(f)->center()(2) - sqrt(3.)*cell->face(f)->center()(1)) < eps ) // z = sqrt(3)y set boundary 4
           {
             cell->face(f)->set_boundary_indicator(4);
-            for (unsigned int j=0;j<GeometryInfo<3>::lines_per_face;++j)
-              if(cell->face(f)->line(j)->at_boundary())
+            for (unsigned int j=0; j<GeometryInfo<3>::lines_per_face; ++j)
+              if (cell->face(f)->line(j)->at_boundary())
                 if (std::fabs(cell->face(f)->line(j)->vertex(0).norm() - cell->face(f)->line(j)->vertex(1).norm()) > eps)
                   cell->face(f)->line(j)->set_boundary_indicator(4);
           }
         else if (std::fabs(cell->face(f)->center()(2) + sqrt(3.)*cell->face(f)->center()(1)) < eps ) // z = -sqrt(3)y set boundary 5
           {
             cell->face(f)->set_boundary_indicator(5);
-            for (unsigned int j=0;j<GeometryInfo<3>::lines_per_face;++j)
-              if(cell->face(f)->line(j)->at_boundary())
+            for (unsigned int j=0; j<GeometryInfo<3>::lines_per_face; ++j)
+              if (cell->face(f)->line(j)->at_boundary())
                 if (std::fabs(cell->face(f)->line(j)->vertex(0).norm() - cell->face(f)->line(j)->vertex(1).norm()) > eps)
                   cell->face(f)->line(j)->set_boundary_indicator(5);
           }
         else if (radius < middle) // inner radius set boundary 0
           {
             cell->face(f)->set_boundary_indicator(0);
-            for (unsigned int j=0;j<GeometryInfo<3>::lines_per_face;++j)
-              if(cell->face(f)->line(j)->at_boundary())
+            for (unsigned int j=0; j<GeometryInfo<3>::lines_per_face; ++j)
+              if (cell->face(f)->line(j)->at_boundary())
                 if (std::fabs(cell->face(f)->line(j)->vertex(0).norm() - cell->face(f)->line(j)->vertex(1).norm()) < eps)
                   cell->face(f)->line(j)->set_boundary_indicator(0);
           }
         else if (radius > middle) // outer radius set boundary 1
           {
             cell->face(f)->set_boundary_indicator(1);
-            for (unsigned int j=0;j<GeometryInfo<3>::lines_per_face;++j)
-              if(cell->face(f)->line(j)->at_boundary())
+            for (unsigned int j=0; j<GeometryInfo<3>::lines_per_face; ++j)
+              if (cell->face(f)->line(j)->at_boundary())
                 if (std::fabs(cell->face(f)->line(j)->vertex(0).norm() - cell->face(f)->line(j)->vertex(1).norm()) < eps)
-                 cell->face(f)->line(j)->set_boundary_indicator(1);
+                  cell->face(f)->line(j)->set_boundary_indicator(1);
           }
         else
           AssertThrow (false, ExcInternalError());
       }
 }
 
-void sixty_deg_hyper_shell (Triangulation<3> & tria,
-                           const Point<3>& center,
-                           const double inner_radius,
-                           const double outer_radius)
+void sixty_deg_hyper_shell (Triangulation<3> &tria,
+                            const Point<3> &center,
+                            const double inner_radius,
+                            const double outer_radius)
 {
   const double r0 = inner_radius;
   const double r1 = outer_radius;
@@ -138,8 +138,9 @@ void sixty_deg_hyper_shell (Triangulation<3> & tria,
   vertices.push_back (center+Point<3>( -1.0/sqrt(5.)*r0, -1.0/sqrt(5.)*r0, sqrt(3./5.)*r0)); //16 -> 6
   vertices.push_back (center+Point<3>( -1.0/sqrt(5.)*r1, -1.0/sqrt(5.)*r1, sqrt(3./5.)*r1)); //17 -> 7
 
-  const int cell_vertices[1][8] = {
-       {6, 2, 4, 0, 7, 3, 5, 1},
+  const int cell_vertices[1][8] =
+  {
+    {6, 2, 4, 0, 7, 3, 5, 1},
   };
 
   std::vector<CellData<3> > cells(1);
@@ -147,7 +148,7 @@ void sixty_deg_hyper_shell (Triangulation<3> & tria,
   for (unsigned int i=0; i<1; ++i)
     {
       for (unsigned int j=0; j<8; ++j)
-       cells[i].vertices[j] = cell_vertices[i][j];
+        cells[i].vertices[j] = cell_vertices[i][j];
       cells[i].material_id = 0;
     }
 
@@ -166,18 +167,18 @@ void run()
   ConstraintMatrix constraints;
 
   sixty_deg_hyper_shell (triangulation,
-                        Point<dim>(),
-                        0.5,
-                        1.0);
+                         Point<dim>(),
+                         0.5,
+                         1.0);
 
   static HyperShellBoundary<dim> boundary((Point<dim>()));
   triangulation.set_boundary (0, boundary);
 
-                                  // write out the mesh. may not be
-                                  // strictly necessary here, but is
-                                  // a good test for functionality
-                                  // that may not actually be tested
-                                  // anywhere else
+  // write out the mesh. may not be
+  // strictly necessary here, but is
+  // a good test for functionality
+  // that may not actually be tested
+  // anywhere else
   MappingQ<3> m(4);
   GridOut go;
   GridOutFlags::Gnuplot gof;
@@ -189,15 +190,15 @@ void run()
 
   for (unsigned int f=0; f<6; ++f)
     deallog << "Face=" << f << ", boundary_id="
-           << (int)triangulation.begin_active()->face(f)->boundary_indicator() << std::endl;
+            << (int)triangulation.begin_active()->face(f)->boundary_indicator() << std::endl;
 
   std::set<unsigned char> no_normal_flux_boundaries;
   no_normal_flux_boundaries.insert (0);
   no_normal_flux_boundaries.insert (2);
   VectorTools::compute_no_normal_flux_constraints
-    (dof_handler, 0,
-     no_normal_flux_boundaries,
-     constraints);
+  (dof_handler, 0,
+   no_normal_flux_boundaries,
+   constraints);
 
   constraints.print(deallog.get_file_stream());
 
index bd71f4407e5061f0708d734b9369e4d5fc96600a..f87e5376d1d82271440cb06cd23ac612b9e2415d 100644 (file)
@@ -33,8 +33,8 @@
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-                     const hp::FECollection<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const hp::FECollection<dim> &fe)
 {
   hp::DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -42,13 +42,13 @@ void test (const Triangulation<dim>& tr,
   for (unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
     {
       deallog << "FE=" << fe[0].get_name()
-             << ", case=" << i
-             << std::endl;
+              << ", case=" << i
+              << std::endl;
 
       std::set<types::boundary_id> boundary_ids;
       for (unsigned int j=0; j<=i; ++j)
-       boundary_ids.insert (j);
-      
+        boundary_ids.insert (j);
+
       ConstraintMatrix cm;
       VectorTools::compute_no_normal_flux_constraints (dof, 0, boundary_ids, cm);
 
@@ -65,7 +65,7 @@ void test_hyper_cube()
 
   for (unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
     tr.begin_active()->face(i)->set_boundary_indicator (i);
-  
+
   tr.refine_global(2);
 
   for (unsigned int degree=1; degree<4; ++degree)
@@ -80,7 +80,7 @@ int main()
 {
   std::ofstream logfile ("no_flux_hp_01/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
   deallog.threshold_double(1.e-12);
index 7baac79f6f927e4253b15e19886364a0610a5037..f2b56339a5c8f88f090cd92dce7ec070d148c91d 100644 (file)
@@ -35,8 +35,8 @@
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-                     const hp::FECollection<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const hp::FECollection<dim> &fe)
 {
   hp::DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -44,13 +44,13 @@ void test (const Triangulation<dim>& tr,
   for (unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
     {
       deallog << "FE=" << fe[0].get_name()
-             << ", case=" << i
-             << std::endl;
+              << ", case=" << i
+              << std::endl;
 
       std::set<types::boundary_id> boundary_ids;
       for (unsigned int j=0; j<=i; ++j)
-       boundary_ids.insert (j);
-      
+        boundary_ids.insert (j);
+
       ConstraintMatrix cm;
       VectorTools::compute_no_normal_flux_constraints (dof, 1, boundary_ids, cm);
 
@@ -67,14 +67,14 @@ void test_hyper_cube()
 
   for (unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
     tr.begin_active()->face(i)->set_boundary_indicator (i);
-  
+
   tr.refine_global(2);
 
   for (unsigned int degree=1; degree<4; ++degree)
     {
       hp::FECollection<dim> fe (FESystem<dim> (FE_Q<dim>(degree+1), 1,
-                                                          FE_Q<dim>(degree), dim,
-                                                          FE_Q<dim>(degree+1), 1));
+                                               FE_Q<dim>(degree), dim,
+                                               FE_Q<dim>(degree+1), 1));
       test(tr, fe);
     }
 }
@@ -84,7 +84,7 @@ int main()
 {
   std::ofstream logfile ("no_flux_hp_02/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
   deallog.threshold_double(1.e-12);
index 9e73c99db538cdcf466f9ed15fddd89aa196432d..ffd1f5c1a63a16265151e9d34c87a82218027c9a 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-                     const hp::FECollection<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const hp::FECollection<dim> &fe)
 {
   hp::DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   deallog << "FE=" << fe[0].get_name()
-         << std::endl;
+          << std::endl;
 
   std::set<types::boundary_id> boundary_ids;
   boundary_ids.insert (0);
-      
+
   ConstraintMatrix cm;
   VectorTools::compute_no_normal_flux_constraints (dof, 0, boundary_ids, cm);
 
@@ -62,7 +62,7 @@ void test_hyper_sphere()
 
   static const HyperBallBoundary<dim> boundary;
   tr.set_boundary (0, boundary);
-  
+
   tr.refine_global(2);
 
   for (unsigned int degree=1; degree<4; ++degree)
index 6ba2e6562e2a97189a728972113f87b6b9b092b0..65ee5a93f2e08df852d8399037913162ca7bd0a2 100644 (file)
 template <int dim>
 class RadialFunction : public Function<dim>
 {
-  public:
-    RadialFunction() : Function<dim> (dim) {}
+public:
+  RadialFunction() : Function<dim> (dim) {}
 
-    virtual void vector_value (const Point<dim> &p,
-                              Vector<double> &v) const
+  virtual void vector_value (const Point<dim> &p,
+                             Vector<double> &v) const
+  {
+    Assert (v.size() == dim, ExcInternalError());
+
+    switch (dim)
       {
-       Assert (v.size() == dim, ExcInternalError());
-
-       switch (dim)
-         {
-           case 2:
-                 v(0) = p[0] + p[1];
-                 v(1) = p[1] - p[0];
-                 break;
-           case 3:
-                 v(0) = p[0] + p[1];
-                 v(1) = p[1] - p[0];
-                 v(2) = p[2];
-                 break;
-           default:
-                 Assert (false, ExcNotImplemented());
-         }
+      case 2:
+        v(0) = p[0] + p[1];
+        v(1) = p[1] - p[0];
+        break;
+      case 3:
+        v(0) = p[0] + p[1];
+        v(1) = p[1] - p[0];
+        v(2) = p[2];
+        break;
+      default:
+        Assert (false, ExcNotImplemented());
       }
+  }
 };
 
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const hp::FECollection<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const hp::FECollection<dim> &fe)
 {
   hp::DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   deallog << "FE=" << fe[0].get_name()
-         << std::endl;
+          << std::endl;
 
   std::set<types::boundary_id> boundary_ids;
   boundary_ids.insert (0);
@@ -90,7 +90,7 @@ void test (const Triangulation<dim>& tr,
 
   cm.distribute (v);
 
-                                  // remove small entries
+  // remove small entries
   for (unsigned int i=0; i<v.size(); ++i)
     if (std::fabs (v(i)) < 1e-12)
       v(i) = 0;
@@ -99,12 +99,12 @@ void test (const Triangulation<dim>& tr,
   data_out.attach_dof_handler (dh);
 
   std::vector<DataComponentInterpretation::DataComponentInterpretation>
-    data_component_interpretation
-    (dim, DataComponentInterpretation::component_is_part_of_vector);
+  data_component_interpretation
+  (dim, DataComponentInterpretation::component_is_part_of_vector);
 
   data_out.add_data_vector (v, "x",
-                           DataOut<dim, hp::DoFHandler<dim> >::type_dof_data,
-                           data_component_interpretation);
+                            DataOut<dim, hp::DoFHandler<dim> >::type_dof_data,
+                            data_component_interpretation);
   data_out.build_patches (fe[0].degree);
 
   data_out.write_vtk (deallog.get_file_stream());
index 847cc90be37b0e25fc1ee1302f2f280820a8339b..05450a31ed08dee2f2bd91a04337d4bc803f9031 100644 (file)
@@ -38,8 +38,8 @@
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-                     const hp::FECollection<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const hp::FECollection<dim> &fe)
 {
   hp::DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -49,12 +49,12 @@ void test (const Triangulation<dim>& tr,
   for (unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
     {
       deallog << "FE=" << fe[0].get_name()
-             << ", case=" << i
-             << std::endl;
+              << ", case=" << i
+              << std::endl;
 
       std::set<types::boundary_id> boundary_ids;
       for (unsigned int j=0; j<=i; ++j)
-       boundary_ids.insert (j);
+        boundary_ids.insert (j);
 
       ConstraintMatrix cm;
       VectorTools::compute_no_normal_flux_constraints (dof, 0, boundary_ids, cm);
@@ -78,7 +78,7 @@ void test_hyper_cube()
   for (unsigned int degree=1; degree<4; ++degree)
     {
       hp::FECollection<dim> fe (FESystem<dim> (FE_Q<dim>(degree), dim,
-                                                          FE_DGP<dim>(degree+1), 1));
+                                               FE_DGP<dim>(degree+1), 1));
       test(tr, fe);
     }
 }
index 979e2364b3796bac60ba673b39288be5e6846214..ad5446a3a83c3746a2a7ce340b9c00c31c5c6f7f 100644 (file)
 
 
 void create_triangulation(const unsigned int case_no,
-                         Triangulation<3> &tria)
+                          Triangulation<3> &tria)
 {
   switch (case_no)
     {
-      case 0:
-           GridGenerator::hyper_cube(tria, 1., 3.);
-           break;
-      case 1:
-      {
-       GridGenerator::hyper_cube(tria, 1., 3.);
-       Point<3> &v0=tria.begin_active()->vertex(0);
-       v0 = Point<3> (0,-0.5,-1);
-       Point<3> &v1=tria.begin_active()->vertex(1);
-       v1 = Point<3> (1.25, 0.25, 0.25);
-       break;
-      }
-      default:
-           Assert(false, ExcNotImplemented());
+    case 0:
+      GridGenerator::hyper_cube(tria, 1., 3.);
+      break;
+    case 1:
+    {
+      GridGenerator::hyper_cube(tria, 1., 3.);
+      Point<3> &v0=tria.begin_active()->vertex(0);
+      v0 = Point<3> (0,-0.5,-1);
+      Point<3> &v1=tria.begin_active()->vertex(1);
+      v1 = Point<3> (1.25, 0.25, 0.25);
+      break;
+    }
+    default:
+      Assert(false, ExcNotImplemented());
     };
 }
 
@@ -77,18 +77,18 @@ int main ()
       const Triangulation<3>::active_cell_iterator cell=tria.begin_active();
       Triangulation<3>::face_iterator face;
       for (unsigned int face_no=0; face_no<GeometryInfo<3>::faces_per_cell; ++face_no)
-       {
-         face=cell->face(face_no);
-         boundary.get_normals_at_vertices(face, normals);
-         for (unsigned int v=0; v<GeometryInfo<3>::vertices_per_face; ++v)
-           Assert ((boundary.normal_vector (face,
-                                            face->vertex(v))
-                    -
-                    normals[v] / normals[v].norm()).norm()
-                   <
-                   1e-12,
-                   ExcInternalError());
-       }
+        {
+          face=cell->face(face_no);
+          boundary.get_normals_at_vertices(face, normals);
+          for (unsigned int v=0; v<GeometryInfo<3>::vertices_per_face; ++v)
+            Assert ((boundary.normal_vector (face,
+                                             face->vertex(v))
+                     -
+                     normals[v] / normals[v].norm()).norm()
+                    <
+                    1e-12,
+                    ExcInternalError());
+        }
       tria.clear();
     }
 
index e3ab94dc8db353e67bc33544ce079bfb4b63a8e0..19f04f394ce37e99dc80c77a71a7ad83823b33d3 100644 (file)
 
 
 void create_triangulation(const unsigned int case_no,
-                         Triangulation<2> &tria)
+                          Triangulation<2> &tria)
 {
   switch (case_no)
     {
-      case 0:
-           GridGenerator::hyper_cube(tria, 1., 3.);
-           break;
-      case 1:
-      {
-       GridGenerator::hyper_cube(tria, 1., 3.);
-       Point<2> &v0=tria.begin_active()->vertex(0);
-       v0 = Point<2> (-0.5,-1);
-       Point<2> &v1=tria.begin_active()->vertex(1);
-       v1 = Point<2> (0.25, 0.25);
-       break;
-      }
-      default:
-           Assert(false, ExcNotImplemented());
+    case 0:
+      GridGenerator::hyper_cube(tria, 1., 3.);
+      break;
+    case 1:
+    {
+      GridGenerator::hyper_cube(tria, 1., 3.);
+      Point<2> &v0=tria.begin_active()->vertex(0);
+      v0 = Point<2> (-0.5,-1);
+      Point<2> &v1=tria.begin_active()->vertex(1);
+      v1 = Point<2> (0.25, 0.25);
+      break;
+    }
+    default:
+      Assert(false, ExcNotImplemented());
     };
 }
 
@@ -77,18 +77,18 @@ int main ()
       const Triangulation<2>::active_cell_iterator cell=tria.begin_active();
       Triangulation<2>::face_iterator face;
       for (unsigned int face_no=0; face_no<GeometryInfo<2>::faces_per_cell; ++face_no)
-       {
-         face=cell->face(face_no);
-         boundary.get_normals_at_vertices(face, normals);
-         for (unsigned int v=0; v<GeometryInfo<2>::vertices_per_face; ++v)
-           Assert ((boundary.normal_vector (face,
-                                            face->vertex(v))
-                    -
-                    normals[v] / normals[v].norm()).norm()
-                   <
-                   1e-12,
-                   ExcInternalError());
-       }
+        {
+          face=cell->face(face_no);
+          boundary.get_normals_at_vertices(face, normals);
+          for (unsigned int v=0; v<GeometryInfo<2>::vertices_per_face; ++v)
+            Assert ((boundary.normal_vector (face,
+                                             face->vertex(v))
+                     -
+                     normals[v] / normals[v].norm()).norm()
+                    <
+                    1e-12,
+                    ExcInternalError());
+        }
       tria.clear();
     }
 
index 1c850b1ceb44e98027ae0b33924eccb31089c367..4e29cb56fd0119cc880ad32379a33a747d0f5a75 100644 (file)
@@ -50,20 +50,20 @@ int main ()
   Triangulation<3>::active_cell_iterator cell=tria.begin_active();
   for (; cell!=tria.end(); ++cell)
     for (unsigned int face_no=0;
-        face_no<GeometryInfo<3>::faces_per_cell; ++face_no)
+         face_no<GeometryInfo<3>::faces_per_cell; ++face_no)
       if (cell->at_boundary(face_no))
-       {
-         Triangulation<3>::face_iterator face = cell->face(face_no);
-         boundary.get_normals_at_vertices(face, normals);
-         for (unsigned int v=0; v<GeometryInfo<3>::vertices_per_face; ++v)
-           Assert ((boundary.normal_vector (face,
-                                            face->vertex(v))
-                    -
-                    normals[v] / normals[v].norm()).norm()
-                   <
-                   1e-12,
-                   ExcInternalError());
-       }
+        {
+          Triangulation<3>::face_iterator face = cell->face(face_no);
+          boundary.get_normals_at_vertices(face, normals);
+          for (unsigned int v=0; v<GeometryInfo<3>::vertices_per_face; ++v)
+            Assert ((boundary.normal_vector (face,
+                                             face->vertex(v))
+                     -
+                     normals[v] / normals[v].norm()).norm()
+                    <
+                    1e-12,
+                    ExcInternalError());
+        }
 
   deallog << "OK" << std::endl;
 }
index 7f8ba09dc184da2b6dc7771f37642b410bca5c3f..bdc288996243c1b865b39396c1c2caa4f9c4cee0 100644 (file)
@@ -50,20 +50,20 @@ int main ()
   Triangulation<2>::active_cell_iterator cell=tria.begin_active();
   for (; cell!=tria.end(); ++cell)
     for (unsigned int face_no=0;
-        face_no<GeometryInfo<2>::faces_per_cell; ++face_no)
+         face_no<GeometryInfo<2>::faces_per_cell; ++face_no)
       if (cell->at_boundary(face_no))
-       {
-         Triangulation<2>::face_iterator face = cell->face(face_no);
-         boundary.get_normals_at_vertices(face, normals);
-         for (unsigned int v=0; v<GeometryInfo<2>::vertices_per_face; ++v)
-           Assert ((boundary.normal_vector (face,
-                                            face->vertex(v))
-                    -
-                    normals[v] / normals[v].norm()).norm()
-                   <
-                   1e-12,
-                   ExcInternalError());
-       }
+        {
+          Triangulation<2>::face_iterator face = cell->face(face_no);
+          boundary.get_normals_at_vertices(face, normals);
+          for (unsigned int v=0; v<GeometryInfo<2>::vertices_per_face; ++v)
+            Assert ((boundary.normal_vector (face,
+                                             face->vertex(v))
+                     -
+                     normals[v] / normals[v].norm()).norm()
+                    <
+                    1e-12,
+                    ExcInternalError());
+        }
 
   deallog << "OK" << std::endl;
 }
index b58297dd4c49784d8bc210b61361c9edd0a2c791..c1a47bd26dc13161cbc79a37eeb8ef18d6786c0a 100644 (file)
 
 
 void create_triangulation(const unsigned int case_no,
-                         Triangulation<3> &tria)
+                          Triangulation<3> &tria)
 {
   switch (case_no)
     {
-      case 0:
-           GridGenerator::hyper_cube(tria, 1., 3.);
-           break;
-      case 1:
-      {
-       GridGenerator::hyper_cube(tria, 1., 3.);
-       Point<3> &v0=tria.begin_active()->vertex(0);
-       v0 = Point<3> (0,-0.5,-1);
-       Point<3> &v1=tria.begin_active()->vertex(1);
-       v1 = Point<3> (1.25, 0.25, 0.25);
-       break;
-      }
-      default:
-           Assert(false, ExcNotImplemented());
+    case 0:
+      GridGenerator::hyper_cube(tria, 1., 3.);
+      break;
+    case 1:
+    {
+      GridGenerator::hyper_cube(tria, 1., 3.);
+      Point<3> &v0=tria.begin_active()->vertex(0);
+      v0 = Point<3> (0,-0.5,-1);
+      Point<3> &v1=tria.begin_active()->vertex(1);
+      v1 = Point<3> (1.25, 0.25, 0.25);
+      break;
+    }
+    default:
+      Assert(false, ExcNotImplemented());
     };
 }
 
@@ -80,36 +80,36 @@ int main ()
       const Triangulation<3>::active_cell_iterator cell=tria.begin_active();
       Triangulation<3>::face_iterator face;
       for (unsigned int face_no=0; face_no<GeometryInfo<3>::faces_per_cell; ++face_no)
-       {
-         face=cell->face(face_no);
-         boundary.get_normals_at_vertices(face, normals);
-
-         for (double xi=0; xi<=1; xi+=0.234)
-           for (double eta=0; eta<=1; eta+=0.234)
-             {
-               Point<3> p;
-               Tensor<1,3> normal;
-
-               for (unsigned int v=0; v<GeometryInfo<3>::vertices_per_face; ++v)
-                 {
-                   p += face->vertex(v) * linear_interpolator.shape_value(v,Point<2>(xi,eta));
-                   normal += normals[v] *
-                             linear_interpolator.shape_value(v,Point<2>(xi,eta));
-                 }
-               normal /= normal.norm();
-
-               deallog << "p=" << p
-                       << ", n=" << boundary.normal_vector (face, p)
-                       << std::endl;
-
-               Assert ((boundary.normal_vector (face, p)
-                        -
-                       normal).norm()
-                       <
-                       1e-10,
-                       ExcInternalError());
-             }
-       }
+        {
+          face=cell->face(face_no);
+          boundary.get_normals_at_vertices(face, normals);
+
+          for (double xi=0; xi<=1; xi+=0.234)
+            for (double eta=0; eta<=1; eta+=0.234)
+              {
+                Point<3> p;
+                Tensor<1,3> normal;
+
+                for (unsigned int v=0; v<GeometryInfo<3>::vertices_per_face; ++v)
+                  {
+                    p += face->vertex(v) * linear_interpolator.shape_value(v,Point<2>(xi,eta));
+                    normal += normals[v] *
+                              linear_interpolator.shape_value(v,Point<2>(xi,eta));
+                  }
+                normal /= normal.norm();
+
+                deallog << "p=" << p
+                        << ", n=" << boundary.normal_vector (face, p)
+                        << std::endl;
+
+                Assert ((boundary.normal_vector (face, p)
+                         -
+                         normal).norm()
+                        <
+                        1e-10,
+                        ExcInternalError());
+              }
+        }
 
       tria.clear();
     }
index 22bdefa457ff05c7c59e78306fcc51461bf912b1..6ef13d3c017a28532677941dc7efcfab87880c33 100644 (file)
 
 
 void create_triangulation(const unsigned int case_no,
-                         Triangulation<2> &tria)
+                          Triangulation<2> &tria)
 {
   switch (case_no)
     {
-      case 0:
-           GridGenerator::hyper_cube(tria, 1., 3.);
-           break;
-      case 1:
-      {
-       GridGenerator::hyper_cube(tria, 1., 3.);
-       Point<2> &v0=tria.begin_active()->vertex(0);
-       v0 = Point<2> (-0.5,-1);
-       Point<2> &v1=tria.begin_active()->vertex(1);
-       v1 = Point<2> (1.25, 0.25);
-       break;
-      }
-      default:
-           Assert(false, ExcNotImplemented());
+    case 0:
+      GridGenerator::hyper_cube(tria, 1., 3.);
+      break;
+    case 1:
+    {
+      GridGenerator::hyper_cube(tria, 1., 3.);
+      Point<2> &v0=tria.begin_active()->vertex(0);
+      v0 = Point<2> (-0.5,-1);
+      Point<2> &v1=tria.begin_active()->vertex(1);
+      v1 = Point<2> (1.25, 0.25);
+      break;
+    }
+    default:
+      Assert(false, ExcNotImplemented());
     };
 }
 
@@ -80,36 +80,36 @@ int main ()
       const Triangulation<2>::active_cell_iterator cell=tria.begin_active();
       Triangulation<2>::face_iterator face;
       for (unsigned int face_no=0; face_no<GeometryInfo<2>::faces_per_cell; ++face_no)
-       {
-         face=cell->face(face_no);
-         boundary.get_normals_at_vertices(face, normals);
-
-         for (double xi=0; xi<=1; xi+=0.234)
-           for (double eta=0; eta<=1; eta+=0.234)
-             {
-               Point<2> p;
-               Tensor<1,2> normal;
-
-               for (unsigned int v=0; v<GeometryInfo<2>::vertices_per_face; ++v)
-                 {
-                   p += face->vertex(v) * linear_interpolator.shape_value(v,Point<2>(xi,eta));
-                   normal += normals[v] *
-                             linear_interpolator.shape_value(v,Point<2>(xi,eta));
-                 }
-               normal /= normal.norm();
-
-               deallog << "p=" << p
-                       << ", n=" << boundary.normal_vector (face, p)
-                       << std::endl;
-
-               Assert ((boundary.normal_vector (face, p)
-                        -
-                       normal).norm()
-                       <
-                       1e-10,
-                       ExcInternalError());
-             }
-       }
+        {
+          face=cell->face(face_no);
+          boundary.get_normals_at_vertices(face, normals);
+
+          for (double xi=0; xi<=1; xi+=0.234)
+            for (double eta=0; eta<=1; eta+=0.234)
+              {
+                Point<2> p;
+                Tensor<1,2> normal;
+
+                for (unsigned int v=0; v<GeometryInfo<2>::vertices_per_face; ++v)
+                  {
+                    p += face->vertex(v) * linear_interpolator.shape_value(v,Point<2>(xi,eta));
+                    normal += normals[v] *
+                              linear_interpolator.shape_value(v,Point<2>(xi,eta));
+                  }
+                normal /= normal.norm();
+
+                deallog << "p=" << p
+                        << ", n=" << boundary.normal_vector (face, p)
+                        << std::endl;
+
+                Assert ((boundary.normal_vector (face, p)
+                         -
+                         normal).norm()
+                        <
+                        1e-10,
+                        ExcInternalError());
+              }
+        }
 
       tria.clear();
     }
index 882a61c456c718fbcdae2b82a151af27bdf89719..6f72dbe80baca5890b2b89dde53ec4386e06244e 100644 (file)
 
 
 void create_triangulation(const unsigned int case_no,
-                         Triangulation<3> &tria)
+                          Triangulation<3> &tria)
 {
   switch (case_no)
     {
-      case 0:
-           GridGenerator::hyper_cube(tria, 1., 3.);
-           break;
-      case 1:
-      {
-       GridGenerator::hyper_cube(tria, 1., 3.);
-       Point<3> &v0=tria.begin_active()->vertex(0);
-       v0 = Point<3> (0,-0.5,-1);
-       Point<3> &v1=tria.begin_active()->vertex(1);
-       v1 = Point<3> (1.25, 0.25, 0.25);
-       break;
-      }
-      default:
-           Assert(false, ExcNotImplemented());
+    case 0:
+      GridGenerator::hyper_cube(tria, 1., 3.);
+      break;
+    case 1:
+    {
+      GridGenerator::hyper_cube(tria, 1., 3.);
+      Point<3> &v0=tria.begin_active()->vertex(0);
+      v0 = Point<3> (0,-0.5,-1);
+      Point<3> &v1=tria.begin_active()->vertex(1);
+      v1 = Point<3> (1.25, 0.25, 0.25);
+      break;
+    }
+    default:
+      Assert(false, ExcNotImplemented());
     };
 }
 
@@ -76,22 +76,22 @@ int main ()
       const Triangulation<3>::active_cell_iterator cell=tria.begin_active();
       Triangulation<3>::face_iterator face;
       for (unsigned int face_no=0; face_no<GeometryInfo<3>::faces_per_cell; ++face_no)
-       {
-         deallog << " Face" << face_no << std::endl;
-         face=cell->face(face_no);
-         boundary.get_normals_at_vertices(face, normals);
-         for (unsigned int v=0; v<GeometryInfo<3>::vertices_per_face; ++v)
-           {
-             deallog << "  vertex=" << face->vertex(v)
-                     << ",  normal=" << normals[v] << std::endl;
+        {
+          deallog << " Face" << face_no << std::endl;
+          face=cell->face(face_no);
+          boundary.get_normals_at_vertices(face, normals);
+          for (unsigned int v=0; v<GeometryInfo<3>::vertices_per_face; ++v)
+            {
+              deallog << "  vertex=" << face->vertex(v)
+                      << ",  normal=" << normals[v] << std::endl;
 
-                                              // note that we can't check
-                                              // here that the normal vector
-                                              // is, in fact, normalized,
-                                              // since the function does not
-                                              // actually guarantee that
-           }
-       }
+              // note that we can't check
+              // here that the normal vector
+              // is, in fact, normalized,
+              // since the function does not
+              // actually guarantee that
+            }
+        }
       tria.clear();
     }
 }
index 4d0a477d5aedf2d41d61678c9b8e13d1381f94b0..5d20005b0d0ca24ebb072cb8ab93fdc58a1e28f0 100644 (file)
@@ -50,22 +50,22 @@ int main ()
   Triangulation<3>::active_cell_iterator cell=tria.begin_active();
   for (; cell!=tria.end(); ++cell)
     for (unsigned int face_no=0;
-        face_no<GeometryInfo<3>::faces_per_cell; ++face_no)
+         face_no<GeometryInfo<3>::faces_per_cell; ++face_no)
       if (cell->at_boundary(face_no))
-       {
-         deallog << " Face" << face_no << std::endl;
-         Triangulation<3>::face_iterator face = cell->face(face_no);
-         boundary.get_normals_at_vertices(face, normals);
-         for (unsigned int v=0; v<GeometryInfo<3>::vertices_per_face; ++v)
-           {
-             deallog << "  vertex=" << face->vertex(v)
-                     << ",  normal=" << normals[v] << std::endl;
+        {
+          deallog << " Face" << face_no << std::endl;
+          Triangulation<3>::face_iterator face = cell->face(face_no);
+          boundary.get_normals_at_vertices(face, normals);
+          for (unsigned int v=0; v<GeometryInfo<3>::vertices_per_face; ++v)
+            {
+              deallog << "  vertex=" << face->vertex(v)
+                      << ",  normal=" << normals[v] << std::endl;
 
-                                              // note that we can't check
-                                              // here that the normal vector
-                                              // is, in fact, normalized,
-                                              // since the function does not
-                                              // actually guarantee that
-           }
-       }
+              // note that we can't check
+              // here that the normal vector
+              // is, in fact, normalized,
+              // since the function does not
+              // actually guarantee that
+            }
+        }
 }
index 6d99b4fd0fb269bd46f16aebfcb8d72b65c3f333..a04e88f1dd05435455b42dff7da1aaded3d02c97 100644 (file)
@@ -42,7 +42,7 @@ std::ofstream logfile("number_cache_01/output");
 template <int dim>
 void output (const Triangulation<dim> &tria)
 {
-  
+
   deallog << "  " << tria.n_active_cells() << std::endl;
   deallog << "  " << tria.n_cells() << std::endl;
   deallog << "  " << tria.n_active_lines() << std::endl;
@@ -57,22 +57,22 @@ void output (const Triangulation<dim> &tria)
       deallog << "  " << tria.n_active_cells(i) << std::endl;
       deallog << "  " << tria.n_cells(i) << std::endl;
       if (dim == 1)
-       {
-         deallog << "  " << tria.n_active_lines(i) << std::endl;
-         deallog << "  " << tria.n_lines(i) << std::endl;
-       }
-      
+        {
+          deallog << "  " << tria.n_active_lines(i) << std::endl;
+          deallog << "  " << tria.n_lines(i) << std::endl;
+        }
+
       if (dim == 2)
-       {
-         deallog << "  " << tria.n_active_quads(i) << std::endl;
-         deallog << "  " << tria.n_quads(i) << std::endl;
-       }
-      
+        {
+          deallog << "  " << tria.n_active_quads(i) << std::endl;
+          deallog << "  " << tria.n_quads(i) << std::endl;
+        }
+
       if (dim == 3)
-       {
-         deallog << "  " << tria.n_active_hexs(i) << std::endl;
-         deallog << "  " << tria.n_hexs(i) << std::endl;
-       }
+        {
+          deallog << "  " << tria.n_active_hexs(i) << std::endl;
+          deallog << "  " << tria.n_hexs(i) << std::endl;
+        }
     }
 }
 
@@ -81,10 +81,10 @@ template <int dim>
 void test ()
 {
   deallog << dim << "d" << std::endl;
-  
+
   Triangulation<dim> tria;
   GridGenerator::hyper_cube (tria);
-  
+
   output (tria);
 
   deallog << "Refining..." << std::endl;
index 5627f5f98bb7ed2a2807a99b9ff6b73de93edcb9..44e7c4ce7f58952f614ca3095e2a9ea280069363 100644 (file)
@@ -57,22 +57,22 @@ void output (const Triangulation<dim> &tria)
       deallog << "  " << tria.n_active_cells(i) << std::endl;
       deallog << "  " << tria.n_cells(i) << std::endl;
       if (dim == 1)
-       {
-         deallog << "  " << tria.n_active_lines(i) << std::endl;
-         deallog << "  " << tria.n_lines(i) << std::endl;
-       }
+        {
+          deallog << "  " << tria.n_active_lines(i) << std::endl;
+          deallog << "  " << tria.n_lines(i) << std::endl;
+        }
 
       if (dim == 2)
-       {
-         deallog << "  " << tria.n_active_quads(i) << std::endl;
-         deallog << "  " << tria.n_quads(i) << std::endl;
-       }
+        {
+          deallog << "  " << tria.n_active_quads(i) << std::endl;
+          deallog << "  " << tria.n_quads(i) << std::endl;
+        }
 
       if (dim == 3)
-       {
-         deallog << "  " << tria.n_active_hexs(i) << std::endl;
-         deallog << "  " << tria.n_hexs(i) << std::endl;
-       }
+        {
+          deallog << "  " << tria.n_active_hexs(i) << std::endl;
+          deallog << "  " << tria.n_hexs(i) << std::endl;
+        }
     }
 }
 
@@ -93,28 +93,28 @@ void test (const char *filename)
     }
   catch (typename Triangulation<dim>::DistortedCellList &dcv)
     {
-                                      // ignore the exception that we
-                                      // get because the mesh has
-                                      // distorted cells
+      // ignore the exception that we
+      // get because the mesh has
+      // distorted cells
       deallog << dcv.distorted_cells.size() << " cells are distorted."
-             << std::endl;
+              << std::endl;
     }
   catch (std::exception &exc)
     {
       deallog << "  caught exception:" << std::endl
-             << exc.what()
-             << std::endl;
+              << exc.what()
+              << std::endl;
       return;
     }
 
   output (tria);
 
-                                  // now refine a few cells and output again
+  // now refine a few cells and output again
   deallog << "  Refining..." << std::endl;
   typename Triangulation<dim>::active_cell_iterator
-    cell = tria.begin_active();
+  cell = tria.begin_active();
   for (unsigned int i=0; i<=std::min (tria.n_active_cells() / 3,
-                                     10U); ++i, ++cell)
+                                      10U); ++i, ++cell)
     cell->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
 
index 89fba24697b54491628646c37bf50027169815f5..164a6117ca2ccaf8b5c2a885acbc162a1933b99c 100644 (file)
@@ -62,22 +62,22 @@ void output (const Triangulation<dim> &tria)
       deallog << "  " << tria.n_active_cells(i) << std::endl;
       deallog << "  " << tria.n_cells(i) << std::endl;
       if (dim == 1)
-       {
-         deallog << "  " << tria.n_active_lines(i) << std::endl;
-         deallog << "  " << tria.n_lines(i) << std::endl;
-       }
+        {
+          deallog << "  " << tria.n_active_lines(i) << std::endl;
+          deallog << "  " << tria.n_lines(i) << std::endl;
+        }
 
       if (dim == 2)
-       {
-         deallog << "  " << tria.n_active_quads(i) << std::endl;
-         deallog << "  " << tria.n_quads(i) << std::endl;
-       }
+        {
+          deallog << "  " << tria.n_active_quads(i) << std::endl;
+          deallog << "  " << tria.n_quads(i) << std::endl;
+        }
 
       if (dim == 3)
-       {
-         deallog << "  " << tria.n_active_hexs(i) << std::endl;
-         deallog << "  " << tria.n_hexs(i) << std::endl;
-       }
+        {
+          deallog << "  " << tria.n_active_hexs(i) << std::endl;
+          deallog << "  " << tria.n_hexs(i) << std::endl;
+        }
     }
 }
 
index d4b62b5e30bd63f6807016baa2682a0840b0ab9d..1f37fee27ff104ed76f9986ec6b0acfc37dde7fe 100644 (file)
@@ -56,14 +56,14 @@ template <int dim>
 class TestPointValueHistory
 {
 public:
-    TestPointValueHistory();
-    void run();
+  TestPointValueHistory();
+  void run();
 
 private:
-    Triangulation <dim> triangulation;
-    FESystem<dim> finite_element;
-    DoFHandler <dim > dof_handler;
-    PointValueHistory <dim> test_copy;
+  Triangulation <dim> triangulation;
+  FESystem<dim> finite_element;
+  DoFHandler <dim > dof_handler;
+  PointValueHistory <dim> test_copy;
 };
 
 
@@ -71,9 +71,9 @@ private:
 
 template <int dim>
 TestPointValueHistory<dim>::TestPointValueHistory() :
-finite_element(FE_Q<dim > (1 + 1), dim, FE_Q<dim > (1), 1),
+  finite_element(FE_Q<dim > (1 + 1), dim, FE_Q<dim > (1), 1),
 
-dof_handler(triangulation)
+  dof_handler(triangulation)
 { }
 
 
@@ -82,179 +82,180 @@ dof_handler(triangulation)
 template <int dim>
 void TestPointValueHistory<dim>::run()
 {
-    // Make a triangulation
-    GridGenerator::hyper_cube(triangulation, 0, 1);
-    triangulation.refine_global(2); // refine 2 times to make 5 nodes per side
-
-    // make a DOF handler, a model solution filled with ones and a flow vector
-    //    FESystem<dim> finite_element(FE_Q<dim > (1 + 1), dim, FE_Q<dim > (1), 1); // Already done!
-    //    DoFHandler <dim > dof_handler(triangulation);
-    dof_handler.distribute_dofs(finite_element);
-    DoFRenumbering::Cuthill_McKee(dof_handler);
-
-    // renumber for components so that same dof indices are used for BlockVectors and normal Vectors
-    std::vector<unsigned int> block_component(dim + 1, 0);
-    block_component[dim] = 1; // component dim = pressure component!
-    DoFRenumbering::component_wise(dof_handler, block_component);
-
-    // Vector
-    Vector <double> solution, post_processed, poles;
-    solution.reinit(dof_handler.n_dofs());
-    post_processed.reinit(dof_handler.n_dofs());
-    poles.reinit(dof_handler.n_dofs());
-
-    // set up a simple linear discrete time system so that time plots vary
-    // over the mesh but can be easily checked. The basic idea is to have each
-    // component of the fe_system to depend on a specific dimension (i.e component 0
-    // depends on dim 0, etc. % dim handles the case where there are more components
-    // than dimensions. The code breaks down at the edges of the mesh and this is
-    // not corrected for.
-    {
-        QGauss<dim> quadrature_formula(2);
-        FEValues<dim> fe_values(finite_element, quadrature_formula, update_values | update_quadrature_points); // just need local_dof_indices and quadrature_points
-
-        std::vector<types::global_dof_index> local_dof_indices(finite_element.dofs_per_cell);
-        std::vector<Point<dim> > dof_locations(finite_element.dofs_per_cell);
-        Vector<double> cell_pole(finite_element.dofs_per_cell);
-
-        typename DoFHandler<dim>::active_cell_iterator cell, endc;
-        cell = dof_handler.begin_active();
-        endc = dof_handler.end();
-        for (; cell != endc; ++cell)
-        {
-            fe_values.reinit(cell); // need to get local_dof_indices
-            cell->get_dof_indices(local_dof_indices);
-            dof_locations = fe_values.get_quadrature_points();
-            cell_pole = 0;
-            for (unsigned int dof = 0; dof != finite_element.dofs_per_cell; dof++)
-            {
-                unsigned int dof_component = finite_element.system_to_component_index(dof).first;
-
-                for (unsigned int q_point = 0; q_point < quadrature_formula.size(); ++q_point)
-                {
-                    cell_pole(dof) += (fe_values.shape_value(dof, q_point) * dof_locations [q_point] (dof_component % dim));
-                }
-                solution(local_dof_indices [dof]) = 1; // start all solutions at 1
-                poles(local_dof_indices[dof]) -= cell_pole(dof);
-
-                if (dof_component == dim) // components start numbering at 0
-                    poles(local_dof_indices[dof]) = -0.1; // dim+1th component is not handled well by the code above
-            }
-
-        } // loop over all cells
-        poles.add(1.0); // slow down the pole settling time
-        post_processed.add(3.0); // set to starting value.
-    }
+  // Make a triangulation
+  GridGenerator::hyper_cube(triangulation, 0, 1);
+  triangulation.refine_global(2); // refine 2 times to make 5 nodes per side
+
+  // make a DOF handler, a model solution filled with ones and a flow vector
+  //    FESystem<dim> finite_element(FE_Q<dim > (1 + 1), dim, FE_Q<dim > (1), 1); // Already done!
+  //    DoFHandler <dim > dof_handler(triangulation);
+  dof_handler.distribute_dofs(finite_element);
+  DoFRenumbering::Cuthill_McKee(dof_handler);
+
+  // renumber for components so that same dof indices are used for BlockVectors and normal Vectors
+  std::vector<unsigned int> block_component(dim + 1, 0);
+  block_component[dim] = 1; // component dim = pressure component!
+  DoFRenumbering::component_wise(dof_handler, block_component);
+
+  // Vector
+  Vector <double> solution, post_processed, poles;
+  solution.reinit(dof_handler.n_dofs());
+  post_processed.reinit(dof_handler.n_dofs());
+  poles.reinit(dof_handler.n_dofs());
+
+  // set up a simple linear discrete time system so that time plots vary
+  // over the mesh but can be easily checked. The basic idea is to have each
+  // component of the fe_system to depend on a specific dimension (i.e component 0
+  // depends on dim 0, etc. % dim handles the case where there are more components
+  // than dimensions. The code breaks down at the edges of the mesh and this is
+  // not corrected for.
+  {
+    QGauss<dim> quadrature_formula(2);
+    FEValues<dim> fe_values(finite_element, quadrature_formula, update_values | update_quadrature_points); // just need local_dof_indices and quadrature_points
+
+    std::vector<types::global_dof_index> local_dof_indices(finite_element.dofs_per_cell);
+    std::vector<Point<dim> > dof_locations(finite_element.dofs_per_cell);
+    Vector<double> cell_pole(finite_element.dofs_per_cell);
+
+    typename DoFHandler<dim>::active_cell_iterator cell, endc;
+    cell = dof_handler.begin_active();
+    endc = dof_handler.end();
+    for (; cell != endc; ++cell)
+      {
+        fe_values.reinit(cell); // need to get local_dof_indices
+        cell->get_dof_indices(local_dof_indices);
+        dof_locations = fe_values.get_quadrature_points();
+        cell_pole = 0;
+        for (unsigned int dof = 0; dof != finite_element.dofs_per_cell; dof++)
+          {
+            unsigned int dof_component = finite_element.system_to_component_index(dof).first;
+
+            for (unsigned int q_point = 0; q_point < quadrature_formula.size(); ++q_point)
+              {
+                cell_pole(dof) += (fe_values.shape_value(dof, q_point) * dof_locations [q_point] (dof_component % dim));
+              }
+            solution(local_dof_indices [dof]) = 1; // start all solutions at 1
+            poles(local_dof_indices[dof]) -= cell_pole(dof);
+
+            if (dof_component == dim) // components start numbering at 0
+              poles(local_dof_indices[dof]) = -0.1; // dim+1th component is not handled well by the code above
+          }
+
+      } // loop over all cells
+    poles.add(1.0); // slow down the pole settling time
+    post_processed.add(3.0); // set to starting value.
+  }
+
+  // Setup monitor node to print variation over time
+  unsigned int n_inputs = 1;
+  PointValueHistory<dim> node_monitor (dof_handler, n_inputs);
+  PointValueHistory<dim> no_dof_handler (n_inputs);
+
+  // check that the assignment operator is valid
+  test_copy = node_monitor;
+  test_copy.add_point(Point<2>(1, 0.2));
+  test_copy.add_field_name("Solution");
+  std::vector < std::vector <Point <dim> > > selected_locations;
+  test_copy.get_points(selected_locations);
+  test_copy.mark_locations();
+  test_copy.close();
+  test_copy.start_new_dataset(0.1);
+  test_copy.evaluate_field("Solution", solution);
+  std::vector <double> input_value(n_inputs, 1);
+  test_copy.push_back_independent(input_value);
+  test_copy.write_gnuplot("point_value_history_01/Test_Copy");
+  test_copy.status(deallog.get_file_stream());
+  test_copy.clear ();
+  // end of assignment operator check
+
+  {
+    node_monitor.add_field_name("Solution");
+    node_monitor.add_field_name("Post Processed Vector"); // not sensitive to spaces
+
+    // two alternatives here, adding a point at a time or a vector of points
+    // 2d points
+    std::vector <Point < 2 > > point_vector(5, Point < 2 > ());
+    point_vector[0] = Point < 2 > (0, 0); // some of these points will hit a node, others won't
+    point_vector[1] = Point < 2 > (0.25, 0);
+    point_vector[2] = Point < 2 > (0.25, 0.45);
+    point_vector[3] = Point < 2 > (0.45, 0.45);
+    point_vector[4] = Point < 2 > (0.8, 0.8);
+
+    node_monitor.add_points(point_vector);
+    node_monitor.add_point(Point<2>(1, 0.2)); // add a single point
+
+    // MonitorNode requires that the instance is 'closed' before any data is added
+    // this ensures that points are not added once time starts.
+    node_monitor.close();
+    no_dof_handler.close(); // closing still required!
 
-    // Setup monitor node to print variation over time
-    unsigned int n_inputs = 1;
-    PointValueHistory<dim> node_monitor (dof_handler, n_inputs);
-    PointValueHistory<dim> no_dof_handler (n_inputs);
-
-    // check that the assignment operator is valid
-    test_copy = node_monitor;
-    test_copy.add_point(Point<2>(1, 0.2));
-    test_copy.add_field_name("Solution");
     std::vector < std::vector <Point <dim> > > selected_locations;
-    test_copy.get_points(selected_locations);
-    test_copy.mark_locations();
-    test_copy.close();
-    test_copy.start_new_dataset(0.1);
-    test_copy.evaluate_field("Solution", solution);
-    std::vector <double> input_value(n_inputs, 1);
-    test_copy.push_back_independent(input_value);
-    test_copy.write_gnuplot("point_value_history_01/Test_Copy");
-    test_copy.status(deallog.get_file_stream());
-    test_copy.clear ();
-    // end of assignment operator check
-
-    {
-        node_monitor.add_field_name("Solution");
-        node_monitor.add_field_name("Post Processed Vector"); // not sensitive to spaces
-
-        // two alternatives here, adding a point at a time or a vector of points
-        // 2d points
-        std::vector <Point < 2 > > point_vector(5, Point < 2 > ());
-        point_vector[0] = Point < 2 > (0, 0); // some of these points will hit a node, others won't
-        point_vector[1] = Point < 2 > (0.25, 0);
-        point_vector[2] = Point < 2 > (0.25, 0.45);
-        point_vector[3] = Point < 2 > (0.45, 0.45);
-        point_vector[4] = Point < 2 > (0.8, 0.8);
-
-        node_monitor.add_points(point_vector);
-        node_monitor.add_point(Point<2>(1, 0.2)); // add a single point
-
-        // MonitorNode requires that the instance is 'closed' before any data is added
-        // this ensures that points are not added once time starts.
-        node_monitor.close();
-        no_dof_handler.close(); // closing still required!
-
-        std::vector < std::vector <Point <dim> > > selected_locations;
-        node_monitor.get_points(selected_locations);
-        // write output to a file
-        Vector<double> node_locations = node_monitor.mark_locations();
-        // write output to a file
-    }
+    node_monitor.get_points(selected_locations);
+    // write output to a file
+    Vector<double> node_locations = node_monitor.mark_locations();
+    // write output to a file
+  }
 
-    double delta_t = 0.000001;
-    double t_max = 0.00001;
+  double delta_t = 0.000001;
+  double t_max = 0.00001;
 
-    for (double time = 0; time < t_max; time = time + delta_t)
+  for (double time = 0; time < t_max; time = time + delta_t)
     {
-        node_monitor.start_new_dataset(time);
-        no_dof_handler.start_new_dataset(time);
-        // time and input are special, they don't vary over the mesh.
-
-        std::vector <double> input_value(n_inputs, 1); // manufacture an input value
-        node_monitor.push_back_independent(input_value);
-        no_dof_handler.push_back_independent(input_value);
-        node_monitor.evaluate_field("Solution", solution);
-        node_monitor.evaluate_field("Post Processed Vector", post_processed);
-
-        solution.scale(poles); // decaying exponentials of varying time constants
-        post_processed = solution;
-        post_processed.add(2.0); // simple post processing, giving it a dc offset
+      node_monitor.start_new_dataset(time);
+      no_dof_handler.start_new_dataset(time);
+      // time and input are special, they don't vary over the mesh.
+
+      std::vector <double> input_value(n_inputs, 1); // manufacture an input value
+      node_monitor.push_back_independent(input_value);
+      no_dof_handler.push_back_independent(input_value);
+      node_monitor.evaluate_field("Solution", solution);
+      node_monitor.evaluate_field("Post Processed Vector", post_processed);
+
+      solution.scale(poles); // decaying exponentials of varying time constants
+      post_processed = solution;
+      post_processed.add(2.0); // simple post processing, giving it a dc offset
     }
-    node_monitor.write_gnuplot("point_value_history_01/node");
-    no_dof_handler.write_gnuplot("point_value_history_01/no_dof");
-
-    node_monitor.status (deallog.get_file_stream());
-    no_dof_handler.status (deallog.get_file_stream());
-
-    deallog << "Starting data files" << std::endl;
-
-                     // copy all the data into deallog and
-                     // delete those files
-    const std::string filenames[]
-      = { "point_value_history_01/node_00.gpl",
-      "point_value_history_01/node_01.gpl",
-      "point_value_history_01/node_02.gpl",
-      "point_value_history_01/node_03.gpl",
-      "point_value_history_01/node_04.gpl",
-      "point_value_history_01/node_05.gpl",
-      "point_value_history_01/node_indep.gpl",
-      "point_value_history_01/Test_Copy_00.gpl",
-      "point_value_history_01/Test_Copy_indep.gpl",
-      "point_value_history_01/no_dof_indep.gpl" };
-
-    for (unsigned int i=0; i<sizeof(filenames)/sizeof(filenames[0]); ++i)
+  node_monitor.write_gnuplot("point_value_history_01/node");
+  no_dof_handler.write_gnuplot("point_value_history_01/no_dof");
+
+  node_monitor.status (deallog.get_file_stream());
+  no_dof_handler.status (deallog.get_file_stream());
+
+  deallog << "Starting data files" << std::endl;
+
+  // copy all the data into deallog and
+  // delete those files
+  const std::string filenames[]
+    = { "point_value_history_01/node_00.gpl",
+        "point_value_history_01/node_01.gpl",
+        "point_value_history_01/node_02.gpl",
+        "point_value_history_01/node_03.gpl",
+        "point_value_history_01/node_04.gpl",
+        "point_value_history_01/node_05.gpl",
+        "point_value_history_01/node_indep.gpl",
+        "point_value_history_01/Test_Copy_00.gpl",
+        "point_value_history_01/Test_Copy_indep.gpl",
+        "point_value_history_01/no_dof_indep.gpl"
+      };
+
+  for (unsigned int i=0; i<sizeof(filenames)/sizeof(filenames[0]); ++i)
     {
-        deallog << "Copying output file " << filenames[i]
-            << std::endl;
+      deallog << "Copying output file " << filenames[i]
+              << std::endl;
 
-        std::ifstream in(filenames[i].c_str());
-        AssertThrow (in, ExcIO());
+      std::ifstream in(filenames[i].c_str());
+      AssertThrow (in, ExcIO());
 
-        std::string s;
-        while (in)
+      std::string s;
+      while (in)
         {
-            std::getline (in, s);
-            deallog << s << std::endl;
+          std::getline (in, s);
+          deallog << s << std::endl;
         }
 
-    std::remove (filenames[i].c_str());
+      std::remove (filenames[i].c_str());
 
-    deallog << std::endl;
+      deallog << std::endl;
     }
 }
 
@@ -263,13 +264,13 @@ void TestPointValueHistory<dim>::run()
 
 int main()
 {
-    std::ofstream logfile("point_value_history_01/output");
-    logfile << std::setprecision(2);
-    deallog << std::setprecision(2);
-    deallog.attach(logfile);
-    deallog.depth_console(0);
-    deallog.threshold_double(1.e-10);
-
-    TestPointValueHistory<2> test;
-    test.run();
+  std::ofstream logfile("point_value_history_01/output");
+  logfile << std::setprecision(2);
+  deallog << std::setprecision(2);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  TestPointValueHistory<2> test;
+  test.run();
 }
index d73d8ea93709fa26961b06f9191d12add26cf093..4911c670847c4e02f31f3824b09060f9dc39a380 100644 (file)
@@ -58,78 +58,78 @@ using namespace dealii;
 template <int dim>
 class Postprocess : public DataPostprocessor<dim>
 {
-   public:
-     void compute_derived_quantities_vector (
-       const std::vector< Vector< double > > &, 
-       const std::vector< std::vector< Tensor< 1, dim > > > &, 
-       const std::vector< std::vector< Tensor< 2, dim > > > &, 
-       const std::vector< Point< dim > > &,
-       const std::vector< Point< dim > > &,
-       std::vector< Vector< double > > &
-     ) const;
-     std::vector<std::string> get_names () const;
-     UpdateFlags              get_needed_update_flags () const;
-     unsigned int             n_output_variables () const;
-                // The following function is not required
-                // by the point_value_history class.
-     //std::vector<DataComponentInterpretation::DataComponentInterpretation>
-     //                  get_data_component_interpretation () const;
+public:
+
+  void compute_derived_quantities_vector (
+    const std::vector< Vector< double > > &,
+    const std::vector< std::vector< Tensor< 1, dim > > > &,
+    const std::vector< std::vector< Tensor< 2, dim > > > &,
+    const std::vector< Point< dim > > &,
+    const std::vector< Point< dim > > &,
+    std::vector< Vector< double > > &
+  ) const;
+
+  std::vector<std::string> get_names () const;
+  UpdateFlags              get_needed_update_flags () const;
+  unsigned int             n_output_variables () const;
+  // The following function is not required
+  // by the point_value_history class.
+  //std::vector<DataComponentInterpretation::DataComponentInterpretation>
+  //                  get_data_component_interpretation () const;
 };
+
 template <int dim>
 std::vector<std::string>
 Postprocess<dim>::get_names() const
 {
-   std::vector<std::string> names;
-   names.push_back ("Vector_out");
-   names.push_back ("Vector_out_1");
-   names.push_back ("Vector_out_2");
-   names.push_back ("Scalar_out");
-   return names;
+  std::vector<std::string> names;
+  names.push_back ("Vector_out");
+  names.push_back ("Vector_out_1");
+  names.push_back ("Vector_out_2");
+  names.push_back ("Scalar_out");
+  return names;
 }
+
 template <int dim>
 UpdateFlags
 Postprocess<dim>::get_needed_update_flags () const
 {
-   return update_values | update_gradients | update_hessians;
+  return update_values | update_gradients | update_hessians;
 }
+
 template <int dim>
 unsigned int
 Postprocess<dim>::n_output_variables () const
 {
-   return 4;
+  return 4;
 }
+
+
 template <int dim>
 void
 Postprocess<dim>::compute_derived_quantities_vector (
-   const std::vector< Vector< double > >                 & uh,
-   const std::vector< std::vector< Tensor< 1, dim > > >  & duh,
-   const std::vector< std::vector< Tensor< 2, dim > > >  & dduh,
-   const std::vector< Point< dim > >                     & /* normals */,
-   const std::vector< Point< dim > >                     & /* locations */,
-   std::vector< Vector< double > >                       & computed_quantities
- ) const
+  const std::vector< Vector< double > >                  &uh,
+  const std::vector< std::vector< Tensor< 1, dim > > >   &duh,
+  const std::vector< std::vector< Tensor< 2, dim > > >   &dduh,
+  const std::vector< Point< dim > >                     & /* normals */,
+  const std::vector< Point< dim > >                     & /* locations */,
+  std::vector< Vector< double > >                        &computed_quantities
+) const
 {
-   Assert(computed_quantities.size() == uh.size(), 
-          ExcDimensionMismatch (computed_quantities.size(), uh.size()));
-   for (unsigned int i=0; i<computed_quantities.size(); i++)
-   {
-       Assert(computed_quantities[i].size() == 4, 
+  Assert(computed_quantities.size() == uh.size(),
+         ExcDimensionMismatch (computed_quantities.size(), uh.size()));
+
+  for (unsigned int i=0; i<computed_quantities.size(); i++)
+    {
+      Assert(computed_quantities[i].size() == 4,
              ExcDimensionMismatch (computed_quantities[i].size(), 3));
-       Assert(uh[i].size() == dim + 1, ExcDimensionMismatch (uh[i].size(), dim + 1));
-       computed_quantities[i](0) = duh[i][0].norm(); // norm of x gradient
-       computed_quantities[i](1) = dduh[i][1].norm(); // norm of y hessian
-       computed_quantities[i](2) = duh[i][0].norm() + dduh[i][1].norm(); // norm of y hessian
-       computed_quantities[i](3) = uh[i].l2_norm();
-   }
+      Assert(uh[i].size() == dim + 1, ExcDimensionMismatch (uh[i].size(), dim + 1));
+
+      computed_quantities[i](0) = duh[i][0].norm(); // norm of x gradient
+      computed_quantities[i](1) = dduh[i][1].norm(); // norm of y hessian
+      computed_quantities[i](2) = duh[i][0].norm() + dduh[i][1].norm(); // norm of y hessian
+      computed_quantities[i](3) = uh[i].l2_norm();
+    }
 }
 
 
@@ -138,17 +138,17 @@ template <int dim>
 class TestPointValueHistory
 {
 public:
-    TestPointValueHistory();
-    void run();
+  TestPointValueHistory();
+  void run();
 
 private:
-    void output_results (unsigned int step, Vector <double> solution) const;
+  void output_results (unsigned int step, Vector <double> solution) const;
 
-    Triangulation <dim> triangulation;
-    FESystem<dim> finite_element;
-    DoFHandler <dim > dof_handler;
-    PointValueHistory <dim> test_copy;
-    std::vector <Point <dim> > postprocessor_locations;
+  Triangulation <dim> triangulation;
+  FESystem<dim> finite_element;
+  DoFHandler <dim > dof_handler;
+  PointValueHistory <dim> test_copy;
+  std::vector <Point <dim> > postprocessor_locations;
 };
 
 
@@ -156,9 +156,9 @@ private:
 
 template <int dim>
 TestPointValueHistory<dim>::TestPointValueHistory() :
-finite_element(FE_Q<dim > (1 + 1), dim, FE_Q<dim > (1), 1),
+  finite_element(FE_Q<dim > (1 + 1), dim, FE_Q<dim > (1), 1),
 
-dof_handler(triangulation)
+  dof_handler(triangulation)
 { }
 
 
@@ -167,27 +167,27 @@ dof_handler(triangulation)
 template <int dim>
 void TestPointValueHistory<dim>::run()
 {
-    // Make a triangulation
-    GridGenerator::hyper_cube(triangulation, 0, 1);
-    triangulation.refine_global(2); // refine 2 times to make 5 nodes per side
+  // Make a triangulation
+  GridGenerator::hyper_cube(triangulation, 0, 1);
+  triangulation.refine_global(2); // refine 2 times to make 5 nodes per side
 
-    // make a DOF handler, a model solution filled with ones and a flow vector
+  // make a DOF handler, a model solution filled with ones and a flow vector
 //    FESystem<dim> finite_element(FE_Q<dim > (1 + 1), dim, FE_Q<dim > (1), 1);
 //    DoFHandler <dim > dof_handler(triangulation);
-    dof_handler.distribute_dofs(finite_element);
-    DoFRenumbering::Cuthill_McKee(dof_handler);
-
-    // renumber for components so that same dof indices are used for BlockVectors and normal Vectors
-    std::vector<unsigned int> block_component(dim + 1, 0);
-    block_component[dim] = 1; // component dim = pressure component!
-    DoFRenumbering::component_wise(dof_handler, block_component);
-
-    // Vector
-    Vector <double> solution, post_processed, poles;
-    solution.reinit(dof_handler.n_dofs());
-    post_processed.reinit(dof_handler.n_dofs());
-    poles.reinit(dof_handler.n_dofs());
-    
+  dof_handler.distribute_dofs(finite_element);
+  DoFRenumbering::Cuthill_McKee(dof_handler);
+
+  // renumber for components so that same dof indices are used for BlockVectors and normal Vectors
+  std::vector<unsigned int> block_component(dim + 1, 0);
+  block_component[dim] = 1; // component dim = pressure component!
+  DoFRenumbering::component_wise(dof_handler, block_component);
+
+  // Vector
+  Vector <double> solution, post_processed, poles;
+  solution.reinit(dof_handler.n_dofs());
+  post_processed.reinit(dof_handler.n_dofs());
+  poles.reinit(dof_handler.n_dofs());
+
 //            // BlockVector
 //        std::vector<unsigned int> dofs_per_block(2);
 //        DoFTools::count_dofs_per_block(dof_handler, dofs_per_block, block_component);
@@ -198,7 +198,7 @@ void TestPointValueHistory<dim>::run()
 //        solution.block(0).reinit(n_u);
 //        solution.block(1).reinit(n_p);
 //        solution.collect_sizes();
-// 
+//
 //        BlockVector<double> post_processed;
 //        post_processed.reinit(2);
 //        post_processed.block(0).reinit(n_u);
@@ -210,232 +210,233 @@ void TestPointValueHistory<dim>::run()
 //        poles.block(1).reinit(n_p);
 //        poles.collect_sizes();
 
-    // set up a simple linear discrete time system so that time plots vary
-    // over the mesh but can be easily checked. The basic idea is to have each
-    // component of the fe_system to depend on a specific dimension (i.e component 0
-    // depends on dim 0, etc. % dim handles the case where there are more components
-    // than dimensions. The code breaks down at the edges of the mesh and this is
-    // not corrected for. The code used in this test simplified from point_value_history_01.
-    {
-        Quadrature<dim> quadrature_formula(finite_element.get_unit_support_points ());
-        FEValues<dim> fe_values(finite_element, quadrature_formula, update_values | update_quadrature_points); // just need local_dof_indices and quadrature_points
-
-        std::vector<types::global_dof_index> local_dof_indices(finite_element.dofs_per_cell);
-        std::vector<Point<dim> > dof_locations(finite_element.dofs_per_cell);
-
-        typename DoFHandler<dim>::active_cell_iterator cell, endc;
-        cell = dof_handler.begin_active();
-        endc = dof_handler.end();
-        for (; cell != endc; ++cell)
-        {
-            fe_values.reinit(cell); // need to get local_dof_indices
-            cell->get_dof_indices(local_dof_indices);
-            dof_locations = fe_values.get_quadrature_points();
-
-            for (unsigned int dof = 0; dof != finite_element.dofs_per_cell; dof++)
-            {
-                unsigned int dof_component = finite_element.system_to_component_index(dof).first;
-
-                poles(local_dof_indices[dof]) = -dof_locations[dof](dof_component % dim);
-
-                if (dof_component == dim) // components start numbering at 0
-                    poles(local_dof_indices[dof]) = -0.1; // dim+1th component is not handled well by the code above
-
-                solution(local_dof_indices [dof]) = 1; // start all solutions at 1
-            }
-
-        } // loop over all cells
-        poles.add(1.0); // slow down the pole settling time
-        post_processed.add(3.0); // set to starting value.
+  // set up a simple linear discrete time system so that time plots vary
+  // over the mesh but can be easily checked. The basic idea is to have each
+  // component of the fe_system to depend on a specific dimension (i.e component 0
+  // depends on dim 0, etc. % dim handles the case where there are more components
+  // than dimensions. The code breaks down at the edges of the mesh and this is
+  // not corrected for. The code used in this test simplified from point_value_history_01.
+  {
+    Quadrature<dim> quadrature_formula(finite_element.get_unit_support_points ());
+    FEValues<dim> fe_values(finite_element, quadrature_formula, update_values | update_quadrature_points); // just need local_dof_indices and quadrature_points
+
+    std::vector<types::global_dof_index> local_dof_indices(finite_element.dofs_per_cell);
+    std::vector<Point<dim> > dof_locations(finite_element.dofs_per_cell);
+
+    typename DoFHandler<dim>::active_cell_iterator cell, endc;
+    cell = dof_handler.begin_active();
+    endc = dof_handler.end();
+    for (; cell != endc; ++cell)
+      {
+        fe_values.reinit(cell); // need to get local_dof_indices
+        cell->get_dof_indices(local_dof_indices);
+        dof_locations = fe_values.get_quadrature_points();
+
+        for (unsigned int dof = 0; dof != finite_element.dofs_per_cell; dof++)
+          {
+            unsigned int dof_component = finite_element.system_to_component_index(dof).first;
+
+            poles(local_dof_indices[dof]) = -dof_locations[dof](dof_component % dim);
+
+            if (dof_component == dim) // components start numbering at 0
+              poles(local_dof_indices[dof]) = -0.1; // dim+1th component is not handled well by the code above
+
+            solution(local_dof_indices [dof]) = 1; // start all solutions at 1
+          }
+
+      } // loop over all cells
+    poles.add(1.0); // slow down the pole settling time
+    post_processed.add(3.0); // set to starting value.
 //         output_results(10, poles);
-    }
-
-    // Setup monitor node to print variation over time
-    unsigned int n_inputs = 1;
-    PointValueHistory<dim> node_monitor (dof_handler, n_inputs);
-    PointValueHistory<dim> no_dof_handler (n_inputs);
-
-    // check that the assignment operator is valid
-    test_copy = node_monitor;
-    test_copy.add_point(Point<2>(1, 0.2));
-    test_copy.add_field_name("Solution");
-    std::vector < std::vector <Point <dim> > > selected_locations;
-    test_copy.get_support_locations(selected_locations);
-    test_copy.mark_support_locations();
-    test_copy.close();
-    test_copy.start_new_dataset(0.1);
+  }
+
+  // Setup monitor node to print variation over time
+  unsigned int n_inputs = 1;
+  PointValueHistory<dim> node_monitor (dof_handler, n_inputs);
+  PointValueHistory<dim> no_dof_handler (n_inputs);
+
+  // check that the assignment operator is valid
+  test_copy = node_monitor;
+  test_copy.add_point(Point<2>(1, 0.2));
+  test_copy.add_field_name("Solution");
+  std::vector < std::vector <Point <dim> > > selected_locations;
+  test_copy.get_support_locations(selected_locations);
+  test_copy.mark_support_locations();
+  test_copy.close();
+  test_copy.start_new_dataset(0.1);
 //    triangulation.refine_global(1); // should mark the triangulation as changed
-    test_copy.evaluate_field("Solution", solution);
-    std::vector <double> input_value(n_inputs, 1);
-    test_copy.push_back_independent(input_value);
-    test_copy.write_gnuplot("point_value_history_02/Test_Copy");
-    test_copy.status(deallog.get_file_stream());
-    test_copy.clear ();
-    // end of assignment operator check
+  test_copy.evaluate_field("Solution", solution);
+  std::vector <double> input_value(n_inputs, 1);
+  test_copy.push_back_independent(input_value);
+  test_copy.write_gnuplot("point_value_history_02/Test_Copy");
+  test_copy.status(deallog.get_file_stream());
+  test_copy.clear ();
+  // end of assignment operator check
+
+  {
+    node_monitor.add_field_name("Solution");
+    std::vector <std::string> solution_names;
+    solution_names.push_back("X velocity");
+    solution_names.push_back("Y velocity");
+    solution_names.push_back("Z velocity");
+    node_monitor.add_component_names ("Solution", solution_names);
+    node_monitor.add_field_name("Post Processed Vector"); // not sensitive to spaces
+    std::vector <bool> component_mask (3, false);
+    component_mask[2] = true;
+    node_monitor.add_field_name("Pressure", component_mask);
+    component_mask = std::vector <bool> (3, false);
+    component_mask[1] = true;
+    node_monitor.add_field_name("Req_sol", component_mask);
+    component_mask = std::vector <bool> (4, true);
+    component_mask[3] = false;
+    node_monitor.add_field_name("Vector_out", component_mask);
+    component_mask = std::vector <bool> (4, false);
+    component_mask[3] = true;
+    node_monitor.add_field_name("Scalar_out", component_mask);
+
+    std::vector <std::string> indep_names;
+    indep_names.push_back ("Input");
+    node_monitor.add_independent_names(indep_names);
+
+    // two alternatives here, adding a point at a time or a vector of points
+    // 2d points
+    std::vector <Point < 2 > > point_vector(5, Point < 2 > ());
+    point_vector[0] = Point < 2 > (0, 0); // some of these points will hit a node, others won't
+    point_vector[1] = Point < 2 > (0.25, 0);
+    point_vector[2] = Point < 2 > (0.25, 0.45);
+    point_vector[3] = Point < 2 > (0.45, 0.45);
+    point_vector[4] = Point < 2 > (0.8, 0.8);
+
+    node_monitor.add_points(point_vector);
+    node_monitor.add_point(Point<2>(1, 0.2)); // add a single point
+
+    // MonitorNode requires that the instance is 'closed' before any data is added
+    // this ensures that points are not added once time starts.
+    node_monitor.close();
+    no_dof_handler.close(); // closing still required!
 
-    {
-        node_monitor.add_field_name("Solution");
-        std::vector <std::string> solution_names;
-        solution_names.push_back("X velocity");
-        solution_names.push_back("Y velocity");
-        solution_names.push_back("Z velocity");
-        node_monitor.add_component_names ("Solution", solution_names);
-        node_monitor.add_field_name("Post Processed Vector"); // not sensitive to spaces
-        std::vector <bool> component_mask (3, false);
-        component_mask[2] = true;    
-        node_monitor.add_field_name("Pressure", component_mask);
-        component_mask = std::vector <bool> (3, false);
-        component_mask[1] = true;
-        node_monitor.add_field_name("Req_sol", component_mask);
-        component_mask = std::vector <bool> (4, true);
-        component_mask[3] = false;
-        node_monitor.add_field_name("Vector_out", component_mask);
-        component_mask = std::vector <bool> (4, false);
-        component_mask[3] = true;
-        node_monitor.add_field_name("Scalar_out", component_mask);
-
-        std::vector <std::string> indep_names;
-        indep_names.push_back ("Input");
-        node_monitor.add_independent_names(indep_names);
-
-        // two alternatives here, adding a point at a time or a vector of points
-        // 2d points
-        std::vector <Point < 2 > > point_vector(5, Point < 2 > ());
-        point_vector[0] = Point < 2 > (0, 0); // some of these points will hit a node, others won't
-        point_vector[1] = Point < 2 > (0.25, 0);
-        point_vector[2] = Point < 2 > (0.25, 0.45);
-        point_vector[3] = Point < 2 > (0.45, 0.45);
-        point_vector[4] = Point < 2 > (0.8, 0.8);
-
-        node_monitor.add_points(point_vector);
-        node_monitor.add_point(Point<2>(1, 0.2)); // add a single point
-
-        // MonitorNode requires that the instance is 'closed' before any data is added
-        // this ensures that points are not added once time starts.
-        node_monitor.close();
-        no_dof_handler.close(); // closing still required!
-
-        std::vector < std::vector <Point <dim> > > selected_locations;
-        node_monitor.get_support_locations(selected_locations);
-        Vector<double> node_locations = node_monitor.mark_support_locations();
-        QGauss<dim> postprocess_quadrature (2);
-        node_monitor.get_postprocessor_locations(postprocess_quadrature, postprocessor_locations);
-    }
+    std::vector < std::vector <Point <dim> > > selected_locations;
+    node_monitor.get_support_locations(selected_locations);
+    Vector<double> node_locations = node_monitor.mark_support_locations();
+    QGauss<dim> postprocess_quadrature (2);
+    node_monitor.get_postprocessor_locations(postprocess_quadrature, postprocessor_locations);
+  }
 
-    double delta_t = 0.000001;
-    double t_max = 0.00001;
-    unsigned int step = 0;
+  double delta_t = 0.000001;
+  double t_max = 0.00001;
+  unsigned int step = 0;
 
-    for (double time = 0; time < t_max; time = time + delta_t)
+  for (double time = 0; time < t_max; time = time + delta_t)
     {
-        node_monitor.start_new_dataset(time);
-        no_dof_handler.start_new_dataset(time);
-        // time and input are special, they don't vary over the mesh.
-
-        std::vector <double> input_value(n_inputs, 1); // manufacture an input value
-        node_monitor.push_back_independent(input_value);
-        no_dof_handler.push_back_independent(input_value);
-        node_monitor.evaluate_field("Solution", solution);
-        node_monitor.evaluate_field("Post Processed Vector", post_processed);
-        node_monitor.evaluate_field("Pressure", solution);
-        node_monitor.evaluate_field_at_requested_location("Req_sol", solution);
-
-        Postprocess<dim> postprocessor;
-        QGauss<dim> postprocess_quadrature (2);
-        std::vector<std::string> names;
-        names.push_back ("Vector_out");
-        names.push_back ("Scalar_out");
-        node_monitor.evaluate_field(names, solution, postprocessor, postprocess_quadrature);
+      node_monitor.start_new_dataset(time);
+      no_dof_handler.start_new_dataset(time);
+      // time and input are special, they don't vary over the mesh.
+
+      std::vector <double> input_value(n_inputs, 1); // manufacture an input value
+      node_monitor.push_back_independent(input_value);
+      no_dof_handler.push_back_independent(input_value);
+      node_monitor.evaluate_field("Solution", solution);
+      node_monitor.evaluate_field("Post Processed Vector", post_processed);
+      node_monitor.evaluate_field("Pressure", solution);
+      node_monitor.evaluate_field_at_requested_location("Req_sol", solution);
+
+      Postprocess<dim> postprocessor;
+      QGauss<dim> postprocess_quadrature (2);
+      std::vector<std::string> names;
+      names.push_back ("Vector_out");
+      names.push_back ("Scalar_out");
+      node_monitor.evaluate_field(names, solution, postprocessor, postprocess_quadrature);
 //         output_results (step, solution);
-        step++;
+      step++;
 
-        solution.scale(poles); // decaying exponentials of varying time constants
-        post_processed = solution;
-        post_processed.add(2.0); // simple post processing, giving it a dc offset
+      solution.scale(poles); // decaying exponentials of varying time constants
+      post_processed = solution;
+      post_processed.add(2.0); // simple post processing, giving it a dc offset
     }
-    triangulation.refine_global(1); // should mark the triangulation as changed
-    node_monitor.write_gnuplot("point_value_history_02/node", postprocessor_locations);
-    no_dof_handler.write_gnuplot("point_value_history_02/no_dof");
-
-    node_monitor.status (deallog.get_file_stream());
-    no_dof_handler.status (deallog.get_file_stream());
-
-    deallog << "Starting data files" << std::endl;
-
-                     // copy all the data into deallog and
-                     // delete those files
-    const std::string filenames[]
-      = { "point_value_history_02/node_00.gpl",
-      "point_value_history_02/node_01.gpl",
-      "point_value_history_02/node_02.gpl",
-      "point_value_history_02/node_03.gpl",
-      "point_value_history_02/node_04.gpl",
-      "point_value_history_02/node_05.gpl",
-      "point_value_history_02/node_indep.gpl",
-      "point_value_history_02/Test_Copy_00.gpl",
-      "point_value_history_02/Test_Copy_indep.gpl",
-      "point_value_history_02/no_dof_indep.gpl" };
-
-    for (unsigned int i=0; i<sizeof(filenames)/sizeof(filenames[0]); ++i)
+  triangulation.refine_global(1); // should mark the triangulation as changed
+  node_monitor.write_gnuplot("point_value_history_02/node", postprocessor_locations);
+  no_dof_handler.write_gnuplot("point_value_history_02/no_dof");
+
+  node_monitor.status (deallog.get_file_stream());
+  no_dof_handler.status (deallog.get_file_stream());
+
+  deallog << "Starting data files" << std::endl;
+
+  // copy all the data into deallog and
+  // delete those files
+  const std::string filenames[]
+    = { "point_value_history_02/node_00.gpl",
+        "point_value_history_02/node_01.gpl",
+        "point_value_history_02/node_02.gpl",
+        "point_value_history_02/node_03.gpl",
+        "point_value_history_02/node_04.gpl",
+        "point_value_history_02/node_05.gpl",
+        "point_value_history_02/node_indep.gpl",
+        "point_value_history_02/Test_Copy_00.gpl",
+        "point_value_history_02/Test_Copy_indep.gpl",
+        "point_value_history_02/no_dof_indep.gpl"
+      };
+
+  for (unsigned int i=0; i<sizeof(filenames)/sizeof(filenames[0]); ++i)
     {
-        deallog << "Copying output file " << filenames[i]
-            << std::endl;
+      deallog << "Copying output file " << filenames[i]
+              << std::endl;
 
-        std::ifstream in(filenames[i].c_str());
-        AssertThrow (in, ExcIO());
+      std::ifstream in(filenames[i].c_str());
+      AssertThrow (in, ExcIO());
 
-        std::string s;
-        while (in)
+      std::string s;
+      while (in)
         {
-            std::getline (in, s);
-            deallog << s << std::endl;
+          std::getline (in, s);
+          deallog << s << std::endl;
         }
 
-        std::remove (filenames[i].c_str());
+      std::remove (filenames[i].c_str());
 
-        deallog << std::endl;
+      deallog << std::endl;
     }
 }
 
 template <int dim>
 void TestPointValueHistory<dim>::output_results (unsigned int step, Vector <double> solution)  const
 {
-    std::vector<std::string> solution_names (dim, "velocity");
-    solution_names.push_back ("pressure");
-
-    std::vector<DataComponentInterpretation::DataComponentInterpretation>
-    data_component_interpretation
-     (dim, DataComponentInterpretation::component_is_part_of_vector);
-    data_component_interpretation
-     .push_back (DataComponentInterpretation::component_is_scalar);
-
-    DataOut<dim> data_out;
-    data_out.attach_dof_handler (dof_handler);
-    data_out.add_data_vector (solution, solution_names,
-                               DataOut<dim>::type_dof_data,
-                               data_component_interpretation);
-    data_out.build_patches (2);
-    std::ostringstream filename;
-    filename << "point_value_history_02/solution-"
-              << Utilities::int_to_string (step, 2)
-              << ".gpl";
-    std::ofstream output (filename.str().c_str());
-    data_out.write_gnuplot (output);
+  std::vector<std::string> solution_names (dim, "velocity");
+  solution_names.push_back ("pressure");
+
+  std::vector<DataComponentInterpretation::DataComponentInterpretation>
+  data_component_interpretation
+  (dim, DataComponentInterpretation::component_is_part_of_vector);
+  data_component_interpretation
+  .push_back (DataComponentInterpretation::component_is_scalar);
+
+  DataOut<dim> data_out;
+  data_out.attach_dof_handler (dof_handler);
+  data_out.add_data_vector (solution, solution_names,
+                            DataOut<dim>::type_dof_data,
+                            data_component_interpretation);
+  data_out.build_patches (2);
+
+  std::ostringstream filename;
+  filename << "point_value_history_02/solution-"
+           << Utilities::int_to_string (step, 2)
+           << ".gpl";
+
+  std::ofstream output (filename.str().c_str());
+  data_out.write_gnuplot (output);
 }
 
 
 
 int main()
 {
-    std::ofstream logfile("point_value_history_02/output");
-    logfile << std::setprecision(2);
-    deallog << std::setprecision(2);
-    deallog.attach(logfile);
-    deallog.depth_console(0);
-    deallog.threshold_double(1.e-10);
-
-    TestPointValueHistory<2> test;
-    test.run();
+  std::ofstream logfile("point_value_history_02/output");
+  logfile << std::setprecision(2);
+  deallog << std::setprecision(2);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  TestPointValueHistory<2> test;
+  test.run();
 }
index 5a16554520bc9700ac6c21b14e3da99f9d57b822..9f5d285a9067f970470a407de653d1bce9ae2803 100644 (file)
@@ -58,73 +58,73 @@ using namespace dealii;
 template <int dim>
 class Postprocess : public DataPostprocessor<dim>
 {
-   public:
-      void compute_derived_quantities_scalar (
-        const std::vector< double > &, 
-        const std::vector< Tensor< 1, dim > > &, 
-        const std::vector< Tensor< 2, dim > > &, 
-        const std::vector< Point< dim > > &,
-        const std::vector< Point< dim > > &,
-        std::vector< Vector< double > > &
-     ) const;
-      std::vector<std::string> get_names () const;
-      UpdateFlags              get_needed_update_flags () const;
-      unsigned int             n_output_variables () const;
-                // The following function is not required
-                // by the point_value_history class.
-     //std::vector<DataComponentInterpretation::DataComponentInterpretation>
-     //                  get_data_component_interpretation () const;
+public:
+
+  void compute_derived_quantities_scalar (
+    const std::vector< double > &,
+    const std::vector< Tensor< 1, dim > > &,
+    const std::vector< Tensor< 2, dim > > &,
+    const std::vector< Point< dim > > &,
+    const std::vector< Point< dim > > &,
+    std::vector< Vector< double > > &
+  ) const;
+
+  std::vector<std::string> get_names () const;
+  UpdateFlags              get_needed_update_flags () const;
+  unsigned int             n_output_variables () const;
+  // The following function is not required
+  // by the point_value_history class.
+  //std::vector<DataComponentInterpretation::DataComponentInterpretation>
+  //                  get_data_component_interpretation () const;
 };
+
 template <int dim>
 std::vector<std::string>
 Postprocess<dim>::get_names() const
 {
-   std::vector<std::string> names;
-   names.push_back ("X_gradient");
-   names.push_back ("X_hessian");
-   return names;
+  std::vector<std::string> names;
+  names.push_back ("X_gradient");
+  names.push_back ("X_hessian");
+  return names;
 }
+
 template <int dim>
 UpdateFlags
 Postprocess<dim>::get_needed_update_flags () const
 {
   return update_values | update_gradients | update_hessians;
 }
+
 template <int dim>
 unsigned int
 Postprocess<dim>::n_output_variables () const
 {
-   return 2;
+  return 2;
 }
- template <int dim>
- void
- Postprocess<dim>::compute_derived_quantities_scalar (
-    const std::vector< double >                 & uh,
-    const std::vector< Tensor< 1, dim > >  & duh,
-    const std::vector< Tensor< 2, dim > >  & dduh,
-    const std::vector< Point< dim > >                     & /* normals */,
-    const std::vector< Point< dim > >                     & /* locations */,
-    std::vector< Vector< double > >                       & computed_quantities
- ) const
+
+
+template <int dim>
+void
+Postprocess<dim>::compute_derived_quantities_scalar (
+  const std::vector< double >                  &uh,
+  const std::vector< Tensor< 1, dim > >   &duh,
+  const std::vector< Tensor< 2, dim > >   &dduh,
+  const std::vector< Point< dim > >                     & /* normals */,
+  const std::vector< Point< dim > >                     & /* locations */,
+  std::vector< Vector< double > >                        &computed_quantities
+) const
 {
-   Assert(computed_quantities.size() == uh.size(), 
-          ExcDimensionMismatch (computed_quantities.size(), uh.size()));
-   for (unsigned int i=0; i<computed_quantities.size(); i++)
-   {
-       Assert(computed_quantities[i].size() == 2, 
+  Assert(computed_quantities.size() == uh.size(),
+         ExcDimensionMismatch (computed_quantities.size(), uh.size()));
+
+  for (unsigned int i=0; i<computed_quantities.size(); i++)
+    {
+      Assert(computed_quantities[i].size() == 2,
              ExcDimensionMismatch (computed_quantities[i].size(), 2));
-       
-       computed_quantities[i](0) = duh[i][0]; // norm of x gradient
-       computed_quantities[i](1) = dduh[i][0].norm(); // norm of x hessian
-   }
+
+      computed_quantities[i](0) = duh[i][0]; // norm of x gradient
+      computed_quantities[i](1) = dduh[i][0].norm(); // norm of x hessian
+    }
 }
 
 
@@ -133,17 +133,17 @@ template <int dim>
 class TestPointValueHistory
 {
 public:
-    TestPointValueHistory();
-    void run();
+  TestPointValueHistory();
+  void run();
 
 private:
-    void output_results (unsigned int step, Vector <double> solution) const;
+  void output_results (unsigned int step, Vector <double> solution) const;
 
-    Triangulation <dim> triangulation;
-    FE_Q<dim> finite_element;
-    DoFHandler <dim > dof_handler;
-    PointValueHistory <dim> test_copy;
-    std::vector <Point <dim> > postprocessor_locations;
+  Triangulation <dim> triangulation;
+  FE_Q<dim> finite_element;
+  DoFHandler <dim > dof_handler;
+  PointValueHistory <dim> test_copy;
+  std::vector <Point <dim> > postprocessor_locations;
 };
 
 
@@ -151,8 +151,8 @@ private:
 
 template <int dim>
 TestPointValueHistory<dim>::TestPointValueHistory() :
-    finite_element(2),
-    dof_handler(triangulation)
+  finite_element(2),
+  dof_handler(triangulation)
 { }
 
 
@@ -161,235 +161,236 @@ TestPointValueHistory<dim>::TestPointValueHistory() :
 template <int dim>
 void TestPointValueHistory<dim>::run()
 {
-    // Make a triangulation
-    GridGenerator::hyper_cube(triangulation, 0, 1);
-    triangulation.refine_global(2); // refine 2 times to make 5 nodes per side
+  // Make a triangulation
+  GridGenerator::hyper_cube(triangulation, 0, 1);
+  triangulation.refine_global(2); // refine 2 times to make 5 nodes per side
 
-    // make a DOF handler, a model solution filled with ones and a flow vector
+  // make a DOF handler, a model solution filled with ones and a flow vector
 //    DoFHandler <dim > dof_handler(triangulation);
-    dof_handler.distribute_dofs(finite_element);
-    DoFRenumbering::Cuthill_McKee(dof_handler);
-
-    // Vector
-    Vector <double> solution, post_processed, poles;
-    solution.reinit(dof_handler.n_dofs());
-    post_processed.reinit(dof_handler.n_dofs());
-    poles.reinit(dof_handler.n_dofs());
-    
-//            // BlockVector
-          // BlockVector not used with scalar fields generally
-
-    // set up a simple linear discrete time system so that time plots vary
-    // over the mesh but can be easily checked. The basic idea is to have each
-    // component of the fe_system to depend on a specific dimension (i.e component 0
-    // depends on dim 0, etc. % dim handles the case where there are more components
-    // than dimensions. The code breaks down at the edges of the mesh and this is
-    // not corrected for. The code used in this test is simplified from point_value_history_01.
-    {
-        Quadrature<dim> quadrature_formula(finite_element.get_unit_support_points ());
-        FEValues<dim> fe_values(finite_element, quadrature_formula, update_values | update_quadrature_points); // just need local_dof_indices and quadrature_points
+  dof_handler.distribute_dofs(finite_element);
+  DoFRenumbering::Cuthill_McKee(dof_handler);
 
-        std::vector<types::global_dof_index> local_dof_indices(finite_element.dofs_per_cell);
-        std::vector<Point<dim> > dof_locations(finite_element.dofs_per_cell);
+  // Vector
+  Vector <double> solution, post_processed, poles;
+  solution.reinit(dof_handler.n_dofs());
+  post_processed.reinit(dof_handler.n_dofs());
+  poles.reinit(dof_handler.n_dofs());
 
-        typename DoFHandler<dim>::active_cell_iterator cell, endc;
-        cell = dof_handler.begin_active();
-        endc = dof_handler.end();
-        for (; cell != endc; ++cell)
-        {
-            fe_values.reinit(cell); // need to get local_dof_indices
-            cell->get_dof_indices(local_dof_indices);
-            dof_locations = fe_values.get_quadrature_points();
-
-            for (unsigned int dof = 0; dof != finite_element.dofs_per_cell; dof++)
-            {
-                unsigned int dof_component = finite_element.system_to_component_index(dof).first;
-                // The line above will always evaluate to 1, 
-                // simplifying the remaining lines
-
-                poles(local_dof_indices[dof]) = -dof_locations[dof](dof_component % dim);
-
-                if (dof_component == dim) // components start numbering at 0
-                    poles(local_dof_indices[dof]) = -0.1; // dim+1th component is not handled well by the code above
-
-                solution(local_dof_indices [dof]) = 1; // start all solutions at 1
-            }
-        } // loop over all cells
-        
-        poles.add(1.0); // slow down the pole settling time
-        post_processed.add(3.0); // set to starting value.
+//            // BlockVector
+  // BlockVector not used with scalar fields generally
+
+  // set up a simple linear discrete time system so that time plots vary
+  // over the mesh but can be easily checked. The basic idea is to have each
+  // component of the fe_system to depend on a specific dimension (i.e component 0
+  // depends on dim 0, etc. % dim handles the case where there are more components
+  // than dimensions. The code breaks down at the edges of the mesh and this is
+  // not corrected for. The code used in this test is simplified from point_value_history_01.
+  {
+    Quadrature<dim> quadrature_formula(finite_element.get_unit_support_points ());
+    FEValues<dim> fe_values(finite_element, quadrature_formula, update_values | update_quadrature_points); // just need local_dof_indices and quadrature_points
+
+    std::vector<types::global_dof_index> local_dof_indices(finite_element.dofs_per_cell);
+    std::vector<Point<dim> > dof_locations(finite_element.dofs_per_cell);
+
+    typename DoFHandler<dim>::active_cell_iterator cell, endc;
+    cell = dof_handler.begin_active();
+    endc = dof_handler.end();
+    for (; cell != endc; ++cell)
+      {
+        fe_values.reinit(cell); // need to get local_dof_indices
+        cell->get_dof_indices(local_dof_indices);
+        dof_locations = fe_values.get_quadrature_points();
+
+        for (unsigned int dof = 0; dof != finite_element.dofs_per_cell; dof++)
+          {
+            unsigned int dof_component = finite_element.system_to_component_index(dof).first;
+            // The line above will always evaluate to 1,
+            // simplifying the remaining lines
+
+            poles(local_dof_indices[dof]) = -dof_locations[dof](dof_component % dim);
+
+            if (dof_component == dim) // components start numbering at 0
+              poles(local_dof_indices[dof]) = -0.1; // dim+1th component is not handled well by the code above
+
+            solution(local_dof_indices [dof]) = 1; // start all solutions at 1
+          }
+      } // loop over all cells
+
+    poles.add(1.0); // slow down the pole settling time
+    post_processed.add(3.0); // set to starting value.
 //        output_results(10, poles);
-    }
-
-    // Setup monitor node to print variation over time
-    unsigned int n_inputs = 1;
-    PointValueHistory<dim> node_monitor (dof_handler, n_inputs);
-    PointValueHistory<dim> no_dof_handler (n_inputs);
+  }
+
+  // Setup monitor node to print variation over time
+  unsigned int n_inputs = 1;
+  PointValueHistory<dim> node_monitor (dof_handler, n_inputs);
+  PointValueHistory<dim> no_dof_handler (n_inputs);
+
+  // check that the assignment operator is valid
+  test_copy = node_monitor;
+  test_copy.add_point(Point<2>(1, 0.2));
+  test_copy.add_field_name("Solution");
+  std::vector < std::vector <Point <dim> > > selected_locations;
+  test_copy.get_support_locations(selected_locations);
+  test_copy.mark_support_locations();
+  test_copy.close();
+  test_copy.start_new_dataset(0.1);
+  test_copy.evaluate_field("Solution", solution);
+  std::vector <double> input_value(n_inputs, 1);
+  test_copy.push_back_independent(input_value);
+  test_copy.write_gnuplot("point_value_history_03/Test_Copy");
+  test_copy.status(deallog.get_file_stream());
+  test_copy.clear ();
+  // end of assignment operator check
+
+  {
+    node_monitor.add_field_name("Solution");
+    std::vector <std::string> solution_names;
+    solution_names.push_back("Solution");
+    node_monitor.add_component_names ("Solution", solution_names);
+    node_monitor.add_field_name("Post Processed Vector"); // not sensitive to spaces
+    node_monitor.add_field_name("Pressure", 1);
+    std::vector <bool> component_mask (1, true);
+    node_monitor.add_field_name("Req_sol", component_mask);
+    component_mask = std::vector <bool> (2, false);
+    component_mask[0] = true;
+    node_monitor.add_field_name("X_gradient", component_mask);
+    component_mask = std::vector <bool> (2, false);
+    component_mask[1] = true;
+    node_monitor.add_field_name("X_hessian", component_mask);
+    std::vector <std::string> indep_names;
+    indep_names.push_back ("Input");
+    node_monitor.add_independent_names(indep_names);
+
+    // two alternatives here, adding a point at a time or a vector of points
+    // 2d points
+    std::vector <Point < 2 > > point_vector(5, Point < 2 > ());
+    point_vector[0] = Point < 2 > (0, 0); // some of these points will hit a node, others won't
+    point_vector[1] = Point < 2 > (0.25, 0);
+    point_vector[2] = Point < 2 > (0.25, 0.45);
+    point_vector[3] = Point < 2 > (0.45, 0.45);
+    point_vector[4] = Point < 2 > (0.8, 0.8);
+
+    node_monitor.add_points(point_vector);
+    node_monitor.add_point(Point<2>(1, 0.2)); // add a single point
+
+    // MonitorNode requires that the instance is 'closed' before any data is added
+    // this ensures that points are not added once time starts.
+    node_monitor.close();
+    no_dof_handler.close(); // closing still required!
 
-    // check that the assignment operator is valid
-    test_copy = node_monitor;
-    test_copy.add_point(Point<2>(1, 0.2));
-    test_copy.add_field_name("Solution");
     std::vector < std::vector <Point <dim> > > selected_locations;
-    test_copy.get_support_locations(selected_locations);
-    test_copy.mark_support_locations();
-    test_copy.close();
-    test_copy.start_new_dataset(0.1);
-    test_copy.evaluate_field("Solution", solution);
-    std::vector <double> input_value(n_inputs, 1);
-    test_copy.push_back_independent(input_value);
-    test_copy.write_gnuplot("point_value_history_03/Test_Copy");
-    test_copy.status(deallog.get_file_stream());
-    test_copy.clear ();
-    // end of assignment operator check
+    node_monitor.get_support_locations(selected_locations);
+    Vector<double> node_locations = node_monitor.mark_support_locations();
+    QGauss<dim> postprocess_quadrature (2);
+    node_monitor.get_postprocessor_locations(postprocess_quadrature, postprocessor_locations);
+  }
 
-    {
-        node_monitor.add_field_name("Solution");
-        std::vector <std::string> solution_names;
-        solution_names.push_back("Solution");
-        node_monitor.add_component_names ("Solution", solution_names);
-        node_monitor.add_field_name("Post Processed Vector"); // not sensitive to spaces
-        node_monitor.add_field_name("Pressure", 1);
-        std::vector <bool> component_mask (1, true);
-        node_monitor.add_field_name("Req_sol", component_mask);
-        component_mask = std::vector <bool> (2, false);
-        component_mask[0] = true;
-        node_monitor.add_field_name("X_gradient", component_mask);
-        component_mask = std::vector <bool> (2, false);
-        component_mask[1] = true;
-        node_monitor.add_field_name("X_hessian", component_mask);
-        std::vector <std::string> indep_names;
-        indep_names.push_back ("Input");
-        node_monitor.add_independent_names(indep_names);
-
-        // two alternatives here, adding a point at a time or a vector of points
-        // 2d points
-        std::vector <Point < 2 > > point_vector(5, Point < 2 > ());
-        point_vector[0] = Point < 2 > (0, 0); // some of these points will hit a node, others won't
-        point_vector[1] = Point < 2 > (0.25, 0);
-        point_vector[2] = Point < 2 > (0.25, 0.45);
-        point_vector[3] = Point < 2 > (0.45, 0.45);
-        point_vector[4] = Point < 2 > (0.8, 0.8);
-
-        node_monitor.add_points(point_vector);
-        node_monitor.add_point(Point<2>(1, 0.2)); // add a single point
-
-        // MonitorNode requires that the instance is 'closed' before any data is added
-        // this ensures that points are not added once time starts.
-        node_monitor.close();
-        no_dof_handler.close(); // closing still required!
-
-        std::vector < std::vector <Point <dim> > > selected_locations;
-        node_monitor.get_support_locations(selected_locations);
-        Vector<double> node_locations = node_monitor.mark_support_locations();
-        QGauss<dim> postprocess_quadrature (2);
-        node_monitor.get_postprocessor_locations(postprocess_quadrature, postprocessor_locations);
-    }
-
-    double delta_t = 0.000001;
-    double t_max = 0.00001;
-    unsigned int step = 0;
+  double delta_t = 0.000001;
+  double t_max = 0.00001;
+  unsigned int step = 0;
 
-    for (double time = 0; time < t_max; time = time + delta_t)
+  for (double time = 0; time < t_max; time = time + delta_t)
     {
-        node_monitor.start_new_dataset(time);
-        no_dof_handler.start_new_dataset(time);
-        // time and input are special, they don't vary over the mesh.
-
-        std::vector <double> input_value(n_inputs, 1); // manufacture an input value
-        node_monitor.push_back_independent(input_value);
-        no_dof_handler.push_back_independent(input_value);
-        node_monitor.evaluate_field("Solution", solution);
-        node_monitor.evaluate_field("Post Processed Vector", post_processed);
-        node_monitor.evaluate_field("Pressure", solution);
-        node_monitor.evaluate_field_at_requested_location("Req_sol", solution);
-
-        Postprocess<dim> postprocessor;
-        QGauss<dim> postprocess_quadrature (2);
-        std::vector<std::string> names;
-        names.push_back ("X_gradient");
-        names.push_back ("X_hessian");
-        node_monitor.evaluate_field(names, solution, postprocessor, postprocess_quadrature);
+      node_monitor.start_new_dataset(time);
+      no_dof_handler.start_new_dataset(time);
+      // time and input are special, they don't vary over the mesh.
+
+      std::vector <double> input_value(n_inputs, 1); // manufacture an input value
+      node_monitor.push_back_independent(input_value);
+      no_dof_handler.push_back_independent(input_value);
+      node_monitor.evaluate_field("Solution", solution);
+      node_monitor.evaluate_field("Post Processed Vector", post_processed);
+      node_monitor.evaluate_field("Pressure", solution);
+      node_monitor.evaluate_field_at_requested_location("Req_sol", solution);
+
+      Postprocess<dim> postprocessor;
+      QGauss<dim> postprocess_quadrature (2);
+      std::vector<std::string> names;
+      names.push_back ("X_gradient");
+      names.push_back ("X_hessian");
+      node_monitor.evaluate_field(names, solution, postprocessor, postprocess_quadrature);
 
 //        output_results (step, solution);
-        step++;
+      step++;
 
-        solution.scale(poles); // decaying exponentials of varying time constants
-        post_processed = solution;
-        post_processed.add(2.0); // simple post processing, giving it a dc offset
+      solution.scale(poles); // decaying exponentials of varying time constants
+      post_processed = solution;
+      post_processed.add(2.0); // simple post processing, giving it a dc offset
     }
-    node_monitor.write_gnuplot("point_value_history_03/node", postprocessor_locations);
-    no_dof_handler.write_gnuplot("point_value_history_03/no_dof"); // no point in adding postprocessor_locations
-
-    node_monitor.status (deallog.get_file_stream());
-    no_dof_handler.status (deallog.get_file_stream());
-
-    deallog << "Starting data files" << std::endl;
-
-                     // copy all the data into deallog and
-                     // delete those files
-    const std::string filenames[]
-      = { "point_value_history_03/node_00.gpl",
-      "point_value_history_03/node_01.gpl",
-      "point_value_history_03/node_02.gpl",
-      "point_value_history_03/node_03.gpl",
-      "point_value_history_03/node_04.gpl",
-      "point_value_history_03/node_05.gpl",
-      "point_value_history_03/node_indep.gpl",
-      "point_value_history_03/Test_Copy_00.gpl",
-      "point_value_history_03/Test_Copy_indep.gpl",
-      "point_value_history_03/no_dof_indep.gpl" };
-
-    for (unsigned int i=0; i<sizeof(filenames)/sizeof(filenames[0]); ++i)
+  node_monitor.write_gnuplot("point_value_history_03/node", postprocessor_locations);
+  no_dof_handler.write_gnuplot("point_value_history_03/no_dof"); // no point in adding postprocessor_locations
+
+  node_monitor.status (deallog.get_file_stream());
+  no_dof_handler.status (deallog.get_file_stream());
+
+  deallog << "Starting data files" << std::endl;
+
+  // copy all the data into deallog and
+  // delete those files
+  const std::string filenames[]
+    = { "point_value_history_03/node_00.gpl",
+        "point_value_history_03/node_01.gpl",
+        "point_value_history_03/node_02.gpl",
+        "point_value_history_03/node_03.gpl",
+        "point_value_history_03/node_04.gpl",
+        "point_value_history_03/node_05.gpl",
+        "point_value_history_03/node_indep.gpl",
+        "point_value_history_03/Test_Copy_00.gpl",
+        "point_value_history_03/Test_Copy_indep.gpl",
+        "point_value_history_03/no_dof_indep.gpl"
+      };
+
+  for (unsigned int i=0; i<sizeof(filenames)/sizeof(filenames[0]); ++i)
     {
-        deallog << "Copying output file " << filenames[i]
-            << std::endl;
+      deallog << "Copying output file " << filenames[i]
+              << std::endl;
 
-        std::ifstream in(filenames[i].c_str());
-        AssertThrow (in, ExcIO());
+      std::ifstream in(filenames[i].c_str());
+      AssertThrow (in, ExcIO());
 
-        std::string s;
-        while (in)
+      std::string s;
+      while (in)
         {
-            std::getline (in, s);
-            deallog << s << std::endl;
+          std::getline (in, s);
+          deallog << s << std::endl;
         }
 
-        std::remove (filenames[i].c_str());
+      std::remove (filenames[i].c_str());
 
-        deallog << std::endl;
+      deallog << std::endl;
     }
 }
 
 template <int dim>
 void TestPointValueHistory<dim>::output_results (unsigned int step, Vector <double> solution)  const
 {
-    DataOut<dim> data_out;
-    data_out.attach_dof_handler (dof_handler);
-    data_out.add_data_vector (solution, "solution");
-  
-    data_out.build_patches (2);
-    std::ostringstream filename;
-    filename << "point_value_history_03/solution-"
-              << Utilities::int_to_string (step, 2)
-              << ".gpl";
-    std::ofstream output (filename.str().c_str());
-    data_out.write_gnuplot (output);
+  DataOut<dim> data_out;
+  data_out.attach_dof_handler (dof_handler);
+  data_out.add_data_vector (solution, "solution");
+
+  data_out.build_patches (2);
+
+  std::ostringstream filename;
+  filename << "point_value_history_03/solution-"
+           << Utilities::int_to_string (step, 2)
+           << ".gpl";
+
+  std::ofstream output (filename.str().c_str());
+  data_out.write_gnuplot (output);
 }
 
 
 
 int main()
 {
-    std::ofstream logfile("point_value_history_03/output");
-    logfile << std::setprecision(2);
-    deallog << std::setprecision(2);
-    deallog.attach(logfile);
-    deallog.depth_console(0);
-    deallog.threshold_double(1.e-10);
-
-    TestPointValueHistory<2> test;
-    test.run();
+  std::ofstream logfile("point_value_history_03/output");
+  logfile << std::setprecision(2);
+  deallog << std::setprecision(2);
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  deallog.threshold_double(1.e-10);
+
+  TestPointValueHistory<2> test;
+  test.run();
 }
index 5240921d15c52d26e3a55f0e8f0ce37a20a252d0..3450c1d74a4be2f749c5fad83d0659208357cc23 100644 (file)
 template <int dim>
 class F : public Function<dim>
 {
-  public:
-    virtual double value (const Point<dim> &p,
-                          const unsigned int = 0) const
-      {
-        double s = 1;
-        for (unsigned int i=0; i<dim; ++i)
-          s *= p[i];
-        return s;
-      }
+public:
+  virtual double value (const Point<dim> &p,
+                        const unsigned int = 0) const
+  {
+    double s = 1;
+    for (unsigned int i=0; i<dim; ++i)
+      s *= p[i];
+    return s;
+  }
 };
 
 
 template<int dim>
 void test()
 {
-                                   // create 2 triangulations with the
-                                   // same coarse grid, and refine
-                                   // them differently
+  // create 2 triangulations with the
+  // same coarse grid, and refine
+  // them differently
   Triangulation<dim> tria;
 
   GridGenerator::hyper_cube (tria);
@@ -78,10 +78,10 @@ void test()
        cell != dh.end(); ++cell)
     for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
       {
-                                         // check that the error is
-                                         // somewhat small. it won't
-                                         // be zero since we project
-                                         // and do not interpolate
+        // check that the error is
+        // somewhat small. it won't
+        // be zero since we project
+        // and do not interpolate
         Assert (std::fabs (v(cell->vertex_dof_index(i,0)) -
                            F<dim>().value (cell->vertex(i)))
                 < 1e-4,
index 14ca76910b907ad976acf008c4da4428a50c0654..b33987e826ae47f27fba4e5c6875c575c470e7de 100644 (file)
 template <int dim>
 class F : public Function<dim>
 {
-  public:
-    virtual double value (const Point<dim> &p,
-                          const unsigned int = 0) const
-      {
-       // compute the linfty norm of p
-       double m = 0;
-       for (unsigned int d=0; d<dim; ++d)
-         m = std::max(m, std::fabs(p[d]));
-
-       // let the value increase linearly away from the square
-       return std::max (0., m-std::sqrt(2.)/2);
-      }
+public:
+  virtual double value (const Point<dim> &p,
+                        const unsigned int = 0) const
+  {
+    // compute the linfty norm of p
+    double m = 0;
+    for (unsigned int d=0; d<dim; ++d)
+      m = std::max(m, std::fabs(p[d]));
+
+    // let the value increase linearly away from the square
+    return std::max (0., m-std::sqrt(2.)/2);
+  }
 };
 
 
@@ -71,7 +71,7 @@ void test()
   Triangulation<dim> tria;
   GridGenerator::hyper_ball (tria);
   tria.set_boundary (0, boundary);
-  
+
 
   FE_Q<dim> fe(1);
   DoFHandler<dim> dh (tria);
@@ -85,7 +85,7 @@ void test()
   // use the implicit Q1 mapping. this will yield a zero solution
   {
     VectorTools::project (dh, cm, QGauss<dim>(3), F<dim>(),
-                         v);
+                          v);
     deallog << v.l2_norm() << std::endl;
     Assert (v.l2_norm() == 0, ExcInternalError());
   }
@@ -93,8 +93,8 @@ void test()
   // use an explicit Q1 mapping. this will yield a zero solution
   {
     VectorTools::project (MappingQ1<dim>(),
-                         dh, cm, QGauss<dim>(3), F<dim>(),
-                         v);
+                          dh, cm, QGauss<dim>(3), F<dim>(),
+                          v);
     deallog << v.l2_norm() << std::endl;
     Assert (v.l2_norm() == 0, ExcInternalError());
   }
@@ -104,8 +104,8 @@ void test()
   // the area where the function is zero
   {
     VectorTools::project (MappingQ<dim>(2),
-                         dh, cm, QGauss<dim>(3), F<dim>(),
-                         v);
+                          dh, cm, QGauss<dim>(3), F<dim>(),
+                          v);
     deallog << v.l2_norm() << std::endl;
     Assert (v.l2_norm() != 0, ExcInternalError());
   }
@@ -117,8 +117,8 @@ void test()
   // points where the function is zero)
   {
     VectorTools::project (MappingQ<dim>(2),
-                         dh, cm, QGauss<dim>(3), F<dim>(),
-                         v, true);
+                          dh, cm, QGauss<dim>(3), F<dim>(),
+                          v, true);
     deallog << v.l2_norm() << std::endl;
     Assert (v.l2_norm() != 0, ExcInternalError());
   }
@@ -130,34 +130,34 @@ void test()
   // *interpolation* of boundary values onto the trace of the Q1 space is zero
   {
     VectorTools::project (MappingQ<dim>(2),
-                         dh, cm, QGauss<dim>(3), F<dim>(),
-                         v, false,
-                         QGauss<dim-1>(2), true);
+                          dh, cm, QGauss<dim>(3), F<dim>(),
+                          v, false,
+                          QGauss<dim-1>(2), true);
     deallog << v.l2_norm() << std::endl;
     Assert (v.l2_norm() != 0, ExcInternalError());
     for (typename DoFHandler<dim>::active_cell_iterator cell=dh.begin_active();
-        cell != dh.end(); ++cell)
+         cell != dh.end(); ++cell)
       for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
-       deallog << cell->vertex(i) << ' ' << v(cell->vertex_dof_index(i,0))
-               << std::endl;
+        deallog << cell->vertex(i) << ' ' << v(cell->vertex_dof_index(i,0))
+                << std::endl;
   }
 
-  
+
   // same as above, but use a projection with a QTrapez formula. this happens
   // to evaluate the function only at points where it is zero, and
   // consequently the values at the boundary should be zero
   {
     VectorTools::project (MappingQ<dim>(2),
-                         dh, cm, QGauss<dim>(3), F<dim>(),
-                         v, false,
-                         QTrapez<dim-1>(), true);
+                          dh, cm, QGauss<dim>(3), F<dim>(),
+                          v, false,
+                          QTrapez<dim-1>(), true);
     deallog << v.l2_norm() << std::endl;
     Assert (v.l2_norm() != 0, ExcInternalError());
     for (typename DoFHandler<dim>::active_cell_iterator cell=dh.begin_active();
-        cell != dh.end(); ++cell)
+         cell != dh.end(); ++cell)
       for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
-       deallog << cell->vertex(i) << ' ' << v(cell->vertex_dof_index(i,0))
-               << std::endl;
+        deallog << cell->vertex(i) << ' ' << v(cell->vertex_dof_index(i,0))
+                << std::endl;
   }
 }
 
index d1a7b3a629964ac830f612a85b39f5631101bf8a..e1ac1dfb7b891ec17daeeb0aba70668a6beaccd8 100644 (file)
 template <int dim>
 class F : public Function<dim>
 {
-  public:
-    virtual double value (const Point<dim> &p,
-                          const unsigned int = 0) const
-      {
-        double s = 1;
-        for (unsigned int i=0; i<dim; ++i)
-          s *= p[i];
-        return s;
-      }
+public:
+  virtual double value (const Point<dim> &p,
+                        const unsigned int = 0) const
+  {
+    double s = 1;
+    for (unsigned int i=0; i<dim; ++i)
+      s *= p[i];
+    return s;
+  }
 };
 
 
 template<int dim>
 void test()
 {
-                                   // create 2 triangulations with the
-                                   // same coarse grid, and refine
-                                   // them differently
+  // create 2 triangulations with the
+  // same coarse grid, and refine
+  // them differently
   Triangulation<dim> tria;
 
   GridGenerator::hyper_cube (tria);
@@ -81,10 +81,10 @@ void test()
        cell != dh.end(); ++cell)
     for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
       {
-                                         // check that the error is
-                                         // somewhat small. it won't
-                                         // be zero since we project
-                                         // and do not interpolate
+        // check that the error is
+        // somewhat small. it won't
+        // be zero since we project
+        // and do not interpolate
         Assert (std::fabs (v(cell->vertex_dof_index(i,0)) -
                            F<dim>().value (cell->vertex(i)))
                 < 1e-4,
index f2386cd32900d17ba70ed4a4e5dc2a70f67025fb..b142a6cca6964720fb43a53d52d83362f0a61de1 100644 (file)
 template<int dim>
 class TestFunction : public Function<dim>
 {
-  public:
-    
-                                    /// Construct a polynomial of degree p
-    TestFunction(unsigned int degree);
-
-    virtual void vector_value_list (const std::vector<Point<dim> > &points,
-                                   std::vector<Vector<double> >   &values) const;
-  private:
-    unsigned int degree;
+public:
+
+  /// Construct a polynomial of degree p
+  TestFunction(unsigned int degree);
+
+  virtual void vector_value_list (const std::vector<Point<dim> > &points,
+                                  std::vector<Vector<double> >   &values) const;
+private:
+  unsigned int degree;
 };
 
 
 template<int dim>
 TestFunction<dim>::TestFunction (unsigned int p)
-               :
-               Function<dim>(dim), degree(p)
+  :
+  Function<dim>(dim), degree(p)
 {}
 
 
 template<int dim>
 void
 TestFunction<dim>::vector_value_list (const std::vector<Point<dim> > &points,
-                                     std::vector<Vector<double> >   &values) const
+                                      std::vector<Vector<double> >   &values) const
 {
-  for (unsigned int k=0;k<points.size();++k)
+  for (unsigned int k=0; k<points.size(); ++k)
     {
       if (degree < 2)
-       {
-         for (unsigned int d=0;d<dim;++d)
-           values[k](d) = points[k](d) - d;
-       }
+        {
+          for (unsigned int d=0; d<dim; ++d)
+            values[k](d) = points[k](d) - d;
+        }
       else
-       {
-                                          // Base of the function is
-                                          // the distance to a
-                                          // different point in each
-                                          // component
-         for (unsigned int d=0;d<dim;++d)
-           {
-             Point<dim> p = points[k];
-             for (unsigned int dd=0;dd<dim;++dd)
-               p(dd) -= d;
-             const double r2 = p.square();
-             values[k](d) = std::pow(r2, (int) degree/2);
-           }
-       }
+        {
+          // Base of the function is
+          // the distance to a
+          // different point in each
+          // component
+          for (unsigned int d=0; d<dim; ++d)
+            {
+              Point<dim> p = points[k];
+              for (unsigned int dd=0; dd<dim; ++dd)
+                p(dd) -= d;
+              const double r2 = p.square();
+              values[k](d) = std::pow(r2, (int) degree/2);
+            }
+        }
     }
 }
 
 
 
 template<int dim>
-double integrate_error(const DoFHandler<dim>dof,
-                      FEFaceValues<dim>& fe,
-                      const Vector<double>& u,
-                      const Function<dim>& f)
+double integrate_error(const DoFHandler<dim> &dof,
+                       FEFaceValues<dim> &fe,
+                       const Vector<double> &u,
+                       const Function<dim> &f)
 {
   double result = 0.;
   std::vector<Vector<double> > f_values(fe.n_quadrature_points, Vector<double>(dim));
-  std::vector<Vector<double> > fe_values(fe.n_quadrature_points, Vector<double>(dim));  
-  
+  std::vector<Vector<double> > fe_values(fe.n_quadrature_points, Vector<double>(dim));
+
   for (typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       for (unsigned int face=0 ; face != GeometryInfo<dim>::faces_per_cell; ++face)
-       {
-         if (!cell->at_boundary(face)) continue;
-         
-         fe.reinit(cell, face);
-         f.vector_value_list(fe.get_quadrature_points(), f_values);
-         fe.get_function_values(u, fe_values);
-         for (unsigned int k=0;k<fe.n_quadrature_points;++k)
-           {
-             double diff = 0.;
-             for (unsigned int d=0;d<dim;++d)
-               diff += fe.normal_vector(k)(d) * (f_values[k](d) - fe_values[k](d));
-             result += fe.JxW(k) * diff * diff;
-           }
-       }
+        {
+          if (!cell->at_boundary(face)) continue;
+
+          fe.reinit(cell, face);
+          f.vector_value_list(fe.get_quadrature_points(), f_values);
+          fe.get_function_values(u, fe_values);
+          for (unsigned int k=0; k<fe.n_quadrature_points; ++k)
+            {
+              double diff = 0.;
+              for (unsigned int d=0; d<dim; ++d)
+                diff += fe.normal_vector(k)(d) * (f_values[k](d) - fe_values[k](d));
+              result += fe.JxW(k) * diff * diff;
+            }
+        }
     }
   return result;
 }
 
 
 template<int dim>
-void test_projection (const Triangulation<dim>tr,
-                     const FiniteElement<dim>& fe)
+void test_projection (const Triangulation<dim> &tr,
+                      const FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl << "Cells: " << tr.n_active_cells() << std::endl;
 
   const unsigned int degree = fe.tensor_degree();
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
-  
+
   QGauss<dim-1> quadrature(degree+2);
   MappingQ1<dim> mapping;
 
   TestFunction<dim> f(degree-1);
   std::map<types::global_dof_index, double> boundary_constraints;
   typename FunctionMap<dim>::type boundary_map;
-  for (types::boundary_id i=0;i<255;++i)
+  for (types::boundary_id i=0; i<255; ++i)
     boundary_map[i] = &f;
   VectorTools::project_boundary_values(mapping, dof, boundary_map, quadrature,
-                                      boundary_constraints);
+                                       boundary_constraints);
 
   deallog << "Constraints: " << boundary_constraints.size() << std::endl;
-  
-                                  // Fill a vector with the projected
-                                  // boundary values
+
+  // Fill a vector with the projected
+  // boundary values
   Vector<double> u(dof.n_dofs());
   u = -1.;
   for (typename std::map<types::global_dof_index, double>::const_iterator
-        i = boundary_constraints.begin(); i != boundary_constraints.end(); ++i)
+       i = boundary_constraints.begin(); i != boundary_constraints.end(); ++i)
     u(i->first) = i->second;
-  
+
   FEFaceValues<dim> feval(mapping, fe, quadrature,
-                         update_quadrature_points
-                         | update_normal_vectors
-                         | update_JxW_values
-                         | update_values);
+                          update_quadrature_points
+                          | update_normal_vectors
+                          | update_JxW_values
+                          | update_values);
   double err = integrate_error(dof, feval, u, f);
   deallog << err << std::endl;
 }
 
 
 template<int dim>
-void test_hyper_cube(const FiniteElement<dim>fe)
+void test_hyper_cube(const FiniteElement<dim> &fe)
 {
   Triangulation<dim> tr;
   GridGenerator::hyper_cube(tr);
@@ -177,7 +177,7 @@ int main()
 {
   std::ofstream logfile ("project_boundary_rt_01/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
   deallog.threshold_double(1.e-12);
@@ -189,5 +189,5 @@ int main()
   FE_RaviartThomasNodal<2> rt23(3);
   test_hyper_cube(rt23);
   FE_RaviartThomasNodal<2> rt24(4);
-  test_hyper_cube(rt24);  
+  test_hyper_cube(rt24);
 }
index 5a0aa1d83e69cd0a194dc943a6a3b9ef14dfdca8..7d221c5d786445f174126e4a0fd8c97c0ed7a6b7 100644 (file)
 std::ofstream logfile ("project_bv_curl_conf/output");
 
 template <int dim>
-class BoundaryFunction: public Function<dim> {
-  public:
-    BoundaryFunction ();
-    virtual void vector_value (const Point<dim>& p, Vector<double>& values) const;
+class BoundaryFunction: public Function<dim>
+{
+public:
+  BoundaryFunction ();
+  virtual void vector_value (const Point<dim> &p, Vector<double> &values) const;
 };
 
 template <int dim>
-BoundaryFunction<dim>::BoundaryFunction (): Function<dim> (dim) {
+BoundaryFunction<dim>::BoundaryFunction (): Function<dim> (dim)
+{
 }
 
 template <int dim>
-void BoundaryFunction<dim>::vector_value (const Point<dim>&, 
-                                         Vector<double>& values) const {
+void BoundaryFunction<dim>::vector_value (const Point<dim> &,
+                                          Vector<double> &values) const
+{
   for (unsigned int d = 0; d < dim; ++d)
     values (d) = d + 1.0;
 }
 
 template <int dim>
-void test_boundary_values (const FiniteElement<dim>& fe) {
+void test_boundary_values (const FiniteElement<dim> &fe)
+{
   Triangulation<dim> triangulation;
-  
+
   GridGenerator::subdivided_hyper_cube (triangulation, 2);
-  
+
   DoFHandler<dim> dof_handler (triangulation);
-  
+
   dof_handler.distribute_dofs (fe);
-  
+
   BoundaryFunction<dim> boundary_function;
   ConstraintMatrix constraints;
-  
+
   constraints.clear ();
   VectorTools::project_boundary_values_curl_conforming (dof_handler, 0, boundary_function, 0, constraints);
   constraints.close ();
   constraints.print (logfile);
 }
 
-int main () {
+int main ()
+{
   deallog << std::setprecision (2);
   deallog.attach (logfile);
   deallog.depth_console (0);
   deallog.threshold_double (1e-12);
-  
+
   FE_Nedelec<2> fe_2 (1);
-  
+
   deallog << "dim=2:" << std::endl;
   test_boundary_values (fe_2);
-  
+
   FE_Nedelec<3> fe_3 (1);
-  
+
   deallog << "dim=3:" << std::endl;
   test_boundary_values (fe_3);
 }
index 61e525f0fe78b1987e948768eb8c6e9ef76d7f6e..8e7eca3b44cf3788bcadb6d1aae95b81b7df1c54 100644 (file)
 std::ofstream logfile ("project_bv_div_conf/output");
 
 template <int dim>
-class BoundaryFunction: public Function<dim> {
-  public:
-    BoundaryFunction ();
-    virtual void vector_value (const Point<dim>& p, Vector<double>& values) const;
+class BoundaryFunction: public Function<dim>
+{
+public:
+  BoundaryFunction ();
+  virtual void vector_value (const Point<dim> &p, Vector<double> &values) const;
 };
 
 template <int dim>
-BoundaryFunction<dim>::BoundaryFunction (): Function<dim> (dim) {
+BoundaryFunction<dim>::BoundaryFunction (): Function<dim> (dim)
+{
 }
 
 template <int dim>
-void BoundaryFunction<dim>::vector_value (const Point<dim>&, Vector<double>& values) const {
+void BoundaryFunction<dim>::vector_value (const Point<dim> &, Vector<double> &values) const
+{
   for (unsigned int d = 0; d < dim; ++d)
     values (d) = d + 1.0;
 }
 
 template <int dim>
-void test_boundary_values (const FiniteElement<dim>& fe) {
+void test_boundary_values (const FiniteElement<dim> &fe)
+{
   Triangulation<dim> triangulation;
-  
+
   GridGenerator::subdivided_hyper_cube (triangulation, 2);
-  
+
   DoFHandler<dim> dof_handler (triangulation);
-  
+
   dof_handler.distribute_dofs (fe);
-  
+
   BoundaryFunction<dim> boundary_function;
   ConstraintMatrix constraints;
-  
+
   constraints.clear ();
   VectorTools::project_boundary_values_div_conforming (dof_handler, 0, boundary_function, 0, constraints);
   constraints.close ();
   constraints.print (logfile);
 }
 
-int main () {
+int main ()
+{
   deallog << std::setprecision (2);
   deallog.attach (logfile);
   deallog.depth_console (0);
   deallog.threshold_double (1e-12);
-  
+
   FE_RaviartThomas<2> fe_2 (1);
-  
+
   deallog << "dim=2:" << std::endl;
   test_boundary_values (fe_2);
-  
+
   FE_RaviartThomas<3> fe_3 (1);
-  
+
   deallog << "dim=3:" << std::endl;
   test_boundary_values (fe_3);
 }
index 09b0f2cc2e295c7f9994d3255455197a71200872..4f53022348d46187bd0ae12ec5cfa5110d49e26a 100644 (file)
@@ -1,6 +1,6 @@
 //----------------------------  project_common.h  ---------------------------
 //    $Id$
-//    Version: $Name$ 
+//    Version: $Name$
 //
 //    Copyright (C) 2006, 2010 by the deal.II authors
 //
@@ -54,50 +54,50 @@ void test ();
 template <int dim>
 class F :  public Function<dim>
 {
-  public:
-    F (const unsigned int q,
-       const unsigned int n_components)
-                   :
-                   Function<dim>(n_components),
-                   q(q)
-      {}
-    
-    virtual double value (const Point<dim> &p,
-                         const unsigned int component) const
+public:
+  F (const unsigned int q,
+     const unsigned int n_components)
+    :
+    Function<dim>(n_components),
+    q(q)
+  {}
+
+  virtual double value (const Point<dim> &p,
+                        const unsigned int component) const
+  {
+    Assert ((component == 0) && (this->n_components == 1),
+            ExcInternalError());
+    double val = 0;
+    for (unsigned int d=0; d<dim; ++d)
+      for (unsigned int i=0; i<=q; ++i)
+        val += (d+1)*(i+1)*std::pow (p[d], 1.*i);
+    return val;
+  }
+
+
+  virtual void vector_value (const Point<dim> &p,
+                             Vector<double>   &v) const
+  {
+    for (unsigned int c=0; c<v.size(); ++c)
       {
-       Assert ((component == 0) && (this->n_components == 1),
-               ExcInternalError());
-       double val = 0;
-       for (unsigned int d=0; d<dim; ++d)
-         for (unsigned int i=0; i<=q; ++i)
-           val += (d+1)*(i+1)*std::pow (p[d], 1.*i);
-       return val;
+        v(c) = 0;
+        for (unsigned int d=0; d<dim; ++d)
+          for (unsigned int i=0; i<=q; ++i)
+            v(c) += (d+1)*(i+1)*std::pow (p[d], 1.*i)+c;
       }
+  }
 
-
-    virtual void vector_value (const Point<dim> &p,
-                              Vector<double>   &v) const
-      {
-       for (unsigned int c=0; c<v.size(); ++c)
-         {
-           v(c) = 0;
-           for (unsigned int d=0; d<dim; ++d)
-             for (unsigned int i=0; i<=q; ++i)
-               v(c) += (d+1)*(i+1)*std::pow (p[d], 1.*i)+c;
-         }
-      }
-    
-  private:
-    const unsigned int q;
+private:
+  const unsigned int q;
 };
 
 
 template <int dim>
 void do_project (const Triangulation<dim> &triangulation,
-                const FiniteElement<dim> &fe,
-                const unsigned int        p,
-                const unsigned int        order_difference)
-{  
+                 const FiniteElement<dim> &fe,
+                 const unsigned int        p,
+                 const unsigned int        order_difference)
+{
   DoFHandler<dim>        dof_handler(triangulation);
   dof_handler.distribute_dofs (fe);
 
@@ -105,40 +105,40 @@ void do_project (const Triangulation<dim> &triangulation,
 
   ConstraintMatrix constraints;
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          constraints);
+                                           constraints);
   constraints.close ();
 
   Vector<double> projection (dof_handler.n_dofs());
   Vector<float>  error (triangulation.n_active_cells());
   for (unsigned int q=0; q<=p+2-order_difference; ++q)
     {
-                                      // project the function
+      // project the function
       VectorTools::project (dof_handler,
-                           constraints,
-                           QGauss<dim>(p+2),
-                           F<dim> (q, fe.n_components()),
-                           projection);
-                                      // just to make sure it doesn't get
-                                      // forgotten: handle hanging node
-                                      // constraints
+                            constraints,
+                            QGauss<dim>(p+2),
+                            F<dim> (q, fe.n_components()),
+                            projection);
+      // just to make sure it doesn't get
+      // forgotten: handle hanging node
+      // constraints
       constraints.distribute (projection);
-      
-                                      // then compute the interpolation error
+
+      // then compute the interpolation error
       VectorTools::integrate_difference (dof_handler,
-                                        projection,
-                                        F<dim> (q, fe.n_components()),
-                                        error,
-                                        QGauss<dim>(std::max(p,q)+1),
-                                        VectorTools::L2_norm);
+                                         projection,
+                                         F<dim> (q, fe.n_components()),
+                                         error,
+                                         QGauss<dim>(std::max(p,q)+1),
+                                         VectorTools::L2_norm);
       deallog << fe.get_name() << ", P_" << q
-             << ", rel. error=" << error.l2_norm() / projection.l2_norm()
-             << std::endl;
-         
+              << ", rel. error=" << error.l2_norm() / projection.l2_norm()
+              << std::endl;
+
       if (q<=p-order_difference)
-       if (error.l2_norm() > 1e-10*projection.l2_norm())
-       deallog << "Projection failed with relative error "
-               << error.l2_norm() / projection.l2_norm()
-               << std::endl;
+        if (error.l2_norm() > 1e-10*projection.l2_norm())
+          deallog << "Projection failed with relative error "
+                  << error.l2_norm() / projection.l2_norm()
+                  << std::endl;
     }
 }
 
@@ -150,8 +150,8 @@ void do_project (const Triangulation<dim> &triangulation,
 // can only represent polynomials of degree p-1 exactly. the gap is then 1.
 template <int dim>
 void test_no_hanging_nodes (const FiniteElement<dim> &fe,
-                           const unsigned int        p,
-                           const unsigned int        order_difference = 0)
+                            const unsigned int        p,
+                            const unsigned int        order_difference = 0)
 {
   Triangulation<dim>     triangulation;
   GridGenerator::hyper_cube (triangulation);
@@ -165,8 +165,8 @@ void test_no_hanging_nodes (const FiniteElement<dim> &fe,
 // same test as above, but this time with a mesh that has hanging nodes
 template <int dim>
 void test_with_hanging_nodes (const FiniteElement<dim> &fe,
-                             const unsigned int        p,
-                             const unsigned int        order_difference = 0)
+                              const unsigned int        p,
+                              const unsigned int        order_difference = 0)
 {
   Triangulation<dim>     triangulation;
   GridGenerator::hyper_cube (triangulation);
@@ -174,7 +174,7 @@ void test_with_hanging_nodes (const FiniteElement<dim> &fe,
   triangulation.begin_active()->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
   triangulation.refine_global (1);
-  
+
   do_project (triangulation, fe, p, order_difference);
 }
 
@@ -192,22 +192,22 @@ void test_with_hanging_nodes (const FiniteElement<dim> &fe,
 // having face_orientation==false
 template <int dim>
 void test_with_wrong_face_orientation (const FiniteElement<dim> &fe,
-                                      const unsigned int        p,
-                                      const unsigned int        order_difference = 0)
+                                       const unsigned int        p,
+                                       const unsigned int        order_difference = 0)
 {
   if (dim != 3)
     return;
-  
+
   for (unsigned int i=0; i<7; ++i)
     {
       Triangulation<dim>     triangulation;
       GridGenerator::hyper_ball (triangulation);
       typename Triangulation<dim>::active_cell_iterator
-       cell = triangulation.begin_active();
+      cell = triangulation.begin_active();
       std::advance (cell, i);
       cell->set_refine_flag ();
       triangulation.execute_coarsening_and_refinement ();
-  
+
       do_project (triangulation, fe, p, order_difference);
     }
 }
@@ -220,12 +220,12 @@ void test_with_wrong_face_orientation (const FiniteElement<dim> &fe,
 // fe_poly_tensor.cc
 template <int dim>
 void test_with_2d_deformed_mesh (const FiniteElement<dim> &fe,
-                                const unsigned int        p,
-                                const unsigned int        order_difference = 0)
+                                 const unsigned int        p,
+                                 const unsigned int        order_difference = 0)
 {
   if (dim != 2)
     return;
-  
+
   std::vector<Point<dim> > points_glob;
   std::vector<Point<dim> > points;
 
@@ -237,7 +237,7 @@ void test_with_2d_deformed_mesh (const FiniteElement<dim> &fe,
   points_glob.push_back (Point<dim> (0.5, 1.0));
   points_glob.push_back (Point<dim> (0.0, 1.0));
 
-                                  // Prepare cell data
+  // Prepare cell data
   std::vector<CellData<dim> > cells (3);
 
   cells[0].vertices[0] = 0;
@@ -260,7 +260,7 @@ void test_with_2d_deformed_mesh (const FiniteElement<dim> &fe,
 
   Triangulation<dim>     triangulation;
   triangulation.create_triangulation (points_glob, cells, SubCellData());
-  
+
   do_project (triangulation, fe, p, order_difference);
 }
 
@@ -270,8 +270,8 @@ void test_with_2d_deformed_mesh (const FiniteElement<dim> &fe,
 // makes sure we also check the sign_change thingy for refined cells
 template <int dim>
 void test_with_2d_deformed_refined_mesh (const FiniteElement<dim> &fe,
-                                        const unsigned int        p,
-                                        const unsigned int        order_difference = 0)
+                                         const unsigned int        p,
+                                         const unsigned int        order_difference = 0)
 {
   if (dim != 2)
     return;
@@ -289,7 +289,7 @@ void test_with_2d_deformed_refined_mesh (const FiniteElement<dim> &fe,
       points_glob.push_back (Point<dim> (0.5, 1.0));
       points_glob.push_back (Point<dim> (0.0, 1.0));
 
-                                      // Prepare cell data
+      // Prepare cell data
       std::vector<CellData<dim> > cells (3);
 
       cells[0].vertices[0] = 0;
@@ -314,21 +314,21 @@ void test_with_2d_deformed_refined_mesh (const FiniteElement<dim> &fe,
       triangulation.create_triangulation (points_glob, cells, SubCellData());
 
       switch (i)
-       {
-         case 0:
-               triangulation.begin_active()->set_refine_flag();
-               break;
-         case 1:
-               (++(triangulation.begin_active()))->set_refine_flag();
-               break;
-         case 2:
-               (++(++(triangulation.begin_active())))->set_refine_flag();
-               break;
-         default:
-               Assert (false, ExcNotImplemented());
-       }
+        {
+        case 0:
+          triangulation.begin_active()->set_refine_flag();
+          break;
+        case 1:
+          (++(triangulation.begin_active()))->set_refine_flag();
+          break;
+        case 2:
+          (++(++(triangulation.begin_active())))->set_refine_flag();
+          break;
+        default:
+          Assert (false, ExcNotImplemented());
+        }
       triangulation.execute_coarsening_and_refinement ();
-      
+
       do_project (triangulation, fe, p, order_difference);
     }
 }
@@ -339,7 +339,7 @@ int main ()
 {
   std::ofstream logfile(logname);
   deallog << std::setprecision (3);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
index 99e99aec6591e3ec719d016e3a61a107b85c3266..dc24424004dd22520f1ebafb02fa8d2a7171925a 100644 (file)
@@ -28,7 +28,7 @@ template <int dim>
 void test ()
 {
   if (dim > 1)
-                                    // only p=1 implemented at present
+    // only p=1 implemented at present
     for (unsigned int p=1; p<2; ++p)
       test_no_hanging_nodes (FE_Nedelec<dim>(p-1), p, 1);
 }
index 3497a334fdb718826f699c4c879c0e1375b2b453..71153941df01383c3a6aaa038bee7994bbc27752 100644 (file)
@@ -28,7 +28,7 @@ template <int dim>
 void test ()
 {
   if (dim > 1)
-                                    // only p=1 implemented at present
+    // only p=1 implemented at present
     for (unsigned int p=0; p<2; ++p)
       test_with_hanging_nodes (FE_Nedelec<dim>(p), p, 1);
 }
index 16d07e1e603bff0d5c2b1f8ff71272415b3a1dfa..054ef11f27468ed2907da2eabd47bc4e39e670d2 100644 (file)
@@ -28,7 +28,7 @@ template <int dim>
 void test ()
 {
   if (dim > 1)
-                                    // only p=1 implemented at present
+    // only p=1 implemented at present
     for (unsigned int p=1; p<2; ++p)
       test_with_wrong_face_orientation (FE_Nedelec<dim>(p-1), p, 1);
 }
index 69b746ebe454791edda984a8d207c4f9526145e9..c5b215e09850fdddd7e89b3ff91ea83464b3eec8 100644 (file)
@@ -28,7 +28,7 @@ template <int dim>
 void test ()
 {
   if (dim > 1)
-                                    // only p=1 implemented at present
+    // only p=1 implemented at present
     for (unsigned int p=1; p<2; ++p)
       test_with_2d_deformed_mesh (FE_Nedelec<dim>(p-1), p, 1);
 }
index 2e782947b37d0d435f548d8ce967ada0aa811c83..f9ae168a2ed46cf944618cd6ca019f556cd684fa 100644 (file)
@@ -28,7 +28,7 @@ template <int dim>
 void test ()
 {
   if (dim > 1)
-                                    // only p=1 implemented at present
+    // only p=1 implemented at present
     for (unsigned int p=1; p<2; ++p)
       test_with_2d_deformed_refined_mesh (FE_Nedelec<dim>(p-1), p, 1);
 }
index 84f96c622c7ec70390d1c01ec92e585540f7df05..7fc70b40dfb5976b9e83037e5da01c01ac1bbc30 100644 (file)
@@ -30,6 +30,6 @@ void test ()
 {
   for (unsigned int p=1; p<5-dim; ++p)
     test_no_hanging_nodes (FESystem<dim>(FE_Q<dim>(p), 1,
-                                        FE_DGQ<dim>(p+1), 1),
-                          p);
+                                         FE_DGQ<dim>(p+1), 1),
+                           p);
 }
index 3238a1f2120c5c7bc35bd2a38f43f2d3c40b8bd2..3eb1e68c26161c2f64bad9d9f933938b63dded6f 100644 (file)
@@ -30,6 +30,6 @@ void test ()
 {
   for (unsigned int p=1; p<5-dim; ++p)
     test_with_hanging_nodes (FESystem<dim>(FE_Q<dim>(p), 1,
-                                        FE_DGQ<dim>(p+1), 1),
-                          p);
+                                           FE_DGQ<dim>(p+1), 1),
+                             p);
 }
index 8e0d2f84b6bb3c4606e0ba2e0b52ec73fe7cc663..17f3c1cd4e80b30382165f25cef6922b91175740 100644 (file)
@@ -30,6 +30,6 @@ void test ()
 {
   for (unsigned int p=1; p<5-dim; ++p)
     test_with_wrong_face_orientation (FESystem<dim>(FE_Q<dim>(p), 1,
-                                        FE_DGQ<dim>(p+1), 1),
-                          p);
+                                                    FE_DGQ<dim>(p+1), 1),
+                                      p);
 }
index eac08407799cfaa4db8a4e4061f4b236e85ffa44..9590c31cfa563cd385559f385c70a326ae26a44b 100644 (file)
@@ -30,6 +30,6 @@ void test ()
 {
   for (unsigned int p=1; p<5-dim; ++p)
     test_with_2d_deformed_mesh (FESystem<dim>(FE_Q<dim>(p), 1,
-                                        FE_DGQ<dim>(p+1), 1),
-                          p);
+                                              FE_DGQ<dim>(p+1), 1),
+                                p);
 }
index 9e0504207426e259b5fa354f9854ac5f97089eaa..b1186ad5b85ddf940bc5513d69ff674b1505d5b0 100644 (file)
@@ -30,6 +30,6 @@ void test ()
 {
   for (unsigned int p=1; p<5-dim; ++p)
     test_with_2d_deformed_refined_mesh (FESystem<dim>(FE_Q<dim>(p), 1,
-                                        FE_DGQ<dim>(p+1), 1),
-                          p);
+                                                      FE_DGQ<dim>(p+1), 1),
+                                        p);
 }
index 298ff9bfd0a865f0ba3eaff33db416af849e8c44..7b6606e43961f434bf883065342819f7fee54bb3 100644 (file)
@@ -28,9 +28,9 @@ template <int dim>
 void test ()
 {
   if (dim != 1)
-                                    // this is interesting also in 3d, but is
-                                    // exceedingly slow there. limit to the
-                                    // case of RT(0) elements in 3d
+    // this is interesting also in 3d, but is
+    // exceedingly slow there. limit to the
+    // case of RT(0) elements in 3d
     for (unsigned int p=0; p<(dim == 2 ? 3 : 1); ++p)
       test_no_hanging_nodes (FE_RaviartThomas<dim>(p), p+1, 1);
 }
index 0868556edcdedb4f2b7d20bac4d7f82041fd0963..62b24299da36430adf9486c11403672920134469 100644 (file)
@@ -28,9 +28,9 @@ template <int dim>
 void test ()
 {
   if (dim != 1)
-                                    // this is interesting also in 3d, but is
-                                    // exceedingly slow there. limit to the
-                                    // case of RT(0) elements in 3d
+    // this is interesting also in 3d, but is
+    // exceedingly slow there. limit to the
+    // case of RT(0) elements in 3d
     for (unsigned int p=0; p<(dim == 2 ? 3 : 1); ++p)
       test_with_hanging_nodes (FE_RaviartThomas<dim>(p), p+1, 1);
 }
index 88eecbaeddcde3974158ef7fd72ab10e27c1ab02..e0ce9a4bb85b0136d106450bd7cfac726c116b43 100644 (file)
@@ -28,9 +28,9 @@ template <int dim>
 void test ()
 {
   if (dim != 1)
-                                    // this is interesting also in 3d, but is
-                                    // exceedingly slow there. limit to the
-                                    // case of RT(0) elements in 3d
+    // this is interesting also in 3d, but is
+    // exceedingly slow there. limit to the
+    // case of RT(0) elements in 3d
     for (unsigned int p=0; p<(dim == 2 ? 3 : 1); ++p)
       test_with_2d_deformed_mesh (FE_RaviartThomas<dim>(p), p+1, 1);
 }
index 0906795f4dfade3b7426dbc2088147c80f863e77..a740156ccbcc732ff6ecd85b9f0f2bcfd2a92de9 100644 (file)
@@ -28,9 +28,9 @@ template <int dim>
 void test ()
 {
   if (dim != 1)
-                                    // this is interesting also in 3d, but is
-                                    // exceedingly slow there. limit to the
-                                    // case of RT(0) elements in 3d
+    // this is interesting also in 3d, but is
+    // exceedingly slow there. limit to the
+    // case of RT(0) elements in 3d
     for (unsigned int p=0; p<(dim == 2 ? 3 : 1); ++p)
       test_with_2d_deformed_refined_mesh (FE_RaviartThomas<dim>(p), p+1, 1);
 }
index 1b31b7153b88afc9dbddb27d4f9f4c5371fc9577..4855daaf54b516aaa5954b2000317113ffe44aa4 100644 (file)
 
 class Rotate2d
 {
-  public:
-    Rotate2d (const double angle)
-                   :
-                   angle(angle)
-      {}
-
-    template <int spacedim>
-    Point<spacedim> operator() (const Point<spacedim> p) const
-      {
-       Point<spacedim> q;
-       q[0] = std::cos(angle)*p(0) - std::sin(angle) * p(1);
-       q[1] = std::sin(angle)*p(0) + std::cos(angle) * p(1);
-       for (unsigned d=2; d<spacedim; ++d)
-         q[d] = p[d];
-       return q;
-      }
-  private:
-    const double angle;
+public:
+  Rotate2d (const double angle)
+    :
+    angle(angle)
+  {}
+
+  template <int spacedim>
+  Point<spacedim> operator() (const Point<spacedim> p) const
+  {
+    Point<spacedim> q;
+    q[0] = std::cos(angle)*p(0) - std::sin(angle) * p(1);
+    q[1] = std::sin(angle)*p(0) + std::cos(angle) * p(1);
+    for (unsigned d=2; d<spacedim; ++d)
+      q[d] = p[d];
+    return q;
+  }
+private:
+  const double angle;
 };
 
 
@@ -71,7 +71,7 @@ void do_rotate (Triangulation<1> &)
 
 template <int dim>
 void create_triangulation(const bool rotate,
-                         Triangulation<dim> &tria)
+                          Triangulation<dim> &tria)
 {
   GridGenerator::hyper_cube(tria, 1., 3.);
 
@@ -84,7 +84,7 @@ template <int dim>
 void test ()
 {
   deallog << "dim=" << dim << std::endl;
-  
+
   Triangulation<dim> tria;
   StraightBoundary<dim> boundary;
 
@@ -96,29 +96,29 @@ void test ()
       const typename Triangulation<dim>::active_cell_iterator cell=tria.begin_active();
       Point<dim> trial_point;
       for (unsigned int i=0; i<dim; ++i)
-       trial_point[i] = 1.5;
-      
+        trial_point[i] = 1.5;
+
       for (unsigned int e=0; e<GeometryInfo<dim>::lines_per_cell; ++e)
-       {
-         deallog << "    Line " << e << ", projected point=";
-         if (dim > 1)
-           deallog << boundary.project_to_surface (cell->line(e), trial_point);
-         else
-           deallog << boundary.project_to_surface (cell, trial_point);
-
-         deallog << "  (line is from ";
-         if (dim > 1)
-           deallog << cell->line(e)->vertex(0);
-         else
-           deallog << cell->vertex(0);
-         deallog << " to ";
-         if (dim > 1)
-           deallog << cell->line(e)->vertex(1);
-         else
-           deallog << cell->vertex(1);
-         
-         deallog << ")" << std::endl;
-       }
+        {
+          deallog << "    Line " << e << ", projected point=";
+          if (dim > 1)
+            deallog << boundary.project_to_surface (cell->line(e), trial_point);
+          else
+            deallog << boundary.project_to_surface (cell, trial_point);
+
+          deallog << "  (line is from ";
+          if (dim > 1)
+            deallog << cell->line(e)->vertex(0);
+          else
+            deallog << cell->vertex(0);
+          deallog << " to ";
+          if (dim > 1)
+            deallog << cell->line(e)->vertex(1);
+          else
+            deallog << cell->vertex(1);
+
+          deallog << ")" << std::endl;
+        }
       tria.clear();
     }
 }
@@ -130,7 +130,7 @@ int main ()
 {
   std::ofstream logfile ("project_to_surface_01/output");
   deallog << std::setprecision (3);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 509bc367ad73804c432eede05d16addf9aed1e87..ef05055d9c25a205e516e9b6f99cc71f51724958 100644 (file)
 
 class Rotate2d
 {
-  public:
-    Rotate2d (const double angle)
-                   :
-                   angle(angle)
-      {}
-
-    template <int spacedim>
-    Point<spacedim> operator() (const Point<spacedim> p) const
-      {
-       Point<spacedim> q;
-       q[0] = std::cos(angle)*p(0) - std::sin(angle) * p(1);
-       q[1] = std::sin(angle)*p(0) + std::cos(angle) * p(1);
-       for (unsigned d=2; d<spacedim; ++d)
-         q[d] = p[d];
-       return q;
-      }
-  private:
-    const double angle;
+public:
+  Rotate2d (const double angle)
+    :
+    angle(angle)
+  {}
+
+  template <int spacedim>
+  Point<spacedim> operator() (const Point<spacedim> p) const
+  {
+    Point<spacedim> q;
+    q[0] = std::cos(angle)*p(0) - std::sin(angle) * p(1);
+    q[1] = std::sin(angle)*p(0) + std::cos(angle) * p(1);
+    for (unsigned d=2; d<spacedim; ++d)
+      q[d] = p[d];
+    return q;
+  }
+private:
+  const double angle;
 };
 
 
@@ -71,7 +71,7 @@ void do_rotate (Triangulation<1> &)
 
 template <int dim>
 void create_triangulation(const bool rotate,
-                         Triangulation<dim> &tria)
+                          Triangulation<dim> &tria)
 {
   GridGenerator::hyper_cube(tria, 1., 3.);
 
@@ -84,7 +84,7 @@ template <int dim>
 void test ()
 {
   deallog << "dim=" << dim << std::endl;
-  
+
   Triangulation<dim> tria;
   StraightBoundary<dim> boundary;
 
@@ -96,37 +96,37 @@ void test ()
       const typename Triangulation<dim>::active_cell_iterator cell=tria.begin_active();
       Point<dim> trial_point;
       for (unsigned int i=0; i<dim; ++i)
-       trial_point[i] = 1.5;
-      
+        trial_point[i] = 1.5;
+
       for (unsigned int e=0; e<GeometryInfo<dim>::quads_per_cell; ++e)
-       {
-         const typename Triangulation<dim>::quad_iterator
-           quad = (dim > 2 ? cell->quad(e) :
-                   *reinterpret_cast<const typename Triangulation<dim>::quad_iterator*>(&cell));
-         
-         deallog << "    Quad " << e << ", projected point=";
-
-         const Point<dim> p = boundary.project_to_surface (quad, trial_point);
-         deallog << p;
-         deallog << "  (quad is from ";
-         deallog << quad->vertex(0);
-         deallog << " to ";
-         deallog << quad->vertex(1);
-         deallog << " to ";
-         deallog << quad->vertex(2);
-         deallog << " to ";
-         deallog << quad->vertex(3);
-         deallog << ")" << std::endl;
-
-                                          // now make sure that p is
-                                          // indeed closer to
-                                          // trial_point than any of
-                                          // the vertices of the quad
-         for (unsigned int v=0; v<4; ++v)
-           Assert (p.distance (trial_point) <=
-                   quad->vertex(v).distance (trial_point),
-                   ExcInternalError());
-       }
+        {
+          const typename Triangulation<dim>::quad_iterator
+          quad = (dim > 2 ? cell->quad(e) :
+                  *reinterpret_cast<const typename Triangulation<dim>::quad_iterator *>(&cell));
+
+          deallog << "    Quad " << e << ", projected point=";
+
+          const Point<dim> p = boundary.project_to_surface (quad, trial_point);
+          deallog << p;
+          deallog << "  (quad is from ";
+          deallog << quad->vertex(0);
+          deallog << " to ";
+          deallog << quad->vertex(1);
+          deallog << " to ";
+          deallog << quad->vertex(2);
+          deallog << " to ";
+          deallog << quad->vertex(3);
+          deallog << ")" << std::endl;
+
+          // now make sure that p is
+          // indeed closer to
+          // trial_point than any of
+          // the vertices of the quad
+          for (unsigned int v=0; v<4; ++v)
+            Assert (p.distance (trial_point) <=
+                    quad->vertex(v).distance (trial_point),
+                    ExcInternalError());
+        }
       tria.clear();
     }
 }
@@ -138,7 +138,7 @@ int main ()
 {
   std::ofstream logfile ("project_to_surface_02/output");
   deallog << std::setprecision (3);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 4e4924c2997908f0e843347509e0bd4a76d9297e..72ab9f749c502dc2e86006c524fd3763b1b1d78b 100644 (file)
@@ -38,66 +38,66 @@ template <int dim>
 void test ()
 {
   deallog << "dim=" << dim << std::endl;
-  
+
   Triangulation<dim> tria;
   StraightBoundary<dim> boundary;
 
   GridGenerator::hyper_cube(tria, 0, 1);
 
   const typename Triangulation<dim>::active_cell_iterator
-    cell=tria.begin_active();
+  cell=tria.begin_active();
 
-                                  // distort the cell a bit. all
-                                  // faces but face 0 stay planar;
-                                  // face 0 becomes a saddle
+  // distort the cell a bit. all
+  // faces but face 0 stay planar;
+  // face 0 becomes a saddle
   cell->vertex(0)[0] -= 0.25;
   cell->vertex(6)[0] -= 0.25;
   cell->vertex(2)[0] += 0.25;
   cell->vertex(4)[0] += 0.25;
-  
+
 
   for (unsigned int point=0; point<9; ++point)
     {
-                                      // choose the 8 vertices of the
-                                      // original unit cell as well
-                                      // as the center point
+      // choose the 8 vertices of the
+      // original unit cell as well
+      // as the center point
       const Point<dim> trial_point = (point < 8
-                                     ?
-                                     GeometryInfo<dim>::unit_cell_vertex(point)
-                                     :
-                                     Point<dim>(.5,.5,.5));
+                                      ?
+                                      GeometryInfo<dim>::unit_cell_vertex(point)
+                                      :
+                                      Point<dim>(.5,.5,.5));
 
       deallog << "Trial point = " << trial_point << std::endl;
-      
+
       for (unsigned int e=0; e<GeometryInfo<dim>::quads_per_cell; ++e)
-       {
-         const typename Triangulation<dim>::quad_iterator
-           quad = (dim > 2 ? cell->quad(e) :
-                   *reinterpret_cast<const typename Triangulation<dim>::quad_iterator*>(&cell));
-         
-         deallog << "    Quad " << e << ", projected point=";
-
-         const Point<dim> p = boundary.project_to_surface (quad, trial_point);
-         deallog << p;
-         deallog << "  (quad is from ";
-         deallog << quad->vertex(0);
-         deallog << " to ";
-         deallog << quad->vertex(1);
-         deallog << " to ";
-         deallog << quad->vertex(2);
-         deallog << " to ";
-         deallog << quad->vertex(3);
-         deallog << ")" << std::endl;
-
-                                          // now make sure that p is
-                                          // indeed closer to
-                                          // trial_point than any of
-                                          // the vertices of the quad
-         for (unsigned int v=0; v<4; ++v)
-           Assert (p.distance (trial_point) <=
-                   quad->vertex(v).distance (trial_point),
-                   ExcInternalError());
-       }
+        {
+          const typename Triangulation<dim>::quad_iterator
+          quad = (dim > 2 ? cell->quad(e) :
+                  *reinterpret_cast<const typename Triangulation<dim>::quad_iterator *>(&cell));
+
+          deallog << "    Quad " << e << ", projected point=";
+
+          const Point<dim> p = boundary.project_to_surface (quad, trial_point);
+          deallog << p;
+          deallog << "  (quad is from ";
+          deallog << quad->vertex(0);
+          deallog << " to ";
+          deallog << quad->vertex(1);
+          deallog << " to ";
+          deallog << quad->vertex(2);
+          deallog << " to ";
+          deallog << quad->vertex(3);
+          deallog << ")" << std::endl;
+
+          // now make sure that p is
+          // indeed closer to
+          // trial_point than any of
+          // the vertices of the quad
+          for (unsigned int v=0; v<4; ++v)
+            Assert (p.distance (trial_point) <=
+                    quad->vertex(v).distance (trial_point),
+                    ExcInternalError());
+        }
       deallog << std::endl;
     }
 }
@@ -109,7 +109,7 @@ int main ()
 {
   std::ofstream logfile ("project_to_surface_03/output");
   deallog << std::setprecision (3);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index ba6f8097f94067bd82d8e624161e7fe9e814c974..6478a4cb1e6cd9f8c1aa82880a6ba012fcf49baa 100644 (file)
@@ -36,52 +36,52 @@ void test()
   for (unsigned int t=0; t<2; ++t)
     {
       deallog << "dim=" << dim << ", test=" << t << std::endl;
-      
+
       Triangulation<dim> tr;
       if (dim > 1)
-       GridGenerator::hyper_ball(tr);
+        GridGenerator::hyper_ball(tr);
       else
-       GridGenerator::hyper_cube(tr);
+        GridGenerator::hyper_cube(tr);
 
       tr.refine_global(1);
 
-                                      // for test 1, refine a second
-                                      // time isotropically. for test
-                                      // 2, cut in only one direction
+      // for test 1, refine a second
+      // time isotropically. for test
+      // 2, cut in only one direction
       if (t==0)
-       tr.refine_global(1);
+        tr.refine_global(1);
       else
-       {
-         for (typename Triangulation<dim>::active_cell_iterator
-                cell = tr.begin_active(); cell != tr.end(); ++cell)
-           cell->set_refine_flag (RefinementCase<dim>::cut_x);
-         tr.execute_coarsening_and_refinement();
-       }
+        {
+          for (typename Triangulation<dim>::active_cell_iterator
+               cell = tr.begin_active(); cell != tr.end(); ++cell)
+            cell->set_refine_flag (RefinementCase<dim>::cut_x);
+          tr.execute_coarsening_and_refinement();
+        }
 
       deallog << tr.n_active_cells() << std::endl;
 
-                                      // now call the function once
-                                      // for one of the cells on
-                                      // level 1
+      // now call the function once
+      // for one of the cells on
+      // level 1
       tr.begin(1)->recursively_set_material_id (1);
 
-                                      // and then count how many
-                                      // active cells inherited this
-                                      // flag
+      // and then count how many
+      // active cells inherited this
+      // flag
       unsigned int n=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active(); cell != tr.end(); ++cell)
-       if (cell->material_id() == 1)
-         ++n;
-      
+           cell = tr.begin_active(); cell != tr.end(); ++cell)
+        if (cell->material_id() == 1)
+          ++n;
+
       deallog << n << std::endl;
 
       if (t==0)
-       Assert (n == GeometryInfo<dim>::max_children_per_cell,
-               ExcInternalError())
-      else
-       Assert (n == 2,
-               ExcInternalError());
+        Assert (n == GeometryInfo<dim>::max_children_per_cell,
+                ExcInternalError())
+        else
+          Assert (n == 2,
+                  ExcInternalError());
     }
 }
 
index 41016a9f7dd398cd4f5ca5b3c76699145a36038b..891b722dfe0bd8a609b418b2c03d428f13f68c31 100644 (file)
@@ -35,45 +35,45 @@ template <int dim, int spacedim = dim>
 class RefinementListener :
   public Triangulation<dim,spacedim>::RefinementListener
 {
-  public:
-    RefinementListener (const std::string &prefix)
-                   :
-                   prefix(prefix)
-      {}
-
-    virtual
-    void
-    pre_refinement_notification (const Triangulation<dim, spacedim> &tria)
-      {
-       deallog << prefix << ' ' << "Pre-refinement: " << tria.n_active_cells() << std::endl;
-      }
-
-    virtual
-    void
-    post_refinement_notification (const Triangulation<dim, spacedim> &tria)
-      {
-       deallog << prefix << ' ' << "Post-refinement: " << tria.n_active_cells() << std::endl;
-      }
-
-    virtual
-    void
-    copy_notification (const Triangulation<dim, spacedim> &old_tria,
-                      const Triangulation<dim, spacedim> &new_tria)
-      {
-       deallog << prefix << ' ' << "Copy: "
-               << old_tria.n_active_cells() << ' '
-               << new_tria.n_active_cells() << std::endl;
-      }
-
-    virtual
-    void
-    create_notification (const Triangulation<dim, spacedim> &tria)
-      {
-       deallog << prefix << ' ' << "Create: " << tria.n_active_cells() << std::endl;
-      }
-
-  private:
-    std::string prefix;
+public:
+  RefinementListener (const std::string &prefix)
+    :
+    prefix(prefix)
+  {}
+
+  virtual
+  void
+  pre_refinement_notification (const Triangulation<dim, spacedim> &tria)
+  {
+    deallog << prefix << ' ' << "Pre-refinement: " << tria.n_active_cells() << std::endl;
+  }
+
+  virtual
+  void
+  post_refinement_notification (const Triangulation<dim, spacedim> &tria)
+  {
+    deallog << prefix << ' ' << "Post-refinement: " << tria.n_active_cells() << std::endl;
+  }
+
+  virtual
+  void
+  copy_notification (const Triangulation<dim, spacedim> &old_tria,
+                     const Triangulation<dim, spacedim> &new_tria)
+  {
+    deallog << prefix << ' ' << "Copy: "
+            << old_tria.n_active_cells() << ' '
+            << new_tria.n_active_cells() << std::endl;
+  }
+
+  virtual
+  void
+  create_notification (const Triangulation<dim, spacedim> &tria)
+  {
+    deallog << prefix << ' ' << "Create: " << tria.n_active_cells() << std::endl;
+  }
+
+private:
+  std::string prefix;
 };
 
 
@@ -91,18 +91,18 @@ void test ()
   tria_1.add_refinement_listener (rl_1);
   tria_2.add_refinement_listener (rl_2);
 
-                                  // this should print the create note
+  // this should print the create note
   GridGenerator::hyper_cube(tria_1);
 
-                                  // this should print the pre- and
-                                  // post-refinement note
+  // this should print the pre- and
+  // post-refinement note
   tria_1.refine_global (1);
 
-                                  // this should print the copy note
+  // this should print the copy note
   tria_1.clear ();
   tria_1.copy_triangulation (tria_2);
 
-                                  // no longer print anything
+  // no longer print anything
   tria_1.remove_refinement_listener (rl_1);
   tria_1.refine_global (2);
 }
index 3b4122233f4f59dd6cd05e4d8fb12572d30b5062..cd56e10e2b539904cc4403643366773f8ce7fe7a 100644 (file)
@@ -36,7 +36,7 @@ std::ofstream logfile("refinement_listener_02/output");
 template <int dim, int spacedim>
 void
 pre_refinement_notification (const std::string &prefix,
-                            const Triangulation<dim, spacedim> &tria)
+                             const Triangulation<dim, spacedim> &tria)
 {
   deallog << prefix << ' ' << "Pre-refinement: " << tria.n_active_cells() << std::endl;
 }
@@ -45,7 +45,7 @@ pre_refinement_notification (const std::string &prefix,
 template <int dim, int spacedim>
 void
 post_refinement_notification (const std::string &prefix,
-                             const Triangulation<dim, spacedim> &tria)
+                              const Triangulation<dim, spacedim> &tria)
 {
   deallog << prefix << ' ' << "Post-refinement: " << tria.n_active_cells() << std::endl;
 }
@@ -54,19 +54,19 @@ post_refinement_notification (const std::string &prefix,
 template <int dim, int spacedim>
 void
 copy_notification (const std::string &prefix,
-                  const Triangulation<dim, spacedim> &old_tria,
-                  const Triangulation<dim, spacedim> &new_tria)
+                   const Triangulation<dim, spacedim> &old_tria,
+                   const Triangulation<dim, spacedim> &new_tria)
 {
   deallog << prefix << ' ' << "Copy: "
-         << old_tria.n_active_cells() << ' '
-         << new_tria.n_active_cells() << std::endl;
+          << old_tria.n_active_cells() << ' '
+          << new_tria.n_active_cells() << std::endl;
 }
 
 
 template <int dim, int spacedim>
 void
 create_notification (const std::string &prefix,
-                    const Triangulation<dim, spacedim> &tria)
+                     const Triangulation<dim, spacedim> &tria)
 {
   deallog << prefix << ' ' << "Create: " << tria.n_active_cells() << std::endl;
 }
@@ -84,56 +84,56 @@ void test ()
   boost::signals2::connection connections_1[4]
     = {tria_1.signals.pre_refinement
        .connect (std_cxx1x::bind (&pre_refinement_notification<dim,dim>,
-                                 "tria_1",
-                                 std_cxx1x::cref(tria_1))),
+                                  "tria_1",
+                                  std_cxx1x::cref(tria_1))),
        tria_1.signals.post_refinement
        .connect (std_cxx1x::bind (&post_refinement_notification<dim,dim>,
-                                 "tria_1",
-                                 std_cxx1x::cref(tria_1))),
+                                  "tria_1",
+                                  std_cxx1x::cref(tria_1))),
        tria_1.signals.create
        .connect (std_cxx1x::bind (&create_notification<dim,dim>,
-                                 "tria_1",
-                                 std_cxx1x::cref(tria_1))),
+                                  "tria_1",
+                                  std_cxx1x::cref(tria_1))),
        tria_1.signals.copy
        .connect (std_cxx1x::bind (&copy_notification<dim,dim>,
-                                 "tria_1",
-                                 std_cxx1x::_1,
-                                 std_cxx1x::cref(tria_1)))
-  };
+                                  "tria_1",
+                                  std_cxx1x::_1,
+                                  std_cxx1x::cref(tria_1)))
+      };
   boost::signals2::connection connections_2[4]
     = {tria_2.signals.pre_refinement
        .connect (std_cxx1x::bind (&pre_refinement_notification<dim,dim>,
-                                 "tria_2",
-                                 std_cxx1x::cref(tria_2))),
+                                  "tria_2",
+                                  std_cxx1x::cref(tria_2))),
        tria_2.signals.post_refinement
        .connect (std_cxx1x::bind (&post_refinement_notification<dim,dim>,
-                                 "tria_2",
-                                 std_cxx1x::cref(tria_2))),
+                                  "tria_2",
+                                  std_cxx1x::cref(tria_2))),
        tria_2.signals.create
        .connect (std_cxx1x::bind (&create_notification<dim,dim>,
-                                 "tria_2",
-                                 std_cxx1x::cref(tria_2))),
+                                  "tria_2",
+                                  std_cxx1x::cref(tria_2))),
        tria_2.signals.copy
        .connect (std_cxx1x::bind (&copy_notification<dim,dim>,
-                                 "tria_2",
-                                 std_cxx1x::_1,
-                                 std_cxx1x::cref(tria_2)))
-  };
+                                  "tria_2",
+                                  std_cxx1x::_1,
+                                  std_cxx1x::cref(tria_2)))
+      };
 
 
 
-                                  // this should print the create note
+  // this should print the create note
   GridGenerator::hyper_cube(tria_1);
 
-                                  // this should print the pre- and
-                                  // post-refinement note
+  // this should print the pre- and
+  // post-refinement note
   tria_1.refine_global (1);
 
-                                  // this should print the copy note
+  // this should print the copy note
   tria_1.clear ();
   tria_1.copy_triangulation (tria_2);
 
-                                  // no longer print anything
+  // no longer print anything
   for (unsigned int i=0; i<4; ++i)
     connections_1[i].disconnect ();
 
index 4b36c165705e04b7d6134ad9523182f7c61b9732..34f9b13c8fc39b191ac921ff65650dc13ef5ccf3 100644 (file)
@@ -35,7 +35,7 @@ std::ofstream logfile("refinement_listener_03/output");
 template <int dim, int spacedim>
 void
 pre_refinement_notification (const std::string &prefix,
-                            const Triangulation<dim, spacedim> &tria)
+                             const Triangulation<dim, spacedim> &tria)
 {
   deallog << prefix << ' ' << "Pre-refinement: " << tria.n_active_cells() << std::endl;
 }
@@ -44,7 +44,7 @@ pre_refinement_notification (const std::string &prefix,
 template <int dim, int spacedim>
 void
 post_refinement_notification (const std::string &prefix,
-                             const Triangulation<dim, spacedim> &tria)
+                              const Triangulation<dim, spacedim> &tria)
 {
   deallog << prefix << ' ' << "Post-refinement: " << tria.n_active_cells() << std::endl;
 }
@@ -53,19 +53,19 @@ post_refinement_notification (const std::string &prefix,
 template <int dim, int spacedim>
 void
 copy_notification (const std::string &prefix,
-                  const Triangulation<dim, spacedim> &old_tria,
-                  const Triangulation<dim, spacedim> &new_tria)
+                   const Triangulation<dim, spacedim> &old_tria,
+                   const Triangulation<dim, spacedim> &new_tria)
 {
   deallog << prefix << ' ' << "Copy: "
-         << old_tria.n_active_cells() << ' '
-         << new_tria.n_active_cells() << std::endl;
+          << old_tria.n_active_cells() << ' '
+          << new_tria.n_active_cells() << std::endl;
 }
 
 
 template <int dim, int spacedim>
 void
 create_notification (const std::string &prefix,
-                    const Triangulation<dim, spacedim> &tria)
+                     const Triangulation<dim, spacedim> &tria)
 {
   deallog << prefix << ' ' << "Create: " << tria.n_active_cells() << std::endl;
 }
@@ -74,10 +74,10 @@ create_notification (const std::string &prefix,
 template <int dim, int spacedim>
 void
 any_change_notification (const std::string &prefix,
-                        const Triangulation<dim, spacedim> &tria)
+                         const Triangulation<dim, spacedim> &tria)
 {
   deallog << prefix << ' ' << "Any change: "
-         << tria.n_active_cells() << std::endl;
+          << tria.n_active_cells() << std::endl;
 }
 
 
@@ -93,76 +93,76 @@ void test ()
   boost::signals2::connection connections_1[5]
     = {tria_1.signals.pre_refinement
        .connect (std_cxx1x::bind (&pre_refinement_notification<dim,dim>,
-                                 "tria_1",
-                                 std_cxx1x::cref(tria_1))),
+                                  "tria_1",
+                                  std_cxx1x::cref(tria_1))),
        tria_1.signals.post_refinement
        .connect (std_cxx1x::bind (&post_refinement_notification<dim,dim>,
-                                 "tria_1",
-                                 std_cxx1x::cref(tria_1))),
+                                  "tria_1",
+                                  std_cxx1x::cref(tria_1))),
        tria_1.signals.create
        .connect (std_cxx1x::bind (&create_notification<dim,dim>,
-                                 "tria_1",
-                                 std_cxx1x::cref(tria_1))),
+                                  "tria_1",
+                                  std_cxx1x::cref(tria_1))),
        tria_1.signals.copy
        .connect (std_cxx1x::bind (&copy_notification<dim,dim>,
-                                 "tria_1",
-                                 std_cxx1x::_1,
-                                 std_cxx1x::cref(tria_1))),
+                                  "tria_1",
+                                  std_cxx1x::_1,
+                                  std_cxx1x::cref(tria_1))),
        tria_1.signals.any_change
        .connect (std_cxx1x::bind (&any_change_notification<dim,dim>,
-                                 "tria_1",
-                                 std_cxx1x::cref(tria_1)))
-  };
+                                  "tria_1",
+                                  std_cxx1x::cref(tria_1)))
+      };
   boost::signals2::connection connections_2[5]
     = {tria_2.signals.pre_refinement
        .connect (std_cxx1x::bind (&pre_refinement_notification<dim,dim>,
-                                 "tria_2",
-                                 std_cxx1x::cref(tria_2))),
+                                  "tria_2",
+                                  std_cxx1x::cref(tria_2))),
        tria_2.signals.post_refinement
        .connect (std_cxx1x::bind (&post_refinement_notification<dim,dim>,
-                                 "tria_2",
-                                 std_cxx1x::cref(tria_2))),
+                                  "tria_2",
+                                  std_cxx1x::cref(tria_2))),
        tria_2.signals.create
        .connect (std_cxx1x::bind (&create_notification<dim,dim>,
-                                 "tria_2",
-                                 std_cxx1x::cref(tria_2))),
+                                  "tria_2",
+                                  std_cxx1x::cref(tria_2))),
        tria_2.signals.copy
        .connect (std_cxx1x::bind (&copy_notification<dim,dim>,
-                                 "tria_2",
-                                 std_cxx1x::_1,
-                                 std_cxx1x::cref(tria_2))),
+                                  "tria_2",
+                                  std_cxx1x::_1,
+                                  std_cxx1x::cref(tria_2))),
        tria_2.signals.any_change
        .connect (std_cxx1x::bind (&any_change_notification<dim,dim>,
-                                 "tria_2",
-                                 std_cxx1x::cref(tria_2)))
-  };
+                                  "tria_2",
+                                  std_cxx1x::cref(tria_2)))
+      };
 
 
 
-                                  // this should print the create note
+  // this should print the create note
   GridGenerator::hyper_cube(tria_1);
 
-                                  // this should print the pre- and
-                                  // post-refinement note
+  // this should print the pre- and
+  // post-refinement note
   tria_1.refine_global (1);
 
-                                  // this should print the copy note
+  // this should print the copy note
   tria_1.clear ();
   tria_1.copy_triangulation (tria_2);
 
-                                  // no longer print anything with the
-                                  // exception of the any_change signal
+  // no longer print anything with the
+  // exception of the any_change signal
   for (unsigned int i=0; i<4; ++i)
     connections_1[i].disconnect ();
 
-                                  // still show the any_change signal
+  // still show the any_change signal
   tria_1.refine_global (2);
 
-                                  // and now really nothing
+  // and now really nothing
   connections_1[4].disconnect ();
   tria_1.refine_global (1);
 
-                               // avoid compiler warning
+  // avoid compiler warning
   (void)connections_2;
 }
 
index f6322426d8515eb0a9c080a404947cc7d017ab5c..e884cf1ca8513cb9261c6c7327903bac7e9ed2c3 100644 (file)
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   deallog << "FE=" << fe.get_name()
-         << std::endl;
+          << std::endl;
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (fe, quadrature, update_hessians);
 
-                                          // we used to fail here
+  // we used to fail here
   fe_values.reinit (dof.begin_active());
 
   deallog << "OK" << std::endl;
index 3dc30e6cc952eb2f8f5f3cb64602e36933fab5eb..1e15ed34cf7789e93e38f5e015525cafe72d88b3 100644 (file)
@@ -40,8 +40,8 @@
 
 
 template<int dim>
-void test (const Triangulation<dim>tr,
-          const FiniteElement<dim>& fe)
+void test (const Triangulation<dim> &tr,
+           const FiniteElement<dim> &fe)
 {
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
@@ -54,16 +54,16 @@ void test (const Triangulation<dim>& tr,
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       deallog << fe_values.shape_hessian_component (0,0,0)[i][j] << std::endl;
-  
-                                  // compare the hessian with
-                                  // itself. this fails if the
-                                  // values are NaN's which the
-                                  // Hessian consists of at the
-                                  // time this test is written
+
+  // compare the hessian with
+  // itself. this fails if the
+  // values are NaN's which the
+  // Hessian consists of at the
+  // time this test is written
   Assert (fe_values.shape_hessian_component (0,0,0)
-         ==
-         fe_values.shape_hessian_component (0,0,0),
-         ExcInternalError());
+          ==
+          fe_values.shape_hessian_component (0,0,0),
+          ExcInternalError());
 }
 
 
index 53baec7733eb1dacffe159bb1251a18f09419e43..c7c64ad3429abf11615f2e3e79bc89fa5b1e51de 100644 (file)
 
 
 bool operator == (const BlockSparsityPattern &sp1,
-                 const BlockSparsityPattern &sp2)
+                  const BlockSparsityPattern &sp2)
 {
   if (sp1.n_block_rows() != sp2.n_block_rows())
     return false;
-  
+
   if (sp1.n_block_cols() != sp2.n_block_cols())
     return false;
-  
+
   for (unsigned int i=0; i<sp1.n_block_rows(); ++i)
     for (unsigned int j=0; j<sp1.n_block_cols(); ++j)
       if (!(sp1.block(i,j) == sp2.block(i,j)))
-       return false;
-  
+        return false;
+
   return true;
 }
 
@@ -66,32 +66,32 @@ check_boundary (const DoFHandler<dim> &dof)
 {
   std::vector<types::global_dof_index> dof_to_boundary_mapping;
   DoFTools::map_dof_to_boundary_indices (dof,
-                                        dof_to_boundary_mapping);
+                                         dof_to_boundary_mapping);
 
-                                  // first way: direct generation
+  // first way: direct generation
   SparsityPattern sparsity_1(dof.n_boundary_dofs(),
-                            dof.max_couplings_between_boundary_dofs());
+                             dof.max_couplings_between_boundary_dofs());
   DoFTools::make_boundary_sparsity_pattern (dof,
-                                           dof_to_boundary_mapping,
-                                           sparsity_1);
+                                            dof_to_boundary_mapping,
+                                            sparsity_1);
   sparsity_1.compress ();
 
-                                  // second way: via a CompressedSparsityPattern
+  // second way: via a CompressedSparsityPattern
   SparsityPattern sparsity_2;
   CompressedSparsityPattern csp(dof.n_boundary_dofs());
   DoFTools::make_boundary_sparsity_pattern (dof,
-                                           dof_to_boundary_mapping,
-                                           csp);
+                                            dof_to_boundary_mapping,
+                                            csp);
   sparsity_2.copy_from (csp);
 
-                                  // the exact content of sparsity
-                                  // patterns is checked in other
-                                  // tests, so only make sure that
-                                  // sparsity_[12] are equal
+  // the exact content of sparsity
+  // patterns is checked in other
+  // tests, so only make sure that
+  // sparsity_[12] are equal
   deallog << "Check boundary"
-         << " -- "
-         << (sparsity_1 == sparsity_2 ? "ok" : "failed")
-         << std::endl;
+          << " -- "
+          << (sparsity_1 == sparsity_2 ? "ok" : "failed")
+          << std::endl;
 }
 
 
@@ -101,7 +101,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -114,10 +114,10 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FESystem<dim> element(FE_Q<dim>(1), 1,
-                       FE_Q<dim>(2), 1);
+                        FE_Q<dim>(2), 1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
@@ -125,23 +125,23 @@ check ()
   DoFTools::make_hanging_node_constraints (dof, constraints);
   constraints.close ();
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   std::vector<std::vector<bool> > mask (2, std::vector<bool>(2, false));
   mask[0][0] = mask[1][1] = true;
 
-  
+
 //--------------- Regular sparsity pattern checks -----------------
-  
-                                  // first way: directly
+
+  // first way: directly
   SparsityPattern sparsity_1 (dof.n_dofs(), dof.n_dofs());
   DoFTools::make_sparsity_pattern (dof, mask, sparsity_1);
   constraints.condense (sparsity_1);
   sparsity_1.compress ();
 
-                                  // second way: via
-                                  // CompressedSparsityPattern
+  // second way: via
+  // CompressedSparsityPattern
   SparsityPattern sparsity_2;
   CompressedSparsityPattern csp_2 (dof.n_dofs());
   DoFTools::make_sparsity_pattern (dof, mask, csp_2);
@@ -149,17 +149,17 @@ check ()
   sparsity_2.copy_from (csp_2);
 
 
-                                  // the exact content of sparsity
-                                  // patterns is checked in other
-                                  // tests, so only make sure that
-                                  // sparsity_[12] are equal
+  // the exact content of sparsity
+  // patterns is checked in other
+  // tests, so only make sure that
+  // sparsity_[12] are equal
   deallog << "Check 1:"
-         << " -- "
-         << (sparsity_1 == sparsity_2 ? "ok" : "failed")
-         << std::endl;
+          << " -- "
+          << (sparsity_1 == sparsity_2 ? "ok" : "failed")
+          << std::endl;
+
 
 
-  
 //--------------- Block sparsity pattern checks -----------------
 
   const unsigned int n  = dof.n_dofs();
@@ -192,15 +192,15 @@ check ()
   sparsity_4.copy_from (csp_4);
 
   deallog << "Check 2:"
-         << " -- "
-         << (sparsity_3 == sparsity_4 ? "ok" : "failed")
-         << std::endl;
+          << " -- "
+          << (sparsity_3 == sparsity_4 ? "ok" : "failed")
+          << std::endl;
+
 
-  
 //--------------- Sparsity pattern checks for
 //                boundary sparsity generators -----------------
 
-                                  // check boundary matrices
+  // check boundary matrices
   check_boundary (dof);
 }
 
@@ -210,7 +210,7 @@ int main ()
 {
   std::ofstream logfile ("sparsity_pattern/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 487bf452ae741902dfa793b0ed9172c77de96fbb..e4f9f9a6af8689b064a9ee9cc0c7f63c351228f2 100644 (file)
 
 
 bool operator == (const BlockSparsityPattern &sp1,
-                 const BlockSparsityPattern &sp2)
+                  const BlockSparsityPattern &sp2)
 {
   if (sp1.n_block_rows() != sp2.n_block_rows())
     return false;
-  
+
   if (sp1.n_block_cols() != sp2.n_block_cols())
     return false;
-  
+
   for (unsigned int i=0; i<sp1.n_block_rows(); ++i)
     for (unsigned int j=0; j<sp1.n_block_cols(); ++j)
       if (!(sp1.block(i,j) == sp2.block(i,j)))
-       return false;
-  
+        return false;
+
   return true;
 }
 
@@ -65,32 +65,32 @@ check_boundary (const DoFHandler<dim> &dof)
 {
   std::vector<types::global_dof_index> dof_to_boundary_mapping;
   DoFTools::map_dof_to_boundary_indices (dof,
-                                        dof_to_boundary_mapping);
+                                         dof_to_boundary_mapping);
 
-                                  // first way: direct generation
+  // first way: direct generation
   SparsityPattern sparsity_1(dof.n_boundary_dofs(),
-                            dof.max_couplings_between_boundary_dofs());
+                             dof.max_couplings_between_boundary_dofs());
   DoFTools::make_boundary_sparsity_pattern (dof,
-                                           dof_to_boundary_mapping,
-                                           sparsity_1);
+                                            dof_to_boundary_mapping,
+                                            sparsity_1);
   sparsity_1.compress ();
 
-                                  // second way: via a CompressedSparsityPattern
+  // second way: via a CompressedSparsityPattern
   SparsityPattern sparsity_2;
   CompressedSparsityPattern csp(dof.n_boundary_dofs());
   DoFTools::make_boundary_sparsity_pattern (dof,
-                                           dof_to_boundary_mapping,
-                                           csp);
+                                            dof_to_boundary_mapping,
+                                            csp);
   sparsity_2.copy_from (csp);
 
-                                  // the exact content of sparsity
-                                  // patterns is checked in other
-                                  // tests, so only make sure that
-                                  // sparsity_[12] are equal
+  // the exact content of sparsity
+  // patterns is checked in other
+  // tests, so only make sure that
+  // sparsity_[12] are equal
   deallog << "Check boundary"
-         << " -- "
-         << (sparsity_1 == sparsity_2 ? "ok" : "failed")
-         << std::endl;
+          << " -- "
+          << (sparsity_1 == sparsity_2 ? "ok" : "failed")
+          << std::endl;
 }
 
 
@@ -100,7 +100,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -113,10 +113,10 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FESystem<dim> element(FE_Q<dim>(1), 1,
-                       FE_Q<dim>(2), 1);
+                        FE_Q<dim>(2), 1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
@@ -124,23 +124,23 @@ check ()
   DoFTools::make_hanging_node_constraints (dof, constraints);
   constraints.close ();
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   std::vector<std::vector<bool> > mask (2, std::vector<bool>(2, false));
   mask[0][0] = mask[1][1] = true;
 
-  
+
 //--------------- Regular sparsity pattern checks -----------------
-  
-                                  // first way: directly
+
+  // first way: directly
   SparsityPattern sparsity_1 (dof.n_dofs(), dof.n_dofs());
   DoFTools::make_sparsity_pattern (dof, mask, sparsity_1);
   constraints.condense (sparsity_1);
   sparsity_1.compress ();
 
-                                  // second way: via
-                                  // CompressedSparsityPattern
+  // second way: via
+  // CompressedSparsityPattern
   SparsityPattern sparsity_2;
   CompressedSparsityPattern csp_2 (dof.n_dofs());
   DoFTools::make_sparsity_pattern (dof, mask, csp_2);
@@ -148,17 +148,17 @@ check ()
   sparsity_2.copy_from (csp_2);
 
 
-                                  // the exact content of sparsity
-                                  // patterns is checked in other
-                                  // tests, so only make sure that
-                                  // sparsity_[12] are equal
+  // the exact content of sparsity
+  // patterns is checked in other
+  // tests, so only make sure that
+  // sparsity_[12] are equal
   deallog << "Check 1:"
-         << " -- "
-         << (sparsity_1 == sparsity_2 ? "ok" : "failed")
-         << std::endl;
+          << " -- "
+          << (sparsity_1 == sparsity_2 ? "ok" : "failed")
+          << std::endl;
+
 
 
-  
 //--------------- Block sparsity pattern checks -----------------
 
   const unsigned int n  = dof.n_dofs();
@@ -191,15 +191,15 @@ check ()
   sparsity_4.copy_from (csp_4);
 
   deallog << "Check 2:"
-         << " -- "
-         << (sparsity_3 == sparsity_4 ? "ok" : "failed")
-         << std::endl;
+          << " -- "
+          << (sparsity_3 == sparsity_4 ? "ok" : "failed")
+          << std::endl;
+
 
-  
 //--------------- Sparsity pattern checks for
 //                boundary sparsity generators -----------------
 
-                                  // check boundary matrices
+  // check boundary matrices
   check_boundary (dof);
 }
 
@@ -209,7 +209,7 @@ int main ()
 {
   std::ofstream logfile ("sparsity_pattern_01/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 2624a3025eacf58f5da53565a6d4de0fb88114dd..0a4f66ae0ac4b771dcd0037fc21ce8267f246324 100644 (file)
 
 
 bool operator == (const BlockSparsityPattern &sp1,
-                 const BlockSparsityPattern &sp2)
+                  const BlockSparsityPattern &sp2)
 {
   if (sp1.n_block_rows() != sp2.n_block_rows())
     return false;
-  
+
   if (sp1.n_block_cols() != sp2.n_block_cols())
     return false;
-  
+
   for (unsigned int i=0; i<sp1.n_block_rows(); ++i)
     for (unsigned int j=0; j<sp1.n_block_cols(); ++j)
       if (!(sp1.block(i,j) == sp2.block(i,j)))
-       return false;
-  
+        return false;
+
   return true;
 }
 
@@ -66,32 +66,32 @@ check_boundary (const DoFHandler<dim> &dof)
 {
   std::vector<types::global_dof_index> dof_to_boundary_mapping;
   DoFTools::map_dof_to_boundary_indices (dof,
-                                        dof_to_boundary_mapping);
+                                         dof_to_boundary_mapping);
 
-                                  // first way: direct generation
+  // first way: direct generation
   SparsityPattern sparsity_1(dof.n_boundary_dofs(),
-                            dof.max_couplings_between_boundary_dofs());
+                             dof.max_couplings_between_boundary_dofs());
   DoFTools::make_boundary_sparsity_pattern (dof,
-                                           dof_to_boundary_mapping,
-                                           sparsity_1);
+                                            dof_to_boundary_mapping,
+                                            sparsity_1);
   sparsity_1.compress ();
 
-                                  // second way: via a CompressedSetSparsityPattern
+  // second way: via a CompressedSetSparsityPattern
   SparsityPattern sparsity_2;
   CompressedSetSparsityPattern csp(dof.n_boundary_dofs());
   DoFTools::make_boundary_sparsity_pattern (dof,
-                                           dof_to_boundary_mapping,
-                                           csp);
+                                            dof_to_boundary_mapping,
+                                            csp);
   sparsity_2.copy_from (csp);
 
-                                  // the exact content of sparsity
-                                  // patterns is checked in other
-                                  // tests, so only make sure that
-                                  // sparsity_[12] are equal
+  // the exact content of sparsity
+  // patterns is checked in other
+  // tests, so only make sure that
+  // sparsity_[12] are equal
   deallog << "Check boundary"
-         << " -- "
-         << (sparsity_1 == sparsity_2 ? "ok" : "failed")
-         << std::endl;
+          << " -- "
+          << (sparsity_1 == sparsity_2 ? "ok" : "failed")
+          << std::endl;
 }
 
 
@@ -101,7 +101,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -114,10 +114,10 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FESystem<dim> element(FE_Q<dim>(1), 1,
-                       FE_Q<dim>(2), 1);
+                        FE_Q<dim>(2), 1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
@@ -125,23 +125,23 @@ check ()
   DoFTools::make_hanging_node_constraints (dof, constraints);
   constraints.close ();
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   std::vector<std::vector<bool> > mask (2, std::vector<bool>(2, false));
   mask[0][0] = mask[1][1] = true;
 
-  
+
 //--------------- Regular sparsity pattern checks -----------------
-  
-                                  // first way: directly
+
+  // first way: directly
   SparsityPattern sparsity_1 (dof.n_dofs(), dof.n_dofs());
   DoFTools::make_sparsity_pattern (dof, mask, sparsity_1);
   constraints.condense (sparsity_1);
   sparsity_1.compress ();
 
-                                  // second way: via
-                                  // CompressedSetSparsityPattern
+  // second way: via
+  // CompressedSetSparsityPattern
   SparsityPattern sparsity_2;
   CompressedSetSparsityPattern csp_2 (dof.n_dofs());
   DoFTools::make_sparsity_pattern (dof, mask, csp_2);
@@ -149,17 +149,17 @@ check ()
   sparsity_2.copy_from (csp_2);
 
 
-                                  // the exact content of sparsity
-                                  // patterns is checked in other
-                                  // tests, so only make sure that
-                                  // sparsity_[12] are equal
+  // the exact content of sparsity
+  // patterns is checked in other
+  // tests, so only make sure that
+  // sparsity_[12] are equal
   deallog << "Check 1:"
-         << " -- "
-         << (sparsity_1 == sparsity_2 ? "ok" : "failed")
-         << std::endl;
+          << " -- "
+          << (sparsity_1 == sparsity_2 ? "ok" : "failed")
+          << std::endl;
+
 
 
-  
 //--------------- Block sparsity pattern checks -----------------
 
   const unsigned int n  = dof.n_dofs();
@@ -192,15 +192,15 @@ check ()
   sparsity_4.copy_from (csp_4);
 
   deallog << "Check 2:"
-         << " -- "
-         << (sparsity_3 == sparsity_4 ? "ok" : "failed")
-         << std::endl;
+          << " -- "
+          << (sparsity_3 == sparsity_4 ? "ok" : "failed")
+          << std::endl;
+
 
-  
 //--------------- Sparsity pattern checks for
 //                boundary sparsity generators -----------------
 
-                                  // check boundary matrices
+  // check boundary matrices
   check_boundary (dof);
 }
 
@@ -210,7 +210,7 @@ int main ()
 {
   std::ofstream logfile ("sparsity_pattern_01_x/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index cc9b9be1d98f25c4eb0e9b3173e1bb34ab6abf6f..afcec5d8213e958dd2b065acb4d49fa21600ea1c 100644 (file)
@@ -45,8 +45,8 @@ template <int dim>
 void
 check ()
 {
-                                  // create two different triangulations
-  Triangulation<dim> triangulation_1;  
+  // create two different triangulations
+  Triangulation<dim> triangulation_1;
   if (dim==2)
     GridGenerator::hyper_ball(triangulation_1, Point<dim>(), 1);
   else
@@ -60,7 +60,7 @@ check ()
     triangulation_1.refine_global(2);
 
 
-  Triangulation<dim> triangulation_2;  
+  Triangulation<dim> triangulation_2;
   if (dim==2)
     GridGenerator::hyper_ball(triangulation_2, Point<dim>(), 1);
   else
@@ -74,18 +74,18 @@ check ()
     triangulation_2.refine_global(2);
 
 
-  
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FESystem<dim> element(FE_Q<dim>(1), 1,
-                       FE_Q<dim>(2), 1);
+                        FE_Q<dim>(2), 1);
   DoFHandler<dim> dof_1(triangulation_1);
   DoFHandler<dim> dof_2(triangulation_2);
   dof_1.distribute_dofs(element);
   dof_2.distribute_dofs(element);
 
   SparsityPattern sparsity (dof_1.n_dofs(), dof_2.n_dofs(),
-                           std::max(dof_1.n_dofs(), dof_2.n_dofs()));
+                            std::max(dof_1.n_dofs(), dof_2.n_dofs()));
   DoFTools::make_sparsity_pattern (dof_1, dof_2, sparsity);
   sparsity.compress ();
 
@@ -98,7 +98,7 @@ int main ()
 {
   std::ofstream logfile ("sparsity_pattern_02/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 55d50c2c7c3745813dfa2e48aed2b5cecbbba5a4..0b8b2cec0b1069d119d2aecdaca6515d1a07e7eb 100644 (file)
@@ -48,8 +48,8 @@ template <int dim>
 void
 check ()
 {
-                                  // create two different triangulations
-  Triangulation<dim> triangulation_1;  
+  // create two different triangulations
+  Triangulation<dim> triangulation_1;
   if (dim==2)
     GridGenerator::hyper_ball(triangulation_1, Point<dim>(), 1);
   else
@@ -63,7 +63,7 @@ check ()
     triangulation_1.refine_global(2);
 
 
-  Triangulation<dim> triangulation_2;  
+  Triangulation<dim> triangulation_2;
   if (dim==2)
     GridGenerator::hyper_ball(triangulation_2, Point<dim>(), 1);
   else
@@ -77,18 +77,18 @@ check ()
     triangulation_2.refine_global(2);
 
 
-  
+
   FESystem<dim> element_1(FE_Q<dim>(1), 2,
-                         FE_Q<dim>(2), 1);
+                          FE_Q<dim>(2), 1);
   FESystem<dim> element_2(FE_Q<dim>(3), 1,
-                         FE_DGQ<dim>(0), 2);
+                          FE_DGQ<dim>(0), 2);
   DoFHandler<dim> dof_1(triangulation_1);
   DoFHandler<dim> dof_2(triangulation_2);
   dof_1.distribute_dofs(element_1);
   dof_2.distribute_dofs(element_2);
 
   SparsityPattern sparsity (dof_1.n_dofs(), dof_2.n_dofs(),
-                           std::max(dof_1.n_dofs(), dof_2.n_dofs()));
+                            std::max(dof_1.n_dofs(), dof_2.n_dofs()));
   DoFTools::make_sparsity_pattern (dof_1, dof_2, sparsity);
   sparsity.compress ();
 
@@ -101,7 +101,7 @@ int main ()
 {
   std::ofstream logfile ("sparsity_pattern_03/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index c18c63a66d81b10de5613105ee31ac6f0fae8481..a5e45f265a7d5178fad8b1ec8f2bc799ed907ff2 100644 (file)
@@ -49,8 +49,8 @@ template <int dim>
 void
 check ()
 {
-                                  // create two different triangulations
-  Triangulation<dim> triangulation_1;  
+  // create two different triangulations
+  Triangulation<dim> triangulation_1;
   if (dim==2)
     GridGenerator::hyper_ball(triangulation_1, Point<dim>(), 1);
   else
@@ -64,7 +64,7 @@ check ()
     triangulation_1.refine_global(2);
 
 
-  Triangulation<dim> triangulation_2;  
+  Triangulation<dim> triangulation_2;
   if (dim==2)
     GridGenerator::hyper_ball(triangulation_2, Point<dim>(), 1);
   else
@@ -79,18 +79,18 @@ check ()
   triangulation_2.refine_global(1);
 
 
-  
+
   FESystem<dim> element_1(FE_Q<dim>(1), 2,
-                         FE_Q<dim>(2), 1);
+                          FE_Q<dim>(2), 1);
   FESystem<dim> element_2(FE_Q<dim>(3), 1,
-                         FE_DGQ<dim>(0), 2);
+                          FE_DGQ<dim>(0), 2);
   DoFHandler<dim> dof_1(triangulation_1);
   DoFHandler<dim> dof_2(triangulation_2);
   dof_1.distribute_dofs(element_1);
   dof_2.distribute_dofs(element_2);
 
   SparsityPattern sparsity (dof_1.n_dofs(), dof_2.n_dofs(),
-                           std::max(dof_1.n_dofs(), dof_2.n_dofs()));
+                            std::max(dof_1.n_dofs(), dof_2.n_dofs()));
   DoFTools::make_sparsity_pattern (dof_1, dof_2, sparsity);
   sparsity.compress ();
 
@@ -103,7 +103,7 @@ int main ()
 {
   std::ofstream logfile ("sparsity_pattern_04/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 4104e88e5ea98a8859866daf987a96b7d5fcaaf3..af6b6cf0af6705d04cbe701b378f3938b40f81a8 100644 (file)
 
 
 bool operator == (const BlockSparsityPattern &sp1,
-                 const BlockSparsityPattern &sp2)
+                  const BlockSparsityPattern &sp2)
 {
   if (sp1.n_block_rows() != sp2.n_block_rows())
     return false;
-  
+
   if (sp1.n_block_cols() != sp2.n_block_cols())
     return false;
-  
+
   for (unsigned int i=0; i<sp1.n_block_rows(); ++i)
     for (unsigned int j=0; j<sp1.n_block_cols(); ++j)
       if (!(sp1.block(i,j) == sp2.block(i,j)))
-       {
-         Assert (false, ExcInternalError());
-         return false;
-       }
-  
+        {
+          Assert (false, ExcInternalError());
+          return false;
+        }
+
   return true;
 }
 
@@ -67,7 +67,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -80,10 +80,10 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FESystem<dim> element(FE_Q<dim>(1), 1,
-                       FE_Q<dim>(2), 1);
+                        FE_Q<dim>(2), 1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
@@ -93,32 +93,32 @@ check ()
 
 
 //--------------- Regular sparsity pattern checks -----------------
-  
-                                  // first way: directly
+
+  // first way: directly
   SparsityPattern sparsity_1 (dof.n_dofs(), dof.n_dofs());
   DoFTools::make_sparsity_pattern (dof, sparsity_1);
   constraints.condense (sparsity_1);
   sparsity_1.compress ();
 
-                                  // second way: via direct elimination of
-                                  // constraints
+  // second way: via direct elimination of
+  // constraints
   SparsityPattern sparsity_2;
   CompressedSparsityPattern csp_2 (dof.n_dofs());
   DoFTools::make_sparsity_pattern (dof, csp_2, constraints);
   sparsity_2.copy_from (csp_2);
 
 
-                                  // the exact content of sparsity
-                                  // patterns is checked in other
-                                  // tests, so only make sure that
-                                  // sparsity_[12] are equal
+  // the exact content of sparsity
+  // patterns is checked in other
+  // tests, so only make sure that
+  // sparsity_[12] are equal
   deallog << "Check 1:"
-         << " -- "
-         << (sparsity_1 == sparsity_2 ? "ok" : "failed")
-         << std::endl;
+          << " -- "
+          << (sparsity_1 == sparsity_2 ? "ok" : "failed")
+          << std::endl;
+
 
 
-  
 //--------------- Block sparsity pattern checks -----------------
 
   const unsigned int n  = dof.n_dofs();
@@ -150,9 +150,9 @@ check ()
   sparsity_4.copy_from (csp_4);
 
   deallog << "Check 2:"
-         << " -- "
-         << (sparsity_3 == sparsity_4 ? "ok" : "failed")
-         << std::endl;
+          << " -- "
+          << (sparsity_3 == sparsity_4 ? "ok" : "failed")
+          << std::endl;
 }
 
 
@@ -161,7 +161,7 @@ int main ()
 {
   std::ofstream logfile ("sparsity_pattern_05/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index e6d1687ce4288aacba024346101eb9348aae752b..eec60a8a6a153bebff9afd7ea30189b5a98ac5d6 100644 (file)
 
 
 bool operator == (const BlockSparsityPattern &sp1,
-                 const BlockSparsityPattern &sp2)
+                  const BlockSparsityPattern &sp2)
 {
   if (sp1.n_block_rows() != sp2.n_block_rows())
     return false;
-  
+
   if (sp1.n_block_cols() != sp2.n_block_cols())
     return false;
-  
+
   for (unsigned int i=0; i<sp1.n_block_rows(); ++i)
     for (unsigned int j=0; j<sp1.n_block_cols(); ++j)
       if (!(sp1.block(i,j) == sp2.block(i,j)))
-       {
-         Assert (false, ExcInternalError());
-         return false;
-       }
-  
+        {
+          Assert (false, ExcInternalError());
+          return false;
+        }
+
   return true;
 }
 
@@ -67,7 +67,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -80,10 +80,10 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FESystem<dim> element(FE_Q<dim>(1), 1,
-                       FE_Q<dim>(2), 1);
+                        FE_Q<dim>(2), 1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
@@ -93,32 +93,32 @@ check ()
 
 
 //--------------- Regular sparsity pattern checks -----------------
-  
-                                  // first way: directly
+
+  // first way: directly
   SparsityPattern sparsity_1 (dof.n_dofs(), dof.n_dofs());
   DoFTools::make_sparsity_pattern (dof, sparsity_1);
   constraints.condense (sparsity_1);
   sparsity_1.compress ();
 
-                                  // second way: via direct elimination of
-                                  // constraints
+  // second way: via direct elimination of
+  // constraints
   SparsityPattern sparsity_2;
   CompressedSetSparsityPattern csp_2 (dof.n_dofs());
   DoFTools::make_sparsity_pattern (dof, csp_2, constraints);
   sparsity_2.copy_from (csp_2);
 
 
-                                  // the exact content of sparsity
-                                  // patterns is checked in other
-                                  // tests, so only make sure that
-                                  // sparsity_[12] are equal
+  // the exact content of sparsity
+  // patterns is checked in other
+  // tests, so only make sure that
+  // sparsity_[12] are equal
   deallog << "Check 1:"
-         << " -- "
-         << (sparsity_1 == sparsity_2 ? "ok" : "failed")
-         << std::endl;
+          << " -- "
+          << (sparsity_1 == sparsity_2 ? "ok" : "failed")
+          << std::endl;
+
 
 
-  
 //--------------- Block sparsity pattern checks -----------------
 
   const unsigned int n  = dof.n_dofs();
@@ -150,9 +150,9 @@ check ()
   sparsity_4.copy_from (csp_4);
 
   deallog << "Check 2:"
-         << " -- "
-         << (sparsity_3 == sparsity_4 ? "ok" : "failed")
-         << std::endl;
+          << " -- "
+          << (sparsity_3 == sparsity_4 ? "ok" : "failed")
+          << std::endl;
 }
 
 
@@ -161,7 +161,7 @@ int main ()
 {
   std::ofstream logfile ("sparsity_pattern_05_x/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 5056349fc05abdf61fa6729bd9ca699368c00010..c0cbd64fbef703a534a1e8fe1f8fe1b8b3e4f894 100644 (file)
 
 
 bool operator == (const BlockSparsityPattern &sp1,
-                 const BlockSparsityPattern &sp2)
+                  const BlockSparsityPattern &sp2)
 {
   if (sp1.n_block_rows() != sp2.n_block_rows())
     return false;
-  
+
   if (sp1.n_block_cols() != sp2.n_block_cols())
     return false;
-  
+
   for (unsigned int i=0; i<sp1.n_block_rows(); ++i)
     for (unsigned int j=0; j<sp1.n_block_cols(); ++j)
       if (!(sp1.block(i,j) == sp2.block(i,j)))
-       return false;
-  
+        return false;
+
   return true;
 }
 
@@ -66,32 +66,32 @@ check_boundary (const DoFHandler<dim> &dof)
 {
   std::vector<types::global_dof_index> dof_to_boundary_mapping;
   DoFTools::map_dof_to_boundary_indices (dof,
-                                        dof_to_boundary_mapping);
+                                         dof_to_boundary_mapping);
 
-                                  // first way: direct generation
+  // first way: direct generation
   SparsityPattern sparsity_1(dof.n_boundary_dofs(),
-                            dof.max_couplings_between_boundary_dofs());
+                             dof.max_couplings_between_boundary_dofs());
   DoFTools::make_boundary_sparsity_pattern (dof,
-                                           dof_to_boundary_mapping,
-                                           sparsity_1);
+                                            dof_to_boundary_mapping,
+                                            sparsity_1);
   sparsity_1.compress ();
 
-                                  // second way: via a CompressedSetSparsityPattern
+  // second way: via a CompressedSetSparsityPattern
   SparsityPattern sparsity_2;
   CompressedSetSparsityPattern csp(dof.n_boundary_dofs());
   DoFTools::make_boundary_sparsity_pattern (dof,
-                                           dof_to_boundary_mapping,
-                                           csp);
+                                            dof_to_boundary_mapping,
+                                            csp);
   sparsity_2.copy_from (csp);
 
-                                  // the exact content of sparsity
-                                  // patterns is checked in other
-                                  // tests, so only make sure that
-                                  // sparsity_[12] are equal
+  // the exact content of sparsity
+  // patterns is checked in other
+  // tests, so only make sure that
+  // sparsity_[12] are equal
   deallog << "Check boundary"
-         << " -- "
-         << (sparsity_1 == sparsity_2 ? "ok" : "failed")
-         << std::endl;
+          << " -- "
+          << (sparsity_1 == sparsity_2 ? "ok" : "failed")
+          << std::endl;
 }
 
 
@@ -101,7 +101,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -114,10 +114,10 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FESystem<dim> element(FE_Q<dim>(1), 1,
-                       FE_Q<dim>(2), 1);
+                        FE_Q<dim>(2), 1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
@@ -125,23 +125,23 @@ check ()
   DoFTools::make_hanging_node_constraints (dof, constraints);
   constraints.close ();
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   std::vector<std::vector<bool> > mask (2, std::vector<bool>(2, false));
   mask[0][0] = mask[1][1] = true;
 
-  
+
 //--------------- Regular sparsity pattern checks -----------------
-  
-                                  // first way: directly
+
+  // first way: directly
   SparsityPattern sparsity_1 (dof.n_dofs(), dof.n_dofs());
   DoFTools::make_sparsity_pattern (dof, mask, sparsity_1);
   constraints.condense (sparsity_1);
   sparsity_1.compress ();
 
-                                  // second way: via
-                                  // CompressedSetSparsityPattern
+  // second way: via
+  // CompressedSetSparsityPattern
   SparsityPattern sparsity_2;
   CompressedSetSparsityPattern csp_2 (dof.n_dofs());
   DoFTools::make_sparsity_pattern (dof, mask, csp_2);
@@ -149,17 +149,17 @@ check ()
   sparsity_2.copy_from (csp_2);
 
 
-                                  // the exact content of sparsity
-                                  // patterns is checked in other
-                                  // tests, so only make sure that
-                                  // sparsity_[12] are equal
+  // the exact content of sparsity
+  // patterns is checked in other
+  // tests, so only make sure that
+  // sparsity_[12] are equal
   deallog << "Check 1:"
-         << " -- "
-         << (sparsity_1 == sparsity_2 ? "ok" : "failed")
-         << std::endl;
+          << " -- "
+          << (sparsity_1 == sparsity_2 ? "ok" : "failed")
+          << std::endl;
+
 
 
-  
 //--------------- Block sparsity pattern checks -----------------
 
   const unsigned int n  = dof.n_dofs();
@@ -192,15 +192,15 @@ check ()
   sparsity_4.copy_from (csp_4);
 
   deallog << "Check 2:"
-         << " -- "
-         << (sparsity_3 == sparsity_4 ? "ok" : "failed")
-         << std::endl;
+          << " -- "
+          << (sparsity_3 == sparsity_4 ? "ok" : "failed")
+          << std::endl;
+
 
-  
 //--------------- Sparsity pattern checks for
 //                boundary sparsity generators -----------------
 
-                                  // check boundary matrices
+  // check boundary matrices
   check_boundary (dof);
 }
 
@@ -210,7 +210,7 @@ int main ()
 {
   std::ofstream logfile ("sparsity_pattern_x/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 580c78ce47ae4e64a22d5e09a63e2bb71752f306..07ba176f2885d45d42ece94fbbfea0181f92fa7f 100644 (file)
 
 
 static unsigned subcells[6][4] = {{0, 1, 2, 3},
-                                 {4, 5, 6, 7},
-                                 {0, 1, 5, 4},
-                                 {1, 5, 6, 2},
-                                 {3, 2, 6, 7},
-                                 {0, 4, 7, 3}};
+  {4, 5, 6, 7},
+  {0, 1, 5, 4},
+  {1, 5, 6, 2},
+  {3, 2, 6, 7},
+  {0, 4, 7, 3}
+};
 
 
 
@@ -38,7 +39,7 @@ template <int dim>
 void test()
 {
   Assert(dim==2 || dim==3, ExcNotImplemented());
-  
+
   std::vector<Point<dim> > vertices (GeometryInfo<dim>::vertices_per_cell);
   vertices[0](0)=0;
   vertices[0](1)=0;
@@ -50,24 +51,24 @@ void test()
   vertices[3](1)=1;
   if (dim==3)
     {
-                                  // for the new numbering
+      // for the new numbering
 //       for (unsigned int i=0; i<4; ++i)
-//     {
-//       vertices[i+4]=vertices[i];
-//       vertices[i+4](2)=1;
-//     }
-                                      // for the old numbering
+//  {
+//    vertices[i+4]=vertices[i];
+//    vertices[i+4](2)=1;
+//  }
+      // for the old numbering
       for (unsigned int i=0; i<4; ++i)
-       {
-         std::swap(vertices[i](1),vertices[i](2));
-         vertices[i+4]=vertices[i];
-         vertices[i+4](1)=1;
-       }
-      
+        {
+          std::swap(vertices[i](1),vertices[i](2));
+          vertices[i+4]=vertices[i];
+          vertices[i+4](1)=1;
+        }
+
     }
 
   std::vector<CellData<dim> > cells (1);
-  for (unsigned int i=0;i<GeometryInfo<dim>::vertices_per_cell;++i)
+  for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
     cells[0].vertices[i] = i;
   cells[0].material_id = 0;
 
@@ -75,22 +76,22 @@ void test()
   if (dim==2)
     {
       subcelldata.boundary_lines.resize(GeometryInfo<dim>::faces_per_cell);
-      for(unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
-       {
-         subcelldata.boundary_lines[i].vertices[0]=i;
-         subcelldata.boundary_lines[i].vertices[1]=(i+1)%4;
-         subcelldata.boundary_lines[i].material_id=10*i+1;
-       }
+      for (unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
+        {
+          subcelldata.boundary_lines[i].vertices[0]=i;
+          subcelldata.boundary_lines[i].vertices[1]=(i+1)%4;
+          subcelldata.boundary_lines[i].material_id=10*i+1;
+        }
     }
   else if (dim==3)
     {
       subcelldata.boundary_quads.resize(GeometryInfo<dim>::faces_per_cell);
-      for(unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
-       {
-         for(unsigned int i=0; i<GeometryInfo<dim>::vertices_per_face; ++i)
-           subcelldata.boundary_quads[f].vertices[i]=subcells[f][i];
-         subcelldata.boundary_quads[f].material_id=10*f+1;
-       }
+      for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+        {
+          for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_face; ++i)
+            subcelldata.boundary_quads[f].vertices[i]=subcells[f][i];
+          subcelldata.boundary_quads[f].material_id=10*f+1;
+        }
     }
 
   Triangulation<dim> tria;
@@ -113,9 +114,9 @@ int main ()
   std::ofstream logfile("subcelldata/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  
+
   test<2>();
   test<3>();
-  
+
   return 0;
 }
index 1e0bd67b6061234229347062672b0c63de0a2691..ffab29f8a43eaee77b285629951da3131b64130b 100644 (file)
@@ -38,9 +38,9 @@ std::ofstream logfile("subdomain_ids/output");
 
 
 DeclException2 (ExcNumberMismatch,
-               int, int,
-               << "The numbers " << arg1 << " and " << arg2
-               << " should be equal, but are not.");
+                int, int,
+                << "The numbers " << arg1 << " and " << arg2
+                << " should be equal, but are not.");
 
 
 template <int dim>
@@ -50,28 +50,28 @@ void test ()
   GridGenerator::hyper_cube(tria, -1, 1);
   tria.refine_global (2);
 
-                                  // we now have a number of cells,
-                                  // flag them with some subdomain
-                                  // ids based on their position, in
-                                  // particular we take the quadrant
-                                  // (octant)
+  // we now have a number of cells,
+  // flag them with some subdomain
+  // ids based on their position, in
+  // particular we take the quadrant
+  // (octant)
   typename Triangulation<dim>::active_cell_iterator
-    cell = tria.begin_active (),
-    endc = tria.end ();
+  cell = tria.begin_active (),
+  endc = tria.end ();
   for (; cell!=endc; ++cell)
     {
       unsigned int subdomain = 0;
       for (unsigned int d=0; d<dim; ++d)
-       if (cell->center()(d) > 0)
-         subdomain |= (1<<d);
+        if (cell->center()(d) > 0)
+          subdomain |= (1<<d);
       Assert (subdomain < (1<<dim), ExcInternalError());
 
       cell->set_subdomain_id (subdomain);
     };
 
-                                  // refine twice (for 3d only once)
-                                  // and count again the numbers of
-                                  // cells in each subdomain
+  // refine twice (for 3d only once)
+  // and count again the numbers of
+  // cells in each subdomain
   tria.refine_global ((dim != 3) ? 2 : 1);
   if (true)
     {
@@ -79,45 +79,45 @@ void test ()
       endc = tria.end();
       std::vector<unsigned int> subdomain_cells(1<<dim, 0);
       for (; cell!=endc; ++cell)
-       {
-         Assert (cell->subdomain_id() < (1<<dim), ExcInternalError());
-         ++subdomain_cells[cell->subdomain_id()];
-       };
+        {
+          Assert (cell->subdomain_id() < (1<<dim), ExcInternalError());
+          ++subdomain_cells[cell->subdomain_id()];
+        };
       for (unsigned int i=0; i<(1<<dim); ++i)
-       Assert (subdomain_cells[i] == tria.n_active_cells()/(1<<dim),
-               ExcNumberMismatch(subdomain_cells[i],
-                                 tria.n_active_cells()/(1<<dim)));
+        Assert (subdomain_cells[i] == tria.n_active_cells()/(1<<dim),
+                ExcNumberMismatch(subdomain_cells[i],
+                                  tria.n_active_cells()/(1<<dim)));
       deallog << "Check 1 (dim=" << dim << ") ok" << std::endl;
     };
-  
-                                  // coarsen once and check again
+
+  // coarsen once and check again
   if (true)
     {
       cell = tria.begin_active();
       endc = tria.end();
       for (; cell!=endc; ++cell)
-       cell->set_coarsen_flag ();
+        cell->set_coarsen_flag ();
       tria.execute_coarsening_and_refinement ();
-      
+
       cell = tria.begin_active();
       endc = tria.end();
       std::vector<unsigned int> subdomain_cells(1<<dim, 0);
       for (; cell!=endc; ++cell)
-       {
-         Assert (cell->subdomain_id() < (1<<dim), ExcInternalError());
-         ++subdomain_cells[cell->subdomain_id()];
-       };
+        {
+          Assert (cell->subdomain_id() < (1<<dim), ExcInternalError());
+          ++subdomain_cells[cell->subdomain_id()];
+        };
       for (unsigned int i=0; i<(1<<dim); ++i)
-       Assert (subdomain_cells[i] == tria.n_active_cells()/(1<<dim),
-               ExcNumberMismatch(subdomain_cells[i],
-                                 tria.n_active_cells()/(1<<dim)));
+        Assert (subdomain_cells[i] == tria.n_active_cells()/(1<<dim),
+                ExcNumberMismatch(subdomain_cells[i],
+                                  tria.n_active_cells()/(1<<dim)));
       deallog << "Check 2 (dim=" << dim << ") ok" << std::endl;
     };
 
-                                  // check 3: assign DQ2 elements to
-                                  // cells and count degrees of
-                                  // freedom associated with each
-                                  // subdomain
+  // check 3: assign DQ2 elements to
+  // cells and count degrees of
+  // freedom associated with each
+  // subdomain
   if (true)
     {
       FE_DGQ<dim> fe(2);
@@ -125,28 +125,28 @@ void test ()
       dof_handler.distribute_dofs (fe);
       std::vector<bool> selected_dofs (dof_handler.n_dofs());
       for (unsigned int subdomain=0; subdomain<(1<<dim); ++subdomain)
-       {
-         DoFTools::extract_subdomain_dofs (dof_handler, subdomain,
-                                           selected_dofs);
-         Assert (static_cast<unsigned int>(std::count (selected_dofs.begin(),
-                                                       selected_dofs.end(),
-                                                       true))
-                 ==
-                 dof_handler.n_dofs() / (1<<dim),
-                 ExcNumberMismatch(std::count (selected_dofs.begin(),
-                                               selected_dofs.end(),
-                                               true),
-                                   dof_handler.n_dofs() / (1<<dim)));
-       }
-      deallog << "Check 3 (dim=" << dim << ") ok" << std::endl;      
+        {
+          DoFTools::extract_subdomain_dofs (dof_handler, subdomain,
+                                            selected_dofs);
+          Assert (static_cast<unsigned int>(std::count (selected_dofs.begin(),
+                                                        selected_dofs.end(),
+                                                        true))
+                  ==
+                  dof_handler.n_dofs() / (1<<dim),
+                  ExcNumberMismatch(std::count (selected_dofs.begin(),
+                                                selected_dofs.end(),
+                                                true),
+                                    dof_handler.n_dofs() / (1<<dim)));
+        }
+      deallog << "Check 3 (dim=" << dim << ") ok" << std::endl;
     };
 
 
-                                  // check 4: check again for
-                                  // continuous elements. note that
-                                  // the number of dofs here is
-                                  // different, since dofs can be on
-                                  // several subdomain at once
+  // check 4: check again for
+  // continuous elements. note that
+  // the number of dofs here is
+  // different, since dofs can be on
+  // several subdomain at once
   if (true)
     {
       FE_Q<dim> fe(1);
@@ -154,25 +154,25 @@ void test ()
       dof_handler.distribute_dofs (fe);
 
       const unsigned int cells_per_direction
-       = static_cast<unsigned int>(rint(std::pow(tria.n_active_cells(), 1./dim)));
-      
+        = static_cast<unsigned int>(rint(std::pow(tria.n_active_cells(), 1./dim)));
+
       std::vector<bool> selected_dofs (dof_handler.n_dofs());
       for (unsigned int subdomain=0; subdomain<(1<<dim); ++subdomain)
-       {
-         DoFTools::extract_subdomain_dofs (dof_handler, subdomain,
-                                           selected_dofs);
-         Assert (static_cast<unsigned int>(std::count (selected_dofs.begin(),
-                                                       selected_dofs.end(),
-                                                       true))
-                 ==
-                 std::pow(static_cast<double>(cells_per_direction/2+1),dim),
-                 ExcNumberMismatch(std::count (selected_dofs.begin(),
-                                               selected_dofs.end(),
-                                               true),
-                                   static_cast<unsigned int>(std::pow(static_cast<double>(
-                                     cells_per_direction/2+1),dim))));
-       }
-      deallog << "Check 4 (dim=" << dim << ") ok" << std::endl;      
+        {
+          DoFTools::extract_subdomain_dofs (dof_handler, subdomain,
+                                            selected_dofs);
+          Assert (static_cast<unsigned int>(std::count (selected_dofs.begin(),
+                                                        selected_dofs.end(),
+                                                        true))
+                  ==
+                  std::pow(static_cast<double>(cells_per_direction/2+1),dim),
+                  ExcNumberMismatch(std::count (selected_dofs.begin(),
+                                                selected_dofs.end(),
+                                                true),
+                                    static_cast<unsigned int>(std::pow(static_cast<double>(
+                                                                cells_per_direction/2+1),dim))));
+        }
+      deallog << "Check 4 (dim=" << dim << ") ok" << std::endl;
     };
 }
 
@@ -187,6 +187,6 @@ int main ()
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   return 0;
 }
index cfb3c8df628d7525406b5ae7e09441b0ca73b37f..9b680100e02d798b3d4950f42da61b7c23d4eb9f 100644 (file)
@@ -38,9 +38,9 @@ std::ofstream logfile("subdomain_on_refinement/output");
 
 
 DeclException2 (ExcNumberMismatch,
-               int, int,
-               << "The numbers " << arg1 << " and " << arg2
-               << " should be equal, but are not.");
+                int, int,
+                << "The numbers " << arg1 << " and " << arg2
+                << " should be equal, but are not.");
 
 
 template <int dim>
@@ -51,11 +51,11 @@ void test ()
   tria.begin_active()->set_subdomain_id (42);
   tria.refine_global (2);
   typename Triangulation<dim>::active_cell_iterator
-    cell = tria.begin_active (),
-    endc = tria.end ();
+  cell = tria.begin_active (),
+  endc = tria.end ();
   for (; cell!=endc; ++cell)
     Assert (cell->subdomain_id() == 42,
-           ExcInternalError());
+            ExcInternalError());
   deallog << "OK" << std::endl;
 }
 
@@ -70,6 +70,6 @@ int main ()
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   return 0;
 }
index bf1c6fe46873a5e24a94ebdb229d7edf6c99a248..e2feb65594ddfcc67c0b3cb468aeb9db477b3862 100644 (file)
@@ -37,17 +37,17 @@ class TimeStep : public TimeStepBase
 {
 public:
   TimeStep (const unsigned int time_step_number)
-  :
-  TimeStepBase(0),
-  time_step_number (time_step_number)
-    {}
+    :
+    TimeStepBase(0),
+    time_step_number (time_step_number)
+  {}
 
   virtual void end_sweep ()
-    {
-      static Threads::Mutex mutex;
-      Threads::Mutex::ScopedLock lock(mutex);
-      end_sweep_flags[time_step_number] = true;
-    }
+  {
+    static Threads::Mutex mutex;
+    Threads::Mutex::ScopedLock lock(mutex);
+    end_sweep_flags[time_step_number] = true;
+  }
 
   virtual void solve_primal_problem () {}
 
@@ -60,8 +60,8 @@ void test ()
 {
   // create time steps, more than there are likely threads on current machines
   TimeDependent td (TimeDependent::TimeSteppingData(0,0),
-                   TimeDependent::TimeSteppingData(0,0),
-                   TimeDependent::TimeSteppingData(0,0));
+                    TimeDependent::TimeSteppingData(0,0),
+                    TimeDependent::TimeSteppingData(0,0));
   const unsigned int n_time_steps = 10000;
   for (unsigned int i=0; i<n_time_steps; ++i)
     td.add_timestep (new TimeStep(i));
@@ -71,7 +71,7 @@ void test ()
 
   // make sure we have called TimeStep::end_sweep once for every time step object
   Assert (end_sweep_flags == std::vector<bool> (n_time_steps, true),
-         ExcInternalError());
+          ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
index 0ea1f4f8d947d434fdf87dcf11c387956c57af16..ad0a7b1e0e838ef2474997f35c699c21dcc397e9 100644 (file)
@@ -43,20 +43,20 @@ void test ()
   GridGenerator::hyper_cube(tria_1);
   GridGenerator::hyper_cube(tria_2);
 
-                                  // fill tria_3 with something, to
-                                  // make sure that the function we
-                                  // call later can deal with prior
-                                  // content
+  // fill tria_3 with something, to
+  // make sure that the function we
+  // call later can deal with prior
+  // content
   GridGenerator::hyper_cube(tria_3);
 
-                                  // refine once, then refine first
-                                  // cell
+  // refine once, then refine first
+  // cell
   tria_1.refine_global (1);
   tria_1.begin_active()->set_refine_flag();
   tria_1.execute_coarsening_and_refinement ();
 
-                                  // similar for second grid, but
-                                  // different cell
+  // similar for second grid, but
+  // different cell
   tria_2.refine_global (1);
   (++tria_2.begin_active())->set_refine_flag();
   tria_2.execute_coarsening_and_refinement ();
@@ -66,7 +66,7 @@ void test ()
   GridOut().write_gnuplot (tria_3, logfile);
 
   deallog << "     Total number of cells        = " << tria_3.n_cells() << std::endl
-         << "     Total number of active cells = " << tria_3.n_active_cells() << std::endl;
+          << "     Total number of active cells = " << tria_3.n_active_cells() << std::endl;
 }
 
 
@@ -77,10 +77,10 @@ int main ()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   return 0;
 }
index d7f1eab8ddf07b73b1195703c0f6d5772dcd9d4f..614d841a309ed0c0888c425cd61e658e198ae4a9 100644 (file)
  */
 template<int dim>
 void
-check_user_pointers(Triangulation<dim>tr)
+check_user_pointers(Triangulation<dim> &tr)
 {
-                                  // Check if values are the same as below
-  Triangulation<dim>p = &tr;
+  // Check if values are the same as below
+  Triangulation<dim> *p = &tr;
   for (typename Triangulation<dim>::cell_iterator it = tr.begin();
-       it != tr.end();++it)
+       it != tr.end(); ++it)
     {
       deallog << '.';
       if (it->user_pointer() != p++)
-       deallog << "Error" << std::endl;
+        deallog << "Error" << std::endl;
     }
   deallog << "cells" << std::endl;
 
-                                  // now for faces and lines. since
-                                  // we visit them multiple times,
-                                  // check only the first time around
+  // now for faces and lines. since
+  // we visit them multiple times,
+  // check only the first time around
   tr.clear_user_flags ();
   if (dim > 1)
     for (typename Triangulation<dim>::cell_iterator it = tr.begin();
-        it != tr.end();++it)
+         it != tr.end(); ++it)
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
-       if (it->face(f)->user_flag_set() == false)
-         {
-           deallog << '.';
-           if (it->face(f)->user_pointer() != p++)
-             deallog << "Error" << std::endl;
-           it->face(f)->set_user_flag();
-         }
+        if (it->face(f)->user_flag_set() == false)
+          {
+            deallog << '.';
+            if (it->face(f)->user_pointer() != p++)
+              deallog << "Error" << std::endl;
+            it->face(f)->set_user_flag();
+          }
   deallog << "faces" << std::endl;
 
   if (dim > 2)
     for (typename Triangulation<dim>::cell_iterator it = tr.begin();
-        it != tr.end();++it)
+         it != tr.end(); ++it)
       for (unsigned int l=0; l<GeometryInfo<dim>::lines_per_cell; ++l)
-       if (it->line(l)->user_flag_set() == false)
-         {
-           deallog << '.';
-           if (it->line(l)->user_pointer() != p++)
-             deallog << "Error" << std::endl;
-           it->line(l)->set_user_flag();
-         }
+        if (it->line(l)->user_flag_set() == false)
+          {
+            deallog << '.';
+            if (it->line(l)->user_pointer() != p++)
+              deallog << "Error" << std::endl;
+            it->line(l)->set_user_flag();
+          }
   deallog << "lines" << std::endl;
 }
 
@@ -86,92 +86,92 @@ check_user_pointers(Triangulation<dim>& tr)
  */
 template<int dim>
 void
-check_user_indices(Triangulation<dim>tr)
+check_user_indices(Triangulation<dim> &tr)
 {
-                                  // Check if values are the same as below
+  // Check if values are the same as below
   unsigned int p=1;
   for (typename Triangulation<dim>::cell_iterator it = tr.begin();
-       it != tr.end();++it)
+       it != tr.end(); ++it)
     {
       deallog << '.';
       if (it->user_index() != p++)
-       deallog << "Error" << std::endl;
+        deallog << "Error" << std::endl;
     }
   deallog << "cells" << std::endl;
 
-                                  // now for faces and lines. since
-                                  // we visit them multiple times,
-                                  // check only the first time around
+  // now for faces and lines. since
+  // we visit them multiple times,
+  // check only the first time around
   tr.clear_user_flags ();
   if (dim > 1)
     for (typename Triangulation<dim>::cell_iterator it = tr.begin();
-        it != tr.end();++it)
+         it != tr.end(); ++it)
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
-       if (it->face(f)->user_flag_set() == false)
-         {
-           deallog << '.';
-           if (it->face(f)->user_index() != p++)
-             deallog << "Error" << std::endl;
-           it->face(f)->set_user_flag();
-         }
+        if (it->face(f)->user_flag_set() == false)
+          {
+            deallog << '.';
+            if (it->face(f)->user_index() != p++)
+              deallog << "Error" << std::endl;
+            it->face(f)->set_user_flag();
+          }
   deallog << "faces" << std::endl;
 
   if (dim > 2)
     for (typename Triangulation<dim>::cell_iterator it = tr.begin();
-        it != tr.end();++it)
+         it != tr.end(); ++it)
       for (unsigned int l=0; l<GeometryInfo<dim>::lines_per_cell; ++l)
-       if (it->line(l)->user_flag_set() == false)
-         {
-           deallog << '.';
-           if (it->line(l)->user_index() != p++)
-             deallog << "Error" << std::endl;
-           it->line(l)->set_user_flag();
-         }
+        if (it->line(l)->user_flag_set() == false)
+          {
+            deallog << '.';
+            if (it->line(l)->user_index() != p++)
+              deallog << "Error" << std::endl;
+            it->line(l)->set_user_flag();
+          }
   deallog << "lines" << std::endl;
 }
 
 
 template<int dim>
 void
-user_pointers(Triangulation<dim>tr)
+user_pointers(Triangulation<dim> &tr)
 {
   deallog << "Pointers" << dim << 'D' << std::endl;
 
-                                  // Fill user pointers with some
-                                  // nonsense. clear them first
-  Triangulation<dim>p = &tr;
+  // Fill user pointers with some
+  // nonsense. clear them first
+  Triangulation<dim> *p = &tr;
   tr.clear_user_pointers();
   for (typename Triangulation<dim>::cell_iterator it = tr.begin();
-       it != tr.end();++it)
+       it != tr.end(); ++it)
     it->set_user_pointer(p++);
 
-                                  // we hit faces and lines more than
-                                  // once, possibly. only set them
-                                  // the first time around
+  // we hit faces and lines more than
+  // once, possibly. only set them
+  // the first time around
   tr.clear_user_flags ();
   if (dim > 1)
     for (typename Triangulation<dim>::cell_iterator it = tr.begin();
-        it != tr.end();++it)
+         it != tr.end(); ++it)
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
-       if (it->face(f)->user_flag_set() == false)
-         {
-           it->face(f)->set_user_pointer(p++);
-           it->face(f)->set_user_flag();
-         }
+        if (it->face(f)->user_flag_set() == false)
+          {
+            it->face(f)->set_user_pointer(p++);
+            it->face(f)->set_user_flag();
+          }
 
   if (dim > 2)
     for (typename Triangulation<dim>::cell_iterator it = tr.begin();
-        it != tr.end();++it)
+         it != tr.end(); ++it)
       for (unsigned int l=0; l<GeometryInfo<dim>::lines_per_cell; ++l)
-       if (it->line(l)->user_flag_set() == false)
-         {
-           it->line(l)->set_user_pointer(p++);
-           it->line(l)->set_user_flag();
-         }
+        if (it->line(l)->user_flag_set() == false)
+          {
+            it->line(l)->set_user_pointer(p++);
+            it->line(l)->set_user_flag();
+          }
 
-                                  // Check if they are still the same
+  // Check if they are still the same
   check_user_pointers(tr);
-                                  // Create two pointer index clashes here
+  // Create two pointer index clashes here
   try
     {
       tr.begin()->user_index();
@@ -182,8 +182,8 @@ user_pointers(Triangulation<dim>& tr)
   tr.begin()->user_pointer();
 
 
-                                  // Check if save and load work
-  std::vector<void*> cell_pointers(tr.n_cells());
+  // Check if save and load work
+  std::vector<void *> cell_pointers(tr.n_cells());
   deallog << "Save" << dim << 'D' << std::endl;
   tr.save_user_pointers(cell_pointers);
   tr.clear_user_data();
@@ -195,60 +195,60 @@ user_pointers(Triangulation<dim>& tr)
 
 template<int dim>
 void
-user_indices(Triangulation<dim>tr)
+user_indices(Triangulation<dim> &tr)
 {
   deallog << "Indices" << dim << 'D' << std::endl;
 
-                                  // Fill user indices with some
-                                  // nonsense. clear them first
+  // Fill user indices with some
+  // nonsense. clear them first
 
   for (typename Triangulation<dim>::cell_iterator it = tr.begin();
-       it != tr.end();++it)
+       it != tr.end(); ++it)
     {
       it->clear_user_index();
 
       if (dim > 1)
-       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
-         it->face(f)->clear_user_index();
+        for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+          it->face(f)->clear_user_index();
 
       if (dim > 2)
-       for (unsigned int l=0; l<GeometryInfo<dim>::lines_per_cell; ++l)
-         it->line(l)->clear_user_index();
+        for (unsigned int l=0; l<GeometryInfo<dim>::lines_per_cell; ++l)
+          it->line(l)->clear_user_index();
     }
 
 
   unsigned int p=1;
   for (typename Triangulation<dim>::cell_iterator it = tr.begin();
-       it != tr.end();++it)
+       it != tr.end(); ++it)
     it->set_user_index(p++);
 
-                                  // we hit faces and lines more than
-                                  // once, possibly. only set them
-                                  // the first time around
+  // we hit faces and lines more than
+  // once, possibly. only set them
+  // the first time around
   tr.clear_user_flags ();
   if (dim > 1)
     for (typename Triangulation<dim>::cell_iterator it = tr.begin();
-        it != tr.end();++it)
+         it != tr.end(); ++it)
       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
-       if (it->face(f)->user_flag_set() == false)
-         {
-           it->face(f)->set_user_index(p++);
-           it->face(f)->set_user_flag();
-         }
+        if (it->face(f)->user_flag_set() == false)
+          {
+            it->face(f)->set_user_index(p++);
+            it->face(f)->set_user_flag();
+          }
 
   if (dim > 2)
     for (typename Triangulation<dim>::cell_iterator it = tr.begin();
-        it != tr.end();++it)
+         it != tr.end(); ++it)
       for (unsigned int l=0; l<GeometryInfo<dim>::lines_per_cell; ++l)
-       if (it->line(l)->user_flag_set() == false)
-         {
-           it->line(l)->set_user_index(p++);
-           it->line(l)->set_user_flag();
-         }
+        if (it->line(l)->user_flag_set() == false)
+          {
+            it->line(l)->set_user_index(p++);
+            it->line(l)->set_user_flag();
+          }
 
-                                  // Check if they are still the same
+  // Check if they are still the same
   check_user_indices(tr);
-                                  // Create two pointer index clashes here
+  // Create two pointer index clashes here
   try
     {
       tr.begin()->user_pointer();
@@ -258,10 +258,10 @@ user_indices(Triangulation<dim>& tr)
       deallog << e.get_exc_name() << std::endl;
     }
   tr.begin()->user_index();
-  
 
 
-                                  // Check if save and load work
+
+  // Check if save and load work
   std::vector<unsigned int> indices(tr.n_cells());
   deallog << "Save" << dim << 'D' << std::endl;
   tr.save_user_indices(indices);
index 9ec53ec4caa21d08500dbe456dc1b341eb681c97..d97ab2b99d7ce7660ea5c017c93ad71f9d1b689f 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim>(2) {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square(); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      {
-       for (unsigned int d=0; d<2; ++d)
-         values(d) = value(p,d);
-      }
+public:
+  MySquareFunction () : Function<dim>(2) {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square();
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    for (unsigned int d=0; d<2; ++d)
+      values(d) = value(p,d);
+  }
 };
 
 
@@ -66,7 +68,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -77,25 +79,25 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FESystem<dim> element(FE_Q<dim>(1), 1,
-                       FE_Q<dim>(2), 1);
+                        FE_Q<dim>(2), 1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping(3);
 
   QGauss<dim-1> quadrature(3);
 
   Vector<double> rhs (dof.n_dofs());
   VectorTools::create_boundary_right_hand_side (dof, quadrature,
-                                      MySquareFunction<dim>(),
-                                      rhs);
+                                                MySquareFunction<dim>(),
+                                                rhs);
   for (unsigned int i=0; i<rhs.size(); ++i)
     deallog << rhs(i) << std::endl;
 }
@@ -106,7 +108,7 @@ int main ()
 {
   std::ofstream logfile ("vectors_boundary_rhs_01/output");
   deallog << std::setprecision (4);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index a6cefd453d0f66f5e21f80e35f468be7866235a7..371b15b4c36e1d966897d6f2d2ae2d23ea5b39e3 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim>(dim) {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square(); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      {
-       for (unsigned int d=0; d<dim; ++d)
-         values(d) = value(p,d);
-      }
+public:
+  MySquareFunction () : Function<dim>(dim) {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square();
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    for (unsigned int d=0; d<dim; ++d)
+      values(d) = value(p,d);
+  }
 };
 
 
@@ -69,7 +71,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -80,24 +82,24 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FE_RaviartThomas<dim> element(0);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping(3);
 
   QGauss<dim-1> quadrature(3);
 
   Vector<double> rhs (dof.n_dofs());
   VectorTools::create_boundary_right_hand_side (dof, quadrature,
-                                      MySquareFunction<dim>(),
-                                      rhs);
+                                                MySquareFunction<dim>(),
+                                                rhs);
   for (unsigned int i=0; i<rhs.size(); ++i)
     deallog << rhs(i) << std::endl;
 }
@@ -108,7 +110,7 @@ int main ()
 {
   std::ofstream logfile ("vectors_boundary_rhs_02/output");
   deallog << std::setprecision (4);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 1522c29ed14a0b34f5fe103a659c2a118a899494..d48b2f1a48edd4eeb112ce5e12c9373d1e06f4f1 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim>(1) {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square(); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      {
-         values(0) = value(p,0);
-      }
+public:
+  MySquareFunction () : Function<dim>(1) {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square();
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+  }
 };
 
 
@@ -67,7 +69,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -78,24 +80,24 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FE_Q<dim> element(1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping(3);
 
   QGauss<dim-1> quadrature(3);
 
   Vector<double> rhs (dof.n_dofs());
   VectorTools::create_boundary_right_hand_side (dof, quadrature,
-                                      MySquareFunction<dim>(),
-                                      rhs);
+                                                MySquareFunction<dim>(),
+                                                rhs);
   for (unsigned int i=0; i<rhs.size(); ++i)
     deallog << rhs(i) << std::endl;
 }
@@ -106,7 +108,7 @@ int main ()
 {
   std::ofstream logfile ("vectors_boundary_rhs_03/output");
   deallog << std::setprecision (4);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 5258628a410a4a2dbce48dfe7fe573247ffed208..4d49baf0907703a11676b675a3823607c746b8c2 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim>(1) {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square(); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { values(0) = value(p,0); }
+public:
+  MySquareFunction () : Function<dim>(1) {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square();
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+  }
 };
 
 
@@ -66,7 +70,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -77,22 +81,22 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FE_Q<dim> element(1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping(3);
 
   Vector<double> rhs (dof.n_dofs());
   VectorTools::create_point_source_vector (dof,
-                                          tr.begin()->center(),
-                                          rhs);
+                                           tr.begin()->center(),
+                                           rhs);
   for (unsigned int i=0; i<rhs.size(); ++i)
     deallog << rhs(i) << std::endl;
 }
@@ -103,7 +107,7 @@ int main ()
 {
   std::ofstream logfile ("vectors_point_source_01/output");
   deallog << std::setprecision (4);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index a03c2ba558dec2623cf801ed4739fdf327fadc26..546f3f6d6d617ce512e1fe7316ad801beb04a16b 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim>(2) {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square(); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { values(0) = value(p,0);
-       values(1) = value(p,1); }
+public:
+  MySquareFunction () : Function<dim>(2) {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square();
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+    values(1) = value(p,1);
+  }
 };
 
 
@@ -66,7 +70,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -77,25 +81,25 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FESystem<dim> element(FE_Q<dim>(1), 1,
-                       FE_Q<dim>(2), 1);
+                        FE_Q<dim>(2), 1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping(3);
 
   QGauss<dim> quadrature(3);
 
   Vector<double> rhs (dof.n_dofs());
   VectorTools::create_right_hand_side (dof, quadrature,
-                                      MySquareFunction<dim>(),
-                                      rhs);
+                                       MySquareFunction<dim>(),
+                                       rhs);
   for (unsigned int i=0; i<rhs.size(); ++i)
     deallog << rhs(i) << std::endl;
 }
@@ -106,7 +110,7 @@ int main ()
 {
   std::ofstream logfile ("vectors_rhs_01/output");
   deallog << std::setprecision (4);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 3c7f46626f1c30b40d946d67ea3907b7bd753d0d..078f7c671cff35e784c1862da0d689a8f07526c1 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim>(1) {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square(); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { values(0) = value(p,0); }
+public:
+  MySquareFunction () : Function<dim>(1) {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square();
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+  }
 };
 
 
@@ -66,7 +70,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -77,24 +81,24 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   FE_Q<dim> element(1);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping(3);
 
   QGauss<dim> quadrature(3);
 
   Vector<double> rhs (dof.n_dofs());
   VectorTools::create_right_hand_side (dof, quadrature,
-                                      MySquareFunction<dim>(),
-                                      rhs);
+                                       MySquareFunction<dim>(),
+                                       rhs);
   for (unsigned int i=0; i<rhs.size(); ++i)
     deallog << rhs(i) << std::endl;
 }
@@ -105,7 +109,7 @@ int main ()
 {
   std::ofstream logfile ("vectors_rhs_03/output");
   deallog << std::setprecision (4);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index c4a15b3fa98616189aca1d9657a970dccc535d83..1f7487b738548fa84cff24dfc98c851d20785120 100644 (file)
@@ -41,7 +41,7 @@ void test ()
   tria.refine_global (2);
 
   for (typename Triangulation<1,spacedim>::active_cell_iterator
-        cell = tria.begin_active();
+       cell = tria.begin_active();
        cell != tria.end(); ++cell)
     {
       deallog << "Cell: " << cell << std::endl;
index e0b1f3323f947660c8cd000961ea3ff4f1d96e1e..deea3caa904f55c18fd33c1277b09a716b882868 100644 (file)
@@ -41,7 +41,7 @@ void test ()
   tria.refine_global (2);
 
   for (typename Triangulation<1,spacedim>::active_cell_iterator
-        cell = tria.begin_active();
+       cell = tria.begin_active();
        cell != tria.end(); ++cell)
     {
       deallog << "Cell: " << cell << std::endl;
index c5f54148dbec96c2493c648da677be108cfb2bc5..7b3bdbc88600f4381feda8e926e952eef2aa5d00 100644 (file)
@@ -41,7 +41,7 @@ void test ()
   tria.refine_global (2);
 
   for (typename Triangulation<1,spacedim>::active_cell_iterator
-        cell = tria.begin_active();
+       cell = tria.begin_active();
        cell != tria.end(); ++cell)
     {
       deallog << "Cell: " << cell << std::endl;
index d8db9a99cee4173d3b4370c7c85417cd0582468a..4a79ab2f0ff0ad7db156ecdcf02d7ef302dc3a08 100644 (file)
@@ -41,7 +41,7 @@ void test ()
   tria.refine_global (2);
 
   for (typename Triangulation<1,spacedim>::active_cell_iterator
-        cell = tria.begin_active();
+       cell = tria.begin_active();
        cell != tria.end(); ++cell)
     {
       deallog << "Cell: " << cell << std::endl;
index 97b27850aaf86104732d211bb13b4ba26b904c55..21cc9d07dcd4d06cf2fb1f796f506cbf018bc179 100644 (file)
@@ -40,7 +40,7 @@ void test ()
   GridGenerator::hyper_cube (tria);
 
   FESystem<1,spacedim> fe(FE_Q<1,spacedim>(2),2,
-                         FE_Q<1,spacedim>(1),1);
+                          FE_Q<1,spacedim>(1),1);
   DoFHandler<1,spacedim> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
 
@@ -52,7 +52,7 @@ void test ()
   dof_handler.distribute_dofs (fe);
 
   for (typename DoFHandler<1,spacedim>::active_cell_iterator
-        cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell != dof_handler.end(); ++cell)
     {
       deallog << "Cell: " << cell << std::endl;
index 6313755b92e63c7aadb830d1e11f99c7a2aefbfd..e7740bcd5e4ee1dce1f2aa6b3b7c40628fa7e58f 100644 (file)
@@ -40,7 +40,7 @@ void test ()
   GridGenerator::hyper_cube (tria);
 
   FESystem<1,spacedim> fe(FE_Q<1,spacedim>(2),1,
-                         FE_Q<1,spacedim>(1),1);
+                          FE_Q<1,spacedim>(1),1);
   DoFHandler<1,spacedim> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
 
@@ -58,16 +58,16 @@ void test ()
   dof_handler.distribute_dofs (fe);
 
   for (typename DoFHandler<1,spacedim>::active_cell_iterator
-        cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell != dof_handler.end(); ++cell)
     {
       deallog << "Cell: " << cell << std::endl;
       cell->face(0)->get_dof_indices (dof_indices);
       for (unsigned int i=0; i<fe.dofs_per_face; ++i)
-       deallog << "Left vertex=" << dof_indices[i] << std::endl;
+        deallog << "Left vertex=" << dof_indices[i] << std::endl;
       cell->face(1)->get_dof_indices (dof_indices);
       for (unsigned int i=0; i<fe.dofs_per_face; ++i)
-       deallog << "Right vertex=" << dof_indices[i] << std::endl;
+        deallog << "Right vertex=" << dof_indices[i] << std::endl;
     }
 }
 
index fa99be6c87eebfa96752ee9f8e3c955254fdf049..45792256cb88386e6ba4c1ec7c3599531f8f0d6f 100644 (file)
@@ -36,8 +36,8 @@
 
 template <int spacedim>
 void print_dofs (const typename hp::DoFHandler<1,spacedim>::face_iterator &i,
-                const unsigned int fe_index,
-                const unsigned int n)
+                 const unsigned int fe_index,
+                 const unsigned int n)
 {
   std::vector<types::global_dof_index> dof_indices (n);
   i->get_dof_indices (dof_indices, fe_index);
@@ -50,7 +50,7 @@ void print_dofs (const typename hp::DoFHandler<1,spacedim>::face_iterator &i,
 
 template <int spacedim>
 void print_dofs (const typename hp::DoFHandler<1,spacedim>::cell_iterator &i,
-                const unsigned int n)
+                 const unsigned int n)
 {
   std::vector<types::global_dof_index> dof_indices (n);
   i->get_dof_indices (dof_indices);
@@ -68,9 +68,9 @@ void test ()
   GridGenerator::hyper_cube (tria);
 
   FESystem<1,spacedim> fe1(FE_Q<1,spacedim>(2),1,
-                          FE_Q<1,spacedim>(1),1);
+                           FE_Q<1,spacedim>(1),1);
   FESystem<1,spacedim> fe2(FE_Q<1,spacedim>(3),1,
-                          FE_Q<1,spacedim>(2),1);
+                           FE_Q<1,spacedim>(2),1);
   hp::FECollection<1,spacedim> fe_collection;
   fe_collection.push_back (fe1);
   fe_collection.push_back (fe2);
@@ -87,28 +87,28 @@ void test ()
   {
     unsigned int index = 0;
     for (typename hp::DoFHandler<1,spacedim>::active_cell_iterator
-          cell = dof_handler.begin_active();
-        cell != dof_handler.end(); ++cell, index = (index + 1) % fe_collection.size())
+         cell = dof_handler.begin_active();
+         cell != dof_handler.end(); ++cell, index = (index + 1) % fe_collection.size())
       cell->set_active_fe_index (index);
   }
   dof_handler.distribute_dofs (fe_collection);
 
   for (typename hp::DoFHandler<1,spacedim>::active_cell_iterator
-        cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell != dof_handler.end(); ++cell)
     {
       deallog << "Cell: " << cell
-             << ", active_fe_index=" << cell->active_fe_index()
-             << std::endl;
+              << ", active_fe_index=" << cell->active_fe_index()
+              << std::endl;
 
       print_dofs<spacedim> (cell,
-                           cell->get_fe().dofs_per_cell);
+                            cell->get_fe().dofs_per_cell);
       print_dofs<spacedim> (cell->face(0),
-                           cell->active_fe_index(),
-                           cell->get_fe().dofs_per_face);
+                            cell->active_fe_index(),
+                            cell->get_fe().dofs_per_face);
       print_dofs<spacedim> (cell->face(1),
-                           cell->active_fe_index(),
-                           cell->get_fe().dofs_per_face);
+                            cell->active_fe_index(),
+                            cell->get_fe().dofs_per_face);
     }
 }
 
index 670fa3425fe40f6928ca8c585791c8e9372c431f..86633aef9b3062227ee44154d6ff8ad6fac76465 100644 (file)
@@ -36,7 +36,7 @@ void test ()
   tria.refine_global (2);
 
   std::vector<types::boundary_id>
-    boundary_ids = tria.get_boundary_indicators ();
+  boundary_ids = tria.get_boundary_indicators ();
 
   for (unsigned int i=0; i<boundary_ids.size(); ++i)
     deallog << (int)boundary_ids[i] << std::endl;
index 1dfa679af8ef5e474cc424c72ac0d53044992475..e843a555569e96f11da824e3d4a1998a13c3efbc 100644 (file)
@@ -41,7 +41,7 @@ void test ()
 
   deallog << "n_cells = " << tria.n_active_cells() << std::endl;
   deallog << "n_boundary_ids = " << tria.get_boundary_indicators ().size()
-         << std::endl;
+          << std::endl;
 }
 
 
index 8b8ae273eb0f95ac74916afc43cb7df07bdfadb3..5b33a533a50b477301b84c513bf2f30c0347e881 100644 (file)
@@ -38,7 +38,7 @@ void test ()
   tria.begin_active()->face(1)->set_boundary_indicator(4);
 
   std::vector<types::boundary_id>
-    boundary_ids = tria.get_boundary_indicators ();
+  boundary_ids = tria.get_boundary_indicators ();
 
   for (unsigned int i=0; i<boundary_ids.size(); ++i)
     deallog << (int)boundary_ids[i] << std::endl;
index 0e9cab8d305847adf1e2134b91f9111f3b19dba9..0b518aff62e9f2c1f62fafe4edefc9cb2ece7389 100644 (file)
@@ -35,7 +35,7 @@ void test ()
   GridGenerator::hyper_cube (tria);
 
   typename Triangulation<1,spacedim>::face_iterator
-    face = tria.begin_active()->face(0);
+  face = tria.begin_active()->face(0);
 
   deallog << face << std::endl;
 }
index ebed2bb8801ea781efc6f4f4dab58943564a0590..89afe02e02b1963c2af791129bd104f1e1bc2559 100644 (file)
@@ -31,7 +31,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   if (true)
     {
index c6f9c3ca3e6205c90ee011d4013516c0b936cbf1..17b2c2f7b2b61f55dc6fb564f92279853f5f7201 100644 (file)
@@ -33,7 +33,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
@@ -46,10 +46,10 @@ void test(std::ostream& /*out*/)
     }
   catch (const typename Triangulation<dim>::DistortedCellList &distorted_cells)
     {
-                                      // ignore distorted cells
+      // ignore distorted cells
       deallog << distorted_cells.distorted_cells.size()
-             << " distorted cells after creating mesh."
-             << std::endl;
+              << " distorted cells after creating mesh."
+              << std::endl;
     }
 
   write_vtk (tr, "2d_coarse_grid_02", "1");
index 1ccfb082a903051912775cb080172d8d6abede71..1d5c75760ef759b8bd7d9961da566bffaf036a69 100644 (file)
@@ -31,7 +31,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
index bf9ce495a4f89a945b5f552951c60babcc17cbc4..1d92ba9c9590169894980503bcc158dac7af52c4 100644 (file)
@@ -30,7 +30,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
index 505979cc6edd2d76011fa7714d8be402acad8bfe..f37f5e90abcb10abcea89097d90690ddeddda271 100644 (file)
@@ -32,7 +32,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   if (true)
     {
@@ -43,8 +43,8 @@ void test(std::ostream& /*out*/)
       GridGenerator::hyper_cube(tr);
 
       deallog << "Triangulation copied back from p4est has "
-             << tr.n_active_cells()
-             << " active cells" << std::endl;
+              << tr.n_active_cells()
+              << " active cells" << std::endl;
       GridOut().write_gnuplot (tr, deallog.get_file_stream());
     }
 
@@ -58,8 +58,8 @@ void test(std::ostream& /*out*/)
       GridGenerator::hyper_ball(tr, Point<dim>(), 3.);
 
       deallog << "Triangulation copied back from p4est has "
-             << tr.n_active_cells()
-             << " active cells" << std::endl;
+              << tr.n_active_cells()
+              << " active cells" << std::endl;
       GridOut().write_gnuplot (tr, deallog.get_file_stream());
     }
 
@@ -72,8 +72,8 @@ void test(std::ostream& /*out*/)
       GridGenerator::half_hyper_ball(tr, Point<dim>(), 3.);
 
       deallog << "Triangulation copied back from p4est has "
-             << tr.n_active_cells()
-             << " active cells" << std::endl;
+              << tr.n_active_cells()
+              << " active cells" << std::endl;
       GridOut().write_gnuplot (tr, deallog.get_file_stream());
     }
 }
index f3c0b0caffb9872d71b92d2016cb2313d07d7a8c..12845d7320643b26bc34c57f97578a0e14148b89 100644 (file)
@@ -34,7 +34,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
index a6d94f753306c903d63e3f84d0fc648de9e4edf3..eaa47bc5ca7e97032cf311476e4ecdf3a4989088 100644 (file)
@@ -49,7 +49,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
   Triangulation<dim> tr2 (Triangulation<dim>::limit_level_difference_at_vertices);
@@ -61,47 +61,47 @@ void test(std::ostream& /*out*/)
   tr2.refine_global (2);
 
   Assert (tr.n_active_cells() == tr2.n_active_cells(),
-         ExcInternalError());
+          ExcInternalError());
 
 
   for (unsigned int i=0; i<15-2*dim; ++i)
     {
-                                      // refine one-fifth of cells randomly
+      // refine one-fifth of cells randomly
       std::vector<bool> flags (tr.n_active_cells(), false);
       for (unsigned int k=0; k<flags.size()/5 + 1; ++k)
-       flags[rand() % flags.size()] = true;
-                                      // make sure there's at least one that
-                                      // will be refined
+        flags[rand() % flags.size()] = true;
+      // make sure there's at least one that
+      // will be refined
       flags[0] = true;
 
       InterGridMap<Triangulation<dim> > intergrid_map;
       intergrid_map.make_mapping (tr, tr2);
 
-                                      // refine tr and tr2
+      // refine tr and tr2
       unsigned int index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active();
-          cell != tr.end(); ++cell, ++index)
-       if (flags[index])
-         {
-           cell->set_refine_flag();
-           intergrid_map[cell]->set_refine_flag();
-         }
+           cell = tr.begin_active();
+           cell != tr.end(); ++cell, ++index)
+        if (flags[index])
+          {
+            cell->set_refine_flag();
+            intergrid_map[cell]->set_refine_flag();
+          }
       Assert (index == tr.n_active_cells(), ExcInternalError());
 
-                                      // flag all other cells for coarsening
-                                      // (this should ensure that at least
-                                      // some of them will actually be
-                                      // coarsened)
+      // flag all other cells for coarsening
+      // (this should ensure that at least
+      // some of them will actually be
+      // coarsened)
       index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active();
-          cell != tr.end(); ++cell, ++index)
-       if (!flags[index])
-         {
-           cell->set_coarsen_flag();
-           intergrid_map[cell]->set_coarsen_flag();
-         }
+           cell = tr.begin_active();
+           cell != tr.end(); ++cell, ++index)
+        if (!flags[index])
+          {
+            cell->set_coarsen_flag();
+            intergrid_map[cell]->set_coarsen_flag();
+          }
 
       tr.execute_coarsening_and_refinement ();
       tr2.execute_coarsening_and_refinement ();
@@ -110,9 +110,9 @@ void test(std::ostream& /*out*/)
       deallog << std::endl;
 
       deallog << i << " Number of cells: "
-             << tr.n_active_cells() << ' '
-             << tr2.n_active_cells()
-             << std::endl;
+              << tr.n_active_cells() << ' '
+              << tr2.n_active_cells()
+              << std::endl;
       assert_tria_equal("2d_coarsening_02", tr, tr2);
     }
 }
index 73dd100cdcbda2c5b3eb9b4dae9eae2e71078bb8..f1559894e36858ff683a76e1e890f6ee28640c3c 100644 (file)
@@ -36,7 +36,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
   Triangulation<dim> tr2 (Triangulation<dim>::limit_level_difference_at_vertices);
@@ -47,14 +47,14 @@ void test(std::ostream& /*out*/)
     std::ifstream in ("../deal.II/grid_in_02/2d.xda");
     try
       {
-       gi.read_xda (in);
+        gi.read_xda (in);
       }
     catch (const typename Triangulation<dim>::DistortedCellList &distorted_cells)
       {
-                                        // ignore distorted cells
-       deallog << distorted_cells.distorted_cells.size()
-               << " distorted cells after creating mesh."
-               << std::endl;
+        // ignore distorted cells
+        deallog << distorted_cells.distorted_cells.size()
+                << " distorted cells after creating mesh."
+                << std::endl;
       }
   }
 
@@ -64,20 +64,20 @@ void test(std::ostream& /*out*/)
     std::ifstream in ("../deal.II/grid_in_02/2d.xda");
     try
       {
-       gi.read_xda (in);
+        gi.read_xda (in);
       }
     catch (const typename Triangulation<dim>::DistortedCellList &distorted_cells)
       {
-                                        // ignore distorted cells
-       deallog << distorted_cells.distorted_cells.size()
-               << " distorted cells after creating mesh."
-               << std::endl;
+        // ignore distorted cells
+        deallog << distorted_cells.distorted_cells.size()
+                << " distorted cells after creating mesh."
+                << std::endl;
       }
   }
 
   deallog << tr.n_active_cells() << ' ' << tr2.n_active_cells() << std::endl;
   Assert (tr.n_active_cells() == tr2.n_active_cells(),
-         ExcInternalError());
+          ExcInternalError());
 
   try
     {
@@ -85,10 +85,10 @@ void test(std::ostream& /*out*/)
     }
   catch (const typename Triangulation<dim>::DistortedCellList &distorted_cells)
     {
-                                      // ignore distorted cells
+      // ignore distorted cells
       deallog << distorted_cells.distorted_cells.size()
-             << " distorted cells after refining mesh."
-             << std::endl;
+              << " distorted cells after refining mesh."
+              << std::endl;
     }
 
   try
@@ -97,10 +97,10 @@ void test(std::ostream& /*out*/)
     }
   catch (const typename Triangulation<dim>::DistortedCellList &distorted_cells)
     {
-                                      // ignore distorted cells
+      // ignore distorted cells
       deallog << distorted_cells.distorted_cells.size()
-             << " distorted cells after refining mesh."
-             << std::endl;
+              << " distorted cells after refining mesh."
+              << std::endl;
     }
 
   deallog << tr.n_active_cells() << ' ' << tr2.n_active_cells() << std::endl;
@@ -108,72 +108,72 @@ void test(std::ostream& /*out*/)
 
   for (unsigned int i=0; i<1; ++i)
     {
-                                      // refine one-fifth of cells randomly
+      // refine one-fifth of cells randomly
       std::vector<bool> flags (tr.n_active_cells(), false);
       for (unsigned int k=0; k<flags.size()/5 + 1; ++k)
-       flags[rand() % flags.size()] = true;
-                                      // make sure there's at least one that
-                                      // will be refined
+        flags[rand() % flags.size()] = true;
+      // make sure there's at least one that
+      // will be refined
       flags[0] = true;
 
       InterGridMap<Triangulation<dim> > intergrid_map;
       intergrid_map.make_mapping (tr, tr2);
 
-                                      // refine tr and tr2
+      // refine tr and tr2
       unsigned int index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active();
-          cell != tr.end(); ++cell, ++index)
-       if (flags[index])
-         {
-           cell->set_refine_flag();
-           intergrid_map[cell]->set_refine_flag();
-         }
+           cell = tr.begin_active();
+           cell != tr.end(); ++cell, ++index)
+        if (flags[index])
+          {
+            cell->set_refine_flag();
+            intergrid_map[cell]->set_refine_flag();
+          }
       Assert (index == tr.n_active_cells(), ExcInternalError());
 
-                                      // flag all other cells for coarsening
-                                      // (this should ensure that at least
-                                      // some of them will actually be
-                                      // coarsened)
+      // flag all other cells for coarsening
+      // (this should ensure that at least
+      // some of them will actually be
+      // coarsened)
       index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active();
-          cell != tr.end(); ++cell, ++index)
-       if (!flags[index])
-         {
-           cell->set_coarsen_flag();
-           intergrid_map[cell]->set_coarsen_flag();
-         }
+           cell = tr.begin_active();
+           cell != tr.end(); ++cell, ++index)
+        if (!flags[index])
+          {
+            cell->set_coarsen_flag();
+            intergrid_map[cell]->set_coarsen_flag();
+          }
 
       try
-       {
-         tr.execute_coarsening_and_refinement ();
-       }
+        {
+          tr.execute_coarsening_and_refinement ();
+        }
       catch (const typename Triangulation<dim>::DistortedCellList &distorted_cells)
-       {
-                                          // ignore distorted cells
-         deallog << distorted_cells.distorted_cells.size()
-                 << " distorted cells after adaptively refining mesh."
-                 << std::endl;
-       }
+        {
+          // ignore distorted cells
+          deallog << distorted_cells.distorted_cells.size()
+                  << " distorted cells after adaptively refining mesh."
+                  << std::endl;
+        }
       try
-       {
-         tr2.execute_coarsening_and_refinement ();
-       }
+        {
+          tr2.execute_coarsening_and_refinement ();
+        }
       catch (const typename Triangulation<dim>::DistortedCellList &distorted_cells)
-       {
-                                          // ignore distorted cells
-         deallog << distorted_cells.distorted_cells.size()
-                 << " distorted cells after adaptively refining mesh."
-                 << std::endl;
-       }
+        {
+          // ignore distorted cells
+          deallog << distorted_cells.distorted_cells.size()
+                  << " distorted cells after adaptively refining mesh."
+                  << std::endl;
+        }
 
       deallog << std::endl;
 
       deallog << i << " Number of cells: "
-             << tr.n_active_cells() << ' '
-             << tr2.n_active_cells()
-             << std::endl;
+              << tr.n_active_cells() << ' '
+              << tr2.n_active_cells()
+              << std::endl;
       assert_tria_equal("2d_coarsening_03", tr, tr2);
     }
 }
index b65f85199241122dfae9287ea21b46f0f4c6e93e..151a9922ba6354e41249375c2025e8befc9550a2 100644 (file)
@@ -39,7 +39,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
   Triangulation<dim> tr2 (Triangulation<dim>::limit_level_difference_at_vertices);
@@ -51,7 +51,7 @@ void test(std::ostream& /*out*/)
   tr2.refine_global (1);
 
   Assert (tr.n_active_cells() == tr2.n_active_cells(),
-         ExcInternalError());
+          ExcInternalError());
 
 
   while (tr.n_active_cells() < 50000)
@@ -61,45 +61,45 @@ void test(std::ostream& /*out*/)
 
       std::vector<bool> flags (tr.n_active_cells(), false);
 
-                                      // refine one fifth of all cells each
-                                      // time (but at least one)
+      // refine one fifth of all cells each
+      // time (but at least one)
       for (unsigned int i=0; i<tr.n_active_cells() / 5 + 1; ++i)
-       flags[rand() % flags.size()] = true;
+        flags[rand() % flags.size()] = true;
 
-                                      // refine tr and tr2
+      // refine tr and tr2
       unsigned int index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active();
-          cell != tr.end(); ++cell, ++index)
-       if (flags[index])
-         {
-           cell->set_refine_flag();
-           intergrid_map[cell]->set_refine_flag();
-         }
+           cell = tr.begin_active();
+           cell != tr.end(); ++cell, ++index)
+        if (flags[index])
+          {
+            cell->set_refine_flag();
+            intergrid_map[cell]->set_refine_flag();
+          }
       Assert (index == tr.n_active_cells(), ExcInternalError());
 
-                                      // flag all other cells for coarsening
-                                      // (this should ensure that at least
-                                      // some of them will actually be
-                                      // coarsened)
+      // flag all other cells for coarsening
+      // (this should ensure that at least
+      // some of them will actually be
+      // coarsened)
       index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active();
-          cell != tr.end(); ++cell, ++index)
-       if (!flags[index])
-         {
-           cell->set_coarsen_flag();
-           intergrid_map[cell]->set_coarsen_flag();
-         }
+           cell = tr.begin_active();
+           cell != tr.end(); ++cell, ++index)
+        if (!flags[index])
+          {
+            cell->set_coarsen_flag();
+            intergrid_map[cell]->set_coarsen_flag();
+          }
 
 
       tr.execute_coarsening_and_refinement ();
       tr2.execute_coarsening_and_refinement ();
 
       deallog << " Number of cells: "
-             << tr.n_active_cells() << ' '
-             << tr2.n_active_cells()
-             << std::endl;
+              << tr.n_active_cells() << ' '
+              << tr2.n_active_cells()
+              << std::endl;
 
       assert_tria_equal("2d_coarsening_05", tr, tr2);
     }
index da84bcf32f2d64c987993f40c5b35be4c6bbe78d..171f823f45fb3d95252f89520db532a1ec6e23ea 100644 (file)
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   deallog << "hyper_cube" << std::endl;
 
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
-      
+
   GridGenerator::hyper_cube(tr);
   tr.refine_global (1);
   DoFHandler<dim> dofh(tr);
@@ -52,37 +52,37 @@ void test(std::ostream& /*out*/)
   static const FE_Q<dim> fe(2);
   dofh.distribute_dofs (fe);
 
-   typename
-     DoFHandler<dim>::active_cell_iterator cell
-     = dofh.begin_active();
+  typename
+  DoFHandler<dim>::active_cell_iterator cell
+    = dofh.begin_active();
+
+  const unsigned int dofs_per_cell = dofh.get_fe().dofs_per_cell;
+  std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
+
 
-   const unsigned int dofs_per_cell = dofh.get_fe().dofs_per_cell;
-   std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
+  for (; cell != dofh.end(); ++cell)
+    {
+      cell->get_dof_indices (local_dof_indices);
 
-      
-   for (; cell != dofh.end(); ++cell)
-     {
-       cell->get_dof_indices (local_dof_indices);
+      for (unsigned int i=0; i<dofs_per_cell; ++i)
+        deallog << local_dof_indices[i] << " ";
 
-       for (unsigned int i=0;i<dofs_per_cell;++i)
-       deallog << local_dof_indices[i] << " ";
+      deallog << std::endl;
+    }
 
-       deallog << std::endl;
-     }
-  
 }
 
 
 int main(int argc, char *argv[])
 {
   Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
-  
+
   std::ofstream logfile("2d_dofhandler_01/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   deallog.push("2d");
   test<2>(logfile);
   deallog.pop();
index f05b782a6b50e36d16403cab883c861a9e79b9e4..8d3f7a4f613c073a6f1b4d1ba9f58f353b92f7ed 100644 (file)
@@ -34,7 +34,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
index 40b0b3c18b0386a894b57555e33384f8750ab6b9..90cbc96fe3a2543006d7965155315358ec322eba 100644 (file)
@@ -52,7 +52,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
   Triangulation<dim> tr2 (Triangulation<dim>::limit_level_difference_at_vertices);
@@ -64,31 +64,31 @@ void test(std::ostream& /*out*/)
   tr2.refine_global (1);
 
   Assert (tr.n_active_cells() == tr2.n_active_cells(),
-         ExcInternalError());
+          ExcInternalError());
 
 
   for (unsigned int i=0; i<15-2*dim; ++i)
     {
       std::vector<bool> flags (tr.n_active_cells(), false);
       {
-       const unsigned int x = rand() % flags.size();
-       deallog << "Refining cell " << x << std::endl;
-       flags[x] = true;
+        const unsigned int x = rand() % flags.size();
+        deallog << "Refining cell " << x << std::endl;
+        flags[x] = true;
       }
 
       InterGridMap<Triangulation<dim> > intergrid_map;
       intergrid_map.make_mapping (tr, tr2);
 
-                                      // refine tr and tr2
+      // refine tr and tr2
       unsigned int index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active();
-          cell != tr.end(); ++cell, ++index)
-       if (flags[index])
-         {
-           cell->set_refine_flag();
-           intergrid_map[cell]->set_refine_flag();
-         }
+           cell = tr.begin_active();
+           cell != tr.end(); ++cell, ++index)
+        if (flags[index])
+          {
+            cell->set_refine_flag();
+            intergrid_map[cell]->set_refine_flag();
+          }
       Assert (index == tr.n_active_cells(), ExcInternalError());
       tr.execute_coarsening_and_refinement ();
       tr2.execute_coarsening_and_refinement ();
@@ -97,9 +97,9 @@ void test(std::ostream& /*out*/)
       deallog << std::endl;
 
       deallog << i << " Number of cells: "
-             << tr.n_active_cells() << ' '
-             << tr2.n_active_cells()
-             << std::endl;
+              << tr.n_active_cells() << ' '
+              << tr2.n_active_cells()
+              << std::endl;
 
       assert_tria_equal("2d_refinement_02", tr, tr2);
 
index 1f5d798b6b27a636fed1d211a5c61c2a46284a2c..6ac0edffc9cbe18d8c8c2ee47845174bf836bd79 100644 (file)
@@ -36,7 +36,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
   Triangulation<dim> tr2 (Triangulation<dim>::limit_level_difference_at_vertices);
@@ -47,14 +47,14 @@ void test(std::ostream& /*out*/)
     std::ifstream in ("../deal.II/grid_in_02/2d.xda");
     try
       {
-       gi.read_xda (in);
+        gi.read_xda (in);
       }
     catch (const typename Triangulation<dim>::DistortedCellList &distorted_cells)
       {
-                                        // ignore distorted cells
-       deallog << distorted_cells.distorted_cells.size()
-               << " distorted cells after creating mesh."
-               << std::endl;
+        // ignore distorted cells
+        deallog << distorted_cells.distorted_cells.size()
+                << " distorted cells after creating mesh."
+                << std::endl;
       }
   }
 
@@ -64,72 +64,72 @@ void test(std::ostream& /*out*/)
     std::ifstream in ("../deal.II/grid_in_02/2d.xda");
     try
       {
-       gi.read_xda (in);
+        gi.read_xda (in);
       }
     catch (const typename Triangulation<dim>::DistortedCellList &distorted_cells)
       {
-                                        // ignore distorted cells
-       deallog << distorted_cells.distorted_cells.size()
-               << " distorted cells after creating mesh."
-               << std::endl;
+        // ignore distorted cells
+        deallog << distorted_cells.distorted_cells.size()
+                << " distorted cells after creating mesh."
+                << std::endl;
       }
   }
 
   Assert (tr.n_active_cells() == tr2.n_active_cells(),
-         ExcInternalError());
+          ExcInternalError());
 
 
   for (unsigned int i=0; i<1; ++i)
     {
       std::vector<bool> flags (tr.n_active_cells());
       for (unsigned int j=0; j<flags.size(); ++j)
-       flags[j] = (rand() < 0.2*RAND_MAX);
+        flags[j] = (rand() < 0.2*RAND_MAX);
 
       InterGridMap<Triangulation<dim> > intergrid_map;
       intergrid_map.make_mapping (tr, tr2);
 
-                                      // refine tr and tr2
+      // refine tr and tr2
       unsigned int index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active();
-          cell != tr.end(); ++cell, ++index)
-       if (flags[index])
-         {
-           cell->set_refine_flag();
-           intergrid_map[cell]->set_refine_flag();
-         }
+           cell = tr.begin_active();
+           cell != tr.end(); ++cell, ++index)
+        if (flags[index])
+          {
+            cell->set_refine_flag();
+            intergrid_map[cell]->set_refine_flag();
+          }
       Assert (index == tr.n_active_cells(), ExcInternalError());
 
       try
-       {
-         tr.execute_coarsening_and_refinement ();
-       }
+        {
+          tr.execute_coarsening_and_refinement ();
+        }
       catch (const typename Triangulation<dim>::DistortedCellList &distorted_cells)
-       {
-                                          // ignore distorted cells
-         deallog << distorted_cells.distorted_cells.size()
-                 << " distorted cells after adaptively refining mesh."
-                 << std::endl;
-       }
+        {
+          // ignore distorted cells
+          deallog << distorted_cells.distorted_cells.size()
+                  << " distorted cells after adaptively refining mesh."
+                  << std::endl;
+        }
       try
-       {
-         tr2.execute_coarsening_and_refinement ();
-       }
+        {
+          tr2.execute_coarsening_and_refinement ();
+        }
       catch (const typename Triangulation<dim>::DistortedCellList &distorted_cells)
-       {
-                                          // ignore distorted cells
-         deallog << distorted_cells.distorted_cells.size()
-                 << " distorted cells after adaptively refining mesh."
-                 << std::endl;
-       }
+        {
+          // ignore distorted cells
+          deallog << distorted_cells.distorted_cells.size()
+                  << " distorted cells after adaptively refining mesh."
+                  << std::endl;
+        }
 
 //      write_vtk (tr, "2d_refinement_03", "1");
       deallog << std::endl;
 
       deallog << i << " Number of cells: "
-             << tr.n_active_cells() << ' '
-             << tr2.n_active_cells()
-             << std::endl;
+              << tr.n_active_cells() << ' '
+              << tr2.n_active_cells()
+              << std::endl;
 
       assert_tria_equal("2d_refinement_03", tr, tr2);
 
index 8b4ae9cf1fab60363377f6b1fafe9818a4c83cee..85e2fc745c3d65fd50765b439b4fd7bd5e21f1b8 100644 (file)
@@ -41,7 +41,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   for (unsigned int i=0; i<GeometryInfo<dim>::max_children_per_cell; ++i)
     {
@@ -50,27 +50,27 @@ void test(std::ostream& /*out*/)
       GridGenerator::hyper_cube(tr);
 
       deallog << i << ' ' << tr.n_active_cells()
-             << std::endl;
+              << std::endl;
 
       tr.refine_global (1);
 
       deallog << i << ' ' << tr.n_active_cells()
-             << std::endl;
+              << std::endl;
 
       Assert (tr.n_active_cells() == 4,
-             ExcInternalError());
+              ExcInternalError());
 
       typename Triangulation<dim>::active_cell_iterator
-       cell = tr.begin_active();
+      cell = tr.begin_active();
       std::advance (cell, i);
       cell->set_refine_flag();
       tr.execute_coarsening_and_refinement ();
 
       deallog << i << ' ' << tr.n_active_cells()
-             << std::endl;
+              << std::endl;
 
       Assert (tr.n_active_cells() == 7,
-             ExcInternalError());
+              ExcInternalError());
     }
 }
 
index 3d5040be3ecc8509cbb80e709178fe6701554cee..47b508f7485ed55d35738fdbe2ecf20f280c3d63 100644 (file)
@@ -40,7 +40,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
   Triangulation<dim> tr2 (Triangulation<dim>::limit_level_difference_at_vertices);
@@ -57,36 +57,36 @@ void test(std::ostream& /*out*/)
     {
       std::vector<bool> flags (tr.n_active_cells(), false);
 
-                                      // refine one fifth of all cells each
-                                      // time (but at least one)
+      // refine one fifth of all cells each
+      // time (but at least one)
       for (unsigned int i=0; i<tr.n_active_cells() / 5 + 1; ++i)
-       {
-         const unsigned int x = rand() % flags.size();
-         deallog << "Refining cell " << x << std::endl;
-         flags[x] = true;
-       }
+        {
+          const unsigned int x = rand() % flags.size();
+          deallog << "Refining cell " << x << std::endl;
+          flags[x] = true;
+        }
 
       InterGridMap<Triangulation<dim> > intergrid_map;
       intergrid_map.make_mapping (tr, tr2);
 
-                                      // refine tr and tr2
+      // refine tr and tr2
       unsigned int index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active();
-          cell != tr.end(); ++cell, ++index)
-       if (flags[index])
-         {
-           cell->set_refine_flag();
-           intergrid_map[cell]->set_refine_flag();
-         }
+           cell = tr.begin_active();
+           cell != tr.end(); ++cell, ++index)
+        if (flags[index])
+          {
+            cell->set_refine_flag();
+            intergrid_map[cell]->set_refine_flag();
+          }
       Assert (index == tr.n_active_cells(), ExcInternalError());
       tr.execute_coarsening_and_refinement ();
       tr2.execute_coarsening_and_refinement ();
 
       deallog << " Number of cells: "
-             << tr.n_active_cells() << ' '
-             << tr2.n_active_cells()
-             << std::endl;
+              << tr.n_active_cells() << ' '
+              << tr2.n_active_cells()
+              << std::endl;
 
       assert_tria_equal("2d_refinement_05", tr, tr2);
 
index 7309df46f14747fa56d8c0e3c3cd99b29d2ec5af..c0a1fe651fe30f5c92a394349e43ee4d791b5717 100644 (file)
@@ -36,7 +36,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   {
     parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
index 40b069da3539ea974a22daa541efa20d89b50350..6ee64423829c2802d46eb33b2526bfb7a8cf79d4 100644 (file)
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
   GridGenerator::hyper_cube(tr);
-  for (unsigned int i=0;i<30;++i)
+  for (unsigned int i=0; i<30; ++i)
     {
       deallog << "cells: " << tr.n_active_cells() << " level:" << tr.n_levels() << std::endl;
 
       typename parallel::distributed::Triangulation<dim>::cell_iterator it;
       it=tr.begin_active();
       while (it->level()<static_cast<int>(tr.n_levels()-1))
-       ++it;
+        ++it;
+
 
-      
       it->set_refine_flag();
       try
-       {
-         tr.execute_coarsening_and_refinement ();
-       }
+        {
+          tr.execute_coarsening_and_refinement ();
+        }
       catch (ExceptionBase &e)
-       {
-         deallog << e.get_exc_name() << std::endl;
-       }
+        {
+          deallog << e.get_exc_name() << std::endl;
+        }
     }
-  
+
 }
 
 
index a50da3d66e15b1bf9b1880d31a8df2da9790e805..090e9939a3cd2218a21460e05fefd67de3ac5a1a 100644 (file)
@@ -31,7 +31,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   if (true)
     {
index dec62669f6e757bfdaa43ddda22311744cea40ef..a5a4e6fad911327d360b34b4500fdaf3ed424be0 100644 (file)
@@ -31,7 +31,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
index e1b0f77894929c86bb9d203a13fc8e113456937a..c2e6115945ce53501bba7df29d9db151e66b6e41 100644 (file)
@@ -30,7 +30,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
index 1d5fd88b6bac7f6b8443fd7905a9262c57123854..f75fdcb61b9e117325b8c0fc6bbc2469d76479d7 100644 (file)
@@ -42,7 +42,7 @@ void create_disconnected_mesh (Triangulation<dim> &tria)
   std::vector<Point<dim> > vertices (2*GeometryInfo<dim>::vertices_per_cell);
   std::vector<CellData<dim> > cells (2);
 
-                                  // cell 1
+  // cell 1
   {
     Point<dim> p1 = Point<dim>();
     Point<dim> p2;
@@ -51,39 +51,39 @@ void create_disconnected_mesh (Triangulation<dim> &tria)
 
     switch (dim)
       {
-       case 2:
-             vertices[0] = vertices[1] = p1;
-             vertices[2] = vertices[3] = p2;
-
-             vertices[1](0) = p2(0);
-             vertices[2](0) = p1(0);
-             break;
-       case 3:
-             vertices[0] = vertices[1] = vertices[2] = vertices[3] = p1;
-             vertices[4] = vertices[5] = vertices[6] = vertices[7] = p2;
-
-             vertices[1](0) = p2(0);
-             vertices[2](1) = p2(1);
-             vertices[3](0) = p2(0);
-             vertices[3](1) = p2(1);
-
-             vertices[4](0) = p1(0);
-             vertices[4](1) = p1(1);
-             vertices[5](1) = p1(1);
-             vertices[6](0) = p1(0);
-
-             break;
-       default:
-             Assert (false, ExcNotImplemented ());
+      case 2:
+        vertices[0] = vertices[1] = p1;
+        vertices[2] = vertices[3] = p2;
+
+        vertices[1](0) = p2(0);
+        vertices[2](0) = p1(0);
+        break;
+      case 3:
+        vertices[0] = vertices[1] = vertices[2] = vertices[3] = p1;
+        vertices[4] = vertices[5] = vertices[6] = vertices[7] = p2;
+
+        vertices[1](0) = p2(0);
+        vertices[2](1) = p2(1);
+        vertices[3](0) = p2(0);
+        vertices[3](1) = p2(1);
+
+        vertices[4](0) = p1(0);
+        vertices[4](1) = p1(1);
+        vertices[5](1) = p1(1);
+        vertices[6](0) = p1(0);
+
+        break;
+      default:
+        Assert (false, ExcNotImplemented ());
       }
 
-                                    // Prepare cell data
-    for (unsigned int i=0;i<GeometryInfo<dim>::vertices_per_cell;++i)
+    // Prepare cell data
+    for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
       cells[0].vertices[i] = i;
     cells[0].material_id = 0;
   }
 
-                                  // cell 2. shifted 2 units in x-direction
+  // cell 2. shifted 2 units in x-direction
   {
     Point<dim> p1 = Point<dim>();
     Point<dim> p2;
@@ -95,34 +95,34 @@ void create_disconnected_mesh (Triangulation<dim> &tria)
 
     switch (dim)
       {
-       case 2:
-             vertices[GeometryInfo<dim>::vertices_per_cell+0] = vertices[GeometryInfo<dim>::vertices_per_cell+1] = p1;
-             vertices[GeometryInfo<dim>::vertices_per_cell+2] = vertices[GeometryInfo<dim>::vertices_per_cell+3] = p2;
-
-             vertices[GeometryInfo<dim>::vertices_per_cell+1](0) = p2(0);
-             vertices[GeometryInfo<dim>::vertices_per_cell+2](0) = p1(0);
-             break;
-       case 3:
-             vertices[GeometryInfo<dim>::vertices_per_cell+0] = vertices[GeometryInfo<dim>::vertices_per_cell+1] = vertices[GeometryInfo<dim>::vertices_per_cell+2] = vertices[GeometryInfo<dim>::vertices_per_cell+3] = p1;
-             vertices[GeometryInfo<dim>::vertices_per_cell+4] = vertices[GeometryInfo<dim>::vertices_per_cell+5] = vertices[GeometryInfo<dim>::vertices_per_cell+6] = vertices[GeometryInfo<dim>::vertices_per_cell+7] = p2;
-
-             vertices[GeometryInfo<dim>::vertices_per_cell+1](0) = p2(0);
-             vertices[GeometryInfo<dim>::vertices_per_cell+2](1) = p2(1);
-             vertices[GeometryInfo<dim>::vertices_per_cell+3](0) = p2(0);
-             vertices[GeometryInfo<dim>::vertices_per_cell+3](1) = p2(1);
-
-             vertices[GeometryInfo<dim>::vertices_per_cell+4](0) = p1(0);
-             vertices[GeometryInfo<dim>::vertices_per_cell+4](1) = p1(1);
-             vertices[GeometryInfo<dim>::vertices_per_cell+5](1) = p1(1);
-             vertices[GeometryInfo<dim>::vertices_per_cell+6](0) = p1(0);
-
-             break;
-       default:
-             Assert (false, ExcNotImplemented ());
+      case 2:
+        vertices[GeometryInfo<dim>::vertices_per_cell+0] = vertices[GeometryInfo<dim>::vertices_per_cell+1] = p1;
+        vertices[GeometryInfo<dim>::vertices_per_cell+2] = vertices[GeometryInfo<dim>::vertices_per_cell+3] = p2;
+
+        vertices[GeometryInfo<dim>::vertices_per_cell+1](0) = p2(0);
+        vertices[GeometryInfo<dim>::vertices_per_cell+2](0) = p1(0);
+        break;
+      case 3:
+        vertices[GeometryInfo<dim>::vertices_per_cell+0] = vertices[GeometryInfo<dim>::vertices_per_cell+1] = vertices[GeometryInfo<dim>::vertices_per_cell+2] = vertices[GeometryInfo<dim>::vertices_per_cell+3] = p1;
+        vertices[GeometryInfo<dim>::vertices_per_cell+4] = vertices[GeometryInfo<dim>::vertices_per_cell+5] = vertices[GeometryInfo<dim>::vertices_per_cell+6] = vertices[GeometryInfo<dim>::vertices_per_cell+7] = p2;
+
+        vertices[GeometryInfo<dim>::vertices_per_cell+1](0) = p2(0);
+        vertices[GeometryInfo<dim>::vertices_per_cell+2](1) = p2(1);
+        vertices[GeometryInfo<dim>::vertices_per_cell+3](0) = p2(0);
+        vertices[GeometryInfo<dim>::vertices_per_cell+3](1) = p2(1);
+
+        vertices[GeometryInfo<dim>::vertices_per_cell+4](0) = p1(0);
+        vertices[GeometryInfo<dim>::vertices_per_cell+4](1) = p1(1);
+        vertices[GeometryInfo<dim>::vertices_per_cell+5](1) = p1(1);
+        vertices[GeometryInfo<dim>::vertices_per_cell+6](0) = p1(0);
+
+        break;
+      default:
+        Assert (false, ExcNotImplemented ());
       }
 
-                                    // Prepare cell data
-    for (unsigned int i=0;i<GeometryInfo<dim>::vertices_per_cell;++i)
+    // Prepare cell data
+    for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
       cells[1].vertices[i] = GeometryInfo<dim>::vertices_per_cell+i;
     cells[1].material_id = 0;
   }
@@ -133,7 +133,7 @@ void create_disconnected_mesh (Triangulation<dim> &tria)
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
index 1bdd0fc5504c7c3adad4e166a7d20a3be9846c6a..03c1eeeb419357501c3678bc6211c00b3bc4793b 100644 (file)
@@ -31,7 +31,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
@@ -40,8 +40,8 @@ void test(std::ostream& /*out*/)
   gi.read ("../deal.II/grid_in_3d_02/747.ucd");
 
   deallog << "Checksum: "
-         << tr.get_checksum ()
-         << std::endl;
+          << tr.get_checksum ()
+          << std::endl;
 }
 
 
index 695c70ecb2f979bd4ca7255416b00dcd5b3d299b..da62cff4d56ac697953baf62b7bcbbb2e74e3d9d 100644 (file)
@@ -32,7 +32,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   if (true)
     {
@@ -43,8 +43,8 @@ void test(std::ostream& /*out*/)
       GridGenerator::hyper_cube(tr);
 
       deallog << "Triangulation copied back from p4est has "
-             << tr.n_active_cells()
-             << " active cells" << std::endl;
+              << tr.n_active_cells()
+              << " active cells" << std::endl;
       GridOut().write_gnuplot (tr, deallog.get_file_stream());
     }
 
@@ -58,8 +58,8 @@ void test(std::ostream& /*out*/)
       GridGenerator::hyper_ball(tr, Point<dim>(), 3.);
 
       deallog << "Triangulation copied back from p4est has "
-             << tr.n_active_cells()
-             << " active cells" << std::endl;
+              << tr.n_active_cells()
+              << " active cells" << std::endl;
       GridOut().write_gnuplot (tr, deallog.get_file_stream());
     }
 
@@ -72,8 +72,8 @@ void test(std::ostream& /*out*/)
       GridGenerator::half_hyper_ball(tr, Point<dim>(), 3.);
 
       deallog << "Triangulation copied back from p4est has "
-             << tr.n_active_cells()
-             << " active cells" << std::endl;
+              << tr.n_active_cells()
+              << " active cells" << std::endl;
       GridOut().write_gnuplot (tr, deallog.get_file_stream());
     }
 }
index 81ada4a3733aeda19f15687638a79b43ada3081e..fe03304b21d03485ccf0f8cde92a3bba4d49d905 100644 (file)
@@ -34,7 +34,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
index cc87be8aba05e397685b1fba62861f5ed09f5088..dbb63d9adb29f9632216b6ed06eac455af33fe7d 100644 (file)
@@ -49,7 +49,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
   Triangulation<dim> tr2 (Triangulation<dim>::limit_level_difference_at_vertices);
@@ -61,47 +61,47 @@ void test(std::ostream& /*out*/)
   tr2.refine_global (2);
 
   Assert (tr.n_active_cells() == tr2.n_active_cells(),
-         ExcInternalError());
+          ExcInternalError());
 
 
   for (unsigned int i=0; i<15-3*dim; ++i)
     {
-                                      // refine one-fifth of cells randomly
+      // refine one-fifth of cells randomly
       std::vector<bool> flags (tr.n_active_cells(), false);
       for (unsigned int k=0; k<flags.size()/5 + 1; ++k)
-       flags[rand() % flags.size()] = true;
-                                      // make sure there's at least one that
-                                      // will be refined
+        flags[rand() % flags.size()] = true;
+      // make sure there's at least one that
+      // will be refined
       flags[0] = true;
 
       InterGridMap<Triangulation<dim> > intergrid_map;
       intergrid_map.make_mapping (tr, tr2);
 
-                                      // refine tr and tr2
+      // refine tr and tr2
       unsigned int index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active();
-          cell != tr.end(); ++cell, ++index)
-       if (flags[index])
-         {
-           cell->set_refine_flag();
-           intergrid_map[cell]->set_refine_flag();
-         }
+           cell = tr.begin_active();
+           cell != tr.end(); ++cell, ++index)
+        if (flags[index])
+          {
+            cell->set_refine_flag();
+            intergrid_map[cell]->set_refine_flag();
+          }
       Assert (index == tr.n_active_cells(), ExcInternalError());
 
-                                      // flag all other cells for coarsening
-                                      // (this should ensure that at least
-                                      // some of them will actually be
-                                      // coarsened)
+      // flag all other cells for coarsening
+      // (this should ensure that at least
+      // some of them will actually be
+      // coarsened)
       index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active();
-          cell != tr.end(); ++cell, ++index)
-       if (!flags[index])
-         {
-           cell->set_coarsen_flag();
-           intergrid_map[cell]->set_coarsen_flag();
-         }
+           cell = tr.begin_active();
+           cell != tr.end(); ++cell, ++index)
+        if (!flags[index])
+          {
+            cell->set_coarsen_flag();
+            intergrid_map[cell]->set_coarsen_flag();
+          }
 
       tr.execute_coarsening_and_refinement ();
       tr2.execute_coarsening_and_refinement ();
@@ -110,9 +110,9 @@ void test(std::ostream& /*out*/)
       deallog << std::endl;
 
       deallog << i << " Number of cells: "
-             << tr.n_active_cells() << ' '
-             << tr2.n_active_cells()
-             << std::endl;
+              << tr.n_active_cells() << ' '
+              << tr2.n_active_cells()
+              << std::endl;
 
       assert_tria_equal("3d_coarsening_02", tr, tr2);
 
index c7f558e0b9ad00b4a19f178a1c0e32b5d7495c9e..ac0d016bc1ec00d65f188b414c809a19d6050b91 100644 (file)
@@ -36,7 +36,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
   Triangulation<dim> tr2 (Triangulation<dim>::limit_level_difference_at_vertices);
@@ -58,47 +58,47 @@ void test(std::ostream& /*out*/)
   }
 
   Assert (tr.n_active_cells() == tr2.n_active_cells(),
-         ExcInternalError());
+          ExcInternalError());
 
 
   for (unsigned int i=0; i<1; ++i)
     {
-                                      // refine one-fifth of cells randomly
+      // refine one-fifth of cells randomly
       std::vector<bool> flags (tr.n_active_cells(), false);
       for (unsigned int k=0; k<flags.size()/5 + 1; ++k)
-       flags[rand() % flags.size()] = true;
-                                      // make sure there's at least one that
-                                      // will be refined
+        flags[rand() % flags.size()] = true;
+      // make sure there's at least one that
+      // will be refined
       flags[0] = true;
 
       InterGridMap<Triangulation<dim> > intergrid_map;
       intergrid_map.make_mapping (tr, tr2);
 
-                                      // refine tr and tr2
+      // refine tr and tr2
       unsigned int index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active();
-          cell != tr.end(); ++cell, ++index)
-       if (flags[index])
-         {
-           cell->set_refine_flag();
-           intergrid_map[cell]->set_refine_flag();
-         }
+           cell = tr.begin_active();
+           cell != tr.end(); ++cell, ++index)
+        if (flags[index])
+          {
+            cell->set_refine_flag();
+            intergrid_map[cell]->set_refine_flag();
+          }
       Assert (index == tr.n_active_cells(), ExcInternalError());
 
-                                      // flag all other cells for coarsening
-                                      // (this should ensure that at least
-                                      // some of them will actually be
-                                      // coarsened)
+      // flag all other cells for coarsening
+      // (this should ensure that at least
+      // some of them will actually be
+      // coarsened)
       index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active();
-          cell != tr.end(); ++cell, ++index)
-       if (!flags[index])
-         {
-           cell->set_coarsen_flag();
-           intergrid_map[cell]->set_coarsen_flag();
-         }
+           cell = tr.begin_active();
+           cell != tr.end(); ++cell, ++index)
+        if (!flags[index])
+          {
+            cell->set_coarsen_flag();
+            intergrid_map[cell]->set_coarsen_flag();
+          }
 
       tr.execute_coarsening_and_refinement ();
       tr2.execute_coarsening_and_refinement ();
@@ -107,9 +107,9 @@ void test(std::ostream& /*out*/)
       deallog << std::endl;
 
       deallog << i << " Number of cells: "
-             << tr.n_active_cells() << ' '
-             << tr2.n_active_cells()
-             << std::endl;
+              << tr.n_active_cells() << ' '
+              << tr2.n_active_cells()
+              << std::endl;
 
       assert_tria_equal("3d_coarsening_03", tr, tr2);
 
index 3fbb0f7bee7b6deb999676738eed5a0ef0be4ea9..be1c6c2a3f9f39a2ebdfd82afd9fdd36e73712ba 100644 (file)
@@ -36,7 +36,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
   Triangulation<dim> tr2 (Triangulation<dim>::limit_level_difference_at_vertices);
@@ -46,7 +46,7 @@ void test(std::ostream& /*out*/)
     gi.attach_triangulation (tr);
     std::ifstream in ("../deal.II/grid_in_3d_02/747.ucd");
     gi.read (in);
-                                    //tr.refine_global (1);
+    //tr.refine_global (1);
   }
 
   {
@@ -54,63 +54,63 @@ void test(std::ostream& /*out*/)
     gi.attach_triangulation (tr2);
     std::ifstream in ("../deal.II/grid_in_3d_02/747.ucd");
     gi.read (in);
-                                    //tr2.refine_global (1);
+    //tr2.refine_global (1);
   }
 
   Assert (tr.n_active_cells() == tr2.n_active_cells(),
-         ExcInternalError());
-      deallog << " Number of cells: "
-             << tr.n_active_cells() << ' '
-             << tr2.n_active_cells()
-             << std::endl;
+          ExcInternalError());
+  deallog << " Number of cells: "
+          << tr.n_active_cells() << ' '
+          << tr2.n_active_cells()
+          << std::endl;
 
 
   for (unsigned int i=0; i<2; ++i)
     {
-                                      // refine one-tenth of cells randomly
+      // refine one-tenth of cells randomly
       std::vector<bool> flags (tr.n_active_cells(), false);
       for (unsigned int k=0; k<flags.size()/30 + 1; ++k)
-       flags[rand() % flags.size()] = true;
-                                      // make sure there's at least one that
-                                      // will be refined
+        flags[rand() % flags.size()] = true;
+      // make sure there's at least one that
+      // will be refined
       flags[0] = true;
 
       InterGridMap<Triangulation<dim> > intergrid_map;
       intergrid_map.make_mapping (tr, tr2);
 
-                                      // refine tr and tr2
+      // refine tr and tr2
       unsigned int index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active();
-          cell != tr.end(); ++cell, ++index)
-       if (flags[index])
-         {
-           cell->set_refine_flag();
-           intergrid_map[cell]->set_refine_flag();
-         }
+           cell = tr.begin_active();
+           cell != tr.end(); ++cell, ++index)
+        if (flags[index])
+          {
+            cell->set_refine_flag();
+            intergrid_map[cell]->set_refine_flag();
+          }
       Assert (index == tr.n_active_cells(), ExcInternalError());
 
-                                      // flag all other cells for coarsening
-                                      // (this should ensure that at least
-                                      // some of them will actually be
-                                      // coarsened)
+      // flag all other cells for coarsening
+      // (this should ensure that at least
+      // some of them will actually be
+      // coarsened)
       index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active();
-          cell != tr.end(); ++cell, ++index)
-       if (!flags[index])
-         {
-           cell->set_coarsen_flag();
-           intergrid_map[cell]->set_coarsen_flag();
-         }
+           cell = tr.begin_active();
+           cell != tr.end(); ++cell, ++index)
+        if (!flags[index])
+          {
+            cell->set_coarsen_flag();
+            intergrid_map[cell]->set_coarsen_flag();
+          }
 
       tr.execute_coarsening_and_refinement ();
       tr2.execute_coarsening_and_refinement ();
 
       deallog << i << " Number of cells: "
-             << tr.n_active_cells() << ' '
-             << tr2.n_active_cells()
-             << std::endl;
+              << tr.n_active_cells() << ' '
+              << tr2.n_active_cells()
+              << std::endl;
 
       assert_tria_equal("3d_coarsening_04", tr, tr2);
 
index b2cf2f718701debc0ae94bf3bc8c21cc434fe576..ccb18f8529ca8c6b5aa57a01eb5ce33cbf882338 100644 (file)
@@ -39,7 +39,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
   Triangulation<dim> tr2 (Triangulation<dim>::limit_level_difference_at_vertices);
@@ -51,7 +51,7 @@ void test(std::ostream& /*out*/)
   tr2.refine_global (1);
 
   Assert (tr.n_active_cells() == tr2.n_active_cells(),
-         ExcInternalError());
+          ExcInternalError());
 
 
   while (tr.n_active_cells() < 50000)
@@ -61,45 +61,45 @@ void test(std::ostream& /*out*/)
 
       std::vector<bool> flags (tr.n_active_cells(), false);
 
-                                      // refine one fifth of all cells each
-                                      // time (but at least one)
+      // refine one fifth of all cells each
+      // time (but at least one)
       for (unsigned int i=0; i<tr.n_active_cells() / 5 + 1; ++i)
-       flags[rand() % flags.size()] = true;
+        flags[rand() % flags.size()] = true;
 
-                                      // refine tr and tr2
+      // refine tr and tr2
       unsigned int index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active();
-          cell != tr.end(); ++cell, ++index)
-       if (flags[index])
-         {
-           cell->set_refine_flag();
-           intergrid_map[cell]->set_refine_flag();
-         }
+           cell = tr.begin_active();
+           cell != tr.end(); ++cell, ++index)
+        if (flags[index])
+          {
+            cell->set_refine_flag();
+            intergrid_map[cell]->set_refine_flag();
+          }
       Assert (index == tr.n_active_cells(), ExcInternalError());
 
-                                      // flag all other cells for coarsening
-                                      // (this should ensure that at least
-                                      // some of them will actually be
-                                      // coarsened)
+      // flag all other cells for coarsening
+      // (this should ensure that at least
+      // some of them will actually be
+      // coarsened)
       index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active();
-          cell != tr.end(); ++cell, ++index)
-       if (!flags[index])
-         {
-           cell->set_coarsen_flag();
-           intergrid_map[cell]->set_coarsen_flag();
-         }
+           cell = tr.begin_active();
+           cell != tr.end(); ++cell, ++index)
+        if (!flags[index])
+          {
+            cell->set_coarsen_flag();
+            intergrid_map[cell]->set_coarsen_flag();
+          }
 
 
       tr.execute_coarsening_and_refinement ();
       tr2.execute_coarsening_and_refinement ();
 
       deallog << " Number of cells: "
-             << tr.n_active_cells() << ' '
-             << tr2.n_active_cells()
-             << std::endl;
+              << tr.n_active_cells() << ' '
+              << tr2.n_active_cells()
+              << std::endl;
 
       assert_tria_equal("3d_coarsening_05", tr, tr2);
 
index 81b1c9b458a3384427820eebf8bebe2ea162dfd5..d7367f509a92500663c7e4ea50c969fb5720aedc 100644 (file)
@@ -34,7 +34,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
index 5acce43b28f8a7c769002534cb9d88d7e848df02..9a56a2bd2c33383f4f5909248ae05444ea5e46d9 100644 (file)
@@ -52,7 +52,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
   Triangulation<dim> tr2 (Triangulation<dim>::limit_level_difference_at_vertices);
@@ -64,31 +64,31 @@ void test(std::ostream& /*out*/)
   tr2.refine_global (1);
 
   Assert (tr.n_active_cells() == tr2.n_active_cells(),
-         ExcInternalError());
+          ExcInternalError());
 
 
   for (unsigned int i=0; i<15-2*dim; ++i)
     {
       std::vector<bool> flags (tr.n_active_cells(), false);
       {
-       const unsigned int x = rand() % flags.size();
-       deallog << "Refining cell " << x << std::endl;
-       flags[x] = true;
+        const unsigned int x = rand() % flags.size();
+        deallog << "Refining cell " << x << std::endl;
+        flags[x] = true;
       }
 
       InterGridMap<Triangulation<dim> > intergrid_map;
       intergrid_map.make_mapping (tr, tr2);
 
-                                      // refine tr and tr2
+      // refine tr and tr2
       unsigned int index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active();
-          cell != tr.end(); ++cell, ++index)
-       if (flags[index])
-         {
-           cell->set_refine_flag();
-           intergrid_map[cell]->set_refine_flag();
-         }
+           cell = tr.begin_active();
+           cell != tr.end(); ++cell, ++index)
+        if (flags[index])
+          {
+            cell->set_refine_flag();
+            intergrid_map[cell]->set_refine_flag();
+          }
       Assert (index == tr.n_active_cells(), ExcInternalError());
       tr.execute_coarsening_and_refinement ();
       tr2.execute_coarsening_and_refinement ();
@@ -97,9 +97,9 @@ void test(std::ostream& /*out*/)
       deallog << std::endl;
 
       deallog << i << " Number of cells: "
-             << tr.n_active_cells() << ' '
-             << tr2.n_active_cells()
-             << std::endl;
+              << tr.n_active_cells() << ' '
+              << tr2.n_active_cells()
+              << std::endl;
 
       assert_tria_equal("3d_refinement_02", tr, tr2);
 
index d6731aa653e791ae8f6e90c58644281eb69daa03..1e74d1e5abea78aa8a3c4307ab752763a9c4ce9f 100644 (file)
@@ -36,7 +36,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
   Triangulation<dim> tr2 (Triangulation<dim>::limit_level_difference_at_vertices);
@@ -56,28 +56,28 @@ void test(std::ostream& /*out*/)
   }
 
   Assert (tr.n_active_cells() == tr2.n_active_cells(),
-         ExcInternalError());
+          ExcInternalError());
 
 
   for (unsigned int i=0; i<1; ++i)
     {
       std::vector<bool> flags (tr.n_active_cells());
       for (unsigned int j=0; j<flags.size(); ++j)
-       flags[j] = (rand() < 0.2*RAND_MAX);
+        flags[j] = (rand() < 0.2*RAND_MAX);
 
       InterGridMap<Triangulation<dim> > intergrid_map;
       intergrid_map.make_mapping (tr, tr2);
 
-                                      // refine tr and tr2
+      // refine tr and tr2
       unsigned int index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active();
-          cell != tr.end(); ++cell, ++index)
-       if (flags[index])
-         {
-           cell->set_refine_flag();
-           intergrid_map[cell]->set_refine_flag();
-         }
+           cell = tr.begin_active();
+           cell != tr.end(); ++cell, ++index)
+        if (flags[index])
+          {
+            cell->set_refine_flag();
+            intergrid_map[cell]->set_refine_flag();
+          }
       Assert (index == tr.n_active_cells(), ExcInternalError());
       tr.execute_coarsening_and_refinement ();
       tr2.execute_coarsening_and_refinement ();
@@ -86,9 +86,9 @@ void test(std::ostream& /*out*/)
       deallog << std::endl;
 
       deallog << i << " Number of cells: "
-             << tr.n_active_cells() << ' '
-             << tr2.n_active_cells()
-             << std::endl;
+              << tr.n_active_cells() << ' '
+              << tr2.n_active_cells()
+              << std::endl;
 
       assert_tria_equal("3d_refinement_03", tr, tr2);
 
index 39c21ba7b39c44bfb1f19edd78570649b2894f6d..8eff960e658e79b9dc5e6bb583a8389cca4696f4 100644 (file)
@@ -41,7 +41,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   for (unsigned int i=0; i<GeometryInfo<dim>::max_children_per_cell; ++i)
     {
@@ -50,27 +50,27 @@ void test(std::ostream& /*out*/)
       GridGenerator::hyper_cube(tr);
 
       deallog << i << ' ' << tr.n_active_cells()
-             << std::endl;
+              << std::endl;
 
       tr.refine_global (1);
 
       deallog << i << ' ' << tr.n_active_cells()
-             << std::endl;
+              << std::endl;
 
       Assert (tr.n_active_cells() == 8,
-             ExcInternalError());
+              ExcInternalError());
 
       typename Triangulation<dim>::active_cell_iterator
-       cell = tr.begin_active();
+      cell = tr.begin_active();
       std::advance (cell, i);
       cell->set_refine_flag();
       tr.execute_coarsening_and_refinement ();
 
       deallog << i << ' ' << tr.n_active_cells()
-             << std::endl;
+              << std::endl;
 
       Assert (tr.n_active_cells() == 15,
-             ExcInternalError());
+              ExcInternalError());
     }
 }
 
index b39be2ee0b588df54c86abb6299dd7e89144fa07..76adb480cd8859344b6330ebdd200f84e660fae6 100644 (file)
@@ -39,7 +39,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
   Triangulation<dim> tr2 (Triangulation<dim>::limit_level_difference_at_vertices);
@@ -51,43 +51,43 @@ void test(std::ostream& /*out*/)
   tr2.refine_global (1);
 
   Assert (tr.n_active_cells() == tr2.n_active_cells(),
-         ExcInternalError());
+          ExcInternalError());
 
 
   while (tr.n_active_cells() < 50000)
     {
       std::vector<bool> flags (tr.n_active_cells(), false);
 
-                                      // refine one fifth of all cells each
-                                      // time (but at least one)
+      // refine one fifth of all cells each
+      // time (but at least one)
       for (unsigned int i=0; i<tr.n_active_cells() / 5 + 1; ++i)
-       {
-         const unsigned int x = rand() % flags.size();
-         deallog << "Refining cell " << x << std::endl;
-         flags[x] = true;
-       }
+        {
+          const unsigned int x = rand() % flags.size();
+          deallog << "Refining cell " << x << std::endl;
+          flags[x] = true;
+        }
 
       InterGridMap<Triangulation<dim> > intergrid_map;
       intergrid_map.make_mapping (tr, tr2);
 
-                                      // refine tr and tr2
+      // refine tr and tr2
       unsigned int index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active();
-          cell != tr.end(); ++cell, ++index)
-       if (flags[index])
-         {
-           cell->set_refine_flag();
-           intergrid_map[cell]->set_refine_flag();
-         }
+           cell = tr.begin_active();
+           cell != tr.end(); ++cell, ++index)
+        if (flags[index])
+          {
+            cell->set_refine_flag();
+            intergrid_map[cell]->set_refine_flag();
+          }
       Assert (index == tr.n_active_cells(), ExcInternalError());
       tr.execute_coarsening_and_refinement ();
       tr2.execute_coarsening_and_refinement ();
 
       deallog << " Number of cells: "
-             << tr.n_active_cells() << ' '
-             << tr2.n_active_cells()
-             << std::endl;
+              << tr.n_active_cells() << ' '
+              << tr2.n_active_cells()
+              << std::endl;
 
       assert_tria_equal("3d_refinement_05", tr, tr2);
 
index 450ffae6a6e28da230280a5d0adc5467d341af68..d4621d59b16a7942a9e1700309d877b4056bf373 100644 (file)
@@ -39,7 +39,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   {
     parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
@@ -50,11 +50,11 @@ void test(std::ostream& /*out*/)
     tr.begin_active()->set_refine_flag();
     tr.execute_coarsening_and_refinement ();
 
-                                    // for better visibility, refine
-                                    // all children of the sole
-                                    // level-1 cell once more. this
-                                    // will introduce more level-1
-                                    // cells as well.
+    // for better visibility, refine
+    // all children of the sole
+    // level-1 cell once more. this
+    // will introduce more level-1
+    // cells as well.
     for (unsigned int c=0; c<8; ++c)
       tr.begin(1)->child(c)->set_refine_flag();
     tr.execute_coarsening_and_refinement ();
index c8703f218b113e192cf48f588318e19eb4c89766..e3d6e9f0c0c820c8c5cb70c09f1f2345d963c372 100644 (file)
@@ -36,7 +36,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   {
     parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
index 09127c99b5a2cc3be42d391bdebbb651e7eb9ed5..1da2a64e8c893e3857a95490a6ab9ff31687e154 100644 (file)
@@ -36,7 +36,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
   Triangulation<dim> tr2 (Triangulation<dim>::limit_level_difference_at_vertices);
@@ -59,37 +59,37 @@ void test(std::ostream& /*out*/)
     {
       std::vector<bool> flags (tr.n_active_cells(), false);
 
-                                      // refine one tenth of all cells each
-                                      // time (but at least one)
+      // refine one tenth of all cells each
+      // time (but at least one)
       deallog << "Refining cells: ";
       for (unsigned int i=0; i<tr.n_active_cells() / 10 + 1; ++i)
-       {
-         const unsigned int x = rand() % flags.size();
-         deallog << x << std::endl;
-         flags[x] = true;
-       }
+        {
+          const unsigned int x = rand() % flags.size();
+          deallog << x << std::endl;
+          flags[x] = true;
+        }
 
       InterGridMap<Triangulation<dim> > intergrid_map;
       intergrid_map.make_mapping (tr, tr2);
 
-                                      // refine tr and tr2
+      // refine tr and tr2
       unsigned int index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active();
-          cell != tr.end(); ++cell, ++index)
-       if (flags[index])
-         {
-           cell->set_refine_flag();
-           intergrid_map[cell]->set_refine_flag();
-         }
+           cell = tr.begin_active();
+           cell != tr.end(); ++cell, ++index)
+        if (flags[index])
+          {
+            cell->set_refine_flag();
+            intergrid_map[cell]->set_refine_flag();
+          }
       Assert (index == tr.n_active_cells(), ExcInternalError());
       tr.execute_coarsening_and_refinement ();
       tr2.execute_coarsening_and_refinement ();
 
       deallog << " Number of cells: "
-             << tr.n_active_cells() << ' '
-             << tr2.n_active_cells()
-             << std::endl;
+              << tr.n_active_cells() << ' '
+              << tr2.n_active_cells()
+              << std::endl;
 
       assert_tria_equal("3d_refinement_08", tr, tr2);
 
index 3becddd6f3dfa855ec6d53813e8cde4cd7bccc71..b22509e38334a5f31eb2003b4fe092eb8be05c7b 100644 (file)
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
   GridGenerator::hyper_cube(tr);
-  for (unsigned int i=0;i<19;++i)
+  for (unsigned int i=0; i<19; ++i)
     {
       deallog << "cells: " << tr.n_active_cells() << " level:" << tr.n_levels() << std::endl;
 
       typename parallel::distributed::Triangulation<dim>::cell_iterator it;
       it=tr.begin_active();
       while (it->level()<static_cast<int>(i))
-       ++it;
+        ++it;
+
 
-      
       it->set_refine_flag();
       try
-       {
-         tr.execute_coarsening_and_refinement ();
-       }
+        {
+          tr.execute_coarsening_and_refinement ();
+        }
       catch (ExceptionBase &e)
-       {
-         deallog << e.get_exc_name() << std::endl;
-       }
+        {
+          deallog << e.get_exc_name() << std::endl;
+        }
     }
-  
+
 }
 
 
index 9692117cba01d0fa41486111e677fcb209b94590..1a8de77f576dc94499cf4e7534f0cb46085a3383 100644 (file)
@@ -33,7 +33,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
@@ -49,7 +49,7 @@ void test(std::ostream& /*out*/)
     {
       deallog << e.get_exc_name() << std::endl;
     }
-  
+
 }
 
 
index 481c137a04349d3c204b07a2b50f84f20d5d99dd..c8613cb1c5c8478c7f36f5fb235b7257eb67f968 100644 (file)
 
 template <int dim>
 void write_vtk (const parallel::distributed::Triangulation<dim> &tria,
-               const char *                               dirname,
-               const char *                               filename)
+                const char                                *dirname,
+                const char                                *filename)
 {
   deallog << "Checksum: "
-         << tria.get_checksum ()
-         << std::endl;
+          << tria.get_checksum ()
+          << std::endl;
 
   chdir (dirname);
   tria.write_mesh_vtk (filename);
 
-                                  // copy the .pvtu and .vtu files
-                                  // into the logstream
+  // copy the .pvtu and .vtu files
+  // into the logstream
   {
     std::ifstream in((std::string(filename) + ".pvtu").c_str());
     while (in)
       {
-       std::string s;
-       std::getline(in, s);
-       deallog.get_file_stream() << s << "\n";
+        std::string s;
+        std::getline(in, s);
+        deallog.get_file_stream() << s << "\n";
       }
   }
 
@@ -51,9 +51,9 @@ void write_vtk (const parallel::distributed::Triangulation<dim> &tria,
     std::ifstream in((std::string(filename) + "_0000.vtu").c_str());
     while (in)
       {
-       std::string s;
-       std::getline(in, s);
-       deallog.get_file_stream() << s << "\n";
+        std::string s;
+        std::getline(in, s);
+        deallog.get_file_stream() << s << "\n";
       }
   }
 
@@ -62,10 +62,10 @@ void write_vtk (const parallel::distributed::Triangulation<dim> &tria,
 
 
 template <int dim>
-void assert_tria_equal(const char* testdir, const Triangulation<dim> & a, const Triangulation<dim> & b)
+void assert_tria_equal(const char *testdir, const Triangulation<dim> &a, const Triangulation<dim> &b)
 {
   Assert (a.n_active_cells() == b.n_active_cells(),
-             ExcInternalError());
+          ExcInternalError());
 
   std::string file1=std::string(testdir)+"/tmp_grid1";
   std::string file2=std::string(testdir)+"/tmp_grid2";
@@ -78,11 +78,11 @@ void assert_tria_equal(const char* testdir, const Triangulation<dim> & a, const
   out1.close();
   out2.close();
 
-                                  //compare the two files
+  //compare the two files
   std::string cmd = std::string("diff -q ")+file1+std::string(" ")+file2;
   Assert (system(cmd.c_str()) == 0, ExcInternalError());
 
-                                  //and delete them
+  //and delete them
   std::remove (file1.c_str());
   std::remove (file2.c_str());
 }
index 7121e53b92e815c459537e33b8f81ba9db6d43f3..bf046470f77f208def3e0660f07082f17cb9309e 100644 (file)
@@ -43,11 +43,11 @@ template<int dim>
 void test()
 {
   parallel::distributed::Triangulation<dim>
-    triangulation (MPI_COMM_WORLD,
-                  Triangulation<dim>::limit_level_difference_at_vertices);
+  triangulation (MPI_COMM_WORLD,
+                 Triangulation<dim>::limit_level_difference_at_vertices);
 
   FESystem<dim> fe (FE_Q<dim>(3),2,
-                   FE_DGQ<dim>(1),1);
+                    FE_DGQ<dim>(1),1);
 
   DoFHandler<dim> dof_handler (triangulation);
 
@@ -57,33 +57,33 @@ void test()
   const unsigned int n_refinements[] = { 0, 4, 3, 2 };
   for (unsigned int i=0; i<n_refinements[dim]; ++i)
     {
-                                      // refine one-fifth of cells randomly
+      // refine one-fifth of cells randomly
       std::vector<bool> flags (triangulation.n_active_cells(), false);
       for (unsigned int k=0; k<flags.size()/5 + 1; ++k)
-       flags[rand() % flags.size()] = true;
-                                      // make sure there's at least one that
-                                      // will be refined
+        flags[rand() % flags.size()] = true;
+      // make sure there's at least one that
+      // will be refined
       flags[0] = true;
 
-                                      // refine triangulation
+      // refine triangulation
       unsigned int index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = triangulation.begin_active();
-          cell != triangulation.end(); ++cell, ++index)
-       if (flags[index])
-         cell->set_refine_flag();
+           cell = triangulation.begin_active();
+           cell != triangulation.end(); ++cell, ++index)
+        if (flags[index])
+          cell->set_refine_flag();
       Assert (index == triangulation.n_active_cells(), ExcInternalError());
 
-                                      // flag all other cells for coarsening
-                                      // (this should ensure that at least
-                                      // some of them will actually be
-                                      // coarsened)
+      // flag all other cells for coarsening
+      // (this should ensure that at least
+      // some of them will actually be
+      // coarsened)
       index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = triangulation.begin_active();
-          cell != triangulation.end(); ++cell, ++index)
-       if (!flags[index])
-         cell->set_coarsen_flag();
+           cell = triangulation.begin_active();
+           cell != triangulation.end(); ++cell, ++index)
+        if (!flags[index])
+          cell->set_coarsen_flag();
 
       triangulation.execute_coarsening_and_refinement ();
       dof_handler.distribute_dofs (fe);
@@ -92,17 +92,17 @@ void test()
       DoFTools::count_dofs_per_block (dof_handler, dofs_per_block);
 
       Assert (std::accumulate (dofs_per_block.begin(), dofs_per_block.end(), 0U)
-             == dof_handler.n_dofs(),
-             ExcInternalError());
-      
+              == dof_handler.n_dofs(),
+              ExcInternalError());
+
       unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
       if (myid == 0)
-       {
-         deallog << "Total number of dofs: " << dof_handler.n_dofs() << std::endl;
-         for (unsigned int i=0; i<dofs_per_block.size(); ++i)
-           deallog << "Block " << i << " has " << dofs_per_block[i] << " global dofs"
-                   << std::endl;
-       }
+        {
+          deallog << "Total number of dofs: " << dof_handler.n_dofs() << std::endl;
+          for (unsigned int i=0; i<dofs_per_block.size(); ++i)
+            deallog << "Block " << i << " has " << dofs_per_block[i] << " global dofs"
+                    << std::endl;
+        }
     }
 }
 
index e96f01d1361b40b27adfb7d6de4736e1c9ae3dfc..3e2f72a513cc8ef130419c0d6f37e5921e2cee62 100644 (file)
@@ -43,11 +43,11 @@ template<int dim>
 void test()
 {
   parallel::distributed::Triangulation<dim>
-    triangulation (MPI_COMM_WORLD,
-                  Triangulation<dim>::limit_level_difference_at_vertices);
+  triangulation (MPI_COMM_WORLD,
+                 Triangulation<dim>::limit_level_difference_at_vertices);
 
   FESystem<dim> fe (FE_Q<dim>(3),2,
-                   FE_DGQ<dim>(1),1);
+                    FE_DGQ<dim>(1),1);
 
   DoFHandler<dim> dof_handler (triangulation);
 
@@ -59,16 +59,16 @@ void test()
   DoFTools::count_dofs_per_component (dof_handler, dofs_per_component);
 
   Assert (std::accumulate (dofs_per_component.begin(), dofs_per_component.end(), 0U)
-         == dof_handler.n_dofs(),
-         ExcInternalError());
-      
+          == dof_handler.n_dofs(),
+          ExcInternalError());
+
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
   if (myid == 0)
     {
       deallog << "Total number of dofs: " << dof_handler.n_dofs() << std::endl;
       for (unsigned int i=0; i<dofs_per_component.size(); ++i)
-       deallog << "Block " << i << " has " << dofs_per_component[i] << " global dofs"
-               << std::endl;
+        deallog << "Block " << i << " has " << dofs_per_component[i] << " global dofs"
+                << std::endl;
     }
 }
 
index acd616d7ad5cbae230f935109ab5c4121f905248..3bf1631e9877fe1efc81e90b07a307df23ef2f90 100644 (file)
@@ -44,11 +44,11 @@ template<int dim>
 void test()
 {
   parallel::distributed::Triangulation<dim>
-    triangulation (MPI_COMM_WORLD,
-                  Triangulation<dim>::limit_level_difference_at_vertices);
+  triangulation (MPI_COMM_WORLD,
+                 Triangulation<dim>::limit_level_difference_at_vertices);
 
   FESystem<dim> fe (FE_Q<dim>(3),2,
-                   FE_DGQ<dim>(1),1);
+                    FE_DGQ<dim>(1),1);
 
   DoFHandler<dim> dof_handler (triangulation);
 
@@ -58,33 +58,33 @@ void test()
   const unsigned int n_refinements[] = { 0, 4, 3, 2 };
   for (unsigned int i=0; i<n_refinements[dim]; ++i)
     {
-                                      // refine one-fifth of cells randomly
+      // refine one-fifth of cells randomly
       std::vector<bool> flags (triangulation.n_active_cells(), false);
       for (unsigned int k=0; k<flags.size()/5 + 1; ++k)
-       flags[rand() % flags.size()] = true;
-                                      // make sure there's at least one that
-                                      // will be refined
+        flags[rand() % flags.size()] = true;
+      // make sure there's at least one that
+      // will be refined
       flags[0] = true;
 
-                                      // refine triangulation
+      // refine triangulation
       unsigned int index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = triangulation.begin_active();
-          cell != triangulation.end(); ++cell, ++index)
-       if (flags[index])
-         cell->set_refine_flag();
+           cell = triangulation.begin_active();
+           cell != triangulation.end(); ++cell, ++index)
+        if (flags[index])
+          cell->set_refine_flag();
       Assert (index == triangulation.n_active_cells(), ExcInternalError());
 
-                                      // flag all other cells for coarsening
-                                      // (this should ensure that at least
-                                      // some of them will actually be
-                                      // coarsened)
+      // flag all other cells for coarsening
+      // (this should ensure that at least
+      // some of them will actually be
+      // coarsened)
       index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = triangulation.begin_active();
-          cell != triangulation.end(); ++cell, ++index)
-       if (!flags[index])
-         cell->set_coarsen_flag();
+           cell = triangulation.begin_active();
+           cell != triangulation.end(); ++cell, ++index)
+        if (!flags[index])
+          cell->set_coarsen_flag();
 
       triangulation.execute_coarsening_and_refinement ();
       dof_handler.distribute_dofs (fe);
@@ -96,15 +96,15 @@ void test()
       all.add_range (0, N);
 
       Assert (dof_handler.n_locally_owned_dofs() == N,
-             ExcInternalError());
+              ExcInternalError());
       Assert (dof_handler.locally_owned_dofs() == all,
-             ExcInternalError());
+              ExcInternalError());
       Assert (dof_handler.n_locally_owned_dofs_per_processor() ==
-             std::vector<types::global_dof_index> (1,N),
-             ExcInternalError());
+              std::vector<types::global_dof_index> (1,N),
+              ExcInternalError());
       Assert (dof_handler.locally_owned_dofs_per_processor() ==
-             std::vector<IndexSet>(1,all),
-             ExcInternalError());
+              std::vector<IndexSet>(1,all),
+              ExcInternalError());
     }
 }
 
index 4ae5d646cdc228a361fcb09289eb327cc484d07c..0c23ecebb3e9fabc6c8aaf4fbdf4cb741e80b1c5 100644 (file)
@@ -40,7 +40,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
@@ -53,8 +53,8 @@ void test(std::ostream& /*out*/)
   parallel::distributed::SolutionTransfer<dim, Vector<double> > soltrans(dofh);
 
   for (typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active();
-          cell != tr.end(); ++cell)
+       cell = tr.begin_active();
+       cell != tr.end(); ++cell)
     {
       cell->set_refine_flag();
     }
index 5de8f95526dd729981751cd415f06c064f84894d..fd54ee7c14f706c72458893167ef1a70b0ebd415 100644 (file)
 template<int dim>
 class MyFunction : public Function<dim>
 {
-  public:
-    MyFunction () : Function<dim>() {};
-
-    virtual double value (const Point<dim>   &p,
-                          const unsigned int) const
-      { double f=p[0]*2.0+1.0;
-        if (dim>1)
-          f*=p[1]*3.3-1.0;
-        if (dim>2)
-          f*=p[2]*5.0;
-        return f;
-      };
+public:
+  MyFunction () : Function<dim>() {};
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int) const
+  {
+    double f=p[0]*2.0+1.0;
+    if (dim>1)
+      f*=p[1]*3.3-1.0;
+    if (dim>2)
+      f*=p[2]*5.0;
+    return f;
+  };
 };
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   MyFunction<dim> func;
   MappingQ1<dim> mapping;
@@ -75,8 +76,8 @@ void test(std::ostream& /*out*/)
   parallel::distributed::SolutionTransfer<dim, Vector<double> > soltrans(dofh);
 
   for (typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active();
-          cell != tr.end(); ++cell)
+       cell = tr.begin_active();
+       cell != tr.end(); ++cell)
     {
       cell->set_refine_flag();
     }
@@ -85,9 +86,9 @@ void test(std::ostream& /*out*/)
 
   Vector<double> solution(dofh.n_dofs());
   VectorTools::interpolate (mapping,
-                           * static_cast<dealii::DoFHandler<dim>* >(&dofh),
-                           func,
-                           solution);
+                            * static_cast<dealii::DoFHandler<dim>* >(&dofh),
+                            func,
+                            solution);
 
   soltrans.prepare_for_coarsening_and_refinement(solution);
 
@@ -102,13 +103,13 @@ void test(std::ostream& /*out*/)
   Vector<double> difference(tr.n_global_active_cells());
 
   VectorTools::integrate_difference(mapping,
-                                   dofh,
-                                   interpolated_solution,
-                                   func,
-                                   difference,
-                                   QGauss<dim>(2),
-                                   VectorTools::L2_norm);
-   deallog << "error: " << difference.l2_norm() << std::endl;
+                                    dofh,
+                                    interpolated_solution,
+                                    func,
+                                    difference,
+                                    QGauss<dim>(2),
+                                    VectorTools::L2_norm);
+  deallog << "error: " << difference.l2_norm() << std::endl;
 
 }
 
index 3fd35e9a7054acec8d8ff425c99f55eb0da13ee5..a424e388b40431f16663b386e07f9b62df07b818 100644 (file)
 template<int dim>
 class MyFunction : public Function<dim>
 {
-  public:
-    MyFunction () : Function<dim>() {};
-
-    virtual double value (const Point<dim>   &p,
-                          const unsigned int) const
-      { double f=p[0]*2.0+1.0;
-        if (dim>1)
-          f*=p[1]*3.3-1.0;
-        if (dim>2)
-          f*=p[2]*5.0;
-        return f;
-      };
+public:
+  MyFunction () : Function<dim>() {};
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int) const
+  {
+    double f=p[0]*2.0+1.0;
+    if (dim>1)
+      f*=p[1]*3.3-1.0;
+    if (dim>2)
+      f*=p[2]*5.0;
+    return f;
+  };
 };
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   MyFunction<dim> func;
   MappingQ1<dim> mapping;
@@ -77,47 +78,47 @@ void test(std::ostream& /*out*/)
 
   parallel::distributed::SolutionTransfer<dim, Vector<double> > soltrans(dofh);
 
-  for (int i=0;i<4;++i)
+  for (int i=0; i<4; ++i)
     {
 
       for (typename Triangulation<dim>::cell_iterator
-            cell = tr.begin();
-          cell != tr.end(); ++cell)
-       {
-         if (cell->has_children() && !(rand() % 3))
-           for (unsigned int c=0;c<GeometryInfo<dim>::max_children_per_cell; ++c)
-             if (!cell->child(c)->has_children())
-               cell->child(c)->set_coarsen_flag();
-       }
+           cell = tr.begin();
+           cell != tr.end(); ++cell)
+        {
+          if (cell->has_children() && !(rand() % 3))
+            for (unsigned int c=0; c<GeometryInfo<dim>::max_children_per_cell; ++c)
+              if (!cell->child(c)->has_children())
+                cell->child(c)->set_coarsen_flag();
+        }
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active();
-          cell != tr.end(); ++cell)
-       {
-         if (!(rand() % 3))
-           {
-             cell->clear_coarsen_flag();
-             cell->set_refine_flag();
-           }
+           cell = tr.begin_active();
+           cell != tr.end(); ++cell)
+        {
+          if (!(rand() % 3))
+            {
+              cell->clear_coarsen_flag();
+              cell->set_refine_flag();
+            }
 
-       }
+        }
 
       tr.prepare_coarsening_and_refinement();
 
       Vector<double> solution(dofh.n_dofs());
       VectorTools::interpolate (mapping,
-                               * static_cast<dealii::DoFHandler<dim>* >(&dofh),
-                               func,
-                               solution);
+                                * static_cast<dealii::DoFHandler<dim>* >(&dofh),
+                                func,
+                                solution);
 
       soltrans.prepare_for_coarsening_and_refinement(solution);
 
       tr.execute_coarsening_and_refinement ();
       if (0)
-       {
-         std::ofstream out ("grid-1.eps");
-         GridOut grid_out;
-         grid_out.write_eps (tr, out);
-       }
+        {
+          std::ofstream out ("grid-1.eps");
+          GridOut grid_out;
+          grid_out.write_eps (tr, out);
+        }
 
       dofh.distribute_dofs (fe);
 
@@ -128,12 +129,12 @@ void test(std::ostream& /*out*/)
       Vector<double> difference(tr.n_global_active_cells());
 
       VectorTools::integrate_difference(mapping,
-                                       dofh,
-                                       interpolated_solution,
-                                       func,
-                                       difference,
-                                       QGauss<dim>(2),
-                                       VectorTools::L2_norm);
+                                        dofh,
+                                        interpolated_solution,
+                                        func,
+                                        difference,
+                                        QGauss<dim>(2),
+                                        VectorTools::L2_norm);
       deallog << "error: " << difference.l2_norm() << std::endl;
     }
 
@@ -161,5 +162,5 @@ int main(int argc, char *argv[])
   deallog.push("3d");
   test<3>(logfile);
   deallog.pop();
-  
+
 }
index 7e6b9a3a5d11bd153ee8a5368ace26b8f14dcf4f..869c7ea9cb724a955a93999d974352b2478d4e41 100644 (file)
@@ -40,7 +40,7 @@
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
@@ -54,8 +54,8 @@ void test(std::ostream& /*out*/)
   parallel::distributed::SolutionTransfer<dim, Vector<double> > soltrans2(dofh);
 
   for (typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active();
-          cell != tr.end(); ++cell)
+       cell = tr.begin_active();
+       cell != tr.end(); ++cell)
     {
       cell->set_refine_flag();
     }
index 904901aadb4a19045d127253714ace1e0bc29560..ba026f68f5045f8f2de4fd159c77d187f04b8beb 100644 (file)
 
 
 template <class TRIA>
-void check (TRIA & tr)
+void check (TRIA &tr)
 {
   typename TRIA::cell_iterator cell = tr.begin(),
-        endc = tr.end();
-  
+                               endc = tr.end();
+
   for (; cell!=endc; ++cell)
     {
       deallog << cell->level_subdomain_id() << " ";
       try
-       {
-         deallog << cell->subdomain_id();
-       }
+        {
+          deallog << cell->subdomain_id();
+        }
       catch (...)
-       {
-         deallog << ".";
-         
-       }
+        {
+          deallog << ".";
+
+        }
       deallog << std::endl;
     }
-  
+
   deallog << "OK" << std::endl;
 }
 
 
-int main (int argc, char *argv[]) 
+int main (int argc, char *argv[])
 {
   deal_II_exceptions::disable_abort_on_exception();
 
@@ -80,5 +80,5 @@ int main (int argc, char *argv[])
   check(tria2);
 }
 
-  
-  
+
+
index de0feea9303ea7f2d8eb87bc218068cbd44a1dcc..7db3941e680899d77c147f291d34a0d017413d4e 100644 (file)
@@ -36,7 +36,7 @@
 #include <fstream>
 
 template<int dim>
-void testit(parallel::distributed::Triangulation<dim> & tr)
+void testit(parallel::distributed::Triangulation<dim> &tr)
 {
   GridGenerator::hyper_cube(tr);
   tr.refine_global(1);
@@ -48,38 +48,38 @@ void testit(parallel::distributed::Triangulation<dim> & tr)
   tr.execute_coarsening_and_refinement ();
 
   typename  parallel::distributed::Triangulation<dim>::active_cell_iterator it=tr.begin_active();
-  for (;it!=tr.end();++it)
+  for (; it!=tr.end(); ++it)
     {
       deallog << it->center() << ", ";
     }
-    deallog << std::endl;
+  deallog << std::endl;
 }
 
 
 template<int dim>
-void test(std::ostream& /*out*/)
+void test(std::ostream & /*out*/)
 {
   {
-    
-  parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD,
-                                              dealii::Triangulation<dim>::none,
-                                              parallel::distributed::Triangulation<dim>::default_setting);
-  testit(tr);
-  
+
+    parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD,
+                                                 dealii::Triangulation<dim>::none,
+                                                 parallel::distributed::Triangulation<dim>::default_setting);
+    testit(tr);
+
   }
-  
+
   {
-    
-  parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD,
-                                              dealii::Triangulation<dim>::none,
-                                              parallel::distributed::Triangulation<dim>::mesh_reconstruction_after_repartitioning);
-  testit(tr);
-  
+
+    parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD,
+                                                 dealii::Triangulation<dim>::none,
+                                                 parallel::distributed::Triangulation<dim>::mesh_reconstruction_after_repartitioning);
+    testit(tr);
+
   }
 
 
-  
-  
+
+
 
 }
 
index 81172a18680b6d7455cdb435522593c15b6f1c0d..4dc074505aceff204a2f30f61c9d7f12753ae721 100644 (file)
@@ -74,18 +74,18 @@ char buf[1000];
 template <int dim>
 class TestMap1 : public Function<dim>
 {
-  public:
-    TestMap1 (const unsigned int n_components) :
-                   Function<dim> (n_components)
-      {}
-  
-    virtual ~TestMap1 () {}
-  
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
-  
-    void vector_value (const Point<dim> &p,
-                      Vector<double>   &return_value) const;
+public:
+  TestMap1 (const unsigned int n_components) :
+    Function<dim> (n_components)
+  {}
+
+  virtual ~TestMap1 () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
+
+  void vector_value (const Point<dim> &p,
+                     Vector<double>   &return_value) const;
 };
 
 
@@ -93,10 +93,10 @@ class TestMap1 : public Function<dim>
 template <int dim>
 double
 TestMap1<dim>::value (const Point<dim>   &p,
-                     const unsigned int  component) const 
+                      const unsigned int  component) const
 {
-                                  // u = x^2, v = y^2, dudx = 2 x, dvdy = 2 y, div u = 2x + 2y
-                                  // I.e. \int div u = 2 (for unit square)
+  // u = x^2, v = y^2, dudx = 2 x, dvdy = 2 y, div u = 2x + 2y
+  // I.e. \int div u = 2 (for unit square)
 
   if (component == 0)
     return (p(0) * p(0));
@@ -109,12 +109,12 @@ TestMap1<dim>::value (const Point<dim>   &p,
 
 template <int dim>
 void TestMap1<dim>::vector_value (const Point<dim> &p,
-                                 Vector<double>   &return_value) const
+                                  Vector<double>   &return_value) const
 {
   Assert (return_value.size() == this->n_components,
-         ExcDimensionMismatch (return_value.size(), this->n_components));
-  
-                                  // Just fill the vector with the appropriate components
+          ExcDimensionMismatch (return_value.size(), this->n_components));
+
+  // Just fill the vector with the appropriate components
   for (unsigned int iCount = 0; iCount < this->n_components; iCount++)
     return_value (iCount) = value (p, iCount);
 }
@@ -126,22 +126,22 @@ void TestMap1<dim>::vector_value (const Point<dim> &p,
 template <int dim>
 class TestDef1 : public Function<dim>
 {
-  private:
-    const double phi;
-
-  public:
-    TestDef1 (const unsigned int n_components, const double ph) :
-                   Function<dim> (n_components),
-                   phi (ph)
-      {}
-    
-    virtual ~TestDef1 () {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
-    
-    void vector_value (const Point<dim> &p,
-                      Vector<double>   &return_value) const;
+private:
+  const double phi;
+
+public:
+  TestDef1 (const unsigned int n_components, const double ph) :
+    Function<dim> (n_components),
+    phi (ph)
+  {}
+
+  virtual ~TestDef1 () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
+
+  void vector_value (const Point<dim> &p,
+                     Vector<double>   &return_value) const;
 };
 
 
@@ -149,13 +149,13 @@ class TestDef1 : public Function<dim>
 template <int dim>
 double
 TestDef1<dim>::value (const Point<dim>   &p,
-                     const unsigned int  component) const 
+                      const unsigned int  component) const
 {
   Point<2> center;
   center(0) = 0.5;
   center(1) = 0.5;
   double rad = p.distance (center),
-       phi_p = atan2 (p(0) - center(0), p(1) - center(1));
+         phi_p = atan2 (p(0) - center(0), p(1) - center(1));
 
   if (component == 0)
     return rad * (sin (phi + phi_p) - sin (phi_p));
@@ -166,10 +166,10 @@ TestDef1<dim>::value (const Point<dim>   &p,
 
 template <int dim>
 void TestDef1<dim>::vector_value (const Point<dim> &p,
-                                 Vector<double>   &return_value) const
+                                  Vector<double>   &return_value) const
 {
   Assert (return_value.size() == this->n_components,
-         ExcDimensionMismatch (return_value.size(), this->n_components));
+          ExcDimensionMismatch (return_value.size(), this->n_components));
   for (unsigned int iCount = 0; iCount < this->n_components; iCount++)
     return_value (iCount) = value (p, iCount);
 }
@@ -181,32 +181,32 @@ void TestDef1<dim>::vector_value (const Point<dim> &p,
 template <int dim>
 class TestDef2 : public Function<dim>
 {
-  private:
-    const double scale;
-
-  public:
-    TestDef2 (const unsigned int n_components, const double sc) :
-                   Function<dim> (n_components),
-                   scale (sc)
-      {}
-    
-    virtual ~TestDef2 () {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
-    
-    void vector_value (const Point<dim> &p,
-                      Vector<double>   &return_value) const;
+private:
+  const double scale;
+
+public:
+  TestDef2 (const unsigned int n_components, const double sc) :
+    Function<dim> (n_components),
+    scale (sc)
+  {}
+
+  virtual ~TestDef2 () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
+
+  void vector_value (const Point<dim> &p,
+                     Vector<double>   &return_value) const;
 };
 
 
 template <int dim>
 double
 TestDef2<dim>::value (const Point<dim>   &p,
-                     const unsigned int  component) const 
+                      const unsigned int  component) const
 {
   double x = p(0),
-        y = p(1);
+         y = p(1);
 
   if (component == 0)
     return scale * x;
@@ -217,10 +217,10 @@ TestDef2<dim>::value (const Point<dim>   &p,
 
 template <int dim>
 void TestDef2<dim>::vector_value (const Point<dim> &p,
-                                 Vector<double>   &return_value) const
+                                  Vector<double>   &return_value) const
 {
   Assert (return_value.size() == this->n_components,
-         ExcDimensionMismatch (return_value.size(), this->n_components));
+          ExcDimensionMismatch (return_value.size(), this->n_components));
   for (unsigned int iCount = 0; iCount < this->n_components; iCount++)
     return_value (iCount) = value (p, iCount);
 }
@@ -233,29 +233,29 @@ void TestDef2<dim>::vector_value (const Point<dim> &p,
 template <int dim>
 class TestDef3 : public Function<dim>
 {
-  private:
-    const double scale;
-
-  public:
-    TestDef3 (const unsigned int n_components, const double sc) :
-                   Function<dim> (n_components),
-                   scale (sc)
-      {}
-    
-    virtual ~TestDef3 () {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
-    
-    void vector_value (const Point<dim> &p,
-                      Vector<double>   &return_value) const;
+private:
+  const double scale;
+
+public:
+  TestDef3 (const unsigned int n_components, const double sc) :
+    Function<dim> (n_components),
+    scale (sc)
+  {}
+
+  virtual ~TestDef3 () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
+
+  void vector_value (const Point<dim> &p,
+                     Vector<double>   &return_value) const;
 };
 
 
 template <int dim>
 double
 TestDef3<dim>::value (const Point<dim>   &p,
-                     const unsigned int  component) const 
+                      const unsigned int  component) const
 {
   double y = p(1);
 
@@ -268,57 +268,57 @@ TestDef3<dim>::value (const Point<dim>   &p,
 
 template <int dim>
 void TestDef3<dim>::vector_value (const Point<dim> &p,
-                                 Vector<double>   &return_value) const
+                                  Vector<double>   &return_value) const
 {
   Assert (return_value.size() == this->n_components,
-         ExcDimensionMismatch (return_value.size(), this->n_components));
+          ExcDimensionMismatch (return_value.size(), this->n_components));
   for (unsigned int iCount = 0; iCount < this->n_components; iCount++)
     return_value (iCount) = value (p, iCount);
 }
 
-// Wrapper class for polynomials. 
+// Wrapper class for polynomials.
 
 template <int dim>
 class TestPoly : public Function<dim>
 {
-  private:
-    std::vector<Polynomials::Polynomial<double> > polys;
+private:
+  std::vector<Polynomials::Polynomial<double> > polys;
 
-  public:
-    TestPoly (unsigned int deg) :
-                   Function<dim> (2)
+public:
+  TestPoly (unsigned int deg) :
+    Function<dim> (2)
+  {
+    std::vector<double> coeff (deg, 0.0);
+    for (unsigned int p=0; p < 4; ++p)
       {
-       std::vector<double> coeff (deg, 0.0);
-       for (unsigned int p=0; p < 4; ++p)
-         {
-           for (unsigned int i=0; i < deg; ++i)
-             {
-               double c = ((double) rand ()) / ((double) RAND_MAX + 1);
-               coeff[i] = c;
-             }
-           polys.push_back (Polynomials::Polynomial<double> (coeff));
-         }
+        for (unsigned int i=0; i < deg; ++i)
+          {
+            double c = ((double) rand ()) / ((double) RAND_MAX + 1);
+            coeff[i] = c;
+          }
+        polys.push_back (Polynomials::Polynomial<double> (coeff));
       }
-    
-    virtual ~TestPoly () {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
-    
-    void vector_value (const Point<dim> &p,
-                      Vector<double>   &return_value) const;
+  }
+
+  virtual ~TestPoly () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
+
+  void vector_value (const Point<dim> &p,
+                     Vector<double>   &return_value) const;
 };
 
 
 template <int dim>
 double
 TestPoly<dim>::value (const Point<dim>   &p,
-                     const unsigned int  component) const 
+                      const unsigned int  component) const
 {
   double x = p(0),
-        y = p(1);
+         y = p(1);
 
-                                  // Ugly hack, but should do the job ...
+  // Ugly hack, but should do the job ...
   if (component == 0)
     return polys[0].value (x) + polys[1].value (y);
   else
@@ -328,10 +328,10 @@ TestPoly<dim>::value (const Point<dim>   &p,
 
 template <int dim>
 void TestPoly<dim>::vector_value (const Point<dim> &p,
-                                 Vector<double>   &return_value) const
+                                  Vector<double>   &return_value) const
 {
   Assert (return_value.size() == this->n_components,
-         ExcDimensionMismatch (return_value.size(), this->n_components));
+          ExcDimensionMismatch (return_value.size(), this->n_components));
   for (unsigned int iCount = 0; iCount < this->n_components; iCount++)
     return_value (iCount) = value (p, iCount);
 }
@@ -343,80 +343,80 @@ void TestPoly<dim>::vector_value (const Point<dim> &p,
  */
 
 double TestProjection (Mapping<2> &mapping,
-                      DoFHandler<2> *dof_handler)
+                       DoFHandler<2> *dof_handler)
 {
   Vector<double> solution;
   solution.reinit (dof_handler->n_dofs ());
 
-                                  // Create and Project test function to H_div space and evaluate the error
-                                  // If the error is in the range of machine precision, this polynomial
-                                  // degree can obviously be represented by projected field.
+  // Create and Project test function to H_div space and evaluate the error
+  // If the error is in the range of machine precision, this polynomial
+  // degree can obviously be represented by projected field.
 
   for (unsigned int deg = 1; deg < 4; ++deg)
     {
       TestPoly<2> pol (deg);
 
-                                      // Project solution onto RT FE field
+      // Project solution onto RT FE field
       ConstraintMatrix     hn_constraints;
       hn_constraints.clear ();
-      DoFTools::make_hanging_node_constraints (*dof_handler, 
-                                              hn_constraints);
+      DoFTools::make_hanging_node_constraints (*dof_handler,
+                                               hn_constraints);
       hn_constraints.close ();
       VectorTools::project (mapping, *dof_handler, hn_constraints,
-                           QGauss<2> (6), pol,
-                           solution);
+                            QGauss<2> (6), pol,
+                            solution);
 
-                                      // Now evaluate error ...
-                                      // Use a high order quadrature. 
+      // Now evaluate error ...
+      // Use a high order quadrature.
       QGauss<2> quad (6);
-      FEValues<2> fe_values (mapping, dof_handler->get_fe (), quad, 
-                            UpdateFlags(update_values    |
-                                        update_q_points  |
-                                        update_gradients |
-                                        update_JxW_values|
-                                        update_contravariant_transformation));
+      FEValues<2> fe_values (mapping, dof_handler->get_fe (), quad,
+                             UpdateFlags(update_values    |
+                                         update_q_points  |
+                                         update_gradients |
+                                         update_JxW_values|
+                                         update_contravariant_transformation));
 
       const unsigned int   n_q_points    = quad.size();
       const unsigned int   n_components   = dof_handler->get_fe().n_components();
-      
-                                      // Cell iterators
+
+      // Cell iterators
       DoFHandler<2>::active_cell_iterator cell = dof_handler->begin_active(),
-                                         endc = dof_handler->end();
+                                          endc = dof_handler->end();
 
       double err_u = 0,
-            err_v = 0;
+             err_v = 0;
 
       for (; cell!=endc; ++cell)
-       {
-         fe_values.reinit (cell);
-         
-                                          // Get values from solution vector (For Trap.Rule)
-         std::vector<Vector<double> > this_value
-           (n_q_points, Vector<double>(n_components));
-         fe_values.get_function_values (solution, this_value);
-         
-         for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-           {
-             double u = this_value[q_point](0),
-                    v = this_value[q_point](1);
-             Point<2> p = fe_values.quadrature_point (q_point);
-
-             double u_ex = pol.value (p, 0),
-                    v_ex = pol.value (p, 1);
-
-             double JxW = fe_values.JxW (q_point);
-
-             err_u += (u - u_ex) * (u - u_ex) * JxW;
-             err_v += (v - v_ex) * (v - v_ex) * JxW;
-           }
-       }
+        {
+          fe_values.reinit (cell);
+
+          // Get values from solution vector (For Trap.Rule)
+          std::vector<Vector<double> > this_value
+          (n_q_points, Vector<double>(n_components));
+          fe_values.get_function_values (solution, this_value);
+
+          for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+            {
+              double u = this_value[q_point](0),
+                     v = this_value[q_point](1);
+              Point<2> p = fe_values.quadrature_point (q_point);
+
+              double u_ex = pol.value (p, 0),
+                     v_ex = pol.value (p, 1);
+
+              double JxW = fe_values.JxW (q_point);
+
+              err_u += (u - u_ex) * (u - u_ex) * JxW;
+              err_v += (v - v_ex) * (v - v_ex) * JxW;
+            }
+        }
 
       sprintf (buf, "Deg %i  ErrU %e  ErrV %e\n", deg, err_u, err_v);
       deallog << buf;
     }
 
 
-                                  // Test the core functionality
+  // Test the core functionality
   DataOut<2> *data_out = new DataOut<2>;
   data_out->attach_dof_handler (*dof_handler);
   data_out->add_data_vector (solution, "solution");
@@ -433,22 +433,22 @@ double TestProjection (Mapping<2> &mapping,
 int main ()
 {
   logfile.precision (PRECISION);
-  logfile.setf(std::ios::fixed);  
+  logfile.setf(std::ios::fixed);
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
   Triangulation<2> tria_test;
   DoFHandler<2> *dof_handler,
-    *dof_handler_def;
+             *dof_handler_def;
   Point<2> p1 (0,0),
-    p2 (1, 1);
+        p2 (1, 1);
 
   GridGenerator::hyper_rectangle (tria_test, p1, p2);
-                                  //  tria_test.refine_global (1);
-                                  //  tria_test.distort_random (0.4);
+  //  tria_test.refine_global (1);
+  //  tria_test.distort_random (0.4);
 
-                                  // Create a DoFHandler for the ABF space
+  // Create a DoFHandler for the ABF space
   FE_ABF<2> fe (0);
   dof_handler = new DoFHandler<2> (tria_test);
   dof_handler->distribute_dofs (fe);
@@ -459,74 +459,74 @@ int main ()
   sprintf (buf, "QPoints %i\n", quad_temp.size());
   deallog << buf;
 
-                                  // Create an deformation object for the Eulerian mapping
+  // Create an deformation object for the Eulerian mapping
   FESystem<2> fe_def (FE_Q<2>(1), 2);
   dof_handler_def = new DoFHandler<2> (tria_test);
   dof_handler_def->distribute_dofs (fe_def);
 
-                                  // Alloc some DoFs
+  // Alloc some DoFs
   Vector<double> solution,
-    solution_q,
-    deformation;
+         solution_q,
+         deformation;
   solution.reinit (dof_handler->n_dofs ());
   solution_q.reinit (dof_handler->n_dofs ());
   deformation.reinit (dof_handler_def->n_dofs ());
 
   ConstraintMatrix     hn_constraints_def;
   hn_constraints_def.clear ();
-  DoFTools::make_hanging_node_constraints (*dof_handler_def, 
-                                          hn_constraints_def);
+  DoFTools::make_hanging_node_constraints (*dof_handler_def,
+                                           hn_constraints_def);
   hn_constraints_def.close ();
-  
+
   {
     MappingQ1Eulerian<2> mapping_euler (deformation, *dof_handler_def);
 
-                                    // Try rotating the elements
+    // Try rotating the elements
     for (double rotat = 0; rotat < 2 * M_PI; rotat += 0.25 * M_PI)
       {
-                                        // Rotate element
-       VectorTools::project (*dof_handler_def, hn_constraints_def,
-                             QGauss<2> (6), TestDef1<2>(2, rotat),
-                             deformation);
-       sprintf (buf, "phi = %e\n", rotat);
-       deallog << buf;
-       TestProjection (mapping_euler, dof_handler);
+        // Rotate element
+        VectorTools::project (*dof_handler_def, hn_constraints_def,
+                              QGauss<2> (6), TestDef1<2>(2, rotat),
+                              deformation);
+        sprintf (buf, "phi = %e\n", rotat);
+        deallog << buf;
+        TestProjection (mapping_euler, dof_handler);
       }
 
-                                    // Try resizing the elements
+    // Try resizing the elements
     for (double scale = -0.75; scale < 4.0; scale += 0.25)
       {
-       VectorTools::project (*dof_handler_def, hn_constraints_def,
-                             QGauss<2> (6), TestDef2<2>(2, scale),
-                             deformation);
-       sprintf (buf, "Scale = %e\n", scale);
-       deallog << buf;
-       TestProjection (mapping_euler, dof_handler);
+        VectorTools::project (*dof_handler_def, hn_constraints_def,
+                              QGauss<2> (6), TestDef2<2>(2, scale),
+                              deformation);
+        sprintf (buf, "Scale = %e\n", scale);
+        deallog << buf;
+        TestProjection (mapping_euler, dof_handler);
       }
 
-                                    // Try paralellogramming the elements
+    // Try paralellogramming the elements
     for (double scale = -1.0; scale < 1.0; scale += 0.25)
       {
-       VectorTools::project (*dof_handler_def, hn_constraints_def,
-                             QGauss<2> (6), TestDef3<2>(2, scale),
-                             deformation);
-       sprintf (buf, "Scale = %e\n", scale);
-       deallog << buf;
-       TestProjection (mapping_euler, dof_handler);
+        VectorTools::project (*dof_handler_def, hn_constraints_def,
+                              QGauss<2> (6), TestDef3<2>(2, scale),
+                              deformation);
+        sprintf (buf, "Scale = %e\n", scale);
+        deallog << buf;
+        TestProjection (mapping_euler, dof_handler);
       }
 
-                                    // Try arbitrary deformation ...
+    // Try arbitrary deformation ...
     for (unsigned int i=0; i < deformation.size (); ++i)
       {
-       double c = ((double) rand ()) / ((double) RAND_MAX + 1);
-       deformation (i) = 0.35 * (c - 0.5);
+        double c = ((double) rand ()) / ((double) RAND_MAX + 1);
+        deformation (i) = 0.35 * (c - 0.5);
       }
 
     sprintf (buf, "Arbitrary\n");
     deallog << buf;
     TestProjection (mapping_euler, dof_handler);
   }
-  
+
   delete (dof_handler);
   delete (dof_handler_def);
 
index 13d5a2ae7ba86a40f56823a30252377286b19c8a..7bdbe717d9430fdd3b0c2531a6eba9501630c236 100644 (file)
@@ -59,44 +59,44 @@ char logname[] = "circular_01/output";
 
 #include <complex>
 
-                                // Finally, this is as in previous
-                                // programs:
+// Finally, this is as in previous
+// programs:
 using namespace dealii;
 
 template <int dim>
-class LaplaceProblem 
+class LaplaceProblem
 {
-  public:
-    LaplaceProblem ();
-    ~LaplaceProblem ();
+public:
+  LaplaceProblem ();
+  ~LaplaceProblem ();
 
-    void run ();
-    
-  private:
-    void setup_system ();
-    void assemble_system ();
-    void solve ();
-    void create_coarse_grid ();
-    void refine_grid ();
-    void estimate_smoothness (Vector<float> &smoothness_indicators) const;
-    void output_results (const unsigned int cycle) const;
+  void run ();
 
-    Triangulation<dim>   triangulation;
+private:
+  void setup_system ();
+  void assemble_system ();
+  void solve ();
+  void create_coarse_grid ();
+  void refine_grid ();
+  void estimate_smoothness (Vector<float> &smoothness_indicators) const;
+  void output_results (const unsigned int cycle) const;
 
-    hp::DoFHandler<dim>      dof_handler;
-    hp::FECollection<dim>    fe_collection;
-    hp::QCollection<dim>     quadrature_collection;
-    hp::QCollection<dim-1>   face_quadrature_collection;
+  Triangulation<dim>   triangulation;
 
-    ConstraintMatrix     hanging_node_constraints;
+  hp::DoFHandler<dim>      dof_handler;
+  hp::FECollection<dim>    fe_collection;
+  hp::QCollection<dim>     quadrature_collection;
+  hp::QCollection<dim-1>   face_quadrature_collection;
 
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> system_matrix;
+  ConstraintMatrix     hanging_node_constraints;
 
-    Vector<double>       solution;
-    Vector<double>       system_rhs;
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> system_matrix;
 
-    Timer distr, condense, hang, assemble, solver;
+  Vector<double>       solution;
+  Vector<double>       system_rhs;
+
+  Timer distr, condense, hang, assemble, solver;
 };
 
 
@@ -104,18 +104,18 @@ class LaplaceProblem
 template <int dim>
 class RightHandSide : public Function<dim>
 {
-  public:
-    RightHandSide () : Function<dim> () {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const;
+public:
+  RightHandSide () : Function<dim> () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const;
 };
 
 
 template <int dim>
 double
 RightHandSide<dim>::value (const Point<dim>   &p,
-                          const unsigned int  /*component*/) const
+                           const unsigned int  /*component*/) const
 {
   double product = 1;
   for (unsigned int d=0; d<dim; ++d)
@@ -128,7 +128,7 @@ RightHandSide<dim>::value (const Point<dim>   &p,
 
 template <int dim>
 LaplaceProblem<dim>::LaplaceProblem () :
-               dof_handler (triangulation)
+  dof_handler (triangulation)
 {
   for (unsigned int degree=2; degree<(dim == 2 ? 8 : 5); ++degree)
     {
@@ -140,7 +140,7 @@ LaplaceProblem<dim>::LaplaceProblem () :
 
 
 template <int dim>
-LaplaceProblem<dim>::~LaplaceProblem () 
+LaplaceProblem<dim>::~LaplaceProblem ()
 {
   dof_handler.clear ();
 }
@@ -160,7 +160,7 @@ void LaplaceProblem<dim>::setup_system ()
   hang.reset();
   hang.start();
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          hanging_node_constraints);
+                                           hanging_node_constraints);
 
   hanging_node_constraints.close ();
   hang.stop();
@@ -168,46 +168,46 @@ void LaplaceProblem<dim>::setup_system ()
   if (dim < 3)
     {
       sparsity_pattern.reinit (dof_handler.n_dofs(),
-                              dof_handler.n_dofs(),
-                              dof_handler.max_couplings_between_dofs());
+                               dof_handler.n_dofs(),
+                               dof_handler.max_couplings_between_dofs());
       DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
 
       condense.reset();
       condense.start();
       hanging_node_constraints.condense (sparsity_pattern);
       condense.stop();
-      sparsity_pattern.compress();      
+      sparsity_pattern.compress();
     }
   else
     {
       CompressedSparsityPattern csp (dof_handler.n_dofs(),
-                                    dof_handler.n_dofs());
+                                     dof_handler.n_dofs());
       DoFTools::make_sparsity_pattern (dof_handler, csp);
 
       condense.reset();
       condense.start();
       hanging_node_constraints.condense (csp);
       condense.stop();
-      
+
       sparsity_pattern.copy_from (csp);
-    }  
+    }
 
   system_matrix.reinit (sparsity_pattern);
 }
 
 template <int dim>
-void LaplaceProblem<dim>::assemble_system () 
+void LaplaceProblem<dim>::assemble_system ()
 {
   hp::FEValues<dim> hp_fe_values (fe_collection,
-                                 quadrature_collection, 
-                                 update_values    |  update_gradients |
-                                 update_q_points  |  update_JxW_values);
+                                  quadrature_collection,
+                                  update_values    |  update_gradients |
+                                  update_q_points  |  update_JxW_values);
 
   const RightHandSide<dim> rhs_function;
-  
+
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       const unsigned int   dofs_per_cell = cell->get_fe().dofs_per_cell;
@@ -220,36 +220,36 @@ void LaplaceProblem<dim>::assemble_system ()
       cell_rhs = 0;
 
       hp_fe_values.reinit (cell);
-      
+
       const FEValues<dim> &fe_values = hp_fe_values.get_present_fe_values ();
 
       std::vector<double>  rhs_values (fe_values.n_quadrature_points);
       rhs_function.value_list (fe_values.get_quadrature_points(),
-                              rhs_values);
-      
+                               rhs_values);
+
       for (unsigned int q_point=0; q_point<fe_values.n_quadrature_points; ++q_point)
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         {
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += (fe_values.shape_grad(i,q_point) *
-                                  fe_values.shape_grad(j,q_point) *
-                                  fe_values.JxW(q_point));
-
-           cell_rhs(i) += (fe_values.shape_value(i,q_point) *
-                           rhs_values[q_point] *
-                           fe_values.JxW(q_point));
-         }
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += (fe_values.shape_grad(i,q_point) *
+                                   fe_values.shape_grad(j,q_point) *
+                                   fe_values.JxW(q_point));
+
+            cell_rhs(i) += (fe_values.shape_value(i,q_point) *
+                            rhs_values[q_point] *
+                            fe_values.JxW(q_point));
+          }
 
       cell->get_dof_indices (local_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           system_matrix.add (local_dof_indices[i],
-                              local_dof_indices[j],
-                              cell_matrix(i,j));
-         
-         system_rhs(local_dof_indices[i]) += cell_rhs(i);
-       }
+        {
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            system_matrix.add (local_dof_indices[i],
+                               local_dof_indices[j],
+                               cell_matrix(i,j));
+
+          system_rhs(local_dof_indices[i]) += cell_rhs(i);
+        }
     }
 
   condense.start();
@@ -258,27 +258,27 @@ void LaplaceProblem<dim>::assemble_system ()
   condense.stop();
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           ZeroFunction<dim>(),
-                                           boundary_values);
+                                            0,
+                                            ZeroFunction<dim>(),
+                                            boundary_values);
   MatrixTools::apply_boundary_values (boundary_values,
-                                     system_matrix,
-                                     solution,
-                                     system_rhs);
+                                      system_matrix,
+                                      solution,
+                                      system_rhs);
 }
 
 template <int dim>
-void LaplaceProblem<dim>::solve () 
+void LaplaceProblem<dim>::solve ()
 {
   SolverControl           solver_control (system_rhs.size(),
-                                         1e-8*system_rhs.l2_norm());
+                                          1e-8*system_rhs.l2_norm());
   SolverCG<>              cg (solver_control);
 
   PreconditionSSOR<> preconditioner;
   preconditioner.initialize(system_matrix, 1.2);
 
   cg.solve (system_matrix, solution, system_rhs,
-           preconditioner);
+            preconditioner);
 
   hanging_node_constraints.distribute (solution);
 }
@@ -286,7 +286,7 @@ void LaplaceProblem<dim>::solve ()
 
 unsigned int
 int_pow (const unsigned int x,
-        const unsigned int n)
+         const unsigned int n)
 {
   unsigned int p=1;
   for (unsigned int i=0; i<n; ++i)
@@ -302,220 +302,220 @@ estimate_smoothness (Vector<float> &smoothness_indicators) const
 {
   const unsigned int N = (dim == 2 ? 7 : 4);
 
-                                  // form all the Fourier vectors
-                                  // that we want to
-                                  // consider. exclude k=0 to avoid
-                                  // problems with |k|^{-mu} and also
-                                  // logarithms of |k|
+  // form all the Fourier vectors
+  // that we want to
+  // consider. exclude k=0 to avoid
+  // problems with |k|^{-mu} and also
+  // logarithms of |k|
   std::vector<Tensor<1,dim> > k_vectors;
   std::vector<unsigned int>   k_vectors_magnitude;
   switch (dim)
     {
-      case 2:
-      {
-       for (unsigned int i=0; i<N; ++i)
-         for (unsigned int j=0; j<N; ++j)
-           if (!((i==0) && (j==0))
-               &&
-               (i*i + j*j < N*N))
-             {
-               k_vectors.push_back (Point<dim>(numbers::PI * i,
-                                               numbers::PI * j));
-               k_vectors_magnitude.push_back (i*i+j*j);
-             }
-       
-       break;
-      }
-
-      case 3:
-      {
-       for (unsigned int i=0; i<N; ++i)
-         for (unsigned int j=0; j<N; ++j)
-           for (unsigned int k=0; k<N; ++k)
-             if (!((i==0) && (j==0) && (k==0))
-                 &&
-                 (i*i + j*j + k*k < N*N))
-               {
-                 k_vectors.push_back (Point<dim>(numbers::PI * i,
-                                                 numbers::PI * j,
-                                                 numbers::PI * k));
-                 k_vectors_magnitude.push_back (i*i+j*j+k*k);
-             }
-       
-       break;
-      }
-      
-      default:
-           Assert (false, ExcNotImplemented());
+    case 2:
+    {
+      for (unsigned int i=0; i<N; ++i)
+        for (unsigned int j=0; j<N; ++j)
+          if (!((i==0) && (j==0))
+              &&
+              (i*i + j*j < N*N))
+            {
+              k_vectors.push_back (Point<dim>(numbers::PI * i,
+                                              numbers::PI * j));
+              k_vectors_magnitude.push_back (i*i+j*j);
+            }
+
+      break;
+    }
+
+    case 3:
+    {
+      for (unsigned int i=0; i<N; ++i)
+        for (unsigned int j=0; j<N; ++j)
+          for (unsigned int k=0; k<N; ++k)
+            if (!((i==0) && (j==0) && (k==0))
+                &&
+                (i*i + j*j + k*k < N*N))
+              {
+                k_vectors.push_back (Point<dim>(numbers::PI * i,
+                                                numbers::PI * j,
+                                                numbers::PI * k));
+                k_vectors_magnitude.push_back (i*i+j*j+k*k);
+              }
+
+      break;
+    }
+
+    default:
+      Assert (false, ExcNotImplemented());
     }
 
   const unsigned n_fourier_modes = k_vectors.size();
   std::vector<double> ln_k (n_fourier_modes);
   for (unsigned int i=0; i<n_fourier_modes; ++i)
     ln_k[i] = std::log (k_vectors[i].norm());
-  
-
-                                  // assemble the matrices that do
-                                  // the Fourier transforms for each
-                                  // of the finite elements we deal
-                                  // with. note that these matrices
-                                  // are complex-valued, so we can't
-                                  // use FullMatrix
+
+
+  // assemble the matrices that do
+  // the Fourier transforms for each
+  // of the finite elements we deal
+  // with. note that these matrices
+  // are complex-valued, so we can't
+  // use FullMatrix
   QGauss<1>      base_quadrature (2);
   QIterated<dim> quadrature (base_quadrature, N);
-  
+
   std::vector<Table<2,std::complex<double> > >
-    fourier_transform_matrices (fe_collection.size());
+  fourier_transform_matrices (fe_collection.size());
   for (unsigned int fe=0; fe<fe_collection.size(); ++fe)
     {
       fourier_transform_matrices[fe].reinit (n_fourier_modes,
-                                            fe_collection[fe].dofs_per_cell);
+                                             fe_collection[fe].dofs_per_cell);
 
       for (unsigned int k=0; k<n_fourier_modes; ++k)
-       for (unsigned int i=0; i<fe_collection[fe].dofs_per_cell; ++i)
-         {
-           std::complex<double> sum = 0;
-           for (unsigned int q=0; q<quadrature.size(); ++q)
-             {
-               const Point<dim> x_q = quadrature.point(q);
-               sum += std::exp(std::complex<double>(0,1) *
-                               (k_vectors[k] * x_q)) *
-                      fe_collection[fe].shape_value(i,x_q) *
-                      quadrature.weight(q);
-             }
-           fourier_transform_matrices[fe](k,i)
-             = sum / std::pow(2*numbers::PI, 1.*dim/2);
-         }
+        for (unsigned int i=0; i<fe_collection[fe].dofs_per_cell; ++i)
+          {
+            std::complex<double> sum = 0;
+            for (unsigned int q=0; q<quadrature.size(); ++q)
+              {
+                const Point<dim> x_q = quadrature.point(q);
+                sum += std::exp(std::complex<double>(0,1) *
+                                (k_vectors[k] * x_q)) *
+                       fe_collection[fe].shape_value(i,x_q) *
+                       quadrature.weight(q);
+              }
+            fourier_transform_matrices[fe](k,i)
+              = sum / std::pow(2*numbers::PI, 1.*dim/2);
+          }
     }
 
-                                  // the next thing is to loop over
-                                  // all cells and do our work there,
-                                  // i.e. to locally do the Fourier
-                                  // transform and estimate the decay
-                                  // coefficient
+  // the next thing is to loop over
+  // all cells and do our work there,
+  // i.e. to locally do the Fourier
+  // transform and estimate the decay
+  // coefficient
   std::vector<std::complex<double> > fourier_coefficients (n_fourier_modes);
   Vector<double>                     local_dof_values;
-  
+
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (unsigned int index=0; cell!=endc; ++cell, ++index)
     {
       local_dof_values.reinit (cell->get_fe().dofs_per_cell);
       cell->get_dof_values (solution, local_dof_values);
 
-                                      // first compute the Fourier
-                                      // transform of the local
-                                      // solution
+      // first compute the Fourier
+      // transform of the local
+      // solution
       std::fill (fourier_coefficients.begin(), fourier_coefficients.end(), 0);
       for (unsigned int f=0; f<n_fourier_modes; ++f)
-       for (unsigned int i=0; i<cell->get_fe().dofs_per_cell; ++i)
-         fourier_coefficients[f] += 
-           fourier_transform_matrices[cell->active_fe_index()](f,i)
-           *
-           local_dof_values(i);
-
-                                      // enter the Fourier
-                                      // coefficients into a map with
-                                      // the k-magnitudes, to make
-                                      // sure that we get only the
-                                      // largest magnitude for each
-                                      // value of |k|
+        for (unsigned int i=0; i<cell->get_fe().dofs_per_cell; ++i)
+          fourier_coefficients[f] +=
+            fourier_transform_matrices[cell->active_fe_index()](f,i)
+            *
+            local_dof_values(i);
+
+      // enter the Fourier
+      // coefficients into a map with
+      // the k-magnitudes, to make
+      // sure that we get only the
+      // largest magnitude for each
+      // value of |k|
       std::map<unsigned int, double> k_to_max_U_map;
       for (unsigned int f=0; f<n_fourier_modes; ++f)
-       if ((k_to_max_U_map.find (k_vectors_magnitude[f]) ==
-            k_to_max_U_map.end())
-           ||
-           (k_to_max_U_map[k_vectors_magnitude[f]] <
-            std::abs (fourier_coefficients[f])))
-         k_to_max_U_map[k_vectors_magnitude[f]]
-           = std::abs (fourier_coefficients[f]);
-      
-                                      // now we have to calculate the
-                                      // various contributions to the
-                                      // formula for mu. we'll only
-                                      // take those fourier
-                                      // coefficients with the
-                                      // largest value for a given
-                                      // |k|
+        if ((k_to_max_U_map.find (k_vectors_magnitude[f]) ==
+             k_to_max_U_map.end())
+            ||
+            (k_to_max_U_map[k_vectors_magnitude[f]] <
+             std::abs (fourier_coefficients[f])))
+          k_to_max_U_map[k_vectors_magnitude[f]]
+            = std::abs (fourier_coefficients[f]);
+
+      // now we have to calculate the
+      // various contributions to the
+      // formula for mu. we'll only
+      // take those fourier
+      // coefficients with the
+      // largest value for a given
+      // |k|
       double  sum_1           = 0,
-             sum_ln_k        = 0,
-             sum_ln_k_square = 0,
-             sum_ln_U        = 0,
-             sum_ln_U_ln_k   = 0;
+              sum_ln_k        = 0,
+              sum_ln_k_square = 0,
+              sum_ln_U        = 0,
+              sum_ln_U_ln_k   = 0;
       for (unsigned int f=0; f<n_fourier_modes; ++f)
-       if (k_to_max_U_map[k_vectors_magnitude[f]] ==
-           std::abs (fourier_coefficients[f]))
-         {
-           sum_1 += 1;
-           sum_ln_k += ln_k[f];
-           sum_ln_k_square += ln_k[f]*ln_k[f];
-           sum_ln_U += std::log (std::abs (fourier_coefficients[f]));
-           sum_ln_U_ln_k += std::log (std::abs (fourier_coefficients[f])) * ln_k[f];
-         }
+        if (k_to_max_U_map[k_vectors_magnitude[f]] ==
+            std::abs (fourier_coefficients[f]))
+          {
+            sum_1 += 1;
+            sum_ln_k += ln_k[f];
+            sum_ln_k_square += ln_k[f]*ln_k[f];
+            sum_ln_U += std::log (std::abs (fourier_coefficients[f]));
+            sum_ln_U_ln_k += std::log (std::abs (fourier_coefficients[f])) * ln_k[f];
+          }
 
       const double mu
-       = (1./(sum_1*sum_ln_k_square - sum_ln_k*sum_ln_k)
-          *
-          (sum_ln_k*sum_ln_U - sum_1*sum_ln_U_ln_k));
-      
+        = (1./(sum_1*sum_ln_k_square - sum_ln_k*sum_ln_k)
+           *
+           (sum_ln_k*sum_ln_U - sum_1*sum_ln_U_ln_k));
+
       smoothness_indicators(index) = mu - 1.*dim/2;
     }
 }
 
 
 
-  
+
 template <int dim>
 void LaplaceProblem<dim>::refine_grid ()
 {
   Vector<float> estimated_error_per_cell (triangulation.n_active_cells());
   KellyErrorEstimator<dim>::estimate (dof_handler,
-                                     face_quadrature_collection,
-                                     typename FunctionMap<dim>::type(),
-                                     solution,
-                                     estimated_error_per_cell);
+                                      face_quadrature_collection,
+                                      typename FunctionMap<dim>::type(),
+                                      solution,
+                                      estimated_error_per_cell);
 
   Vector<float> smoothness_indicators (triangulation.n_active_cells());
   estimate_smoothness (smoothness_indicators);
-  
+
   GridRefinement::refine_and_coarsen_fixed_number (triangulation,
-                                                  estimated_error_per_cell,
-                                                  0.3, 0.03);
+                                                   estimated_error_per_cell,
+                                                   0.3, 0.03);
 
   float max_smoothness = 0,
-        min_smoothness = smoothness_indicators.linfty_norm();
+        min_smoothness = smoothness_indicators.linfty_norm();
   {
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     for (unsigned int index=0; cell!=endc; ++cell, ++index)
       if (cell->refine_flag_set())
-       {
-         max_smoothness = std::max (max_smoothness,
-                                    smoothness_indicators(index));
-         min_smoothness = std::min (min_smoothness,
-                                    smoothness_indicators(index));
-       }
+        {
+          max_smoothness = std::max (max_smoothness,
+                                     smoothness_indicators(index));
+          min_smoothness = std::min (min_smoothness,
+                                     smoothness_indicators(index));
+        }
   }
   const float cutoff_smoothness = (max_smoothness + min_smoothness) / 2;
   {
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     for (unsigned int index=0; cell!=endc; ++cell, ++index)
       if (cell->refine_flag_set()
-         &&
-         (smoothness_indicators(index) > cutoff_smoothness)
-         &&
-         !(cell->active_fe_index() == fe_collection.size() - 1))
-       {
-         cell->clear_refine_flag();
-         cell->set_active_fe_index (std::min (cell->active_fe_index() + 1,
-                                              fe_collection.size() - 1));
-       }
-  } 
-  
+          &&
+          (smoothness_indicators(index) > cutoff_smoothness)
+          &&
+          !(cell->active_fe_index() == fe_collection.size() - 1))
+        {
+          cell->clear_refine_flag();
+          cell->set_active_fe_index (std::min (cell->active_fe_index() + 1,
+                                               fe_collection.size() - 1));
+        }
+  }
+
   triangulation.execute_coarsening_and_refinement ();
 }
 
@@ -525,42 +525,42 @@ template <int dim>
 void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
 {
   Assert (cycle < 10, ExcNotImplemented());
-  
+
   {
     const std::string filename = "grid-" +
-                                Utilities::int_to_string (cycle, 2) +
-                                ".eps";
+                                 Utilities::int_to_string (cycle, 2) +
+                                 ".eps";
     std::ofstream output (filename.c_str());
-    
+
     GridOut grid_out;
     grid_out.write_eps (triangulation, output);
   }
-  
+
   {
     Vector<float> smoothness_indicators (triangulation.n_active_cells());
     estimate_smoothness (smoothness_indicators);
 
     Vector<double> smoothness_field (dof_handler.n_dofs());
     DoFTools::distribute_cell_to_dof_vector (dof_handler,
-                                            smoothness_indicators,
-                                            smoothness_field);
+                                             smoothness_indicators,
+                                             smoothness_field);
 
     Vector<float> fe_indices (triangulation.n_active_cells());
     {
       typename hp::DoFHandler<dim>::active_cell_iterator
-       cell = dof_handler.begin_active(),
-       endc = dof_handler.end();
+      cell = dof_handler.begin_active(),
+      endc = dof_handler.end();
       for (unsigned int index=0; cell!=endc; ++cell, ++index)
-       {
-         
-         fe_indices(index) = cell->active_fe_index();
-//       smoothness_indicators(index) *= std::sqrt(cell->diameter());
-       }
+        {
+
+          fe_indices(index) = cell->active_fe_index();
+//    smoothness_indicators(index) *= std::sqrt(cell->diameter());
+        }
     }
-    
+
     const std::string filename = "solution-" +
-                                Utilities::int_to_string (cycle, 2) +
-                                ".vtk";
+                                 Utilities::int_to_string (cycle, 2) +
+                                 ".vtk";
     DataOut<dim,hp::DoFHandler<dim> > data_out;
 
     data_out.attach_dof_handler (dof_handler);
@@ -569,7 +569,7 @@ void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
     data_out.add_data_vector (smoothness_field, "smoothness2");
     data_out.add_data_vector (fe_indices, "fe_index");
     data_out.build_patches ();
-  
+
     std::ofstream output (filename.c_str());
     data_out.write_vtk (output);
   }
@@ -580,58 +580,60 @@ template <>
 void LaplaceProblem<2>::create_coarse_grid ()
 {
   const unsigned int dim = 2;
-  
+
   static const Point<2> vertices_1[]
     = {  Point<2> (-1.,   -1.),
          Point<2> (-1./2, -1.),
          Point<2> (0.,    -1.),
          Point<2> (+1./2, -1.),
          Point<2> (+1,    -1.),
-            
+
          Point<2> (-1.,   -1./2.),
          Point<2> (-1./2, -1./2.),
          Point<2> (0.,    -1./2.),
          Point<2> (+1./2, -1./2.),
          Point<2> (+1,    -1./2.),
-            
+
          Point<2> (-1.,   0.),
          Point<2> (-1./2, 0.),
          Point<2> (+1./2, 0.),
          Point<2> (+1,    0.),
-            
+
          Point<2> (-1.,   1./2.),
          Point<2> (-1./2, 1./2.),
          Point<2> (0.,    1./2.),
          Point<2> (+1./2, 1./2.),
          Point<2> (+1,    1./2.),
-            
+
          Point<2> (-1.,   1.),
          Point<2> (-1./2, 1.),
-         Point<2> (0.,    1.),                   
+         Point<2> (0.,    1.),
          Point<2> (+1./2, 1.),
-         Point<2> (+1,    1.)    };
+         Point<2> (+1,    1.)
+      };
   const unsigned int
-    n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
+  n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
   const std::vector<Point<dim> > vertices (&vertices_1[0],
                                            &vertices_1[n_vertices]);
   static const int cell_vertices[][GeometryInfo<dim>::vertices_per_cell]
-    = {{0, 1, 5, 6},
-       {1, 2, 6, 7},
-       {2, 3, 7, 8},
-       {3, 4, 8, 9},
-       {5, 6, 10, 11},
-       {8, 9, 12, 13},
-       {10, 11, 14, 15},
-       {12, 13, 17, 18},
-       {14, 15, 19, 20},
-       {15, 16, 20, 21},
-       {16, 17, 21, 22},
-       {17, 18, 22, 23}};
+  = {{0, 1, 5, 6},
+    {1, 2, 6, 7},
+    {2, 3, 7, 8},
+    {3, 4, 8, 9},
+    {5, 6, 10, 11},
+    {8, 9, 12, 13},
+    {10, 11, 14, 15},
+    {12, 13, 17, 18},
+    {14, 15, 19, 20},
+    {15, 16, 20, 21},
+    {16, 17, 21, 22},
+    {17, 18, 22, 23}
+  };
   const unsigned int
-    n_cells = sizeof(cell_vertices) / sizeof(cell_vertices[0]);
+  n_cells = sizeof(cell_vertices) / sizeof(cell_vertices[0]);
 
   std::vector<CellData<dim> > cells (n_cells, CellData<dim>());
-  for (unsigned int i=0; i<n_cells; ++i) 
+  for (unsigned int i=0; i<n_cells; ++i)
     {
       for (unsigned int j=0;
            j<GeometryInfo<dim>::vertices_per_cell;
@@ -641,8 +643,8 @@ void LaplaceProblem<2>::create_coarse_grid ()
     }
 
   triangulation.create_triangulation (vertices,
-                                    cells,
-                                    SubCellData());
+                                      cells,
+                                      SubCellData());
   triangulation.refine_global (3);
 }
 
@@ -652,149 +654,150 @@ template <>
 void LaplaceProblem<3>::create_coarse_grid ()
 {
   const unsigned int dim = 3;
-  
+
   static const Point<3> vertices_1[]
-    = 
-    {
-                                          // points on the lower surface
-         Point<dim>(0,  0, -4),
-         Point<dim>(std::cos(0*numbers::PI/6),
-                    std::sin(0*numbers::PI/6),
-                    -4),
-         Point<dim>(std::cos(2*numbers::PI/6),
-                    std::sin(2*numbers::PI/6),
-                    -4),
-         Point<dim>(std::cos(4*numbers::PI/6),
-                    std::sin(4*numbers::PI/6),
-                    -4),
-         Point<dim>(std::cos(6*numbers::PI/6),
-                    std::sin(6*numbers::PI/6),
-                    -4),
-         Point<dim>(std::cos(8*numbers::PI/6),
-                    std::sin(8*numbers::PI/6),
-                    -4),
-         Point<dim>(std::cos(10*numbers::PI/6),
-                    std::sin(10*numbers::PI/6),
-                    -4),
-
-                                          // same points on the top
-                                          // of the stem, with
-                                          // indentation in the middle
-         Point<dim>(0,  0, 4-std::sqrt(2.)/2),
-         Point<dim>(std::cos(0*numbers::PI/6),
-                    std::sin(0*numbers::PI/6),
-                    4),
-         Point<dim>(std::cos(2*numbers::PI/6),
-                    std::sin(2*numbers::PI/6),
-                    4),
-         Point<dim>(std::cos(4*numbers::PI/6),
-                    std::sin(4*numbers::PI/6),
-                    4),
-         Point<dim>(std::cos(6*numbers::PI/6),
-                    std::sin(6*numbers::PI/6),
-                    4),
-         Point<dim>(std::cos(8*numbers::PI/6),
-                    std::sin(8*numbers::PI/6),
-                    4),
-         Point<dim>(std::cos(10*numbers::PI/6),
-                    std::sin(10*numbers::PI/6),
-                    4),
-
-                                          // point at top of chevron
-         Point<dim>(0,0,4+std::sqrt(2.)/2),
-
-                                          // points at the top of the
-                                          // first extension
-                                          // points 15-18
-         Point<dim>(0,  0, 7) + Point<dim> (std::cos(2*numbers::PI/6),
-                                            std::sin(2*numbers::PI/6),
-                                            0) * 4,
-         Point<dim>(std::cos(0*numbers::PI/6),
-                    std::sin(0*numbers::PI/6),
-                    7) + Point<dim> (std::cos(2*numbers::PI/6),
-                                     std::sin(2*numbers::PI/6),
-                                     0) * 4,
-         Point<dim>(std::cos(2*numbers::PI/6),
-                    std::sin(2*numbers::PI/6),
-                    7) + Point<dim> (std::cos(2*numbers::PI/6),
-                                     std::sin(2*numbers::PI/6),
-                                     0) * 4,
-         Point<dim>(std::cos(4*numbers::PI/6),
-                    std::sin(4*numbers::PI/6),
-                    7) + Point<dim> (std::cos(2*numbers::PI/6),
-                                     std::sin(2*numbers::PI/6),
-                                     0) * 4,
-
-                                          // points at the top of the
-                                          // second extension
-                                          // points 19-22
-         Point<dim>(0,  0, 7) + Point<dim> (std::cos(6*numbers::PI/6),
-                                            std::sin(6*numbers::PI/6),
-                                            0) * 4,
-         Point<dim>(std::cos(4*numbers::PI/6),
-                    std::sin(4*numbers::PI/6),
-                    7) + Point<dim> (std::cos(6*numbers::PI/6),
-                                     std::sin(6*numbers::PI/6),
-                                     0) * 4,
-         Point<dim>(std::cos(6*numbers::PI/6),
-                    std::sin(6*numbers::PI/6),
-                    7) + Point<dim> (std::cos(6*numbers::PI/6),
-                                     std::sin(6*numbers::PI/6),
-                                     0) * 4,
-         Point<dim>(std::cos(8*numbers::PI/6),
-                    std::sin(8*numbers::PI/6),
-                    7) + Point<dim> (std::cos(6*numbers::PI/6),
-                                     std::sin(6*numbers::PI/6),
-                                     0) * 4,
-
-                                          // points at the top of the
-                                          // third extension
-                                          // points 23-26
-         Point<dim>(0,  0, 7) + Point<dim> (std::cos(10*numbers::PI/6),
-                                            std::sin(10*numbers::PI/6),
-                                            0) * 4,
-         Point<dim>(std::cos(8*numbers::PI/6),
-                    std::sin(8*numbers::PI/6),
-                    7) + Point<dim> (std::cos(10*numbers::PI/6),
-                                     std::sin(10*numbers::PI/6),
-                                     0) * 4,
-         Point<dim>(std::cos(10*numbers::PI/6),
-                    std::sin(10*numbers::PI/6),
-                    7) + Point<dim> (std::cos(10*numbers::PI/6),
-                                     std::sin(10*numbers::PI/6),
-                                     0) * 4,
-         Point<dim>(std::cos(0*numbers::PI/6),
-                    std::sin(0*numbers::PI/6),
-                    7) + Point<dim> (std::cos(10*numbers::PI/6),
-                                     std::sin(10*numbers::PI/6),
-                                     0) * 4,
-         
-    };
-  
+  =
+  {
+    // points on the lower surface
+    Point<dim>(0,  0, -4),
+    Point<dim>(std::cos(0*numbers::PI/6),
+    std::sin(0*numbers::PI/6),
+    -4),
+    Point<dim>(std::cos(2*numbers::PI/6),
+    std::sin(2*numbers::PI/6),
+    -4),
+    Point<dim>(std::cos(4*numbers::PI/6),
+    std::sin(4*numbers::PI/6),
+    -4),
+    Point<dim>(std::cos(6*numbers::PI/6),
+    std::sin(6*numbers::PI/6),
+    -4),
+    Point<dim>(std::cos(8*numbers::PI/6),
+    std::sin(8*numbers::PI/6),
+    -4),
+    Point<dim>(std::cos(10*numbers::PI/6),
+    std::sin(10*numbers::PI/6),
+    -4),
+
+    // same points on the top
+    // of the stem, with
+    // indentation in the middle
+    Point<dim>(0,  0, 4-std::sqrt(2.)/2),
+    Point<dim>(std::cos(0*numbers::PI/6),
+    std::sin(0*numbers::PI/6),
+    4),
+    Point<dim>(std::cos(2*numbers::PI/6),
+    std::sin(2*numbers::PI/6),
+    4),
+    Point<dim>(std::cos(4*numbers::PI/6),
+    std::sin(4*numbers::PI/6),
+    4),
+    Point<dim>(std::cos(6*numbers::PI/6),
+    std::sin(6*numbers::PI/6),
+    4),
+    Point<dim>(std::cos(8*numbers::PI/6),
+    std::sin(8*numbers::PI/6),
+    4),
+    Point<dim>(std::cos(10*numbers::PI/6),
+    std::sin(10*numbers::PI/6),
+    4),
+
+    // point at top of chevron
+    Point<dim>(0,0,4+std::sqrt(2.)/2),
+
+    // points at the top of the
+    // first extension
+    // points 15-18
+    Point<dim>(0,  0, 7) + Point<dim> (std::cos(2*numbers::PI/6),
+    std::sin(2*numbers::PI/6),
+    0) * 4,
+    Point<dim>(std::cos(0*numbers::PI/6),
+    std::sin(0*numbers::PI/6),
+    7) + Point<dim> (std::cos(2*numbers::PI/6),
+    std::sin(2*numbers::PI/6),
+    0) * 4,
+    Point<dim>(std::cos(2*numbers::PI/6),
+    std::sin(2*numbers::PI/6),
+    7) + Point<dim> (std::cos(2*numbers::PI/6),
+    std::sin(2*numbers::PI/6),
+    0) * 4,
+    Point<dim>(std::cos(4*numbers::PI/6),
+    std::sin(4*numbers::PI/6),
+    7) + Point<dim> (std::cos(2*numbers::PI/6),
+    std::sin(2*numbers::PI/6),
+    0) * 4,
+
+    // points at the top of the
+    // second extension
+    // points 19-22
+    Point<dim>(0,  0, 7) + Point<dim> (std::cos(6*numbers::PI/6),
+    std::sin(6*numbers::PI/6),
+    0) * 4,
+    Point<dim>(std::cos(4*numbers::PI/6),
+    std::sin(4*numbers::PI/6),
+    7) + Point<dim> (std::cos(6*numbers::PI/6),
+    std::sin(6*numbers::PI/6),
+    0) * 4,
+    Point<dim>(std::cos(6*numbers::PI/6),
+    std::sin(6*numbers::PI/6),
+    7) + Point<dim> (std::cos(6*numbers::PI/6),
+    std::sin(6*numbers::PI/6),
+    0) * 4,
+    Point<dim>(std::cos(8*numbers::PI/6),
+    std::sin(8*numbers::PI/6),
+    7) + Point<dim> (std::cos(6*numbers::PI/6),
+    std::sin(6*numbers::PI/6),
+    0) * 4,
+
+    // points at the top of the
+    // third extension
+    // points 23-26
+    Point<dim>(0,  0, 7) + Point<dim> (std::cos(10*numbers::PI/6),
+    std::sin(10*numbers::PI/6),
+    0) * 4,
+    Point<dim>(std::cos(8*numbers::PI/6),
+    std::sin(8*numbers::PI/6),
+    7) + Point<dim> (std::cos(10*numbers::PI/6),
+    std::sin(10*numbers::PI/6),
+    0) * 4,
+    Point<dim>(std::cos(10*numbers::PI/6),
+    std::sin(10*numbers::PI/6),
+    7) + Point<dim> (std::cos(10*numbers::PI/6),
+    std::sin(10*numbers::PI/6),
+    0) * 4,
+    Point<dim>(std::cos(0*numbers::PI/6),
+    std::sin(0*numbers::PI/6),
+    7) + Point<dim> (std::cos(10*numbers::PI/6),
+    std::sin(10*numbers::PI/6),
+    0) * 4,
+
+  };
+
   const unsigned int
-    n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
+  n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
   const std::vector<Point<dim> > vertices (&vertices_1[0],
                                            &vertices_1[n_vertices]);
   static const int cell_vertices[][GeometryInfo<dim>::vertices_per_cell]
-    = {
-                                          // the three cells in the stem
-         {0, 2, 4, 3, 7, 9, 11, 10},
-         {6, 0, 5, 4, 13, 7, 12, 11},
-         {6, 1, 0, 2, 13, 8, 7, 9},
-                                          // the chevron at the center
-         {13, 8, 7, 9, 12, 14, 11, 10},
-                                          // first extension
-         {14, 8, 10, 9, 15, 16, 18, 17},
-                                          // second extension
-         {11, 12, 10, 14, 21, 22, 20, 19},
-                                          // third extension
-         {12, 13, 14, 8, 24, 25, 23, 26},
-    };
+  =
+  {
+    // the three cells in the stem
+    {0, 2, 4, 3, 7, 9, 11, 10},
+    {6, 0, 5, 4, 13, 7, 12, 11},
+    {6, 1, 0, 2, 13, 8, 7, 9},
+    // the chevron at the center
+    {13, 8, 7, 9, 12, 14, 11, 10},
+    // first extension
+    {14, 8, 10, 9, 15, 16, 18, 17},
+    // second extension
+    {11, 12, 10, 14, 21, 22, 20, 19},
+    // third extension
+    {12, 13, 14, 8, 24, 25, 23, 26},
+  };
   const unsigned int
-    n_cells = sizeof(cell_vertices) / sizeof(cell_vertices[0]);
+  n_cells = sizeof(cell_vertices) / sizeof(cell_vertices[0]);
 
   std::vector<CellData<dim> > cells (n_cells, CellData<dim>());
-  for (unsigned int i=0; i<n_cells; ++i) 
+  for (unsigned int i=0; i<n_cells; ++i)
     {
       for (unsigned int j=0;
            j<GeometryInfo<dim>::vertices_per_cell;
@@ -804,72 +807,72 @@ void LaplaceProblem<3>::create_coarse_grid ()
     }
 
   triangulation.create_triangulation (vertices,
-                                    cells,
-                                    SubCellData());
+                                      cells,
+                                      SubCellData());
 
   for (Triangulation<dim>::active_cell_iterator cell = triangulation.begin_active();
        cell != triangulation.end(); ++cell)
     for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
       if ((cell->face(f)->center()[2] != -4)
-         &&
-         (cell->face(f)->center()[2] != 7)
-         &&
-         (cell->face(f)->at_boundary()))
-       cell->face(f)->set_boundary_indicator (1);
-  
+          &&
+          (cell->face(f)->center()[2] != 7)
+          &&
+          (cell->face(f)->at_boundary()))
+        cell->face(f)->set_boundary_indicator (1);
+
   triangulation.refine_global (1);
 }
 
 
 
 template <int dim>
-void LaplaceProblem<dim>::run () 
+void LaplaceProblem<dim>::run ()
 {
   for (unsigned int cycle=0; cycle<30; ++cycle)
     {
       deallog << "Cycle " << cycle << ':' << std::endl;
 
       if (cycle == 0)
-       create_coarse_grid ();
+        create_coarse_grid ();
       else
-       refine_grid ();
-      
+        refine_grid ();
+
 
       deallog << "   Number of active cells:       "
-               << triangulation.n_active_cells()
-               << std::endl;
+              << triangulation.n_active_cells()
+              << std::endl;
 
       Timer all;
       all.start();
       setup_system ();
 
       deallog << "   Number of degrees of freedom: "
-               << dof_handler.n_dofs()
-               << std::endl;
+              << dof_handler.n_dofs()
+              << std::endl;
       deallog << "   Number of constraints       : "
-               << hanging_node_constraints.n_constraints()
-               << std::endl;
+              << hanging_node_constraints.n_constraints()
+              << std::endl;
 
       assemble.reset ();
       assemble.start ();
       assemble_system ();
       assemble.stop();
-      
+
 
       solver.reset();
       solver.start();
       solve ();
       solver.stop();
-      
+
       all.stop();
     }
 }
 
-int main () 
+int main ()
 {
   std::ofstream logfile(logname);
   logfile.precision (3);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
@@ -881,25 +884,25 @@ int main ()
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
 
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     }
 
index ce01ff6dfcb1c61ad8ce93204c310fd82fcab1e9..9bdfe25f9807f59810aa0fa38db56008d920d9e1 100644 (file)
@@ -51,48 +51,48 @@ void test ()
   triangulation.refine_global(4);
 
   hp::FECollection<dim>    fe_collection;
-  
-          // test the behavior of the FE_Nothing element
-          // in multicomponent systems (for, e.g., solving
-          // Stokes' equations).
-  
+
+  // test the behavior of the FE_Nothing element
+  // in multicomponent systems (for, e.g., solving
+  // Stokes' equations).
+
   fe_collection.push_back (FESystem<dim>(FE_RaviartThomas<dim>(0), 1,
                                          FE_DGQ<dim>(0), 1));
-                                         
+
   fe_collection.push_back (FESystem<dim>(FE_Nothing<dim>(dim), 1,
                                          FE_Nothing<dim>(), 1));
 
 
   hp::DoFHandler<dim>      dof_handler (triangulation);
 
-                                  // loop over cells, and set cells
-                                  // within a circle to be of type
-                                  // FE_Nothing, while outside the
-                                  // circle to be of type RT(0)/DG(0)
-       
+  // loop over cells, and set cells
+  // within a circle to be of type
+  // FE_Nothing, while outside the
+  // circle to be of type RT(0)/DG(0)
+
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
 
-  for(; cell != endc; cell++)
-  {
+  for (; cell != endc; cell++)
+    {
       Point<dim> center = cell->center();
-      if(std::sqrt(center.square()) < 0.25 )
+      if (std::sqrt(center.square()) < 0.25 )
         cell->set_active_fe_index(1);
       else
         cell->set_active_fe_index(0);
-  }
+    }
 
-        // attempt to distribute dofs
+  // attempt to distribute dofs
 
   dof_handler.distribute_dofs (fe_collection);
 
   deallog << "   Number of active cells:       "
-         << triangulation.n_active_cells()
-         << std::endl
-         << "   Number of degrees of freedom: "
-         << dof_handler.n_dofs()
-         << std::endl;
+          << triangulation.n_active_cells()
+          << std::endl
+          << "   Number of degrees of freedom: "
+          << dof_handler.n_dofs()
+          << std::endl;
 }
 
 
index 9e81bb72620c6506f526315f3b837984f44558a1..9ddb438dbc9d6f5b777035318053e119f1ddf4cc 100644 (file)
@@ -64,26 +64,26 @@ std::ofstream logfile("step-14/output");
 namespace Evaluation
 {
   template <int dim>
-  class EvaluationBase 
+  class EvaluationBase
   {
-    public:
-      virtual ~EvaluationBase ();
-
-      void set_refinement_cycle (const unsigned int refinement_cycle);
-      
-      virtual void operator () (const hp::DoFHandler<dim> &dof_handler,
-                               const Vector<double>  &solution) const = 0;
-    protected:
-      unsigned int refinement_cycle;
+  public:
+    virtual ~EvaluationBase ();
+
+    void set_refinement_cycle (const unsigned int refinement_cycle);
+
+    virtual void operator () (const hp::DoFHandler<dim> &dof_handler,
+                              const Vector<double>  &solution) const = 0;
+  protected:
+    unsigned int refinement_cycle;
   };
 
 
   template <int dim>
   EvaluationBase<dim>::~EvaluationBase ()
   {}
-  
 
-  
+
+
   template <int dim>
   void
   EvaluationBase<dim>::set_refinement_cycle (const unsigned int step)
@@ -95,61 +95,61 @@ namespace Evaluation
   template <int dim>
   class PointValueEvaluation : public EvaluationBase<dim>
   {
-    public:
-      PointValueEvaluation (const Point<dim>   &evaluation_point);
-      
-      virtual void operator () (const hp::DoFHandler<dim> &dof_handler,
-                               const Vector<double>  &solution) const;
-      
-      DeclException1 (ExcEvaluationPointNotFound,
-                     Point<dim>,
-                     << "The evaluation point " << arg1
-                     << " was not found among the vertices of the present grid.");
-    private:
-      const Point<dim>  evaluation_point;
+  public:
+    PointValueEvaluation (const Point<dim>   &evaluation_point);
+
+    virtual void operator () (const hp::DoFHandler<dim> &dof_handler,
+                              const Vector<double>  &solution) const;
+
+    DeclException1 (ExcEvaluationPointNotFound,
+                    Point<dim>,
+                    << "The evaluation point " << arg1
+                    << " was not found among the vertices of the present grid.");
+  private:
+    const Point<dim>  evaluation_point;
   };
 
 
   template <int dim>
   PointValueEvaluation<dim>::
   PointValueEvaluation (const Point<dim>   &evaluation_point)
-                 :
-                 evaluation_point (evaluation_point)
+    :
+    evaluation_point (evaluation_point)
   {}
-  
+
 
 
   template <int dim>
   void
   PointValueEvaluation<dim>::
   operator () (const hp::DoFHandler<dim> &dof_handler,
-              const Vector<double>  &solution) const 
+               const Vector<double>  &solution) const
   {
     double point_value = 1e20;
 
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     bool evaluation_point_found = false;
     for (; (cell!=endc) && !evaluation_point_found; ++cell)
       for (unsigned int vertex=0;
-          vertex<GeometryInfo<dim>::vertices_per_cell;
-          ++vertex)
-       if (cell->vertex(vertex).distance (evaluation_point)
-           <
-           cell->diameter() * 1e-8)
-         {
-           point_value = solution(cell->vertex_dof_index(vertex,0));
-
-           evaluation_point_found = true;
-           break;
-         };
+           vertex<GeometryInfo<dim>::vertices_per_cell;
+           ++vertex)
+        if (cell->vertex(vertex).distance (evaluation_point)
+            <
+            cell->diameter() * 1e-8)
+          {
+            point_value = solution(cell->vertex_dof_index(vertex,0));
+
+            evaluation_point_found = true;
+            break;
+          };
 
     AssertThrow (evaluation_point_found,
-                ExcEvaluationPointNotFound(evaluation_point));
+                 ExcEvaluationPointNotFound(evaluation_point));
 
     deallog << "   Point value=" << point_value
-             << std::endl;
+            << std::endl;
   }
 
 
@@ -157,160 +157,160 @@ namespace Evaluation
   template <int dim>
   class PointXDerivativeEvaluation : public EvaluationBase<dim>
   {
-    public:
-      PointXDerivativeEvaluation (const Point<dim>   &evaluation_point);
-      
-      virtual void operator () (const hp::DoFHandler<dim> &dof_handler,
-                               const Vector<double>  &solution) const;
-      
-      DeclException1 (ExcEvaluationPointNotFound,
-                     Point<dim>,
-                     << "The evaluation point " << arg1
-                     << " was not found among the vertices of the present grid.");
-    private:
-      const Point<dim>  evaluation_point;
+  public:
+    PointXDerivativeEvaluation (const Point<dim>   &evaluation_point);
+
+    virtual void operator () (const hp::DoFHandler<dim> &dof_handler,
+                              const Vector<double>  &solution) const;
+
+    DeclException1 (ExcEvaluationPointNotFound,
+                    Point<dim>,
+                    << "The evaluation point " << arg1
+                    << " was not found among the vertices of the present grid.");
+  private:
+    const Point<dim>  evaluation_point;
   };
 
 
   template <int dim>
   PointXDerivativeEvaluation<dim>::
   PointXDerivativeEvaluation (const Point<dim>   &evaluation_point)
-                 :
-                 evaluation_point (evaluation_point)
+    :
+    evaluation_point (evaluation_point)
   {}
-  
+
 
   template <int dim>
   void
   PointXDerivativeEvaluation<dim>::
   operator () (const hp::DoFHandler<dim> &dof_handler,
-              const Vector<double>  &solution) const 
+               const Vector<double>  &solution) const
   {
     double point_derivative = 0;
 
     QTrapez<dim>  vertex_quadrature;
     hp::FEValues<dim> fe_values (dof_handler.get_fe(),
-                            vertex_quadrature,
-                            update_gradients | update_q_points);
+                                 vertex_quadrature,
+                                 update_gradients | update_q_points);
     std::vector<Tensor<1,dim> >
-      solution_gradients (vertex_quadrature.size());
-    
+    solution_gradients (vertex_quadrature.size());
+
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     unsigned int evaluation_point_hits = 0;
     for (; cell!=endc; ++cell)
       for (unsigned int vertex=0;
-          vertex<GeometryInfo<dim>::vertices_per_cell;
-          ++vertex)
-       if (cell->vertex(vertex) == evaluation_point)
-         {
-           fe_values.reinit (cell);
-           fe_values.get_present_fe_values().get_function_grads (solution,
-                                         solution_gradients);
-
-           unsigned int q_point = 0;
-           for (; q_point<solution_gradients.size(); ++q_point)
-             if (fe_values.get_present_fe_values().quadrature_point(q_point) ==
-                 evaluation_point)
-               break;
-
-           Assert (q_point < solution_gradients.size(),
-                   ExcInternalError());
-           point_derivative += solution_gradients[q_point][0];
-           ++evaluation_point_hits;
-
-           break;
-         };
+           vertex<GeometryInfo<dim>::vertices_per_cell;
+           ++vertex)
+        if (cell->vertex(vertex) == evaluation_point)
+          {
+            fe_values.reinit (cell);
+            fe_values.get_present_fe_values().get_function_grads (solution,
+                                                                  solution_gradients);
+
+            unsigned int q_point = 0;
+            for (; q_point<solution_gradients.size(); ++q_point)
+              if (fe_values.get_present_fe_values().quadrature_point(q_point) ==
+                  evaluation_point)
+                break;
+
+            Assert (q_point < solution_gradients.size(),
+                    ExcInternalError());
+            point_derivative += solution_gradients[q_point][0];
+            ++evaluation_point_hits;
+
+            break;
+          };
 
     AssertThrow (evaluation_point_hits > 0,
-                ExcEvaluationPointNotFound(evaluation_point));
+                 ExcEvaluationPointNotFound(evaluation_point));
 
     point_derivative /= evaluation_point_hits;
     deallog << "   Point x-derivative=" << point_derivative
-             << std::endl;
+            << std::endl;
   }
 
 
-  
+
 
   template <int dim>
   class GridOutput : public EvaluationBase<dim>
   {
-    public:
-      GridOutput (const std::string &output_name_base);
-      
-      virtual void operator () (const hp::DoFHandler<dim> &dof_handler,
-                               const Vector<double>  &solution) const;
-    private:
-      const std::string output_name_base;
+  public:
+    GridOutput (const std::string &output_name_base);
+
+    virtual void operator () (const hp::DoFHandler<dim> &dof_handler,
+                              const Vector<double>  &solution) const;
+  private:
+    const std::string output_name_base;
   };
 
 
   template <int dim>
   GridOutput<dim>::
   GridOutput (const std::string &output_name_base)
-                 :
-                 output_name_base (output_name_base)
+    :
+    output_name_base (output_name_base)
   {}
-  
+
 
   template <int dim>
   void
   GridOutput<dim>::operator () (const hp::DoFHandler<dim> &dof_handler,
-                               const Vector<double>  &/*solution*/) const
+                                const Vector<double>  &/*solution*/) const
   {
     std::ostringstream filename;
     filename << output_name_base << "-"
-            << this->refinement_cycle
-            << ".eps"
-            << std::ends;
-    
+             << this->refinement_cycle
+             << ".eps"
+             << std::ends;
+
     GridOut().write_eps (dof_handler.get_tria(),
-                        deallog.get_file_stream());
+                         deallog.get_file_stream());
   }
 }
 
-  
+
 
 namespace LaplaceSolver
 {
   template <int dim> class WeightedResidual;
-  
-  
+
+
 
   template <int dim>
   class Base
   {
-    public:
-      Base (Triangulation<dim> &coarse_grid);
-      virtual ~Base ();
+  public:
+    Base (Triangulation<dim> &coarse_grid);
+    virtual ~Base ();
 
-      virtual void solve_problem () = 0;
-      virtual void postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const = 0;
-      virtual void refine_grid () = 0;
-      virtual unsigned int n_dofs () const = 0;
+    virtual void solve_problem () = 0;
+    virtual void postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const = 0;
+    virtual void refine_grid () = 0;
+    virtual unsigned int n_dofs () const = 0;
 
-      virtual void set_refinement_cycle (const unsigned int cycle);
+    virtual void set_refinement_cycle (const unsigned int cycle);
 
-      virtual void output_solution () const = 0;
-      
-    protected:
-      const SmartPointer<Triangulation<dim> > triangulation;
+    virtual void output_solution () const = 0;
 
-      unsigned int refinement_cycle;
+  protected:
+    const SmartPointer<Triangulation<dim> > triangulation;
+
+    unsigned int refinement_cycle;
   };
 
 
   template <int dim>
   Base<dim>::Base (Triangulation<dim> &coarse_grid)
-                 :
-                 triangulation (&coarse_grid)
+    :
+    triangulation (&coarse_grid)
   {}
 
 
   template <int dim>
-  Base<dim>::~Base () 
+  Base<dim>::~Base ()
   {}
 
 
@@ -321,86 +321,86 @@ namespace LaplaceSolver
   {
     refinement_cycle = cycle;
   }
-  
+
 
 
   template <int dim>
   class Solver : public virtual Base<dim>
   {
-    public:
-      Solver (Triangulation<dim>       &triangulation,
-             const hp::FECollection<dim> &fe,
-             const hp::QCollection<dim>    &quadrature,
-             const hp::QCollection<dim-1>  &face_quadrature,         
-             const Function<dim>      &boundary_values);
-      virtual
-      ~Solver ();
-
-      virtual
-      void
-      solve_problem ();
-
-      virtual
-      void
-      postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const;
-
-      virtual
-      unsigned int
-      n_dofs () const;
-      
-    protected:
-      const SmartPointer<const hp::FECollection<dim> >  fe;
-      const SmartPointer<const hp::QCollection<dim> >     quadrature;
-      const SmartPointer<const hp::QCollection<dim-1> >   face_quadrature;      
-      hp::DoFHandler<dim>                                dof_handler;
-      Vector<double>                                 solution;
-      const SmartPointer<const Function<dim> >       boundary_values;
-
-      virtual void assemble_rhs (Vector<double> &rhs) const = 0;
-    
-    private:
-      struct LinearSystem
-      {
-         LinearSystem (const hp::DoFHandler<dim> &dof_handler);
-
-         void solve (Vector<double> &solution) const;
-       
-         ConstraintMatrix     hanging_node_constraints;
-         SparsityPattern      sparsity_pattern;
-         SparseMatrix<double> matrix;
-         Vector<double>       rhs;
-      };
+  public:
+    Solver (Triangulation<dim>       &triangulation,
+            const hp::FECollection<dim> &fe,
+            const hp::QCollection<dim>    &quadrature,
+            const hp::QCollection<dim-1>  &face_quadrature,
+            const Function<dim>      &boundary_values);
+    virtual
+    ~Solver ();
+
+    virtual
+    void
+    solve_problem ();
+
+    virtual
+    void
+    postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const;
+
+    virtual
+    unsigned int
+    n_dofs () const;
+
+  protected:
+    const SmartPointer<const hp::FECollection<dim> >  fe;
+    const SmartPointer<const hp::QCollection<dim> >     quadrature;
+    const SmartPointer<const hp::QCollection<dim-1> >   face_quadrature;
+    hp::DoFHandler<dim>                                dof_handler;
+    Vector<double>                                 solution;
+    const SmartPointer<const Function<dim> >       boundary_values;
+
+    virtual void assemble_rhs (Vector<double> &rhs) const = 0;
+
+  private:
+    struct LinearSystem
+    {
+      LinearSystem (const hp::DoFHandler<dim> &dof_handler);
+
+      void solve (Vector<double> &solution) const;
 
-      void
-      assemble_linear_system (LinearSystem &linear_system);
+      ConstraintMatrix     hanging_node_constraints;
+      SparsityPattern      sparsity_pattern;
+      SparseMatrix<double> matrix;
+      Vector<double>       rhs;
+    };
+
+    void
+    assemble_linear_system (LinearSystem &linear_system);
 
-      void
-      assemble_matrix (LinearSystem                                         &linear_system,
-                      const typename hp::DoFHandler<dim>::active_cell_iterator &begin_cell,
-                      const typename hp::DoFHandler<dim>::active_cell_iterator &end_cell,
-                      Threads::ThreadMutex                                 &mutex) const;
+    void
+    assemble_matrix (LinearSystem                                         &linear_system,
+                     const typename hp::DoFHandler<dim>::active_cell_iterator &begin_cell,
+                     const typename hp::DoFHandler<dim>::active_cell_iterator &end_cell,
+                     Threads::ThreadMutex                                 &mutex) const;
   };
 
 
 
   template <int dim>
   Solver<dim>::Solver (Triangulation<dim>       &triangulation,
-                      const hp::FECollection<dim> &fe,
-                      const hp::QCollection<dim>    &quadrature,
-                      const hp::QCollection<dim-1>  &face_quadrature,
-                      const Function<dim>      &boundary_values)
-                 :
-                 Base<dim> (triangulation),
-                 fe (&fe),
-                  quadrature (&quadrature),
-                  face_quadrature (&face_quadrature),    
-                 dof_handler (triangulation),
-                 boundary_values (&boundary_values)
+                       const hp::FECollection<dim> &fe,
+                       const hp::QCollection<dim>    &quadrature,
+                       const hp::QCollection<dim-1>  &face_quadrature,
+                       const Function<dim>      &boundary_values)
+    :
+    Base<dim> (triangulation),
+    fe (&fe),
+    quadrature (&quadrature),
+    face_quadrature (&face_quadrature),
+    dof_handler (triangulation),
+    boundary_values (&boundary_values)
   {}
 
 
   template <int dim>
-  Solver<dim>::~Solver () 
+  Solver<dim>::~Solver ()
   {
     dof_handler.clear ();
   }
@@ -434,22 +434,22 @@ namespace LaplaceSolver
   {
     return dof_handler.n_dofs();
   }
-  
+
 
   template <int dim>
   void
   Solver<dim>::assemble_linear_system (LinearSystem &linear_system)
   {
     typedef
-      typename hp::DoFHandler<dim>::active_cell_iterator
-      active_cell_iterator;
+    typename hp::DoFHandler<dim>::active_cell_iterator
+    active_cell_iterator;
 
     const unsigned int n_threads = multithread_info.n_default_threads;
     std::vector<std::pair<active_cell_iterator,active_cell_iterator> >
-      thread_ranges 
+    thread_ranges
       = Threads::split_range<active_cell_iterator> (dof_handler.begin_active (),
-                                                   dof_handler.end (),
-                                                   n_threads);
+                                                    dof_handler.end (),
+                                                    n_threads);
 
     Threads::ThreadMutex mutex;
     Threads::ThreadGroup<> threads;
@@ -465,29 +465,29 @@ namespace LaplaceSolver
 
     std::map<types::global_dof_index,double> boundary_value_map;
     VectorTools::interpolate_boundary_values (dof_handler,
-                                             0,
-                                             *boundary_values,
-                                             boundary_value_map);
-    
+                                              0,
+                                              *boundary_values,
+                                              boundary_value_map);
+
     threads.join_all ();
     linear_system.hanging_node_constraints.condense (linear_system.matrix);
 
     MatrixTools::apply_boundary_values (boundary_value_map,
-                                       linear_system.matrix,
-                                       solution,
-                                       linear_system.rhs);
+                                        linear_system.matrix,
+                                        solution,
+                                        linear_system.rhs);
   }
 
 
   template <int dim>
   void
   Solver<dim>::assemble_matrix (LinearSystem                                         &linear_system,
-                               const typename hp::DoFHandler<dim>::active_cell_iterator &begin_cell,
-                               const typename hp::DoFHandler<dim>::active_cell_iterator &end_cell,
-                               Threads::ThreadMutex                                 &mutex) const
+                                const typename hp::DoFHandler<dim>::active_cell_iterator &begin_cell,
+                                const typename hp::DoFHandler<dim>::active_cell_iterator &end_cell,
+                                Threads::ThreadMutex                                 &mutex) const
   {
-    hp::FEValues<dim> fe_values (*fe, *quadrature, 
-                            update_gradients | update_JxW_values);
+    hp::FEValues<dim> fe_values (*fe, *quadrature,
+                                 update_gradients | update_JxW_values);
 
     const unsigned int   dofs_per_cell = (*fe)[0].dofs_per_cell;
     const unsigned int   n_q_points    = (*quadrature)[0].size();
@@ -497,27 +497,27 @@ namespace LaplaceSolver
     std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     for (typename hp::DoFHandler<dim>::active_cell_iterator cell=begin_cell;
-        cell!=end_cell; ++cell)
+         cell!=end_cell; ++cell)
       {
-       cell_matrix = 0;
+        cell_matrix = 0;
 
-       fe_values.reinit (cell);
+        fe_values.reinit (cell);
 
-       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-         for (unsigned int i=0; i<dofs_per_cell; ++i)
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += (fe_values.get_present_fe_values().shape_grad(i,q_point) *
-                                  fe_values.get_present_fe_values().shape_grad(j,q_point) *
-                                  fe_values.get_present_fe_values().JxW(q_point));
+        for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+          for (unsigned int i=0; i<dofs_per_cell; ++i)
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += (fe_values.get_present_fe_values().shape_grad(i,q_point) *
+                                   fe_values.get_present_fe_values().shape_grad(j,q_point) *
+                                   fe_values.get_present_fe_values().JxW(q_point));
 
 
-       cell->get_dof_indices (local_dof_indices);
-       Threads::ThreadMutex::ScopedLock lock (mutex);
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           linear_system.matrix.add (local_dof_indices[i],
-                                     local_dof_indices[j],
-                                     cell_matrix(i,j));
+        cell->get_dof_indices (local_dof_indices);
+        Threads::ThreadMutex::ScopedLock lock (mutex);
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            linear_system.matrix.add (local_dof_indices[i],
+                                      local_dof_indices[j],
+                                      cell_matrix(i,j));
       };
   }
 
@@ -529,15 +529,15 @@ namespace LaplaceSolver
     hanging_node_constraints.clear ();
 
     void (*mhnc_p) (const hp::DoFHandler<dim> &,
-                   ConstraintMatrix      &)
+                    ConstraintMatrix &)
       = &DoFTools::make_hanging_node_constraints;
-    
+
     Threads::Thread<>
-      mhnc_thread = Threads::spawn (mhnc_p)(dof_handler, hanging_node_constraints);
+    mhnc_thread = Threads::spawn (mhnc_p)(dof_handler, hanging_node_constraints);
 
     sparsity_pattern.reinit (dof_handler.n_dofs(),
-                            dof_handler.n_dofs(),
-                            dof_handler.max_couplings_between_dofs());
+                             dof_handler.n_dofs(),
+                             dof_handler.max_couplings_between_dofs());
     DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
 
     mhnc_thread.join ();
@@ -573,48 +573,48 @@ namespace LaplaceSolver
   template <int dim>
   class PrimalSolver : public Solver<dim>
   {
-    public:
-      PrimalSolver (Triangulation<dim>       &triangulation,
-                   const hp::FECollection<dim> &fe,
-                   const hp::QCollection<dim>    &quadrature,
-                   const hp::QCollection<dim-1>  &face_quadrature,
-                   const Function<dim>      &rhs_function,
-                   const Function<dim>      &boundary_values);
-
-      virtual
-      void solve_problem ();
-      
-      virtual
-      unsigned int n_dofs () const;
-      
-      virtual
-      void postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const;
-
-      virtual
-      void output_solution () const;
-      
-    protected:
-      const SmartPointer<const Function<dim> > rhs_function;
-      virtual void assemble_rhs (Vector<double> &rhs) const;
-
-      friend class WeightedResidual<dim>;
+  public:
+    PrimalSolver (Triangulation<dim>       &triangulation,
+                  const hp::FECollection<dim> &fe,
+                  const hp::QCollection<dim>    &quadrature,
+                  const hp::QCollection<dim-1>  &face_quadrature,
+                  const Function<dim>      &rhs_function,
+                  const Function<dim>      &boundary_values);
+
+    virtual
+    void solve_problem ();
+
+    virtual
+    unsigned int n_dofs () const;
+
+    virtual
+    void postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const;
+
+    virtual
+    void output_solution () const;
+
+  protected:
+    const SmartPointer<const Function<dim> > rhs_function;
+    virtual void assemble_rhs (Vector<double> &rhs) const;
+
+    friend class WeightedResidual<dim>;
   };
 
 
   template <int dim>
   PrimalSolver<dim>::
   PrimalSolver (Triangulation<dim>       &triangulation,
-               const hp::FECollection<dim> &fe,
-               const hp::QCollection<dim>    &quadrature,
-               const hp::QCollection<dim-1>  &face_quadrature,
-               const Function<dim>      &rhs_function,
-               const Function<dim>      &boundary_values)
-                 :
-                 Base<dim> (triangulation),
-                 Solver<dim> (triangulation, fe,
-                              quadrature, face_quadrature,
-                              boundary_values),
-                  rhs_function (&rhs_function)
+                const hp::FECollection<dim> &fe,
+                const hp::QCollection<dim>    &quadrature,
+                const hp::QCollection<dim-1>  &face_quadrature,
+                const Function<dim>      &rhs_function,
+                const Function<dim>      &boundary_values)
+    :
+    Base<dim> (triangulation),
+    Solver<dim> (triangulation, fe,
+                 quadrature, face_quadrature,
+                 boundary_values),
+    rhs_function (&rhs_function)
   {}
 
 
@@ -655,22 +655,22 @@ namespace LaplaceSolver
 
     std::ostringstream filename;
     filename << "solution-"
-            << this->refinement_cycle
-            << ".gnuplot"
-            << std::ends;
+             << this->refinement_cycle
+             << ".gnuplot"
+             << std::ends;
     data_out.write (deallog.get_file_stream(), DataOut<dim>::gnuplot);
   }
-  
+
 
 
   template <int dim>
   void
   PrimalSolver<dim>::
-  assemble_rhs (Vector<double> &rhs) const 
+  assemble_rhs (Vector<double> &rhs) const
   {
-    hp::FEValues<dim> fe_values (*this->fe, *this->quadrature, 
-                            update_values  | update_q_points  |
-                             update_JxW_values);
+    hp::FEValues<dim> fe_values (*this->fe, *this->quadrature,
+                                 update_values  | update_q_points  |
+                                 update_JxW_values);
 
     const unsigned int   dofs_per_cell = (*this->fe)[0].dofs_per_cell;
     const unsigned int   n_q_points    = (*this->quadrature)[0].size();
@@ -680,26 +680,26 @@ namespace LaplaceSolver
     std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = this->dof_handler.begin_active(),
-      endc = this->dof_handler.end();
+    cell = this->dof_handler.begin_active(),
+    endc = this->dof_handler.end();
     for (; cell!=endc; ++cell)
       {
-       cell_rhs = 0;
-
-       fe_values.reinit (cell);
-
-       rhs_function->value_list (fe_values.get_present_fe_values().get_quadrature_points(),
-                                 rhs_values);
-      
-       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-         for (unsigned int i=0; i<dofs_per_cell; ++i)
-           cell_rhs(i) += (fe_values.get_present_fe_values().shape_value(i,q_point) *
-                           rhs_values[q_point] *
-                           fe_values.get_present_fe_values().JxW(q_point));
-
-       cell->get_dof_indices (local_dof_indices);
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         rhs(local_dof_indices[i]) += cell_rhs(i);
+        cell_rhs = 0;
+
+        fe_values.reinit (cell);
+
+        rhs_function->value_list (fe_values.get_present_fe_values().get_quadrature_points(),
+                                  rhs_values);
+
+        for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+          for (unsigned int i=0; i<dofs_per_cell; ++i)
+            cell_rhs(i) += (fe_values.get_present_fe_values().shape_value(i,q_point) *
+                            rhs_values[q_point] *
+                            fe_values.get_present_fe_values().JxW(q_point));
+
+        cell->get_dof_indices (local_dof_indices);
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          rhs(local_dof_indices[i]) += cell_rhs(i);
       }
   }
 
@@ -708,15 +708,15 @@ namespace LaplaceSolver
   template <int dim>
   class RefinementGlobal : public PrimalSolver<dim>
   {
-    public:
-      RefinementGlobal (Triangulation<dim>       &coarse_grid,
-                       const hp::FECollection<dim> &fe,
-                       const hp::QCollection<dim>    &quadrature,
-                       const hp::QCollection<dim-1>  &face_quadrature,
-                       const Function<dim>      &rhs_function,
-                       const Function<dim>      &boundary_values);
-
-      virtual void refine_grid ();
+  public:
+    RefinementGlobal (Triangulation<dim>       &coarse_grid,
+                      const hp::FECollection<dim> &fe,
+                      const hp::QCollection<dim>    &quadrature,
+                      const hp::QCollection<dim-1>  &face_quadrature,
+                      const Function<dim>      &rhs_function,
+                      const Function<dim>      &boundary_values);
+
+    virtual void refine_grid ();
   };
 
 
@@ -724,16 +724,16 @@ namespace LaplaceSolver
   template <int dim>
   RefinementGlobal<dim>::
   RefinementGlobal (Triangulation<dim>       &coarse_grid,
-                   const hp::FECollection<dim> &fe,
-                   const hp::QCollection<dim>    &quadrature,
-                   const hp::QCollection<dim-1>  &face_quadrature,
-                   const Function<dim>      &rhs_function,
-                   const Function<dim>      &boundary_values)
-                 :
-                 Base<dim> (coarse_grid),
-                  PrimalSolver<dim> (coarse_grid, fe, quadrature,
-                                    face_quadrature, rhs_function,
-                                    boundary_values)
+                    const hp::FECollection<dim> &fe,
+                    const hp::QCollection<dim>    &quadrature,
+                    const hp::QCollection<dim-1>  &face_quadrature,
+                    const Function<dim>      &rhs_function,
+                    const Function<dim>      &boundary_values)
+    :
+    Base<dim> (coarse_grid),
+    PrimalSolver<dim> (coarse_grid, fe, quadrature,
+                       face_quadrature, rhs_function,
+                       boundary_values)
   {}
 
 
@@ -750,15 +750,15 @@ namespace LaplaceSolver
   template <int dim>
   class RefinementKelly : public PrimalSolver<dim>
   {
-    public:
-      RefinementKelly (Triangulation<dim>       &coarse_grid,
-                      const hp::FECollection<dim> &fe,
-                      const hp::QCollection<dim>    &quadrature,
-                      const hp::QCollection<dim-1>  &face_quadrature,
-                      const Function<dim>      &rhs_function,
-                      const Function<dim>      &boundary_values);
-
-      virtual void refine_grid ();
+  public:
+    RefinementKelly (Triangulation<dim>       &coarse_grid,
+                     const hp::FECollection<dim> &fe,
+                     const hp::QCollection<dim>    &quadrature,
+                     const hp::QCollection<dim-1>  &face_quadrature,
+                     const Function<dim>      &rhs_function,
+                     const Function<dim>      &boundary_values);
+
+    virtual void refine_grid ();
   };
 
 
@@ -766,16 +766,16 @@ namespace LaplaceSolver
   template <int dim>
   RefinementKelly<dim>::
   RefinementKelly (Triangulation<dim>       &coarse_grid,
-                  const hp::FECollection<dim> &fe,
-                  const hp::QCollection<dim>    &quadrature,
-                  const hp::QCollection<dim-1>  &face_quadrature,
-                  const Function<dim>      &rhs_function,
-                  const Function<dim>      &boundary_values)
-                 :
-                 Base<dim> (coarse_grid),
-                  PrimalSolver<dim> (coarse_grid, fe, quadrature,
-                                    face_quadrature,
-                                    rhs_function, boundary_values)
+                   const hp::FECollection<dim> &fe,
+                   const hp::QCollection<dim>    &quadrature,
+                   const hp::QCollection<dim-1>  &face_quadrature,
+                   const Function<dim>      &rhs_function,
+                   const Function<dim>      &boundary_values)
+    :
+    Base<dim> (coarse_grid),
+    PrimalSolver<dim> (coarse_grid, fe, quadrature,
+                       face_quadrature,
+                       rhs_function, boundary_values)
   {}
 
 
@@ -786,13 +786,13 @@ namespace LaplaceSolver
   {
     Vector<float> estimated_error_per_cell (this->triangulation->n_active_cells());
     KellyErrorEstimator<dim>::estimate (this->dof_handler,
-                                       QGauss<dim-1>(3),
-                                       typename FunctionMap<dim>::type(),
-                                       this->solution,
-                                       estimated_error_per_cell);
+                                        QGauss<dim-1>(3),
+                                        typename FunctionMap<dim>::type(),
+                                        this->solution,
+                                        estimated_error_per_cell);
     GridRefinement::refine_and_coarsen_fixed_number (*this->triangulation,
-                                                    estimated_error_per_cell,
-                                                    0.3, 0.03);
+                                                     estimated_error_per_cell,
+                                                     0.3, 0.03);
     this->triangulation->execute_coarsening_and_refinement ();
   }
 
@@ -802,19 +802,19 @@ namespace LaplaceSolver
   template <int dim>
   class RefinementWeightedKelly : public PrimalSolver<dim>
   {
-    public:
-      RefinementWeightedKelly (Triangulation<dim>       &coarse_grid,
-                              const hp::FECollection<dim> &fe,
-                              const hp::QCollection<dim>    &quadrature,
-                              const hp::QCollection<dim-1>  &face_quadrature,
-                              const Function<dim>      &rhs_function,
-                              const Function<dim>      &boundary_values,
-                              const Function<dim>      &weighting_function);
-
-      virtual void refine_grid ();
-
-    private:
-      const SmartPointer<const Function<dim> > weighting_function;
+  public:
+    RefinementWeightedKelly (Triangulation<dim>       &coarse_grid,
+                             const hp::FECollection<dim> &fe,
+                             const hp::QCollection<dim>    &quadrature,
+                             const hp::QCollection<dim-1>  &face_quadrature,
+                             const Function<dim>      &rhs_function,
+                             const Function<dim>      &boundary_values,
+                             const Function<dim>      &weighting_function);
+
+    virtual void refine_grid ();
+
+  private:
+    const SmartPointer<const Function<dim> > weighting_function;
   };
 
 
@@ -822,18 +822,18 @@ namespace LaplaceSolver
   template <int dim>
   RefinementWeightedKelly<dim>::
   RefinementWeightedKelly (Triangulation<dim>       &coarse_grid,
-                          const hp::FECollection<dim> &fe,
-                          const hp::QCollection<dim>    &quadrature,
-                          const hp::QCollection<dim-1>  &face_quadrature,
-                          const Function<dim>      &rhs_function,
-                          const Function<dim>      &boundary_values,
-                          const Function<dim>      &weighting_function)
-                 :
-                 Base<dim> (coarse_grid),
-                  PrimalSolver<dim> (coarse_grid, fe, quadrature,
-                                    face_quadrature,
-                                    rhs_function, boundary_values),
-                  weighting_function (&weighting_function)
+                           const hp::FECollection<dim> &fe,
+                           const hp::QCollection<dim>    &quadrature,
+                           const hp::QCollection<dim-1>  &face_quadrature,
+                           const Function<dim>      &rhs_function,
+                           const Function<dim>      &boundary_values,
+                           const Function<dim>      &weighting_function)
+    :
+    Base<dim> (coarse_grid),
+    PrimalSolver<dim> (coarse_grid, fe, quadrature,
+                       face_quadrature,
+                       rhs_function, boundary_values),
+    weighting_function (&weighting_function)
   {}
 
 
@@ -844,21 +844,21 @@ namespace LaplaceSolver
   {
     Vector<float> estimated_error (this->triangulation->n_active_cells());
     KellyErrorEstimator<dim>::estimate (this->dof_handler,
-                                       (*this->face_quadrature)[0],
-                                       typename FunctionMap<dim>::type(),
-                                       this->solution,
-                                       estimated_error);
+                                        (*this->face_quadrature)[0],
+                                        typename FunctionMap<dim>::type(),
+                                        this->solution,
+                                        estimated_error);
 
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = this->dof_handler.begin_active(),
-      endc = this->dof_handler.end();
+    cell = this->dof_handler.begin_active(),
+    endc = this->dof_handler.end();
     for (unsigned int cell_index=0; cell!=endc; ++cell, ++cell_index)
       estimated_error(cell_index)
-       *= weighting_function->value (cell->center());
-    
+      *= weighting_function->value (cell->center());
+
     GridRefinement::refine_and_coarsen_fixed_number (*this->triangulation,
-                                                    estimated_error,
-                                                    0.3, 0.03);
+                                                     estimated_error,
+                                                     0.3, 0.03);
     this->triangulation->execute_coarsening_and_refinement ();
   }
 
@@ -867,39 +867,39 @@ namespace LaplaceSolver
 
 namespace Data
 {
-  
+
   template <int dim>
   struct SetUpBase : public Subscriptor
   {
-      virtual
-      const Function<dim> &  get_boundary_values () const = 0;
+    virtual
+    const Function<dim>   &get_boundary_values () const = 0;
 
-      virtual
-      const Function<dim> &  get_right_hand_side () const = 0;
+    virtual
+    const Function<dim>   &get_right_hand_side () const = 0;
 
-      virtual
-      void create_coarse_grid (Triangulation<dim> &coarse_grid) const = 0;
+    virtual
+    void create_coarse_grid (Triangulation<dim> &coarse_grid) const = 0;
   };
 
 
   template <class Traits, int dim>
   struct SetUp : public SetUpBase<dim>
   {
-      SetUp () {}
+    SetUp () {}
+
+    virtual
+    const Function<dim>   &get_boundary_values () const;
 
-      virtual
-      const Function<dim> &  get_boundary_values () const;
+    virtual
+    const Function<dim>   &get_right_hand_side () const;
 
-      virtual
-      const Function<dim> &  get_right_hand_side () const;
-      
 
-      virtual
-      void create_coarse_grid (Triangulation<dim> &coarse_grid) const;
+    virtual
+    void create_coarse_grid (Triangulation<dim> &coarse_grid) const;
 
-    private:
-      static const typename Traits::BoundaryValues boundary_values;
-      static const typename Traits::RightHandSide  right_hand_side;
+  private:
+    static const typename Traits::BoundaryValues boundary_values;
+    static const typename Traits::RightHandSide  right_hand_side;
   };
 
   template <class Traits, int dim>
@@ -909,7 +909,7 @@ namespace Data
 
   template <class Traits, int dim>
   const Function<dim> &
-  SetUp<Traits,dim>::get_boundary_values () const 
+  SetUp<Traits,dim>::get_boundary_values () const
   {
     return boundary_values;
   }
@@ -917,7 +917,7 @@ namespace Data
 
   template <class Traits, int dim>
   const Function<dim> &
-  SetUp<Traits,dim>::get_right_hand_side () const 
+  SetUp<Traits,dim>::get_right_hand_side () const
   {
     return right_hand_side;
   }
@@ -926,46 +926,46 @@ namespace Data
   template <class Traits, int dim>
   void
   SetUp<Traits,dim>::
-  create_coarse_grid (Triangulation<dim> &coarse_grid) const 
+  create_coarse_grid (Triangulation<dim> &coarse_grid) const
   {
     Traits::create_coarse_grid (coarse_grid);
   }
-  
+
 
 
   template <int dim>
   struct CurvedRidges
   {
-      class BoundaryValues : public Function<dim>
-      {
-       public:
-         BoundaryValues () : Function<dim> () {}
-         
-         virtual double value (const Point<dim>   &p,
-                               const unsigned int  component) const;
-      };
+    class BoundaryValues : public Function<dim>
+    {
+    public:
+      BoundaryValues () : Function<dim> () {}
 
+      virtual double value (const Point<dim>   &p,
+                            const unsigned int  component) const;
+    };
 
-      class RightHandSide : public Function<dim>
-      {
-       public:
-         RightHandSide () : Function<dim> () {}
-         
-         virtual double value (const Point<dim>   &p,
-                               const unsigned int  component) const;
-      };
 
-      static
-      void
-      create_coarse_grid (Triangulation<dim> &coarse_grid);
+    class RightHandSide : public Function<dim>
+    {
+    public:
+      RightHandSide () : Function<dim> () {}
+
+      virtual double value (const Point<dim>   &p,
+                            const unsigned int  component) const;
+    };
+
+    static
+    void
+    create_coarse_grid (Triangulation<dim> &coarse_grid);
   };
-  
-    
+
+
   template <int dim>
   double
   CurvedRidges<dim>::BoundaryValues::
   value (const Point<dim>   &p,
-        const unsigned int  /*component*/) const
+         const unsigned int  /*component*/) const
   {
     double q = p(0);
     for (unsigned int i=1; i<dim; ++i)
@@ -979,25 +979,25 @@ namespace Data
   template <int dim>
   double
   CurvedRidges<dim>::RightHandSide::value (const Point<dim>   &p,
-                                          const unsigned int  /*component*/) const
+                                           const unsigned int  /*component*/) const
   {
     double q = p(0);
     for (unsigned int i=1; i<dim; ++i)
       q += std::sin(10*p(i)+5*p(0)*p(0));
     const double u = std::exp(q);
     double t1 = 1,
-          t2 = 0,
-          t3 = 0;
+           t2 = 0,
+           t3 = 0;
     for (unsigned int i=1; i<dim; ++i)
       {
-       t1 += std::cos(10*p(i)+5*p(0)*p(0)) * 10 * p(0);
-       t2 += 10*std::cos(10*p(i)+5*p(0)*p(0)) -
-             100*std::sin(10*p(i)+5*p(0)*p(0)) * p(0)*p(0);
-       t3 += 100*std::cos(10*p(i)+5*p(0)*p(0))*std::cos(10*p(i)+5*p(0)*p(0)) -
-             100*std::sin(10*p(i)+5*p(0)*p(0));
+        t1 += std::cos(10*p(i)+5*p(0)*p(0)) * 10 * p(0);
+        t2 += 10*std::cos(10*p(i)+5*p(0)*p(0)) -
+              100*std::sin(10*p(i)+5*p(0)*p(0)) * p(0)*p(0);
+        t3 += 100*std::cos(10*p(i)+5*p(0)*p(0))*std::cos(10*p(i)+5*p(0)*p(0)) -
+              100*std::sin(10*p(i)+5*p(0)*p(0));
       };
     t1 = t1*t1;
-    
+
     return -u*(t1+t2+t3);
   }
 
@@ -1010,23 +1010,23 @@ namespace Data
     GridGenerator::hyper_cube (coarse_grid, -1, 1);
     coarse_grid.refine_global (2);
   }
-  
 
-  
+
+
   template <int dim>
   struct Exercise_2_3
   {
-      typedef ZeroFunction<dim> BoundaryValues;
+    typedef ZeroFunction<dim> BoundaryValues;
 
-      class RightHandSide : public ConstantFunction<dim>
-      {
-       public:
-         RightHandSide () : ConstantFunction<dim> (1.) {}
-      };
-      
-      static
-      void
-      create_coarse_grid (Triangulation<dim> &coarse_grid);
+    class RightHandSide : public ConstantFunction<dim>
+    {
+    public:
+      RightHandSide () : ConstantFunction<dim> (1.) {}
+    };
+
+    static
+    void
+    create_coarse_grid (Triangulation<dim> &coarse_grid);
   };
 
 
@@ -1039,69 +1039,71 @@ namespace Data
 
     static const Point<2> vertices_1[]
       = {  Point<2> (-1.,   -1.),
-            Point<2> (-1./2, -1.),
-            Point<2> (0.,    -1.),
-            Point<2> (+1./2, -1.),
-            Point<2> (+1,    -1.),
-            
-            Point<2> (-1.,   -1./2.),
-            Point<2> (-1./2, -1./2.),
-            Point<2> (0.,    -1./2.),
-            Point<2> (+1./2, -1./2.),
-            Point<2> (+1,    -1./2.),
-            
-            Point<2> (-1.,   0.),
-            Point<2> (-1./2, 0.),
-            Point<2> (+1./2, 0.),
-            Point<2> (+1,    0.),
-            
-            Point<2> (-1.,   1./2.),
-            Point<2> (-1./2, 1./2.),
-            Point<2> (0.,    1./2.),
-            Point<2> (+1./2, 1./2.),
-            Point<2> (+1,    1./2.),
-            
-            Point<2> (-1.,   1.),
-            Point<2> (-1./2, 1.),
-            Point<2> (0.,    1.),                        
-            Point<2> (+1./2, 1.),
-            Point<2> (+1,    1.)    };
+           Point<2> (-1./2, -1.),
+           Point<2> (0.,    -1.),
+           Point<2> (+1./2, -1.),
+           Point<2> (+1,    -1.),
+
+           Point<2> (-1.,   -1./2.),
+           Point<2> (-1./2, -1./2.),
+           Point<2> (0.,    -1./2.),
+           Point<2> (+1./2, -1./2.),
+           Point<2> (+1,    -1./2.),
+
+           Point<2> (-1.,   0.),
+           Point<2> (-1./2, 0.),
+           Point<2> (+1./2, 0.),
+           Point<2> (+1,    0.),
+
+           Point<2> (-1.,   1./2.),
+           Point<2> (-1./2, 1./2.),
+           Point<2> (0.,    1./2.),
+           Point<2> (+1./2, 1./2.),
+           Point<2> (+1,    1./2.),
+
+           Point<2> (-1.,   1.),
+           Point<2> (-1./2, 1.),
+           Point<2> (0.,    1.),
+           Point<2> (+1./2, 1.),
+           Point<2> (+1,    1.)
+        };
     const unsigned int
-      n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
+    n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
 
     const std::vector<Point<dim> > vertices (&vertices_1[0],
-                                            &vertices_1[n_vertices]);
+                                             &vertices_1[n_vertices]);
 
     static const int cell_vertices[][GeometryInfo<dim>::vertices_per_cell]
-      = {{0, 1, 5, 6},
-        {1, 2, 6, 7},
-        {2, 3, 7, 8},
-        {3, 4, 8, 9},
-        {5, 6, 10, 11},
-        {8, 9, 12, 13},
-        {10, 11, 14, 15},
-        {12, 13, 17, 18},
-        {14, 15, 19, 20},
-        {15, 16, 20, 21},
-        {16, 17, 21, 22},
-        {17, 18, 22, 23}};
+    = {{0, 1, 5, 6},
+      {1, 2, 6, 7},
+      {2, 3, 7, 8},
+      {3, 4, 8, 9},
+      {5, 6, 10, 11},
+      {8, 9, 12, 13},
+      {10, 11, 14, 15},
+      {12, 13, 17, 18},
+      {14, 15, 19, 20},
+      {15, 16, 20, 21},
+      {16, 17, 21, 22},
+      {17, 18, 22, 23}
+    };
     const unsigned int
-      n_cells = sizeof(cell_vertices) / sizeof(cell_vertices[0]);
+    n_cells = sizeof(cell_vertices) / sizeof(cell_vertices[0]);
 
     std::vector<CellData<dim> > cells (n_cells, CellData<dim>());
-    for (unsigned int i=0; i<n_cells; ++i) 
+    for (unsigned int i=0; i<n_cells; ++i)
       {
-       for (unsigned int j=0;
-            j<GeometryInfo<dim>::vertices_per_cell;
-            ++j)
-         cells[i].vertices[j] = cell_vertices[i][j];
-       cells[i].material_id = 0;
+        for (unsigned int j=0;
+             j<GeometryInfo<dim>::vertices_per_cell;
+             ++j)
+          cells[i].vertices[j] = cell_vertices[i][j];
+        cells[i].material_id = 0;
       };
 
     coarse_grid.create_triangulation (vertices,
-                                                   cells,
-                                                   SubCellData());
-    
+                                      cells,
+                                      SubCellData());
+
     coarse_grid.refine_global (1);
   }
 }
@@ -1111,117 +1113,117 @@ namespace Data
 
 namespace DualFunctional
 {
-  
+
   template <int dim>
   class DualFunctionalBase : public Subscriptor
   {
-    public:
-      virtual
-      void
-      assemble_rhs (const hp::DoFHandler<dim> &dof_handler,
-                   Vector<double>        &rhs) const = 0;
+  public:
+    virtual
+    void
+    assemble_rhs (const hp::DoFHandler<dim> &dof_handler,
+                  Vector<double>        &rhs) const = 0;
   };
 
 
-  
+
   template <int dim>
   class PointValueEvaluation : public DualFunctionalBase<dim>
   {
-    public:
-      PointValueEvaluation (const Point<dim> &evaluation_point);
-
-      virtual
-      void
-      assemble_rhs (const hp::DoFHandler<dim> &dof_handler,
-                   Vector<double>        &rhs) const;
-      
-      DeclException1 (ExcEvaluationPointNotFound,
-                     Point<dim>,
-                     << "The evaluation point " << arg1
-                     << " was not found among the vertices of the present grid.");
-
-    protected:
-      const Point<dim> evaluation_point;
+  public:
+    PointValueEvaluation (const Point<dim> &evaluation_point);
+
+    virtual
+    void
+    assemble_rhs (const hp::DoFHandler<dim> &dof_handler,
+                  Vector<double>        &rhs) const;
+
+    DeclException1 (ExcEvaluationPointNotFound,
+                    Point<dim>,
+                    << "The evaluation point " << arg1
+                    << " was not found among the vertices of the present grid.");
+
+  protected:
+    const Point<dim> evaluation_point;
   };
 
 
   template <int dim>
   PointValueEvaluation<dim>::
   PointValueEvaluation (const Point<dim> &evaluation_point)
-                 :
-                 evaluation_point (evaluation_point)
+    :
+    evaluation_point (evaluation_point)
   {}
-  
+
 
   template <int dim>
   void
   PointValueEvaluation<dim>::
   assemble_rhs (const hp::DoFHandler<dim> &dof_handler,
-               Vector<double>        &rhs) const
+                Vector<double>        &rhs) const
   {
     rhs.reinit (dof_handler.n_dofs());
 
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     for (; cell!=endc; ++cell)
       for (unsigned int vertex=0;
-          vertex<GeometryInfo<dim>::vertices_per_cell;
-          ++vertex)
-       if (cell->vertex(vertex).distance(evaluation_point)
-           < cell->diameter()*1e-8)
-         {
-           rhs(cell->vertex_dof_index(vertex,0)) = 1;
-           return;
-         };
+           vertex<GeometryInfo<dim>::vertices_per_cell;
+           ++vertex)
+        if (cell->vertex(vertex).distance(evaluation_point)
+            < cell->diameter()*1e-8)
+          {
+            rhs(cell->vertex_dof_index(vertex,0)) = 1;
+            return;
+          };
 
     AssertThrow (false, ExcEvaluationPointNotFound(evaluation_point));
   }
 
 
-  
+
   template <int dim>
   class PointXDerivativeEvaluation : public DualFunctionalBase<dim>
   {
-    public:
-      PointXDerivativeEvaluation (const Point<dim> &evaluation_point);
-
-      virtual
-      void
-      assemble_rhs (const hp::DoFHandler<dim> &dof_handler,
-                   Vector<double>        &rhs) const;
-      
-      DeclException1 (ExcEvaluationPointNotFound,
-                     Point<dim>,
-                     << "The evaluation point " << arg1
-                     << " was not found among the vertices of the present grid.");
-
-    protected:
-      const Point<dim> evaluation_point;
+  public:
+    PointXDerivativeEvaluation (const Point<dim> &evaluation_point);
+
+    virtual
+    void
+    assemble_rhs (const hp::DoFHandler<dim> &dof_handler,
+                  Vector<double>        &rhs) const;
+
+    DeclException1 (ExcEvaluationPointNotFound,
+                    Point<dim>,
+                    << "The evaluation point " << arg1
+                    << " was not found among the vertices of the present grid.");
+
+  protected:
+    const Point<dim> evaluation_point;
   };
 
 
   template <int dim>
   PointXDerivativeEvaluation<dim>::
   PointXDerivativeEvaluation (const Point<dim> &evaluation_point)
-                 :
-                 evaluation_point (evaluation_point)
+    :
+    evaluation_point (evaluation_point)
   {}
-  
+
 
   template <int dim>
   void
   PointXDerivativeEvaluation<dim>::
   assemble_rhs (const hp::DoFHandler<dim> &dof_handler,
-               Vector<double>        &rhs) const
+                Vector<double>        &rhs) const
   {
     rhs.reinit (dof_handler.n_dofs());
 
     QGauss<dim> quadrature(4);
     hp::FEValues<dim>  fe_values (dof_handler.get_fe(), quadrature,
-                             update_gradients |
-                             update_q_points  |
-                             update_JxW_values);
+                                  update_gradients |
+                                  update_q_points  |
+                                  update_JxW_values);
     const unsigned int n_q_points = fe_values.get_present_fe_values().n_quadrature_points;
     const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell;
 
@@ -1229,36 +1231,36 @@ namespace DualFunctional
     std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     double total_volume = 0;
-    
+
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     for (; cell!=endc; ++cell)
       if (cell->center().distance(evaluation_point) <=
-         cell->diameter())
-       {
-         fe_values.reinit (cell);
-         cell_rhs = 0;
-         
-         for (unsigned int q=0; q<n_q_points; ++q)
-           {
-             for (unsigned int i=0; i<dofs_per_cell; ++i)
-               cell_rhs(i) += fe_values.get_present_fe_values().shape_grad(i,q)[0] *
-                              fe_values.get_present_fe_values().JxW (q);
-             total_volume += fe_values.get_present_fe_values().JxW (q);
-           };
-
-         cell->get_dof_indices (local_dof_indices);
-         for (unsigned int i=0; i<dofs_per_cell; ++i)
-           rhs(local_dof_indices[i]) += cell_rhs(i);
-       };
+          cell->diameter())
+        {
+          fe_values.reinit (cell);
+          cell_rhs = 0;
+
+          for (unsigned int q=0; q<n_q_points; ++q)
+            {
+              for (unsigned int i=0; i<dofs_per_cell; ++i)
+                cell_rhs(i) += fe_values.get_present_fe_values().shape_grad(i,q)[0] *
+                               fe_values.get_present_fe_values().JxW (q);
+              total_volume += fe_values.get_present_fe_values().JxW (q);
+            };
+
+          cell->get_dof_indices (local_dof_indices);
+          for (unsigned int i=0; i<dofs_per_cell; ++i)
+            rhs(local_dof_indices[i]) += cell_rhs(i);
+        };
 
     AssertThrow (total_volume > 0,
-                ExcEvaluationPointNotFound(evaluation_point));
+                 ExcEvaluationPointNotFound(evaluation_point));
 
     rhs.scale (1./total_volume);
   }
-  
+
 
 }
 
@@ -1270,32 +1272,32 @@ namespace LaplaceSolver
   template <int dim>
   class DualSolver : public Solver<dim>
   {
-    public:
-      DualSolver (Triangulation<dim>       &triangulation,
-                 const hp::FECollection<dim> &fe,
-                 const hp::QCollection<dim>    &quadrature,
-                 const hp::QCollection<dim-1>  &face_quadrature,
-                 const DualFunctional::DualFunctionalBase<dim> &dual_functional);
-
-      virtual
-      void
-      solve_problem ();
-      
-      virtual
-      unsigned int
-      n_dofs () const;
-
-      virtual
-      void
-      postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const;
-
-    protected:
-      const SmartPointer<const DualFunctional::DualFunctionalBase<dim> > dual_functional;
-      virtual void assemble_rhs (Vector<double> &rhs) const;
-
-      static const ZeroFunction<dim> boundary_values;
-
-      friend class WeightedResidual<dim>;
+  public:
+    DualSolver (Triangulation<dim>       &triangulation,
+                const hp::FECollection<dim> &fe,
+                const hp::QCollection<dim>    &quadrature,
+                const hp::QCollection<dim-1>  &face_quadrature,
+                const DualFunctional::DualFunctionalBase<dim> &dual_functional);
+
+    virtual
+    void
+    solve_problem ();
+
+    virtual
+    unsigned int
+    n_dofs () const;
+
+    virtual
+    void
+    postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const;
+
+  protected:
+    const SmartPointer<const DualFunctional::DualFunctionalBase<dim> > dual_functional;
+    virtual void assemble_rhs (Vector<double> &rhs) const;
+
+    static const ZeroFunction<dim> boundary_values;
+
+    friend class WeightedResidual<dim>;
   };
 
   template <int dim>
@@ -1304,16 +1306,16 @@ namespace LaplaceSolver
   template <int dim>
   DualSolver<dim>::
   DualSolver (Triangulation<dim>       &triangulation,
-             const hp::FECollection<dim> &fe,
-             const hp::QCollection<dim>    &quadrature,
-             const hp::QCollection<dim-1>  &face_quadrature,
-             const DualFunctional::DualFunctionalBase<dim> &dual_functional)
-                 :
-                 Base<dim> (triangulation),
-                 Solver<dim> (triangulation, fe,
-                              quadrature, face_quadrature,
-                              boundary_values),
-                  dual_functional (&dual_functional)
+              const hp::FECollection<dim> &fe,
+              const hp::QCollection<dim>    &quadrature,
+              const hp::QCollection<dim-1>  &face_quadrature,
+              const DualFunctional::DualFunctionalBase<dim> &dual_functional)
+    :
+    Base<dim> (triangulation),
+    Solver<dim> (triangulation, fe,
+                 quadrature, face_quadrature,
+                 boundary_values),
+    dual_functional (&dual_functional)
   {}
 
 
@@ -1341,13 +1343,13 @@ namespace LaplaceSolver
   {
     Solver<dim>::postprocess(postprocessor);
   }
-  
+
 
 
   template <int dim>
   void
   DualSolver<dim>::
-  assemble_rhs (Vector<double> &rhs) const 
+  assemble_rhs (Vector<double> &rhs) const
   {
     dual_functional->assemble_rhs (this->dof_handler, rhs);
   }
@@ -1356,109 +1358,109 @@ namespace LaplaceSolver
 
   template <int dim>
   class WeightedResidual : public PrimalSolver<dim>,
-                          public DualSolver<dim>
+    public DualSolver<dim>
   {
-    public:
-      WeightedResidual (Triangulation<dim>       &coarse_grid,
-                       const hp::FECollection<dim> &primal_fe,
-                       const hp::FECollection<dim> &dual_fe,
-                       const hp::QCollection<dim>    &quadrature,
-                       const hp::QCollection<dim-1>  &face_quadrature,
-                       const Function<dim>      &rhs_function,
-                       const Function<dim>      &boundary_values,
-                       const DualFunctional::DualFunctionalBase<dim> &dual_functional);
-
-      virtual
-      void
-      solve_problem ();
-
-      virtual
-      void
-      postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const;
-      
-      virtual
-      unsigned int
-      n_dofs () const;
-
-      virtual void refine_grid ();
-
-      virtual
-      void
-      output_solution () const;
-
-    private:
-      void solve_primal_problem ();
-      void solve_dual_problem ();
-                                       
-      typedef
-      typename hp::DoFHandler<dim>::active_cell_iterator
-      active_cell_iterator;
-
-      typedef
-      typename std::map<typename hp::DoFHandler<dim>::face_iterator,double>
-      FaceIntegrals;
-
-      struct CellData
-      {
-         hp::FEValues<dim>    fe_values;
-         const SmartPointer<const Function<dim> > right_hand_side;
-
-         std::vector<double> cell_residual;
-         std::vector<double> rhs_values;         
-         std::vector<double> dual_weights;       
-         typename std::vector<Tensor<2,dim> > cell_grad_grads;
-         CellData (const hp::FECollection<dim> &fe,
-                   const hp::QCollection<dim>    &quadrature,
-                   const Function<dim>      &right_hand_side);
-      };
+  public:
+    WeightedResidual (Triangulation<dim>       &coarse_grid,
+                      const hp::FECollection<dim> &primal_fe,
+                      const hp::FECollection<dim> &dual_fe,
+                      const hp::QCollection<dim>    &quadrature,
+                      const hp::QCollection<dim-1>  &face_quadrature,
+                      const Function<dim>      &rhs_function,
+                      const Function<dim>      &boundary_values,
+                      const DualFunctional::DualFunctionalBase<dim> &dual_functional);
 
-      struct FaceData
-      {
-         hp::FEFaceValues<dim>    fe_face_values_cell;
-         hp::FEFaceValues<dim>    fe_face_values_neighbor;
-         hp::FESubfaceValues<dim> fe_subface_values_cell;
-
-         std::vector<double> jump_residual;
-         std::vector<double> dual_weights;       
-         typename std::vector<Tensor<1,dim> > cell_grads;
-         typename std::vector<Tensor<1,dim> > neighbor_grads;
-         FaceData (const hp::FECollection<dim> &fe,
-                   const hp::QCollection<dim-1>  &face_quadrature);
-      };
+    virtual
+    void
+    solve_problem ();
+
+    virtual
+    void
+    postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const;
+
+    virtual
+    unsigned int
+    n_dofs () const;
+
+    virtual void refine_grid ();
+
+    virtual
+    void
+    output_solution () const;
 
-      
-
-      void estimate_error (Vector<float> &error_indicators) const;
-
-      void estimate_some (const Vector<double> &primal_solution,
-                         const Vector<double> &dual_weights,
-                         const unsigned int    n_threads,
-                         const unsigned int    this_thread,
-                         Vector<float>        &error_indicators,
-                         FaceIntegrals        &face_integrals) const;
-
-      void
-      integrate_over_cell (const active_cell_iterator &cell,
-                          const unsigned int          cell_index,
-                          const Vector<double>       &primal_solution,
-                          const Vector<double>       &dual_weights,
-                          CellData                   &cell_data,
-                          Vector<float>              &error_indicators) const;
-
-      void
-      integrate_over_regular_face (const active_cell_iterator &cell,
-                                  const unsigned int          face_no,
-                                  const Vector<double>       &primal_solution,
-                                  const Vector<double>       &dual_weights,
-                                  FaceData                   &face_data,
-                                  FaceIntegrals              &face_integrals) const;
-      void
-      integrate_over_irregular_face (const active_cell_iterator &cell,
-                                    const unsigned int          face_no,
-                                    const Vector<double>       &primal_solution,
-                                    const Vector<double>       &dual_weights,
-                                    FaceData                   &face_data,
-                                    FaceIntegrals              &face_integrals) const;
+  private:
+    void solve_primal_problem ();
+    void solve_dual_problem ();
+
+    typedef
+    typename hp::DoFHandler<dim>::active_cell_iterator
+    active_cell_iterator;
+
+    typedef
+    typename std::map<typename hp::DoFHandler<dim>::face_iterator,double>
+    FaceIntegrals;
+
+    struct CellData
+    {
+      hp::FEValues<dim>    fe_values;
+      const SmartPointer<const Function<dim> > right_hand_side;
+
+      std::vector<double> cell_residual;
+      std::vector<double> rhs_values;
+      std::vector<double> dual_weights;
+      typename std::vector<Tensor<2,dim> > cell_grad_grads;
+      CellData (const hp::FECollection<dim> &fe,
+                const hp::QCollection<dim>    &quadrature,
+                const Function<dim>      &right_hand_side);
+    };
+
+    struct FaceData
+    {
+      hp::FEFaceValues<dim>    fe_face_values_cell;
+      hp::FEFaceValues<dim>    fe_face_values_neighbor;
+      hp::FESubfaceValues<dim> fe_subface_values_cell;
+
+      std::vector<double> jump_residual;
+      std::vector<double> dual_weights;
+      typename std::vector<Tensor<1,dim> > cell_grads;
+      typename std::vector<Tensor<1,dim> > neighbor_grads;
+      FaceData (const hp::FECollection<dim> &fe,
+                const hp::QCollection<dim-1>  &face_quadrature);
+    };
+
+
+
+    void estimate_error (Vector<float> &error_indicators) const;
+
+    void estimate_some (const Vector<double> &primal_solution,
+                        const Vector<double> &dual_weights,
+                        const unsigned int    n_threads,
+                        const unsigned int    this_thread,
+                        Vector<float>        &error_indicators,
+                        FaceIntegrals        &face_integrals) const;
+
+    void
+    integrate_over_cell (const active_cell_iterator &cell,
+                         const unsigned int          cell_index,
+                         const Vector<double>       &primal_solution,
+                         const Vector<double>       &dual_weights,
+                         CellData                   &cell_data,
+                         Vector<float>              &error_indicators) const;
+
+    void
+    integrate_over_regular_face (const active_cell_iterator &cell,
+                                 const unsigned int          face_no,
+                                 const Vector<double>       &primal_solution,
+                                 const Vector<double>       &dual_weights,
+                                 FaceData                   &face_data,
+                                 FaceIntegrals              &face_integrals) const;
+    void
+    integrate_over_irregular_face (const active_cell_iterator &cell,
+                                   const unsigned int          face_no,
+                                   const Vector<double>       &primal_solution,
+                                   const Vector<double>       &dual_weights,
+                                   FaceData                   &face_data,
+                                   FaceIntegrals              &face_integrals) const;
   };
 
 
@@ -1466,75 +1468,75 @@ namespace LaplaceSolver
   template <int dim>
   WeightedResidual<dim>::CellData::
   CellData (const hp::FECollection<dim> &fe,
-           const hp::QCollection<dim>    &quadrature,
-           const Function<dim>      &right_hand_side)
-                 :
-                 fe_values (fe, quadrature,
-                            update_values             |
-                            update_second_derivatives |
-                            update_q_points           |
-                            update_JxW_values),
-                 right_hand_side (&right_hand_side)
-  {  
+            const hp::QCollection<dim>    &quadrature,
+            const Function<dim>      &right_hand_side)
+    :
+    fe_values (fe, quadrature,
+               update_values             |
+               update_second_derivatives |
+               update_q_points           |
+               update_JxW_values),
+    right_hand_side (&right_hand_side)
+  {
     const unsigned int n_q_points
       = quadrature[0].size();
-  
+
     cell_residual.resize(n_q_points);
-    rhs_values.resize(n_q_points);    
-    dual_weights.resize(n_q_points);    
+    rhs_values.resize(n_q_points);
+    dual_weights.resize(n_q_points);
     cell_grad_grads.resize(n_q_points);
   }
-  
-  
+
+
 
   template <int dim>
   WeightedResidual<dim>::FaceData::
   FaceData (const hp::FECollection<dim> &fe,
-           const hp::QCollection<dim-1>  &face_quadrature)
-                 :
-                 fe_face_values_cell (fe, face_quadrature,
-                                      update_values        |
-                                      update_gradients     |
-                                      update_JxW_values    |
-                                      update_normal_vectors),
-                 fe_face_values_neighbor (fe, face_quadrature,
-                                          update_values     |
-                                          update_gradients  |
-                                          update_JxW_values |
-                                          update_normal_vectors),
-                 fe_subface_values_cell (fe, face_quadrature,
-                                         update_gradients)
-  {  
+            const hp::QCollection<dim-1>  &face_quadrature)
+    :
+    fe_face_values_cell (fe, face_quadrature,
+                         update_values        |
+                         update_gradients     |
+                         update_JxW_values    |
+                         update_normal_vectors),
+    fe_face_values_neighbor (fe, face_quadrature,
+                             update_values     |
+                             update_gradients  |
+                             update_JxW_values |
+                             update_normal_vectors),
+    fe_subface_values_cell (fe, face_quadrature,
+                            update_gradients)
+  {
     const unsigned int n_face_q_points
       = face_quadrature[0].size();
-  
+
     jump_residual.resize(n_face_q_points);
-    dual_weights.resize(n_face_q_points);    
+    dual_weights.resize(n_face_q_points);
     cell_grads.resize(n_face_q_points);
     neighbor_grads.resize(n_face_q_points);
   }
-  
+
 
 
 
   template <int dim>
   WeightedResidual<dim>::
   WeightedResidual (Triangulation<dim>       &coarse_grid,
-                   const hp::FECollection<dim> &primal_fe,
-                   const hp::FECollection<dim> &dual_fe,
-                   const hp::QCollection<dim>    &quadrature,
-                   const hp::QCollection<dim-1>  &face_quadrature,
-                   const Function<dim>      &rhs_function,
-                   const Function<dim>      &bv,
-                   const DualFunctional::DualFunctionalBase<dim> &dual_functional)
-                 :
-                 Base<dim> (coarse_grid),
-                  PrimalSolver<dim> (coarse_grid, primal_fe,
-                                    quadrature, face_quadrature,
-                                    rhs_function, bv),
-                  DualSolver<dim> (coarse_grid, dual_fe,
-                                  quadrature, face_quadrature,
-                                  dual_functional)
+                    const hp::FECollection<dim> &primal_fe,
+                    const hp::FECollection<dim> &dual_fe,
+                    const hp::QCollection<dim>    &quadrature,
+                    const hp::QCollection<dim-1>  &face_quadrature,
+                    const Function<dim>      &rhs_function,
+                    const Function<dim>      &bv,
+                    const DualFunctional::DualFunctionalBase<dim> &dual_functional)
+    :
+    Base<dim> (coarse_grid),
+    PrimalSolver<dim> (coarse_grid, primal_fe,
+                       quadrature, face_quadrature,
+                       rhs_function, bv),
+    DualSolver<dim> (coarse_grid, dual_fe,
+                     quadrature, face_quadrature,
+                     dual_functional)
   {}
 
 
@@ -1548,7 +1550,7 @@ namespace LaplaceSolver
     threads.join_all ();
   }
 
-  
+
   template <int dim>
   void
   WeightedResidual<dim>::solve_primal_problem ()
@@ -1562,7 +1564,7 @@ namespace LaplaceSolver
   {
     DualSolver<dim>::solve_problem ();
   }
-  
+
 
   template <int dim>
   void
@@ -1571,8 +1573,8 @@ namespace LaplaceSolver
   {
     PrimalSolver<dim>::postprocess (postprocessor);
   }
-  
-  
+
+
   template <int dim>
   unsigned int
   WeightedResidual<dim>::n_dofs () const
@@ -1590,15 +1592,15 @@ namespace LaplaceSolver
     estimate_error (error_indicators);
 
     for (Vector<float>::iterator i=error_indicators.begin();
-        i != error_indicators.end(); ++i)
+         i != error_indicators.end(); ++i)
       *i = std::fabs (*i);
 
     GridRefinement::refine_and_coarsen_fixed_fraction (*this->triangulation,
-                                                      error_indicators,
-                                                      0.8, 0.02);
+                                                       error_indicators,
+                                                       0.8, 0.02);
     this->triangulation->execute_coarsening_and_refinement ();
   }
-  
+
 
   template <int dim>
   void
@@ -1606,39 +1608,39 @@ namespace LaplaceSolver
   {
     const PrimalSolver<dim> &primal_solver = *this;
     const DualSolver<dim>   &dual_solver   = *this;
-    
+
     ConstraintMatrix primal_hanging_node_constraints;
     DoFTools::make_hanging_node_constraints (primal_solver.dof_handler,
-                                            primal_hanging_node_constraints);
+                                             primal_hanging_node_constraints);
     primal_hanging_node_constraints.close();
     Vector<double> dual_solution (primal_solver.dof_handler.n_dofs());
     FETools::interpolate (dual_solver.dof_handler,
-                         dual_solver.solution,
-                         primal_solver.dof_handler,
-                         primal_hanging_node_constraints,
-                         dual_solution);    
+                          dual_solver.solution,
+                          primal_solver.dof_handler,
+                          primal_hanging_node_constraints,
+                          dual_solution);
 
     DataOut<dim,hp::DoFHandler<dim> > data_out;
     data_out.attach_dof_handler (primal_solver.dof_handler);
 
     data_out.add_data_vector (primal_solver.solution,
-                             "primal_solution");
+                              "primal_solution");
     data_out.add_data_vector (dual_solution,
-                             "dual_solution");
-    
+                              "dual_solution");
+
     data_out.build_patches ();
-  
+
     std::ostringstream filename;
     filename << "solution-"
-            << this->refinement_cycle
-            << ".gnuplot"
-            << std::ends;
+             << this->refinement_cycle
+             << ".gnuplot"
+             << std::ends;
     data_out.write (deallog.get_file_stream(), DataOut<dim>::gnuplot);
   }
 
 
 
-  
+
   template <int dim>
   void
   WeightedResidual<dim>::
@@ -1649,39 +1651,39 @@ namespace LaplaceSolver
 
     ConstraintMatrix dual_hanging_node_constraints;
     DoFTools::make_hanging_node_constraints (dual_solver.dof_handler,
-                                            dual_hanging_node_constraints);
+                                             dual_hanging_node_constraints);
     dual_hanging_node_constraints.close();
     Vector<double> primal_solution (dual_solver.dof_handler.n_dofs());
     FETools::interpolate (primal_solver.dof_handler,
-                         primal_solver.solution,
-                         dual_solver.dof_handler,
-                         dual_hanging_node_constraints,
-                         primal_solution);
-    
+                          primal_solver.solution,
+                          dual_solver.dof_handler,
+                          dual_hanging_node_constraints,
+                          primal_solution);
+
     ConstraintMatrix primal_hanging_node_constraints;
     DoFTools::make_hanging_node_constraints (primal_solver.dof_handler,
-                                            primal_hanging_node_constraints);
+                                             primal_hanging_node_constraints);
     primal_hanging_node_constraints.close();
     Vector<double> dual_weights (dual_solver.dof_handler.n_dofs());
     FETools::interpolation_difference (dual_solver.dof_handler,
-                                      dual_hanging_node_constraints,
-                                      dual_solver.solution,
-                                      primal_solver.dof_handler,
-                                      primal_hanging_node_constraints,
-                                      dual_weights);
-    
-    
+                                       dual_hanging_node_constraints,
+                                       dual_solver.solution,
+                                       primal_solver.dof_handler,
+                                       primal_hanging_node_constraints,
+                                       dual_weights);
+
+
     FaceIntegrals face_integrals;
     for (active_cell_iterator cell=dual_solver.dof_handler.begin_active();
-        cell!=dual_solver.dof_handler.end();
-        ++cell)
+         cell!=dual_solver.dof_handler.end();
+         ++cell)
       for (unsigned int face_no=0;
-          face_no<GeometryInfo<dim>::faces_per_cell;
-          ++face_no)
-       face_integrals[cell->face(face_no)] = -1e20;
+           face_no<GeometryInfo<dim>::faces_per_cell;
+           ++face_no)
+        face_integrals[cell->face(face_no)] = -1e20;
 
     error_indicators.reinit (dual_solver.dof_handler
-                            .get_tria().n_active_cells());
+                             .get_tria().n_active_cells());
 
     const unsigned int n_threads = multithread_info.n_default_threads;
     Threads::ThreadGroup<> threads;
@@ -1692,25 +1694,25 @@ namespace LaplaceSolver
                   n_threads, i,
                   error_indicators,
                   face_integrals);
-    threads.join_all();    
+    threads.join_all();
 
-    unsigned int present_cell=0;  
+    unsigned int present_cell=0;
     for (active_cell_iterator cell=dual_solver.dof_handler.begin_active();
-        cell!=dual_solver.dof_handler.end();
-        ++cell, ++present_cell)
+         cell!=dual_solver.dof_handler.end();
+         ++cell, ++present_cell)
       for (unsigned int face_no=0; face_no<GeometryInfo<dim>::faces_per_cell;
-          ++face_no)
-       {
-         Assert(face_integrals.find(cell->face(face_no)) !=
-                face_integrals.end(),
-                ExcInternalError());
-         error_indicators(present_cell)
-           -= 0.5*face_integrals[cell->face(face_no)];
-       };
+           ++face_no)
+        {
+          Assert(face_integrals.find(cell->face(face_no)) !=
+                 face_integrals.end(),
+                 ExcInternalError());
+          error_indicators(present_cell)
+          -= 0.5*face_integrals[cell->face(face_no)];
+        };
     deallog << "   Estimated error="
-             << std::accumulate (error_indicators.begin(),
-                                 error_indicators.end(), 0.)
-             << std::endl;
+            << std::accumulate (error_indicators.begin(),
+                                error_indicators.end(), 0.)
+            << std::endl;
   }
 
 
@@ -1719,76 +1721,76 @@ namespace LaplaceSolver
   void
   WeightedResidual<dim>::
   estimate_some (const Vector<double> &primal_solution,
-                const Vector<double> &dual_weights,
-                const unsigned int    n_threads,
-                const unsigned int    this_thread,
-                Vector<float>        &error_indicators,
-                FaceIntegrals        &face_integrals) const
+                 const Vector<double> &dual_weights,
+                 const unsigned int    n_threads,
+                 const unsigned int    this_thread,
+                 Vector<float>        &error_indicators,
+                 FaceIntegrals        &face_integrals) const
   {
     const PrimalSolver<dim> &primal_solver = *this;
     const DualSolver<dim>   &dual_solver   = *this;
 
     CellData cell_data (*dual_solver.fe,
-                       *dual_solver.quadrature,
-                       *primal_solver.rhs_function);
+                        *dual_solver.quadrature,
+                        *primal_solver.rhs_function);
     FaceData face_data (*dual_solver.fe,
-                       *dual_solver.face_quadrature);    
+                        *dual_solver.face_quadrature);
 
     active_cell_iterator cell=dual_solver.dof_handler.begin_active();
     for (unsigned int t=0;
-        (t<this_thread) && (cell!=dual_solver.dof_handler.end());
-        ++t, ++cell);
+         (t<this_thread) && (cell!=dual_solver.dof_handler.end());
+         ++t, ++cell);
 
     if (cell == dual_solver.dof_handler.end())
       return;
-    
+
     for (unsigned int cell_index=this_thread; true; )
       {
-       integrate_over_cell (cell, cell_index,
-                            primal_solution,
-                            dual_weights,
-                            cell_data,
-                            error_indicators);
-       
-       for (unsigned int face_no=0;
-            face_no<GeometryInfo<dim>::faces_per_cell;
-            ++face_no)
-         {
-           if (cell->face(face_no)->at_boundary()) 
-             {
-               face_integrals[cell->face(face_no)] = 0;
-               continue;
-             };
-           
-           if ((cell->neighbor(face_no)->has_children() == false) &&
-               (cell->neighbor(face_no)->level() == cell->level()) &&
-               (cell->neighbor(face_no)->index() < cell->index()))
-             continue;
-
-           if (cell->at_boundary(face_no) == false)
-             if (cell->neighbor(face_no)->level() < cell->level())
-               continue;         
-
-
-           if (cell->face(face_no)->has_children() == false)
-             integrate_over_regular_face (cell, face_no,
-                                          primal_solution,
-                                          dual_weights,
-                                          face_data,
-                                          face_integrals);       
-           else
-             integrate_over_irregular_face (cell, face_no,
-                                            primal_solution,
-                                            dual_weights,
-                                            face_data,
-                                            face_integrals);
-         };
-
-       for (unsigned int t=0;
-            ((t<n_threads) && (cell!=dual_solver.dof_handler.end()));
-            ++t, ++cell, ++cell_index);
-       if (cell == dual_solver.dof_handler.end())
-         break;
+        integrate_over_cell (cell, cell_index,
+                             primal_solution,
+                             dual_weights,
+                             cell_data,
+                             error_indicators);
+
+        for (unsigned int face_no=0;
+             face_no<GeometryInfo<dim>::faces_per_cell;
+             ++face_no)
+          {
+            if (cell->face(face_no)->at_boundary())
+              {
+                face_integrals[cell->face(face_no)] = 0;
+                continue;
+              };
+
+            if ((cell->neighbor(face_no)->has_children() == false) &&
+                (cell->neighbor(face_no)->level() == cell->level()) &&
+                (cell->neighbor(face_no)->index() < cell->index()))
+              continue;
+
+            if (cell->at_boundary(face_no) == false)
+              if (cell->neighbor(face_no)->level() < cell->level())
+                continue;
+
+
+            if (cell->face(face_no)->has_children() == false)
+              integrate_over_regular_face (cell, face_no,
+                                           primal_solution,
+                                           dual_weights,
+                                           face_data,
+                                           face_integrals);
+            else
+              integrate_over_irregular_face (cell, face_no,
+                                             primal_solution,
+                                             dual_weights,
+                                             face_data,
+                                             face_integrals);
+          };
+
+        for (unsigned int t=0;
+             ((t<n_threads) && (cell!=dual_solver.dof_handler.end()));
+             ++t, ++cell, ++cell_index);
+        if (cell == dual_solver.dof_handler.end())
+          break;
       };
   }
 
@@ -1797,154 +1799,154 @@ namespace LaplaceSolver
   template <int dim>
   void WeightedResidual<dim>::
   integrate_over_cell (const active_cell_iterator &cell,
-                      const unsigned int          cell_index,
-                      const Vector<double>       &primal_solution,
-                      const Vector<double>       &dual_weights,
-                      CellData                   &cell_data,
-                      Vector<float>              &error_indicators) const
+                       const unsigned int          cell_index,
+                       const Vector<double>       &primal_solution,
+                       const Vector<double>       &dual_weights,
+                       CellData                   &cell_data,
+                       Vector<float>              &error_indicators) const
   {
     cell_data.fe_values.reinit (cell);
     cell_data.right_hand_side
-      ->value_list (cell_data.fe_values.get_present_fe_values().get_quadrature_points(),
-                   cell_data.rhs_values);
+    ->value_list (cell_data.fe_values.get_present_fe_values().get_quadrature_points(),
+                  cell_data.rhs_values);
     cell_data.fe_values.get_present_fe_values().get_function_2nd_derivatives (primal_solution,
-                                                     cell_data.cell_grad_grads);
+        cell_data.cell_grad_grads);
 
     cell_data.fe_values.get_present_fe_values().get_function_values (dual_weights,
-                                            cell_data.dual_weights);
+        cell_data.dual_weights);
 
     double sum = 0;
     for (unsigned int p=0; p<cell_data.fe_values.get_present_fe_values().n_quadrature_points; ++p)
       sum += ((cell_data.rhs_values[p]+trace(cell_data.cell_grad_grads[p])) *
-             cell_data.dual_weights[p] *
-             cell_data.fe_values.get_present_fe_values().JxW (p));
+              cell_data.dual_weights[p] *
+              cell_data.fe_values.get_present_fe_values().JxW (p));
     error_indicators(cell_index) += sum;
   }
 
 
-  
+
   template <int dim>
   void WeightedResidual<dim>::
   integrate_over_regular_face (const active_cell_iterator &cell,
-                              const unsigned int          face_no,
-                              const Vector<double>       &primal_solution,
-                              const Vector<double>       &dual_weights,
-                              FaceData                   &face_data,
-                              FaceIntegrals              &face_integrals) const
+                               const unsigned int          face_no,
+                               const Vector<double>       &primal_solution,
+                               const Vector<double>       &dual_weights,
+                               FaceData                   &face_data,
+                               FaceIntegrals              &face_integrals) const
   {
     const unsigned int
-      n_q_points = face_data.fe_face_values_cell.get_present_fe_values().n_quadrature_points;
+    n_q_points = face_data.fe_face_values_cell.get_present_fe_values().n_quadrature_points;
 
     face_data.fe_face_values_cell.reinit (cell, face_no);
     face_data.fe_face_values_cell.get_present_fe_values().get_function_grads (primal_solution,
-                                                     face_data.cell_grads);
+        face_data.cell_grads);
 
     Assert (cell->neighbor(face_no).state() == IteratorState::valid,
-           ExcInternalError());
+            ExcInternalError());
     const unsigned int
-      neighbor_neighbor = cell->neighbor_of_neighbor (face_no);
+    neighbor_neighbor = cell->neighbor_of_neighbor (face_no);
     const active_cell_iterator neighbor = cell->neighbor(face_no);
-    face_data.fe_face_values_neighbor.reinit (neighbor, neighbor_neighbor);      
+    face_data.fe_face_values_neighbor.reinit (neighbor, neighbor_neighbor);
     face_data.fe_face_values_neighbor.get_present_fe_values().get_function_grads (primal_solution,
-                                                         face_data.neighbor_grads);
+        face_data.neighbor_grads);
 
     for (unsigned int p=0; p<n_q_points; ++p)
       face_data.jump_residual[p]
-       = ((face_data.cell_grads[p] - face_data.neighbor_grads[p]) *
-          face_data.fe_face_values_cell.get_present_fe_values().normal_vector(p));
+        = ((face_data.cell_grads[p] - face_data.neighbor_grads[p]) *
+           face_data.fe_face_values_cell.get_present_fe_values().normal_vector(p));
 
     face_data.fe_face_values_cell.get_present_fe_values().get_function_values (dual_weights,
-                                                      face_data.dual_weights);
-    
+        face_data.dual_weights);
+
     double face_integral = 0;
     for (unsigned int p=0; p<n_q_points; ++p)
       face_integral += (face_data.jump_residual[p] *
-                       face_data.dual_weights[p]  *
-                       face_data.fe_face_values_cell.get_present_fe_values().JxW(p));
+                        face_data.dual_weights[p]  *
+                        face_data.fe_face_values_cell.get_present_fe_values().JxW(p));
 
     Assert (face_integrals.find (cell->face(face_no)) != face_integrals.end(),
-           ExcInternalError());
+            ExcInternalError());
     Assert (face_integrals[cell->face(face_no)] == -1e20,
-           ExcInternalError());
+            ExcInternalError());
 
     face_integrals[cell->face(face_no)] = face_integral;
   }
 
 
-  
+
   template <int dim>
   void WeightedResidual<dim>::
   integrate_over_irregular_face (const active_cell_iterator &cell,
-                                const unsigned int          face_no,
-                                const Vector<double>       &primal_solution,
-                                const Vector<double>       &dual_weights,
-                                FaceData                   &face_data,
-                                FaceIntegrals              &face_integrals) const
+                                 const unsigned int          face_no,
+                                 const Vector<double>       &primal_solution,
+                                 const Vector<double>       &dual_weights,
+                                 FaceData                   &face_data,
+                                 FaceIntegrals              &face_integrals) const
   {
     const unsigned int
-      n_q_points = face_data.fe_face_values_cell.get_present_fe_values().n_quadrature_points;
+    n_q_points = face_data.fe_face_values_cell.get_present_fe_values().n_quadrature_points;
 
     const typename hp::DoFHandler<dim>::face_iterator
-      face = cell->face(face_no);    
+    face = cell->face(face_no);
     const typename hp::DoFHandler<dim>::cell_iterator
-      neighbor = cell->neighbor(face_no);    
+    neighbor = cell->neighbor(face_no);
     Assert (neighbor.state() == IteratorState::valid,
-           ExcInternalError());
+            ExcInternalError());
     Assert (neighbor->has_children(),
-           ExcInternalError());
+            ExcInternalError());
 
     const unsigned int
-      neighbor_neighbor = cell->neighbor_of_neighbor (face_no);
-  
+    neighbor_neighbor = cell->neighbor_of_neighbor (face_no);
+
     for (unsigned int subface_no=0;
-        subface_no<face->n_children(); ++subface_no)
+         subface_no<face->n_children(); ++subface_no)
       {
-       const active_cell_iterator neighbor_child
+        const active_cell_iterator neighbor_child
           = cell->neighbor_child_on_subface (face_no, subface_no);
-       Assert (neighbor_child->face(neighbor_neighbor) ==
-               cell->face(face_no)->child(subface_no),
-               ExcInternalError());
-
-       face_data.fe_subface_values_cell.reinit (cell, face_no, subface_no);
-       face_data.fe_subface_values_cell.get_present_fe_values().get_function_grads (primal_solution,
-                                                            face_data.cell_grads);
-       face_data.fe_face_values_neighbor.reinit (neighbor_child,
-                                            neighbor_neighbor);
-       face_data.fe_face_values_neighbor.get_present_fe_values().get_function_grads (primal_solution,
-                                                             face_data.neighbor_grads);
-      
-       for (unsigned int p=0; p<n_q_points; ++p)
-         face_data.jump_residual[p]
-            = ((face_data.neighbor_grads[p] - face_data.cell_grads[p]) *
-               face_data.fe_face_values_neighbor.get_present_fe_values().normal_vector(p));
-
-       face_data.fe_face_values_neighbor.get_present_fe_values().get_function_values (dual_weights,
-                                                              face_data.dual_weights);
-       
-       double face_integral = 0;
-       for (unsigned int p=0; p<n_q_points; ++p)
-         face_integral += (face_data.jump_residual[p] *
-                           face_data.dual_weights[p] *
-                           face_data.fe_face_values_neighbor.get_present_fe_values().JxW(p));
-       face_integrals[neighbor_child->face(neighbor_neighbor)]
-         = face_integral;
+        Assert (neighbor_child->face(neighbor_neighbor) ==
+                cell->face(face_no)->child(subface_no),
+                ExcInternalError());
+
+        face_data.fe_subface_values_cell.reinit (cell, face_no, subface_no);
+        face_data.fe_subface_values_cell.get_present_fe_values().get_function_grads (primal_solution,
+            face_data.cell_grads);
+        face_data.fe_face_values_neighbor.reinit (neighbor_child,
+                                                  neighbor_neighbor);
+        face_data.fe_face_values_neighbor.get_present_fe_values().get_function_grads (primal_solution,
+            face_data.neighbor_grads);
+
+        for (unsigned int p=0; p<n_q_points; ++p)
+          face_data.jump_residual[p]
+            = ((face_data.neighbor_grads[p] - face_data.cell_grads[p]) *
+               face_data.fe_face_values_neighbor.get_present_fe_values().normal_vector(p));
+
+        face_data.fe_face_values_neighbor.get_present_fe_values().get_function_values (dual_weights,
+            face_data.dual_weights);
+
+        double face_integral = 0;
+        for (unsigned int p=0; p<n_q_points; ++p)
+          face_integral += (face_data.jump_residual[p] *
+                            face_data.dual_weights[p] *
+                            face_data.fe_face_values_neighbor.get_present_fe_values().JxW(p));
+        face_integrals[neighbor_child->face(neighbor_neighbor)]
+          = face_integral;
       };
 
     double sum = 0;
     for (unsigned int subface_no=0;
-        subface_no<face->n_children(); ++subface_no) 
+         subface_no<face->n_children(); ++subface_no)
       {
-       Assert (face_integrals.find(face->child(subface_no)) !=
-               face_integrals.end(),
-               ExcInternalError());
-       Assert (face_integrals[face->child(subface_no)] != -1e20,
-               ExcInternalError());
-      
-       sum += face_integrals[face->child(subface_no)];
+        Assert (face_integrals.find(face->child(subface_no)) !=
+                face_integrals.end(),
+                ExcInternalError());
+        Assert (face_integrals[face->child(subface_no)] != -1e20,
+                ExcInternalError());
+
+        sum += face_integrals[face->child(subface_no)];
       };
     face_integrals[face] = sum;
   }
-  
+
 }
 
 
@@ -1952,49 +1954,50 @@ namespace LaplaceSolver
 template <int dim>
 struct Framework
 {
-  public:
-    typedef Evaluation::EvaluationBase<dim> Evaluator;
-    typedef std::list<Evaluator*>           EvaluatorList;
+public:
+  typedef Evaluation::EvaluationBase<dim> Evaluator;
+  typedef std::list<Evaluator *>           EvaluatorList;
 
 
-    struct ProblemDescription 
-    {
-       unsigned int primal_fe_degree;
-       unsigned int dual_fe_degree;
+  struct ProblemDescription
+  {
+    unsigned int primal_fe_degree;
+    unsigned int dual_fe_degree;
 
-       SmartPointer<const Data::SetUpBase<dim> > data;
+    SmartPointer<const Data::SetUpBase<dim> > data;
 
-       enum RefinementCriterion {
-             dual_weighted_error_estimator,
-             global_refinement,
-             kelly_indicator,
-             weighted_kelly_indicator
-       };
+    enum RefinementCriterion
+    {
+      dual_weighted_error_estimator,
+      global_refinement,
+      kelly_indicator,
+      weighted_kelly_indicator
+    };
 
-       RefinementCriterion refinement_criterion;
+    RefinementCriterion refinement_criterion;
 
-       SmartPointer<const DualFunctional::DualFunctionalBase<dim> > dual_functional;
+    SmartPointer<const DualFunctional::DualFunctionalBase<dim> > dual_functional;
 
-       EvaluatorList evaluator_list;
+    EvaluatorList evaluator_list;
 
-       SmartPointer<const Function<dim> > kelly_weight;
+    SmartPointer<const Function<dim> > kelly_weight;
 
-       unsigned int max_degrees_of_freedom;
+    unsigned int max_degrees_of_freedom;
 
-       ProblemDescription ();
-    };
+    ProblemDescription ();
+  };
 
-    static void run (const ProblemDescription &descriptor);
+  static void run (const ProblemDescription &descriptor);
 };
 
 
 template <int dim>
 Framework<dim>::ProblemDescription::ProblemDescription ()
-               :
-               primal_fe_degree (1),
-               dual_fe_degree (2),
-               refinement_criterion (dual_weighted_error_estimator),
-               max_degrees_of_freedom (5000)
+  :
+  primal_fe_degree (1),
+  dual_fe_degree (2),
+  refinement_criterion (dual_weighted_error_estimator),
+  max_degrees_of_freedom (5000)
 {}
 
 
@@ -2003,7 +2006,7 @@ template <int dim>
 void Framework<dim>::run (const ProblemDescription &descriptor)
 {
   Triangulation<dim>
-    triangulation (Triangulation<dim>::smoothing_on_refinement);
+  triangulation (Triangulation<dim>::smoothing_on_refinement);
   descriptor.data->create_coarse_grid (triangulation);
 
   const hp::FECollection<dim>     primal_fe(FE_Q<dim>(descriptor.primal_fe_degree));
@@ -2011,89 +2014,89 @@ void Framework<dim>::run (const ProblemDescription &descriptor)
   const hp::QCollection<dim>   quadrature(QGauss<dim>(descriptor.dual_fe_degree+1));
   const hp::QCollection<dim-1> face_quadrature(QGauss<dim-1>(descriptor.dual_fe_degree+1));
 
-  LaplaceSolver::Base<dim> * solver = 0;
+  LaplaceSolver::Base<dim> *solver = 0;
   switch (descriptor.refinement_criterion)
     {
-      case ProblemDescription::dual_weighted_error_estimator:
-      {
-       solver
-         = new LaplaceSolver::WeightedResidual<dim> (triangulation,
-                                                     primal_fe,
-                                                     dual_fe,
-                                                     quadrature,
-                                                     face_quadrature,
-                                                     descriptor.data->get_right_hand_side(),
-                                                     descriptor.data->get_boundary_values(),
-                                                     *descriptor.dual_functional);
-       break;
-      };
-       
-      case ProblemDescription::global_refinement:
-      {
-       solver
-         = new LaplaceSolver::RefinementGlobal<dim> (triangulation,
-                                                     primal_fe,
-                                                     quadrature,
-                                                     face_quadrature,
-                                                     descriptor.data->get_right_hand_side(),
-                                                     descriptor.data->get_boundary_values());
-       break;
-      };
-       
-      case ProblemDescription::kelly_indicator:
-      {
-       solver
-         = new LaplaceSolver::RefinementKelly<dim> (triangulation,
-                                                    primal_fe,
-                                                    quadrature,
-                                                    face_quadrature,
-                                                    descriptor.data->get_right_hand_side(),
-                                                    descriptor.data->get_boundary_values());
-       break;
-      };
+    case ProblemDescription::dual_weighted_error_estimator:
+    {
+      solver
+        = new LaplaceSolver::WeightedResidual<dim> (triangulation,
+                                                    primal_fe,
+                                                    dual_fe,
+                                                    quadrature,
+                                                    face_quadrature,
+                                                    descriptor.data->get_right_hand_side(),
+                                                    descriptor.data->get_boundary_values(),
+                                                    *descriptor.dual_functional);
+      break;
+    };
 
-      case ProblemDescription::weighted_kelly_indicator:
-      {
-       solver
-         = new LaplaceSolver::RefinementWeightedKelly<dim> (triangulation,
-                                                            primal_fe,
-                                                            quadrature,
-                                                            face_quadrature,
-                                                            descriptor.data->get_right_hand_side(),
-                                                            descriptor.data->get_boundary_values(),
-                                                            *descriptor.kelly_weight);
-       break;
-      };
-           
-      default:
-           AssertThrow (false, ExcInternalError());
+    case ProblemDescription::global_refinement:
+    {
+      solver
+        = new LaplaceSolver::RefinementGlobal<dim> (triangulation,
+                                                    primal_fe,
+                                                    quadrature,
+                                                    face_quadrature,
+                                                    descriptor.data->get_right_hand_side(),
+                                                    descriptor.data->get_boundary_values());
+      break;
+    };
+
+    case ProblemDescription::kelly_indicator:
+    {
+      solver
+        = new LaplaceSolver::RefinementKelly<dim> (triangulation,
+                                                   primal_fe,
+                                                   quadrature,
+                                                   face_quadrature,
+                                                   descriptor.data->get_right_hand_side(),
+                                                   descriptor.data->get_boundary_values());
+      break;
+    };
+
+    case ProblemDescription::weighted_kelly_indicator:
+    {
+      solver
+        = new LaplaceSolver::RefinementWeightedKelly<dim> (triangulation,
+                                                           primal_fe,
+                                                           quadrature,
+                                                           face_quadrature,
+                                                           descriptor.data->get_right_hand_side(),
+                                                           descriptor.data->get_boundary_values(),
+                                                           *descriptor.kelly_weight);
+      break;
     };
-  
+
+    default:
+      AssertThrow (false, ExcInternalError());
+    };
+
   for (unsigned int step=0; true; ++step)
     {
-      deallog << "Refinement cycle: "  << step
-               << std::endl;
-           
+      deallog << "Refinement cycle: " << step
+              << std::endl;
+
       solver->set_refinement_cycle (step);
       solver->solve_problem ();
       solver->output_solution ();
 
       deallog << "   Number of degrees of freedom="
-               << solver->n_dofs() << std::endl;
-      
+              << solver->n_dofs() << std::endl;
+
       for (typename EvaluatorList::const_iterator
-            e = descriptor.evaluator_list.begin();
-          e != descriptor.evaluator_list.end(); ++e)
-       {
-         (*e)->set_refinement_cycle (step);
-         solver->postprocess (**e);
-       };
-
-           
+           e = descriptor.evaluator_list.begin();
+           e != descriptor.evaluator_list.end(); ++e)
+        {
+          (*e)->set_refinement_cycle (step);
+          solver->postprocess (**e);
+        };
+
+
       if (solver->n_dofs() < descriptor.max_degrees_of_freedom)
-       solver->refine_grid ();
+        solver->refine_grid ();
       else
-       break;
+        break;
     };
 
   deallog << std::endl;
@@ -2105,66 +2108,66 @@ void Framework<dim>::run (const ProblemDescription &descriptor)
 
 
 
-int main () 
+int main ()
 {
   deallog.depth_console (0);
   try
     {
       logfile.precision(2);
-  
+
       deallog.attach(logfile);
       deallog.depth_console(0);
-      deallog.threshold_double(1.e-10);  
+      deallog.threshold_double(1.e-10);
 
       const unsigned int dim = 2;
       Framework<dim>::ProblemDescription descriptor;
 
       descriptor.refinement_criterion
-       = Framework<dim>::ProblemDescription::dual_weighted_error_estimator;
+        = Framework<dim>::ProblemDescription::dual_weighted_error_estimator;
 
       descriptor.primal_fe_degree = 1;
       descriptor.dual_fe_degree   = 2;
 
       descriptor.data = new Data::SetUp<Data::Exercise_2_3<dim>,dim> ();
-      
+
       const Point<dim> evaluation_point (0.75, 0.75);
       descriptor.dual_functional
-       = new DualFunctional::PointValueEvaluation<dim> (evaluation_point);
-      
+        = new DualFunctional::PointValueEvaluation<dim> (evaluation_point);
+
       Evaluation::PointValueEvaluation<dim>
-       postprocessor1 (evaluation_point);
+      postprocessor1 (evaluation_point);
       Evaluation::GridOutput<dim>
-       postprocessor2 ("grid");
-      
+      postprocessor2 ("grid");
+
       descriptor.evaluator_list.push_back (&postprocessor1);
       descriptor.evaluator_list.push_back (&postprocessor2);
 
       descriptor.max_degrees_of_freedom = 20000;
-      
+
       Framework<dim>::run (descriptor);
     }
 
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 
index 0956f045767b46eeea52fd1f031eb47c79e8b6d6..5a7c267548a806bf510887f314b4ba413da78ec1 100644 (file)
@@ -71,19 +71,19 @@ double gradient_power (const Tensor<1,dim> &v,
 
 
 
-class InitializationValues : public Function<1> 
+class InitializationValues : public Function<1>
 {
-  public:
-    InitializationValues () : Function<1>() {}
-    
-    virtual double value (const Point<1>     &p,
-                         const unsigned int  component = 0) const;
+public:
+  InitializationValues () : Function<1>() {}
+
+  virtual double value (const Point<1>     &p,
+                        const unsigned int  component = 0) const;
 };
 
 
 
 double InitializationValues::value (const Point<1> &p,
-                                    const unsigned int) const 
+                                    const unsigned int) const
 {
   const double base = std::pow(p(0), 1./3.);
   const double random = 2.*rand()/RAND_MAX-1;
@@ -93,54 +93,54 @@ double InitializationValues::value (const Point<1> &p,
 
 
 template <int dim>
-class MinimizationProblem 
+class MinimizationProblem
 {
-  public:
-    MinimizationProblem  (const unsigned int run_number);
-    void run ();
-    
-  private:
-    void initialize_solution ();
-    void setup_system_on_mesh ();
-    void assemble_step ();
-    double line_search (const Vector<double> & update) const;
-    void do_step ();
-    void output_results () const;
-    void refine_grid ();
-
-    static double energy (const hp::DoFHandler<dim> &dof_handler,
-                          const Vector<double>  &function);
-
-    const unsigned int run_number;
-    
-    Triangulation<dim>   triangulation;
-
-    hp::FECollection<dim>            fe;
-    hp::DoFHandler<dim>      dof_handler;
-
-    ConstraintMatrix     hanging_node_constraints;
-    
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> matrix;
-
-    Vector<double>       present_solution;
-    Vector<double>       residual;
+public:
+  MinimizationProblem  (const unsigned int run_number);
+  void run ();
+
+private:
+  void initialize_solution ();
+  void setup_system_on_mesh ();
+  void assemble_step ();
+  double line_search (const Vector<double> &update) const;
+  void do_step ();
+  void output_results () const;
+  void refine_grid ();
+
+  static double energy (const hp::DoFHandler<dim> &dof_handler,
+                        const Vector<double>  &function);
+
+
+  const unsigned int run_number;
+
+  Triangulation<dim>   triangulation;
+
+  hp::FECollection<dim>            fe;
+  hp::DoFHandler<dim>      dof_handler;
+
+  ConstraintMatrix     hanging_node_constraints;
+
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> matrix;
+
+  Vector<double>       present_solution;
+  Vector<double>       residual;
 };
 
 
 
 template <int dim>
 MinimizationProblem<dim>::MinimizationProblem (const unsigned int run_number)
-                :
-                run_number (run_number),
-                fe (FE_Q<dim>(1)),
-               dof_handler (triangulation)
+  :
+  run_number (run_number),
+  fe (FE_Q<dim>(1)),
+  dof_handler (triangulation)
 {}
 
 
 template <>
-void MinimizationProblem<1>::initialize_solution () 
+void MinimizationProblem<1>::initialize_solution ()
 {
   present_solution.reinit (dof_handler.n_dofs());
   VectorTools::interpolate (dof_handler,
@@ -169,12 +169,12 @@ void MinimizationProblem<dim>::setup_system_on_mesh ()
 {
   hanging_node_constraints.clear ();
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          hanging_node_constraints);
+                                           hanging_node_constraints);
   hanging_node_constraints.close ();
 
   sparsity_pattern.reinit (dof_handler.n_dofs(),
-                          dof_handler.n_dofs(),
-                          dof_handler.max_couplings_between_dofs());
+                           dof_handler.n_dofs(),
+                           dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
 
   hanging_node_constraints.condense (sparsity_pattern);
@@ -191,9 +191,9 @@ void MinimizationProblem<dim>::assemble_step ()
   residual.reinit (dof_handler.n_dofs());
 
   hp::QCollection<dim>  quadrature_formula(QGauss<dim>(4));
-  hp::FEValues<dim> fe_values (fe, quadrature_formula, 
-                          update_values   | update_gradients |
-                           update_q_points | update_JxW_values);
+  hp::FEValues<dim> fe_values (fe, quadrature_formula,
+                               update_values   | update_gradients |
+                               update_q_points | update_JxW_values);
 
   const unsigned int dofs_per_cell = fe[0].dofs_per_cell;
   const unsigned int n_q_points    = quadrature_formula[0].size();
@@ -207,8 +207,8 @@ void MinimizationProblem<dim>::assemble_step ()
   std::vector<Tensor<1,dim> > local_solution_grads (n_q_points);
 
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       cell_matrix = 0;
@@ -217,9 +217,9 @@ void MinimizationProblem<dim>::assemble_step ()
       fe_values.reinit (cell);
 
       fe_values.get_present_fe_values().get_function_values (present_solution,
-                                     local_solution_values);
+                                                             local_solution_values);
       fe_values.get_present_fe_values().get_function_grads (present_solution,
-                                    local_solution_grads);
+                                                            local_solution_grads);
 
       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
         {
@@ -231,14 +231,14 @@ void MinimizationProblem<dim>::assemble_step ()
           for (unsigned int i=0; i<dofs_per_cell; ++i)
             for (unsigned int j=0; j<dofs_per_cell; ++j)
               cell_matrix(i,j)
-                += (fe_values.get_present_fe_values().shape_grad(i,q_point) *
-                    fe_values.get_present_fe_values().shape_grad(j,q_point) *
-                    cell->diameter() *
-                    cell->diameter()
-                    +
-                    fe_values.get_present_fe_values().shape_value(i,q_point) *
-                    fe_values.get_present_fe_values().shape_value(j,q_point)) *
-                fe_values.get_present_fe_values().JxW(q_point);
+              += (fe_values.get_present_fe_values().shape_grad(i,q_point) *
+                  fe_values.get_present_fe_values().shape_grad(j,q_point) *
+                  cell->diameter() *
+                  cell->diameter()
+                  +
+                  fe_values.get_present_fe_values().shape_value(i,q_point) *
+                  fe_values.get_present_fe_values().shape_value(j,q_point)) *
+                 fe_values.get_present_fe_values().JxW(q_point);
 
           for (unsigned int i=0; i<dofs_per_cell; ++i)
             cell_rhs(i) += -((6. * x_minus_u3 *
@@ -246,26 +246,26 @@ void MinimizationProblem<dim>::assemble_step ()
                               fe_values.get_present_fe_values().shape_value(i,q_point)
                               *
                               (x_minus_u3 *
-                               (u_prime * 
+                               (u_prime *
                                 fe_values.get_present_fe_values().shape_grad(i,q_point))
                                -
                                (u_prime*u_prime) * u * u *
                                fe_values.get_present_fe_values().shape_value(i,q_point))
-                              )
+                             )
                              *
                              fe_values.get_present_fe_values().JxW(q_point));
         }
-      
+
       cell->get_dof_indices (local_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           matrix.add (local_dof_indices[i],
-                              local_dof_indices[j],
-                              cell_matrix(i,j));
-         
-         residual(local_dof_indices[i]) += cell_rhs(i);
-       }
+        {
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            matrix.add (local_dof_indices[i],
+                        local_dof_indices[j],
+                        cell_matrix(i,j));
+
+          residual(local_dof_indices[i]) += cell_rhs(i);
+        }
     }
 
   hanging_node_constraints.condense (matrix);
@@ -273,9 +273,9 @@ void MinimizationProblem<dim>::assemble_step ()
 
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           ZeroFunction<dim>(),
-                                           boundary_values);
+                                            0,
+                                            ZeroFunction<dim>(),
+                                            boundary_values);
   if (dim == 1)
     VectorTools::interpolate_boundary_values (dof_handler,
                                               1,
@@ -283,9 +283,9 @@ void MinimizationProblem<dim>::assemble_step ()
                                               boundary_values);
   Vector<double> dummy (residual.size());
   MatrixTools::apply_boundary_values (boundary_values,
-                                     matrix,
-                                     dummy,
-                                     residual);
+                                      matrix,
+                                      dummy,
+                                      residual);
 }
 
 
@@ -303,7 +303,7 @@ MinimizationProblem<dim>::line_search (const Vector<double> &update) const
       const double f_a = energy (dof_handler, tmp);
 
       const double dalpha = (alpha != 0 ? alpha/100 : 0.01);
-      
+
       tmp = present_solution;
       tmp.add (alpha+dalpha, update);
       const double f_a_plus = energy (dof_handler, tmp);
@@ -329,7 +329,7 @@ MinimizationProblem<dim>::line_search (const Vector<double> &update) const
           tmp = present_solution;
           tmp.add (alpha+step_length, update);
           const double e = energy (dof_handler, tmp);
-          
+
           if (e >= f_a)
             step_length /= 2;
           else
@@ -346,7 +346,7 @@ MinimizationProblem<dim>::line_search (const Vector<double> &update) const
 
 template <int dim>
 void MinimizationProblem<dim>::do_step ()
-{          
+{
   assemble_step ();
 
   Vector<double> update (present_solution.size());
@@ -354,7 +354,7 @@ void MinimizationProblem<dim>::do_step ()
     SolverControl           solver_control (residual.size(),
                                             1e-2*residual.l2_norm());
     SolverCG<>              solver (solver_control);
-    
+
     PreconditionSSOR<> preconditioner;
     preconditioner.initialize(matrix);
 
@@ -393,26 +393,26 @@ template <>
 void MinimizationProblem<1>::refine_grid ()
 {
   const unsigned int dim = 1;
-  
+
   Vector<float> error_indicators (triangulation.n_active_cells());
 
   QTrapez<dim> q;
   hp::QCollection<dim> quadrature(q);
   hp::FEValues<dim> fe_values (fe, quadrature,
-                           update_values   | update_gradients |
-                           update_second_derivatives |
-                           update_q_points | update_JxW_values);
+                               update_values   | update_gradients |
+                               update_second_derivatives |
+                               update_q_points | update_JxW_values);
 
   hp::FEValues<dim> neighbor_fe_values (fe, quadrature,
-                                    update_gradients);
+                                        update_gradients);
 
   std::vector<double> local_values (quadrature[0].size());
   std::vector<Tensor<1,dim> > local_gradients (quadrature[0].size());
   std::vector<Tensor<2,dim> > local_2nd_derivs (quadrature[0].size());
 
   hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active (),
-    endc = dof_handler.end ();
+  cell = dof_handler.begin_active (),
+  endc = dof_handler.end ();
   for (unsigned int cell_index = 0; cell!=endc; ++cell, ++cell_index)
     {
       fe_values.reinit (cell);
@@ -434,7 +434,7 @@ void MinimizationProblem<1>::refine_grid ()
                 5*(x-u*u*u)*u_doubleprime
                 +
                 2*u_prime*(1-3*u*u*u_prime)));
-          
+
           cell_residual_norm += (local_residual_value * local_residual_value *
                                  fe_values.get_present_fe_values().JxW(q));
         }
@@ -476,23 +476,23 @@ void MinimizationProblem<1>::refine_grid ()
           hp::DoFHandler<dim>::cell_iterator right_neighbor = cell->neighbor(1);
           while (right_neighbor->has_children())
             right_neighbor = right_neighbor->child(0);
-          
+
           neighbor_fe_values.reinit (right_neighbor);
           neighbor_fe_values.get_present_fe_values().get_function_grads (present_solution, local_gradients);
 
           const double neighbor_u_prime_right = local_gradients[0][0];
 
           const double right_jump = std::pow(x_right-std::pow(u_right,3), 2) *
-                                   (std::pow(neighbor_u_prime_right,5) -
-                                    std::pow(u_prime_right,5));
+                                    (std::pow(neighbor_u_prime_right,5) -
+                                     std::pow(u_prime_right,5));
           error_indicators(cell_index) += right_jump * right_jump *
                                           cell->diameter();
-        }      
-    } 
+        }
+    }
 
   GridRefinement::refine_and_coarsen_fixed_number (triangulation,
-                                                  error_indicators,
-                                                  0.3, 0.03);
+                                                   error_indicators,
+                                                   0.3, 0.03);
   triangulation.prepare_coarsening_and_refinement();
 
   SolutionTransfer<dim> solution_transfer(dof_handler);
@@ -507,8 +507,8 @@ void MinimizationProblem<1>::refine_grid ()
 
   hanging_node_constraints.clear ();
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          hanging_node_constraints);
-  hanging_node_constraints.close ();  
+                                           hanging_node_constraints);
+  hanging_node_constraints.close ();
   hanging_node_constraints.distribute (present_solution);
 }
 
@@ -520,9 +520,9 @@ MinimizationProblem<dim>::energy (const hp::DoFHandler<dim> &dof_handler,
                                   const Vector<double>  &function)
 {
   hp::QCollection<dim>  quadrature_formula(QGauss<dim>(4));
-  hp::FEValues<dim> fe_values (dof_handler.get_fe(), quadrature_formula, 
-                          update_values   | update_gradients |
-                           update_q_points | update_JxW_values);
+  hp::FEValues<dim> fe_values (dof_handler.get_fe(), quadrature_formula,
+                               update_values   | update_gradients |
+                               update_q_points | update_JxW_values);
 
   const unsigned int   n_q_points    = quadrature_formula[0].size();
 
@@ -532,15 +532,15 @@ MinimizationProblem<dim>::energy (const hp::DoFHandler<dim> &dof_handler,
   double energy = 0.;
 
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       fe_values.reinit (cell);
       fe_values.get_present_fe_values().get_function_values (function,
-                                     local_solution_values);
+                                                             local_solution_values);
       fe_values.get_present_fe_values().get_function_grads (function,
-                                    local_solution_grads);
+                                                            local_solution_grads);
 
       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
         energy += (std::pow (fe_values.get_present_fe_values().quadrature_point(q_point)(0)
@@ -556,7 +556,7 @@ MinimizationProblem<dim>::energy (const hp::DoFHandler<dim> &dof_handler,
 
 
 template <int dim>
-void MinimizationProblem<dim>::run () 
+void MinimizationProblem<dim>::run ()
 {
   GridGenerator::hyper_cube (triangulation, 0., 1.);
   triangulation.refine_global (4);
@@ -564,11 +564,11 @@ void MinimizationProblem<dim>::run ()
   initialize_solution ();
 
   double last_energy = energy (dof_handler, present_solution);
-  
+
   while (true)
     {
       setup_system_on_mesh ();
-      
+
       for (unsigned int iteration=0; iteration<5; ++iteration)
         do_step ();
 
@@ -582,19 +582,19 @@ void MinimizationProblem<dim>::run ()
 
       refine_grid ();
     }
-  
+
   output_results ();
-  
+
   deallog << std::endl;
 }
 
 
-int main () 
+int main ()
 {
   try
     {
       logfile.precision(2);
-  
+
       deallog.attach(logfile);
       deallog.depth_console(0);
       deallog.threshold_double(1.e-10);
@@ -603,7 +603,7 @@ int main ()
       for (unsigned int realization=0; realization<n_realizations; ++realization)
         {
           deallog << "Realization " << realization << ":" << std::endl;
-  
+
           MinimizationProblem<1> minimization_problem_1d (realization);
           minimization_problem_1d.run ();
         }
@@ -611,24 +611,24 @@ int main ()
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     }
   return 0;
index 323d1ec3454062a01626a78a08ec77d44ee2dee5..40c046a755d29de8ca3773edb6d910e9ec89bf3e 100644 (file)
@@ -31,7 +31,7 @@ void test ()
   hp::FECollection<dim> fe;
   for (unsigned int i=1; i<4; ++i)
     fe.push_back (FESystem<dim>(FE_Q<dim>(i), 1,
-                               FE_DGQ<dim>(i+1), 1));
-  
+                                FE_DGQ<dim>(i+1), 1));
+
   test_with_hanging_nodes_random_aniso (fe);
 }
index 9bfe173bb1376c66163a5baa4870b9a8281408da..0434b1f8a4140466731ff3ec383aceb0969ab079 100644 (file)
@@ -35,7 +35,7 @@ void test ()
   for (unsigned int i=1; i<4; ++i)
     for (unsigned int j=0; j<4; ++j)
       fe.push_back (FESystem<dim>(FE_Q<dim>(i), 1,
-                                 FE_DGQ<dim>(j), 1));
-  
+                                  FE_DGQ<dim>(j), 1));
+
   test_with_hanging_nodes_random_aniso (fe);
 }
index 79d00c0f1289a70e39012bce5273a307dde11e39..dfda7338c64bad33a6262a66e33f42a0df337ee2 100644 (file)
@@ -30,7 +30,7 @@ void test ()
 {
   if (dim == 1)
     return;
-  
+
   hp::FECollection<dim> fe;
   for (unsigned int i=1; i<4; ++i)
     fe.push_back (FE_RaviartThomas<dim>(i));
index a90bc28faeddddf89ca616d377912b5dc789e940..ebb4ae05db2ebbcd82645b44f5c36a2fb7191bc2 100644 (file)
@@ -30,7 +30,7 @@ void test ()
 {
   if (dim == 1)
     return;
-  
+
   hp::FECollection<dim> fe;
   for (unsigned int i=1; i<4; ++i)
     fe.push_back (FE_RaviartThomas<dim>(i));
index e65a960c0212466f77a2334425e3e7420ea74dec..2fba2ce0f1bec8474cc67c5b6cd7e35777df0190 100644 (file)
@@ -30,7 +30,7 @@ void test ()
 {
   if (dim == 1)
     return;
-  
+
   hp::FECollection<dim> fe;
   for (unsigned int i=1; i<4; ++i)
     fe.push_back (FE_RaviartThomas<dim>(i));
index 847304a48c11a1d2e6cedcc1177350acc6f894bc..808e1ea861821d67e54b3307dc62a39cd761f881 100644 (file)
@@ -30,7 +30,7 @@ void test ()
 {
   if (dim == 1)
     return;
-  
+
   hp::FECollection<dim> fe;
   for (unsigned int i=1; i<4; ++i)
     fe.push_back (FE_RaviartThomas<dim>(i));
index 7a49b3aadb4d50d6ca76a30d33ec0051ea84d5e4..e5a7dd7042d0940f60af3d231ae1adf23f4a8ad7 100644 (file)
@@ -30,7 +30,7 @@ void test ()
 {
   if (dim == 1)
     return;
-  
+
   hp::FECollection<dim> fe;
   for (unsigned int i=1; i<4; ++i)
     fe.push_back (FE_RaviartThomas<dim>(i));
index 12e9f647edeca934515393e780c7f1dfe5e8577d..814d0a72d53d66c557119ae97b93019889ba9450 100644 (file)
@@ -30,7 +30,7 @@ void test ()
 {
   if (dim == 1)
     return;
-  
+
   hp::FECollection<dim> fe;
   std::vector<unsigned int> degrees;
   for (unsigned int i=1; i<7-dim; ++i)
@@ -38,6 +38,6 @@ void test ()
       fe.push_back (FE_RaviartThomas<dim>(i));
       degrees.push_back (i);
     }
-  
+
   test_interpolation  (fe, degrees);
 }
index d3a745db72b4eed19fb04e54939ec8ddab2d50d4..c11ee8fbac85fc496c6c874ec144f3d0d40dce0d 100644 (file)
@@ -27,7 +27,7 @@ void test ()
 {
   if (dim == 1)
     return;
-  
+
   for (unsigned int i=1; i<4; ++i)
     for (unsigned int j=i; j<4; ++j)
       do_check (FE_Nedelec<dim>(i), FE_Nedelec<dim>(j));
index bc4cae641f38664f12cf92be6449b6c8254d6d74..b982c62d23a5e1eb65b460ca6baed3ab7d7a59a0 100644 (file)
@@ -27,7 +27,7 @@ void test ()
 {
   if (dim == 1)
     return;
-  
+
   for (unsigned int i=0; i<4; ++i)
     for (unsigned int j=i; j<4; ++j)
       do_check (FE_RaviartThomas<dim>(i), FE_RaviartThomas<dim>(j));
index 4f9371d74f18b37cc717e6b576010d95ba151bce..d064cb95e6dceb2196287266fee94f9a8cde1baa 100644 (file)
@@ -28,9 +28,9 @@ template <int dim>
 void test ()
 {
   if (dim != 1)
-                                    // this is interesting also in 3d, but is
-                                    // exceedingly slow there. limit to the
-                                    // case of RT(0) elements in 3d
+    // this is interesting also in 3d, but is
+    // exceedingly slow there. limit to the
+    // case of RT(0) elements in 3d
     for (unsigned int p=0; p<(dim == 2 ? 3 : 1); ++p)
       test_with_wrong_face_orientation (FE_RaviartThomas<dim>(p), p+1, 1);
 }
index 6946bebe287cb88ea13d3c50269a40e643e1b51f..ecd0534ae9bcbff1bf43c5eb6e99ebd70af8f45b 100644 (file)
@@ -34,21 +34,21 @@ void
 test(const unsigned int degree)
 {
   deallog << "FE_RaviartThomas<" << dim << "> (" << degree << ")"
-         << std::endl;
-  
+          << std::endl;
+
   FE_RaviartThomas<dim> fe_rt(degree);
 
   for (unsigned int c=0; c<GeometryInfo<dim>::max_children_per_cell; ++c)
     {
-      const FullMatrix<double> & m = fe_rt.get_prolongation_matrix(c,RefinementCase<dim>::isotropic_refinement);
+      const FullMatrix<double> &m = fe_rt.get_prolongation_matrix(c,RefinementCase<dim>::isotropic_refinement);
 
       for (unsigned int i=0; i<m.m(); ++i)
-       {
-         for (unsigned int j=0; j<m.n(); ++j)
-           deallog << 100*m(i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<m.n(); ++j)
+            deallog << 100*m(i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << std::endl;
     }
 }
@@ -59,7 +59,7 @@ main()
 {
   std::ofstream logfile ("rt_4/output");
   logfile.precision (PRECISION);
-  logfile.setf(std::ios::fixed);  
+  logfile.setf(std::ios::fixed);
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
@@ -67,7 +67,7 @@ main()
   for (unsigned int degree=0; degree<4; ++degree)
     test<2>(degree);
 //  test<3>(degree);
-  
+
   return 0;
 }
 
index b8d1e10b5e7ab5947b27d1461c1b712eae0a4ac7..2834535ee43a61ec4422c53639c7036894cd3fca 100644 (file)
 template <int dim>
 Point<dim> transform (const Point<dim> p)
 {
-  switch (dim) 
+  switch (dim)
     {
-      case 1:
-            return p;
-      case 2:
-            return Point<dim>(p(0)*(1+p(1)), p(1)*(1+p(0)));
-      case 3:
-            return Point<dim>(p(0)*(1+p(1))*(1+p(2)),
-                              p(1)*(1+p(0))*(1+p(2)),
-                              p(2)*(1+p(0))*(1+p(1)));
-      default:
-            Assert (false, ExcNotImplemented());
-            return Point<dim>();
+    case 1:
+      return p;
+    case 2:
+      return Point<dim>(p(0)*(1+p(1)), p(1)*(1+p(0)));
+    case 3:
+      return Point<dim>(p(0)*(1+p(1))*(1+p(2)),
+                        p(1)*(1+p(0))*(1+p(2)),
+                        p(2)*(1+p(0))*(1+p(1)));
+    default:
+      Assert (false, ExcNotImplemented());
+      return Point<dim>();
     };
 }
 
@@ -64,17 +64,17 @@ void check_element (const Triangulation<dim> &tr,
   DoFHandler<dim> dof_handler(tr);
   dof_handler.distribute_dofs (fe);
 
-                                   // create a mostly arbitrary
-                                   // function plus a trend on this
-                                   // grid
+  // create a mostly arbitrary
+  // function plus a trend on this
+  // grid
   Vector<double> tmp(dof_handler.n_dofs());
   for (unsigned int i=0; i<tmp.size(); ++i)
     tmp(i) = (i + 13*i%17);
 
-                                   // restrict this function to the
-                                   // next coarser level and
-                                   // distribute it again to the
-                                   // higher level
+  // restrict this function to the
+  // next coarser level and
+  // distribute it again to the
+  // higher level
   Vector<double> x(tmp.size());
   Vector<double> v(fe.dofs_per_cell);
   for (typename DoFHandler<dim>::cell_iterator cell=dof_handler.begin();
@@ -82,24 +82,24 @@ void check_element (const Triangulation<dim> &tr,
     if (cell->has_children() &&
         cell->child(0)->active())
       {
-                                         // first make sure that what
-                                         // we do is reasonable. for
-                                         // this, _all_ children have
-                                         // to be active, not only
-                                         // some of them
+        // first make sure that what
+        // we do is reasonable. for
+        // this, _all_ children have
+        // to be active, not only
+        // some of them
         for (unsigned int c=0; c<GeometryInfo<dim>::max_children_per_cell; ++c)
           Assert (cell->child(c)->active(), ExcInternalError());
 
-                                         // then restrict and prolongate
+        // then restrict and prolongate
         cell->get_interpolated_dof_values (tmp, v);
         cell->set_dof_values_by_interpolation (v, x);
       };
 
-                                   // now x is a function on the fine
-                                   // grid that is representable on
-                                   // the coarse grid. so another
-                                   // cycle should not alter it any
-                                   // more:
+  // now x is a function on the fine
+  // grid that is representable on
+  // the coarse grid. so another
+  // cycle should not alter it any
+  // more:
   Vector<double> x2(x.size());
   for (typename DoFHandler<dim>::cell_iterator cell=dof_handler.begin();
        cell!=dof_handler.end(); ++cell)
@@ -110,7 +110,7 @@ void check_element (const Triangulation<dim> &tr,
         cell->set_dof_values_by_interpolation (v, x2);
       };
 
-                                   // then check that this is so:
+  // then check that this is so:
   x2 -= x;
   const double relative_residual = (x2.l2_norm() / x.l2_norm());
 
@@ -118,7 +118,7 @@ void check_element (const Triangulation<dim> &tr,
   deallog << ", dofs_per_cell=" << fe.dofs_per_cell
           << "; relative residual: "
           << (relative_residual<threshold ? "ok" : "botched up!")
-         << " (relative residual=" << relative_residual << ")"
+          << " (relative residual=" << relative_residual << ")"
           << std::endl;
 }
 
@@ -126,30 +126,30 @@ void check_element (const Triangulation<dim> &tr,
 template <int dim>
 void test ()
 {
-                                   // make a coarse triangulation as a
-                                   // hypercube. if in more than 1d,
-                                   // distort it so that it is no more
-                                   // an affine image of the
-                                   // hypercube, to make things more
-                                   // difficult. then refine it twice
+  // make a coarse triangulation as a
+  // hypercube. if in more than 1d,
+  // distort it so that it is no more
+  // an affine image of the
+  // hypercube, to make things more
+  // difficult. then refine it twice
   Triangulation<dim> tr;
   GridGenerator::hyper_cube(tr, 0., 1.);
   Point<dim> (*p) (Point<dim>) = &transform<dim>;
   GridTools::transform (p, tr);
   tr.refine_global (2);
 
-                                   // now for a list of finite
-                                   // elements, for which we want to
-                                   // test. we happily waste tons of
-                                   // memory here, but who cares...
+  // now for a list of finite
+  // elements, for which we want to
+  // test. we happily waste tons of
+  // memory here, but who cares...
   const FiniteElement<dim> *fe_list[]
-    = 
-    {
-          new FE_RaviartThomas<dim>(0),
-          new FE_RaviartThomas<dim>(1),
-         new FE_RaviartThomas<dim>(2)
-    };
-  
+  =
+  {
+    new FE_RaviartThomas<dim>(0),
+    new FE_RaviartThomas<dim>(1),
+    new FE_RaviartThomas<dim>(2)
+  };
+
   for (unsigned int i=0; i<sizeof(fe_list)/sizeof(fe_list[0]); ++i)
     if (fe_list[i] != 0)
       {
@@ -165,11 +165,11 @@ main()
 {
   std::ofstream logfile ("rt_6/output");
   logfile.precision (PRECISION);
-  logfile.setf(std::ios::fixed);  
+  logfile.setf(std::ios::fixed);
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<2>();
   test<3>();
   return 0;
index a8f7b4e5ae7923ffd369414cc9459ecaae75ef32..df6c51dfb3ee4645c43cf5f7c79281205f4fcf7e 100644 (file)
@@ -36,19 +36,19 @@ template <int dim>
 void
 check_this (const DoFHandler<dim> &dof_handler)
 {
-                                   // there's presently a crash in the
-                                   // Raviart-Thomas element. only
-                                   // check for these elements,
-                                   // everything else is handled in
-                                   // dof_tools_19
+  // there's presently a crash in the
+  // Raviart-Thomas element. only
+  // check for these elements,
+  // everything else is handled in
+  // dof_tools_19
   if (dof_handler.get_fe().get_name().find ("RaviartThomas") ==
       std::string::npos)
     return;
 
   ConstantFunction<dim> test_func (1, dof_handler.get_fe().n_components ());
 
-                                   // don't run this test if hanging
-                                   // nodes are not implemented
+  // don't run this test if hanging
+  // nodes are not implemented
   if (dof_handler.get_fe().constraints_are_implemented() == false)
     return;
 
@@ -64,16 +64,16 @@ check_this (const DoFHandler<dim> &dof_handler)
   Vector<double> solution (dof_handler.n_dofs ());
 
   VectorTools::project (dof_handler, cm,
-                       quadrature, test_func,
-                       solution);
+                        quadrature, test_func,
+                        solution);
   cm.distribute (solution);
 
-                                  // all values of the projected solution
-                                  // should be close around 1 (the value of
-                                  // the original function)
+  // all values of the projected solution
+  // should be close around 1 (the value of
+  // the original function)
   for (unsigned int i=0; i<solution.size(); ++i)
     Assert (std::fabs (solution(i)-1) < 1e-6,
-           ExcInternalError());
+            ExcInternalError());
 
   // Evaluate error
   Vector<double> cellwise_errors (dof_handler.get_tria ().n_active_cells());
index cf854748d2d7dbc4ed9ac75d34d9fb558ed206bd..41a563b1d02e68b6d22e86b345d8402a72974342 100644 (file)
@@ -68,18 +68,18 @@ std::ofstream logfile ("rt_distorted_01/output");
 template <int dim>
 class TestMap1 : public Function<dim>
 {
-  public:
-    TestMap1 (const unsigned int n_components) :
-                   Function<dim> (n_components)
-      {}
+public:
+  TestMap1 (const unsigned int n_components) :
+    Function<dim> (n_components)
+  {}
 
-    virtual ~TestMap1 () {}
+  virtual ~TestMap1 () {}
 
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
 
-    void vector_value (const Point<dim> &p,
-                      Vector<double>   &return_value) const;
+  void vector_value (const Point<dim> &p,
+                     Vector<double>   &return_value) const;
 };
 
 
@@ -87,7 +87,7 @@ class TestMap1 : public Function<dim>
 template <int dim>
 double
 TestMap1<dim>::value (const Point<dim>   &/*p*/,
-                     const unsigned int  /*component*/) const
+                      const unsigned int  /*component*/) const
 {
   return (1);
 }
@@ -95,12 +95,12 @@ TestMap1<dim>::value (const Point<dim>   &/*p*/,
 
 template <int dim>
 void TestMap1<dim>::vector_value (const Point<dim> &p,
-                                 Vector<double>   &return_value) const
+                                  Vector<double>   &return_value) const
 {
   Assert (return_value.size() == this->n_components,
-         ExcDimensionMismatch (return_value.size(), this->n_components));
+          ExcDimensionMismatch (return_value.size(), this->n_components));
 
-                                  // Parabolic inflow profile
+  // Parabolic inflow profile
   for (unsigned int iCount = 0; iCount < this->n_components; iCount++)
     return_value (iCount) = value (p, iCount);
 }
@@ -110,22 +110,22 @@ void TestMap1<dim>::vector_value (const Point<dim> &p,
 template <int dim>
 class TestDef1 : public Function<dim>
 {
-  private:
-    const double phi;
+private:
+  const double phi;
 
-  public:
-    TestDef1 (const unsigned int n_components, const double ph) :
-                   Function<dim> (n_components),
-                   phi (ph)
-      {}
+public:
+  TestDef1 (const unsigned int n_components, const double ph) :
+    Function<dim> (n_components),
+    phi (ph)
+  {}
 
-    virtual ~TestDef1 () {}
+  virtual ~TestDef1 () {}
 
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
 
-    void vector_value (const Point<dim> &p,
-                      Vector<double>   &return_value) const;
+  void vector_value (const Point<dim> &p,
+                     Vector<double>   &return_value) const;
 };
 
 
@@ -133,13 +133,13 @@ class TestDef1 : public Function<dim>
 template <int dim>
 double
 TestDef1<dim>::value (const Point<dim>   &p,
-                     const unsigned int  component) const
+                      const unsigned int  component) const
 {
   Point<2> center;
   center(0) = 0.5;
   center(1) = 0.5;
   double rad = p.distance (center),
-       phi_p = atan2 (p(0) - center(0), p(1) - center(1));
+         phi_p = atan2 (p(0) - center(0), p(1) - center(1));
 
   if (component == 0)
     return rad * (sin (phi + phi_p) - sin (phi_p));
@@ -150,10 +150,10 @@ TestDef1<dim>::value (const Point<dim>   &p,
 
 template <int dim>
 void TestDef1<dim>::vector_value (const Point<dim> &p,
-                                 Vector<double>   &return_value) const
+                                  Vector<double>   &return_value) const
 {
   Assert (return_value.size() == this->n_components,
-         ExcDimensionMismatch (return_value.size(), this->n_components));
+          ExcDimensionMismatch (return_value.size(), this->n_components));
   for (unsigned int iCount = 0; iCount < this->n_components; iCount++)
     return_value (iCount) = value (p, iCount);
 }
@@ -165,32 +165,32 @@ void TestDef1<dim>::vector_value (const Point<dim> &p,
 template <int dim>
 class TestDef2 : public Function<dim>
 {
-  private:
-    const double scale;
+private:
+  const double scale;
 
-  public:
-    TestDef2 (const unsigned int n_components, const double sc) :
-                   Function<dim> (n_components),
-                   scale (sc)
-      {}
+public:
+  TestDef2 (const unsigned int n_components, const double sc) :
+    Function<dim> (n_components),
+    scale (sc)
+  {}
 
-    virtual ~TestDef2 () {}
+  virtual ~TestDef2 () {}
 
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
 
-    void vector_value (const Point<dim> &p,
-                      Vector<double>   &return_value) const;
+  void vector_value (const Point<dim> &p,
+                     Vector<double>   &return_value) const;
 };
 
 
 template <int dim>
 double
 TestDef2<dim>::value (const Point<dim>   &p,
-                     const unsigned int  component) const
+                      const unsigned int  component) const
 {
   double x = p(0),
-        y = p(1);
+         y = p(1);
 
   if (component == 0)
     return scale * x;
@@ -201,10 +201,10 @@ TestDef2<dim>::value (const Point<dim>   &p,
 
 template <int dim>
 void TestDef2<dim>::vector_value (const Point<dim> &p,
-                                 Vector<double>   &return_value) const
+                                  Vector<double>   &return_value) const
 {
   Assert (return_value.size() == this->n_components,
-         ExcDimensionMismatch (return_value.size(), this->n_components));
+          ExcDimensionMismatch (return_value.size(), this->n_components));
   for (unsigned int iCount = 0; iCount < this->n_components; iCount++)
     return_value (iCount) = value (p, iCount);
 }
@@ -217,29 +217,29 @@ void TestDef2<dim>::vector_value (const Point<dim> &p,
 template <int dim>
 class TestDef3 : public Function<dim>
 {
-  private:
-    const double scale;
+private:
+  const double scale;
 
-  public:
-    TestDef3 (const unsigned int n_components, const double sc) :
-                   Function<dim> (n_components),
-                   scale (sc)
-      {}
+public:
+  TestDef3 (const unsigned int n_components, const double sc) :
+    Function<dim> (n_components),
+    scale (sc)
+  {}
 
-    virtual ~TestDef3 () {}
+  virtual ~TestDef3 () {}
 
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
 
-    void vector_value (const Point<dim> &p,
-                      Vector<double>   &return_value) const;
+  void vector_value (const Point<dim> &p,
+                     Vector<double>   &return_value) const;
 };
 
 
 template <int dim>
 double
 TestDef3<dim>::value (const Point<dim>   &p,
-                     const unsigned int  component) const
+                      const unsigned int  component) const
 {
   double y = p(1);
 
@@ -252,10 +252,10 @@ TestDef3<dim>::value (const Point<dim>   &p,
 
 template <int dim>
 void TestDef3<dim>::vector_value (const Point<dim> &p,
-                                 Vector<double>   &return_value) const
+                                  Vector<double>   &return_value) const
 {
   Assert (return_value.size() == this->n_components,
-         ExcDimensionMismatch (return_value.size(), this->n_components));
+          ExcDimensionMismatch (return_value.size(), this->n_components));
   for (unsigned int iCount = 0; iCount < this->n_components; iCount++)
     return_value (iCount) = value (p, iCount);
 }
@@ -267,40 +267,40 @@ void TestDef3<dim>::vector_value (const Point<dim> &p,
  */
 
 double EvaluateArea (Mapping<2> &mapping,
-                    DoFHandler<2> *dof_handler,
-                    Vector<double> &solution)
+                     DoFHandler<2> *dof_handler,
+                     Vector<double> &solution)
 {
-                                  // Use a high order quadrature.
+  // Use a high order quadrature.
   QGauss<2> quad (6);
   FEValues<2> fe_values (mapping, dof_handler->get_fe (), quad,
-                        UpdateFlags(update_values    |
-                                    update_q_points  |
-                                    update_JxW_values));
+                         UpdateFlags(update_values    |
+                                     update_q_points  |
+                                     update_JxW_values));
 
   const unsigned int   n_q_points    = quad.size();
   const unsigned int   n_components   = dof_handler->get_fe().n_components();
 
-                                  // Cell iterators
+  // Cell iterators
   DoFHandler<2>::active_cell_iterator cell = dof_handler->begin_active(),
-                                     endc = dof_handler->end();
+                                      endc = dof_handler->end();
   double result_u = 0,
-        result_v = 0;
+         result_v = 0;
 
   for (; cell!=endc; ++cell)
     {
       fe_values.reinit (cell);
 
-                                      // Get values from solution vector (For Trap.Rule)
+      // Get values from solution vector (For Trap.Rule)
       std::vector<Vector<double> > this_value
-       (n_q_points, Vector<double>(n_components));
+      (n_q_points, Vector<double>(n_components));
       fe_values.get_function_values (solution, this_value);
 
       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-       {
-         double JxW = fe_values.JxW (q_point);
-         result_u += this_value[q_point](0) * JxW;
-         result_v += this_value[q_point](1) * JxW;
-       }
+        {
+          double JxW = fe_values.JxW (q_point);
+          result_u += this_value[q_point](0) * JxW;
+          result_v += this_value[q_point](1) * JxW;
+        }
     }
 
   return (result_v);
@@ -317,81 +317,81 @@ int main (int /*argc*/, char **/*argv*/)
 
   Triangulation<2> tria_test;
   DoFHandler<2> *dof_handler,
-    *dof_handler_def;
+             *dof_handler_def;
   Point<2> p1 (0,0),
-    p2 (1, 1);
+        p2 (1, 1);
 
   GridGenerator::hyper_rectangle (tria_test, p1, p2);
   tria_test.refine_global (1);
 
-                                  // Uncommenting the following line, demonstrates the problem
-                                  // of RT elements on distorted Quads!
+  // Uncommenting the following line, demonstrates the problem
+  // of RT elements on distorted Quads!
   tria_test.distort_random (0.4);
 
-                                  // Create a DoFHandler for the RT space
+  // Create a DoFHandler for the RT space
   FE_RaviartThomas<2> fe (2);
   dof_handler = new DoFHandler<2> (tria_test);
   dof_handler->distribute_dofs (fe);
 
-                                  // Create an deformation object for the Eulerian mapping
+  // Create an deformation object for the Eulerian mapping
   FESystem<2> fe_def (FE_Q<2>(1), 2);
   dof_handler_def = new DoFHandler<2> (tria_test);
   dof_handler_def->distribute_dofs (fe_def);
 
-                                  // Alloc some DoFs
+  // Alloc some DoFs
   Vector<double> solution,
-    solution_q,
-    deformation;
+         solution_q,
+         deformation;
   solution.reinit (dof_handler->n_dofs ());
   solution_q.reinit (dof_handler_def->n_dofs ());
   deformation.reinit (dof_handler_def->n_dofs ());
 
-                                  // Project solution onto RT FE field
+  // Project solution onto RT FE field
   ConstraintMatrix     hn_constraints;
   hn_constraints.clear ();
   DoFTools::make_hanging_node_constraints (*dof_handler,
-                                          hn_constraints);
+                                           hn_constraints);
   hn_constraints.close ();
   VectorTools::project (*dof_handler, hn_constraints,
-                       QGauss<2> (6), TestMap1<2>(2),
-                       solution);
+                        QGauss<2> (6), TestMap1<2>(2),
+                        solution);
 
-                                  // Project reference solution onto RT FE field
+  // Project reference solution onto RT FE field
   ConstraintMatrix     hn_constraints_def;
   hn_constraints_def.clear ();
   DoFTools::make_hanging_node_constraints (*dof_handler_def,
-                                          hn_constraints_def);
+                                           hn_constraints_def);
   hn_constraints_def.close ();
 
   VectorTools::project (*dof_handler_def, hn_constraints_def,
-                       QGauss<2> (6), TestMap1<2>(2),
-                       solution_q);
+                        QGauss<2> (6), TestMap1<2>(2),
+                        solution_q);
 
   MappingQ1Eulerian<2> *mapping_euler
     = new MappingQ1Eulerian<2> (deformation, *dof_handler_def);
 
   char buf[1000];
   sprintf (buf,
-          "FE_RT Area %e  FE_Q Area %e\n",
-          EvaluateArea (*mapping_euler, dof_handler, solution),
-          EvaluateArea (*mapping_euler, dof_handler_def, solution_q));
+           "FE_RT Area %e  FE_Q Area %e\n",
+           EvaluateArea (*mapping_euler, dof_handler, solution),
+           EvaluateArea (*mapping_euler, dof_handler_def, solution_q));
   deallog << buf;
 
   unsigned int test_out = 0;
-                                  // Try rotating the elements
+  // Try rotating the elements
   for (double rotat = 0; rotat < 2 * M_PI; rotat += 0.25 * M_PI)
     {
-                                      // Rotate element
+      // Rotate element
       VectorTools::project (*dof_handler_def, hn_constraints_def,
-                           QGauss<2> (6), TestDef1<2>(2, rotat),
-                           deformation);
+                            QGauss<2> (6), TestDef1<2>(2, rotat),
+                            deformation);
 
-                                      // Project 1 function to element
+      // Project 1 function to element
       VectorTools::project (*mapping_euler, *dof_handler, hn_constraints,
-                           QGauss<2> (6), TestMap1<2>(2),
-                           solution);
+                            QGauss<2> (6), TestMap1<2>(2),
+                            solution);
 
-                                      // Write output files
+      // Write output files
       DataOut<2> *data_out = new DataOut<2>;
       data_out->attach_dof_handler (*dof_handler);
       data_out->add_data_vector (solution, "solution");
@@ -407,49 +407,49 @@ int main (int /*argc*/, char **/*argv*/)
 
       char buf[100];
       sprintf (buf, "phi = %e FE_RT Area %e  FE_Q Area %e\n",
-              rotat,
-              area_rt, area_q);
+               rotat,
+               area_rt, area_q);
       deallog << buf;
     }
 
-                                  // Try resizing the elements
+  // Try resizing the elements
   for (double scale = -0.75; scale < 4.0; scale += 0.25)
     {
       VectorTools::project (*dof_handler_def, hn_constraints_def,
-                           QGauss<2> (6), TestDef2<2>(2, scale),
-                           deformation);
+                            QGauss<2> (6), TestDef2<2>(2, scale),
+                            deformation);
 
-                                      // Project 1 function to element
+      // Project 1 function to element
       VectorTools::project (*mapping_euler, *dof_handler, hn_constraints,
-                           QGauss<2> (6), TestMap1<2>(2),
-                           solution);
+                            QGauss<2> (6), TestMap1<2>(2),
+                            solution);
 
       char buf[1000];
       sprintf (buf, "Scale = %e FE_RT Area %e  FE_Q Area %e\n",
-              scale,
-              EvaluateArea (*mapping_euler, dof_handler, solution),
-              EvaluateArea (*mapping_euler, dof_handler_def, solution_q));
+               scale,
+               EvaluateArea (*mapping_euler, dof_handler, solution),
+               EvaluateArea (*mapping_euler, dof_handler_def, solution_q));
       deallog << buf;
     }
 
 
-                                  // Try parallelograms
+  // Try parallelograms
   for (double scale = -1.0; scale < 1.0; scale += 0.25)
     {
       VectorTools::project (*dof_handler_def, hn_constraints_def,
-                           QGauss<2> (6), TestDef3<2>(2, scale),
-                           deformation);
+                            QGauss<2> (6), TestDef3<2>(2, scale),
+                            deformation);
 
-                                      // Project 1 function to element
+      // Project 1 function to element
       VectorTools::project (*mapping_euler, *dof_handler, hn_constraints,
-                           QGauss<2> (6), TestMap1<2>(2),
-                           solution);
+                            QGauss<2> (6), TestMap1<2>(2),
+                            solution);
 
       char buf[1000];
       sprintf (buf, "Parallelogram = %e FE_RT Area %e  FE_Q Area %e\n",
-              scale,
-              EvaluateArea (*mapping_euler, dof_handler, solution),
-              EvaluateArea (*mapping_euler, dof_handler_def, solution_q));
+               scale,
+               EvaluateArea (*mapping_euler, dof_handler, solution),
+               EvaluateArea (*mapping_euler, dof_handler_def, solution_q));
       deallog << buf;
     }
 
index e26c9a75eb6657da73efa732f54b6cbe5a3b3618..06e5b0b171e23655405141edcab7fa88b68f05c4 100644 (file)
@@ -70,18 +70,18 @@ char buf[1000];
 template <int dim>
 class TestMap1 : public Function<dim>
 {
-  public:
-    TestMap1 (const unsigned int n_components) :
-                   Function<dim> (n_components)
-      {}
-  
-    virtual ~TestMap1 () {}
-  
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
-  
-    void vector_value (const Point<dim> &p,
-                      Vector<double>   &return_value) const;
+public:
+  TestMap1 (const unsigned int n_components) :
+    Function<dim> (n_components)
+  {}
+
+  virtual ~TestMap1 () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
+
+  void vector_value (const Point<dim> &p,
+                     Vector<double>   &return_value) const;
 };
 
 
@@ -89,10 +89,10 @@ class TestMap1 : public Function<dim>
 template <int dim>
 double
 TestMap1<dim>::value (const Point<dim>   &p,
-                     const unsigned int  component) const 
+                      const unsigned int  component) const
 {
-                                  // u = x^2, v = y^2, dudx = 2 x, dvdy = 2 y, div u = 2x + 2y
-                                  // I.e. \int div u = 2 (for unit square)
+  // u = x^2, v = y^2, dudx = 2 x, dvdy = 2 y, div u = 2x + 2y
+  // I.e. \int div u = 2 (for unit square)
 
   if (component == 0)
     return (p(0) * p(0));
@@ -105,12 +105,12 @@ TestMap1<dim>::value (const Point<dim>   &p,
 
 template <int dim>
 void TestMap1<dim>::vector_value (const Point<dim> &p,
-                                 Vector<double>   &return_value) const
+                                  Vector<double>   &return_value) const
 {
   Assert (return_value.size() == this->n_components,
-         ExcDimensionMismatch (return_value.size(), this->n_components));
-  
-                                  // Just fill the vector with the appropriate components
+          ExcDimensionMismatch (return_value.size(), this->n_components));
+
+  // Just fill the vector with the appropriate components
   for (unsigned int iCount = 0; iCount < this->n_components; iCount++)
     return_value (iCount) = value (p, iCount);
 }
@@ -122,22 +122,22 @@ void TestMap1<dim>::vector_value (const Point<dim> &p,
 template <int dim>
 class TestDef1 : public Function<dim>
 {
-  private:
-    const double phi;
-
-  public:
-    TestDef1 (const unsigned int n_components, const double ph) :
-                   Function<dim> (n_components),
-                   phi (ph)
-      {}
-    
-    virtual ~TestDef1 () {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
-    
-    void vector_value (const Point<dim> &p,
-                      Vector<double>   &return_value) const;
+private:
+  const double phi;
+
+public:
+  TestDef1 (const unsigned int n_components, const double ph) :
+    Function<dim> (n_components),
+    phi (ph)
+  {}
+
+  virtual ~TestDef1 () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
+
+  void vector_value (const Point<dim> &p,
+                     Vector<double>   &return_value) const;
 };
 
 
@@ -145,13 +145,13 @@ class TestDef1 : public Function<dim>
 template <int dim>
 double
 TestDef1<dim>::value (const Point<dim>   &p,
-                     const unsigned int  component) const 
+                      const unsigned int  component) const
 {
   Point<2> center;
   center(0) = 0.5;
   center(1) = 0.5;
   double rad = p.distance (center),
-       phi_p = atan2 (p(0) - center(0), p(1) - center(1));
+         phi_p = atan2 (p(0) - center(0), p(1) - center(1));
 
   if (component == 0)
     return rad * (sin (phi + phi_p) - sin (phi_p));
@@ -162,10 +162,10 @@ TestDef1<dim>::value (const Point<dim>   &p,
 
 template <int dim>
 void TestDef1<dim>::vector_value (const Point<dim> &p,
-                                 Vector<double>   &return_value) const
+                                  Vector<double>   &return_value) const
 {
   Assert (return_value.size() == this->n_components,
-         ExcDimensionMismatch (return_value.size(), this->n_components));
+          ExcDimensionMismatch (return_value.size(), this->n_components));
   for (unsigned int iCount = 0; iCount < this->n_components; iCount++)
     return_value (iCount) = value (p, iCount);
 }
@@ -177,32 +177,32 @@ void TestDef1<dim>::vector_value (const Point<dim> &p,
 template <int dim>
 class TestDef2 : public Function<dim>
 {
-  private:
-    const double scale;
-
-  public:
-    TestDef2 (const unsigned int n_components, const double sc) :
-                   Function<dim> (n_components),
-                   scale (sc)
-      {}
-    
-    virtual ~TestDef2 () {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
-    
-    void vector_value (const Point<dim> &p,
-                      Vector<double>   &return_value) const;
+private:
+  const double scale;
+
+public:
+  TestDef2 (const unsigned int n_components, const double sc) :
+    Function<dim> (n_components),
+    scale (sc)
+  {}
+
+  virtual ~TestDef2 () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
+
+  void vector_value (const Point<dim> &p,
+                     Vector<double>   &return_value) const;
 };
 
 
 template <int dim>
 double
 TestDef2<dim>::value (const Point<dim>   &p,
-                     const unsigned int  component) const 
+                      const unsigned int  component) const
 {
   double x = p(0),
-        y = p(1);
+         y = p(1);
 
   if (component == 0)
     return scale * x;
@@ -213,10 +213,10 @@ TestDef2<dim>::value (const Point<dim>   &p,
 
 template <int dim>
 void TestDef2<dim>::vector_value (const Point<dim> &p,
-                                 Vector<double>   &return_value) const
+                                  Vector<double>   &return_value) const
 {
   Assert (return_value.size() == this->n_components,
-         ExcDimensionMismatch (return_value.size(), this->n_components));
+          ExcDimensionMismatch (return_value.size(), this->n_components));
   for (unsigned int iCount = 0; iCount < this->n_components; iCount++)
     return_value (iCount) = value (p, iCount);
 }
@@ -229,29 +229,29 @@ void TestDef2<dim>::vector_value (const Point<dim> &p,
 template <int dim>
 class TestDef3 : public Function<dim>
 {
-  private:
-    const double scale;
-
-  public:
-    TestDef3 (const unsigned int n_components, const double sc) :
-                   Function<dim> (n_components),
-                   scale (sc)
-      {}
-    
-    virtual ~TestDef3 () {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
-    
-    void vector_value (const Point<dim> &p,
-                      Vector<double>   &return_value) const;
+private:
+  const double scale;
+
+public:
+  TestDef3 (const unsigned int n_components, const double sc) :
+    Function<dim> (n_components),
+    scale (sc)
+  {}
+
+  virtual ~TestDef3 () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
+
+  void vector_value (const Point<dim> &p,
+                     Vector<double>   &return_value) const;
 };
 
 
 template <int dim>
 double
 TestDef3<dim>::value (const Point<dim>   &p,
-                     const unsigned int  component) const 
+                      const unsigned int  component) const
 {
   double y = p(1);
 
@@ -264,10 +264,10 @@ TestDef3<dim>::value (const Point<dim>   &p,
 
 template <int dim>
 void TestDef3<dim>::vector_value (const Point<dim> &p,
-                                 Vector<double>   &return_value) const
+                                  Vector<double>   &return_value) const
 {
   Assert (return_value.size() == this->n_components,
-         ExcDimensionMismatch (return_value.size(), this->n_components));
+          ExcDimensionMismatch (return_value.size(), this->n_components));
   for (unsigned int iCount = 0; iCount < this->n_components; iCount++)
     return_value (iCount) = value (p, iCount);
 }
@@ -279,47 +279,47 @@ void TestDef3<dim>::vector_value (const Point<dim> &p,
  */
 
 double EvaluateDiver (Mapping<2> &mapping,
-                     DoFHandler<2> &dof_handler,
-                     Vector<double> &solution)
+                      DoFHandler<2> &dof_handler,
+                      Vector<double> &solution)
 {
-                                  // Use a high order quadrature. 
+  // Use a high order quadrature.
   QGauss<2> quad (6);
-  FEValues<2> fe_values (mapping, dof_handler.get_fe (), quad, 
-                        UpdateFlags(update_values    |
-                                    update_q_points  |
-                                    update_gradients |
-                                    update_JxW_values|
-                                    update_contravariant_transformation));
+  FEValues<2> fe_values (mapping, dof_handler.get_fe (), quad,
+                         UpdateFlags(update_values    |
+                                     update_q_points  |
+                                     update_gradients |
+                                     update_JxW_values|
+                                     update_contravariant_transformation));
 
   const unsigned int   n_q_points    = quad.size();
   const unsigned int   n_components   = dof_handler.get_fe().n_components();
 
-                                  // Cell iterators
+  // Cell iterators
   DoFHandler<2>::active_cell_iterator cell = dof_handler.begin_active(),
-                                     endc = dof_handler.end();
+                                      endc = dof_handler.end();
   double result = 0;
 
   for (; cell!=endc; ++cell)
     {
       fe_values.reinit (cell);
 
-                                      // Get values from solution vector (For Trap.Rule)
+      // Get values from solution vector (For Trap.Rule)
       std::vector<Vector<double> > this_value
-       (n_q_points, Vector<double>(n_components));
+      (n_q_points, Vector<double>(n_components));
       fe_values.get_function_values (solution, this_value);
 
       std::vector<std::vector<Tensor<1,2> > >
-       grads_here (n_q_points, 
-                   std::vector<Tensor<1,2> > (n_components));
+      grads_here (n_q_points,
+                  std::vector<Tensor<1,2> > (n_components));
       fe_values.get_function_grads (solution, grads_here);
 
       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-       {
-         double JxW = fe_values.JxW (q_point);
-         double dudx = grads_here[q_point][0][0];
-         double dvdy = grads_here[q_point][1][1];
-         result += (dudx + dvdy) * JxW;
-       }
+        {
+          double JxW = fe_values.JxW (q_point);
+          double dudx = grads_here[q_point][0][0];
+          double dvdy = grads_here[q_point][1][1];
+          result += (dudx + dvdy) * JxW;
+        }
     }
 
   return (result);
@@ -329,20 +329,20 @@ double EvaluateDiver (Mapping<2> &mapping,
 int main ()
 {
   logfile.precision (PRECISION);
-  logfile.setf(std::ios::fixed);  
+  logfile.setf(std::ios::fixed);
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
   Triangulation<2> tria_test;
   Point<2> p1 (0,0),
-    p2 (1, 1);
+        p2 (1, 1);
 
   GridGenerator::hyper_rectangle (tria_test, p1, p2);
   tria_test.refine_global (1);
   tria_test.distort_random (0.4);
 
-                                  // Create a DoFHandler for the RT space
+  // Create a DoFHandler for the RT space
   FE_RaviartThomas<2> fe (2);
   DoFHandler<2> dof_handler (tria_test);
   dof_handler.distribute_dofs (fe);
@@ -350,88 +350,88 @@ int main ()
   QGauss<2> quad_temp(6);
   sprintf (buf,"DoFs per Quad: %i per Line %i per Vert %i\n", fe.dofs_per_quad, fe.dofs_per_line, fe.dofs_per_vertex);
   deallog << buf;
-  
+
   sprintf (buf,"QPoints %i\n", quad_temp.size());
   deallog << buf;
 
-                                  // Create an deformation object for the Eulerian mapping
+  // Create an deformation object for the Eulerian mapping
   FESystem<2> fe_def (FE_Q<2>(1), 2);
   DoFHandler<2> dof_handler_def (tria_test);
   dof_handler_def.distribute_dofs (fe_def);
 
-                                  // Alloc some DoFs
+  // Alloc some DoFs
   Vector<double> solution,
-    solution_q,
-    deformation;
+         solution_q,
+         deformation;
   solution.reinit (dof_handler.n_dofs ());
   solution_q.reinit (dof_handler_def.n_dofs ());
   deformation.reinit (dof_handler_def.n_dofs ());
 
-                                  // Project solution onto RT FE field
+  // Project solution onto RT FE field
   ConstraintMatrix     hn_constraints;
   hn_constraints.clear ();
-  DoFTools::make_hanging_node_constraints (dof_handler, 
-                                          hn_constraints);
+  DoFTools::make_hanging_node_constraints (dof_handler,
+                                           hn_constraints);
   hn_constraints.close ();
   VectorTools::project (dof_handler, hn_constraints,
-                       QGauss<2> (6), TestMap1<2>(2),
-                       solution);
+                        QGauss<2> (6), TestMap1<2>(2),
+                        solution);
 
-                                  // Project reference solution onto RT FE field
+  // Project reference solution onto RT FE field
   ConstraintMatrix     hn_constraints_def;
   hn_constraints_def.clear ();
-  DoFTools::make_hanging_node_constraints (dof_handler_def, 
-                                          hn_constraints_def);
+  DoFTools::make_hanging_node_constraints (dof_handler_def,
+                                           hn_constraints_def);
   hn_constraints_def.close ();
 
   VectorTools::project (dof_handler_def, hn_constraints_def,
-                       QGauss<2> (6), TestMap1<2>(2),
-                       solution_q);
-  
+                        QGauss<2> (6), TestMap1<2>(2),
+                        solution_q);
+
   MappingQ1Eulerian<2> mapping_euler (deformation, dof_handler_def);
 
   sprintf (buf,"FE_RT Area %e  FE_Q Area %e\n",
-          EvaluateDiver (mapping_euler, dof_handler, solution),
-          EvaluateDiver (mapping_euler, dof_handler_def, solution_q));
+           EvaluateDiver (mapping_euler, dof_handler, solution),
+           EvaluateDiver (mapping_euler, dof_handler_def, solution_q));
   deallog << buf;
 
-                                  // Try rotating the elements
+  // Try rotating the elements
   for (double rotat = 0; rotat < 2 * M_PI; rotat += 0.25 * M_PI)
     {
-                                      // Rotate element
+      // Rotate element
       VectorTools::project (dof_handler_def, hn_constraints_def,
-                           QGauss<2> (6), TestDef1<2>(2, rotat),
-                           deformation);
+                            QGauss<2> (6), TestDef1<2>(2, rotat),
+                            deformation);
       sprintf (buf,"phi = %e FE_RT Area %e  FE_Q Area %e\n",
-              rotat,
-              EvaluateDiver (mapping_euler, dof_handler, solution),
-              EvaluateDiver (mapping_euler, dof_handler_def, solution_q));
+               rotat,
+               EvaluateDiver (mapping_euler, dof_handler, solution),
+               EvaluateDiver (mapping_euler, dof_handler_def, solution_q));
       deallog << buf;
     }
 
-                                  // Try resizing the elements
+  // Try resizing the elements
   for (double scale = -0.75; scale < 4.0; scale += 0.25)
     {
       VectorTools::project (dof_handler_def, hn_constraints_def,
-                           QGauss<2> (6), TestDef2<2>(2, scale),
-                           deformation);
+                            QGauss<2> (6), TestDef2<2>(2, scale),
+                            deformation);
       sprintf (buf,"Scale = %e FE_RT Area %e  FE_Q Area %e\n",
-              scale,
-              EvaluateDiver (mapping_euler, dof_handler, solution),
-              EvaluateDiver (mapping_euler, dof_handler_def, solution_q));
+               scale,
+               EvaluateDiver (mapping_euler, dof_handler, solution),
+               EvaluateDiver (mapping_euler, dof_handler_def, solution_q));
       deallog << buf;
     }
 
-                                  // Try paralellogramming the elements
+  // Try paralellogramming the elements
   for (double scale = -1.0; scale < 1.0; scale += 0.25)
     {
       VectorTools::project (dof_handler_def, hn_constraints_def,
-                           QGauss<2> (6), TestDef3<2>(2, scale),
-                           deformation);
+                            QGauss<2> (6), TestDef3<2>(2, scale),
+                            deformation);
       sprintf (buf,"Scale = %e FE_RT Area %e  FE_Q Area %e\n",
-              scale,
-              EvaluateDiver (mapping_euler, dof_handler, solution),
-              EvaluateDiver (mapping_euler, dof_handler_def, solution_q));
+               scale,
+               EvaluateDiver (mapping_euler, dof_handler, solution),
+               EvaluateDiver (mapping_euler, dof_handler_def, solution_q));
       deallog << buf;
     }
 
index cbb38400bd543eb9aaff560b8c4839ebc50fee66..1483a08b2f3a95bfc2152e81eda8e6e707bf4914 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim>(dim) {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square(); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      {
-       for (unsigned int d=0; d<dim; ++d)
-         values(d) = value(p,d);
-      }
+public:
+  MySquareFunction () : Function<dim>(dim) {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square();
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    for (unsigned int d=0; d<dim; ++d)
+      values(d) = value(p,d);
+  }
 };
 
 
@@ -70,7 +72,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -81,22 +83,22 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   hp::FECollection<dim> element;
   for (unsigned int i=1; i<7-dim; ++i)
     element.push_back (FE_RaviartThomas<dim>(i-1));
   hp::DoFHandler<dim> dof(tr);
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active(); cell!=dof.end(); ++cell)
+       cell = dof.begin_active(); cell!=dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
-  
+
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   hp::MappingCollection<dim> mapping;
   for (unsigned int i=1; i<7-dim; ++i)
     mapping.push_back (MappingQ<dim>(i+1));
@@ -107,8 +109,8 @@ check ()
 
   Vector<double> rhs (dof.n_dofs());
   VectorTools::create_boundary_right_hand_side (dof, quadrature,
-                                      MySquareFunction<dim>(),
-                                      rhs);
+                                                MySquareFunction<dim>(),
+                                                rhs);
   for (unsigned int i=0; i<rhs.size(); ++i)
     deallog << rhs(i) << std::endl;
 }
@@ -119,7 +121,7 @@ int main ()
 {
   std::ofstream logfile ("vectors_boundary_rhs_hp_02/output");
   logfile.precision (4);
-  logfile.setf(std::ios::fixed);  
+  logfile.setf(std::ios::fixed);
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 0020cd3c4391ce169f88b85b93593ffd35802df6..8a032743c8befa511fca7988226a2be1dfbe3ee7 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim>(dim) {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square(); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      {
-       for (unsigned int d=0; d<dim; ++d)
-         values(d) = value(p,d);
-      }
+public:
+  MySquareFunction () : Function<dim>(dim) {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square();
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    for (unsigned int d=0; d<dim; ++d)
+      values(d) = value(p,d);
+  }
 };
 
 
@@ -70,7 +72,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -81,22 +83,22 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   hp::FECollection<dim> element;
   for (unsigned int i=1; i<7-dim; ++i)
     element.push_back (FE_RaviartThomas<dim>(i-1));
   hp::DoFHandler<dim> dof(tr);
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active(); cell!=dof.end(); ++cell)
+       cell = dof.begin_active(); cell!=dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
-  
+
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   hp::MappingCollection<dim> mapping;
   for (unsigned int i=1; i<7-dim; ++i)
     mapping.push_back (MappingQ<dim>(i+1));
@@ -107,8 +109,8 @@ check ()
 
   Vector<double> rhs (dof.n_dofs());
   VectorTools::create_right_hand_side (dof, quadrature,
-                                      MySquareFunction<dim>(),
-                                      rhs);
+                                       MySquareFunction<dim>(),
+                                       rhs);
   for (unsigned int i=0; i<rhs.size(); ++i)
     deallog << rhs(i) << std::endl;
 }
@@ -119,7 +121,7 @@ int main ()
 {
   std::ofstream logfile ("vectors_rhs_hp_02/output");
   logfile.precision (4);
-  logfile.setf(std::ios::fixed);  
+  logfile.setf(std::ios::fixed);
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 94ba5cc150d6555db3bc7b92d360e2362e2524a2..8eaa4a15f70523caaadaaa36ade04e5c4abbb78a 100644 (file)
  */
 
 void EvaluateDerivative (DoFHandler<2> *dof_handler,
-                        Vector<double> &solution)
+                         Vector<double> &solution)
 {
-    // This quadrature rule determines the points, where the
-    // derivative will be evaluated.
-    QGauss<2> quad (3);
-    FEValues<2> fe_values (dof_handler->get_fe (), quad,
-                          UpdateFlags(update_values    |
-                                      update_q_points  |
-                                      update_gradients |
-                                      update_JxW_values));
+  // This quadrature rule determines the points, where the
+  // derivative will be evaluated.
+  QGauss<2> quad (3);
+  FEValues<2> fe_values (dof_handler->get_fe (), quad,
+                         UpdateFlags(update_values    |
+                                     update_q_points  |
+                                     update_gradients |
+                                     update_JxW_values));
 
-    const unsigned int   n_q_points    = quad.size();
-    const unsigned int   n_components   = dof_handler->get_fe().n_components();
-    const unsigned int dofs_per_cell = dof_handler->get_fe().dofs_per_cell;
+  const unsigned int   n_q_points    = quad.size();
+  const unsigned int   n_components   = dof_handler->get_fe().n_components();
+  const unsigned int dofs_per_cell = dof_handler->get_fe().dofs_per_cell;
 
-    // Cell iterators
-    DoFHandler<2>::active_cell_iterator cell = dof_handler->begin_active(),
-       endc = dof_handler->end();
+  // Cell iterators
+  DoFHandler<2>::active_cell_iterator cell = dof_handler->begin_active(),
+                                      endc = dof_handler->end();
 
-    double err_l2 = 0,
-      err_hdiv = 0;
+  double err_l2 = 0,
+         err_hdiv = 0;
 
-    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
+  std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
-    for (; cell!=endc; ++cell)
+  for (; cell!=endc; ++cell)
     {
       cell->get_dof_indices (local_dof_indices);
 
-       fe_values.reinit (cell);
-
-       // Get function values
-       std::vector<Vector<double> > this_value(n_q_points,
-                                               Vector<double>(n_components));
-       fe_values.get_function_values (solution, this_value);
-
-       // Get values from solution vector (For Trap.Rule)
-       std::vector<std::vector<Tensor<1,2> > >
-           grads_here (n_q_points, std::vector<Tensor<1,2> > (n_components));
-       fe_values.get_function_grads (solution, grads_here);
-
-       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-       {
-         //      double u0 = this_value[q_point](0);
-         //double v0 = this_value[q_point](1);
-
-         double u0 = 0;
-         double v0 = 0;
-         for (unsigned int i = 0; i < dofs_per_cell; ++i)
-           {
-             u0 += (solution (local_dof_indices[i]) *
-                    fe_values.shape_value_component(i, q_point, 0));
-             v0 += (solution (local_dof_indices[i]) *
-                    fe_values.shape_value_component(i, q_point, 1));
-           }
-         u0 -= 1.0;
-         v0 -= 1.0;
-
-         double dudx = grads_here[q_point][0][0];
-         double dvdy = grads_here[q_point][1][1];
-
-         err_l2 += (u0 * u0 + v0 * v0) * fe_values.JxW (q_point);
-         err_hdiv += (dudx + dvdy) * (dudx + dvdy) * fe_values.JxW (q_point);
-       }
+      fe_values.reinit (cell);
+
+      // Get function values
+      std::vector<Vector<double> > this_value(n_q_points,
+                                              Vector<double>(n_components));
+      fe_values.get_function_values (solution, this_value);
+
+      // Get values from solution vector (For Trap.Rule)
+      std::vector<std::vector<Tensor<1,2> > >
+      grads_here (n_q_points, std::vector<Tensor<1,2> > (n_components));
+      fe_values.get_function_grads (solution, grads_here);
+
+      for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+        {
+          //    double u0 = this_value[q_point](0);
+          //double v0 = this_value[q_point](1);
+
+          double u0 = 0;
+          double v0 = 0;
+          for (unsigned int i = 0; i < dofs_per_cell; ++i)
+            {
+              u0 += (solution (local_dof_indices[i]) *
+                     fe_values.shape_value_component(i, q_point, 0));
+              v0 += (solution (local_dof_indices[i]) *
+                     fe_values.shape_value_component(i, q_point, 1));
+            }
+          u0 -= 1.0;
+          v0 -= 1.0;
+
+          double dudx = grads_here[q_point][0][0];
+          double dvdy = grads_here[q_point][1][1];
+
+          err_l2 += (u0 * u0 + v0 * v0) * fe_values.JxW (q_point);
+          err_hdiv += (dudx + dvdy) * (dudx + dvdy) * fe_values.JxW (q_point);
+        }
     }
 
-    deallog << "L2-Err=" << pow (err_l2, 0.5)
-           << ", Hdiv-Err=" << pow (err_hdiv, 0.5)
-           << std::endl;
+  deallog << "L2-Err=" << pow (err_l2, 0.5)
+          << ", Hdiv-Err=" << pow (err_hdiv, 0.5)
+          << std::endl;
 }
 
 
 template <int dim>
 void create_mass_matrix (const Mapping<dim>       &mapping,
-                        const DoFHandler<dim>    &dof,
-                        const Quadrature<dim>    &q,
-                        SparseMatrix<double>     &matrix,
-                        const Function<dim>   &rhs_function,
-                        Vector<double>        &rhs_vector,
-                        const Function<dim> * const coefficient = 0)
+                         const DoFHandler<dim>    &dof,
+                         const Quadrature<dim>    &q,
+                         SparseMatrix<double>     &matrix,
+                         const Function<dim>   &rhs_function,
+                         Vector<double>        &rhs_vector,
+                         const Function<dim> *const coefficient = 0)
 {
   UpdateFlags update_flags = UpdateFlags(update_values | update_JxW_values | update_q_points);
   if (coefficient != 0)
@@ -153,26 +153,26 @@ void create_mass_matrix (const Mapping<dim>       &mapping,
   FEValues<dim> fe_values (mapping, dof.get_fe(), q, update_flags);
 
   const unsigned int dofs_per_cell = fe_values.dofs_per_cell,
-                    n_q_points    = fe_values.n_quadrature_points;
+                     n_q_points    = fe_values.n_quadrature_points;
   const FiniteElement<dim>    &fe  = fe_values.get_fe();
   const unsigned int n_components  = fe.n_components();
 
   Assert(coefficient == 0 ||
-        coefficient->n_components==1 ||
-        coefficient->n_components==n_components, ExcInternalError());
+         coefficient->n_components==1 ||
+         coefficient->n_components==n_components, ExcInternalError());
 
   FullMatrix<double>  cell_matrix (dofs_per_cell, dofs_per_cell);
   Vector<double> cell_vector (dofs_per_cell);
   std::vector<double> coefficient_values (n_q_points);
   std::vector<Vector<double> > coefficient_vector_values (n_q_points,
-                                                         Vector<double> (n_components));
+                                                          Vector<double> (n_components));
 
   std::vector<types::global_dof_index> dof_indices (dofs_per_cell);
 
   std::vector<Vector<double> > rhs_values(n_q_points, Vector<double>(n_components));
 
   typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active (),
-      endc = dof.end ();
+                                                 endc = dof.end ();
   for (; cell!=endc; ++cell)
     {
       fe_values.reinit (cell);
@@ -185,234 +185,234 @@ void create_mass_matrix (const Mapping<dim>       &mapping,
       cell_vector = 0;
 
       if (coefficient != 0)
-       {
-         if (coefficient->n_components==1)
-           {
-             coefficient->value_list (fe_values.get_quadrature_points(),
-                                      coefficient_values);
-             for (unsigned int point=0; point<n_q_points; ++point)
-               {
-                 const double weight = fe_values.JxW(point);
-                 for (unsigned int i=0; i<dofs_per_cell; ++i)
-                   {
-                     const double v = fe_values.shape_value(i,point);
-                     for (unsigned int j=0; j<dofs_per_cell; ++j)
-                       {
-                         const double u = fe_values.shape_value(j,point);
-
-                         if ((n_components==1) ||
-                             (fe.system_to_component_index(i).first ==
-                              fe.system_to_component_index(j).first))
-                           cell_matrix(i,j) +=
-                             (u * v * weight * coefficient_values[point]);
-                       }
-                   }
-               }
-           }
-         else
-           {
-             coefficient->vector_value_list (fe_values.get_quadrature_points(),
-                                             coefficient_vector_values);
-             for (unsigned int point=0; point<n_q_points; ++point)
-               {
-                 const double weight = fe_values.JxW(point);
-                 for (unsigned int i=0; i<dofs_per_cell; ++i)
-                   {
-                     const double v = fe_values.shape_value(i,point);
-                     const unsigned int component_i=
-                       fe.system_to_component_index(i).first;
-                     for (unsigned int j=0; j<dofs_per_cell; ++j)
-                       {
-                         const double u = fe_values.shape_value(j,point);
-                         if ((n_components==1) ||
-                             (fe.system_to_component_index(j).first == component_i))
-                           cell_matrix(i,j) +=
-                             (u * v * weight *
-                              coefficient_vector_values[point](component_i));
-                       }
-                   }
-               }
-           }
-       }
+        {
+          if (coefficient->n_components==1)
+            {
+              coefficient->value_list (fe_values.get_quadrature_points(),
+                                       coefficient_values);
+              for (unsigned int point=0; point<n_q_points; ++point)
+                {
+                  const double weight = fe_values.JxW(point);
+                  for (unsigned int i=0; i<dofs_per_cell; ++i)
+                    {
+                      const double v = fe_values.shape_value(i,point);
+                      for (unsigned int j=0; j<dofs_per_cell; ++j)
+                        {
+                          const double u = fe_values.shape_value(j,point);
+
+                          if ((n_components==1) ||
+                              (fe.system_to_component_index(i).first ==
+                               fe.system_to_component_index(j).first))
+                            cell_matrix(i,j) +=
+                              (u * v * weight * coefficient_values[point]);
+                        }
+                    }
+                }
+            }
+          else
+            {
+              coefficient->vector_value_list (fe_values.get_quadrature_points(),
+                                              coefficient_vector_values);
+              for (unsigned int point=0; point<n_q_points; ++point)
+                {
+                  const double weight = fe_values.JxW(point);
+                  for (unsigned int i=0; i<dofs_per_cell; ++i)
+                    {
+                      const double v = fe_values.shape_value(i,point);
+                      const unsigned int component_i=
+                        fe.system_to_component_index(i).first;
+                      for (unsigned int j=0; j<dofs_per_cell; ++j)
+                        {
+                          const double u = fe_values.shape_value(j,point);
+                          if ((n_components==1) ||
+                              (fe.system_to_component_index(j).first == component_i))
+                            cell_matrix(i,j) +=
+                              (u * v * weight *
+                               coefficient_vector_values[point](component_i));
+                        }
+                    }
+                }
+            }
+        }
       else
-       {
-         // Compute eventual sign changes depending on the neighborhood
-         // between two faces.
-         std::vector<double> sign_change (dofs_per_cell, 1.0);
-         const unsigned int dofs_per_face = fe.dofs_per_face;
-         std::vector<unsigned int> face_dof_indices (dofs_per_face);
-
-         /* This code should now be in fe_poly_tensor.cc
-         for (unsigned int f = 2; f < 4; ++f)
-           {
-             typename DoFHandler<dim>::active_face_iterator face = cell->face (f);
-             if (!face->at_boundary ())
-               {
-                 unsigned int nn = cell->neighbor_of_neighbor (f);
-                 printf ("Face %i  NeigNeig %i\n", f, nn);
-                 if (nn < 2)
-                   {
-                     face->get_dof_indices (face_dof_indices);
-                     for (unsigned int j = 0; j < dofs_per_face; ++j)
-                       {
-                         sign_change[f * dofs_per_face + j] = -1.0;
-                         printf ("DoF %i\n", face_dof_indices[j]);
-                       }
-                   }
-               }
-           }
-         */
-
-         for (unsigned int point=0; point<n_q_points; ++point)
-           {
-             const double weight = fe_values.JxW(point);
-             //            const double weight = q.weight(point);
-
-             std::vector<Vector<double> > val_vector (dofs_per_cell,
-                                                      Vector<double> (n_components));
-
-             // Precompute the component values
-             for (unsigned int i=0; i < dofs_per_cell; ++i)
-               for (unsigned int comp_i = 0; comp_i < fe.n_components ();
-                    ++comp_i)
-                 {
-                   val_vector[i](comp_i) = sign_change[i] *
-                     fe_values.shape_value_component(i,point,comp_i);
-                 }
-             // Now eventually switch the sign of some of the ansatzfunctions.
-             // TODO
-
-             for (unsigned int i=0; i<dofs_per_cell; ++i)
-               for (unsigned int comp_i = 0; comp_i < fe.n_components ();
-                    ++comp_i)
-                 if (fe.get_nonzero_components(i)[comp_i] == true)
-                   {
-                     const double v = val_vector[i](comp_i);
-                     for (unsigned int j=0; j<dofs_per_cell; ++j)
-                       for (unsigned int comp_j = 0;
-                            comp_j < fe.n_components (); ++comp_j)
-                         if (fe.get_nonzero_components(j)[comp_j] == true)
-                           {
-                             const double u = val_vector[j](comp_j);
-                             if ((n_components==1) ||
-                                 (comp_i == comp_j))
-                               cell_matrix(i,j) += (u * v * weight);
-                           }
-                   }
-
-             for (unsigned int i=0; i<dofs_per_cell; ++i)
-               for (unsigned int comp_i = 0; comp_i < fe.n_components ();
-                    ++comp_i)
-                 if (fe.get_nonzero_components(i)[comp_i] == true)
-                   {
-                     cell_vector(i) += rhs_values[point](comp_i) *
-                       val_vector[i](comp_i) * weights[point];
-                   }
-           }
-       }
-                                      // transfer everything into the
-                                      // global object. lock the
-                                      // matrix meanwhile
+        {
+          // Compute eventual sign changes depending on the neighborhood
+          // between two faces.
+          std::vector<double> sign_change (dofs_per_cell, 1.0);
+          const unsigned int dofs_per_face = fe.dofs_per_face;
+          std::vector<unsigned int> face_dof_indices (dofs_per_face);
+
+          /* This code should now be in fe_poly_tensor.cc
+          for (unsigned int f = 2; f < 4; ++f)
+            {
+              typename DoFHandler<dim>::active_face_iterator face = cell->face (f);
+              if (!face->at_boundary ())
+          {
+            unsigned int nn = cell->neighbor_of_neighbor (f);
+            printf ("Face %i  NeigNeig %i\n", f, nn);
+            if (nn < 2)
+              {
+                face->get_dof_indices (face_dof_indices);
+                for (unsigned int j = 0; j < dofs_per_face; ++j)
+            {
+              sign_change[f * dofs_per_face + j] = -1.0;
+              printf ("DoF %i\n", face_dof_indices[j]);
+            }
+              }
+          }
+            }
+          */
+
+          for (unsigned int point=0; point<n_q_points; ++point)
+            {
+              const double weight = fe_values.JxW(point);
+              //      const double weight = q.weight(point);
+
+              std::vector<Vector<double> > val_vector (dofs_per_cell,
+                                                       Vector<double> (n_components));
+
+              // Precompute the component values
+              for (unsigned int i=0; i < dofs_per_cell; ++i)
+                for (unsigned int comp_i = 0; comp_i < fe.n_components ();
+                     ++comp_i)
+                  {
+                    val_vector[i](comp_i) = sign_change[i] *
+                                            fe_values.shape_value_component(i,point,comp_i);
+                  }
+              // Now eventually switch the sign of some of the ansatzfunctions.
+              // TODO
+
+              for (unsigned int i=0; i<dofs_per_cell; ++i)
+                for (unsigned int comp_i = 0; comp_i < fe.n_components ();
+                     ++comp_i)
+                  if (fe.get_nonzero_components(i)[comp_i] == true)
+                    {
+                      const double v = val_vector[i](comp_i);
+                      for (unsigned int j=0; j<dofs_per_cell; ++j)
+                        for (unsigned int comp_j = 0;
+                             comp_j < fe.n_components (); ++comp_j)
+                          if (fe.get_nonzero_components(j)[comp_j] == true)
+                            {
+                              const double u = val_vector[j](comp_j);
+                              if ((n_components==1) ||
+                                  (comp_i == comp_j))
+                                cell_matrix(i,j) += (u * v * weight);
+                            }
+                    }
+
+              for (unsigned int i=0; i<dofs_per_cell; ++i)
+                for (unsigned int comp_i = 0; comp_i < fe.n_components ();
+                     ++comp_i)
+                  if (fe.get_nonzero_components(i)[comp_i] == true)
+                    {
+                      cell_vector(i) += rhs_values[point](comp_i) *
+                                        val_vector[i](comp_i) * weights[point];
+                    }
+            }
+        }
+      // transfer everything into the
+      // global object. lock the
+      // matrix meanwhile
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int j=0; j<dofs_per_cell; ++j)
-         if ((n_components==1) ||
-             (cell_matrix (i,j) != 0.0))
-/*
-             (fe.system_to_component_index(i).first ==
-              fe.system_to_component_index(j).first))
-*/
-           matrix.add (dof_indices[i], dof_indices[j],
-                       cell_matrix(i,j));
+        for (unsigned int j=0; j<dofs_per_cell; ++j)
+          if ((n_components==1) ||
+              (cell_matrix (i,j) != 0.0))
+            /*
+                    (fe.system_to_component_index(i).first ==
+                     fe.system_to_component_index(j).first))
+            */
+            matrix.add (dof_indices[i], dof_indices[j],
+                        cell_matrix(i,j));
 
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       rhs_vector(dof_indices[i]) += cell_vector(i);
+        rhs_vector(dof_indices[i]) += cell_vector(i);
     }
 }
 
 
 template <int dim>
 void create_right_hand_side (const Mapping<dim>    &mapping,
-                            const DoFHandler<dim> &dof_handler,
-                            const Quadrature<dim> &quadrature,
-                            const Function<dim>   &rhs_function,
-                            Vector<double>        &rhs_vector)
+                             const DoFHandler<dim> &dof_handler,
+                             const Quadrature<dim> &quadrature,
+                             const Function<dim>   &rhs_function,
+                             Vector<double>        &rhs_vector)
 {
   const FiniteElement<dim> &fe  = dof_handler.get_fe();
   Assert (fe.n_components() == rhs_function.n_components,
-         ExcInternalError());
+          ExcInternalError());
   Assert (rhs_vector.size() == dof_handler.n_dofs(),
-         ExcDimensionMismatch(rhs_vector.size(), dof_handler.n_dofs()));
+          ExcDimensionMismatch(rhs_vector.size(), dof_handler.n_dofs()));
   rhs_vector = 0;
 
   UpdateFlags update_flags = UpdateFlags(update_values   |
-                                        update_q_points |
-                                        update_JxW_values);
+                                         update_q_points |
+                                         update_JxW_values);
   FEValues<dim> fe_values (mapping, fe, quadrature, update_flags);
 
   const unsigned int dofs_per_cell = fe_values.dofs_per_cell,
-                    n_q_points    = fe_values.n_quadrature_points,
-                    n_components  = fe.n_components();
+                     n_q_points    = fe_values.n_quadrature_points,
+                     n_components  = fe.n_components();
 
   std::vector<unsigned int> dofs (dofs_per_cell);
   Vector<double> cell_vector (dofs_per_cell);
 
   typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active(),
-                                                endc = dof_handler.end();
+                                                 endc = dof_handler.end();
 
   if (n_components==1)
     {
       std::vector<double> rhs_values(n_q_points);
 
       for (; cell!=endc; ++cell)
-       {
-         fe_values.reinit(cell);
+        {
+          fe_values.reinit(cell);
 
-         const std::vector<double> &weights   = fe_values.get_JxW_values ();
-         rhs_function.value_list (fe_values.get_quadrature_points(), rhs_values);
+          const std::vector<double> &weights   = fe_values.get_JxW_values ();
+          rhs_function.value_list (fe_values.get_quadrature_points(), rhs_values);
 
-         cell_vector = 0;
-         for (unsigned int point=0; point<n_q_points; ++point)
-           for (unsigned int i=0; i<dofs_per_cell; ++i)
-             cell_vector(i) += rhs_values[point] *
-                               fe_values.shape_value(i,point) *
-                 weights[point];
+          cell_vector = 0;
+          for (unsigned int point=0; point<n_q_points; ++point)
+            for (unsigned int i=0; i<dofs_per_cell; ++i)
+              cell_vector(i) += rhs_values[point] *
+                                fe_values.shape_value(i,point) *
+                                weights[point];
 
-         cell->get_dof_indices (dofs);
+          cell->get_dof_indices (dofs);
 
-         for (unsigned int i=0; i<dofs_per_cell; ++i)
-           rhs_vector(dofs[i]) += cell_vector(i);
-       }
+          for (unsigned int i=0; i<dofs_per_cell; ++i)
+            rhs_vector(dofs[i]) += cell_vector(i);
+        }
     }
   else
     {
       std::vector<Vector<double> > rhs_values(n_q_points, Vector<double>(n_components));
 
       for (; cell!=endc; ++cell)
-       {
-         fe_values.reinit(cell);
-
-         const std::vector<double> &weights   = fe_values.get_JxW_values ();
-         rhs_function.vector_value_list (fe_values.get_quadrature_points(), rhs_values);
-
-         cell_vector = 0;
-         for (unsigned int point=0; point<n_q_points; ++point)
-           for (unsigned int i=0; i<dofs_per_cell; ++i)
-               for (unsigned int comp_i = 0; comp_i < fe.n_components ();
-                    ++comp_i)
-                 //                if (fe.get_nonzero_components(i)[comp_i] == true)
-                   {
-                       double det = weights[point] / quadrature.weight(point);
-
-                       cell_vector(i) += rhs_values[point](comp_i) *
-                           fe_values.shape_value_component(i,point,comp_i) *
-                           weights[point];
-                   }
-
-         cell->get_dof_indices (dofs);
-
-         for (unsigned int i=0; i<dofs_per_cell; ++i)
-           rhs_vector(dofs[i]) += cell_vector(i);
-       }
+        {
+          fe_values.reinit(cell);
+
+          const std::vector<double> &weights   = fe_values.get_JxW_values ();
+          rhs_function.vector_value_list (fe_values.get_quadrature_points(), rhs_values);
+
+          cell_vector = 0;
+          for (unsigned int point=0; point<n_q_points; ++point)
+            for (unsigned int i=0; i<dofs_per_cell; ++i)
+              for (unsigned int comp_i = 0; comp_i < fe.n_components ();
+                   ++comp_i)
+                //        if (fe.get_nonzero_components(i)[comp_i] == true)
+                {
+                  double det = weights[point] / quadrature.weight(point);
+
+                  cell_vector(i) += rhs_values[point](comp_i) *
+                                    fe_values.shape_value_component(i,point,comp_i) *
+                                    weights[point];
+                }
+
+          cell->get_dof_indices (dofs);
+
+          for (unsigned int i=0; i<dofs_per_cell; ++i)
+            rhs_vector(dofs[i]) += cell_vector(i);
+        }
     }
 }
 
@@ -425,92 +425,92 @@ void create_right_hand_side (const Mapping<dim>    &mapping,
 
 template <int dim>
 void project (const Mapping<dim>       &mapping,
-             const DoFHandler<dim>    &dof,
-             const ConstraintMatrix   &constraints,
-             const Quadrature<dim>    &quadrature,
-             const Function<dim>      &function,
-             Vector<double>           &vec,
-             const bool                enforce_zero_boundary = false,
-             const Quadrature<dim-1>  & = QGauss<dim-1>(2),
-             const bool                project_to_boundary_first = false)
+              const DoFHandler<dim>    &dof,
+              const ConstraintMatrix   &constraints,
+              const Quadrature<dim>    &quadrature,
+              const Function<dim>      &function,
+              Vector<double>           &vec,
+              const bool                enforce_zero_boundary = false,
+              const Quadrature<dim-1>  & = QGauss<dim-1>(2),
+              const bool                project_to_boundary_first = false)
 {
   Assert (dof.get_fe().n_components() == function.n_components,
-         ExcInternalError());
+          ExcInternalError());
 
   const FiniteElement<dim> &fe = dof.get_fe();
 
-                                  // make up boundary values
+  // make up boundary values
   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
+    // no need to project boundary
+    // values, but enforce
+    // homogeneous boundary values
+    // anyway
     {
-                                      // loop over all boundary faces
-                                      // to get all dof indices of
-                                      // dofs on the boundary. note
-                                      // that in 3d there are cases
-                                      // where a face is not at the
-                                      // boundary, yet one of its
-                                      // lines is, and we should
-                                      // consider the degrees of
-                                      // freedom on it as boundary
-                                      // nodes. likewise, in 2d and
-                                      // 3d there are cases where a
-                                      // cell is only at the boundary
-                                      // by one vertex. nevertheless,
-                                      // since we do not support
-                                      // boundaries with dimension
-                                      // less or equal to dim-2, each
-                                      // such boundary dof is also
-                                      // found from some other face
-                                      // that is actually wholly on
-                                      // the boundary, not only by
-                                      // one line or one vertex
+      // loop over all boundary faces
+      // to get all dof indices of
+      // dofs on the boundary. note
+      // that in 3d there are cases
+      // where a face is not at the
+      // boundary, yet one of its
+      // lines is, and we should
+      // consider the degrees of
+      // freedom on it as boundary
+      // nodes. likewise, in 2d and
+      // 3d there are cases where a
+      // cell is only at the boundary
+      // by one vertex. nevertheless,
+      // since we do not support
+      // boundaries with dimension
+      // less or equal to dim-2, each
+      // such boundary dof is also
+      // found from some other face
+      // that is actually wholly on
+      // the boundary, not only by
+      // one line or one vertex
       typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active(),
-                                                    endc = dof.end();
+                                                     endc = dof.end();
       std::vector<types::global_dof_index> face_dof_indices (fe.dofs_per_face);
       for (; cell!=endc; ++cell)
-       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
-         if (cell->face(f)->at_boundary())
-           {
-             cell->face(f)->get_dof_indices (face_dof_indices);
-             for (unsigned int i=0; i<fe.dofs_per_face; ++i)
-                                                // enter zero boundary values
-                                                // for all boundary nodes
-                                                //
-                                                // we need not care about
-                                                // vector valued elements here,
-                                                // since we set all components
-               boundary_values[face_dof_indices[i]] = 0.;
-           };
+        for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+          if (cell->face(f)->at_boundary())
+            {
+              cell->face(f)->get_dof_indices (face_dof_indices);
+              for (unsigned int i=0; i<fe.dofs_per_face; ++i)
+                // enter zero boundary values
+                // for all boundary nodes
+                //
+                // we need not care about
+                // vector valued elements here,
+                // since we set all components
+                boundary_values[face_dof_indices[i]] = 0.;
+            };
     }
   else
-                                    // no homogeneous boundary values
+    // no homogeneous boundary values
     if (project_to_boundary_first == true)
-                                      // boundary projection required
+      // boundary projection required
       {
-/*
-                                        // set up a list of boundary functions for
-                                        // the different boundary parts. We want the
-                                        // @p{function} to hold on all parts of the
-                                        // boundary
-       typename FunctionMap<dim>::type boundary_functions;
-       for (types::boundary_id c=0; c<255; ++c)
-         boundary_functions[c] = &function;
-       project_boundary_values (dof, boundary_functions, q_boundary,
-                                boundary_values);
-*/
+        /*
+                   // set up a list of boundary functions for
+                   // the different boundary parts. We want the
+                   // @p{function} to hold on all parts of the
+                   // boundary
+          typename FunctionMap<dim>::type boundary_functions;
+          for (types::boundary_id c=0; c<255; ++c)
+            boundary_functions[c] = &function;
+          project_boundary_values (dof, boundary_functions, q_boundary,
+                 boundary_values);
+        */
       }
 
 
-                                  // set up mass matrix and right hand side
+  // set up mass matrix and right hand side
   vec.reinit (dof.n_dofs());
   SparsityPattern sparsity(dof.n_dofs(),
-                          dof.n_dofs(),
-                          dof.max_couplings_between_dofs());
+                           dof.n_dofs(),
+                           dof.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof, sparsity);
   constraints.condense (sparsity);
 
@@ -525,8 +525,8 @@ void project (const Mapping<dim>       &mapping,
   constraints.condense (tmp);
   if (boundary_values.size() != 0)
     MatrixTools::apply_boundary_values (boundary_values,
-                                       mass_matrix, vec, tmp,
-                                       true);
+                                        mass_matrix, vec, tmp,
+                                        true);
 
   SolverControl           control(1000,1e-16);
   PrimitiveVectorMemory<> memory;
@@ -534,10 +534,10 @@ void project (const Mapping<dim>       &mapping,
 
   PreconditionSSOR<> prec;
   prec.initialize(mass_matrix, 1.2);
-                                  // solve
+  // solve
   cg.solve (mass_matrix, vec, tmp, prec);
 
-                                  // distribute solution
+  // distribute solution
   constraints.distribute (vec);
 }
 
@@ -556,7 +556,7 @@ int create_alternate_unitsquare (Triangulation<2> &tria)
 
   //points.push_back (Point<2> (0.0, 0.001));
 
-                                  // Prepare cell data
+  // Prepare cell data
   std::vector<CellData<2> > cells (3);
   cells[0].vertices[0] = 0;
   cells[0].vertices[1] = 1;
@@ -605,7 +605,7 @@ int main (int /*argc*/, char **/*argv*/)
     {
       deallog << "Cell " << cell << std::endl;
       for (unsigned int v=0; v<4; ++v)
-       deallog << "    " << cell->vertex(v) << std::endl;
+        deallog << "    " << cell->vertex(v) << std::endl;
     }
 
 
@@ -614,7 +614,7 @@ int main (int /*argc*/, char **/*argv*/)
 
   FE_ABF<2> fe (0);
   deallog << "Dofs/cell " << fe.dofs_per_cell
-           << "Dofs/face " << fe.dofs_per_face << std::endl;
+          << "Dofs/face " << fe.dofs_per_face << std::endl;
 
   DoFHandler<2> *dof_handler;
   dof_handler = new DoFHandler<2> (tria_test);
@@ -629,12 +629,12 @@ int main (int /*argc*/, char **/*argv*/)
   ConstraintMatrix     hn_constraints;
   hn_constraints.clear ();
   DoFTools::make_hanging_node_constraints (*dof_handler,
-                                          hn_constraints);
+                                           hn_constraints);
   hn_constraints.close ();
   MappingQ1<2> map_default;
   project (map_default, *dof_handler, hn_constraints,
-          QGauss<2> (6), ConstantFunction<2>(1., 2),
-          solution);
+           QGauss<2> (6), ConstantFunction<2>(1., 2),
+           solution);
 
   EvaluateDerivative (dof_handler, solution);
   solution.print (deallog);
index 4239bab89f241ce2b62c8cb44bb9dace1ba5f473..3f17e340814706c055f2da71081dd736a28a064c 100644 (file)
@@ -38,11 +38,11 @@ void test ()
 
   BlockMask m(v);
 
-                                  // verify equality
+  // verify equality
   for (unsigned int i=0; i<v.size(); ++i)
     Assert (m[i] == v[i], ExcInternalError());
 
-                                  // this needs to throw an exception
+  // this needs to throw an exception
   try
     {
       m[v.size()];
index a422ef43f0e9eacc46c2e5e71503c93f5ae4a3b1..35e1d7557d9a5231cb687d4f6e2ebd5a3d93bbd1 100644 (file)
@@ -36,7 +36,7 @@ void test ()
   std::vector<bool> v(12, false);
   BlockMask     m(12, false);
 
-                                  // verify equality
+  // verify equality
   for (unsigned int i=0; i<v.size(); ++i)
     Assert (m[i] == v[i], ExcInternalError());
 
index 8abc6dd17312eb898e482f03fb775aa8366c081a..626f96fb3dce1735d91129f446a7855756c1a21b 100644 (file)
 
 void test ()
 {
-                                  // test for an initialized mask
+  // test for an initialized mask
   Assert (BlockMask(12,false).represents_n_blocks(12) == true,
-         ExcInternalError());
+          ExcInternalError());
   Assert (BlockMask(12,false).represents_n_blocks(13) == false,
-         ExcInternalError());
-                                  // test for an empty mask
+          ExcInternalError());
+  // test for an empty mask
   Assert (BlockMask().represents_n_blocks(12) == true,
-         ExcInternalError());
+          ExcInternalError());
   Assert (BlockMask().represents_n_blocks(13) == true,
-         ExcInternalError());
+          ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
index 71098a79b67cca00461ea8edef7e1cbb753c0d36..879b210354e14299067dd158302d3783bfd3969d 100644 (file)
@@ -34,32 +34,32 @@ void test ()
 {
   deal_II_exceptions::disable_abort_on_exception();
 
-                                  // test for an initialized mask
+  // test for an initialized mask
   Assert (BlockMask(12,true).n_selected_blocks() == 12,
-         ExcInternalError());
+          ExcInternalError());
   Assert (BlockMask(12,true).n_selected_blocks(12) == 12,
-         ExcInternalError());
-                                  // test for an empty mask
+          ExcInternalError());
+  // test for an empty mask
   Assert (BlockMask().n_selected_blocks(12) == 12,
-         ExcInternalError());
+          ExcInternalError());
   Assert (BlockMask().n_selected_blocks(13) == 13,
-         ExcInternalError());
+          ExcInternalError());
 
 
   deallog << "OK" << std::endl;
 
-                                  // this now must throw an exception,
-                                  // though:
-  try 
+  // this now must throw an exception,
+  // though:
+  try
     {
       Assert (BlockMask(12,true).n_selected_blocks(13) == 12,
-             ExcInternalError());
+              ExcInternalError());
     }
   catch (ExceptionBase &e)
     {
       deallog << e.get_exc_name() << std::endl;
     }
-  
+
 }
 
 
index 65e5382280a61a6813a26667144537bd9b0199ba..5f220fddec81bebe418cc421256f2b99e48399b2 100644 (file)
@@ -37,33 +37,33 @@ void test ()
 
   BlockMask m(v);
 
-                                  // test for an initialized mask
+  // test for an initialized mask
   Assert (m.first_selected_block() == 3,
-         ExcInternalError());
+          ExcInternalError());
   Assert (BlockMask(12,true).first_selected_block() == 0,
-         ExcInternalError());
-                                  // test for an empty mask
+          ExcInternalError());
+  // test for an empty mask
   Assert (BlockMask().first_selected_block(12) == 0,
-         ExcInternalError());
+          ExcInternalError());
 
   deallog << "OK" << std::endl;
 
-                                  // the following should yield an exception:
-  try 
+  // the following should yield an exception:
+  try
     {
       Assert (BlockMask(12,true).first_selected_block(13) == 0,
-             ExcInternalError());
+              ExcInternalError());
     }
   catch (ExceptionBase &e)
     {
       deallog << e.get_exc_name() << std::endl;
     }
-  
-                                  // as should this: 
-  try 
+
+  // as should this:
+  try
     {
       Assert (BlockMask(12,false).first_selected_block() == 0,
-             ExcInternalError());
+              ExcInternalError());
     }
   catch (ExceptionBase &e)
     {
index 36a000fd30e424d1bbcb1d7ef57896012143db00..3c063cdaa38b89af424b145dc6d1481d6a25c998 100644 (file)
 
 void test ()
 {
-                                  // test for an initialized mask
+  // test for an initialized mask
   Assert (BlockMask(12,false).represents_the_all_selected_mask() == false,
-         ExcInternalError());
-                                  // note the semantics of the following as
-                                  // described in the documentation
+          ExcInternalError());
+  // note the semantics of the following as
+  // described in the documentation
   Assert (BlockMask(12,true).represents_the_all_selected_mask() == false,
-         ExcInternalError());
-                                  // test for an empty mask
+          ExcInternalError());
+  // test for an empty mask
   Assert (BlockMask().represents_the_all_selected_mask() == true,
-         ExcInternalError());
+          ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
index e4030080f8c8d0b6e7c036e3f4dad034170e6a09..6c45d1d241af84edfdced67c1fbdef9d6b7f480b 100644 (file)
@@ -43,7 +43,7 @@ void test ()
   BlockMask m2(v2);
   BlockMask m = m1 | m2;
 
-                                  // verify equality
+  // verify equality
   for (unsigned int i=0; i<v1.size(); ++i)
     Assert (m[i] == (v1[i] || v2[i]), ExcInternalError());
 
index 6f0b4b8e80c4051be07dea4e6cdb5dfa31dcffc0..f4ff5009481dc6cccf07daaff530abaeeb1909f8 100644 (file)
@@ -43,7 +43,7 @@ void test ()
   BlockMask m2(v2);
   BlockMask m = m1 & m2;
 
-                                  // verify equality
+  // verify equality
   for (unsigned int i=0; i<v1.size(); ++i)
     Assert (m[i] == (v1[i] && v2[i]), ExcInternalError());
 
index 85918b7056ee56dc4b8cf135522d41eb29d1f296..0fbf79531c45ee5fbd25a4a7079ef6f91e07497e 100644 (file)
@@ -47,15 +47,15 @@ void test ()
   BlockMask m2(v2);
   BlockMask m = m1 | m2;
 
-                                  // verify equality
+  // verify equality
   Assert (m == BlockMask(v),
-         ExcInternalError());
+          ExcInternalError());
   Assert (!(m == m1),
-         ExcInternalError());
+          ExcInternalError());
   Assert (!(m == BlockMask(v1)),
-         ExcInternalError());
+          ExcInternalError());
   Assert (!(m == BlockMask(v2)),
-         ExcInternalError());
+          ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
index 6badabc0aa1d930ec17e9a7838d5b863c2a2e54c..2413a869e81a7b25b304e00de2817d3b5a90b955 100644 (file)
 
 
 bool equal (const FullMatrix<double> &m1,
-           const FullMatrix<double> &m2)
+            const FullMatrix<double> &m2)
 {
   double d = 0, s = 0;
   for (unsigned int i=0; i<m1.m(); ++i)
     for (unsigned int j=0; j<m1.n(); ++j)
       {
-       d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
-       s += m1(i,j) * m1(i,j);
+        d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
+        s += m1(i,j) * m1(i,j);
       }
   return (d<1e-8*s);
 }
 
 
 template<int dim>
-void test (const Triangulation<dim>tr)
+void test (const Triangulation<dim> &tr)
 {
   FE_Q<dim> fe(1);
   deallog << "FE=" << fe.get_name() << std::endl;
@@ -71,14 +71,14 @@ void test (const Triangulation<dim>& tr)
   MappingQ1<dim> mapping;
   deallog << "Mapping=Q1" << std::endl;
 
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (mapping, fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   FullMatrix<double> mass_matrix[2], laplace_matrix[2];
   mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
@@ -87,54 +87,54 @@ void test (const Triangulation<dim>& tr)
   laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
-                                                fe_values.shape_value (j,q) *
-                                                fe_values.JxW(q);
-             laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
-                                                   fe_values.shape_grad (j,q) *
-                                                   fe_values.JxW(q);    
-           }
+        for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
+                                                 fe_values.shape_value (j,q) *
+                                                 fe_values.JxW(q);
+              laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
+                                                    fe_values.shape_grad (j,q) *
+                                                    fe_values.JxW(q);
+            }
     }
 
-                                  // check what we expect for this mapping
-                                  // about equality or inequality of the
-                                  // matrices
+  // check what we expect for this mapping
+  // about equality or inequality of the
+  // matrices
   deallog << "Mass matrices "
-         << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
+          << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
   deallog << "Laplace matrices "
-         << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
-  
+          << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
+
   for (unsigned int cell=0; cell<2; ++cell)
     {
       deallog << "cell=" << cell << std::endl;
       deallog << "mass_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << mass_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << mass_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "laplace_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << laplace_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << laplace_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
     }
 }
 
@@ -146,8 +146,8 @@ void test()
   Triangulation<dim> tr;
   Point<dim> p1 = Point<dim>();
   Point<dim> p2 = (dim == 2 ?
-                  Point<dim>(2,1) :
-                  Point<dim>(2,1,1));
+                   Point<dim>(2,1) :
+                   Point<dim>(2,1,1));
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2);
@@ -155,11 +155,11 @@ void test()
   static const HyperBallBoundary<dim> boundary(tr.begin_active()->center());
   tr.set_boundary (1, boundary);
 
-                                  // set boundary id on cell 1
+  // set boundary id on cell 1
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (tr.begin_active()->at_boundary(f))
       tr.begin_active()->face(f)->set_boundary_indicator (1);
-  
+
   test(tr);
 }
 
index 2e58bafe8b0f2064863ae12d115745b0b7eabf4e..47e45915c1d633211ef4232b2e9fbe3d1744b236 100644 (file)
 
 
 bool equal (const FullMatrix<double> &m1,
-           const FullMatrix<double> &m2)
+            const FullMatrix<double> &m2)
 {
   double d = 0, s = 0;
   for (unsigned int i=0; i<m1.m(); ++i)
     for (unsigned int j=0; j<m1.n(); ++j)
       {
-       d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
-       s += m1(i,j) * m1(i,j);
+        d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
+        s += m1(i,j) * m1(i,j);
       }
   return (d<1e-8*s);
 }
 
 
 template<int dim>
-void test (const Triangulation<dim>tr)
+void test (const Triangulation<dim> &tr)
 {
   FE_Q<dim> fe(2);
   deallog << "FE=" << fe.get_name() << std::endl;
@@ -71,14 +71,14 @@ void test (const Triangulation<dim>& tr)
   MappingQ1<dim> mapping;
   deallog << "Mapping=Q1" << std::endl;
 
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (mapping, fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   FullMatrix<double> mass_matrix[2], laplace_matrix[2];
   mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
@@ -87,54 +87,54 @@ void test (const Triangulation<dim>& tr)
   laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
-                                                fe_values.shape_value (j,q) *
-                                                fe_values.JxW(q);
-             laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
-                                                   fe_values.shape_grad (j,q) *
-                                                   fe_values.JxW(q);    
-           }
+        for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
+                                                 fe_values.shape_value (j,q) *
+                                                 fe_values.JxW(q);
+              laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
+                                                    fe_values.shape_grad (j,q) *
+                                                    fe_values.JxW(q);
+            }
     }
 
-                                  // check what we expect for this mapping
-                                  // about equality or inequality of the
-                                  // matrices
+  // check what we expect for this mapping
+  // about equality or inequality of the
+  // matrices
   deallog << "Mass matrices "
-         << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
+          << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
   deallog << "Laplace matrices "
-         << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
-  
+          << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
+
   for (unsigned int cell=0; cell<2; ++cell)
     {
       deallog << "cell=" << cell << std::endl;
       deallog << "mass_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << mass_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << mass_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "laplace_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << laplace_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << laplace_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
     }
 }
 
@@ -146,8 +146,8 @@ void test()
   Triangulation<dim> tr;
   Point<dim> p1 = Point<dim>();
   Point<dim> p2 = (dim == 2 ?
-                  Point<dim>(2,1) :
-                  Point<dim>(2,1,1));
+                   Point<dim>(2,1) :
+                   Point<dim>(2,1,1));
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2);
@@ -155,11 +155,11 @@ void test()
   static const HyperBallBoundary<dim> boundary(tr.begin_active()->center());
   tr.set_boundary (1, boundary);
 
-                                  // set boundary id on cell 1
+  // set boundary id on cell 1
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (tr.begin_active()->at_boundary(f))
       tr.begin_active()->face(f)->set_boundary_indicator (1);
-  
+
   test(tr);
 }
 
index 3af9d4f6441948806eeebebbc190c36f0f35ab49..38811e0ecdd21d0633e21e5729c208b80effc770 100644 (file)
 
 
 bool equal (const FullMatrix<double> &m1,
-           const FullMatrix<double> &m2)
+            const FullMatrix<double> &m2)
 {
   double d = 0, s = 0;
   for (unsigned int i=0; i<m1.m(); ++i)
     for (unsigned int j=0; j<m1.n(); ++j)
       {
-       d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
-       s += m1(i,j) * m1(i,j);
+        d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
+        s += m1(i,j) * m1(i,j);
       }
   return (d<1e-8*s);
 }
 
 
 template<int dim>
-void test (const Triangulation<dim>tr)
+void test (const Triangulation<dim> &tr)
 {
   FE_Q<dim> fe(1);
   deallog << "FE=" << fe.get_name() << std::endl;
@@ -71,14 +71,14 @@ void test (const Triangulation<dim>& tr)
   MappingQ<dim> mapping(1);
   deallog << "Mapping=Q1" << std::endl;
 
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (mapping, fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   FullMatrix<double> mass_matrix[2], laplace_matrix[2];
   mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
@@ -87,54 +87,54 @@ void test (const Triangulation<dim>& tr)
   laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
-                                                fe_values.shape_value (j,q) *
-                                                fe_values.JxW(q);
-             laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
-                                                   fe_values.shape_grad (j,q) *
-                                                   fe_values.JxW(q);    
-           }
+        for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
+                                                 fe_values.shape_value (j,q) *
+                                                 fe_values.JxW(q);
+              laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
+                                                    fe_values.shape_grad (j,q) *
+                                                    fe_values.JxW(q);
+            }
     }
 
-                                  // check what we expect for this mapping
-                                  // about equality or inequality of the
-                                  // matrices
+  // check what we expect for this mapping
+  // about equality or inequality of the
+  // matrices
   deallog << "Mass matrices "
-         << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
+          << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
   deallog << "Laplace matrices "
-         << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
-  
+          << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
+
   for (unsigned int cell=0; cell<2; ++cell)
     {
       deallog << "cell=" << cell << std::endl;
       deallog << "mass_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << mass_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << mass_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "laplace_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << laplace_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << laplace_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
     }
 }
 
@@ -146,8 +146,8 @@ void test()
   Triangulation<dim> tr;
   Point<dim> p1 = Point<dim>();
   Point<dim> p2 = (dim == 2 ?
-                  Point<dim>(2,1) :
-                  Point<dim>(2,1,1));
+                   Point<dim>(2,1) :
+                   Point<dim>(2,1,1));
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2);
@@ -155,11 +155,11 @@ void test()
   static const HyperBallBoundary<dim> boundary(tr.begin_active()->center());
   tr.set_boundary (1, boundary);
 
-                                  // set boundary id on cell 1
+  // set boundary id on cell 1
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (tr.begin_active()->at_boundary(f))
       tr.begin_active()->face(f)->set_boundary_indicator (1);
-  
+
   test(tr);
 }
 
index 5c5b2d8b9d5324782c3ac7ba81cfbd71e2411019..bf5b11806067307ca28aeeda7ead7e67b92da00f 100644 (file)
 
 
 bool equal (const FullMatrix<double> &m1,
-           const FullMatrix<double> &m2)
+            const FullMatrix<double> &m2)
 {
   double d = 0, s = 0;
   for (unsigned int i=0; i<m1.m(); ++i)
     for (unsigned int j=0; j<m1.n(); ++j)
       {
-       d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
-       s += m1(i,j) * m1(i,j);
+        d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
+        s += m1(i,j) * m1(i,j);
       }
   return (d<1e-8*s);
 }
 
 
 template<int dim>
-void test (const Triangulation<dim>tr)
+void test (const Triangulation<dim> &tr)
 {
   FE_Q<dim> fe(2);
   deallog << "FE=" << fe.get_name() << std::endl;
@@ -71,14 +71,14 @@ void test (const Triangulation<dim>& tr)
   MappingQ<dim> mapping(1);
   deallog << "Mapping=Q1" << std::endl;
 
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (mapping, fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   FullMatrix<double> mass_matrix[2], laplace_matrix[2];
   mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
@@ -87,54 +87,54 @@ void test (const Triangulation<dim>& tr)
   laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
-                                                fe_values.shape_value (j,q) *
-                                                fe_values.JxW(q);
-             laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
-                                                   fe_values.shape_grad (j,q) *
-                                                   fe_values.JxW(q);    
-           }
+        for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
+                                                 fe_values.shape_value (j,q) *
+                                                 fe_values.JxW(q);
+              laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
+                                                    fe_values.shape_grad (j,q) *
+                                                    fe_values.JxW(q);
+            }
     }
 
-                                  // check what we expect for this mapping
-                                  // about equality or inequality of the
-                                  // matrices
+  // check what we expect for this mapping
+  // about equality or inequality of the
+  // matrices
   deallog << "Mass matrices "
-         << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
+          << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
   deallog << "Laplace matrices "
-         << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
-  
+          << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
+
   for (unsigned int cell=0; cell<2; ++cell)
     {
       deallog << "cell=" << cell << std::endl;
       deallog << "mass_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << mass_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << mass_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "laplace_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << laplace_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << laplace_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
     }
 }
 
@@ -146,8 +146,8 @@ void test()
   Triangulation<dim> tr;
   Point<dim> p1 = Point<dim>();
   Point<dim> p2 = (dim == 2 ?
-                  Point<dim>(2,1) :
-                  Point<dim>(2,1,1));
+                   Point<dim>(2,1) :
+                   Point<dim>(2,1,1));
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2);
@@ -155,11 +155,11 @@ void test()
   static const HyperBallBoundary<dim> boundary(tr.begin_active()->center());
   tr.set_boundary (1, boundary);
 
-                                  // set boundary id on cell 1
+  // set boundary id on cell 1
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (tr.begin_active()->at_boundary(f))
       tr.begin_active()->face(f)->set_boundary_indicator (1);
-  
+
   test(tr);
 }
 
index db348dfff0491bce08946048f827ab71efaf362e..496e482ae3057a0beed54f66f6e49360feb122cb 100644 (file)
 
 
 bool equal (const FullMatrix<double> &m1,
-           const FullMatrix<double> &m2)
+            const FullMatrix<double> &m2)
 {
   double d = 0, s = 0;
   for (unsigned int i=0; i<m1.m(); ++i)
     for (unsigned int j=0; j<m1.n(); ++j)
       {
-       d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
-       s += m1(i,j) * m1(i,j);
+        d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
+        s += m1(i,j) * m1(i,j);
       }
   return (d<1e-8*s);
 }
 
 
 template<int dim>
-void test (const Triangulation<dim>tr)
+void test (const Triangulation<dim> &tr)
 {
   FE_Q<dim> fe(1);
   deallog << "FE=" << fe.get_name() << std::endl;
@@ -71,14 +71,14 @@ void test (const Triangulation<dim>& tr)
   MappingQ<dim> mapping(2);
   deallog << "Mapping=Q2" << std::endl;
 
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (mapping, fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   FullMatrix<double> mass_matrix[2], laplace_matrix[2];
   mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
@@ -87,54 +87,54 @@ void test (const Triangulation<dim>& tr)
   laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
-                                                fe_values.shape_value (j,q) *
-                                                fe_values.JxW(q);
-             laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
-                                                   fe_values.shape_grad (j,q) *
-                                                   fe_values.JxW(q);    
-           }
+        for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
+                                                 fe_values.shape_value (j,q) *
+                                                 fe_values.JxW(q);
+              laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
+                                                    fe_values.shape_grad (j,q) *
+                                                    fe_values.JxW(q);
+            }
     }
 
-                                  // check what we expect for this mapping
-                                  // about equality or inequality of the
-                                  // matrices
+  // check what we expect for this mapping
+  // about equality or inequality of the
+  // matrices
   deallog << "Mass matrices "
-         << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
+          << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
   deallog << "Laplace matrices "
-         << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
-  
+          << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
+
   for (unsigned int cell=0; cell<2; ++cell)
     {
       deallog << "cell=" << cell << std::endl;
       deallog << "mass_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << mass_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << mass_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "laplace_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << laplace_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << laplace_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
     }
 }
 
@@ -146,8 +146,8 @@ void test()
   Triangulation<dim> tr;
   Point<dim> p1 = Point<dim>();
   Point<dim> p2 = (dim == 2 ?
-                  Point<dim>(2,1) :
-                  Point<dim>(2,1,1));
+                   Point<dim>(2,1) :
+                   Point<dim>(2,1,1));
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2);
@@ -155,11 +155,11 @@ void test()
   static const HyperBallBoundary<dim> boundary(tr.begin_active()->center());
   tr.set_boundary (1, boundary);
 
-                                  // set boundary id on cell 1
+  // set boundary id on cell 1
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (tr.begin_active()->at_boundary(f))
       tr.begin_active()->face(f)->set_boundary_indicator (1);
-  
+
   test(tr);
 }
 
index 8afd74be06449ebd21321ac6644d49ee95942f4d..85b697c4bd1d47d8844df69761d484de854329b8 100644 (file)
 
 
 bool equal (const FullMatrix<double> &m1,
-           const FullMatrix<double> &m2)
+            const FullMatrix<double> &m2)
 {
   double d = 0, s = 0;
   for (unsigned int i=0; i<m1.m(); ++i)
     for (unsigned int j=0; j<m1.n(); ++j)
       {
-       d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
-       s += m1(i,j) * m1(i,j);
+        d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
+        s += m1(i,j) * m1(i,j);
       }
   return (d<1e-8*s);
 }
 
 
 template<int dim>
-void test (const Triangulation<dim>tr)
+void test (const Triangulation<dim> &tr)
 {
   FE_Q<dim> fe(2);
   deallog << "FE=" << fe.get_name() << std::endl;
@@ -71,14 +71,14 @@ void test (const Triangulation<dim>& tr)
   MappingQ<dim> mapping(2);
   deallog << "Mapping=Q2" << std::endl;
 
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (mapping, fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   FullMatrix<double> mass_matrix[2], laplace_matrix[2];
   mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
@@ -87,54 +87,54 @@ void test (const Triangulation<dim>& tr)
   laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
-                                                fe_values.shape_value (j,q) *
-                                                fe_values.JxW(q);
-             laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
-                                                   fe_values.shape_grad (j,q) *
-                                                   fe_values.JxW(q);    
-           }
+        for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
+                                                 fe_values.shape_value (j,q) *
+                                                 fe_values.JxW(q);
+              laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
+                                                    fe_values.shape_grad (j,q) *
+                                                    fe_values.JxW(q);
+            }
     }
 
-                                  // check what we expect for this mapping
-                                  // about equality or inequality of the
-                                  // matrices
+  // check what we expect for this mapping
+  // about equality or inequality of the
+  // matrices
   deallog << "Mass matrices "
-         << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
+          << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
   deallog << "Laplace matrices "
-         << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
-  
+          << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
+
   for (unsigned int cell=0; cell<2; ++cell)
     {
       deallog << "cell=" << cell << std::endl;
       deallog << "mass_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << mass_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << mass_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "laplace_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << laplace_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << laplace_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
     }
 }
 
@@ -146,8 +146,8 @@ void test()
   Triangulation<dim> tr;
   Point<dim> p1 = Point<dim>();
   Point<dim> p2 = (dim == 2 ?
-                  Point<dim>(2,1) :
-                  Point<dim>(2,1,1));
+                   Point<dim>(2,1) :
+                   Point<dim>(2,1,1));
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2);
@@ -155,11 +155,11 @@ void test()
   static const HyperBallBoundary<dim> boundary(tr.begin_active()->center());
   tr.set_boundary (1, boundary);
 
-                                  // set boundary id on cell 1
+  // set boundary id on cell 1
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (tr.begin_active()->at_boundary(f))
       tr.begin_active()->face(f)->set_boundary_indicator (1);
-  
+
   test(tr);
 }
 
index b4fd8e2078303af7f949faaa89486d90fe425fb2..4a2f4367ee8416dd6ee77bb59d7af6b788dbf6fc 100644 (file)
 
 
 bool equal (const FullMatrix<double> &m1,
-           const FullMatrix<double> &m2)
+            const FullMatrix<double> &m2)
 {
   double d = 0, s = 0;
   for (unsigned int i=0; i<m1.m(); ++i)
     for (unsigned int j=0; j<m1.n(); ++j)
       {
-       d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
-       s += m1(i,j) * m1(i,j);
+        d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
+        s += m1(i,j) * m1(i,j);
       }
   return (d<1e-8*s);
 }
 
 
 template<int dim>
-void test (const Triangulation<dim>tr)
+void test (const Triangulation<dim> &tr)
 {
   FE_Q<dim> fe(1);
   deallog << "FE=" << fe.get_name() << std::endl;
@@ -71,14 +71,14 @@ void test (const Triangulation<dim>& tr)
   MappingC1<dim> mapping;
   deallog << "Mapping=C1" << std::endl;
 
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (mapping, fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   FullMatrix<double> mass_matrix[2], laplace_matrix[2];
   mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
@@ -87,54 +87,54 @@ void test (const Triangulation<dim>& tr)
   laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
-                                                fe_values.shape_value (j,q) *
-                                                fe_values.JxW(q);
-             laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
-                                                   fe_values.shape_grad (j,q) *
-                                                   fe_values.JxW(q);    
-           }
+        for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
+                                                 fe_values.shape_value (j,q) *
+                                                 fe_values.JxW(q);
+              laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
+                                                    fe_values.shape_grad (j,q) *
+                                                    fe_values.JxW(q);
+            }
     }
 
-                                  // check what we expect for this mapping
-                                  // about equality or inequality of the
-                                  // matrices
+  // check what we expect for this mapping
+  // about equality or inequality of the
+  // matrices
   deallog << "Mass matrices "
-         << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
+          << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
   deallog << "Laplace matrices "
-         << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
-  
+          << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
+
   for (unsigned int cell=0; cell<2; ++cell)
     {
       deallog << "cell=" << cell << std::endl;
       deallog << "mass_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << mass_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << mass_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "laplace_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << laplace_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << laplace_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
     }
 }
 
@@ -146,8 +146,8 @@ void test()
   Triangulation<dim> tr;
   Point<dim> p1 = Point<dim>();
   Point<dim> p2 = (dim == 2 ?
-                  Point<dim>(2,1) :
-                  Point<dim>(2,1,1));
+                   Point<dim>(2,1) :
+                   Point<dim>(2,1,1));
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2);
@@ -155,11 +155,11 @@ void test()
   static const HyperBallBoundary<dim> boundary(tr.begin_active()->center());
   tr.set_boundary (1, boundary);
 
-                                  // set boundary id on cell 1
+  // set boundary id on cell 1
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (tr.begin_active()->at_boundary(f))
       tr.begin_active()->face(f)->set_boundary_indicator (1);
-  
+
   test(tr);
 }
 
index f264c64959e8f2fa9104a14d00b7e72588780a40..bc4f3db8f3e210fc91a8f16f728c159780ea7355 100644 (file)
 
 
 bool equal (const FullMatrix<double> &m1,
-           const FullMatrix<double> &m2)
+            const FullMatrix<double> &m2)
 {
   double d = 0, s = 0;
   for (unsigned int i=0; i<m1.m(); ++i)
     for (unsigned int j=0; j<m1.n(); ++j)
       {
-       d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
-       s += m1(i,j) * m1(i,j);
+        d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
+        s += m1(i,j) * m1(i,j);
       }
   return (d<1e-8*s);
 }
 
 
 template<int dim>
-void test (const Triangulation<dim>tr)
+void test (const Triangulation<dim> &tr)
 {
   FE_Q<dim> fe(2);
   deallog << "FE=" << fe.get_name() << std::endl;
@@ -71,14 +71,14 @@ void test (const Triangulation<dim>& tr)
   MappingC1<dim> mapping;
   deallog << "Mapping=C1" << std::endl;
 
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (mapping, fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   FullMatrix<double> mass_matrix[2], laplace_matrix[2];
   mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
@@ -87,54 +87,54 @@ void test (const Triangulation<dim>& tr)
   laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
-                                                fe_values.shape_value (j,q) *
-                                                fe_values.JxW(q);
-             laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
-                                                   fe_values.shape_grad (j,q) *
-                                                   fe_values.JxW(q);    
-           }
+        for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
+                                                 fe_values.shape_value (j,q) *
+                                                 fe_values.JxW(q);
+              laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
+                                                    fe_values.shape_grad (j,q) *
+                                                    fe_values.JxW(q);
+            }
     }
 
-                                  // check what we expect for this mapping
-                                  // about equality or inequality of the
-                                  // matrices
+  // check what we expect for this mapping
+  // about equality or inequality of the
+  // matrices
   deallog << "Mass matrices "
-         << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
+          << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
   deallog << "Laplace matrices "
-         << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
-  
+          << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
+
   for (unsigned int cell=0; cell<2; ++cell)
     {
       deallog << "cell=" << cell << std::endl;
       deallog << "mass_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << mass_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << mass_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "laplace_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << laplace_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << laplace_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
     }
 }
 
@@ -146,8 +146,8 @@ void test()
   Triangulation<dim> tr;
   Point<dim> p1 = Point<dim>();
   Point<dim> p2 = (dim == 2 ?
-                  Point<dim>(2,1) :
-                  Point<dim>(2,1,1));
+                   Point<dim>(2,1) :
+                   Point<dim>(2,1,1));
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2);
@@ -155,11 +155,11 @@ void test()
   static const HyperBallBoundary<dim> boundary(tr.begin_active()->center());
   tr.set_boundary (1, boundary);
 
-                                  // set boundary id on cell 1
+  // set boundary id on cell 1
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (tr.begin_active()->at_boundary(f))
       tr.begin_active()->face(f)->set_boundary_indicator (1);
-  
+
   test(tr);
 }
 
index 6e9093bd4d336e5c5aafafc3a016b70ddf6bb212..3e6bb4d4ed4e2247a18e7157455688cdfebb3fff 100644 (file)
 
 
 bool equal (const FullMatrix<double> &m1,
-           const FullMatrix<double> &m2)
+            const FullMatrix<double> &m2)
 {
   double d = 0, s = 0;
   for (unsigned int i=0; i<m1.m(); ++i)
     for (unsigned int j=0; j<m1.n(); ++j)
       {
-       d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
-       s += m1(i,j) * m1(i,j);
+        d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
+        s += m1(i,j) * m1(i,j);
       }
   return (d<1e-8*s);
 }
 
 
 template<int dim>
-void test (const Triangulation<dim>tr)
+void test (const Triangulation<dim> &tr)
 {
   FE_Q<dim> fe(1);
   deallog << "FE=" << fe.get_name() << std::endl;
@@ -71,14 +71,14 @@ void test (const Triangulation<dim>& tr)
   MappingCartesian<dim> mapping;
   deallog << "Mapping=Cartesian" << std::endl;
 
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (mapping, fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   FullMatrix<double> mass_matrix[2], laplace_matrix[2];
   mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
@@ -87,54 +87,54 @@ void test (const Triangulation<dim>& tr)
   laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
-                                                fe_values.shape_value (j,q) *
-                                                fe_values.JxW(q);
-             laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
-                                                   fe_values.shape_grad (j,q) *
-                                                   fe_values.JxW(q);    
-           }
+        for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
+                                                 fe_values.shape_value (j,q) *
+                                                 fe_values.JxW(q);
+              laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
+                                                    fe_values.shape_grad (j,q) *
+                                                    fe_values.JxW(q);
+            }
     }
 
-                                  // check what we expect for this mapping
-                                  // about equality or inequality of the
-                                  // matrices
+  // check what we expect for this mapping
+  // about equality or inequality of the
+  // matrices
   deallog << "Mass matrices "
-         << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
+          << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
   deallog << "Laplace matrices "
-         << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
-  
+          << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
+
   for (unsigned int cell=0; cell<2; ++cell)
     {
       deallog << "cell=" << cell << std::endl;
       deallog << "mass_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << mass_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << mass_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "laplace_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << laplace_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << laplace_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
     }
 }
 
@@ -146,8 +146,8 @@ void test()
   Triangulation<dim> tr;
   Point<dim> p1 = Point<dim>();
   Point<dim> p2 = (dim == 2 ?
-                  Point<dim>(2,1) :
-                  Point<dim>(2,1,1));
+                   Point<dim>(2,1) :
+                   Point<dim>(2,1,1));
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2);
@@ -155,11 +155,11 @@ void test()
   static const HyperBallBoundary<dim> boundary(tr.begin_active()->center());
   tr.set_boundary (1, boundary);
 
-                                  // set boundary id on cell 1
+  // set boundary id on cell 1
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (tr.begin_active()->at_boundary(f))
       tr.begin_active()->face(f)->set_boundary_indicator (1);
-  
+
   test(tr);
 }
 
index ea77e782af2a1961a8a464a107666ea0850887de..99ceda03eae67dd34d2ff3ce301bb6c70514f287 100644 (file)
 
 
 bool equal (const FullMatrix<double> &m1,
-           const FullMatrix<double> &m2)
+            const FullMatrix<double> &m2)
 {
   double d = 0, s = 0;
   for (unsigned int i=0; i<m1.m(); ++i)
     for (unsigned int j=0; j<m1.n(); ++j)
       {
-       d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
-       s += m1(i,j) * m1(i,j);
+        d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
+        s += m1(i,j) * m1(i,j);
       }
   return (d<1e-8*s);
 }
 
 
 template<int dim>
-void test (const Triangulation<dim>tr)
+void test (const Triangulation<dim> &tr)
 {
   FE_Q<dim> fe(2);
   deallog << "FE=" << fe.get_name() << std::endl;
@@ -71,14 +71,14 @@ void test (const Triangulation<dim>& tr)
   MappingCartesian<dim> mapping;
   deallog << "Mapping=Cartesian" << std::endl;
 
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (mapping, fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   FullMatrix<double> mass_matrix[2], laplace_matrix[2];
   mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
@@ -87,54 +87,54 @@ void test (const Triangulation<dim>& tr)
   laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
-                                                fe_values.shape_value (j,q) *
-                                                fe_values.JxW(q);
-             laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
-                                                   fe_values.shape_grad (j,q) *
-                                                   fe_values.JxW(q);    
-           }
+        for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
+                                                 fe_values.shape_value (j,q) *
+                                                 fe_values.JxW(q);
+              laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
+                                                    fe_values.shape_grad (j,q) *
+                                                    fe_values.JxW(q);
+            }
     }
 
-                                  // check what we expect for this mapping
-                                  // about equality or inequality of the
-                                  // matrices
+  // check what we expect for this mapping
+  // about equality or inequality of the
+  // matrices
   deallog << "Mass matrices "
-         << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
+          << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
   deallog << "Laplace matrices "
-         << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
-  
+          << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
+
   for (unsigned int cell=0; cell<2; ++cell)
     {
       deallog << "cell=" << cell << std::endl;
       deallog << "mass_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << mass_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << mass_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "laplace_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << laplace_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << laplace_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
     }
 }
 
@@ -146,8 +146,8 @@ void test()
   Triangulation<dim> tr;
   Point<dim> p1 = Point<dim>();
   Point<dim> p2 = (dim == 2 ?
-                  Point<dim>(2,1) :
-                  Point<dim>(2,1,1));
+                   Point<dim>(2,1) :
+                   Point<dim>(2,1,1));
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2);
@@ -155,11 +155,11 @@ void test()
   static const HyperBallBoundary<dim> boundary(tr.begin_active()->center());
   tr.set_boundary (1, boundary);
 
-                                  // set boundary id on cell 1
+  // set boundary id on cell 1
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (tr.begin_active()->at_boundary(f))
       tr.begin_active()->face(f)->set_boundary_indicator (1);
-  
+
   test(tr);
 }
 
index ab2cefdb4c0b466f42f2bc10b5b3e919df88ae83..1a6aed6f1035e214676e15eb09aacbe6284c9aee 100644 (file)
 
 
 bool equal (const FullMatrix<double> &m1,
-           const FullMatrix<double> &m2)
+            const FullMatrix<double> &m2)
 {
   double d = 0, s = 0;
   for (unsigned int i=0; i<m1.m(); ++i)
     for (unsigned int j=0; j<m1.n(); ++j)
       {
-       d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
-       s += m1(i,j) * m1(i,j);
+        d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
+        s += m1(i,j) * m1(i,j);
       }
   return (d<1e-8*s);
 }
 
 
 template<int dim>
-void test (const Triangulation<dim>tr)
+void test (const Triangulation<dim> &tr)
 {
   FE_DGPMonomial<dim> fe(1);
   deallog << "FE=" << fe.get_name() << std::endl;
@@ -71,14 +71,14 @@ void test (const Triangulation<dim>& tr)
   MappingQ1<dim> mapping;
   deallog << "Mapping=Q1" << std::endl;
 
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (mapping, fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   FullMatrix<double> mass_matrix[2], laplace_matrix[2];
   mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
@@ -87,54 +87,54 @@ void test (const Triangulation<dim>& tr)
   laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
-                                                fe_values.shape_value (j,q) *
-                                                fe_values.JxW(q);
-             laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
-                                                   fe_values.shape_grad (j,q) *
-                                                   fe_values.JxW(q);    
-           }
+        for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
+                                                 fe_values.shape_value (j,q) *
+                                                 fe_values.JxW(q);
+              laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
+                                                    fe_values.shape_grad (j,q) *
+                                                    fe_values.JxW(q);
+            }
     }
 
-                                  // check what we expect for this mapping
-                                  // about equality or inequality of the
-                                  // matrices
+  // check what we expect for this mapping
+  // about equality or inequality of the
+  // matrices
   deallog << "Mass matrices "
-         << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
+          << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
   deallog << "Laplace matrices "
-         << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
-  
+          << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
+
   for (unsigned int cell=0; cell<2; ++cell)
     {
       deallog << "cell=" << cell << std::endl;
       deallog << "mass_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << mass_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << mass_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "laplace_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << laplace_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << laplace_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
     }
 }
 
@@ -146,8 +146,8 @@ void test()
   Triangulation<dim> tr;
   Point<dim> p1 = Point<dim>();
   Point<dim> p2 = (dim == 2 ?
-                  Point<dim>(2,1) :
-                  Point<dim>(2,1,1));
+                   Point<dim>(2,1) :
+                   Point<dim>(2,1,1));
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2);
@@ -155,11 +155,11 @@ void test()
   static const HyperBallBoundary<dim> boundary(tr.begin_active()->center());
   tr.set_boundary (1, boundary);
 
-                                  // set boundary id on cell 1
+  // set boundary id on cell 1
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (tr.begin_active()->at_boundary(f))
       tr.begin_active()->face(f)->set_boundary_indicator (1);
-  
+
   test(tr);
 }
 
index eee112de9397062cd70b1812acbcbbc380a40896..827a55c94baaadf1903cc9bdc4c4a7763c34ba33 100644 (file)
 
 
 bool equal (const FullMatrix<double> &m1,
-           const FullMatrix<double> &m2)
+            const FullMatrix<double> &m2)
 {
   double d = 0, s = 0;
   for (unsigned int i=0; i<m1.m(); ++i)
     for (unsigned int j=0; j<m1.n(); ++j)
       {
-       d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
-       s += m1(i,j) * m1(i,j);
+        d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
+        s += m1(i,j) * m1(i,j);
       }
   return (d<1e-8*s);
 }
 
 
 template<int dim>
-void test (const Triangulation<dim>tr)
+void test (const Triangulation<dim> &tr)
 {
   FE_DGPMonomial<dim> fe(2);
   deallog << "FE=" << fe.get_name() << std::endl;
@@ -71,14 +71,14 @@ void test (const Triangulation<dim>& tr)
   MappingQ1<dim> mapping;
   deallog << "Mapping=Q1" << std::endl;
 
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (mapping, fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   FullMatrix<double> mass_matrix[2], laplace_matrix[2];
   mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
@@ -87,54 +87,54 @@ void test (const Triangulation<dim>& tr)
   laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
-                                                fe_values.shape_value (j,q) *
-                                                fe_values.JxW(q);
-             laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
-                                                   fe_values.shape_grad (j,q) *
-                                                   fe_values.JxW(q);    
-           }
+        for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
+                                                 fe_values.shape_value (j,q) *
+                                                 fe_values.JxW(q);
+              laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
+                                                    fe_values.shape_grad (j,q) *
+                                                    fe_values.JxW(q);
+            }
     }
 
-                                  // check what we expect for this mapping
-                                  // about equality or inequality of the
-                                  // matrices
+  // check what we expect for this mapping
+  // about equality or inequality of the
+  // matrices
   deallog << "Mass matrices "
-         << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
+          << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
   deallog << "Laplace matrices "
-         << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
-  
+          << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
+
   for (unsigned int cell=0; cell<2; ++cell)
     {
       deallog << "cell=" << cell << std::endl;
       deallog << "mass_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << mass_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << mass_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "laplace_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << laplace_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << laplace_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
     }
 }
 
@@ -146,8 +146,8 @@ void test()
   Triangulation<dim> tr;
   Point<dim> p1 = Point<dim>();
   Point<dim> p2 = (dim == 2 ?
-                  Point<dim>(2,1) :
-                  Point<dim>(2,1,1));
+                   Point<dim>(2,1) :
+                   Point<dim>(2,1,1));
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2);
@@ -155,11 +155,11 @@ void test()
   static const HyperBallBoundary<dim> boundary(tr.begin_active()->center());
   tr.set_boundary (1, boundary);
 
-                                  // set boundary id on cell 1
+  // set boundary id on cell 1
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (tr.begin_active()->at_boundary(f))
       tr.begin_active()->face(f)->set_boundary_indicator (1);
-  
+
   test(tr);
 }
 
index 0d5eb387a6ab604f354e7ac99af4977257e0baeb..8ee2f8377fac6ca6ae4e4e1c185d5601a317ec41 100644 (file)
 
 
 bool equal (const FullMatrix<double> &m1,
-           const FullMatrix<double> &m2)
+            const FullMatrix<double> &m2)
 {
   double d = 0, s = 0;
   for (unsigned int i=0; i<m1.m(); ++i)
     for (unsigned int j=0; j<m1.n(); ++j)
       {
-       d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
-       s += m1(i,j) * m1(i,j);
+        d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
+        s += m1(i,j) * m1(i,j);
       }
   return (d<1e-8*s);
 }
 
 
 template<int dim>
-void test (const Triangulation<dim>tr)
+void test (const Triangulation<dim> &tr)
 {
   FE_DGPMonomial<dim> fe(1);
   deallog << "FE=" << fe.get_name() << std::endl;
@@ -71,14 +71,14 @@ void test (const Triangulation<dim>& tr)
   MappingQ<dim> mapping(1);
   deallog << "Mapping=Q1" << std::endl;
 
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (mapping, fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   FullMatrix<double> mass_matrix[2], laplace_matrix[2];
   mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
@@ -87,54 +87,54 @@ void test (const Triangulation<dim>& tr)
   laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
-                                                fe_values.shape_value (j,q) *
-                                                fe_values.JxW(q);
-             laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
-                                                   fe_values.shape_grad (j,q) *
-                                                   fe_values.JxW(q);    
-           }
+        for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
+                                                 fe_values.shape_value (j,q) *
+                                                 fe_values.JxW(q);
+              laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
+                                                    fe_values.shape_grad (j,q) *
+                                                    fe_values.JxW(q);
+            }
     }
 
-                                  // check what we expect for this mapping
-                                  // about equality or inequality of the
-                                  // matrices
+  // check what we expect for this mapping
+  // about equality or inequality of the
+  // matrices
   deallog << "Mass matrices "
-         << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
+          << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
   deallog << "Laplace matrices "
-         << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
-  
+          << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
+
   for (unsigned int cell=0; cell<2; ++cell)
     {
       deallog << "cell=" << cell << std::endl;
       deallog << "mass_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << mass_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << mass_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "laplace_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << laplace_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << laplace_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
     }
 }
 
@@ -146,8 +146,8 @@ void test()
   Triangulation<dim> tr;
   Point<dim> p1 = Point<dim>();
   Point<dim> p2 = (dim == 2 ?
-                  Point<dim>(2,1) :
-                  Point<dim>(2,1,1));
+                   Point<dim>(2,1) :
+                   Point<dim>(2,1,1));
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2);
@@ -155,11 +155,11 @@ void test()
   static const HyperBallBoundary<dim> boundary(tr.begin_active()->center());
   tr.set_boundary (1, boundary);
 
-                                  // set boundary id on cell 1
+  // set boundary id on cell 1
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (tr.begin_active()->at_boundary(f))
       tr.begin_active()->face(f)->set_boundary_indicator (1);
-  
+
   test(tr);
 }
 
index 9534f9163c4a6ea63bd964a3f1e2058a76caf8e6..1d866032f2c2451f4b88acb3176705665f713f90 100644 (file)
 
 
 bool equal (const FullMatrix<double> &m1,
-           const FullMatrix<double> &m2)
+            const FullMatrix<double> &m2)
 {
   double d = 0, s = 0;
   for (unsigned int i=0; i<m1.m(); ++i)
     for (unsigned int j=0; j<m1.n(); ++j)
       {
-       d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
-       s += m1(i,j) * m1(i,j);
+        d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
+        s += m1(i,j) * m1(i,j);
       }
   return (d<1e-8*s);
 }
 
 
 template<int dim>
-void test (const Triangulation<dim>tr)
+void test (const Triangulation<dim> &tr)
 {
   FE_DGPMonomial<dim> fe(2);
   deallog << "FE=" << fe.get_name() << std::endl;
@@ -71,14 +71,14 @@ void test (const Triangulation<dim>& tr)
   MappingQ<dim> mapping(1);
   deallog << "Mapping=Q1" << std::endl;
 
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (mapping, fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   FullMatrix<double> mass_matrix[2], laplace_matrix[2];
   mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
@@ -87,54 +87,54 @@ void test (const Triangulation<dim>& tr)
   laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
-                                                fe_values.shape_value (j,q) *
-                                                fe_values.JxW(q);
-             laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
-                                                   fe_values.shape_grad (j,q) *
-                                                   fe_values.JxW(q);    
-           }
+        for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
+                                                 fe_values.shape_value (j,q) *
+                                                 fe_values.JxW(q);
+              laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
+                                                    fe_values.shape_grad (j,q) *
+                                                    fe_values.JxW(q);
+            }
     }
 
-                                  // check what we expect for this mapping
-                                  // about equality or inequality of the
-                                  // matrices
+  // check what we expect for this mapping
+  // about equality or inequality of the
+  // matrices
   deallog << "Mass matrices "
-         << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
+          << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
   deallog << "Laplace matrices "
-         << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
-  
+          << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
+
   for (unsigned int cell=0; cell<2; ++cell)
     {
       deallog << "cell=" << cell << std::endl;
       deallog << "mass_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << mass_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << mass_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "laplace_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << laplace_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << laplace_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
     }
 }
 
@@ -146,8 +146,8 @@ void test()
   Triangulation<dim> tr;
   Point<dim> p1 = Point<dim>();
   Point<dim> p2 = (dim == 2 ?
-                  Point<dim>(2,1) :
-                  Point<dim>(2,1,1));
+                   Point<dim>(2,1) :
+                   Point<dim>(2,1,1));
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2);
@@ -155,11 +155,11 @@ void test()
   static const HyperBallBoundary<dim> boundary(tr.begin_active()->center());
   tr.set_boundary (1, boundary);
 
-                                  // set boundary id on cell 1
+  // set boundary id on cell 1
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (tr.begin_active()->at_boundary(f))
       tr.begin_active()->face(f)->set_boundary_indicator (1);
-  
+
   test(tr);
 }
 
index b23357b3773f596f29e41d8fa66327e23e2b327d..1354bedaf7d9b28f777a0ffd2d487c4db237a24c 100644 (file)
 
 
 bool equal (const FullMatrix<double> &m1,
-           const FullMatrix<double> &m2)
+            const FullMatrix<double> &m2)
 {
   double d = 0, s = 0;
   for (unsigned int i=0; i<m1.m(); ++i)
     for (unsigned int j=0; j<m1.n(); ++j)
       {
-       d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
-       s += m1(i,j) * m1(i,j);
+        d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
+        s += m1(i,j) * m1(i,j);
       }
   return (d<1e-8*s);
 }
 
 
 template<int dim>
-void test (const Triangulation<dim>tr)
+void test (const Triangulation<dim> &tr)
 {
   FE_DGPMonomial<dim> fe(1);
   deallog << "FE=" << fe.get_name() << std::endl;
@@ -71,14 +71,14 @@ void test (const Triangulation<dim>& tr)
   MappingQ<dim> mapping(2);
   deallog << "Mapping=Q2" << std::endl;
 
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (mapping, fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   FullMatrix<double> mass_matrix[2], laplace_matrix[2];
   mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
@@ -87,54 +87,54 @@ void test (const Triangulation<dim>& tr)
   laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
-                                                fe_values.shape_value (j,q) *
-                                                fe_values.JxW(q);
-             laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
-                                                   fe_values.shape_grad (j,q) *
-                                                   fe_values.JxW(q);    
-           }
+        for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
+                                                 fe_values.shape_value (j,q) *
+                                                 fe_values.JxW(q);
+              laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
+                                                    fe_values.shape_grad (j,q) *
+                                                    fe_values.JxW(q);
+            }
     }
 
-                                  // check what we expect for this mapping
-                                  // about equality or inequality of the
-                                  // matrices
+  // check what we expect for this mapping
+  // about equality or inequality of the
+  // matrices
   deallog << "Mass matrices "
-         << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
+          << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
   deallog << "Laplace matrices "
-         << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
-  
+          << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
+
   for (unsigned int cell=0; cell<2; ++cell)
     {
       deallog << "cell=" << cell << std::endl;
       deallog << "mass_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << mass_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << mass_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "laplace_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << laplace_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << laplace_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
     }
 }
 
@@ -146,8 +146,8 @@ void test()
   Triangulation<dim> tr;
   Point<dim> p1 = Point<dim>();
   Point<dim> p2 = (dim == 2 ?
-                  Point<dim>(2,1) :
-                  Point<dim>(2,1,1));
+                   Point<dim>(2,1) :
+                   Point<dim>(2,1,1));
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2);
@@ -155,11 +155,11 @@ void test()
   static const HyperBallBoundary<dim> boundary(tr.begin_active()->center());
   tr.set_boundary (1, boundary);
 
-                                  // set boundary id on cell 1
+  // set boundary id on cell 1
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (tr.begin_active()->at_boundary(f))
       tr.begin_active()->face(f)->set_boundary_indicator (1);
-  
+
   test(tr);
 }
 
index 6ea5836cb117a11db6ad21122ecc34830a11a186..d87f3d856bf353fd764dd536e1478f0f2ffba072 100644 (file)
 
 
 bool equal (const FullMatrix<double> &m1,
-           const FullMatrix<double> &m2)
+            const FullMatrix<double> &m2)
 {
   double d = 0, s = 0;
   for (unsigned int i=0; i<m1.m(); ++i)
     for (unsigned int j=0; j<m1.n(); ++j)
       {
-       d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
-       s += m1(i,j) * m1(i,j);
+        d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
+        s += m1(i,j) * m1(i,j);
       }
   return (d<1e-8*s);
 }
 
 
 template<int dim>
-void test (const Triangulation<dim>tr)
+void test (const Triangulation<dim> &tr)
 {
   FE_DGPMonomial<dim> fe(2);
   deallog << "FE=" << fe.get_name() << std::endl;
@@ -71,14 +71,14 @@ void test (const Triangulation<dim>& tr)
   MappingQ<dim> mapping(2);
   deallog << "Mapping=Q2" << std::endl;
 
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (mapping, fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   FullMatrix<double> mass_matrix[2], laplace_matrix[2];
   mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
@@ -87,54 +87,54 @@ void test (const Triangulation<dim>& tr)
   laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
-                                                fe_values.shape_value (j,q) *
-                                                fe_values.JxW(q);
-             laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
-                                                   fe_values.shape_grad (j,q) *
-                                                   fe_values.JxW(q);    
-           }
+        for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
+                                                 fe_values.shape_value (j,q) *
+                                                 fe_values.JxW(q);
+              laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
+                                                    fe_values.shape_grad (j,q) *
+                                                    fe_values.JxW(q);
+            }
     }
 
-                                  // check what we expect for this mapping
-                                  // about equality or inequality of the
-                                  // matrices
+  // check what we expect for this mapping
+  // about equality or inequality of the
+  // matrices
   deallog << "Mass matrices "
-         << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
+          << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
   deallog << "Laplace matrices "
-         << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
-  
+          << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
+
   for (unsigned int cell=0; cell<2; ++cell)
     {
       deallog << "cell=" << cell << std::endl;
       deallog << "mass_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << mass_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << mass_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "laplace_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << laplace_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << laplace_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
     }
 }
 
@@ -146,8 +146,8 @@ void test()
   Triangulation<dim> tr;
   Point<dim> p1 = Point<dim>();
   Point<dim> p2 = (dim == 2 ?
-                  Point<dim>(2,1) :
-                  Point<dim>(2,1,1));
+                   Point<dim>(2,1) :
+                   Point<dim>(2,1,1));
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2);
@@ -155,11 +155,11 @@ void test()
   static const HyperBallBoundary<dim> boundary(tr.begin_active()->center());
   tr.set_boundary (1, boundary);
 
-                                  // set boundary id on cell 1
+  // set boundary id on cell 1
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (tr.begin_active()->at_boundary(f))
       tr.begin_active()->face(f)->set_boundary_indicator (1);
-  
+
   test(tr);
 }
 
index 801feede79229bc9b95e7822aced3ababd827794..ff6396335495accf8077b31374a4f889ee793d2a 100644 (file)
 
 
 bool equal (const FullMatrix<double> &m1,
-           const FullMatrix<double> &m2)
+            const FullMatrix<double> &m2)
 {
   double d = 0, s = 0;
   for (unsigned int i=0; i<m1.m(); ++i)
     for (unsigned int j=0; j<m1.n(); ++j)
       {
-       d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
-       s += m1(i,j) * m1(i,j);
+        d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
+        s += m1(i,j) * m1(i,j);
       }
   return (d<1e-8*s);
 }
 
 
 template<int dim>
-void test (const Triangulation<dim>tr)
+void test (const Triangulation<dim> &tr)
 {
   FE_DGPMonomial<dim> fe(1);
   deallog << "FE=" << fe.get_name() << std::endl;
@@ -71,14 +71,14 @@ void test (const Triangulation<dim>& tr)
   MappingC1<dim> mapping;
   deallog << "Mapping=C1" << std::endl;
 
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (mapping, fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   FullMatrix<double> mass_matrix[2], laplace_matrix[2];
   mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
@@ -87,54 +87,54 @@ void test (const Triangulation<dim>& tr)
   laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
-                                                fe_values.shape_value (j,q) *
-                                                fe_values.JxW(q);
-             laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
-                                                   fe_values.shape_grad (j,q) *
-                                                   fe_values.JxW(q);    
-           }
+        for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
+                                                 fe_values.shape_value (j,q) *
+                                                 fe_values.JxW(q);
+              laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
+                                                    fe_values.shape_grad (j,q) *
+                                                    fe_values.JxW(q);
+            }
     }
 
-                                  // check what we expect for this mapping
-                                  // about equality or inequality of the
-                                  // matrices
+  // check what we expect for this mapping
+  // about equality or inequality of the
+  // matrices
   deallog << "Mass matrices "
-         << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
+          << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
   deallog << "Laplace matrices "
-         << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
-  
+          << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
+
   for (unsigned int cell=0; cell<2; ++cell)
     {
       deallog << "cell=" << cell << std::endl;
       deallog << "mass_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << mass_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << mass_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "laplace_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << laplace_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << laplace_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
     }
 }
 
@@ -146,8 +146,8 @@ void test()
   Triangulation<dim> tr;
   Point<dim> p1 = Point<dim>();
   Point<dim> p2 = (dim == 2 ?
-                  Point<dim>(2,1) :
-                  Point<dim>(2,1,1));
+                   Point<dim>(2,1) :
+                   Point<dim>(2,1,1));
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2);
@@ -155,11 +155,11 @@ void test()
   static const HyperBallBoundary<dim> boundary(tr.begin_active()->center());
   tr.set_boundary (1, boundary);
 
-                                  // set boundary id on cell 1
+  // set boundary id on cell 1
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (tr.begin_active()->at_boundary(f))
       tr.begin_active()->face(f)->set_boundary_indicator (1);
-  
+
   test(tr);
 }
 
index 9823f2fbc5979953e5e27857153ef332d126bbc6..a140e125c3ef30cd2fa44a3fb16dd2e52d6ecbef 100644 (file)
 
 
 bool equal (const FullMatrix<double> &m1,
-           const FullMatrix<double> &m2)
+            const FullMatrix<double> &m2)
 {
   double d = 0, s = 0;
   for (unsigned int i=0; i<m1.m(); ++i)
     for (unsigned int j=0; j<m1.n(); ++j)
       {
-       d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
-       s += m1(i,j) * m1(i,j);
+        d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
+        s += m1(i,j) * m1(i,j);
       }
   return (d<1e-8*s);
 }
 
 
 template<int dim>
-void test (const Triangulation<dim>tr)
+void test (const Triangulation<dim> &tr)
 {
   FE_DGPMonomial<dim> fe(2);
   deallog << "FE=" << fe.get_name() << std::endl;
@@ -71,14 +71,14 @@ void test (const Triangulation<dim>& tr)
   MappingC1<dim> mapping;
   deallog << "Mapping=C1" << std::endl;
 
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (mapping, fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   FullMatrix<double> mass_matrix[2], laplace_matrix[2];
   mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
@@ -87,54 +87,54 @@ void test (const Triangulation<dim>& tr)
   laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
-                                                fe_values.shape_value (j,q) *
-                                                fe_values.JxW(q);
-             laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
-                                                   fe_values.shape_grad (j,q) *
-                                                   fe_values.JxW(q);    
-           }
+        for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
+                                                 fe_values.shape_value (j,q) *
+                                                 fe_values.JxW(q);
+              laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
+                                                    fe_values.shape_grad (j,q) *
+                                                    fe_values.JxW(q);
+            }
     }
 
-                                  // check what we expect for this mapping
-                                  // about equality or inequality of the
-                                  // matrices
+  // check what we expect for this mapping
+  // about equality or inequality of the
+  // matrices
   deallog << "Mass matrices "
-         << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
+          << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
   deallog << "Laplace matrices "
-         << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
-  
+          << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
+
   for (unsigned int cell=0; cell<2; ++cell)
     {
       deallog << "cell=" << cell << std::endl;
       deallog << "mass_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << mass_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << mass_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "laplace_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << laplace_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << laplace_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
     }
 }
 
@@ -146,8 +146,8 @@ void test()
   Triangulation<dim> tr;
   Point<dim> p1 = Point<dim>();
   Point<dim> p2 = (dim == 2 ?
-                  Point<dim>(2,1) :
-                  Point<dim>(2,1,1));
+                   Point<dim>(2,1) :
+                   Point<dim>(2,1,1));
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2);
@@ -155,11 +155,11 @@ void test()
   static const HyperBallBoundary<dim> boundary(tr.begin_active()->center());
   tr.set_boundary (1, boundary);
 
-                                  // set boundary id on cell 1
+  // set boundary id on cell 1
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (tr.begin_active()->at_boundary(f))
       tr.begin_active()->face(f)->set_boundary_indicator (1);
-  
+
   test(tr);
 }
 
index 1260b8719b70ca26c626441beaaa1bd1d9fd552e..4a9b143273f91fe8ed31c808e022f61ec695f20f 100644 (file)
 
 
 bool equal (const FullMatrix<double> &m1,
-           const FullMatrix<double> &m2)
+            const FullMatrix<double> &m2)
 {
   double d = 0, s = 0;
   for (unsigned int i=0; i<m1.m(); ++i)
     for (unsigned int j=0; j<m1.n(); ++j)
       {
-       d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
-       s += m1(i,j) * m1(i,j);
+        d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
+        s += m1(i,j) * m1(i,j);
       }
   return (d<1e-8*s);
 }
 
 
 template<int dim>
-void test (const Triangulation<dim>tr)
+void test (const Triangulation<dim> &tr)
 {
   FE_DGPMonomial<dim> fe(1);
   deallog << "FE=" << fe.get_name() << std::endl;
@@ -71,14 +71,14 @@ void test (const Triangulation<dim>& tr)
   MappingCartesian<dim> mapping;
   deallog << "Mapping=Cartesian" << std::endl;
 
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (mapping, fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   FullMatrix<double> mass_matrix[2], laplace_matrix[2];
   mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
@@ -87,54 +87,54 @@ void test (const Triangulation<dim>& tr)
   laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
-                                                fe_values.shape_value (j,q) *
-                                                fe_values.JxW(q);
-             laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
-                                                   fe_values.shape_grad (j,q) *
-                                                   fe_values.JxW(q);    
-           }
+        for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
+                                                 fe_values.shape_value (j,q) *
+                                                 fe_values.JxW(q);
+              laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
+                                                    fe_values.shape_grad (j,q) *
+                                                    fe_values.JxW(q);
+            }
     }
 
-                                  // check what we expect for this mapping
-                                  // about equality or inequality of the
-                                  // matrices
+  // check what we expect for this mapping
+  // about equality or inequality of the
+  // matrices
   deallog << "Mass matrices "
-         << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
+          << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
   deallog << "Laplace matrices "
-         << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
-  
+          << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
+
   for (unsigned int cell=0; cell<2; ++cell)
     {
       deallog << "cell=" << cell << std::endl;
       deallog << "mass_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << mass_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << mass_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "laplace_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << laplace_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << laplace_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
     }
 }
 
@@ -146,8 +146,8 @@ void test()
   Triangulation<dim> tr;
   Point<dim> p1 = Point<dim>();
   Point<dim> p2 = (dim == 2 ?
-                  Point<dim>(2,1) :
-                  Point<dim>(2,1,1));
+                   Point<dim>(2,1) :
+                   Point<dim>(2,1,1));
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2);
@@ -155,11 +155,11 @@ void test()
   static const HyperBallBoundary<dim> boundary(tr.begin_active()->center());
   tr.set_boundary (1, boundary);
 
-                                  // set boundary id on cell 1
+  // set boundary id on cell 1
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (tr.begin_active()->at_boundary(f))
       tr.begin_active()->face(f)->set_boundary_indicator (1);
-  
+
   test(tr);
 }
 
index 6a328158fe577627fd8ed71370cc36695f502eb3..39818565a86f02e53b9a7852315560b2c4cef522 100644 (file)
 
 
 bool equal (const FullMatrix<double> &m1,
-           const FullMatrix<double> &m2)
+            const FullMatrix<double> &m2)
 {
   double d = 0, s = 0;
   for (unsigned int i=0; i<m1.m(); ++i)
     for (unsigned int j=0; j<m1.n(); ++j)
       {
-       d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
-       s += m1(i,j) * m1(i,j);
+        d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
+        s += m1(i,j) * m1(i,j);
       }
   return (d<1e-8*s);
 }
 
 
 template<int dim>
-void test (const Triangulation<dim>tr)
+void test (const Triangulation<dim> &tr)
 {
   FE_DGPMonomial<dim> fe(2);
   deallog << "FE=" << fe.get_name() << std::endl;
@@ -71,14 +71,14 @@ void test (const Triangulation<dim>& tr)
   MappingCartesian<dim> mapping;
   deallog << "Mapping=Cartesian" << std::endl;
 
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (mapping, fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   FullMatrix<double> mass_matrix[2], laplace_matrix[2];
   mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
@@ -87,54 +87,54 @@ void test (const Triangulation<dim>& tr)
   laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
-                                                fe_values.shape_value (j,q) *
-                                                fe_values.JxW(q);
-             laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
-                                                   fe_values.shape_grad (j,q) *
-                                                   fe_values.JxW(q);    
-           }
+        for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
+                                                 fe_values.shape_value (j,q) *
+                                                 fe_values.JxW(q);
+              laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
+                                                    fe_values.shape_grad (j,q) *
+                                                    fe_values.JxW(q);
+            }
     }
 
-                                  // check what we expect for this mapping
-                                  // about equality or inequality of the
-                                  // matrices
+  // check what we expect for this mapping
+  // about equality or inequality of the
+  // matrices
   deallog << "Mass matrices "
-         << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
+          << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
   deallog << "Laplace matrices "
-         << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
-  
+          << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
+
   for (unsigned int cell=0; cell<2; ++cell)
     {
       deallog << "cell=" << cell << std::endl;
       deallog << "mass_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << mass_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << mass_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "laplace_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << laplace_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << laplace_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
     }
 }
 
@@ -146,8 +146,8 @@ void test()
   Triangulation<dim> tr;
   Point<dim> p1 = Point<dim>();
   Point<dim> p2 = (dim == 2 ?
-                  Point<dim>(2,1) :
-                  Point<dim>(2,1,1));
+                   Point<dim>(2,1) :
+                   Point<dim>(2,1,1));
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2);
@@ -155,11 +155,11 @@ void test()
   static const HyperBallBoundary<dim> boundary(tr.begin_active()->center());
   tr.set_boundary (1, boundary);
 
-                                  // set boundary id on cell 1
+  // set boundary id on cell 1
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (tr.begin_active()->at_boundary(f))
       tr.begin_active()->face(f)->set_boundary_indicator (1);
-  
+
   test(tr);
 }
 
index f0ffd0d9ebf544d04e29574594d5b391220ce7bb..9e90c6733ae676a385728a1cbb31b0cff141f748 100644 (file)
 
 
 bool equal (const FullMatrix<double> &m1,
-           const FullMatrix<double> &m2)
+            const FullMatrix<double> &m2)
 {
   double d = 0, s = 0;
   for (unsigned int i=0; i<m1.m(); ++i)
     for (unsigned int j=0; j<m1.n(); ++j)
       {
-       d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
-       s += m1(i,j) * m1(i,j);
+        d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
+        s += m1(i,j) * m1(i,j);
       }
   return (d<1e-8*s);
 }
 
 
 template<int dim>
-void test (const Triangulation<dim>tr)
+void test (const Triangulation<dim> &tr)
 {
   FE_DGPNonparametric<dim> fe(1);
   deallog << "FE=" << fe.get_name() << std::endl;
@@ -71,14 +71,14 @@ void test (const Triangulation<dim>& tr)
   MappingQ1<dim> mapping;
   deallog << "Mapping=Q1" << std::endl;
 
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (mapping, fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   FullMatrix<double> mass_matrix[2], laplace_matrix[2];
   mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
@@ -87,54 +87,54 @@ void test (const Triangulation<dim>& tr)
   laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
-                                                fe_values.shape_value (j,q) *
-                                                fe_values.JxW(q);
-             laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
-                                                   fe_values.shape_grad (j,q) *
-                                                   fe_values.JxW(q);    
-           }
+        for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
+                                                 fe_values.shape_value (j,q) *
+                                                 fe_values.JxW(q);
+              laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
+                                                    fe_values.shape_grad (j,q) *
+                                                    fe_values.JxW(q);
+            }
     }
 
-                                  // check what we expect for this mapping
-                                  // about equality or inequality of the
-                                  // matrices
+  // check what we expect for this mapping
+  // about equality or inequality of the
+  // matrices
   deallog << "Mass matrices "
-         << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
+          << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
   deallog << "Laplace matrices "
-         << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
-  
+          << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
+
   for (unsigned int cell=0; cell<2; ++cell)
     {
       deallog << "cell=" << cell << std::endl;
       deallog << "mass_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << mass_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << mass_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "laplace_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << laplace_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << laplace_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
     }
 }
 
@@ -146,8 +146,8 @@ void test()
   Triangulation<dim> tr;
   Point<dim> p1 = Point<dim>();
   Point<dim> p2 = (dim == 2 ?
-                  Point<dim>(2,1) :
-                  Point<dim>(2,1,1));
+                   Point<dim>(2,1) :
+                   Point<dim>(2,1,1));
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2);
@@ -155,11 +155,11 @@ void test()
   static const HyperBallBoundary<dim> boundary(tr.begin_active()->center());
   tr.set_boundary (1, boundary);
 
-                                  // set boundary id on cell 1
+  // set boundary id on cell 1
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (tr.begin_active()->at_boundary(f))
       tr.begin_active()->face(f)->set_boundary_indicator (1);
-  
+
   test(tr);
 }
 
index ce26dba167f98aee041b8928ccfa3ba9a11ba84a..bc3aae1fa80a0b24ddb60102a2a0dc095a052fa1 100644 (file)
 
 
 bool equal (const FullMatrix<double> &m1,
-           const FullMatrix<double> &m2)
+            const FullMatrix<double> &m2)
 {
   double d = 0, s = 0;
   for (unsigned int i=0; i<m1.m(); ++i)
     for (unsigned int j=0; j<m1.n(); ++j)
       {
-       d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
-       s += m1(i,j) * m1(i,j);
+        d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
+        s += m1(i,j) * m1(i,j);
       }
   return (d<1e-8*s);
 }
 
 
 template<int dim>
-void test (const Triangulation<dim>tr)
+void test (const Triangulation<dim> &tr)
 {
   FE_DGPNonparametric<dim> fe(2);
   deallog << "FE=" << fe.get_name() << std::endl;
@@ -71,14 +71,14 @@ void test (const Triangulation<dim>& tr)
   MappingQ1<dim> mapping;
   deallog << "Mapping=Q1" << std::endl;
 
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (mapping, fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   FullMatrix<double> mass_matrix[2], laplace_matrix[2];
   mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
@@ -87,54 +87,54 @@ void test (const Triangulation<dim>& tr)
   laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
-                                                fe_values.shape_value (j,q) *
-                                                fe_values.JxW(q);
-             laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
-                                                   fe_values.shape_grad (j,q) *
-                                                   fe_values.JxW(q);    
-           }
+        for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
+                                                 fe_values.shape_value (j,q) *
+                                                 fe_values.JxW(q);
+              laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
+                                                    fe_values.shape_grad (j,q) *
+                                                    fe_values.JxW(q);
+            }
     }
 
-                                  // check what we expect for this mapping
-                                  // about equality or inequality of the
-                                  // matrices
+  // check what we expect for this mapping
+  // about equality or inequality of the
+  // matrices
   deallog << "Mass matrices "
-         << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
+          << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
   deallog << "Laplace matrices "
-         << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
-  
+          << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
+
   for (unsigned int cell=0; cell<2; ++cell)
     {
       deallog << "cell=" << cell << std::endl;
       deallog << "mass_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << mass_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << mass_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "laplace_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << laplace_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << laplace_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
     }
 }
 
@@ -146,8 +146,8 @@ void test()
   Triangulation<dim> tr;
   Point<dim> p1 = Point<dim>();
   Point<dim> p2 = (dim == 2 ?
-                  Point<dim>(2,1) :
-                  Point<dim>(2,1,1));
+                   Point<dim>(2,1) :
+                   Point<dim>(2,1,1));
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2);
@@ -155,11 +155,11 @@ void test()
   static const HyperBallBoundary<dim> boundary(tr.begin_active()->center());
   tr.set_boundary (1, boundary);
 
-                                  // set boundary id on cell 1
+  // set boundary id on cell 1
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (tr.begin_active()->at_boundary(f))
       tr.begin_active()->face(f)->set_boundary_indicator (1);
-  
+
   test(tr);
 }
 
index 850b6efeb7b8e82a9a3ee60d5b399a21656fed7c..5f7c2f14c645000c8320b3c101dbfe1df9b6276a 100644 (file)
 
 
 bool equal (const FullMatrix<double> &m1,
-           const FullMatrix<double> &m2)
+            const FullMatrix<double> &m2)
 {
   double d = 0, s = 0;
   for (unsigned int i=0; i<m1.m(); ++i)
     for (unsigned int j=0; j<m1.n(); ++j)
       {
-       d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
-       s += m1(i,j) * m1(i,j);
+        d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
+        s += m1(i,j) * m1(i,j);
       }
   return (d<1e-8*s);
 }
 
 
 template<int dim>
-void test (const Triangulation<dim>tr)
+void test (const Triangulation<dim> &tr)
 {
   FE_DGPNonparametric<dim> fe(1);
   deallog << "FE=" << fe.get_name() << std::endl;
@@ -71,14 +71,14 @@ void test (const Triangulation<dim>& tr)
   MappingQ<dim> mapping(1);
   deallog << "Mapping=Q1" << std::endl;
 
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (mapping, fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   FullMatrix<double> mass_matrix[2], laplace_matrix[2];
   mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
@@ -87,54 +87,54 @@ void test (const Triangulation<dim>& tr)
   laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
-                                                fe_values.shape_value (j,q) *
-                                                fe_values.JxW(q);
-             laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
-                                                   fe_values.shape_grad (j,q) *
-                                                   fe_values.JxW(q);    
-           }
+        for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
+                                                 fe_values.shape_value (j,q) *
+                                                 fe_values.JxW(q);
+              laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
+                                                    fe_values.shape_grad (j,q) *
+                                                    fe_values.JxW(q);
+            }
     }
 
-                                  // check what we expect for this mapping
-                                  // about equality or inequality of the
-                                  // matrices
+  // check what we expect for this mapping
+  // about equality or inequality of the
+  // matrices
   deallog << "Mass matrices "
-         << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
+          << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
   deallog << "Laplace matrices "
-         << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
-  
+          << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
+
   for (unsigned int cell=0; cell<2; ++cell)
     {
       deallog << "cell=" << cell << std::endl;
       deallog << "mass_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << mass_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << mass_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "laplace_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << laplace_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << laplace_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
     }
 }
 
@@ -146,8 +146,8 @@ void test()
   Triangulation<dim> tr;
   Point<dim> p1 = Point<dim>();
   Point<dim> p2 = (dim == 2 ?
-                  Point<dim>(2,1) :
-                  Point<dim>(2,1,1));
+                   Point<dim>(2,1) :
+                   Point<dim>(2,1,1));
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2);
@@ -155,11 +155,11 @@ void test()
   static const HyperBallBoundary<dim> boundary(tr.begin_active()->center());
   tr.set_boundary (1, boundary);
 
-                                  // set boundary id on cell 1
+  // set boundary id on cell 1
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (tr.begin_active()->at_boundary(f))
       tr.begin_active()->face(f)->set_boundary_indicator (1);
-  
+
   test(tr);
 }
 
index db46fe16897d7c16b89f447f6f855b83d8a956bd..96734be13dff551d0d24edf019da5b6a8201a7d1 100644 (file)
 
 
 bool equal (const FullMatrix<double> &m1,
-           const FullMatrix<double> &m2)
+            const FullMatrix<double> &m2)
 {
   double d = 0, s = 0;
   for (unsigned int i=0; i<m1.m(); ++i)
     for (unsigned int j=0; j<m1.n(); ++j)
       {
-       d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
-       s += m1(i,j) * m1(i,j);
+        d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
+        s += m1(i,j) * m1(i,j);
       }
   return (d<1e-8*s);
 }
 
 
 template<int dim>
-void test (const Triangulation<dim>tr)
+void test (const Triangulation<dim> &tr)
 {
   FE_DGPNonparametric<dim> fe(2);
   deallog << "FE=" << fe.get_name() << std::endl;
@@ -71,14 +71,14 @@ void test (const Triangulation<dim>& tr)
   MappingQ<dim> mapping(1);
   deallog << "Mapping=Q1" << std::endl;
 
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (mapping, fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   FullMatrix<double> mass_matrix[2], laplace_matrix[2];
   mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
@@ -87,54 +87,54 @@ void test (const Triangulation<dim>& tr)
   laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
-                                                fe_values.shape_value (j,q) *
-                                                fe_values.JxW(q);
-             laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
-                                                   fe_values.shape_grad (j,q) *
-                                                   fe_values.JxW(q);    
-           }
+        for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
+                                                 fe_values.shape_value (j,q) *
+                                                 fe_values.JxW(q);
+              laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
+                                                    fe_values.shape_grad (j,q) *
+                                                    fe_values.JxW(q);
+            }
     }
 
-                                  // check what we expect for this mapping
-                                  // about equality or inequality of the
-                                  // matrices
+  // check what we expect for this mapping
+  // about equality or inequality of the
+  // matrices
   deallog << "Mass matrices "
-         << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
+          << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
   deallog << "Laplace matrices "
-         << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
-  
+          << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
+
   for (unsigned int cell=0; cell<2; ++cell)
     {
       deallog << "cell=" << cell << std::endl;
       deallog << "mass_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << mass_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << mass_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "laplace_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << laplace_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << laplace_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
     }
 }
 
@@ -146,8 +146,8 @@ void test()
   Triangulation<dim> tr;
   Point<dim> p1 = Point<dim>();
   Point<dim> p2 = (dim == 2 ?
-                  Point<dim>(2,1) :
-                  Point<dim>(2,1,1));
+                   Point<dim>(2,1) :
+                   Point<dim>(2,1,1));
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2);
@@ -155,11 +155,11 @@ void test()
   static const HyperBallBoundary<dim> boundary(tr.begin_active()->center());
   tr.set_boundary (1, boundary);
 
-                                  // set boundary id on cell 1
+  // set boundary id on cell 1
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (tr.begin_active()->at_boundary(f))
       tr.begin_active()->face(f)->set_boundary_indicator (1);
-  
+
   test(tr);
 }
 
index 92e16ccadf72f83ea643b75a6c4b8bea6c6c4cbd..c55a0a1f5db3052057296a2116e015ddfbebc0fd 100644 (file)
 
 
 bool equal (const FullMatrix<double> &m1,
-           const FullMatrix<double> &m2)
+            const FullMatrix<double> &m2)
 {
   double d = 0, s = 0;
   for (unsigned int i=0; i<m1.m(); ++i)
     for (unsigned int j=0; j<m1.n(); ++j)
       {
-       d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
-       s += m1(i,j) * m1(i,j);
+        d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
+        s += m1(i,j) * m1(i,j);
       }
   return (d<1e-8*s);
 }
 
 
 template<int dim>
-void test (const Triangulation<dim>tr)
+void test (const Triangulation<dim> &tr)
 {
   FE_DGPNonparametric<dim> fe(1);
   deallog << "FE=" << fe.get_name() << std::endl;
@@ -71,14 +71,14 @@ void test (const Triangulation<dim>& tr)
   MappingQ<dim> mapping(2);
   deallog << "Mapping=Q2" << std::endl;
 
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (mapping, fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   FullMatrix<double> mass_matrix[2], laplace_matrix[2];
   mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
@@ -87,54 +87,54 @@ void test (const Triangulation<dim>& tr)
   laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
-                                                fe_values.shape_value (j,q) *
-                                                fe_values.JxW(q);
-             laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
-                                                   fe_values.shape_grad (j,q) *
-                                                   fe_values.JxW(q);    
-           }
+        for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
+                                                 fe_values.shape_value (j,q) *
+                                                 fe_values.JxW(q);
+              laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
+                                                    fe_values.shape_grad (j,q) *
+                                                    fe_values.JxW(q);
+            }
     }
 
-                                  // check what we expect for this mapping
-                                  // about equality or inequality of the
-                                  // matrices
+  // check what we expect for this mapping
+  // about equality or inequality of the
+  // matrices
   deallog << "Mass matrices "
-         << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
+          << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
   deallog << "Laplace matrices "
-         << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
-  
+          << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
+
   for (unsigned int cell=0; cell<2; ++cell)
     {
       deallog << "cell=" << cell << std::endl;
       deallog << "mass_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << mass_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << mass_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "laplace_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << laplace_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << laplace_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
     }
 }
 
@@ -146,8 +146,8 @@ void test()
   Triangulation<dim> tr;
   Point<dim> p1 = Point<dim>();
   Point<dim> p2 = (dim == 2 ?
-                  Point<dim>(2,1) :
-                  Point<dim>(2,1,1));
+                   Point<dim>(2,1) :
+                   Point<dim>(2,1,1));
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2);
@@ -155,11 +155,11 @@ void test()
   static const HyperBallBoundary<dim> boundary(tr.begin_active()->center());
   tr.set_boundary (1, boundary);
 
-                                  // set boundary id on cell 1
+  // set boundary id on cell 1
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (tr.begin_active()->at_boundary(f))
       tr.begin_active()->face(f)->set_boundary_indicator (1);
-  
+
   test(tr);
 }
 
index 17474fd00332a63a675032754746b18c366ce492..c0e6d25370380bb80c0d482bda196c0f73b17f16 100644 (file)
 
 
 bool equal (const FullMatrix<double> &m1,
-           const FullMatrix<double> &m2)
+            const FullMatrix<double> &m2)
 {
   double d = 0, s = 0;
   for (unsigned int i=0; i<m1.m(); ++i)
     for (unsigned int j=0; j<m1.n(); ++j)
       {
-       d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
-       s += m1(i,j) * m1(i,j);
+        d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
+        s += m1(i,j) * m1(i,j);
       }
   return (d<1e-8*s);
 }
 
 
 template<int dim>
-void test (const Triangulation<dim>tr)
+void test (const Triangulation<dim> &tr)
 {
   FE_DGPNonparametric<dim> fe(2);
   deallog << "FE=" << fe.get_name() << std::endl;
@@ -71,14 +71,14 @@ void test (const Triangulation<dim>& tr)
   MappingQ<dim> mapping(2);
   deallog << "Mapping=Q2" << std::endl;
 
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (mapping, fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   FullMatrix<double> mass_matrix[2], laplace_matrix[2];
   mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
@@ -87,54 +87,54 @@ void test (const Triangulation<dim>& tr)
   laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
-                                                fe_values.shape_value (j,q) *
-                                                fe_values.JxW(q);
-             laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
-                                                   fe_values.shape_grad (j,q) *
-                                                   fe_values.JxW(q);    
-           }
+        for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
+                                                 fe_values.shape_value (j,q) *
+                                                 fe_values.JxW(q);
+              laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
+                                                    fe_values.shape_grad (j,q) *
+                                                    fe_values.JxW(q);
+            }
     }
 
-                                  // check what we expect for this mapping
-                                  // about equality or inequality of the
-                                  // matrices
+  // check what we expect for this mapping
+  // about equality or inequality of the
+  // matrices
   deallog << "Mass matrices "
-         << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
+          << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
   deallog << "Laplace matrices "
-         << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
-  
+          << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
+
   for (unsigned int cell=0; cell<2; ++cell)
     {
       deallog << "cell=" << cell << std::endl;
       deallog << "mass_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << mass_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << mass_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "laplace_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << laplace_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << laplace_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
     }
 }
 
@@ -146,8 +146,8 @@ void test()
   Triangulation<dim> tr;
   Point<dim> p1 = Point<dim>();
   Point<dim> p2 = (dim == 2 ?
-                  Point<dim>(2,1) :
-                  Point<dim>(2,1,1));
+                   Point<dim>(2,1) :
+                   Point<dim>(2,1,1));
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2);
@@ -155,11 +155,11 @@ void test()
   static const HyperBallBoundary<dim> boundary(tr.begin_active()->center());
   tr.set_boundary (1, boundary);
 
-                                  // set boundary id on cell 1
+  // set boundary id on cell 1
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (tr.begin_active()->at_boundary(f))
       tr.begin_active()->face(f)->set_boundary_indicator (1);
-  
+
   test(tr);
 }
 
index 04fa5cf230af936223cbaf4290fc58520131bab8..05cec04d6794c000363be609115bba0132877443 100644 (file)
 
 
 bool equal (const FullMatrix<double> &m1,
-           const FullMatrix<double> &m2)
+            const FullMatrix<double> &m2)
 {
   double d = 0, s = 0;
   for (unsigned int i=0; i<m1.m(); ++i)
     for (unsigned int j=0; j<m1.n(); ++j)
       {
-       d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
-       s += m1(i,j) * m1(i,j);
+        d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
+        s += m1(i,j) * m1(i,j);
       }
   return (d<1e-8*s);
 }
 
 
 template<int dim>
-void test (const Triangulation<dim>tr)
+void test (const Triangulation<dim> &tr)
 {
   FE_DGPNonparametric<dim> fe(1);
   deallog << "FE=" << fe.get_name() << std::endl;
@@ -71,14 +71,14 @@ void test (const Triangulation<dim>& tr)
   MappingC1<dim> mapping;
   deallog << "Mapping=C1" << std::endl;
 
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (mapping, fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   FullMatrix<double> mass_matrix[2], laplace_matrix[2];
   mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
@@ -87,54 +87,54 @@ void test (const Triangulation<dim>& tr)
   laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
-                                                fe_values.shape_value (j,q) *
-                                                fe_values.JxW(q);
-             laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
-                                                   fe_values.shape_grad (j,q) *
-                                                   fe_values.JxW(q);    
-           }
+        for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
+                                                 fe_values.shape_value (j,q) *
+                                                 fe_values.JxW(q);
+              laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
+                                                    fe_values.shape_grad (j,q) *
+                                                    fe_values.JxW(q);
+            }
     }
 
-                                  // check what we expect for this mapping
-                                  // about equality or inequality of the
-                                  // matrices
+  // check what we expect for this mapping
+  // about equality or inequality of the
+  // matrices
   deallog << "Mass matrices "
-         << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
+          << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
   deallog << "Laplace matrices "
-         << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
-  
+          << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
+
   for (unsigned int cell=0; cell<2; ++cell)
     {
       deallog << "cell=" << cell << std::endl;
       deallog << "mass_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << mass_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << mass_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "laplace_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << laplace_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << laplace_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
     }
 }
 
@@ -146,8 +146,8 @@ void test()
   Triangulation<dim> tr;
   Point<dim> p1 = Point<dim>();
   Point<dim> p2 = (dim == 2 ?
-                  Point<dim>(2,1) :
-                  Point<dim>(2,1,1));
+                   Point<dim>(2,1) :
+                   Point<dim>(2,1,1));
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2);
@@ -155,11 +155,11 @@ void test()
   static const HyperBallBoundary<dim> boundary(tr.begin_active()->center());
   tr.set_boundary (1, boundary);
 
-                                  // set boundary id on cell 1
+  // set boundary id on cell 1
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (tr.begin_active()->at_boundary(f))
       tr.begin_active()->face(f)->set_boundary_indicator (1);
-  
+
   test(tr);
 }
 
index 80149ac399bfb6b8739bd587ef1f2ca83ea7b55e..9d16a82d83b9a22308c9f79bb3450327c5b6b75a 100644 (file)
 
 
 bool equal (const FullMatrix<double> &m1,
-           const FullMatrix<double> &m2)
+            const FullMatrix<double> &m2)
 {
   double d = 0, s = 0;
   for (unsigned int i=0; i<m1.m(); ++i)
     for (unsigned int j=0; j<m1.n(); ++j)
       {
-       d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
-       s += m1(i,j) * m1(i,j);
+        d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
+        s += m1(i,j) * m1(i,j);
       }
   return (d<1e-8*s);
 }
 
 
 template<int dim>
-void test (const Triangulation<dim>tr)
+void test (const Triangulation<dim> &tr)
 {
   FE_DGPNonparametric<dim> fe(2);
   deallog << "FE=" << fe.get_name() << std::endl;
@@ -71,14 +71,14 @@ void test (const Triangulation<dim>& tr)
   MappingC1<dim> mapping;
   deallog << "Mapping=C1" << std::endl;
 
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (mapping, fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   FullMatrix<double> mass_matrix[2], laplace_matrix[2];
   mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
@@ -87,54 +87,54 @@ void test (const Triangulation<dim>& tr)
   laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
-                                                fe_values.shape_value (j,q) *
-                                                fe_values.JxW(q);
-             laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
-                                                   fe_values.shape_grad (j,q) *
-                                                   fe_values.JxW(q);    
-           }
+        for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
+                                                 fe_values.shape_value (j,q) *
+                                                 fe_values.JxW(q);
+              laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
+                                                    fe_values.shape_grad (j,q) *
+                                                    fe_values.JxW(q);
+            }
     }
 
-                                  // check what we expect for this mapping
-                                  // about equality or inequality of the
-                                  // matrices
+  // check what we expect for this mapping
+  // about equality or inequality of the
+  // matrices
   deallog << "Mass matrices "
-         << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
+          << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
   deallog << "Laplace matrices "
-         << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
-  
+          << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
+
   for (unsigned int cell=0; cell<2; ++cell)
     {
       deallog << "cell=" << cell << std::endl;
       deallog << "mass_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << mass_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << mass_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "laplace_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << laplace_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << laplace_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
     }
 }
 
@@ -146,8 +146,8 @@ void test()
   Triangulation<dim> tr;
   Point<dim> p1 = Point<dim>();
   Point<dim> p2 = (dim == 2 ?
-                  Point<dim>(2,1) :
-                  Point<dim>(2,1,1));
+                   Point<dim>(2,1) :
+                   Point<dim>(2,1,1));
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2);
@@ -155,11 +155,11 @@ void test()
   static const HyperBallBoundary<dim> boundary(tr.begin_active()->center());
   tr.set_boundary (1, boundary);
 
-                                  // set boundary id on cell 1
+  // set boundary id on cell 1
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (tr.begin_active()->at_boundary(f))
       tr.begin_active()->face(f)->set_boundary_indicator (1);
-  
+
   test(tr);
 }
 
index dcb82f7c88830b485857c4b153aa27c6364b14f7..1514a169432c631c624a3a49253840619bbccd1a 100644 (file)
 
 
 bool equal (const FullMatrix<double> &m1,
-           const FullMatrix<double> &m2)
+            const FullMatrix<double> &m2)
 {
   double d = 0, s = 0;
   for (unsigned int i=0; i<m1.m(); ++i)
     for (unsigned int j=0; j<m1.n(); ++j)
       {
-       d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
-       s += m1(i,j) * m1(i,j);
+        d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
+        s += m1(i,j) * m1(i,j);
       }
   return (d<1e-8*s);
 }
 
 
 template<int dim>
-void test (const Triangulation<dim>tr)
+void test (const Triangulation<dim> &tr)
 {
   FE_DGPNonparametric<dim> fe(1);
   deallog << "FE=" << fe.get_name() << std::endl;
@@ -71,14 +71,14 @@ void test (const Triangulation<dim>& tr)
   MappingCartesian<dim> mapping;
   deallog << "Mapping=Cartesian" << std::endl;
 
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (mapping, fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   FullMatrix<double> mass_matrix[2], laplace_matrix[2];
   mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
@@ -87,54 +87,54 @@ void test (const Triangulation<dim>& tr)
   laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
-                                                fe_values.shape_value (j,q) *
-                                                fe_values.JxW(q);
-             laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
-                                                   fe_values.shape_grad (j,q) *
-                                                   fe_values.JxW(q);    
-           }
+        for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
+                                                 fe_values.shape_value (j,q) *
+                                                 fe_values.JxW(q);
+              laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
+                                                    fe_values.shape_grad (j,q) *
+                                                    fe_values.JxW(q);
+            }
     }
 
-                                  // check what we expect for this mapping
-                                  // about equality or inequality of the
-                                  // matrices
+  // check what we expect for this mapping
+  // about equality or inequality of the
+  // matrices
   deallog << "Mass matrices "
-         << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
+          << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
   deallog << "Laplace matrices "
-         << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
-  
+          << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
+
   for (unsigned int cell=0; cell<2; ++cell)
     {
       deallog << "cell=" << cell << std::endl;
       deallog << "mass_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << mass_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << mass_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "laplace_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << laplace_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << laplace_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
     }
 }
 
@@ -146,8 +146,8 @@ void test()
   Triangulation<dim> tr;
   Point<dim> p1 = Point<dim>();
   Point<dim> p2 = (dim == 2 ?
-                  Point<dim>(2,1) :
-                  Point<dim>(2,1,1));
+                   Point<dim>(2,1) :
+                   Point<dim>(2,1,1));
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2);
@@ -155,11 +155,11 @@ void test()
   static const HyperBallBoundary<dim> boundary(tr.begin_active()->center());
   tr.set_boundary (1, boundary);
 
-                                  // set boundary id on cell 1
+  // set boundary id on cell 1
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (tr.begin_active()->at_boundary(f))
       tr.begin_active()->face(f)->set_boundary_indicator (1);
-  
+
   test(tr);
 }
 
index 97601d1e4359198109592bb2d326f2b0b1209a88..6d9fa7b21fc2f66747b60ca236b61517358e6f62 100644 (file)
 
 
 bool equal (const FullMatrix<double> &m1,
-           const FullMatrix<double> &m2)
+            const FullMatrix<double> &m2)
 {
   double d = 0, s = 0;
   for (unsigned int i=0; i<m1.m(); ++i)
     for (unsigned int j=0; j<m1.n(); ++j)
       {
-       d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
-       s += m1(i,j) * m1(i,j);
+        d += (m1(i,j)-m2(i,j)) * (m1(i,j)-m2(i,j));
+        s += m1(i,j) * m1(i,j);
       }
   return (d<1e-8*s);
 }
 
 
 template<int dim>
-void test (const Triangulation<dim>tr)
+void test (const Triangulation<dim> &tr)
 {
   FE_DGPNonparametric<dim> fe(2);
   deallog << "FE=" << fe.get_name() << std::endl;
@@ -71,14 +71,14 @@ void test (const Triangulation<dim>& tr)
   MappingCartesian<dim> mapping;
   deallog << "Mapping=Cartesian" << std::endl;
 
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
   const QGauss<dim> quadrature(2);
   FEValues<dim> fe_values (mapping, fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   FullMatrix<double> mass_matrix[2], laplace_matrix[2];
   mass_matrix[0].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
@@ -87,54 +87,54 @@ void test (const Triangulation<dim>& tr)
   laplace_matrix[1].reinit(fe.dofs_per_cell, fe.dofs_per_cell);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     {
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-         for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-           {
-             mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
-                                                fe_values.shape_value (j,q) *
-                                                fe_values.JxW(q);
-             laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
-                                                   fe_values.shape_grad (j,q) *
-                                                   fe_values.JxW(q);    
-           }
+        for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+          for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+            {
+              mass_matrix[cell->index()](i,j) += fe_values.shape_value (i,q) *
+                                                 fe_values.shape_value (j,q) *
+                                                 fe_values.JxW(q);
+              laplace_matrix[cell->index()](i,j) += fe_values.shape_grad (i,q) *
+                                                    fe_values.shape_grad (j,q) *
+                                                    fe_values.JxW(q);
+            }
     }
 
-                                  // check what we expect for this mapping
-                                  // about equality or inequality of the
-                                  // matrices
+  // check what we expect for this mapping
+  // about equality or inequality of the
+  // matrices
   deallog << "Mass matrices "
-         << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
+          << (equal (mass_matrix[0], mass_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
   deallog << "Laplace matrices "
-         << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
-         << " equal."
-         << std::endl;
-  
+          << (equal (laplace_matrix[0], laplace_matrix[1]) ? "are" : "are not")
+          << " equal."
+          << std::endl;
+
   for (unsigned int cell=0; cell<2; ++cell)
     {
       deallog << "cell=" << cell << std::endl;
       deallog << "mass_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << mass_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << mass_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "laplace_matrix:" << std::endl;
       for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
-           deallog << laplace_matrix[cell](i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
+            deallog << laplace_matrix[cell](i,j) << ' ';
+          deallog << std::endl;
+        }
     }
 }
 
@@ -146,8 +146,8 @@ void test()
   Triangulation<dim> tr;
   Point<dim> p1 = Point<dim>();
   Point<dim> p2 = (dim == 2 ?
-                  Point<dim>(2,1) :
-                  Point<dim>(2,1,1));
+                   Point<dim>(2,1) :
+                   Point<dim>(2,1,1));
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2);
@@ -155,11 +155,11 @@ void test()
   static const HyperBallBoundary<dim> boundary(tr.begin_active()->center());
   tr.set_boundary (1, boundary);
 
-                                  // set boundary id on cell 1
+  // set boundary id on cell 1
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     if (tr.begin_active()->at_boundary(f))
       tr.begin_active()->face(f)->set_boundary_indicator (1);
-  
+
   test(tr);
 }
 
index 45af2f5ab3e781d1721b000c3669690ef5a825da..ff87aacf575c9f76aa61ec0e679d1f0e40aeb97e 100644 (file)
@@ -40,16 +40,16 @@ const double delta_x = 1e-8;
 
 template <int dim>
 void test (const FiniteElement<dim> &fe,
-           const Quadrature<dim>    &quadrature) 
+           const Quadrature<dim>    &quadrature)
 {
   deallog << fe.get_name() << ' ' << fe.dofs_per_cell << ' ';
-  
+
   for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
     for (unsigned int q=0; q<quadrature.size(); ++q)
       for (unsigned int c=0; c<fe.n_components(); ++c)
         {
           const Point<dim> point = quadrature.point(q);
-          
+
           const Tensor<1,dim> gradient
             = fe.shape_grad_component (i, point, c);
 
@@ -89,7 +89,7 @@ void check (const unsigned int min_degree,
 
 template <template <int> class FE>
 void check1 (const unsigned int min_degree,
-            const unsigned int max_degree)
+             const unsigned int max_degree)
 {
   for (unsigned int degree=min_degree; degree<=max_degree; ++degree)
     {
@@ -106,7 +106,7 @@ void check1 (const unsigned int min_degree,
 // Nedelec exists only in 2d/3d
 template <>
 void check1<FE_Nedelec> (const unsigned int min_degree,
-                        const unsigned int max_degree)
+                         const unsigned int max_degree)
 {
   for (unsigned int degree=min_degree; degree<=max_degree; ++degree)
     {
@@ -120,7 +120,7 @@ void check1<FE_Nedelec> (const unsigned int min_degree,
 // former is also not implemented in 3d
 template <>
 void check1<FE_RaviartThomas> (const unsigned int min_degree,
-                             const unsigned int max_degree)
+                               const unsigned int max_degree)
 {
   for (unsigned int degree=min_degree; degree<=max_degree; ++degree)
     {
@@ -130,7 +130,7 @@ void check1<FE_RaviartThomas> (const unsigned int min_degree,
 
 template <>
 void check1<FE_RaviartThomasNodal> (const unsigned int min_degree,
-                                   const unsigned int max_degree)
+                                    const unsigned int max_degree)
 {
   for (unsigned int degree=min_degree; degree<=max_degree; ++degree)
     {
@@ -146,7 +146,7 @@ main()
 {
   std::ofstream logfile ("check_derivatives/output");
   deallog << std::setprecision(2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
 
@@ -160,7 +160,7 @@ main()
   check1<FE_Nedelec> (0,1);
   check1<FE_RaviartThomas> (0,4);
   check1<FE_RaviartThomasNodal> (0,2);
-  
+
   return 0;
 }
 
index 53b92f63f382ba7b7ff17325fce729472f983fd1..a840c07cb04e7c135f48de44af91f86bdcb412b4 100644 (file)
@@ -38,11 +38,11 @@ void test ()
 
   ComponentMask m(v);
 
-                                  // verify equality
+  // verify equality
   for (unsigned int i=0; i<v.size(); ++i)
     Assert (m[i] == v[i], ExcInternalError());
 
-                                  // this needs to throw an exception
+  // this needs to throw an exception
   try
     {
       m[v.size()];
index 098e06d483e5e0f8ea3e1cf2393e468d40e12b51..cf7698512ea57ba06baa35a13d6739533942b1cd 100644 (file)
@@ -36,7 +36,7 @@ void test ()
   std::vector<bool> v(12, false);
   ComponentMask     m(12, false);
 
-                                  // verify equality
+  // verify equality
   for (unsigned int i=0; i<v.size(); ++i)
     Assert (m[i] == v[i], ExcInternalError());
 
index 0c650ce2d5aa95bb8ba789d4ae6e83385c3c501c..4bf8d7cfa0d121941bf195f7e3102ffd0133bcdc 100644 (file)
 
 void test ()
 {
-                                  // test for an initialized mask
+  // test for an initialized mask
   Assert (ComponentMask(12,false).represents_n_components(12) == true,
-         ExcInternalError());
+          ExcInternalError());
   Assert (ComponentMask(12,false).represents_n_components(13) == false,
-         ExcInternalError());
-                                  // test for an empty mask
+          ExcInternalError());
+  // test for an empty mask
   Assert (ComponentMask().represents_n_components(12) == true,
-         ExcInternalError());
+          ExcInternalError());
   Assert (ComponentMask().represents_n_components(13) == true,
-         ExcInternalError());
+          ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
index 7fa87e12c088dd580bb0b732f626d33b3894727a..f485bc1fb56aad63436bc3e51bde40a42b950dda 100644 (file)
 
 void test ()
 {
-                                  // test for an initialized mask
+  // test for an initialized mask
   Assert (ComponentMask(12,true).n_selected_components() == 12,
-         ExcInternalError());
+          ExcInternalError());
   Assert (ComponentMask(12,true).n_selected_components(12) == 12,
-         ExcInternalError());
-                                  // test for an empty mask
+          ExcInternalError());
+  // test for an empty mask
   Assert (ComponentMask().n_selected_components(12) == 12,
-         ExcInternalError());
+          ExcInternalError());
   Assert (ComponentMask().n_selected_components(13) == 13,
-         ExcInternalError());
+          ExcInternalError());
 
 
   deallog << "OK" << std::endl;
 
-                                  // this now must throw an exception,
-                                  // though:
-  try 
+  // this now must throw an exception,
+  // though:
+  try
     {
       Assert (ComponentMask(12,true).n_selected_components(13) == 12,
-             ExcInternalError());
+              ExcInternalError());
     }
   catch (ExceptionBase &e)
     {
       deallog << e.get_exc_name() << std::endl;
     }
-  
+
 }
 
 
index 107d2a9a3b9fb8fec9ca01cc28fa44ebe7ae5324..f3c522dc02b27d66f0f9f292b6499c134d5735b8 100644 (file)
@@ -37,33 +37,33 @@ void test ()
 
   ComponentMask m(v);
 
-                                  // test for an initialized mask
+  // test for an initialized mask
   Assert (m.first_selected_component() == 3,
-         ExcInternalError());
+          ExcInternalError());
   Assert (ComponentMask(12,true).first_selected_component() == 0,
-         ExcInternalError());
-                                  // test for an empty mask
+          ExcInternalError());
+  // test for an empty mask
   Assert (ComponentMask().first_selected_component(12) == 0,
-         ExcInternalError());
+          ExcInternalError());
 
   deallog << "OK" << std::endl;
 
-                                  // the following should yield an exception:
-  try 
+  // the following should yield an exception:
+  try
     {
       Assert (ComponentMask(12,true).first_selected_component(13) == 0,
-             ExcInternalError());
+              ExcInternalError());
     }
   catch (ExceptionBase &e)
     {
       deallog << e.get_exc_name() << std::endl;
     }
-  
-                                  // as should this:
+
+  // as should this:
   try
     {
       Assert (ComponentMask(12,false).first_selected_component() == 0,
-             ExcInternalError());
+              ExcInternalError());
     }
   catch (ExceptionBase &e)
     {
index 4d01eabcb7d0733c7163d2ba725c0800ba9ea5c8..7f743d48d278ed38261cbba4842bc9c4e3ef70bd 100644 (file)
 
 void test ()
 {
-                                  // test for an initialized mask
+  // test for an initialized mask
   Assert (ComponentMask(12,false).represents_the_all_selected_mask() == false,
-         ExcInternalError());
-                                  // note the semantics of the following as
-                                  // described in the documentation
+          ExcInternalError());
+  // note the semantics of the following as
+  // described in the documentation
   Assert (ComponentMask(12,true).represents_the_all_selected_mask() == false,
-         ExcInternalError());
-                                  // test for an empty mask
+          ExcInternalError());
+  // test for an empty mask
   Assert (ComponentMask().represents_the_all_selected_mask() == true,
-         ExcInternalError());
+          ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
index 9ace11c10ced862256ed12bf1f19616f4fe322ad..2908f7c56b26d3221459ae754f443b68c1003b5f 100644 (file)
@@ -43,7 +43,7 @@ void test ()
   ComponentMask m2(v2);
   ComponentMask m = m1 | m2;
 
-                                  // verify equality
+  // verify equality
   for (unsigned int i=0; i<v1.size(); ++i)
     Assert (m[i] == (v1[i] || v2[i]), ExcInternalError());
 
index ce2687734c965c63b84e2a116a8c18e9324519ac..c2d26947c812c83c2babd1695dff5ba1f99a0f96 100644 (file)
@@ -43,7 +43,7 @@ void test ()
   ComponentMask m2(v2);
   ComponentMask m = m1 & m2;
 
-                                  // verify equality
+  // verify equality
   for (unsigned int i=0; i<v1.size(); ++i)
     Assert (m[i] == (v1[i] && v2[i]), ExcInternalError());
 
index 79ad868e7b859094c5af034fc8d1b96c8a748d12..16dc67dd004948c5d7f2b543785a278811013801 100644 (file)
@@ -47,15 +47,15 @@ void test ()
   ComponentMask m2(v2);
   ComponentMask m = m1 | m2;
 
-                                  // verify equality
+  // verify equality
   Assert (m == ComponentMask(v),
-         ExcInternalError());
+          ExcInternalError());
   Assert (!(m == m1),
-         ExcInternalError());
+          ExcInternalError());
   Assert (!(m == ComponentMask(v1)),
-         ExcInternalError());
+          ExcInternalError());
   Assert (!(m == ComponentMask(v2)),
-         ExcInternalError());
+          ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
index 3ab4502048d266b8665c0e143f75920abaf149b9..fb964e24e367c0b26846148ca1a6f8518a1af8e1 100644 (file)
 
 void test ()
 {
-                                  // the following element has as
-                                  // many components as blocks so
-                                  // that any component mask we come
-                                  // up with should also produce a
-                                  // valid block mask (in fact, it
-                                  // should be exactly the same mask)
+  // the following element has as
+  // many components as blocks so
+  // that any component mask we come
+  // up with should also produce a
+  // valid block mask (in fact, it
+  // should be exactly the same mask)
   FESystem<2> fe (FE_Q<2>(1), 5);
 
-                                  // try all possible component
-                                  // masks, which we encode as bit
-                                  // strings
+  // try all possible component
+  // masks, which we encode as bit
+  // strings
   for (unsigned int int_mask=0; int_mask<(1U<<fe.n_components()); ++int_mask)
-  {
-    std::vector<bool> component_mask (fe.n_components());
-    for (unsigned int c=0; c<fe.n_components(); ++c)
-      component_mask[c] = (int_mask & (1<<c));
-
-                                    // make sure that the round-trip works
-    Assert (ComponentMask(component_mask) == fe.component_mask(fe.block_mask(ComponentMask(component_mask))),
-           ExcInternalError());
-
-                                    // then compare elementwise with
-                                    // the block mask (where there is
-                                    // no direct comparison operator,
-                                    // but they should be the same
-                                    // because each component of the
-                                    // element corresponds to a
-                                    // block)
-    for (unsigned int c=0; c<fe.n_components(); ++c)
-      Assert (component_mask[c] == fe.block_mask(component_mask)[c],
-             ExcInternalError());
-  }
+    {
+      std::vector<bool> component_mask (fe.n_components());
+      for (unsigned int c=0; c<fe.n_components(); ++c)
+        component_mask[c] = (int_mask & (1<<c));
+
+      // make sure that the round-trip works
+      Assert (ComponentMask(component_mask) == fe.component_mask(fe.block_mask(ComponentMask(component_mask))),
+              ExcInternalError());
+
+      // then compare elementwise with
+      // the block mask (where there is
+      // no direct comparison operator,
+      // but they should be the same
+      // because each component of the
+      // element corresponds to a
+      // block)
+      for (unsigned int c=0; c<fe.n_components(); ++c)
+        Assert (component_mask[c] == fe.block_mask(component_mask)[c],
+                ExcInternalError());
+    }
 
   deallog << "OK" << std::endl;
 }
index 3116df83a37c1796a07ee83e133014a9a804fbc5..2e2f77439c422603b3dd8e3a561a747c640fe810 100644 (file)
 
 void test ()
 {
-                                  // the following element has more
-                                  // components than blocks
+  // the following element has more
+  // components than blocks
   FESystem<2> fe (FE_RaviartThomas<2>(1), 3);
 
-                                  // try all possible block
-                                  // masks, which we encode as bit
-                                  // strings
+  // try all possible block
+  // masks, which we encode as bit
+  // strings
   for (unsigned int int_mask=0; int_mask<(1U<<fe.n_blocks()); ++int_mask)
-  {
-    std::vector<bool> block_mask (fe.n_blocks());
-    for (unsigned int c=0; c<fe.n_blocks(); ++c)
-      block_mask[c] = (int_mask & (1<<c));
-
-                                    // make sure that the round-trip works
-    Assert (BlockMask(block_mask) == fe.block_mask(fe.component_mask(BlockMask(block_mask))),
-           ExcInternalError());
-  }
+    {
+      std::vector<bool> block_mask (fe.n_blocks());
+      for (unsigned int c=0; c<fe.n_blocks(); ++c)
+        block_mask[c] = (int_mask & (1<<c));
+
+      // make sure that the round-trip works
+      Assert (BlockMask(block_mask) == fe.block_mask(fe.component_mask(BlockMask(block_mask))),
+              ExcInternalError());
+    }
 
   deallog << "OK" << std::endl;
 }
index 7fd3b87e01269c311b8f04c3c6578af6c88c761b..a2117589f3a1a4968ad0ff07def4f267fbdefd8a 100644 (file)
 
 void test ()
 {
-                                  // the following element has more
-                                  // components than blocks
+  // the following element has more
+  // components than blocks
   FESystem<2> fe (FE_RaviartThomas<2>(1), 2);
 
-                                  // try all possible component
-                                  // masks, which we encode as bit
-                                  // strings
+  // try all possible component
+  // masks, which we encode as bit
+  // strings
   for (unsigned int int_mask=0; int_mask<(1U<<fe.n_components()); ++int_mask)
-  {
-    std::vector<bool> component_mask (fe.n_components());
-    for (unsigned int c=0; c<fe.n_components(); ++c)
-      component_mask[c] = (int_mask & (1<<c));
-
-                                    // now try to convert to a block
-                                    // mask. this should not always
-                                    // work
-    try
-      {
-       deallog << fe.block_mask (component_mask) << std::endl;
-      }
-    catch (ExceptionBase &e)
-      {
-        deallog << e.get_exc_name() << std::endl;
-      }
-  }
+    {
+      std::vector<bool> component_mask (fe.n_components());
+      for (unsigned int c=0; c<fe.n_components(); ++c)
+        component_mask[c] = (int_mask & (1<<c));
+
+      // now try to convert to a block
+      // mask. this should not always
+      // work
+      try
+        {
+          deallog << fe.block_mask (component_mask) << std::endl;
+        }
+      catch (ExceptionBase &e)
+        {
+          deallog << e.get_exc_name() << std::endl;
+        }
+    }
 
   deallog << "OK" << std::endl;
 }
index 9bc996d5cf282af369775019755038146ab49735..fed37bb30bd89614ece525096ddfad58874f9317 100644 (file)
@@ -37,8 +37,8 @@ void
 test(const unsigned int degree)
 {
   deallog << "FE_Q<" << dim << "> (" << degree << ")"
-         << std::endl;
-  
+          << std::endl;
+
   FE_Q<dim> fe_q(degree);
   FE_Q<dim> x(fe_q);
 }
@@ -49,14 +49,14 @@ main()
 {
   std::ofstream logfile ("copy_01/output");
   deallog << std::setprecision(PRECISION);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-                                   // no constraints in 1d, but we had
-                                   // the matrices precomputed up to
-                                   // Q4 for 2d and Q2 for 3d
+  // no constraints in 1d, but we had
+  // the matrices precomputed up to
+  // Q4 for 2d and Q2 for 3d
   for (unsigned int degree=1; degree<=4; ++degree)
     test<2>(degree);
 
index 846d7bdfd62a67d123d2f5e4ad984cf47506ea77..2b0cb64331182d3b856310a82b42afbbad7a79df 100644 (file)
@@ -64,26 +64,26 @@ void test();
 template <int dim>
 class TestMap1 : public Function<dim>
 {
-  public:
-    TestMap1 (const unsigned int n_components) :
-                   Function<dim> (n_components)
-      {}
+public:
+  TestMap1 (const unsigned int n_components) :
+    Function<dim> (n_components)
+  {}
 
-    virtual ~TestMap1 () {}
+  virtual ~TestMap1 () {}
 
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
 
-    void vector_value (const Point<dim> &p,
-                      Vector<double>   &return_value) const;
+  void vector_value (const Point<dim> &p,
+                     Vector<double>   &return_value) const;
 };
 
 
 
 template <int dim>
 double
-TestMap1<dim>::value (const Point<dim>   &,
-                     const unsigned int  ) const
+TestMap1<dim>::value (const Point<dim> &,
+                      const unsigned int  ) const
 {
   return (1.0);
 }
@@ -91,12 +91,12 @@ TestMap1<dim>::value (const Point<dim>   &,
 
 template <int dim>
 void TestMap1<dim>::vector_value (const Point<dim> &p,
-                                 Vector<double>   &return_value) const
+                                  Vector<double>   &return_value) const
 {
   Assert (return_value.size() == this->n_components,
-         ExcDimensionMismatch (return_value.size(), this->n_components));
+          ExcDimensionMismatch (return_value.size(), this->n_components));
 
-                                  // Parabolic inflow profile
+  // Parabolic inflow profile
   for (unsigned int iCount = 0; iCount < this->n_components; iCount++)
     return_value (iCount) = value (p, iCount);
 }
@@ -107,27 +107,27 @@ void TestMap1<dim>::vector_value (const Point<dim> &p,
  */
 
 void EvaluateDerivative (DoFHandler<2> *dof_handler,
-                        Vector<double> &solution)
+                         Vector<double> &solution)
 {
-                                  // This quadrature rule determines the points, where the
-                                  // derivative will be evaluated.
+  // This quadrature rule determines the points, where the
+  // derivative will be evaluated.
   QGauss<2> quad (3);
   FEValues<2> fe_values (dof_handler->get_fe (), quad,
-                        UpdateFlags(update_values    |
-                                    update_q_points  |
-                                    update_gradients |
-                                    update_JxW_values));
+                         UpdateFlags(update_values    |
+                                     update_q_points  |
+                                     update_gradients |
+                                     update_JxW_values));
 
   const unsigned int   n_q_points    = quad.size();
   const unsigned int   n_components   = dof_handler->get_fe().n_components();
   const unsigned int dofs_per_cell = dof_handler->get_fe().dofs_per_cell;
 
-                                  // Cell iterators
+  // Cell iterators
   DoFHandler<2>::active_cell_iterator cell = dof_handler->begin_active(),
-                                     endc = dof_handler->end();
+                                      endc = dof_handler->end();
 
   double err_l2 = 0,
-       err_hdiv = 0;
+         err_hdiv = 0;
 
   std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
@@ -137,60 +137,60 @@ void EvaluateDerivative (DoFHandler<2> *dof_handler,
 
       fe_values.reinit (cell);
 
-                                      // Get function values
+      // Get function values
       std::vector<Vector<double> > this_value(n_q_points,
-                                             Vector<double>(n_components));
+                                              Vector<double>(n_components));
       fe_values.get_function_values (solution, this_value);
 
-                                      // Get values from solution vector (For Trap.Rule)
+      // Get values from solution vector (For Trap.Rule)
       std::vector<std::vector<Tensor<1,2> > >
-       grads_here (n_q_points, std::vector<Tensor<1,2> > (n_components));
+      grads_here (n_q_points, std::vector<Tensor<1,2> > (n_components));
       fe_values.get_function_grads (solution, grads_here);
 
       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-       {
-                                          //     double u0 = this_value[q_point](0);
-                                          //double v0 = this_value[q_point](1);
-
-         double u0 = 0;
-         double v0 = 0;
-         for (unsigned int i = 0; i < dofs_per_cell; ++i)
-           {
-             u0 += (solution (local_dof_indices[i]) *
-                    fe_values.shape_value_component(i, q_point, 0));
-             v0 += (solution (local_dof_indices[i]) *
-                    fe_values.shape_value_component(i, q_point, 1));
-           }
-         u0 -= 1.0;
-         v0 -= 1.0;
-
-         double dudx = grads_here[q_point][0][0];
-         double dvdy = grads_here[q_point][1][1];
-
-                                          /*
-                                            sprintf (buf, "QP %i %e %e %e %e %e %e Div %e\n", q_point, u0, v0,
-                                            dudx, dudy, dvdx, dvdy, dudx + dvdy);
-                                          */
-
-         err_l2 += (u0 * u0 + v0 * v0) * fe_values.JxW (q_point);
-         err_hdiv += (dudx + dvdy) * (dudx + dvdy) * fe_values.JxW (q_point);
-       }
+        {
+          //   double u0 = this_value[q_point](0);
+          //double v0 = this_value[q_point](1);
+
+          double u0 = 0;
+          double v0 = 0;
+          for (unsigned int i = 0; i < dofs_per_cell; ++i)
+            {
+              u0 += (solution (local_dof_indices[i]) *
+                     fe_values.shape_value_component(i, q_point, 0));
+              v0 += (solution (local_dof_indices[i]) *
+                     fe_values.shape_value_component(i, q_point, 1));
+            }
+          u0 -= 1.0;
+          v0 -= 1.0;
+
+          double dudx = grads_here[q_point][0][0];
+          double dvdy = grads_here[q_point][1][1];
+
+          /*
+            sprintf (buf, "QP %i %e %e %e %e %e %e Div %e\n", q_point, u0, v0,
+            dudx, dudy, dvdx, dvdy, dudx + dvdy);
+          */
+
+          err_l2 += (u0 * u0 + v0 * v0) * fe_values.JxW (q_point);
+          err_hdiv += (dudx + dvdy) * (dudx + dvdy) * fe_values.JxW (q_point);
+        }
     }
 
   deallog << "L2-Err " << pow (err_l2, 0.5)
-         << "  Hdiv-Err " << pow (err_hdiv, 0.5)
-         << std::endl;
+          << "  Hdiv-Err " << pow (err_hdiv, 0.5)
+          << std::endl;
 }
 
 
 template <int dim>
 void create_mass_matrix (const Mapping<dim>       &mapping,
-                        const DoFHandler<dim>    &dof,
-                        const Quadrature<dim>    &q,
-                        SparseMatrix<double>     &matrix,
-                        const Function<dim>   &rhs_function,
-                        Vector<double>        &rhs_vector,
-                        const Function<dim> * const coefficient = 0)
+                         const DoFHandler<dim>    &dof,
+                         const Quadrature<dim>    &q,
+                         SparseMatrix<double>     &matrix,
+                         const Function<dim>   &rhs_function,
+                         Vector<double>        &rhs_vector,
+                         const Function<dim> *const coefficient = 0)
 {
   UpdateFlags update_flags = UpdateFlags(update_values | update_JxW_values | update_q_points);
   if (coefficient != 0)
@@ -199,26 +199,26 @@ void create_mass_matrix (const Mapping<dim>       &mapping,
   FEValues<dim> fe_values (mapping, dof.get_fe(), q, update_flags);
 
   const unsigned int dofs_per_cell = fe_values.dofs_per_cell,
-                    n_q_points    = fe_values.n_quadrature_points;
+                     n_q_points    = fe_values.n_quadrature_points;
   const FiniteElement<dim>    &fe  = fe_values.get_fe();
   const unsigned int n_components  = fe.n_components();
 
   Assert(coefficient == 0 ||
-        coefficient->n_components==1 ||
-        coefficient->n_components==n_components, ExcInternalError());
+         coefficient->n_components==1 ||
+         coefficient->n_components==n_components, ExcInternalError());
 
   FullMatrix<double>  cell_matrix (dofs_per_cell, dofs_per_cell);
   Vector<double> cell_vector (dofs_per_cell);
   std::vector<double> coefficient_values (n_q_points);
   std::vector<Vector<double> > coefficient_vector_values (n_q_points,
-                                                         Vector<double> (n_components));
+                                                          Vector<double> (n_components));
 
   std::vector<types::global_dof_index> dof_indices (dofs_per_cell);
 
   std::vector<Vector<double> > rhs_values(n_q_points, Vector<double>(n_components));
 
   typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active (),
-                                                endc = dof.end ();
+                                                 endc = dof.end ();
   for (; cell!=endc; ++cell)
     {
       fe_values.reinit (cell);
@@ -231,231 +231,231 @@ void create_mass_matrix (const Mapping<dim>       &mapping,
       cell_vector = 0;
 
       if (coefficient != 0)
-       {
-         if (coefficient->n_components==1)
-           {
-             coefficient->value_list (fe_values.get_quadrature_points(),
-                                      coefficient_values);
-             for (unsigned int point=0; point<n_q_points; ++point)
-               {
-                 const double weight = fe_values.JxW(point);
-                 for (unsigned int i=0; i<dofs_per_cell; ++i)
-                   {
-                     const double v = fe_values.shape_value(i,point);
-                     for (unsigned int j=0; j<dofs_per_cell; ++j)
-                       {
-                         const double u = fe_values.shape_value(j,point);
-
-                         if ((n_components==1) ||
-                             (fe.system_to_component_index(i).first ==
-                              fe.system_to_component_index(j).first))
-                           cell_matrix(i,j) +=
-                             (u * v * weight * coefficient_values[point]);
-                       }
-                   }
-               }
-           }
-         else
-           {
-             coefficient->vector_value_list (fe_values.get_quadrature_points(),
-                                             coefficient_vector_values);
-             for (unsigned int point=0; point<n_q_points; ++point)
-               {
-                 const double weight = fe_values.JxW(point);
-                 for (unsigned int i=0; i<dofs_per_cell; ++i)
-                   {
-                     const double v = fe_values.shape_value(i,point);
-                     const unsigned int component_i=
-                       fe.system_to_component_index(i).first;
-                     for (unsigned int j=0; j<dofs_per_cell; ++j)
-                       {
-                         const double u = fe_values.shape_value(j,point);
-                         if ((n_components==1) ||
-                             (fe.system_to_component_index(j).first == component_i))
-                           cell_matrix(i,j) +=
-                             (u * v * weight *
-                              coefficient_vector_values[point](component_i));
-                       }
-                   }
-               }
-           }
-       }
+        {
+          if (coefficient->n_components==1)
+            {
+              coefficient->value_list (fe_values.get_quadrature_points(),
+                                       coefficient_values);
+              for (unsigned int point=0; point<n_q_points; ++point)
+                {
+                  const double weight = fe_values.JxW(point);
+                  for (unsigned int i=0; i<dofs_per_cell; ++i)
+                    {
+                      const double v = fe_values.shape_value(i,point);
+                      for (unsigned int j=0; j<dofs_per_cell; ++j)
+                        {
+                          const double u = fe_values.shape_value(j,point);
+
+                          if ((n_components==1) ||
+                              (fe.system_to_component_index(i).first ==
+                               fe.system_to_component_index(j).first))
+                            cell_matrix(i,j) +=
+                              (u * v * weight * coefficient_values[point]);
+                        }
+                    }
+                }
+            }
+          else
+            {
+              coefficient->vector_value_list (fe_values.get_quadrature_points(),
+                                              coefficient_vector_values);
+              for (unsigned int point=0; point<n_q_points; ++point)
+                {
+                  const double weight = fe_values.JxW(point);
+                  for (unsigned int i=0; i<dofs_per_cell; ++i)
+                    {
+                      const double v = fe_values.shape_value(i,point);
+                      const unsigned int component_i=
+                        fe.system_to_component_index(i).first;
+                      for (unsigned int j=0; j<dofs_per_cell; ++j)
+                        {
+                          const double u = fe_values.shape_value(j,point);
+                          if ((n_components==1) ||
+                              (fe.system_to_component_index(j).first == component_i))
+                            cell_matrix(i,j) +=
+                              (u * v * weight *
+                               coefficient_vector_values[point](component_i));
+                        }
+                    }
+                }
+            }
+        }
       else
-       {
-                                          // Compute eventual sign changes depending on the neighborhood
-                                          // between two faces.
-         std::vector<double> sign_change (dofs_per_cell, 1.0);
-         const unsigned int dofs_per_face = fe.dofs_per_face;
-         std::vector<types::global_dof_index> face_dof_indices (dofs_per_face);
-
-         for (unsigned int f = 0; f < 2; ++f)
-           {
-             typename DoFHandler<dim>::active_face_iterator face = cell->face (f);
-             if (!face->at_boundary ())
-               {
-                 unsigned int nn = cell->neighbor_of_neighbor (f);
-                 deallog << "Face " << f << " NeigNeig " << nn << std::endl;
-                 if (nn > 1)
-                   {
-                     face->get_dof_indices (face_dof_indices);
-                     for (unsigned int j = 0; j < dofs_per_face; ++j)
-                       {
-                         sign_change[face_dof_indices[j]] = -1.0;
-                         deallog << "DoF " << face_dof_indices[j] << std::endl;
-                       }
-                   }
-               }
-           }
-
-         for (unsigned int point=0; point<n_q_points; ++point)
-           {
-             const double weight = fe_values.JxW(point);
-                                              //           const double weight = q.weight(point);
-
-             std::vector<Vector<double> > val_vector (dofs_per_cell,
-                                                      Vector<double> (n_components));
-
-                                              // Precompute the component values
-             for (unsigned int i=0; i < dofs_per_cell; ++i)
-               for (unsigned int comp_i = 0; comp_i < fe.n_components ();
-                    ++comp_i)
-                 {
-                   val_vector[i](comp_i) = sign_change[i] *
-                                           fe_values.shape_value_component(i,point,comp_i);
-                 }
-                                              // Now eventually switch the sign of some of the ansatzfunctions.
-                                              // TODO
-
-             for (unsigned int i=0; i<dofs_per_cell; ++i)
-               for (unsigned int comp_i = 0; comp_i < fe.n_components ();
-                    ++comp_i)
-                 if (fe.get_nonzero_components(i)[comp_i] == true)
-                   {
-                     const double v = val_vector[i](comp_i);
-                     for (unsigned int j=0; j<dofs_per_cell; ++j)
-                       for (unsigned int comp_j = 0;
-                            comp_j < fe.n_components (); ++comp_j)
-                         if (fe.get_nonzero_components(j)[comp_j] == true)
-                           {
-                             const double u = val_vector[j](comp_j);
-                             if ((n_components==1) ||
-                                 (comp_i == comp_j))
-                               cell_matrix(i,j) += (u * v * weight);
-                           }
-                   }
-
-
-             for (unsigned int i=0; i<dofs_per_cell; ++i)
-               for (unsigned int comp_i = 0; comp_i < fe.n_components ();
-                    ++comp_i)
-                 if (fe.get_nonzero_components(i)[comp_i] == true)
-                   {
-                     cell_vector(i) += rhs_values[point](comp_i) *
-                                       val_vector[i](comp_i) * weights[point];
-                   }
-           }
-       }
-                                      // transfer everything into the
-                                      // global object. lock the
-                                      // matrix meanwhile
+        {
+          // Compute eventual sign changes depending on the neighborhood
+          // between two faces.
+          std::vector<double> sign_change (dofs_per_cell, 1.0);
+          const unsigned int dofs_per_face = fe.dofs_per_face;
+          std::vector<types::global_dof_index> face_dof_indices (dofs_per_face);
+
+          for (unsigned int f = 0; f < 2; ++f)
+            {
+              typename DoFHandler<dim>::active_face_iterator face = cell->face (f);
+              if (!face->at_boundary ())
+                {
+                  unsigned int nn = cell->neighbor_of_neighbor (f);
+                  deallog << "Face " << f << " NeigNeig " << nn << std::endl;
+                  if (nn > 1)
+                    {
+                      face->get_dof_indices (face_dof_indices);
+                      for (unsigned int j = 0; j < dofs_per_face; ++j)
+                        {
+                          sign_change[face_dof_indices[j]] = -1.0;
+                          deallog << "DoF " << face_dof_indices[j] << std::endl;
+                        }
+                    }
+                }
+            }
+
+          for (unsigned int point=0; point<n_q_points; ++point)
+            {
+              const double weight = fe_values.JxW(point);
+              //     const double weight = q.weight(point);
+
+              std::vector<Vector<double> > val_vector (dofs_per_cell,
+                                                       Vector<double> (n_components));
+
+              // Precompute the component values
+              for (unsigned int i=0; i < dofs_per_cell; ++i)
+                for (unsigned int comp_i = 0; comp_i < fe.n_components ();
+                     ++comp_i)
+                  {
+                    val_vector[i](comp_i) = sign_change[i] *
+                                            fe_values.shape_value_component(i,point,comp_i);
+                  }
+              // Now eventually switch the sign of some of the ansatzfunctions.
+              // TODO
+
+              for (unsigned int i=0; i<dofs_per_cell; ++i)
+                for (unsigned int comp_i = 0; comp_i < fe.n_components ();
+                     ++comp_i)
+                  if (fe.get_nonzero_components(i)[comp_i] == true)
+                    {
+                      const double v = val_vector[i](comp_i);
+                      for (unsigned int j=0; j<dofs_per_cell; ++j)
+                        for (unsigned int comp_j = 0;
+                             comp_j < fe.n_components (); ++comp_j)
+                          if (fe.get_nonzero_components(j)[comp_j] == true)
+                            {
+                              const double u = val_vector[j](comp_j);
+                              if ((n_components==1) ||
+                                  (comp_i == comp_j))
+                                cell_matrix(i,j) += (u * v * weight);
+                            }
+                    }
+
+
+              for (unsigned int i=0; i<dofs_per_cell; ++i)
+                for (unsigned int comp_i = 0; comp_i < fe.n_components ();
+                     ++comp_i)
+                  if (fe.get_nonzero_components(i)[comp_i] == true)
+                    {
+                      cell_vector(i) += rhs_values[point](comp_i) *
+                                        val_vector[i](comp_i) * weights[point];
+                    }
+            }
+        }
+      // transfer everything into the
+      // global object. lock the
+      // matrix meanwhile
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int j=0; j<dofs_per_cell; ++j)
-         if ((n_components==1) ||
-             (cell_matrix (i,j) != 0.0))
-/*
-  (fe.system_to_component_index(i).first ==
-  fe.system_to_component_index(j).first))
-*/
-           matrix.add (dof_indices[i], dof_indices[j],
-                       cell_matrix(i,j));
+        for (unsigned int j=0; j<dofs_per_cell; ++j)
+          if ((n_components==1) ||
+              (cell_matrix (i,j) != 0.0))
+            /*
+              (fe.system_to_component_index(i).first ==
+              fe.system_to_component_index(j).first))
+            */
+            matrix.add (dof_indices[i], dof_indices[j],
+                        cell_matrix(i,j));
 
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       rhs_vector(dof_indices[i]) += cell_vector(i);
+        rhs_vector(dof_indices[i]) += cell_vector(i);
     }
 }
 
 
 template <int dim>
 void create_right_hand_side (const Mapping<dim>    &mapping,
-                            const DoFHandler<dim> &dof_handler,
-                            const Quadrature<dim> &quadrature,
-                            const Function<dim>   &rhs_function,
-                            Vector<double>        &rhs_vector)
+                             const DoFHandler<dim> &dof_handler,
+                             const Quadrature<dim> &quadrature,
+                             const Function<dim>   &rhs_function,
+                             Vector<double>        &rhs_vector)
 {
   const FiniteElement<dim> &fe  = dof_handler.get_fe();
   Assert (fe.n_components() == rhs_function.n_components,
-         ExcInternalError());
+          ExcInternalError());
   Assert (rhs_vector.size() == dof_handler.n_dofs(),
-         ExcDimensionMismatch(rhs_vector.size(), dof_handler.n_dofs()));
+          ExcDimensionMismatch(rhs_vector.size(), dof_handler.n_dofs()));
   rhs_vector = 0;
 
   UpdateFlags update_flags = UpdateFlags(update_values   |
-                                        update_q_points |
-                                        update_JxW_values);
+                                         update_q_points |
+                                         update_JxW_values);
   FEValues<dim> fe_values (mapping, fe, quadrature, update_flags);
 
   const unsigned int dofs_per_cell = fe_values.dofs_per_cell,
-                    n_q_points    = fe_values.n_quadrature_points,
-                    n_components  = fe.n_components();
+                     n_q_points    = fe_values.n_quadrature_points,
+                     n_components  = fe.n_components();
 
   std::vector<types::global_dof_index> dofs (dofs_per_cell);
   Vector<double> cell_vector (dofs_per_cell);
 
   typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active(),
-                                                endc = dof_handler.end();
+                                                 endc = dof_handler.end();
 
   if (n_components==1)
     {
       std::vector<double> rhs_values(n_q_points);
 
       for (; cell!=endc; ++cell)
-       {
-         fe_values.reinit(cell);
+        {
+          fe_values.reinit(cell);
 
-         const std::vector<double> &weights   = fe_values.get_JxW_values ();
-         rhs_function.value_list (fe_values.get_quadrature_points(), rhs_values);
+          const std::vector<double> &weights   = fe_values.get_JxW_values ();
+          rhs_function.value_list (fe_values.get_quadrature_points(), rhs_values);
 
-         cell_vector = 0;
-         for (unsigned int point=0; point<n_q_points; ++point)
-           for (unsigned int i=0; i<dofs_per_cell; ++i)
-             cell_vector(i) += rhs_values[point] *
-                               fe_values.shape_value(i,point) *
-                               weights[point];
+          cell_vector = 0;
+          for (unsigned int point=0; point<n_q_points; ++point)
+            for (unsigned int i=0; i<dofs_per_cell; ++i)
+              cell_vector(i) += rhs_values[point] *
+                                fe_values.shape_value(i,point) *
+                                weights[point];
 
-         cell->get_dof_indices (dofs);
+          cell->get_dof_indices (dofs);
 
-         for (unsigned int i=0; i<dofs_per_cell; ++i)
-           rhs_vector(dofs[i]) += cell_vector(i);
-       }
+          for (unsigned int i=0; i<dofs_per_cell; ++i)
+            rhs_vector(dofs[i]) += cell_vector(i);
+        }
     }
   else
     {
       std::vector<Vector<double> > rhs_values(n_q_points, Vector<double>(n_components));
 
       for (; cell!=endc; ++cell)
-       {
-         fe_values.reinit(cell);
-
-         const std::vector<double> &weights   = fe_values.get_JxW_values ();
-         rhs_function.vector_value_list (fe_values.get_quadrature_points(), rhs_values);
-
-         cell_vector = 0;
-         for (unsigned int point=0; point<n_q_points; ++point)
-           for (unsigned int i=0; i<dofs_per_cell; ++i)
-             for (unsigned int comp_i = 0; comp_i < fe.n_components ();
-                  ++comp_i)
-                                                //                 if (fe.get_nonzero_components(i)[comp_i] == true)
-               {
-                 cell_vector(i) += rhs_values[point](comp_i) *
-                                   fe_values.shape_value_component(i,point,comp_i) *
-                                   weights[point];
-               }
-
-         cell->get_dof_indices (dofs);
-
-         for (unsigned int i=0; i<dofs_per_cell; ++i)
-           rhs_vector(dofs[i]) += cell_vector(i);
-       }
+        {
+          fe_values.reinit(cell);
+
+          const std::vector<double> &weights   = fe_values.get_JxW_values ();
+          rhs_function.vector_value_list (fe_values.get_quadrature_points(), rhs_values);
+
+          cell_vector = 0;
+          for (unsigned int point=0; point<n_q_points; ++point)
+            for (unsigned int i=0; i<dofs_per_cell; ++i)
+              for (unsigned int comp_i = 0; comp_i < fe.n_components ();
+                   ++comp_i)
+                //       if (fe.get_nonzero_components(i)[comp_i] == true)
+                {
+                  cell_vector(i) += rhs_values[point](comp_i) *
+                                    fe_values.shape_value_component(i,point,comp_i) *
+                                    weights[point];
+                }
+
+          cell->get_dof_indices (dofs);
+
+          for (unsigned int i=0; i<dofs_per_cell; ++i)
+            rhs_vector(dofs[i]) += cell_vector(i);
+        }
     }
 }
 
@@ -468,92 +468,92 @@ void create_right_hand_side (const Mapping<dim>    &mapping,
 
 template <int dim>
 void project (const Mapping<dim>       &mapping,
-             const DoFHandler<dim>    &dof,
-             const ConstraintMatrix   &constraints,
-             const Quadrature<dim>    &quadrature,
-             const Function<dim>      &function,
-             Vector<double>           &vec,
-             const bool                enforce_zero_boundary = false,
-             const Quadrature<dim-1>  & = QGauss<dim-1>(2),
-             const bool                project_to_boundary_first = false)
+              const DoFHandler<dim>    &dof,
+              const ConstraintMatrix   &constraints,
+              const Quadrature<dim>    &quadrature,
+              const Function<dim>      &function,
+              Vector<double>           &vec,
+              const bool                enforce_zero_boundary = false,
+              const Quadrature<dim-1>  & = QGauss<dim-1>(2),
+              const bool                project_to_boundary_first = false)
 {
   Assert (dof.get_fe().n_components() == function.n_components,
-         ExcInternalError());
+          ExcInternalError());
 
   const FiniteElement<dim> &fe = dof.get_fe();
 
-                                  // make up boundary values
+  // make up boundary values
   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
+    // no need to project boundary
+    // values, but enforce
+    // homogeneous boundary values
+    // anyway
     {
-                                      // loop over all boundary faces
-                                      // to get all dof indices of
-                                      // dofs on the boundary. note
-                                      // that in 3d there are cases
-                                      // where a face is not at the
-                                      // boundary, yet one of its
-                                      // lines is, and we should
-                                      // consider the degrees of
-                                      // freedom on it as boundary
-                                      // nodes. likewise, in 2d and
-                                      // 3d there are cases where a
-                                      // cell is only at the boundary
-                                      // by one vertex. nevertheless,
-                                      // since we do not support
-                                      // boundaries with dimension
-                                      // less or equal to dim-2, each
-                                      // such boundary dof is also
-                                      // found from some other face
-                                      // that is actually wholly on
-                                      // the boundary, not only by
-                                      // one line or one vertex
+      // loop over all boundary faces
+      // to get all dof indices of
+      // dofs on the boundary. note
+      // that in 3d there are cases
+      // where a face is not at the
+      // boundary, yet one of its
+      // lines is, and we should
+      // consider the degrees of
+      // freedom on it as boundary
+      // nodes. likewise, in 2d and
+      // 3d there are cases where a
+      // cell is only at the boundary
+      // by one vertex. nevertheless,
+      // since we do not support
+      // boundaries with dimension
+      // less or equal to dim-2, each
+      // such boundary dof is also
+      // found from some other face
+      // that is actually wholly on
+      // the boundary, not only by
+      // one line or one vertex
       typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active(),
-                                                    endc = dof.end();
+                                                     endc = dof.end();
       std::vector<types::global_dof_index> face_dof_indices (fe.dofs_per_face);
       for (; cell!=endc; ++cell)
-       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
-         if (cell->face(f)->at_boundary())
-           {
-             cell->face(f)->get_dof_indices (face_dof_indices);
-             for (unsigned int i=0; i<fe.dofs_per_face; ++i)
-                                                // enter zero boundary values
-                                                // for all boundary nodes
-                                                //
-                                                // we need not care about
-                                                // vector valued elements here,
-                                                // since we set all components
-               boundary_values[face_dof_indices[i]] = 0.;
-           };
+        for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+          if (cell->face(f)->at_boundary())
+            {
+              cell->face(f)->get_dof_indices (face_dof_indices);
+              for (unsigned int i=0; i<fe.dofs_per_face; ++i)
+                // enter zero boundary values
+                // for all boundary nodes
+                //
+                // we need not care about
+                // vector valued elements here,
+                // since we set all components
+                boundary_values[face_dof_indices[i]] = 0.;
+            };
     }
   else
-                                    // no homogeneous boundary values
+    // no homogeneous boundary values
     if (project_to_boundary_first == true)
-                                      // boundary projection required
+      // boundary projection required
       {
-/*
-                                // set up a list of boundary functions for
-                                                                 // the different boundary parts. We want the
-                                                                                                  // @p{function} to hold on all parts of the
-                                                                                                                                   // boundary
-                                                                                                                                   typename FunctionMap<dim>::type boundary_functions;
-                                                                                                                                   for (unsigned char c=0; c<255; ++c)
-                                                                                                                                   boundary_functions[c] = &function;
-                                                                                                                                   project_boundary_values (dof, boundary_functions, q_boundary,
-                                                                                                                                   boundary_values);
-*/
+        /*
+                 // set up a list of boundary functions for
+                          // the different boundary parts. We want the
+                                   // @p{function} to hold on all parts of the
+                                            // boundary
+                                            typename FunctionMap<dim>::type boundary_functions;
+                                            for (unsigned char c=0; c<255; ++c)
+                                            boundary_functions[c] = &function;
+                                            project_boundary_values (dof, boundary_functions, q_boundary,
+                                            boundary_values);
+        */
       }
 
 
-                                  // set up mass matrix and right hand side
+  // set up mass matrix and right hand side
   vec.reinit (dof.n_dofs());
   SparsityPattern sparsity(dof.n_dofs(),
-                          dof.n_dofs(),
-                          dof.max_couplings_between_dofs());
+                           dof.n_dofs(),
+                           dof.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof, sparsity);
   constraints.condense (sparsity);
 
@@ -569,8 +569,8 @@ void project (const Mapping<dim>       &mapping,
   constraints.condense (tmp);
   if (boundary_values.size() != 0)
     MatrixTools::apply_boundary_values (boundary_values,
-                                       mass_matrix, vec, tmp,
-                                       true);
+                                        mass_matrix, vec, tmp,
+                                        true);
 
   SolverControl           control(1000,1e-16);
   PrimitiveVectorMemory<> memory;
@@ -578,10 +578,10 @@ void project (const Mapping<dim>       &mapping,
 
   PreconditionSSOR<> prec;
   prec.initialize(mass_matrix, 1.2);
-                                  // solve
+  // solve
   cg.solve (mass_matrix, vec, tmp, prec);
 
-                                  // distribute solution
+  // distribute solution
   constraints.distribute (vec);
 }
 
@@ -599,32 +599,32 @@ int create_tria (unsigned int elm, Triangulation<2> &tria)
   points_glob.push_back (Point<2> (0.5, 1.0));
   points_glob.push_back (Point<2> (0.0, 1.0));
 
-                                  // Prepare cell data
+  // Prepare cell data
   std::vector<CellData<2> > cells (1);
 
   switch (elm)
     {
-      case 0:
-           cells[0].vertices[0] = 0;
-           cells[0].vertices[1] = 1;
-           cells[0].vertices[2] = 4;
-           cells[0].vertices[3] = 2;
-           cells[0].material_id = 0;
-           break;
-      case 1:
-           cells[0].vertices[0] = 4;
-           cells[0].vertices[1] = 2;
-           cells[0].vertices[2] = 5;
-           cells[0].vertices[3] = 3;
-           cells[0].material_id = 0;
-           break;
-      case 2:
-           cells[0].vertices[0] = 0;
-           cells[0].vertices[1] = 4;
-           cells[0].vertices[2] = 6;
-           cells[0].vertices[3] = 5;
-           cells[0].material_id = 0;
-           break;
+    case 0:
+      cells[0].vertices[0] = 0;
+      cells[0].vertices[1] = 1;
+      cells[0].vertices[2] = 4;
+      cells[0].vertices[3] = 2;
+      cells[0].material_id = 0;
+      break;
+    case 1:
+      cells[0].vertices[0] = 4;
+      cells[0].vertices[1] = 2;
+      cells[0].vertices[2] = 5;
+      cells[0].vertices[3] = 3;
+      cells[0].material_id = 0;
+      break;
+    case 2:
+      cells[0].vertices[0] = 0;
+      cells[0].vertices[1] = 4;
+      cells[0].vertices[2] = 6;
+      cells[0].vertices[3] = 5;
+      cells[0].material_id = 0;
+      break;
     }
 
   for (unsigned int i = 0; i < 4; ++i)
@@ -644,20 +644,20 @@ void plot_shapes (DoFHandler<2> &dof_handler)
   Vector<double> solution (dof_handler.n_dofs ());
   std::set<unsigned int> face_dofs;
 
-                                  // Create set of all DoFs, which are on the boundary.
+  // Create set of all DoFs, which are on the boundary.
   DoFHandler<2>::active_cell_iterator cell = dof_handler.begin_active(),
-                                              endc = dof_handler.end();
+                                      endc = dof_handler.end();
   std::vector<types::global_dof_index> face_dof_indices (dof_handler.get_fe().dofs_per_face);
   for (; cell!=endc; ++cell)
     for (unsigned int f=0; f<GeometryInfo<2>::faces_per_cell; ++f)
       {
-       cell->face(f)->get_dof_indices (face_dof_indices);
-       for (unsigned int i=0; i<dof_handler.get_fe().dofs_per_face; ++i)
-         face_dofs.insert (face_dof_indices[i]);
+        cell->face(f)->get_dof_indices (face_dof_indices);
+        for (unsigned int i=0; i<dof_handler.get_fe().dofs_per_face; ++i)
+          face_dofs.insert (face_dof_indices[i]);
       }
 
-                                  // Now set a 1 at the place of the different DoFs and
-                                  // output the solution.
+  // Now set a 1 at the place of the different DoFs and
+  // output the solution.
   std::set<unsigned int>::iterator face_dof_iter;
   for (face_dof_iter = face_dofs.begin ();
        face_dof_iter != face_dofs.end (); ++face_dof_iter)
@@ -668,7 +668,7 @@ void plot_shapes (DoFHandler<2> &dof_handler)
 
       solution (dof) = 1.0;
 
-                                      // Test the core functionality2
+      // Test the core functionality2
       DataOut<2> *data_out = new DataOut<2>;
       data_out->attach_dof_handler (dof_handler);
       data_out->add_data_vector (solution, "solution");
@@ -705,35 +705,35 @@ void check (const FiniteElement<2> &fe)
   DoFHandler<2> *dof_handler;
 
   deallog << "Dofs/cell " << fe.dofs_per_cell
-         << "Dofs/face " << fe.dofs_per_face << std::endl;
+          << "Dofs/face " << fe.dofs_per_face << std::endl;
 
   for (unsigned int elm = 0; elm < 3; ++elm)
     {
       create_tria (elm, tria_test);
 
-                                      // Create a DoFHandler
+      // Create a DoFHandler
       dof_handler = new DoFHandler<2> (tria_test);
       dof_handler->distribute_dofs (fe);
 
       deallog << "Dofs total " << dof_handler->n_dofs () << std::endl;
 
-                                      // Alloc some DoFs
+      // Alloc some DoFs
       Vector<double> solution(dof_handler->n_dofs ());
 
-                                      // Project solution onto FE field
+      // Project solution onto FE field
       ConstraintMatrix     hn_constraints;
       hn_constraints.clear ();
       DoFTools::make_hanging_node_constraints (*dof_handler,
-                                              hn_constraints);
+                                               hn_constraints);
       hn_constraints.close ();
 
       MappingQ1<2> map_default;
 
       project (map_default, *dof_handler, hn_constraints,
-              QGauss<2> (6), TestMap1<2>(2),
-              solution);
+               QGauss<2> (6), TestMap1<2>(2),
+               solution);
 
-                                      // Test the core functionality
+      // Test the core functionality
       DataOut<2> *data_out = new DataOut<2>;
       data_out->attach_dof_handler (*dof_handler);
       data_out->add_data_vector (solution, "solution");
@@ -741,13 +741,13 @@ void check (const FiniteElement<2> &fe)
 
       data_out->write_gnuplot (deallog.get_file_stream());
 
-                                      // Now write face DoFs ..
+      // Now write face DoFs ..
       for (unsigned int i = 0; i < 4; ++i)
-       {
-         deallog << solution(i) << std::endl;
-       }
+        {
+          deallog << solution(i) << std::endl;
+        }
 
-                                      // Clean up ...
+      // Clean up ...
       delete data_out;
       delete (dof_handler);
       tria_test.clear ();
index ea4a299b8e51621c7c5b2aa50f23a6ee6b827c3d..a92615468af2f71d5aae82f864f1a5bfd4129ffd 100644 (file)
 
 template<int dim>
 inline void
-plot_derivatives(Mapping<dim>mapping,
-                    FiniteElement<dim>& finel,
-                    const char* name)
+plot_derivatives(Mapping<dim> &mapping,
+                 FiniteElement<dim> &finel,
+                 const char *name)
 {
   deallog.push (name);
-  
+
   Triangulation<dim> tr;
   DoFHandler<dim> dof(tr);
   GridGenerator::hyper_cube(tr, 2., 5.);
@@ -52,27 +52,27 @@ plot_derivatives(Mapping<dim>& mapping,
   QTrapez<dim> q;
 //  QIterated<dim> q(q_trapez, div);
   FEValues<dim> fe(mapping, finel, q, UpdateFlags(update_gradients
-                                                 | update_second_derivatives));
+                                                  | update_second_derivatives));
   fe.reinit(c);
 
   unsigned int k=0;
-  for (unsigned int mz=0;mz<=((dim>2) ? div : 0) ;++mz)
+  for (unsigned int mz=0; mz<=((dim>2) ? div : 0) ; ++mz)
     {
-      for (unsigned int my=0;my<=((dim>1) ? div : 0) ;++my)
-       {
-         for (unsigned int mx=0;mx<=div;++mx)
-           {
-             deallog << q.point(k) << std::endl;
-         
-             for (unsigned int i=0;i<finel.dofs_per_cell;++i)
-               {
-                 deallog << "\tGrad " << fe.shape_grad(i,k);
-                 deallog << "\t2nd " << fe.shape_hessian(i,k);
-                 deallog << std::endl;
-               }
-             k++;
-           }
-       }
+      for (unsigned int my=0; my<=((dim>1) ? div : 0) ; ++my)
+        {
+          for (unsigned int mx=0; mx<=div; ++mx)
+            {
+              deallog << q.point(k) << std::endl;
+
+              for (unsigned int i=0; i<finel.dofs_per_cell; ++i)
+                {
+                  deallog << "\tGrad " << fe.shape_grad(i,k);
+                  deallog << "\t2nd " << fe.shape_hessian(i,k);
+                  deallog << std::endl;
+                }
+              k++;
+            }
+        }
     }
   deallog.pop ();
 }
@@ -146,30 +146,30 @@ main()
 {
   std::ofstream logfile ("derivatives/output");
   deallog << std::setprecision(2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
-  
+
   deallog.push ("1d");
   plot_FE_Q_shape_functions<1>();
   deallog.pop ();
-  
+
   deallog.push ("2d");
   plot_FE_Q_shape_functions<2>();
   plot_FE_DGQ_shape_functions<2>();
   deallog.pop ();
-  
+
   deallog.push ("3d");
 //  plot_FE_Q_shape_functions<3>();
   deallog.pop ();
-  
 
-                                  // FESystem test.
+
+  // FESystem test.
   MappingQ1<2> m;
   FESystem<2> q2_q3(FE_Q<2>(2), 1,
-                   FE_Q<2>(3), 1);
+                    FE_Q<2>(3), 1);
 //  plot_derivatives(m, q2_q3, "Q2_Q3");
-  
+
   return 0;
 }
 
index bc736b602f48a17db0deeae902364046a1a08d7c..d5585ad702e89a6001668a7bdeb02bd3a44e8da9 100644 (file)
 
 template<int dim>
 inline void
-plot_derivatives(Mapping<dim>mapping,
-                FiniteElement<dim>& finel,
-                const char* name)
+plot_derivatives(Mapping<dim> &mapping,
+                 FiniteElement<dim> &finel,
+                 const char *name)
 {
   deallog.push (name);
-  
+
   Triangulation<dim> tr;
   DoFHandler<dim> dof(tr);
   GridGenerator::hyper_cube(tr);
@@ -50,22 +50,22 @@ plot_derivatives(Mapping<dim>& mapping,
   QGauss<dim-1> q(1);
 //  QIterated<dim> q(q_trapez, div);
   FEFaceValues<dim> fe(mapping, finel, q, UpdateFlags(update_gradients
-                                                     | update_second_derivatives));
-  for (unsigned int face=0;face<GeometryInfo<dim>::faces_per_cell;++face)
+                                                      | update_second_derivatives));
+  for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
     {
       fe.reinit(c, face);
-      
-      for (unsigned int k=0; k<q.size();++k)
-       {
-         deallog << "Face " << face
-                 << " Point " << q.point(k) << std::endl;
-         for (unsigned int i=0;i<finel.dofs_per_cell;++i)
-           {
-             deallog << "\tGrad " << fe.shape_grad(i,k);
-             deallog << "\t2nd " << fe.shape_hessian(i,k);
-             deallog << std::endl;
-           }
-       }
+
+      for (unsigned int k=0; k<q.size(); ++k)
+        {
+          deallog << "Face " << face
+                  << " Point " << q.point(k) << std::endl;
+          for (unsigned int i=0; i<finel.dofs_per_cell; ++i)
+            {
+              deallog << "\tGrad " << fe.shape_grad(i,k);
+              deallog << "\t2nd " << fe.shape_hessian(i,k);
+              deallog << std::endl;
+            }
+        }
     }
   deallog.pop ();
 }
@@ -108,15 +108,15 @@ main()
 {
   std::ofstream logfile ("derivatives_face/output");
   deallog << std::setprecision(2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
-  
+
   deallog.push ("2d");
   plot_FE_Q_shape_functions<2>();
 //  plot_FE_DGQ_shape_functions<2>();
   deallog.pop ();
-  
+
   deallog.push ("3d");
 //  plot_FE_Q_shape_functions<3>();
   deallog.pop ();
index c749697b5a6b24910021de83e0293a31fbad9e19..990aa8b744aa18e2db66996c6ac020b192f28ec5 100644 (file)
@@ -52,14 +52,14 @@ test(const unsigned int degree)
   QGauss<dim> q(degree+1);
   FEValues<dim> fe_values (fe, q, update_values);
   for (typename Triangulation<dim>::active_cell_iterator
-        cell = tr.begin_active(); cell != tr.end(); ++cell)
+       cell = tr.begin_active(); cell != tr.end(); ++cell)
     {
       fe_values.reinit (cell);
       for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
-       Assert (fe_values.shape_value (0,q) == 1,
-               ExcInternalError());
+        Assert (fe_values.shape_value (0,q) == 1,
+                ExcInternalError());
     }
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -69,7 +69,7 @@ main()
 {
   std::ofstream logfile ("dgp_01/output");
   deallog << std::setprecision(PRECISION);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
@@ -82,7 +82,7 @@ main()
 
   for (unsigned int degree=0; degree<=4; ++degree)
     test<3>(degree);
-  
+
   return 0;
 }
 
index d90dc316931efa28446c62505aa12c6f1fd5e3db..e76c1f5215f1b2c443971ba3386591cdc9a8d24d 100644 (file)
@@ -37,24 +37,24 @@ void
 test(const unsigned int degree)
 {
   deallog << "FE_DGPMonomial<" << dim << "> (" << degree << ")"
-         << std::endl;
-  
+          << std::endl;
+
   FE_DGPMonomial<dim> fe_q(degree);
 
   for (unsigned int c=0; c<GeometryInfo<dim>::max_children_per_cell; ++c)
     {
-      const FullMatrix<double> & m = fe_q.get_prolongation_matrix(c);
+      const FullMatrix<double> &m = fe_q.get_prolongation_matrix(c);
 
       for (unsigned int i=0; i<m.m(); ++i)
-       {
-         for (unsigned int j=0; j<m.n(); ++j)
-           deallog << m(i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<m.n(); ++j)
+            deallog << m(i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << std::endl;
     }
-  
+
   deallog << std::endl;
 }
 
@@ -64,14 +64,14 @@ main()
 {
   std::ofstream logfile ("dgp_monomial_1/output");
   deallog << std::setprecision(PRECISION);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-                                   // we had the matrices precomputed
-                                   // up to Q4 for 1d, Q3 for 2d and
-                                   // Q2 for 3d
+  // we had the matrices precomputed
+  // up to Q4 for 1d, Q3 for 2d and
+  // Q2 for 3d
   for (unsigned int degree=1; degree<=4; ++degree)
     test<1>(degree);
 
@@ -80,7 +80,7 @@ main()
 
   for (unsigned int degree=1; degree<=2; ++degree)
     test<3>(degree);
-  
+
   return 0;
 }
 
index 94d59de3f39dec10b91f67145de722d99050a641..3a72c8fb02077b0c92168474f0e2dc34fcd52873 100644 (file)
@@ -40,8 +40,8 @@ test(const unsigned int degree1,
 {
   deallog << "FE_DGPMonomial" << dim << "> (" << degree1 << ")"
           << " to FE_DGPMonomial<" << dim << "> (" << degree2 << ")"
-         << std::endl;
-  
+          << std::endl;
+
   FE_DGPMonomial<dim> fe1(degree1);
   FE_DGPMonomial<dim> fe2(degree2);
 
@@ -53,10 +53,10 @@ test(const unsigned int degree1,
     {
       for (unsigned int j=0; j<m.n(); ++j)
         deallog << m(i,j) << ' ';
-      
+
       deallog << std::endl;
     }
-  
+
   deallog << std::endl;
 }
 
@@ -66,7 +66,7 @@ main()
 {
   std::ofstream logfile ("dgp_monomial_2/output");
   deallog << std::setprecision(PRECISION);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
@@ -80,7 +80,7 @@ main()
   for (unsigned int degree1=1; degree1<=2; ++degree1)
     for (unsigned int degree2=1; degree2<=2; ++degree2)
       test<3>(degree1, degree2);
-  
+
   return 0;
 }
 
index e61b919a1c938acb6fd0e88db847176247b8da9c..849bfa689b72d6ef9f468af0dca3cb56ca78a74b 100644 (file)
@@ -40,8 +40,8 @@ test(const unsigned int degree1,
 {
   deallog << "FE_DGQ<" << dim << "> (" << degree1 << ")"
           << " to FE_DGQ<" << dim << "> (" << degree2 << ")"
-         << std::endl;
-  
+          << std::endl;
+
   FE_DGQ<dim> fe1(degree1);
   FE_DGQ<dim> fe2(degree2);
 
@@ -53,10 +53,10 @@ test(const unsigned int degree1,
     {
       for (unsigned int j=0; j<m.n(); ++j)
         deallog << m(i,j) << ' ';
-      
+
       deallog << std::endl;
     }
-  
+
   deallog << std::endl;
 }
 
@@ -66,7 +66,7 @@ main()
 {
   std::ofstream logfile ("dgq_1/output");
   deallog << std::setprecision(PRECISION);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
@@ -80,7 +80,7 @@ main()
   for (unsigned int degree1=0; degree1<=2; ++degree1)
     for (unsigned int degree2=0; degree2<=2; ++degree2)
       test<3>(degree1, degree2);
-  
+
   return 0;
 }
 
index 02f5456d932017ede43a8dc689385b59fb420827..ad12d21dd078a0c395f1fbe2e190003a33fba78f 100644 (file)
@@ -69,118 +69,118 @@ void test_fe_datas()
   fe_datas.push_back(new FESystem<dim>(FE_Q<dim> (2), 2));
   deallog << (*fe_datas.rbegin())->get_name() << std::endl;
   fe_datas.push_back(new FESystem<dim>(FE_Q<dim> (1), 2,
-                                      FE_Q<dim> (2), 1));
+                                       FE_Q<dim> (2), 1));
   deallog << (*fe_datas.rbegin())->get_name() << std::endl;
-  
 
-                                  // Check vector elements in 2d and higher only
+
+  // Check vector elements in 2d and higher only
   if (dim>1)
     {
-                                      // Face elements
+      // Face elements
       fe_datas.push_back(new FE_FaceQ<dim> (0));
       deallog << (*fe_datas.rbegin())->get_name() << std::endl;
       fe_datas.push_back(new FE_FaceQ<dim> (1));
       deallog << (*fe_datas.rbegin())->get_name() << std::endl;
       fe_datas.push_back(new FE_FaceQ<dim> (3));
       deallog << (*fe_datas.rbegin())->get_name() << std::endl;
-                                  // Vector DG elements
+      // Vector DG elements
       fe_datas.push_back(
-       new FE_DGRaviartThomas<dim>(0));
+        new FE_DGRaviartThomas<dim>(0));
       deallog << (*fe_datas.rbegin())->get_name() << std::endl;
       fe_datas.push_back(
-       new FE_DGRaviartThomas<dim>(1));
+        new FE_DGRaviartThomas<dim>(1));
       deallog << (*fe_datas.rbegin())->get_name() << std::endl;
       fe_datas.push_back(
-       new FE_DGNedelec<dim>(0));
+        new FE_DGNedelec<dim>(0));
       deallog << (*fe_datas.rbegin())->get_name() << std::endl;
       fe_datas.push_back(
-       new FE_DGNedelec<dim>(1));
+        new FE_DGNedelec<dim>(1));
       deallog << (*fe_datas.rbegin())->get_name() << std::endl;
 
-                                      // Hdiv elements
-      FE_RaviartThomas<dim>rt0 = new FE_RaviartThomas<dim>(0);
+      // Hdiv elements
+      FE_RaviartThomas<dim> *rt0 = new FE_RaviartThomas<dim>(0);
       fe_datas.push_back(rt0);
       deallog << (*fe_datas.rbegin())->get_name() << std::endl;
 
-      FE_RaviartThomas<dim>rt1 = new FE_RaviartThomas<dim>(1);
+      FE_RaviartThomas<dim> *rt1 = new FE_RaviartThomas<dim>(1);
       fe_datas.push_back(rt1);
       deallog << (*fe_datas.rbegin())->get_name() << std::endl;
 
       fe_datas.push_back(new FE_RaviartThomas<dim>(2));
       deallog << (*fe_datas.rbegin())->get_name() << std::endl;
       fe_datas.push_back(new FESystem<dim>(*rt1, 1,
-                                          FE_DGQ<dim> (1), 1));
+                                           FE_DGQ<dim> (1), 1));
       deallog << (*fe_datas.rbegin())->get_name() << std::endl;
 
-                                      // Hcurl elements
-      FE_Nedelec<dim>ned0 = new FE_Nedelec<dim>(0);
+      // Hcurl elements
+      FE_Nedelec<dim> *ned0 = new FE_Nedelec<dim>(0);
       fe_datas.push_back(ned0);
       deallog << (*fe_datas.rbegin())->get_name() << std::endl;
-      FE_Nedelec<dim>ned1 = new FE_Nedelec<dim>(1);
+      FE_Nedelec<dim> *ned1 = new FE_Nedelec<dim>(1);
       fe_datas.push_back(ned1);
       deallog << (*fe_datas.rbegin())->get_name() << std::endl;
     }
   if (dim==2)
     {
       fe_datas.push_back(
-       new FE_DGBDM<dim>(1));
+        new FE_DGBDM<dim>(1));
       deallog << (*fe_datas.rbegin())->get_name() << std::endl;
       fe_datas.push_back(
-       new FE_DGBDM<dim>(2));
+        new FE_DGBDM<dim>(2));
       deallog << (*fe_datas.rbegin())->get_name() << std::endl;
-      
+
       fe_datas.push_back(new FE_BDM<dim>(1));
       deallog << (*fe_datas.rbegin())->get_name() << std::endl;
       fe_datas.push_back(new FE_BDM<dim>(2));
-      deallog << (*fe_datas.rbegin())->get_name() << std::endl;     
+      deallog << (*fe_datas.rbegin())->get_name() << std::endl;
     }
   if (dim>1)
     {
-      FE_RaviartThomasNodal<dim>rt0 = new FE_RaviartThomasNodal<dim>(0);
-      FE_RaviartThomasNodal<dim>rt1 = new FE_RaviartThomasNodal<dim>(1);
+      FE_RaviartThomasNodal<dim> *rt0 = new FE_RaviartThomasNodal<dim>(0);
+      FE_RaviartThomasNodal<dim> *rt1 = new FE_RaviartThomasNodal<dim>(1);
       fe_datas.push_back(rt0);
       deallog << (*fe_datas.rbegin())->get_name() << std::endl;
       fe_datas.push_back(rt1);
       deallog << (*fe_datas.rbegin())->get_name() << std::endl;
       fe_datas.push_back(new FESystem<dim>(*rt1, 1,
-                                          FE_DGQ<dim> (1), 1));
+                                           FE_DGQ<dim> (1), 1));
       deallog << (*fe_datas.rbegin())->get_name() << std::endl;
     }
-  
 
-                                  // for dim==3 the constraints are
-                                  // only hardcoded for Q1-Q2
+
+  // for dim==3 the constraints are
+  // only hardcoded for Q1-Q2
   if (dim!=3)
     {
       fe_datas.push_back(new FESystem<dim>(FE_Q<dim> (3), 2));
       deallog << (*fe_datas.rbegin())->get_name() << std::endl;
       fe_datas.push_back(new FESystem<dim>(FE_Q<dim> (1), 2,
-                                          FE_Q<dim> (3), 1));
+                                           FE_Q<dim> (3), 1));
       deallog << (*fe_datas.rbegin())->get_name() << std::endl;
       fe_datas.push_back(new FESystem<dim>(FE_Q<dim> (4), 2));
       deallog << (*fe_datas.rbegin())->get_name() << std::endl;
     }
 
-                                  // have systems of systems, and
-                                  // construct hierarchies of
-                                  // subsequently weirder elements by
-                                  // taking each of them in turn as
-                                  // basis of others
+  // have systems of systems, and
+  // construct hierarchies of
+  // subsequently weirder elements by
+  // taking each of them in turn as
+  // basis of others
   fe_datas.push_back (new FESystem<dim> (FESystem<dim> (FE_Q<dim>(1),2),2));
   deallog << (*fe_datas.rbegin())->get_name() << std::endl;
   fe_datas.push_back (new FESystem<dim> (FESystem<dim> (FE_Q<dim>(1),2),1,
-                                        FESystem<dim> (FE_DGQ<dim>(1),2),1));
+                                         FESystem<dim> (FE_DGQ<dim>(1),2),1));
   deallog << (*fe_datas.rbegin())->get_name() << std::endl;
   fe_datas.push_back (new FESystem<dim> (FESystem<dim> (FE_Q<dim>(1),1,
-                                                       FE_Q<dim>(2),1),1,
-                                        FESystem<dim> (FE_Q<dim>(2),2),1,
-                                        FESystem<dim> (FE_DGQ<dim>(2),2),1));
+                                                        FE_Q<dim>(2),1),1,
+                                         FESystem<dim> (FE_Q<dim>(2),2),1,
+                                         FESystem<dim> (FE_DGQ<dim>(2),2),1));
   deallog << (*fe_datas.rbegin())->get_name() << std::endl;
   fe_datas.push_back (new FESystem<dim> (*fe_datas[fe_datas.size()-3], 2,
-                                        *fe_datas[fe_datas.size()-2], 1,
-                                        *fe_datas[fe_datas.size()-1], 2));
+                                         *fe_datas[fe_datas.size()-2], 1,
+                                         *fe_datas[fe_datas.size()-1], 2));
   deallog << (*fe_datas.rbegin())->get_name() << std::endl;
-  
+
   deallog << std::endl << "dim=" << dim << std::endl;
   for (unsigned int n=0; n<fe_datas.size(); ++n)
     {
@@ -198,10 +198,10 @@ void test_fe_datas()
       deallog << "dofs_per_face=" << fe_data->dofs_per_face << std::endl;
       deallog << "dofs_per_cell=" << fe_data->dofs_per_cell << std::endl;
       deallog << "primitive=" << (fe_data->is_primitive() ? "yes" : "no") << std::endl
-             << "components=" << fe_data->components << std::endl
-             << "blocks=" << fe_data->block_indices() << std::endl
-             << "degree=" << fe_data->tensor_degree() << std::endl
-             << "conformity=";
+              << "components=" << fe_data->components << std::endl
+              << "blocks=" << fe_data->block_indices() << std::endl
+              << "degree=" << fe_data->tensor_degree() << std::endl
+              << "conformity=";
       if (fe_data->conforms(FiniteElementData<dim>::L2)) deallog << " L2";
       if (fe_data->conforms(FiniteElementData<dim>::Hcurl)) deallog << " Hcurl";
       if (fe_data->conforms(FiniteElementData<dim>::Hdiv)) deallog << " Hdiv";
@@ -209,38 +209,38 @@ void test_fe_datas()
       if (fe_data->conforms(FiniteElementData<dim>::H2)) deallog << " H2";
       deallog << std::endl;
       deallog << "unit_support_points=" << fe_data->get_unit_support_points().size()
-             << std::endl;
+              << std::endl;
       deallog << "unit_face_support_points=" << fe_data->get_unit_face_support_points().size()
-             << std::endl;
+              << std::endl;
       deallog << "generalized_support_points=" << fe_data->get_generalized_support_points().size()
-             << std::endl;
+              << std::endl;
       deallog << "generalized_face_support_points=" << fe_data->get_generalized_face_support_points().size()
-             << std::endl;
-      
+              << std::endl;
+
       deallog << "face_to_equivalent_cell_index:";
-      for (unsigned int i=0;i<fe_data->dofs_per_face;++i)
-       deallog << ' ' << fe_data->face_to_equivalent_cell_index(i);
+      for (unsigned int i=0; i<fe_data->dofs_per_face; ++i)
+        deallog << ' ' << fe_data->face_to_equivalent_cell_index(i);
       deallog << std::endl;
-      for (unsigned int f=0;f<GeometryInfo<dim>::faces_per_cell;++f)
-       {
-         deallog << "face_to_cell_index:";
-         for (unsigned int i=0;i<fe_data->dofs_per_face;++i)
-           deallog << ' ' << fe_data->face_to_cell_index(i, f);
-         deallog << std::endl;
-       }
-      
-      for (unsigned int f=0;f<GeometryInfo<dim>::faces_per_cell;++f)
-       {
-         deallog << "support on face " << f << ':';
-         for (unsigned int s=0;s<fe_data->dofs_per_cell;++s)
-           if (fe_datas[n]->has_support_on_face(s, f))
-             deallog << '\t' << s;
-         deallog << std::endl;
-       }
+      for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+        {
+          deallog << "face_to_cell_index:";
+          for (unsigned int i=0; i<fe_data->dofs_per_face; ++i)
+            deallog << ' ' << fe_data->face_to_cell_index(i, f);
+          deallog << std::endl;
+        }
+
+      for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+        {
+          deallog << "support on face " << f << ':';
+          for (unsigned int s=0; s<fe_data->dofs_per_cell; ++s)
+            if (fe_datas[n]->has_support_on_face(s, f))
+              deallog << '\t' << s;
+          deallog << std::endl;
+        }
       deallog << std::endl;
     }
 
-                                  // delete all FiniteElementDatas
+  // delete all FiniteElementDatas
   for (unsigned int i=0; i<fe_datas.size(); ++i)
     delete fe_datas[i];
 }
@@ -253,7 +253,7 @@ int main()
   deallog.threshold_double(1.e-10);
 //  deallog.log_execution_time(true);
 //  deallog.log_time_differences(true);
-  
+
   test_fe_datas<1>();
   test_fe_datas<2>();
   test_fe_datas<3>();
index 3ca4bb4717095a3f731cd4903a73231b69de846a..cd003c2bc8ca21488c0e3b96fe5c0f256248cc10 100644 (file)
 #include<deal.II/numerics/fe_field_function.h>
 #include<deal.II/numerics/vector_tools.h>
 
-void create_reference_triangulation (Triangulation<3>tria)
+void create_reference_triangulation (Triangulation<3> &tria)
 {
   std::vector<unsigned int> repetitions (3, 1);
-  
+
   repetitions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle (tria, repetitions, Point<3> (-1.0, 0.0, 0.0), Point<3> (1.0, 1.0, 1.0));
 }
 
-void create_triangulation (Triangulation<3>tria, const bool face_orientation, const bool face_flip, const bool face_rotation)
+void create_triangulation (Triangulation<3> &tria, const bool face_orientation, const bool face_flip, const bool face_rotation)
 {
   std::vector<CellData<3> > cells (2);
-  
+
   cells[0].vertices[0] = 0;
   cells[0].vertices[1] = 1;
   cells[0].vertices[2] = 6;
@@ -46,119 +46,116 @@ void create_triangulation (Triangulation<3>& tria, const bool face_orientation,
   cells[0].vertices[6] = 9;
   cells[0].vertices[7] = 10;
   cells[0].material_id = 0;
-  
+
   if (face_orientation)
-  {
-    if (face_flip)
     {
-      if (face_rotation)
-      {
-        cells[1].vertices[0] = 7;
-        cells[1].vertices[1] = 8;
-        cells[1].vertices[2] = 10;
-        cells[1].vertices[3] = 11;
-        cells[1].vertices[4] = 1;
-        cells[1].vertices[5] = 2;
-        cells[1].vertices[6] = 4;
-        cells[1].vertices[7] = 5;
-      }
-      
+      if (face_flip)
+        {
+          if (face_rotation)
+            {
+              cells[1].vertices[0] = 7;
+              cells[1].vertices[1] = 8;
+              cells[1].vertices[2] = 10;
+              cells[1].vertices[3] = 11;
+              cells[1].vertices[4] = 1;
+              cells[1].vertices[5] = 2;
+              cells[1].vertices[6] = 4;
+              cells[1].vertices[7] = 5;
+            }
+
+          else
+            {
+              cells[1].vertices[0] = 10;
+              cells[1].vertices[1] = 11;
+              cells[1].vertices[2] = 4;
+              cells[1].vertices[3] = 5;
+              cells[1].vertices[4] = 7;
+              cells[1].vertices[5] = 8;
+              cells[1].vertices[6] = 1;
+              cells[1].vertices[7] = 2;
+            }
+        }
+
+      else if (face_rotation)
+        {
+          cells[1].vertices[0] = 4;
+          cells[1].vertices[1] = 5;
+          cells[1].vertices[2] = 1;
+          cells[1].vertices[3] = 2;
+          cells[1].vertices[4] = 10;
+          cells[1].vertices[5] = 11;
+          cells[1].vertices[6] = 7;
+          cells[1].vertices[7] = 8;
+        }
+
       else
-      {
-        cells[1].vertices[0] = 10;
-        cells[1].vertices[1] = 11;
-        cells[1].vertices[2] = 4;
-        cells[1].vertices[3] = 5;
-        cells[1].vertices[4] = 7;
-        cells[1].vertices[5] = 8;
-        cells[1].vertices[6] = 1;
-        cells[1].vertices[7] = 2;
-      }
+        {
+          cells[1].vertices[0] = 2;
+          cells[1].vertices[1] = 1;
+          cells[1].vertices[2] = 5;
+          cells[1].vertices[3] = 4;
+          cells[1].vertices[4] = 8;
+          cells[1].vertices[5] = 7;
+          cells[1].vertices[6] = 11;
+          cells[1].vertices[7] = 10;
+        }
     }
-    
-    else
+
+  else if (face_flip)
+    {
       if (face_rotation)
-      {
-        cells[1].vertices[0] = 4;
-        cells[1].vertices[1] = 5;
-        cells[1].vertices[2] = 1;
-        cells[1].vertices[3] = 2;
-        cells[1].vertices[4] = 10;
-        cells[1].vertices[5] = 11;
-        cells[1].vertices[6] = 7;
-        cells[1].vertices[7] = 8;
-      }
-      
+        {
+          cells[1].vertices[0] = 8;
+          cells[1].vertices[1] = 7;
+          cells[1].vertices[2] = 2;
+          cells[1].vertices[3] = 1;
+          cells[1].vertices[4] = 11;
+          cells[1].vertices[5] = 10;
+          cells[1].vertices[6] = 5;
+          cells[1].vertices[7] = 4;
+        }
+
       else
-      {
-        cells[1].vertices[0] = 2;
-        cells[1].vertices[1] = 1;
-        cells[1].vertices[2] = 5;
-        cells[1].vertices[3] = 4;
-        cells[1].vertices[4] = 8;
-        cells[1].vertices[5] = 7;
-        cells[1].vertices[6] = 11;
-        cells[1].vertices[7] = 10;
-      }
-  }
-  
+        {
+          cells[1].vertices[0] = 11;
+          cells[1].vertices[1] = 10;
+          cells[1].vertices[2] = 8;
+          cells[1].vertices[3] = 7;
+          cells[1].vertices[4] = 5;
+          cells[1].vertices[5] = 4;
+          cells[1].vertices[6] = 2;
+          cells[1].vertices[7] = 1;
+        }
+    }
+
+  else if (face_rotation)
+    {
+      cells[1].vertices[0] = 5;
+      cells[1].vertices[1] = 4;
+      cells[1].vertices[2] = 11;
+      cells[1].vertices[3] = 10;
+      cells[1].vertices[4] = 2;
+      cells[1].vertices[5] = 1;
+      cells[1].vertices[6] = 8;
+      cells[1].vertices[7] = 7;
+    }
+
   else
-    if (face_flip)
     {
-      if (face_rotation)
-      {
-        cells[1].vertices[0] = 8;
-        cells[1].vertices[1] = 7;
-        cells[1].vertices[2] = 2;
-        cells[1].vertices[3] = 1;
-        cells[1].vertices[4] = 11;
-        cells[1].vertices[5] = 10;
-        cells[1].vertices[6] = 5;
-        cells[1].vertices[7] = 4;
-      }
-      
-      else
-      {
-        cells[1].vertices[0] = 11;
-        cells[1].vertices[1] = 10;
-        cells[1].vertices[2] = 8;
-        cells[1].vertices[3] = 7;
-        cells[1].vertices[4] = 5;
-        cells[1].vertices[5] = 4;
-        cells[1].vertices[6] = 2;
-        cells[1].vertices[7] = 1;
-      }
+      cells[1].vertices[0] = 1;
+      cells[1].vertices[1] = 2;
+      cells[1].vertices[2] = 7;
+      cells[1].vertices[3] = 8;
+      cells[1].vertices[4] = 4;
+      cells[1].vertices[5] = 5;
+      cells[1].vertices[6] = 10;
+      cells[1].vertices[7] = 11;
     }
-    
-    else
-      if (face_rotation)
-      {
-        cells[1].vertices[0] = 5;
-        cells[1].vertices[1] = 4;
-        cells[1].vertices[2] = 11;
-        cells[1].vertices[3] = 10;
-        cells[1].vertices[4] = 2;
-        cells[1].vertices[5] = 1;
-        cells[1].vertices[6] = 8;
-        cells[1].vertices[7] = 7;
-      }
-      
-      else
-      {
-        cells[1].vertices[0] = 1;
-        cells[1].vertices[1] = 2;
-        cells[1].vertices[2] = 7;
-        cells[1].vertices[3] = 8;
-        cells[1].vertices[4] = 4;
-        cells[1].vertices[5] = 5;
-        cells[1].vertices[6] = 10;
-        cells[1].vertices[7] = 11;
-      }
-  
+
   cells[1].material_id = 0;
-  
+
   std::vector<Point<3> > vertices (12);
-  
+
   vertices[0] = Point<3> (-1.0, 0.0, 0.0);
   vertices[1] = Point<3> ();
   vertices[2] = Point<3> (1.0, 0.0, 0.0);
@@ -174,7 +171,7 @@ void create_triangulation (Triangulation<3>& tria, const bool face_orientation,
   tria.create_triangulation (vertices, cells, SubCellData ());
 }
 
-void evaluate (const FE_Nedelec<3>& fe, const DoFHandler<3>& dof_handler_ref, const Vector<double>& u_ref, const DoFHandler<3>& dof_handler, const Vector<double>& u)
+void evaluate (const FE_Nedelec<3> &fe, const DoFHandler<3> &dof_handler_ref, const Vector<double> &u_ref, const DoFHandler<3> &dof_handler, const Vector<double> &u)
 {
   const FEValuesExtractors::Vector component (0);
   const QGauss<3> quadrature (2);
@@ -183,65 +180,65 @@ void evaluate (const FE_Nedelec<3>& fe, const DoFHandler<3>& dof_handler_ref, co
   FEValues<3> fe_values (fe, quadrature, update_quadrature_points | update_values);
   std::vector<Vector<double> > values (n_q_points, Vector<double> (3));
   std::vector<Tensor<1, 3> > values_ref (n_q_points);
-  
+
   for (DoFHandler<3>::active_cell_iterator cell = dof_handler_ref.begin_active (); cell != dof_handler_ref.end (); ++cell)
-  {
-    fe_values.reinit (cell);
-    fe_values[component].get_function_values (u_ref, values_ref);
-    fe_field_function.vector_value_list (fe_values.get_quadrature_points (), values);
-    
-    for (unsigned int q_point = 0; q_point < n_q_points; ++q_point)
     {
-      for (unsigned int d = 0; d < 3; ++d)
-        deallog << values_ref[q_point][d] - values[q_point] (d) << "  ";
-      
-      deallog << std::endl;
+      fe_values.reinit (cell);
+      fe_values[component].get_function_values (u_ref, values_ref);
+      fe_field_function.vector_value_list (fe_values.get_quadrature_points (), values);
+
+      for (unsigned int q_point = 0; q_point < n_q_points; ++q_point)
+        {
+          for (unsigned int d = 0; d < 3; ++d)
+            deallog << values_ref[q_point][d] - values[q_point] (d) << "  ";
+
+          deallog << std::endl;
+        }
     }
-  }
 }
 
-void set_reference_solution (Vector<double>vector)
+void set_reference_solution (Vector<double> &vector)
 {
   for (unsigned int i = 0; i < vector.size (); ++i)
     vector (i) = 1.0;
 }
 
-void set_solution (Vector<double>& vector, const DoFHandler<3>& dof_handler, const DoFHandler<3>& dof_handler_ref, const Vector<double>& u_ref)
+void set_solution (Vector<double> &vector, const DoFHandler<3> &dof_handler, const DoFHandler<3> &dof_handler_ref, const Vector<double> &u_ref)
 {
   ConstraintMatrix constraints;
-  
+
   constraints.close ();
-  
+
   Functions::FEFieldFunction<3> fe_field_function (dof_handler_ref, u_ref);
-  
+
   VectorTools::project (dof_handler, constraints, QGauss<3> (2), fe_field_function, vector);
 }
 
 void run (const bool face_orientation, const bool face_flip, const bool face_rotation)
 {
   Triangulation<3> tria_ref;
-  
+
   create_reference_triangulation (tria_ref);
-  
+
   FE_Nedelec<3> fe (0);
   DoFHandler<3> dof_handler_ref (tria_ref);
-  
+
   dof_handler_ref.distribute_dofs (fe);
-  
+
   Vector<double> u_ref (dof_handler_ref.n_dofs ());
-  
+
   set_reference_solution (u_ref);
-  
+
   Triangulation<3> tria;
-  
+
   create_triangulation (tria, face_orientation, face_flip, face_rotation);
-  
+
   DoFHandler<3> dof_handler (tria);
-  
+
   dof_handler.distribute_dofs (fe);
-  
+
   Vector<double> u (dof_handler.n_dofs ());
-  
+
   set_solution (u, dof_handler, dof_handler_ref, u_ref);
   evaluate (fe, dof_handler_ref, u_ref, dof_handler, u);
 }
index d24af1c1e870bad32a6a5e14e25d93a0aa3fe12c..a65fae7b911b530465d4edd8124e2a07a0474ea1 100644 (file)
 #include<deal.II/numerics/fe_field_function.h>
 #include<deal.II/numerics/vector_tools.h>
 
-void create_reference_triangulation (Triangulation<3>triangulation)
+void create_reference_triangulation (Triangulation<3> &triangulation)
 {
   GridGenerator::hyper_cube (triangulation, -1.0, 1.0);
   triangulation.refine_global(1);
 }
 
-void create_triangulation (Triangulation<3>triangulation)
+void create_triangulation (Triangulation<3> &triangulation)
 {
-  static const Point<3> vertices_parallelograms[] = {
+  static const Point<3> vertices_parallelograms[] =
+  {
     Point<3> (-1., -1., -1.),  //0
     Point<3> (0., -1., -1.),
     Point<3> (1., -1., -1.),
@@ -82,7 +83,8 @@ void create_triangulation (Triangulation<3>& triangulation)
                                          &vertices_parallelograms[n_vertices]);
 
   // create grid with all possible combintations of face_flip, face_orientation and face_rotation flags
-  static const int cell_vertices[][GeometryInfo<3>::vertices_per_cell] = {
+  static const int cell_vertices[][GeometryInfo<3>::vertices_per_cell] =
+  {
     {0, 1, 9, 10, 3, 4, 12, 13},        // cell 1 standard
     {10, 11, 13, 14, 1, 2, 4, 5},       // cell 2 rotated by 270 deg
     {9, 10, 18, 19, 12, 13, 21, 22},    // cell 3 standard
@@ -95,16 +97,16 @@ void create_triangulation (Triangulation<3>& triangulation)
 
   std::vector<CellData<3> > cells (n_cells, CellData<3>());
   for (unsigned 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];
-    cells[i].material_id = 0;
-  }
+    {
+      for (unsigned int j=0; j<GeometryInfo<3>::vertices_per_cell; ++j)
+        cells[i].vertices[j] = cell_vertices[i][j];
+      cells[i].material_id = 0;
+    }
 
   triangulation.create_triangulation (vertices, cells, SubCellData());
 }
 
-void evaluate (const FE_Nedelec<3>& fe, const DoFHandler<3>& dof_handler_ref, const Vector<double>& u_ref, const DoFHandler<3>& dof_handler, const Vector<double>& u)
+void evaluate (const FE_Nedelec<3> &fe, const DoFHandler<3> &dof_handler_ref, const Vector<double> &u_ref, const DoFHandler<3> &dof_handler, const Vector<double> &u)
 {
   const FEValuesExtractors::Vector component (0);
   const QGauss<3> quadrature (2);
@@ -113,37 +115,38 @@ void evaluate (const FE_Nedelec<3>& fe, const DoFHandler<3>& dof_handler_ref, co
   FEValues<3> fe_values (fe, quadrature, update_quadrature_points | update_values);
   std::vector<Vector<double> > values (n_q_points, Vector<double> (3));
   std::vector<Tensor<1, 3> > values_ref (n_q_points);
-  
+
   for (DoFHandler<3>::active_cell_iterator cell = dof_handler_ref.begin_active (); cell != dof_handler_ref.end (); ++cell)
-  {
-    fe_values.reinit (cell);
-    fe_values[component].get_function_values (u_ref, values_ref);
-    fe_field_function.vector_value_list (fe_values.get_quadrature_points (), values);
-    std::vector<types::global_dof_index> dof_indices (fe.dofs_per_cell);cell->get_dof_indices (dof_indices);
-    for (unsigned int q_point = 0; q_point < n_q_points; ++q_point)
     {
-      for (unsigned int d = 0; d < 3; ++d)
-        deallog << values_ref[q_point][d] - values[q_point] (d) << "  ";
-      
-      deallog << std::endl;
+      fe_values.reinit (cell);
+      fe_values[component].get_function_values (u_ref, values_ref);
+      fe_field_function.vector_value_list (fe_values.get_quadrature_points (), values);
+      std::vector<types::global_dof_index> dof_indices (fe.dofs_per_cell);
+      cell->get_dof_indices (dof_indices);
+      for (unsigned int q_point = 0; q_point < n_q_points; ++q_point)
+        {
+          for (unsigned int d = 0; d < 3; ++d)
+            deallog << values_ref[q_point][d] - values[q_point] (d) << "  ";
+
+          deallog << std::endl;
+        }
     }
-  }
 }
 
-void set_reference_solution (Vector<double>vector)
+void set_reference_solution (Vector<double> &vector)
 {
   for (unsigned int i = 0; i < vector.size (); ++i)
     vector (i) = 1.0;
 }
 
-void set_solution (Vector<double>& vector, const DoFHandler<3>& dof_handler, const DoFHandler<3>& dof_handler_ref, const Vector<double>& u_ref)
+void set_solution (Vector<double> &vector, const DoFHandler<3> &dof_handler, const DoFHandler<3> &dof_handler_ref, const Vector<double> &u_ref)
 {
   ConstraintMatrix constraints;
-  
+
   constraints.close ();
-  
+
   Functions::FEFieldFunction<3> fe_field_function (dof_handler_ref, u_ref);
-  
+
   VectorTools::project (dof_handler, constraints, QGauss<3> (2), fe_field_function, vector);
 }
 
@@ -151,30 +154,30 @@ int main ()
 {
   initlog (__FILE__);
   deallog.threshold_double (1.e-10);
-  
+
   Triangulation<3> tria_ref;
-  
+
   create_reference_triangulation (tria_ref);
-  
+
   FE_Nedelec<3> fe (0);
   DoFHandler<3> dof_handler_ref (tria_ref);
-  
+
   dof_handler_ref.distribute_dofs (fe);
-  
+
   Vector<double> u_ref (dof_handler_ref.n_dofs ());
-  
+
   set_reference_solution (u_ref);
-  
+
   Triangulation<3> tria;
-  
+
   create_triangulation (tria);
-  
+
   DoFHandler<3> dof_handler (tria);
-  
+
   dof_handler.distribute_dofs (fe);
-  
+
   Vector<double> u (dof_handler.n_dofs ());
-  
+
   set_solution (u, dof_handler, dof_handler_ref, u_ref);
   evaluate (fe, dof_handler_ref, u_ref, dof_handler, u);
 }
index 5ccd5cae6e92ebd1df9dea2ceb0b451042755bb1..f621b56b9f8c09a21ab1243e36d1b890640f3b5e 100644 (file)
 template<int dim>
 inline void
 plot_faces(Mapping<dim> &mapping,
-          FiniteElement<dim> &fe,
-          typename DoFHandler<dim>::cell_iterator &cell)
+           FiniteElement<dim> &fe,
+           typename DoFHandler<dim>::cell_iterator &cell)
 {
-                                  // create a QGauss<0>(4), which should
-                                  // still only have 1 quadrature point
+  // create a QGauss<0>(4), which should
+  // still only have 1 quadrature point
   QGauss<dim-1> q(4);
   Assert (q.size() == 1, ExcInternalError());
 
   FEFaceValues<dim> fe_values(mapping, fe, q,
-                             UpdateFlags(update_q_points
-                                         | update_JxW_values
-                                         | update_values
-                                         | update_gradients
-                                         | update_hessians
-                                         | update_normal_vectors));
+                              UpdateFlags(update_q_points
+                                          | update_JxW_values
+                                          | update_values
+                                          | update_gradients
+                                          | update_hessians
+                                          | update_normal_vectors));
 
   for (unsigned int face_nr=0;
        face_nr < GeometryInfo<dim>::faces_per_cell;
@@ -70,18 +70,18 @@ plot_faces(Mapping<dim> &mapping,
       deallog << "Face=" << face_nr << std::endl;
       fe_values.reinit(cell, face_nr);
 
-                                      // print some data on the location
+      // print some data on the location
       deallog << "x=" << fe_values.quadrature_point(0) << std::endl;
       deallog << "n=" << fe_values.normal_vector(0) << std::endl;
       deallog << "JxW=" << fe_values.JxW(0) << std::endl;
 
-                                      // now print some data on the shape
-                                      // functions
+      // now print some data on the shape
+      // functions
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
-       deallog << "shape_function " << i << ":" << std::endl
-               << "  phi=" << fe_values.shape_value(i,0) << std::endl
-               << "  grad phi=" << fe_values.shape_grad(i,0) << std::endl
-               << "  grad^2 phi=" << fe_values.shape_hessian(i,0) << std::endl;
+        deallog << "shape_function " << i << ":" << std::endl
+                << "  phi=" << fe_values.shape_value(i,0) << std::endl
+                << "  grad phi=" << fe_values.shape_grad(i,0) << std::endl
+                << "  grad^2 phi=" << fe_values.shape_hessian(i,0) << std::endl;
 
       deallog << std::endl;
     }
@@ -92,58 +92,58 @@ plot_faces(Mapping<dim> &mapping,
 template<int dim>
 inline void
 plot_subfaces(Mapping<dim> &mapping,
-             FiniteElement<dim> &fe,
-             typename DoFHandler<dim>::cell_iterator &cell)
+              FiniteElement<dim> &fe,
+              typename DoFHandler<dim>::cell_iterator &cell)
 {
 
-                                  // create a QGauss<0>(4), which should
-                                  // still only have 1 quadrature point
+  // create a QGauss<0>(4), which should
+  // still only have 1 quadrature point
   QGauss<dim-1> q(4);
   Assert (q.size() == 1, ExcInternalError());
 
   FESubfaceValues<dim> fe_values(mapping, fe, q,
-                                UpdateFlags(update_q_points
-                                            | update_JxW_values
-                                            | update_values
-                                            | update_gradients
-                                            | update_hessians
-                                            | update_normal_vectors));
+                                 UpdateFlags(update_q_points
+                                             | update_JxW_values
+                                             | update_values
+                                             | update_gradients
+                                             | update_hessians
+                                             | update_normal_vectors));
   for (unsigned int face_nr=0;
        face_nr < GeometryInfo<dim>::faces_per_cell;
        ++ face_nr)
     for (unsigned int sub_nr=0;
-        sub_nr < GeometryInfo<dim>::max_children_per_face;
-        ++ sub_nr)
+         sub_nr < GeometryInfo<dim>::max_children_per_face;
+         ++ sub_nr)
       {
-       deallog << "Face=" << face_nr
-               << ", subface=" << sub_nr
-               << std::endl;
-       
-       fe_values.reinit(cell, face_nr, sub_nr);
-       
-                                        // print some data on the location
-       deallog << "x=" << fe_values.quadrature_point(0) << std::endl;
-       deallog << "n=" << fe_values.normal_vector(0) << std::endl;
-       deallog << "JxW=" << fe_values.JxW(0) << std::endl;
-
-                                        // now print some data on the shape
-                                        // functions
-       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
-         deallog << "shape_function " << i << ":" << std::endl
-                 << "  phi=" << fe_values.shape_value(i,0) << std::endl
-                 << "  grad phi=" << fe_values.shape_grad(i,0) << std::endl
-                 << "  grad^2 phi=" << fe_values.shape_hessian(i,0) << std::endl;
-
-       deallog << std::endl;
+        deallog << "Face=" << face_nr
+                << ", subface=" << sub_nr
+                << std::endl;
+
+        fe_values.reinit(cell, face_nr, sub_nr);
+
+        // print some data on the location
+        deallog << "x=" << fe_values.quadrature_point(0) << std::endl;
+        deallog << "n=" << fe_values.normal_vector(0) << std::endl;
+        deallog << "JxW=" << fe_values.JxW(0) << std::endl;
+
+        // now print some data on the shape
+        // functions
+        for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
+          deallog << "shape_function " << i << ":" << std::endl
+                  << "  phi=" << fe_values.shape_value(i,0) << std::endl
+                  << "  grad phi=" << fe_values.shape_grad(i,0) << std::endl
+                  << "  grad^2 phi=" << fe_values.shape_hessian(i,0) << std::endl;
+
+        deallog << std::endl;
       }
 }
 
-  
+
 template<int dim>
 void mapping_test()
 {
   deallog << "dim=" << dim << std::endl;
-  
+
   std::vector<Mapping<dim> *> mapping_ptr;
   std::vector<std::string> mapping_strings;
 
@@ -155,22 +155,22 @@ void mapping_test()
 
   FE_Q<dim> fe_q4(2);
   DoFHandler<dim> dof(tria);
-  dof.distribute_dofs(fe_q4);      
+  dof.distribute_dofs(fe_q4);
 
   typename DoFHandler<dim>::cell_iterator cell = dof.begin_active();
   {
     std::ostringstream ost;
     ost << "MappingFace" << dim << "d-"
-       << mapping_name;
-    deallog << ost.str() << std::endl;     
+        << mapping_name;
+    deallog << ost.str() << std::endl;
     plot_faces(mapping, fe_q4, cell);
   }
 
   {
     std::ostringstream ost;
     ost << "MappingSubface" << dim << "d-"
-       << mapping_name;
-    deallog << ost.str() << std::endl;     
+        << mapping_name;
+    deallog << ost.str() << std::endl;
     plot_subfaces(mapping, fe_q4, cell);
   }
 }
@@ -184,10 +184,10 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
-                                  // ----------------------- 
-                                  // Tests for dim=1
-                                  // -----------------------
+
+  // -----------------------
+  // Tests for dim=1
+  // -----------------------
   mapping_test<1>();
 }
 
index a03421b347205e39edb51985ffc58632b4e0bdff..c72c8003db414e5f54658abf51460e2689fc4268 100644 (file)
 template<int dim>
 inline void
 plot_faces(Mapping<dim> &mapping,
-          FiniteElement<dim> &fe,
-          typename DoFHandler<dim>::cell_iterator &cell)
+           FiniteElement<dim> &fe,
+           typename DoFHandler<dim>::cell_iterator &cell)
 {
-                                  // create a QGauss<0>(4), which should
-                                  // still only have 1 quadrature point
+  // create a QGauss<0>(4), which should
+  // still only have 1 quadrature point
   QGauss<dim-1> q(4);
   Assert (q.size() == 1, ExcInternalError());
 
   FEFaceValues<dim> fe_values(mapping, fe, q,
-                             UpdateFlags(update_q_points
-                                         | update_JxW_values
-                                         | update_values
-                                         | update_gradients
-                                         | update_hessians
-                                         | update_normal_vectors));
+                              UpdateFlags(update_q_points
+                                          | update_JxW_values
+                                          | update_values
+                                          | update_gradients
+                                          | update_hessians
+                                          | update_normal_vectors));
 
   for (unsigned int face_nr=0;
        face_nr < GeometryInfo<dim>::faces_per_cell;
@@ -69,18 +69,18 @@ plot_faces(Mapping<dim> &mapping,
       deallog << "Face=" << face_nr << std::endl;
       fe_values.reinit(cell, face_nr);
 
-                                      // print some data on the location
+      // print some data on the location
       deallog << "x=" << fe_values.quadrature_point(0) << std::endl;
       deallog << "n=" << fe_values.normal_vector(0) << std::endl;
       deallog << "JxW=" << fe_values.JxW(0) << std::endl;
 
-                                      // now print some data on the shape
-                                      // functions
+      // now print some data on the shape
+      // functions
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
-       deallog << "shape_function " << i << ":" << std::endl
-               << "  phi=" << fe_values.shape_value(i,0) << std::endl
-               << "  grad phi=" << fe_values.shape_grad(i,0) << std::endl
-               << "  grad^2 phi=" << fe_values.shape_hessian(i,0) << std::endl;
+        deallog << "shape_function " << i << ":" << std::endl
+                << "  phi=" << fe_values.shape_value(i,0) << std::endl
+                << "  grad phi=" << fe_values.shape_grad(i,0) << std::endl
+                << "  grad^2 phi=" << fe_values.shape_hessian(i,0) << std::endl;
 
       deallog << std::endl;
     }
@@ -91,58 +91,58 @@ plot_faces(Mapping<dim> &mapping,
 template<int dim>
 inline void
 plot_subfaces(Mapping<dim> &mapping,
-             FiniteElement<dim> &fe,
-             typename DoFHandler<dim>::cell_iterator &cell)
+              FiniteElement<dim> &fe,
+              typename DoFHandler<dim>::cell_iterator &cell)
 {
 
-                                  // create a QGauss<0>(4), which should
-                                  // still only have 1 quadrature point
+  // create a QGauss<0>(4), which should
+  // still only have 1 quadrature point
   QGauss<dim-1> q(4);
   Assert (q.size() == 1, ExcInternalError());
 
   FESubfaceValues<dim> fe_values(mapping, fe, q,
-                                UpdateFlags(update_q_points
-                                            | update_JxW_values
-                                            | update_values
-                                            | update_gradients
-                                            | update_hessians
-                                            | update_normal_vectors));
+                                 UpdateFlags(update_q_points
+                                             | update_JxW_values
+                                             | update_values
+                                             | update_gradients
+                                             | update_hessians
+                                             | update_normal_vectors));
   for (unsigned int face_nr=0;
        face_nr < GeometryInfo<dim>::faces_per_cell;
        ++ face_nr)
     for (unsigned int sub_nr=0;
-        sub_nr < GeometryInfo<dim>::max_children_per_face;
-        ++ sub_nr)
+         sub_nr < GeometryInfo<dim>::max_children_per_face;
+         ++ sub_nr)
       {
-       deallog << "Face=" << face_nr
-               << ", subface=" << sub_nr
-               << std::endl;
-       
-       fe_values.reinit(cell, face_nr, sub_nr);
-       
-                                        // print some data on the location
-       deallog << "x=" << fe_values.quadrature_point(0) << std::endl;
-       deallog << "n=" << fe_values.normal_vector(0) << std::endl;
-       deallog << "JxW=" << fe_values.JxW(0) << std::endl;
-
-                                        // now print some data on the shape
-                                        // functions
-       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
-         deallog << "shape_function " << i << ":" << std::endl
-                 << "  phi=" << fe_values.shape_value(i,0) << std::endl
-                 << "  grad phi=" << fe_values.shape_grad(i,0) << std::endl
-                 << "  grad^2 phi=" << fe_values.shape_hessian(i,0) << std::endl;
-
-       deallog << std::endl;
+        deallog << "Face=" << face_nr
+                << ", subface=" << sub_nr
+                << std::endl;
+
+        fe_values.reinit(cell, face_nr, sub_nr);
+
+        // print some data on the location
+        deallog << "x=" << fe_values.quadrature_point(0) << std::endl;
+        deallog << "n=" << fe_values.normal_vector(0) << std::endl;
+        deallog << "JxW=" << fe_values.JxW(0) << std::endl;
+
+        // now print some data on the shape
+        // functions
+        for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
+          deallog << "shape_function " << i << ":" << std::endl
+                  << "  phi=" << fe_values.shape_value(i,0) << std::endl
+                  << "  grad phi=" << fe_values.shape_grad(i,0) << std::endl
+                  << "  grad^2 phi=" << fe_values.shape_hessian(i,0) << std::endl;
+
+        deallog << std::endl;
       }
 }
 
-  
+
 template<int dim>
 void mapping_test()
 {
   deallog << "dim=" << dim << std::endl;
-  
+
   std::vector<Mapping<dim> *> mapping_ptr;
   std::vector<std::string> mapping_strings;
 
@@ -154,22 +154,22 @@ void mapping_test()
 
   FE_Q<dim> fe_q4(2);
   DoFHandler<dim> dof(tria);
-  dof.distribute_dofs(fe_q4);      
+  dof.distribute_dofs(fe_q4);
 
   typename DoFHandler<dim>::cell_iterator cell = dof.begin_active();
   {
     std::ostringstream ost;
     ost << "MappingFace" << dim << "d-"
-       << mapping_name;
-    deallog << ost.str() << std::endl;     
+        << mapping_name;
+    deallog << ost.str() << std::endl;
     plot_faces(mapping, fe_q4, cell);
   }
 
   {
     std::ostringstream ost;
     ost << "MappingSubface" << dim << "d-"
-       << mapping_name;
-    deallog << ost.str() << std::endl;     
+        << mapping_name;
+    deallog << ost.str() << std::endl;
     plot_subfaces(mapping, fe_q4, cell);
   }
 }
@@ -183,10 +183,10 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
-                                  // ----------------------- 
-                                  // Tests for dim=1
-                                  // -----------------------
+
+  // -----------------------
+  // Tests for dim=1
+  // -----------------------
   mapping_test<1>();
 }
 
index 23b984520eac45b08f3461302c4712619841c32e..ba1edc7d30f057f966b320badc13f6f3c38c3bc7 100644 (file)
 template<int dim>
 inline void
 plot_faces(Mapping<dim> &mapping,
-          FiniteElement<dim> &fe,
-          typename DoFHandler<dim>::cell_iterator &cell)
+           FiniteElement<dim> &fe,
+           typename DoFHandler<dim>::cell_iterator &cell)
 {
-                                  // create a QGauss<0>(4), which should
-                                  // still only have 1 quadrature point
+  // create a QGauss<0>(4), which should
+  // still only have 1 quadrature point
   QGauss<dim-1> q(4);
   Assert (q.size() == 1, ExcInternalError());
 
   FEFaceValues<dim> fe_values(mapping, fe, q,
-                             UpdateFlags(update_q_points
-                                         | update_JxW_values
-                                         | update_values
-                                         | update_gradients
-                                         | update_hessians
-                                         | update_normal_vectors));
+                              UpdateFlags(update_q_points
+                                          | update_JxW_values
+                                          | update_values
+                                          | update_gradients
+                                          | update_hessians
+                                          | update_normal_vectors));
 
   for (unsigned int face_nr=0;
        face_nr < GeometryInfo<dim>::faces_per_cell;
@@ -69,18 +69,18 @@ plot_faces(Mapping<dim> &mapping,
       deallog << "Face=" << face_nr << std::endl;
       fe_values.reinit(cell, face_nr);
 
-                                      // print some data on the location
+      // print some data on the location
       deallog << "x=" << fe_values.quadrature_point(0) << std::endl;
       deallog << "n=" << fe_values.normal_vector(0) << std::endl;
       deallog << "JxW=" << fe_values.JxW(0) << std::endl;
 
-                                      // now print some data on the shape
-                                      // functions
+      // now print some data on the shape
+      // functions
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
-       deallog << "shape_function " << i << ":" << std::endl
-               << "  phi=" << fe_values.shape_value(i,0) << std::endl
-               << "  grad phi=" << fe_values.shape_grad(i,0) << std::endl
-               << "  grad^2 phi=" << fe_values.shape_hessian(i,0) << std::endl;
+        deallog << "shape_function " << i << ":" << std::endl
+                << "  phi=" << fe_values.shape_value(i,0) << std::endl
+                << "  grad phi=" << fe_values.shape_grad(i,0) << std::endl
+                << "  grad^2 phi=" << fe_values.shape_hessian(i,0) << std::endl;
 
       deallog << std::endl;
     }
@@ -91,58 +91,58 @@ plot_faces(Mapping<dim> &mapping,
 template<int dim>
 inline void
 plot_subfaces(Mapping<dim> &mapping,
-             FiniteElement<dim> &fe,
-             typename DoFHandler<dim>::cell_iterator &cell)
+              FiniteElement<dim> &fe,
+              typename DoFHandler<dim>::cell_iterator &cell)
 {
 
-                                  // create a QGauss<0>(4), which should
-                                  // still only have 1 quadrature point
+  // create a QGauss<0>(4), which should
+  // still only have 1 quadrature point
   QGauss<dim-1> q(4);
   Assert (q.size() == 1, ExcInternalError());
 
   FESubfaceValues<dim> fe_values(mapping, fe, q,
-                                UpdateFlags(update_q_points
-                                            | update_JxW_values
-                                            | update_values
-                                            | update_gradients
-                                            | update_hessians
-                                            | update_normal_vectors));
+                                 UpdateFlags(update_q_points
+                                             | update_JxW_values
+                                             | update_values
+                                             | update_gradients
+                                             | update_hessians
+                                             | update_normal_vectors));
   for (unsigned int face_nr=0;
        face_nr < GeometryInfo<dim>::faces_per_cell;
        ++ face_nr)
     for (unsigned int sub_nr=0;
-        sub_nr < GeometryInfo<dim>::max_children_per_face;
-        ++ sub_nr)
+         sub_nr < GeometryInfo<dim>::max_children_per_face;
+         ++ sub_nr)
       {
-       deallog << "Face=" << face_nr
-               << ", subface=" << sub_nr
-               << std::endl;
-       
-       fe_values.reinit(cell, face_nr, sub_nr);
-       
-                                        // print some data on the location
-       deallog << "x=" << fe_values.quadrature_point(0) << std::endl;
-       deallog << "n=" << fe_values.normal_vector(0) << std::endl;
-       deallog << "JxW=" << fe_values.JxW(0) << std::endl;
-
-                                        // now print some data on the shape
-                                        // functions
-       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
-         deallog << "shape_function " << i << ":" << std::endl
-                 << "  phi=" << fe_values.shape_value(i,0) << std::endl
-                 << "  grad phi=" << fe_values.shape_grad(i,0) << std::endl
-                 << "  grad^2 phi=" << fe_values.shape_hessian(i,0) << std::endl;
-
-       deallog << std::endl;
+        deallog << "Face=" << face_nr
+                << ", subface=" << sub_nr
+                << std::endl;
+
+        fe_values.reinit(cell, face_nr, sub_nr);
+
+        // print some data on the location
+        deallog << "x=" << fe_values.quadrature_point(0) << std::endl;
+        deallog << "n=" << fe_values.normal_vector(0) << std::endl;
+        deallog << "JxW=" << fe_values.JxW(0) << std::endl;
+
+        // now print some data on the shape
+        // functions
+        for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
+          deallog << "shape_function " << i << ":" << std::endl
+                  << "  phi=" << fe_values.shape_value(i,0) << std::endl
+                  << "  grad phi=" << fe_values.shape_grad(i,0) << std::endl
+                  << "  grad^2 phi=" << fe_values.shape_hessian(i,0) << std::endl;
+
+        deallog << std::endl;
       }
 }
 
-  
+
 template<int dim>
 void mapping_test()
 {
   deallog << "dim=" << dim << std::endl;
-  
+
   std::vector<Mapping<dim> *> mapping_ptr;
   std::vector<std::string> mapping_strings;
 
@@ -154,22 +154,22 @@ void mapping_test()
 
   FE_Q<dim> fe_q4(2);
   DoFHandler<dim> dof(tria);
-  dof.distribute_dofs(fe_q4);      
+  dof.distribute_dofs(fe_q4);
 
   typename DoFHandler<dim>::cell_iterator cell = dof.begin_active();
   {
     std::ostringstream ost;
     ost << "MappingFace" << dim << "d-"
-       << mapping_name;
-    deallog << ost.str() << std::endl;     
+        << mapping_name;
+    deallog << ost.str() << std::endl;
     plot_faces(mapping, fe_q4, cell);
   }
 
   {
     std::ostringstream ost;
     ost << "MappingSubface" << dim << "d-"
-       << mapping_name;
-    deallog << ost.str() << std::endl;     
+        << mapping_name;
+    deallog << ost.str() << std::endl;
     plot_subfaces(mapping, fe_q4, cell);
   }
 }
@@ -183,10 +183,10 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
-                                  // ----------------------- 
-                                  // Tests for dim=1
-                                  // -----------------------
+
+  // -----------------------
+  // Tests for dim=1
+  // -----------------------
   mapping_test<1>();
 }
 
index 065faf60799917d5ba43f24ffc6928b459f9c79d..215c7d98dc3cf85586ebc86896bb730e4e066f20 100644 (file)
 
 template <typename number>
 void print_formatted (const FullMatrix<number> &A,
-                     const unsigned int        precision,
-                     const unsigned int        width)
+                      const unsigned int        precision,
+                      const unsigned int        width)
 {
   for (unsigned int i=0; i<A.m(); ++i)
     {
       for (unsigned int j=0; j<A.n(); ++j)
-       {
-         if (A(i,j) != 0)
-           deallog << std::setw(width) << std::setprecision(precision)
-                   << A(i,j);
-         else
-           deallog << std::setw(width) << std::setprecision(precision)
-                   << "~";
-         deallog << ' ';
-       };
+        {
+          if (A(i,j) != 0)
+            deallog << std::setw(width) << std::setprecision(precision)
+                    << A(i,j);
+          else
+            deallog << std::setw(width) << std::setprecision(precision)
+                    << "~";
+          deallog << ' ';
+        };
       deallog << std::endl;
     };
 }
@@ -60,16 +60,16 @@ void print_formatted (const FullMatrix<number> &A,
 
 template <int dim>
 inline void
-check_prolongation (FiniteElement<dim>& fe, const char* name)
+check_prolongation (FiniteElement<dim> &fe, const char *name)
 {
   deallog << name << '<' << dim << '>' << " constraint " << std::endl;
   print_formatted (fe.constraints(), 7, 10);
 
-  for (unsigned int i=0;i<GeometryInfo<dim>::max_children_per_cell;++i)
+  for (unsigned int i=0; i<GeometryInfo<dim>::max_children_per_cell; ++i)
     {
       deallog << name << '<' << dim << '>' << " prolongation " << i << std::endl;
       if (fe.isotropic_prolongation_is_implemented())
-       print_formatted (fe.get_prolongation_matrix(i), 6, 8);
+        print_formatted (fe.get_prolongation_matrix(i), 6, 8);
     }
 }
 
@@ -77,8 +77,8 @@ check_prolongation (FiniteElement<dim>& fe, const char* name)
 #define CHECK_ALL(EL,deg,dim) { FE_ ## EL<dim> EL(deg); check_prolongation(EL, #EL #deg); }
 #define CHECK_SYS1(sub1,N1,dim) { FESystem<dim> q(sub1, N1); check_prolongation(q, #sub1 #N1); }
 #define CHECK_SYS2(sub1,N1,sub2,N2,dim) { FESystem<dim> q(sub1, N1, sub2, N2); \
-                                          check_prolongation(q, #sub1 #N1 #sub2 #N2); }
+    check_prolongation(q, #sub1 #N1 #sub2 #N2); }
 #define CHECK_SYS3(sub1,N1,sub2,N2,sub3,N3,dim) { FESystem<dim> q(sub1, N1, sub2, N2, sub3, N3); \
-                                          check_prolongation(q, #sub1 #N1 #sub2 #N2 #sub3 #N3); }
+    check_prolongation(q, #sub1 #N1 #sub2 #N2 #sub3 #N3); }
 
 
index 1bd73fcc2ec7e0263c1387e7f18dc981ee24ebed..28a892d23aca32285e9a2dbae1ed9c1d1612e6a4 100644 (file)
@@ -27,7 +27,7 @@ main()
   deallog.threshold_double(1.e-10);
 
   CHECK_SYS3((FESystem<2>(FE_Q<2>(1),3)), 3,
-            FE_DGQ<2>(3), 1,
-            FE_Q<2>(1), 3,
-            2);
+             FE_DGQ<2>(3), 1,
+             FE_Q<2>(1), 3,
+             2);
 }
index 1a625d8792ccacc824bd16a07df2b75788f4f270..413660a6c41a2639857c031de5baa8d155fc4261 100644 (file)
@@ -27,8 +27,8 @@ main()
   deallog.threshold_double(1.e-10);
 
   CHECK_SYS3(FE_DGQ<2>(3), 1,
-            FESystem<2>(FE_DGQ<2>(3),3), 1,
-            FESystem<2>(FE_Q<2>(2),3,
-                        FE_DGQ<2>(0),1),2,
-            2);
+             FESystem<2>(FE_DGQ<2>(3),3), 1,
+             FESystem<2>(FE_Q<2>(2),3,
+                         FE_DGQ<2>(0),1),2,
+             2);
 }
index fbedb17e6148feb254130c9d5e271126aad54082..05cfc9b1e888964d4b9f6bd3d20b8f900245cc46 100644 (file)
@@ -27,8 +27,8 @@ main()
   deallog.threshold_double(1.e-10);
 
   CHECK_SYS3(FE_Nedelec<2>(0), 1,
-            FESystem<2>(FE_DGQ<2>(3),3), 1,
-            FESystem<2>(FE_Q<2>(2),3,
-                        FE_Nedelec<2>(0),2),2,
-            2);
+             FESystem<2>(FE_DGQ<2>(3),3), 1,
+             FESystem<2>(FE_Q<2>(2),3,
+                         FE_Nedelec<2>(0),2),2,
+             2);
 }
index 4b906ad4aa8439c8087603e0b740c49ef9e26747..0e7ff45fe7df53aaf4682a8ea29f0086fd90e0c0 100644 (file)
@@ -26,8 +26,8 @@ main()
   deallog.threshold_double(1.e-10);
 
   CHECK_SYS3(FE_Nedelec<2>(1), 1,
-            FESystem<2>(FE_DGQ<2>(3),3), 1,
-            FESystem<2>(FE_Q<2>(2),3,
-                        FE_Nedelec<2>(1),2),2,
-            2);
+             FESystem<2>(FE_DGQ<2>(3),3), 1,
+             FESystem<2>(FE_Q<2>(2),3,
+                         FE_Nedelec<2>(1),2),2,
+             2);
 }
index dc68db170f44ffdfc3b0f6d815a93657fa8a70f9..afa2afb9d017abb1120e0d9cf00208f7a6d621b1 100644 (file)
@@ -85,7 +85,7 @@ namespace Step22
   class StokesProblem
   {
   public:
-    StokesProblem (const unsigned int degree, FESystem<dim> & fe_);
+    StokesProblem (const unsigned int degree, FESystem<dim> &fe_);
     void run ();
 
   private:
@@ -385,7 +385,7 @@ namespace Step22
   }
 
   template <int dim>
-  StokesProblem<dim>::StokesProblem (const unsigned int degree, FESystem<dim> & fe_)
+  StokesProblem<dim>::StokesProblem (const unsigned int degree, FESystem<dim> &fe_)
     :
     degree (degree),
     triangulation (Triangulation<dim>::maximum_smoothing),
@@ -465,12 +465,12 @@ namespace Step22
                        n_p = dofs_per_block[1];
 
     deallog << "   Number of active cells: "
-           << triangulation.n_active_cells()
-           << std::endl
-           << "   Number of degrees of freedom: "
-           << dof_handler.n_dofs()
-           << " (" << n_u << '+' << n_p << ')'
-           << std::endl;
+            << triangulation.n_active_cells()
+            << std::endl
+            << "   Number of degrees of freedom: "
+            << dof_handler.n_dofs()
+            << " (" << n_u << '+' << n_p << ')'
+            << std::endl;
 
     {
       BlockCompressedSimpleSparsityPattern csp (2,2);
@@ -626,7 +626,7 @@ namespace Step22
                                                 local_dof_indices,
                                                 system_matrix, system_rhs);
       }
-    
+
     A_preconditioner
       = std_cxx1x::shared_ptr<typename InnerPreconditioner<dim>::type>(new
           typename InnerPreconditioner<dim>::type());
@@ -740,7 +740,7 @@ namespace Step22
                                        difference_per_cell, quadrature,
                                        VectorTools::mean,&pressure_mask);
     double integral = difference_per_cell.mean_value()*n_active_cells;
-                                    //std::cout<<"mean difference "<<integral *integral<<std::endl;
+    //std::cout<<"mean difference "<<integral *integral<<std::endl;
     L2_error_pressure -= integral*integral;
 
 //    std::cout<<"Pressure error squared: "<<L2_error_pressure<<std::endl;
@@ -929,9 +929,9 @@ int main ()
   using namespace Step22;
 
   initlog(__FILE__);
+
   deallog.depth_file (1);
-  
+
   unsigned int degree;
   const unsigned int dim=2;
   {
index c6a89d3d93a2f2222356d49a43be019fdab6e316..56891b736a83a0a10aeadf0a016e14fd6584e101 100644 (file)
 
 template <typename number>
 void print_formatted (const FullMatrix<number> &A,
-                     const unsigned int        precision,
-                     const unsigned int        width)
+                      const unsigned int        precision,
+                      const unsigned int        width)
 {
   for (unsigned int i=0; i<A.m(); ++i)
     {
       for (unsigned int j=0; j<A.n(); ++j)
-       {
-         deallog << std::setw(width) << std::setprecision(precision)
-                 << A(i,j);
-         deallog << ' ';
-       };
+        {
+          deallog << std::setw(width) << std::setprecision(precision)
+                  << A(i,j);
+          deallog << ' ';
+        };
       deallog << std::endl;
     };
 }
@@ -56,16 +56,16 @@ void print_formatted (const FullMatrix<number> &A,
 
 template <int dim>
 inline void
-check_restriction (FiniteElement<dim>& fe, const char* name)
+check_restriction (FiniteElement<dim> &fe, const char *name)
 {
   deallog << name << '<' << dim << '>' << " constraint " << std::endl;
   print_formatted (fe.constraints(), 7, 10);
 
-  for (unsigned int i=0;i<GeometryInfo<dim>::max_children_per_cell;++i)
+  for (unsigned int i=0; i<GeometryInfo<dim>::max_children_per_cell; ++i)
     {
       deallog << name << '<' << dim << '>' << " restriction " << i << std::endl;
       if (fe.isotropic_restriction_is_implemented())
-       print_formatted (fe.get_restriction_matrix(i), 6, 8);
+        print_formatted (fe.get_restriction_matrix(i), 6, 8);
     }
 }
 
@@ -73,8 +73,8 @@ check_restriction (FiniteElement<dim>& fe, const char* name)
 #define CHECK_ALL(EL,deg,dim) { FE_ ## EL<dim> EL(deg); check_restriction(EL, #EL #deg); }
 #define CHECK_SYS1(sub1,N1,dim) { FESystem<dim> q(sub1, N1); check_restriction(q, #sub1 #N1); }
 #define CHECK_SYS2(sub1,N1,sub2,N2,dim) { FESystem<dim> q(sub1, N1, sub2, N2); \
-                                          check_restriction(q, #sub1 #N1 #sub2 #N2); }
+    check_restriction(q, #sub1 #N1 #sub2 #N2); }
 #define CHECK_SYS3(sub1,N1,sub2,N2,sub3,N3,dim) { FESystem<dim> q(sub1, N1, sub2, N2, sub3, N3); \
-                                          check_restriction(q, #sub1 #N1 #sub2 #N2 #sub3 #N3); }
+    check_restriction(q, #sub1 #N1 #sub2 #N2 #sub3 #N3); }
 
 
index 48f948639e05855176728252120184751115b15e..8fea59815d304df42113a9e11871237c155e2a72 100644 (file)
@@ -27,7 +27,7 @@ main()
   deallog.threshold_double(1.e-10);
 
   CHECK_SYS3((FESystem<2>(FE_Q<2>(1),3)), 3,
-            FE_DGQ<2>(3), 1,
-            FE_Q<2>(1), 3,
-            2);
+             FE_DGQ<2>(3), 1,
+             FE_Q<2>(1), 3,
+             2);
 }
index 24ab076de822a70d8061160c7e2211d533385a7b..48b4ab5681c8dd9d966bfba609658a81bfa6744a 100644 (file)
@@ -27,8 +27,8 @@ main()
   deallog.threshold_double(1.e-10);
 
   CHECK_SYS3(FE_DGQ<2>(3), 1,
-            FESystem<2>(FE_DGQ<2>(3),3), 1,
-            FESystem<2>(FE_Q<2>(2),3,
-                        FE_DGQ<2>(0),1),2,
-            2);
+             FESystem<2>(FE_DGQ<2>(3),3), 1,
+             FESystem<2>(FE_Q<2>(2),3,
+                         FE_DGQ<2>(0),1),2,
+             2);
 }
index 2333b02e8a424ef4f9b6204586efa3b870ebf0ba..20e5147c966b28cc775e8d4a2025700fec4705b1 100644 (file)
@@ -27,8 +27,8 @@ main()
   deallog.threshold_double(1.e-10);
 
   CHECK_SYS3(FE_Nedelec<2>(0), 1,
-            FESystem<2>(FE_DGQ<2>(3),3), 1,
-            FESystem<2>(FE_Q<2>(2),3,
-                        FE_Nedelec<2>(0),2),2,
-            2);
+             FESystem<2>(FE_DGQ<2>(3),3), 1,
+             FESystem<2>(FE_Q<2>(2),3,
+                         FE_Nedelec<2>(0),2),2,
+             2);
 }
index e114e936b5e6d81045dc90143836a31739635d95..849d7a8b6b69624d2554380ad962e53600ebd447 100644 (file)
@@ -26,8 +26,8 @@ main()
   deallog.threshold_double(1.e-10);
 
   CHECK_SYS3(FE_Nedelec<2>(1), 1,
-            FESystem<2>(FE_DGQ<2>(3),3), 1,
-            FESystem<2>(FE_Q<2>(2),3,
-                        FE_Nedelec<2>(1),2),2,
-            2);
+             FESystem<2>(FE_DGQ<2>(3),3), 1,
+             FESystem<2>(FE_Q<2>(2),3,
+                         FE_Nedelec<2>(1),2),2,
+             2);
 }
index 4a333733f87168ddd745552f93ebd9167898d271..da525b32d4e8028abf7a97c75acc29f0e7302b68 100644 (file)
@@ -40,7 +40,7 @@
 
 template <int dim>
 inline void
-check_support (const FiniteElement<dim>& finel, const char* name)
+check_support (const FiniteElement<dim> &finel, const char *name)
 {
   Triangulation<dim> tr;
   GridGenerator::hyper_cube(tr, 0., 1.);
@@ -51,7 +51,7 @@ check_support (const FiniteElement<dim>& finel, const char* name)
 
   const std::vector<Point<dim> > &cell_points = finel.get_unit_support_points ();
 
-  for (unsigned int k=0;k<cell_points.size();++k)
+  for (unsigned int k=0; k<cell_points.size(); ++k)
     deallog << std::setprecision(3) << cell_points[k] << std::endl;
 
   const std::vector<Point<dim-1> > &face_points = finel.get_unit_face_support_points ();
@@ -59,17 +59,17 @@ check_support (const FiniteElement<dim>& finel, const char* name)
 
   Quadrature<dim-1> q(face_points, dummy_weights);
 
-  for (unsigned int i=0;i<GeometryInfo<dim>::faces_per_cell;++i)
+  for (unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
     {
       std::vector<Point<dim> > q_points (q.get_points().size());
       QProjector<dim>::project_to_face (q, i, q_points);
       Quadrature<dim> qp(q_points);
       deallog << name << '<' << dim << '>' << " face " << i
-               << " support points" << std::endl;
+              << " support points" << std::endl;
 
       for (unsigned int k=0; k<face_points.size(); ++k)
-       deallog << std::setprecision(3) << qp.point(k)
-               << std::endl;
+        deallog << std::setprecision(3) << qp.point(k)
+                << std::endl;
     }
 }
 
@@ -77,8 +77,8 @@ check_support (const FiniteElement<dim>& finel, const char* name)
 #define CHECK_ALL(EL,deg,dim) { FE_ ## EL<dim> EL(deg); check_support(EL, #EL #deg); }
 #define CHECK_SYS1(sub1,N1,dim) { FESystem<dim> q(sub1, N1); check_support(q, #sub1 #N1); }
 #define CHECK_SYS2(sub1,N1,sub2,N2,dim) { FESystem<dim> q(sub1, N1, sub2, N2); \
-                                          check_support(q, #sub1 #N1 #sub2 #N2); }
+    check_support(q, #sub1 #N1 #sub2 #N2); }
 #define CHECK_SYS3(sub1,N1,sub2,N2,sub3,N3,dim) { FESystem<dim> q(sub1, N1, sub2, N2, sub3, N3); \
-                                          check_support(q, #sub1 #N1 #sub2 #N2 #sub3 #N3); }
+    check_support(q, #sub1 #N1 #sub2 #N2 #sub3 #N3); }
 
 
index 793983f5e1a0d945eab5947ceb2cb0705d7c0199..530829c9b649f8a6bdcca82944e3fe92cb0cbc7d 100644 (file)
@@ -27,7 +27,7 @@ main()
   deallog.threshold_double(1.e-10);
 
   CHECK_SYS3((FESystem<2>(FE_Q<2>(1),3)), 3,
-            FE_DGQ<2>(3), 1,
-            FE_Q<2>(1), 3,
-            2);
+             FE_DGQ<2>(3), 1,
+             FE_Q<2>(1), 3,
+             2);
 }
index 0d80340d25f54e1dc4ceef725f2b5af92750313a..cbde6b5330498225057ed2ffecc26b167d8afe8b 100644 (file)
@@ -27,8 +27,8 @@ main()
   deallog.threshold_double(1.e-10);
 
   CHECK_SYS3(FE_DGQ<2>(3), 1,
-            FESystem<2>(FE_DGQ<2>(3),3), 1,
-            FESystem<2>(FE_Q<2>(2),3,
-                        FE_DGQ<2>(0),1),2,
-            2);
+             FESystem<2>(FE_DGQ<2>(3),3), 1,
+             FESystem<2>(FE_Q<2>(2),3,
+                         FE_DGQ<2>(0),1),2,
+             2);
 }
index fb56898cc43625192b1e53fc2c51bc4f7a4b8012..2b983c8a283e60c00ac01369734f7aaa7133f7b2 100644 (file)
@@ -27,8 +27,8 @@ main()
   deallog.threshold_double(1.e-10);
 
   CHECK_SYS3(FE_Nedelec<2>(0), 1,
-            FESystem<2>(FE_DGQ<2>(3),3), 1,
-            FESystem<2>(FE_Q<2>(2),3,
-                        FE_Nedelec<2>(0),2),2,
-            2);
+             FESystem<2>(FE_DGQ<2>(3),3), 1,
+             FESystem<2>(FE_Q<2>(2),3,
+                         FE_Nedelec<2>(0),2),2,
+             2);
 }
index 81cc8b9393ff0d52d4e6e8d9cb106719a34a9776..8233691321c8666724ab7ac2593a77427c136f46 100644 (file)
@@ -26,8 +26,8 @@ main()
   deallog.threshold_double(1.e-10);
 
   CHECK_SYS3(FE_Nedelec<2>(1), 1,
-            FESystem<2>(FE_DGQ<2>(3),3), 1,
-            FESystem<2>(FE_Q<2>(2),3,
-                        FE_Nedelec<2>(1),2),2,
-            2);
+             FESystem<2>(FE_DGQ<2>(3),3), 1,
+             FESystem<2>(FE_Q<2>(2),3,
+                         FE_Nedelec<2>(1),2),2,
+             2);
 }
index f9f0dc8b42001b927104625c52742d0c2807d5f3..d342ebcb15a9c77ca3b3ccffbcb4fde261edb507 100644 (file)
 
 template <typename number>
 void print_formatted (const FullMatrix<number> &A,
-                     const unsigned int        precision,
-                     const unsigned int        width)
+                      const unsigned int        precision,
+                      const unsigned int        width)
 {
   for (unsigned int i=0; i<A.m(); ++i)
     {
       for (unsigned int j=0; j<A.n(); ++j)
-       {
-         if (A(i,j) != 0)
-           deallog << std::setw(width) << std::setprecision(precision)
-                   << A(i,j);
-         else
-           deallog << std::setw(width) << std::setprecision(precision)
-                   << "~";
-         deallog << ' ';
-       };
+        {
+          if (A(i,j) != 0)
+            deallog << std::setw(width) << std::setprecision(precision)
+                    << A(i,j);
+          else
+            deallog << std::setw(width) << std::setprecision(precision)
+                    << "~";
+          deallog << ' ';
+        };
       deallog << std::endl;
     };
 }
@@ -57,7 +57,7 @@ void print_formatted (const FullMatrix<number> &A,
 
 
 template<int dim>
-void test_embedding (const FiniteElement<dim>fe)
+void test_embedding (const FiniteElement<dim> &fe)
 {
   const unsigned int n = fe.dofs_per_cell;
   const unsigned int nc= GeometryInfo<dim>::max_children_per_cell;
@@ -68,17 +68,17 @@ void test_embedding (const FiniteElement<dim>& fe)
   for (unsigned int ref=RefinementCase<dim>::cut_x;
        ref<RefinementCase<dim>::isotropic_refinement+1; ++ref)
     for (unsigned int c=0;
-        c<GeometryInfo<dim>::n_children(RefinementCase<dim>(ref));
-        ++c)
+         c<GeometryInfo<dim>::n_children(RefinementCase<dim>(ref));
+         ++c)
       {
-       P[ref-1].push_back(FullMatrix<double>());
-       P[ref-1][c].reinit(n,n);
+        P[ref-1].push_back(FullMatrix<double>());
+        P[ref-1][c].reinit(n,n);
       }
 
 
   FETools::compute_embedding_matrices(fe, P);
 
-  for (unsigned int i=0;i<nc;++i)
+  for (unsigned int i=0; i<nc; ++i)
     {
       deallog << fe.get_name() << " embedding " << i << std::endl;
       print_formatted(P[RefinementCase<dim>::isotropic_refinement-1][i], 4, 6);
@@ -87,9 +87,9 @@ void test_embedding (const FiniteElement<dim>& fe)
 
 
 template<int dim>
-void test_projection (const FiniteElement<dim>fe1,
-                     const FiniteElement<dim>& fe2,
-                     std::ostream& out)
+void test_projection (const FiniteElement<dim> &fe1,
+                      const FiniteElement<dim> &fe2,
+                      std::ostream &out)
 {
   out << fe1.get_name() << " -> "
       << fe2.get_name() << std::endl;
@@ -103,13 +103,13 @@ void test_projection (const FiniteElement<dim>& fe1,
   for (unsigned int i=0; i<P.m(); ++i)
     for (unsigned int j=0; j<P.n(); ++j)
       if (std::fabs (P(i,j)) < 1e-14)
-       P(i,j) = 0;
+        P(i,j) = 0;
   P.print_formatted(out, 3, false, 5);
 }
 
 
 template<int dim>
-void test_projection (std::ostreamout)
+void test_projection (std::ostream &out)
 {
   FE_DGQ<dim> q0(0);
   FE_DGQ<dim> q1(1);
@@ -154,22 +154,22 @@ void test_projection (std::ostream& out)
 
 
 template<int dim>
-void test_renumbering(const FiniteElement<dim>fe)
+void test_renumbering(const FiniteElement<dim> &fe)
 {
   std::vector<unsigned int> v(fe.dofs_per_cell);
   std::vector<std::vector<unsigned int> > start;
   FETools::compute_component_wise(fe, v, start);
 
   deallog << fe.get_name() << std::endl << '[';
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v[i];
   deallog << " ]" << std::endl;
 
-  for (unsigned int i=0;i<start.size();++i)
+  for (unsigned int i=0; i<start.size(); ++i)
     {
       deallog << "Base " << i << ':';
-      for (unsigned int j=0;j<start[i].size();++j)
-       deallog << ' ' << start[i][j];
+      for (unsigned int j=0; j<start[i].size(); ++j)
+        deallog << ' ' << start[i][j];
       deallog << std::endl;
     }
 
index 94745076f2e71b957cb86031472d0e1249a59acc..c6e0ac7a327aad463dfdc76bbd7943d01e5bb0d2 100644 (file)
 #include <deal.II/base/quadrature.h>
 
 template <int dim>
-void test_fe(const charname)
+void test_fe(const char *name)
 {
-  FiniteElement<dim>fe = FETools::get_fe_from_name<dim>(std::string(name));
+  FiniteElement<dim> *fe = FETools::get_fe_from_name<dim>(std::string(name));
 
   deallog << fe->get_name() << std::endl
-         << '\t' << fe->dofs_per_cell
-         << '\t' << fe->dofs_per_vertex
-         << '\t' << fe->dofs_per_line
-         << '\t' << fe->dofs_per_quad
-         << '\t' << fe->dofs_per_hex
-         << std::endl;
+          << '\t' << fe->dofs_per_cell
+          << '\t' << fe->dofs_per_vertex
+          << '\t' << fe->dofs_per_line
+          << '\t' << fe->dofs_per_quad
+          << '\t' << fe->dofs_per_hex
+          << std::endl;
 }
 
 
@@ -50,7 +50,7 @@ main()
   deallog.attach(logfile);
   deallog.depth_console(0);
 
-                                  // These names are all correct.
+  // These names are all correct.
   test_fe<1>("FE_Q(1)");
   test_fe<1>("FE_Q(2)");
   test_fe<1>("FE_Q<1>(2)");
@@ -69,20 +69,20 @@ main()
   test_fe<2>("FESystem[FESystem<2>[FE_Q<2>(2)^2-FE_DGQ<2>(1)]^2-FE_Q(1)]");
   test_fe<2>("FESystem[FESystem[FESystem[FE_Q(1)^2-FE_Q(1)]^2]-FESystem[FE_Q(1)^2]-FESystem[FE_Q(1)-FE_DGP(0)]]");
 
-                                  // Now set up a list of malformed
-                                  // names
-  std::vector<const char*> names;
+  // Now set up a list of malformed
+  // names
+  std::vector<const char *> names;
 //  names.push_back("FE_Q[2]");
 
-  for(unsigned int i=0;i<names.size();++i)
+  for (unsigned int i=0; i<names.size(); ++i)
     {
       try
-       {
-         test_fe<2>(names[i]);
-       }
-      catch(ExceptionBase& e)
-       {
-         logfile << e.what();
-       }
+        {
+          test_fe<2>(names[i]);
+        }
+      catch (ExceptionBase &e)
+        {
+          logfile << e.what();
+        }
     }
 }
index 4e6ef8c0e2a5311fa8f2d961b44cc0895d366838..741b3355df380144616cdb6bac6485629595581e 100644 (file)
@@ -39,7 +39,7 @@
 #include <deal.II/numerics/vector_tools.h>
 #include <deal.II/numerics/data_out.h>
 
-                                // This is needed for C++ output:
+// This is needed for C++ output:
 #include <fstream>
 #include <cmath>
 
@@ -47,18 +47,18 @@ const double pi=std::acos(-1.);
 
 class TestFunction: public Function<2>
 {
-  public:
-    TestFunction() {}
-    virtual ~TestFunction() {}
-    
-    virtual double value(const Point<2> &p,
-                        const unsigned int component) const;
+public:
+  TestFunction() {}
+  virtual ~TestFunction() {}
+
+  virtual double value(const Point<2> &p,
+                       const unsigned int component) const;
 };
 
 
 double
 TestFunction::value(const Point<2> &p,
-                   const unsigned int component) const
+                    const unsigned int component) const
 {
   Assert(component==0, ExcInternalError());
   return std::sin(pi*p(0))*std::cos(pi*p(1));
@@ -74,7 +74,7 @@ void make_grid (Triangulation<2> &triangulation)
   const Point<2> p0=triangulation.begin_active()->vertex(0);
 
   triangulation.refine_global(1);
-  
+
   for (unsigned int step=0; step<1; ++step)
     {
       Triangulation<2>::active_cell_iterator cell, endc;
@@ -82,11 +82,11 @@ void make_grid (Triangulation<2> &triangulation)
       endc = triangulation.end();
 
       for (; cell!=endc; ++cell)
-       if (cell->vertex(0)==p0)
-         {
-           cell->set_refine_flag ();
-           break;
-         }
+        if (cell->vertex(0)==p0)
+          {
+            cell->set_refine_flag ();
+            break;
+          }
 
       triangulation.execute_coarsening_and_refinement ();
     };
@@ -95,12 +95,12 @@ void make_grid (Triangulation<2> &triangulation)
 
 template<int dim>
 void test(const Triangulation<dim> &tria,
-         const Mapping<dim> &mapping,
-         const FiniteElement<dim> &fe1,
-         const std::string &fe_string1,
-         const FiniteElement<dim> &fe2,
-         const std::string &fe_string2,
-         const unsigned int testcase)
+          const Mapping<dim> &mapping,
+          const FiniteElement<dim> &fe1,
+          const std::string &fe_string1,
+          const FiniteElement<dim> &fe2,
+          const std::string &fe_string2,
+          const unsigned int testcase)
 {
   DoFHandler<dim> dof_handler1 (tria);
   DoFHandler<dim> dof_handler2 (tria);
@@ -119,32 +119,32 @@ void test(const Triangulation<dim> &tria,
   ConstraintMatrix constraints2;
   DoFTools::make_hanging_node_constraints (dof_handler2, constraints2);
   constraints2.close();
-  
+
   QGauss<dim> quadrature(4);
   TestFunction function;
   VectorTools::project(mapping,
-    dof_handler1,
-    constraints1,
-    quadrature,
-    function,
-    function1);
+                       dof_handler1,
+                       constraints1,
+                       quadrature,
+                       function,
+                       function1);
 
   switch (testcase)
     {
-      case 1:
-           FETools::interpolate(dof_handler1, function1,
-                                dof_handler2, constraints2, function2);
-           break;
-      case 2:
-           FETools::back_interpolate(dof_handler1, constraints1, function1,
-                                     dof_handler2, constraints2, function1_back);
-           break;
-      case 3:
-           FETools::interpolation_difference(dof_handler1, constraints1, function1,
-                                             dof_handler2, constraints2, function1_back);
-           break;
-      default:
-           Assert(false, ExcNotImplemented());
+    case 1:
+      FETools::interpolate(dof_handler1, function1,
+                           dof_handler2, constraints2, function2);
+      break;
+    case 2:
+      FETools::back_interpolate(dof_handler1, constraints1, function1,
+                                dof_handler2, constraints2, function1_back);
+      break;
+    case 3:
+      FETools::interpolation_difference(dof_handler1, constraints1, function1,
+                                        dof_handler2, constraints2, function1_back);
+      break;
+    default:
+      Assert(false, ExcNotImplemented());
     }
 
   DataOut<dim> data_out;
@@ -160,26 +160,26 @@ void test(const Triangulation<dim> &tria,
   std::string file2_name=fe_string1+"_";
   switch (testcase)
     {
-      case 1:
-           data_out.attach_dof_handler (dof_handler2);
-           data_out.add_data_vector (function2, fe_string2);
-           file2_name+=fe_string2+"_interpolation.gnuplot";
-           break;
-      case 2:
-           data_out.attach_dof_handler (dof_handler1);
-           data_out.add_data_vector (function1_back, fe_string1);
-           file2_name+=fe_string2+"_back_interpolation.gnuplot";
-           break;
-      case 3:
-           data_out.attach_dof_handler (dof_handler1);
-           data_out.add_data_vector (function1_back, fe_string1);
-           file2_name+=fe_string2+"_interpolation_diff.gnuplot";
-           break;
-      default:
-           Assert(false, ExcNotImplemented());
+    case 1:
+      data_out.attach_dof_handler (dof_handler2);
+      data_out.add_data_vector (function2, fe_string2);
+      file2_name+=fe_string2+"_interpolation.gnuplot";
+      break;
+    case 2:
+      data_out.attach_dof_handler (dof_handler1);
+      data_out.add_data_vector (function1_back, fe_string1);
+      file2_name+=fe_string2+"_back_interpolation.gnuplot";
+      break;
+    case 3:
+      data_out.attach_dof_handler (dof_handler1);
+      data_out.add_data_vector (function1_back, fe_string1);
+      file2_name+=fe_string2+"_interpolation_diff.gnuplot";
+      break;
+    default:
+      Assert(false, ExcNotImplemented());
     }
   deallog << file2_name << std::endl;
-  
+
   data_out.build_patches (2);
   data_out.write_gnuplot(deallog.get_file_stream());
 //  std::ofstream file2(file2_name.c_str());
@@ -190,18 +190,18 @@ void test(const Triangulation<dim> &tria,
 
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("fe_tools_test/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   Triangulation<2> tria;
   MappingQ1<2> mapping;
-  
+
   make_grid (tria);
-  
+
   deallog.push("dg2dg1_int");
   test(tria, mapping, FE_DGQ<2>(2), "dg2", FE_DGQ<2>(1), "dg1", 1);
   deallog.pop();
index d398c82bb8a70db5a38ffb5236ee7b0ab3051bb7..2e535eb8495954599ad82e6297c98b961decf1ce 100644 (file)
 // Call this function with a system consisting of several copies of
 // the SAME element
 template<int dim>
-void vector_values(const FiniteElement<dim>fe)
+void vector_values(const FiniteElement<dim> &fe)
 {
   Assert(fe.n_base_elements() == 1, ExcNotImplemented());
   deallog.push(fe.get_name());
-  
+
   QTrapez<dim> quadrature;
   std::vector<unsigned int> renumbering(fe.dofs_per_cell);
   std::vector<std::vector<unsigned int> > component_start;
@@ -56,15 +56,15 @@ void vector_values(const FiniteElement<dim>& fe)
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
   DoFRenumbering::component_wise(dof);
-  
+
   Vector<float> v(dof.n_dofs());
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
-  
+
   FEValues<dim> feval(fe, quadrature, update_values);
   std::vector<Vector<double> > local(quadrature.size(),
-                                    Vector<double>(fe.n_components()));
-  
+                                     Vector<double>(fe.n_components()));
+
   typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active();
   const typename DoFHandler<dim>::active_cell_iterator end = dof.end();
 
@@ -74,13 +74,13 @@ void vector_values(const FiniteElement<dim>& fe)
       deallog << "Cell " << cell_no++ << std::endl;
       feval.reinit(cell);
       feval.get_function_values(v, local);
-      for (unsigned int c=0;c<fe.n_components();++c)
-       {
-         deallog << "Component " << c;
-         for (unsigned int k=0;k<quadrature.size();++k)
-           deallog << '\t' << (int) local[k](c);
-         deallog << std::endl;
-       }
+      for (unsigned int c=0; c<fe.n_components(); ++c)
+        {
+          deallog << "Component " << c;
+          for (unsigned int k=0; k<quadrature.size(); ++k)
+            deallog << '\t' << (int) local[k](c);
+          deallog << std::endl;
+        }
       ++cell;
     }
   deallog.pop();
@@ -104,6 +104,6 @@ int main()
   deallog.threshold_double(1.e-10);
 
   test_vectors<2>();
-  
+
   return 0;
 }
index 004818069bafc20bfda300c6dbf18a79e252de55..889db07672fa3748b2b5abd963ca7badc829b367 100644 (file)
@@ -1,6 +1,6 @@
 //----------------------------  injection_common.cc  ---------------------------
 //    $Id$
-//    Version: $Name$ 
+//    Version: $Name$
 //
 //    Copyright (C) 2006, 2007, 2008 by the deal.II authors
 //
@@ -45,69 +45,69 @@ void test ();
 
 template <int dim>
 void do_check (const FiniteElement<dim> &coarse_fe,
-              const FiniteElement<dim> &fine_fe)
+               const FiniteElement<dim> &fine_fe)
 {
   FullMatrix<double> injection_1 (fine_fe.dofs_per_cell,
-                                 coarse_fe.dofs_per_cell);
+                                  coarse_fe.dofs_per_cell);
   FullMatrix<double> injection_2 (fine_fe.dofs_per_cell,
-                                 coarse_fe.dofs_per_cell);
+                                  coarse_fe.dofs_per_cell);
 
   for (unsigned int child_1=0; child_1<GeometryInfo<dim>::max_children_per_cell;
        ++child_1)
     for (unsigned int child_2=0; child_2<GeometryInfo<dim>::max_children_per_cell;
-        ++child_2)
+         ++child_2)
       {
-       injection_1 = 0;
-       injection_2 = 0;
-       
-                                        // check 1: first to finer fe, then
-                                        // to finer cells
-       {
-         FullMatrix<double> tmp1 (fine_fe.dofs_per_cell,
-                                  coarse_fe.dofs_per_cell);
-         FullMatrix<double> tmp2 (fine_fe.dofs_per_cell,
-                                  coarse_fe.dofs_per_cell);
-         fine_fe.get_interpolation_matrix (coarse_fe,
-                                           tmp1);
-         fine_fe.get_prolongation_matrix (child_1)
-           .mmult (tmp2, tmp1);
-         fine_fe.get_prolongation_matrix (child_2)
-           .mmult (injection_1, tmp2);
-       }
-
-                                        // check 2: first to finer cells,
-                                        // then to finer fe
-       {
-         FullMatrix<double> tmp1 (coarse_fe.dofs_per_cell,
-                                  coarse_fe.dofs_per_cell);
-         FullMatrix<double> tmp2 (fine_fe.dofs_per_cell,
-                                  coarse_fe.dofs_per_cell);
-
-         coarse_fe.get_prolongation_matrix (child_2)
-           .mmult (tmp1, coarse_fe.get_prolongation_matrix (child_1));
-
-         fine_fe.get_interpolation_matrix (coarse_fe,
-                                           tmp2);
-         tmp2.mmult (injection_2, tmp1);
-       }
-
-                                        // print one of the matrices. to
-                                        // reduce output, do so only for the
-                                        // some of the matrices
-       if (child_1 == ((child_2+1) % GeometryInfo<dim>::max_children_per_cell))
-         for (unsigned int i=0; i<fine_fe.dofs_per_cell; ++i)
-           for (unsigned int j=0; j<coarse_fe.dofs_per_cell; ++j)
-             deallog << i << ' ' << j << ' ' << injection_1(i,j)
-                     << std::endl;
-
-                                        // make sure that the two matrices
-                                        // are pretty much equal
-       for (unsigned int i=0; i<fine_fe.dofs_per_cell; ++i)
-         for (unsigned int j=0; j<coarse_fe.dofs_per_cell; ++j)
-           injection_2(i,j) -= injection_1(i,j);
-       Assert (injection_2.frobenius_norm() <=
-               1e-12 * injection_1.frobenius_norm(),
-               ExcInternalError());
+        injection_1 = 0;
+        injection_2 = 0;
+
+        // check 1: first to finer fe, then
+        // to finer cells
+        {
+          FullMatrix<double> tmp1 (fine_fe.dofs_per_cell,
+                                   coarse_fe.dofs_per_cell);
+          FullMatrix<double> tmp2 (fine_fe.dofs_per_cell,
+                                   coarse_fe.dofs_per_cell);
+          fine_fe.get_interpolation_matrix (coarse_fe,
+                                            tmp1);
+          fine_fe.get_prolongation_matrix (child_1)
+          .mmult (tmp2, tmp1);
+          fine_fe.get_prolongation_matrix (child_2)
+          .mmult (injection_1, tmp2);
+        }
+
+        // check 2: first to finer cells,
+        // then to finer fe
+        {
+          FullMatrix<double> tmp1 (coarse_fe.dofs_per_cell,
+                                   coarse_fe.dofs_per_cell);
+          FullMatrix<double> tmp2 (fine_fe.dofs_per_cell,
+                                   coarse_fe.dofs_per_cell);
+
+          coarse_fe.get_prolongation_matrix (child_2)
+          .mmult (tmp1, coarse_fe.get_prolongation_matrix (child_1));
+
+          fine_fe.get_interpolation_matrix (coarse_fe,
+                                            tmp2);
+          tmp2.mmult (injection_2, tmp1);
+        }
+
+        // print one of the matrices. to
+        // reduce output, do so only for the
+        // some of the matrices
+        if (child_1 == ((child_2+1) % GeometryInfo<dim>::max_children_per_cell))
+          for (unsigned int i=0; i<fine_fe.dofs_per_cell; ++i)
+            for (unsigned int j=0; j<coarse_fe.dofs_per_cell; ++j)
+              deallog << i << ' ' << j << ' ' << injection_1(i,j)
+                      << std::endl;
+
+        // make sure that the two matrices
+        // are pretty much equal
+        for (unsigned int i=0; i<fine_fe.dofs_per_cell; ++i)
+          for (unsigned int j=0; j<coarse_fe.dofs_per_cell; ++j)
+            injection_2(i,j) -= injection_1(i,j);
+        Assert (injection_2.frobenius_norm() <=
+                1e-12 * injection_1.frobenius_norm(),
+                ExcInternalError());
       }
 }
 
@@ -118,7 +118,7 @@ int main ()
 {
   std::ofstream logfile(logname);
   deallog << std::setprecision (3);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
index 3d2f0377cdfef6057751ba5c1c9d6e3556c56c2b..300c0bdb8ec99d2b6c6142842257340e90f1f9eb 100644 (file)
@@ -27,10 +27,10 @@ void test ()
   for (unsigned int i=1; i<4; ++i)
     for (unsigned int j=i; j<4; ++j)
       {
-       deallog << "inj " << i << " " << j << ":" << std::endl;
-       
-       
-       do_check (FE_Q_DG0<dim>(i), FE_Q_DG0<dim>(j));
+        deallog << "inj " << i << " " << j << ":" << std::endl;
+
+
+        do_check (FE_Q_DG0<dim>(i), FE_Q_DG0<dim>(j));
       }
-  
+
 }
index 8cb3c8c0ab5b2d2bbb0a223520b128366b1222e3..8109aafcd7ce001144f33a58b30f3f620b670e89 100644 (file)
@@ -28,7 +28,7 @@ void test ()
   for (unsigned int i=1; i<4; ++i)
     for (unsigned int j=i; j<4; ++j)
       do_check (FESystem<dim>(FE_Q<dim>(i), 1,
-                             FE_DGQ<dim>(i-1), 1),
-               FESystem<dim>(FE_Q<dim>(j), 1,
-                             FE_DGQ<dim>(j-1), 1));
+                              FE_DGQ<dim>(i-1), 1),
+                FESystem<dim>(FE_Q<dim>(j), 1,
+                              FE_DGQ<dim>(j-1), 1));
 }
index bb030ae8d8d76b7ffe681d2d8116f333dada85bd..03b547a2cdce85f24a18a437024cc170db2f6f45 100644 (file)
@@ -1,6 +1,6 @@
 //----------------------------------------------------------------------
 //    $Id$
-//    Version: $Name$ 
+//    Version: $Name$
 //
 //    Copyright (C) 2005, 2006, 2008, 2010 by the deal.II authors
 //
 
 template <int dim>
 double difference(
-  const FiniteElement<dim>fe,
+  const FiniteElement<dim> &fe,
   const std::vector<double> dofs,
-  const Function<dim>function)
+  const Function<dim> &function)
 {
   double result = 0.;
   QGauss<dim> quadrature(fe.degree+1);
-  
+
   std::vector<double> f(quadrature.size());
   function.value_list(quadrature.get_points(), f);
-  
-  for (unsigned int k=0;k<quadrature.size();++k)
+
+  for (unsigned int k=0; k<quadrature.size(); ++k)
     {
       double diff = f[k];
-      for (unsigned int i=0;i<dofs.size();++i)
-       diff -= dofs[i] * fe.shape_value(i, quadrature.point(k));
+      for (unsigned int i=0; i<dofs.size(); ++i)
+        diff -= dofs[i] * fe.shape_value(i, quadrature.point(k));
       diff = std::abs(diff);
       result = std::max(result, diff);
     }
@@ -49,28 +49,28 @@ double difference(
 
 template <int dim>
 double vector_difference(
-  const FiniteElement<dim>fe,
+  const FiniteElement<dim> &fe,
   const std::vector<double> dofs,
-  const Function<dim>function,
+  const Function<dim> &function,
   const unsigned int offset)
 {
   double result = 0.;
   QGauss<dim> quadrature(fe.degree+1);
-  
+
   std::vector<Vector<double> > f(quadrature.size(),
-                                Vector<double>(function.n_components));
+                                 Vector<double>(function.n_components));
 
   function.vector_value_list(quadrature.get_points(), f);
-  
-  for (unsigned int k=0;k<quadrature.size();++k)
-    for (unsigned int comp=0;comp<fe.n_components();++comp)
+
+  for (unsigned int k=0; k<quadrature.size(); ++k)
+    for (unsigned int comp=0; comp<fe.n_components(); ++comp)
       {
-       double diff = f[k](comp+offset);
-       for (unsigned int i=0;i<dofs.size();++i)
-         diff -= dofs[i] * fe.shape_value_component(i, quadrature.point(k),
-                                                    comp);
-       diff = std::abs(diff);
-       result = std::max(result, diff);
+        double diff = f[k](comp+offset);
+        for (unsigned int i=0; i<dofs.size(); ++i)
+          diff -= dofs[i] * fe.shape_value_component(i, quadrature.point(k),
+                                                     comp);
+        diff = std::abs(diff);
+        result = std::max(result, diff);
       }
   return result;
 }
@@ -81,60 +81,60 @@ double vector_difference(
 
 template<int dim, int degree, int COMP=1>
 class
-Q1WedgeFunction : public Function<dim>
+  Q1WedgeFunction : public Function<dim>
 {
-  public:
-    Q1WedgeFunction() : Function<dim> (COMP)
-      {}
-    
-    double value (const Point<dim>   &p,
-                 const unsigned int c) const
-      {
-       double result = 1.;
-       for (unsigned int d=0;d<dim;++d)
-         for (unsigned int k=0;k<degree;++k)
-           result *= p(d) + c;
-       return result;
-      }
-    
-    void value_list (const std::vector<Point<dim> > &points,
-                    std::vector<double>            &values,
-                    const unsigned int c) const
+public:
+  Q1WedgeFunction() : Function<dim> (COMP)
+  {}
+
+  double value (const Point<dim>   &p,
+                const unsigned int c) const
+  {
+    double result = 1.;
+    for (unsigned int d=0; d<dim; ++d)
+      for (unsigned int k=0; k<degree; ++k)
+        result *= p(d) + c;
+    return result;
+  }
+
+  void value_list (const std::vector<Point<dim> > &points,
+                   std::vector<double>            &values,
+                   const unsigned int c) const
+  {
+    Assert (values.size() == points.size(),
+            ExcDimensionMismatch(values.size(), points.size()));
+
+    for (unsigned int i=0; i<points.size(); ++i)
       {
-       Assert (values.size() == points.size(),
-               ExcDimensionMismatch(values.size(), points.size()));
-       
-       for (unsigned int i=0;i<points.size();++i)
-         {
-           const Point<dim>& p = points[i];
-           double result = 1.;
-           for (unsigned int d=0;d<dim;++d)
-             for (unsigned int k=0;k<degree;++k)
-               result *= p(d) + c;
-           values[i] = result;
-         }
+        const Point<dim> &p = points[i];
+        double result = 1.;
+        for (unsigned int d=0; d<dim; ++d)
+          for (unsigned int k=0; k<degree; ++k)
+            result *= p(d) + c;
+        values[i] = result;
       }
+  }
+
+  void vector_value_list (const std::vector<Point<dim> > &points,
+                          std::vector<Vector<double> >   &values) const
+  {
+    Assert (values.size() == points.size(),
+            ExcDimensionMismatch(values.size(), points.size()));
+    Assert (values[0].size() == this->n_components,
+            ExcDimensionMismatch(values.size(), this->n_components));
 
-    void vector_value_list (const std::vector<Point<dim> > &points,
-                           std::vector<Vector<double> >&   values) const
+    for (unsigned int i=0; i<points.size(); ++i)
       {
-       Assert (values.size() == points.size(),
-               ExcDimensionMismatch(values.size(), points.size()));
-       Assert (values[0].size() == this->n_components,
-               ExcDimensionMismatch(values.size(), this->n_components));
-       
-       for (unsigned int i=0;i<points.size();++i)
-         {
-           const Point<dim>& p = points[i];
-           for (unsigned int c=0;c<COMP;++c)
-             {
-               double result = 1.;
-               for (unsigned int d=0;d<dim;++d)
-                 for (unsigned int k=0;k<degree;++k)
-                   result *= p(d);
-               values[i](c) = result;
-             }
-         }
+        const Point<dim> &p = points[i];
+        for (unsigned int c=0; c<COMP; ++c)
+          {
+            double result = 1.;
+            for (unsigned int d=0; d<dim; ++d)
+              for (unsigned int k=0; k<degree; ++k)
+                result *= p(d);
+            values[i](c) = result;
+          }
       }
+  }
 };
 
index 83005f0b9955815b021d5ff854231aa0a13c871b..7f96f854523fb4d70847c10e648e2b89811521e3 100644 (file)
 // FE_DGQ<dim>::interpolate(...)
 
 template <int dim>
-void check(const Function<dim>f,
-          const unsigned int degree)
+void check(const Function<dim> &f,
+           const unsigned int degree)
 {
   FE_Q<dim> fe(degree);
   deallog << fe.get_name() << ' ';
-  
+
   std::vector<double> dofs(fe.dofs_per_cell);
-  
+
   std::vector<std::vector<double> >
-    values(1, std::vector<double>(fe.get_unit_support_points().size()));
+  values(1, std::vector<double>(fe.get_unit_support_points().size()));
   f.value_list(fe.get_unit_support_points(), values[0]);
   fe.interpolate(dofs, values[0]);
   deallog << " value " << difference(fe,dofs,f);
@@ -45,23 +45,23 @@ void check(const Function<dim>& f,
   deallog << " vector " << difference(fe,dofs,f);
 
   std::vector<Vector<double> >
-    vectors(fe.get_unit_support_points().size(), Vector<double>(1));
+  vectors(fe.get_unit_support_points().size(), Vector<double>(1));
   f.vector_value_list(fe.get_unit_support_points(), vectors);
   fe.interpolate(dofs, vectors, 0);
   deallog << " Vector " << difference(fe,dofs,f) << std::endl;
 }
 
 template <int dim>
-void check_dg(const Function<dim>f,
-             const unsigned int degree)
+void check_dg(const Function<dim> &f,
+              const unsigned int degree)
 {
   FE_DGQ<dim> fe(degree);
   deallog << fe.get_name() << ' ';
-  
+
   std::vector<double> dofs(fe.dofs_per_cell);
-  
+
   std::vector<std::vector<double> >
-    values(1, std::vector<double>(fe.get_unit_support_points().size()));
+  values(1, std::vector<double>(fe.get_unit_support_points().size()));
   f.value_list(fe.get_unit_support_points(), values[0]);
   fe.interpolate(dofs, values[0]);
   deallog << " value " << difference(fe,dofs,f);
@@ -69,24 +69,24 @@ void check_dg(const Function<dim>& f,
   deallog << " vector " << difference(fe,dofs,f);
 
   std::vector<Vector<double> >
-    vectors(fe.get_unit_support_points().size(), Vector<double>(1));
+  vectors(fe.get_unit_support_points().size(), Vector<double>(1));
   f.vector_value_list(fe.get_unit_support_points(), vectors);
   fe.interpolate(dofs, vectors, 0);
   deallog << " Vector " << difference(fe,dofs,f) << std::endl;
 }
 
 template <int dim>
-void check_dg_lobatto(const Function<dim>f,
-                     const unsigned int degree)
+void check_dg_lobatto(const Function<dim> &f,
+                      const unsigned int degree)
 {
   QGaussLobatto<1> fe_quadrature(degree);
   FE_DGQArbitraryNodes<dim> fe(fe_quadrature);
   deallog << fe.get_name() << ' ';
-  
+
   std::vector<double> dofs(fe.dofs_per_cell);
-  
+
   std::vector<std::vector<double> >
-    values(1, std::vector<double>(fe.get_unit_support_points().size()));
+  values(1, std::vector<double>(fe.get_unit_support_points().size()));
   f.value_list(fe.get_unit_support_points(), values[0]);
   fe.interpolate(dofs, values[0]);
   deallog << " value " << difference(fe,dofs,f);
@@ -94,7 +94,7 @@ void check_dg_lobatto(const Function<dim>& f,
   deallog << " vector " << difference(fe,dofs,f);
 
   std::vector<Vector<double> >
-    vectors(fe.get_unit_support_points().size(), Vector<double>(1));
+  vectors(fe.get_unit_support_points().size(), Vector<double>(1));
   f.vector_value_list(fe.get_unit_support_points(), vectors);
   fe.interpolate(dofs, vectors, 0);
   deallog << " Vector " << difference(fe,dofs,f) << std::endl;
index 4981bd9a8e998db3109a5e111dbc36a0b4cc8d25..a0e6dcef928148799eecc44dcd010b48ac9f7f2b 100644 (file)
 // FE_Q_DG0<dim>::interpolate(...)
 
 template <int dim>
-void check_q_dg0(const Function<dim>f,
-                const unsigned int degree)
+void check_q_dg0(const Function<dim> &f,
+                 const unsigned int degree)
 {
   FE_Q_DG0<dim> fe(degree);
   deallog << fe.get_name() << ' ';
-  
+
   std::vector<double> dofs(fe.dofs_per_cell);
-  
+
   std::vector<std::vector<double> >
-    values(1, std::vector<double>(fe.get_unit_support_points().size()));
+  values(1, std::vector<double>(fe.get_unit_support_points().size()));
   f.value_list(fe.get_unit_support_points(), values[0]);
   fe.interpolate(dofs, values[0]);
   deallog << " value " << difference(fe,dofs,f);
@@ -41,7 +41,7 @@ void check_q_dg0(const Function<dim>& f,
   deallog << " vector " << difference(fe,dofs,f);
 
   std::vector<Vector<double> >
-    vectors(fe.get_unit_support_points().size(), Vector<double>(1));
+  vectors(fe.get_unit_support_points().size(), Vector<double>(1));
   f.vector_value_list(fe.get_unit_support_points(), vectors);
   fe.interpolate(dofs, vectors, 0);
   deallog << " Vector " << difference(fe,dofs,f) << std::endl;
index c9cf717e1e441a270f4b62f423af4189f7d16e55..afdb76e61df8cf3043d99622e75f58cc85b7b632 100644 (file)
 // FE_Q_iso_Q1<dim>::interpolate(...)
 
 template <int dim>
-void check(const Function<dim>f,
-          const unsigned int degree)
+void check(const Function<dim> &f,
+           const unsigned int degree)
 {
   FE_Q_iso_Q1<dim> fe(degree);
   deallog << fe.get_name() << ' ';
-  
+
   std::vector<double> dofs(fe.dofs_per_cell);
-  
+
   std::vector<std::vector<double> >
-    values(1, std::vector<double>(fe.get_unit_support_points().size()));
+  values(1, std::vector<double>(fe.get_unit_support_points().size()));
   f.value_list(fe.get_unit_support_points(), values[0]);
   fe.interpolate(dofs, values[0]);
   deallog << " value " << difference(fe,dofs,f);
@@ -43,7 +43,7 @@ void check(const Function<dim>& f,
   deallog << " vector " << difference(fe,dofs,f);
 
   std::vector<Vector<double> >
-    vectors(fe.get_unit_support_points().size(), Vector<double>(1));
+  vectors(fe.get_unit_support_points().size(), Vector<double>(1));
   f.vector_value_list(fe.get_unit_support_points(), vectors);
   fe.interpolate(dofs, vectors, 0);
   deallog << " Vector " << difference(fe,dofs,f) << std::endl;
index 3ef4ae186d22d46e8ad9b429a44c6db09a6352f1..0d72e6386d47954be0e30c32e5d6db7ce92fc73a 100644 (file)
 // FE_RaviartThomas<dim>::interpolate(...)
 
 template <int dim>
-void check1(const Function<dim>f,
-           const unsigned int degree)
+void check1(const Function<dim> &f,
+            const unsigned int degree)
 {
   FE_RaviartThomas<dim> fe(degree);
   deallog << fe.get_name() << ' ';
   deallog << fe.get_generalized_support_points().size() << ' ';
-  
+
   std::vector<double> dofs(fe.dofs_per_cell);
-  
+
   std::vector<std::vector<double> >
-    values(dim, std::vector<double>(fe.get_generalized_support_points().size()));
+  values(dim, std::vector<double>(fe.get_generalized_support_points().size()));
   std::vector<Vector<double> >
-    vectors(fe.get_generalized_support_points().size(),
-           Vector<double>(dim));
+  vectors(fe.get_generalized_support_points().size(),
+          Vector<double>(dim));
   f.vector_value_list(fe.get_generalized_support_points(), vectors);
 
-  for (unsigned int c=0;c<values.size();++c)
-    for (unsigned int k=0;k<values[c].size();++k)
+  for (unsigned int c=0; c<values.size(); ++c)
+    for (unsigned int k=0; k<values[c].size(); ++k)
       values[c][k] = vectors[k](c);
-  
+
   fe.interpolate(dofs, values);
   deallog << " vector " << vector_difference(fe,dofs,f,0);
-  
+
   fe.interpolate(dofs, vectors, 0);
   deallog << " Vector " << vector_difference(fe,dofs,f,0) << std::endl;
 }
index 627d735a50e3863a6cd11257366248438b83b747..6f4059555a568ca9ef820ca0690b494b228cc608 100644 (file)
 // FE_RaviartThomasNodal<dim>::interpolate(...)
 
 template <int dim>
-void check1(const Function<dim>f,
-           const unsigned int degree)
+void check1(const Function<dim> &f,
+            const unsigned int degree)
 {
   FE_RaviartThomasNodal<dim> fe(degree);
   deallog << fe.get_name() << ' ';
   deallog << fe.get_generalized_support_points().size() << ' ';
-  
+
   std::vector<double> dofs(fe.dofs_per_cell);
-  
+
   std::vector<std::vector<double> >
-    values(dim, std::vector<double>(fe.get_generalized_support_points().size()));
+  values(dim, std::vector<double>(fe.get_generalized_support_points().size()));
   std::vector<Vector<double> >
-    vectors(fe.get_generalized_support_points().size(),
-           Vector<double>(dim));
+  vectors(fe.get_generalized_support_points().size(),
+          Vector<double>(dim));
   f.vector_value_list(fe.get_generalized_support_points(), vectors);
 
-  for (unsigned int c=0;c<values.size();++c)
-    for (unsigned int k=0;k<values[c].size();++k)
+  for (unsigned int c=0; c<values.size(); ++c)
+    for (unsigned int k=0; k<values[c].size(); ++k)
       values[c][k] = vectors[k](c);
-  
+
   fe.interpolate(dofs, values);
   deallog << " vector " << vector_difference(fe,dofs,f,0);
-  
+
   fe.interpolate(dofs, vectors, 0);
   deallog << " Vector " << vector_difference(fe,dofs,f,0) << std::endl;
 }
index a42a963eafdc2cc9623ea04304b0999f630cee4a..4b4671d8c093af9c8b2dec3c4a123e221695f46d 100644 (file)
 // FE_Q<dim>::interpolate(...)
 
 template <int dim>
-void check1(const Function<dim>f,
-           const unsigned int degree,
-           const unsigned int comp)
+void check1(const Function<dim> &f,
+            const unsigned int degree,
+            const unsigned int comp)
 {
   FE_Q<dim> feq(degree);
   FESystem<dim> fe(feq, comp);
   deallog << fe.get_name() << ' ';
-  
+
   std::vector<double> dofs(fe.dofs_per_cell);
-  
+
   std::vector<std::vector<double> >
-    values(comp, std::vector<double>(fe.get_unit_support_points().size()));
+  values(comp, std::vector<double>(fe.get_unit_support_points().size()));
   std::vector<Vector<double> >
-    vectors(fe.get_unit_support_points().size(),
-           Vector<double>(f.n_components));
+  vectors(fe.get_unit_support_points().size(),
+          Vector<double>(f.n_components));
   f.vector_value_list(fe.get_unit_support_points(), vectors);
-  for (unsigned int c=0;c<values.size();++c)
-    for (unsigned int k=0;k<values[c].size();++k)
+  for (unsigned int c=0; c<values.size(); ++c)
+    for (unsigned int k=0; k<values[c].size(); ++k)
       values[c][k] = vectors[k](c);
-  
+
   fe.interpolate(dofs, values);
   deallog << " vector " << vector_difference(fe,dofs,f,0);
-  
+
   fe.interpolate(dofs, vectors, 0);
   deallog << " Vector " << vector_difference(fe,dofs,f,0) << std::endl;
 }
 
 template <int dim>
-void check3(const Function<dim>f,
-           const unsigned int degree,
-           const unsigned int comp1,
-           const unsigned int comp2,
-           const unsigned int comp3)
+void check3(const Function<dim> &f,
+            const unsigned int degree,
+            const unsigned int comp1,
+            const unsigned int comp2,
+            const unsigned int comp3)
 {
   FE_Q<dim> feq1(degree);
   FE_Q<dim> feq2(degree+1);
   FE_Q<dim> feq3(degree+2);
   FESystem<dim> fe(feq1, comp1, feq2, comp2, feq3, comp3);
   deallog << fe.get_name() << ' ';
-  
+
   std::vector<double> dofs(fe.dofs_per_cell);
-  
+
   std::vector<std::vector<double> >
-    values(f.n_components,
-          std::vector<double>(fe.get_unit_support_points().size()));
+  values(f.n_components,
+         std::vector<double>(fe.get_unit_support_points().size()));
   std::vector<Vector<double> >
-    vectors(fe.get_unit_support_points().size(),
-           Vector<double>(f.n_components));
+  vectors(fe.get_unit_support_points().size(),
+          Vector<double>(f.n_components));
   f.vector_value_list(fe.get_unit_support_points(), vectors);
-  for (unsigned int c=0;c<values.size();++c)
-    for (unsigned int k=0;k<values[c].size();++k)
+  for (unsigned int c=0; c<values.size(); ++c)
+    for (unsigned int k=0; k<values[c].size(); ++k)
       values[c][k] = vectors[k](c);
-  
+
   fe.interpolate(dofs, values);
   deallog << " vector " << vector_difference(fe,dofs,f,0);
-  
+
   fe.interpolate(dofs, vectors, 0);
   deallog << " Vector " << vector_difference(fe,dofs,f,0) << std::endl;
 }
index c888e5bedc490054816c6b65de8479748d187556..a5db1da27cdef156d0eb1b5bcd40462999642ccc 100644 (file)
@@ -37,25 +37,25 @@ void test()
 
   MappingQ<dim> mapping(3);
   FE_Nothing<dim> dummy;
-                               // choose a point that is not right in the
-                               // middle of the cell so that the Jacobian
-                               // contains many nonzero entries
+  // choose a point that is not right in the
+  // middle of the cell so that the Jacobian
+  // contains many nonzero entries
   Point<dim> quad_p;
   for (int d=0; d<dim; ++d)
     quad_p(d) = 0.42 + 0.11 * d;
   Quadrature<dim> quad(quad_p);
   FEValues<dim> fe_val (mapping, dummy, quad,
-                       update_jacobians | update_inverse_jacobians);
+                        update_jacobians | update_inverse_jacobians);
   deallog << dim << "d Jacobians:" << std::endl;
   typename Triangulation<dim>::active_cell_iterator
-    cell = tria.begin_active(), endc = tria.end();
+  cell = tria.begin_active(), endc = tria.end();
   for ( ; cell != endc; ++cell)
     {
       fe_val.reinit (cell);
-      
+
       for (unsigned int d=0; d<dim; ++d)
-       for (unsigned int e=0; e<dim; ++e)
-         deallog << fe_val.jacobian(0)[d][e] << " ";
+        for (unsigned int e=0; e<dim; ++e)
+          deallog << fe_val.jacobian(0)[d][e] << " ";
       deallog << std::endl;
     }
   deallog << std::endl;
@@ -66,10 +66,10 @@ void test()
   for ( ; cell != endc; ++cell)
     {
       fe_val.reinit (cell);
-      
+
       for (unsigned int d=0; d<dim; ++d)
-       for (unsigned int e=0; e<dim; ++e)
-         deallog << fe_val.inverse_jacobian(0)[d][e] << " ";
+        for (unsigned int e=0; e<dim; ++e)
+          deallog << fe_val.inverse_jacobian(0)[d][e] << " ";
       deallog << std::endl;
     }
   deallog << std::endl;
index 10a3243dfa1c088802b211f54f5d514ee1433b87..c5bb235830a83b0c0165b6e4bbd3e7a9738ff6a4 100644 (file)
 template<int dim>
 inline void
 plot_transformation(Mapping<dim> &mapping,
-                   FiniteElement<dim> &fe,
-                   typename DoFHandler<dim>::cell_iterator &cell,
-                   const std::string& name)
+                    FiniteElement<dim> &fe,
+                    typename DoFHandler<dim>::cell_iterator &cell,
+                    const std::string &name)
 {
   const unsigned int div = 7;
 
   QTrapez<1> q_trapez;
   QIterated<dim> q(q_trapez, div);
   FEValues<dim> fe_values(mapping, fe, q,
-                         UpdateFlags(update_q_points
-                                     | update_JxW_values));
+                          UpdateFlags(update_q_points
+                                      | update_JxW_values));
 
   fe_values.reinit(cell);
 
@@ -65,16 +65,16 @@ plot_transformation(Mapping<dim> &mapping,
   for (unsigned int nz=0; nz<=((dim>2) ? div : 0); ++nz)
     {
       for (unsigned int ny=0; ny<=((dim>1) ? div : 0); ++ny)
-       {
-         for (unsigned int nx=0; nx<=div; ++nx)
-           {
-             deallog << fe_values.quadrature_point(k);
-             double J = fe_values.JxW(k) / q.weight(k);
-             deallog << ' ' << J << std::endl;
-             ++k;
-           }
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int nx=0; nx<=div; ++nx)
+            {
+              deallog << fe_values.quadrature_point(k);
+              double J = fe_values.JxW(k) / q.weight(k);
+              deallog << ' ' << J << std::endl;
+              ++k;
+            }
+          deallog << std::endl;
+        }
       deallog << std::endl;
     }
   deallog.pop();
@@ -85,9 +85,9 @@ plot_transformation(Mapping<dim> &mapping,
 template<int dim>
 inline void
 plot_faces(Mapping<dim> &mapping,
-          FiniteElement<dim> &fe,
-          typename DoFHandler<dim>::cell_iterator &cell,
-          const std::string& name)
+           FiniteElement<dim> &fe,
+           typename DoFHandler<dim>::cell_iterator &cell,
+           const std::string &name)
 {
   deallog.push(name);
 
@@ -95,9 +95,9 @@ plot_faces(Mapping<dim> &mapping,
   const unsigned int nq = (unsigned int) (.01 + std::pow(q.size(), 1./(dim-1)));
 
   FEFaceValues<dim> fe_values(mapping, fe, q,
-                             UpdateFlags(update_q_points
-                                         | update_JxW_values
-                                         | update_normal_vectors));
+                              UpdateFlags(update_q_points
+                                          | update_JxW_values
+                                          | update_normal_vectors));
 
   for (unsigned int face_nr=0;
        face_nr < GeometryInfo<dim>::faces_per_cell;
@@ -107,18 +107,18 @@ plot_faces(Mapping<dim> &mapping,
 
       unsigned int k=0;
       for (unsigned int ny=0; ny<((dim>2) ? nq : 1); ++ny)
-       {
-         for (unsigned int nx=0; nx<nq; ++nx)
-           {
-             const Point<dim> x = fe_values.quadrature_point(k);
-             const Point<dim>& n = fe_values.normal_vector(k);
-             const double ds = fe_values.JxW(k);
-
-             deallog << x << '\t' << n << '\t' << ds << std::endl;
-             ++k;
-           }
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int nx=0; nx<nq; ++nx)
+            {
+              const Point<dim> x = fe_values.quadrature_point(k);
+              const Point<dim> &n = fe_values.normal_vector(k);
+              const double ds = fe_values.JxW(k);
+
+              deallog << x << '\t' << n << '\t' << ds << std::endl;
+              ++k;
+            }
+          deallog << std::endl;
+        }
       deallog << std::endl;
     }
   deallog.pop();
@@ -129,9 +129,9 @@ plot_faces(Mapping<dim> &mapping,
 template<int dim>
 inline void
 plot_subfaces(Mapping<dim> &mapping,
-             FiniteElement<dim> &fe,
-             typename DoFHandler<dim>::cell_iterator &cell,
-             const std::string& name)
+              FiniteElement<dim> &fe,
+              typename DoFHandler<dim>::cell_iterator &cell,
+              const std::string &name)
 {
   deallog.push(name);
 
@@ -139,33 +139,33 @@ plot_subfaces(Mapping<dim> &mapping,
   const unsigned int nq = (unsigned int) (.01 + std::pow(q.size(), 1./(dim-1)));
 
   FESubfaceValues<dim> fe_values(mapping, fe, q,
-                                UpdateFlags(update_q_points
-                                            | update_normal_vectors));
+                                 UpdateFlags(update_q_points
+                                             | update_normal_vectors));
   for (unsigned int face_nr=0;
        face_nr < GeometryInfo<dim>::faces_per_cell;
        ++ face_nr)
     for (unsigned int sub_nr=0;
-        sub_nr < GeometryInfo<dim>::max_children_per_face;
-        ++ sub_nr)
+         sub_nr < GeometryInfo<dim>::max_children_per_face;
+         ++ sub_nr)
       {
-       fe_values.reinit(cell, face_nr, sub_nr);
-
-       const std::vector<Point<dim> > &normals
-         =fe_values.get_normal_vectors();
-
-       unsigned int k=0;
-       for (unsigned int ny=0; ny<((dim>2) ? nq : 1); ++ny)
-         {
-           for (unsigned int nx=0; nx<nq; ++nx)
-             {
-               Point<dim> x = fe_values.quadrature_point(k);
-               Tensor<1,dim> n = normals[k];
-               deallog << x << '\t' << n << std::endl;
-               ++k;
-             }
-           deallog << std::endl;
-         }
-       deallog << std::endl;
+        fe_values.reinit(cell, face_nr, sub_nr);
+
+        const std::vector<Point<dim> > &normals
+          =fe_values.get_normal_vectors();
+
+        unsigned int k=0;
+        for (unsigned int ny=0; ny<((dim>2) ? nq : 1); ++ny)
+          {
+            for (unsigned int nx=0; nx<nq; ++nx)
+              {
+                Point<dim> x = fe_values.quadrature_point(k);
+                Tensor<1,dim> n = normals[k];
+                deallog << x << '\t' << n << std::endl;
+                ++k;
+              }
+            deallog << std::endl;
+          }
+        deallog << std::endl;
       }
   deallog.pop();
 }
@@ -174,20 +174,20 @@ plot_subfaces(Mapping<dim> &mapping,
 
 template<>
 inline void
-plot_faces(Mapping<1>&,
-          FiniteElement<1>&,
-          DoFHandler<1>::cell_iterator&,
-          const std::string&)
+plot_faces(Mapping<1> &,
+           FiniteElement<1> &,
+           DoFHandler<1>::cell_iterator &,
+           const std::string &)
 {}
 
 
 
 template<>
 inline void
-plot_subfaces(Mapping<1>&,
-             FiniteElement<1>&,
-             DoFHandler<1>::cell_iterator&,
-             const std::string&)
+plot_subfaces(Mapping<1> &,
+              FiniteElement<1> &,
+              DoFHandler<1>::cell_iterator &,
+              const std::string &)
 {}
 
 
@@ -195,12 +195,12 @@ plot_subfaces(Mapping<1>&,
 template<int dim>
 inline void
 compute_area(Mapping<dim> &mapping,
-            FiniteElement<dim> &fe,
-            typename DoFHandler<dim>::cell_iterator &cell)
+             FiniteElement<dim> &fe,
+             typename DoFHandler<dim>::cell_iterator &cell)
 {
   QGauss<dim> gauss4(4);
   FEValues<dim> fe_values(mapping, fe, gauss4,
-                       UpdateFlags(update_JxW_values));
+                          UpdateFlags(update_JxW_values));
   fe_values.reinit(cell);
   const std::vector<double> &JxW=fe_values.get_JxW_values();
 
@@ -213,8 +213,8 @@ compute_area(Mapping<dim> &mapping,
 
 template<int dim>
 void create_triangulations(std::vector<Triangulation<dim> *> &,
-                          std::vector<Boundary<dim> *> &,
-                          std::vector<double> &)
+                           std::vector<Boundary<dim> *> &,
+                           std::vector<double> &)
 {
   Assert(false, ExcNotImplemented());
 }
@@ -227,8 +227,8 @@ unsigned int mapping_size;
 
 template<>
 void create_triangulations(std::vector<Triangulation<1> *> &tria_ptr,
-                          std::vector<Boundary<1> *> &,
-                          std::vector<double> &exact_areas)
+                           std::vector<Boundary<1> *> &,
+                           std::vector<double> &exact_areas)
 {
   show.resize(1, std::vector<unsigned int> (mapping_size,0));
   Triangulation<1> *tria=new Triangulation<1>();
@@ -244,13 +244,13 @@ void create_triangulations(std::vector<Triangulation<1> *> &tria_ptr,
 
 template<>
 void create_triangulations(std::vector<Triangulation<2> *> &tria_ptr,
-                          std::vector<Boundary<2> *> &boundary_ptr,
-                          std::vector<double> &exact_areas)
+                           std::vector<Boundary<2> *> &boundary_ptr,
+                           std::vector<double> &exact_areas)
 {
   Triangulation<2> *tria;
   show.clear();
   show.resize(4, std::vector<unsigned int> (mapping_size,0));
-                                  // tria0: 3x3 square rotated
+  // tria0: 3x3 square rotated
   if (1)
     {
       tria=new Triangulation<2>();
@@ -259,22 +259,23 @@ void create_triangulations(std::vector<Triangulation<2> *> &tria_ptr,
       const double right = 4.;
 
       const Point<2> vertices[4] = { Point<2>(left,left),
-                                      Point<2>(right,left),
-                                      Point<2>(right,right),
-                                      Point<2>(left,right)  };
+                                     Point<2>(right,left),
+                                     Point<2>(right,right),
+                                     Point<2>(left,right)
+                                   };
       const int cell_vertices[1][4] = { { 1,2,0,3 } };
       std::vector<CellData<2> > cells (1, CellData<2>());
       for (unsigned int j=0; j<4; ++j)
-       cells[0].vertices[j] = cell_vertices[0][j];
+        cells[0].vertices[j] = cell_vertices[0][j];
       cells[0].material_id = 0;
 
       tria->create_triangulation (std::vector<Point<2> >(&vertices[0], &vertices[4]),
-                                 cells,
-                                 SubCellData());
+                                  cells,
+                                  SubCellData());
       exact_areas.push_back(9.);
     }
 
-                                  // tria1: arbitrary quadrilateral
+  // tria1: arbitrary quadrilateral
   if (1)
     {
       tria=new Triangulation<2>();
@@ -289,7 +290,7 @@ void create_triangulations(std::vector<Triangulation<2> *> &tria_ptr,
       show[1][0] = 1;
     }
 
-                                  // tria2: crazy cell
+  // tria2: crazy cell
   if (2)
     {
       Boundary<2> *boundary1=new HyperBallBoundary<2>(Point<2>(3,1), 2);
@@ -313,7 +314,7 @@ void create_triangulations(std::vector<Triangulation<2> *> &tria_ptr,
       double alpha=2*std::atan(0.5);
       exact_areas.push_back(4+pi-2.5*(alpha-std::sin(alpha)));
       for (unsigned int i=0; i<=3; ++i)
-       show[2][i]=1;
+        show[2][i]=1;
     }
 
   if (3)
@@ -334,7 +335,7 @@ void create_triangulations(std::vector<Triangulation<2> *> &tria_ptr,
   if (4 && false)
     {
       Boundary<2> *boundary1=new HyperBallBoundary<2>(Point<2>(2.5,-0.5),
-                                                     std::sqrt(1.5*1.5+0.5*0.5));
+                                                      std::sqrt(1.5*1.5+0.5*0.5));
       boundary_ptr.push_back(boundary1);
       tria=new Triangulation<2>();
       tria_ptr.push_back(tria);
@@ -349,7 +350,7 @@ void create_triangulations(std::vector<Triangulation<2> *> &tria_ptr,
       tria->begin_active()->face(1)->set_boundary_indicator(1);
       exact_areas.push_back(0.);
       for (unsigned int i=0; i<=4; ++i)
-       show[4][i]=1;
+        show[4][i]=1;
     }
 }
 
@@ -357,14 +358,14 @@ void create_triangulations(std::vector<Triangulation<2> *> &tria_ptr,
 
 template<>
 void create_triangulations(std::vector<Triangulation<3> *> &tria_ptr,
-                          std::vector<Boundary<3> *> &boundary_ptr,
-                          std::vector<double> &exact_areas)
+                           std::vector<Boundary<3> *> &boundary_ptr,
+                           std::vector<double> &exact_areas)
 {
   Triangulation<3> *tria;
   show.clear();
   show.resize(4, std::vector<unsigned int> (mapping_size,0));
 
-                                  // 2x2 cube
+  // 2x2 cube
   if (1)
     {
       tria=new Triangulation<3>();
@@ -373,7 +374,7 @@ void create_triangulations(std::vector<Triangulation<3> *> &tria_ptr,
       exact_areas.push_back(8.);
     }
 
-                                  // arbitrary quadrilateral
+  // arbitrary quadrilateral
   if (1)
     {
       tria=new Triangulation<3>();
@@ -386,14 +387,14 @@ void create_triangulations(std::vector<Triangulation<3> *> &tria_ptr,
       exact_areas.push_back(12.5);
     }
 
-                                  // cube+part of ball
+  // cube+part of ball
   if (2)
     {
       Point<3> m(2,2,2);
       Point<3> v(3,3,3);
       double r=std::sqrt((m-v).square()),
-            h=r-1.5,
-           pi=std::acos(-1.);
+             h=r-1.5,
+             pi=std::acos(-1.);
       Boundary<3> *boundary1=new HyperBallBoundary<3>(m, r);
       boundary_ptr.push_back(boundary1);
 
@@ -437,7 +438,7 @@ void mapping_test()
   MappingQ<dim> q1tmp(1);
   MappingQ<dim> q2tmp(2);
   MappingQ<dim> q3tmp(3);
-                                  // check MappingQ copy constructor
+  // check MappingQ copy constructor
   MappingQ<dim> q1(q1tmp);
   MappingQ<dim> q2(q2tmp);
   MappingQ<dim> q3(q3tmp);
@@ -476,66 +477,66 @@ void mapping_test()
 
       deallog << "exact_area=" << exact_areas[i] << std::endl;
       for (unsigned int j=0; j<mapping_size; ++j)
-       if (show[i][j])
-         {
-           if (true)
-             {
-               std::ostringstream ost;
-               ost << "Mapping" << dim << "d-" << i << '-'
-                   << mapping_strings[j];
-               deallog << ost.str() << std::endl;
-               plot_transformation(*mapping_ptr[j], fe_q4, cell, ost.str());
-               compute_area(*mapping_ptr[j], fe_q4, cell);
-             }
-
-           if (dim>1)
-             {
-               std::ostringstream ost;
-               ost << "MappingFace" << dim << "d-" << i << '-'
-                   << mapping_strings[j];
-               deallog << ost.str() << std::endl;
-               plot_faces(*mapping_ptr[j], fe_q4, cell, ost.str());
-             }
-
-           if (dim>1)
-             {
-               std::ostringstream ost;
-               ost << "MappingSubface" << dim << "d-" << i << '-'
-                   << mapping_strings[j];
-               deallog << ost.str() << std::endl;
-               plot_subfaces(*mapping_ptr[j], fe_q4, cell, ost.str());
-             }
-
-
-                                  // Test for transform_*_to_*_cell
-           if (true)
-             {
-               Mapping<dim> &mapping=*mapping_ptr[j];
-               Point<dim> p_unit;
-               switch(dim)
-                 {
-                   case 1:
-                         p_unit=Point<dim>(6/7.);
-                         break;
-                   case 2:
-                         p_unit=Point<dim>(6/7.,4/7.);
-                         break;
-                   case 3:
-                         p_unit=Point<dim>(6/7.,4/7.,5/7.);
-                         break;
-                 }
-
-               Point<dim> p_real=mapping.transform_unit_to_real_cell(cell, p_unit);
-               Point<dim> p_re_unit=mapping.transform_real_to_unit_cell(cell, p_real);
-               deallog << "p_unit=" << p_unit << ",  p_real=" << p_real
-                       << ",  p_re_unit=" << p_re_unit << std::endl;
-             }
-         }
+        if (show[i][j])
+          {
+            if (true)
+              {
+                std::ostringstream ost;
+                ost << "Mapping" << dim << "d-" << i << '-'
+                    << mapping_strings[j];
+                deallog << ost.str() << std::endl;
+                plot_transformation(*mapping_ptr[j], fe_q4, cell, ost.str());
+                compute_area(*mapping_ptr[j], fe_q4, cell);
+              }
+
+            if (dim>1)
+              {
+                std::ostringstream ost;
+                ost << "MappingFace" << dim << "d-" << i << '-'
+                    << mapping_strings[j];
+                deallog << ost.str() << std::endl;
+                plot_faces(*mapping_ptr[j], fe_q4, cell, ost.str());
+              }
+
+            if (dim>1)
+              {
+                std::ostringstream ost;
+                ost << "MappingSubface" << dim << "d-" << i << '-'
+                    << mapping_strings[j];
+                deallog << ost.str() << std::endl;
+                plot_subfaces(*mapping_ptr[j], fe_q4, cell, ost.str());
+              }
+
+
+            // Test for transform_*_to_*_cell
+            if (true)
+              {
+                Mapping<dim> &mapping=*mapping_ptr[j];
+                Point<dim> p_unit;
+                switch (dim)
+                  {
+                  case 1:
+                    p_unit=Point<dim>(6/7.);
+                    break;
+                  case 2:
+                    p_unit=Point<dim>(6/7.,4/7.);
+                    break;
+                  case 3:
+                    p_unit=Point<dim>(6/7.,4/7.,5/7.);
+                    break;
+                  }
+
+                Point<dim> p_real=mapping.transform_unit_to_real_cell(cell, p_unit);
+                Point<dim> p_re_unit=mapping.transform_real_to_unit_cell(cell, p_real);
+                deallog << "p_unit=" << p_unit << ",  p_real=" << p_real
+                        << ",  p_re_unit=" << p_re_unit << std::endl;
+              }
+          }
     }
 
 
-                                  // delete all triangulations and
-                                  // boundary objects
+  // delete all triangulations and
+  // boundary objects
   for (unsigned int i=0; i<tria_ptr.size(); ++i)
     if (tria_ptr[i]!=0)
       delete tria_ptr[i];
@@ -556,20 +557,20 @@ int main()
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-                                  // -----------------------
-                                  // Tests for dim=1
-                                  // -----------------------
+  // -----------------------
+  // Tests for dim=1
+  // -----------------------
   mapping_test<1>();
 
 
-                                  // -----------------------
-                                  // Tests for dim=2
-                                  // -----------------------
+  // -----------------------
+  // Tests for dim=2
+  // -----------------------
   mapping_test<2>();
 
 
-                                  // -----------------------
-                                  // Tests for dim=3
-                                  // -----------------------
+  // -----------------------
+  // Tests for dim=3
+  // -----------------------
   mapping_test<3>();
 }
index 6b94cb5e2d261c5cf83823f9c846634beef84698..c68ce89937fc93c3071bd829b90f1cf2e12f68b0 100644 (file)
 int main ()
 {
   std::ofstream logfile ("mapping_c1/output");
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog << std::setprecision(PRECISION) << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
-                                  // create grid of circle, somehow
-                                  // arbitrarily from only one cell,
-                                  // but since we are not interested
-                                  // in the quality of the mesh, this
-                                  // is ok
+
+  // create grid of circle, somehow
+  // arbitrarily from only one cell,
+  // but since we are not interested
+  // in the quality of the mesh, this
+  // is ok
   Point<2> center;
   HyperBallBoundary<2> circle(center, std::sqrt(2.0));
   Triangulation<2> tria;
   GridGenerator::hyper_cube(tria, -1, 1);
   tria.set_boundary (0, circle);
-  
 
-                                  // refine it more or less
-                                  // arbitrarily
+
+  // refine it more or less
+  // arbitrarily
   tria.refine_global (1);
   if (true)
     {
@@ -64,69 +64,69 @@ int main ()
       tria.execute_coarsening_and_refinement ();
     };
 
-                                  // attach a dof handler to it
+  // attach a dof handler to it
   const FE_Q<2>       fe(2);
   DoFHandler<2> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
 
-                                  // and loop over all exterior faces
-                                  // to see whether the normal
-                                  // vectors are indeed continuous
-                                  // and pointing radially outward at
-                                  // the vertices
+  // and loop over all exterior faces
+  // to see whether the normal
+  // vectors are indeed continuous
+  // and pointing radially outward at
+  // the vertices
   const QTrapez<1>    quadrature;
   const MappingC1<2>  c1_mapping;
   FEFaceValues<2> c1_values (c1_mapping, fe, quadrature,
-                            update_q_points | update_normal_vectors);
+                             update_q_points | update_normal_vectors);
 
-                                  // to compare with, also print the
-                                  // normal vectors as generated by a
-                                  // cubic mapping
+  // to compare with, also print the
+  // normal vectors as generated by a
+  // cubic mapping
   const MappingQ<2> q3_mapping(3);
   FEFaceValues<2> q3_values (q3_mapping, fe, quadrature,
-                            update_q_points | update_normal_vectors);
-  
+                             update_q_points | update_normal_vectors);
+
   for (DoFHandler<2>::active_cell_iterator cell=dof_handler.begin_active();
        cell!=dof_handler.end(); ++cell)
     for (unsigned int f=0; f<GeometryInfo<2>::faces_per_cell; ++f)
       if (cell->face(f)->at_boundary())
-       {
-         c1_values.reinit (cell, f);
-         q3_values.reinit (cell, f);
-
-                                          // there should now be two
-                                          // normal vectors, one for
-                                          // each vertex of the face
-         Assert (c1_values.get_normal_vectors().size() == 2,
-                 ExcInternalError());
-
-                                          // check that these two
-                                          // normal vectors have
-                                          // length approximately 1
-                                          // and point radially
-                                          // outward
-         for (unsigned int i=0; i<2; ++i)
-           {
-             Point<2> radius = c1_values.quadrature_point(i);
-             radius /= std::sqrt(radius.square());
-             deallog << "Normalized radius=" << radius << std::endl;
-
-             deallog << "C1 normal vector " << i << ": " << c1_values.normal_vector(i) << std::endl;
-             deallog << "Q3 normal vector " << i << ": " << q3_values.normal_vector(i) << std::endl;
-           };
-         
-
-                                          // some numerical checks for correctness
-         for (unsigned int i=0; i<2; ++i)
-           {
-             Assert (std::fabs(c1_values.normal_vector(i) *
-                               c1_values.normal_vector(i) - 1) < 1e-14,
-                     ExcInternalError());
-             Point<2> radius = c1_values.quadrature_point(i);
-             radius /= std::sqrt(radius.square());
-
-             Assert ((radius-c1_values.normal_vector(i)).square() < 1e-14,
-                     ExcInternalError());
-           };
-       };  
+        {
+          c1_values.reinit (cell, f);
+          q3_values.reinit (cell, f);
+
+          // there should now be two
+          // normal vectors, one for
+          // each vertex of the face
+          Assert (c1_values.get_normal_vectors().size() == 2,
+                  ExcInternalError());
+
+          // check that these two
+          // normal vectors have
+          // length approximately 1
+          // and point radially
+          // outward
+          for (unsigned int i=0; i<2; ++i)
+            {
+              Point<2> radius = c1_values.quadrature_point(i);
+              radius /= std::sqrt(radius.square());
+              deallog << "Normalized radius=" << radius << std::endl;
+
+              deallog << "C1 normal vector " << i << ": " << c1_values.normal_vector(i) << std::endl;
+              deallog << "Q3 normal vector " << i << ": " << q3_values.normal_vector(i) << std::endl;
+            };
+
+
+          // some numerical checks for correctness
+          for (unsigned int i=0; i<2; ++i)
+            {
+              Assert (std::fabs(c1_values.normal_vector(i) *
+                                c1_values.normal_vector(i) - 1) < 1e-14,
+                      ExcInternalError());
+              Point<2> radius = c1_values.quadrature_point(i);
+              radius /= std::sqrt(radius.square());
+
+              Assert ((radius-c1_values.normal_vector(i)).square() < 1e-14,
+                      ExcInternalError());
+            };
+        };
 }
index 90c1a1372e9e8eb0482b77a97931aef8614062ce..28f716cb59d8784170ce9c0ea3fca538e364574b 100644 (file)
 
 template<int dim>
 inline void
-show_values(FiniteElement<dim>fe,
-           const char* name)
+show_values(FiniteElement<dim> &fe,
+            const char *name)
 {
   deallog.push (name);
-  
+
   Triangulation<dim> tr;
   GridGenerator::hyper_cube(tr, 2., 5.);
 
-                                  // shift one point of the cell
-                                  // somehow
+  // shift one point of the cell
+  // somehow
   if (dim > 1)
     tr.begin_active()->vertex(dim==2 ? 3 : 5)(dim-1) += 1./std::sqrt(2.);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
 
 
-                                  // construct the MappingQ1Eulerian
-                                  // object
-  
+  // construct the MappingQ1Eulerian
+  // object
+
   FESystem<dim> mapping_fe(FE_Q<dim>(1), dim);
   DoFHandler<dim> flowfield_dof_handler(tr);
   flowfield_dof_handler.distribute_dofs(mapping_fe);
@@ -61,12 +61,12 @@ show_values(FiniteElement<dim>& fe,
 
 
   QGauss<dim> quadrature_formula(2);
-  
+
   FEValues<dim> fe_values(mapping, fe, quadrature_formula,
-                         UpdateFlags(update_values |
-                                     update_JxW_values |
-                                     update_gradients |
-                                     update_second_derivatives));
+                          UpdateFlags(update_values |
+                                      update_JxW_values |
+                                      update_gradients |
+                                      update_second_derivatives));
   typename DoFHandler<dim>::cell_iterator c = dof.begin();
   fe_values.reinit(c);
 
@@ -74,14 +74,14 @@ show_values(FiniteElement<dim>& fe,
     {
       deallog << quadrature_formula.point(k) << std::endl;
       deallog << "JxW: " << fe_values.JxW(k) << std::endl;
-         
-      for (unsigned int i=0;i<fe.dofs_per_cell;++i)
-       {
-         deallog << "Values: " << fe_values.shape_value(i,k);
-         deallog << ",  Grad: " << fe_values.shape_grad(i,k);
-         deallog << ",  2nd: " << fe_values.shape_hessian(i,k);
-         deallog << std::endl;
-       }
+
+      for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
+        {
+          deallog << "Values: " << fe_values.shape_value(i,k);
+          deallog << ",  Grad: " << fe_values.shape_grad(i,k);
+          deallog << ",  2nd: " << fe_values.shape_hessian(i,k);
+          deallog << std::endl;
+        }
     }
   deallog.pop ();
 }
@@ -104,7 +104,7 @@ main()
 {
   std::ofstream logfile ("mapping_q1_eulerian/output");
   deallog << std::setprecision(2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
@@ -114,11 +114,11 @@ main()
   deallog.push ("1d");
   show_values<1>();
   deallog.pop ();
-  
+
   deallog.push ("2d");
   show_values<2>();
   deallog.pop ();
-  
+
   deallog.push ("3d");
   show_values<3>();
   deallog.pop ();
index ae2548d492b48b3b15efb1fe301aad6b92ce1d20..2bffbb08224fb188ccacaab64ce92acf2f2bd572 100644 (file)
 template <int dim>
 class ImposedDisplacement : public Function<dim>
 {
-  public:
-    ImposedDisplacement() : Function<dim> (dim) { }
-    virtual void vector_value(const Point<dim> &p,
-                              Vector<double> &value) const;
+public:
+  ImposedDisplacement() : Function<dim> (dim) { }
+  virtual void vector_value(const Point<dim> &p,
+                            Vector<double> &value) const;
 };
 
 template <>
@@ -74,26 +74,26 @@ void ImposedDisplacement<2>::vector_value(const Point<2> &p,
 template <int dim>
 class MappingTest
 {
-  public:
-    MappingTest (unsigned int degree);
-    ~MappingTest ();
-
-    void run_test();
-    void graphical_output();
-    
-  private:
-    double compute_area();
-    void explicitly_move_mesh();
-    void write_tria_to_eps(std::string id);
-
-    Triangulation<dim>     triangulation;
-    DoFHandler<dim>        dof_handler;
-    FESystem<dim>          fe;
-
-    unsigned int           degree;
-
-    ImposedDisplacement<dim> imposed_displacement;
-    Vector<double>           displacements;
+public:
+  MappingTest (unsigned int degree);
+  ~MappingTest ();
+
+  void run_test();
+  void graphical_output();
+
+private:
+  double compute_area();
+  void explicitly_move_mesh();
+  void write_tria_to_eps(std::string id);
+
+  Triangulation<dim>     triangulation;
+  DoFHandler<dim>        dof_handler;
+  FESystem<dim>          fe;
+
+  unsigned int           degree;
+
+  ImposedDisplacement<dim> imposed_displacement;
+  Vector<double>           displacements;
 };
 
 
@@ -101,17 +101,17 @@ class MappingTest
 
 template <int dim>
 MappingTest<dim>::MappingTest (unsigned int degree)
-               :
-               dof_handler (triangulation),
-               fe (FE_Q<dim>(degree),dim),
-                degree(degree)
+  :
+  dof_handler (triangulation),
+  fe (FE_Q<dim>(degree),dim),
+  degree(degree)
 { }
 
 
 // .... DESTRUCTOR
 
 template <int dim>
-MappingTest<dim>::~MappingTest () 
+MappingTest<dim>::~MappingTest ()
 {
   dof_handler.clear ();
 }
@@ -120,27 +120,28 @@ MappingTest<dim>::~MappingTest ()
 // .... COMPUTE AREA
 
 template <int dim>
-double MappingTest<dim>::compute_area () 
-{  
+double MappingTest<dim>::compute_area ()
+{
   QGauss<dim>  quadrature_formula(degree+1);
 
   MappingQEulerian<dim> mapping(degree,displacements,dof_handler);
 
-  FEValues<dim> fe_values (mapping, fe, quadrature_formula, 
-                          update_JxW_values);
+  FEValues<dim> fe_values (mapping, fe, quadrature_formula,
+                           update_JxW_values);
 
   const unsigned int   n_q_points = quadrature_formula.size();
 
   long double area = 0.;
 
-  typename DoFHandler<dim>::active_cell_iterator 
-                              cell = dof_handler.begin_active(),
-                              endc = dof_handler.end();
+  typename DoFHandler<dim>::active_cell_iterator
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
 
-  for (; cell!=endc; ++cell) {
-    fe_values.reinit (cell);
-    for(unsigned int q=0; q<n_q_points; ++q) area += fe_values.JxW(q);
-  }      
+  for (; cell!=endc; ++cell)
+    {
+      fe_values.reinit (cell);
+      for (unsigned int q=0; q<n_q_points; ++q) area += fe_values.JxW(q);
+    }
 
   return area;
 }
@@ -149,38 +150,39 @@ double MappingTest<dim>::compute_area ()
 // .... RUN TEST
 
 template <int dim>
-void MappingTest<dim>::run_test () 
+void MappingTest<dim>::run_test ()
 {
   GridGenerator::hyper_cube (triangulation,0, 1);
 
   ConvergenceTable table;
 
-  for(unsigned int ref_level = 0; 
-                   ref_level < 5; 
-                 ++ref_level, triangulation.refine_global(1)){
+  for (unsigned int ref_level = 0;
+       ref_level < 5;
+       ++ref_level, triangulation.refine_global(1))
+    {
 
-    dof_handler.distribute_dofs (fe);
-    displacements.reinit (dof_handler.n_dofs());
+      dof_handler.distribute_dofs (fe);
+      displacements.reinit (dof_handler.n_dofs());
 
-    VectorTools::interpolate(MappingQ1<dim>(),dof_handler,
-                             imposed_displacement,displacements);
+      VectorTools::interpolate(MappingQ1<dim>(),dof_handler,
+                               imposed_displacement,displacements);
 
 
-    table.add_value("cells",triangulation.n_active_cells());
-    table.add_value("dofs",dof_handler.n_dofs());
+      table.add_value("cells",triangulation.n_active_cells());
+      table.add_value("dofs",dof_handler.n_dofs());
 
-    long double area  = compute_area();
-    long double error = std::fabs(numbers::PI-area)/numbers::PI;
+      long double area  = compute_area();
+      long double error = std::fabs(numbers::PI-area)/numbers::PI;
 
-    table.add_value("area",  static_cast<double> (area));
-    table.add_value("error", static_cast<double> (error));
-  }    
+      table.add_value("area",  static_cast<double> (area));
+      table.add_value("error", static_cast<double> (error));
+    }
 
   table.set_precision("area", 8);
   table.set_precision("error", 4);
   table.set_scientific("error", true);
   table.evaluate_convergence_rates("error",
-    ConvergenceTable::reduction_rate_log2); 
+                                   ConvergenceTable::reduction_rate_log2);
   table.write_text(deallog.get_file_stream());
   deallog << std::endl;
 
@@ -190,25 +192,31 @@ void MappingTest<dim>::run_test ()
 // .... EXPLICITLY MOVE MESH
 
 template <int dim>
-void MappingTest<dim>::explicitly_move_mesh () 
-{  
+void MappingTest<dim>::explicitly_move_mesh ()
+{
   std::vector<bool> moved (triangulation.n_vertices(),false);
   unsigned int vpc = GeometryInfo<dim>::vertices_per_cell;
 
   typename DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active (),
-    endc = dof_handler.end();
-
-  for (; cell != endc; cell++) {
-  for (unsigned int v=0; v < vpc; v++) {
-  if (moved[cell->vertex_index(v)] == false){
-      moved[cell->vertex_index(v)] =  true;
-      Point<dim> vertex_disp;
-      for (unsigned int d=0; d<dim; d++) {
-        vertex_disp[d] = displacements(cell->vertex_dof_index(v,d));
-      }
-      cell->vertex(v) += vertex_disp;
-  }}}
+  cell = dof_handler.begin_active (),
+  endc = dof_handler.end();
+
+  for (; cell != endc; cell++)
+    {
+      for (unsigned int v=0; v < vpc; v++)
+        {
+          if (moved[cell->vertex_index(v)] == false)
+            {
+              moved[cell->vertex_index(v)] =  true;
+              Point<dim> vertex_disp;
+              for (unsigned int d=0; d<dim; d++)
+                {
+                  vertex_disp[d] = displacements(cell->vertex_dof_index(v,d));
+                }
+              cell->vertex(v) += vertex_disp;
+            }
+        }
+    }
 }
 
 
@@ -216,7 +224,7 @@ void MappingTest<dim>::explicitly_move_mesh ()
 // .... GRAPHICAL OUTPUT
 
 template <int dim>
-void MappingTest<dim>::graphical_output () 
+void MappingTest<dim>::graphical_output ()
 {
   GridGenerator::hyper_cube (triangulation,0, 1);
   triangulation.refine_global(4);
@@ -233,25 +241,25 @@ void MappingTest<dim>::graphical_output ()
 
 // .... MAIN
 
-int main () 
+int main ()
 {
   std::ofstream logfile ("mapping_q_eulerian/output");
   deallog << std::setprecision(2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-                                  // convergence studies
+  // convergence studies
 
-  for(unsigned int degree = 1; degree <=4; ++degree)
-  {
-    deallog << ".... Q" << degree << " Mapping ...." << std::endl;
-    MappingTest<2> test_one(degree);
-    test_one.run_test();
-  }
+  for (unsigned int degree = 1; degree <=4; ++degree)
+    {
+      deallog << ".... Q" << degree << " Mapping ...." << std::endl;
+      MappingTest<2> test_one(degree);
+      test_one.run_test();
+    }
 
-                       // graphical output
+  // graphical output
 
   MappingTest<2> test_two(1);
   test_two.graphical_output();
index dc0d73aafaffeda98c8ba08b4771964aa2007703..3cc33e2baed4ac48bfbb05d402a3c4174c695fdc 100644 (file)
@@ -58,19 +58,20 @@ void test2()
 
   std::vector<Point<dim> > points(19*19);
   std::vector<double> m (19*19);
-  
+
   if (1) //works if changed to "if (0)"   <<<<<<<<<
     for (unsigned int i = 0; i < 19; i++)
-    for (unsigned int j = 0; j < 19; j++)
-      { /// all points are inside
-        points[19*i+j] (0) = -0.7 + (i + 1) * .07;
-        points[19*i+j] (1) = -0.7 + (j + 1) * .07;
-      }
+      for (unsigned int j = 0; j < 19; j++)
+        {
+          /// all points are inside
+          points[19*i+j] (0) = -0.7 + (i + 1) * .07;
+          points[19*i+j] (1) = -0.7 + (j + 1) * .07;
+        }
   points[95]=p;
   fe_function.value_list (points, m); // <<<< this fails at point[95] but only if the other points are filled in?!
-  
+
   triangulation.set_boundary (0);
-  
+
   deallog << "OK" << std::endl;
 }
 
index 3d595e745ef240239a4f651974eda8016da6a24c..b766bbb24fe6bf9a4cb257e68032a883bb4f6126 100644 (file)
@@ -42,64 +42,64 @@ void test_real_to_unit_cell()
 
   switch (dim)
     {
-      case 1:
-           for (unsigned int x=0; x<n_points;++x)
-             unit_points[x][0] = double(x)/double(n_points);
-           break;
-
-      case 2:
-           for (unsigned int x=0; x<n_points;++x)
-             for (unsigned int y=0; y<n_points;++y)
-               {
-                 unit_points[y * n_points + x][0] = double(x)/double(n_points);
-                 unit_points[y * n_points + x][1] = double(y)/double(n_points);
-               }
-           break;
-
-      case 3:
-           for (unsigned int x=0; x<n_points;++x)
-             for (unsigned int y=0; y<n_points;++y)
-               for (unsigned int z=0; z<n_points;++z)
-               {
-                 unit_points[z * n_points + y * n_points + x][0] = double(x)/double(n_points);
-                 unit_points[z * n_points + y * n_points + x][1] = double(y)/double(n_points);
-                 unit_points[z * n_points + y * n_points + x][2] = double(z)/double(n_points);
-               }
-           break;
+    case 1:
+      for (unsigned int x=0; x<n_points; ++x)
+        unit_points[x][0] = double(x)/double(n_points);
+      break;
+
+    case 2:
+      for (unsigned int x=0; x<n_points; ++x)
+        for (unsigned int y=0; y<n_points; ++y)
+          {
+            unit_points[y * n_points + x][0] = double(x)/double(n_points);
+            unit_points[y * n_points + x][1] = double(y)/double(n_points);
+          }
+      break;
+
+    case 3:
+      for (unsigned int x=0; x<n_points; ++x)
+        for (unsigned int y=0; y<n_points; ++y)
+          for (unsigned int z=0; z<n_points; ++z)
+            {
+              unit_points[z * n_points + y * n_points + x][0] = double(x)/double(n_points);
+              unit_points[z * n_points + y * n_points + x][1] = double(y)/double(n_points);
+              unit_points[z * n_points + y * n_points + x][2] = double(z)/double(n_points);
+            }
+      break;
     }
 
 
   MappingQ1< dim, spacedim > map;
 
   typename Triangulation<dim, spacedim >::active_cell_iterator
-    cell = triangulation.begin_active();
+  cell = triangulation.begin_active();
 
-                                  //Move a vertex a little bit
+  //Move a vertex a little bit
   const unsigned int n_dx = 5;
   const double dx = 0.4/n_dx;
   Point<spacedim> direction;
-  for (unsigned int j=0; j<spacedim;++j)
+  for (unsigned int j=0; j<spacedim; ++j)
     direction[j]=dx;
 
-                                  // in a loop, make the cell more
-                                  // and more distorted
-  for (unsigned int j=0; j<n_dx;++j)
+  // in a loop, make the cell more
+  // and more distorted
+  for (unsigned int j=0; j<n_dx; ++j)
     {
       deallog << "Vertex displacement: " << double(j)*direction <<  std::endl;
       cell->vertex(0) = double(j)*direction;
 
-      for (unsigned int i=0; i<unit_points.size();++i)
-       {
-                                          // for each of the points,
-                                          // verify that if we apply
-                                          // the forward map and then
-                                          // pull back that we get
-                                          // the same point again
-         const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
-         const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
-         Assert (unit_points[i].distance(p_unit) < 1e-10,
-                 ExcInternalError());
-       }
+      for (unsigned int i=0; i<unit_points.size(); ++i)
+        {
+          // for each of the points,
+          // verify that if we apply
+          // the forward map and then
+          // pull back that we get
+          // the same point again
+          const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
+          const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
+          Assert (unit_points[i].distance(p_unit) < 1e-10,
+                  ExcInternalError());
+        }
     }
   deallog << "OK" << std::endl;
 }
index 66cb2aacf23316350405b31c49f5c732043ba5a2..f8a90094ad7c32a4a61b21c112bb9e3867c4efbb 100644 (file)
@@ -39,17 +39,17 @@ void test_real_to_unit_cell()
 {
   deallog << "dim=" << dim << ", spacedim=" << spacedim << std::endl;
 
-                                  // define a boundary that fits the
-                                  // the vertices of the hyper cube
-                                  // we're going to create below
+  // define a boundary that fits the
+  // the vertices of the hyper cube
+  // we're going to create below
   HyperBallBoundary<dim,spacedim> boundary (Point<spacedim>(),
-                                           std::sqrt(1.*dim));
+                                            std::sqrt(1.*dim));
 
   Triangulation<dim, spacedim>   triangulation;
   GridGenerator::hyper_cube (triangulation, -1, 1);
 
-                                  // set the boundary indicator for
-                                  // one face of the single cell
+  // set the boundary indicator for
+  // one face of the single cell
   triangulation.set_boundary (1, boundary);
   triangulation.begin_active()->face(0)->set_boundary_indicator (1);
 
@@ -58,50 +58,50 @@ void test_real_to_unit_cell()
 
   switch (dim)
     {
-      case 1:
-           for (unsigned int x=0; x<n_points;++x)
-             unit_points[x][0] = double(x)/double(n_points);
-           break;
-
-      case 2:
-           for (unsigned int x=0; x<n_points;++x)
-             for (unsigned int y=0; y<n_points;++y)
-               {
-                 unit_points[y * n_points + x][0] = double(x)/double(n_points);
-                 unit_points[y * n_points + x][1] = double(y)/double(n_points);
-               }
-           break;
-
-      case 3:
-           for (unsigned int x=0; x<n_points;++x)
-             for (unsigned int y=0; y<n_points;++y)
-               for (unsigned int z=0; z<n_points;++z)
-               {
-                 unit_points[z * n_points + y * n_points + x][0] = double(x)/double(n_points);
-                 unit_points[z * n_points + y * n_points + x][1] = double(y)/double(n_points);
-                 unit_points[z * n_points + y * n_points + x][2] = double(z)/double(n_points);
-               }
-           break;
+    case 1:
+      for (unsigned int x=0; x<n_points; ++x)
+        unit_points[x][0] = double(x)/double(n_points);
+      break;
+
+    case 2:
+      for (unsigned int x=0; x<n_points; ++x)
+        for (unsigned int y=0; y<n_points; ++y)
+          {
+            unit_points[y * n_points + x][0] = double(x)/double(n_points);
+            unit_points[y * n_points + x][1] = double(y)/double(n_points);
+          }
+      break;
+
+    case 3:
+      for (unsigned int x=0; x<n_points; ++x)
+        for (unsigned int y=0; y<n_points; ++y)
+          for (unsigned int z=0; z<n_points; ++z)
+            {
+              unit_points[z * n_points + y * n_points + x][0] = double(x)/double(n_points);
+              unit_points[z * n_points + y * n_points + x][1] = double(y)/double(n_points);
+              unit_points[z * n_points + y * n_points + x][2] = double(z)/double(n_points);
+            }
+      break;
     }
 
 
   MappingQ< dim, spacedim > map(4);
 
-                                  // work with this cell (unlike the
-                                  // _q1 test where we move vertices)
+  // work with this cell (unlike the
+  // _q1 test where we move vertices)
   typename Triangulation<dim, spacedim >::active_cell_iterator
-    cell = triangulation.begin_active();
-  for (unsigned int i=0; i<unit_points.size();++i)
+  cell = triangulation.begin_active();
+  for (unsigned int i=0; i<unit_points.size(); ++i)
     {
-                                      // for each of the points,
-                                      // verify that if we apply
-                                      // the forward map and then
-                                      // pull back that we get
-                                      // the same point again
+      // for each of the points,
+      // verify that if we apply
+      // the forward map and then
+      // pull back that we get
+      // the same point again
       const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
       const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
       Assert (unit_points[i].distance(p_unit) < 1e-10,
-             ExcInternalError());
+              ExcInternalError());
     }
   deallog << "OK" << std::endl;
 }
index 6c2c845f213714be2e21c3eebb7d75fd010f23b6..58dc655361fca4f16d879f62d997f1dea507046f 100644 (file)
@@ -39,17 +39,17 @@ void test_real_to_unit_cell()
 {
   deallog << "dim=" << dim << ", spacedim=" << spacedim << std::endl;
 
-                                  // define a boundary that fits the
-                                  // the vertices of the hyper cube
-                                  // we're going to create below
+  // define a boundary that fits the
+  // the vertices of the hyper cube
+  // we're going to create below
   HyperBallBoundary<dim,spacedim> boundary (Point<spacedim>(),
-                                           std::sqrt(1.*dim));
+                                            std::sqrt(1.*dim));
 
   Triangulation<dim, spacedim>   triangulation;
   GridGenerator::hyper_cube (triangulation, -1, 1);
 
-                                  // set the boundary indicator for
-                                  // one face of the single cell
+  // set the boundary indicator for
+  // one face of the single cell
   triangulation.set_boundary (1, boundary);
   triangulation.begin_active()->face(0)->set_boundary_indicator (1);
 
@@ -58,50 +58,50 @@ void test_real_to_unit_cell()
 
   switch (dim)
     {
-      case 1:
-           for (unsigned int x=0; x<n_points;++x)
-             unit_points[x][0] = double(x)/double(n_points);
-           break;
-
-      case 2:
-           for (unsigned int x=0; x<n_points;++x)
-             for (unsigned int y=0; y<n_points;++y)
-               {
-                 unit_points[y * n_points + x][0] = double(x)/double(n_points);
-                 unit_points[y * n_points + x][1] = double(y)/double(n_points);
-               }
-           break;
-
-      case 3:
-           for (unsigned int x=0; x<n_points;++x)
-             for (unsigned int y=0; y<n_points;++y)
-               for (unsigned int z=0; z<n_points;++z)
-               {
-                 unit_points[z * n_points + y * n_points + x][0] = double(x)/double(n_points);
-                 unit_points[z * n_points + y * n_points + x][1] = double(y)/double(n_points);
-                 unit_points[z * n_points + y * n_points + x][2] = double(z)/double(n_points);
-               }
-           break;
+    case 1:
+      for (unsigned int x=0; x<n_points; ++x)
+        unit_points[x][0] = double(x)/double(n_points);
+      break;
+
+    case 2:
+      for (unsigned int x=0; x<n_points; ++x)
+        for (unsigned int y=0; y<n_points; ++y)
+          {
+            unit_points[y * n_points + x][0] = double(x)/double(n_points);
+            unit_points[y * n_points + x][1] = double(y)/double(n_points);
+          }
+      break;
+
+    case 3:
+      for (unsigned int x=0; x<n_points; ++x)
+        for (unsigned int y=0; y<n_points; ++y)
+          for (unsigned int z=0; z<n_points; ++z)
+            {
+              unit_points[z * n_points + y * n_points + x][0] = double(x)/double(n_points);
+              unit_points[z * n_points + y * n_points + x][1] = double(y)/double(n_points);
+              unit_points[z * n_points + y * n_points + x][2] = double(z)/double(n_points);
+            }
+      break;
     }
 
 
   MappingQ< dim, spacedim > map(4);
 
-                                  // work with this cell (unlike the
-                                  // _q1 test where we move vertices)
+  // work with this cell (unlike the
+  // _q1 test where we move vertices)
   typename Triangulation<dim, spacedim >::active_cell_iterator
-    cell = triangulation.begin_active();
-  for (unsigned int i=0; i<unit_points.size();++i)
+  cell = triangulation.begin_active();
+  for (unsigned int i=0; i<unit_points.size(); ++i)
     {
-                                      // for each of the points,
-                                      // verify that if we apply
-                                      // the forward map and then
-                                      // pull back that we get
-                                      // the same point again
+      // for each of the points,
+      // verify that if we apply
+      // the forward map and then
+      // pull back that we get
+      // the same point again
       const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
       const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
       Assert (unit_points[i].distance(p_unit) < 1e-10,
-             ExcInternalError());
+              ExcInternalError());
     }
   deallog << "OK" << std::endl;
 }
index 8065080b62372692a4484490abaa693f734085f8..8a46c0b5aa28dfeb573febd2713d824f98ea6bf6 100644 (file)
@@ -40,13 +40,13 @@ void test_real_to_unit_cell()
 {
   const unsigned int dim = 3;
 
-                                  // define a spherical cap boundary
-                                  // to be used for one of the faces
+  // define a spherical cap boundary
+  // to be used for one of the faces
   const double radius = Point<dim>(1.43757e-10, 4.48023e+06, 4.48023e+06).norm();
   HyperBallBoundary<dim> boundary (Point<dim>(), radius);
 
-                                  // create the mesh: a single cell
-                                  // with the following coordinates:
+  // create the mesh: a single cell
+  // with the following coordinates:
   std::vector<Point<dim> > vertices;
   vertices.push_back (Point<dim>( 6.70384e-11, 3.17728e+06, 3.17728e+06));
   vertices.push_back (Point<dim>( -1.46060e+06, 3.99043e+06, 1.46060e+06));
@@ -56,10 +56,10 @@ void test_real_to_unit_cell()
   vertices.push_back (Point<dim>( -2.05956e+06, 5.62684e+06, 2.05956e+06));
   vertices.push_back (Point<dim>( -2.05956e+06, 2.05956e+06, 5.62684e+06));
   vertices.push_back (Point<dim>( -3.65809e+06, 3.65809e+06, 3.65809e+06));
-                                  // the points above don't show
-                                  // enough digits to have the same
-                                  // outer radius, so normalize the
-                                  // four outer ones
+  // the points above don't show
+  // enough digits to have the same
+  // outer radius, so normalize the
+  // four outer ones
   for (unsigned int v=4; v<8; ++v)
     vertices[v] *= radius/vertices[v].norm();
   std::vector<CellData<dim> > cells;
@@ -69,22 +69,22 @@ void test_real_to_unit_cell()
   }
   Triangulation<dim> triangulation;
   triangulation.create_triangulation (vertices, cells,
-                                     SubCellData());
+                                      SubCellData());
 
-                                  // set the boundary indicator for
-                                  // one face and adjacent edges of
-                                  // the single cell
+  // set the boundary indicator for
+  // one face and adjacent edges of
+  // the single cell
   triangulation.set_boundary (1, boundary);
   triangulation.begin_active()->face(5)->set_all_boundary_indicators (1);
 
-                                  // now try to find the coordinates
-                                  // of the following point in the
-                                  // reference coordinate system of
-                                  // the cell
+  // now try to find the coordinates
+  // of the following point in the
+  // reference coordinate system of
+  // the cell
   const Point<dim> p (-3.56413e+06, 1.74215e+06, 2.14762e+06);
   MappingQ<dim> map(4);
   Triangulation<dim >::active_cell_iterator
-    cell = triangulation.begin_active();
+  cell = triangulation.begin_active();
 
   try
     {
index c1afaea811900cc7b41a9f839810c624b6ca368b..2760cfcd736d1dc496fad16734577620bae744a2 100644 (file)
@@ -33,13 +33,13 @@ void test_real_to_unit_cell()
 {
   const unsigned int dim = 3;
 
-                                  // define a spherical cap boundary
-                                  // to be used for one of the faces
+  // define a spherical cap boundary
+  // to be used for one of the faces
   const double radius = Point<dim>(1.43757e-10, 4.48023e+06, 4.48023e+06).norm();
   HyperBallBoundary<dim> boundary (Point<dim>(), radius);
 
-                                  // create the mesh: a single cell
-                                  // with the following coordinates:
+  // create the mesh: a single cell
+  // with the following coordinates:
   std::vector<Point<dim> > vertices;
   vertices.push_back (Point<dim>( 6.70384e-11, 3.17728e+06, 3.17728e+06));
   vertices.push_back (Point<dim>( -1.46060e+06, 3.99043e+06, 1.46060e+06));
@@ -49,10 +49,10 @@ void test_real_to_unit_cell()
   vertices.push_back (Point<dim>( -2.05956e+06, 5.62684e+06, 2.05956e+06));
   vertices.push_back (Point<dim>( -2.05956e+06, 2.05956e+06, 5.62684e+06));
   vertices.push_back (Point<dim>( -3.65809e+06, 3.65809e+06, 3.65809e+06));
-                                  // the points above don't show
-                                  // enough digits to have the same
-                                  // outer radius, so normalize the
-                                  // four outer ones
+  // the points above don't show
+  // enough digits to have the same
+  // outer radius, so normalize the
+  // four outer ones
   for (unsigned int v=4; v<8; ++v)
     vertices[v] *= radius/vertices[v].norm();
   std::vector<CellData<dim> > cells;
@@ -62,22 +62,22 @@ void test_real_to_unit_cell()
   }
   Triangulation<dim> triangulation;
   triangulation.create_triangulation (vertices, cells,
-                                     SubCellData());
+                                      SubCellData());
 
-                                  // set the boundary indicator for
-                                  // one face and adjacent edges of
-                                  // the single cell
+  // set the boundary indicator for
+  // one face and adjacent edges of
+  // the single cell
   triangulation.set_boundary (1, boundary);
   triangulation.begin_active()->face(5)->set_all_boundary_indicators (1);
 
-                                  // now try to find the coordinates
-                                  // of the following point in the
-                                  // reference coordinate system of
-                                  // the cell
+  // now try to find the coordinates
+  // of the following point in the
+  // reference coordinate system of
+  // the cell
   const Point<dim> p (-3.56413e+06, 1.74215e+06, 2.14762e+06);
   MappingQ1<dim> map;
   Triangulation<dim >::active_cell_iterator
-    cell = triangulation.begin_active();
+  cell = triangulation.begin_active();
   try
     {
       map.transform_real_to_unit_cell(cell,p);
index 7f6f141cf764aaa941db998f2a13c14761edca0e..3c0a1b5f08c5f4d9b5cc0aaff20359715c77ee71 100644 (file)
@@ -33,13 +33,13 @@ void test_real_to_unit_cell()
 {
   const unsigned int dim = 3;
 
-                                  // define a spherical cap boundary
-                                  // to be used for one of the faces
+  // define a spherical cap boundary
+  // to be used for one of the faces
   const double radius = Point<dim>(1.43757e-10, 4.48023e+06, 4.48023e+06).norm();
   HyperBallBoundary<dim> boundary (Point<dim>(), radius);
 
-                                  // create the mesh: a single cell
-                                  // with the following coordinates:
+  // create the mesh: a single cell
+  // with the following coordinates:
   std::vector<Point<dim> > vertices;
   vertices.push_back (Point<dim>( 6.70384e-11, 3.17728e+06, 3.17728e+06));
   vertices.push_back (Point<dim>( -1.46060e+06, 3.99043e+06, 1.46060e+06));
@@ -49,10 +49,10 @@ void test_real_to_unit_cell()
   vertices.push_back (Point<dim>( -2.05956e+06, 5.62684e+06, 2.05956e+06));
   vertices.push_back (Point<dim>( -2.05956e+06, 2.05956e+06, 5.62684e+06));
   vertices.push_back (Point<dim>( -3.65809e+06, 3.65809e+06, 3.65809e+06));
-                                  // the points above don't show
-                                  // enough digits to have the same
-                                  // outer radius, so normalize the
-                                  // four outer ones
+  // the points above don't show
+  // enough digits to have the same
+  // outer radius, so normalize the
+  // four outer ones
   for (unsigned int v=4; v<8; ++v)
     vertices[v] *= radius/vertices[v].norm();
   std::vector<CellData<dim> > cells;
@@ -62,30 +62,30 @@ void test_real_to_unit_cell()
   }
   Triangulation<dim> triangulation;
   triangulation.create_triangulation (vertices, cells,
-                                     SubCellData());
+                                      SubCellData());
 
-                                  // set the boundary indicator for
-                                  // one face and adjacent edges of
-                                  // the single cell
+  // set the boundary indicator for
+  // one face and adjacent edges of
+  // the single cell
   triangulation.set_boundary (1, boundary);
   triangulation.begin_active()->face(5)->set_all_boundary_indicators (1);
 
-                                  // now try to find the coordinates
-                                  // of the following point in the
-                                  // reference coordinate system of
-                                  // the cell
+  // now try to find the coordinates
+  // of the following point in the
+  // reference coordinate system of
+  // the cell
   const Point<dim> p (-3.56413e+06, 1.74215e+06, 2.14762e+06);
   MappingQ1<dim> map;
   Triangulation<dim >::active_cell_iterator
-    cell = triangulation.begin_active();
-
-                                  // the following call will fail
-                                  // because the point is outside the
-                                  // bounds of the cell. catch the
-                                  // exception and make sure that
-                                  // there is output that documents
-                                  // that the function threw an
-                                  // exception
+  cell = triangulation.begin_active();
+
+  // the following call will fail
+  // because the point is outside the
+  // bounds of the cell. catch the
+  // exception and make sure that
+  // there is output that documents
+  // that the function threw an
+  // exception
   try
     {
       map.transform_real_to_unit_cell(cell,p);
@@ -93,7 +93,7 @@ void test_real_to_unit_cell()
   catch (const std::exception &e)
     {
       deallog << "Caught exception of type " << typeid(e).name()
-             << std::endl;
+              << std::endl;
     }
 }
 
index f9e2ba6ddd8871206247403faaecab8fb9e9b7c1..462e278c174c3cb6d40877d4b98bbda94353d290 100644 (file)
@@ -33,13 +33,13 @@ void test_real_to_unit_cell()
 {
   const unsigned int dim = 3;
 
-                                  // define a spherical cap boundary
-                                  // to be used for one of the faces
+  // define a spherical cap boundary
+  // to be used for one of the faces
   const double radius = Point<dim>(1.43757e-10, 4.48023e+06, 4.48023e+06).norm();
   HyperBallBoundary<dim> boundary (Point<dim>(), radius);
 
-                                  // create the mesh: a single cell
-                                  // with the following coordinates:
+  // create the mesh: a single cell
+  // with the following coordinates:
   std::vector<Point<dim> > vertices;
   vertices.push_back (Point<dim>( 6.70384e-11, 3.17728e+06, 3.17728e+06));
   vertices.push_back (Point<dim>( -1.46060e+06, 3.99043e+06, 1.46060e+06));
@@ -49,10 +49,10 @@ void test_real_to_unit_cell()
   vertices.push_back (Point<dim>( -2.05956e+06, 5.62684e+06, 2.05956e+06));
   vertices.push_back (Point<dim>( -2.05956e+06, 2.05956e+06, 5.62684e+06));
   vertices.push_back (Point<dim>( -3.65809e+06, 3.65809e+06, 3.65809e+06));
-                                  // the points above don't show
-                                  // enough digits to have the same
-                                  // outer radius, so normalize the
-                                  // four outer ones
+  // the points above don't show
+  // enough digits to have the same
+  // outer radius, so normalize the
+  // four outer ones
   for (unsigned int v=4; v<8; ++v)
     vertices[v] *= radius/vertices[v].norm();
   std::vector<CellData<dim> > cells;
@@ -62,20 +62,20 @@ void test_real_to_unit_cell()
   }
   Triangulation<dim> triangulation;
   triangulation.create_triangulation (vertices, cells,
-                                     SubCellData());
+                                      SubCellData());
 
-                                  // set the boundary indicator for
-                                  // one face and adjacent edges of
-                                  // the single cell
+  // set the boundary indicator for
+  // one face and adjacent edges of
+  // the single cell
   triangulation.set_boundary (1, boundary);
   triangulation.begin_active()->face(5)->set_all_boundary_indicators (1);
 
-                                  // now see if the point is inside
-                                  // or outside
+  // now see if the point is inside
+  // or outside
   const Point<dim> p (-3.56413e+06, 1.74215e+06, 2.14762e+06);
   Assert (triangulation.begin_active()->point_inside (p)
-         == false,
-         ExcInternalError());
+          == false,
+          ExcInternalError());
   deallog << "Point is outside!" << std::endl;
 }
 
index 344ab1e1ea1366b8ea0301a472a6744727dddd3e..fd46ff276e8cf4cdffc2a0fbf52bb2820d08e096 100644 (file)
@@ -47,64 +47,64 @@ void test_real_to_unit_cell()
 
   switch (dim)
     {
-      case 1:
-           for (unsigned int x=0; x<n_points;++x)
-             unit_points[x][0] = double(x)/double(n_points);
-           break;
-
-      case 2:
-           for (unsigned int x=0; x<n_points;++x)
-             for (unsigned int y=0; y<n_points;++y)
-               {
-                 unit_points[y * n_points + x][0] = double(x)/double(n_points);
-                 unit_points[y * n_points + x][1] = double(y)/double(n_points);
-               }
-           break;
-
-      case 3:
-           for (unsigned int x=0; x<n_points;++x)
-             for (unsigned int y=0; y<n_points;++y)
-               for (unsigned int z=0; z<n_points;++z)
-               {
-                 unit_points[z * n_points + y * n_points + x][0] = double(x)/double(n_points);
-                 unit_points[z * n_points + y * n_points + x][1] = double(y)/double(n_points);
-                 unit_points[z * n_points + y * n_points + x][2] = double(z)/double(n_points);
-               }
-           break;
+    case 1:
+      for (unsigned int x=0; x<n_points; ++x)
+        unit_points[x][0] = double(x)/double(n_points);
+      break;
+
+    case 2:
+      for (unsigned int x=0; x<n_points; ++x)
+        for (unsigned int y=0; y<n_points; ++y)
+          {
+            unit_points[y * n_points + x][0] = double(x)/double(n_points);
+            unit_points[y * n_points + x][1] = double(y)/double(n_points);
+          }
+      break;
+
+    case 3:
+      for (unsigned int x=0; x<n_points; ++x)
+        for (unsigned int y=0; y<n_points; ++y)
+          for (unsigned int z=0; z<n_points; ++z)
+            {
+              unit_points[z * n_points + y * n_points + x][0] = double(x)/double(n_points);
+              unit_points[z * n_points + y * n_points + x][1] = double(y)/double(n_points);
+              unit_points[z * n_points + y * n_points + x][2] = double(z)/double(n_points);
+            }
+      break;
     }
 
 
   MappingQ< dim, spacedim > map(4);
 
   typename Triangulation<dim, spacedim >::active_cell_iterator
-    cell = triangulation.begin_active();
+  cell = triangulation.begin_active();
 
-                                  //Move a vertex a little bit
+  //Move a vertex a little bit
   const unsigned int n_dx = 5;
   const double dx = 0.4/n_dx;
   Point<spacedim> direction;
-  for (unsigned int j=0; j<spacedim;++j)
+  for (unsigned int j=0; j<spacedim; ++j)
     direction[j]=dx;
 
-                                  // in a loop, make the cell more
-                                  // and more distorted
-  for (unsigned int j=0; j<n_dx;++j)
+  // in a loop, make the cell more
+  // and more distorted
+  for (unsigned int j=0; j<n_dx; ++j)
     {
       deallog << "Vertex displacement: " << double(j)*direction <<  std::endl;
       cell->vertex(0) = double(j)*direction;
 
-      for (unsigned int i=0; i<unit_points.size();++i)
-       {
-                                          // for each of the points,
-                                          // verify that if we apply
-                                          // the forward map and then
-                                          // pull back that we get
-                                          // the same point again
-         const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
-         const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
-         Assert (unit_points[i].distance(p_unit) < 1e-10,
-                 ExcInternalError());
-       }
+      for (unsigned int i=0; i<unit_points.size(); ++i)
+        {
+          // for each of the points,
+          // verify that if we apply
+          // the forward map and then
+          // pull back that we get
+          // the same point again
+          const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
+          const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
+          Assert (unit_points[i].distance(p_unit) < 1e-10,
+                  ExcInternalError());
+        }
     }
   deallog << "OK" << std::endl;
 }
index a7649207b7f0d0fde23d84a47ad7128452efe6a4..39f044ab4d7216669f74fbf9eabaab2a4746ca28 100644 (file)
@@ -44,9 +44,9 @@ void check ()
 
       Triangulation<dim> tr;
       if (dim == 1)
-       GridGenerator::hyper_cube (tr);
+        GridGenerator::hyper_cube (tr);
       else
-       GridGenerator::hyper_ball (tr);
+        GridGenerator::hyper_ball (tr);
       tr.refine_global (3-dim);
 
       FE_DGQArbitraryNodes<dim> fe ((QGauss<1>(q_points)));
@@ -54,25 +54,25 @@ void check ()
       dh.distribute_dofs (fe);
 
       SparsityPattern sp (dh.n_dofs(),
-                         dh.n_dofs(),
-                         fe.dofs_per_cell);
+                          dh.n_dofs(),
+                          fe.dofs_per_cell);
       DoFTools::make_sparsity_pattern (dh, sp);
       sp.compress();
 
       SparseMatrix<double> mass_matrix (sp);
       MatrixTools::create_mass_matrix (dh,
-                                      QGauss<dim>(q_points),
-                                      mass_matrix);
+                                       QGauss<dim>(q_points),
+                                       mass_matrix);
 
-                                      // verify that the matrix is diagonal
+      // verify that the matrix is diagonal
       for (unsigned int i=0; i<dh.n_dofs(); ++i)
-       {
-         deallog << mass_matrix.el(i,i) << std::endl;
-         for (unsigned int j=0; j<dh.n_dofs(); ++j)
-           if (i != j)
-             Assert (std::fabs(mass_matrix.el(i,j) / mass_matrix.el(i,i)) < 1e-14,
-                     ExcInternalError());
-       }
+        {
+          deallog << mass_matrix.el(i,i) << std::endl;
+          for (unsigned int j=0; j<dh.n_dofs(); ++j)
+            if (i != j)
+              Assert (std::fabs(mass_matrix.el(i,j) / mass_matrix.el(i,i)) < 1e-14,
+                      ExcInternalError());
+        }
     }
 }
 
index 7408eeed28f1c90e54da2e8f889594f0b8ab8496..74c53dd4b4a6f8538bb3b1ad1fec821b4d1e3da8 100644 (file)
@@ -60,43 +60,43 @@ Point<2> tilt_coordinates (const Point<2> p)
 
 void
 transform_grid (Triangulation<2> &tria,
-               const unsigned int  transform)
+                const unsigned int  transform)
 {
   switch (transform)
     {
-                                       // first round: take
-                                       // original grid
-      case 0:
-           break;
-            
-                                            // second round: rotate
-                                            // triangulation
-      case 1:
-           GridTools::rotate (3.14159265358/2, tria);
-           break;
-
-                                            // third round: inflate
-                                            // by a factor of 2
-      case 2:
-           GridTools::scale (2, tria);
-           break;
-
-                                             // third round: scale
-                                             // back, rotate back,
-                                             // stretch
-      case 3:
-            GridTools::scale (.5, tria);
-           GridTools::rotate (-3.14159265358/2, tria);
-            GridTools::transform (&stretch_coordinates, tria);
-            
-           break;
-            
-      default:
-           Assert (false, ExcNotImplemented());
+      // first round: take
+      // original grid
+    case 0:
+      break;
+
+      // second round: rotate
+      // triangulation
+    case 1:
+      GridTools::rotate (3.14159265358/2, tria);
+      break;
+
+      // third round: inflate
+      // by a factor of 2
+    case 2:
+      GridTools::scale (2, tria);
+      break;
+
+      // third round: scale
+      // back, rotate back,
+      // stretch
+    case 3:
+      GridTools::scale (.5, tria);
+      GridTools::rotate (-3.14159265358/2, tria);
+      GridTools::transform (&stretch_coordinates, tria);
+
+      break;
+
+    default:
+      Assert (false, ExcNotImplemented());
     };
 }
 
-           
+
 
 
 template<int dim>
@@ -107,61 +107,61 @@ plot_shape_functions(const unsigned int degree)
   Triangulation<dim> tr;
   GridGenerator::hyper_cube(tr, 0., 1.);
 
-                                  // check the following with a
-                                  // number of transformed
-                                  // triangulations
+  // check the following with a
+  // number of transformed
+  // triangulations
   for (unsigned int transform=0; transform<4; ++transform)
     {
       std::ostringstream ost;
       ost << "Nedelec" << degree << "-Transform" << transform;
       deallog.push(ost.str());
-      
+
       transform_grid (tr, transform);
 
       DoFHandler<dim> dof(tr);
       typename DoFHandler<dim>::cell_iterator c = dof.begin();
       dof.distribute_dofs(element);
-      
+
       QTrapez<1> q_trapez;
       const unsigned int div=2;
       QIterated<dim> q(q_trapez, div);
       FEValues<dim> fe(element, q, update_values|update_gradients|update_q_points);
       fe.reinit(c);
-      
-      for (unsigned int q_point=0;q_point< q.size();++q_point)
-       {
-                                          // Output function in
-                                          // gnuplot readable format,
-                                          // namely x y z u0x u0y u0z u1x...
-         deallog << "value    " << q_point << '\t' << fe.quadrature_point(q_point);
-         
-         for (unsigned int i=0;i<element.dofs_per_cell;++i)
-           {
-             for (unsigned int c=0; c<dim; ++c)
-               deallog << '\t' << fe.shape_value_component(i,q_point,c);
-           }
-
-                                          // Output the gradients in
-                                          // similar fashion
-         deallog << std::endl << "gradient " << q_point << '\t' << fe.quadrature_point(q_point);
-         
-         for (unsigned int i=0;i<element.dofs_per_cell;++i)
-           {
-             for (unsigned int c=0; c<dim; ++c)
-               {
-                 for (unsigned int d=0; d<dim; ++d)
-                   deallog << '\t' << fe.shape_grad_component(i,q_point,c)[d];
-               }
-           }
-         deallog << std::endl;
-         
-         if ((q_point+1) % (2*div-1) == 0)
-           {
-             deallog << "value    " << std::endl;
-             deallog << "gradient " << std::endl;
-           }
-       }
-      
+
+      for (unsigned int q_point=0; q_point< q.size(); ++q_point)
+        {
+          // Output function in
+          // gnuplot readable format,
+          // namely x y z u0x u0y u0z u1x...
+          deallog << "value    " << q_point << '\t' << fe.quadrature_point(q_point);
+
+          for (unsigned int i=0; i<element.dofs_per_cell; ++i)
+            {
+              for (unsigned int c=0; c<dim; ++c)
+                deallog << '\t' << fe.shape_value_component(i,q_point,c);
+            }
+
+          // Output the gradients in
+          // similar fashion
+          deallog << std::endl << "gradient " << q_point << '\t' << fe.quadrature_point(q_point);
+
+          for (unsigned int i=0; i<element.dofs_per_cell; ++i)
+            {
+              for (unsigned int c=0; c<dim; ++c)
+                {
+                  for (unsigned int d=0; d<dim; ++d)
+                    deallog << '\t' << fe.shape_grad_component(i,q_point,c)[d];
+                }
+            }
+          deallog << std::endl;
+
+          if ((q_point+1) % (2*div-1) == 0)
+            {
+              deallog << "value    " << std::endl;
+              deallog << "gradient " << std::endl;
+            }
+        }
+
       deallog << std::endl;
       deallog.pop();
     }
@@ -173,13 +173,13 @@ main()
 {
   std::ofstream logfile ("nedelec/output");
   deallog << std::setprecision(PRECISION);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
   plot_shape_functions<2> (0);
   plot_shape_functions<2> (1);
-  
+
   return 0;
 }
 
index 65d24cd88fdbfaeadf02d19bf00c7ac3f69f1ac2..2c69476b54bf9654ff99acaf004f5c26da2e7343 100644 (file)
@@ -39,7 +39,7 @@
 
 
 void
-plot_diff(const Vector<double>& v1, const Vector<double>& v2, const Tensor<1,2>& n)
+plot_diff(const Vector<double> &v1, const Vector<double> &v2, const Tensor<1,2> &n)
 {
   AssertDimension(v1.size(), 2);
   AssertDimension(v2.size(), 2);
@@ -52,21 +52,21 @@ plot_diff(const Vector<double>& v1, const Vector<double>& v2, const Tensor<1,2>&
 
 
 void
-plot_diff(const Vector<double>& v1, const Vector<double>& v2, const Tensor<1,3>& n)
+plot_diff(const Vector<double> &v1, const Vector<double> &v2, const Tensor<1,3> &n)
 {
   AssertDimension(v1.size(), 3);
   AssertDimension(v2.size(), 3);
-  
+
   Tensor<1,3> p1, p2;
-  for (unsigned int d=0;d<3;++d)
+  for (unsigned int d=0; d<3; ++d)
     {
       const unsigned int d1 = (d+1)%3;
       const unsigned int d2 = (d+2)%3;
-      
+
       p1[d] = v1(d1)*n[d2] - v1(d2)*n[d1];
       p2[d] = v2(d1)*n[d2] - v2(d2)*n[d1];
     }
-  
+
   deallog << " tangential  diff " << p1-p2 << " (" << p1 << '-' << p2 << ')' << std::endl;
 }
 
@@ -78,91 +78,91 @@ plot (const Triangulation<dim> &tr, const unsigned int p)
   deallog << dim << "d, "
           << tr.n_active_cells() << " CELLS" << std::endl;
 
-                                  // Create the finite element space
-  FE_Nedelec<dim> fe_ned (p);  
+  // Create the finite element space
+  FE_Nedelec<dim> fe_ned (p);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe_ned);
   ConstraintMatrix cm;
   DoFTools::make_hanging_node_constraints (dof, cm);
   cm.close ();
-  
-                                   // generate some numbers for the
-                                   // degrees of freedom on this mesh
+
+  // generate some numbers for the
+  // degrees of freedom on this mesh
   Vector<double> values (dof.n_dofs());
   for (unsigned int i=0; i<values.size(); ++i)
     values(i) = i;
   cm.distribute (values);
-  
-                                   // then make sure that hanging node
-                                   // constraints are taken care of
-
-                                   // now take these values, and print
-                                   // the values of this so defined
-                                   // function on each cell and on
-                                   // each quadrature point
+
+  // then make sure that hanging node
+  // constraints are taken care of
+
+  // now take these values, and print
+  // the values of this so defined
+  // function on each cell and on
+  // each quadrature point
   QTrapez<dim-1> quadrature;
   std::vector<Vector<double> > shape_values1 (quadrature.size(),
-                                             Vector<double>(dim));
+                                              Vector<double>(dim));
   std::vector<Vector<double> > shape_values2 (quadrature.size(),
-                                             Vector<double>(dim));
-  
+                                              Vector<double>(dim));
+
   MappingCartesian<dim> mapping;
   FEFaceValues<dim> feface(mapping, fe_ned, quadrature,
-                          update_values|update_q_points|update_normal_vectors);
+                           update_values|update_q_points|update_normal_vectors);
   FEFaceValues<dim> feneighbor(mapping, fe_ned, quadrature,
-                              update_values|update_q_points|update_normal_vectors);
+                               update_values|update_q_points|update_normal_vectors);
   FESubfaceValues<dim> fesubface(mapping, fe_ned, quadrature,
-                                update_values|update_q_points|update_normal_vectors);
-  
-  
+                                 update_values|update_q_points|update_normal_vectors);
+
+
   for (typename DoFHandler<dim>::active_cell_iterator
-         c = dof.begin_active();
+       c = dof.begin_active();
        c!=dof.end(); ++c)
-    for (unsigned int face=0;face<GeometryInfo<dim>::faces_per_cell;++face)
+    for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
       {
-       deallog << "cell " << c << " face " << face;
-       if (c->at_boundary(face))
-         {
-           deallog << " boundary" << std::endl;
-           continue;
-         }
-
-       if (c->neighbor(face)->has_children())
-         {
-           deallog << " neighbor " << c->neighbor(face) << " refined" << std::endl;
-           continue;
-         }
-       
-       deallog << " neighbor " << c->neighbor(face) << std::endl;
-       
-       feface.reinit(c, face);
-       feface.get_function_values (values, shape_values1);
-       
-       if (c->neighbor(face)->level() < c->level())
-         {
-           std::pair<unsigned int, unsigned int> neighbor_face
-             = c->neighbor_of_coarser_neighbor(face);
-           
-           fesubface.reinit(c->neighbor(face), neighbor_face.first, neighbor_face.second);
-           fesubface.get_function_values (values, shape_values2);
-           for (unsigned int k=0;k<feface.n_quadrature_points;++k)
-             {
-                   deallog << feface.quadrature_point(k);
-                   plot_diff(shape_values1[k], shape_values2[k], feface.normal_vector(k));
-             }
-         }
-       else
-         {
-           feneighbor.reinit(c->neighbor(face), c->neighbor_of_neighbor(face));
-           feneighbor.get_function_values (values, shape_values2);
-           for (unsigned int k=0;k<feface.n_quadrature_points;++k)
-             {
-               deallog << feface.quadrature_point(k);
-               plot_diff(shape_values1[k], shape_values2[k], feface.normal_vector(k));
-             }
-         }
+        deallog << "cell " << c << " face " << face;
+        if (c->at_boundary(face))
+          {
+            deallog << " boundary" << std::endl;
+            continue;
+          }
+
+        if (c->neighbor(face)->has_children())
+          {
+            deallog << " neighbor " << c->neighbor(face) << " refined" << std::endl;
+            continue;
+          }
+
+        deallog << " neighbor " << c->neighbor(face) << std::endl;
+
+        feface.reinit(c, face);
+        feface.get_function_values (values, shape_values1);
+
+        if (c->neighbor(face)->level() < c->level())
+          {
+            std::pair<unsigned int, unsigned int> neighbor_face
+              = c->neighbor_of_coarser_neighbor(face);
+
+            fesubface.reinit(c->neighbor(face), neighbor_face.first, neighbor_face.second);
+            fesubface.get_function_values (values, shape_values2);
+            for (unsigned int k=0; k<feface.n_quadrature_points; ++k)
+              {
+                deallog << feface.quadrature_point(k);
+                plot_diff(shape_values1[k], shape_values2[k], feface.normal_vector(k));
+              }
+          }
+        else
+          {
+            feneighbor.reinit(c->neighbor(face), c->neighbor_of_neighbor(face));
+            feneighbor.get_function_values (values, shape_values2);
+            for (unsigned int k=0; k<feface.n_quadrature_points; ++k)
+              {
+                deallog << feface.quadrature_point(k);
+                plot_diff(shape_values1[k], shape_values2[k], feface.normal_vector(k));
+              }
+          }
       }
-                                  // Uncomment this to plot solutions
+  // Uncomment this to plot solutions
 //   if (dim==2 && p==1)
 //     {
 //       std::ofstream gnuplot_output("test.gpl");
@@ -183,12 +183,12 @@ check (const unsigned int p)
   Triangulation<dim> tr;
   GridGenerator::hyper_cube(tr, 0., 1.);
 
-                                   // first everything on a
-                                   // once-refined grid
+  // first everything on a
+  // once-refined grid
   tr.refine_global (1);
 //   plot (tr, p);
 
-                                   // then same with one cell refined
+  // then same with one cell refined
   tr.begin_active()->set_refine_flag ();
   tr.execute_coarsening_and_refinement ();
   plot (tr, p);
@@ -200,7 +200,7 @@ main()
 {
   std::ofstream logfile ("nedelec_2/output");
   deallog << std::setprecision(PRECISION);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
@@ -210,7 +210,7 @@ main()
   deallog << "Degree 1:" << std::endl;
   check<2> (1);
   check<3> (1);
-  
+
   return 0;
 }
 
index c9c7efc4871c9490cd219392e8d9e4dc6d425566..65e0e039a77667b14ca52aba4a13c604d5c4abdb 100644 (file)
@@ -43,42 +43,42 @@ inline void
 check (const unsigned int p)
 {
   deallog << dim << "-D" << std::endl;
-  
+
   Triangulation<dim> tr;
   GridGenerator::hyper_cube(tr, 0., 1.);
 
-                                   // work on a once-refined grid
+  // work on a once-refined grid
   tr.refine_global (1);
 
   FE_Nedelec<dim> fe_ned(p);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe_ned);
 
-                                   // generate a function on the
-                                   // coarse grid (with shape function
-                                   // values equal to the index of the
-                                   // line)
+  // generate a function on the
+  // coarse grid (with shape function
+  // values equal to the index of the
+  // line)
   Vector<double> coarse_grid_values (fe_ned.dofs_per_cell);
   for (unsigned int i=0; i<coarse_grid_values.size(); ++i)
     coarse_grid_values(i) = i;
 
-                                   // then transfer this function
-                                   // from the coarse grid to the
-                                   // child cells.
+  // then transfer this function
+  // from the coarse grid to the
+  // child cells.
   Vector<double> values (dof.n_dofs());
   for (typename DoFHandler<dim>::active_cell_iterator
-         c = dof.begin_active();
+       c = dof.begin_active();
        c!=dof.end(); ++c)
     {
       Vector<double> tmp (fe_ned.dofs_per_cell);
       fe_ned.get_prolongation_matrix (c->index()).vmult (tmp, coarse_grid_values);
       c->set_dof_values (tmp, values);
     };
-  
 
-                                   // then output these values at the
-                                   // quadrature points of all cells
-                                   // of the finer grid
+
+  // then output these values at the
+  // quadrature points of all cells
+  // of the finer grid
   QTrapez<dim> quadrature;
   std::vector<Vector<double> > shape_values (quadrature.size(),
                                              Vector<double>(dim));
@@ -86,7 +86,7 @@ check (const unsigned int p)
                    update_values|update_q_points);
 
   for (typename DoFHandler<dim>::active_cell_iterator
-         c = dof.begin_active();
+       c = dof.begin_active();
        c!=dof.end(); ++c)
     {
       deallog << "  CELL " << c << std::endl;
@@ -100,10 +100,10 @@ check (const unsigned int p)
           for (unsigned int d=0; d<dim; ++d)
             deallog << (d==0 ? "" : " ")
                     << shape_values[q](d);
-          
+
           deallog << "]" << std::endl;
         };
-                
+
       deallog << std::endl;
     }
 }
@@ -114,7 +114,7 @@ main()
 {
   std::ofstream logfile ("nedelec_3/output");
   deallog << std::setprecision(PRECISION);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
index 99ad6803c452c8115e03360970512e3ac7320959..592827b9f66a9256c8e1aafbb5a4b6550bd81d73 100644 (file)
@@ -37,15 +37,16 @@ int main()
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-                                  // generate a version of the
-                                  // Nedelec element but force it to
-                                  // use the old-style constraints
-  struct MyFE : FE_Nedelec<3> {
-      MyFE () : FE_Nedelec<3>(0) {};
-      virtual bool hp_constraints_are_implemented () const
-       {
-         return false;
-       }
+  // generate a version of the
+  // Nedelec element but force it to
+  // use the old-style constraints
+  struct MyFE : FE_Nedelec<3>
+  {
+    MyFE () : FE_Nedelec<3>(0) {};
+    virtual bool hp_constraints_are_implemented () const
+    {
+      return false;
+    }
   } fe;
 
   Triangulation<3> tr(Triangulation<3>::limit_level_difference_at_vertices);
index 739601f62945f2407bebf10a905e60e9b66b6ab0..1e390f682cabc2a9bfe1cae2a8823c2b40610962 100644 (file)
 #include <fstream>
 
 
-                                // create the matrix in the plain old
-                                // way, which is valid if the finite
-                                // element shape functions are
-                                // primitive
+// create the matrix in the plain old
+// way, which is valid if the finite
+// element shape functions are
+// primitive
 template <int dim>
 void
 create_stokes_matrix_1 (const DoFHandler<dim> &dof_handler,
-                       SparseMatrix<double>  &A)
+                        SparseMatrix<double>  &A)
 {
   const FiniteElement<dim> &fe = dof_handler.get_fe();
   const unsigned int dofs_per_cell = fe.dofs_per_cell;
-  
+
   typename DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
-  
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
+
   std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
   FullMatrix<double> local_matrix (dofs_per_cell, dofs_per_cell);
 
   QGauss<dim> quadrature (3);
   const unsigned int n_q_points = quadrature.size();
-  
+
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   const double nu = 3.14159265358e-2;
-  
+
   for (; cell!=endc; ++cell)
     {
       local_matrix = 0;
       fe_values.reinit (cell);
 
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int j=0; j<dofs_per_cell; ++j)
-         for (unsigned int q=0; q<n_q_points; ++q)
-           {
-             const unsigned int
-               comp_i = fe.system_to_component_index(i).first,
-               comp_j = fe.system_to_component_index(j).first;
-
-                                              // velocity-velocity coupling?
-             if ((comp_i<dim) && (comp_j<dim))
-               if (comp_i == comp_j)
-                 local_matrix(i,j) += (nu *
-                                      (fe_values.shape_grad(i,q) * 
-                                       fe_values.shape_grad(j,q)  ) *
-                                      fe_values.JxW(q)); 
-
-                                              // velocity-pressure coupling
-             if ((comp_i<dim) && (comp_j==dim))
-               local_matrix(i,j) += (-fe_values.shape_grad(i,q)[comp_i] * 
-                                    fe_values.shape_value(j,q)        *
-                                    fe_values.JxW(q)); 
-
-                                              // pressure-velocity coupling
-             if ((comp_i==dim) && (comp_j<dim))
-               local_matrix(i,j) += (fe_values.shape_value(i,q) * 
-                                    fe_values.shape_grad(j,q)[comp_j] *
-                                    fe_values.JxW(q)); 
-           };
-      
+        for (unsigned int j=0; j<dofs_per_cell; ++j)
+          for (unsigned int q=0; q<n_q_points; ++q)
+            {
+              const unsigned int
+              comp_i = fe.system_to_component_index(i).first,
+              comp_j = fe.system_to_component_index(j).first;
+
+              // velocity-velocity coupling?
+              if ((comp_i<dim) && (comp_j<dim))
+                if (comp_i == comp_j)
+                  local_matrix(i,j) += (nu *
+                                        (fe_values.shape_grad(i,q) *
+                                         fe_values.shape_grad(j,q)  ) *
+                                        fe_values.JxW(q));
+
+              // velocity-pressure coupling
+              if ((comp_i<dim) && (comp_j==dim))
+                local_matrix(i,j) += (-fe_values.shape_grad(i,q)[comp_i] *
+                                      fe_values.shape_value(j,q)        *
+                                      fe_values.JxW(q));
+
+              // pressure-velocity coupling
+              if ((comp_i==dim) && (comp_j<dim))
+                local_matrix(i,j) += (fe_values.shape_value(i,q) *
+                                      fe_values.shape_grad(j,q)[comp_j] *
+                                      fe_values.JxW(q));
+            };
+
       cell->get_dof_indices (local_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int j=0; j<dofs_per_cell; ++j)
-         A.add (local_dof_indices[i],
-                local_dof_indices[j],
-                local_matrix(i,j));
+        for (unsigned int j=0; j<dofs_per_cell; ++j)
+          A.add (local_dof_indices[i],
+                 local_dof_indices[j],
+                 local_matrix(i,j));
     };
 }
 
 
 
-                                // create the matrix in the simple
-                                // way that is necessary when you
-                                // want to use non-primitive shape
-                                // functions
+// create the matrix in the simple
+// way that is necessary when you
+// want to use non-primitive shape
+// functions
 template <int dim>
 void
 create_stokes_matrix_2 (const DoFHandler<dim> &dof_handler,
-                       SparseMatrix<double>  &A)
+                        SparseMatrix<double>  &A)
 {
   const FiniteElement<dim> &fe = dof_handler.get_fe();
   const unsigned int dofs_per_cell = fe.dofs_per_cell;
-  
+
   typename DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
-  
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
+
   std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
   FullMatrix<double> local_matrix (dofs_per_cell, dofs_per_cell);
 
   QGauss<dim> quadrature (3);
   const unsigned int n_q_points = quadrature.size();
-  
+
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   const double nu = 3.14159265358e-2;
-  
+
   for (; cell!=endc; ++cell)
     {
       local_matrix = 0;
       fe_values.reinit (cell);
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
-       for (unsigned int comp_i=0; comp_i<fe.n_components(); ++comp_i)
-         for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
-           for (unsigned int comp_j=0; comp_j<fe.n_components(); ++comp_j)
-             for (unsigned int q=0; q<n_q_points; ++q) 
-               {
-                                                  // velocity-velocity coupling?
-                 if ((comp_i<dim) && (comp_j<dim))
-                   if (comp_i == comp_j)
-                     local_matrix(i,j)
-                       += (nu *
-                           (fe_values.shape_grad_component(i,q,comp_i) * 
-                            fe_values.shape_grad_component(j,q,comp_j)  ) *
-                           fe_values.JxW(q)); 
-
-                                                  // velocity-pressure coupling
-                 if ((comp_i<dim) && (comp_j==dim))
-                   local_matrix(i,j)
-                     += (-fe_values.shape_grad_component(i,q,comp_i)[comp_i] * 
-                         fe_values.shape_value_component(j,q,comp_j)        *
-                         fe_values.JxW(q)); 
-
-                                                  // pressure-velocity coupling
-                 if ((comp_i==dim) && (comp_j<dim))
-                   local_matrix(i,j)
-                     += (fe_values.shape_value_component(i,q,comp_i) * 
-                         fe_values.shape_grad_component(j,q,comp_j)[comp_j] *
-                         fe_values.JxW(q)); 
-               };
-
-      
+        for (unsigned int comp_i=0; comp_i<fe.n_components(); ++comp_i)
+          for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
+            for (unsigned int comp_j=0; comp_j<fe.n_components(); ++comp_j)
+              for (unsigned int q=0; q<n_q_points; ++q)
+                {
+                  // velocity-velocity coupling?
+                  if ((comp_i<dim) && (comp_j<dim))
+                    if (comp_i == comp_j)
+                      local_matrix(i,j)
+                      += (nu *
+                          (fe_values.shape_grad_component(i,q,comp_i) *
+                           fe_values.shape_grad_component(j,q,comp_j)  ) *
+                          fe_values.JxW(q));
+
+                  // velocity-pressure coupling
+                  if ((comp_i<dim) && (comp_j==dim))
+                    local_matrix(i,j)
+                    += (-fe_values.shape_grad_component(i,q,comp_i)[comp_i] *
+                        fe_values.shape_value_component(j,q,comp_j)        *
+                        fe_values.JxW(q));
+
+                  // pressure-velocity coupling
+                  if ((comp_i==dim) && (comp_j<dim))
+                    local_matrix(i,j)
+                    += (fe_values.shape_value_component(i,q,comp_i) *
+                        fe_values.shape_grad_component(j,q,comp_j)[comp_j] *
+                        fe_values.JxW(q));
+                };
+
+
       cell->get_dof_indices (local_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int j=0; j<dofs_per_cell; ++j)
-         A.add (local_dof_indices[i],
-                local_dof_indices[j],
-                local_matrix(i,j));
+        for (unsigned int j=0; j<dofs_per_cell; ++j)
+          A.add (local_dof_indices[i],
+                 local_dof_indices[j],
+                 local_matrix(i,j));
     };
 }
 
 
 
-                                // create the matrix in a way that is
-                                // necessary when you want to use
-                                // non-primitive shape
-                                // functions. compared to the second
-                                // possibility used above, use some
-                                // optimizations
+// create the matrix in a way that is
+// necessary when you want to use
+// non-primitive shape
+// functions. compared to the second
+// possibility used above, use some
+// optimizations
 template <int dim>
 void
 create_stokes_matrix_3 (const DoFHandler<dim> &dof_handler,
-                       SparseMatrix<double>  &A)
+                        SparseMatrix<double>  &A)
 {
   const FiniteElement<dim> &fe = dof_handler.get_fe();
   const unsigned int dofs_per_cell = fe.dofs_per_cell;
-  
+
   typename DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
-  
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
+
   std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
   FullMatrix<double> local_matrix (dofs_per_cell, dofs_per_cell);
 
   QGauss<dim> quadrature (3);
   const unsigned int n_q_points = quadrature.size();
-  
+
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   const double nu = 3.14159265358e-2;
-  
+
   for (; cell!=endc; ++cell)
     {
       local_matrix = 0;
       fe_values.reinit (cell);
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
-       for (unsigned int comp_i=0; comp_i<fe.n_components(); ++comp_i)
-         if (fe.get_nonzero_components(i)[comp_i] == true)
-           for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
-             for (unsigned int comp_j=0; comp_j<fe.n_components(); ++comp_j)
-               if (fe.get_nonzero_components(j)[comp_j] == true)               
-                 for (unsigned int q=0; q<n_q_points; ++q) 
-                   {
-                                                      // velocity-velocity coupling?
-                     if ((comp_i<dim) && (comp_j<dim))
-                       if (comp_i == comp_j)
-                         local_matrix(i,j)
-                           += (nu *
-                               (fe_values.shape_grad_component(i,q,comp_i) * 
-                                fe_values.shape_grad_component(j,q,comp_j)  ) *
-                               fe_values.JxW(q)); 
-                     
-                                                      // velocity-pressure coupling
-                     if ((comp_i<dim) && (comp_j==dim))
-                       local_matrix(i,j)
-                         += (-fe_values.shape_grad_component(i,q,comp_i)[comp_i] * 
-                             fe_values.shape_value_component(j,q,comp_j)        *
-                             fe_values.JxW(q)); 
-                     
-                                                      // pressure-velocity coupling
-                     if ((comp_i==dim) && (comp_j<dim))
-                       local_matrix(i,j)
-                         += (fe_values.shape_value_component(i,q,comp_i) * 
-                             fe_values.shape_grad_component(j,q,comp_j)[comp_j] *
-                             fe_values.JxW(q)); 
-                   };
-      
-      
+        for (unsigned int comp_i=0; comp_i<fe.n_components(); ++comp_i)
+          if (fe.get_nonzero_components(i)[comp_i] == true)
+            for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
+              for (unsigned int comp_j=0; comp_j<fe.n_components(); ++comp_j)
+                if (fe.get_nonzero_components(j)[comp_j] == true)
+                  for (unsigned int q=0; q<n_q_points; ++q)
+                    {
+                      // velocity-velocity coupling?
+                      if ((comp_i<dim) && (comp_j<dim))
+                        if (comp_i == comp_j)
+                          local_matrix(i,j)
+                          += (nu *
+                              (fe_values.shape_grad_component(i,q,comp_i) *
+                               fe_values.shape_grad_component(j,q,comp_j)  ) *
+                              fe_values.JxW(q));
+
+                      // velocity-pressure coupling
+                      if ((comp_i<dim) && (comp_j==dim))
+                        local_matrix(i,j)
+                        += (-fe_values.shape_grad_component(i,q,comp_i)[comp_i] *
+                            fe_values.shape_value_component(j,q,comp_j)        *
+                            fe_values.JxW(q));
+
+                      // pressure-velocity coupling
+                      if ((comp_i==dim) && (comp_j<dim))
+                        local_matrix(i,j)
+                        += (fe_values.shape_value_component(i,q,comp_i) *
+                            fe_values.shape_grad_component(j,q,comp_j)[comp_j] *
+                            fe_values.JxW(q));
+                    };
+
+
       cell->get_dof_indices (local_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int j=0; j<dofs_per_cell; ++j)
-         A.add (local_dof_indices[i],
-                local_dof_indices[j],
-                local_matrix(i,j));
+        for (unsigned int j=0; j<dofs_per_cell; ++j)
+          A.add (local_dof_indices[i],
+                 local_dof_indices[j],
+                 local_matrix(i,j));
     };
 }
 
@@ -281,27 +281,27 @@ test ()
   triangulation.execute_coarsening_and_refinement();
 
   deallog << "dim=" << dim
-         << ", n_cells=" << triangulation.n_active_cells()
-         << std::endl;
-  
+          << ", n_cells=" << triangulation.n_active_cells()
+          << std::endl;
+
   FESystem<dim> fe (FE_Q<dim>(2), dim,
-                   FE_Q<dim>(1), 1);
+                    FE_Q<dim>(1), 1);
   DoFHandler<dim> dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
-  
+
   SparsityPattern sparsity(dof_handler.n_dofs(),
-                          dof_handler.n_dofs());
-  
-                                  // have a mask that indicates that
-                                  // for the stokes equation the
-                                  // pressure does not couple to
-                                  // itself
+                           dof_handler.n_dofs());
+
+  // have a mask that indicates that
+  // for the stokes equation the
+  // pressure does not couple to
+  // itself
   std::vector<std::vector<bool> > mask (dim+1, std::vector<bool> (dim+1, true));
   mask[dim][dim] = false;
-  
+
   DoFTools::make_sparsity_pattern (dof_handler, mask, sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> A1 (sparsity);
   SparseMatrix<double> A2 (sparsity);
   SparseMatrix<double> A3 (sparsity);
@@ -310,20 +310,20 @@ test ()
   create_stokes_matrix_2 (dof_handler, A2);
   create_stokes_matrix_3 (dof_handler, A3);
 
-                                  // write out the contents of the
-                                  // matrix and compare for equality
-                                  // with the other matrices. to
-                                  // reduce the amount of data
-                                  // written out a little bit, only
-                                  // write every so-many-th element
+  // write out the contents of the
+  // matrix and compare for equality
+  // with the other matrices. to
+  // reduce the amount of data
+  // written out a little bit, only
+  // write every so-many-th element
   for (unsigned int i=0; i<A1.n_nonzero_elements(); ++i)
     {
       if (i % (dim*dim*dim) == 0)
-       deallog << i << ' ' << A1.global_entry(i) << std::endl;
+        deallog << i << ' ' << A1.global_entry(i) << std::endl;
       Assert (A1.global_entry(i) == A2.global_entry(i),
-             ExcInternalError());
+              ExcInternalError());
       Assert (A1.global_entry(i) == A3.global_entry(i),
-             ExcInternalError());
+              ExcInternalError());
     };
 }
 
@@ -343,4 +343,4 @@ int main ()
 
 
 
-        
+
index 1eccdb719b4eece50140fc5d1bc519527b22aae5..25421270c415fc408da8ec450785b7e1860b8e11 100644 (file)
 // note: create_stokes_matrix_1 from non_primitive_1 does not work here,
 // since the elements in use are actually non-primitive
 
-                                // create the matrix in the simple
-                                // way that is necessary when you
-                                // want to use non-primitive shape
-                                // functions
+// create the matrix in the simple
+// way that is necessary when you
+// want to use non-primitive shape
+// functions
 template <int dim>
 void
 create_stokes_matrix_2 (const DoFHandler<dim> &dof_handler,
-                       SparseMatrix<double>  &A)
+                        SparseMatrix<double>  &A)
 {
   const FiniteElement<dim> &fe = dof_handler.get_fe();
   const unsigned int dofs_per_cell = fe.dofs_per_cell;
-  
+
   typename DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
-  
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
+
   std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
   FullMatrix<double> local_matrix (dofs_per_cell, dofs_per_cell);
 
   QGauss<dim> quadrature (3);
   const unsigned int n_q_points = quadrature.size();
-  
+
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   const double nu = 3.14159265358e-2;
-  
+
   for (; cell!=endc; ++cell)
     {
       local_matrix = 0;
       fe_values.reinit (cell);
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
-       for (unsigned int comp_i=0; comp_i<fe.n_components(); ++comp_i)
-         for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
-           for (unsigned int comp_j=0; comp_j<fe.n_components(); ++comp_j)
-             for (unsigned int q=0; q<n_q_points; ++q) 
-               {
-                                                  // velocity-velocity coupling?
-                 if ((comp_i<dim) && (comp_j<dim))
-                   if (comp_i == comp_j)
-                     local_matrix(i,j)
-                       += (nu *
-                           (fe_values.shape_grad_component(i,q,comp_i) * 
-                            fe_values.shape_grad_component(j,q,comp_j)  ) *
-                           fe_values.JxW(q)); 
-
-                                                  // velocity-pressure coupling
-                 if ((comp_i<dim) && (comp_j==dim))
-                   local_matrix(i,j)
-                     += (-fe_values.shape_grad_component(i,q,comp_i)[comp_i] * 
-                         fe_values.shape_value_component(j,q,comp_j)        *
-                         fe_values.JxW(q)); 
-
-                                                  // pressure-velocity coupling
-                 if ((comp_i==dim) && (comp_j<dim))
-                   local_matrix(i,j)
-                     += (fe_values.shape_value_component(i,q,comp_i) * 
-                         fe_values.shape_grad_component(j,q,comp_j)[comp_j] *
-                         fe_values.JxW(q)); 
-               };
-
-      
+        for (unsigned int comp_i=0; comp_i<fe.n_components(); ++comp_i)
+          for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
+            for (unsigned int comp_j=0; comp_j<fe.n_components(); ++comp_j)
+              for (unsigned int q=0; q<n_q_points; ++q)
+                {
+                  // velocity-velocity coupling?
+                  if ((comp_i<dim) && (comp_j<dim))
+                    if (comp_i == comp_j)
+                      local_matrix(i,j)
+                      += (nu *
+                          (fe_values.shape_grad_component(i,q,comp_i) *
+                           fe_values.shape_grad_component(j,q,comp_j)  ) *
+                          fe_values.JxW(q));
+
+                  // velocity-pressure coupling
+                  if ((comp_i<dim) && (comp_j==dim))
+                    local_matrix(i,j)
+                    += (-fe_values.shape_grad_component(i,q,comp_i)[comp_i] *
+                        fe_values.shape_value_component(j,q,comp_j)        *
+                        fe_values.JxW(q));
+
+                  // pressure-velocity coupling
+                  if ((comp_i==dim) && (comp_j<dim))
+                    local_matrix(i,j)
+                    += (fe_values.shape_value_component(i,q,comp_i) *
+                        fe_values.shape_grad_component(j,q,comp_j)[comp_j] *
+                        fe_values.JxW(q));
+                };
+
+
       cell->get_dof_indices (local_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int j=0; j<dofs_per_cell; ++j)
-         A.add (local_dof_indices[i],
-                local_dof_indices[j],
-                local_matrix(i,j));
+        for (unsigned int j=0; j<dofs_per_cell; ++j)
+          A.add (local_dof_indices[i],
+                 local_dof_indices[j],
+                 local_matrix(i,j));
     };
 }
 
 
 
-                                // create the matrix in a way that is
-                                // necessary when you want to use
-                                // non-primitive shape
-                                // functions. compared to the second
-                                // possibility used above, use some
-                                // optimizations
+// create the matrix in a way that is
+// necessary when you want to use
+// non-primitive shape
+// functions. compared to the second
+// possibility used above, use some
+// optimizations
 template <int dim>
 void
 create_stokes_matrix_3 (const DoFHandler<dim> &dof_handler,
-                       SparseMatrix<double>  &A)
+                        SparseMatrix<double>  &A)
 {
   const FiniteElement<dim> &fe = dof_handler.get_fe();
   const unsigned int dofs_per_cell = fe.dofs_per_cell;
-  
+
   typename DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
-  
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
+
   std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
   FullMatrix<double> local_matrix (dofs_per_cell, dofs_per_cell);
 
   QGauss<dim> quadrature (3);
   const unsigned int n_q_points = quadrature.size();
-  
+
   FEValues<dim> fe_values (fe, quadrature,
-                          update_values | update_gradients |
-                          update_JxW_values);
+                           update_values | update_gradients |
+                           update_JxW_values);
 
   const double nu = 3.14159265358e-2;
-  
+
   for (; cell!=endc; ++cell)
     {
       local_matrix = 0;
       fe_values.reinit (cell);
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
-       for (unsigned int comp_i=0; comp_i<fe.n_components(); ++comp_i)
-         if (fe.get_nonzero_components(i)[comp_i] == true)
-           for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
-             for (unsigned int comp_j=0; comp_j<fe.n_components(); ++comp_j)
-               if (fe.get_nonzero_components(j)[comp_j] == true)               
-                 for (unsigned int q=0; q<n_q_points; ++q) 
-                   {
-                                                      // velocity-velocity coupling?
-                     if ((comp_i<dim) && (comp_j<dim))
-                       if (comp_i == comp_j)
-                         local_matrix(i,j)
-                           += (nu *
-                               (fe_values.shape_grad_component(i,q,comp_i) * 
-                                fe_values.shape_grad_component(j,q,comp_j)  ) *
-                               fe_values.JxW(q)); 
-                     
-                                                      // velocity-pressure coupling
-                     if ((comp_i<dim) && (comp_j==dim))
-                       local_matrix(i,j)
-                         += (-fe_values.shape_grad_component(i,q,comp_i)[comp_i] * 
-                             fe_values.shape_value_component(j,q,comp_j)        *
-                             fe_values.JxW(q)); 
-                     
-                                                      // pressure-velocity coupling
-                     if ((comp_i==dim) && (comp_j<dim))
-                       local_matrix(i,j)
-                         += (fe_values.shape_value_component(i,q,comp_i) * 
-                             fe_values.shape_grad_component(j,q,comp_j)[comp_j] *
-                             fe_values.JxW(q)); 
-                   };
-      
-      
+        for (unsigned int comp_i=0; comp_i<fe.n_components(); ++comp_i)
+          if (fe.get_nonzero_components(i)[comp_i] == true)
+            for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
+              for (unsigned int comp_j=0; comp_j<fe.n_components(); ++comp_j)
+                if (fe.get_nonzero_components(j)[comp_j] == true)
+                  for (unsigned int q=0; q<n_q_points; ++q)
+                    {
+                      // velocity-velocity coupling?
+                      if ((comp_i<dim) && (comp_j<dim))
+                        if (comp_i == comp_j)
+                          local_matrix(i,j)
+                          += (nu *
+                              (fe_values.shape_grad_component(i,q,comp_i) *
+                               fe_values.shape_grad_component(j,q,comp_j)  ) *
+                              fe_values.JxW(q));
+
+                      // velocity-pressure coupling
+                      if ((comp_i<dim) && (comp_j==dim))
+                        local_matrix(i,j)
+                        += (-fe_values.shape_grad_component(i,q,comp_i)[comp_i] *
+                            fe_values.shape_value_component(j,q,comp_j)        *
+                            fe_values.JxW(q));
+
+                      // pressure-velocity coupling
+                      if ((comp_i==dim) && (comp_j<dim))
+                        local_matrix(i,j)
+                        += (fe_values.shape_value_component(i,q,comp_i) *
+                            fe_values.shape_grad_component(j,q,comp_j)[comp_j] *
+                            fe_values.JxW(q));
+                    };
+
+
       cell->get_dof_indices (local_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int j=0; j<dofs_per_cell; ++j)
-         A.add (local_dof_indices[i],
-                local_dof_indices[j],
-                local_matrix(i,j));
+        for (unsigned int j=0; j<dofs_per_cell; ++j)
+          A.add (local_dof_indices[i],
+                 local_dof_indices[j],
+                 local_matrix(i,j));
     };
 }
 
@@ -203,7 +203,7 @@ void
 test (const unsigned int p)
 {
   Triangulation<dim> triangulation;
-  
+
   GridGenerator::hyper_cube (triangulation);
 
   triangulation.refine_global (1);
@@ -211,45 +211,45 @@ test (const unsigned int p)
   triangulation.execute_coarsening_and_refinement();
 
   deallog << "dim=" << dim
-         << ", n_cells=" << triangulation.n_active_cells()
-         << std::endl;
-  
+          << ", n_cells=" << triangulation.n_active_cells()
+          << std::endl;
+
   FESystem<dim> fe (FE_Nedelec<dim>(p), 1,
-                   FE_Q<dim>(1), 1);
+                    FE_Q<dim>(1), 1);
   DoFHandler<dim> dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
-  
+
   SparsityPattern sparsity(dof_handler.n_dofs(),
-                          dof_handler.n_dofs());
-  
-                                  // have a mask that indicates that
-                                  // for the stokes equation the
-                                  // pressure does not couple to
-                                  // itself
+                           dof_handler.n_dofs());
+
+  // have a mask that indicates that
+  // for the stokes equation the
+  // pressure does not couple to
+  // itself
 //   std::vector<std::vector<bool> > mask (dim+1, std::vector<bool> (dim+1, true));
 //   mask[dim][dim] = false;
-  
+
   DoFTools::make_sparsity_pattern (dof_handler, /*mask,*/ sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> A2 (sparsity);
   SparseMatrix<double> A3 (sparsity);
 
   create_stokes_matrix_2 (dof_handler, A2);
   create_stokes_matrix_3 (dof_handler, A3);
 
-                                  // write out the contents of the
-                                  // matrix and compare for equality
-                                  // with the other matrices. to
-                                  // reduce the amount of data
-                                  // written out a little bit, only
-                                  // write every so-many-th element
+  // write out the contents of the
+  // matrix and compare for equality
+  // with the other matrices. to
+  // reduce the amount of data
+  // written out a little bit, only
+  // write every so-many-th element
   for (unsigned int i=0; i<A2.n_nonzero_elements(); ++i)
     {
       if (i % (dim*dim*dim) == 0)
-       deallog << i << ' ' << A2.global_entry(i) << std::endl;
+        deallog << i << ' ' << A2.global_entry(i) << std::endl;
       Assert (A3.global_entry(i) == A2.global_entry(i),
-             ExcInternalError());
+              ExcInternalError());
     };
 }
 
@@ -271,4 +271,4 @@ int main ()
 
 
 
-        
+
index eddfefa81a5d0127bb21b58a93459e2bd9743e07..41c9a0be4b54baf1126ef780bf15ad36c6d0648a 100644 (file)
@@ -30,203 +30,203 @@ template <int dim>
 void check (const FE_Q<dim> &fe)
 {
   Assert (fe.n_components() == 1, ExcInternalError());
-  
+
   std::vector<unsigned int> hierarchic_to_lexicographic_numbering (fe.dofs_per_cell);
 
   const unsigned int dofs_per_cell = fe.dofs_per_cell;
-                                  // polynomial degree
+  // polynomial degree
   const unsigned int degree = fe.dofs_per_line+1;
-                                  // number of grid points in each
-                                  // direction
+  // number of grid points in each
+  // direction
   const unsigned int n = degree+1;
 
-                                  // the following lines of code are
-                                  // somewhat odd, due to the way the
-                                  // hierarchic numbering is
-                                  // organized. if someone would
-                                  // really want to understand these
-                                  // lines, you better draw some
-                                  // pictures where you indicate the
-                                  // indices and orders of vertices,
-                                  // lines, etc, along with the
-                                  // numbers of the degrees of
-                                  // freedom in hierarchical and
-                                  // lexicographical order
+  // the following lines of code are
+  // somewhat odd, due to the way the
+  // hierarchic numbering is
+  // organized. if someone would
+  // really want to understand these
+  // lines, you better draw some
+  // pictures where you indicate the
+  // indices and orders of vertices,
+  // lines, etc, along with the
+  // numbers of the degrees of
+  // freedom in hierarchical and
+  // lexicographical order
   switch (dim)
     {
-      case 1:
-      {
-       hierarchic_to_lexicographic_numbering[0] = 0;
-       hierarchic_to_lexicographic_numbering[1] = dofs_per_cell-1;
-       for (unsigned int i=2; i<dofs_per_cell; ++i)
-         hierarchic_to_lexicographic_numbering[i] = i-1;
-
-       break;
-      }
-
-      case 2:
-      {
-       unsigned int next_index = 0;
-                                        // first the four vertices
-       hierarchic_to_lexicographic_numbering[next_index++] = 0;
-       hierarchic_to_lexicographic_numbering[next_index++] = n-1;
-       hierarchic_to_lexicographic_numbering[next_index++] = n*(n-1);
-       hierarchic_to_lexicographic_numbering[next_index++] = n*n-1;
-
-                                        // left   line
-       for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-         hierarchic_to_lexicographic_numbering[next_index++] = (1+i)*n;
-       
-                                        // right  line
-       for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-         hierarchic_to_lexicographic_numbering[next_index++] = (2+i)*n-1;
-
-                                        // bottom line
-       for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-         hierarchic_to_lexicographic_numbering[next_index++] = 1+i;    
-       
-                                        // top    line
-       for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-         hierarchic_to_lexicographic_numbering[next_index++] = n*(n-1)+i+1;
-
-                                        // inside quad
-       Assert (fe.dofs_per_quad == fe.dofs_per_line*fe.dofs_per_line,
-               ExcInternalError());
-       for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-         for (unsigned int j=0; j<fe.dofs_per_line; ++j)
-           hierarchic_to_lexicographic_numbering[next_index++] = n*(i+1)+j+1;
-
-       Assert (next_index == fe.dofs_per_cell, ExcInternalError());
-
-       break;
-      }
-
-      case 3:
-      {
-       unsigned int next_index = 0;
-                                        // first the eight vertices
-       hierarchic_to_lexicographic_numbering[next_index++] = 0;                 // 0
-       hierarchic_to_lexicographic_numbering[next_index++] = (      1)*degree;  // 1
-       hierarchic_to_lexicographic_numbering[next_index++] = (    n  )*degree;  // 2
-       hierarchic_to_lexicographic_numbering[next_index++] = (    n+1)*degree;  // 3
-       hierarchic_to_lexicographic_numbering[next_index++] = (n*n    )*degree;  // 4
-       hierarchic_to_lexicographic_numbering[next_index++] = (n*n  +1)*degree;  // 5
-       hierarchic_to_lexicographic_numbering[next_index++] = (n*n+n  )*degree;  // 6
-       hierarchic_to_lexicographic_numbering[next_index++] = (n*n+n+1)*degree;  // 7
-
-                                        // line 0
-       for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-         hierarchic_to_lexicographic_numbering[next_index++] = (i+1)*n;
-                                        // line 1
-       for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-         hierarchic_to_lexicographic_numbering[next_index++] = n-1+(i+1)*n;
-                                        // line 2
-       for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-         hierarchic_to_lexicographic_numbering[next_index++] = 1+i;
-                                        // line 3
-       for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-         hierarchic_to_lexicographic_numbering[next_index++] = 1+i+n*(n-1);
-
-                                        // line 4
-       for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-         hierarchic_to_lexicographic_numbering[next_index++] = (n-1)*n*n+(i+1)*n;
-                                        // line 5
-       for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-         hierarchic_to_lexicographic_numbering[next_index++] = (n-1)*(n*n+1)+(i+1)*n;
-                                        // line 6
-       for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-         hierarchic_to_lexicographic_numbering[next_index++] = n*n*(n-1)+i+1;
-                                        // line 7
-       for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-         hierarchic_to_lexicographic_numbering[next_index++] = n*n*(n-1)+i+1+n*(n-1);
-
-                                        // line 8
-       for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-         hierarchic_to_lexicographic_numbering[next_index++] = (i+1)*n*n;
-                                        // line 9
-       for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-         hierarchic_to_lexicographic_numbering[next_index++] = n-1+(i+1)*n*n;
-                                        // line 10
-       for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-         hierarchic_to_lexicographic_numbering[next_index++] = (i+1)*n*n+n*(n-1);
-                                        // line 11
-       for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-         hierarchic_to_lexicographic_numbering[next_index++] = n-1+(i+1)*n*n+n*(n-1);
-
-
-                                        // inside quads
-       Assert (fe.dofs_per_quad == fe.dofs_per_line*fe.dofs_per_line,
-               ExcInternalError());
-                                        // face 0
-       for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-         for (unsigned int j=0; j<fe.dofs_per_line; ++j)
-           hierarchic_to_lexicographic_numbering[next_index++] = (i+1)*n*n+n*(j+1);
-                                        // face 1
-       for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-         for (unsigned int j=0; j<fe.dofs_per_line; ++j)
-           hierarchic_to_lexicographic_numbering[next_index++] = (i+1)*n*n+n-1+n*(j+1);
-                                        // face 2, note the orientation!
-       for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-         for (unsigned int j=0; j<fe.dofs_per_line; ++j)
-           hierarchic_to_lexicographic_numbering[next_index++] = (j+1)*n*n+i+1;
-                                        // face 3, note the orientation!
-       for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-         for (unsigned int j=0; j<fe.dofs_per_line; ++j)
-           hierarchic_to_lexicographic_numbering[next_index++] = (j+1)*n*n+n*(n-1)+i+1;
-                                        // face 4
-       for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-         for (unsigned int j=0; j<fe.dofs_per_line; ++j)
-           hierarchic_to_lexicographic_numbering[next_index++] = n*(i+1)+j+1;
-                                        // face 5
-       for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-         for (unsigned int j=0; j<fe.dofs_per_line; ++j)
-           hierarchic_to_lexicographic_numbering[next_index++] = (n-1)*n*n+n*(i+1)+j+1;
-
-                                        // inside hex
-       Assert (fe.dofs_per_hex == fe.dofs_per_quad*fe.dofs_per_line,
-               ExcInternalError());
-       for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-         for (unsigned int j=0; j<fe.dofs_per_line; ++j)
-           for (unsigned int k=0; k<fe.dofs_per_line; ++k)
-             hierarchic_to_lexicographic_numbering[next_index++]       = n*n*(i+1)+n*(j+1)+k+1;
-
-       Assert (next_index == fe.dofs_per_cell, ExcInternalError());
-       
-       break;
-      }       
-
-      default:
-           Assert (false, ExcNotImplemented());
+    case 1:
+    {
+      hierarchic_to_lexicographic_numbering[0] = 0;
+      hierarchic_to_lexicographic_numbering[1] = dofs_per_cell-1;
+      for (unsigned int i=2; i<dofs_per_cell; ++i)
+        hierarchic_to_lexicographic_numbering[i] = i-1;
+
+      break;
+    }
+
+    case 2:
+    {
+      unsigned int next_index = 0;
+      // first the four vertices
+      hierarchic_to_lexicographic_numbering[next_index++] = 0;
+      hierarchic_to_lexicographic_numbering[next_index++] = n-1;
+      hierarchic_to_lexicographic_numbering[next_index++] = n*(n-1);
+      hierarchic_to_lexicographic_numbering[next_index++] = n*n-1;
+
+      // left   line
+      for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+        hierarchic_to_lexicographic_numbering[next_index++] = (1+i)*n;
+
+      // right  line
+      for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+        hierarchic_to_lexicographic_numbering[next_index++] = (2+i)*n-1;
+
+      // bottom line
+      for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+        hierarchic_to_lexicographic_numbering[next_index++] = 1+i;
+
+      // top    line
+      for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+        hierarchic_to_lexicographic_numbering[next_index++] = n*(n-1)+i+1;
+
+      // inside quad
+      Assert (fe.dofs_per_quad == fe.dofs_per_line*fe.dofs_per_line,
+              ExcInternalError());
+      for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+        for (unsigned int j=0; j<fe.dofs_per_line; ++j)
+          hierarchic_to_lexicographic_numbering[next_index++] = n*(i+1)+j+1;
+
+      Assert (next_index == fe.dofs_per_cell, ExcInternalError());
+
+      break;
     }
-  
-                                  // now check with data from the
-                                  // lib: there we have the mapping
-                                  // the other way round, and we
-                                  // check that the concatenation of
-                                  // the two mappings is the
-                                  // identity. output the two maps to
-                                  // generate some output for
-                                  // automatic comparison
+
+    case 3:
+    {
+      unsigned int next_index = 0;
+      // first the eight vertices
+      hierarchic_to_lexicographic_numbering[next_index++] = 0;                 // 0
+      hierarchic_to_lexicographic_numbering[next_index++] = (      1)*degree;  // 1
+      hierarchic_to_lexicographic_numbering[next_index++] = (    n  )*degree;  // 2
+      hierarchic_to_lexicographic_numbering[next_index++] = (    n+1)*degree;  // 3
+      hierarchic_to_lexicographic_numbering[next_index++] = (n*n    )*degree;  // 4
+      hierarchic_to_lexicographic_numbering[next_index++] = (n*n  +1)*degree;  // 5
+      hierarchic_to_lexicographic_numbering[next_index++] = (n*n+n  )*degree;  // 6
+      hierarchic_to_lexicographic_numbering[next_index++] = (n*n+n+1)*degree;  // 7
+
+      // line 0
+      for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+        hierarchic_to_lexicographic_numbering[next_index++] = (i+1)*n;
+      // line 1
+      for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+        hierarchic_to_lexicographic_numbering[next_index++] = n-1+(i+1)*n;
+      // line 2
+      for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+        hierarchic_to_lexicographic_numbering[next_index++] = 1+i;
+      // line 3
+      for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+        hierarchic_to_lexicographic_numbering[next_index++] = 1+i+n*(n-1);
+
+      // line 4
+      for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+        hierarchic_to_lexicographic_numbering[next_index++] = (n-1)*n*n+(i+1)*n;
+      // line 5
+      for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+        hierarchic_to_lexicographic_numbering[next_index++] = (n-1)*(n*n+1)+(i+1)*n;
+      // line 6
+      for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+        hierarchic_to_lexicographic_numbering[next_index++] = n*n*(n-1)+i+1;
+      // line 7
+      for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+        hierarchic_to_lexicographic_numbering[next_index++] = n*n*(n-1)+i+1+n*(n-1);
+
+      // line 8
+      for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+        hierarchic_to_lexicographic_numbering[next_index++] = (i+1)*n*n;
+      // line 9
+      for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+        hierarchic_to_lexicographic_numbering[next_index++] = n-1+(i+1)*n*n;
+      // line 10
+      for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+        hierarchic_to_lexicographic_numbering[next_index++] = (i+1)*n*n+n*(n-1);
+      // line 11
+      for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+        hierarchic_to_lexicographic_numbering[next_index++] = n-1+(i+1)*n*n+n*(n-1);
+
+
+      // inside quads
+      Assert (fe.dofs_per_quad == fe.dofs_per_line*fe.dofs_per_line,
+              ExcInternalError());
+      // face 0
+      for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+        for (unsigned int j=0; j<fe.dofs_per_line; ++j)
+          hierarchic_to_lexicographic_numbering[next_index++] = (i+1)*n*n+n*(j+1);
+      // face 1
+      for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+        for (unsigned int j=0; j<fe.dofs_per_line; ++j)
+          hierarchic_to_lexicographic_numbering[next_index++] = (i+1)*n*n+n-1+n*(j+1);
+      // face 2, note the orientation!
+      for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+        for (unsigned int j=0; j<fe.dofs_per_line; ++j)
+          hierarchic_to_lexicographic_numbering[next_index++] = (j+1)*n*n+i+1;
+      // face 3, note the orientation!
+      for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+        for (unsigned int j=0; j<fe.dofs_per_line; ++j)
+          hierarchic_to_lexicographic_numbering[next_index++] = (j+1)*n*n+n*(n-1)+i+1;
+      // face 4
+      for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+        for (unsigned int j=0; j<fe.dofs_per_line; ++j)
+          hierarchic_to_lexicographic_numbering[next_index++] = n*(i+1)+j+1;
+      // face 5
+      for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+        for (unsigned int j=0; j<fe.dofs_per_line; ++j)
+          hierarchic_to_lexicographic_numbering[next_index++] = (n-1)*n*n+n*(i+1)+j+1;
+
+      // inside hex
+      Assert (fe.dofs_per_hex == fe.dofs_per_quad*fe.dofs_per_line,
+              ExcInternalError());
+      for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+        for (unsigned int j=0; j<fe.dofs_per_line; ++j)
+          for (unsigned int k=0; k<fe.dofs_per_line; ++k)
+            hierarchic_to_lexicographic_numbering[next_index++] = n*n*(i+1)+n*(j+1)+k+1;
+
+      Assert (next_index == fe.dofs_per_cell, ExcInternalError());
+
+      break;
+    }
+
+    default:
+      Assert (false, ExcNotImplemented());
+    }
+
+  // now check with data from the
+  // lib: there we have the mapping
+  // the other way round, and we
+  // check that the concatenation of
+  // the two mappings is the
+  // identity. output the two maps to
+  // generate some output for
+  // automatic comparison
   std::vector<unsigned int> l2h (fe.dofs_per_cell);
   FETools::lexicographic_to_hierarchic_numbering (fe, l2h);
   for (unsigned int i=0; i<dofs_per_cell; ++i)
     {
       Assert (l2h[hierarchic_to_lexicographic_numbering[i]] == i,
-             ExcInternalError());
+              ExcInternalError());
       logfile << dim << "d, degree=" << degree << ": "
-             << l2h[i]
-             << ' '
-             << hierarchic_to_lexicographic_numbering[i]
-             << std::endl;
+              << l2h[i]
+              << ' '
+              << hierarchic_to_lexicographic_numbering[i]
+              << std::endl;
     };
 
-                                  // finally, we also have the
-                                  // forward map in the lib, so check
-                                  // for equality
+  // finally, we also have the
+  // forward map in the lib, so check
+  // for equality
   std::vector<unsigned int> h2l (fe.dofs_per_cell);
   FETools::hierarchic_to_lexicographic_numbering (fe, h2l);
   Assert (hierarchic_to_lexicographic_numbering == h2l,
-         ExcInternalError());
+          ExcInternalError());
 }
 
 
@@ -245,7 +245,7 @@ void check_dim ()
 int main ()
 {
   deallog << std::setprecision(2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 461f87d252dfa1548f28c45c46d49a4c6ec3995f..abd00ab3f3797c98811300d2beb82a15721c91c4 100644 (file)
@@ -38,14 +38,14 @@ void
 test(const FE_Q<dim> &fe_q)
 {
   deallog << fe_q.get_name()
-         << std::endl;
+          << std::endl;
 
-  const FullMatrix<double> & constraints = fe_q.constraints();
+  const FullMatrix<double> &constraints = fe_q.constraints();
 
   for (unsigned int i=0; i<constraints.m(); ++i)
     {
       for (unsigned int j=0; j<constraints.n(); ++j)
-       deallog << 100*constraints(i,j) << ' ';
+        deallog << 100*constraints(i,j) << ' ';
       deallog << std::endl;
     }
 
@@ -65,13 +65,13 @@ main()
   deallog.threshold_double(1.e-10);
 
 
-                               // Test the non-equidistant version as
-                               // well
+  // Test the non-equidistant version as
+  // well
   const QGaussLobatto<1> quad(5);
 
-                                   // no constraints in 1d, but we had
-                                   // the matrices precomputed up to
-                                   // Q4 for 2d and Q2 for 3d
+  // no constraints in 1d, but we had
+  // the matrices precomputed up to
+  // Q4 for 2d and Q2 for 3d
   for (unsigned int degree=1; degree<=4; ++degree)
     test<2>(FE_Q<2>(degree));
 
index 112295d3d0a94db2660b4ee1eae6867bd879489d..e6cb098fa6aa38f263ef31fa967b0ac0ad314245 100644 (file)
@@ -38,18 +38,18 @@ void
 test(const FE_Q<dim> &fe_q)
 {
   deallog << fe_q.get_name()
-         << std::endl;
+          << std::endl;
 
   for (unsigned int c=0; c<GeometryInfo<dim>::max_children_per_cell; ++c)
     {
-      const FullMatrix<double> & m = fe_q.get_prolongation_matrix(c);
+      const FullMatrix<double> &m = fe_q.get_prolongation_matrix(c);
 
       for (unsigned int i=0; i<m.m(); ++i)
-       {
-         for (unsigned int j=0; j<m.n(); ++j)
-           deallog << 100*m(i,j) << ' ';
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int j=0; j<m.n(); ++j)
+            deallog << 100*m(i,j) << ' ';
+          deallog << std::endl;
+        }
 
       deallog << std::endl;
     }
@@ -69,13 +69,13 @@ main()
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-                               // Test the non-equidistant version as
-                               // well
+  // Test the non-equidistant version as
+  // well
   const QGaussLobatto<1> quad(5);
 
-                                   // we had the matrices precomputed
-                                   // up to Q4 for 1d, Q3 for 2d and
-                                   // Q2 for 3d
+  // we had the matrices precomputed
+  // up to Q4 for 1d, Q3 for 2d and
+  // Q2 for 3d
   for (unsigned int degree=1; degree<=4; ++degree)
     test<1>(FE_Q<1>(degree));
 
index fa532cdae0ac8aa0950ed163f290f0915fed7c21..73a971ba986f47beb460e51ed05851c791153df2 100644 (file)
@@ -38,11 +38,11 @@ void
 test(const FE_Q<dim> &fe_q)
 {
   deallog << fe_q.get_name()
-         << std::endl;
+          << std::endl;
 
   for (unsigned int c=0; c<GeometryInfo<dim>::max_children_per_cell; ++c)
     {
-      const FullMatrix<double> & m = fe_q.get_restriction_matrix(c);
+      const FullMatrix<double> &m = fe_q.get_restriction_matrix(c);
 
       for (unsigned int i=0; i<m.m(); ++i)
         for (unsigned int j=0; j<m.n(); ++j)
@@ -66,12 +66,12 @@ main()
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-                               // Test the non-equidistant version as
-                               // well
+  // Test the non-equidistant version as
+  // well
   const QGaussLobatto<1> quad(5);
 
-                                   // we had the matrices precomputed
-                                   // up to Q4 for 1d, 2d and 3d
+  // we had the matrices precomputed
+  // up to Q4 for 1d, 2d and 3d
   for (unsigned int degree=1; degree<=4; ++degree)
     test<1>(FE_Q<1>(degree));
 
index d30d0f6634d3466e3190a16cbbeeb18b4d37c170..3ba36d3345530313771138f56bf93bccc8ef591c 100644 (file)
@@ -41,7 +41,7 @@ test(const FE_Q<dim> fe1,
 {
   deallog << fe1.get_name()
           << " to " << fe2.get_name()
-         << std::endl;
+          << std::endl;
 
   FullMatrix<float> m (fe2.dofs_per_cell,
                        fe1.dofs_per_cell);
@@ -75,7 +75,7 @@ main()
   for (unsigned int degree1=2; degree1<=5; ++degree1)
     for (unsigned int degree2=2; degree2<=5; ++degree2)
       test<1>(FE_Q<1>(QGaussLobatto<1>(degree1)),
-             FE_Q<1>(QGaussLobatto<1>(degree2)));
+              FE_Q<1>(QGaussLobatto<1>(degree2)));
 
   for (unsigned int degree1=1; degree1<=3; ++degree1)
     for (unsigned int degree2=1; degree2<=3; ++degree2)
@@ -83,7 +83,7 @@ main()
   for (unsigned int degree1=2; degree1<=4; ++degree1)
     for (unsigned int degree2=2; degree2<=4; ++degree2)
       test<2>(FE_Q<2>(QGaussLobatto<1>(degree1)),
-             FE_Q<2>(QGaussLobatto<1>(degree2)));
+              FE_Q<2>(QGaussLobatto<1>(degree2)));
 
   for (unsigned int degree1=1; degree1<=2; ++degree1)
     for (unsigned int degree2=1; degree2<=2; ++degree2)
@@ -91,7 +91,7 @@ main()
   for (unsigned int degree1=2; degree1<=4; ++degree1)
     for (unsigned int degree2=2; degree2<=4; ++degree2)
       test<3>(FE_Q<3>(QGaussLobatto<1>(degree1)),
-             FE_Q<3>(QGaussLobatto<1>(degree2)));
+              FE_Q<3>(QGaussLobatto<1>(degree2)));
 
 
   return 0;
index 81496250a12b0ad5d338a1e73708c3f4dea5fb78..10b0ef98542cc710e41f478cb2bce66343ab59cc 100644 (file)
@@ -38,49 +38,49 @@ plot_shape_functions(const unsigned int degree)
 {
   std::ostringstream prefix;
   prefix << "RT<" << dim << ">(" << degree << ')';
-  
+
   deallog.push(prefix.str());
   FE_RaviartThomas<dim> fe_rt(degree);
 
   const unsigned int div=2;
-  for (unsigned int mz=0;mz<=((dim>2) ? div : 0) ;++mz)
-    for (unsigned int my=0;my<=((dim>1) ? div : 0) ;++my)
+  for (unsigned int mz=0; mz<=((dim>2) ? div : 0) ; ++mz)
+    for (unsigned int my=0; my<=((dim>1) ? div : 0) ; ++my)
       {
-       for (unsigned int mx=0;mx<=div;++mx)
-         {
-           const Point<dim> p = (dim==2 ?
-                                 Point<dim>(1.*mx/div, 1.*my/div) :
-                                 Point<dim>(1.*mx/div, 1.*my/div, 1.*mz/div));
-           
-                                            // Lines with function
-                                            // values contain
-                                            // quadrature point and one
-                                            // vector of dim entries
-                                            // for each chape function
-           deallog << "value " << p;
-           for (unsigned int i=0;i<fe_rt.dofs_per_cell;++i)
-             {
-               for (unsigned int c=0; c<dim; ++c)
-                 deallog << " " << fe_rt.shape_value_component(i,p,c);
-               deallog << "  ";
-             }
-           deallog << std::endl << "grad "  << p;
-           for (unsigned int i=0;i<fe_rt.dofs_per_cell;++i)
-             {
-               for (unsigned int c=0; c<dim; ++c)
-                 {
-                   deallog << ' ';
-                   for (unsigned int d=0; d<dim; ++d)
-                     deallog << ' ' << fe_rt.shape_grad_component(i,p,c)[d];
-                 }
-             }
-           deallog << std::endl;
-         }
-      deallog << "value " << std::endl;
-      deallog << "grad " << std::endl;
-    }
-  
-  deallog.pop();  
+        for (unsigned int mx=0; mx<=div; ++mx)
+          {
+            const Point<dim> p = (dim==2 ?
+                                  Point<dim>(1.*mx/div, 1.*my/div) :
+                                  Point<dim>(1.*mx/div, 1.*my/div, 1.*mz/div));
+
+            // Lines with function
+            // values contain
+            // quadrature point and one
+            // vector of dim entries
+            // for each chape function
+            deallog << "value " << p;
+            for (unsigned int i=0; i<fe_rt.dofs_per_cell; ++i)
+              {
+                for (unsigned int c=0; c<dim; ++c)
+                  deallog << " " << fe_rt.shape_value_component(i,p,c);
+                deallog << "  ";
+              }
+            deallog << std::endl << "grad "  << p;
+            for (unsigned int i=0; i<fe_rt.dofs_per_cell; ++i)
+              {
+                for (unsigned int c=0; c<dim; ++c)
+                  {
+                    deallog << ' ';
+                    for (unsigned int d=0; d<dim; ++d)
+                      deallog << ' ' << fe_rt.shape_grad_component(i,p,c)[d];
+                  }
+              }
+            deallog << std::endl;
+          }
+        deallog << "value " << std::endl;
+        deallog << "grad " << std::endl;
+      }
+
+  deallog.pop();
 }
 
 
@@ -89,7 +89,7 @@ main()
 {
   std::ofstream logfile ("rt_1/output");
   deallog << std::setprecision(PRECISION);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
@@ -97,7 +97,7 @@ main()
   for (unsigned int degree=0; degree<4; ++degree)
     plot_shape_functions<2>(degree);
 //  plot_shape_functions<3>(degree);
-  
+
   return 0;
 }
 
index 89abe9b8be6007be7e1406abbca224906ac2ba8f..824fedded0fcae00c0c5f94d860dfc4d64d3aa46 100644 (file)
@@ -51,12 +51,12 @@ test (const unsigned int degree)
   FE_RaviartThomas<dim> fe_rt(degree);
 
   deallog << "Degree=" << degree
-         << std::endl;
-  
+          << std::endl;
+
   for (double h=1; h>1./128; h/=2)
-    {      
+    {
       deallog << "  h=" << h
-             << std::endl;
+              << std::endl;
 
       Triangulation<dim> tr;
       GridGenerator::hyper_cube(tr, 0., h);
@@ -69,17 +69,17 @@ test (const unsigned int degree)
       FEValues<dim> fe_values (fe_rt, quadrature, update_values);
       fe_values.reinit (dof.begin_active());
       for (unsigned int q=0; q<quadrature.size(); ++q)
-       {
-         deallog << "    Quadrature point " << q << ": ";
-         for (unsigned int i=0; i<fe_rt.dofs_per_cell; ++i)
-           {
-             deallog << '[';
-             for (unsigned int c=0; c<fe_rt.n_components(); ++c)
-               deallog << fe_values.shape_value_component(i,q,c) << ' ';
-             deallog << ']';
-           }
-         deallog << std::endl;
-       }
+        {
+          deallog << "    Quadrature point " << q << ": ";
+          for (unsigned int i=0; i<fe_rt.dofs_per_cell; ++i)
+            {
+              deallog << '[';
+              for (unsigned int c=0; c<fe_rt.n_components(); ++c)
+                deallog << fe_values.shape_value_component(i,q,c) << ' ';
+              deallog << ']';
+            }
+          deallog << std::endl;
+        }
     }
 }
 
@@ -88,14 +88,14 @@ int
 main()
 {
   deallog << std::setprecision(PRECISION);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
   for (unsigned int i=0; i<4; ++i)
     test<2>(i);
-  
+
   return 0;
 }
 
index 5d7d6f44a73653b5251d070dca380b54d9d21011..c18447fae74f44a451934bbf54332024f805121c 100644 (file)
@@ -57,12 +57,12 @@ test (const unsigned int degree)
   FE_RaviartThomas<dim> fe_rt(degree);
 
   deallog << "Degree=" << degree
-         << std::endl;
-  
+          << std::endl;
+
   for (double h=1; h>1./128; h/=2)
-    {      
+    {
       deallog << "  h=" << h
-             << std::endl;
+              << std::endl;
 
       Triangulation<dim> tr;
       GridGenerator::hyper_cube(tr, 0., h);
@@ -75,17 +75,17 @@ test (const unsigned int degree)
       FEFaceValues<dim> fe_values (fe_rt, quadrature, update_values);
       fe_values.reinit (dof.begin_active(), 0);
       for (unsigned int q=0; q<quadrature.size(); ++q)
-       {
-         deallog << "    Quadrature point " << q << ": ";
-         for (unsigned int i=0; i<fe_rt.dofs_per_cell; ++i)
-           {
-             deallog << '[';
-             for (unsigned int c=0; c<fe_rt.n_components(); ++c)
-               deallog << fe_values.shape_value_component(i,q,c) << ' ';
-             deallog << ']';
-           }
-         deallog << std::endl;
-       }
+        {
+          deallog << "    Quadrature point " << q << ": ";
+          for (unsigned int i=0; i<fe_rt.dofs_per_cell; ++i)
+            {
+              deallog << '[';
+              for (unsigned int c=0; c<fe_rt.n_components(); ++c)
+                deallog << fe_values.shape_value_component(i,q,c) << ' ';
+              deallog << ']';
+            }
+          deallog << std::endl;
+        }
     }
 }
 
@@ -94,14 +94,14 @@ int
 main()
 {
   deallog << std::setprecision(PRECISION);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
   for (unsigned int i=0; i<4; ++i)
     test<2>(i);
-  
+
   return 0;
 }
 
index fcc3e4e96d62bc373b60a1c63b14ab7b8abb9f7b..37ab404b85d94e1e02725d27335b0ad9a8dc8707 100644 (file)
@@ -50,12 +50,12 @@ test (const unsigned int degree)
   FE_RaviartThomas<dim> fe_rt(degree);
 
   deallog << "Degree=" << degree
-         << std::endl;
-  
+          << std::endl;
+
   for (double h=1; h>1./128; h/=2)
-    {      
+    {
       deallog << "  h=" << h
-             << std::endl;
+              << std::endl;
 
       Triangulation<dim> tr;
       GridGenerator::hyper_cube(tr, 0., h);
@@ -68,17 +68,17 @@ test (const unsigned int degree)
       FEValues<dim> fe_values (fe_rt, quadrature, update_gradients);
       fe_values.reinit (dof.begin_active());
       for (unsigned int q=0; q<quadrature.size(); ++q)
-       {
-         deallog << "    Quadrature point " << q << ": ";
-         for (unsigned int i=0; i<fe_rt.dofs_per_cell; ++i)
-           {
-             deallog << '[';
-             for (unsigned int c=0; c<fe_rt.n_components(); ++c)
-               deallog << fe_values.shape_grad_component(i,q,c) << ' ';
-             deallog << ']';
-           }
-         deallog << std::endl;
-       }
+        {
+          deallog << "    Quadrature point " << q << ": ";
+          for (unsigned int i=0; i<fe_rt.dofs_per_cell; ++i)
+            {
+              deallog << '[';
+              for (unsigned int c=0; c<fe_rt.n_components(); ++c)
+                deallog << fe_values.shape_grad_component(i,q,c) << ' ';
+              deallog << ']';
+            }
+          deallog << std::endl;
+        }
     }
 }
 
@@ -87,14 +87,14 @@ int
 main()
 {
   deallog << std::setprecision(PRECISION);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
   for (unsigned int i=0; i<4; ++i)
     test<2>(i);
-  
+
   return 0;
 }
 
index d26ef12d6634107ce25fa37f848abc106ebedf1e..270b8c01605db0d3a6fc26e5022a4c693ca795fc 100644 (file)
@@ -55,12 +55,12 @@ test (const unsigned int degree)
   FE_RaviartThomas<dim> fe_rt(degree);
 
   deallog << "Degree=" << degree
-         << std::endl;
-  
+          << std::endl;
+
   for (double h=1; h>1./128; h/=2)
-    {      
+    {
       deallog << "  h=" << h
-             << std::endl;
+              << std::endl;
 
       Triangulation<dim> tr;
       GridGenerator::hyper_cube(tr, 0., h);
@@ -73,17 +73,17 @@ test (const unsigned int degree)
       FEFaceValues<dim> fe_values (fe_rt, quadrature, update_gradients);
       fe_values.reinit (dof.begin_active(), 0);
       for (unsigned int q=0; q<quadrature.size(); ++q)
-       {
-         deallog << "    Quadrature point " << q << ": ";
-         for (unsigned int i=0; i<fe_rt.dofs_per_cell; ++i)
-           {
-             deallog << '[';
-             for (unsigned int c=0; c<fe_rt.n_components(); ++c)
-               deallog << fe_values.shape_grad_component(i,q,c) << ' ';
-             deallog << ']';
-           }
-         deallog << std::endl;
-       }
+        {
+          deallog << "    Quadrature point " << q << ": ";
+          for (unsigned int i=0; i<fe_rt.dofs_per_cell; ++i)
+            {
+              deallog << '[';
+              for (unsigned int c=0; c<fe_rt.n_components(); ++c)
+                deallog << fe_values.shape_grad_component(i,q,c) << ' ';
+              deallog << ']';
+            }
+          deallog << std::endl;
+        }
     }
 }
 
@@ -92,14 +92,14 @@ int
 main()
 {
   deallog << std::setprecision(PRECISION);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
   for (unsigned int i=0; i<4; ++i)
     test<2>(i);
-  
+
   return 0;
 }
 
index 3ca693bf08fb1d0fb81ac03ef17db76f898366e9..8ce23c551e104d3c9dd2bd45336902921b41007b 100644 (file)
@@ -55,12 +55,12 @@ test (const unsigned int degree)
   FE_RaviartThomas<dim> fe_rt(degree);
 
   deallog << "Degree=" << degree
-         << std::endl;
-  
+          << std::endl;
+
   for (double h=1; h>1./128; h/=2)
-    {      
+    {
       deallog << "  h=" << h
-             << std::endl;
+              << std::endl;
 
       Triangulation<dim> tr;
       GridGenerator::hyper_cube(tr, 0., h);
@@ -73,17 +73,17 @@ test (const unsigned int degree)
       FESubfaceValues<dim> fe_values (fe_rt, quadrature, update_values);
       fe_values.reinit (dof.begin_active(), 0, 0);
       for (unsigned int q=0; q<quadrature.size(); ++q)
-       {
-         deallog << "    Quadrature point " << q << ": ";
-         for (unsigned int i=0; i<fe_rt.dofs_per_cell; ++i)
-           {
-             deallog << '[';
-             for (unsigned int c=0; c<fe_rt.n_components(); ++c)
-               deallog << fe_values.shape_value_component(i,q,c) << ' ';
-             deallog << ']';
-           }
-         deallog << std::endl;
-       }
+        {
+          deallog << "    Quadrature point " << q << ": ";
+          for (unsigned int i=0; i<fe_rt.dofs_per_cell; ++i)
+            {
+              deallog << '[';
+              for (unsigned int c=0; c<fe_rt.n_components(); ++c)
+                deallog << fe_values.shape_value_component(i,q,c) << ' ';
+              deallog << ']';
+            }
+          deallog << std::endl;
+        }
     }
 }
 
@@ -92,14 +92,14 @@ int
 main()
 {
   deallog << std::setprecision(PRECISION);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
   for (unsigned int i=0; i<4; ++i)
     test<2>(i);
-  
+
   return 0;
 }
 
index 4fa61c7c49fce87ee768683dde09802de5bdb4ea..7449608c436513cdcb4e386be3643d358aafa56a 100644 (file)
@@ -55,12 +55,12 @@ test (const unsigned int degree)
   FE_RaviartThomas<dim> fe_rt(degree);
 
   deallog << "Degree=" << degree
-         << std::endl;
-  
+          << std::endl;
+
   for (double h=1; h>1./128; h/=2)
-    {      
+    {
       deallog << "  h=" << h
-             << std::endl;
+              << std::endl;
 
       Triangulation<dim> tr;
       GridGenerator::hyper_cube(tr, 0., h);
@@ -73,17 +73,17 @@ test (const unsigned int degree)
       FESubfaceValues<dim> fe_values (fe_rt, quadrature, update_gradients);
       fe_values.reinit (dof.begin_active(), 0, 0);
       for (unsigned int q=0; q<quadrature.size(); ++q)
-       {
-         deallog << "    Quadrature point " << q << ": ";
-         for (unsigned int i=0; i<fe_rt.dofs_per_cell; ++i)
-           {
-             deallog << '[';
-             for (unsigned int c=0; c<fe_rt.n_components(); ++c)
-               deallog << fe_values.shape_grad_component(i,q,c) << ' ';
-             deallog << ']';
-           }
-         deallog << std::endl;
-       }
+        {
+          deallog << "    Quadrature point " << q << ": ";
+          for (unsigned int i=0; i<fe_rt.dofs_per_cell; ++i)
+            {
+              deallog << '[';
+              for (unsigned int c=0; c<fe_rt.n_components(); ++c)
+                deallog << fe_values.shape_grad_component(i,q,c) << ' ';
+              deallog << ']';
+            }
+          deallog << std::endl;
+        }
     }
 }
 
@@ -92,14 +92,14 @@ int
 main()
 {
   deallog << std::setprecision(PRECISION);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
   for (unsigned int i=0; i<4; ++i)
     test<2>(i);
-  
+
   return 0;
 }
 
index 0acfa61097a472657fd3c259e6f0a0a824c40651..77291a03bccd9427341b91c886c23588776b94fd 100644 (file)
@@ -54,43 +54,43 @@ Point<2> tilt_coordinates (const Point<2> p)
 
 void
 transform_grid (Triangulation<2> &tria,
-               const unsigned int  transform)
+                const unsigned int  transform)
 {
   switch (transform)
     {
-                                       // first round: take
-                                       // original grid
-      case 0:
-           break;
-            
-                                            // second round: rotate
-                                            // triangulation
-      case 1:
-           GridTools::rotate (3.14159265358/2, tria);
-           break;
-
-                                            // third round: inflate
-                                            // by a factor of 2
-      case 2:
-           GridTools::scale (2, tria);
-           break;
-
-                                             // third round: scale
-                                             // back, rotate back,
-                                             // stretch
-      case 3:
-            GridTools::scale (.5, tria);
-           GridTools::rotate (-3.14159265358/2, tria);
-            GridTools::transform (&stretch_coordinates, tria);
-            
-           break;
-            
-      default:
-           Assert (false, ExcNotImplemented());
+      // first round: take
+      // original grid
+    case 0:
+      break;
+
+      // second round: rotate
+      // triangulation
+    case 1:
+      GridTools::rotate (3.14159265358/2, tria);
+      break;
+
+      // third round: inflate
+      // by a factor of 2
+    case 2:
+      GridTools::scale (2, tria);
+      break;
+
+      // third round: scale
+      // back, rotate back,
+      // stretch
+    case 3:
+      GridTools::scale (.5, tria);
+      GridTools::rotate (-3.14159265358/2, tria);
+      GridTools::transform (&stretch_coordinates, tria);
+
+      break;
+
+    default:
+      Assert (false, ExcNotImplemented());
     };
 }
 
-           
+
 
 
 template<int dim>
@@ -101,61 +101,61 @@ plot_shape_functions(const unsigned int degree)
   Triangulation<dim> tr;
   GridGenerator::hyper_cube(tr, 0., 1.);
 
-                                  // check the following with a
-                                  // number of transformed
-                                  // triangulations
+  // check the following with a
+  // number of transformed
+  // triangulations
   for (unsigned int transform=0; transform<4; ++transform)
     {
       std::ostringstream ost;
       ost << "RT" << degree << "-Transform" << transform;
       deallog.push(ost.str());
-      
+
       transform_grid (tr, transform);
 
       DoFHandler<dim> dof(tr);
       typename DoFHandler<dim>::cell_iterator c = dof.begin();
       dof.distribute_dofs(element);
-      
+
       QTrapez<1> q_trapez;
       const unsigned int div=2;
       QIterated<dim> q(q_trapez, div);
       FEValues<dim> fe(element, q, update_values|update_gradients|update_q_points);
       fe.reinit(c);
-      
-      for (unsigned int q_point=0;q_point< q.size();++q_point)
-       {
-                                          // Output function in
-                                          // gnuplot readable format,
-                                          // namely x y z u0x u0y u0z u1x...
-         deallog << "value    " << q_point << '\t' << fe.quadrature_point(q_point);
-         
-         for (unsigned int i=0;i<element.dofs_per_cell;++i)
-           {
-             for (unsigned int c=0; c<dim; ++c)
-               deallog << '\t' << fe.shape_value_component(i,q_point,c);
-           }
-
-                                          // Output the gradients in
-                                          // similar fashion
-         deallog << std::endl << "gradient " << q_point << '\t' << fe.quadrature_point(q_point);
-         
-         for (unsigned int i=0;i<element.dofs_per_cell;++i)
-           {
-             for (unsigned int c=0; c<dim; ++c)
-               {
-                 for (unsigned int d=0; d<dim; ++d)
-                   deallog << '\t' << fe.shape_grad_component(i,q_point,c)[d];
-               }
-           }
-         deallog << std::endl;
-         
-         if ((q_point+1) % (2*div-1) == 0)
-           {
-             deallog << "value    " << std::endl;
-             deallog << "gradient " << std::endl;
-           }
-       }
-      
+
+      for (unsigned int q_point=0; q_point< q.size(); ++q_point)
+        {
+          // Output function in
+          // gnuplot readable format,
+          // namely x y z u0x u0y u0z u1x...
+          deallog << "value    " << q_point << '\t' << fe.quadrature_point(q_point);
+
+          for (unsigned int i=0; i<element.dofs_per_cell; ++i)
+            {
+              for (unsigned int c=0; c<dim; ++c)
+                deallog << '\t' << fe.shape_value_component(i,q_point,c);
+            }
+
+          // Output the gradients in
+          // similar fashion
+          deallog << std::endl << "gradient " << q_point << '\t' << fe.quadrature_point(q_point);
+
+          for (unsigned int i=0; i<element.dofs_per_cell; ++i)
+            {
+              for (unsigned int c=0; c<dim; ++c)
+                {
+                  for (unsigned int d=0; d<dim; ++d)
+                    deallog << '\t' << fe.shape_grad_component(i,q_point,c)[d];
+                }
+            }
+          deallog << std::endl;
+
+          if ((q_point+1) % (2*div-1) == 0)
+            {
+              deallog << "value    " << std::endl;
+              deallog << "gradient " << std::endl;
+            }
+        }
+
       deallog << std::endl;
       deallog.pop();
     }
@@ -167,13 +167,13 @@ main()
 {
   std::ofstream logfile ("rt_2/output");
   deallog << std::setprecision(PRECISION);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
   for (unsigned int degree=0; degree<4; ++degree)
     plot_shape_functions<2>(degree);
-  
+
   return 0;
 }
index 5da758ff4eaba4ede2bd3f8c45b84fe922e4a555..7cb73e914e760d0bea9424b717fad850c075b284 100644 (file)
@@ -34,18 +34,18 @@ void
 test(const unsigned int degree)
 {
   deallog << "FE_RaviartThomas<" << dim << "> (" << degree << ")"
-         << std::endl;
-  
+          << std::endl;
+
   FE_RaviartThomas<dim> fe_rt(degree);
-  const FullMatrix<double> & constraints = fe_rt.constraints();
+  const FullMatrix<double> &constraints = fe_rt.constraints();
 
   for (unsigned int i=0; i<constraints.m(); ++i)
     {
       for (unsigned int j=0; j<constraints.n(); ++j)
-       deallog << constraints(i,j) << ' ';
+        deallog << constraints(i,j) << ' ';
       deallog << std::endl;
     }
-  
+
   deallog << std::endl;
 }
 
@@ -55,14 +55,14 @@ main()
 {
   std::ofstream logfile ("rt_3/output");
   deallog << std::setprecision(PRECISION);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
   for (unsigned int degree=0; degree<4; ++degree)
     test<2>(degree);
-  
+
   return 0;
 }
 
index 66cccb9ad3fe105b7d7b08f4d1e11b863e21dd3b..68fcd8d6bc78fde44e0e12d6d106e0addb5bd103 100644 (file)
@@ -34,21 +34,21 @@ void
 test(const unsigned int degree)
 {
   deallog << "FE_RaviartThomas<" << dim << "> (" << degree << ")"
-         << std::endl;
-  
+          << std::endl;
+
   FE_RaviartThomas<dim> fe_rt(degree);
 
   for (unsigned int c=0; c<GeometryInfo<dim>::max_children_per_cell; ++c)
     {
-      const FullMatrix<double> & m = fe_rt.get_restriction_matrix(c);
+      const FullMatrix<double> &m = fe_rt.get_restriction_matrix(c);
 
       for (unsigned int i=0; i<m.m(); ++i)
-       {
-         for (unsigned int j=0; j<m.n(); ++j)
-           deallog << m(i,j) << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          for (unsigned int j=0; j<m.n(); ++j)
+            deallog << m(i,j) << ' ';
+          deallog << std::endl;
+        }
+
       deallog << std::endl;
     }
 }
@@ -59,7 +59,7 @@ main()
 {
   std::ofstream logfile ("rt_5/output");
   deallog << std::setprecision(PRECISION);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
@@ -69,6 +69,6 @@ main()
       test<2>(degree);
       test<3>(degree);
     }
-  
+
   return 0;
 }
index a07731721dbba72c02daa8b2ae9a4dbe3d435088..b54162b3dbbf8de1ece8e10708b75ae75ab11de9 100644 (file)
@@ -48,7 +48,7 @@ plot_shape_functions(const unsigned int degree)
   DoFHandler<dim> dof(tr);
   typename DoFHandler<dim>::cell_iterator c = dof.begin();
   dof.distribute_dofs(fe_rt);
-      
+
   QTrapez<1> q_trapez;
   const unsigned int div=10;
   QIterated<dim> q(q_trapez, div);
@@ -56,15 +56,15 @@ plot_shape_functions(const unsigned int degree)
   fe.reinit(c);
 
   Assert (fe.get_fe().n_components() == dim, ExcInternalError());
-  
+
   for (unsigned int q_point=0; q_point<q.size(); ++q_point)
     {
       if (q_point % QIterated<1>(q_trapez,div).size() == 0)
         deallog << std::endl;
-      
+
       deallog << fe.quadrature_point(q_point) << " ";
-             
-      for (unsigned int i=0;i<fe_rt.dofs_per_cell;++i)
+
+      for (unsigned int i=0; i<fe_rt.dofs_per_cell; ++i)
         for (unsigned int c=0; c<fe.get_fe().n_components(); ++c)
           deallog << " " << fe.shape_value_component(i,q_point,c);
 
@@ -78,13 +78,13 @@ main()
 {
   std::ofstream logfile ("rt_7/output");
   deallog << std::setprecision(PRECISION);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
   plot_shape_functions<2>(2);
-  
+
   return 0;
 }
 
index c11384a64fa53582686e96e3069e8b1be4268dd4..d4564a85496f04023a67ae620b7889f038865eba 100644 (file)
@@ -62,7 +62,7 @@ test (const unsigned int degree)
 
   const unsigned int dofs_per_cell = fe_rt.dofs_per_cell;
   FullMatrix<double> mass_matrix (dofs_per_cell, dofs_per_cell);
-  
+
   Assert (fe.get_fe().n_components() == dim, ExcInternalError());
 
 
@@ -71,13 +71,13 @@ test (const unsigned int degree)
       for (unsigned int j=0; j<dofs_per_cell; ++j)
         for (unsigned int d=0; d<dim; ++d)
           mass_matrix(i,j)
-            += (fe.shape_value_component(i,q_point,d) *
-                fe.shape_value_component(j,q_point,d) *
-                fe.JxW(q_point));
+          += (fe.shape_value_component(i,q_point,d) *
+              fe.shape_value_component(j,q_point,d) *
+              fe.JxW(q_point));
   for (unsigned int i=0; i<dofs_per_cell; ++i)
     for (unsigned int j=0; j<dofs_per_cell; ++j)
       if (std::fabs(mass_matrix(i,j)) < 1e-14)
-       mass_matrix(i,j) = 0;
+        mass_matrix(i,j) = 0;
   mass_matrix.print_formatted (logfile, 3, false, 0, " ", 1);
 
   SolverControl           solver_control (dofs_per_cell,
@@ -101,14 +101,14 @@ int
 main()
 {
   deallog << std::setprecision(PRECISION);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
   for (unsigned int i=0; i<4; ++i)
     test<2>(i);
-  
+
   return 0;
 }
 
index 024f85b32daefef24677950e89e8d5ee4606b45f..669ea69ffc5b0110ce7606d05f0db325030ce129 100644 (file)
@@ -66,7 +66,7 @@ test (const unsigned int degree)
       sp.add(i,j);
   sp.compress ();
   SparseMatrix<double> mass_matrix (sp);
-  
+
   MatrixTools::create_mass_matrix (dof, q, mass_matrix);
 
   mass_matrix.print_formatted (logfile, 3, false, 0, " ", 1);
@@ -92,14 +92,14 @@ int
 main()
 {
   deallog << std::setprecision(PRECISION);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
   for (unsigned int i=0; i<4; ++i)
     test<2>(i);
-  
+
   return 0;
 }
 
index 2ccc2a7f9b6e0da07261e65412be49fc4950ef2f..0300b08797c94ca41a9ba3c8c561d214c75a1208 100644 (file)
@@ -74,18 +74,18 @@ char buf[1000];
 template <int dim>
 class TestMap1 : public Function<dim>
 {
-  public:
-    TestMap1 (const unsigned int n_components) :
-                   Function<dim> (n_components)
-      {}
-  
-    virtual ~TestMap1 () {}
-  
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
-  
-    void vector_value (const Point<dim> &p,
-                      Vector<double>   &return_value) const;
+public:
+  TestMap1 (const unsigned int n_components) :
+    Function<dim> (n_components)
+  {}
+
+  virtual ~TestMap1 () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
+
+  void vector_value (const Point<dim> &p,
+                     Vector<double>   &return_value) const;
 };
 
 
@@ -93,10 +93,10 @@ class TestMap1 : public Function<dim>
 template <int dim>
 double
 TestMap1<dim>::value (const Point<dim>   &p,
-                     const unsigned int  component) const 
+                      const unsigned int  component) const
 {
-                                  // u = x^2, v = y^2, dudx = 2 x, dvdy = 2 y, div u = 2x + 2y
-                                  // I.e. \int div u = 2 (for unit square)
+  // u = x^2, v = y^2, dudx = 2 x, dvdy = 2 y, div u = 2x + 2y
+  // I.e. \int div u = 2 (for unit square)
 
   if (component == 0)
     return (p(0) * p(0));
@@ -109,12 +109,12 @@ TestMap1<dim>::value (const Point<dim>   &p,
 
 template <int dim>
 void TestMap1<dim>::vector_value (const Point<dim> &p,
-                                 Vector<double>   &return_value) const
+                                  Vector<double>   &return_value) const
 {
   Assert (return_value.size() == this->n_components,
-         ExcDimensionMismatch (return_value.size(), this->n_components));
-  
-                                  // Just fill the vector with the appropriate components
+          ExcDimensionMismatch (return_value.size(), this->n_components));
+
+  // Just fill the vector with the appropriate components
   for (unsigned int iCount = 0; iCount < this->n_components; iCount++)
     return_value (iCount) = value (p, iCount);
 }
@@ -126,22 +126,22 @@ void TestMap1<dim>::vector_value (const Point<dim> &p,
 template <int dim>
 class TestDef1 : public Function<dim>
 {
-  private:
-    const double phi;
-
-  public:
-    TestDef1 (const unsigned int n_components, const double ph) :
-                   Function<dim> (n_components),
-                   phi (ph)
-      {}
-    
-    virtual ~TestDef1 () {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
-    
-    void vector_value (const Point<dim> &p,
-                      Vector<double>   &return_value) const;
+private:
+  const double phi;
+
+public:
+  TestDef1 (const unsigned int n_components, const double ph) :
+    Function<dim> (n_components),
+    phi (ph)
+  {}
+
+  virtual ~TestDef1 () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
+
+  void vector_value (const Point<dim> &p,
+                     Vector<double>   &return_value) const;
 };
 
 
@@ -149,13 +149,13 @@ class TestDef1 : public Function<dim>
 template <int dim>
 double
 TestDef1<dim>::value (const Point<dim>   &p,
-                     const unsigned int  component) const 
+                      const unsigned int  component) const
 {
   Point<2> center;
   center(0) = 0.5;
   center(1) = 0.5;
   double rad = p.distance (center),
-       phi_p = atan2 (p(0) - center(0), p(1) - center(1));
+         phi_p = atan2 (p(0) - center(0), p(1) - center(1));
 
   if (component == 0)
     return rad * (sin (phi + phi_p) - sin (phi_p));
@@ -166,10 +166,10 @@ TestDef1<dim>::value (const Point<dim>   &p,
 
 template <int dim>
 void TestDef1<dim>::vector_value (const Point<dim> &p,
-                                 Vector<double>   &return_value) const
+                                  Vector<double>   &return_value) const
 {
   Assert (return_value.size() == this->n_components,
-         ExcDimensionMismatch (return_value.size(), this->n_components));
+          ExcDimensionMismatch (return_value.size(), this->n_components));
   for (unsigned int iCount = 0; iCount < this->n_components; iCount++)
     return_value (iCount) = value (p, iCount);
 }
@@ -181,32 +181,32 @@ void TestDef1<dim>::vector_value (const Point<dim> &p,
 template <int dim>
 class TestDef2 : public Function<dim>
 {
-  private:
-    const double scale;
-
-  public:
-    TestDef2 (const unsigned int n_components, const double sc) :
-                   Function<dim> (n_components),
-                   scale (sc)
-      {}
-    
-    virtual ~TestDef2 () {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
-    
-    void vector_value (const Point<dim> &p,
-                      Vector<double>   &return_value) const;
+private:
+  const double scale;
+
+public:
+  TestDef2 (const unsigned int n_components, const double sc) :
+    Function<dim> (n_components),
+    scale (sc)
+  {}
+
+  virtual ~TestDef2 () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
+
+  void vector_value (const Point<dim> &p,
+                     Vector<double>   &return_value) const;
 };
 
 
 template <int dim>
 double
 TestDef2<dim>::value (const Point<dim>   &p,
-                     const unsigned int  component) const 
+                      const unsigned int  component) const
 {
   double x = p(0),
-        y = p(1);
+         y = p(1);
 
   if (component == 0)
     return scale * x;
@@ -217,10 +217,10 @@ TestDef2<dim>::value (const Point<dim>   &p,
 
 template <int dim>
 void TestDef2<dim>::vector_value (const Point<dim> &p,
-                                 Vector<double>   &return_value) const
+                                  Vector<double>   &return_value) const
 {
   Assert (return_value.size() == this->n_components,
-         ExcDimensionMismatch (return_value.size(), this->n_components));
+          ExcDimensionMismatch (return_value.size(), this->n_components));
   for (unsigned int iCount = 0; iCount < this->n_components; iCount++)
     return_value (iCount) = value (p, iCount);
 }
@@ -233,29 +233,29 @@ void TestDef2<dim>::vector_value (const Point<dim> &p,
 template <int dim>
 class TestDef3 : public Function<dim>
 {
-  private:
-    const double scale;
-
-  public:
-    TestDef3 (const unsigned int n_components, const double sc) :
-                   Function<dim> (n_components),
-                   scale (sc)
-      {}
-    
-    virtual ~TestDef3 () {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
-    
-    void vector_value (const Point<dim> &p,
-                      Vector<double>   &return_value) const;
+private:
+  const double scale;
+
+public:
+  TestDef3 (const unsigned int n_components, const double sc) :
+    Function<dim> (n_components),
+    scale (sc)
+  {}
+
+  virtual ~TestDef3 () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
+
+  void vector_value (const Point<dim> &p,
+                     Vector<double>   &return_value) const;
 };
 
 
 template <int dim>
 double
 TestDef3<dim>::value (const Point<dim>   &p,
-                     const unsigned int  component) const 
+                      const unsigned int  component) const
 {
   double y = p(1);
 
@@ -268,57 +268,57 @@ TestDef3<dim>::value (const Point<dim>   &p,
 
 template <int dim>
 void TestDef3<dim>::vector_value (const Point<dim> &p,
-                                 Vector<double>   &return_value) const
+                                  Vector<double>   &return_value) const
 {
   Assert (return_value.size() == this->n_components,
-         ExcDimensionMismatch (return_value.size(), this->n_components));
+          ExcDimensionMismatch (return_value.size(), this->n_components));
   for (unsigned int iCount = 0; iCount < this->n_components; iCount++)
     return_value (iCount) = value (p, iCount);
 }
 
-// Wrapper class for polynomials. 
+// Wrapper class for polynomials.
 
 template <int dim>
 class TestPoly : public Function<dim>
 {
-  private:
-    std::vector<Polynomials::Polynomial<double> > polys;
+private:
+  std::vector<Polynomials::Polynomial<double> > polys;
 
-  public:
-    TestPoly (unsigned int deg) :
-                   Function<dim> (2)
+public:
+  TestPoly (unsigned int deg) :
+    Function<dim> (2)
+  {
+    std::vector<double> coeff (deg, 0.0);
+    for (unsigned int p=0; p < 4; ++p)
       {
-       std::vector<double> coeff (deg, 0.0);
-       for (unsigned int p=0; p < 4; ++p)
-         {
-           for (unsigned int i=0; i < deg; ++i)
-             {
-               double c = ((double) rand ()) / ((double) RAND_MAX + 1);
-               coeff[i] = c;
-             }
-           polys.push_back (Polynomials::Polynomial<double> (coeff));
-         }
+        for (unsigned int i=0; i < deg; ++i)
+          {
+            double c = ((double) rand ()) / ((double) RAND_MAX + 1);
+            coeff[i] = c;
+          }
+        polys.push_back (Polynomials::Polynomial<double> (coeff));
       }
-    
-    virtual ~TestPoly () {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
-    
-    void vector_value (const Point<dim> &p,
-                      Vector<double>   &return_value) const;
+  }
+
+  virtual ~TestPoly () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
+
+  void vector_value (const Point<dim> &p,
+                     Vector<double>   &return_value) const;
 };
 
 
 template <int dim>
 double
 TestPoly<dim>::value (const Point<dim>   &p,
-                     const unsigned int  component) const 
+                      const unsigned int  component) const
 {
   double x = p(0),
-        y = p(1);
+         y = p(1);
 
-                                  // Ugly hack, but should do the job ...
+  // Ugly hack, but should do the job ...
   if (component == 0)
     return polys[0].value (x) + polys[1].value (y);
   else
@@ -328,10 +328,10 @@ TestPoly<dim>::value (const Point<dim>   &p,
 
 template <int dim>
 void TestPoly<dim>::vector_value (const Point<dim> &p,
-                                 Vector<double>   &return_value) const
+                                  Vector<double>   &return_value) const
 {
   Assert (return_value.size() == this->n_components,
-         ExcDimensionMismatch (return_value.size(), this->n_components));
+          ExcDimensionMismatch (return_value.size(), this->n_components));
   for (unsigned int iCount = 0; iCount < this->n_components; iCount++)
     return_value (iCount) = value (p, iCount);
 }
@@ -343,83 +343,83 @@ void TestPoly<dim>::vector_value (const Point<dim> &p,
  */
 
 double TestProjection (Mapping<2> &mapping,
-                      DoFHandler<2> *dof_handler)
+                       DoFHandler<2> *dof_handler)
 {
   Vector<double> solution;
   solution.reinit (dof_handler->n_dofs ());
 
-                                  // Create and Project test function to H_div space and evaluate the error
-                                  // If the error is in the range of machine precision, this polynomial
-                                  // degree can obviously be represented by projected field.
+  // Create and Project test function to H_div space and evaluate the error
+  // If the error is in the range of machine precision, this polynomial
+  // degree can obviously be represented by projected field.
 
   for (unsigned int deg = 1; deg < 4; ++deg)
     {
       TestPoly<2> pol (deg);
 
-                                      // Project solution onto RT FE field
+      // Project solution onto RT FE field
       ConstraintMatrix     hn_constraints;
       hn_constraints.clear ();
-      DoFTools::make_hanging_node_constraints (*dof_handler, 
-                                              hn_constraints);
+      DoFTools::make_hanging_node_constraints (*dof_handler,
+                                               hn_constraints);
       hn_constraints.close ();
       VectorTools::project (mapping, *dof_handler, hn_constraints,
-                           QGauss<2> (6), pol,
-                           solution);
+                            QGauss<2> (6), pol,
+                            solution);
 
-                                      // Now evaluate error ...
-                                      // Use a high order quadrature. 
+      // Now evaluate error ...
+      // Use a high order quadrature.
       QGauss<2> quad (6);
-      FEValues<2> fe_values (mapping, dof_handler->get_fe (), quad, 
-                            UpdateFlags(update_values    |
-                                        update_q_points  |
-                                        update_gradients |
-                                        update_JxW_values|
-                                        update_contravariant_transformation));
+      FEValues<2> fe_values (mapping, dof_handler->get_fe (), quad,
+                             UpdateFlags(update_values    |
+                                         update_q_points  |
+                                         update_gradients |
+                                         update_JxW_values|
+                                         update_contravariant_transformation));
 
       const unsigned int   n_q_points    = quad.size();
       const unsigned int   n_components   = dof_handler->get_fe().n_components();
-      
-                                      // Cell iterators
+
+      // Cell iterators
       DoFHandler<2>::active_cell_iterator cell = dof_handler->begin_active(),
-                                         endc = dof_handler->end();
+                                          endc = dof_handler->end();
 
       double err_u = 0,
-            err_v = 0;
+             err_v = 0;
 
       for (; cell!=endc; ++cell)
-       {
-         fe_values.reinit (cell);
-         
-                                          // Get values from solution vector (For Trap.Rule)
-         std::vector<Vector<double> > this_value
-           (n_q_points, Vector<double>(n_components));
-         fe_values.get_function_values (solution, this_value);
-         
-         for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-           {
-             double u = this_value[q_point](0),
-                    v = this_value[q_point](1);
-             Point<2> p = fe_values.quadrature_point (q_point);
-
-             double u_ex = pol.value (p, 0),
-                    v_ex = pol.value (p, 1);
-
-             double JxW = fe_values.JxW (q_point);
-
-             err_u += (u - u_ex) * (u - u_ex) * JxW;
-             err_v += (v - v_ex) * (v - v_ex) * JxW;
-           }
-       }
+        {
+          fe_values.reinit (cell);
+
+          // Get values from solution vector (For Trap.Rule)
+          std::vector<Vector<double> > this_value
+          (n_q_points, Vector<double>(n_components));
+          fe_values.get_function_values (solution, this_value);
+
+          for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+            {
+              double u = this_value[q_point](0),
+                     v = this_value[q_point](1);
+              Point<2> p = fe_values.quadrature_point (q_point);
+
+              double u_ex = pol.value (p, 0),
+                     v_ex = pol.value (p, 1);
+
+              double JxW = fe_values.JxW (q_point);
+
+              err_u += (u - u_ex) * (u - u_ex) * JxW;
+              err_v += (v - v_ex) * (v - v_ex) * JxW;
+            }
+        }
 
       deallog << dof_handler->get_fe().get_name()
-             << ", testfun(" << deg
-             << "), error_u=" << err_u
-             << ", error_v=" << err_v
-             << std::endl;
+              << ", testfun(" << deg
+              << "), error_u=" << err_u
+              << ", error_v=" << err_v
+              << std::endl;
     }
 
 
-                                  // Test the core functionality
+  // Test the core functionality
   DataOut<2> *data_out = new DataOut<2>;
   data_out->attach_dof_handler (*dof_handler);
   data_out->add_data_vector (solution, "solution");
@@ -445,92 +445,92 @@ int main ()
 
   Triangulation<2> tria_test;
   DoFHandler<2> *dof_handler,
-    *dof_handler_def;
+             *dof_handler_def;
   Point<2> p1 (0,0),
-    p2 (1, 1);
+        p2 (1, 1);
 
   GridGenerator::hyper_rectangle (tria_test, p1, p2);
-                                  //  tria_test.refine_global (1);
-                                  //  tria_test.distort_random (0.4);
+  //  tria_test.refine_global (1);
+  //  tria_test.distort_random (0.4);
 
-                                  // Create a DoFHandler for the RT space
+  // Create a DoFHandler for the RT space
   FE_RaviartThomas<2> fe (1);
   dof_handler = new DoFHandler<2> (tria_test);
   dof_handler->distribute_dofs (fe);
 
   QGauss<2> quad_temp(6);
   deallog << "DoFs per quad: " << fe.dofs_per_quad
-         << ", dofs per line: " << fe.dofs_per_line
-         << ", dofs per vertex: " <<  fe.dofs_per_vertex
-         << std::endl;
+          << ", dofs per line: " << fe.dofs_per_line
+          << ", dofs per vertex: " <<  fe.dofs_per_vertex
+          << std::endl;
   deallog << "n_q_points=" << quad_temp.size()
-         << std::endl;
+          << std::endl;
 
-                                  // Create an deformation object for
-                                  // the Eulerian mapping
+  // Create an deformation object for
+  // the Eulerian mapping
   FESystem<2> fe_def (FE_Q<2>(1), 2);
   dof_handler_def = new DoFHandler<2> (tria_test);
   dof_handler_def->distribute_dofs (fe_def);
 
-                                  // Alloc some DoFs
+  // Alloc some DoFs
   Vector<double> solution,
-    solution_q,
-    deformation;
+         solution_q,
+         deformation;
   solution.reinit (dof_handler->n_dofs ());
   solution_q.reinit (dof_handler->n_dofs ());
   deformation.reinit (dof_handler_def->n_dofs ());
 
   ConstraintMatrix     hn_constraints_def;
   hn_constraints_def.clear ();
-  DoFTools::make_hanging_node_constraints (*dof_handler_def, 
-                                          hn_constraints_def);
+  DoFTools::make_hanging_node_constraints (*dof_handler_def,
+                                           hn_constraints_def);
   hn_constraints_def.close ();
-  
+
   {
     MappingQ1Eulerian<2> mapping_euler (deformation, *dof_handler_def);
 
-                                    // Try rotating the elements
+    // Try rotating the elements
     for (double rotat = 0; rotat < 2 * M_PI; rotat += 0.25 * M_PI)
       {
-                                        // Rotate element
-       VectorTools::project (*dof_handler_def, hn_constraints_def,
-                             QGauss<2> (6), TestDef1<2>(2, rotat),
-                             deformation);
-       deallog << "phi = " << rotat << std::endl;
-       TestProjection (mapping_euler, dof_handler);
+        // Rotate element
+        VectorTools::project (*dof_handler_def, hn_constraints_def,
+                              QGauss<2> (6), TestDef1<2>(2, rotat),
+                              deformation);
+        deallog << "phi = " << rotat << std::endl;
+        TestProjection (mapping_euler, dof_handler);
       }
 
-                                    // Try resizing the elements
+    // Try resizing the elements
     for (double scale = -0.75; scale < 4.0; scale += 0.25)
       {
-       VectorTools::project (*dof_handler_def, hn_constraints_def,
-                             QGauss<2> (6), TestDef2<2>(2, scale),
-                             deformation);
-       deallog << "scale = " << scale << std::endl;
-       TestProjection (mapping_euler, dof_handler);
+        VectorTools::project (*dof_handler_def, hn_constraints_def,
+                              QGauss<2> (6), TestDef2<2>(2, scale),
+                              deformation);
+        deallog << "scale = " << scale << std::endl;
+        TestProjection (mapping_euler, dof_handler);
       }
 
-                                    // Try paralellogramming the elements
+    // Try paralellogramming the elements
     for (double scale = -1.0; scale < 1.0; scale += 0.25)
       {
-       VectorTools::project (*dof_handler_def, hn_constraints_def,
-                             QGauss<2> (6), TestDef3<2>(2, scale),
-                             deformation);
-       deallog << "scale = " << scale << std::endl;
-       TestProjection (mapping_euler, dof_handler);
+        VectorTools::project (*dof_handler_def, hn_constraints_def,
+                              QGauss<2> (6), TestDef3<2>(2, scale),
+                              deformation);
+        deallog << "scale = " << scale << std::endl;
+        TestProjection (mapping_euler, dof_handler);
       }
 
-                                    // Try arbitrary deformation ...
+    // Try arbitrary deformation ...
     for (unsigned int i=0; i < deformation.size (); ++i)
       {
-       double c = ((double) rand ()) / ((double) RAND_MAX + 1);
-       deformation (i) = 0.35 * (c - 0.5);
+        double c = ((double) rand ()) / ((double) RAND_MAX + 1);
+        deformation (i) = 0.35 * (c - 0.5);
       }
 
     deallog << "Arbitrary\n" << std::endl;
     TestProjection (mapping_euler, dof_handler);
   }
-  
+
   delete (dof_handler);
   delete (dof_handler_def);
 
index a21182a0687e2e13c7a8173b5a3beb7e047ce568..7111e6c6d9f4c6e37edbc4da07c6586694d91e11 100644 (file)
@@ -58,114 +58,114 @@ std::ofstream logfile ("rt_normal_02/output");
  */
 
 void EvaluateNormal2 (DoFHandler<2> *dof_handler,
-                     Vector<double> &solution)
+                      Vector<double> &solution)
 {
-    // This quadrature rule determines the points, where the
-    // continuity will be tested.
-    QGauss<1> quad (6);
-    Quadrature<2> qproject = QProjector<2>::project_to_all_faces (quad);
-
-    FEFaceValues<2> fe_v_face (dof_handler->get_fe (), quad, 
-                              UpdateFlags(update_values    |
-                                          update_q_points  |
-                                          update_gradients |
-                                          update_normal_vectors |
-                                          update_JxW_values));
-
-    FEValues<2> fe_v (dof_handler->get_fe (), qproject, 
-                     UpdateFlags(update_values    |
-                                 update_q_points  |
-                                 update_gradients |
-                                 update_JxW_values));
-
-    FEValues<2> fe_v_n (dof_handler->get_fe (), qproject, 
-                       UpdateFlags(update_values    |
-                                   update_q_points  |
-                                   update_gradients |
-                                   update_JxW_values));
-
-    const unsigned int   n_q_face    = quad.size();
-    const unsigned int   n_q_proj    = qproject.size();
-    const unsigned int   n_components   = dof_handler->get_fe().n_components();
-    const unsigned int   dofs_per_cell = dof_handler->get_fe().dofs_per_cell;
-
-    deallog << "Quad Points Face " << n_q_face
-           << ", Quad Points Proj. " << n_q_proj
-           << std::endl;
-
-    // Cell iterators
-    DoFHandler<2>::active_cell_iterator cell = dof_handler->begin_active(),
-       endc = dof_handler->end();
-
-    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
-
-    for (; cell!=endc; ++cell)
+  // This quadrature rule determines the points, where the
+  // continuity will be tested.
+  QGauss<1> quad (6);
+  Quadrature<2> qproject = QProjector<2>::project_to_all_faces (quad);
+
+  FEFaceValues<2> fe_v_face (dof_handler->get_fe (), quad,
+                             UpdateFlags(update_values    |
+                                         update_q_points  |
+                                         update_gradients |
+                                         update_normal_vectors |
+                                         update_JxW_values));
+
+  FEValues<2> fe_v (dof_handler->get_fe (), qproject,
+                    UpdateFlags(update_values    |
+                                update_q_points  |
+                                update_gradients |
+                                update_JxW_values));
+
+  FEValues<2> fe_v_n (dof_handler->get_fe (), qproject,
+                      UpdateFlags(update_values    |
+                                  update_q_points  |
+                                  update_gradients |
+                                  update_JxW_values));
+
+  const unsigned int   n_q_face    = quad.size();
+  const unsigned int   n_q_proj    = qproject.size();
+  const unsigned int   n_components   = dof_handler->get_fe().n_components();
+  const unsigned int   dofs_per_cell = dof_handler->get_fe().dofs_per_cell;
+
+  deallog << "Quad Points Face " << n_q_face
+          << ", Quad Points Proj. " << n_q_proj
+          << std::endl;
+
+  // Cell iterators
+  DoFHandler<2>::active_cell_iterator cell = dof_handler->begin_active(),
+                                      endc = dof_handler->end();
+
+  std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
+
+  for (; cell!=endc; ++cell)
     {
-       cell->get_dof_indices (local_dof_indices);
-       fe_v.reinit (cell);
-       
-       for (unsigned int f = 0; f < GeometryInfo<2>::faces_per_cell; ++f)
-       {
-           if (!cell->face(f)->at_boundary ())
-           {
-               const QProjector<2>::DataSetDescriptor offset
-                   = (QProjector<2>::DataSetDescriptor::
-                      face (f,
-                            cell->face_orientation(f),
-                            cell->face_flip(f),
-                            cell->face_rotation(f),
-                            quad.size()));
-               fe_v_face.reinit (cell, f);
-               
-               DoFHandler<2>::active_cell_iterator cell_n = cell->neighbor (f);
-               const unsigned int neighbor=cell->neighbor_of_neighbor(f);
-               fe_v_n.reinit (cell_n); 
-
-               const QProjector<2>::DataSetDescriptor offset_n
-                   = (QProjector<2>::DataSetDescriptor::
-                      face (neighbor,
-                            cell_n->face_orientation(neighbor),
-                            cell_n->face_flip(neighbor),
-                            cell_n->face_rotation(neighbor),
-                            quad.size()));
-
-               // Get values from solution vector (For Trap.Rule)
-               std::vector<Vector<double> > this_value
-                   (n_q_proj, Vector<double>(n_components));
-               fe_v.get_function_values (solution, this_value);
-
-               // Same for neighbor cell
-               std::vector<Vector<double> > this_value_n
-                   (n_q_proj, Vector<double>(n_components));
-               fe_v_n.get_function_values (solution, this_value_n);
-
-               for (unsigned int q_point=0; q_point<n_q_face; ++q_point)
-               {
-                   Point<2> vn = fe_v_face.normal_vector (q_point);
-                   double nx = vn(0);
-                   double ny = vn(1);
-                   
-                   double u = this_value[q_point + offset](0);
-                   double v = this_value[q_point + offset](1);
-
-                   double u_n = this_value_n[q_point + offset_n](0);
-                   double v_n = this_value_n[q_point + offset_n](1);
-                   double un1 = u * nx + v * ny,
-                       un2 = u_n * nx + v_n * ny;
-
-                   deallog << "QP " << q_point
-                           << ", Error: "
-                           << (u-u_n) * nx + (v-v_n) * ny
-                           << ", u " << un1
-                           << ", un " << un2
-                           << ", Rat " << un2 / un1
-                           << std::endl;
-
-                   Assert (std::fabs((u-u_n) * nx + (v-v_n) * ny) < 1e-12,
-                           ExcInternalError());
-               }
-           }
-       }
+      cell->get_dof_indices (local_dof_indices);
+      fe_v.reinit (cell);
+
+      for (unsigned int f = 0; f < GeometryInfo<2>::faces_per_cell; ++f)
+        {
+          if (!cell->face(f)->at_boundary ())
+            {
+              const QProjector<2>::DataSetDescriptor offset
+                = (QProjector<2>::DataSetDescriptor::
+                   face (f,
+                         cell->face_orientation(f),
+                         cell->face_flip(f),
+                         cell->face_rotation(f),
+                         quad.size()));
+              fe_v_face.reinit (cell, f);
+
+              DoFHandler<2>::active_cell_iterator cell_n = cell->neighbor (f);
+              const unsigned int neighbor=cell->neighbor_of_neighbor(f);
+              fe_v_n.reinit (cell_n);
+
+              const QProjector<2>::DataSetDescriptor offset_n
+                = (QProjector<2>::DataSetDescriptor::
+                   face (neighbor,
+                         cell_n->face_orientation(neighbor),
+                         cell_n->face_flip(neighbor),
+                         cell_n->face_rotation(neighbor),
+                         quad.size()));
+
+              // Get values from solution vector (For Trap.Rule)
+              std::vector<Vector<double> > this_value
+              (n_q_proj, Vector<double>(n_components));
+              fe_v.get_function_values (solution, this_value);
+
+              // Same for neighbor cell
+              std::vector<Vector<double> > this_value_n
+              (n_q_proj, Vector<double>(n_components));
+              fe_v_n.get_function_values (solution, this_value_n);
+
+              for (unsigned int q_point=0; q_point<n_q_face; ++q_point)
+                {
+                  Point<2> vn = fe_v_face.normal_vector (q_point);
+                  double nx = vn(0);
+                  double ny = vn(1);
+
+                  double u = this_value[q_point + offset](0);
+                  double v = this_value[q_point + offset](1);
+
+                  double u_n = this_value_n[q_point + offset_n](0);
+                  double v_n = this_value_n[q_point + offset_n](1);
+                  double un1 = u * nx + v * ny,
+                         un2 = u_n * nx + v_n * ny;
+
+                  deallog << "QP " << q_point
+                          << ", Error: "
+                          << (u-u_n) * nx + (v-v_n) * ny
+                          << ", u " << un1
+                          << ", un " << un2
+                          << ", Rat " << un2 / un1
+                          << std::endl;
+
+                  Assert (std::fabs((u-u_n) * nx + (v-v_n) * ny) < 1e-12,
+                          ExcInternalError());
+                }
+            }
+        }
     }
 }
 
@@ -176,85 +176,85 @@ void EvaluateNormal2 (DoFHandler<2> *dof_handler,
  */
 
 void EvaluateNormal (DoFHandler<2> *dof_handler,
-                    Vector<double> &solution)
+                     Vector<double> &solution)
 {
-    // This quadrature rule determines the points, where the
-    // continuity will be tested.
-    QGauss<1> quad (6);
-    FEFaceValues<2> fe_v_face (dof_handler->get_fe (), quad, 
-                              UpdateFlags(update_values    |
-                                          update_q_points  |
-                                          update_gradients |
-                                          update_normal_vectors |
-                                          update_JxW_values));
-
-    FEFaceValues<2> fe_v_face_n (dof_handler->get_fe (), quad, 
-                                UpdateFlags(update_values    |
-                                            update_q_points  |
-                                            update_gradients |
-                                            update_normal_vectors |
-                                            update_JxW_values));
-
-    const unsigned int   n_q_face    = quad.size();
-    const unsigned int   n_components   = dof_handler->get_fe().n_components();
-    const unsigned int   dofs_per_cell = dof_handler->get_fe().dofs_per_cell;
-
-    // Cell iterators
-    DoFHandler<2>::active_cell_iterator cell = dof_handler->begin_active(),
-       endc = dof_handler->end();
-
-    std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
-
-    for (; cell!=endc; ++cell)
+  // This quadrature rule determines the points, where the
+  // continuity will be tested.
+  QGauss<1> quad (6);
+  FEFaceValues<2> fe_v_face (dof_handler->get_fe (), quad,
+                             UpdateFlags(update_values    |
+                                         update_q_points  |
+                                         update_gradients |
+                                         update_normal_vectors |
+                                         update_JxW_values));
+
+  FEFaceValues<2> fe_v_face_n (dof_handler->get_fe (), quad,
+                               UpdateFlags(update_values    |
+                                           update_q_points  |
+                                           update_gradients |
+                                           update_normal_vectors |
+                                           update_JxW_values));
+
+  const unsigned int   n_q_face    = quad.size();
+  const unsigned int   n_components   = dof_handler->get_fe().n_components();
+  const unsigned int   dofs_per_cell = dof_handler->get_fe().dofs_per_cell;
+
+  // Cell iterators
+  DoFHandler<2>::active_cell_iterator cell = dof_handler->begin_active(),
+                                      endc = dof_handler->end();
+
+  std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
+
+  for (; cell!=endc; ++cell)
     {
-       cell->get_dof_indices (local_dof_indices);
-
-       for (unsigned int f = 0; f < GeometryInfo<2>::faces_per_cell; ++f)
-       {
-           if (!cell->face(f)->at_boundary ())
-           {
-               fe_v_face.reinit (cell, f);
-               
-               const unsigned int neighbor=cell->neighbor_of_neighbor(f);
-               fe_v_face_n.reinit (cell->neighbor (f), neighbor); 
-
-               // Get values from solution vector (For Trap.Rule)
-               std::vector<Vector<double> > this_value
-                   (n_q_face, Vector<double>(n_components));
-               fe_v_face.get_function_values (solution, this_value);
-
-               // Same for neighbor cell
-               std::vector<Vector<double> > this_value_n
-                   (n_q_face, Vector<double>(n_components));
-               fe_v_face_n.get_function_values (solution, this_value_n);
-
-               for (unsigned int q_point=0; q_point<n_q_face; ++q_point)
-               {
-                   Point<2> vn = fe_v_face.normal_vector (q_point);
-                   double nx = vn(0);
-                   double ny = vn(1);
-                   
-                   double u = this_value[q_point](0);
-                   double v = this_value[q_point](1);
-
-                   double u_n = this_value_n[q_point](0);
-                   double v_n = this_value_n[q_point](1);
-                   double un1 = u * nx + v * ny,
-                       un2 = u_n * nx + v_n * ny;
-
-                   deallog << "QP " << q_point
-                           << ", Error: "
-                           << (u-u_n) * nx + (v-v_n) * ny
-                           << ", u " << un1
-                           << ", un " << un2
-                           << ", Rat " << un2 / un1
-                           << std::endl;
-
-                   Assert (std::fabs((u-u_n) * nx + (v-v_n) * ny) < 1e-12,
-                           ExcInternalError());
-               }
-           }
-       }
+      cell->get_dof_indices (local_dof_indices);
+
+      for (unsigned int f = 0; f < GeometryInfo<2>::faces_per_cell; ++f)
+        {
+          if (!cell->face(f)->at_boundary ())
+            {
+              fe_v_face.reinit (cell, f);
+
+              const unsigned int neighbor=cell->neighbor_of_neighbor(f);
+              fe_v_face_n.reinit (cell->neighbor (f), neighbor);
+
+              // Get values from solution vector (For Trap.Rule)
+              std::vector<Vector<double> > this_value
+              (n_q_face, Vector<double>(n_components));
+              fe_v_face.get_function_values (solution, this_value);
+
+              // Same for neighbor cell
+              std::vector<Vector<double> > this_value_n
+              (n_q_face, Vector<double>(n_components));
+              fe_v_face_n.get_function_values (solution, this_value_n);
+
+              for (unsigned int q_point=0; q_point<n_q_face; ++q_point)
+                {
+                  Point<2> vn = fe_v_face.normal_vector (q_point);
+                  double nx = vn(0);
+                  double ny = vn(1);
+
+                  double u = this_value[q_point](0);
+                  double v = this_value[q_point](1);
+
+                  double u_n = this_value_n[q_point](0);
+                  double v_n = this_value_n[q_point](1);
+                  double un1 = u * nx + v * ny,
+                         un2 = u_n * nx + v_n * ny;
+
+                  deallog << "QP " << q_point
+                          << ", Error: "
+                          << (u-u_n) * nx + (v-v_n) * ny
+                          << ", u " << un1
+                          << ", un " << un2
+                          << ", Rat " << un2 / un1
+                          << std::endl;
+
+                  Assert (std::fabs((u-u_n) * nx + (v-v_n) * ny) < 1e-12,
+                          ExcInternalError());
+                }
+            }
+        }
     }
 }
 
@@ -262,7 +262,7 @@ void EvaluateNormal (DoFHandler<2> *dof_handler,
 int main (int /*argc*/, char **/*argv*/)
 {
   deallog << std::setprecision(PRECISION);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
@@ -270,7 +270,7 @@ int main (int /*argc*/, char **/*argv*/)
   Triangulation<2> tria_test;
   DoFHandler<2> *dof_handler;
   Point<2> p1 (0,0),
-    p2 (1, 1);
+        p2 (1, 1);
   std::vector<unsigned int> sub_div;
 
   sub_div.push_back (1);
@@ -291,7 +291,7 @@ int main (int /*argc*/, char **/*argv*/)
 
   // Fill solution vector with random values between 0 and 1.
   for (unsigned int i = 0; i < dof_handler->n_dofs (); ++i)
-      solution(i) = (double) rand () / (double) RAND_MAX;
+    solution(i) = (double) rand () / (double) RAND_MAX;
 
   // Now check if the function is continuous in normal
   // direction.
index 3c98636386a73776b727511d8961bb29dcc88bcd..2a6698cfbe3486419c9fa2f9755070d0d6100232 100644 (file)
 // points is computed.
 template <int dim>
 void
-initialize_node_matrix (const FiniteElement<dim>other,
-                       const FiniteElement<dim>& nodes,
-                       FullMatrix<double>& N)
+initialize_node_matrix (const FiniteElement<dim> &other,
+                        const FiniteElement<dim> &nodes,
+                        FullMatrix<double> &N)
 {
   const unsigned int n_dofs = other.dofs_per_cell;
   Assert (n_dofs == nodes.dofs_per_cell,
-         ExcDimensionMismatch(n_dofs, nodes.dofs_per_cell));
-  
+          ExcDimensionMismatch(n_dofs, nodes.dofs_per_cell));
+
   N.reinit(n_dofs, n_dofs);
 
-  const std::vector<Point<dim> >unit_support_points = nodes.get_generalized_support_points();
-  
-                                  // The curent node functional index
+  const std::vector<Point<dim> > &unit_support_points = nodes.get_generalized_support_points();
+
+  // The curent node functional index
   unsigned int current = 0;
 
-                                  // For each face and all quadrature
-                                  // points on it, the node value is
-                                  // the normal component of the
-                                  // shape function, possibly
-                                  // pointing in negative direction.
+  // For each face and all quadrature
+  // points on it, the node value is
+  // the normal component of the
+  // shape function, possibly
+  // pointing in negative direction.
   for (unsigned int face = 0; face<GeometryInfo<dim>::faces_per_cell; ++face)
-    for (unsigned int k=0;k<other.dofs_per_face;++k)
+    for (unsigned int k=0; k<other.dofs_per_face; ++k)
       {
-       for (unsigned int i=0;i<n_dofs;++i)
-         N(current,i) = other.shape_value_component(
-           i, unit_support_points[current],
-           GeometryInfo< dim >::unit_normal_direction[face]);
-       ++current;
+        for (unsigned int i=0; i<n_dofs; ++i)
+          N(current,i) = other.shape_value_component(
+                           i, unit_support_points[current],
+                           GeometryInfo< dim >::unit_normal_direction[face]);
+        ++current;
       }
-                                  // Interior degrees of freedom in each direction
+  // Interior degrees of freedom in each direction
   const unsigned int n_cell = (n_dofs - current) / dim;
-  
-  for (unsigned int d=0;d<dim;++d)
-    for (unsigned int k=0;k<n_cell;++k)
+
+  for (unsigned int d=0; d<dim; ++d)
+    for (unsigned int k=0; k<n_cell; ++k)
       {
-       for (unsigned int i=0;i<n_dofs;++i)
-         N(current,i) = other.shape_value_component(i, unit_support_points[current], d);
-       ++current;
+        for (unsigned int i=0; i<n_dofs; ++i)
+          N(current,i) = other.shape_value_component(i, unit_support_points[current], d);
+        ++current;
       }
   Assert (current == n_dofs, ExcInternalError());
 }
@@ -85,46 +85,46 @@ initialize_node_matrix (const FiniteElement<dim>& other,
 
 template <int dim>
 void
-compare_shapes (const FiniteElement<dim>other,
-               const FiniteElement<dim>& nodes,
-               FullMatrix<double>& M)
+compare_shapes (const FiniteElement<dim> &other,
+                const FiniteElement<dim> &nodes,
+                FullMatrix<double> &M)
 {
   QGauss<dim> quadrature(other.degree+1);
   Table<3,double> other_values(quadrature.size(), other.dofs_per_cell, dim);
   Table<3,double> nodes_values(quadrature.size(), other.dofs_per_cell, dim);
   Table<3,Tensor<1,dim> > other_grads(quadrature.size(), other.dofs_per_cell, dim);
   Table<3,Tensor<1,dim> > nodes_grads(quadrature.size(), other.dofs_per_cell, dim);
-  for (unsigned int k=0;k<quadrature.size();++k)
-    for (unsigned int i=0;i<other.dofs_per_cell;++i)
-      for (unsigned int d=0;d<dim;++d)
-       {
-         other_values[k][i][d] = other.shape_value_component(i,quadrature.point(k),d);
-         nodes_values[k][i][d] = nodes.shape_value_component(i,quadrature.point(k),d);
-         other_grads[k][i][d] = other.shape_grad_component(i,quadrature.point(k),d);
-         nodes_grads[k][i][d] = nodes.shape_grad_component(i,quadrature.point(k),d);
-       }
-
-  for (unsigned int k=0;k<quadrature.size();++k)
+  for (unsigned int k=0; k<quadrature.size(); ++k)
+    for (unsigned int i=0; i<other.dofs_per_cell; ++i)
+      for (unsigned int d=0; d<dim; ++d)
+        {
+          other_values[k][i][d] = other.shape_value_component(i,quadrature.point(k),d);
+          nodes_values[k][i][d] = nodes.shape_value_component(i,quadrature.point(k),d);
+          other_grads[k][i][d] = other.shape_grad_component(i,quadrature.point(k),d);
+          nodes_grads[k][i][d] = nodes.shape_grad_component(i,quadrature.point(k),d);
+        }
+
+  for (unsigned int k=0; k<quadrature.size(); ++k)
     {
-      for (unsigned int i=0;i<other.dofs_per_cell;++i)
-       for (unsigned int d=0;d<dim;++d)
-         {
-           double value = other_values[k][i][d];
-           Tensor<1,dim> grad = other_grads[k][i][d];
-           for (unsigned int j=0;j<other.dofs_per_cell;++j)
-             {
-               value -= M(j,i) * nodes_values[k][j][d];              
-               grad -= M(j,i) * nodes_grads[k][j][d];
-             }
-           deallog << '.';
-           if (std::fabs(value) > 1.e-12)
-             deallog << "Error value\t" << k << '\t' << i << '\t' << d << '\t' << value
-                     << std::endl;
-           if (grad.norm() > 1.e-12)
-             deallog << "Error grad\t" << k << '\t' << i << '\t' << d << '\t' << grad
-                     << '\t' << other_grads[k][i][d]
-                     << std::endl;
-         }
+      for (unsigned int i=0; i<other.dofs_per_cell; ++i)
+        for (unsigned int d=0; d<dim; ++d)
+          {
+            double value = other_values[k][i][d];
+            Tensor<1,dim> grad = other_grads[k][i][d];
+            for (unsigned int j=0; j<other.dofs_per_cell; ++j)
+              {
+                value -= M(j,i) * nodes_values[k][j][d];
+                grad -= M(j,i) * nodes_grads[k][j][d];
+              }
+            deallog << '.';
+            if (std::fabs(value) > 1.e-12)
+              deallog << "Error value\t" << k << '\t' << i << '\t' << d << '\t' << value
+                      << std::endl;
+            if (grad.norm() > 1.e-12)
+              deallog << "Error grad\t" << k << '\t' << i << '\t' << d << '\t' << grad
+                      << '\t' << other_grads[k][i][d]
+                      << std::endl;
+          }
       deallog << std::endl;
     }
 }
@@ -150,5 +150,5 @@ int main()
 
   test<2>(0);
   test<2>(1);
-  test<2>(2);  
+  test<2>(2);
 }
index 31ff6c66ce1ded9fcabd59dffd261cd9e21562ad..3e92040375231e0a07cf548b1eb8335b2a0447e2 100644 (file)
 
 template <int dim>
 void
-check_support_points (const FiniteElement<dim>fe)
+check_support_points (const FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
-  
-  const std::vector< Point<dim > > & points = fe.get_generalized_support_points();
+
+  const std::vector< Point<dim > > &points = fe.get_generalized_support_points();
   std::vector<double> weights(points.size());
 
   Triangulation<dim> tr;
   GridGenerator::hyper_cube(tr);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
-  
+
   MappingCartesian<dim> mapping;
-  
+
   Quadrature<dim> support_quadrature(points, weights);
   UpdateFlags flags = update_values | update_gradients;
   FEValues<dim> vals(mapping, fe, support_quadrature, flags);
   vals.reinit(dof.begin_active());
-  
-  for (unsigned int k=0;k<points.size();++k)
+
+  for (unsigned int k=0; k<points.size(); ++k)
     {
-      const Point<dim>p = points[k];
+      const Point<dim> &p = points[k];
       deallog << p;
-      for (unsigned int i=0;i<fe.dofs_per_cell;++i)
-       {
-         deallog << '\t';
-         for (unsigned int d=0;d<dim;++d)
-           {
-             const double sf = fe.shape_value_component(i,p,d);
-             deallog << ' ' << (int) rint(60*sf);
-             
-             const double diff = std::abs(sf - vals.shape_value_component(i,k,d));
-             if (diff > 1.e-12)
-               deallog << "Error values" << std::endl;
-             Tensor<1,dim> grad = fe.shape_grad_component(i,p,d);
-             grad -= vals.shape_grad_component(i,k,d);
-             if (grad.norm() > 1.e-12)
-               deallog << "Error grads" << std::endl;
-           }
-       }
+      for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
+        {
+          deallog << '\t';
+          for (unsigned int d=0; d<dim; ++d)
+            {
+              const double sf = fe.shape_value_component(i,p,d);
+              deallog << ' ' << (int) rint(60*sf);
+
+              const double diff = std::abs(sf - vals.shape_value_component(i,k,d));
+              if (diff > 1.e-12)
+                deallog << "Error values" << std::endl;
+              Tensor<1,dim> grad = fe.shape_grad_component(i,p,d);
+              grad -= vals.shape_grad_component(i,k,d);
+              if (grad.norm() > 1.e-12)
+                deallog << "Error grads" << std::endl;
+            }
+        }
       deallog << std::endl;
     }
   deallog << std::endl;
@@ -83,53 +83,53 @@ check_support_points (const FiniteElement<dim>& fe)
 
 template <int dim>
 void
-check_face_support_points (const FiniteElement<dim>fe)
+check_face_support_points (const FiniteElement<dim> &fe)
 {
   deallog << "Face " << fe.get_name() << std::endl;
-  
+
   const std::vector< Point<dim-1> > & sub_points = fe.get_generalized_face_support_points();
   std::vector<double> weights(sub_points.size());
   Quadrature<dim-1> sub_quadrature(sub_points, weights);
   std::vector< Point<dim> > points(sub_points.size());
-  
+
   Triangulation<dim> tr;
   GridGenerator::hyper_cube(tr);
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
-  
+
   MappingCartesian<dim> mapping;
-  
+
   UpdateFlags flags = update_values | update_gradients;
   FEFaceValues<dim> vals(mapping, fe, sub_quadrature, flags);
 
-  for (unsigned int face=0;face<GeometryInfo<dim>::faces_per_cell;++face)
+  for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
     {
       QProjector<dim>::project_to_face(sub_quadrature, face, points);
       vals.reinit(dof.begin_active(), face);
-      
-      for (unsigned int k=0;k<points.size();++k)
-       {
-         const Point<dim>& p = points[k];
-         deallog << p;
-         for (unsigned int i=0;i<fe.dofs_per_cell;++i)
-           {
-             deallog << '\t';
-             for (unsigned int d=0;d<dim;++d)
-               {
-                 const double sf = fe.shape_value_component(i,p,d);
-                 deallog << ' ' << (int) rint(60*sf);
-                 
-                 const double diff = std::abs(sf - vals.shape_value_component(i,k,d));
-                 if (diff > 1.e-12)
-                   deallog << "Error values" << std::endl;
-                 Tensor<1,dim> grad = fe.shape_grad_component(i,p,d);
-                 grad -= vals.shape_grad_component(i,k,d);
-                 if (grad.norm() > 1.e-12)
-                   deallog << "Error grads" << std::endl;
-               }
-           }
-         deallog << std::endl;
-       }
+
+      for (unsigned int k=0; k<points.size(); ++k)
+        {
+          const Point<dim> &p = points[k];
+          deallog << p;
+          for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
+            {
+              deallog << '\t';
+              for (unsigned int d=0; d<dim; ++d)
+                {
+                  const double sf = fe.shape_value_component(i,p,d);
+                  deallog << ' ' << (int) rint(60*sf);
+
+                  const double diff = std::abs(sf - vals.shape_value_component(i,k,d));
+                  if (diff > 1.e-12)
+                    deallog << "Error values" << std::endl;
+                  Tensor<1,dim> grad = fe.shape_grad_component(i,p,d);
+                  grad -= vals.shape_grad_component(i,k,d);
+                  if (grad.norm() > 1.e-12)
+                    deallog << "Error grads" << std::endl;
+                }
+            }
+          deallog << std::endl;
+        }
       deallog << std::endl;
     }
 }
index fd69dad6e191968ee383496fe9893cbdc75296d7..68f87da9f980f59e737cd86b8f429741819d940c 100644 (file)
@@ -49,7 +49,7 @@ plot_shape_functions(const unsigned int degree)
   DoFHandler<dim> dof(tr);
   typename DoFHandler<dim>::cell_iterator c = dof.begin();
   dof.distribute_dofs(fe_rt);
-      
+
   QTrapez<1> q_trapez;
   const unsigned int div=10;
   QIterated<dim> q(q_trapez, div);
@@ -60,10 +60,10 @@ plot_shape_functions(const unsigned int degree)
     {
       if (q_point % QIterated<1>(q_trapez,div).size() == 0)
         deallog << std::endl;
-      
+
       deallog << fe.quadrature_point(q_point) << " ";
-             
-      for (unsigned int i=0;i<fe_rt.dofs_per_cell;++i)
+
+      for (unsigned int i=0; i<fe_rt.dofs_per_cell; ++i)
         for (unsigned int c=0; c<fe.get_fe().n_components(); ++c)
           deallog << " " << fe.shape_value_component(i,q_point,c);
 
@@ -82,7 +82,7 @@ main()
   deallog.threshold_double(1.e-10);
 
   plot_shape_functions<2>(2);
-  
+
   return 0;
 }
 
index 90de184b532c37233f158cf47ebda4ea3d5b398b..5c59c0d514f90857d0e0ad357a1d55966ebefa9f 100644 (file)
@@ -52,14 +52,14 @@ main()
 {
   std::ofstream logfile ("rtn_3/output");
   deallog << std::setprecision(PRECISION);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
   test<2>();
   test<3>();
-  
+
   return 0;
 }
 
index 68127c9151d6d0bd2e3f8d2620859b2792375ccf..1f364d09513cdc0bd8ad0f9674195d24d121e3e9 100644 (file)
@@ -28,9 +28,9 @@ char fname[50];
 ////////////////////////////////////////////////////////////////////////////
 template<int dim>
 inline void
-plot_shape_functions(Mapping<dim>mapping,
-                    FiniteElement<dim>& finel,
-                    const char* name)
+plot_shape_functions(Mapping<dim> &mapping,
+                     FiniteElement<dim> &finel,
+                     const char *name)
 {
   Triangulation<dim> tr;
   DoFHandler<dim> dof(tr);
@@ -43,8 +43,8 @@ plot_shape_functions(Mapping<dim>& mapping,
   QTrapez<1> q_trapez;
   QIterated<dim> q(q_trapez, div);
   FEValues<dim> fe(mapping, finel, q, UpdateFlags(update_values
-                                                 | update_gradients
-                                                 | update_second_derivatives));
+                                                  | update_gradients
+                                                  | update_second_derivatives));
 
   sprintf(fname, "Cell%dd-%s", dim, name);
 //  cerr << "\n" << fname << "\n";
@@ -53,44 +53,44 @@ plot_shape_functions(Mapping<dim>& mapping,
   fe.reinit(c);
 
   unsigned int k=0;
-  for (unsigned int mz=0;mz<=((dim>2) ? div : 0) ;++mz)
+  for (unsigned int mz=0; mz<=((dim>2) ? div : 0) ; ++mz)
     {
-      for (unsigned int my=0;my<=((dim>1) ? div : 0) ;++my)
-       {
-         for (unsigned int mx=0;mx<=div;++mx)
-           {
-             deallog << q.point(k);
-
-             for (unsigned int i=0;i<finel.dofs_per_cell;++i)
-               {
-                 deallog << " " << fe.shape_value(i,k) + 1.;
-
-                                                  // some additional
-                                                  // checks
-                 for (unsigned int c=0; c<fe.get_fe().n_components(); ++c)
-                   {
-                     if (fe.get_fe().system_to_component_index(i).first == c)
-                       Assert ((fe.shape_value(i,k) ==
-                                fe.shape_value_component(i,k,c))
-                               &&
-                               (fe.shape_grad(i,k) ==
-                                fe.shape_grad_component(i,k,c))
-                               &&
-                               (fe.shape_hessian(i,k) ==
-                                fe.shape_hessian_component(i,k,c)),
-                               ExcInternalError())
-                     else
-                       Assert ((fe.shape_value_component(i,k,c) == 0) &&
-                               (fe.shape_grad_component(i,k,c) == Tensor<1,dim>()) &&
-                               (fe.shape_hessian_component(i,k,c) == Tensor<2,dim>()),
-                               ExcInternalError());
-                   };
-               }
-             deallog << std::endl;
-             k++;
-           }
-         deallog << std::endl;
-       }
+      for (unsigned int my=0; my<=((dim>1) ? div : 0) ; ++my)
+        {
+          for (unsigned int mx=0; mx<=div; ++mx)
+            {
+              deallog << q.point(k);
+
+              for (unsigned int i=0; i<finel.dofs_per_cell; ++i)
+                {
+                  deallog << " " << fe.shape_value(i,k) + 1.;
+
+                  // some additional
+                  // checks
+                  for (unsigned int c=0; c<fe.get_fe().n_components(); ++c)
+                    {
+                      if (fe.get_fe().system_to_component_index(i).first == c)
+                        Assert ((fe.shape_value(i,k) ==
+                                 fe.shape_value_component(i,k,c))
+                                &&
+                                (fe.shape_grad(i,k) ==
+                                 fe.shape_grad_component(i,k,c))
+                                &&
+                                (fe.shape_hessian(i,k) ==
+                                 fe.shape_hessian_component(i,k,c)),
+                                ExcInternalError())
+                        else
+                          Assert ((fe.shape_value_component(i,k,c) == 0) &&
+                                  (fe.shape_grad_component(i,k,c) == Tensor<1,dim>()) &&
+                                  (fe.shape_hessian_component(i,k,c) == Tensor<2,dim>()),
+                                  ExcInternalError());
+                    };
+                }
+              deallog << std::endl;
+              k++;
+            }
+          deallog << std::endl;
+        }
       deallog << std::endl;
     }
   deallog.pop();
@@ -101,12 +101,12 @@ plot_shape_functions(Mapping<dim>& mapping,
 template<int dim>
 inline void
 plot_face_shape_functions(
-  Mapping<dim>mapping,
-  FiniteElement<dim>finel,
-  const charname,
+  Mapping<dim> &mapping,
+  FiniteElement<dim> &finel,
+  const char *name,
   UpdateFlags uflags = UpdateFlags(update_values
-                                  | update_gradients
-                                  | update_second_derivatives))
+                                   | update_gradients
+                                   | update_second_derivatives))
 {
   Triangulation<dim> tr;
   DoFHandler<dim> dof(tr);
@@ -133,128 +133,130 @@ plot_face_shape_functions(
   for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
     {
       if (!c->face(f)->has_children())
-       {
-         fe.reinit(c, f);
-
-         unsigned int k=0;
-         for (unsigned int my=0;my<=((dim>2) ? div : 0) ;++my)
-           {
-             for (unsigned int mx=0;mx<=div;++mx)
-               {
-                 deallog << fe.quadrature_point(k);
-
-                 for (unsigned int i=0;i<finel.dofs_per_cell;++i)
-                   {
-                     if (uflags & update_values)
-                       deallog << " " << fe.shape_value(i,k) + 1.;
-
-                                                      // some additional
-                                                      // checks
-                     for (unsigned int c=0; c<fe.get_fe().n_components(); ++c)
-                       {
-                         if (fe.get_fe().system_to_component_index(i).first == c)
-                           {
-                             if (uflags & update_values)
-                               Assert ((fe.shape_value(i,k) == fe.shape_value_component(i,k,c)),
-                                       ExcInternalError());
-                             if (uflags & update_gradients)
-                               Assert((fe.shape_grad(i,k) == fe.shape_grad_component(i,k,c)),
-                                      ExcInternalError());
-                             if (uflags & update_hessians)
-                               Assert((fe.shape_hessian(i,k) == fe.shape_hessian_component(i,k,c)),
-                                      ExcInternalError());
-                           }
-                         else
-                           {
-                             if (uflags & update_values)
-                               Assert ((fe.shape_value_component(i,k,c) == 0),
-                                       ExcInternalError());
-                             if (uflags & update_gradients)
-                               Assert ((fe.shape_grad_component(i,k,c) == Tensor<1,dim>()),
-                                       ExcInternalError());
-                             if (uflags & update_hessians)
-                               Assert ((fe.shape_hessian_component(i,k,c) == Tensor<2,dim>()),
-                                       ExcInternalError());
-                           }
-                       }
-                   }
-                 deallog << std::endl;
-                 k++;
-               }
-             deallog << std::endl;
-           }
-         deallog << std::endl;
-       } else {
-         for (unsigned int s=0;s<GeometryInfo<dim>::max_children_per_face; ++s)
-           {
-             sub.reinit(c, f, s);
-
-             unsigned int k=0;
-             for (unsigned int my=0;my<=((dim>2) ? div : 0) ;++my)
-               {
-                 for (unsigned int mx=0;mx<=div;++mx)
-                   {
-                     deallog << sub.quadrature_point(k);
-
-                     for (unsigned int i=0;i<finel.dofs_per_cell;++i)
-                       {
-                         if (uflags & update_values)
-                           deallog << " " << sub.shape_value(i,k) + 1.;
-                         
-                                                          // some additional
-                                                          // checks
-                         for (unsigned int c=0; c<fe.get_fe().n_components(); ++c)
-                           {
-                             if (fe.get_fe().system_to_component_index(i).first == c)
-                               {
-                                 if (uflags & update_values)
-                                   {
-                                     const double v1 = sub.shape_value(i,k),
-                                                  v2 = sub.shape_value_component(i,k,c);
-                                     Assert (v1 == v2, ExcInternalError());
-                                   }
-                                 if (uflags & update_gradients)
-                                   { 
-                                     const Tensor<1,dim> g1 = sub.shape_grad(i,k),
-                                                         g2 = sub.shape_grad_component(i,k,c);
-                                     Assert (g1 == g2, ExcInternalError());
-                                   }
-                                 if (uflags & update_hessians)
-                                   {
-                                     const Tensor<2,dim> s1 = sub.shape_hessian(i,k),
-                                                         s2 = sub.shape_hessian_component(i,k,c);
-                                     Assert (s1 == s2, ExcInternalError());
-                                   }
-                               }
-                             else
-                               {
-                                 if (uflags & update_values)
-                                   Assert ((sub.shape_value_component(i,k,c) == 0),
-                                           ExcInternalError());
-                                 if (uflags & update_gradients)
-                                   Assert ((sub.shape_grad_component(i,k,c) == Tensor<1,dim>()),
-                                           ExcInternalError());
-                                 if (uflags & update_hessians)
-                                   Assert ((sub.shape_hessian_component(i,k,c) == Tensor<2,dim>()),
-                                           ExcInternalError());
-                               }
-                           };
-                       }
-                     deallog << std::endl;
-                     k++;
-                   }
-                 deallog << std::endl;
-               }
-             deallog << std::endl;
-           }
-       }
+        {
+          fe.reinit(c, f);
+
+          unsigned int k=0;
+          for (unsigned int my=0; my<=((dim>2) ? div : 0) ; ++my)
+            {
+              for (unsigned int mx=0; mx<=div; ++mx)
+                {
+                  deallog << fe.quadrature_point(k);
+
+                  for (unsigned int i=0; i<finel.dofs_per_cell; ++i)
+                    {
+                      if (uflags & update_values)
+                        deallog << " " << fe.shape_value(i,k) + 1.;
+
+                      // some additional
+                      // checks
+                      for (unsigned int c=0; c<fe.get_fe().n_components(); ++c)
+                        {
+                          if (fe.get_fe().system_to_component_index(i).first == c)
+                            {
+                              if (uflags & update_values)
+                                Assert ((fe.shape_value(i,k) == fe.shape_value_component(i,k,c)),
+                                        ExcInternalError());
+                              if (uflags & update_gradients)
+                                Assert((fe.shape_grad(i,k) == fe.shape_grad_component(i,k,c)),
+                                       ExcInternalError());
+                              if (uflags & update_hessians)
+                                Assert((fe.shape_hessian(i,k) == fe.shape_hessian_component(i,k,c)),
+                                       ExcInternalError());
+                            }
+                          else
+                            {
+                              if (uflags & update_values)
+                                Assert ((fe.shape_value_component(i,k,c) == 0),
+                                        ExcInternalError());
+                              if (uflags & update_gradients)
+                                Assert ((fe.shape_grad_component(i,k,c) == Tensor<1,dim>()),
+                                        ExcInternalError());
+                              if (uflags & update_hessians)
+                                Assert ((fe.shape_hessian_component(i,k,c) == Tensor<2,dim>()),
+                                        ExcInternalError());
+                            }
+                        }
+                    }
+                  deallog << std::endl;
+                  k++;
+                }
+              deallog << std::endl;
+            }
+          deallog << std::endl;
+        }
+      else
+        {
+          for (unsigned int s=0; s<GeometryInfo<dim>::max_children_per_face; ++s)
+            {
+              sub.reinit(c, f, s);
+
+              unsigned int k=0;
+              for (unsigned int my=0; my<=((dim>2) ? div : 0) ; ++my)
+                {
+                  for (unsigned int mx=0; mx<=div; ++mx)
+                    {
+                      deallog << sub.quadrature_point(k);
+
+                      for (unsigned int i=0; i<finel.dofs_per_cell; ++i)
+                        {
+                          if (uflags & update_values)
+                            deallog << " " << sub.shape_value(i,k) + 1.;
+
+                          // some additional
+                          // checks
+                          for (unsigned int c=0; c<fe.get_fe().n_components(); ++c)
+                            {
+                              if (fe.get_fe().system_to_component_index(i).first == c)
+                                {
+                                  if (uflags & update_values)
+                                    {
+                                      const double v1 = sub.shape_value(i,k),
+                                                   v2 = sub.shape_value_component(i,k,c);
+                                      Assert (v1 == v2, ExcInternalError());
+                                    }
+                                  if (uflags & update_gradients)
+                                    {
+                                      const Tensor<1,dim> g1 = sub.shape_grad(i,k),
+                                                          g2 = sub.shape_grad_component(i,k,c);
+                                      Assert (g1 == g2, ExcInternalError());
+                                    }
+                                  if (uflags & update_hessians)
+                                    {
+                                      const Tensor<2,dim> s1 = sub.shape_hessian(i,k),
+                                                          s2 = sub.shape_hessian_component(i,k,c);
+                                      Assert (s1 == s2, ExcInternalError());
+                                    }
+                                }
+                              else
+                                {
+                                  if (uflags & update_values)
+                                    Assert ((sub.shape_value_component(i,k,c) == 0),
+                                            ExcInternalError());
+                                  if (uflags & update_gradients)
+                                    Assert ((sub.shape_grad_component(i,k,c) == Tensor<1,dim>()),
+                                            ExcInternalError());
+                                  if (uflags & update_hessians)
+                                    Assert ((sub.shape_hessian_component(i,k,c) == Tensor<2,dim>()),
+                                            ExcInternalError());
+                                }
+                            };
+                        }
+                      deallog << std::endl;
+                      k++;
+                    }
+                  deallog << std::endl;
+                }
+              deallog << std::endl;
+            }
+        }
     }
   deallog.pop();
 }
 
 
 template<>
-void plot_face_shape_functions (Mapping<1>&, FiniteElement<1>&, const char*, UpdateFlags)
+void plot_face_shape_functions (Mapping<1> &, FiniteElement<1> &, const char *, UpdateFlags)
 {}
 
 
@@ -269,25 +271,25 @@ check_values_and_derivatives (const FiniteElement<dim> &fe,
                               const FEValuesBase<dim>  &fe_values,
                               const Quadrature<dim>    &q)
 {
-                                   // check values
+  // check values
   for (unsigned int x=0; x<q.size(); ++x)
     for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
       {
         for (unsigned int c=0; c<fe.n_components(); ++c)
           {
             const double val1 = fe_values.shape_value_component(i,x,c);
-           const double val2 = fe.shape_value_component(i,q.point(x),c);
-           const double diff = std::fabs(val1-val2);
-           if (diff > 1e-13)
-             deallog << " values differ v" << i << "(x" << x << ") diff " << diff
-                     << std::endl;
+            const double val2 = fe.shape_value_component(i,q.point(x),c);
+            const double diff = std::fabs(val1-val2);
+            if (diff > 1e-13)
+              deallog << " values differ v" << i << "(x" << x << ") diff " << diff
+                      << std::endl;
           };
 
-                                         // test something about the
-                                         // correctness of indices
-                                         // etc, except for the more
-                                         // complicated case of
-                                         // non-primitive elements
+        // test something about the
+        // correctness of indices
+        // etc, except for the more
+        // complicated case of
+        // non-primitive elements
         if (fe.is_primitive(i))
           for (unsigned int c=0; c<fe.n_components(); ++c)
             Assert (((c == fe.system_to_component_index(i).first) &&
@@ -298,7 +300,7 @@ check_values_and_derivatives (const FiniteElement<dim> &fe,
                     ExcInternalError());
       };
 
-                                   // check gradients
+  // check gradients
   for (unsigned int x=0; x<q.size(); ++x)
     for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
       {
@@ -319,7 +321,7 @@ check_values_and_derivatives (const FiniteElement<dim> &fe,
                     ExcInternalError());
       }
 
-                                   // check second derivatives
+  // check second derivatives
   double max_diff=0.;
   for (unsigned int x=0; x<q.size(); ++x)
     for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
@@ -333,9 +335,9 @@ check_values_and_derivatives (const FiniteElement<dim> &fe,
                 {
                   const double diff=std::fabs(tmp[j][k]);
                   if (diff>max_diff) max_diff=diff;
-                 const double tmpabs = std::fabs(tmp[j][k]);
-                 if (tmpabs > 1.e-6)
-                   deallog << "Second derivatives differ " << tmpabs << std::endl;
+                  const double tmpabs = std::fabs(tmp[j][k]);
+                  if (tmpabs > 1.e-6)
+                    deallog << "Second derivatives differ " << tmpabs << std::endl;
                 }
           };
 
@@ -355,17 +357,17 @@ check_values_and_derivatives (const FiniteElement<dim> &fe,
 
 template<int dim>
 void test_compute_functions (const Mapping<dim> &mapping,
-                            const FiniteElement<dim> &fe,
-                            const char*)
+                             const FiniteElement<dim> &fe,
+                             const char *)
 {
-                                   // generate a grid with only one
-                                   // cell, which furthermore has the
-                                   // shape of the unit cell. then the
-                                   // values/gradients/... we get from
-                                   // the FEValues object on this cell
-                                   // should really be equal to what
-                                   // we get from the finite element
-                                   // itself on the unit cell:
+  // generate a grid with only one
+  // cell, which furthermore has the
+  // shape of the unit cell. then the
+  // values/gradients/... we get from
+  // the FEValues object on this cell
+  // should really be equal to what
+  // we get from the finite element
+  // itself on the unit cell:
   Triangulation<dim> tr;
   DoFHandler<dim> dof(tr);
   GridGenerator::hyper_cube(tr, 0., 1.);
@@ -374,8 +376,8 @@ void test_compute_functions (const Mapping<dim> &mapping,
   const UpdateFlags update_all = (update_values | update_gradients |
                                   update_second_derivatives);
 
-                                   // first check this for FEValues
-                                   // objects
+  // first check this for FEValues
+  // objects
   if (true)
     {
       const QGauss<dim> q (6);
index af2c215e0b0f7d1b7fcce0d7c4aae1d3925aab79..7a884ea3b752601a5a4903101710fd77b29680c7 100644 (file)
@@ -39,12 +39,12 @@ void plot_FE_DGP_shape_functions()
   plot_shape_functions(m, p2, "DGP2");
   plot_face_shape_functions(m, p2, "DGP2");
   test_compute_functions(m, p2, "DGP2");
-      
+
   FE_DGP<dim> p3(3);
   plot_shape_functions(m, p3, "DGP3");
   plot_face_shape_functions(m, p3, "DGP3");
   test_compute_functions(m, p3, "DGP3");
-      
+
 //    FE_DGP<dim> p4(4);
 //    plot_shape_functions(m, p4, "DGP4");
 //    plot_face_shape_functions(m, p4, "DGP4");
@@ -73,11 +73,11 @@ main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   plot_FE_DGP_shape_functions<1>();
   plot_FE_DGP_shape_functions<2>();
   plot_FE_DGP_shape_functions<3>();
-  
+
   return 0;
 }
 
index e16ba9279e7bd60cc48450bb964a9069f10faaa2..6cdc44c337592dbc830706f9419ecabc8c4600e3 100644 (file)
@@ -58,11 +58,11 @@ main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   plot_FE_DGPMonomial_shape_functions<1>();
   plot_FE_DGPMonomial_shape_functions<2>();
   plot_FE_DGPMonomial_shape_functions<3>();
-  
+
   return 0;
 }
 
index 55a58ad8166c4f148ea32f90c1e367d43c55f0c9..b1b5cc3c5dcc0b7747fb8ca7606cef91cf2fb7fc 100644 (file)
@@ -41,11 +41,11 @@ void plot_FE_DGPNonparametric_shape_functions()
   FE_DGPNonparametric<dim> p2(2);
   plot_shape_functions(m, p2, "DGPNonparametric2");
   plot_face_shape_functions(m, p2, "DGPNonparametric2");
-      
+
 //    FE_DGPNonparametric<dim> p3(3);
 //    plot_shape_functions(m, p3, "DGPNonparametric3");
 //    plot_face_shape_functions(m, p3, "DGPNonparametric3");
-      
+
 //    FE_DGPNonparametric<dim> p4(4);
 //    plot_shape_functions(m, p4, "DGPNonparametric4");
 //    plot_face_shape_functions(m, p4, "DGPNonparametric4");
@@ -64,7 +64,7 @@ main()
   plot_FE_DGPNonparametric_shape_functions<1>();
   plot_FE_DGPNonparametric_shape_functions<2>();
   plot_FE_DGPNonparametric_shape_functions<3>();
-  
+
   return 0;
 }
 
index a6b043118a1d9d0ccbdbdb2511ebd8e775baec81..fcd8f99203ab54671180cd1c505fbb905579c848 100644 (file)
@@ -29,7 +29,7 @@ template<int dim>
 void plot_FE_DGQ_shape_functions()
 {
   MappingQ1<dim> m;
-  
+
   FE_DGQ<dim> q1(1);
   plot_shape_functions(m, q1, "DGQ1");
   plot_face_shape_functions(m, q1, "DGQ1");
@@ -44,19 +44,19 @@ void plot_FE_DGQ_shape_functions()
   plot_shape_functions(m, q3, "DGQ3");
   plot_face_shape_functions(m, q3, "DGQ3");
   test_compute_functions(m, q3, "DGQ3");
-  
+
   QGaussLobatto<1> quadrature_gl(5);
   FE_DGQArbitraryNodes<dim> qgl(quadrature_gl);
   plot_shape_functions(m, qgl, "DGQGL");
   plot_face_shape_functions(m, qgl, "DGQGL");
   test_compute_functions(m, qgl, "DGQGL");
-  
+
   QGauss<1> quadrature_g(5);
   FE_DGQArbitraryNodes<dim> qg(quadrature_g);
   plot_shape_functions(m, qg, "DGQG");
   plot_face_shape_functions(m, qg, "DGQG");
   test_compute_functions(m, qg, "DGQG");
-  
+
 //    FE_DGQ<dim> q4(4);
 //    plot_shape_functions(m, q4, "DGQ4");
 //    plot_face_shape_functions(m, q4, "DGQ4");
@@ -89,7 +89,7 @@ main()
   plot_FE_DGQ_shape_functions<1>();
   plot_FE_DGQ_shape_functions<2>();
   plot_FE_DGQ_shape_functions<3>();
-  
+
   return 0;
 }
 
index ee5f6296a649c9f327aca54ef245d22a1a056f00..fdbe409ee5e574beb0d14cbba18993d9ae42fe35 100644 (file)
@@ -31,7 +31,7 @@ template<int dim>
 void plot_FE_FaceQ_shape_functions()
 {
   MappingQ1<dim> m;
-  
+
   FE_FaceQ<dim> q0(0);
   FE_FaceQ<dim> q1(1);
   FE_FaceQ<dim> q2(2);
@@ -46,8 +46,8 @@ void plot_FE_FaceQ_shape_functions()
   plot_face_shape_functions(m, q1, "FaceQ1", update_values);
   plot_face_shape_functions(m, q2, "FaceQ2", update_values);
   plot_face_shape_functions(m, q3, "FaceQ3", update_values);
-  plot_face_shape_functions(m, sys0, "System0", update_values);  
-  plot_face_shape_functions(m, sys1, "System1", update_values);  
+  plot_face_shape_functions(m, sys0, "System0", update_values);
+  plot_face_shape_functions(m, sys1, "System1", update_values);
   plot_face_shape_functions(m, sys00, "System0-0", update_values);
   plot_face_shape_functions(m, sys11, "System1-1", update_values);
 }
@@ -65,7 +65,7 @@ main()
 
   plot_FE_FaceQ_shape_functions<2>();
 //  plot_FE_FaceQ_shape_functions<3>();
-  
+
   return 0;
 }
 
index 6614c0bb8c17d71c11a6b135cc840d1b45375815..986199e8336fb85b42367be486ab7df03c86ba89 100644 (file)
@@ -50,7 +50,7 @@ main()
   plot_FE_Nedelec_shape_functions<2>();
   deallog << "FE_Nedelec<3>" << std::endl;
   plot_FE_Nedelec_shape_functions<3>();
-  
+
   return 0;
 }
 
index fc44827558461f30266031dbc69b441ebb66374d..027729e873713dba25d6ad31ad7d75c9bb8e6910 100644 (file)
@@ -40,8 +40,8 @@ void plot_FE_Q_shape_functions()
   plot_face_shape_functions(m, q2, "Q2");
   test_compute_functions(m, q2, "Q2");
 
-                                  // skip the following tests to
-                                  // reduce run-time
+  // skip the following tests to
+  // reduce run-time
   if (dim < 3)
     {
       FE_Q<dim> q3(3);
@@ -54,7 +54,7 @@ void plot_FE_Q_shape_functions()
       plot_face_shape_functions(m, q4, "Q4");
       test_compute_functions(m, q4, "Q4");
     };
-  
+
 //    FE_Q<dim> q5(5);
 //    plot_shape_functions(m, q5, "Q5");
 //    FE_Q<dim> q6(6);
@@ -78,11 +78,11 @@ main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   plot_FE_Q_shape_functions<1>();
   plot_FE_Q_shape_functions<2>();
   plot_FE_Q_shape_functions<3>();
-  
+
   return 0;
 }
 
index c97964f14384254d138f627d00deebff791be0e2..05092ee3efc97a1e0db15d42d8b74426968ae098 100644 (file)
@@ -40,8 +40,8 @@ void plot_FE_Q_DG0_shape_functions()
   plot_face_shape_functions(m, q2, "Q2_DG0");
   test_compute_functions(m, q2, "Q2_DG0");
 
-                                  // skip the following tests to
-                                  // reduce run-time
+  // skip the following tests to
+  // reduce run-time
   if (dim < 3)
     {
       FE_Q_DG0<dim> q3(3);
@@ -54,7 +54,7 @@ void plot_FE_Q_DG0_shape_functions()
       plot_face_shape_functions(m, q4, "Q4_DG0");
       test_compute_functions(m, q4, "Q4_DG0");
     };
-  
+
 //    FE_Q<dim> q5(5);
 //    plot_shape_functions(m, q5, "Q5");
 //    FE_Q<dim> q6(6);
@@ -78,11 +78,11 @@ main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   plot_FE_Q_DG0_shape_functions<1>();
   plot_FE_Q_DG0_shape_functions<2>();
   plot_FE_Q_DG0_shape_functions<3>();
-  
+
   return 0;
 }
 
index 8bd32c22321f37a216ecbce79a8a3acd7b224494..c54568581024b0978e28dcaa82e013e8f51e0ca0 100644 (file)
@@ -40,8 +40,8 @@ void plot_FE_Q_Hierarchical_shape_functions()
   plot_face_shape_functions(m, q2, "QHierarchical2");
   test_compute_functions(m, q2, "QHierarchical2");
 
-                                  // skip the following tests to
-                                  // reduce run-time
+  // skip the following tests to
+  // reduce run-time
   if (dim < 3)
     {
       FE_Q_Hierarchical<dim> q3(3);
@@ -69,7 +69,7 @@ main()
   plot_FE_Q_Hierarchical_shape_functions<1>();
   plot_FE_Q_Hierarchical_shape_functions<2>();
   plot_FE_Q_Hierarchical_shape_functions<3>();
-  
+
   return 0;
 }
 
index 98ec92c0c0503ae573594cb8b97ebc29eaf57eff..b5c489f44b4c94ab6ee4232dd455baf0e206b3ba 100644 (file)
@@ -40,8 +40,8 @@ void plot_FE_Q_shape_functions()
   plot_face_shape_functions(m, q2, "Q2_iso_Q1");
   test_compute_functions(m, q2, "Q2_iso_Q1");
 
-                                  // skip the following tests to
-                                  // reduce run-time
+  // skip the following tests to
+  // reduce run-time
   if (dim < 3)
     {
       FE_Q_iso_Q1<dim> q3(3);
index a818d7be9427e70951461c1563cbc9839446ff0a..842f28097b5f015683df74e45a0a1b3b180c1116 100644 (file)
@@ -48,16 +48,16 @@ void plot_FE_System_shape_functions()
 //   plot_face_shape_functions(m, p2, "System2");
 //   test_compute_functions(m, p2, "System2");
 
-                                   // some tests with the Nedelec
-                                   // element. don't try to make sense
-                                   // out of the composed elements,
-                                   // they are simply constructed as
-                                   // complicated as possible to
-                                   // trigger as many assertions as
-                                   // possible (and they _have_, in
-                                   // the past, literally dozens of
-                                   // assertions)
-  if (dim != 1) 
+  // some tests with the Nedelec
+  // element. don't try to make sense
+  // out of the composed elements,
+  // they are simply constructed as
+  // complicated as possible to
+  // trigger as many assertions as
+  // possible (and they _have_, in
+  // the past, literally dozens of
+  // assertions)
+  if (dim != 1)
     {
       FESystem<dim> p3(FE_Nedelec<dim>(1), 1,
                        FESystem<dim> (FE_Q<dim>(1),1,
@@ -66,8 +66,8 @@ void plot_FE_System_shape_functions()
                        FE_DGQ<dim>(0), 2);
       test_compute_functions(m, p3, "System_Nedelec_1");
 
-                                       // the following is simply too
-                                       // expensive in 3d...
+      // the following is simply too
+      // expensive in 3d...
       if (dim != 3)
         {
           FESystem<dim> p4(p3, 1,
@@ -95,7 +95,7 @@ main()
   plot_FE_System_shape_functions<2>();
   deallog << "FE_System<3>" << std::endl;
   plot_FE_System_shape_functions<3>();
-  
+
   return 0;
 }
 
index 277ed08f5696c16a8e668b8bb87f1d76bc81ae18..7122153e80b754315a6692f06debd82eaeeec4b4 100644 (file)
@@ -44,7 +44,7 @@ check(const FiniteElement<dim> &fe1,
       const FiniteElement<dim> &fe2)
 {
   deallog << fe1.get_name () << " to " << fe2.get_name ()
-         << std::endl;
+          << std::endl;
 
   FullMatrix<float> m (fe2.dofs_per_cell,
                        fe1.dofs_per_cell);
@@ -54,25 +54,25 @@ check(const FiniteElement<dim> &fe1,
     {
       for (unsigned int j=0; j<m.n(); ++j)
         deallog << m(i,j) << ' ';
-      
+
       deallog << std::endl;
     }
-  
+
   deallog << std::endl;
 }
 
 
 
 #define CHECK_SYS1(sub1_1,N1_1,sub2_1,N2_1,dim) \
- { FESystem<dim> fe1(sub1_1, N1_1);   \
-   FESystem<dim> fe2(sub2_1, N2_1);   \
-   check(fe1, fe2); \
-   check(fe2, fe1); \
- }
 { FESystem<dim> fe1(sub1_1, N1_1);   \
+    FESystem<dim> fe2(sub2_1, N2_1);   \
+    check(fe1, fe2); \
+    check(fe2, fe1); \
 }
 
 #define CHECK_SYS3(sub1,N1,sub2,N2,sub3,N3,dim)   \
- { FESystem<dim> q(sub1, N1, sub2, N2, sub3, N3); \
-   check(q, q); }
 { FESystem<dim> q(sub1, N1, sub2, N2, sub3, N3); \
+    check(q, q); }
 
 
 int
@@ -80,7 +80,7 @@ main()
 {
   std::ofstream logfile ("system_01/output");
   deallog << std::setprecision(PRECISION);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
@@ -106,19 +106,19 @@ main()
              FE_DGQ<3>(3),2,
              3);
 
-                                   // systems in 1d
+  // systems in 1d
   CHECK_SYS3(FE_Q<1>(1),  3,FE_DGQ<1>(3),1,FE_Q<1>(1),3,1);
   CHECK_SYS3(FE_DGQ<1>(2),2,FE_DGQ<1>(2),2,FE_Q<1>(3),3,1);
   CHECK_SYS3(FE_DGQ<1>(3),1,FE_DGQ<1>(3),1,FE_Q<1>(2),3,1);
 
-                                   // systems in 2d
+  // systems in 2d
   CHECK_SYS3(FE_Q<2>(1),  3,FE_DGQ<2>(3),1,FE_Q<2>(1),3,2);
   CHECK_SYS3(FE_DGQ<2>(2),2,FE_DGQ<2>(2),2,FE_Q<2>(3),3,2);
 
-                                   // systems in 3d
+  // systems in 3d
   CHECK_SYS3(FE_Q<3>(1),  3,FE_DGQ<3>(3),1,FE_Q<3>(1),3,3);
 
-                                   // systems of systems  
+  // systems of systems
   CHECK_SYS3((FESystem<2>(FE_Q<2>(1),3)), 3,
              FE_DGQ<2>(3), 1,
              FE_Q<2>(1), 3,
index 385a1bed22e95f5eb29ca00e2d8200c57897e1df..3ada616a3166823b5034d1e91d19c11f05961d08 100644 (file)
@@ -49,7 +49,7 @@ main()
 {
   std::ofstream logfile ("system_02/output");
   deallog << std::setprecision(PRECISION);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
@@ -70,7 +70,7 @@ main()
     FESystem<2> fe(FESystem<2>(FE_Q<2>(1), 2), 1, FE_DGQ<2>(2),0, FE_Q<2>(1), 1);
     check<2>(fe);
   }
-  
+
   return 0;
 }
 
index c4c208bd756a25c16f7ece3dd2f351f21c40e8e5..f9e8465bdda52b6cd2b7ca3a3a7a1b38b10b7f68 100644 (file)
@@ -41,64 +41,64 @@ check_fe(const FiniteElement<dim> &fe)
   const unsigned int n_base = fe.n_base_elements();
   const unsigned int n_comp = fe.n_components();
   const unsigned int n_blocks = fe.n_blocks();
-  
+
   deallog << "Base elements:  " << n_base
-         << std::endl
-         << "Multiplicities:";
-  for (unsigned int b=0;b<n_base;++b)
+          << std::endl
+          << "Multiplicities:";
+  for (unsigned int b=0; b<n_base; ++b)
     deallog << ' ' << fe.element_multiplicity(b);
   deallog << std::endl
-         << "First block   :";
-  for (unsigned int b=0;b<n_base;++b)
+          << "First block   :";
+  for (unsigned int b=0; b<n_base; ++b)
     deallog << ' ' << fe.first_block_of_base(b);
-  
+
   deallog << std::endl << "Blocks : " << n_blocks << std::endl;
-  
-  for (unsigned int i=0;i<n_dofs;++i)
+
+  for (unsigned int i=0; i<n_dofs; ++i)
     {
       deallog << std::setw(3) << i;
-                                      // Cehck consistency of
-                                      // functions and inverse
+      // Cehck consistency of
+      // functions and inverse
       std::pair<unsigned int, unsigned int> p;
       if (fe.is_primitive(i))
-       {
-         p = fe.system_to_component_index(i);
-         Assert(fe.component_to_system_index(p.first, p.second) == i,
-                ExcInternalError());
-       }
+        {
+          p = fe.system_to_component_index(i);
+          Assert(fe.component_to_system_index(p.first, p.second) == i,
+                 ExcInternalError());
+        }
     }
-  
+
   deallog << std::endl;
-  
+
   deallog << "Next two lines: block index_in_block"
-         << std::endl;
-  for (unsigned int i=0;i<n_dofs;++i)
+          << std::endl;
+  for (unsigned int i=0; i<n_dofs; ++i)
     deallog << std::setw(3) << fe.system_to_block_index(i).first;
   deallog << std::endl;
-  for (unsigned int i=0;i<n_dofs;++i)
+  for (unsigned int i=0; i<n_dofs; ++i)
     deallog << std::setw(3) << fe.system_to_block_index(i).second;
   deallog << std::endl;
   deallog << "Next three lines: base block_in_base index_in_block"
-         << std::endl;
-  for (unsigned int i=0;i<n_dofs;++i)
+          << std::endl;
+  for (unsigned int i=0; i<n_dofs; ++i)
     deallog << std::setw(3) << fe.system_to_base_index(i).first.first;
   deallog << std::endl;
-  for (unsigned int i=0;i<n_dofs;++i)
+  for (unsigned int i=0; i<n_dofs; ++i)
     deallog << std::setw(3) << fe.system_to_base_index(i).first.second;
   deallog << std::endl;
-  for (unsigned int i=0;i<n_dofs;++i)
+  for (unsigned int i=0; i<n_dofs; ++i)
     deallog << std::setw(3) << fe.system_to_base_index(i).second;
   deallog << std::endl;
 
   deallog << "Next two lines: component index_in_component"
-         << std::endl;
-  for (unsigned int i=0;i<n_dofs;++i)
+          << std::endl;
+  for (unsigned int i=0; i<n_dofs; ++i)
     if (fe.is_primitive(i))
       deallog << std::setw(3) << fe.system_to_component_index(i).first;
     else
       deallog << std::setw(3) << 'x';
   deallog << std::endl;
-  for (unsigned int i=0;i<n_dofs;++i)
+  for (unsigned int i=0; i<n_dofs; ++i)
     if (fe.is_primitive(i))
       deallog << std::setw(3) << fe.system_to_component_index(i).second;
     else
@@ -108,18 +108,18 @@ check_fe(const FiniteElement<dim> &fe)
   if (true || fe.is_primitive())
     {
       deallog << "Next two lines: component_to_base" << std::endl;
-      for (unsigned int i=0;i<n_comp;++i)
-       deallog << std::setw(3) << fe.component_to_base_index(i).first;
+      for (unsigned int i=0; i<n_comp; ++i)
+        deallog << std::setw(3) << fe.component_to_base_index(i).first;
       deallog << std::endl;
-      for (unsigned int i=0;i<n_comp;++i)
-       deallog << std::setw(3) << fe.component_to_base_index(i).second;
+      for (unsigned int i=0; i<n_comp; ++i)
+        deallog << std::setw(3) << fe.component_to_base_index(i).second;
       deallog << std::endl;
       deallog << "Next line: component_to_block_index" << std::endl;
-      for (unsigned int i=0;i<n_comp;++i)
-       deallog << std::setw(3) << fe.component_to_block_index(i);
+      for (unsigned int i=0; i<n_comp; ++i)
+        deallog << std::setw(3) << fe.component_to_block_index(i);
       deallog << std::endl;
-      
-    }  
+
+    }
 }
 
 
@@ -152,14 +152,14 @@ main()
 {
   std::ofstream logfile ("system_index/output");
   deallog << std::setprecision(PRECISION);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
   check<2>();
   check<3>();
-  
+
   return 0;
 }
 
index e57e4908da8268d7606573ffcdc3b0855c4219bb..7d36faae7d87be39d0a06111d40e7d77e7440364 100644 (file)
@@ -34,8 +34,8 @@ void check (const FiniteElement<dim> &fe)
 {
   const unsigned int dofs_per_cell = fe.dofs_per_cell;
 
-                                  // first check whether shape
-                                  // functions are primitive:
+  // first check whether shape
+  // functions are primitive:
   deallog << "  Primitivity: ";
   for (unsigned int i=0; i<dofs_per_cell; ++i)
     deallog << (fe.is_primitive(i) ? 1 : 0);
@@ -43,29 +43,29 @@ void check (const FiniteElement<dim> &fe)
 
   deallog << "  Overall primitivity: " << fe.is_primitive() << std::endl;
 
-                                  // then check n_nonzero_components
+  // then check n_nonzero_components
   deallog << "  n_nonzero_components: ";
   for (unsigned int i=0; i<dofs_per_cell; ++i)
     deallog << fe.n_nonzero_components(i);
   deallog << std::endl;
 
-                                  // finally check component pattern
-                                  // for each shape function
+  // finally check component pattern
+  // for each shape function
   deallog << "  component pattern for each shape function:" << std::endl;
   for (unsigned int i=0; i<dofs_per_cell; ++i)
     {
       deallog << "    shape function i=" << i
-             << " [" << fe.system_to_component_index(i).first
-             << ','
-             << fe.system_to_component_index(i).second
-             << "]: ";
-                      
+              << " [" << fe.system_to_component_index(i).first
+              << ','
+              << fe.system_to_component_index(i).second
+              << "]: ";
+
       for (unsigned int j=0; j<fe.n_components(); ++j)
-       {
-         Assert (fe.get_nonzero_components(i).size() == fe.n_components(),
-                 ExcInternalError());
-         deallog << (fe.get_nonzero_components(i)[j] ? 1 : 0);
-       };
+        {
+          Assert (fe.get_nonzero_components(i).size() == fe.n_components(),
+                  ExcInternalError());
+          deallog << (fe.get_nonzero_components(i)[j] ? 1 : 0);
+        };
       deallog << std::endl;
     };
 }
@@ -75,49 +75,49 @@ void check (const FiniteElement<dim> &fe)
 template <int dim>
 void check ()
 {
-                                  // check usual Lagrange elements
+  // check usual Lagrange elements
   for (unsigned int p=1; p<3; ++p)
     {
       deallog << "Checking FE_Q<" << dim << ">(" << p << "): "
-             << std::endl;
+              << std::endl;
       check (FE_Q<dim>(p));
     };
 
-                                  // check DG Lagrange elements
+  // check DG Lagrange elements
   for (unsigned int p=0; p<3; ++p)
     {
       deallog << "Checking FE_DGQ<" << dim << ">(" << p << "): "
-             << std::endl;
+              << std::endl;
       check (FE_DGQ<dim>(p));
     };
 
-                                  // check DG-P elements
+  // check DG-P elements
   for (unsigned int p=0; p<3; ++p)
     {
       deallog << "Checking FE_DGP<" << dim << ">(" << p << "): "
-             << std::endl;
+              << std::endl;
       check (FE_DGP<dim>(p));
     };
 
-                                  // check systems of Q-elements
+  // check systems of Q-elements
   for (unsigned int p=1; p<3; ++p)
     {
       deallog << "Checking FE_Q<" << dim << ">(" << p << ")^2: "
-             << std::endl;
+              << std::endl;
       check (FESystem<dim> (FE_Q<dim>(p),2));
     };
 
-                                  // check systems of systems of
-                                  // Q-elements
+  // check systems of systems of
+  // Q-elements
   for (unsigned int p=1; p<3; ++p)
     {
       deallog << "Checking FE_Q<" << dim << ">(" << p << ")^2^2: "
-             << std::endl;
+              << std::endl;
       check (FESystem<dim> (FESystem<dim> (FE_Q<dim>(p),2), 2));
     };
 }
 
-  
+
 
 
 int main ()
index c5652d1f03cad26ece083a375b5d462c11210fbe..e78c091611bf034a5ab47d04ab90496bc3851555 100644 (file)
 
 
 #define TEST(dim, l, el, deg) { el<dim> fe(deg); \
-  deallog << # el << '<' << dim << ">(" << deg << ')' << std::endl; \
-  print_matrix(tr ## dim, l, fe, #el); }
+    deallog << # el << '<' << dim << ">(" << deg << ')' << std::endl; \
+    print_matrix(tr ## dim, l, fe, #el); }
 
 template<int dim>
 inline void
-print_matrix(Triangulation<dim>tr,
-            unsigned int level,
-            const FiniteElement<dim>& finel,
-            const char* /*name*/)
+print_matrix(Triangulation<dim> &tr,
+             unsigned int level,
+             const FiniteElement<dim> &finel,
+             const char * /*name*/)
 {
   MGDoFHandler<dim> dof(tr);
   dof.distribute_dofs(finel);
@@ -58,14 +58,14 @@ print_matrix(Triangulation<dim>& tr,
   Vector<double> in(n_fine);
   Vector<double> out(n_coarse);
 
-  for (unsigned int i=0;i<n_fine;++i)
+  for (unsigned int i=0; i<n_fine; ++i)
     {
       in = 0.;
       out = 0.;
       in(i) = 1.;
       transfer.restrict_and_add(level,out,in);
-      for (unsigned int k=0;k<out.size();++k)
-       deallog << '\t' << out(k);
+      for (unsigned int k=0; k<out.size(); ++k)
+        deallog << '\t' << out(k);
       deallog << std::endl;
     }
   deallog << std::endl;
@@ -80,7 +80,7 @@ main()
   deallog << std::setprecision(3);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   Triangulation<2> tr2;
 
   GridGenerator::hyper_cube(tr2, -1., 1.);
index 9a58d8794a4318f17f58de586d80ffe83d0b4205..cfe9f4211e70e30785855ee9da2e3fd4ad497c46 100644 (file)
 template <int dim>
 Point<dim> transform (const Point<dim> p)
 {
-  switch (dim) 
+  switch (dim)
     {
-      case 1:
-            return p;
-      case 2:
-            return Point<dim>(p(0)*(1+p(1)), p(1)*(1+p(0)));
-      case 3:
-            return Point<dim>(p(0)*(1+p(1))*(1+p(2)),
-                              p(1)*(1+p(0))*(1+p(2)),
-                              p(2)*(1+p(0))*(1+p(1)));
-      default:
-            Assert (false, ExcNotImplemented());
-            return Point<dim>();
+    case 1:
+      return p;
+    case 2:
+      return Point<dim>(p(0)*(1+p(1)), p(1)*(1+p(0)));
+    case 3:
+      return Point<dim>(p(0)*(1+p(1))*(1+p(2)),
+                        p(1)*(1+p(0))*(1+p(2)),
+                        p(2)*(1+p(0))*(1+p(1)));
+    default:
+      Assert (false, ExcNotImplemented());
+      return Point<dim>();
     };
 }
 
@@ -65,17 +65,17 @@ void check_element (const Triangulation<dim> &tr,
   DoFHandler<dim> dof_handler(tr);
   dof_handler.distribute_dofs (fe);
 
-                                   // create a mostly arbitrary
-                                   // function plus a trend on this
-                                   // grid
+  // create a mostly arbitrary
+  // function plus a trend on this
+  // grid
   Vector<double> tmp(dof_handler.n_dofs());
   for (unsigned int i=0; i<tmp.size(); ++i)
     tmp(i) = i;//(i + 13*i%17);
 
-                                   // restrict this function to the
-                                   // next coarser level and
-                                   // distribute it again to the
-                                   // higher level
+  // restrict this function to the
+  // next coarser level and
+  // distribute it again to the
+  // higher level
   Vector<double> x(tmp.size());
   Vector<double> v(fe.dofs_per_cell);
   for (typename DoFHandler<dim>::cell_iterator cell=dof_handler.begin();
@@ -83,24 +83,24 @@ void check_element (const Triangulation<dim> &tr,
     if (cell->has_children() &&
         cell->child(0)->active())
       {
-                                         // first make sure that what
-                                         // we do is reasonable. for
-                                         // this, _all_ children have
-                                         // to be active, not only
-                                         // some of them
+        // first make sure that what
+        // we do is reasonable. for
+        // this, _all_ children have
+        // to be active, not only
+        // some of them
         for (unsigned int c=0; c<GeometryInfo<dim>::max_children_per_cell; ++c)
           Assert (cell->child(c)->active(), ExcInternalError());
 
-                                         // then restrict and prolongate
+        // then restrict and prolongate
         cell->get_interpolated_dof_values (tmp, v);
         cell->set_dof_values_by_interpolation (v, x);
       };
 
-                                   // now x is a function on the fine
-                                   // grid that is representable on
-                                   // the coarse grid. so another
-                                   // cycle should not alter it any
-                                   // more:
+  // now x is a function on the fine
+  // grid that is representable on
+  // the coarse grid. so another
+  // cycle should not alter it any
+  // more:
   Vector<double> x2(x.size());
   for (typename DoFHandler<dim>::cell_iterator cell=dof_handler.begin();
        cell!=dof_handler.end(); ++cell)
@@ -111,7 +111,7 @@ void check_element (const Triangulation<dim> &tr,
         cell->set_dof_values_by_interpolation (v, x2);
       };
 
-                                   // then check that this is so:
+  // then check that this is so:
   x2 -= x;
   const double relative_residual = (x2.l2_norm() / x.l2_norm());
 
@@ -121,115 +121,115 @@ void check_element (const Triangulation<dim> &tr,
           << (relative_residual<threshold ? "ok" : "botched up!")
           << std::endl;
 
-//TODO:[WB] Why this exception with a value different from above. Output of the error should be sufficient!  
+//TODO:[WB] Why this exception with a value different from above. Output of the error should be sufficient!
 //  Assert (relative_residual < threshold*x.l2_norm(), ExcInternalError());
 }
 
 
 template <int dim>
-void test () 
+void test ()
 {
-                                   // make a coarse triangulation as a
-                                   // hypercube. if in more than 1d,
-                                   // distort it so that it is no more
-                                   // an affine image of the
-                                   // hypercube, to make things more
-                                   // difficult. then refine it twice
+  // make a coarse triangulation as a
+  // hypercube. if in more than 1d,
+  // distort it so that it is no more
+  // an affine image of the
+  // hypercube, to make things more
+  // difficult. then refine it twice
   Triangulation<dim> tr;
   GridGenerator::hyper_cube(tr, 0., 1.);
   Point<dim> (*p) (Point<dim>) = &transform<dim>;
   GridTools::transform (p, tr);
   tr.refine_global (2);
 
-                                   // now for a list of finite
-                                   // elements, for which we want to
-                                   // test. we happily waste tons of
-                                   // memory here, but who cares...
+  // now for a list of finite
+  // elements, for which we want to
+  // test. we happily waste tons of
+  // memory here, but who cares...
   const FiniteElement<dim> *fe_list[]
-    = 
-    {
-                                           // first for some scalar
-                                           // elements:
-
-                                           // FE_Q
-          new FE_Q<dim>(1),
-          new FE_Q<dim>(2),
-          (dim<3 ? new FE_Q<dim>(3) : 0),
-          (dim<2 ? new FE_Q<dim>(4) : 0),
-          
-                                           // FE_DGQ
-          new FE_DGQ<dim>(0),
-          new FE_DGQ<dim>(1),
-          new FE_DGQ<dim>(2),
-          (dim<3 ? new FE_DGQ<dim>(3) : 0),
-          (dim<3 ? new FE_DGQ<dim>(4) : 0),
-
-                                           // FE_DGP does not
-                                           // presently have the
-                                           // restriction matrices
-                                           // implemented, so comment
-                                           // out the following
-                                           // tests...
+  =
+  {
+    // first for some scalar
+    // elements:
+
+    // FE_Q
+    new FE_Q<dim>(1),
+    new FE_Q<dim>(2),
+    (dim<3 ? new FE_Q<dim>(3) : 0),
+    (dim<2 ? new FE_Q<dim>(4) : 0),
+
+    // FE_DGQ
+    new FE_DGQ<dim>(0),
+    new FE_DGQ<dim>(1),
+    new FE_DGQ<dim>(2),
+    (dim<3 ? new FE_DGQ<dim>(3) : 0),
+    (dim<3 ? new FE_DGQ<dim>(4) : 0),
+
+    // FE_DGP does not
+    // presently have the
+    // restriction matrices
+    // implemented, so comment
+    // out the following
+    // tests...
 //           new FE_DGP<dim>(0),
 //           new FE_DGP<dim>(1),
 //           new FE_DGP<dim>(2),
 //           new FE_DGP<dim>(3),
 
-                                           // a non-primitive FE
-          (dim != 1 ? new FE_Nedelec<dim>(0) : 0),
-          (dim != 1 ? new FE_Nedelec<dim>(1) : 0),
-
-                                           // some composed elements
-                                           // of increasing
-                                           // complexity, to check the
-                                           // logics by which the
-                                           // matrices of the composed
-                                           // elements are assembled
-                                           // from those of the base
-                                           // elements. note that some
-                                           // of the base elements are
-                                           // additive, some not, so
-                                           // the result will be an
-                                           // element that is mixed in
-                                           // this respect
-          new FESystem<dim> (FE_Q<dim>(2), 2),
-          new FESystem<dim> (FE_Q<dim>(1), 2,
-                             FE_DGQ<dim>(2), 2),
-          new FESystem<dim> (FE_Q<dim>(1), 2,
-                             FE_DGQ<dim>(2), 2,
-                             FE_DGQ<dim>(0), 1),
-          new FESystem<dim> (FE_Q<dim>(1), 2,
-                             FESystem<dim> (FE_Q<dim>(1), 2,
-                                            FE_DGQ<dim>(2), 2,
-                                            FE_DGQ<dim>(2), 1), 2,
-                             FE_DGQ<dim>(0), 1),
-          new FESystem<dim> (FE_Q<dim>(1), 2,
-                             FESystem<dim> (FE_Q<dim>(1), 2,
-                                            FE_DGQ<dim>(2), 2,
-                                            FESystem<dim>(FE_DGQ<dim>(0),
-                                                          3),
-                                            1), 2,
-                             FE_DGQ<dim>(0), 1),
-
-                                           // finally mixed elements,
-                                           // with scalar and Nedelec
-                                           // elements, to make things
-                                           // really difficult
-          (dim != 1 ?
-           new FESystem<dim>(FE_Nedelec<dim>(0), 2)
-           : 0),
-          (dim != 1 ?
-           new FESystem<dim>(FE_Nedelec<dim>(0), 2,
-                             FE_Q<dim> (2), 2)
-           : 0),
-          (dim != 1 ?
-           new FESystem<dim>(FE_Nedelec<dim>(0), 2,
-                             FE_DGQ<dim> (2), 2,
-                             FESystem<dim>(FE_Nedelec<dim>(0), 2,
-                                           FE_Q<dim> (2), 2), 2)
-           : 0),          
-    };
-  
+    // a non-primitive FE
+    (dim != 1 ? new FE_Nedelec<dim>(0) : 0),
+    (dim != 1 ? new FE_Nedelec<dim>(1) : 0),
+
+    // some composed elements
+    // of increasing
+    // complexity, to check the
+    // logics by which the
+    // matrices of the composed
+    // elements are assembled
+    // from those of the base
+    // elements. note that some
+    // of the base elements are
+    // additive, some not, so
+    // the result will be an
+    // element that is mixed in
+    // this respect
+    new FESystem<dim> (FE_Q<dim>(2), 2),
+    new FESystem<dim> (FE_Q<dim>(1), 2,
+    FE_DGQ<dim>(2), 2),
+    new FESystem<dim> (FE_Q<dim>(1), 2,
+    FE_DGQ<dim>(2), 2,
+    FE_DGQ<dim>(0), 1),
+    new FESystem<dim> (FE_Q<dim>(1), 2,
+    FESystem<dim> (FE_Q<dim>(1), 2,
+    FE_DGQ<dim>(2), 2,
+    FE_DGQ<dim>(2), 1), 2,
+    FE_DGQ<dim>(0), 1),
+    new FESystem<dim> (FE_Q<dim>(1), 2,
+    FESystem<dim> (FE_Q<dim>(1), 2,
+    FE_DGQ<dim>(2), 2,
+    FESystem<dim>(FE_DGQ<dim>(0),
+    3),
+    1), 2,
+    FE_DGQ<dim>(0), 1),
+
+    // finally mixed elements,
+    // with scalar and Nedelec
+    // elements, to make things
+    // really difficult
+    (dim != 1 ?
+    new FESystem<dim>(FE_Nedelec<dim>(0), 2)
+    : 0),
+    (dim != 1 ?
+    new FESystem<dim>(FE_Nedelec<dim>(0), 2,
+    FE_Q<dim> (2), 2)
+    : 0),
+    (dim != 1 ?
+    new FESystem<dim>(FE_Nedelec<dim>(0), 2,
+    FE_DGQ<dim> (2), 2,
+    FESystem<dim>(FE_Nedelec<dim>(0), 2,
+    FE_Q<dim> (2), 2), 2)
+    : 0),
+  };
+
   for (unsigned int i=0; i<sizeof(fe_list)/sizeof(fe_list[0]); ++i)
     if (fe_list[i] != 0)
       {
@@ -245,15 +245,15 @@ main()
 {
   std::ofstream logfile ("up_and_down/output");
   deallog << std::setprecision(PRECISION);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1>();
   test<2>();
   test<3>();
-  
+
   return 0;
 }
 
index 3b82efd26d96c1fe4edd5a9fee8061158dc8914c..e71a50da03fb58b219f06dc1229733b0769a50a5 100644 (file)
 
 #include "gla.h"
 
-template <class LA> 
+template <class LA>
 void test ()
 {
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
   unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
-  
+
   if (myid==0)
     deallog << "numproc=" << numproc << std::endl;
 
   IndexSet block1(10);
   if (numproc==1)
     block1.add_range(0,10);
-  
+
   if (myid==0)
     block1.add_range(0,7);
   if (myid==1)
@@ -49,7 +49,7 @@ void test ()
   IndexSet block2(5);
   if (numproc==1)
     block2.add_range(0,5);
-  
+
   if (myid==0)
     block2.add_range(0,2);
   if (myid==1)
@@ -59,17 +59,17 @@ void test ()
   std::vector<IndexSet> partitioning;
   partitioning.push_back(block1);
   partitioning.push_back(block2);
-  
+
   //LA::MPI::CompressedBlockSparsityPattern sp(partitioning);
   BlockCompressedSimpleSparsityPattern sp(partitioning);
-  for (unsigned int i=0;i<15;++i)
+  for (unsigned int i=0; i<15; ++i)
     {
       sp.add(i,i);
       sp.add(i,1);
     }
   sp.compress();
 
-  typename LA::MPI::BlockSparseMatrix matrix;  
+  typename LA::MPI::BlockSparseMatrix matrix;
   matrix.reinit (partitioning, sp, MPI_COMM_WORLD);
 
   matrix.add(1,1,1.3);
@@ -81,8 +81,8 @@ void test ()
       deallog << "(0,0) = " << matrix(0,0) << std::endl;
       deallog << "(1,1) = " << matrix(1,1) << std::endl;
     }
-                                  // done
+
+  // done
   if (myid==0)
     deallog << "OK" << std::endl;
 }
@@ -94,18 +94,18 @@ int main (int argc, char **argv)
   Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
   MPILogInitAll log(__FILE__);
 
-  {    
+  {
     deallog.push("PETSc");
     test<LA_PETSc>();
-    deallog.pop();     
+    deallog.pop();
     deallog.push("Trilinos");
     test<LA_Trilinos>();
-    deallog.pop();     
+    deallog.pop();
   }
-  
+
   // compile, don't run
   //if (myid==9999)
-    //  test<LA_Dummy>();
-  
+  //  test<LA_Dummy>();
+
 
 }
index bda049bc6e56f5c428c284fc18c3c4ed02860938..9bf677ab10ac8df941783c29a0080ba92a74b8e8 100644 (file)
 
 #include "gla.h"
 
-template <class LA, int dim> 
+template <class LA, int dim>
 void test ()
 {
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
   unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
-  
+
   if (myid==0)
     deallog << "numproc=" << numproc << std::endl;
 
 
   parallel::distributed::Triangulation<dim>
-    triangulation (MPI_COMM_WORLD,
-                     typename Triangulation<dim>::MeshSmoothing
-                     (Triangulation<dim>::smoothing_on_refinement |
-                      Triangulation<dim>::smoothing_on_coarsening));
+  triangulation (MPI_COMM_WORLD,
+                 typename Triangulation<dim>::MeshSmoothing
+                 (Triangulation<dim>::smoothing_on_refinement |
+                  Triangulation<dim>::smoothing_on_coarsening));
 
   GridGenerator::hyper_cube(triangulation);
   triangulation.refine_global(2);
 
   const FESystem<dim> stokes_fe(FE_Q<dim>(1),
-                               1,FE_DGP<dim>(0),1);
-  
-  
+                                1,FE_DGP<dim>(0),1);
+
+
   DoFHandler<dim> stokes_dof_handler(triangulation);
   std::vector<unsigned int> stokes_sub_blocks (1+1,0);
   stokes_sub_blocks[1] = 1;
@@ -75,10 +75,10 @@ void test ()
 
   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);
+                                  stokes_sub_blocks);
 
   const unsigned int n_u = stokes_dofs_per_block[0],
-                    n_p = stokes_dofs_per_block[1];
+                     n_p = stokes_dofs_per_block[1];
 
   std::vector<IndexSet> stokes_partitioning, stokes_relevant_partitioning;
 
@@ -88,38 +88,38 @@ void test ()
 
   IndexSet stokes_relevant_set;
   DoFTools::extract_locally_relevant_dofs (stokes_dof_handler,
-                                          stokes_relevant_set);
+                                           stokes_relevant_set);
   stokes_relevant_partitioning.push_back(stokes_relevant_set.get_view(0,n_u));
   stokes_relevant_partitioning.push_back(stokes_relevant_set.get_view(n_u,n_u+n_p));
 
   stokes_relevant_set.print(deallog.get_file_stream());
-  
+
   ConstraintMatrix cm(stokes_relevant_set);
-      
+
   DoFTools::make_hanging_node_constraints (stokes_dof_handler,
-                                               cm);
+                                           cm);
 
   //boundary conditions ?
   cm.close();
 
-      
+
   BlockCompressedSimpleSparsityPattern sp(stokes_relevant_partitioning);
 
   Table<2,DoFTools::Coupling> coupling (1+1, 1+1);
-    coupling[0][0] = DoFTools::always;
-    coupling[1][1] = DoFTools::always;
-    coupling[0][1] = DoFTools::always;
+  coupling[0][0] = DoFTools::always;
+  coupling[1][1] = DoFTools::always;
+  coupling[0][1] = DoFTools::always;
 
-    DoFTools::make_sparsity_pattern (stokes_dof_handler,
-        coupling, sp,
-        cm, false,
-        Utilities::MPI::this_mpi_process(MPI_COMM_WORLD));
+  DoFTools::make_sparsity_pattern (stokes_dof_handler,
+                                   coupling, sp,
+                                   cm, false,
+                                   Utilities::MPI::this_mpi_process(MPI_COMM_WORLD));
+
+  SparsityTools::distribute_sparsity_pattern(sp,
+                                             stokes_dof_handler.n_locally_owned_dofs_per_processor(),
+                                             MPI_COMM_WORLD, stokes_relevant_set);
 
-    SparsityTools::distribute_sparsity_pattern(sp,
-                                              stokes_dof_handler.n_locally_owned_dofs_per_processor(),
-                                              MPI_COMM_WORLD, stokes_relevant_set);
 
-    
   sp.compress();
 
   typename LA::MPI::BlockSparseMatrix stokes_matrix;
@@ -128,36 +128,36 @@ void test ()
   stokes_matrix.print(deallog.get_file_stream());
 
 
-                                  // done
+  // done
   if (myid==0)
     deallog << "OK" << std::endl;
 }
 
-template <int dim> 
+template <int dim>
 void test_LA_Trilinos ()
 {
   typedef LA_Trilinos LA;
-  
+
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
   unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
-  
+
   if (myid==0)
     deallog << "numproc=" << numproc << std::endl;
 
 
   parallel::distributed::Triangulation<dim>
-    triangulation (MPI_COMM_WORLD,
-                     typename Triangulation<dim>::MeshSmoothing
-                     (Triangulation<dim>::smoothing_on_refinement |
-                      Triangulation<dim>::smoothing_on_coarsening));
+  triangulation (MPI_COMM_WORLD,
+                 typename Triangulation<dim>::MeshSmoothing
+                 (Triangulation<dim>::smoothing_on_refinement |
+                  Triangulation<dim>::smoothing_on_coarsening));
 
   GridGenerator::hyper_cube(triangulation);
   triangulation.refine_global(2);
 
   const FESystem<dim> stokes_fe(FE_Q<dim>(1),
-                               1,FE_DGP<dim>(0),1);
-  
-  
+                                1,FE_DGP<dim>(0),1);
+
+
   DoFHandler<dim> stokes_dof_handler(triangulation);
   std::vector<unsigned int> stokes_sub_blocks (1+1,0);
   stokes_sub_blocks[1] = 1;
@@ -166,10 +166,10 @@ void test_LA_Trilinos ()
 
   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);
+                                  stokes_sub_blocks);
 
   const unsigned int n_u = stokes_dofs_per_block[0],
-                    n_p = stokes_dofs_per_block[1];
+                     n_p = stokes_dofs_per_block[1];
 
   std::vector<IndexSet> stokes_partitioning, stokes_relevant_partitioning;
 
@@ -179,35 +179,35 @@ void test_LA_Trilinos ()
 
   IndexSet stokes_relevant_set;
   DoFTools::extract_locally_relevant_dofs (stokes_dof_handler,
-                                          stokes_relevant_set);
+                                           stokes_relevant_set);
   stokes_relevant_partitioning.push_back(stokes_relevant_set.get_view(0,n_u));
   stokes_relevant_partitioning.push_back(stokes_relevant_set.get_view(n_u,n_u+n_p));
   stokes_relevant_set.print(deallog.get_file_stream());
-  
+
   ConstraintMatrix cm(stokes_relevant_set);
-      
+
   DoFTools::make_hanging_node_constraints (stokes_dof_handler,
-                                               cm);
+                                           cm);
 
   //boundary conditions ?
   cm.close();
   TrilinosWrappers::BlockSparsityPattern
-    //typename LA::MPI::CompressedBlockSparsityPattern
-    sp(stokes_partitioning, MPI_COMM_WORLD);
-  
-
-    Table<2,DoFTools::Coupling> coupling (1+1, 1+1);
-
-    coupling[0][0] = DoFTools::always;
-    coupling[1][1] = DoFTools::always;
-    coupling[0][1] = DoFTools::always;
-
-    DoFTools::make_sparsity_pattern (stokes_dof_handler,
-                                     coupling, sp,
-                                     cm, false,
-                                     Utilities::MPI::
-                                     this_mpi_process(MPI_COMM_WORLD));
-    
+  //typename LA::MPI::CompressedBlockSparsityPattern
+  sp(stokes_partitioning, MPI_COMM_WORLD);
+
+
+  Table<2,DoFTools::Coupling> coupling (1+1, 1+1);
+
+  coupling[0][0] = DoFTools::always;
+  coupling[1][1] = DoFTools::always;
+  coupling[0][1] = DoFTools::always;
+
+  DoFTools::make_sparsity_pattern (stokes_dof_handler,
+                                   coupling, sp,
+                                   cm, false,
+                                   Utilities::MPI::
+                                   this_mpi_process(MPI_COMM_WORLD));
+
   sp.compress();
 
   //sp.print(deallog.get_file_stream());
@@ -217,8 +217,8 @@ void test_LA_Trilinos ()
 
   stokes_matrix.print(deallog.get_file_stream());
 
-  
-                                  // done
+
+  // done
   if (myid==0)
     deallog << "OK" << std::endl;
 }
@@ -232,18 +232,18 @@ int main (int argc, char **argv)
   {
     deallog.push("PETSc");
     test<LA_PETSc,2>();
-    deallog.pop();     
+    deallog.pop();
     deallog.push("Trilinos");
     test<LA_Trilinos,2>();
     deallog.pop();
     deallog.push("TrilinosAlt");
     test_LA_Trilinos<2>();
-    deallog.pop();     
+    deallog.pop();
   }
-  
+
   // compile, don't run
   //if (myid==9999)
-    //  test<LA_Dummy>();
-  
+  //  test<LA_Dummy>();
+
 
 }
index e16a415bb211de976dd2f69df013606fe7b0c3e7..e96be453c9f4f0622b85275507b18447e66677a4 100644 (file)
 
 #include "gla.h"
 
-template <class LA> 
+template <class LA>
 void test ()
 {
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
   unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
-  
+
   if (myid==0)
     deallog << "numproc=" << numproc << std::endl;
 
@@ -73,8 +73,8 @@ void test ()
   deallog << "block(1).size: " << v.block(1).size() << std::endl;
   if (block1.n_elements()>0)
     deallog << "my first entry: " << v(block1.nth_index_in_set(0)) << std::endl;
-  
-                                  // done
+
+  // done
   if (myid==0)
     deallog << "OK" << std::endl;
 }
index 09e33607d985544633cbd0ee94c1cbb05db417d9..9fcad3fafbe8f8716ba445e3a864f8f255ae4011 100644 (file)
 
 #include "gla.h"
 
-template <class LA> 
+template <class LA>
 void test ()
 {
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
   unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
-  
+
   if (myid==0)
     deallog << "numproc=" << numproc << std::endl;
 
@@ -77,14 +77,14 @@ void test ()
   cm.add_line(0);
   cm.add_entry(0, 1, 3.0);
   cm.close();
-  
+
   if (myid==0)
     deallog << "before: " << v(0) << std::endl;
   cm.distribute(v); // this should set x(0)= 3.0 * x(1) = 3.0
   if (myid==0)
     deallog << "after: " << v(0) << std::endl;
-  
-                                  // done
+
+  // done
   if (myid==0)
     deallog << "OK" << std::endl;
 }
index 1e0a53a05733dfcf006e727053f620f03f7931d0..9f48457f40bb72e83a52ac6b1e8aa8e77053b4e7 100644 (file)
 
 class LA_PETSc
 {
+public:
+  class MPI
+  {
   public:
-    class MPI
-    {
-      public:
-       typedef LinearAlgebraPETSc::MPI::Vector Vector;
-       typedef LinearAlgebraPETSc::MPI::SparseMatrix SparseMatrix;
-       typedef LinearAlgebraPETSc::MPI::BlockVector BlockVector;
-       typedef LinearAlgebraPETSc::MPI::BlockSparseMatrix BlockSparseMatrix;
-    };
+    typedef LinearAlgebraPETSc::MPI::Vector Vector;
+    typedef LinearAlgebraPETSc::MPI::SparseMatrix SparseMatrix;
+    typedef LinearAlgebraPETSc::MPI::BlockVector BlockVector;
+    typedef LinearAlgebraPETSc::MPI::BlockSparseMatrix BlockSparseMatrix;
+  };
 };
 
 class LA_Trilinos
 {
+public:
+  class MPI
+  {
   public:
-    class MPI
-    {
-      public:
-       typedef LinearAlgebraTrilinos::MPI::Vector Vector;
-       typedef LinearAlgebraTrilinos::MPI::SparseMatrix SparseMatrix;
-       typedef LinearAlgebraTrilinos::MPI::BlockVector BlockVector;
-       typedef LinearAlgebraTrilinos::MPI::BlockSparseMatrix BlockSparseMatrix;
-    };
+    typedef LinearAlgebraTrilinos::MPI::Vector Vector;
+    typedef LinearAlgebraTrilinos::MPI::SparseMatrix SparseMatrix;
+    typedef LinearAlgebraTrilinos::MPI::BlockVector BlockVector;
+    typedef LinearAlgebraTrilinos::MPI::BlockSparseMatrix BlockSparseMatrix;
+  };
 };
 
 class LA_Dummy
 {
+public:
+  class MPI
+  {
   public:
-    class MPI
+    class Vector
+    {
+    public:
+
+      Vector()
+      {}
+
+      Vector(const IndexSet local, const MPI_Comm &comm)
+      {}
+
+      Vector(const IndexSet &local, const IndexSet &ghost, const MPI_Comm &comm)
+      {}
+
+      void reinit(const IndexSet local, const MPI_Comm &comm)
+      {}
+
+      void reinit(const IndexSet local, const IndexSet &ghost, const MPI_Comm &comm)
+      {}
+
+      void compress(VectorOperation::values op)
+      {}
+
+      bool has_ghost_elements()
+      {
+        return false;
+      }
+
+      unsigned int size()
+      {
+        return 0;
+      }
+
+
+      const Vector &operator=(const double number)
+      {
+        return *this;
+      }
+
+
+      const Vector &operator*=(const double factor)
+      {
+        return *this;
+      }
+
+      double &operator()(unsigned int)
+      {
+        static double d;
+        return d;
+      }
+
+      const double &operator()(unsigned int) const
+      {
+        static double d;
+        return d;
+      }
+
+
+    };
+
+    class SparseMatrix
     {
-      public:
-       class Vector
-       {
-         public:
-
-           Vector()
-             {}
-           
-           Vector(const IndexSet local, const MPI_Comm &comm)
-             {}
-           
-           Vector(const IndexSet &local, const IndexSet &ghost, const MPI_Comm &comm) 
-             {}
-
-           void reinit(const IndexSet local, const MPI_Comm &comm)
-             {}
-
-           void reinit(const IndexSet local, const IndexSet &ghost, const MPI_Comm &comm)
-             {}
-           
-           void compress(VectorOperation::values op)
-             {}
-           
-           bool has_ghost_elements()
-             {
-               return false;}
-
-           unsigned int size()
-             {return 0;}
-           
-           
-           const Vector & operator=(const double number)
-             {
-               return *this;
-             }
-           
-
-             const Vector & operator*=(const double factor)
-             {
-               return *this;
-             }
-           
-           double & operator()(unsigned int)
-             {
-               static double d;
-               return d;
-             }
-           
-           const double & operator()(unsigned int) const
-             {
-               static double d;
-               return d;
-             }
-           
-           
-       };
-
-       class SparseMatrix
-       {
-         public:
-           template <typename SP>
-           SparseMatrix(const IndexSet & local,
-                        const IndexSet &,
-                        SP & sp,
-                        const MPI_Comm &comm=MPI_COMM_WORLD)
-             {}
-           
-           void set(unsigned int, unsigned int, double);
-           
-           const double & operator()(unsigned int, unsigned int) const
-             {
-               static double d;
-               return d;
-             }
-           
-       };
-       
-       
+    public:
+      template <typename SP>
+      SparseMatrix(const IndexSet &local,
+                   const IndexSet &,
+                   SP &sp,
+                   const MPI_Comm &comm=MPI_COMM_WORLD)
+      {}
+
+      void set(unsigned int, unsigned int, double);
+
+      const double &operator()(unsigned int, unsigned int) const
+      {
+        static double d;
+        return d;
+      }
+
     };
+
+
+  };
 };
index fce0e1ae499b54a8055ca6739ab888a23a79be55..21803813c221b801f3599674cce34eec64b4e666 100644 (file)
 
 #include "gla.h"
 
-template <class LA> 
+template <class LA>
 void test ()
 {
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
   unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
-  
+
   if (myid==0)
     deallog << "numproc=" << numproc << std::endl;
 
-                                  // each processor owns 2 indices and all
-                                  // are ghosting Element 1 (the second)
+  // each processor owns 2 indices and all
+  // are ghosting Element 1 (the second)
 
   IndexSet local_active(numproc*2);
   local_active.add_range(myid*2,myid*2+2);
@@ -46,40 +46,40 @@ void test ()
   local_relevant.add_range(1,2);
 
   CompressedSimpleSparsityPattern csp (local_relevant);
-  
-  for (unsigned int i=0;i<2*numproc;++i)
+
+  for (unsigned int i=0; i<2*numproc; ++i)
     if (local_relevant.is_element(i))
       csp.add(i,i);
 
   if (myid==0)
     csp.add(0,1);
 
+
   typename LA::MPI::SparseMatrix mat;
   mat.reinit (local_active, local_active, csp, MPI_COMM_WORLD);
 
   Assert(mat.n()==numproc*2, ExcInternalError());
   Assert(mat.m()==numproc*2, ExcInternalError());
 
-                                  // set local values
+  // set local values
   mat.set(myid*2,myid*2, myid*2.0);
   mat.set(myid*2+1,myid*2+1, myid*2.0+1.0);
 
   mat.compress(VectorOperation::insert);
 
   mat.add(0,1,1.0);
-  
+
   mat.compress(VectorOperation::add);
-  
-                                  // check local values
+
+  // check local values
   if (myid==0)
     {
       deallog << myid*2 << ": " << mat(myid*2,myid*2) << std::endl;
       deallog << myid*2+1 << ": " << mat(myid*2+1,myid*2+1) << std::endl;
       deallog << "0,1 : " << mat(0,1) << std::endl;
-    }  
+    }
 
-                                  // done
+  // done
   if (myid==0)
     deallog << "OK" << std::endl;
 }
@@ -90,18 +90,18 @@ int main (int argc, char **argv)
 {
   Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
   MPILogInitAll log(__FILE__);
-  {    
+  {
     deallog.push("PETSc");
     test<LA_PETSc>();
-    deallog.pop();     
+    deallog.pop();
     deallog.push("Trilinos");
     test<LA_Trilinos>();
-    deallog.pop();     
+    deallog.pop();
   }
-  
+
   // compile, don't run
   //if (myid==9999)
-    //  test<LA_Dummy>();
-  
+  //  test<LA_Dummy>();
+
 
 }
index 0dfa385a1206dcbc18710b64757590674a171105..52f499c98b8d29ed490d7a7d2a46d453b260078c 100644 (file)
 
 #include "gla.h"
 
-template <class LA> 
+template <class LA>
 void test ()
 {
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
   unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
-  
+
   if (myid==0)
     deallog << "numproc=" << numproc << std::endl;
-  
+
   IndexSet local_active(10);
   if (myid==0)
     local_active.add_range(0,10);
@@ -47,14 +47,14 @@ void test ()
     local_relevant.add_range(5,10);
 
   CompressedSimpleSparsityPattern csp (local_relevant);
-  
-  for (unsigned int i=0;i<10;++i)
+
+  for (unsigned int i=0; i<10; ++i)
     if (local_relevant.is_element(i))
       csp.add(i,i);
 
   if (myid==0)
     csp.add(0,1);
+
   typename LA::MPI::SparseMatrix mat;
   mat.reinit (local_active, local_active, csp, MPI_COMM_WORLD);
 
@@ -62,24 +62,24 @@ void test ()
   Assert(mat.m()==10, ExcInternalError());
 
   mat.set(0,0,0.1);
-  mat.set(1,1,0.1);  
+  mat.set(1,1,0.1);
 
   MPI_Barrier(MPI_COMM_WORLD);
-  
+
   mat.compress(VectorOperation::insert);
 
   mat.add(0,1,1.0);
-  
+
   mat.compress(VectorOperation::add);
-  
-                                  // check local values
+
+  // check local values
   if (myid==0)
     {
       deallog << "1,1 : " << mat(1,1) << std::endl;
       deallog << "0,1 : " << mat(0,1) << std::endl;
-    }  
+    }
 
-                                  // done
+  // done
   if (myid==0)
     deallog << "OK" << std::endl;
 }
@@ -90,18 +90,18 @@ int main (int argc, char **argv)
 {
   Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
   MPILogInitAll log(__FILE__);
-  {    
+  {
     deallog.push("PETSc");
     test<LA_PETSc>();
-    deallog.pop();     
+    deallog.pop();
     deallog.push("Trilinos");
     test<LA_Trilinos>();
-    deallog.pop();     
+    deallog.pop();
   }
-  
+
   // compile, don't run
   //if (myid==9999)
-    //  test<LA_Dummy>();
-  
+  //  test<LA_Dummy>();
+
 
 }
index c3e886938be3bd3ac3f6642ce7dbf8ee6f33caff..02e30102a7759e1162d3f11de7d0246b8bc0665d 100644 (file)
@@ -43,7 +43,7 @@ void test ()
 {
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
   unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
-  
+
   if (myid==0)
     deallog << "numproc=" << numproc << std::endl;
 
@@ -51,18 +51,18 @@ void test ()
   cm.close();
 
   parallel::distributed::Triangulation<dim>
-    triangulation (MPI_COMM_WORLD,
-                     typename Triangulation<dim>::MeshSmoothing
-                     (Triangulation<dim>::smoothing_on_refinement |
-                      Triangulation<dim>::smoothing_on_coarsening));
+  triangulation (MPI_COMM_WORLD,
+                 typename Triangulation<dim>::MeshSmoothing
+                 (Triangulation<dim>::smoothing_on_refinement |
+                  Triangulation<dim>::smoothing_on_coarsening));
   const double R0      = 6371000.-2890000;
   const double R1      = 6371000.-  35000.;
   GridGenerator::hyper_shell (triangulation,
-                                  Point<dim>(),
-                                  R0,
-                                  R1,
-                                  (dim==3) ? 96 : 12,
-                                  true);
+                              Point<dim>(),
+                              R0,
+                              R1,
+                              (dim==3) ? 96 : 12,
+                              true);
 
   FE_Q<dim>                                 temperature_fe(2);
 
@@ -78,12 +78,12 @@ void test ()
   CompressedSimpleSparsityPattern sp (relevant);
   typename LA::MPI::SparseMatrix matrix;
   DoFTools::make_sparsity_pattern (dof_handler, sp,
-                                       cm, false,
-                                       Utilities::MPI::
-                                       this_mpi_process(MPI_COMM_WORLD));
+                                   cm, false,
+                                   Utilities::MPI::
+                                   this_mpi_process(MPI_COMM_WORLD));
   SparsityTools::distribute_sparsity_pattern(sp,
-      dof_handler.n_locally_owned_dofs_per_processor(),
-      MPI_COMM_WORLD, relevant);
+                                             dof_handler.n_locally_owned_dofs_per_processor(),
+                                             MPI_COMM_WORLD, relevant);
   sp.compress();
   matrix.reinit (owned, owned, sp, MPI_COMM_WORLD);
 
@@ -99,9 +99,9 @@ void test ()
   matrix.compress(VectorOperation::add);
 
   matrix.print(deallog.get_file_stream());
-  
 
-                                  // done
+
+  // done
   if (myid==0)
     deallog << "OK" << std::endl;
 }
@@ -113,18 +113,18 @@ int main (int argc, char **argv)
   Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
   MPILogInitAll log(__FILE__);
 
-  {    
+  {
     deallog.push("PETSc");
     test<LA_PETSc,2>();
-    deallog.pop();     
+    deallog.pop();
     deallog.push("Trilinos");
     test<LA_Trilinos,2>();
-    deallog.pop();     
+    deallog.pop();
   }
-  
+
   // compile, don't run
   //if (myid==9999)
-    //  test<LA_Dummy>();
-  
+  //  test<LA_Dummy>();
+
 
 }
index 080637ceb2d68acd1eedb9fbae6406aa8a9d08d0..78f0a0f8453a00bd6170d812d256afe43d6fc603 100644 (file)
@@ -44,7 +44,7 @@ void test ()
 {
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
   unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
-  
+
   if (myid==0)
     deallog << "numproc=" << numproc << std::endl;
 
@@ -52,18 +52,18 @@ void test ()
   cm.close();
 
   parallel::distributed::Triangulation<dim>
-    triangulation (MPI_COMM_WORLD,
-                     typename Triangulation<dim>::MeshSmoothing
-                     (Triangulation<dim>::smoothing_on_refinement |
-                      Triangulation<dim>::smoothing_on_coarsening));
+  triangulation (MPI_COMM_WORLD,
+                 typename Triangulation<dim>::MeshSmoothing
+                 (Triangulation<dim>::smoothing_on_refinement |
+                  Triangulation<dim>::smoothing_on_coarsening));
   const double R0      = 6371000.-2890000;
   const double R1      = 6371000.-  35000.;
   GridGenerator::hyper_shell (triangulation,
-                                  Point<dim>(),
-                                  R0,
-                                  R1,
-                                  (dim==3) ? 96 : 12,
-                                  true);
+                              Point<dim>(),
+                              R0,
+                              R1,
+                              (dim==3) ? 96 : 12,
+                              true);
 
   FE_Q<dim>                                 temperature_fe(1);
 
@@ -77,20 +77,20 @@ void test ()
   CompressedSimpleSparsityPattern sp (relevant);
   typename LA::MPI::SparseMatrix matrix;
   DoFTools::make_sparsity_pattern (dof_handler, sp,
-                                       cm, false,
-                                       Utilities::MPI::
-                                       this_mpi_process(MPI_COMM_WORLD));
+                                   cm, false,
+                                   Utilities::MPI::
+                                   this_mpi_process(MPI_COMM_WORLD));
   SparsityTools::distribute_sparsity_pattern(sp,
-      dof_handler.n_locally_owned_dofs_per_processor(),
-      MPI_COMM_WORLD, relevant);
+                                             dof_handler.n_locally_owned_dofs_per_processor(),
+                                             MPI_COMM_WORLD, relevant);
   sp.compress();
   matrix.reinit (owned, owned, sp, MPI_COMM_WORLD);
 
 
   matrix.print(deallog.get_file_stream());
-  
 
-                                  // done
+
+  // done
   if (myid==0)
     deallog << "OK" << std::endl;
 }
@@ -101,10 +101,10 @@ template <int dim>
 void test_trilinos_alternative ()
 {
   typedef LA_Trilinos LA;
-   
+
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
   unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
-  
+
   if (myid==0)
     deallog << "numproc=" << numproc << std::endl;
 
@@ -112,18 +112,18 @@ void test_trilinos_alternative ()
   cm.close();
 
   parallel::distributed::Triangulation<dim>
-    triangulation (MPI_COMM_WORLD,
-                     typename Triangulation<dim>::MeshSmoothing
-                     (Triangulation<dim>::smoothing_on_refinement |
-                      Triangulation<dim>::smoothing_on_coarsening));
+  triangulation (MPI_COMM_WORLD,
+                 typename Triangulation<dim>::MeshSmoothing
+                 (Triangulation<dim>::smoothing_on_refinement |
+                  Triangulation<dim>::smoothing_on_coarsening));
   const double R0      = 6371000.-2890000;
   const double R1      = 6371000.-  35000.;
   GridGenerator::hyper_shell (triangulation,
-                                  Point<dim>(),
-                                  R0,
-                                  R1,
-                                  (dim==3) ? 96 : 12,
-                                  true);
+                              Point<dim>(),
+                              R0,
+                              R1,
+                              (dim==3) ? 96 : 12,
+                              true);
 
   FE_Q<dim>                                 temperature_fe(1);
 
@@ -137,15 +137,15 @@ void test_trilinos_alternative ()
   TrilinosWrappers::SparsityPattern sp (owned, MPI_COMM_WORLD);
   typename LA::MPI::SparseMatrix matrix;
   DoFTools::make_sparsity_pattern (dof_handler, sp,
-                                       cm, false,
-                                       Utilities::MPI::
-                                       this_mpi_process(MPI_COMM_WORLD));
+                                   cm, false,
+                                   Utilities::MPI::
+                                   this_mpi_process(MPI_COMM_WORLD));
   sp.compress();
   matrix.reinit (sp);
 
   matrix.print(deallog.get_file_stream());
 
-                                  // done
+  // done
   if (myid==0)
     deallog << "OK" << std::endl;
 }
@@ -155,20 +155,21 @@ int main (int argc, char **argv)
   Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
   MPILogInitAll log(__FILE__);
 
-  {    
+  {
     deallog.push("PETSc");
     test<LA_PETSc,2>();
-    deallog.pop();     
+    deallog.pop();
     deallog.push("Trilinos");
     test<LA_Trilinos,2>();
-    deallog.pop();     
+    deallog.pop();
     deallog.push("Trilinos_alt");
     test_trilinos_alternative<2>();
-    deallog.pop();  }
-  
+    deallog.pop();
+  }
+
   // compile, don't run
   //if (myid==9999)
-    //  test<LA_Dummy>();
-  
+  //  test<LA_Dummy>();
+
 
 }
index 12ab3bcbf8ad620c2bd73e656a372cdccbb0e599..1ccfb00af1480a11929cc950251ed1d8372be13d 100644 (file)
 
 #include "gla.h"
 
-template <class LA> 
+template <class LA>
 void test ()
 {
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
   unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
-  
+
   if (myid==0)
     deallog << "numproc=" << numproc << std::endl;
 
-                                  // each processor owns 2 indices and all
-                                  // are ghosting Element 1 (the second)
+  // each processor owns 2 indices and all
+  // are ghosting Element 1 (the second)
 
   IndexSet local_active(numproc*2);
   local_active.add_range(myid*2,myid*2+2);
@@ -51,10 +51,10 @@ void test ()
   if (myid==numproc-1)
     something.add_range(numproc,100);
 
-  
+
   {
     typename LA::MPI::Vector v1;
-    
+
     v1.reinit(something, MPI_COMM_WORLD);
     Assert(!v1.has_ghost_elements(), ExcInternalError());
     Assert(v1.size()==100, ExcInternalError());
@@ -66,14 +66,14 @@ void test ()
     v2.reinit(local_active,MPI_COMM_WORLD);
     Assert(!v2.has_ghost_elements(), ExcInternalError());
     Assert(v2.size()==numproc*2, ExcInternalError());
-   
+
     v2.reinit(local_active, local_relevant, MPI_COMM_WORLD);
     Assert(v2.has_ghost_elements(), ExcInternalError());
     Assert(v2.size()==numproc*2, ExcInternalError());
-    
+
   }
 
-                                  // done
+  // done
   if (myid==0)
     deallog << "OK" << std::endl;
 }
@@ -95,28 +95,28 @@ int main (int argc, char **argv)
       deallog.depth_console(0);
       deallog.threshold_double(1.e-10);
 
-      {        
-       deallog.push("PETSc");
-       test<LA_PETSc>();
-       deallog.pop();  
-       deallog.push("Trilinos");
-       test<LA_Trilinos>();
-       deallog.pop();  
+      {
+        deallog.push("PETSc");
+        test<LA_PETSc>();
+        deallog.pop();
+        deallog.push("Trilinos");
+        test<LA_Trilinos>();
+        deallog.pop();
       }
-      
+
     }
   else
-      {        
-       deallog.push("PETSc");
-       test<LA_PETSc>();
-       deallog.pop();  
-       deallog.push("Trilinos");
-       test<LA_Trilinos>();
-       deallog.pop();  
-      }
+    {
+      deallog.push("PETSc");
+      test<LA_PETSc>();
+      deallog.pop();
+      deallog.push("Trilinos");
+      test<LA_Trilinos>();
+      deallog.pop();
+    }
 
   if (myid==9999)
     test<LA_Dummy>();
-  
+
 
 }
index b61879acc0d2e5318faf81d57ea3af9494cd42c3..6ff6788baed481bdde62b8720fca6c2fd203a7c2 100644 (file)
 
 #include "gla.h"
 
-template <class LA> 
+template <class LA>
 void test ()
 {
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
   unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
-  
+
   if (myid==0)
     deallog << "numproc=" << numproc << std::endl;
 
-                                  // each processor owns 2 indices and all
-                                  // are ghosting Element 1 (the second)
+  // each processor owns 2 indices and all
+  // are ghosting Element 1 (the second)
 
   IndexSet local_active(numproc*2);
   local_active.add_range(myid*2,myid*2+2);
   IndexSet local_relevant(numproc*2);
   local_relevant.add_range(1,2);
-  
+
   typename LA::MPI::Vector vb(local_active, MPI_COMM_WORLD);
   typename LA::MPI::Vector v(local_active, local_relevant, MPI_COMM_WORLD);
 
-                                  // set local values
+  // set local values
   vb(myid*2)=myid*2.0;
   vb(myid*2+1)=myid*2.0+1.0;
 
@@ -61,24 +61,24 @@ void test ()
 
   Assert(!vb.has_ghost_elements(), ExcInternalError());
   Assert(v.has_ghost_elements(), ExcInternalError());
-  
-                                  // check local values
+
+  // check local values
   if (myid==0)
     {
       deallog << myid*2 << ":" << v(myid*2) << std::endl;
       deallog << myid*2+1 << ":" << v(myid*2+1) << std::endl;
     }
-  
+
   Assert(v(myid*2) == myid*4.0, ExcInternalError());
   Assert(v(myid*2+1) == myid*4.0+2.0, ExcInternalError());
-  
 
-                                  // check ghost values
+
+  // check ghost values
   if (myid==0)
     deallog << "ghost: " << v(1) << std::endl;
   Assert(v(1) == 2.0, ExcInternalError());
 
-                                  // done
+  // done
   if (myid==0)
     deallog << "OK" << std::endl;
 }
@@ -100,28 +100,28 @@ int main (int argc, char **argv)
       deallog.depth_console(0);
       deallog.threshold_double(1.e-10);
 
-      {        
-       deallog.push("PETSc");
-       test<LA_PETSc>();
-       deallog.pop();  
-       deallog.push("Trilinos");
-       test<LA_Trilinos>();
-       deallog.pop();  
+      {
+        deallog.push("PETSc");
+        test<LA_PETSc>();
+        deallog.pop();
+        deallog.push("Trilinos");
+        test<LA_Trilinos>();
+        deallog.pop();
       }
-      
+
     }
   else
-      {        
-       deallog.push("PETSc");
-       test<LA_PETSc>();
-       deallog.pop();  
-       deallog.push("Trilinos");
-       test<LA_Trilinos>();
-       deallog.pop();  
-      }
+    {
+      deallog.push("PETSc");
+      test<LA_PETSc>();
+      deallog.pop();
+      deallog.push("Trilinos");
+      test<LA_Trilinos>();
+      deallog.pop();
+    }
 
   if (myid==9999)
     test<LA_Dummy>();
-  
+
 
 }
index 1330381bcfe41ea1449c588d00a6176888a1b54a..8997016ccef0974080b038287d2262508ada8e10 100644 (file)
 
 #include "gla.h"
 
-template <class LA> 
+template <class LA>
 void test ()
 {
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
   unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
-  
+
   if (myid==0)
     deallog << "numproc=" << numproc << std::endl;
 
-                                  // each processor owns 2 indices and all
-                                  // are ghosting Element 1 (the second)
+  // each processor owns 2 indices and all
+  // are ghosting Element 1 (the second)
 
   IndexSet local_active(numproc*2);
   local_active.add_range(myid*2,myid*2+2);
@@ -52,7 +52,7 @@ void test ()
   vb = 1.0;
   v2 = vb;
 
-                                  // set local values
+  // set local values
   vb(myid*2)=myid*2.0;
   vb(myid*2+1)=myid*2.0+1.0;
 
@@ -65,32 +65,32 @@ void test ()
 
   Assert(!vb.has_ghost_elements(), ExcInternalError());
   Assert(v.has_ghost_elements(), ExcInternalError());
-  
-                                  // check local values
+
+  // check local values
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     {
       deallog << myid*2 << ":" << v(myid*2) << std::endl;
       deallog << myid*2+1 << ":" << v(myid*2+1) << std::endl;
     }
-  
-                                  //assignment from ghosted to ghosted
+
+  //assignment from ghosted to ghosted
   v2 = v;
   Assert(v2(1) == 2.0, ExcInternalError());
   Assert(v2(myid*2) == myid*4.0, ExcInternalError());
   Assert(v2(myid*2+1) == myid*4.0+2.0, ExcInternalError());
 
 
-  
+
   Assert(v(myid*2) == myid*4.0, ExcInternalError());
   Assert(v(myid*2+1) == myid*4.0+2.0, ExcInternalError());
-  
 
-                                  // check ghost values
+
+  // check ghost values
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     deallog << "ghost: " << v(1) << std::endl;
   Assert(v(1) == 2.0, ExcInternalError());
 
-                                  // done
+  // done
   if (myid==0)
     deallog << "OK" << std::endl;
 }
@@ -112,28 +112,28 @@ int main (int argc, char **argv)
       deallog.depth_console(0);
       deallog.threshold_double(1.e-10);
 
-      {        
-       deallog.push("PETSc");
-       test<LA_PETSc>();
-       deallog.pop();  
-       deallog.push("Trilinos");
-       test<LA_Trilinos>();
-       deallog.pop();  
+      {
+        deallog.push("PETSc");
+        test<LA_PETSc>();
+        deallog.pop();
+        deallog.push("Trilinos");
+        test<LA_Trilinos>();
+        deallog.pop();
       }
-      
+
     }
   else
-      {        
-       deallog.push("PETSc");
-       test<LA_PETSc>();
-       deallog.pop();  
-       deallog.push("Trilinos");
-       test<LA_Trilinos>();
-       deallog.pop();  
-      }
+    {
+      deallog.push("PETSc");
+      test<LA_PETSc>();
+      deallog.pop();
+      deallog.push("Trilinos");
+      test<LA_Trilinos>();
+      deallog.pop();
+    }
 
   if (myid==9999)
     test<LA_Dummy>();
-  
+
 
 }
index a743e16fbb031b65ba7052d1bc42ed6183c5ea51..b765b27bc4ca53bafe073818ce979240972676c8 100644 (file)
 
 #include "gla.h"
 
-template <class LA> 
+template <class LA>
 void test ()
 {
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
   unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
-  
+
   if (myid==0)
     deallog << "numproc=" << numproc << std::endl;
 
-                                  // each processor owns 2 indices and all
-                                  // are ghosting Element 1 (the second)
+  // each processor owns 2 indices and all
+  // are ghosting Element 1 (the second)
 
   IndexSet local_active(numproc*2);
   local_active.add_range(myid*2,myid*2+2);
@@ -51,7 +51,7 @@ void test ()
 
   vb = 1.0;
 
-                                  // set local values
+  // set local values
   vb(myid*2)=myid*2.0;
   vb(myid*2+1)=myid*2.0+1.0;
 
@@ -64,13 +64,13 @@ void test ()
 
   Assert(!vb.has_ghost_elements(), ExcInternalError());
   Assert(v.has_ghost_elements(), ExcInternalError());
-  
-                                  // check local values
-    {
-      deallog << myid*2 << ": " << v(myid*2) << std::endl;
-      deallog << myid*2+1 << ": " << v(myid*2+1) << std::endl;
-    }
-  
+
+  // check local values
+  {
+    deallog << myid*2 << ": " << v(myid*2) << std::endl;
+    deallog << myid*2+1 << ": " << v(myid*2+1) << std::endl;
+  }
+
   Assert(v(myid*2) == myid*4.0, ExcInternalError());
   Assert(v(myid*2+1) == myid*4.0+2.0, ExcInternalError());
 
@@ -78,14 +78,14 @@ void test ()
   cm.add_line(1);
   cm.add_entry(1 ,2, 3.0);
   cm.close();
-  
+
   if (myid==0)
     deallog << "before: " << vb(1) << std::endl;
   cm.distribute(vb); // this should set x(1)= 3.0 * x(2) = 12.0
   if (myid==0)
     deallog << "after: " << vb(1) << std::endl;
-  
-                                  // done
+
+  // done
   if (myid==0)
     deallog << "OK" << std::endl;
 }
index 59f50d5afeaec00fd872a5d601999834ca06e473..9524e85560c091b0fdc3ec843f1b8ea3bd365e8c 100644 (file)
 
 
 template <class TRIA>
-void check (TRIA & tr)
+void check (TRIA &tr)
 {
   typename TRIA::cell_iterator cell = tr.begin(),
-        endc = tr.end();
-  
+                               endc = tr.end();
+
   for (; cell!=endc; ++cell)
     {
       deallog << cell->level() << " " << cell->index() << " " << cell->id() << std::endl;
@@ -50,10 +50,10 @@ void check (TRIA & tr)
 }
 
 
-int main (int argc, char *argv[]) 
+int main (int argc, char *argv[])
 {
   Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv);
-  
+
   initlog(__FILE__);
   deal_II_exceptions::disable_abort_on_exception();
 
@@ -72,9 +72,9 @@ int main (int argc, char *argv[])
     tria.refine_global (1);
     check(tria);
   }
-  
+
 
 }
 
-  
-  
+
+
index 1f91edc9ddb2e365d08e2de63ba3c06acc248f6b..d99492882bcaa52b6bbbee9c51d033b1ea6993ea 100644 (file)
 #include <sstream>
 
 template <class TRIA>
-void check (TRIA & tr)
+void check (TRIA &tr)
 {
   typename TRIA::cell_iterator cell = tr.begin(),
-        endc = tr.end();
+                               endc = tr.end();
+
 
-  
   for (; cell!=endc; ++cell)
     {
       std::ostringstream outb;
@@ -53,19 +53,19 @@ void check (TRIA & tr)
 
 
   CellId empty;
-  
+
   Assert(tr.begin()->id() != tr.begin_active()->id(), ExcInternalError());
   Assert(tr.begin()->id() != empty, ExcInternalError());
   Assert(tr.begin()->id() == tr.begin()->id(), ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
 
-int main (int argc, char *argv[]) 
+int main (int argc, char *argv[])
 {
   Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv);
-  
+
   initlog(__FILE__);
   deal_II_exceptions::disable_abort_on_exception();
 
@@ -77,5 +77,5 @@ int main (int argc, char *argv[])
   check(tria);
 }
 
-  
-  
+
+
index e73c89353d1bbab12a9c82c4588e58dba18bb847..f9fd3b373f455b10ac876da8daf0a4c860219655 100644 (file)
@@ -30,53 +30,53 @@ using namespace dealii;
 
 Triangulation<2,2> create_grid()
 {
-       Triangulation<2,2> triangulation;
+  Triangulation<2,2> triangulation;
 
-       double inner_radius = .5;
-       double outer_radius = 1.;
+  double inner_radius = .5;
+  double outer_radius = 1.;
 
-       Point<2> center(0., 0.);
+  Point<2> center(0., 0.);
 
-       GridGenerator::hyper_cube_with_cylindrical_hole(triangulation, inner_radius, outer_radius);
-       triangulation.refine_global(1);
+  GridGenerator::hyper_cube_with_cylindrical_hole(triangulation, inner_radius, outer_radius);
+  triangulation.refine_global(1);
 
-       Triangulation<2>::active_cell_iterator
+  Triangulation<2>::active_cell_iterator
 
-       cell = triangulation.begin_active(),
-       endc = triangulation.end();
+  cell = triangulation.begin_active(),
+  endc = triangulation.end();
 
-       for(; cell!=endc; ++cell)
-       {
-               for (unsigned int v=0; v < GeometryInfo<2>::vertices_per_cell; ++v)
-               {
-                       const double distance_from_center = center.distance(cell->vertex(v));
+  for (; cell!=endc; ++cell)
+    {
+      for (unsigned int v=0; v < GeometryInfo<2>::vertices_per_cell; ++v)
+        {
+          const double distance_from_center = center.distance(cell->vertex(v));
 
-                       if (std::fabs(distance_from_center - inner_radius) < .25)
-                       {
-                               cell->set_refine_flag();
-                               break;
-                       }
-               }
-       }
+          if (std::fabs(distance_from_center - inner_radius) < .25)
+            {
+              cell->set_refine_flag();
+              break;
+            }
+        }
+    }
 
-       triangulation.execute_coarsening_and_refinement();
+  triangulation.execute_coarsening_and_refinement();
 
-       return triangulation;
+  return triangulation;
 }
 
 int main()
 {
-       initlog(__FILE__);
+  initlog(__FILE__);
 
-       GridOut grid_out;
-       GridOutFlags::Svg svg_flags;
+  GridOut grid_out;
+  GridOutFlags::Svg svg_flags;
 
-       svg_flags.coloring = GridOutFlags::Svg::level_number;
-       svg_flags.label_material_id = true;
-       svg_flags.background = GridOutFlags::Svg::transparent;
-       
-       grid_out.set_flags(svg_flags);
-       grid_out.write_svg(create_grid(), deallog.get_file_stream());
+  svg_flags.coloring = GridOutFlags::Svg::level_number;
+  svg_flags.label_material_id = true;
+  svg_flags.background = GridOutFlags::Svg::transparent;
 
-       return 0;
+  grid_out.set_flags(svg_flags);
+  grid_out.write_svg(create_grid(), deallog.get_file_stream());
+
+  return 0;
 }
index afc7e1fc7e76e27f902e27e1f4a21e3d3ae47e14..0a5881a35f6f4bee6f1a9333ac5f77a0c8cfa47b 100644 (file)
@@ -30,57 +30,57 @@ using namespace dealii;
 
 Triangulation<2,2> create_grid()
 {
-       Triangulation<2,2> triangulation;
+  Triangulation<2,2> triangulation;
 
-       double inner_radius = .5;
-       double outer_radius = 1.;
+  double inner_radius = .5;
+  double outer_radius = 1.;
 
-       Point<2> center(0., 0.);
+  Point<2> center(0., 0.);
 
-       GridGenerator::hyper_cube_with_cylindrical_hole(triangulation, inner_radius, outer_radius);
-       triangulation.refine_global(1);
+  GridGenerator::hyper_cube_with_cylindrical_hole(triangulation, inner_radius, outer_radius);
+  triangulation.refine_global(1);
 
-       Triangulation<2>::active_cell_iterator
+  Triangulation<2>::active_cell_iterator
 
-       cell = triangulation.begin_active(),
-       endc = triangulation.end();
+  cell = triangulation.begin_active(),
+  endc = triangulation.end();
 
-       for(; cell!=endc; ++cell)
-       {
-               for (unsigned int v=0; v < GeometryInfo<2>::vertices_per_cell; ++v)
-               {
-                       const double distance_from_center = center.distance(cell->vertex(v));
+  for (; cell!=endc; ++cell)
+    {
+      for (unsigned int v=0; v < GeometryInfo<2>::vertices_per_cell; ++v)
+        {
+          const double distance_from_center = center.distance(cell->vertex(v));
 
-                       if (std::fabs(distance_from_center - inner_radius) < .25)
-                       {
-                               cell->set_refine_flag();
-                               break;
-                       }
-               }
-       }
+          if (std::fabs(distance_from_center - inner_radius) < .25)
+            {
+              cell->set_refine_flag();
+              break;
+            }
+        }
+    }
 
-       triangulation.execute_coarsening_and_refinement();
+  triangulation.execute_coarsening_and_refinement();
 
-       return triangulation;
+  return triangulation;
 }
 
 int main()
 {
-       initlog(__FILE__);
-
-       GridOut grid_out;
-       GridOutFlags::Svg svg_flags;
-
-       svg_flags.coloring = GridOutFlags::Svg::level_number;
-       svg_flags.label_material_id = true;
-       svg_flags.label_subdomain_id = true;
-       svg_flags.label_level_subdomain_id = true;
-       svg_flags.background = GridOutFlags::Svg::transparent;
-       svg_flags.polar_angle = 45;
-       svg_flags.convert_level_number_to_height = true;
-       
-       grid_out.set_flags(svg_flags);
-       grid_out.write_svg(create_grid(), deallog.get_file_stream());
-
-       return 0;
+  initlog(__FILE__);
+
+  GridOut grid_out;
+  GridOutFlags::Svg svg_flags;
+
+  svg_flags.coloring = GridOutFlags::Svg::level_number;
+  svg_flags.label_material_id = true;
+  svg_flags.label_subdomain_id = true;
+  svg_flags.label_level_subdomain_id = true;
+  svg_flags.background = GridOutFlags::Svg::transparent;
+  svg_flags.polar_angle = 45;
+  svg_flags.convert_level_number_to_height = true;
+
+  grid_out.set_flags(svg_flags);
+  grid_out.write_svg(create_grid(), deallog.get_file_stream());
+
+  return 0;
 }
index 8f801a8fce90dfe47c4c093a1725b14b1aaae44d..9aec827dcabc73fc0a880609b1966aca3ebacc30 100644 (file)
@@ -31,26 +31,26 @@ using namespace dealii;
 
 template <int dim>
 void
-show_ordering(const Triangulation<dim>tr)
+show_ordering(const Triangulation<dim> &tr)
 {
-  for (typename Triangulation<dim>::cell_iterator cell = tr.begin(); cell != tr.end();++cell)
-    for (typename Triangulation<dim>::cell_iterator other = tr.begin(); other != tr.end();++other)
+  for (typename Triangulation<dim>::cell_iterator cell = tr.begin(); cell != tr.end(); ++cell)
+    for (typename Triangulation<dim>::cell_iterator other = tr.begin(); other != tr.end(); ++other)
       {
-       deallog << (cell < other ? "less " : "not  ");
-       deallog << cell->level_subdomain_id() << ':' << other->level_subdomain_id() << ' ';
-       if (cell->active())
-         deallog << cell->subdomain_id();
-       else
-         deallog << 'X';
-       deallog << ':';
-       if (other->active())
-         deallog << other->subdomain_id();
-       else
-         deallog << 'X';
-       deallog << ' ';
-       deallog << cell->level() << ':' << other->level() << ' ';
-       deallog << cell->index() << ':' << other->index() << ' ';
-       deallog << std::endl;
+        deallog << (cell < other ? "less " : "not  ");
+        deallog << cell->level_subdomain_id() << ':' << other->level_subdomain_id() << ' ';
+        if (cell->active())
+          deallog << cell->subdomain_id();
+        else
+          deallog << 'X';
+        deallog << ':';
+        if (other->active())
+          deallog << other->subdomain_id();
+        else
+          deallog << 'X';
+        deallog << ' ';
+        deallog << cell->level() << ':' << other->level() << ' ';
+        deallog << cell->index() << ':' << other->index() << ' ';
+        deallog << std::endl;
       }
 }
 
@@ -59,14 +59,14 @@ void test1()
 {
   Triangulation<dim> tr;
   GridGenerator::hyper_ball(tr);
-  
+
   typename Triangulation<dim>::active_cell_iterator cell = tr.begin_active();
   cell->set_subdomain_id(4);
   cell->set_level_subdomain_id(4);
   ++cell;
   cell->set_subdomain_id(3);
   cell->set_level_subdomain_id(5);
-  
+
   tr.refine_global(1);
   cell = tr.begin_active();
   cell->set_level_subdomain_id(3);
@@ -82,8 +82,8 @@ void test1()
 
 int main()
 {
-       initlog(__FILE__);
-       
-       test1<2>();
-       return 0;
+  initlog(__FILE__);
+
+  test1<2>();
+  return 0;
 }
index 8020c57b2fc95fe46f2b908ff40dcda8e1468b48..8b49adb5a2d08a84722cd2a312947c6983938313 100644 (file)
@@ -45,23 +45,23 @@ void check ()
   Vector<float> estimated_error_per_cell;
   estimated_error_per_cell.reinit(tria.n_active_cells());
   for (unsigned int j=0; j<estimated_error_per_cell.size(); ++j)
-      estimated_error_per_cell(j)= 1.;
+    estimated_error_per_cell(j)= 1.;
 
   deallog << "n_active_cells: " << tria.n_active_cells() << std::endl;
-  
-  
+
+
   GridRefinement::refine_and_coarsen_fixed_fraction (tria,
-                                                    estimated_error_per_cell,
-                                                    0.25, 0);
+                                                     estimated_error_per_cell,
+                                                     0.25, 0);
   tria.execute_coarsening_and_refinement ();
 
   deallog << "n_active_cells: " << tria.n_active_cells() << std::endl;
-  
+
   deallog << "OK for " << dim << "d" << std::endl;
 }
 
 
-int main () 
+int main ()
 {
   std::ofstream logfile("refine_and_coarsen_01/output");
   deallog.attach(logfile);
@@ -73,5 +73,5 @@ int main ()
   check<3> ();
 }
 
-  
-  
+
+
index 69847f4bb56201ef5f0c43e87065c5898b3cb09d..2d3af2996e47fb5fd6ea929db06cd62625822135 100644 (file)
@@ -55,19 +55,22 @@ std::ofstream logfile("compare_hp_vs_nonhp_01/output");
 
 
 template <int dim>
-class ExactSolution: public Function<dim> {
-  public:
-    ExactSolution ();
-    virtual double value (const Point<dim>& p, const unsigned int component = 0) const;
+class ExactSolution: public Function<dim>
+{
+public:
+  ExactSolution ();
+  virtual double value (const Point<dim> &p, const unsigned int component = 0) const;
 };
 
 template <int dim>
-double ExactSolution<dim>::value (const Point<dim>& p, const unsigned int) const {
+double ExactSolution<dim>::value (const Point<dim> &p, const unsigned int) const
+{
   return p (0) * p (0);
 }
 
 template <int dim>
-ExactSolution<dim>::ExactSolution (): Function<dim> () {
+ExactSolution<dim>::ExactSolution (): Function<dim> ()
+{
 }
 
 
@@ -77,31 +80,31 @@ namespace with_hp
   template <int dim>
   class LaplaceProblem
   {
-    public:
-      LaplaceProblem<dim> ();
-
-      void run (Vector<double> &sol);
-
-    private:
-      const ExactSolution<dim> exact_solution;
-      void make_grid_and_dofs ();
-      void assemble_system ();
-      void solve ();
-
-      Triangulation<dim>     triangulation;
-      hp::FECollection<dim>      fe;
-      hp::DoFHandler<dim>        dof_handler;
-      hp::QCollection<dim>   quadrature;
-      SparsityPattern      sparsity_pattern;
-      SparseMatrix<double> system_matrix;
-
-      Vector<double>       solution;
-      Vector<double>       system_rhs;
+  public:
+    LaplaceProblem<dim> ();
+
+    void run (Vector<double> &sol);
+
+  private:
+    const ExactSolution<dim> exact_solution;
+    void make_grid_and_dofs ();
+    void assemble_system ();
+    void solve ();
+
+    Triangulation<dim>     triangulation;
+    hp::FECollection<dim>      fe;
+    hp::DoFHandler<dim>        dof_handler;
+    hp::QCollection<dim>   quadrature;
+    SparsityPattern      sparsity_pattern;
+    SparseMatrix<double> system_matrix;
+
+    Vector<double>       solution;
+    Vector<double>       system_rhs;
   };
 
   template <int dim>
   LaplaceProblem<dim>::LaplaceProblem () :
-                 dof_handler (triangulation)
+    dof_handler (triangulation)
   {
     fe.push_back (FE_Q<dim> (1));
     quadrature.push_back (QGauss<dim> (2));
@@ -113,20 +116,20 @@ namespace with_hp
     GridGenerator::hyper_cube (triangulation);
     triangulation.refine_global (2);
     deallog << "Number of active cells: "
-             << triangulation.n_active_cells()
-             << std::endl;
+            << triangulation.n_active_cells()
+            << std::endl;
     deallog << "Total number of cells: "
-             << triangulation.n_cells()
-             << std::endl;
+            << triangulation.n_cells()
+            << std::endl;
 
     dof_handler.distribute_dofs (fe);
     deallog << "Number of degrees of freedom: "
-             << dof_handler.n_dofs()
-             << std::endl;
+            << dof_handler.n_dofs()
+            << std::endl;
 
     sparsity_pattern.reinit (dof_handler.n_dofs(),
-                            dof_handler.n_dofs(),
-                            dof_handler.max_couplings_between_dofs());
+                             dof_handler.n_dofs(),
+                             dof_handler.max_couplings_between_dofs());
     DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
     sparsity_pattern.compress();
 
@@ -140,7 +143,7 @@ namespace with_hp
   void LaplaceProblem<dim>::assemble_system ()
   {
     hp::FEValues<dim> fe_values (fe, quadrature,
-                              update_values | update_gradients | update_JxW_values);
+                                 update_values | update_gradients | update_JxW_values);
 
     unsigned int   dofs_per_cell;
     unsigned int   n_q_points;
@@ -151,57 +154,57 @@ namespace with_hp
     std::vector<types::global_dof_index> local_dof_indices;
 
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     for (; cell!=endc; ++cell)
       {
-       fe_values.reinit (cell);
-       dofs_per_cell = cell->get_fe ().dofs_per_cell;
-       cell_matrix.reinit (dofs_per_cell, dofs_per_cell);
-       cell_matrix = 0;
-       cell_rhs.reinit (dofs_per_cell);
-       cell_rhs = 0;
-       n_q_points = fe_values.get_present_fe_values ().n_quadrature_points;
-
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-             cell_matrix(i,j) += (fe_values.get_present_fe_values ().shape_grad (i, q_point) *
-                                  fe_values.get_present_fe_values ().shape_grad (j, q_point) *
-                                  fe_values.get_present_fe_values ().JxW (q_point));
-
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-           cell_rhs(i) += (-2.0 * fe_values.get_present_fe_values ().shape_value (i, q_point) *
-                           fe_values.get_present_fe_values ().JxW (q_point));
-
-       local_dof_indices.resize (dofs_per_cell);
-       cell->get_dof_indices (local_dof_indices);
-
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           system_matrix.add (local_dof_indices[i],
-                              local_dof_indices[j],
-                              cell_matrix(i,j));
-
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         system_rhs(local_dof_indices[i]) += cell_rhs(i);
+        fe_values.reinit (cell);
+        dofs_per_cell = cell->get_fe ().dofs_per_cell;
+        cell_matrix.reinit (dofs_per_cell, dofs_per_cell);
+        cell_matrix = 0;
+        cell_rhs.reinit (dofs_per_cell);
+        cell_rhs = 0;
+        n_q_points = fe_values.get_present_fe_values ().n_quadrature_points;
+
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+              cell_matrix(i,j) += (fe_values.get_present_fe_values ().shape_grad (i, q_point) *
+                                   fe_values.get_present_fe_values ().shape_grad (j, q_point) *
+                                   fe_values.get_present_fe_values ().JxW (q_point));
+
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+            cell_rhs(i) += (-2.0 * fe_values.get_present_fe_values ().shape_value (i, q_point) *
+                            fe_values.get_present_fe_values ().JxW (q_point));
+
+        local_dof_indices.resize (dofs_per_cell);
+        cell->get_dof_indices (local_dof_indices);
+
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            system_matrix.add (local_dof_indices[i],
+                               local_dof_indices[j],
+                               cell_matrix(i,j));
+
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          system_rhs(local_dof_indices[i]) += cell_rhs(i);
       }
 
 
     std::map<types::global_dof_index,double> boundary_values;
     VectorTools::interpolate_boundary_values (dof_handler,
-                                             0,
-                                             exact_solution,
-                                             boundary_values);
+                                              0,
+                                              exact_solution,
+                                              boundary_values);
     VectorTools::interpolate_boundary_values (dof_handler,
-                                             1,
-                                             exact_solution,
-                                             boundary_values);
+                                              1,
+                                              exact_solution,
+                                              boundary_values);
     MatrixTools::apply_boundary_values (boundary_values,
-                                       system_matrix,
-                                       solution,
-                                       system_rhs);
+                                        system_matrix,
+                                        solution,
+                                        system_rhs);
   }
 
   template <int dim>
@@ -211,7 +214,7 @@ namespace with_hp
     SolverCG<>              cg (solver_control);
 
     cg.solve (system_matrix, solution, system_rhs,
-             PreconditionIdentity());
+              PreconditionIdentity());
   }
 
   template <int dim>
@@ -231,32 +234,32 @@ namespace without_hp
   template <int dim>
   class LaplaceProblem
   {
-    public:
-      LaplaceProblem<dim> ();
+  public:
+    LaplaceProblem<dim> ();
 
-      void run (Vector<double> &sol);
+    void run (Vector<double> &sol);
 
-    private:
-      const ExactSolution<dim> exact_solution;
-      void make_grid_and_dofs ();
-      void assemble_system ();
-      void solve ();
+  private:
+    const ExactSolution<dim> exact_solution;
+    void make_grid_and_dofs ();
+    void assemble_system ();
+    void solve ();
 
-      Triangulation<dim>     triangulation;
-      FE_Q<dim>              fe;
-      DoFHandler<dim>        dof_handler;
+    Triangulation<dim>     triangulation;
+    FE_Q<dim>              fe;
+    DoFHandler<dim>        dof_handler;
 
-      SparsityPattern      sparsity_pattern;
-      SparseMatrix<double> system_matrix;
+    SparsityPattern      sparsity_pattern;
+    SparseMatrix<double> system_matrix;
 
-      Vector<double>       solution;
-      Vector<double>       system_rhs;
+    Vector<double>       solution;
+    Vector<double>       system_rhs;
   };
 
   template <int dim>
   LaplaceProblem<dim>::LaplaceProblem () :
-                 fe (1),
-                 dof_handler (triangulation)
+    fe (1),
+    dof_handler (triangulation)
   {}
 
   template <int dim>
@@ -265,20 +268,20 @@ namespace without_hp
     GridGenerator::hyper_cube (triangulation);
     triangulation.refine_global (2);
     deallog << "Number of active cells: "
-             << triangulation.n_active_cells()
-             << std::endl;
+            << triangulation.n_active_cells()
+            << std::endl;
     deallog << "Total number of cells: "
-             << triangulation.n_cells()
-             << std::endl;
+            << triangulation.n_cells()
+            << std::endl;
 
     dof_handler.distribute_dofs (fe);
     deallog << "Number of degrees of freedom: "
-             << dof_handler.n_dofs()
-             << std::endl;
+            << dof_handler.n_dofs()
+            << std::endl;
 
     sparsity_pattern.reinit (dof_handler.n_dofs(),
-                            dof_handler.n_dofs(),
-                            dof_handler.max_couplings_between_dofs());
+                             dof_handler.n_dofs(),
+                             dof_handler.max_couplings_between_dofs());
     DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
     sparsity_pattern.compress();
 
@@ -293,7 +296,7 @@ namespace without_hp
   {
     QGauss<dim>  quadrature_formula(2);
     FEValues<dim> fe_values (fe, quadrature_formula,
-                          update_values | update_gradients | update_JxW_values);
+                             update_values | update_gradients | update_JxW_values);
 
     const unsigned int   dofs_per_cell = fe.dofs_per_cell;
     const unsigned int   n_q_points    = quadrature_formula.size();
@@ -304,53 +307,53 @@ namespace without_hp
     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();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     for (; cell!=endc; ++cell)
       {
-       fe_values.reinit (cell);
+        fe_values.reinit (cell);
 
-       cell_matrix = 0;
-       cell_rhs = 0;
+        cell_matrix = 0;
+        cell_rhs = 0;
 
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-             cell_matrix(i,j) += (fe_values.shape_grad (i, q_point) *
-                                  fe_values.shape_grad (j, q_point) *
-                                  fe_values.JxW (q_point));
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+              cell_matrix(i,j) += (fe_values.shape_grad (i, q_point) *
+                                   fe_values.shape_grad (j, q_point) *
+                                   fe_values.JxW (q_point));
 
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-           cell_rhs(i) += (-2.0 * fe_values.shape_value (i, q_point) *
-                           fe_values.JxW (q_point));
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+            cell_rhs(i) += (-2.0 * fe_values.shape_value (i, q_point) *
+                            fe_values.JxW (q_point));
 
-       cell->get_dof_indices (local_dof_indices);
+        cell->get_dof_indices (local_dof_indices);
 
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           system_matrix.add (local_dof_indices[i],
-                              local_dof_indices[j],
-                              cell_matrix(i,j));
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            system_matrix.add (local_dof_indices[i],
+                               local_dof_indices[j],
+                               cell_matrix(i,j));
 
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         system_rhs(local_dof_indices[i]) += cell_rhs(i);
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          system_rhs(local_dof_indices[i]) += cell_rhs(i);
       }
 
 
     std::map<types::global_dof_index,double> boundary_values;
     VectorTools::interpolate_boundary_values (dof_handler,
-                                             0,
-                                             exact_solution,
-                                             boundary_values);
+                                              0,
+                                              exact_solution,
+                                              boundary_values);
     VectorTools::interpolate_boundary_values (dof_handler,
-                                             1,
-                                             exact_solution,
-                                             boundary_values);
+                                              1,
+                                              exact_solution,
+                                              boundary_values);
     MatrixTools::apply_boundary_values (boundary_values,
-                                       system_matrix,
-                                       solution,
-                                       system_rhs);
+                                        system_matrix,
+                                        solution,
+                                        system_rhs);
   }
 
   template <int dim>
@@ -360,7 +363,7 @@ namespace without_hp
     SolverCG<>              cg (solver_control);
 
     cg.solve (system_matrix, solution, system_rhs,
-             PreconditionIdentity());
+              PreconditionIdentity());
   }
 
   template <int dim>
@@ -388,7 +391,7 @@ void test ()
 
   sol1 -= sol2;
   Assert (sol1.l2_norm () <= 1e-8 * sol2.l2_norm(),
-         ExcInternalError());
+          ExcInternalError());
 }
 
 
index 1aa783367cfc884824f084d9fda7790d346882ee..97d96b92ac200c9df033202a2e76b93a88beaa89 100644 (file)
@@ -43,7 +43,7 @@ void test ()
   tria.refine_global (2);
   tria.begin_active()->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
-  tria.refine_global (1);  
+  tria.refine_global (1);
 
   const hp::FECollection<dim> fe_collection (FE_Q<dim> (1));
 
@@ -52,7 +52,7 @@ void test ()
 
   std::vector<types::global_dof_index> local_dof_indices (fe_collection[0].dofs_per_cell);
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-         cell=dof_handler.begin_active();
+       cell=dof_handler.begin_active();
        cell!=dof_handler.end(); ++cell)
     {
       cell->get_dof_indices (local_dof_indices);
@@ -69,12 +69,12 @@ int main ()
 {
   std::ofstream logfile("continuous_1d_01/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   test<1> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 6760793fe0e2b74d636c992c47cfebb54cd52769..bb78154e9d73d322b6b7783469b065f9c3644e1d 100644 (file)
@@ -43,7 +43,7 @@ void test ()
   tria.refine_global (2);
   tria.begin_active()->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
-  tria.refine_global (1);  
+  tria.refine_global (1);
 
   const hp::FECollection<dim> fe_collection (FE_Q<dim> (1));
 
@@ -52,7 +52,7 @@ void test ()
 
   std::vector<types::global_dof_index> local_dof_indices (fe_collection[0].dofs_per_cell);
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-         cell=dof_handler.begin_active();
+       cell=dof_handler.begin_active();
        cell!=dof_handler.end(); ++cell)
     {
       cell->get_dof_indices (local_dof_indices);
@@ -69,12 +69,12 @@ int main ()
 {
   std::ofstream logfile("continuous_2d_01/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   test<2> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 2338b1bd4c1927a2ab89bcfad3905c20a1d05b75..6573d7215f3b05c53ac789a84fb7964fe4fba94d 100644 (file)
@@ -43,7 +43,7 @@ void test ()
   tria.refine_global (2);
   tria.begin_active()->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
-  tria.refine_global (1);  
+  tria.refine_global (1);
 
   const hp::FECollection<dim> fe_collection (FE_Q<dim> (1));
 
@@ -52,7 +52,7 @@ void test ()
 
   std::vector<types::global_dof_index> local_dof_indices (fe_collection[0].dofs_per_cell);
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-         cell=dof_handler.begin_active();
+       cell=dof_handler.begin_active();
        cell!=dof_handler.end(); ++cell)
     {
       cell->get_dof_indices (local_dof_indices);
@@ -69,12 +69,12 @@ int main ()
 {
   std::ofstream logfile("continuous_3d_01/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 412a267b75a57e0c835c77673d9eb6f6b7644be6..d2cc4fe64eb749eb661a3aacdda30683cbe06648 100644 (file)
@@ -58,9 +58,9 @@ template <int dim>
 void
 check ()
 {
-                                   // create tria and dofhandler
-                                   // objects. set different boundary
-                                   // and sub-domain ids
+  // create tria and dofhandler
+  // objects. set different boundary
+  // and sub-domain ids
   Triangulation<dim> tria;
   GridGenerator::hyper_cube(tria, 0., 1.);
   tria.refine_global (1);
@@ -70,8 +70,8 @@ check ()
       tria.execute_coarsening_and_refinement ();
     }
 
-                                  // produce two copies of the Taylor-Hood
-                                  // element
+  // produce two copies of the Taylor-Hood
+  // element
   hp::FECollection<dim> fe;
   fe.push_back (FESystem<dim> (FE_Q<dim>(1), dim, FE_DGQ<dim>(0), 1));
   fe.push_back (FESystem<dim> (FE_Q<dim>(1), dim, FE_DGQ<dim>(0), 1));
@@ -79,14 +79,14 @@ check ()
   hp::DoFHandler<dim> dof_handler (tria);
 
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     cell->set_active_fe_index (std::rand() % fe.size());
 
   dof_handler.distribute_dofs (fe);
 
-                                  // no grouping
+  // no grouping
   {
     std::vector<types::global_dof_index> dpc(dim+1);
     DoFTools::count_dofs_per_component (dof_handler, dpc);
@@ -100,8 +100,8 @@ check ()
   }
 
 
-                                  // grouping into less groups than
-                                  // components
+  // grouping into less groups than
+  // components
   {
     std::vector<unsigned int> group(dim+1, 0);
     group[dim] = 1;
@@ -120,8 +120,8 @@ check ()
     print (dpc);
   }
 
-                                  // grouping into more groups than
-                                  // components
+  // grouping into more groups than
+  // components
   {
     std::vector<unsigned int> group(dim+1, 2*dim);
     group[dim] = 0;
index 71130fd2d142cfbcb6f114df7f894d2f03b7b924..a625d2c571372f79b4b6c4acfae607e49e91e4b3 100644 (file)
@@ -58,9 +58,9 @@ template <int dim>
 void
 check ()
 {
-                                   // create tria and dofhandler
-                                   // objects. set different boundary
-                                   // and sub-domain ids
+  // create tria and dofhandler
+  // objects. set different boundary
+  // and sub-domain ids
   Triangulation<dim> tria;
   GridGenerator::hyper_cube(tria, 0., 1.);
   tria.refine_global (1);
@@ -70,8 +70,8 @@ check ()
       tria.execute_coarsening_and_refinement ();
     }
 
-                                  // produce two copies of the Taylor-Hood
-                                  // element
+  // produce two copies of the Taylor-Hood
+  // element
   hp::FECollection<dim> fe;
   fe.push_back (FESystem<dim> (FE_Q<dim>(1), dim, FE_DGQ<dim>(0), 1));
   fe.push_back (FESystem<dim> (FE_Q<dim>(2), dim, FE_DGQ<dim>(1), 1));
@@ -79,14 +79,14 @@ check ()
   hp::DoFHandler<dim> dof_handler (tria);
 
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     cell->set_active_fe_index (std::rand() % fe.size());
 
   dof_handler.distribute_dofs (fe);
 
-                                  // no grouping
+  // no grouping
   {
     std::vector<types::global_dof_index> dpc(dim+1);
     DoFTools::count_dofs_per_component (dof_handler, dpc);
@@ -100,8 +100,8 @@ check ()
   }
 
 
-                                  // grouping into less groups than
-                                  // components
+  // grouping into less groups than
+  // components
   {
     std::vector<unsigned int> group(dim+1, 0);
     group[dim] = 1;
@@ -120,8 +120,8 @@ check ()
     print (dpc);
   }
 
-                                  // grouping into more groups than
-                                  // components
+  // grouping into more groups than
+  // components
   {
     std::vector<unsigned int> group(dim+1, 2*dim);
     group[dim] = 0;
index 0f8492c1374145b6ff3b24d4f4d55d18058a855a..7e29d3c900efccc5231f56fb96fad18627e1180e 100644 (file)
@@ -47,7 +47,7 @@ void test ()
 
   tria.refine_global(1);
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-         cell=dof_handler.begin_active();
+       cell=dof_handler.begin_active();
        cell!=dof_handler.end(); ++cell)
     cell->set_active_fe_index (0);
 }
@@ -57,14 +57,14 @@ int main ()
 {
   std::ofstream logfile("crash_01/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index f6decad190293a7195042dc1ca2976921c79cf9b..3d682d236d4a0f17ae17bb6219f51f5039773113 100644 (file)
@@ -46,7 +46,7 @@ void test ()
 
   hp::DoFHandler<dim> dof_handler(tria);
   dof_handler.distribute_dofs (fe_collection);
-  
+
   dof_handler.begin_active()->set_active_fe_index(0);
 }
 
@@ -56,14 +56,14 @@ int main ()
 {
   std::ofstream logfile("crash_02/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 6d03704b13df71657b36b84e619a557a0ee52614..542e435497a45639bb461e3e190a8540f84e2cbc 100644 (file)
@@ -44,7 +44,7 @@ void test ()
 
   hp::DoFHandler<dim> dof_handler(tria);
   dof_handler.distribute_dofs (fe_collection);
-  
+
   tria.refine_global (1);
   dof_handler.distribute_dofs (fe_collection);
 
@@ -53,7 +53,7 @@ void test ()
   dof_handler.distribute_dofs (fe_collection);
 
   tria.begin_active()->set_refine_flag ();
-  tria.execute_coarsening_and_refinement ();  
+  tria.execute_coarsening_and_refinement ();
   dof_handler.distribute_dofs (fe_collection);
 }
 
@@ -63,14 +63,14 @@ int main ()
 {
   std::ofstream logfile("crash_03/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index fa90221889a509d9c39c3933aef91154b66598cc..84abcc85f81683a9adfc5b7aa3b96ffdd421edd1 100644 (file)
@@ -55,14 +55,14 @@ int main ()
 {
   std::ofstream logfile("crash_04/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 01469e6f7249c6d3555586faf729cd6b3a454fc2..b8d518178a3998201d0c195d5545dd4859b3a312 100644 (file)
@@ -41,8 +41,8 @@ void test ()
   GridGenerator::hyper_cube(tria);
   tria.refine_global (1);
 
-                                  // use the same element, but with
-                                  // different indices
+  // use the same element, but with
+  // different indices
   hp::FECollection<dim> fe_collection;
   for (unsigned int i=0; i<tria.n_active_cells(); ++i)
     fe_collection.push_back(FE_Q<dim> (1));
@@ -51,19 +51,19 @@ void test ()
 
   unsigned int fe_index = 0;
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell != dof_handler.end(); ++cell, ++fe_index)
     {
       deallog << "Setting fe_index=" << fe_index << " on cell " << cell
-             << std::endl;
+              << std::endl;
       cell->set_active_fe_index (fe_index);
     }
-  
+
   dof_handler.distribute_dofs(fe_collection);
 
   std::vector<types::global_dof_index> local_dof_indices;
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-         cell=dof_handler.begin_active();
+       cell=dof_handler.begin_active();
        cell!=dof_handler.end(); ++cell)
     {
       local_dof_indices.resize (cell->get_fe().dofs_per_cell);
@@ -81,14 +81,14 @@ int main ()
 {
   std::ofstream logfile("crash_05/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index bb62ba56a03a0d0b2a1cc8c88c218526cf45e70d..eef030fe8ce1e49ee12cd201f0a219cb9c9fdbcd 100644 (file)
@@ -62,13 +62,13 @@ void test ();
 
 template <int dim>
 void do_check (const Triangulation<dim> &triangulation,
-              const hp::FECollection<dim> &fe)
-{  
+               const hp::FECollection<dim> &fe)
+{
   hp::DoFHandler<dim>        dof_handler(triangulation);
 
-                                  // distribute fe_indices randomly
+  // distribute fe_indices randomly
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell != dof_handler.end(); ++cell)
     cell->set_active_fe_index (rand() % fe.size());
   dof_handler.distribute_dofs (fe);
@@ -77,7 +77,7 @@ void do_check (const Triangulation<dim> &triangulation,
 
   ConstraintMatrix constraints;
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          constraints);
+                                           constraints);
   constraints.close ();
 
   constraints.print (deallog.get_file_stream());
@@ -91,7 +91,7 @@ void test_with_wrong_face_orientation (const hp::FECollection<3> &fe)
   GridGenerator::hyper_ball (triangulation);
   triangulation.begin_active()->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
-  
+
   do_check (triangulation, fe);
 }
 
@@ -101,7 +101,7 @@ int main ()
 {
   std::ofstream logfile(logname);
   logfile.precision (3);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
index 0fb0fbcdd02e5c4528bf5f8437c46f346a15c9fe..ff00e80c71d332a3fdd97042e77d68f1e26d899d 100644 (file)
@@ -50,7 +50,7 @@ int main ()
 {
   std::ofstream logfile(logname);
   logfile.precision (3);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
@@ -67,7 +67,7 @@ int main ()
   points_glob.push_back (Point<2> (0.5, 1.0));
   points_glob.push_back (Point<2> (0.0, 1.0));
 
-                                  // Prepare cell data
+  // Prepare cell data
   std::vector<CellData<2> > cells (3);
 
   cells[0].vertices[0] = 0;
@@ -93,17 +93,17 @@ int main ()
 
   triangulation.begin_active()->set_refine_flag();
   triangulation.execute_coarsening_and_refinement ();
-      
+
   hp::FECollection<2> fe;
   fe.push_back (FE_Q<2>(1));
   fe.push_back (FE_Q<2>(2));
 
   hp::DoFHandler<2>        dof_handler(triangulation);
 
-                                  // distribute fe_indices randomly
+  // distribute fe_indices randomly
   unsigned int cell_no = 0;
   for (hp::DoFHandler<2>::active_cell_iterator
-        cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell != dof_handler.end(); ++cell, ++cell_no)
     cell->set_active_fe_index (0);
   (++dof_handler.begin_active())->set_active_fe_index (1);
@@ -112,29 +112,29 @@ int main ()
   deallog << "n_dofs=" << dof_handler.n_dofs() << std::endl;
 
   for (hp::DoFHandler<2>::active_cell_iterator
-        cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell != dof_handler.end(); ++cell)
     {
       deallog << "Cell=" << cell << std::endl;
       deallog << "    vertices="
-             << cell->vertex_index(0) << ' '
-             << cell->vertex_index(1) << ' '
-             << cell->vertex_index(2) << ' '
-             << cell->vertex_index(3) << std::endl;
+              << cell->vertex_index(0) << ' '
+              << cell->vertex_index(1) << ' '
+              << cell->vertex_index(2) << ' '
+              << cell->vertex_index(3) << std::endl;
       deallog << "    active_fe_index=" << cell->active_fe_index() << std::endl;
 
       deallog << "    dofs=";
       std::vector<types::global_dof_index> local_dofs (fe[cell->active_fe_index()].dofs_per_cell);
       cell->get_dof_indices (local_dofs);
       for (unsigned int i=0; i<fe[cell->active_fe_index()].dofs_per_cell; ++i)
-       deallog << local_dofs[i] << ' ';
+        deallog << local_dofs[i] << ' ';
       deallog << std::endl;
     }
 
-  
+
   ConstraintMatrix constraints;
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          constraints);
+                                           constraints);
   constraints.close ();
 
   constraints.print (deallog.get_file_stream());
index db46918b6a46aae8d3715824330ec1195f4eb184..c7cd9adebd4ed2c1beb2e6300f91336cddb6337a 100644 (file)
@@ -51,21 +51,21 @@ int main ()
 {
   std::ofstream logfile(logname);
   logfile.precision (3);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
 
-                                  // create a mesh like this:
-                                  //
-                                  // *---*---*---*
-                                  // | 6 | 7 | 8 |
-                                  // *---*---*---*
-                                  // | 3 | 4 | 5 |
-                                  // *---*---*---*
-                                  // | 0 | 1 | 2 |
-                                  // *---*---*---*
+  // create a mesh like this:
+  //
+  // *---*---*---*
+  // | 6 | 7 | 8 |
+  // *---*---*---*
+  // | 3 | 4 | 5 |
+  // *---*---*---*
+  // | 0 | 1 | 2 |
+  // *---*---*---*
   Triangulation<2>     triangulation;
   GridGenerator::subdivided_hyper_cube (triangulation, 3);
 
@@ -76,21 +76,24 @@ int main ()
 
   hp::DoFHandler<2>        dof_handler(triangulation);
 
-                                  // subdivide cells 1, 3, 5, 7
+  // subdivide cells 1, 3, 5, 7
   hp::DoFHandler<2>::active_cell_iterator
-    cell = dof_handler.begin_active();
+  cell = dof_handler.begin_active();
   ++cell;
   cell->set_refine_flag ();
-  ++cell; ++cell;
+  ++cell;
+  ++cell;
   cell->set_refine_flag ();
-  ++cell; ++cell;
+  ++cell;
+  ++cell;
   cell->set_refine_flag ();
-  ++cell; ++cell;
+  ++cell;
+  ++cell;
   cell->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
 
-                                  // now set fe_index as described in the
-                                  // paper
+  // now set fe_index as described in the
+  // paper
   cell = dof_handler.begin_active();
   cell->set_active_fe_index (0);
   ++cell;
@@ -102,7 +105,7 @@ int main ()
   ++cell;
   cell->set_active_fe_index (0);
 
-                                  // one set of small cells
+  // one set of small cells
   ++cell;
   cell->set_active_fe_index (0);
   ++cell;
@@ -112,7 +115,7 @@ int main ()
   ++cell;
   cell->set_active_fe_index (2);
 
-                                  // one set of small cells
+  // one set of small cells
   ++cell;
   cell->set_active_fe_index (0);
   ++cell;
@@ -122,7 +125,7 @@ int main ()
   ++cell;
   cell->set_active_fe_index (0);
 
-                                  // one set of small cells
+  // one set of small cells
   ++cell;
   cell->set_active_fe_index (0);
   ++cell;
@@ -132,7 +135,7 @@ int main ()
   ++cell;
   cell->set_active_fe_index (0);
 
-                                  // one set of small cells
+  // one set of small cells
   ++cell;
   cell->set_active_fe_index (2);
   ++cell;
@@ -143,10 +146,10 @@ int main ()
   cell->set_active_fe_index (0);
 
   dof_handler.distribute_dofs (fe);
-  
+
   ConstraintMatrix constraints;
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          constraints);
+                                           constraints);
   constraints.close ();
 
   constraints.print (deallog.get_file_stream());
index adfd9a5c56be8b1f4fd9a93e57253d4a2b582c63..a7e4146d5d211349dfb7da8bafe66dbbbef82e65 100644 (file)
@@ -56,14 +56,14 @@ int main ()
   deallog.threshold_double(1.e-10);
 
 
-                                  // create a mesh like this (viewed
-                                  // from top):
-                                  //
-                                  // *---*---*
-                                  // | 2 | 3 |
-                                  // *---*---*
-                                  // | 0 | 1 |
-                                  // *---*---*
+  // create a mesh like this (viewed
+  // from top):
+  //
+  // *---*---*
+  // | 2 | 3 |
+  // *---*---*
+  // | 0 | 1 |
+  // *---*---*
   Triangulation<3>     triangulation;
   std::vector<unsigned int> subdivisions (3, 2);
   subdivisions[2] = 1;
@@ -77,31 +77,31 @@ int main ()
 
   hp::DoFHandler<3>        dof_handler(triangulation);
 
-                                  // assign polynomial degrees like this:
-                                   //
-                                  // *---*---*
-                                  // | 1 | 3 |
-                                  // *---*---*
-                                  // | 1 | 2 |
-                                  // *---*---*
-                                   //
-                                   // what happens here is that we
-                                   // first constraint the common face
-                                   // between cells 0 and 1, then
-                                   // between cells 1 and 3. During
-                                   // the latter operation, the line
-                                   // dofs of the Q3 are constrained
-                                   // against those of the lines dofs
-                                   // of the Q2. Later, we come back
-                                   // and do the face between cells 2
-                                   // and 3, where we want to
-                                   // constrain the line dofs of the
-                                   // Q3 again, but this time against
-                                   // a Q1. this leads to conflicts
-                                   // with the constraints previously
-                                   // entered
+  // assign polynomial degrees like this:
+  //
+  // *---*---*
+  // | 1 | 3 |
+  // *---*---*
+  // | 1 | 2 |
+  // *---*---*
+  //
+  // what happens here is that we
+  // first constraint the common face
+  // between cells 0 and 1, then
+  // between cells 1 and 3. During
+  // the latter operation, the line
+  // dofs of the Q3 are constrained
+  // against those of the lines dofs
+  // of the Q2. Later, we come back
+  // and do the face between cells 2
+  // and 3, where we want to
+  // constrain the line dofs of the
+  // Q3 again, but this time against
+  // a Q1. this leads to conflicts
+  // with the constraints previously
+  // entered
   hp::DoFHandler<3>::active_cell_iterator
-    cell = dof_handler.begin_active();
+  cell = dof_handler.begin_active();
   cell->set_active_fe_index (0);
   ++cell;
   cell->set_active_fe_index (1);
@@ -112,36 +112,36 @@ int main ()
 
   dof_handler.distribute_dofs (fe);
 
-                                   // for illustrative purposes, print
-                                   // out the numbers of the dofs that
-                                   // belong to the shared edge
-                                   // (that's the one that has three
-                                   // different fe indices associated
-                                   // with it). note that there is
-                                   // only one such line so we can
-                                   // quit the loop once we find it
+  // for illustrative purposes, print
+  // out the numbers of the dofs that
+  // belong to the shared edge
+  // (that's the one that has three
+  // different fe indices associated
+  // with it). note that there is
+  // only one such line so we can
+  // quit the loop once we find it
   for (hp::DoFHandler<3>::active_cell_iterator cell = dof_handler.begin_active();
        cell != dof_handler.end(); ++cell)
     for (unsigned int l=0; l<GeometryInfo<3>::lines_per_cell; ++l)
       if (cell->line(l)->n_active_fe_indices() == 3)
-       {
-         deallog << "Shared line: " << cell->line(l) << std::endl;
-         for (unsigned int i=0; i<3; ++i)
-           {
-             deallog << "DoF indices for fe_index=" << i << ": ";
-             std::vector<types::global_dof_index> line_dofs (fe[i].dofs_per_line + 2*fe[i].dofs_per_vertex);
-             cell->line(l)->get_dof_indices (line_dofs, i);
-             for (unsigned int j=0; j<fe[i].dofs_per_line + 2*fe[i].dofs_per_vertex; ++j)
-               deallog << line_dofs[j] << ' ';
-             deallog << std::endl;
-           }
-         goto done;
-       }
-  done:
+        {
+          deallog << "Shared line: " << cell->line(l) << std::endl;
+          for (unsigned int i=0; i<3; ++i)
+            {
+              deallog << "DoF indices for fe_index=" << i << ": ";
+              std::vector<types::global_dof_index> line_dofs (fe[i].dofs_per_line + 2*fe[i].dofs_per_vertex);
+              cell->line(l)->get_dof_indices (line_dofs, i);
+              for (unsigned int j=0; j<fe[i].dofs_per_line + 2*fe[i].dofs_per_vertex; ++j)
+                deallog << line_dofs[j] << ' ';
+              deallog << std::endl;
+            }
+          goto done;
+        }
+done:
 
   ConstraintMatrix constraints;
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          constraints);
+                                           constraints);
   constraints.close ();
 
   constraints.print (deallog.get_file_stream());
index 171acabff69a12532a4d061e6215c9fd93ea30f0..7bd8b60581159163c6c816efec6da20ae5aee1a7 100644 (file)
@@ -53,45 +53,45 @@ void test ()
   fe.push_back (fe_2);
   fe.push_back (fe_3);
   fe.push_back (fe_4);
-  
-  
-  
+
+
+
   GridGenerator::hyper_cube (triangulation, -1, 1);
   triangulation.refine_global (2);
   deallog << "Number of active cells: "
-           << triangulation.n_active_cells()
-           << std::endl;
+          << triangulation.n_active_cells()
+          << std::endl;
   deallog << "Total number of cells: "
-           << triangulation.n_cells()
-           << std::endl;
+          << triangulation.n_cells()
+          << std::endl;
 
-                                  // Now to the p-Method. Assign
-                                  // random active_fe_indices to the
-                                  // different cells.
+  // Now to the p-Method. Assign
+  // random active_fe_indices to the
+  // different cells.
   typename hp::DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active (),
-                                                    endc = dof_handler.end ();
+                                                     endc = dof_handler.end ();
   for (; cell != endc; ++cell)
     cell->set_active_fe_index (random() % fe.size());
-  
+
   dof_handler.distribute_dofs (fe);
 
   cell = dof_handler.begin_active ();
   for (; cell != endc; ++cell)
     for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
       {
-       deallog << "cell=" << cell << ", face=" << f
-               << ", fe_index=" << cell->active_fe_index()
-               << ", dofs=";
-       std::vector<types::global_dof_index> dofs (fe[cell->active_fe_index()].dofs_per_face);
-       cell->face(f)->get_dof_indices (dofs,
-                                       cell->active_fe_index());
-       for (unsigned int i=0; i<dofs.size(); ++i)
-         deallog << dofs[i] << ' ';
-       deallog << std::endl;
+        deallog << "cell=" << cell << ", face=" << f
+                << ", fe_index=" << cell->active_fe_index()
+                << ", dofs=";
+        std::vector<types::global_dof_index> dofs (fe[cell->active_fe_index()].dofs_per_face);
+        cell->face(f)->get_dof_indices (dofs,
+                                        cell->active_fe_index());
+        for (unsigned int i=0; i<dofs.size(); ++i)
+          deallog << dofs[i] << ' ';
+        deallog << std::endl;
       }
-  
+
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          hanging_node_constraints);
+                                           hanging_node_constraints);
 
   hanging_node_constraints.print (deallog.get_file_stream ());
 
@@ -99,22 +99,22 @@ void test ()
 }
 
 
-int main () 
+int main ()
 {
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
-                                  // this test depends on the right
-                                  // starting value of the random
-                                  // number generator. set it to the
-                                  // same value it has in
-                                  // hp_hanging_nodes_02
+  // this test depends on the right
+  // starting value of the random
+  // number generator. set it to the
+  // same value it has in
+  // hp_hanging_nodes_02
   for (unsigned int i=0; i<64; ++i)
     random ();
   test<3> ();
-      
+
   return 0;
 }
index e68e755af5b0deddf80d97c7ed18a77f70ee3809..82591c97d2c3c89c47acb395a6df2efd0aafcb02 100644 (file)
@@ -56,14 +56,14 @@ int main ()
   deallog.threshold_double(1.e-10);
 
 
-                                  // create a mesh like this (viewed
-                                  // from top):
-                                  //
-                                  // *---*---*
-                                  // | 2 | 3 |
-                                  // *---*---*
-                                  // | 0 | 1 |
-                                  // *---*---*
+  // create a mesh like this (viewed
+  // from top):
+  //
+  // *---*---*
+  // | 2 | 3 |
+  // *---*---*
+  // | 0 | 1 |
+  // *---*---*
   Triangulation<3>     triangulation;
   std::vector<unsigned int> subdivisions (3, 2);
   subdivisions[2] = 1;
@@ -78,16 +78,16 @@ int main ()
 
   hp::DoFHandler<3>        dof_handler(triangulation);
 
-                                  // assign polynomial degrees like this:
-                                   //
-                                  // *---*---*
-                                  // | 1 | 2 |
-                                  // *---*---*
-                                  // | 4 | 3 |
-                                  // *---*---*
-                                   //
+  // assign polynomial degrees like this:
+  //
+  // *---*---*
+  // | 1 | 2 |
+  // *---*---*
+  // | 4 | 3 |
+  // *---*---*
+  //
   hp::DoFHandler<3>::active_cell_iterator
-    cell = dof_handler.begin_active();
+  cell = dof_handler.begin_active();
   cell->set_active_fe_index (0);
   ++cell;
   cell->set_active_fe_index (1);
@@ -98,37 +98,37 @@ int main ()
 
   dof_handler.distribute_dofs (fe);
 
-                                   // for illustrative purposes, print
-                                   // out the numbers of the dofs that
-                                   // belong to the shared edge
-                                   // (that's the one that has four
-                                   // different fe indices associated
-                                   // with it). note that there is
-                                   // only one such line so we can
-                                   // quit the loop once we find it
+  // for illustrative purposes, print
+  // out the numbers of the dofs that
+  // belong to the shared edge
+  // (that's the one that has four
+  // different fe indices associated
+  // with it). note that there is
+  // only one such line so we can
+  // quit the loop once we find it
   for (hp::DoFHandler<3>::active_cell_iterator cell = dof_handler.begin_active();
        cell != dof_handler.end(); ++cell)
     for (unsigned int l=0; l<GeometryInfo<3>::lines_per_cell; ++l)
       if (cell->line(l)->n_active_fe_indices() == 4)
-       {
-         deallog << "Shared line: " << cell->line(l) << std::endl;
-         for (unsigned int i=0; i<4; ++i)
-           {
-             deallog << "DoF indices for fe_index=" << i << ": ";
-             std::vector<types::global_dof_index> line_dofs (fe[i].dofs_per_line + 2*fe[i].dofs_per_vertex);
-             cell->line(l)->get_dof_indices (line_dofs, i);
-             for (unsigned int j=0; j<fe[i].dofs_per_line + 2*fe[i].dofs_per_vertex; ++j)
-               deallog << line_dofs[j] << ' ';
-             deallog << std::endl;
-           }
-
-         goto done;
-       }
-  done:
+        {
+          deallog << "Shared line: " << cell->line(l) << std::endl;
+          for (unsigned int i=0; i<4; ++i)
+            {
+              deallog << "DoF indices for fe_index=" << i << ": ";
+              std::vector<types::global_dof_index> line_dofs (fe[i].dofs_per_line + 2*fe[i].dofs_per_vertex);
+              cell->line(l)->get_dof_indices (line_dofs, i);
+              for (unsigned int j=0; j<fe[i].dofs_per_line + 2*fe[i].dofs_per_vertex; ++j)
+                deallog << line_dofs[j] << ' ';
+              deallog << std::endl;
+            }
+
+          goto done;
+        }
+done:
 
   ConstraintMatrix constraints;
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          constraints);
+                                           constraints);
   constraints.close ();
 
   constraints.print (deallog.get_file_stream());
index c60e4a4c045b7e361a8ed94da66b3af2e32feb10..3b1f65d9cdf208ad98b085f93a566941d1bda251 100644 (file)
@@ -57,22 +57,22 @@ char logname[] = "crash_12/output";
 template <int dim>
 void test ()
 {
-                                  // create a mesh like this (viewed
-                                  // from top, if in 3d):
-                                  // *---*---*
-                                  // | 0 | 1 |
-                                  // *---*---*
+  // create a mesh like this (viewed
+  // from top, if in 3d):
+  // *---*---*
+  // | 0 | 1 |
+  // *---*---*
   Triangulation<dim>     triangulation;
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle (triangulation, subdivisions,
                                              Point<dim>(),
-                                            (dim == 3 ?
-                                             Point<dim>(2,1,1) :
-                                             Point<dim>(2,1)));
+                                             (dim == 3 ?
+                                              Point<dim>(2,1,1) :
+                                              Point<dim>(2,1)));
   (++triangulation.begin_active())->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
-  
+
   hp::FECollection<dim> fe;
   fe.push_back (FE_Q<dim>(1));
   fe.push_back (FE_Q<dim>(2));
@@ -85,28 +85,28 @@ void test ()
   for (unsigned int i=0; i<fe.size(); ++i)
     for (unsigned int j=0; j<fe.size(); ++j)
       {
-       deallog << "Testing " << fe[i].get_name()
-               << " vs. " << fe[j].get_name()
-               << std::endl;
-       
-                                        // set fe on coarse cell to 'i', on
-                                        // all fine cells to 'j'
-       typename hp::DoFHandler<dim>::active_cell_iterator
-         cell = dof_handler.begin_active();
-       cell->set_active_fe_index (i);
-       ++cell;
-
-       for (; cell != dof_handler.end(); ++cell)
-         cell->set_active_fe_index (j);
-
-       dof_handler.distribute_dofs (fe);
-  
-       ConstraintMatrix constraints;
-       DoFTools::make_hanging_node_constraints (dof_handler,
-                                                constraints);
-       constraints.close ();
-       
-       constraints.print (deallog.get_file_stream());
+        deallog << "Testing " << fe[i].get_name()
+                << " vs. " << fe[j].get_name()
+                << std::endl;
+
+        // set fe on coarse cell to 'i', on
+        // all fine cells to 'j'
+        typename hp::DoFHandler<dim>::active_cell_iterator
+        cell = dof_handler.begin_active();
+        cell->set_active_fe_index (i);
+        ++cell;
+
+        for (; cell != dof_handler.end(); ++cell)
+          cell->set_active_fe_index (j);
+
+        dof_handler.distribute_dofs (fe);
+
+        ConstraintMatrix constraints;
+        DoFTools::make_hanging_node_constraints (dof_handler,
+                                                 constraints);
+        constraints.close ();
+
+        constraints.print (deallog.get_file_stream());
       }
 }
 
@@ -116,7 +116,7 @@ int main ()
 {
   std::ofstream logfile(logname);
   logfile.precision (4);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
index cd2912500a0656132579a96324a7024ef01aa429..382ef96148a5b195673fe8fdecca0e695b421b67 100644 (file)
@@ -31,9 +31,9 @@ void test ()
 {
   hp::FECollection<dim> fe;
   fe.push_back (FESystem<dim>(FE_Q<dim>(1), 1,
-                             FE_DGQ<dim>(0), 1));
+                              FE_DGQ<dim>(0), 1));
   fe.push_back (FESystem<dim>(FE_Q<dim>(1), 1,
-                             FE_DGQ<dim>(1), 1));
-  
+                              FE_DGQ<dim>(1), 1));
+
   test_no_hanging_nodes (fe);
 }
index a33c8c3ceb4c2349db9abcfd434ad7978bf225f5..6cc1a6f94187ea3d356a22033f77a3a17ad79c7e 100644 (file)
@@ -49,62 +49,62 @@ void test ()
     {
       hp::FECollection<dim> fe_collection;
       for (unsigned int i=0; i<tria.n_active_cells(); ++i)
-       fe_collection.push_back(FESystem<dim> (FE_Q<dim> (k), 1,
-                                              FE_DGQ<dim> (i % 4), 1));
+        fe_collection.push_back(FESystem<dim> (FE_Q<dim> (k), 1,
+                                               FE_DGQ<dim> (i % 4), 1));
 
       hp::DoFHandler<dim> dof_handler(tria);
 
       unsigned int fe_index = 0;
       for (typename hp::DoFHandler<dim>::active_cell_iterator
-            cell = dof_handler.begin_active();
-          cell != dof_handler.end(); ++cell, ++fe_index)
-       {
-         deallog << "Setting fe_index=" << fe_index << " on cell " << cell
-                 << std::endl;
-         cell->set_active_fe_index (fe_index);
-       }
-  
+           cell = dof_handler.begin_active();
+           cell != dof_handler.end(); ++cell, ++fe_index)
+        {
+          deallog << "Setting fe_index=" << fe_index << " on cell " << cell
+                  << std::endl;
+          cell->set_active_fe_index (fe_index);
+        }
+
       dof_handler.distribute_dofs(fe_collection);
 
       std::vector<types::global_dof_index> face_dof_indices;
       std::vector<types::global_dof_index> neighbor_face_dof_indices;
       for (typename hp::DoFHandler<dim>::active_cell_iterator
-            cell=dof_handler.begin_active();
-          cell!=dof_handler.end(); ++cell)
-       for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
-         if (!cell->at_boundary(face))
-           {
-             Assert (cell->get_fe().dofs_per_face
-                     ==
-                     cell->neighbor(face)->get_fe().dofs_per_face,
-                     ExcInternalError());
-
-             face_dof_indices.resize (cell->get_fe().dofs_per_face);
-             neighbor_face_dof_indices.resize (cell->neighbor(face)
-                                               ->get_fe().dofs_per_face);
-         
-             cell->face(face)->get_dof_indices (face_dof_indices,
-                                                cell->active_fe_index());
-             cell->face(face)->get_dof_indices (neighbor_face_dof_indices,
-                                                cell->neighbor(face)
-                                                ->active_fe_index());
-
-             deallog << "cell=" << cell << ", face=" << face << std::endl;
-             deallog << "fe1=" << cell->get_fe().get_name()
-                     << ", fe2=" << cell->neighbor(face)->get_fe().get_name()
-                     << std::endl;
-             
-             for (unsigned int i=0; i<face_dof_indices.size(); ++i)
-               {
-                 deallog << face_dof_indices[i] << std::endl;
-
-                 Assert (face_dof_indices[i] ==
-                         neighbor_face_dof_indices[i],
-                         ExcInternalError());
-               }
-         
-             deallog << std::endl;
-           }
+           cell=dof_handler.begin_active();
+           cell!=dof_handler.end(); ++cell)
+        for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
+          if (!cell->at_boundary(face))
+            {
+              Assert (cell->get_fe().dofs_per_face
+                      ==
+                      cell->neighbor(face)->get_fe().dofs_per_face,
+                      ExcInternalError());
+
+              face_dof_indices.resize (cell->get_fe().dofs_per_face);
+              neighbor_face_dof_indices.resize (cell->neighbor(face)
+                                                ->get_fe().dofs_per_face);
+
+              cell->face(face)->get_dof_indices (face_dof_indices,
+                                                 cell->active_fe_index());
+              cell->face(face)->get_dof_indices (neighbor_face_dof_indices,
+                                                 cell->neighbor(face)
+                                                 ->active_fe_index());
+
+              deallog << "cell=" << cell << ", face=" << face << std::endl;
+              deallog << "fe1=" << cell->get_fe().get_name()
+                      << ", fe2=" << cell->neighbor(face)->get_fe().get_name()
+                      << std::endl;
+
+              for (unsigned int i=0; i<face_dof_indices.size(); ++i)
+                {
+                  deallog << face_dof_indices[i] << std::endl;
+
+                  Assert (face_dof_indices[i] ==
+                          neighbor_face_dof_indices[i],
+                          ExcInternalError());
+                }
+
+              deallog << std::endl;
+            }
     }
 }
 
@@ -113,13 +113,13 @@ int main ()
 {
   std::ofstream logfile("crash_14/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index a8e1a6d1c89b7237366b870db9484335a1d2e291..553061d0073efb0713f55ff6acf519777d195814 100644 (file)
@@ -53,68 +53,68 @@ void test ()
   hp::FECollection<dim> fe_collection;
   for (unsigned int i=0; i<tria.n_active_cells(); ++i)
     fe_collection.push_back(FESystem<dim> (FE_Q<dim> (2), 1,
-                                          FE_DGQ<dim> (i % 4), 1));
+                                           FE_DGQ<dim> (i % 4), 1));
 
   hp::DoFHandler<dim> dof_handler(tria);
 
   unsigned int fe_index = 0;
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell != dof_handler.end(); ++cell, ++fe_index)
     {
       deallog << "Setting fe_index=" << fe_index << " on cell " << cell
-             << std::endl;
+              << std::endl;
       cell->set_active_fe_index (fe_index);
     }
-  
+
   dof_handler.distribute_dofs(fe_collection);
 
   std::vector<types::global_dof_index> line_dof_indices_1 (fe_collection[0].dofs_per_line +
-                                               2 * fe_collection[0].dofs_per_vertex);
+                                                           2 * fe_collection[0].dofs_per_vertex);
   std::vector<types::global_dof_index> line_dof_indices_2 (fe_collection[0].dofs_per_line +
-                                               2 * fe_collection[0].dofs_per_vertex);
+                                                           2 * fe_collection[0].dofs_per_vertex);
 
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell=dof_handler.begin_active();
+       cell=dof_handler.begin_active();
        cell!=dof_handler.end(); ++cell)
     for (unsigned int line=0; line<GeometryInfo<dim>::lines_per_cell; ++line)
       if (cell->line(line)->n_active_fe_indices() > 1)
-       {
-         deallog << "line=" << cell->line(line)
-                 << std::endl;
-         for (unsigned int i=0; i<cell->line(line)->n_active_fe_indices(); ++i)
-           {
-             deallog << "  active_fe_index="
-                     << cell->line(line)->nth_active_fe_index(i)
-                     << " ("
-                     << fe_collection[cell->line(line)->nth_active_fe_index(i)].get_name()
-                     << ")"
-                     << std::endl;
-             
-             cell->line(line)->get_dof_indices (line_dof_indices_1,
-                                                cell->line(line)->nth_active_fe_index(i));
-             deallog << "  dof indices=";
-             for (unsigned int p=0; p<line_dof_indices_1.size(); ++p)
-               deallog << line_dof_indices_1[p] << ' ';
-             deallog << std::endl;
-           }
-         
-                       
-                                          // if there are multiple active fe
-                                          // indices, make sure that all their
-                                          // fe indices were unified
-         for (unsigned int i=0; i<cell->line(line)->n_active_fe_indices(); ++i)
-           for (unsigned int j=i+1; j<cell->line(line)->n_active_fe_indices(); ++j)
-             {
-               cell->line(line)->get_dof_indices (line_dof_indices_1,
-                                                  cell->line(line)->nth_active_fe_index(i));
-               cell->line(line)->get_dof_indices (line_dof_indices_2,
-                                                  cell->line(line)->nth_active_fe_index(j));
-
-               Assert (line_dof_indices_1 == line_dof_indices_2,
-                       ExcInternalError());
-             }
-       }
+        {
+          deallog << "line=" << cell->line(line)
+                  << std::endl;
+          for (unsigned int i=0; i<cell->line(line)->n_active_fe_indices(); ++i)
+            {
+              deallog << "  active_fe_index="
+                      << cell->line(line)->nth_active_fe_index(i)
+                      << " ("
+                      << fe_collection[cell->line(line)->nth_active_fe_index(i)].get_name()
+                      << ")"
+                      << std::endl;
+
+              cell->line(line)->get_dof_indices (line_dof_indices_1,
+                                                 cell->line(line)->nth_active_fe_index(i));
+              deallog << "  dof indices=";
+              for (unsigned int p=0; p<line_dof_indices_1.size(); ++p)
+                deallog << line_dof_indices_1[p] << ' ';
+              deallog << std::endl;
+            }
+
+
+          // if there are multiple active fe
+          // indices, make sure that all their
+          // fe indices were unified
+          for (unsigned int i=0; i<cell->line(line)->n_active_fe_indices(); ++i)
+            for (unsigned int j=i+1; j<cell->line(line)->n_active_fe_indices(); ++j)
+              {
+                cell->line(line)->get_dof_indices (line_dof_indices_1,
+                                                   cell->line(line)->nth_active_fe_index(i));
+                cell->line(line)->get_dof_indices (line_dof_indices_2,
+                                                   cell->line(line)->nth_active_fe_index(j));
+
+                Assert (line_dof_indices_1 == line_dof_indices_2,
+                        ExcInternalError());
+              }
+        }
 }
 
 
@@ -122,13 +122,13 @@ int main ()
 {
   std::ofstream logfile("crash_15/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 4241fc90cb43c8a760fccadd1ab6be14748a5d4f..395d2778118d845a546b3021108a8720c8df2e05 100644 (file)
@@ -56,7 +56,7 @@ void test ()
   for (unsigned int i=1; i<4; ++i)
     for (unsigned int j=0; j<4; ++j)
       fe.push_back (FESystem<dim>(FE_Q<dim>(i), 1,
-                                 FE_DGQ<dim>(j), 1));
+                                  FE_DGQ<dim>(j), 1));
 
   Triangulation<dim>     triangulation;
   GridGenerator::hyper_cube (triangulation);
@@ -64,69 +64,69 @@ void test ()
 
   hp::DoFHandler<dim>        dof_handler(triangulation);
 
-                                  // distribute fe_indices randomly
+  // distribute fe_indices randomly
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell != dof_handler.end(); ++cell)
     cell->set_active_fe_index (rand() % fe.size());
   dof_handler.distribute_dofs (fe);
 
-                                  // loop over all lines and make sure that
-                                  // all the DoF indices on these lines are
-                                  // identical
+  // loop over all lines and make sure that
+  // all the DoF indices on these lines are
+  // identical
   std::vector<types::global_dof_index> indices_1;
   std::vector<types::global_dof_index> indices_2;
 
   std::set<unsigned int> line_already_treated;
 
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell != dof_handler.end(); ++cell)
     for (unsigned int l=0; l<GeometryInfo<dim>::lines_per_cell; ++l)
       if (line_already_treated.find (cell->line(l)->index())
-         == line_already_treated.end())
-                                        // line not yet treated
-       {
-         const typename hp::DoFHandler<dim>::active_line_iterator
-           line = cell->line(l);
-         deallog << "line=" << line << std::endl;
-         line_already_treated.insert (line->index());
-
-         for (unsigned int f=0; f<line->n_active_fe_indices(); ++f)
-           {
-             indices_1.resize (fe[line->nth_active_fe_index(f)].dofs_per_line +
-                               2 * fe[line->nth_active_fe_index(f)].dofs_per_vertex);
-             line->get_dof_indices (indices_1,
-                                    line->nth_active_fe_index(f));
-
-             deallog << "  fe index=" << line->nth_active_fe_index(f)
-                     << ", indices=";
-             for (unsigned int i=0; i<indices_1.size(); ++i)
-               deallog << indices_1[i] << ' ';
-
-             deallog << std::endl;
-           }
-
-         for (unsigned int f=0; f<line->n_active_fe_indices(); ++f)
-           {
-             indices_1.resize (fe[line->nth_active_fe_index(f)].dofs_per_line +
-                               2 * fe[line->nth_active_fe_index(f)].dofs_per_vertex);
-             line->get_dof_indices (indices_1,
-                                    line->nth_active_fe_index(f));
-             for (unsigned int g=f+1; g<line->n_active_fe_indices(); ++g)
-               if (fe[line->nth_active_fe_index(f)].dofs_per_line
-                   ==
-                   fe[line->nth_active_fe_index(g)].dofs_per_line)
-                 {
-                   indices_2.resize (fe[line->nth_active_fe_index(g)].dofs_per_line +
-                                     2 * fe[line->nth_active_fe_index(g)].dofs_per_vertex);
-                   line->get_dof_indices (indices_2,
-                                          line->nth_active_fe_index(g));
-                   Assert (indices_1 == indices_2,
-                           ExcInternalError());
-                 }
-           }
-       }
+          == line_already_treated.end())
+        // line not yet treated
+        {
+          const typename hp::DoFHandler<dim>::active_line_iterator
+          line = cell->line(l);
+          deallog << "line=" << line << std::endl;
+          line_already_treated.insert (line->index());
+
+          for (unsigned int f=0; f<line->n_active_fe_indices(); ++f)
+            {
+              indices_1.resize (fe[line->nth_active_fe_index(f)].dofs_per_line +
+                                2 * fe[line->nth_active_fe_index(f)].dofs_per_vertex);
+              line->get_dof_indices (indices_1,
+                                     line->nth_active_fe_index(f));
+
+              deallog << "  fe index=" << line->nth_active_fe_index(f)
+                      << ", indices=";
+              for (unsigned int i=0; i<indices_1.size(); ++i)
+                deallog << indices_1[i] << ' ';
+
+              deallog << std::endl;
+            }
+
+          for (unsigned int f=0; f<line->n_active_fe_indices(); ++f)
+            {
+              indices_1.resize (fe[line->nth_active_fe_index(f)].dofs_per_line +
+                                2 * fe[line->nth_active_fe_index(f)].dofs_per_vertex);
+              line->get_dof_indices (indices_1,
+                                     line->nth_active_fe_index(f));
+              for (unsigned int g=f+1; g<line->n_active_fe_indices(); ++g)
+                if (fe[line->nth_active_fe_index(f)].dofs_per_line
+                    ==
+                    fe[line->nth_active_fe_index(g)].dofs_per_line)
+                  {
+                    indices_2.resize (fe[line->nth_active_fe_index(g)].dofs_per_line +
+                                      2 * fe[line->nth_active_fe_index(g)].dofs_per_vertex);
+                    line->get_dof_indices (indices_2,
+                                           line->nth_active_fe_index(g));
+                    Assert (indices_1 == indices_2,
+                            ExcInternalError());
+                  }
+            }
+        }
 }
 
 
index eceee8dbcc1d39c66c8b0e4b8dc4823040410b5b..2aa83bc5e0478e1c1d72a8eb95d8e7d363dd208e 100644 (file)
@@ -59,44 +59,44 @@ char logname[] = "crash_17/output";
 
 #include <complex>
 
-                                // Finally, this is as in previous
-                                // programs:
+// Finally, this is as in previous
+// programs:
 using namespace dealii;
 
 template <int dim>
-class LaplaceProblem 
+class LaplaceProblem
 {
-  public:
-    LaplaceProblem ();
-    ~LaplaceProblem ();
+public:
+  LaplaceProblem ();
+  ~LaplaceProblem ();
 
-    void run ();
-    
-  private:
-    void setup_system ();
-    void assemble_system ();
-    void solve ();
-    void create_coarse_grid ();
-    void refine_grid ();
-    void estimate_smoothness (Vector<float> &smoothness_indicators) const;
-    void output_results (const unsigned int cycle) const;
+  void run ();
 
-    Triangulation<dim>   triangulation;
+private:
+  void setup_system ();
+  void assemble_system ();
+  void solve ();
+  void create_coarse_grid ();
+  void refine_grid ();
+  void estimate_smoothness (Vector<float> &smoothness_indicators) const;
+  void output_results (const unsigned int cycle) const;
 
-    hp::DoFHandler<dim>      dof_handler;
-    hp::FECollection<dim>    fe_collection;
-    hp::QCollection<dim>     quadrature_collection;
-    hp::QCollection<dim-1>   face_quadrature_collection;
+  Triangulation<dim>   triangulation;
 
-    ConstraintMatrix     hanging_node_constraints;
+  hp::DoFHandler<dim>      dof_handler;
+  hp::FECollection<dim>    fe_collection;
+  hp::QCollection<dim>     quadrature_collection;
+  hp::QCollection<dim-1>   face_quadrature_collection;
 
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> system_matrix;
+  ConstraintMatrix     hanging_node_constraints;
 
-    Vector<double>       solution;
-    Vector<double>       system_rhs;
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> system_matrix;
 
-    Timer distr, condense, hang;
+  Vector<double>       solution;
+  Vector<double>       system_rhs;
+
+  Timer distr, condense, hang;
 };
 
 
@@ -104,18 +104,18 @@ class LaplaceProblem
 template <int dim>
 class RightHandSide : public Function<dim>
 {
-  public:
-    RightHandSide () : Function<dim> () {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const;
+public:
+  RightHandSide () : Function<dim> () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const;
 };
 
 
 template <int dim>
 double
 RightHandSide<dim>::value (const Point<dim>   &p,
-                          const unsigned int  /*component*/) const
+                           const unsigned int  /*component*/) const
 {
   double product = 1;
   for (unsigned int d=0; d<dim; ++d)
@@ -128,7 +128,7 @@ RightHandSide<dim>::value (const Point<dim>   &p,
 
 template <int dim>
 LaplaceProblem<dim>::LaplaceProblem () :
-               dof_handler (triangulation)
+  dof_handler (triangulation)
 {
   for (unsigned int degree=2; degree<5; ++degree)
     {
@@ -140,7 +140,7 @@ LaplaceProblem<dim>::LaplaceProblem () :
 
 
 template <int dim>
-LaplaceProblem<dim>::~LaplaceProblem () 
+LaplaceProblem<dim>::~LaplaceProblem ()
 {
   dof_handler.clear ();
 }
@@ -160,7 +160,7 @@ void LaplaceProblem<dim>::setup_system ()
   hang.reset();
   hang.start();
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          hanging_node_constraints);
+                                           hanging_node_constraints);
   hanging_node_constraints.write_dot (deallog.get_file_stream());
   hanging_node_constraints.close ();
   hang.stop();
@@ -168,46 +168,46 @@ void LaplaceProblem<dim>::setup_system ()
   if (dim < 3)
     {
       sparsity_pattern.reinit (dof_handler.n_dofs(),
-                              dof_handler.n_dofs(),
-                              dof_handler.max_couplings_between_dofs());
+                               dof_handler.n_dofs(),
+                               dof_handler.max_couplings_between_dofs());
       DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
 
       condense.reset();
       condense.start();
       hanging_node_constraints.condense (sparsity_pattern);
       condense.stop();
-      sparsity_pattern.compress();      
+      sparsity_pattern.compress();
     }
   else
     {
       CompressedSparsityPattern csp (dof_handler.n_dofs(),
-                                    dof_handler.n_dofs());
+                                     dof_handler.n_dofs());
       DoFTools::make_sparsity_pattern (dof_handler, csp);
 
       condense.reset();
       condense.start();
       hanging_node_constraints.condense (csp);
       condense.stop();
-      
+
       sparsity_pattern.copy_from (csp);
-    }  
+    }
 
   system_matrix.reinit (sparsity_pattern);
 }
 
 template <int dim>
-void LaplaceProblem<dim>::assemble_system () 
+void LaplaceProblem<dim>::assemble_system ()
 {
   hp::FEValues<dim> hp_fe_values (fe_collection,
-                                 quadrature_collection, 
-                                 update_values    |  update_gradients |
-                                 update_q_points  |  update_JxW_values);
+                                  quadrature_collection,
+                                  update_values    |  update_gradients |
+                                  update_q_points  |  update_JxW_values);
 
   const RightHandSide<dim> rhs_function;
-  
+
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       const unsigned int   dofs_per_cell = cell->get_fe().dofs_per_cell;
@@ -220,36 +220,36 @@ void LaplaceProblem<dim>::assemble_system ()
       cell_rhs = 0;
 
       hp_fe_values.reinit (cell);
-      
+
       const FEValues<dim> &fe_values = hp_fe_values.get_present_fe_values ();
 
       std::vector<double>  rhs_values (fe_values.n_quadrature_points);
       rhs_function.value_list (fe_values.get_quadrature_points(),
-                              rhs_values);
-      
+                               rhs_values);
+
       for (unsigned int q_point=0; q_point<fe_values.n_quadrature_points; ++q_point)
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         {
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += (fe_values.shape_grad(i,q_point) *
-                                  fe_values.shape_grad(j,q_point) *
-                                  fe_values.JxW(q_point));
-
-           cell_rhs(i) += (fe_values.shape_value(i,q_point) *
-                           rhs_values[q_point] *
-                           fe_values.JxW(q_point));
-         }
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += (fe_values.shape_grad(i,q_point) *
+                                   fe_values.shape_grad(j,q_point) *
+                                   fe_values.JxW(q_point));
+
+            cell_rhs(i) += (fe_values.shape_value(i,q_point) *
+                            rhs_values[q_point] *
+                            fe_values.JxW(q_point));
+          }
 
       cell->get_dof_indices (local_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           system_matrix.add (local_dof_indices[i],
-                              local_dof_indices[j],
-                              cell_matrix(i,j));
-         
-         system_rhs(local_dof_indices[i]) += cell_rhs(i);
-       }
+        {
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            system_matrix.add (local_dof_indices[i],
+                               local_dof_indices[j],
+                               cell_matrix(i,j));
+
+          system_rhs(local_dof_indices[i]) += cell_rhs(i);
+        }
     }
 
   condense.start();
@@ -258,27 +258,27 @@ void LaplaceProblem<dim>::assemble_system ()
   condense.stop();
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           ZeroFunction<dim>(),
-                                           boundary_values);
+                                            0,
+                                            ZeroFunction<dim>(),
+                                            boundary_values);
   MatrixTools::apply_boundary_values (boundary_values,
-                                     system_matrix,
-                                     solution,
-                                     system_rhs);
+                                      system_matrix,
+                                      solution,
+                                      system_rhs);
 }
 
 template <int dim>
-void LaplaceProblem<dim>::solve () 
+void LaplaceProblem<dim>::solve ()
 {
   SolverControl           solver_control (system_rhs.size(),
-                                         1e-8*system_rhs.l2_norm());
+                                          1e-8*system_rhs.l2_norm());
   SolverCG<>              cg (solver_control);
 
   PreconditionSSOR<> preconditioner;
   preconditioner.initialize(system_matrix, 1.2);
 
   cg.solve (system_matrix, solution, system_rhs,
-           preconditioner);
+            preconditioner);
 
   hanging_node_constraints.distribute (solution);
 }
@@ -286,7 +286,7 @@ void LaplaceProblem<dim>::solve ()
 
 unsigned int
 int_pow (const unsigned int x,
-        const unsigned int n)
+         const unsigned int n)
 {
   unsigned int p=1;
   for (unsigned int i=0; i<n; ++i)
@@ -302,220 +302,220 @@ estimate_smoothness (Vector<float> &smoothness_indicators) const
 {
   const unsigned int N = 4;
 
-                                  // form all the Fourier vectors
-                                  // that we want to
-                                  // consider. exclude k=0 to avoid
-                                  // problems with |k|^{-mu} and also
-                                  // logarithms of |k|
+  // form all the Fourier vectors
+  // that we want to
+  // consider. exclude k=0 to avoid
+  // problems with |k|^{-mu} and also
+  // logarithms of |k|
   std::vector<Tensor<1,dim> > k_vectors;
   std::vector<unsigned int>   k_vectors_magnitude;
   switch (dim)
     {
-      case 2:
-      {
-       for (unsigned int i=0; i<N; ++i)
-         for (unsigned int j=0; j<N; ++j)
-           if (!((i==0) && (j==0))
-               &&
-               (i*i + j*j < N*N))
-             {
-               k_vectors.push_back (Point<dim>(numbers::PI * i,
-                                               numbers::PI * j));
-               k_vectors_magnitude.push_back (i*i+j*j);
-             }
-       
-       break;
-      }
-
-      case 3:
-      {
-       for (unsigned int i=0; i<N; ++i)
-         for (unsigned int j=0; j<N; ++j)
-           for (unsigned int k=0; k<N; ++k)
-             if (!((i==0) && (j==0) && (k==0))
-                 &&
-                 (i*i + j*j + k*k < N*N))
-               {
-                 k_vectors.push_back (Point<dim>(numbers::PI * i,
-                                                 numbers::PI * j,
-                                                 numbers::PI * k));
-                 k_vectors_magnitude.push_back (i*i+j*j+k*k);
-             }
-       
-       break;
-      }
-      
-      default:
-           Assert (false, ExcNotImplemented());
+    case 2:
+    {
+      for (unsigned int i=0; i<N; ++i)
+        for (unsigned int j=0; j<N; ++j)
+          if (!((i==0) && (j==0))
+              &&
+              (i*i + j*j < N*N))
+            {
+              k_vectors.push_back (Point<dim>(numbers::PI * i,
+                                              numbers::PI * j));
+              k_vectors_magnitude.push_back (i*i+j*j);
+            }
+
+      break;
+    }
+
+    case 3:
+    {
+      for (unsigned int i=0; i<N; ++i)
+        for (unsigned int j=0; j<N; ++j)
+          for (unsigned int k=0; k<N; ++k)
+            if (!((i==0) && (j==0) && (k==0))
+                &&
+                (i*i + j*j + k*k < N*N))
+              {
+                k_vectors.push_back (Point<dim>(numbers::PI * i,
+                                                numbers::PI * j,
+                                                numbers::PI * k));
+                k_vectors_magnitude.push_back (i*i+j*j+k*k);
+              }
+
+      break;
+    }
+
+    default:
+      Assert (false, ExcNotImplemented());
     }
 
   const unsigned n_fourier_modes = k_vectors.size();
   std::vector<double> ln_k (n_fourier_modes);
   for (unsigned int i=0; i<n_fourier_modes; ++i)
     ln_k[i] = std::log (k_vectors[i].norm());
-  
-
-                                  // assemble the matrices that do
-                                  // the Fourier transforms for each
-                                  // of the finite elements we deal
-                                  // with. note that these matrices
-                                  // are complex-valued, so we can't
-                                  // use FullMatrix
+
+
+  // assemble the matrices that do
+  // the Fourier transforms for each
+  // of the finite elements we deal
+  // with. note that these matrices
+  // are complex-valued, so we can't
+  // use FullMatrix
   QGauss<1>      base_quadrature (2);
   QIterated<dim> quadrature (base_quadrature, N);
-  
+
   std::vector<Table<2,std::complex<double> > >
-    fourier_transform_matrices (fe_collection.size());
+  fourier_transform_matrices (fe_collection.size());
   for (unsigned int fe=0; fe<fe_collection.size(); ++fe)
     {
       fourier_transform_matrices[fe].reinit (n_fourier_modes,
-                                            fe_collection[fe].dofs_per_cell);
+                                             fe_collection[fe].dofs_per_cell);
 
       for (unsigned int k=0; k<n_fourier_modes; ++k)
-       for (unsigned int i=0; i<fe_collection[fe].dofs_per_cell; ++i)
-         {
-           std::complex<double> sum = 0;
-           for (unsigned int q=0; q<quadrature.size(); ++q)
-             {
-               const Point<dim> x_q = quadrature.point(q);
-               sum += std::exp(std::complex<double>(0,1) *
-                               (k_vectors[k] * x_q)) *
-                      fe_collection[fe].shape_value(i,x_q) *
-                      quadrature.weight(q);
-             }
-           fourier_transform_matrices[fe](k,i)
-             = sum / std::pow(2*numbers::PI, 1.*dim/2);
-         }
+        for (unsigned int i=0; i<fe_collection[fe].dofs_per_cell; ++i)
+          {
+            std::complex<double> sum = 0;
+            for (unsigned int q=0; q<quadrature.size(); ++q)
+              {
+                const Point<dim> x_q = quadrature.point(q);
+                sum += std::exp(std::complex<double>(0,1) *
+                                (k_vectors[k] * x_q)) *
+                       fe_collection[fe].shape_value(i,x_q) *
+                       quadrature.weight(q);
+              }
+            fourier_transform_matrices[fe](k,i)
+              = sum / std::pow(2*numbers::PI, 1.*dim/2);
+          }
     }
 
-                                  // the next thing is to loop over
-                                  // all cells and do our work there,
-                                  // i.e. to locally do the Fourier
-                                  // transform and estimate the decay
-                                  // coefficient
+  // the next thing is to loop over
+  // all cells and do our work there,
+  // i.e. to locally do the Fourier
+  // transform and estimate the decay
+  // coefficient
   std::vector<std::complex<double> > fourier_coefficients (n_fourier_modes);
   Vector<double>                     local_dof_values;
-  
+
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (unsigned int index=0; cell!=endc; ++cell, ++index)
     {
       local_dof_values.reinit (cell->get_fe().dofs_per_cell);
       cell->get_dof_values (solution, local_dof_values);
 
-                                      // first compute the Fourier
-                                      // transform of the local
-                                      // solution
+      // first compute the Fourier
+      // transform of the local
+      // solution
       std::fill (fourier_coefficients.begin(), fourier_coefficients.end(), 0);
       for (unsigned int f=0; f<n_fourier_modes; ++f)
-       for (unsigned int i=0; i<cell->get_fe().dofs_per_cell; ++i)
-         fourier_coefficients[f] += 
-           fourier_transform_matrices[cell->active_fe_index()](f,i)
-           *
-           local_dof_values(i);
-
-                                      // enter the Fourier
-                                      // coefficients into a map with
-                                      // the k-magnitudes, to make
-                                      // sure that we get only the
-                                      // largest magnitude for each
-                                      // value of |k|
+        for (unsigned int i=0; i<cell->get_fe().dofs_per_cell; ++i)
+          fourier_coefficients[f] +=
+            fourier_transform_matrices[cell->active_fe_index()](f,i)
+            *
+            local_dof_values(i);
+
+      // enter the Fourier
+      // coefficients into a map with
+      // the k-magnitudes, to make
+      // sure that we get only the
+      // largest magnitude for each
+      // value of |k|
       std::map<unsigned int, double> k_to_max_U_map;
       for (unsigned int f=0; f<n_fourier_modes; ++f)
-       if ((k_to_max_U_map.find (k_vectors_magnitude[f]) ==
-            k_to_max_U_map.end())
-           ||
-           (k_to_max_U_map[k_vectors_magnitude[f]] <
-            std::abs (fourier_coefficients[f])))
-         k_to_max_U_map[k_vectors_magnitude[f]]
-           = std::abs (fourier_coefficients[f]);
-      
-                                      // now we have to calculate the
-                                      // various contributions to the
-                                      // formula for mu. we'll only
-                                      // take those fourier
-                                      // coefficients with the
-                                      // largest value for a given
-                                      // |k|
+        if ((k_to_max_U_map.find (k_vectors_magnitude[f]) ==
+             k_to_max_U_map.end())
+            ||
+            (k_to_max_U_map[k_vectors_magnitude[f]] <
+             std::abs (fourier_coefficients[f])))
+          k_to_max_U_map[k_vectors_magnitude[f]]
+            = std::abs (fourier_coefficients[f]);
+
+      // now we have to calculate the
+      // various contributions to the
+      // formula for mu. we'll only
+      // take those fourier
+      // coefficients with the
+      // largest value for a given
+      // |k|
       double  sum_1           = 0,
-             sum_ln_k        = 0,
-             sum_ln_k_square = 0,
-             sum_ln_U        = 0,
-             sum_ln_U_ln_k   = 0;
+              sum_ln_k        = 0,
+              sum_ln_k_square = 0,
+              sum_ln_U        = 0,
+              sum_ln_U_ln_k   = 0;
       for (unsigned int f=0; f<n_fourier_modes; ++f)
-       if (k_to_max_U_map[k_vectors_magnitude[f]] ==
-           std::abs (fourier_coefficients[f]))
-         {
-           sum_1 += 1;
-           sum_ln_k += ln_k[f];
-           sum_ln_k_square += ln_k[f]*ln_k[f];
-           sum_ln_U += std::log (std::abs (fourier_coefficients[f]));
-           sum_ln_U_ln_k += std::log (std::abs (fourier_coefficients[f])) * ln_k[f];
-         }
+        if (k_to_max_U_map[k_vectors_magnitude[f]] ==
+            std::abs (fourier_coefficients[f]))
+          {
+            sum_1 += 1;
+            sum_ln_k += ln_k[f];
+            sum_ln_k_square += ln_k[f]*ln_k[f];
+            sum_ln_U += std::log (std::abs (fourier_coefficients[f]));
+            sum_ln_U_ln_k += std::log (std::abs (fourier_coefficients[f])) * ln_k[f];
+          }
 
       const double mu
-       = (1./(sum_1*sum_ln_k_square - sum_ln_k*sum_ln_k)
-          *
-          (sum_ln_k*sum_ln_U - sum_1*sum_ln_U_ln_k));
-      
+        = (1./(sum_1*sum_ln_k_square - sum_ln_k*sum_ln_k)
+           *
+           (sum_ln_k*sum_ln_U - sum_1*sum_ln_U_ln_k));
+
       smoothness_indicators(index) = mu - 1.*dim/2;
     }
 }
 
 
 
-  
+
 template <int dim>
 void LaplaceProblem<dim>::refine_grid ()
 {
   Vector<float> estimated_error_per_cell (triangulation.n_active_cells());
   KellyErrorEstimator<dim>::estimate (dof_handler,
-                                     face_quadrature_collection,
-                                     typename FunctionMap<dim>::type(),
-                                     solution,
-                                     estimated_error_per_cell);
+                                      face_quadrature_collection,
+                                      typename FunctionMap<dim>::type(),
+                                      solution,
+                                      estimated_error_per_cell);
 
   Vector<float> smoothness_indicators (triangulation.n_active_cells());
   estimate_smoothness (smoothness_indicators);
-  
+
   GridRefinement::refine_and_coarsen_fixed_number (triangulation,
-                                                  estimated_error_per_cell,
-                                                  0.3, 0.03);
+                                                   estimated_error_per_cell,
+                                                   0.3, 0.03);
 
   float max_smoothness = 0,
-        min_smoothness = smoothness_indicators.linfty_norm();
+        min_smoothness = smoothness_indicators.linfty_norm();
   {
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     for (unsigned int index=0; cell!=endc; ++cell, ++index)
       if (cell->refine_flag_set())
-       {
-         max_smoothness = std::max (max_smoothness,
-                                    smoothness_indicators(index));
-         min_smoothness = std::min (min_smoothness,
-                                    smoothness_indicators(index));
-       }
+        {
+          max_smoothness = std::max (max_smoothness,
+                                     smoothness_indicators(index));
+          min_smoothness = std::min (min_smoothness,
+                                     smoothness_indicators(index));
+        }
   }
   const float cutoff_smoothness = (max_smoothness + min_smoothness) / 2;
   {
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     for (unsigned int index=0; cell!=endc; ++cell, ++index)
       if (cell->refine_flag_set()
-         &&
-         (smoothness_indicators(index) > cutoff_smoothness)
-         &&
-         !(cell->active_fe_index() == fe_collection.size() - 1))
-       {
-         cell->clear_refine_flag();
-         cell->set_active_fe_index (std::min (cell->active_fe_index() + 1,
-                                              fe_collection.size() - 1));
-       }
-  } 
-  
+          &&
+          (smoothness_indicators(index) > cutoff_smoothness)
+          &&
+          !(cell->active_fe_index() == fe_collection.size() - 1))
+        {
+          cell->clear_refine_flag();
+          cell->set_active_fe_index (std::min (cell->active_fe_index() + 1,
+                                               fe_collection.size() - 1));
+        }
+  }
+
   triangulation.execute_coarsening_and_refinement ();
 }
 
@@ -525,42 +525,42 @@ template <int dim>
 void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
 {
   Assert (cycle < 10, ExcNotImplemented());
-  
+
   {
     const std::string filename = "grid-" +
-                                Utilities::int_to_string (cycle, 2) +
-                                ".eps";
+                                 Utilities::int_to_string (cycle, 2) +
+                                 ".eps";
     std::ofstream output (filename.c_str());
-    
+
     GridOut grid_out;
     grid_out.write_eps (triangulation, output);
   }
-  
+
   {
     Vector<float> smoothness_indicators (triangulation.n_active_cells());
     estimate_smoothness (smoothness_indicators);
 
     Vector<double> smoothness_field (dof_handler.n_dofs());
     DoFTools::distribute_cell_to_dof_vector (dof_handler,
-                                            smoothness_indicators,
-                                            smoothness_field);
+                                             smoothness_indicators,
+                                             smoothness_field);
 
     Vector<float> fe_indices (triangulation.n_active_cells());
     {
       typename hp::DoFHandler<dim>::active_cell_iterator
-       cell = dof_handler.begin_active(),
-       endc = dof_handler.end();
+      cell = dof_handler.begin_active(),
+      endc = dof_handler.end();
       for (unsigned int index=0; cell!=endc; ++cell, ++index)
-       {
-         
-         fe_indices(index) = cell->active_fe_index();
-//       smoothness_indicators(index) *= std::sqrt(cell->diameter());
-       }
+        {
+
+          fe_indices(index) = cell->active_fe_index();
+//    smoothness_indicators(index) *= std::sqrt(cell->diameter());
+        }
     }
-    
+
     const std::string filename = "solution-" +
-                                Utilities::int_to_string (cycle, 2) +
-                                ".vtk";
+                                 Utilities::int_to_string (cycle, 2) +
+                                 ".vtk";
     DataOut<dim,hp::DoFHandler<dim> > data_out;
 
     data_out.attach_dof_handler (dof_handler);
@@ -569,7 +569,7 @@ void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
     data_out.add_data_vector (smoothness_field, "smoothness2");
     data_out.add_data_vector (fe_indices, "fe_index");
     data_out.build_patches ();
-  
+
     std::ofstream output (filename.c_str());
     data_out.write_vtk (output);
   }
@@ -580,58 +580,60 @@ template <>
 void LaplaceProblem<2>::create_coarse_grid ()
 {
   const unsigned int dim = 2;
-  
+
   static const Point<2> vertices_1[]
     = {  Point<2> (-1.,   -1.),
          Point<2> (-1./2, -1.),
          Point<2> (0.,    -1.),
          Point<2> (+1./2, -1.),
          Point<2> (+1,    -1.),
-            
+
          Point<2> (-1.,   -1./2.),
          Point<2> (-1./2, -1./2.),
          Point<2> (0.,    -1./2.),
          Point<2> (+1./2, -1./2.),
          Point<2> (+1,    -1./2.),
-            
+
          Point<2> (-1.,   0.),
          Point<2> (-1./2, 0.),
          Point<2> (+1./2, 0.),
          Point<2> (+1,    0.),
-            
+
          Point<2> (-1.,   1./2.),
          Point<2> (-1./2, 1./2.),
          Point<2> (0.,    1./2.),
          Point<2> (+1./2, 1./2.),
          Point<2> (+1,    1./2.),
-            
+
          Point<2> (-1.,   1.),
          Point<2> (-1./2, 1.),
-         Point<2> (0.,    1.),                   
+         Point<2> (0.,    1.),
          Point<2> (+1./2, 1.),
-         Point<2> (+1,    1.)    };
+         Point<2> (+1,    1.)
+      };
   const unsigned int
-    n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
+  n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
   const std::vector<Point<dim> > vertices (&vertices_1[0],
                                            &vertices_1[n_vertices]);
   static const int cell_vertices[][GeometryInfo<dim>::vertices_per_cell]
-    = {{0, 1, 5, 6},
-       {1, 2, 6, 7},
-       {2, 3, 7, 8},
-       {3, 4, 8, 9},
-       {5, 6, 10, 11},
-       {8, 9, 12, 13},
-       {10, 11, 14, 15},
-       {12, 13, 17, 18},
-       {14, 15, 19, 20},
-       {15, 16, 20, 21},
-       {16, 17, 21, 22},
-       {17, 18, 22, 23}};
+  = {{0, 1, 5, 6},
+    {1, 2, 6, 7},
+    {2, 3, 7, 8},
+    {3, 4, 8, 9},
+    {5, 6, 10, 11},
+    {8, 9, 12, 13},
+    {10, 11, 14, 15},
+    {12, 13, 17, 18},
+    {14, 15, 19, 20},
+    {15, 16, 20, 21},
+    {16, 17, 21, 22},
+    {17, 18, 22, 23}
+  };
   const unsigned int
-    n_cells = sizeof(cell_vertices) / sizeof(cell_vertices[0]);
+  n_cells = sizeof(cell_vertices) / sizeof(cell_vertices[0]);
 
   std::vector<CellData<dim> > cells (n_cells, CellData<dim>());
-  for (unsigned int i=0; i<n_cells; ++i) 
+  for (unsigned int i=0; i<n_cells; ++i)
     {
       for (unsigned int j=0;
            j<GeometryInfo<dim>::vertices_per_cell;
@@ -641,8 +643,8 @@ void LaplaceProblem<2>::create_coarse_grid ()
     }
 
   triangulation.create_triangulation (vertices,
-                                    cells,
-                                    SubCellData());
+                                      cells,
+                                      SubCellData());
   triangulation.refine_global (3);
 }
 
@@ -658,33 +660,33 @@ void LaplaceProblem<3>::create_coarse_grid ()
 
 
 template <int dim>
-void LaplaceProblem<dim>::run () 
+void LaplaceProblem<dim>::run ()
 {
   for (unsigned int cycle=0; cycle<4; ++cycle)
     {
       deallog << "Cycle " << cycle << ':' << std::endl;
 
       if (cycle == 0)
-       create_coarse_grid ();
+        create_coarse_grid ();
       else
-       refine_grid ();
-      
+        refine_grid ();
+
 
       deallog << "   Number of active cells:       "
-               << triangulation.n_active_cells()
-               << std::endl;
+              << triangulation.n_active_cells()
+              << std::endl;
 
       Timer all;
       all.start();
       setup_system ();
 
       deallog << "   Number of degrees of freedom: "
-               << dof_handler.n_dofs()
-               << std::endl;
+              << dof_handler.n_dofs()
+              << std::endl;
       deallog << "   Number of constraints       : "
-               << hanging_node_constraints.n_constraints()
-               << std::endl;
-      
+              << hanging_node_constraints.n_constraints()
+              << std::endl;
+
       assemble_system ();
       solve ();
       all.stop();
@@ -692,12 +694,12 @@ void LaplaceProblem<dim>::run ()
     }
 }
 
-int main () 
+int main ()
 {
   std::ofstream logfile(logname);
   logfile << std::setprecision(4);
   deallog << std::setprecision(4);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
@@ -709,25 +711,25 @@ int main ()
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
 
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     }
 
index 485c35d2e2aeb339334bc906d439750cee9db521..999614e8da7ca294b8bb1b204ebca512c926c21b 100644 (file)
@@ -61,44 +61,44 @@ char logname[] = "crash_17_compressed_set_sparsity/output";
 
 #include <complex>
 
-                                // Finally, this is as in previous
-                                // programs:
+// Finally, this is as in previous
+// programs:
 using namespace dealii;
 
 template <int dim>
-class LaplaceProblem 
+class LaplaceProblem
 {
-  public:
-    LaplaceProblem ();
-    ~LaplaceProblem ();
+public:
+  LaplaceProblem ();
+  ~LaplaceProblem ();
 
-    void run ();
-    
-  private:
-    void setup_system ();
-    void assemble_system ();
-    void solve ();
-    void create_coarse_grid ();
-    void refine_grid ();
-    void estimate_smoothness (Vector<float> &smoothness_indicators) const;
-    void output_results (const unsigned int cycle) const;
+  void run ();
 
-    Triangulation<dim>   triangulation;
+private:
+  void setup_system ();
+  void assemble_system ();
+  void solve ();
+  void create_coarse_grid ();
+  void refine_grid ();
+  void estimate_smoothness (Vector<float> &smoothness_indicators) const;
+  void output_results (const unsigned int cycle) const;
 
-    hp::DoFHandler<dim>      dof_handler;
-    hp::FECollection<dim>    fe_collection;
-    hp::QCollection<dim>     quadrature_collection;
-    hp::QCollection<dim-1>   face_quadrature_collection;
+  Triangulation<dim>   triangulation;
 
-    ConstraintMatrix     hanging_node_constraints;
+  hp::DoFHandler<dim>      dof_handler;
+  hp::FECollection<dim>    fe_collection;
+  hp::QCollection<dim>     quadrature_collection;
+  hp::QCollection<dim-1>   face_quadrature_collection;
 
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> system_matrix;
+  ConstraintMatrix     hanging_node_constraints;
 
-    Vector<double>       solution;
-    Vector<double>       system_rhs;
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> system_matrix;
 
-    Timer distr, condense, hang;
+  Vector<double>       solution;
+  Vector<double>       system_rhs;
+
+  Timer distr, condense, hang;
 };
 
 
@@ -106,18 +106,18 @@ class LaplaceProblem
 template <int dim>
 class RightHandSide : public Function<dim>
 {
-  public:
-    RightHandSide () : Function<dim> () {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const;
+public:
+  RightHandSide () : Function<dim> () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const;
 };
 
 
 template <int dim>
 double
 RightHandSide<dim>::value (const Point<dim>   &p,
-                          const unsigned int  /*component*/) const
+                           const unsigned int  /*component*/) const
 {
   double product = 1;
   for (unsigned int d=0; d<dim; ++d)
@@ -130,7 +130,7 @@ RightHandSide<dim>::value (const Point<dim>   &p,
 
 template <int dim>
 LaplaceProblem<dim>::LaplaceProblem () :
-               dof_handler (triangulation)
+  dof_handler (triangulation)
 {
   for (unsigned int degree=2; degree<5; ++degree)
     {
@@ -142,7 +142,7 @@ LaplaceProblem<dim>::LaplaceProblem () :
 
 
 template <int dim>
-LaplaceProblem<dim>::~LaplaceProblem () 
+LaplaceProblem<dim>::~LaplaceProblem ()
 {
   dof_handler.clear ();
 }
@@ -162,7 +162,7 @@ void LaplaceProblem<dim>::setup_system ()
   hang.reset();
   hang.start();
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          hanging_node_constraints);
+                                           hanging_node_constraints);
   hanging_node_constraints.write_dot (deallog.get_file_stream());
   hanging_node_constraints.close ();
   hang.stop();
@@ -170,46 +170,46 @@ void LaplaceProblem<dim>::setup_system ()
   if (dim < 3)
     {
       sparsity_pattern.reinit (dof_handler.n_dofs(),
-                              dof_handler.n_dofs(),
-                              dof_handler.max_couplings_between_dofs());
+                               dof_handler.n_dofs(),
+                               dof_handler.max_couplings_between_dofs());
       DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
 
       condense.reset();
       condense.start();
       hanging_node_constraints.condense (sparsity_pattern);
       condense.stop();
-      sparsity_pattern.compress();      
+      sparsity_pattern.compress();
     }
   else
     {
       CompressedSetSparsityPattern csp (dof_handler.n_dofs(),
-                                    dof_handler.n_dofs());
+                                        dof_handler.n_dofs());
       DoFTools::make_sparsity_pattern (dof_handler, csp);
 
       condense.reset();
       condense.start();
       hanging_node_constraints.condense (csp);
       condense.stop();
-      
+
       sparsity_pattern.copy_from (csp);
-    }  
+    }
 
   system_matrix.reinit (sparsity_pattern);
 }
 
 template <int dim>
-void LaplaceProblem<dim>::assemble_system () 
+void LaplaceProblem<dim>::assemble_system ()
 {
   hp::FEValues<dim> hp_fe_values (fe_collection,
-                                 quadrature_collection, 
-                                 update_values    |  update_gradients |
-                                 update_q_points  |  update_JxW_values);
+                                  quadrature_collection,
+                                  update_values    |  update_gradients |
+                                  update_q_points  |  update_JxW_values);
 
   const RightHandSide<dim> rhs_function;
-  
+
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       const unsigned int   dofs_per_cell = cell->get_fe().dofs_per_cell;
@@ -222,36 +222,36 @@ void LaplaceProblem<dim>::assemble_system ()
       cell_rhs = 0;
 
       hp_fe_values.reinit (cell);
-      
+
       const FEValues<dim> &fe_values = hp_fe_values.get_present_fe_values ();
 
       std::vector<double>  rhs_values (fe_values.n_quadrature_points);
       rhs_function.value_list (fe_values.get_quadrature_points(),
-                              rhs_values);
-      
+                               rhs_values);
+
       for (unsigned int q_point=0; q_point<fe_values.n_quadrature_points; ++q_point)
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         {
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += (fe_values.shape_grad(i,q_point) *
-                                  fe_values.shape_grad(j,q_point) *
-                                  fe_values.JxW(q_point));
-
-           cell_rhs(i) += (fe_values.shape_value(i,q_point) *
-                           rhs_values[q_point] *
-                           fe_values.JxW(q_point));
-         }
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += (fe_values.shape_grad(i,q_point) *
+                                   fe_values.shape_grad(j,q_point) *
+                                   fe_values.JxW(q_point));
+
+            cell_rhs(i) += (fe_values.shape_value(i,q_point) *
+                            rhs_values[q_point] *
+                            fe_values.JxW(q_point));
+          }
 
       cell->get_dof_indices (local_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           system_matrix.add (local_dof_indices[i],
-                              local_dof_indices[j],
-                              cell_matrix(i,j));
-         
-         system_rhs(local_dof_indices[i]) += cell_rhs(i);
-       }
+        {
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            system_matrix.add (local_dof_indices[i],
+                               local_dof_indices[j],
+                               cell_matrix(i,j));
+
+          system_rhs(local_dof_indices[i]) += cell_rhs(i);
+        }
     }
 
   condense.start();
@@ -260,27 +260,27 @@ void LaplaceProblem<dim>::assemble_system ()
   condense.stop();
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           ZeroFunction<dim>(),
-                                           boundary_values);
+                                            0,
+                                            ZeroFunction<dim>(),
+                                            boundary_values);
   MatrixTools::apply_boundary_values (boundary_values,
-                                     system_matrix,
-                                     solution,
-                                     system_rhs);
+                                      system_matrix,
+                                      solution,
+                                      system_rhs);
 }
 
 template <int dim>
-void LaplaceProblem<dim>::solve () 
+void LaplaceProblem<dim>::solve ()
 {
   SolverControl           solver_control (system_rhs.size(),
-                                         1e-8*system_rhs.l2_norm());
+                                          1e-8*system_rhs.l2_norm());
   SolverCG<>              cg (solver_control);
 
   PreconditionSSOR<> preconditioner;
   preconditioner.initialize(system_matrix, 1.2);
 
   cg.solve (system_matrix, solution, system_rhs,
-           preconditioner);
+            preconditioner);
 
   hanging_node_constraints.distribute (solution);
 }
@@ -288,7 +288,7 @@ void LaplaceProblem<dim>::solve ()
 
 unsigned int
 int_pow (const unsigned int x,
-        const unsigned int n)
+         const unsigned int n)
 {
   unsigned int p=1;
   for (unsigned int i=0; i<n; ++i)
@@ -304,220 +304,220 @@ estimate_smoothness (Vector<float> &smoothness_indicators) const
 {
   const unsigned int N = 4;
 
-                                  // form all the Fourier vectors
-                                  // that we want to
-                                  // consider. exclude k=0 to avoid
-                                  // problems with |k|^{-mu} and also
-                                  // logarithms of |k|
+  // form all the Fourier vectors
+  // that we want to
+  // consider. exclude k=0 to avoid
+  // problems with |k|^{-mu} and also
+  // logarithms of |k|
   std::vector<Tensor<1,dim> > k_vectors;
   std::vector<unsigned int>   k_vectors_magnitude;
   switch (dim)
     {
-      case 2:
-      {
-       for (unsigned int i=0; i<N; ++i)
-         for (unsigned int j=0; j<N; ++j)
-           if (!((i==0) && (j==0))
-               &&
-               (i*i + j*j < N*N))
-             {
-               k_vectors.push_back (Point<dim>(numbers::PI * i,
-                                               numbers::PI * j));
-               k_vectors_magnitude.push_back (i*i+j*j);
-             }
-       
-       break;
-      }
-
-      case 3:
-      {
-       for (unsigned int i=0; i<N; ++i)
-         for (unsigned int j=0; j<N; ++j)
-           for (unsigned int k=0; k<N; ++k)
-             if (!((i==0) && (j==0) && (k==0))
-                 &&
-                 (i*i + j*j + k*k < N*N))
-               {
-                 k_vectors.push_back (Point<dim>(numbers::PI * i,
-                                                 numbers::PI * j,
-                                                 numbers::PI * k));
-                 k_vectors_magnitude.push_back (i*i+j*j+k*k);
-             }
-       
-       break;
-      }
-      
-      default:
-           Assert (false, ExcNotImplemented());
+    case 2:
+    {
+      for (unsigned int i=0; i<N; ++i)
+        for (unsigned int j=0; j<N; ++j)
+          if (!((i==0) && (j==0))
+              &&
+              (i*i + j*j < N*N))
+            {
+              k_vectors.push_back (Point<dim>(numbers::PI * i,
+                                              numbers::PI * j));
+              k_vectors_magnitude.push_back (i*i+j*j);
+            }
+
+      break;
+    }
+
+    case 3:
+    {
+      for (unsigned int i=0; i<N; ++i)
+        for (unsigned int j=0; j<N; ++j)
+          for (unsigned int k=0; k<N; ++k)
+            if (!((i==0) && (j==0) && (k==0))
+                &&
+                (i*i + j*j + k*k < N*N))
+              {
+                k_vectors.push_back (Point<dim>(numbers::PI * i,
+                                                numbers::PI * j,
+                                                numbers::PI * k));
+                k_vectors_magnitude.push_back (i*i+j*j+k*k);
+              }
+
+      break;
+    }
+
+    default:
+      Assert (false, ExcNotImplemented());
     }
 
   const unsigned n_fourier_modes = k_vectors.size();
   std::vector<double> ln_k (n_fourier_modes);
   for (unsigned int i=0; i<n_fourier_modes; ++i)
     ln_k[i] = std::log (k_vectors[i].norm());
-  
-
-                                  // assemble the matrices that do
-                                  // the Fourier transforms for each
-                                  // of the finite elements we deal
-                                  // with. note that these matrices
-                                  // are complex-valued, so we can't
-                                  // use FullMatrix
+
+
+  // assemble the matrices that do
+  // the Fourier transforms for each
+  // of the finite elements we deal
+  // with. note that these matrices
+  // are complex-valued, so we can't
+  // use FullMatrix
   QGauss<1>      base_quadrature (2);
   QIterated<dim> quadrature (base_quadrature, N);
-  
+
   std::vector<Table<2,std::complex<double> > >
-    fourier_transform_matrices (fe_collection.size());
+  fourier_transform_matrices (fe_collection.size());
   for (unsigned int fe=0; fe<fe_collection.size(); ++fe)
     {
       fourier_transform_matrices[fe].reinit (n_fourier_modes,
-                                            fe_collection[fe].dofs_per_cell);
+                                             fe_collection[fe].dofs_per_cell);
 
       for (unsigned int k=0; k<n_fourier_modes; ++k)
-       for (unsigned int i=0; i<fe_collection[fe].dofs_per_cell; ++i)
-         {
-           std::complex<double> sum = 0;
-           for (unsigned int q=0; q<quadrature.size(); ++q)
-             {
-               const Point<dim> x_q = quadrature.point(q);
-               sum += std::exp(std::complex<double>(0,1) *
-                               (k_vectors[k] * x_q)) *
-                      fe_collection[fe].shape_value(i,x_q) *
-                      quadrature.weight(q);
-             }
-           fourier_transform_matrices[fe](k,i)
-             = sum / std::pow(2*numbers::PI, 1.*dim/2);
-         }
+        for (unsigned int i=0; i<fe_collection[fe].dofs_per_cell; ++i)
+          {
+            std::complex<double> sum = 0;
+            for (unsigned int q=0; q<quadrature.size(); ++q)
+              {
+                const Point<dim> x_q = quadrature.point(q);
+                sum += std::exp(std::complex<double>(0,1) *
+                                (k_vectors[k] * x_q)) *
+                       fe_collection[fe].shape_value(i,x_q) *
+                       quadrature.weight(q);
+              }
+            fourier_transform_matrices[fe](k,i)
+              = sum / std::pow(2*numbers::PI, 1.*dim/2);
+          }
     }
 
-                                  // the next thing is to loop over
-                                  // all cells and do our work there,
-                                  // i.e. to locally do the Fourier
-                                  // transform and estimate the decay
-                                  // coefficient
+  // the next thing is to loop over
+  // all cells and do our work there,
+  // i.e. to locally do the Fourier
+  // transform and estimate the decay
+  // coefficient
   std::vector<std::complex<double> > fourier_coefficients (n_fourier_modes);
   Vector<double>                     local_dof_values;
-  
+
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (unsigned int index=0; cell!=endc; ++cell, ++index)
     {
       local_dof_values.reinit (cell->get_fe().dofs_per_cell);
       cell->get_dof_values (solution, local_dof_values);
 
-                                      // first compute the Fourier
-                                      // transform of the local
-                                      // solution
+      // first compute the Fourier
+      // transform of the local
+      // solution
       std::fill (fourier_coefficients.begin(), fourier_coefficients.end(), 0);
       for (unsigned int f=0; f<n_fourier_modes; ++f)
-       for (unsigned int i=0; i<cell->get_fe().dofs_per_cell; ++i)
-         fourier_coefficients[f] += 
-           fourier_transform_matrices[cell->active_fe_index()](f,i)
-           *
-           local_dof_values(i);
-
-                                      // enter the Fourier
-                                      // coefficients into a map with
-                                      // the k-magnitudes, to make
-                                      // sure that we get only the
-                                      // largest magnitude for each
-                                      // value of |k|
+        for (unsigned int i=0; i<cell->get_fe().dofs_per_cell; ++i)
+          fourier_coefficients[f] +=
+            fourier_transform_matrices[cell->active_fe_index()](f,i)
+            *
+            local_dof_values(i);
+
+      // enter the Fourier
+      // coefficients into a map with
+      // the k-magnitudes, to make
+      // sure that we get only the
+      // largest magnitude for each
+      // value of |k|
       std::map<unsigned int, double> k_to_max_U_map;
       for (unsigned int f=0; f<n_fourier_modes; ++f)
-       if ((k_to_max_U_map.find (k_vectors_magnitude[f]) ==
-            k_to_max_U_map.end())
-           ||
-           (k_to_max_U_map[k_vectors_magnitude[f]] <
-            std::abs (fourier_coefficients[f])))
-         k_to_max_U_map[k_vectors_magnitude[f]]
-           = std::abs (fourier_coefficients[f]);
-      
-                                      // now we have to calculate the
-                                      // various contributions to the
-                                      // formula for mu. we'll only
-                                      // take those fourier
-                                      // coefficients with the
-                                      // largest value for a given
-                                      // |k|
+        if ((k_to_max_U_map.find (k_vectors_magnitude[f]) ==
+             k_to_max_U_map.end())
+            ||
+            (k_to_max_U_map[k_vectors_magnitude[f]] <
+             std::abs (fourier_coefficients[f])))
+          k_to_max_U_map[k_vectors_magnitude[f]]
+            = std::abs (fourier_coefficients[f]);
+
+      // now we have to calculate the
+      // various contributions to the
+      // formula for mu. we'll only
+      // take those fourier
+      // coefficients with the
+      // largest value for a given
+      // |k|
       double  sum_1           = 0,
-             sum_ln_k        = 0,
-             sum_ln_k_square = 0,
-             sum_ln_U        = 0,
-             sum_ln_U_ln_k   = 0;
+              sum_ln_k        = 0,
+              sum_ln_k_square = 0,
+              sum_ln_U        = 0,
+              sum_ln_U_ln_k   = 0;
       for (unsigned int f=0; f<n_fourier_modes; ++f)
-       if (k_to_max_U_map[k_vectors_magnitude[f]] ==
-           std::abs (fourier_coefficients[f]))
-         {
-           sum_1 += 1;
-           sum_ln_k += ln_k[f];
-           sum_ln_k_square += ln_k[f]*ln_k[f];
-           sum_ln_U += std::log (std::abs (fourier_coefficients[f]));
-           sum_ln_U_ln_k += std::log (std::abs (fourier_coefficients[f])) * ln_k[f];
-         }
+        if (k_to_max_U_map[k_vectors_magnitude[f]] ==
+            std::abs (fourier_coefficients[f]))
+          {
+            sum_1 += 1;
+            sum_ln_k += ln_k[f];
+            sum_ln_k_square += ln_k[f]*ln_k[f];
+            sum_ln_U += std::log (std::abs (fourier_coefficients[f]));
+            sum_ln_U_ln_k += std::log (std::abs (fourier_coefficients[f])) * ln_k[f];
+          }
 
       const double mu
-       = (1./(sum_1*sum_ln_k_square - sum_ln_k*sum_ln_k)
-          *
-          (sum_ln_k*sum_ln_U - sum_1*sum_ln_U_ln_k));
-      
+        = (1./(sum_1*sum_ln_k_square - sum_ln_k*sum_ln_k)
+           *
+           (sum_ln_k*sum_ln_U - sum_1*sum_ln_U_ln_k));
+
       smoothness_indicators(index) = mu - 1.*dim/2;
     }
 }
 
 
 
-  
+
 template <int dim>
 void LaplaceProblem<dim>::refine_grid ()
 {
   Vector<float> estimated_error_per_cell (triangulation.n_active_cells());
   KellyErrorEstimator<dim>::estimate (dof_handler,
-                                     face_quadrature_collection,
-                                     typename FunctionMap<dim>::type(),
-                                     solution,
-                                     estimated_error_per_cell);
+                                      face_quadrature_collection,
+                                      typename FunctionMap<dim>::type(),
+                                      solution,
+                                      estimated_error_per_cell);
 
   Vector<float> smoothness_indicators (triangulation.n_active_cells());
   estimate_smoothness (smoothness_indicators);
-  
+
   GridRefinement::refine_and_coarsen_fixed_number (triangulation,
-                                                  estimated_error_per_cell,
-                                                  0.3, 0.03);
+                                                   estimated_error_per_cell,
+                                                   0.3, 0.03);
 
   float max_smoothness = 0,
-        min_smoothness = smoothness_indicators.linfty_norm();
+        min_smoothness = smoothness_indicators.linfty_norm();
   {
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     for (unsigned int index=0; cell!=endc; ++cell, ++index)
       if (cell->refine_flag_set())
-       {
-         max_smoothness = std::max (max_smoothness,
-                                    smoothness_indicators(index));
-         min_smoothness = std::min (min_smoothness,
-                                    smoothness_indicators(index));
-       }
+        {
+          max_smoothness = std::max (max_smoothness,
+                                     smoothness_indicators(index));
+          min_smoothness = std::min (min_smoothness,
+                                     smoothness_indicators(index));
+        }
   }
   const float cutoff_smoothness = (max_smoothness + min_smoothness) / 2;
   {
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     for (unsigned int index=0; cell!=endc; ++cell, ++index)
       if (cell->refine_flag_set()
-         &&
-         (smoothness_indicators(index) > cutoff_smoothness)
-         &&
-         !(cell->active_fe_index() == fe_collection.size() - 1))
-       {
-         cell->clear_refine_flag();
-         cell->set_active_fe_index (std::min (cell->active_fe_index() + 1,
-                                              fe_collection.size() - 1));
-       }
-  } 
-  
+          &&
+          (smoothness_indicators(index) > cutoff_smoothness)
+          &&
+          !(cell->active_fe_index() == fe_collection.size() - 1))
+        {
+          cell->clear_refine_flag();
+          cell->set_active_fe_index (std::min (cell->active_fe_index() + 1,
+                                               fe_collection.size() - 1));
+        }
+  }
+
   triangulation.execute_coarsening_and_refinement ();
 }
 
@@ -527,42 +527,42 @@ template <int dim>
 void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
 {
   Assert (cycle < 10, ExcNotImplemented());
-  
+
   {
     const std::string filename = "grid-" +
-                                Utilities::int_to_string (cycle, 2) +
-                                ".eps";
+                                 Utilities::int_to_string (cycle, 2) +
+                                 ".eps";
     std::ofstream output (filename.c_str());
-    
+
     GridOut grid_out;
     grid_out.write_eps (triangulation, output);
   }
-  
+
   {
     Vector<float> smoothness_indicators (triangulation.n_active_cells());
     estimate_smoothness (smoothness_indicators);
 
     Vector<double> smoothness_field (dof_handler.n_dofs());
     DoFTools::distribute_cell_to_dof_vector (dof_handler,
-                                            smoothness_indicators,
-                                            smoothness_field);
+                                             smoothness_indicators,
+                                             smoothness_field);
 
     Vector<float> fe_indices (triangulation.n_active_cells());
     {
       typename hp::DoFHandler<dim>::active_cell_iterator
-       cell = dof_handler.begin_active(),
-       endc = dof_handler.end();
+      cell = dof_handler.begin_active(),
+      endc = dof_handler.end();
       for (unsigned int index=0; cell!=endc; ++cell, ++index)
-       {
-         
-         fe_indices(index) = cell->active_fe_index();
-//       smoothness_indicators(index) *= std::sqrt(cell->diameter());
-       }
+        {
+
+          fe_indices(index) = cell->active_fe_index();
+//    smoothness_indicators(index) *= std::sqrt(cell->diameter());
+        }
     }
-    
+
     const std::string filename = "solution-" +
-                                Utilities::int_to_string (cycle, 2) +
-                                ".vtk";
+                                 Utilities::int_to_string (cycle, 2) +
+                                 ".vtk";
     DataOut<dim,hp::DoFHandler<dim> > data_out;
 
     data_out.attach_dof_handler (dof_handler);
@@ -571,7 +571,7 @@ void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
     data_out.add_data_vector (smoothness_field, "smoothness2");
     data_out.add_data_vector (fe_indices, "fe_index");
     data_out.build_patches ();
-  
+
     std::ofstream output (filename.c_str());
     data_out.write_vtk (output);
   }
@@ -582,58 +582,60 @@ template <>
 void LaplaceProblem<2>::create_coarse_grid ()
 {
   const unsigned int dim = 2;
-  
+
   static const Point<2> vertices_1[]
     = {  Point<2> (-1.,   -1.),
          Point<2> (-1./2, -1.),
          Point<2> (0.,    -1.),
          Point<2> (+1./2, -1.),
          Point<2> (+1,    -1.),
-            
+
          Point<2> (-1.,   -1./2.),
          Point<2> (-1./2, -1./2.),
          Point<2> (0.,    -1./2.),
          Point<2> (+1./2, -1./2.),
          Point<2> (+1,    -1./2.),
-            
+
          Point<2> (-1.,   0.),
          Point<2> (-1./2, 0.),
          Point<2> (+1./2, 0.),
          Point<2> (+1,    0.),
-            
+
          Point<2> (-1.,   1./2.),
          Point<2> (-1./2, 1./2.),
          Point<2> (0.,    1./2.),
          Point<2> (+1./2, 1./2.),
          Point<2> (+1,    1./2.),
-            
+
          Point<2> (-1.,   1.),
          Point<2> (-1./2, 1.),
-         Point<2> (0.,    1.),                   
+         Point<2> (0.,    1.),
          Point<2> (+1./2, 1.),
-         Point<2> (+1,    1.)    };
+         Point<2> (+1,    1.)
+      };
   const unsigned int
-    n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
+  n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
   const std::vector<Point<dim> > vertices (&vertices_1[0],
                                            &vertices_1[n_vertices]);
   static const int cell_vertices[][GeometryInfo<dim>::vertices_per_cell]
-    = {{0, 1, 5, 6},
-       {1, 2, 6, 7},
-       {2, 3, 7, 8},
-       {3, 4, 8, 9},
-       {5, 6, 10, 11},
-       {8, 9, 12, 13},
-       {10, 11, 14, 15},
-       {12, 13, 17, 18},
-       {14, 15, 19, 20},
-       {15, 16, 20, 21},
-       {16, 17, 21, 22},
-       {17, 18, 22, 23}};
+  = {{0, 1, 5, 6},
+    {1, 2, 6, 7},
+    {2, 3, 7, 8},
+    {3, 4, 8, 9},
+    {5, 6, 10, 11},
+    {8, 9, 12, 13},
+    {10, 11, 14, 15},
+    {12, 13, 17, 18},
+    {14, 15, 19, 20},
+    {15, 16, 20, 21},
+    {16, 17, 21, 22},
+    {17, 18, 22, 23}
+  };
   const unsigned int
-    n_cells = sizeof(cell_vertices) / sizeof(cell_vertices[0]);
+  n_cells = sizeof(cell_vertices) / sizeof(cell_vertices[0]);
 
   std::vector<CellData<dim> > cells (n_cells, CellData<dim>());
-  for (unsigned int i=0; i<n_cells; ++i) 
+  for (unsigned int i=0; i<n_cells; ++i)
     {
       for (unsigned int j=0;
            j<GeometryInfo<dim>::vertices_per_cell;
@@ -643,8 +645,8 @@ void LaplaceProblem<2>::create_coarse_grid ()
     }
 
   triangulation.create_triangulation (vertices,
-                                    cells,
-                                    SubCellData());
+                                      cells,
+                                      SubCellData());
   triangulation.refine_global (3);
 }
 
@@ -660,33 +662,33 @@ void LaplaceProblem<3>::create_coarse_grid ()
 
 
 template <int dim>
-void LaplaceProblem<dim>::run () 
+void LaplaceProblem<dim>::run ()
 {
   for (unsigned int cycle=0; cycle<4; ++cycle)
     {
       deallog << "Cycle " << cycle << ':' << std::endl;
 
       if (cycle == 0)
-       create_coarse_grid ();
+        create_coarse_grid ();
       else
-       refine_grid ();
-      
+        refine_grid ();
+
 
       deallog << "   Number of active cells:       "
-               << triangulation.n_active_cells()
-               << std::endl;
+              << triangulation.n_active_cells()
+              << std::endl;
 
       Timer all;
       all.start();
       setup_system ();
 
       deallog << "   Number of degrees of freedom: "
-               << dof_handler.n_dofs()
-               << std::endl;
+              << dof_handler.n_dofs()
+              << std::endl;
       deallog << "   Number of constraints       : "
-               << hanging_node_constraints.n_constraints()
-               << std::endl;
-      
+              << hanging_node_constraints.n_constraints()
+              << std::endl;
+
       assemble_system ();
       solve ();
       all.stop();
@@ -694,12 +696,12 @@ void LaplaceProblem<dim>::run ()
     }
 }
 
-int main () 
+int main ()
 {
   std::ofstream logfile(logname);
   logfile.precision (4);
   deallog << std::setprecision(4);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
@@ -711,25 +713,25 @@ int main ()
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
 
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     }
 
index 30a2e1994c0d0393114838c327f01e6c6be526b8..c9051554c41108dff48a20431f66a3b9057f921c 100644 (file)
@@ -62,44 +62,44 @@ char logname[] = "crash_18/output";
 
 #include <complex>
 
-                                // Finally, this is as in previous
-                                // programs:
+// Finally, this is as in previous
+// programs:
 using namespace dealii;
 
 template <int dim>
-class LaplaceProblem 
+class LaplaceProblem
 {
-  public:
-    LaplaceProblem ();
-    ~LaplaceProblem ();
+public:
+  LaplaceProblem ();
+  ~LaplaceProblem ();
 
-    void run ();
-    
-  private:
-    void setup_system ();
-    void assemble_system ();
-    void solve ();
-    void create_coarse_grid ();
-    void refine_grid ();
-    void estimate_smoothness (Vector<float> &smoothness_indicators) const;
-    void output_results (const unsigned int cycle) const;
+  void run ();
 
-    Triangulation<dim>   triangulation;
+private:
+  void setup_system ();
+  void assemble_system ();
+  void solve ();
+  void create_coarse_grid ();
+  void refine_grid ();
+  void estimate_smoothness (Vector<float> &smoothness_indicators) const;
+  void output_results (const unsigned int cycle) const;
 
-    hp::DoFHandler<dim>      dof_handler;
-    hp::FECollection<dim>    fe_collection;
-    hp::QCollection<dim>     quadrature_collection;
-    hp::QCollection<dim-1>   face_quadrature_collection;
+  Triangulation<dim>   triangulation;
 
-    ConstraintMatrix     hanging_node_constraints;
+  hp::DoFHandler<dim>      dof_handler;
+  hp::FECollection<dim>    fe_collection;
+  hp::QCollection<dim>     quadrature_collection;
+  hp::QCollection<dim-1>   face_quadrature_collection;
 
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> system_matrix;
+  ConstraintMatrix     hanging_node_constraints;
 
-    Vector<double>       solution;
-    Vector<double>       system_rhs;
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> system_matrix;
 
-    Timer distr, condense, hang;
+  Vector<double>       solution;
+  Vector<double>       system_rhs;
+
+  Timer distr, condense, hang;
 };
 
 
@@ -107,18 +107,18 @@ class LaplaceProblem
 template <int dim>
 class RightHandSide : public Function<dim>
 {
-  public:
-    RightHandSide () : Function<dim> () {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const;
+public:
+  RightHandSide () : Function<dim> () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const;
 };
 
 
 template <int dim>
 double
 RightHandSide<dim>::value (const Point<dim>   &p,
-                          const unsigned int  /*component*/) const
+                           const unsigned int  /*component*/) const
 {
   double product = 1;
   for (unsigned int d=0; d<dim; ++d)
@@ -131,7 +131,7 @@ RightHandSide<dim>::value (const Point<dim>   &p,
 
 template <int dim>
 LaplaceProblem<dim>::LaplaceProblem () :
-               dof_handler (triangulation)
+  dof_handler (triangulation)
 {
   for (unsigned int degree=2; degree<5; ++degree)
     {
@@ -143,7 +143,7 @@ LaplaceProblem<dim>::LaplaceProblem () :
 
 
 template <int dim>
-LaplaceProblem<dim>::~LaplaceProblem () 
+LaplaceProblem<dim>::~LaplaceProblem ()
 {
   dof_handler.clear ();
 }
@@ -163,56 +163,56 @@ void LaplaceProblem<dim>::setup_system ()
   hang.reset();
   hang.start();
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          hanging_node_constraints);
+                                           hanging_node_constraints);
+
+  // check for self-referential constraints
 
-                                  // check for self-referential constraints
-  
   hanging_node_constraints.close ();
   hang.stop();
 
   if (dim < 3)
     {
       sparsity_pattern.reinit (dof_handler.n_dofs(),
-                              dof_handler.n_dofs(),
-                              dof_handler.max_couplings_between_dofs());
+                               dof_handler.n_dofs(),
+                               dof_handler.max_couplings_between_dofs());
       DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
 
       condense.reset();
       condense.start();
       hanging_node_constraints.condense (sparsity_pattern);
       condense.stop();
-      sparsity_pattern.compress();      
+      sparsity_pattern.compress();
     }
   else
     {
       CompressedSparsityPattern csp (dof_handler.n_dofs(),
-                                    dof_handler.n_dofs());
+                                     dof_handler.n_dofs());
       DoFTools::make_sparsity_pattern (dof_handler, csp);
 
       condense.reset();
       condense.start();
       hanging_node_constraints.condense (csp);
       condense.stop();
-      
+
       sparsity_pattern.copy_from (csp);
-    }  
+    }
 
   system_matrix.reinit (sparsity_pattern);
 }
 
 template <int dim>
-void LaplaceProblem<dim>::assemble_system () 
+void LaplaceProblem<dim>::assemble_system ()
 {
   hp::FEValues<dim> hp_fe_values (fe_collection,
-                                 quadrature_collection, 
-                                 update_values    |  update_gradients |
-                                 update_q_points  |  update_JxW_values);
+                                  quadrature_collection,
+                                  update_values    |  update_gradients |
+                                  update_q_points  |  update_JxW_values);
 
   const RightHandSide<dim> rhs_function;
-  
+
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       const unsigned int   dofs_per_cell = cell->get_fe().dofs_per_cell;
@@ -225,36 +225,36 @@ void LaplaceProblem<dim>::assemble_system ()
       cell_rhs = 0;
 
       hp_fe_values.reinit (cell);
-      
+
       const FEValues<dim> &fe_values = hp_fe_values.get_present_fe_values ();
 
       std::vector<double>  rhs_values (fe_values.n_quadrature_points);
       rhs_function.value_list (fe_values.get_quadrature_points(),
-                              rhs_values);
-      
+                               rhs_values);
+
       for (unsigned int q_point=0; q_point<fe_values.n_quadrature_points; ++q_point)
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         {
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += (fe_values.shape_grad(i,q_point) *
-                                  fe_values.shape_grad(j,q_point) *
-                                  fe_values.JxW(q_point));
-
-           cell_rhs(i) += (fe_values.shape_value(i,q_point) *
-                           rhs_values[q_point] *
-                           fe_values.JxW(q_point));
-         }
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += (fe_values.shape_grad(i,q_point) *
+                                   fe_values.shape_grad(j,q_point) *
+                                   fe_values.JxW(q_point));
+
+            cell_rhs(i) += (fe_values.shape_value(i,q_point) *
+                            rhs_values[q_point] *
+                            fe_values.JxW(q_point));
+          }
 
       cell->get_dof_indices (local_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           system_matrix.add (local_dof_indices[i],
-                              local_dof_indices[j],
-                              cell_matrix(i,j));
-         
-         system_rhs(local_dof_indices[i]) += cell_rhs(i);
-       }
+        {
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            system_matrix.add (local_dof_indices[i],
+                               local_dof_indices[j],
+                               cell_matrix(i,j));
+
+          system_rhs(local_dof_indices[i]) += cell_rhs(i);
+        }
     }
 
   condense.start();
@@ -263,27 +263,27 @@ void LaplaceProblem<dim>::assemble_system ()
   condense.stop();
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           ZeroFunction<dim>(),
-                                           boundary_values);
+                                            0,
+                                            ZeroFunction<dim>(),
+                                            boundary_values);
   MatrixTools::apply_boundary_values (boundary_values,
-                                     system_matrix,
-                                     solution,
-                                     system_rhs);
+                                      system_matrix,
+                                      solution,
+                                      system_rhs);
 }
 
 template <int dim>
-void LaplaceProblem<dim>::solve () 
+void LaplaceProblem<dim>::solve ()
 {
   SolverControl           solver_control (system_rhs.size(),
-                                         1e-8*system_rhs.l2_norm());
+                                          1e-8*system_rhs.l2_norm());
   SolverCG<>              cg (solver_control);
 
   PreconditionSSOR<> preconditioner;
   preconditioner.initialize(system_matrix, 1.2);
 
   cg.solve (system_matrix, solution, system_rhs,
-           preconditioner);
+            preconditioner);
 
   hanging_node_constraints.distribute (solution);
 }
@@ -291,7 +291,7 @@ void LaplaceProblem<dim>::solve ()
 
 unsigned int
 int_pow (const unsigned int x,
-        const unsigned int n)
+         const unsigned int n)
 {
   unsigned int p=1;
   for (unsigned int i=0; i<n; ++i)
@@ -307,220 +307,220 @@ estimate_smoothness (Vector<float> &smoothness_indicators) const
 {
   const unsigned int N = 4;
 
-                                  // form all the Fourier vectors
-                                  // that we want to
-                                  // consider. exclude k=0 to avoid
-                                  // problems with |k|^{-mu} and also
-                                  // logarithms of |k|
+  // form all the Fourier vectors
+  // that we want to
+  // consider. exclude k=0 to avoid
+  // problems with |k|^{-mu} and also
+  // logarithms of |k|
   std::vector<Tensor<1,dim> > k_vectors;
   std::vector<unsigned int>   k_vectors_magnitude;
   switch (dim)
     {
-      case 2:
-      {
-       for (unsigned int i=0; i<N; ++i)
-         for (unsigned int j=0; j<N; ++j)
-           if (!((i==0) && (j==0))
-               &&
-               (i*i + j*j < N*N))
-             {
-               k_vectors.push_back (Point<dim>(numbers::PI * i,
-                                               numbers::PI * j));
-               k_vectors_magnitude.push_back (i*i+j*j);
-             }
-       
-       break;
-      }
-
-      case 3:
-      {
-       for (unsigned int i=0; i<N; ++i)
-         for (unsigned int j=0; j<N; ++j)
-           for (unsigned int k=0; k<N; ++k)
-             if (!((i==0) && (j==0) && (k==0))
-                 &&
-                 (i*i + j*j + k*k < N*N))
-               {
-                 k_vectors.push_back (Point<dim>(numbers::PI * i,
-                                                 numbers::PI * j,
-                                                 numbers::PI * k));
-                 k_vectors_magnitude.push_back (i*i+j*j+k*k);
-             }
-       
-       break;
-      }
-      
-      default:
-           Assert (false, ExcNotImplemented());
+    case 2:
+    {
+      for (unsigned int i=0; i<N; ++i)
+        for (unsigned int j=0; j<N; ++j)
+          if (!((i==0) && (j==0))
+              &&
+              (i*i + j*j < N*N))
+            {
+              k_vectors.push_back (Point<dim>(numbers::PI * i,
+                                              numbers::PI * j));
+              k_vectors_magnitude.push_back (i*i+j*j);
+            }
+
+      break;
+    }
+
+    case 3:
+    {
+      for (unsigned int i=0; i<N; ++i)
+        for (unsigned int j=0; j<N; ++j)
+          for (unsigned int k=0; k<N; ++k)
+            if (!((i==0) && (j==0) && (k==0))
+                &&
+                (i*i + j*j + k*k < N*N))
+              {
+                k_vectors.push_back (Point<dim>(numbers::PI * i,
+                                                numbers::PI * j,
+                                                numbers::PI * k));
+                k_vectors_magnitude.push_back (i*i+j*j+k*k);
+              }
+
+      break;
+    }
+
+    default:
+      Assert (false, ExcNotImplemented());
     }
 
   const unsigned n_fourier_modes = k_vectors.size();
   std::vector<double> ln_k (n_fourier_modes);
   for (unsigned int i=0; i<n_fourier_modes; ++i)
     ln_k[i] = std::log (k_vectors[i].norm());
-  
-
-                                  // assemble the matrices that do
-                                  // the Fourier transforms for each
-                                  // of the finite elements we deal
-                                  // with. note that these matrices
-                                  // are complex-valued, so we can't
-                                  // use FullMatrix
+
+
+  // assemble the matrices that do
+  // the Fourier transforms for each
+  // of the finite elements we deal
+  // with. note that these matrices
+  // are complex-valued, so we can't
+  // use FullMatrix
   QGauss<1>      base_quadrature (2);
   QIterated<dim> quadrature (base_quadrature, N);
-  
+
   std::vector<Table<2,std::complex<double> > >
-    fourier_transform_matrices (fe_collection.size());
+  fourier_transform_matrices (fe_collection.size());
   for (unsigned int fe=0; fe<fe_collection.size(); ++fe)
     {
       fourier_transform_matrices[fe].reinit (n_fourier_modes,
-                                            fe_collection[fe].dofs_per_cell);
+                                             fe_collection[fe].dofs_per_cell);
 
       for (unsigned int k=0; k<n_fourier_modes; ++k)
-       for (unsigned int i=0; i<fe_collection[fe].dofs_per_cell; ++i)
-         {
-           std::complex<double> sum = 0;
-           for (unsigned int q=0; q<quadrature.size(); ++q)
-             {
-               const Point<dim> x_q = quadrature.point(q);
-               sum += std::exp(std::complex<double>(0,1) *
-                               (k_vectors[k] * x_q)) *
-                      fe_collection[fe].shape_value(i,x_q) *
-                      quadrature.weight(q);
-             }
-           fourier_transform_matrices[fe](k,i)
-             = sum / std::pow(2*numbers::PI, 1.*dim/2);
-         }
+        for (unsigned int i=0; i<fe_collection[fe].dofs_per_cell; ++i)
+          {
+            std::complex<double> sum = 0;
+            for (unsigned int q=0; q<quadrature.size(); ++q)
+              {
+                const Point<dim> x_q = quadrature.point(q);
+                sum += std::exp(std::complex<double>(0,1) *
+                                (k_vectors[k] * x_q)) *
+                       fe_collection[fe].shape_value(i,x_q) *
+                       quadrature.weight(q);
+              }
+            fourier_transform_matrices[fe](k,i)
+              = sum / std::pow(2*numbers::PI, 1.*dim/2);
+          }
     }
 
-                                  // the next thing is to loop over
-                                  // all cells and do our work there,
-                                  // i.e. to locally do the Fourier
-                                  // transform and estimate the decay
-                                  // coefficient
+  // the next thing is to loop over
+  // all cells and do our work there,
+  // i.e. to locally do the Fourier
+  // transform and estimate the decay
+  // coefficient
   std::vector<std::complex<double> > fourier_coefficients (n_fourier_modes);
   Vector<double>                     local_dof_values;
-  
+
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (unsigned int index=0; cell!=endc; ++cell, ++index)
     {
       local_dof_values.reinit (cell->get_fe().dofs_per_cell);
       cell->get_dof_values (solution, local_dof_values);
 
-                                      // first compute the Fourier
-                                      // transform of the local
-                                      // solution
+      // first compute the Fourier
+      // transform of the local
+      // solution
       std::fill (fourier_coefficients.begin(), fourier_coefficients.end(), 0);
       for (unsigned int f=0; f<n_fourier_modes; ++f)
-       for (unsigned int i=0; i<cell->get_fe().dofs_per_cell; ++i)
-         fourier_coefficients[f] += 
-           fourier_transform_matrices[cell->active_fe_index()](f,i)
-           *
-           local_dof_values(i);
-
-                                      // enter the Fourier
-                                      // coefficients into a map with
-                                      // the k-magnitudes, to make
-                                      // sure that we get only the
-                                      // largest magnitude for each
-                                      // value of |k|
+        for (unsigned int i=0; i<cell->get_fe().dofs_per_cell; ++i)
+          fourier_coefficients[f] +=
+            fourier_transform_matrices[cell->active_fe_index()](f,i)
+            *
+            local_dof_values(i);
+
+      // enter the Fourier
+      // coefficients into a map with
+      // the k-magnitudes, to make
+      // sure that we get only the
+      // largest magnitude for each
+      // value of |k|
       std::map<unsigned int, double> k_to_max_U_map;
       for (unsigned int f=0; f<n_fourier_modes; ++f)
-       if ((k_to_max_U_map.find (k_vectors_magnitude[f]) ==
-            k_to_max_U_map.end())
-           ||
-           (k_to_max_U_map[k_vectors_magnitude[f]] <
-            std::abs (fourier_coefficients[f])))
-         k_to_max_U_map[k_vectors_magnitude[f]]
-           = std::abs (fourier_coefficients[f]);
-      
-                                      // now we have to calculate the
-                                      // various contributions to the
-                                      // formula for mu. we'll only
-                                      // take those fourier
-                                      // coefficients with the
-                                      // largest value for a given
-                                      // |k|
+        if ((k_to_max_U_map.find (k_vectors_magnitude[f]) ==
+             k_to_max_U_map.end())
+            ||
+            (k_to_max_U_map[k_vectors_magnitude[f]] <
+             std::abs (fourier_coefficients[f])))
+          k_to_max_U_map[k_vectors_magnitude[f]]
+            = std::abs (fourier_coefficients[f]);
+
+      // now we have to calculate the
+      // various contributions to the
+      // formula for mu. we'll only
+      // take those fourier
+      // coefficients with the
+      // largest value for a given
+      // |k|
       double  sum_1           = 0,
-             sum_ln_k        = 0,
-             sum_ln_k_square = 0,
-             sum_ln_U        = 0,
-             sum_ln_U_ln_k   = 0;
+              sum_ln_k        = 0,
+              sum_ln_k_square = 0,
+              sum_ln_U        = 0,
+              sum_ln_U_ln_k   = 0;
       for (unsigned int f=0; f<n_fourier_modes; ++f)
-       if (k_to_max_U_map[k_vectors_magnitude[f]] ==
-           std::abs (fourier_coefficients[f]))
-         {
-           sum_1 += 1;
-           sum_ln_k += ln_k[f];
-           sum_ln_k_square += ln_k[f]*ln_k[f];
-           sum_ln_U += std::log (std::abs (fourier_coefficients[f]));
-           sum_ln_U_ln_k += std::log (std::abs (fourier_coefficients[f])) * ln_k[f];
-         }
+        if (k_to_max_U_map[k_vectors_magnitude[f]] ==
+            std::abs (fourier_coefficients[f]))
+          {
+            sum_1 += 1;
+            sum_ln_k += ln_k[f];
+            sum_ln_k_square += ln_k[f]*ln_k[f];
+            sum_ln_U += std::log (std::abs (fourier_coefficients[f]));
+            sum_ln_U_ln_k += std::log (std::abs (fourier_coefficients[f])) * ln_k[f];
+          }
 
       const double mu
-       = (1./(sum_1*sum_ln_k_square - sum_ln_k*sum_ln_k)
-          *
-          (sum_ln_k*sum_ln_U - sum_1*sum_ln_U_ln_k));
-      
+        = (1./(sum_1*sum_ln_k_square - sum_ln_k*sum_ln_k)
+           *
+           (sum_ln_k*sum_ln_U - sum_1*sum_ln_U_ln_k));
+
       smoothness_indicators(index) = mu - 1.*dim/2;
     }
 }
 
 
 
-  
+
 template <int dim>
 void LaplaceProblem<dim>::refine_grid ()
 {
   Vector<float> estimated_error_per_cell (triangulation.n_active_cells());
   KellyErrorEstimator<dim>::estimate (dof_handler,
-                                     face_quadrature_collection,
-                                     typename FunctionMap<dim>::type(),
-                                     solution,
-                                     estimated_error_per_cell);
+                                      face_quadrature_collection,
+                                      typename FunctionMap<dim>::type(),
+                                      solution,
+                                      estimated_error_per_cell);
 
   Vector<float> smoothness_indicators (triangulation.n_active_cells());
   estimate_smoothness (smoothness_indicators);
-  
+
   GridRefinement::refine_and_coarsen_fixed_number (triangulation,
-                                                  estimated_error_per_cell,
-                                                  0.3, 0.03);
+                                                   estimated_error_per_cell,
+                                                   0.3, 0.03);
 
   float max_smoothness = 0,
-        min_smoothness = smoothness_indicators.linfty_norm();
+        min_smoothness = smoothness_indicators.linfty_norm();
   {
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     for (unsigned int index=0; cell!=endc; ++cell, ++index)
       if (cell->refine_flag_set())
-       {
-         max_smoothness = std::max (max_smoothness,
-                                    smoothness_indicators(index));
-         min_smoothness = std::min (min_smoothness,
-                                    smoothness_indicators(index));
-       }
+        {
+          max_smoothness = std::max (max_smoothness,
+                                     smoothness_indicators(index));
+          min_smoothness = std::min (min_smoothness,
+                                     smoothness_indicators(index));
+        }
   }
   const float cutoff_smoothness = (max_smoothness + min_smoothness) / 2;
   {
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     for (unsigned int index=0; cell!=endc; ++cell, ++index)
       if (cell->refine_flag_set()
-         &&
-         (smoothness_indicators(index) > cutoff_smoothness)
-         &&
-         !(cell->active_fe_index() == fe_collection.size() - 1))
-       {
-         cell->clear_refine_flag();
-         cell->set_active_fe_index (std::min (cell->active_fe_index() + 1,
-                                              fe_collection.size() - 1));
-       }
-  } 
-  
+          &&
+          (smoothness_indicators(index) > cutoff_smoothness)
+          &&
+          !(cell->active_fe_index() == fe_collection.size() - 1))
+        {
+          cell->clear_refine_flag();
+          cell->set_active_fe_index (std::min (cell->active_fe_index() + 1,
+                                               fe_collection.size() - 1));
+        }
+  }
+
   triangulation.execute_coarsening_and_refinement ();
 }
 
@@ -530,42 +530,42 @@ template <int dim>
 void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
 {
   Assert (cycle < 10, ExcNotImplemented());
-  
+
   {
     const std::string filename = "grid-" +
-                                Utilities::int_to_string (cycle, 2) +
-                                ".eps";
+                                 Utilities::int_to_string (cycle, 2) +
+                                 ".eps";
     std::ofstream output (filename.c_str());
-    
+
     GridOut grid_out;
     grid_out.write_eps (triangulation, output);
   }
-  
+
   {
     Vector<float> smoothness_indicators (triangulation.n_active_cells());
     estimate_smoothness (smoothness_indicators);
 
     Vector<double> smoothness_field (dof_handler.n_dofs());
     DoFTools::distribute_cell_to_dof_vector (dof_handler,
-                                            smoothness_indicators,
-                                            smoothness_field);
+                                             smoothness_indicators,
+                                             smoothness_field);
 
     Vector<float> fe_indices (triangulation.n_active_cells());
     {
       typename hp::DoFHandler<dim>::active_cell_iterator
-       cell = dof_handler.begin_active(),
-       endc = dof_handler.end();
+      cell = dof_handler.begin_active(),
+      endc = dof_handler.end();
       for (unsigned int index=0; cell!=endc; ++cell, ++index)
-       {
-         
-         fe_indices(index) = cell->active_fe_index();
-//       smoothness_indicators(index) *= std::sqrt(cell->diameter());
-       }
+        {
+
+          fe_indices(index) = cell->active_fe_index();
+//    smoothness_indicators(index) *= std::sqrt(cell->diameter());
+        }
     }
-    
+
     const std::string filename = "solution-" +
-                                Utilities::int_to_string (cycle, 2) +
-                                ".vtk";
+                                 Utilities::int_to_string (cycle, 2) +
+                                 ".vtk";
     DataOut<dim,hp::DoFHandler<dim> > data_out;
 
     data_out.attach_dof_handler (dof_handler);
@@ -574,7 +574,7 @@ void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
     data_out.add_data_vector (smoothness_field, "smoothness2");
     data_out.add_data_vector (fe_indices, "fe_index");
     data_out.build_patches ();
-  
+
     std::ofstream output (filename.c_str());
     data_out.write_vtk (output);
   }
@@ -585,58 +585,60 @@ template <>
 void LaplaceProblem<2>::create_coarse_grid ()
 {
   const unsigned int dim = 2;
-  
+
   static const Point<2> vertices_1[]
     = {  Point<2> (-1.,   -1.),
          Point<2> (-1./2, -1.),
          Point<2> (0.,    -1.),
          Point<2> (+1./2, -1.),
          Point<2> (+1,    -1.),
-            
+
          Point<2> (-1.,   -1./2.),
          Point<2> (-1./2, -1./2.),
          Point<2> (0.,    -1./2.),
          Point<2> (+1./2, -1./2.),
          Point<2> (+1,    -1./2.),
-            
+
          Point<2> (-1.,   0.),
          Point<2> (-1./2, 0.),
          Point<2> (+1./2, 0.),
          Point<2> (+1,    0.),
-            
+
          Point<2> (-1.,   1./2.),
          Point<2> (-1./2, 1./2.),
          Point<2> (0.,    1./2.),
          Point<2> (+1./2, 1./2.),
          Point<2> (+1,    1./2.),
-            
+
          Point<2> (-1.,   1.),
          Point<2> (-1./2, 1.),
-         Point<2> (0.,    1.),                   
+         Point<2> (0.,    1.),
          Point<2> (+1./2, 1.),
-         Point<2> (+1,    1.)    };
+         Point<2> (+1,    1.)
+      };
   const unsigned int
-    n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
+  n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
   const std::vector<Point<dim> > vertices (&vertices_1[0],
                                            &vertices_1[n_vertices]);
   static const int cell_vertices[][GeometryInfo<dim>::vertices_per_cell]
-    = {{0, 1, 5, 6},
-       {1, 2, 6, 7},
-       {2, 3, 7, 8},
-       {3, 4, 8, 9},
-       {5, 6, 10, 11},
-       {8, 9, 12, 13},
-       {10, 11, 14, 15},
-       {12, 13, 17, 18},
-       {14, 15, 19, 20},
-       {15, 16, 20, 21},
-       {16, 17, 21, 22},
-       {17, 18, 22, 23}};
+  = {{0, 1, 5, 6},
+    {1, 2, 6, 7},
+    {2, 3, 7, 8},
+    {3, 4, 8, 9},
+    {5, 6, 10, 11},
+    {8, 9, 12, 13},
+    {10, 11, 14, 15},
+    {12, 13, 17, 18},
+    {14, 15, 19, 20},
+    {15, 16, 20, 21},
+    {16, 17, 21, 22},
+    {17, 18, 22, 23}
+  };
   const unsigned int
-    n_cells = sizeof(cell_vertices) / sizeof(cell_vertices[0]);
+  n_cells = sizeof(cell_vertices) / sizeof(cell_vertices[0]);
 
   std::vector<CellData<dim> > cells (n_cells, CellData<dim>());
-  for (unsigned int i=0; i<n_cells; ++i) 
+  for (unsigned int i=0; i<n_cells; ++i)
     {
       for (unsigned int j=0;
            j<GeometryInfo<dim>::vertices_per_cell;
@@ -646,8 +648,8 @@ void LaplaceProblem<2>::create_coarse_grid ()
     }
 
   triangulation.create_triangulation (vertices,
-                                    cells,
-                                    SubCellData());
+                                      cells,
+                                      SubCellData());
   triangulation.refine_global (3);
 }
 
@@ -663,33 +665,33 @@ void LaplaceProblem<3>::create_coarse_grid ()
 
 
 template <int dim>
-void LaplaceProblem<dim>::run () 
+void LaplaceProblem<dim>::run ()
 {
   for (unsigned int cycle=0; cycle<2; ++cycle)
     {
       deallog << "Cycle " << cycle << ':' << std::endl;
 
       if (cycle == 0)
-       create_coarse_grid ();
+        create_coarse_grid ();
       else
-       refine_grid ();
-      
+        refine_grid ();
+
 
       deallog << "   Number of active cells:       "
-               << triangulation.n_active_cells()
-               << std::endl;
+              << triangulation.n_active_cells()
+              << std::endl;
 
       Timer all;
       all.start();
       setup_system ();
 
       deallog << "   Number of degrees of freedom: "
-               << dof_handler.n_dofs()
-               << std::endl;
+              << dof_handler.n_dofs()
+              << std::endl;
       deallog << "   Number of constraints       : "
-               << hanging_node_constraints.n_constraints()
-               << std::endl;
-      
+              << hanging_node_constraints.n_constraints()
+              << std::endl;
+
       assemble_system ();
       solve ();
       all.stop();
@@ -697,12 +699,12 @@ void LaplaceProblem<dim>::run ()
     }
 }
 
-int main () 
+int main ()
 {
   std::ofstream logfile(logname);
   logfile.precision (3);
   deallog << std::setprecision(3);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
@@ -714,25 +716,25 @@ int main ()
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
 
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     }
 
index 8bf58a35442df1c0139f33593b47b2bb7be3bb75..5c6c91995f6e7334b4dedef9a919b8f28dbf1b39 100644 (file)
@@ -65,44 +65,44 @@ char logname[] = "crash_18_compressed_set_sparsity/output";
 
 #include <complex>
 
-                                // Finally, this is as in previous
-                                // programs:
+// Finally, this is as in previous
+// programs:
 using namespace dealii;
 
 template <int dim>
-class LaplaceProblem 
+class LaplaceProblem
 {
-  public:
-    LaplaceProblem ();
-    ~LaplaceProblem ();
+public:
+  LaplaceProblem ();
+  ~LaplaceProblem ();
 
-    void run ();
-    
-  private:
-    void setup_system ();
-    void assemble_system ();
-    void solve ();
-    void create_coarse_grid ();
-    void refine_grid ();
-    void estimate_smoothness (Vector<float> &smoothness_indicators) const;
-    void output_results (const unsigned int cycle) const;
+  void run ();
 
-    Triangulation<dim>   triangulation;
+private:
+  void setup_system ();
+  void assemble_system ();
+  void solve ();
+  void create_coarse_grid ();
+  void refine_grid ();
+  void estimate_smoothness (Vector<float> &smoothness_indicators) const;
+  void output_results (const unsigned int cycle) const;
 
-    hp::DoFHandler<dim>      dof_handler;
-    hp::FECollection<dim>    fe_collection;
-    hp::QCollection<dim>     quadrature_collection;
-    hp::QCollection<dim-1>   face_quadrature_collection;
+  Triangulation<dim>   triangulation;
 
-    ConstraintMatrix     hanging_node_constraints;
+  hp::DoFHandler<dim>      dof_handler;
+  hp::FECollection<dim>    fe_collection;
+  hp::QCollection<dim>     quadrature_collection;
+  hp::QCollection<dim-1>   face_quadrature_collection;
 
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> system_matrix;
+  ConstraintMatrix     hanging_node_constraints;
 
-    Vector<double>       solution;
-    Vector<double>       system_rhs;
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> system_matrix;
 
-    Timer distr, condense, hang;
+  Vector<double>       solution;
+  Vector<double>       system_rhs;
+
+  Timer distr, condense, hang;
 };
 
 
@@ -110,18 +110,18 @@ class LaplaceProblem
 template <int dim>
 class RightHandSide : public Function<dim>
 {
-  public:
-    RightHandSide () : Function<dim> () {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const;
+public:
+  RightHandSide () : Function<dim> () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const;
 };
 
 
 template <int dim>
 double
 RightHandSide<dim>::value (const Point<dim>   &p,
-                          const unsigned int  /*component*/) const
+                           const unsigned int  /*component*/) const
 {
   double product = 1;
   for (unsigned int d=0; d<dim; ++d)
@@ -134,7 +134,7 @@ RightHandSide<dim>::value (const Point<dim>   &p,
 
 template <int dim>
 LaplaceProblem<dim>::LaplaceProblem () :
-               dof_handler (triangulation)
+  dof_handler (triangulation)
 {
   for (unsigned int degree=2; degree<5; ++degree)
     {
@@ -146,7 +146,7 @@ LaplaceProblem<dim>::LaplaceProblem () :
 
 
 template <int dim>
-LaplaceProblem<dim>::~LaplaceProblem () 
+LaplaceProblem<dim>::~LaplaceProblem ()
 {
   dof_handler.clear ();
 }
@@ -166,56 +166,56 @@ void LaplaceProblem<dim>::setup_system ()
   hang.reset();
   hang.start();
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          hanging_node_constraints);
+                                           hanging_node_constraints);
+
+  // check for self-referential constraints
 
-                                  // check for self-referential constraints
-  
   hanging_node_constraints.close ();
   hang.stop();
 
   if (dim < 3)
     {
       sparsity_pattern.reinit (dof_handler.n_dofs(),
-                              dof_handler.n_dofs(),
-                              dof_handler.max_couplings_between_dofs());
+                               dof_handler.n_dofs(),
+                               dof_handler.max_couplings_between_dofs());
       DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
 
       condense.reset();
       condense.start();
       hanging_node_constraints.condense (sparsity_pattern);
       condense.stop();
-      sparsity_pattern.compress();      
+      sparsity_pattern.compress();
     }
   else
     {
       CompressedSetSparsityPattern csp (dof_handler.n_dofs(),
-                                    dof_handler.n_dofs());
+                                        dof_handler.n_dofs());
       DoFTools::make_sparsity_pattern (dof_handler, csp);
 
       condense.reset();
       condense.start();
       hanging_node_constraints.condense (csp);
       condense.stop();
-      
+
       sparsity_pattern.copy_from (csp);
-    }  
+    }
 
   system_matrix.reinit (sparsity_pattern);
 }
 
 template <int dim>
-void LaplaceProblem<dim>::assemble_system () 
+void LaplaceProblem<dim>::assemble_system ()
 {
   hp::FEValues<dim> hp_fe_values (fe_collection,
-                                 quadrature_collection, 
-                                 update_values    |  update_gradients |
-                                 update_q_points  |  update_JxW_values);
+                                  quadrature_collection,
+                                  update_values    |  update_gradients |
+                                  update_q_points  |  update_JxW_values);
 
   const RightHandSide<dim> rhs_function;
-  
+
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       const unsigned int   dofs_per_cell = cell->get_fe().dofs_per_cell;
@@ -228,36 +228,36 @@ void LaplaceProblem<dim>::assemble_system ()
       cell_rhs = 0;
 
       hp_fe_values.reinit (cell);
-      
+
       const FEValues<dim> &fe_values = hp_fe_values.get_present_fe_values ();
 
       std::vector<double>  rhs_values (fe_values.n_quadrature_points);
       rhs_function.value_list (fe_values.get_quadrature_points(),
-                              rhs_values);
-      
+                               rhs_values);
+
       for (unsigned int q_point=0; q_point<fe_values.n_quadrature_points; ++q_point)
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         {
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += (fe_values.shape_grad(i,q_point) *
-                                  fe_values.shape_grad(j,q_point) *
-                                  fe_values.JxW(q_point));
-
-           cell_rhs(i) += (fe_values.shape_value(i,q_point) *
-                           rhs_values[q_point] *
-                           fe_values.JxW(q_point));
-         }
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += (fe_values.shape_grad(i,q_point) *
+                                   fe_values.shape_grad(j,q_point) *
+                                   fe_values.JxW(q_point));
+
+            cell_rhs(i) += (fe_values.shape_value(i,q_point) *
+                            rhs_values[q_point] *
+                            fe_values.JxW(q_point));
+          }
 
       cell->get_dof_indices (local_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           system_matrix.add (local_dof_indices[i],
-                              local_dof_indices[j],
-                              cell_matrix(i,j));
-         
-         system_rhs(local_dof_indices[i]) += cell_rhs(i);
-       }
+        {
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            system_matrix.add (local_dof_indices[i],
+                               local_dof_indices[j],
+                               cell_matrix(i,j));
+
+          system_rhs(local_dof_indices[i]) += cell_rhs(i);
+        }
     }
 
   condense.start();
@@ -266,27 +266,27 @@ void LaplaceProblem<dim>::assemble_system ()
   condense.stop();
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           ZeroFunction<dim>(),
-                                           boundary_values);
+                                            0,
+                                            ZeroFunction<dim>(),
+                                            boundary_values);
   MatrixTools::apply_boundary_values (boundary_values,
-                                     system_matrix,
-                                     solution,
-                                     system_rhs);
+                                      system_matrix,
+                                      solution,
+                                      system_rhs);
 }
 
 template <int dim>
-void LaplaceProblem<dim>::solve () 
+void LaplaceProblem<dim>::solve ()
 {
   SolverControl           solver_control (system_rhs.size(),
-                                         1e-8*system_rhs.l2_norm());
+                                          1e-8*system_rhs.l2_norm());
   SolverCG<>              cg (solver_control);
 
   PreconditionSSOR<> preconditioner;
   preconditioner.initialize(system_matrix, 1.2);
 
   cg.solve (system_matrix, solution, system_rhs,
-           preconditioner);
+            preconditioner);
 
   hanging_node_constraints.distribute (solution);
 }
@@ -294,7 +294,7 @@ void LaplaceProblem<dim>::solve ()
 
 unsigned int
 int_pow (const unsigned int x,
-        const unsigned int n)
+         const unsigned int n)
 {
   unsigned int p=1;
   for (unsigned int i=0; i<n; ++i)
@@ -310,220 +310,220 @@ estimate_smoothness (Vector<float> &smoothness_indicators) const
 {
   const unsigned int N = 4;
 
-                                  // form all the Fourier vectors
-                                  // that we want to
-                                  // consider. exclude k=0 to avoid
-                                  // problems with |k|^{-mu} and also
-                                  // logarithms of |k|
+  // form all the Fourier vectors
+  // that we want to
+  // consider. exclude k=0 to avoid
+  // problems with |k|^{-mu} and also
+  // logarithms of |k|
   std::vector<Tensor<1,dim> > k_vectors;
   std::vector<unsigned int>   k_vectors_magnitude;
   switch (dim)
     {
-      case 2:
-      {
-       for (unsigned int i=0; i<N; ++i)
-         for (unsigned int j=0; j<N; ++j)
-           if (!((i==0) && (j==0))
-               &&
-               (i*i + j*j < N*N))
-             {
-               k_vectors.push_back (Point<dim>(numbers::PI * i,
-                                               numbers::PI * j));
-               k_vectors_magnitude.push_back (i*i+j*j);
-             }
-       
-       break;
-      }
-
-      case 3:
-      {
-       for (unsigned int i=0; i<N; ++i)
-         for (unsigned int j=0; j<N; ++j)
-           for (unsigned int k=0; k<N; ++k)
-             if (!((i==0) && (j==0) && (k==0))
-                 &&
-                 (i*i + j*j + k*k < N*N))
-               {
-                 k_vectors.push_back (Point<dim>(numbers::PI * i,
-                                                 numbers::PI * j,
-                                                 numbers::PI * k));
-                 k_vectors_magnitude.push_back (i*i+j*j+k*k);
-             }
-       
-       break;
-      }
-      
-      default:
-           Assert (false, ExcNotImplemented());
+    case 2:
+    {
+      for (unsigned int i=0; i<N; ++i)
+        for (unsigned int j=0; j<N; ++j)
+          if (!((i==0) && (j==0))
+              &&
+              (i*i + j*j < N*N))
+            {
+              k_vectors.push_back (Point<dim>(numbers::PI * i,
+                                              numbers::PI * j));
+              k_vectors_magnitude.push_back (i*i+j*j);
+            }
+
+      break;
+    }
+
+    case 3:
+    {
+      for (unsigned int i=0; i<N; ++i)
+        for (unsigned int j=0; j<N; ++j)
+          for (unsigned int k=0; k<N; ++k)
+            if (!((i==0) && (j==0) && (k==0))
+                &&
+                (i*i + j*j + k*k < N*N))
+              {
+                k_vectors.push_back (Point<dim>(numbers::PI * i,
+                                                numbers::PI * j,
+                                                numbers::PI * k));
+                k_vectors_magnitude.push_back (i*i+j*j+k*k);
+              }
+
+      break;
+    }
+
+    default:
+      Assert (false, ExcNotImplemented());
     }
 
   const unsigned n_fourier_modes = k_vectors.size();
   std::vector<double> ln_k (n_fourier_modes);
   for (unsigned int i=0; i<n_fourier_modes; ++i)
     ln_k[i] = std::log (k_vectors[i].norm());
-  
-
-                                  // assemble the matrices that do
-                                  // the Fourier transforms for each
-                                  // of the finite elements we deal
-                                  // with. note that these matrices
-                                  // are complex-valued, so we can't
-                                  // use FullMatrix
+
+
+  // assemble the matrices that do
+  // the Fourier transforms for each
+  // of the finite elements we deal
+  // with. note that these matrices
+  // are complex-valued, so we can't
+  // use FullMatrix
   QGauss<1>      base_quadrature (2);
   QIterated<dim> quadrature (base_quadrature, N);
-  
+
   std::vector<Table<2,std::complex<double> > >
-    fourier_transform_matrices (fe_collection.size());
+  fourier_transform_matrices (fe_collection.size());
   for (unsigned int fe=0; fe<fe_collection.size(); ++fe)
     {
       fourier_transform_matrices[fe].reinit (n_fourier_modes,
-                                            fe_collection[fe].dofs_per_cell);
+                                             fe_collection[fe].dofs_per_cell);
 
       for (unsigned int k=0; k<n_fourier_modes; ++k)
-       for (unsigned int i=0; i<fe_collection[fe].dofs_per_cell; ++i)
-         {
-           std::complex<double> sum = 0;
-           for (unsigned int q=0; q<quadrature.size(); ++q)
-             {
-               const Point<dim> x_q = quadrature.point(q);
-               sum += std::exp(std::complex<double>(0,1) *
-                               (k_vectors[k] * x_q)) *
-                      fe_collection[fe].shape_value(i,x_q) *
-                      quadrature.weight(q);
-             }
-           fourier_transform_matrices[fe](k,i)
-             = sum / std::pow(2*numbers::PI, 1.*dim/2);
-         }
+        for (unsigned int i=0; i<fe_collection[fe].dofs_per_cell; ++i)
+          {
+            std::complex<double> sum = 0;
+            for (unsigned int q=0; q<quadrature.size(); ++q)
+              {
+                const Point<dim> x_q = quadrature.point(q);
+                sum += std::exp(std::complex<double>(0,1) *
+                                (k_vectors[k] * x_q)) *
+                       fe_collection[fe].shape_value(i,x_q) *
+                       quadrature.weight(q);
+              }
+            fourier_transform_matrices[fe](k,i)
+              = sum / std::pow(2*numbers::PI, 1.*dim/2);
+          }
     }
 
-                                  // the next thing is to loop over
-                                  // all cells and do our work there,
-                                  // i.e. to locally do the Fourier
-                                  // transform and estimate the decay
-                                  // coefficient
+  // the next thing is to loop over
+  // all cells and do our work there,
+  // i.e. to locally do the Fourier
+  // transform and estimate the decay
+  // coefficient
   std::vector<std::complex<double> > fourier_coefficients (n_fourier_modes);
   Vector<double>                     local_dof_values;
-  
+
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (unsigned int index=0; cell!=endc; ++cell, ++index)
     {
       local_dof_values.reinit (cell->get_fe().dofs_per_cell);
       cell->get_dof_values (solution, local_dof_values);
 
-                                      // first compute the Fourier
-                                      // transform of the local
-                                      // solution
+      // first compute the Fourier
+      // transform of the local
+      // solution
       std::fill (fourier_coefficients.begin(), fourier_coefficients.end(), 0);
       for (unsigned int f=0; f<n_fourier_modes; ++f)
-       for (unsigned int i=0; i<cell->get_fe().dofs_per_cell; ++i)
-         fourier_coefficients[f] += 
-           fourier_transform_matrices[cell->active_fe_index()](f,i)
-           *
-           local_dof_values(i);
-
-                                      // enter the Fourier
-                                      // coefficients into a map with
-                                      // the k-magnitudes, to make
-                                      // sure that we get only the
-                                      // largest magnitude for each
-                                      // value of |k|
+        for (unsigned int i=0; i<cell->get_fe().dofs_per_cell; ++i)
+          fourier_coefficients[f] +=
+            fourier_transform_matrices[cell->active_fe_index()](f,i)
+            *
+            local_dof_values(i);
+
+      // enter the Fourier
+      // coefficients into a map with
+      // the k-magnitudes, to make
+      // sure that we get only the
+      // largest magnitude for each
+      // value of |k|
       std::map<unsigned int, double> k_to_max_U_map;
       for (unsigned int f=0; f<n_fourier_modes; ++f)
-       if ((k_to_max_U_map.find (k_vectors_magnitude[f]) ==
-            k_to_max_U_map.end())
-           ||
-           (k_to_max_U_map[k_vectors_magnitude[f]] <
-            std::abs (fourier_coefficients[f])))
-         k_to_max_U_map[k_vectors_magnitude[f]]
-           = std::abs (fourier_coefficients[f]);
-      
-                                      // now we have to calculate the
-                                      // various contributions to the
-                                      // formula for mu. we'll only
-                                      // take those fourier
-                                      // coefficients with the
-                                      // largest value for a given
-                                      // |k|
+        if ((k_to_max_U_map.find (k_vectors_magnitude[f]) ==
+             k_to_max_U_map.end())
+            ||
+            (k_to_max_U_map[k_vectors_magnitude[f]] <
+             std::abs (fourier_coefficients[f])))
+          k_to_max_U_map[k_vectors_magnitude[f]]
+            = std::abs (fourier_coefficients[f]);
+
+      // now we have to calculate the
+      // various contributions to the
+      // formula for mu. we'll only
+      // take those fourier
+      // coefficients with the
+      // largest value for a given
+      // |k|
       double  sum_1           = 0,
-             sum_ln_k        = 0,
-             sum_ln_k_square = 0,
-             sum_ln_U        = 0,
-             sum_ln_U_ln_k   = 0;
+              sum_ln_k        = 0,
+              sum_ln_k_square = 0,
+              sum_ln_U        = 0,
+              sum_ln_U_ln_k   = 0;
       for (unsigned int f=0; f<n_fourier_modes; ++f)
-       if (k_to_max_U_map[k_vectors_magnitude[f]] ==
-           std::abs (fourier_coefficients[f]))
-         {
-           sum_1 += 1;
-           sum_ln_k += ln_k[f];
-           sum_ln_k_square += ln_k[f]*ln_k[f];
-           sum_ln_U += std::log (std::abs (fourier_coefficients[f]));
-           sum_ln_U_ln_k += std::log (std::abs (fourier_coefficients[f])) * ln_k[f];
-         }
+        if (k_to_max_U_map[k_vectors_magnitude[f]] ==
+            std::abs (fourier_coefficients[f]))
+          {
+            sum_1 += 1;
+            sum_ln_k += ln_k[f];
+            sum_ln_k_square += ln_k[f]*ln_k[f];
+            sum_ln_U += std::log (std::abs (fourier_coefficients[f]));
+            sum_ln_U_ln_k += std::log (std::abs (fourier_coefficients[f])) * ln_k[f];
+          }
 
       const double mu
-       = (1./(sum_1*sum_ln_k_square - sum_ln_k*sum_ln_k)
-          *
-          (sum_ln_k*sum_ln_U - sum_1*sum_ln_U_ln_k));
-      
+        = (1./(sum_1*sum_ln_k_square - sum_ln_k*sum_ln_k)
+           *
+           (sum_ln_k*sum_ln_U - sum_1*sum_ln_U_ln_k));
+
       smoothness_indicators(index) = mu - 1.*dim/2;
     }
 }
 
 
 
-  
+
 template <int dim>
 void LaplaceProblem<dim>::refine_grid ()
 {
   Vector<float> estimated_error_per_cell (triangulation.n_active_cells());
   KellyErrorEstimator<dim>::estimate (dof_handler,
-                                     face_quadrature_collection,
-                                     typename FunctionMap<dim>::type(),
-                                     solution,
-                                     estimated_error_per_cell);
+                                      face_quadrature_collection,
+                                      typename FunctionMap<dim>::type(),
+                                      solution,
+                                      estimated_error_per_cell);
 
   Vector<float> smoothness_indicators (triangulation.n_active_cells());
   estimate_smoothness (smoothness_indicators);
-  
+
   GridRefinement::refine_and_coarsen_fixed_number (triangulation,
-                                                  estimated_error_per_cell,
-                                                  0.3, 0.03);
+                                                   estimated_error_per_cell,
+                                                   0.3, 0.03);
 
   float max_smoothness = 0,
-        min_smoothness = smoothness_indicators.linfty_norm();
+        min_smoothness = smoothness_indicators.linfty_norm();
   {
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     for (unsigned int index=0; cell!=endc; ++cell, ++index)
       if (cell->refine_flag_set())
-       {
-         max_smoothness = std::max (max_smoothness,
-                                    smoothness_indicators(index));
-         min_smoothness = std::min (min_smoothness,
-                                    smoothness_indicators(index));
-       }
+        {
+          max_smoothness = std::max (max_smoothness,
+                                     smoothness_indicators(index));
+          min_smoothness = std::min (min_smoothness,
+                                     smoothness_indicators(index));
+        }
   }
   const float cutoff_smoothness = (max_smoothness + min_smoothness) / 2;
   {
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     for (unsigned int index=0; cell!=endc; ++cell, ++index)
       if (cell->refine_flag_set()
-         &&
-         (smoothness_indicators(index) > cutoff_smoothness)
-         &&
-         !(cell->active_fe_index() == fe_collection.size() - 1))
-       {
-         cell->clear_refine_flag();
-         cell->set_active_fe_index (std::min (cell->active_fe_index() + 1,
-                                              fe_collection.size() - 1));
-       }
-  } 
-  
+          &&
+          (smoothness_indicators(index) > cutoff_smoothness)
+          &&
+          !(cell->active_fe_index() == fe_collection.size() - 1))
+        {
+          cell->clear_refine_flag();
+          cell->set_active_fe_index (std::min (cell->active_fe_index() + 1,
+                                               fe_collection.size() - 1));
+        }
+  }
+
   triangulation.execute_coarsening_and_refinement ();
 }
 
@@ -533,42 +533,42 @@ template <int dim>
 void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
 {
   Assert (cycle < 10, ExcNotImplemented());
-  
+
   {
     const std::string filename = "grid-" +
-                                Utilities::int_to_string (cycle, 2) +
-                                ".eps";
+                                 Utilities::int_to_string (cycle, 2) +
+                                 ".eps";
     std::ofstream output (filename.c_str());
-    
+
     GridOut grid_out;
     grid_out.write_eps (triangulation, output);
   }
-  
+
   {
     Vector<float> smoothness_indicators (triangulation.n_active_cells());
     estimate_smoothness (smoothness_indicators);
 
     Vector<double> smoothness_field (dof_handler.n_dofs());
     DoFTools::distribute_cell_to_dof_vector (dof_handler,
-                                            smoothness_indicators,
-                                            smoothness_field);
+                                             smoothness_indicators,
+                                             smoothness_field);
 
     Vector<float> fe_indices (triangulation.n_active_cells());
     {
       typename hp::DoFHandler<dim>::active_cell_iterator
-       cell = dof_handler.begin_active(),
-       endc = dof_handler.end();
+      cell = dof_handler.begin_active(),
+      endc = dof_handler.end();
       for (unsigned int index=0; cell!=endc; ++cell, ++index)
-       {
-         
-         fe_indices(index) = cell->active_fe_index();
-//       smoothness_indicators(index) *= std::sqrt(cell->diameter());
-       }
+        {
+
+          fe_indices(index) = cell->active_fe_index();
+//    smoothness_indicators(index) *= std::sqrt(cell->diameter());
+        }
     }
-    
+
     const std::string filename = "solution-" +
-                                Utilities::int_to_string (cycle, 2) +
-                                ".vtk";
+                                 Utilities::int_to_string (cycle, 2) +
+                                 ".vtk";
     DataOut<dim,hp::DoFHandler<dim> > data_out;
 
     data_out.attach_dof_handler (dof_handler);
@@ -577,7 +577,7 @@ void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
     data_out.add_data_vector (smoothness_field, "smoothness2");
     data_out.add_data_vector (fe_indices, "fe_index");
     data_out.build_patches ();
-  
+
     std::ofstream output (filename.c_str());
     data_out.write_vtk (output);
   }
@@ -588,58 +588,60 @@ template <>
 void LaplaceProblem<2>::create_coarse_grid ()
 {
   const unsigned int dim = 2;
-  
+
   static const Point<2> vertices_1[]
     = {  Point<2> (-1.,   -1.),
          Point<2> (-1./2, -1.),
          Point<2> (0.,    -1.),
          Point<2> (+1./2, -1.),
          Point<2> (+1,    -1.),
-            
+
          Point<2> (-1.,   -1./2.),
          Point<2> (-1./2, -1./2.),
          Point<2> (0.,    -1./2.),
          Point<2> (+1./2, -1./2.),
          Point<2> (+1,    -1./2.),
-            
+
          Point<2> (-1.,   0.),
          Point<2> (-1./2, 0.),
          Point<2> (+1./2, 0.),
          Point<2> (+1,    0.),
-            
+
          Point<2> (-1.,   1./2.),
          Point<2> (-1./2, 1./2.),
          Point<2> (0.,    1./2.),
          Point<2> (+1./2, 1./2.),
          Point<2> (+1,    1./2.),
-            
+
          Point<2> (-1.,   1.),
          Point<2> (-1./2, 1.),
-         Point<2> (0.,    1.),                   
+         Point<2> (0.,    1.),
          Point<2> (+1./2, 1.),
-         Point<2> (+1,    1.)    };
+         Point<2> (+1,    1.)
+      };
   const unsigned int
-    n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
+  n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
   const std::vector<Point<dim> > vertices (&vertices_1[0],
                                            &vertices_1[n_vertices]);
   static const int cell_vertices[][GeometryInfo<dim>::vertices_per_cell]
-    = {{0, 1, 5, 6},
-       {1, 2, 6, 7},
-       {2, 3, 7, 8},
-       {3, 4, 8, 9},
-       {5, 6, 10, 11},
-       {8, 9, 12, 13},
-       {10, 11, 14, 15},
-       {12, 13, 17, 18},
-       {14, 15, 19, 20},
-       {15, 16, 20, 21},
-       {16, 17, 21, 22},
-       {17, 18, 22, 23}};
+  = {{0, 1, 5, 6},
+    {1, 2, 6, 7},
+    {2, 3, 7, 8},
+    {3, 4, 8, 9},
+    {5, 6, 10, 11},
+    {8, 9, 12, 13},
+    {10, 11, 14, 15},
+    {12, 13, 17, 18},
+    {14, 15, 19, 20},
+    {15, 16, 20, 21},
+    {16, 17, 21, 22},
+    {17, 18, 22, 23}
+  };
   const unsigned int
-    n_cells = sizeof(cell_vertices) / sizeof(cell_vertices[0]);
+  n_cells = sizeof(cell_vertices) / sizeof(cell_vertices[0]);
 
   std::vector<CellData<dim> > cells (n_cells, CellData<dim>());
-  for (unsigned int i=0; i<n_cells; ++i) 
+  for (unsigned int i=0; i<n_cells; ++i)
     {
       for (unsigned int j=0;
            j<GeometryInfo<dim>::vertices_per_cell;
@@ -649,8 +651,8 @@ void LaplaceProblem<2>::create_coarse_grid ()
     }
 
   triangulation.create_triangulation (vertices,
-                                    cells,
-                                    SubCellData());
+                                      cells,
+                                      SubCellData());
   triangulation.refine_global (3);
 }
 
@@ -666,33 +668,33 @@ void LaplaceProblem<3>::create_coarse_grid ()
 
 
 template <int dim>
-void LaplaceProblem<dim>::run () 
+void LaplaceProblem<dim>::run ()
 {
   for (unsigned int cycle=0; cycle<2; ++cycle)
     {
       deallog << "Cycle " << cycle << ':' << std::endl;
 
       if (cycle == 0)
-       create_coarse_grid ();
+        create_coarse_grid ();
       else
-       refine_grid ();
-      
+        refine_grid ();
+
 
       deallog << "   Number of active cells:       "
-               << triangulation.n_active_cells()
-               << std::endl;
+              << triangulation.n_active_cells()
+              << std::endl;
 
       Timer all;
       all.start();
       setup_system ();
 
       deallog << "   Number of degrees of freedom: "
-               << dof_handler.n_dofs()
-               << std::endl;
+              << dof_handler.n_dofs()
+              << std::endl;
       deallog << "   Number of constraints       : "
-               << hanging_node_constraints.n_constraints()
-               << std::endl;
-      
+              << hanging_node_constraints.n_constraints()
+              << std::endl;
+
       assemble_system ();
       solve ();
       all.stop();
@@ -700,12 +702,12 @@ void LaplaceProblem<dim>::run ()
     }
 }
 
-int main () 
+int main ()
 {
   std::ofstream logfile(logname);
   logfile.precision (3);
   deallog << std::setprecision(3);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
@@ -717,25 +719,25 @@ int main ()
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
 
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     }
 
index 9f44c049012d210d1f9d1e76f9562086eafbe077..059540c0ce0758fcfed1124b54e14d4fab11d79d 100644 (file)
@@ -59,14 +59,15 @@ std::ofstream logfile("crash_19/output");
 
 
 template <int dim>
-class ExactSolution: public Function<dim> {
-  public:
-    ExactSolution () {}
-    virtual double value (const Point<dim>& p, const unsigned int) const
-      {
-       return p (0);
-      }
- };
+class ExactSolution: public Function<dim>
+{
+public:
+  ExactSolution () {}
+  virtual double value (const Point<dim> &p, const unsigned int) const
+  {
+    return p (0);
+  }
+};
 
 
 template <int dim>
@@ -81,16 +82,16 @@ void test ()
   GridGenerator::hyper_cube (triangulation);
   triangulation.refine_global (2);
   deallog << "Number of active cells: "
-         << triangulation.n_active_cells()
-         << std::endl;
+          << triangulation.n_active_cells()
+          << std::endl;
   deallog << "Total number of cells: "
-         << triangulation.n_cells()
-         << std::endl;
+          << triangulation.n_cells()
+          << std::endl;
 
   dof_handler.distribute_dofs (fe);
   deallog << "Number of degrees of freedom: "
-         << dof_handler.n_dofs()
-         << std::endl;
+          << dof_handler.n_dofs()
+          << std::endl;
 
   ExactSolution<dim> exact_solution;
   std::map<types::global_dof_index,double> boundary_values;
@@ -100,9 +101,9 @@ void test ()
                                             boundary_values);
   if (dim == 1)
     VectorTools::interpolate_boundary_values (dof_handler,
-                                             1,
-                                             exact_solution,
-                                             boundary_values);
+                                              1,
+                                              exact_solution,
+                                              boundary_values);
 
   for (std::map<types::global_dof_index,double>::iterator i=boundary_values.begin();
        i != boundary_values.end(); ++i)
@@ -128,24 +129,24 @@ int main ()
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     }
   catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 
index 461c7ee3d31ebc7dd4cdb7f20beeba1c76751c47..15cb06cb3fe4159a86ed79fb161daad2a61387cf 100644 (file)
@@ -52,7 +52,7 @@ void test ()
   GridGenerator::hyper_cube(tria);
 
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-         cell=dof_handler.begin_active();
+       cell=dof_handler.begin_active();
        cell!=dof_handler.end(); ++cell)
     cell->set_active_fe_index (0);
 }
@@ -62,14 +62,14 @@ int main ()
 {
   std::ofstream logfile("crash_20/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index bfa29b82fbaa9c7a387f201938cfc0b726497383..81362affb86e52c66b7d40e1d9535d45bf34ba1e 100644 (file)
@@ -58,40 +58,40 @@ namespace Step
   template <int dim>
   class Problem : public Subscriptor
   {
-    public:
-      Problem ();
-      ~Problem ();
+  public:
+    Problem ();
+    ~Problem ();
 
-      void refine_mesh ();
-      void setup_system ();
+    void refine_mesh ();
+    void setup_system ();
 
-    private:
-      Triangulation<dim>       triangulation;
+  private:
+    Triangulation<dim>    triangulation;
 
-      hp::DoFHandler<dim>      dof_handler;
-      hp::FECollection<dim>            fe_collection;
-      hp::QCollection<dim>             quadrature_collection;
-      hp::QCollection<dim-1>           face_quadrature_collection;
+    hp::DoFHandler<dim>     dof_handler;
+    hp::FECollection<dim>     fe_collection;
+    hp::QCollection<dim>      quadrature_collection;
+    hp::QCollection<dim-1>    face_quadrature_collection;
 
-      ConstraintMatrix         constraints;
+    ConstraintMatrix      constraints;
 
-      SparsityPattern          sparsity_pattern;
-      SparseMatrix<double>     system_matrix;
+    SparsityPattern       sparsity_pattern;
+    SparseMatrix<double>  system_matrix;
   };
 
 
 
   template <int dim>
   Problem<dim>::Problem ()
-                 :
-                 dof_handler (triangulation)
+    :
+    dof_handler (triangulation)
   {
     GridGenerator::hyper_cube(triangulation);
     for (unsigned int degree=1; degree<=7; ++degree)
       {
-       fe_collection.push_back (FE_DGQ<dim>(degree));
-       quadrature_collection.push_back (QGauss<dim>(degree+1));
-       face_quadrature_collection.push_back (QGauss<dim-1>(degree+1));
+        fe_collection.push_back (FE_DGQ<dim>(degree));
+        quadrature_collection.push_back (QGauss<dim>(degree+1));
+        face_quadrature_collection.push_back (QGauss<dim-1>(degree+1));
       }
   }
 
@@ -112,20 +112,20 @@ namespace Step
 
 
     CompressedSetSparsityPattern csp (dof_handler.n_dofs(),
-                                     dof_handler.n_dofs());
+                                      dof_handler.n_dofs());
     DoFTools::make_flux_sparsity_pattern (dof_handler, csp, constraints, false);
     sparsity_pattern.copy_from (csp);
     system_matrix.reinit (sparsity_pattern);
 
     deallog << "   Number of active cells:       "
-           << triangulation.n_active_cells()
-           << std::endl
-           << "   Number of degrees of freedom: "
-           << dof_handler.n_dofs()
-           << std::endl
-           << "   Number of constraints       : "
-           << constraints.n_constraints()
-           << std::endl;
+            << triangulation.n_active_cells()
+            << std::endl
+            << "   Number of degrees of freedom: "
+            << dof_handler.n_dofs()
+            << std::endl
+            << "   Number of constraints       : "
+            << constraints.n_constraints()
+            << std::endl;
     deallog << "nnz=" << sparsity_pattern.n_nonzero_elements() << std::endl;
   }
 
index d233cf2f7fa2e4d85ec74737ddfb141c8ab039b2..0268561024160ad2e14af8e6eea82fd4ad2eed0c 100644 (file)
@@ -59,7 +59,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -74,26 +74,26 @@ check ()
   element.push_back (FE_Q<dim>(1));
   element.push_back (FE_Q<dim>(2));
   element.push_back (FE_Q<dim>(3));
-  
+
   hp::DoFHandler<dim> dof(tr);
-  
+
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
 
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   DoFTools::make_sparsity_pattern (dof, sparsity);
   ConstraintMatrix constraints;
@@ -101,30 +101,30 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
 
   Functions::ExpFunction<dim> rhs_function;
-  
+
   Vector<double> rhs (dof.n_dofs());
-  
+
   MatrixTools::
-    create_laplace_matrix (hp::MappingCollection<dim>(mapping), dof,
-                       hp::QCollection<dim>(quadrature), matrix,
-                       rhs_function, rhs);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_laplace_matrix (hp::MappingCollection<dim>(mapping), dof,
+                         hp::QCollection<dim>(quadrature), matrix,
+                         rhs_function, rhs);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 
   deallog << "RHS vector: " << std::endl;
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
@@ -137,7 +137,7 @@ int main ()
 {
   std::ofstream logfile ("create_laplace_matrix_01/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 4ab4c378a7304b65845b37f9006e71f38fc262ab..8331ab22706352df4c5126f5b3edc5245a13edfa 100644 (file)
@@ -60,7 +60,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -75,26 +75,26 @@ check ()
   element.push_back (FE_Q<dim>(1));
   element.push_back (FE_Q<dim>(2));
   element.push_back (FE_Q<dim>(3));
-  
+
   hp::DoFHandler<dim> dof(tr);
-  
+
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
 
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   DoFTools::make_sparsity_pattern (dof, sparsity);
   ConstraintMatrix constraints;
@@ -102,25 +102,25 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
-  
+
   MatrixTools::
-    create_laplace_matrix (hp::MappingCollection<dim>(mapping), dof,
-                       hp::QCollection<dim>(quadrature), matrix);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_laplace_matrix (hp::MappingCollection<dim>(mapping), dof,
+                         hp::QCollection<dim>(quadrature), matrix);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 }
 
 
@@ -129,7 +129,7 @@ int main ()
 {
   std::ofstream logfile ("create_laplace_matrix_01b/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 75dd4abb95493dae15ab5c04bf54e16b63676790..4bc96d3fecbec747eee555517fba058dc2c524bd 100644 (file)
@@ -58,7 +58,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -71,31 +71,31 @@ check ()
 
   hp::FECollection<dim> element;
   element.push_back (FESystem<dim> (FE_Q<dim>(1), 1,
-                                   FE_Q<dim>(2), 1));
+                                    FE_Q<dim>(2), 1));
   element.push_back (FESystem<dim> (FE_Q<dim>(2), 1,
-                                   FE_Q<dim>(3), 1));
+                                    FE_Q<dim>(3), 1));
   element.push_back (FESystem<dim> (FE_Q<dim>(3), 1,
-                                   FE_Q<dim>(4), 1));
+                                    FE_Q<dim>(4), 1));
 
   hp::DoFHandler<dim> dof(tr);
-  
+
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
 
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   std::vector<std::vector<bool> > mask (2, std::vector<bool>(2, false));
   mask[0][0] = mask[1][1] = true;
@@ -105,30 +105,30 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
 
   Functions::ExpFunction<dim> rhs_function;
-  
+
   Vector<double> rhs (dof.n_dofs());
-  
+
   MatrixTools::
-    create_laplace_matrix (hp::MappingCollection<dim>(mapping), dof,
-                       hp::QCollection<dim>(quadrature), matrix,
-                       rhs_function, rhs);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_laplace_matrix (hp::MappingCollection<dim>(mapping), dof,
+                         hp::QCollection<dim>(quadrature), matrix,
+                         rhs_function, rhs);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 
   deallog << "RHS vector: " << std::endl;
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
@@ -141,7 +141,7 @@ int main ()
 {
   std::ofstream logfile ("create_laplace_matrix_02/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index c2da4ef7483f01a00b9add50ca4cc71c952242e2..dbeb5c1d6238eb9747a1e6603c0dbd306d2b0979 100644 (file)
@@ -59,7 +59,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -72,31 +72,31 @@ check ()
 
   hp::FECollection<dim> element;
   element.push_back (FESystem<dim> (FE_Q<dim>(1), 1,
-                                   FE_Q<dim>(2), 1));
+                                    FE_Q<dim>(2), 1));
   element.push_back (FESystem<dim> (FE_Q<dim>(2), 1,
-                                   FE_Q<dim>(3), 1));
+                                    FE_Q<dim>(3), 1));
   element.push_back (FESystem<dim> (FE_Q<dim>(3), 1,
-                                   FE_Q<dim>(4), 1));
+                                    FE_Q<dim>(4), 1));
 
   hp::DoFHandler<dim> dof(tr);
-  
+
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
 
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   std::vector<std::vector<bool> > mask (2, std::vector<bool>(2, false));
   mask[0][0] = mask[1][1] = true;
@@ -106,25 +106,25 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
 
   MatrixTools::
-    create_laplace_matrix (hp::MappingCollection<dim>(mapping), dof,
-                       hp::QCollection<dim>(quadrature), matrix);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_laplace_matrix (hp::MappingCollection<dim>(mapping), dof,
+                         hp::QCollection<dim>(quadrature), matrix);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 }
 
 
@@ -133,7 +133,7 @@ int main ()
 {
   std::ofstream logfile ("create_laplace_matrix_02b/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index d76ed20071c912fb06e566067973d883f9329c7b..f6b96b2a5a373f4d86221598f22934408c43af1f 100644 (file)
@@ -58,7 +58,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -73,26 +73,26 @@ check ()
   element.push_back (FE_Q<dim>(1));
   element.push_back (FE_Q<dim>(2));
   element.push_back (FE_Q<dim>(3));
-  
+
   hp::DoFHandler<dim> dof(tr);
-  
+
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
 
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   DoFTools::make_sparsity_pattern (dof, sparsity);
   ConstraintMatrix constraints;
@@ -100,31 +100,31 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
 
   Functions::ExpFunction<dim> rhs_function;
-  
+
   Vector<double> rhs (dof.n_dofs());
-  
+
   MatrixTools::
-    create_laplace_matrix (hp::MappingCollection<dim>(mapping), dof,
-                       hp::QCollection<dim>(quadrature), matrix,
-                       rhs_function, rhs,
-                       &rhs_function);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_laplace_matrix (hp::MappingCollection<dim>(mapping), dof,
+                         hp::QCollection<dim>(quadrature), matrix,
+                         rhs_function, rhs,
+                         &rhs_function);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 
   deallog << "RHS vector: " << std::endl;
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
@@ -137,7 +137,7 @@ int main ()
 {
   std::ofstream logfile ("create_laplace_matrix_03/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index b2f755a86496baf1f04ea69878c9107560259140..bb022d41eb3929286c25be9c7b7b069929f1ab6f 100644 (file)
@@ -59,7 +59,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -74,26 +74,26 @@ check ()
   element.push_back (FE_Q<dim>(1));
   element.push_back (FE_Q<dim>(2));
   element.push_back (FE_Q<dim>(3));
-  
+
   hp::DoFHandler<dim> dof(tr);
-  
+
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
 
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   DoFTools::make_sparsity_pattern (dof, sparsity);
   ConstraintMatrix constraints;
@@ -101,28 +101,28 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
 
   Functions::ExpFunction<dim> coefficient;
-  
+
   MatrixTools::
-    create_laplace_matrix (hp::MappingCollection<dim>(mapping), dof,
-                       hp::QCollection<dim>(quadrature), matrix,
-                       &coefficient);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_laplace_matrix (hp::MappingCollection<dim>(mapping), dof,
+                         hp::QCollection<dim>(quadrature), matrix,
+                         &coefficient);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 }
 
 
@@ -131,7 +131,7 @@ int main ()
 {
   std::ofstream logfile ("create_laplace_matrix_03b/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 3a245b0865ceb9eae93f2e8e9bc2a31cb59b58f7..da9c9525530cecde6157a792466678742a053db4 100644 (file)
@@ -57,7 +57,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -70,31 +70,31 @@ check ()
 
   hp::FECollection<dim> element;
   element.push_back (FESystem<dim> (FE_Q<dim>(1), 1,
-                                   FE_Q<dim>(2), 1));
+                                    FE_Q<dim>(2), 1));
   element.push_back (FESystem<dim> (FE_Q<dim>(2), 1,
-                                   FE_Q<dim>(3), 1));
+                                    FE_Q<dim>(3), 1));
   element.push_back (FESystem<dim> (FE_Q<dim>(3), 1,
-                                   FE_Q<dim>(4), 1));
+                                    FE_Q<dim>(4), 1));
 
   hp::DoFHandler<dim> dof(tr);
-  
+
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
 
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   std::vector<std::vector<bool> > mask (2, std::vector<bool>(2, false));
   mask[0][0] = mask[1][1] = true;
@@ -104,31 +104,31 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
 
   Functions::ExpFunction<dim> rhs_function;
-  
+
   Vector<double> rhs (dof.n_dofs());
-  
+
   MatrixTools::
-    create_laplace_matrix (hp::MappingCollection<dim>(mapping), dof,
-                       hp::QCollection<dim>(quadrature), matrix,
-                       rhs_function, rhs,
-                       &rhs_function);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_laplace_matrix (hp::MappingCollection<dim>(mapping), dof,
+                         hp::QCollection<dim>(quadrature), matrix,
+                         rhs_function, rhs,
+                         &rhs_function);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 
   deallog << "RHS vector: " << std::endl;
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
@@ -141,7 +141,7 @@ int main ()
 {
   std::ofstream logfile ("create_laplace_matrix_04/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index c1d905d566030be9c9a69cf81f37e65539188899..fc095ae3a5c8eb192cd0d6df915af0059bd9119a 100644 (file)
@@ -58,7 +58,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -71,31 +71,31 @@ check ()
 
   hp::FECollection<dim> element;
   element.push_back (FESystem<dim> (FE_Q<dim>(1), 1,
-                                   FE_Q<dim>(2), 1));
+                                    FE_Q<dim>(2), 1));
   element.push_back (FESystem<dim> (FE_Q<dim>(2), 1,
-                                   FE_Q<dim>(3), 1));
+                                    FE_Q<dim>(3), 1));
   element.push_back (FESystem<dim> (FE_Q<dim>(3), 1,
-                                   FE_Q<dim>(4), 1));
-  
+                                    FE_Q<dim>(4), 1));
+
   hp::DoFHandler<dim> dof(tr);
-  
+
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
 
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   std::vector<std::vector<bool> > mask (2, std::vector<bool>(2, false));
   mask[0][0] = mask[1][1] = true;
@@ -105,28 +105,28 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
 
   Functions::ExpFunction<dim> coefficient;
-  
+
   MatrixTools::
-    create_laplace_matrix (hp::MappingCollection<dim>(mapping), dof,
-                       hp::QCollection<dim>(quadrature), matrix,
-                       &coefficient);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_laplace_matrix (hp::MappingCollection<dim>(mapping), dof,
+                         hp::QCollection<dim>(quadrature), matrix,
+                         &coefficient);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 }
 
 
@@ -135,7 +135,7 @@ int main ()
 {
   std::ofstream logfile ("create_laplace_matrix_04b/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 96dd65e0d0b28a975574f179f0515577be8331bf..cef0c9dae2b04265bea5a51453d7bc052a633c3f 100644 (file)
@@ -64,27 +64,27 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-   hp::FECollection<dim> element;
-   element.push_back (FESystem<dim> (FE_Q<dim>(1), 1,
-                                     FE_Q<dim>(2), 1));
-   element.push_back (FESystem<dim> (FE_Q<dim>(2), 1,
-                                     FE_Q<dim>(3), 1));
-   element.push_back (FESystem<dim> (FE_Q<dim>(3), 1,
-                                     FE_Q<dim>(4), 1));
+  hp::FECollection<dim> element;
+  element.push_back (FESystem<dim> (FE_Q<dim>(1), 1,
+                                    FE_Q<dim>(2), 1));
+  element.push_back (FESystem<dim> (FE_Q<dim>(2), 1,
+                                    FE_Q<dim>(3), 1));
+  element.push_back (FESystem<dim> (FE_Q<dim>(3), 1,
+                                    FE_Q<dim>(4), 1));
 
-   hp::DoFHandler<dim> dof(tr);
+  hp::DoFHandler<dim> dof(tr);
 
-   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
-        cell != dof.end(); ++cell)
-     cell->set_active_fe_index (rand() % element.size());
+  for (typename hp::DoFHandler<dim>::active_cell_iterator
+       cell = dof.begin_active();
+       cell != dof.end(); ++cell)
+    cell->set_active_fe_index (rand() % element.size());
 
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
@@ -95,9 +95,9 @@ check ()
                                            constraints);
   constraints.close ();
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity;
   {
     Table<2,DoFTools::Coupling> mask (2, 2);
@@ -117,9 +117,9 @@ check ()
   Vector<double> rhs (dof.n_dofs()), rhs_ref(dof.n_dofs());
 
   MatrixTools::
-    create_laplace_matrix (hp::MappingCollection<dim>(mapping), dof,
-                           hp::QCollection<dim>(quadrature), matrix_ref,
-                           rhs_function, rhs_ref);
+  create_laplace_matrix (hp::MappingCollection<dim>(mapping), dof,
+                         hp::QCollection<dim>(quadrature), matrix_ref,
+                         rhs_function, rhs_ref);
   constraints.condense(matrix_ref, rhs_ref);
 
   const Function<dim> *const dummy = 0;
index 27d6ce56cf628cfb2714f91d047309a5db33cb57..f647210e8d37b31a5ddddc3adbc6935fccec654f 100644 (file)
@@ -64,27 +64,27 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-   hp::FECollection<dim> element;
-   element.push_back (FESystem<dim> (FE_Q<dim>(1), 1,
-                                     FE_Q<dim>(2), 1));
-   element.push_back (FESystem<dim> (FE_Q<dim>(2), 1,
-                                     FE_Q<dim>(3), 1));
-   element.push_back (FESystem<dim> (FE_Q<dim>(3), 1,
-                                     FE_Q<dim>(4), 1));
+  hp::FECollection<dim> element;
+  element.push_back (FESystem<dim> (FE_Q<dim>(1), 1,
+                                    FE_Q<dim>(2), 1));
+  element.push_back (FESystem<dim> (FE_Q<dim>(2), 1,
+                                    FE_Q<dim>(3), 1));
+  element.push_back (FESystem<dim> (FE_Q<dim>(3), 1,
+                                    FE_Q<dim>(4), 1));
 
-   hp::DoFHandler<dim> dof(tr);
+  hp::DoFHandler<dim> dof(tr);
 
-   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
-        cell != dof.end(); ++cell)
-     cell->set_active_fe_index (rand() % element.size());
+  for (typename hp::DoFHandler<dim>::active_cell_iterator
+       cell = dof.begin_active();
+       cell != dof.end(); ++cell)
+    cell->set_active_fe_index (rand() % element.size());
 
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
@@ -95,9 +95,9 @@ check ()
                                            constraints);
   constraints.close ();
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity;
   {
     Table<2,DoFTools::Coupling> mask (2, 2);
@@ -113,8 +113,8 @@ check ()
   matrix_ref.reinit (sparsity);
 
   MatrixTools::
-    create_laplace_matrix (hp::MappingCollection<dim>(mapping), dof,
-                           hp::QCollection<dim>(quadrature), matrix_ref);
+  create_laplace_matrix (hp::MappingCollection<dim>(mapping), dof,
+                         hp::QCollection<dim>(quadrature), matrix_ref);
   constraints.condense(matrix_ref);
 
   const Function<dim> *const dummy = 0;
index c85123183bb72b6e934d52c23191bed719df7aac..d9846f17eef4475717d636c1ece6b41494349b73 100644 (file)
@@ -59,7 +59,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -74,26 +74,26 @@ check ()
   element.push_back (FE_Q<dim>(1));
   element.push_back (FE_Q<dim>(2));
   element.push_back (FE_Q<dim>(3));
-  
+
   hp::DoFHandler<dim> dof(tr);
-  
+
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
 
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   DoFTools::make_sparsity_pattern (dof, sparsity);
   ConstraintMatrix constraints;
@@ -101,30 +101,30 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
 
   Functions::ExpFunction<dim> rhs_function;
-  
+
   Vector<double> rhs (dof.n_dofs());
-  
+
   MatrixTools::
-    create_mass_matrix (hp::MappingCollection<dim>(mapping), dof,
-                       hp::QCollection<dim>(quadrature), matrix,
-                       rhs_function, rhs);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_mass_matrix (hp::MappingCollection<dim>(mapping), dof,
+                      hp::QCollection<dim>(quadrature), matrix,
+                      rhs_function, rhs);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 
   deallog << "RHS vector: " << std::endl;
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
@@ -137,7 +137,7 @@ int main ()
 {
   std::ofstream logfile ("create_mass_matrix_01/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index f0861e3567bf078ae8454a81262fc36e8fe3c075..b2e678ac980ab2edc524c53ac249a962ff1e052d 100644 (file)
@@ -60,7 +60,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -75,26 +75,26 @@ check ()
   element.push_back (FE_Q<dim>(1));
   element.push_back (FE_Q<dim>(2));
   element.push_back (FE_Q<dim>(3));
-  
+
   hp::DoFHandler<dim> dof(tr);
-  
+
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
 
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   DoFTools::make_sparsity_pattern (dof, sparsity);
   ConstraintMatrix constraints;
@@ -102,25 +102,25 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
-  
+
   MatrixTools::
-    create_mass_matrix (hp::MappingCollection<dim>(mapping), dof,
-                       hp::QCollection<dim>(quadrature), matrix);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_mass_matrix (hp::MappingCollection<dim>(mapping), dof,
+                      hp::QCollection<dim>(quadrature), matrix);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 }
 
 
@@ -129,7 +129,7 @@ int main ()
 {
   std::ofstream logfile ("create_mass_matrix_01b/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 36d7b2e9438460457a958377f52793bca13a748f..d71a010fbe90c51dee9254118b85ba4506fe7702 100644 (file)
@@ -58,7 +58,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -71,31 +71,31 @@ check ()
 
   hp::FECollection<dim> element;
   element.push_back (FESystem<dim> (FE_Q<dim>(1), 1,
-                                   FE_Q<dim>(2), 1));
+                                    FE_Q<dim>(2), 1));
   element.push_back (FESystem<dim> (FE_Q<dim>(2), 1,
-                                   FE_Q<dim>(3), 1));
+                                    FE_Q<dim>(3), 1));
   element.push_back (FESystem<dim> (FE_Q<dim>(3), 1,
-                                   FE_Q<dim>(4), 1));
+                                    FE_Q<dim>(4), 1));
 
   hp::DoFHandler<dim> dof(tr);
-  
+
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
 
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   std::vector<std::vector<bool> > mask (2, std::vector<bool>(2, false));
   mask[0][0] = mask[1][1] = true;
@@ -105,30 +105,30 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
 
   Functions::ExpFunction<dim> rhs_function;
-  
+
   Vector<double> rhs (dof.n_dofs());
-  
+
   MatrixTools::
-    create_mass_matrix (hp::MappingCollection<dim>(mapping), dof,
-                       hp::QCollection<dim>(quadrature), matrix,
-                       rhs_function, rhs);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_mass_matrix (hp::MappingCollection<dim>(mapping), dof,
+                      hp::QCollection<dim>(quadrature), matrix,
+                      rhs_function, rhs);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 
   deallog << "RHS vector: " << std::endl;
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
@@ -141,7 +141,7 @@ int main ()
 {
   std::ofstream logfile ("create_mass_matrix_02/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 26c95ef3226f827514a8858cb91f285de554be55..ccbd837246647f0ce8f23ecc7f81d0b3a0027dc2 100644 (file)
@@ -59,7 +59,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -72,31 +72,31 @@ check ()
 
   hp::FECollection<dim> element;
   element.push_back (FESystem<dim> (FE_Q<dim>(1), 1,
-                                   FE_Q<dim>(2), 1));
+                                    FE_Q<dim>(2), 1));
   element.push_back (FESystem<dim> (FE_Q<dim>(2), 1,
-                                   FE_Q<dim>(3), 1));
+                                    FE_Q<dim>(3), 1));
   element.push_back (FESystem<dim> (FE_Q<dim>(3), 1,
-                                   FE_Q<dim>(4), 1));
+                                    FE_Q<dim>(4), 1));
 
   hp::DoFHandler<dim> dof(tr);
-  
+
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
 
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   std::vector<std::vector<bool> > mask (2, std::vector<bool>(2, false));
   mask[0][0] = mask[1][1] = true;
@@ -106,25 +106,25 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
 
   MatrixTools::
-    create_mass_matrix (hp::MappingCollection<dim>(mapping), dof,
-                       hp::QCollection<dim>(quadrature), matrix);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_mass_matrix (hp::MappingCollection<dim>(mapping), dof,
+                      hp::QCollection<dim>(quadrature), matrix);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 }
 
 
@@ -133,7 +133,7 @@ int main ()
 {
   std::ofstream logfile ("create_mass_matrix_02b/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index daa41a6f2d51b7be1703b75ceedb9dca04ddaff6..3c75a930407e3dd86858ad4839f26b18f2b22db9 100644 (file)
@@ -58,7 +58,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -73,26 +73,26 @@ check ()
   element.push_back (FE_Q<dim>(1));
   element.push_back (FE_Q<dim>(2));
   element.push_back (FE_Q<dim>(3));
-  
+
   hp::DoFHandler<dim> dof(tr);
-  
+
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
 
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   DoFTools::make_sparsity_pattern (dof, sparsity);
   ConstraintMatrix constraints;
@@ -100,31 +100,31 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
 
   Functions::ExpFunction<dim> rhs_function;
-  
+
   Vector<double> rhs (dof.n_dofs());
-  
+
   MatrixTools::
-    create_mass_matrix (hp::MappingCollection<dim>(mapping), dof,
-                       hp::QCollection<dim>(quadrature), matrix,
-                       rhs_function, rhs,
-                       &rhs_function);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_mass_matrix (hp::MappingCollection<dim>(mapping), dof,
+                      hp::QCollection<dim>(quadrature), matrix,
+                      rhs_function, rhs,
+                      &rhs_function);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 
   deallog << "RHS vector: " << std::endl;
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
@@ -137,7 +137,7 @@ int main ()
 {
   std::ofstream logfile ("create_mass_matrix_03/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index e707e1aca7154f089a8c13c82387b26157876d2b..76621fd3cabcf14c80d7e871ce83a736fc3dd55a 100644 (file)
@@ -59,7 +59,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -70,32 +70,32 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   hp::FECollection<dim> element;
   element.push_back (FE_Q<dim>(1));
   element.push_back (FE_Q<dim>(2));
   element.push_back (FE_Q<dim>(3));
-  
+
   hp::DoFHandler<dim> dof(tr);
-  
+
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
 
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   DoFTools::make_sparsity_pattern (dof, sparsity);
   ConstraintMatrix constraints;
@@ -103,28 +103,28 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
 
   Functions::ExpFunction<dim> coefficient;
-  
+
   MatrixTools::
-    create_mass_matrix (hp::MappingCollection<dim>(mapping), dof,
-                       hp::QCollection<dim>(quadrature), matrix,
-                       &coefficient);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_mass_matrix (hp::MappingCollection<dim>(mapping), dof,
+                      hp::QCollection<dim>(quadrature), matrix,
+                      &coefficient);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 }
 
 
@@ -133,7 +133,7 @@ int main ()
 {
   std::ofstream logfile ("create_mass_matrix_03b/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 9427144fa35b8bb048760d104c533dfc04d40e56..f35a1802f2cd869d460cbd3c0035120e0f755330 100644 (file)
@@ -57,7 +57,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -70,31 +70,31 @@ check ()
 
   hp::FECollection<dim> element;
   element.push_back (FESystem<dim> (FE_Q<dim>(1), 1,
-                                   FE_Q<dim>(2), 1));
+                                    FE_Q<dim>(2), 1));
   element.push_back (FESystem<dim> (FE_Q<dim>(2), 1,
-                                   FE_Q<dim>(3), 1));
+                                    FE_Q<dim>(3), 1));
   element.push_back (FESystem<dim> (FE_Q<dim>(3), 1,
-                                   FE_Q<dim>(4), 1));
-  
+                                    FE_Q<dim>(4), 1));
+
   hp::DoFHandler<dim> dof(tr);
-  
+
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
 
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   std::vector<std::vector<bool> > mask (2, std::vector<bool>(2, false));
   mask[0][0] = mask[1][1] = true;
@@ -104,31 +104,31 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
 
   Functions::ExpFunction<dim> rhs_function;
-  
+
   Vector<double> rhs (dof.n_dofs());
-  
+
   MatrixTools::
-    create_mass_matrix (hp::MappingCollection<dim>(mapping), dof,
-                       hp::QCollection<dim>(quadrature), matrix,
-                       rhs_function, rhs,
-                       &rhs_function);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_mass_matrix (hp::MappingCollection<dim>(mapping), dof,
+                      hp::QCollection<dim>(quadrature), matrix,
+                      rhs_function, rhs,
+                      &rhs_function);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 
   deallog << "RHS vector: " << std::endl;
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
@@ -141,7 +141,7 @@ int main ()
 {
   std::ofstream logfile ("create_mass_matrix_04/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 1c11e55043fae0ab0504be1539c0a0c601be22a4..82d2d6677a523ed5f4e0aecd0762833296f3e111 100644 (file)
@@ -58,7 +58,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -71,31 +71,31 @@ check ()
 
   hp::FECollection<dim> element;
   element.push_back (FESystem<dim> (FE_Q<dim>(1), 1,
-                                   FE_Q<dim>(2), 1));
+                                    FE_Q<dim>(2), 1));
   element.push_back (FESystem<dim> (FE_Q<dim>(2), 1,
-                                   FE_Q<dim>(3), 1));
+                                    FE_Q<dim>(3), 1));
   element.push_back (FESystem<dim> (FE_Q<dim>(3), 1,
-                                   FE_Q<dim>(4), 1));
+                                    FE_Q<dim>(4), 1));
 
   hp::DoFHandler<dim> dof(tr);
-  
+
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
 
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   std::vector<std::vector<bool> > mask (2, std::vector<bool>(2, false));
   mask[0][0] = mask[1][1] = true;
@@ -105,28 +105,28 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
 
   Functions::ExpFunction<dim> coefficient;
-  
+
   MatrixTools::
-    create_mass_matrix (hp::MappingCollection<dim>(mapping), dof,
-                       hp::QCollection<dim>(quadrature), matrix,
-                       &coefficient);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_mass_matrix (hp::MappingCollection<dim>(mapping), dof,
+                      hp::QCollection<dim>(quadrature), matrix,
+                      &coefficient);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 }
 
 
@@ -135,7 +135,7 @@ int main ()
 {
   std::ofstream logfile ("create_mass_matrix_04b/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 52fdc2a2b1779bcd5dbb6043a038c9b7d29202ab..e8d2da65671231a8f7303ef15b829316fd5b3a8c 100644 (file)
@@ -50,7 +50,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -61,37 +61,37 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of non-primitive elements
+  // create a system element composed
+  // of non-primitive elements
   hp::FECollection<dim> element;
   element.push_back (FESystem<dim> (FE_RaviartThomasNodal<dim>(1), 2));
   element.push_back (FESystem<dim> (FE_RaviartThomasNodal<dim>(2), 2));
 
   if (dim < 3)
     element.push_back (FESystem<dim> (FE_RaviartThomasNodal<dim>(3), 2));
-  
+
   hp::DoFHandler<dim> dof(tr);
-  
+
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
+       cell = dof.begin_active();
        cell != dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
 
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
-                                  // create sparsity pattern. note
-                                  // that different blocks should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different blocks should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   std::vector<std::vector<bool> > mask (dim*2,
-                                       std::vector<bool>(dim*2, false));
+                                        std::vector<bool>(dim*2, false));
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<dim; ++j)
       mask[i][j] = true;
@@ -99,31 +99,31 @@ check ()
     for (unsigned int j=0; j<dim; ++j)
       mask[dim+i][dim+j] = true;
   DoFTools::make_sparsity_pattern (dof, mask, sparsity);
-  
+
   ConstraintMatrix constraints;
   DoFTools::make_hanging_node_constraints (dof, constraints);
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
 
   MatrixTools::
-    create_mass_matrix (hp::MappingCollection<dim>(mapping), dof,
-                       hp::QCollection<dim>(quadrature), matrix);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_mass_matrix (hp::MappingCollection<dim>(mapping), dof,
+                      hp::QCollection<dim>(quadrature), matrix);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   deallog << "Matrix: " << std::endl;
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     deallog << matrix.global_entry(i) * 100
-           << std::endl;
+            << std::endl;
 }
 
 
@@ -132,7 +132,7 @@ int main ()
 {
   std::ofstream logfile ("create_mass_matrix_05/output");
   deallog << std::setprecision (2);
-  deallog << std::fixed;  
+  deallog << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 94d2d8898010eec29ffb9fb27dad74fb79dc5d77..870a5f9d49c4b5dde3a99fc615c28b1222b7ac4d 100644 (file)
@@ -64,27 +64,27 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-   hp::FECollection<dim> element;
-   element.push_back (FESystem<dim> (FE_Q<dim>(1), 1,
-                                     FE_Q<dim>(2), 1));
-   element.push_back (FESystem<dim> (FE_Q<dim>(2), 1,
-                                     FE_Q<dim>(3), 1));
-   element.push_back (FESystem<dim> (FE_Q<dim>(3), 1,
-                                     FE_Q<dim>(4), 1));
+  hp::FECollection<dim> element;
+  element.push_back (FESystem<dim> (FE_Q<dim>(1), 1,
+                                    FE_Q<dim>(2), 1));
+  element.push_back (FESystem<dim> (FE_Q<dim>(2), 1,
+                                    FE_Q<dim>(3), 1));
+  element.push_back (FESystem<dim> (FE_Q<dim>(3), 1,
+                                    FE_Q<dim>(4), 1));
 
-   hp::DoFHandler<dim> dof(tr);
+  hp::DoFHandler<dim> dof(tr);
 
-   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
-        cell != dof.end(); ++cell)
-     cell->set_active_fe_index (rand() % element.size());
+  for (typename hp::DoFHandler<dim>::active_cell_iterator
+       cell = dof.begin_active();
+       cell != dof.end(); ++cell)
+    cell->set_active_fe_index (rand() % element.size());
 
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
@@ -95,9 +95,9 @@ check ()
                                            constraints);
   constraints.close ();
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity;
   {
     Table<2,DoFTools::Coupling> mask (2, 2);
@@ -117,9 +117,9 @@ check ()
   Vector<double> rhs (dof.n_dofs()), rhs_ref(dof.n_dofs());
 
   MatrixTools::
-    create_mass_matrix (hp::MappingCollection<dim>(mapping), dof,
-                       hp::QCollection<dim>(quadrature), matrix_ref,
-                       rhs_function, rhs_ref);
+  create_mass_matrix (hp::MappingCollection<dim>(mapping), dof,
+                      hp::QCollection<dim>(quadrature), matrix_ref,
+                      rhs_function, rhs_ref);
   constraints.condense(matrix_ref, rhs_ref);
 
   const Function<dim> *const dummy = 0;
index 37c8c918a52cf777cbac30ccba1ddd76388fece7..120ea12ea952f218e07642e9108523cf575168a2 100644 (file)
@@ -64,27 +64,27 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-   hp::FECollection<dim> element;
-   element.push_back (FESystem<dim> (FE_Q<dim>(1), 1,
-                                     FE_Q<dim>(2), 1));
-   element.push_back (FESystem<dim> (FE_Q<dim>(2), 1,
-                                     FE_Q<dim>(3), 1));
-   element.push_back (FESystem<dim> (FE_Q<dim>(3), 1,
-                                     FE_Q<dim>(4), 1));
+  hp::FECollection<dim> element;
+  element.push_back (FESystem<dim> (FE_Q<dim>(1), 1,
+                                    FE_Q<dim>(2), 1));
+  element.push_back (FESystem<dim> (FE_Q<dim>(2), 1,
+                                    FE_Q<dim>(3), 1));
+  element.push_back (FESystem<dim> (FE_Q<dim>(3), 1,
+                                    FE_Q<dim>(4), 1));
 
-   hp::DoFHandler<dim> dof(tr);
+  hp::DoFHandler<dim> dof(tr);
 
-   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active();
-        cell != dof.end(); ++cell)
-     cell->set_active_fe_index (rand() % element.size());
+  for (typename hp::DoFHandler<dim>::active_cell_iterator
+       cell = dof.begin_active();
+       cell != dof.end(); ++cell)
+    cell->set_active_fe_index (rand() % element.size());
 
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   MappingQ<dim> mapping (3);
   QGauss<dim> quadrature(6);
 
@@ -95,9 +95,9 @@ check ()
                                            constraints);
   constraints.close ();
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity;
   {
     Table<2,DoFTools::Coupling> mask (2, 2);
@@ -113,8 +113,8 @@ check ()
   matrix_ref.reinit (sparsity);
 
   MatrixTools::
-    create_mass_matrix (hp::MappingCollection<dim>(mapping), dof,
-                       hp::QCollection<dim>(quadrature), matrix_ref);
+  create_mass_matrix (hp::MappingCollection<dim>(mapping), dof,
+                      hp::QCollection<dim>(quadrature), matrix_ref);
   constraints.condense(matrix_ref);
 
   const Function<dim> *const dummy = 0;
index 6df209a968e3366156af1753d99e411423525329..be04f4674381626ce90ed7486c2904ed39ebebd1 100644 (file)
 
 void test ()
 {
-                                  //make grid
+  //make grid
   Triangulation<2> triangulation;
   GridGenerator::hyper_cube(triangulation);
   triangulation.refine_global(1);
 
-                                  //define DoFhandler and FEs
+  //define DoFhandler and FEs
   FE_Q<2> u(2),u2(3);
 
   hp::FECollection<2> fe_collection;
@@ -60,56 +60,56 @@ void test ()
   hp::DoFHandler<2> hp_dof_handler(triangulation);
   hp::DoFHandler<2> hp_dof_handler2(triangulation);
 
-                                  //set different fe for testing
+  //set different fe for testing
   hp::DoFHandler<2>::active_cell_iterator
-    cell=hp_dof_handler.begin_active(),endc = hp_dof_handler.end();
+  cell=hp_dof_handler.begin_active(),endc = hp_dof_handler.end();
+
   for (; cell!=endc; ++cell)
     cell->set_active_fe_index(1);
   hp_dof_handler.begin_active()->set_active_fe_index(0);
-  
-                                  //distribute dofs
+
+  //distribute dofs
   hp_dof_handler.distribute_dofs(fe_collection);
   hp_dof_handler2.distribute_dofs(fe_collection2);
 
-                                  // define input for create_rhs function
+  // define input for create_rhs function
   Vector<double> rhs_vector(hp_dof_handler.n_dofs());
   Vector<double> rhs_vector2(hp_dof_handler2.n_dofs());
 
   types::boundary_id myints[1];
-  std::set<types::boundary_id> boundary_indicators  (myints,myints+1);  
+  std::set<types::boundary_id> boundary_indicators  (myints,myints+1);
   myints[0]=0;
   hp::QCollection<1>   quadrature;
   quadrature.push_back (QGauss<1>(1));
 
-                                  // choose rhs=1. because the circumference
-                                  // of the domain is four and the shape
-                                  // functions all add up to one, if you take
-                                  // the sum over the elements of the
-                                  // resulting rhs vector, you need to get
-                                  // four
+  // choose rhs=1. because the circumference
+  // of the domain is four and the shape
+  // functions all add up to one, if you take
+  // the sum over the elements of the
+  // resulting rhs vector, you need to get
+  // four
   ConstantFunction< 2 > rhs_function(1);
-  
+
   VectorTools::create_boundary_right_hand_side ( hp_dof_handler2,
-                                                quadrature,
-                                                rhs_function,
-                                                rhs_vector2,
-                                                boundary_indicators);
+                                                 quadrature,
+                                                 rhs_function,
+                                                 rhs_vector2,
+                                                 boundary_indicators);
   Assert (std::fabs (std::accumulate (rhs_vector2.begin(),
-                                     rhs_vector2.end(), 0.)
-                    - 4) < 1e-12,
-         ExcInternalError());
+                                      rhs_vector2.end(), 0.)
+                     - 4) < 1e-12,
+          ExcInternalError());
   deallog << rhs_vector2.l2_norm() << std::endl;
-  
+
   VectorTools::create_boundary_right_hand_side ( hp_dof_handler,
-                                                quadrature,
-                                                rhs_function,
-                                                rhs_vector,
-                                                boundary_indicators);
+                                                 quadrature,
+                                                 rhs_function,
+                                                 rhs_vector,
+                                                 boundary_indicators);
   Assert (std::fabs (std::accumulate (rhs_vector.begin(),
-                                     rhs_vector.end(), 0.)
-                    - 4) < 1e-12,
-         ExcInternalError());
+                                      rhs_vector.end(), 0.)
+                     - 4) < 1e-12,
+          ExcInternalError());
   deallog << rhs_vector.l2_norm() << std::endl;
 }
 
@@ -119,12 +119,12 @@ int main ()
   std::ofstream logfile("create_rhs_01/output");
   logfile.precision(2);
   deallog << std::setprecision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   test ();
-  
+
   deallog << "OK" << std::endl;
 }
index 0b415e5d25a7c55ad69de3feb23e048a7c3f7a72..5d922af675b31655f1808e1646892be4aedf4f12 100644 (file)
@@ -47,7 +47,7 @@ void test()
   hp::FECollection<dim> fe;
   for (unsigned int i=0; i<4; ++i)
     fe.push_back (FESystem<dim>  (FE_Q<dim>(i+1),2,
-                                 FE_DGQ<dim>(i),1));
+                                  FE_DGQ<dim>(i),1));
 
   hp::DoFHandler<dim> dof_handler (triangulation);
 
@@ -57,42 +57,42 @@ void test()
   const unsigned int n_refinements[] = { 0, 4, 3, 2 };
   for (unsigned int i=0; i<n_refinements[dim]; ++i)
     {
-                                      // refine one-fifth of cells randomly
+      // refine one-fifth of cells randomly
       std::vector<bool> flags (triangulation.n_active_cells(), false);
       for (unsigned int k=0; k<flags.size()/5 + 1; ++k)
-       flags[rand() % flags.size()] = true;
-                                      // make sure there's at least one that
-                                      // will be refined
+        flags[rand() % flags.size()] = true;
+      // make sure there's at least one that
+      // will be refined
       flags[0] = true;
 
-                                      // refine triangulation
+      // refine triangulation
       unsigned int index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = triangulation.begin_active();
-          cell != triangulation.end(); ++cell, ++index)
-       if (flags[index])
-         cell->set_refine_flag();
+           cell = triangulation.begin_active();
+           cell != triangulation.end(); ++cell, ++index)
+        if (flags[index])
+          cell->set_refine_flag();
       Assert (index == triangulation.n_active_cells(), ExcInternalError());
 
-                                      // flag all other cells for coarsening
-                                      // (this should ensure that at least
-                                      // some of them will actually be
-                                      // coarsened)
+      // flag all other cells for coarsening
+      // (this should ensure that at least
+      // some of them will actually be
+      // coarsened)
       index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = triangulation.begin_active();
-          cell != triangulation.end(); ++cell, ++index)
-       if (!flags[index])
-         cell->set_coarsen_flag();
+           cell = triangulation.begin_active();
+           cell != triangulation.end(); ++cell, ++index)
+        if (!flags[index])
+          cell->set_coarsen_flag();
 
       triangulation.execute_coarsening_and_refinement ();
 
       index=0;
       for (typename hp::DoFHandler<dim>::active_cell_iterator
-            cell = dof_handler.begin_active();
-          cell != dof_handler.end(); ++cell, ++index)
-       cell->set_active_fe_index (index % fe.size());
-      
+           cell = dof_handler.begin_active();
+           cell != dof_handler.end(); ++cell, ++index)
+        cell->set_active_fe_index (index % fe.size());
+
       dof_handler.distribute_dofs (fe);
 
       const unsigned int N = dof_handler.n_dofs();
@@ -102,15 +102,15 @@ void test()
       all.add_range (0, N);
 
       Assert (dof_handler.n_locally_owned_dofs() == N,
-             ExcInternalError());
+              ExcInternalError());
       Assert (dof_handler.locally_owned_dofs() == all,
-             ExcInternalError());
+              ExcInternalError());
       Assert (dof_handler.n_locally_owned_dofs_per_processor() ==
-             std::vector<types::global_dof_index> (1,N),
-             ExcInternalError());
+              std::vector<types::global_dof_index> (1,N),
+              ExcInternalError());
       Assert (dof_handler.locally_owned_dofs_per_processor() ==
-             std::vector<IndexSet>(1,all),
-             ExcInternalError());
+              std::vector<IndexSet>(1,all),
+              ExcInternalError());
     }
 }
 
index 4828cac2b615960b6451a6d13854e4089b981c74..59c95485a3e3feb24cbe2f0c8a89aec710eef539 100644 (file)
@@ -51,7 +51,7 @@ print_dofs (const hp::DoFHandler<dim> &dof)
       deallog << "Cell " << cell << " -- ";
       cell->get_dof_indices (v);
       for (unsigned int i=0; i<v.size(); ++i)
-       deallog << v[i] << ' ';
+        deallog << v[i] << ' ';
       deallog << std::endl;
     }
 }
@@ -60,11 +60,11 @@ print_dofs (const hp::DoFHandler<dim> &dof)
 
 template <int dim>
 void
-check_renumbering(hp::DoFHandler<dim>dof)
+check_renumbering(hp::DoFHandler<dim> &dof)
 {
   for (unsigned int i=0; i<dof.get_fe().size(); ++i)
     {
-      const FiniteElement<dim>element = dof.get_fe()[i];
+      const FiniteElement<dim> &element = dof.get_fe()[i];
       deallog << element.get_name() << std::endl;
     }
 
@@ -92,10 +92,10 @@ check ()
   {
     bool coin = false;
     for (typename hp::DoFHandler<dim>::active_cell_iterator cell=dof.begin_active();
-        cell != dof.end(); ++cell)
+         cell != dof.end(); ++cell)
       {
-       cell->set_active_fe_index (coin ? 0 : 1);
-       coin = !coin;
+        cell->set_active_fe_index (coin ? 0 : 1);
+        coin = !coin;
       }
   }
 
index 6e60d9dd2c0c7de0821d4329af420a39b5bad5d5..e0f03c0e2bc80d45f6704527e0bca43997b357f1 100644 (file)
@@ -51,7 +51,7 @@ print_dofs (const hp::DoFHandler<dim> &dof)
       deallog << "Cell " << cell << " -- ";
       cell->get_dof_indices (v);
       for (unsigned int i=0; i<v.size(); ++i)
-       deallog << v[i] << ' ';
+        deallog << v[i] << ' ';
       deallog << std::endl;
     }
 }
@@ -60,11 +60,11 @@ print_dofs (const hp::DoFHandler<dim> &dof)
 
 template <int dim>
 void
-check_renumbering(hp::DoFHandler<dim>dof)
+check_renumbering(hp::DoFHandler<dim> &dof)
 {
   for (unsigned int i=0; i<dof.get_fe().size(); ++i)
     {
-      const FiniteElement<dim>element = dof.get_fe()[i];
+      const FiniteElement<dim> &element = dof.get_fe()[i];
       deallog << element.get_name() << std::endl;
     }
 
@@ -92,10 +92,10 @@ check ()
   {
     bool coin = false;
     for (typename hp::DoFHandler<dim>::active_cell_iterator cell=dof.begin_active();
-        cell != dof.end(); ++cell)
+         cell != dof.end(); ++cell)
       {
-       cell->set_active_fe_index (coin ? 0 : 1);
-       coin = !coin;
+        cell->set_active_fe_index (coin ? 0 : 1);
+        coin = !coin;
       }
   }
 
index 5bd521eedf61540b7d4c76f03b1f7f9e0b33527e..dd5448d7bd9ddc540ab5ddca9b2b50b23fea1407 100644 (file)
@@ -51,7 +51,7 @@ print_dofs (const hp::DoFHandler<dim> &dof)
       deallog << "Cell " << cell << " -- ";
       cell->get_dof_indices (v);
       for (unsigned int i=0; i<v.size(); ++i)
-       deallog << v[i] << ' ';
+        deallog << v[i] << ' ';
       deallog << std::endl;
     }
 }
@@ -60,11 +60,11 @@ print_dofs (const hp::DoFHandler<dim> &dof)
 
 template <int dim>
 void
-check_renumbering(hp::DoFHandler<dim>dof)
+check_renumbering(hp::DoFHandler<dim> &dof)
 {
   for (unsigned int i=0; i<dof.get_fe().size(); ++i)
     {
-      const FiniteElement<dim>element = dof.get_fe()[i];
+      const FiniteElement<dim> &element = dof.get_fe()[i];
       deallog << element.get_name() << std::endl;
     }
 
@@ -92,10 +92,10 @@ check ()
   {
     bool coin = false;
     for (typename hp::DoFHandler<dim>::active_cell_iterator cell=dof.begin_active();
-        cell != dof.end(); ++cell)
+         cell != dof.end(); ++cell)
       {
-       cell->set_active_fe_index (coin ? 0 : 1);
-       coin = !coin;
+        cell->set_active_fe_index (coin ? 0 : 1);
+        coin = !coin;
       }
   }
 
index 0aa35e3bf6ba8bd02eca7e9963e0d2e64c1ce4c1..1a624364fff6ea825ca857aee866ead154a40525 100644 (file)
@@ -36,9 +36,9 @@ void test ()
   fe_collection.push_back (FE_Q<dim>(2));
   fe_collection.push_back (FE_Q<dim>(3));
 
-                                   // now create a copy and make sure
-                                   // it goes out of scope before the
-                                   // original
+  // now create a copy and make sure
+  // it goes out of scope before the
+  // original
   {
     hp::FECollection<dim> copy (fe_collection);
   }
index 94375085d799bcb0437cc5a2eadf71d8be407db9..804b2dc56862547c0cc54c2f236de24bbe4712bb 100644 (file)
 template <int dim>
 void test ()
 {
-                                  // test things with a collection of
-                                  // primitive elements
+  // test things with a collection of
+  // primitive elements
   {
     hp::FECollection<dim> fe_collection;
     fe_collection.push_back (FESystem<dim>(FE_Q<dim>(2),dim));
     fe_collection.push_back (FESystem<dim>(FE_Q<dim>(2),dim));
     Assert (fe_collection.n_components() == dim,
-           ExcInternalError());
+            ExcInternalError());
   }
 
-                                  // now the same with one of the elements
-                                  // being non-primitive
+  // now the same with one of the elements
+  // being non-primitive
   if (dim > 1)
     {
       hp::FECollection<dim> fe_collection;
       fe_collection.push_back (FESystem<dim>(FE_Q<dim>(2),dim));
       fe_collection.push_back (FE_RaviartThomas<dim>(1));
       Assert (fe_collection.n_components() == dim,
-           ExcInternalError());
+              ExcInternalError());
     }
 
   deallog << "OK" << std::endl;
index 4b74e6fe01ea8b55291011a390a0cf6f6a90899c..da1be21c3a036f80d5076a8a1f4cda2a0becad9e 100644 (file)
 template <int dim>
 void test ()
 {
-                                  // test things with a collection of
-                                  // primitive elements
+  // test things with a collection of
+  // primitive elements
   {
     hp::FECollection<dim> fe_collection;
     fe_collection.push_back (FESystem<dim>(FE_Q<dim>(2),dim));
     fe_collection.push_back (FESystem<dim>(FE_Q<dim>(2),dim));
     Assert (fe_collection.n_components() == dim,
-           ExcInternalError());
+            ExcInternalError());
   }
 
-                                  // now the same with one of the elements
-                                  // being non-primitive. the other one can
-                                  // then not simply be a FESystem but must
-                                  // in fact be an FESystem of FESystem to
-                                  // hide multiple components in one block
+  // now the same with one of the elements
+  // being non-primitive. the other one can
+  // then not simply be a FESystem but must
+  // in fact be an FESystem of FESystem to
+  // hide multiple components in one block
   if (dim > 1)
     {
       hp::FECollection<dim> fe_collection;
       fe_collection.push_back (FESystem<dim>(FESystem<dim>(FE_Q<dim>(2),dim),1));
       fe_collection.push_back (FE_RaviartThomas<dim>(1));
       Assert (fe_collection.n_blocks() == 1,
-             ExcInternalError());
+              ExcInternalError());
     }
 
   deallog << "OK" << std::endl;
index 99656637cbe616c97b980e65a952756de4a6521c..70f074d8ec986c985b2314c3fbb77ef57ce2c8fa 100644 (file)
 template <int dim>
 void test ()
 {
-                                  // now the same with one of the elements
-                                  // being non-primitive. the other one can
-                                  // then not simply be a FESystem but must
-                                  // in fact be an FESystem of FESystem to
-                                  // hide multiple components in one
-                                  // block. this test tries to see what
-                                  // happens if one doesn't do this
+  // now the same with one of the elements
+  // being non-primitive. the other one can
+  // then not simply be a FESystem but must
+  // in fact be an FESystem of FESystem to
+  // hide multiple components in one
+  // block. this test tries to see what
+  // happens if one doesn't do this
   hp::FECollection<dim> fe_collection;
   fe_collection.push_back (FE_RaviartThomas<dim>(1));
   fe_collection.push_back (FESystem<dim>(FE_Q<dim>(2),dim));
 
-                                  // we will get an assertion failure in
-                                  // n_blocks here.
+  // we will get an assertion failure in
+  // n_blocks here.
   try
     {
       fe_collection.n_blocks();
index b1ee94d790da4f141bc3d000db9a7d521c6ca50a..ee7fb76a3a02dd9dcb9b0d3549d72863457a496a 100644 (file)
@@ -54,36 +54,36 @@ void test ()
 
   hp::DoFHandler<dim>      dof_handler (triangulation);
 
-                                  // loop over cells, and set cells
-                                  // within a circle to be of type
-                                  // FE_Nothing, while outside the
-                                  // circle to be of type FE_Q(1)
+  // loop over cells, and set cells
+  // within a circle to be of type
+  // FE_Nothing, while outside the
+  // circle to be of type FE_Q(1)
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
 
-  for(; cell != endc; cell++)
+  for (; cell != endc; cell++)
     {
       Point<dim> center = cell->center();
-      if( std::sqrt(center.square()) < 0.5 )
-       cell->set_active_fe_index(1);
+      if ( std::sqrt(center.square()) < 0.5 )
+        cell->set_active_fe_index(1);
       else
-       cell->set_active_fe_index(0);
+        cell->set_active_fe_index(0);
     }
 
-                                  // Attempt to distribute dofs.
-                                  // Fails here with assertion from
-                                  // hp_vertex_dof_identities() and
-                                  // after that is fixed in face
-                                  // domination computation.
+  // Attempt to distribute dofs.
+  // Fails here with assertion from
+  // hp_vertex_dof_identities() and
+  // after that is fixed in face
+  // domination computation.
   dof_handler.distribute_dofs (fe_collection);
 
   deallog << "   Number of active cells:       "
-         << triangulation.n_active_cells()
-         << std::endl
-         << "   Number of degrees of freedom: "
-         << dof_handler.n_dofs()
-         << std::endl;
+          << triangulation.n_active_cells()
+          << std::endl
+          << "   Number of degrees of freedom: "
+          << dof_handler.n_dofs()
+          << std::endl;
 }
 
 
index 71cfaeac9b86e3058366998896941ce709fdfcba..f2601795bf0f8d9f2a958d5e2899faaefb69d9a6 100644 (file)
@@ -55,19 +55,19 @@ void test ()
 
   hp::DoFHandler<dim>      dof_handler (triangulation);
 
-                                  // loop over cells, and set cells
-                                  // within a circle to be of type
-                                  // FE_Nothing, while outside the
-                                  // circle to be of type FE_Q(1)
+  // loop over cells, and set cells
+  // within a circle to be of type
+  // FE_Nothing, while outside the
+  // circle to be of type FE_Q(1)
 
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
 
-  for(; cell != endc; cell++)
+  for (; cell != endc; cell++)
     {
       Point<dim> center = cell->center();
-      if( std::sqrt(center.square()) < 0.25 )
+      if ( std::sqrt(center.square()) < 0.25 )
         cell->set_active_fe_index(1);
       else
         cell->set_active_fe_index(0);
@@ -76,51 +76,51 @@ void test ()
   dof_handler.distribute_dofs (fe_collection);
 
   deallog << "   Number of active cells:       "
-         << triangulation.n_active_cells()
-         << std::endl
-         << "   Number of degrees of freedom: "
-         << dof_handler.n_dofs()
-         << std::endl;
+          << triangulation.n_active_cells()
+          << std::endl
+          << "   Number of degrees of freedom: "
+          << dof_handler.n_dofs()
+          << std::endl;
 
 
 
-                                  // .... new test code beyond fe_nothing_01.cc
+  // .... new test code beyond fe_nothing_01.cc
 
   hp::QCollection<dim>     quadrature_collection;
   quadrature_collection.push_back(QGauss<dim>(2));
   quadrature_collection.push_back(QGauss<dim>(0));
 
   hp::FEValues<dim> hp_fe_values (fe_collection,
-                                 quadrature_collection,
-                                 update_values    |  update_gradients |
-                                 update_quadrature_points  |  update_JxW_values);
+                                  quadrature_collection,
+                                  update_values    |  update_gradients |
+                                  update_quadrature_points  |  update_JxW_values);
 
   cell = dof_handler.begin_active();
 
-  for(; cell !=endc; cell++)
+  for (; cell !=endc; cell++)
     {
       deallog << "This is a "
-             << (cell->active_fe_index() == 1 ? "FE_Nothing" : "FE_Q")
-             << " cell"
-             << std::endl;
+              << (cell->active_fe_index() == 1 ? "FE_Nothing" : "FE_Q")
+              << " cell"
+              << std::endl;
 
       if (cell->get_fe().dofs_per_cell == 0)
-       continue;
+        continue;
 
-                                      // attempt to reinit hp_fe_values object
+      // attempt to reinit hp_fe_values object
       hp_fe_values.reinit (cell);
 
       const unsigned int   dofs_per_cell = cell->get_fe().dofs_per_cell;
       const FEValues<dim>  &fe_values    = hp_fe_values.get_present_fe_values ();
 
       for (unsigned int q_point=0; q_point<fe_values.n_quadrature_points; ++q_point)
-       {
-         for (unsigned int i=0; i<dofs_per_cell; ++i)
-           {
-             deallog << fe_values.shape_value(i,q_point) << std::endl;
-             deallog << fe_values.shape_grad(i,q_point) << std::endl;
-           }
-       }
+        {
+          for (unsigned int i=0; i<dofs_per_cell; ++i)
+            {
+              deallog << fe_values.shape_value(i,q_point) << std::endl;
+              deallog << fe_values.shape_grad(i,q_point) << std::endl;
+            }
+        }
 
     }
 
index 4340deeed7e77e30a4cab6f132ff2840831a7cdf..026caec56d3aafe5075857b4da8a879835f7f24e 100644 (file)
@@ -50,49 +50,49 @@ void test ()
   triangulation.refine_global(4);
 
   hp::FECollection<dim>    fe_collection;
-  
+
   fe_collection.push_back (FE_Q<dim>(1));
   fe_collection.push_back (FE_Nothing<dim>());
 
   hp::DoFHandler<dim>      dof_handler (triangulation);
 
-                                  // loop over cells, and set cells
-                                  // within a circle to be of type
-                                  // FE_Nothing, while outside the
-                                  // circle to be of type FE_Q(1)
-       
+  // loop over cells, and set cells
+  // within a circle to be of type
+  // FE_Nothing, while outside the
+  // circle to be of type FE_Q(1)
+
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
 
-  for(; cell != endc; cell++)
-  {
+  for (; cell != endc; cell++)
+    {
       Point<dim> center = cell->center();
-      if(std::sqrt(center.square()) < 0.25 )
+      if (std::sqrt(center.square()) < 0.25 )
         cell->set_active_fe_index(1);
       else
         cell->set_active_fe_index(0);
-  }
+    }
 
   dof_handler.distribute_dofs (fe_collection);
 
   deallog << "   Number of active cells:       "
-         << triangulation.n_active_cells()
-         << std::endl
-         << "   Number of degrees of freedom: "
-         << dof_handler.n_dofs()
-         << std::endl;
-  
-  
-  
+          << triangulation.n_active_cells()
+          << std::endl
+          << "   Number of degrees of freedom: "
+          << dof_handler.n_dofs()
+          << std::endl;
+
+
+
   // .... test constraint handling
-  
+
   ConstraintMatrix constraints;
-  
+
   DoFTools::make_hanging_node_constraints (dof_handler, constraints);
 
   constraints.close();
-  
+
   deallog << "   Number of constraints:        "
           << constraints.n_constraints()
           << std::endl;
index 434b15d17972a909139b5914f7cdf694d51429b7..0aa9783e94927e3fa9421917d2ad8610b097d759 100644 (file)
 
 #include <fstream>
 
-                               // Create a mesh with hanging
-                               // nodes and FEQ/FENothing interfaces
-                               // in several admissible configurations
-                                // we'd like to check.  In 2D the mesh
-                                // looks like the following (with 0
-                                // and 1 denoting the two element types)
-                                //
-                                // +---------+----+----+
-                                // |         | 1  | 1  |
-                                // |    0    +----+----+
-                                // |         | 1  | 1  |
-                                // +----+----+----+----+
-                                // | 0  | 0  |         |
-                                // +----+----+    1    |
-                                // | 0  | 0  |         |
-                                // +----+----+---------+
-                               //
-                               // We then attempt to make hanging node
-                               // constraints on this mesh.
+// Create a mesh with hanging
+// nodes and FEQ/FENothing interfaces
+// in several admissible configurations
+// we'd like to check.  In 2D the mesh
+// looks like the following (with 0
+// and 1 denoting the two element types)
+//
+// +---------+----+----+
+// |         | 1  | 1  |
+// |    0    +----+----+
+// |         | 1  | 1  |
+// +----+----+----+----+
+// | 0  | 0  |         |
+// +----+----+    1    |
+// | 0  | 0  |         |
+// +----+----+---------+
+//
+// We then attempt to make hanging node
+// constraints on this mesh.
 
 template <int dim>
 void test ()
@@ -71,30 +71,30 @@ void test ()
 
   {
     typename Triangulation<dim> :: active_cell_iterator
-        cell = triangulation.begin_active(),
-        endc = triangulation.end();
+    cell = triangulation.begin_active(),
+    endc = triangulation.end();
 
-    for(; cell != endc; cell++)
-    {
+    for (; cell != endc; cell++)
+      {
         Point<dim> center = cell->center();
 
-        if(center[0] < 0)
-        {
-          cell->set_subdomain_id(1);
-        }
+        if (center[0] < 0)
+          {
+            cell->set_subdomain_id(1);
+          }
 
         double h=0;
-        for(unsigned d=0; d<dim; ++d) h += center[d];
+        for (unsigned d=0; d<dim; ++d) h += center[d];
 
-        if(std::fabs(h) + 1e-6 > 0.25*dim)
+        if (std::fabs(h) + 1e-6 > 0.25*dim)
           cell->set_refine_flag();
-    }
+      }
 
     triangulation.execute_coarsening_and_refinement();
   }
 
-                               // create fe_collection and
-                               // distribute dofs
+  // create fe_collection and
+  // distribute dofs
 
   hp::FECollection<dim>    fe_collection;
 
@@ -103,33 +103,33 @@ void test ()
 
   hp::DoFHandler<dim>      dof_handler (triangulation);
 
-                                  // loop over cells, and set cells
-                                  // within a circle to be of type
-                                  // FE_Nothing, while outside the
-                                  // circle to be of type FE_Q(1)
+  // loop over cells, and set cells
+  // within a circle to be of type
+  // FE_Nothing, while outside the
+  // circle to be of type FE_Q(1)
   {
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
 
-    for(; cell != endc; cell++)
-    {
-      if(cell->subdomain_id()==1 )
-        cell->set_active_fe_index(1);
-      else
-        cell->set_active_fe_index(0);
-    }
+    for (; cell != endc; cell++)
+      {
+        if (cell->subdomain_id()==1 )
+          cell->set_active_fe_index(1);
+        else
+          cell->set_active_fe_index(0);
+      }
 
     dof_handler.distribute_dofs (fe_collection);
   }
 
 
   deallog << "   Number of active cells:       "
-         << triangulation.n_active_cells()
-         << std::endl
-         << "   Number of degrees of freedom: "
-         << dof_handler.n_dofs()
-         << std::endl;
+          << triangulation.n_active_cells()
+          << std::endl
+          << "   Number of degrees of freedom: "
+          << dof_handler.n_dofs()
+          << std::endl;
 
 
   // .... test constraint handling
index 24814b450994fc25d41da93e1fd799bfe0ee58bd..7d132dddc1d2887d8fbaef418c0ef532e4fc3d3c 100644 (file)
 
 #include <fstream>
 
-                               // Create a mesh with hanging
-                               // nodes and FEQ/FENothing interfaces
-                               // in several admissible configurations
-                                // we'd like to check.  In 2D the mesh
-                                // looks like the following.
-                                //
-                                // +---------+----+----+
-                                // |         | 1  | 1  |
-                                // |    0    +----+----+
-                                // |         | 1  | 1  |
-                                // +----+----+----+----+
-                                // | 0  | 0  |         |
-                                // +----+----+    1    |
-                                // | 0  | 0  |         |
-                                // +----+----+---------+
-                               //
-                               // We then attempt to make hanging node
-                               // constraints on this mesh.
+// Create a mesh with hanging
+// nodes and FEQ/FENothing interfaces
+// in several admissible configurations
+// we'd like to check.  In 2D the mesh
+// looks like the following.
+//
+// +---------+----+----+
+// |         | 1  | 1  |
+// |    0    +----+----+
+// |         | 1  | 1  |
+// +----+----+----+----+
+// | 0  | 0  |         |
+// +----+----+    1    |
+// | 0  | 0  |         |
+// +----+----+---------+
+//
+// We then attempt to make hanging node
+// constraints on this mesh.
 
 template <int dim>
 void test ()
@@ -70,31 +70,31 @@ void test ()
 
   {
     typename Triangulation<dim> :: active_cell_iterator
-        cell = triangulation.begin_active(),
-        endc = triangulation.end();
+    cell = triangulation.begin_active(),
+    endc = triangulation.end();
 
-    for(; cell != endc; cell++)
-    {
+    for (; cell != endc; cell++)
+      {
         Point<dim> center = cell->center();
 
-        if(center[0] < 0)
-        {
-          cell->set_subdomain_id(1);
-        }
+        if (center[0] < 0)
+          {
+            cell->set_subdomain_id(1);
+          }
 
         double h=0;
-        for(unsigned d=0; d<dim; ++d) h += center[d];
+        for (unsigned d=0; d<dim; ++d) h += center[d];
 
-        if(std::fabs(h) + 1e-6 > 0.25*dim)
+        if (std::fabs(h) + 1e-6 > 0.25*dim)
           cell->set_refine_flag();
-    }
+      }
 
     triangulation.execute_coarsening_and_refinement();
   }
 
-                               // create fe_collection and
-                               // distribute dofs. in this test,
-                                // we are looking at FESystems.
+  // create fe_collection and
+  // distribute dofs. in this test,
+  // we are looking at FESystems.
 
   hp::FECollection<dim>    fe_collection;
 
@@ -106,33 +106,33 @@ void test ()
 
   hp::DoFHandler<dim>      dof_handler (triangulation);
 
-                                  // loop over cells, and set cells
-                                  // within a circle to be of type
-                                  // FE_Nothing, while outside the
-                                  // circle to be of type FE_Q(1)
+  // loop over cells, and set cells
+  // within a circle to be of type
+  // FE_Nothing, while outside the
+  // circle to be of type FE_Q(1)
   {
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
 
-    for(; cell != endc; cell++)
-    {
-      if(cell->subdomain_id()==1 )
-        cell->set_active_fe_index(1);
-      else
-        cell->set_active_fe_index(0);
-    }
+    for (; cell != endc; cell++)
+      {
+        if (cell->subdomain_id()==1 )
+          cell->set_active_fe_index(1);
+        else
+          cell->set_active_fe_index(0);
+      }
 
     dof_handler.distribute_dofs (fe_collection);
   }
 
 
   deallog << "   Number of active cells:       "
-         << triangulation.n_active_cells()
-         << std::endl
-         << "   Number of degrees of freedom: "
-         << dof_handler.n_dofs()
-         << std::endl;
+          << triangulation.n_active_cells()
+          << std::endl
+          << "   Number of degrees of freedom: "
+          << dof_handler.n_dofs()
+          << std::endl;
 
 
   // .... test constraint handling
index 4d5570fd950a7218462c92b5f7e23de0d671cf0a..0b5e4d844f100df627f9208d04dada013cc76831 100644 (file)
@@ -82,31 +82,31 @@ void test ()
 
   {
     typename Triangulation<dim> :: active_cell_iterator
-        cell = triangulation.begin_active(),
-        endc = triangulation.end();
+    cell = triangulation.begin_active(),
+    endc = triangulation.end();
 
-    for(; cell != endc; cell++)
-    {
+    for (; cell != endc; cell++)
+      {
         Point<dim> center = cell->center();
 
-        if(center[0] < 0)
-        {
-          cell->set_subdomain_id(1);
-        }
+        if (center[0] < 0)
+          {
+            cell->set_subdomain_id(1);
+          }
 
         double h=0;
-        for(unsigned d=0; d<dim; ++d) h += center[d];
+        for (unsigned d=0; d<dim; ++d) h += center[d];
 
-        if(std::fabs(h) + 1e-6 > 0.25*dim)
+        if (std::fabs(h) + 1e-6 > 0.25*dim)
           cell->set_refine_flag();
-    }
+      }
 
     triangulation.execute_coarsening_and_refinement();
   }
 
-                               // create fe_collection and
-                               // distribute dofs. in this test,
-                                // we are looking at FESystems.
+  // create fe_collection and
+  // distribute dofs. in this test,
+  // we are looking at FESystems.
 
   hp::FECollection<dim>    fe_collection;
 
@@ -120,26 +120,26 @@ void test ()
 
   {
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
 
-    for(; cell != endc; cell++)
-    {
-      if(cell->subdomain_id()==1 )
-        cell->set_active_fe_index(1);
-      else
-        cell->set_active_fe_index(0);
-    }
+    for (; cell != endc; cell++)
+      {
+        if (cell->subdomain_id()==1 )
+          cell->set_active_fe_index(1);
+        else
+          cell->set_active_fe_index(0);
+      }
 
     dof_handler.distribute_dofs (fe_collection);
   }
 
   deallog << "   Number of active cells:       "
-         << triangulation.n_active_cells()
-         << std::endl
-         << "   Number of degrees of freedom: "
-         << dof_handler.n_dofs()
-         << std::endl;
+          << triangulation.n_active_cells()
+          << std::endl
+          << "   Number of degrees of freedom: "
+          << dof_handler.n_dofs()
+          << std::endl;
 
 
   // .... test constraint handling
@@ -154,29 +154,29 @@ void test ()
           << constraints.n_constraints()
           << std::endl;
 
-                                  // the FE assignment is entirely
-                                  // symmetric, so the number of
-                                  // constraints must be even
+  // the FE assignment is entirely
+  // symmetric, so the number of
+  // constraints must be even
   Assert (constraints.n_constraints() % 2 == 0, ExcInternalError());
 
   {
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
 
-    for(; cell != endc; cell++)
+    for (; cell != endc; cell++)
       {
-       deallog << cell << ' ' << cell->active_fe_index() << std::endl
-               << "   ";
-       std::vector<types::global_dof_index> local_dof_indices (cell->get_fe().dofs_per_cell);
-       cell->get_dof_indices (local_dof_indices);
-
-       for (unsigned int i=0; i<cell->get_fe().dofs_per_cell; ++i)
-         deallog << local_dof_indices[i]
-                 << (constraints.is_constrained(local_dof_indices[i]) ?
-                     "*" : "")
-                 << ' ';
-       deallog << std::endl;
+        deallog << cell << ' ' << cell->active_fe_index() << std::endl
+                << "   ";
+        std::vector<types::global_dof_index> local_dof_indices (cell->get_fe().dofs_per_cell);
+        cell->get_dof_indices (local_dof_indices);
+
+        for (unsigned int i=0; i<cell->get_fe().dofs_per_cell; ++i)
+          deallog << local_dof_indices[i]
+                  << (constraints.is_constrained(local_dof_indices[i]) ?
+                      "*" : "")
+                  << ' ';
+        deallog << std::endl;
       }
   }
 }
index ac28171ede4f71b7526347eb769e2e0978b46ccc..c800bcfc2842b2a02770b42d1595b6a0c7679c06 100644 (file)
@@ -57,10 +57,10 @@ void test ()
   hp::DoFHandler<dim>      dof_handler (triangulation);
 
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
 
-  for(; cell != endc; cell++)
+  for (; cell != endc; cell++)
     if (cell->center()[0] > 0)
       cell->set_active_fe_index(1);
     else
@@ -71,11 +71,11 @@ void test ()
 
   std::map<types::global_dof_index, double> bv;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           ZeroFunction<dim>(1),
-                                           bv);
+                                            0,
+                                            ZeroFunction<dim>(1),
+                                            bv);
   for (std::map<types::global_dof_index, double>::iterator
-        p = bv.begin(); p!=bv.end(); ++p)
+       p = bv.begin(); p!=bv.end(); ++p)
     deallog << p->first << ' ' << p->second << std::endl;
 }
 
index 7dae213998552640aade3ca2f4160451fd5fe510..d4de05eafb212343ed4668312f683ab6cb9efb23 100644 (file)
@@ -59,10 +59,10 @@ void test ()
   hp::DoFHandler<dim>      dof_handler (triangulation);
 
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
 
-  for(; cell != endc; cell++)
+  for (; cell != endc; cell++)
     if (cell->center()[0] > 0)
       cell->set_active_fe_index(1);
     else
@@ -73,11 +73,11 @@ void test ()
 
   std::map<types::global_dof_index, double> bv;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           ZeroFunction<dim>(2),
-                                           bv);
+                                            0,
+                                            ZeroFunction<dim>(2),
+                                            bv);
   for (std::map<types::global_dof_index, double>::iterator
-        p = bv.begin(); p!=bv.end(); ++p)
+       p = bv.begin(); p!=bv.end(); ++p)
     deallog << p->first << ' ' << p->second << std::endl;
 }
 
index 42368345e82eccb9ccc8147f619b8fc5870a88e1..0621275e355ce967344924af0bf4fafff350c4c1 100644 (file)
@@ -54,17 +54,17 @@ void test ()
 
   hp::FECollection<dim>    fe_collection;
   fe_collection.push_back (FESystem<dim>(FE_Q<dim>(1), 2,
-                                        FE_Nothing<dim>(), 2));
+                                         FE_Nothing<dim>(), 2));
   fe_collection.push_back (FESystem<dim>(FE_Nothing<dim>(), 2,
-                                        FE_Q<dim>(1), 2));
+                                         FE_Q<dim>(1), 2));
 
   hp::DoFHandler<dim>      dof_handler (triangulation);
 
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
 
-  for(; cell != endc; cell++)
+  for (; cell != endc; cell++)
     if (cell->center()[0] > 0)
       cell->set_active_fe_index(1);
     else
@@ -75,11 +75,11 @@ void test ()
 
   std::map<types::global_dof_index, double> bv;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           ZeroFunction<dim>(4),
-                                           bv);
+                                            0,
+                                            ZeroFunction<dim>(4),
+                                            bv);
   for (std::map<types::global_dof_index, double>::iterator
-        p = bv.begin(); p!=bv.end(); ++p)
+       p = bv.begin(); p!=bv.end(); ++p)
     deallog << p->first << ' ' << p->second << std::endl;
 }
 
index 0f3ca8a1f4285613fcdf78322c1b18fc99fcfac1..2050063d2f320323a05c6e5f8ac89923aff6f2a7 100644 (file)
@@ -64,16 +64,16 @@ void test ()
 
   hp::FECollection<dim>    fe_collection;
   fe_collection.push_back (FESystem<dim>(FE_Q<dim>(1), 1,
-                                        FE_Nothing<dim>(), 1));
+                                         FE_Nothing<dim>(), 1));
   fe_collection.push_back (FESystem<dim>(FE_Nothing<dim>(), 1,
-                                        FE_Q<dim>(1), 1));
+                                         FE_Q<dim>(1), 1));
 
   hp::DoFHandler<dim>      dof_handler (triangulation);
 
   dof_handler.begin_active()->set_active_fe_index(1);
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(1),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(1),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     if (cell->index() % 2 == 0)
       cell->set_active_fe_index (0);
@@ -93,22 +93,22 @@ void test ()
           << std::endl;
   {
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
 
-    for(; cell != endc; cell++)
+    for (; cell != endc; cell++)
       {
-       deallog << cell << ' ' << cell->active_fe_index() << std::endl
-               << "   ";
-       std::vector<types::global_dof_index> local_dof_indices (cell->get_fe().dofs_per_cell);
-       cell->get_dof_indices (local_dof_indices);
-
-       for (unsigned int i=0; i<cell->get_fe().dofs_per_cell; ++i)
-         deallog << local_dof_indices[i]
-                 << (constraints.is_constrained(local_dof_indices[i]) ?
-                     "*" : "")
-                 << ' ';
-       deallog << std::endl;
+        deallog << cell << ' ' << cell->active_fe_index() << std::endl
+                << "   ";
+        std::vector<types::global_dof_index> local_dof_indices (cell->get_fe().dofs_per_cell);
+        cell->get_dof_indices (local_dof_indices);
+
+        for (unsigned int i=0; i<cell->get_fe().dofs_per_cell; ++i)
+          deallog << local_dof_indices[i]
+                  << (constraints.is_constrained(local_dof_indices[i]) ?
+                      "*" : "")
+                  << ' ';
+        deallog << std::endl;
       }
   }
 }
index 51de4fcf69e469f90f33f86d7b34a9a0d69c1078..9eaed85228ff65cf4cf74de6fb32c32e6bacafa3 100644 (file)
@@ -75,8 +75,8 @@ void test ()
 
   dof_handler.begin_active()->set_active_fe_index(1);
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(0),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(0),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     if (cell->index() % 2 == 0)
       cell->set_active_fe_index (1);
@@ -96,22 +96,22 @@ void test ()
           << std::endl;
   {
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
 
-    for(; cell != endc; cell++)
+    for (; cell != endc; cell++)
       {
-       deallog << cell << ' ' << cell->active_fe_index() << std::endl
-               << "   ";
-       std::vector<types::global_dof_index> local_dof_indices (cell->get_fe().dofs_per_cell);
-       cell->get_dof_indices (local_dof_indices);
-
-       for (unsigned int i=0; i<cell->get_fe().dofs_per_cell; ++i)
-         deallog << local_dof_indices[i]
-                 << (constraints.is_constrained(local_dof_indices[i]) ?
-                     "*" : "")
-                 << ' ';
-       deallog << std::endl;
+        deallog << cell << ' ' << cell->active_fe_index() << std::endl
+                << "   ";
+        std::vector<types::global_dof_index> local_dof_indices (cell->get_fe().dofs_per_cell);
+        cell->get_dof_indices (local_dof_indices);
+
+        for (unsigned int i=0; i<cell->get_fe().dofs_per_cell; ++i)
+          deallog << local_dof_indices[i]
+                  << (constraints.is_constrained(local_dof_indices[i]) ?
+                      "*" : "")
+                  << ' ';
+        deallog << std::endl;
       }
   }
 }
index db83da5dd55419d60b9248c891375067169a042e..6ad52f41e58eede7a6da096108561b124f7796a6 100644 (file)
@@ -83,13 +83,13 @@ void test ()
   fe_collection.push_back (FE_Q<dim>(1));
   fe_collection.push_back (FE_Nothing<dim>());
   fe_collection.push_back (FE_Q<dim>(2));
-  
+
   hp::DoFHandler<dim>      dof_handler (triangulation);
 
   dof_handler.begin_active()->set_active_fe_index(1);
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(0),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(0),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     if (cell->index() % 2 == 0)
       cell->set_active_fe_index (1);
@@ -109,22 +109,22 @@ void test ()
           << std::endl;
   {
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
 
-    for(; cell != endc; cell++)
+    for (; cell != endc; cell++)
       {
-       deallog << cell << ' ' << cell->active_fe_index() << std::endl
-               << "   ";
-       std::vector<types::global_dof_index> local_dof_indices (cell->get_fe().dofs_per_cell);
-       cell->get_dof_indices (local_dof_indices);
-
-       for (unsigned int i=0; i<cell->get_fe().dofs_per_cell; ++i)
-         deallog << local_dof_indices[i]
-                 << (constraints.is_constrained(local_dof_indices[i]) ?
-                     "*" : "")
-                 << ' ';
-       deallog << std::endl;
+        deallog << cell << ' ' << cell->active_fe_index() << std::endl
+                << "   ";
+        std::vector<types::global_dof_index> local_dof_indices (cell->get_fe().dofs_per_cell);
+        cell->get_dof_indices (local_dof_indices);
+
+        for (unsigned int i=0; i<cell->get_fe().dofs_per_cell; ++i)
+          deallog << local_dof_indices[i]
+                  << (constraints.is_constrained(local_dof_indices[i]) ?
+                      "*" : "")
+                  << ' ';
+        deallog << std::endl;
       }
   }
 
index 53b150c3026e3fbcd168a45cce42ba92c4d490c6..3b95c9d61bf8af1f86d3797310c2465618a7069f 100644 (file)
@@ -49,7 +49,7 @@ void test ()
   GridGenerator :: hyper_cube (triangulation, -0.5, 0.5);
 
   FESystem<dim> fe (FE_Q<dim>(1), 1,
-                   FE_Nothing<dim>(), 1);
+                    FE_Nothing<dim>(), 1);
   DoFHandler<dim> dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
 
@@ -59,10 +59,10 @@ void test ()
   for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
     for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
       deallog << "i=" << i
-             << ", q=" << q
-             << ", value="
-             << fe_values[nothing].value(i,q)
-             << std::endl;
+              << ", q=" << q
+              << ", value="
+              << fe_values[nothing].value(i,q)
+              << std::endl;
 }
 
 
index 4c449e7c2faa88477a74b4a4fd56a980b08c9213..2810557bf2ef2bc5c5a264ce130318c9e8da937b 100644 (file)
@@ -56,7 +56,7 @@ void test ()
   GridGenerator :: hyper_cube (triangulation, -0.5, 0.5);
 
   FESystem<dim> fe (FE_Q<dim>(1), 1,
-                   FE_Nothing<dim>(), 1);
+                    FE_Nothing<dim>(), 1);
   DoFHandler<dim> dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
 
@@ -65,16 +65,16 @@ void test ()
   FEValuesExtractors::Scalar nothing(1);
   fe_values.reinit (dof_handler.begin_active(), 0);
 
-                                  // the following (second) call to reinit
-                                  // used to abort
+  // the following (second) call to reinit
+  // used to abort
   fe_values.reinit (dof_handler.begin_active(), 1);
   for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
     for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
       deallog << "i=" << i
-             << ", q=" << q
-             << ", value="
-             << fe_values[nothing].value(i,q)
-             << std::endl;
+              << ", q=" << q
+              << ", value="
+              << fe_values[nothing].value(i,q)
+              << std::endl;
 }
 
 
index de287db0eaa2655c744037364504d5f183996462..99c16418b5f54965f0fc956d362bf514a4343b02 100644 (file)
@@ -49,7 +49,7 @@ void transfer(std::ostream &out)
   tria.refine_global(5-dim);
 
   FESystem<dim> fe(FE_Q<dim> (1), 1,
-                  FE_Nothing<dim>(), 1);
+                   FE_Nothing<dim>(), 1);
   DoFHandler<dim> dof_handler(tria);
 
   Vector<double> solution;
@@ -64,9 +64,9 @@ void transfer(std::ostream &out)
 
   SolutionTransfer<dim> soltrans(dof_handler);
 
-                                  // test a): pure refinement
+  // test a): pure refinement
   typename Triangulation<dim>::active_cell_iterator cell=tria.begin_active(),
-                                                   endc=tria.end();
+                                                    endc=tria.end();
   ++cell;
   ++cell;
   for (; cell!=endc; ++cell)
@@ -82,7 +82,7 @@ void transfer(std::ostream &out)
   solution.reinit (dof_handler.n_dofs());
   solution = tmp_q;
 
-                                  // test b): with coarsening
+  // test b): with coarsening
   soltrans.clear();
 
   cell=tria.begin_active(tria.n_levels()-1);
index 425d8a3002144ecee31cb778d55c07e840a9ad34..069fe4fe3695be0b7dd963eec82c57d62daa676e 100644 (file)
@@ -44,7 +44,7 @@ void test ()
   tria.refine_global (2);
   tria.begin_active()->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
-  tria.refine_global (2);  
+  tria.refine_global (2);
 
   hp::FECollection<dim> fe_collection;
   fe_collection.push_back(FE_Q<dim> (1));
@@ -55,15 +55,15 @@ void test ()
   hp::DoFHandler<dim> dof_handler(tria);
 
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell != dof_handler.end(); ++cell)
     cell->set_active_fe_index (rand() % fe_collection.size());
-  
+
   dof_handler.distribute_dofs(fe_collection);
 
   std::vector<unsigned int> active_fe_indices (tria.n_active_cells());
   DoFTools::get_active_fe_indices (dof_handler,
-                                  active_fe_indices);
+                                   active_fe_indices);
   for (unsigned int i=0; i<tria.n_active_cells(); ++i)
     deallog << active_fe_indices[i] << std::endl;
 }
@@ -73,14 +73,14 @@ int main ()
 {
   std::ofstream logfile("get_active_fe_indices/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index fc1d4fe5f8091ec00faf444fb9406b3a471b0033..89985ca6f880723b3839c1f5ba987d03a5040669 100644 (file)
@@ -1,6 +1,6 @@
 //----------------------------  hp_constraints_common.cc  ---------------------------
 //    $Id$
-//    Version: $Name$ 
+//    Version: $Name$
 //
 //    Copyright (C) 2006, 2007 by the deal.II authors
 //
@@ -56,13 +56,13 @@ void test ();
 
 template <int dim>
 void do_check (const Triangulation<dim> &triangulation,
-              const hp::FECollection<dim> &fe)
+               const hp::FECollection<dim> &fe)
 {
   hp::DoFHandler<dim>        dof_handler(triangulation);
 
-                                  // distribute fe_indices randomly
+  // distribute fe_indices randomly
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell != dof_handler.end(); ++cell)
     cell->set_active_fe_index (rand() % fe.size());
   dof_handler.distribute_dofs (fe);
@@ -71,7 +71,7 @@ void do_check (const Triangulation<dim> &triangulation,
 
   ConstraintMatrix constraints;
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          constraints);
+                                           constraints);
   constraints.close ();
 
   constraints.print (deallog.get_file_stream());
@@ -102,7 +102,7 @@ void test_with_hanging_nodes (const hp::FECollection<dim> &fe)
   triangulation.begin_active()->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
   triangulation.refine_global (1);
-  
+
   do_check (triangulation, fe);
 }
 
@@ -119,14 +119,14 @@ void test_with_hanging_nodes_random (const hp::FECollection<dim> &fe)
   for (unsigned int i=0; i<7-dim; ++i)
     {
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = triangulation.begin_active();
-          cell != triangulation.end();
-          ++cell)
-       if (rand() % 4 == 0)
-         cell->set_refine_flag ();
+           cell = triangulation.begin_active();
+           cell != triangulation.end();
+           ++cell)
+        if (rand() % 4 == 0)
+          cell->set_refine_flag ();
       triangulation.execute_coarsening_and_refinement ();
     }
-  
+
   do_check (triangulation, fe);
 }
 
@@ -142,17 +142,17 @@ void test_with_hanging_nodes_random_aniso (const hp::FECollection<dim> &fe)
   for (unsigned int i=0; i<7-dim; ++i)
     {
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = triangulation.begin_active();
-          cell != triangulation.end();
-          ++cell)
-       if (rand() % 4 == 0)
-         cell->set_refine_flag (RefinementCase<dim>(rand() % RefinementCase<dim>::isotropic_refinement + 1));
+           cell = triangulation.begin_active();
+           cell != triangulation.end();
+           ++cell)
+        if (rand() % 4 == 0)
+          cell->set_refine_flag (RefinementCase<dim>(rand() % RefinementCase<dim>::isotropic_refinement + 1));
       triangulation.execute_coarsening_and_refinement ();
     }
-  
+
   do_check (triangulation, fe);
 }
-  
+
 
 
 // test with a 3d grid that has cells with face_orientation==false and hanging
@@ -170,17 +170,17 @@ void test_with_wrong_face_orientation (const hp::FECollection<dim> &fe)
 {
   if (dim != 3)
     return;
-  
+
   for (unsigned int i=0; i<7; ++i)
     {
       Triangulation<dim>     triangulation;
       GridGenerator::hyper_ball (triangulation);
       typename Triangulation<dim>::active_cell_iterator
-       cell = triangulation.begin_active();
+      cell = triangulation.begin_active();
       std::advance (cell, i);
       cell->set_refine_flag ();
       triangulation.execute_coarsening_and_refinement ();
-  
+
       do_check (triangulation, fe);
     }
 }
@@ -196,7 +196,7 @@ void test_with_2d_deformed_mesh (const hp::FECollection<dim> &fe)
 {
   if (dim != 2)
     return;
-  
+
   std::vector<Point<dim> > points_glob;
   std::vector<Point<dim> > points;
 
@@ -208,7 +208,7 @@ void test_with_2d_deformed_mesh (const hp::FECollection<dim> &fe)
   points_glob.push_back (Point<dim> (0.5, 1.0));
   points_glob.push_back (Point<dim> (0.0, 1.0));
 
-                                  // Prepare cell data
+  // Prepare cell data
   std::vector<CellData<dim> > cells (3);
 
   cells[0].vertices[0] = 0;
@@ -231,7 +231,7 @@ void test_with_2d_deformed_mesh (const hp::FECollection<dim> &fe)
 
   Triangulation<dim>     triangulation;
   triangulation.create_triangulation (points_glob, cells, SubCellData());
-  
+
   do_check (triangulation, fe);
 }
 
@@ -258,7 +258,7 @@ void test_with_2d_deformed_refined_mesh (const hp::FECollection<dim> &fe)
       points_glob.push_back (Point<dim> (0.5, 1.0));
       points_glob.push_back (Point<dim> (0.0, 1.0));
 
-                                      // Prepare cell data
+      // Prepare cell data
       std::vector<CellData<dim> > cells (3);
 
       cells[0].vertices[0] = 0;
@@ -283,21 +283,21 @@ void test_with_2d_deformed_refined_mesh (const hp::FECollection<dim> &fe)
       triangulation.create_triangulation (points_glob, cells, SubCellData());
 
       switch (i)
-       {
-         case 0:
-               triangulation.begin_active()->set_refine_flag();
-               break;
-         case 1:
-               (++(triangulation.begin_active()))->set_refine_flag();
-               break;
-         case 2:
-               (++(++(triangulation.begin_active())))->set_refine_flag();
-               break;
-         default:
-               Assert (false, ExcNotImplemented());
-       }
+        {
+        case 0:
+          triangulation.begin_active()->set_refine_flag();
+          break;
+        case 1:
+          (++(triangulation.begin_active()))->set_refine_flag();
+          break;
+        case 2:
+          (++(++(triangulation.begin_active())))->set_refine_flag();
+          break;
+        default:
+          Assert (false, ExcNotImplemented());
+        }
       triangulation.execute_coarsening_and_refinement ();
-      
+
       do_check (triangulation, fe);
     }
 }
@@ -309,147 +309,147 @@ void test_with_2d_deformed_refined_mesh (const hp::FECollection<dim> &fe)
 // error. we do so with every pair of finite elements given
 template <int dim>
 void test_interpolation_base (const hp::FECollection<dim>     &fe,
-                             const std::vector<unsigned int> &polynomial_degrees,
-                             const bool                       do_refine)
+                              const std::vector<unsigned int> &polynomial_degrees,
+                              const bool                       do_refine)
 {
-                                  // create a mesh like this (viewed
-                                  // from top, if in 3d):
-                                  // *---*---*
-                                  // | 0 | 1 |
-                                  // *---*---*
-                                  //
-                                  // then refine cell 1 if do_refine, so that
-                                  // we get hanging nodes
+  // create a mesh like this (viewed
+  // from top, if in 3d):
+  // *---*---*
+  // | 0 | 1 |
+  // *---*---*
+  //
+  // then refine cell 1 if do_refine, so that
+  // we get hanging nodes
   Triangulation<dim>     triangulation;
   std::vector<unsigned int> subdivisions (dim, 1);
   subdivisions[0] = 2;
   GridGenerator::subdivided_hyper_rectangle (triangulation, subdivisions,
                                              Point<dim>(),
-                                            (dim == 3 ?
-                                             Point<dim>(2,1,1) :
-                                             (dim == 2 ?
-                                              Point<dim>(2,1) :
-                                              Point<dim>(2.))));
+                                             (dim == 3 ?
+                                              Point<dim>(2,1,1) :
+                                              (dim == 2 ?
+                                               Point<dim>(2,1) :
+                                               Point<dim>(2.))));
 
   if (do_refine)
     {
       (++triangulation.begin_active())->set_refine_flag ();
       triangulation.execute_coarsening_and_refinement ();
     }
-  
+
   hp::DoFHandler<dim>        dof_handler(triangulation);
 
 
-                                  // for every pair of finite elements,
-                                  // assign them to each of the two sides of the domain
+  // for every pair of finite elements,
+  // assign them to each of the two sides of the domain
   for (unsigned int fe1=0; fe1<fe.size(); ++fe1)
     for (unsigned int fe2=0; fe2<fe.size(); ++fe2)
       {
-                                        // skip elements that don't have
-                                        // support points defined
-       if (! (fe[fe1].has_support_points() &&
-              fe[fe2].has_support_points()))
-         continue;
-       
-       deallog << "Testing " << fe[fe1].get_name()
-               << " vs. " << fe[fe2].get_name()
-               << std::endl;
-       
-                                        // set fe on coarse cell to 'i', on
-                                        // all fine cells to 'j'
-       typename hp::DoFHandler<dim>::active_cell_iterator
-         cell = dof_handler.begin_active();
-       cell->set_active_fe_index (fe1);
-       ++cell;
-
-       for (; cell != dof_handler.end(); ++cell)
-         cell->set_active_fe_index (fe2);
-
-       dof_handler.distribute_dofs (fe);
-  
-       ConstraintMatrix constraints;
-       DoFTools::make_hanging_node_constraints (dof_handler,
-                                                constraints);
-       constraints.close ();
-
-       Vector<double> interpolant_1 (dof_handler.n_dofs());
-       Vector<double> interpolant_2 (dof_handler.n_dofs());
-       
-       Vector<float>  error (triangulation.n_active_cells());
-
-                                        // now consider the dim polynomials
-                                        // of degree equal to the minimal
-                                        // degree of the two finite elements
-                                        // with dependence on only a single
-                                        // coordinate. also consider the one
-                                        // that has full degree in all
-                                        // directions (note that the last
-                                        // test will fail for P finite
-                                        // elements, whereas it is ok for the
-                                        // Q elements; the P elements don't
-                                        // run this test right now because
-                                        // they have no support points and
-                                        // therefore can't use
-                                        // VectorTools::interpolate...)
-       const unsigned int min_degree = std::min (polynomial_degrees[fe1],
-                                                 polynomial_degrees[fe2]);
-       for (unsigned int test=0; test<dim+1; ++test)
-         {
-           Tensor<1,dim> exponents;
-           if (test < dim)
-             exponents[test] = min_degree;
-           else
-             {
-               for (unsigned int i=0; i<dim; ++i)
-                 exponents[i] = min_degree;
-             }
-
-           const Functions::Monomial<dim> test_function (exponents,
-                                                         fe.n_components());
-
-                                            // interpolate the function
-           VectorTools::interpolate (dof_handler,
-                                     test_function,
-                                     interpolant_1);
-
-                                            // then compute the interpolation error
-           VectorTools::integrate_difference (dof_handler,
-                                              interpolant_1,
-                                              test_function,
-                                              error,
-                                              hp::QCollection<dim>(QGauss<dim>(min_degree+2)),
-                                              VectorTools::L2_norm);
-           Assert (error.l2_norm() < 1e-12*interpolant_1.l2_norm(),
-                   ExcInternalError());
-           deallog << "  Relative interpolation error before constraints: "
-                   << error.l2_norm() / interpolant_1.l2_norm()
-                   << std::endl;
-
-                                            // copy the interpolant, apply
-                                            // the constraints, and then
-                                            // compare the difference. it
-                                            // should be zero, since our
-                                            // original polynomial was in the
-                                            // ansatz space
-           interpolant_2 = interpolant_1;
-           constraints.distribute (interpolant_2);
-
-           interpolant_2 -= interpolant_1;
-
-           Assert (interpolant_2.l2_norm() < 1e-12*interpolant_1.l2_norm(),
-                   ExcInternalError());
-
-           deallog << "  Relative difference after constraints: "
-                   << interpolant_2.l2_norm() / interpolant_1.l2_norm()
-                   << std::endl;
-         }
+        // skip elements that don't have
+        // support points defined
+        if (! (fe[fe1].has_support_points() &&
+               fe[fe2].has_support_points()))
+          continue;
+
+        deallog << "Testing " << fe[fe1].get_name()
+                << " vs. " << fe[fe2].get_name()
+                << std::endl;
+
+        // set fe on coarse cell to 'i', on
+        // all fine cells to 'j'
+        typename hp::DoFHandler<dim>::active_cell_iterator
+        cell = dof_handler.begin_active();
+        cell->set_active_fe_index (fe1);
+        ++cell;
+
+        for (; cell != dof_handler.end(); ++cell)
+          cell->set_active_fe_index (fe2);
+
+        dof_handler.distribute_dofs (fe);
+
+        ConstraintMatrix constraints;
+        DoFTools::make_hanging_node_constraints (dof_handler,
+                                                 constraints);
+        constraints.close ();
+
+        Vector<double> interpolant_1 (dof_handler.n_dofs());
+        Vector<double> interpolant_2 (dof_handler.n_dofs());
+
+        Vector<float>  error (triangulation.n_active_cells());
+
+        // now consider the dim polynomials
+        // of degree equal to the minimal
+        // degree of the two finite elements
+        // with dependence on only a single
+        // coordinate. also consider the one
+        // that has full degree in all
+        // directions (note that the last
+        // test will fail for P finite
+        // elements, whereas it is ok for the
+        // Q elements; the P elements don't
+        // run this test right now because
+        // they have no support points and
+        // therefore can't use
+        // VectorTools::interpolate...)
+        const unsigned int min_degree = std::min (polynomial_degrees[fe1],
+                                                  polynomial_degrees[fe2]);
+        for (unsigned int test=0; test<dim+1; ++test)
+          {
+            Tensor<1,dim> exponents;
+            if (test < dim)
+              exponents[test] = min_degree;
+            else
+              {
+                for (unsigned int i=0; i<dim; ++i)
+                  exponents[i] = min_degree;
+              }
+
+            const Functions::Monomial<dim> test_function (exponents,
+                                                          fe.n_components());
+
+            // interpolate the function
+            VectorTools::interpolate (dof_handler,
+                                      test_function,
+                                      interpolant_1);
+
+            // then compute the interpolation error
+            VectorTools::integrate_difference (dof_handler,
+                                               interpolant_1,
+                                               test_function,
+                                               error,
+                                               hp::QCollection<dim>(QGauss<dim>(min_degree+2)),
+                                               VectorTools::L2_norm);
+            Assert (error.l2_norm() < 1e-12*interpolant_1.l2_norm(),
+                    ExcInternalError());
+            deallog << "  Relative interpolation error before constraints: "
+                    << error.l2_norm() / interpolant_1.l2_norm()
+                    << std::endl;
+
+            // copy the interpolant, apply
+            // the constraints, and then
+            // compare the difference. it
+            // should be zero, since our
+            // original polynomial was in the
+            // ansatz space
+            interpolant_2 = interpolant_1;
+            constraints.distribute (interpolant_2);
+
+            interpolant_2 -= interpolant_1;
+
+            Assert (interpolant_2.l2_norm() < 1e-12*interpolant_1.l2_norm(),
+                    ExcInternalError());
+
+            deallog << "  Relative difference after constraints: "
+                    << interpolant_2.l2_norm() / interpolant_1.l2_norm()
+                    << std::endl;
+          }
       }
 }
 
 
 template <int dim>
 void test_interpolation (const hp::FECollection<dim>     &fe,
-                        const std::vector<unsigned int> &polynomial_degrees)
+                         const std::vector<unsigned int> &polynomial_degrees)
 {
   test_interpolation_base (fe, polynomial_degrees, false);
   test_interpolation_base (fe, polynomial_degrees, true);
@@ -461,7 +461,7 @@ int main ()
 {
   std::ofstream logfile(logname);
   logfile.precision (3);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
index 04168eb6f45f507893f3fa6a95a55bc1724b32e2..c47ab4bb260e1c20a12de863f31a8377fb7ad8b7 100644 (file)
@@ -34,7 +34,7 @@ void test ()
   for (unsigned int i=1; i<4; ++i)
     {
       fe.push_back (FESystem<dim>(FE_Q<dim>(i), 1,
-                                 FE_DGQ<dim>(i+1), 1));
+                                  FE_DGQ<dim>(i+1), 1));
       degrees.push_back (i);
     }
 
index 328fef589fe80b6cdfce626a0317c4c654a0d943..a4a34d44cd7d098132ed2b299612ceef944ea152 100644 (file)
@@ -36,7 +36,7 @@ void test ()
   for (unsigned int i=1; i<4; ++i)
     for (unsigned int j=0; j<4; ++j)
       fe.push_back (FESystem<dim>(FE_Q<dim>(i), 1,
-                                 FE_DGQ<dim>(j), 1));
+                                  FE_DGQ<dim>(j), 1));
 
   deallog << "No hanging nodes test" << std::endl;
   test_no_hanging_nodes  (fe);
index 0cc57dd8b245d46ec14219de233d3e824809f2da..56f010ca741e935dd73eccd1dce2d52676290c7a 100644 (file)
@@ -30,7 +30,7 @@ void test ()
 {
   if (dim == 1)
     return;
-  
+
   deallog << "Test for dim = " << dim << std::endl << std::endl;
   hp::FECollection<dim> fe;
   std::vector<unsigned int> degrees;
index a565aeaebcc3c705a0c7eef49e2d908ec8d21b47..a9aa5ebc2d6a9ea39c82c5ce208900d29f500048 100644 (file)
@@ -35,7 +35,7 @@ int main ()
 {
   std::ofstream logfile("hp_dof_handler/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
@@ -48,13 +48,13 @@ int main ()
   fe_collection.push_back (FE_DGQ<dim> (1));
 
   hp::DoFHandler<dim> dof_handler(tria);
-  
+
   tria.begin_active()->set_refine_flag();
   tria.execute_coarsening_and_refinement();
 
   Triangulation<dim>::active_cell_iterator
-    cell=tria.begin_active(),
-    endc=tria.end();
+  cell=tria.begin_active(),
+  endc=tria.end();
   for (; cell!=endc; ++cell)
     cell->set_coarsen_flag();
   tria.execute_coarsening_and_refinement();
index dec7250ebfab74cceb1c10b36eb06713cba45cd8..bc9ecd57921c1dd0a4af7b5c93ce56eb54adf431 100644 (file)
@@ -58,10 +58,10 @@ template <int dim>
 int generate_grid (Triangulation<dim> &tria)
 {
   Point<dim> p1,
-    p2;
+        p2;
   std::vector<unsigned int> sub_div;
 
-                                  // Define a rectangular shape
+  // Define a rectangular shape
   for (unsigned int d=0; d < dim; ++d)
     {
       p1(d) = 0;
@@ -70,7 +70,7 @@ int generate_grid (Triangulation<dim> &tria)
     }
   GridGenerator::subdivided_hyper_rectangle (tria, sub_div, p1, p2, true);
 
-                                  // Refine the first cell.
+  // Refine the first cell.
   tria.begin_active ()->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
 
@@ -84,21 +84,21 @@ void test_constraints (hp::FECollection<dim> &fe_coll)
 {
   Triangulation<dim> tria;
 
-                                  // Setup a rectangular domain
-                                  // where one cell is h-refined,
-                                  // while the other cell is
-                                  // unrefined. Furthermore every cell
-                                  // gets a different active_fe_index.
-                                  // This should serve as a testcase
-                                  // for the hanging node constraints.
+  // Setup a rectangular domain
+  // where one cell is h-refined,
+  // while the other cell is
+  // unrefined. Furthermore every cell
+  // gets a different active_fe_index.
+  // This should serve as a testcase
+  // for the hanging node constraints.
   generate_grid (tria);
 
-                                  // Now assign increasing
-                                  // active_fe_indices to
-                                  // the different cells.
+  // Now assign increasing
+  // active_fe_indices to
+  // the different cells.
   hp::DoFHandler<dim> dof_handler (tria);
   typename hp::DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active (),
-                                           endc = dof_handler.end ();
+                                                     endc = dof_handler.end ();
   unsigned int fe_indx = 0;
   for (; cell != endc; ++cell)
     {
@@ -106,17 +106,17 @@ void test_constraints (hp::FECollection<dim> &fe_coll)
       ++fe_indx;
     }
 
-                                  // Distribute DoFs;
+  // Distribute DoFs;
   dof_handler.distribute_dofs (fe_coll);
   deallog << "DoFs: " << dof_handler.n_dofs () << std::endl;
 
-                                  // Create the constraints.
+  // Create the constraints.
   ConstraintMatrix constraint_matrix;
 
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          constraint_matrix);
+                                           constraint_matrix);
 
-                                  // Output the constraints
+  // Output the constraints
   constraint_matrix.print (deallog.get_file_stream ());
 }
 
@@ -126,31 +126,31 @@ void test_constraints_old (FiniteElement<dim> &fe)
 {
   Triangulation<dim> tria;
 
-                                  // Setup a rectangular domain
-                                  // where one cell is h-refined,
-                                  // while the other cell is
-                                  // unrefined. Furthermore every cell
-                                  // gets a different active_fe_index.
-                                  // This should serve as a testcase
-                                  // for the hanging node constraints.
+  // Setup a rectangular domain
+  // where one cell is h-refined,
+  // while the other cell is
+  // unrefined. Furthermore every cell
+  // gets a different active_fe_index.
+  // This should serve as a testcase
+  // for the hanging node constraints.
   generate_grid (tria);
 
-                                  // Now assign increasing
-                                  // active_fe_indices to
-                                  // the different cells.
+  // Now assign increasing
+  // active_fe_indices to
+  // the different cells.
   DoFHandler<dim> dof_handler (tria);
 
-                                  // Distribute DoFs;
+  // Distribute DoFs;
   dof_handler.distribute_dofs (fe);
   deallog << "DoFs: " << dof_handler.n_dofs () << std::endl;
 
-                                  // Create the constraints.
+  // Create the constraints.
   ConstraintMatrix constraint_matrix;
 
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          constraint_matrix);
+                                           constraint_matrix);
 
-                                  // Output the constraints
+  // Output the constraints
   constraint_matrix.print (deallog.get_file_stream ());
 }
 
index ebfcd1008fd9e77cb31af6e2c03a3da86a8f02e6..c2ff3f0bfa8f575391daef41cef45f0fa2fbc694 100644 (file)
@@ -57,7 +57,7 @@ std::ofstream logfile("hp_hanging_nodes_02/output");
 
 template <int dim>
 void run (bool random_p,
-         unsigned int *indx)
+          unsigned int *indx)
 {
   Triangulation<dim>     triangulation;
   hp::FECollection<dim>              fe;
@@ -65,9 +65,9 @@ void run (bool random_p,
   ConstraintMatrix     hanging_node_constraints;
 
   FE_Q<dim> fe_1 (indx[0]),
-    fe_2 (indx[1]),
-    fe_3 (indx[2]),
-    fe_4 (indx[3]);
+       fe_2 (indx[1]),
+       fe_3 (indx[2]),
+       fe_4 (indx[3]);
 
   fe.push_back (fe_1);
   fe.push_back (fe_2);
@@ -77,48 +77,48 @@ void run (bool random_p,
   GridGenerator::hyper_cube (triangulation, -1, 1);
   triangulation.refine_global (5-dim);
   deallog << "Number of active cells: "
-           << triangulation.n_active_cells()
-           << std::endl;
+          << triangulation.n_active_cells()
+          << std::endl;
   deallog << "Total number of cells: "
-           << triangulation.n_cells()
-           << std::endl;
+          << triangulation.n_cells()
+          << std::endl;
 
-                                  // Now to the p-Method. Assign
-                                  // random active_fe_indices to the
-                                  // different cells.
+  // Now to the p-Method. Assign
+  // random active_fe_indices to the
+  // different cells.
   typename hp::DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active (),
-                                                    endc = dof_handler.end ();
+                                                     endc = dof_handler.end ();
   if (random_p)
     {
       for (; cell != endc; ++cell)
-       {
-         cell->set_active_fe_index ((int)(4.0 * (double) random () / (double) RAND_MAX));
-       }
+        {
+          cell->set_active_fe_index ((int)(4.0 * (double) random () / (double) RAND_MAX));
+        }
     }
   else
     {
       unsigned int cell_no = 0;
       for (; cell != endc; ++cell)
-       {
-         if (cell_no >= triangulation.n_active_cells () / 2)
-           cell->set_active_fe_index (1);
-         else
-           cell->set_active_fe_index (0);
-       }
+        {
+          if (cell_no >= triangulation.n_active_cells () / 2)
+            cell->set_active_fe_index (1);
+          else
+            cell->set_active_fe_index (0);
+        }
     }
 
 
   dof_handler.distribute_dofs (fe);
   deallog << "Number of degrees of freedom: "
-           << dof_handler.n_dofs()
-           << std::endl;
+          << dof_handler.n_dofs()
+          << std::endl;
 
-                                  // Create constraints which stem from
-                                  // the different polynomial degrees on
-                                  // the different elements.
+  // Create constraints which stem from
+  // the different polynomial degrees on
+  // the different elements.
   hanging_node_constraints.clear ();
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          hanging_node_constraints);
+                                           hanging_node_constraints);
 
   hanging_node_constraints.print (deallog.get_file_stream ());
 
@@ -146,9 +146,9 @@ int main ()
   deallog.threshold_double(1.e-10);
 
   unsigned int index[] =
-    {
-         1,2,3,4,5,6,7
-    };
+  {
+    1,2,3,4,5,6,7
+  };
 
 
   deallog << "Testing Order 1" << std::endl;
index 4a7bc7e9f43c3330a59fb8d2a27187a0d7385559..34db947dac55340cef0c5f1e9f29026e3e4dc26a 100644 (file)
@@ -37,26 +37,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_line,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_line,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_line,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_line,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -66,14 +66,14 @@ int main ()
 {
   std::ofstream logfile("hp_line_dof_identities_dgp/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 80fbd450a664a455cb62bbbc8a32beb1d1fff682..066994d36110945f4d66b8bddf0278820d16b218 100644 (file)
@@ -37,26 +37,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_line,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_line,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_line,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_line,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -66,14 +66,14 @@ int main ()
 {
   std::ofstream logfile("hp_line_dof_identities_dgp_monomial/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 49322a537fa8c160df5d9a01cd0659e8c5552383..e879eb3825105cd60b0f837667144a759c490911 100644 (file)
@@ -38,26 +38,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_line,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_line,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_line,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_line,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -67,14 +67,14 @@ int main ()
 {
   std::ofstream logfile("hp_line_dof_identities_dgp_monomial_system_01/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 4677b5b3dbe76595a971608e3c3550308483a5ad..f86dd52cbc3c169f094590849826687a5e899935 100644 (file)
@@ -35,50 +35,50 @@ void test ()
   hp::FECollection<dim> fe_collection;
   for (unsigned int i=0; i<4; ++i)
     {
-                                      // add the system three times, with
-                                      // different numbers of base elements
-                                      // and multiplicities
+      // add the system three times, with
+      // different numbers of base elements
+      // and multiplicities
       fe_collection.push_back (FESystem<dim>(FE_DGPMonomial<dim>(i),3));
       fe_collection.push_back (FESystem<dim>(FE_DGPMonomial<dim>(i),2,
-                                            FE_DGPMonomial<dim>(i),1));
+                                             FE_DGPMonomial<dim>(i),1));
       fe_collection.push_back (FESystem<dim>(FE_DGPMonomial<dim>(i),1,
-                                            FE_DGPMonomial<dim>(i),2));
+                                             FE_DGPMonomial<dim>(i),2));
     }
 
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_line,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_line,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
-
-                                        // make sure the identities are the
-                                        // same whatever the arrangement of
-                                        // the elements to their base
-                                        // elements (the operation i/3*3
-                                        // brings us back to the first of the
-                                        // three identical elements in the
-                                        // collection)
-       Assert (identities ==
-               fe_collection[i/3*3].hp_line_dof_identities (fe_collection[j/3*3]),
-               ExcInternalError());
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_line,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_line,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
+
+        // make sure the identities are the
+        // same whatever the arrangement of
+        // the elements to their base
+        // elements (the operation i/3*3
+        // brings us back to the first of the
+        // three identical elements in the
+        // collection)
+        Assert (identities ==
+                fe_collection[i/3*3].hp_line_dof_identities (fe_collection[j/3*3]),
+                ExcInternalError());
       }
 }
 
@@ -88,14 +88,14 @@ int main ()
 {
   std::ofstream logfile("hp_line_dof_identities_dgp_monomial_system_02/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index f433e8ffa3d544fa07d273e4801c42dda3562372..e09d81f434bd42c0ec07b7bf057485b21b384f29 100644 (file)
@@ -37,26 +37,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_line,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_line,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_line,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_line,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -66,14 +66,14 @@ int main ()
 {
   std::ofstream logfile("hp_line_dof_identities_dgp_nonparametric/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 3908a8dd2882ea114018b005874dc814a8428a55..a76b2b83fca053dc2ea99536aa15bfedad00ef99 100644 (file)
@@ -38,26 +38,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_line,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_line,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_line,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_line,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -67,14 +67,14 @@ int main ()
 {
   std::ofstream logfile("hp_line_dof_identities_dgp_nonparametric_system_01/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 3ff8c69a5285be025b0d79a5d9670ef6b6686484..5d439d0710792eea852c8f14e8b806ab1518fbbb 100644 (file)
@@ -35,50 +35,50 @@ void test ()
   hp::FECollection<dim> fe_collection;
   for (unsigned int i=1; i<8-dim; ++i)
     {
-                                      // add the system three times, with
-                                      // different numbers of base elements
-                                      // and multiplicities
+      // add the system three times, with
+      // different numbers of base elements
+      // and multiplicities
       fe_collection.push_back (FESystem<dim>(FE_DGPNonparametric<dim>(i),3));
       fe_collection.push_back (FESystem<dim>(FE_DGPNonparametric<dim>(i),2,
-                                            FE_DGPNonparametric<dim>(i),1));
+                                             FE_DGPNonparametric<dim>(i),1));
       fe_collection.push_back (FESystem<dim>(FE_DGPNonparametric<dim>(i),1,
-                                            FE_DGPNonparametric<dim>(i),2));
+                                             FE_DGPNonparametric<dim>(i),2));
     }
 
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_line,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_line,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
-
-                                        // make sure the identities are the
-                                        // same whatever the arrangement of
-                                        // the elements to their base
-                                        // elements (the operation i/3*3
-                                        // brings us back to the first of the
-                                        // three identical elements in the
-                                        // collection)
-       Assert (identities ==
-               fe_collection[i/3*3].hp_line_dof_identities (fe_collection[j/3*3]),
-               ExcInternalError());
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_line,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_line,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
+
+        // make sure the identities are the
+        // same whatever the arrangement of
+        // the elements to their base
+        // elements (the operation i/3*3
+        // brings us back to the first of the
+        // three identical elements in the
+        // collection)
+        Assert (identities ==
+                fe_collection[i/3*3].hp_line_dof_identities (fe_collection[j/3*3]),
+                ExcInternalError());
       }
 }
 
@@ -88,14 +88,14 @@ int main ()
 {
   std::ofstream logfile("hp_line_dof_identities_dgp_nonparametric_system_02/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 5d9c02a93d810b48375caabddef07e54a2b9366b..b3af6ce6a3c79749e872a7a6cc44291697523b96 100644 (file)
@@ -38,26 +38,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_line,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_line,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_line,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_line,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -67,14 +67,14 @@ int main ()
 {
   std::ofstream logfile("hp_line_dof_identities_dgp_system_01/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 6284107c1abdcf6a0be027999f6ef295d363cd82..9310e8bff77ef8e8a7426da19e5676422fcf3d8c 100644 (file)
@@ -35,50 +35,50 @@ void test ()
   hp::FECollection<dim> fe_collection;
   for (unsigned int i=1; i<8-dim; ++i)
     {
-                                      // add the system three times, with
-                                      // different numbers of base elements
-                                      // and multiplicities
+      // add the system three times, with
+      // different numbers of base elements
+      // and multiplicities
       fe_collection.push_back (FESystem<dim>(FE_DGP<dim>(i),3));
       fe_collection.push_back (FESystem<dim>(FE_DGP<dim>(i),2,
-                                            FE_DGP<dim>(i),1));
+                                             FE_DGP<dim>(i),1));
       fe_collection.push_back (FESystem<dim>(FE_DGP<dim>(i),1,
-                                            FE_DGP<dim>(i),2));
+                                             FE_DGP<dim>(i),2));
     }
 
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_line,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_line,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
-
-                                        // make sure the identities are the
-                                        // same whatever the arrangement of
-                                        // the elements to their base
-                                        // elements (the operation i/3*3
-                                        // brings us back to the first of the
-                                        // three identical elements in the
-                                        // collection)
-       Assert (identities ==
-               fe_collection[i/3*3].hp_line_dof_identities (fe_collection[j/3*3]),
-               ExcInternalError());
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_line,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_line,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
+
+        // make sure the identities are the
+        // same whatever the arrangement of
+        // the elements to their base
+        // elements (the operation i/3*3
+        // brings us back to the first of the
+        // three identical elements in the
+        // collection)
+        Assert (identities ==
+                fe_collection[i/3*3].hp_line_dof_identities (fe_collection[j/3*3]),
+                ExcInternalError());
       }
 }
 
@@ -88,14 +88,14 @@ int main ()
 {
   std::ofstream logfile("hp_line_dof_identities_dgp_system_02/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 00737b74dd9239b043d214a2903a168a744384f8..6e66bc8108f670a054b09a1f63e126614d670521 100644 (file)
@@ -37,26 +37,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_line,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_line,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_line,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_line,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -66,14 +66,14 @@ int main ()
 {
   std::ofstream logfile("hp_line_dof_identities_dgq/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 888c324c3447aa00dbb71a2bbd8b8bfdf04738f6..2176583dda4d97fc7c5ff82bde8d8413f9e82a58 100644 (file)
@@ -38,26 +38,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_line,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_line,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_line,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_line,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -67,14 +67,14 @@ int main ()
 {
   std::ofstream logfile("hp_line_dof_identities_dgq_system_01/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index eaee2aed9fcb17486f94a9b885664338e62dadba..c33ccc0adea51f0907dd1f1f64dfb6a92bbad131 100644 (file)
@@ -35,50 +35,50 @@ void test ()
   hp::FECollection<dim> fe_collection;
   for (unsigned int i=1; i<8-dim; ++i)
     {
-                                      // add the system three times, with
-                                      // different numbers of base elements
-                                      // and multiplicities
+      // add the system three times, with
+      // different numbers of base elements
+      // and multiplicities
       fe_collection.push_back (FESystem<dim>(FE_DGQ<dim>(i),3));
       fe_collection.push_back (FESystem<dim>(FE_DGQ<dim>(i),2,
-                                            FE_DGQ<dim>(i),1));
+                                             FE_DGQ<dim>(i),1));
       fe_collection.push_back (FESystem<dim>(FE_DGQ<dim>(i),1,
-                                            FE_DGQ<dim>(i),2));
+                                             FE_DGQ<dim>(i),2));
     }
 
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_line,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_line,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
-
-                                        // make sure the identities are the
-                                        // same whatever the arrangement of
-                                        // the elements to their base
-                                        // elements (the operation i/3*3
-                                        // brings us back to the first of the
-                                        // three identical elements in the
-                                        // collection)
-       Assert (identities ==
-               fe_collection[i/3*3].hp_line_dof_identities (fe_collection[j/3*3]),
-               ExcInternalError());
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_line,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_line,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
+
+        // make sure the identities are the
+        // same whatever the arrangement of
+        // the elements to their base
+        // elements (the operation i/3*3
+        // brings us back to the first of the
+        // three identical elements in the
+        // collection)
+        Assert (identities ==
+                fe_collection[i/3*3].hp_line_dof_identities (fe_collection[j/3*3]),
+                ExcInternalError());
       }
 }
 
@@ -88,14 +88,14 @@ int main ()
 {
   std::ofstream logfile("hp_line_dof_identities_dgq_system_02/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 498605fd4d116a0eb1dc0f481bb76dd987e165ba..fbf365d6ce56edc522776728688baaf09a6511d7 100644 (file)
@@ -37,26 +37,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_line,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_line,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_line,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_line,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -66,14 +66,14 @@ int main ()
 {
   std::ofstream logfile("hp_line_dof_identities_q/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 262c9ae0b70491bce2c1373dd274d147eff94628..0177da02d81b2eadb3ce627e65d4cc929d36e313 100644 (file)
@@ -38,26 +38,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_line,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_line,
-                   ExcInternalError());
-
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_line,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_line,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
index a5c5c8493b0ecb4836aef687c42dc61c089b2f0b..00aedadbaed3d8bd252b420df2a7a32401db4b08 100644 (file)
@@ -38,26 +38,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_line,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_line,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_line,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_line,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -67,14 +67,14 @@ int main ()
 {
   std::ofstream logfile("hp_line_dof_identities_q_system_01/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index cfc33db3fc561d033a8878ab1852b4355937e45a..b9f8f6ce20e2a0047143de2d44ff019f183e5796 100644 (file)
@@ -35,50 +35,50 @@ void test ()
   hp::FECollection<dim> fe_collection;
   for (unsigned int i=1; i<8-dim; ++i)
     {
-                                      // add the system three times, with
-                                      // different numbers of base elements
-                                      // and multiplicities
+      // add the system three times, with
+      // different numbers of base elements
+      // and multiplicities
       fe_collection.push_back (FESystem<dim>(FE_Q<dim>(i),3));
       fe_collection.push_back (FESystem<dim>(FE_Q<dim>(i),2,
-                                            FE_Q<dim>(i),1));
+                                             FE_Q<dim>(i),1));
       fe_collection.push_back (FESystem<dim>(FE_Q<dim>(i),1,
-                                            FE_Q<dim>(i),2));
+                                             FE_Q<dim>(i),2));
     }
 
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_line,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_line,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
-
-                                        // make sure the identities are the
-                                        // same whatever the arrangement of
-                                        // the elements to their base
-                                        // elements (the operation i/3*3
-                                        // brings us back to the first of the
-                                        // three identical elements in the
-                                        // collection)
-       Assert (identities ==
-               fe_collection[i/3*3].hp_line_dof_identities (fe_collection[j/3*3]),
-               ExcInternalError());
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_line,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_line,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
+
+        // make sure the identities are the
+        // same whatever the arrangement of
+        // the elements to their base
+        // elements (the operation i/3*3
+        // brings us back to the first of the
+        // three identical elements in the
+        // collection)
+        Assert (identities ==
+                fe_collection[i/3*3].hp_line_dof_identities (fe_collection[j/3*3]),
+                ExcInternalError());
       }
 }
 
@@ -88,14 +88,14 @@ int main ()
 {
   std::ofstream logfile("hp_line_dof_identities_q_system_02/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 96c108eb8b4c3aca47d38f9189806e15c4edc0c5..489e240be52cc7d87d7e79e759cea0595e89a60d 100644 (file)
@@ -38,33 +38,33 @@ void test ()
   for (unsigned int k=1; k<4; ++k)
     {
       for (unsigned int i=1; i<4; ++i)
-       fe_collection.push_back (FESystem<dim>(FE_Q<dim>(k),1,
-                                              FE_DGQ<dim>(i),1));
+        fe_collection.push_back (FESystem<dim>(FE_Q<dim>(k),1,
+                                               FE_DGQ<dim>(i),1));
 
       for (unsigned int i=0; i<fe_collection.size(); ++i)
-       for (unsigned int j=0; j<fe_collection.size(); ++j)
-         {
-           const std::vector<std::pair<unsigned int, unsigned int> >
-             identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
-
-           deallog << "Identities for "
-                   << fe_collection[i].get_name() << " and "
-                   << fe_collection[j].get_name() << ": "
-                   << identities.size()
-                   << std::endl;
-       
-           for (unsigned int k=0; k<identities.size(); ++k)
-             {
-               Assert (identities[k].first < fe_collection[i].dofs_per_line,
-                       ExcInternalError());
-               Assert (identities[k].second < fe_collection[j].dofs_per_line,
-                       ExcInternalError());
-           
-               deallog << identities[k].first << ' '
-                       << identities[k].second
-                       << std::endl;
-             }
-         }
+        for (unsigned int j=0; j<fe_collection.size(); ++j)
+          {
+            const std::vector<std::pair<unsigned int, unsigned int> >
+            identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
+
+            deallog << "Identities for "
+                    << fe_collection[i].get_name() << " and "
+                    << fe_collection[j].get_name() << ": "
+                    << identities.size()
+                    << std::endl;
+
+            for (unsigned int k=0; k<identities.size(); ++k)
+              {
+                Assert (identities[k].first < fe_collection[i].dofs_per_line,
+                        ExcInternalError());
+                Assert (identities[k].second < fe_collection[j].dofs_per_line,
+                        ExcInternalError());
+
+                deallog << identities[k].first << ' '
+                        << identities[k].second
+                        << std::endl;
+              }
+          }
     }
 }
 
@@ -74,14 +74,14 @@ int main ()
 {
   std::ofstream logfile("hp_line_dof_identities_q_system_03/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 8e179a4567034d96f769ab593d2401fc410e22ae..e4e88ec9ea1627fb6a75c3ba0c9d6dcd70912f76 100644 (file)
@@ -37,26 +37,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_line,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_line,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_line_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_line,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_line,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -66,13 +66,13 @@ int main ()
 {
   std::ofstream logfile("hp_line_dof_identities_rt_nodal/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 9b6d680812e8054859e20ddc5b8c18540c4c1cf7..2103a7b26889fe418b121728c5cc777da0d22b01 100644 (file)
@@ -37,26 +37,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_quad,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_quad,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_quad,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_quad,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -66,13 +66,13 @@ int main ()
 {
   std::ofstream logfile("hp_quad_dof_identities_dgp/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index ac21b31a9a7446ff7ce87708e970820bfb7fb8f4..df44dba88ecd1290080864a3d829bec64d4fdc45 100644 (file)
@@ -37,26 +37,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_quad,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_quad,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_quad,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_quad,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -66,13 +66,13 @@ int main ()
 {
   std::ofstream logfile("hp_quad_dof_identities_dgp_monomial/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 451cc3cbe543272bb846a3cae8c9870e59ab02ad..28adfd48cb966779a5b4e1d6caf9cb9922875aaa 100644 (file)
@@ -38,26 +38,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_quad,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_quad,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_quad,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_quad,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -67,13 +67,13 @@ int main ()
 {
   std::ofstream logfile("hp_quad_dof_identities_dgp_monomial_system_01/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index b3bb4e059912f988787d0967215f7b8c681023c6..a7a37c69e31071d6d7e804a70f6d1bbba286ccf7 100644 (file)
@@ -35,39 +35,39 @@ void test ()
   hp::FECollection<dim> fe_collection;
   for (unsigned int i=0; i<4; ++i)
     {
-                                      // add the system three times, with
-                                      // different numbers of base elements
-                                      // and multiplicities
+      // add the system three times, with
+      // different numbers of base elements
+      // and multiplicities
       fe_collection.push_back (FESystem<dim>(FE_DGPMonomial<dim>(i),3));
       fe_collection.push_back (FESystem<dim>(FE_DGPMonomial<dim>(i),2,
-                                            FE_DGPMonomial<dim>(i),1));
+                                             FE_DGPMonomial<dim>(i),1));
       fe_collection.push_back (FESystem<dim>(FE_DGPMonomial<dim>(i),1,
-                                            FE_DGPMonomial<dim>(i),2));
+                                             FE_DGPMonomial<dim>(i),2));
     }
 
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_quad,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_quad,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_quad,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_quad,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -77,13 +77,13 @@ int main ()
 {
   std::ofstream logfile("hp_quad_dof_identities_dgp_monomial_system_02/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 5c206740527e56e9a10cd629fd3de17e4dc0976c..704d9dbd7341432eb0f763b8f120c7e92333ea23 100644 (file)
@@ -37,26 +37,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_quad,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_quad,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_quad,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_quad,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -66,13 +66,13 @@ int main ()
 {
   std::ofstream logfile("hp_quad_dof_identities_dgp_nonparametric/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index a384769a6297fa8b63f06856124ceb6d149fd45d..92ee11eb91cc380e2811dd50419c9a85906b37fb 100644 (file)
@@ -38,26 +38,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_quad,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_quad,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_quad,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_quad,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -67,13 +67,13 @@ int main ()
 {
   std::ofstream logfile("hp_quad_dof_identities_dgp_nonparametric_system_01/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 5369d78342038f7b3358546b51794bc66adb4a5b..04e6550dfa84187e0dce43944d3f876da718f4f2 100644 (file)
@@ -35,39 +35,39 @@ void test ()
   hp::FECollection<dim> fe_collection;
   for (unsigned int i=1; i<8-dim; ++i)
     {
-                                      // add the system three times, with
-                                      // different numbers of base elements
-                                      // and multiplicities
+      // add the system three times, with
+      // different numbers of base elements
+      // and multiplicities
       fe_collection.push_back (FESystem<dim>(FE_DGPNonparametric<dim>(i),3));
       fe_collection.push_back (FESystem<dim>(FE_DGPNonparametric<dim>(i),2,
-                                            FE_DGPNonparametric<dim>(i),1));
+                                             FE_DGPNonparametric<dim>(i),1));
       fe_collection.push_back (FESystem<dim>(FE_DGPNonparametric<dim>(i),1,
-                                            FE_DGPNonparametric<dim>(i),2));
+                                             FE_DGPNonparametric<dim>(i),2));
     }
 
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_quad,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_quad,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_quad,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_quad,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -77,13 +77,13 @@ int main ()
 {
   std::ofstream logfile("hp_quad_dof_identities_dgp_nonparametric_system_02/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index da1706d7c53776cd523127e28c52f54fdfb25cb7..5ddaba4ccce2784a9feb2edd056bf8a0ec6f8313 100644 (file)
@@ -38,26 +38,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_quad,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_quad,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_quad,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_quad,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -67,13 +67,13 @@ int main ()
 {
   std::ofstream logfile("hp_quad_dof_identities_dgp_system_01/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 26a6bc34c4f0cc2a77894adc13ca50f2a6f9f56a..a3c14d76d5254c5666a769c0c1b0e19d91a0c558 100644 (file)
@@ -35,39 +35,39 @@ void test ()
   hp::FECollection<dim> fe_collection;
   for (unsigned int i=1; i<8-dim; ++i)
     {
-                                      // add the system three times, with
-                                      // different numbers of base elements
-                                      // and multiplicities
+      // add the system three times, with
+      // different numbers of base elements
+      // and multiplicities
       fe_collection.push_back (FESystem<dim>(FE_DGP<dim>(i),3));
       fe_collection.push_back (FESystem<dim>(FE_DGP<dim>(i),2,
-                                            FE_DGP<dim>(i),1));
+                                             FE_DGP<dim>(i),1));
       fe_collection.push_back (FESystem<dim>(FE_DGP<dim>(i),1,
-                                            FE_DGP<dim>(i),2));
+                                             FE_DGP<dim>(i),2));
     }
 
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_quad,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_quad,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_quad,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_quad,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -77,13 +77,13 @@ int main ()
 {
   std::ofstream logfile("hp_quad_dof_identities_dgp_system_02/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 48b3b5ce612dcdcf0abc6769950ab46fa1ddb77e..af765bf0ce46b1bf36fbe5507d692bd1131b874a 100644 (file)
@@ -37,26 +37,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_quad,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_quad,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_quad,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_quad,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -66,13 +66,13 @@ int main ()
 {
   std::ofstream logfile("hp_quad_dof_identities_dgq/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index a9d83fca9afb55cf272dcb991e53b77f737714c5..f382858ff883508f8ea2a364e7aa239e54f53d45 100644 (file)
@@ -38,26 +38,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_quad,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_quad,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_quad,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_quad,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -67,13 +67,13 @@ int main ()
 {
   std::ofstream logfile("hp_quad_dof_identities_dgq_system_01/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index c45641503442f3659f7a0632ada4feab31917642..bf2e2769d3b038ce78556ce19e3bbc337da6d789 100644 (file)
@@ -35,39 +35,39 @@ void test ()
   hp::FECollection<dim> fe_collection;
   for (unsigned int i=1; i<8-dim; ++i)
     {
-                                      // add the system three times, with
-                                      // different numbers of base elements
-                                      // and multiplicities
+      // add the system three times, with
+      // different numbers of base elements
+      // and multiplicities
       fe_collection.push_back (FESystem<dim>(FE_DGQ<dim>(i),3));
       fe_collection.push_back (FESystem<dim>(FE_DGQ<dim>(i),2,
-                                            FE_DGQ<dim>(i),1));
+                                             FE_DGQ<dim>(i),1));
       fe_collection.push_back (FESystem<dim>(FE_DGQ<dim>(i),1,
-                                            FE_DGQ<dim>(i),2));
+                                             FE_DGQ<dim>(i),2));
     }
 
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_quad,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_quad,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_quad,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_quad,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -77,13 +77,13 @@ int main ()
 {
   std::ofstream logfile("hp_quad_dof_identities_dgq_system_02/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index eb76f4d5192f3869ed723ef1f6f1e4cb0670b8a7..12c005fb09a689f620fe1d5cce6a442ea19f8266 100644 (file)
@@ -37,26 +37,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_quad,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_quad,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_quad,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_quad,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -66,13 +66,13 @@ int main ()
 {
   std::ofstream logfile("hp_quad_dof_identities_q/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index e9c93343a953038e8587ef97af47b97aa18bb7cd..4372f650f37d85abc50db3a8c650135280ad9865 100644 (file)
@@ -38,26 +38,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_quad,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_quad,
-                   ExcInternalError());
-
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_quad,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_quad,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
index 14b7bd1960cc6eec1a9e1db6ce9facff8b1d313e..707aa0b038fa871e65b3a24329e197f34d49e277 100644 (file)
@@ -38,26 +38,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_quad,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_quad,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_quad,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_quad,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -67,13 +67,13 @@ int main ()
 {
   std::ofstream logfile("hp_quad_dof_identities_q_system_01/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index c4b8936226d2b32b6a89871355cd539783d5f05f..21439aa175d7c1e3e36c43e92662e4ccc99531be 100644 (file)
@@ -35,39 +35,39 @@ void test ()
   hp::FECollection<dim> fe_collection;
   for (unsigned int i=1; i<8-dim; ++i)
     {
-                                      // add the system three times, with
-                                      // different numbers of base elements
-                                      // and multiplicities
+      // add the system three times, with
+      // different numbers of base elements
+      // and multiplicities
       fe_collection.push_back (FESystem<dim>(FE_Q<dim>(i),3));
       fe_collection.push_back (FESystem<dim>(FE_Q<dim>(i),2,
-                                            FE_Q<dim>(i),1));
+                                             FE_Q<dim>(i),1));
       fe_collection.push_back (FESystem<dim>(FE_Q<dim>(i),1,
-                                            FE_Q<dim>(i),2));
+                                             FE_Q<dim>(i),2));
     }
 
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_quad,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_quad,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_quad,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_quad,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -77,13 +77,13 @@ int main ()
 {
   std::ofstream logfile("hp_quad_dof_identities_q_system_02/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 40fb71d404c0c51054f97aeaf2d82b748a7fd10e..66d75458cbb48c9b5ba2b76e92340a7d8a6c0aef 100644 (file)
@@ -37,26 +37,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_quad,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_quad,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_quad_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_quad,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_quad,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -66,13 +66,13 @@ int main ()
 {
   std::ofstream logfile("hp_quad_dof_identities_rt_nodal/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index d7733e0af4ffd4e5cbb6a1304a1080e032b4f87c..ba6e86d2d0a52baeb93564a0cd652df1dfec37e3 100644 (file)
@@ -37,26 +37,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -66,14 +66,14 @@ int main ()
 {
   std::ofstream logfile("hp_vertex_dof_identities_dgp/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 42b506fd85c6bf56a694205a74029fde1ecbd955..e17da03938a5217be241837fe9f9d890578ceca1 100644 (file)
@@ -37,26 +37,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -66,14 +66,14 @@ int main ()
 {
   std::ofstream logfile("hp_vertex_dof_identities_dgp_monomial/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 8564e5eceef5537768f584b957e7e51d00231122..d85d2d63cd6de9b292d3cf0aae77e1082cc8a34f 100644 (file)
@@ -38,26 +38,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -67,14 +67,14 @@ int main ()
 {
   std::ofstream logfile("hp_vertex_dof_identities_dgp_monomial_system_01/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index d016ab172b85c0faf20ca3278155ff5987028037..b0190f0dfd547d4b3abdf16fb5f3d4923d105cc2 100644 (file)
@@ -35,39 +35,39 @@ void test ()
   hp::FECollection<dim> fe_collection;
   for (unsigned int i=0; i<4; ++i)
     {
-                                      // add the system three times, with
-                                      // different numbers of base elements
-                                      // and multiplicities
+      // add the system three times, with
+      // different numbers of base elements
+      // and multiplicities
       fe_collection.push_back (FESystem<dim>(FE_DGPMonomial<dim>(i),3));
       fe_collection.push_back (FESystem<dim>(FE_DGPMonomial<dim>(i),2,
-                                            FE_DGPMonomial<dim>(i),1));
+                                             FE_DGPMonomial<dim>(i),1));
       fe_collection.push_back (FESystem<dim>(FE_DGPMonomial<dim>(i),1,
-                                            FE_DGPMonomial<dim>(i),2));
+                                             FE_DGPMonomial<dim>(i),2));
     }
-  
+
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -77,14 +77,14 @@ int main ()
 {
   std::ofstream logfile("hp_vertex_dof_identities_dgp_monomial_system_02/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index a572d274bc3e7c87e3a5d9b8263266e43b008ccd..e6a6c1f7a9caffdefdd95c46e66f8f1ad8962e18 100644 (file)
@@ -37,26 +37,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -66,14 +66,14 @@ int main ()
 {
   std::ofstream logfile("hp_vertex_dof_identities_dgp_nonparametric/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index f207a0c8f267a0d87cd62a5eb2615e7ba1001061..8c9f7df87cfa0b4638936b4526a85a35b51c5453 100644 (file)
@@ -38,26 +38,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -67,14 +67,14 @@ int main ()
 {
   std::ofstream logfile("hp_vertex_dof_identities_dgp_nonparametric_system_01/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 6f72145a1bf371af521345dd13d0697ea2831d04..90edff242ba9769f1d0620450770a95a52a1ac89 100644 (file)
@@ -35,39 +35,39 @@ void test ()
   hp::FECollection<dim> fe_collection;
   for (unsigned int i=1; i<8-dim; ++i)
     {
-                                      // add the system three times, with
-                                      // different numbers of base elements
-                                      // and multiplicities
+      // add the system three times, with
+      // different numbers of base elements
+      // and multiplicities
       fe_collection.push_back (FESystem<dim>(FE_DGPNonparametric<dim>(i),3));
       fe_collection.push_back (FESystem<dim>(FE_DGPNonparametric<dim>(i),2,
-                                            FE_DGPNonparametric<dim>(i),1));
+                                             FE_DGPNonparametric<dim>(i),1));
       fe_collection.push_back (FESystem<dim>(FE_DGPNonparametric<dim>(i),1,
-                                            FE_DGPNonparametric<dim>(i),2));
+                                             FE_DGPNonparametric<dim>(i),2));
     }
-  
+
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -77,14 +77,14 @@ int main ()
 {
   std::ofstream logfile("hp_vertex_dof_identities_dgp_nonparametric_system_02/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index e6971075c0598715c04b56b77570b1cff627d70d..8011785ace99383dfe88d07d96ae269053780cd0 100644 (file)
@@ -38,26 +38,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -67,14 +67,14 @@ int main ()
 {
   std::ofstream logfile("hp_vertex_dof_identities_dgp_system_01/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 75ca5f310faab69b365f252ae6f189bc2f87af76..77707c23f8cebeaefd2f3f9154e18b43279dc5d4 100644 (file)
@@ -35,39 +35,39 @@ void test ()
   hp::FECollection<dim> fe_collection;
   for (unsigned int i=1; i<8-dim; ++i)
     {
-                                      // add the system three times, with
-                                      // different numbers of base elements
-                                      // and multiplicities
+      // add the system three times, with
+      // different numbers of base elements
+      // and multiplicities
       fe_collection.push_back (FESystem<dim>(FE_DGP<dim>(i),3));
       fe_collection.push_back (FESystem<dim>(FE_DGP<dim>(i),2,
-                                            FE_DGP<dim>(i),1));
+                                             FE_DGP<dim>(i),1));
       fe_collection.push_back (FESystem<dim>(FE_DGP<dim>(i),1,
-                                            FE_DGP<dim>(i),2));
+                                             FE_DGP<dim>(i),2));
     }
-  
+
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -77,14 +77,14 @@ int main ()
 {
   std::ofstream logfile("hp_vertex_dof_identities_dgp_system_02/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 8e4d1ec009a6f20309f29209491b3500cadc5ebe..3d7e038283515b4ec94f1a638d660d00c8b26089 100644 (file)
@@ -37,26 +37,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -66,14 +66,14 @@ int main ()
 {
   std::ofstream logfile("hp_vertex_dof_identities_dgq/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 7f5305b28cb5c712773f46aca3fc85c404107879..7c71ffd40ef82f6a8681555b7bb189be40558d0c 100644 (file)
@@ -38,26 +38,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -67,14 +67,14 @@ int main ()
 {
   std::ofstream logfile("hp_vertex_dof_identities_dgq_system_01/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index a05a5389a88e097d58acb602c74dd55583df24a7..64d66a2a0cf2c1f017987cf261c70133d0e82867 100644 (file)
@@ -35,39 +35,39 @@ void test ()
   hp::FECollection<dim> fe_collection;
   for (unsigned int i=1; i<8-dim; ++i)
     {
-                                      // add the system three times, with
-                                      // different numbers of base elements
-                                      // and multiplicities
+      // add the system three times, with
+      // different numbers of base elements
+      // and multiplicities
       fe_collection.push_back (FESystem<dim>(FE_DGQ<dim>(i),3));
       fe_collection.push_back (FESystem<dim>(FE_DGQ<dim>(i),2,
-                                            FE_DGQ<dim>(i),1));
+                                             FE_DGQ<dim>(i),1));
       fe_collection.push_back (FESystem<dim>(FE_DGQ<dim>(i),1,
-                                            FE_DGQ<dim>(i),2));
+                                             FE_DGQ<dim>(i),2));
     }
-  
+
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -77,14 +77,14 @@ int main ()
 {
   std::ofstream logfile("hp_vertex_dof_identities_dgq_system_02/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index ff3f7fb47884f0d74e7d779e4a31da0ae582b187..c3fddf8086970eceaf5819d8ffa4bbea83460a15 100644 (file)
@@ -37,26 +37,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -66,14 +66,14 @@ int main ()
 {
   std::ofstream logfile("hp_vertex_dof_identities_q/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index cbd746ba709253a4c7ce7c1bf156321ea9b2f9d6..0ac860b8a4d5a35b4e8fb063a337bd9673d7acbc 100644 (file)
@@ -38,26 +38,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -67,14 +67,14 @@ int main ()
 {
   std::ofstream logfile("hp_vertex_dof_identities_q_system_01/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index b246c93757b98b6c38a5c9b10651ba33afb9d3ef..0561b38e613d07763a24e596b3cd28b319432203 100644 (file)
@@ -35,39 +35,39 @@ void test ()
   hp::FECollection<dim> fe_collection;
   for (unsigned int i=1; i<8-dim; ++i)
     {
-                                      // add the system three times, with
-                                      // different numbers of base elements
-                                      // and multiplicities
+      // add the system three times, with
+      // different numbers of base elements
+      // and multiplicities
       fe_collection.push_back (FESystem<dim>(FE_Q<dim>(i),3));
       fe_collection.push_back (FESystem<dim>(FE_Q<dim>(i),2,
-                                            FE_Q<dim>(i),1));
+                                             FE_Q<dim>(i),1));
       fe_collection.push_back (FESystem<dim>(FE_Q<dim>(i),1,
-                                            FE_Q<dim>(i),2));
+                                             FE_Q<dim>(i),2));
     }
-  
+
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -77,14 +77,14 @@ int main ()
 {
   std::ofstream logfile("hp_vertex_dof_identities_q_system_02/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 57a38c706ba8e97eddc4fa55334d082f393bd643..34914c8e6459acdc8c6e8b24d93838f99f024d24 100644 (file)
@@ -37,26 +37,26 @@ void test ()
   for (unsigned int i=0; i<fe_collection.size(); ++i)
     for (unsigned int j=0; j<fe_collection.size(); ++j)
       {
-       const std::vector<std::pair<unsigned int, unsigned int> >
-         identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
-
-       deallog << "Identities for "
-               << fe_collection[i].get_name() << " and "
-               << fe_collection[j].get_name() << ": "
-               << identities.size()
-               << std::endl;
-       
-       for (unsigned int k=0; k<identities.size(); ++k)
-         {
-           Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
-                   ExcInternalError());
-           Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
-                   ExcInternalError());
-           
-           deallog << identities[k].first << ' '
-                   << identities[k].second
-                   << std::endl;
-         }
+        const std::vector<std::pair<unsigned int, unsigned int> >
+        identities = fe_collection[i].hp_vertex_dof_identities (fe_collection[j]);
+
+        deallog << "Identities for "
+                << fe_collection[i].get_name() << " and "
+                << fe_collection[j].get_name() << ": "
+                << identities.size()
+                << std::endl;
+
+        for (unsigned int k=0; k<identities.size(); ++k)
+          {
+            Assert (identities[k].first < fe_collection[i].dofs_per_vertex,
+                    ExcInternalError());
+            Assert (identities[k].second < fe_collection[j].dofs_per_vertex,
+                    ExcInternalError());
+
+            deallog << identities[k].first << ' '
+                    << identities[k].second
+                    << std::endl;
+          }
       }
 }
 
@@ -66,13 +66,13 @@ int main ()
 {
   std::ofstream logfile("hp_vertex_dof_identities_rt_nodal/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index f149e5eb78dec5663ab1c594c214f99d653ad6cb..a5853e883468f0798d5137e70c140c428b183ccf 100644 (file)
@@ -45,13 +45,13 @@ template <int dim>
 void test ()
 {
   deallog << "dim=" << dim << std::endl;
-  
+
   Triangulation<dim> tria;
   GridGenerator::hyper_cube(tria);
   tria.refine_global (2);
   tria.begin_active()->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
-  tria.refine_global (4-dim);  
+  tria.refine_global (4-dim);
 
   hp::FECollection<dim> fe_collection;
   hp::QCollection<dim> q_collection;
@@ -60,15 +60,15 @@ void test ()
       fe_collection.push_back(FE_Q<dim> (i));
       q_collection.push_back (QGauss<dim> (i+2));
     }
-  
+
 
   hp::DoFHandler<dim> dof_handler(tria);
 
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell != dof_handler.end(); ++cell)
     cell->set_active_fe_index (rand() % fe_collection.size());
-  
+
   dof_handler.distribute_dofs(fe_collection);
 
   Vector<double> vec (dof_handler.n_dofs());
@@ -77,15 +77,15 @@ void test ()
 
   Vector<float> diff (tria.n_active_cells());
 
-  VectorTools::NormType norms[] = 
-    {
-          VectorTools::mean,
-          VectorTools::L1_norm,
-          VectorTools::L2_norm,
-          VectorTools::Linfty_norm,
-          VectorTools::H1_seminorm,
-          VectorTools::W1p_seminorm
-    };
+  VectorTools::NormType norms[] =
+  {
+    VectorTools::mean,
+    VectorTools::L1_norm,
+    VectorTools::L2_norm,
+    VectorTools::Linfty_norm,
+    VectorTools::H1_seminorm,
+    VectorTools::W1p_seminorm
+  };
   for (unsigned int i=0; i<sizeof(norms)/sizeof(norms[0]); ++i)
     {
       VectorTools::integrate_difference (dof_handler,
@@ -104,14 +104,14 @@ int main ()
   std::ofstream logfile("integrate_difference/output");
   logfile.precision(2);
   deallog << std::setprecision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index daf3983041aa943dd71a07c3b49597a307935cf9..98bb433e82948473b2ee908cff5f51da6dcfe035 100644 (file)
@@ -65,76 +65,76 @@ void test ()
   hp::DoFHandler<dim> dof_handler(tria);
 
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell != dof_handler.end(); ++cell)
     cell->set_active_fe_index (rand() % fe_collection.size());
 
   dof_handler.distribute_dofs(fe_collection);
 
-                                  // interpolate a linear function
+  // interpolate a linear function
   Vector<double> vec (dof_handler.n_dofs());
   VectorTools::interpolate (dof_handler,
-                           Functions::Monomial<dim>
-                           (dim == 1 ?
-                            Point<dim>(1.) :
-                            (dim == 2 ?
-                             Point<dim>(1.,0.) :
-                             Point<dim>(1.,0.,0.))),
-                           vec);
+                            Functions::Monomial<dim>
+                            (dim == 1 ?
+                             Point<dim>(1.) :
+                             (dim == 2 ?
+                              Point<dim>(1.,0.) :
+                              Point<dim>(1.,0.,0.))),
+                            vec);
 
   Vector<float> diff (tria.n_active_cells());
 
-                                  // L1 norm. the function is u(x)=x, so its
-                                  // L1 norm should be equal to 1/2
+  // L1 norm. the function is u(x)=x, so its
+  // L1 norm should be equal to 1/2
   {
     VectorTools::integrate_difference (dof_handler,
-                                      vec,
-                                      ZeroFunction<dim>(),
-                                      diff,
-                                      q_collection,
-                                      VectorTools::L1_norm);
+                                       vec,
+                                       ZeroFunction<dim>(),
+                                       diff,
+                                       q_collection,
+                                       VectorTools::L1_norm);
     deallog << "L1, diff=" << diff.l1_norm() << std::endl;
   }
 
-                                  // H1 seminorm. the function is u(x)=x, so
-                                  // its H1 seminorm should be equal to 1/2
+  // H1 seminorm. the function is u(x)=x, so
+  // its H1 seminorm should be equal to 1/2
   {
     VectorTools::integrate_difference (dof_handler,
-                                      vec,
-                                      ZeroFunction<dim>(),
-                                      diff,
-                                      q_collection,
-                                      VectorTools::H1_seminorm);
+                                       vec,
+                                       ZeroFunction<dim>(),
+                                       diff,
+                                       q_collection,
+                                       VectorTools::H1_seminorm);
     deallog << "H1 seminorm, diff=" << diff.l2_norm() << std::endl;
   }
 
-                                  // W1infty seminorm. the function is
-                                  // u(x)=x, so the norm must be equal to 1
-                                  // on every cell
+  // W1infty seminorm. the function is
+  // u(x)=x, so the norm must be equal to 1
+  // on every cell
   {
     VectorTools::integrate_difference (dof_handler,
-                                      vec,
-                                      ZeroFunction<dim>(),
-                                      diff,
-                                      q_collection,
-                                      VectorTools::W1infty_seminorm);
+                                       vec,
+                                       ZeroFunction<dim>(),
+                                       diff,
+                                       q_collection,
+                                       VectorTools::W1infty_seminorm);
     deallog << "W1infty semi, diff=" << diff.linfty_norm() << std::endl;
-                                    // also ensure that we indeed get the
-                                    // same value on every cell
+    // also ensure that we indeed get the
+    // same value on every cell
     diff. add(-1);
     Assert (diff.l2_norm() == 0, ExcInternalError());
   }
 
-                                  // W1infty norm. the Linfty norm is one, so
-                                  // the W1infty norm must be two. but not on
-                                  // every cell
+  // W1infty norm. the Linfty norm is one, so
+  // the W1infty norm must be two. but not on
+  // every cell
   {
     VectorTools::integrate_difference (dof_handler,
-                                      vec,
-                                      ZeroFunction<dim>(),
-                                      diff,
-                                      q_collection,
-                                      VectorTools::W1infty_norm);
+                                       vec,
+                                       ZeroFunction<dim>(),
+                                       diff,
+                                       q_collection,
+                                       VectorTools::W1infty_norm);
     deallog << "W1infty, diff=" << diff.linfty_norm() << std::endl;
     diff.add(-2);
     Assert (diff.l1_norm() > 0.5, ExcInternalError());
index 4d9dc3c2bc9ce1e89387df0fb91fcd4d6489c074..127bfb4679a5fc37e79bc7c0c3f8056c13403c52 100644 (file)
 template <int dim>
 class F :  public Function<dim>
 {
-  public:
-    F (const unsigned int q) : q(q) {}
-    
-    virtual double value (const Point<dim> &p,
-                         const unsigned int) const
-      {
-       double v=0;
-       for (unsigned int d=0; d<dim; ++d)
-         for (unsigned int i=0; i<=q; ++i)
-           v += (d+1)*(i+1)*std::pow (p[d], 1.*i);
-       return v;
-      }
-
-  private:
-    const unsigned int q;
+public:
+  F (const unsigned int q) : q(q) {}
+
+  virtual double value (const Point<dim> &p,
+                        const unsigned int) const
+  {
+    double v=0;
+    for (unsigned int d=0; d<dim; ++d)
+      for (unsigned int i=0; i<=q; ++i)
+        v += (d+1)*(i+1)*std::pow (p[d], 1.*i);
+    return v;
+  }
+
+private:
+  const unsigned int q;
 };
 
 
@@ -81,27 +81,27 @@ void test ()
       Vector<double> interpolant (dof_handler.n_dofs());
       Vector<float>  error (triangulation.n_active_cells());
       for (unsigned int q=0; q<=p+2; ++q)
-       {
-                                          // interpolate the function
-         VectorTools::interpolate (dof_handler,
-                                   F<dim> (q),
-                                   interpolant);
-      
-                                          // then compute the interpolation error
-         VectorTools::integrate_difference (dof_handler,
-                                            interpolant,
-                                            F<dim> (q),
-                                            error,
-                                            hp::QCollection<dim>(QGauss<dim>(q+2)),
-                                            VectorTools::L2_norm);
-         if (q<=p)
-           Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
-                   ExcInternalError());
-
-         deallog << fe.get_name() << ", P_" << q
-                 << ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
-                 << std::endl;
-       }
+        {
+          // interpolate the function
+          VectorTools::interpolate (dof_handler,
+                                    F<dim> (q),
+                                    interpolant);
+
+          // then compute the interpolation error
+          VectorTools::integrate_difference (dof_handler,
+                                             interpolant,
+                                             F<dim> (q),
+                                             error,
+                                             hp::QCollection<dim>(QGauss<dim>(q+2)),
+                                             VectorTools::L2_norm);
+          if (q<=p)
+            Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
+                    ExcInternalError());
+
+          deallog << fe.get_name() << ", P_" << q
+                  << ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
+                  << std::endl;
+        }
     }
 }
 
@@ -112,7 +112,7 @@ int main ()
   std::ofstream logfile("interpolate_dgq_01/output");
   logfile.precision (3);
   deallog << std::setprecision(3);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
index fc53c83bc04e38147d39f14866703ec606c374c6..d3ffef99c0e4cdb537b23f2a85857e5e26bb9f9d 100644 (file)
 template <int dim>
 class F :  public Function<dim>
 {
-  public:
-    F (const unsigned int q) : q(q) {}
-    
-    virtual double value (const Point<dim> &p,
-                         const unsigned int) const
-      {
-       double v=0;
-       for (unsigned int d=0; d<dim; ++d)
-         for (unsigned int i=0; i<=q; ++i)
-           v += (d+1)*(i+1)*std::pow (p[d], 1.*i);
-       return v;
-      }
-
-  private:
-    const unsigned int q;
+public:
+  F (const unsigned int q) : q(q) {}
+
+  virtual double value (const Point<dim> &p,
+                        const unsigned int) const
+  {
+    double v=0;
+    for (unsigned int d=0; d<dim; ++d)
+      for (unsigned int i=0; i<=q; ++i)
+        v += (d+1)*(i+1)*std::pow (p[d], 1.*i);
+    return v;
+  }
+
+private:
+  const unsigned int q;
 };
 
 
@@ -74,7 +74,7 @@ void test ()
   triangulation.refine_global (1);
   triangulation.begin_active()->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
-  triangulation.refine_global (1);  
+  triangulation.refine_global (1);
 
   for (unsigned int p=1; p<6-dim; ++p)
     {
@@ -86,32 +86,32 @@ void test ()
       ConstraintMatrix constraints;
       DoFTools::make_hanging_node_constraints (dof_handler, constraints);
       constraints.close ();
-      
+
       Vector<double> interpolant (dof_handler.n_dofs());
       Vector<float>  error (triangulation.n_active_cells());
       for (unsigned int q=0; q<=p+2; ++q)
-       {
-                                          // interpolate the function
-         VectorTools::interpolate (dof_handler,
-                                   F<dim> (q),
-                                   interpolant);
-         constraints.distribute (interpolant);
-         
-                                          // then compute the interpolation error
-         VectorTools::integrate_difference (dof_handler,
-                                            interpolant,
-                                            F<dim> (q),
-                                            error,
-                                            hp::QCollection<dim>(QGauss<dim>(q+2)),
-                                            VectorTools::L2_norm);
-         if (q<=p)
-           Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
-                   ExcInternalError());
-
-         deallog << fe.get_name() << ", P_" << q
-                 << ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
-                 << std::endl;
-       }
+        {
+          // interpolate the function
+          VectorTools::interpolate (dof_handler,
+                                    F<dim> (q),
+                                    interpolant);
+          constraints.distribute (interpolant);
+
+          // then compute the interpolation error
+          VectorTools::integrate_difference (dof_handler,
+                                             interpolant,
+                                             F<dim> (q),
+                                             error,
+                                             hp::QCollection<dim>(QGauss<dim>(q+2)),
+                                             VectorTools::L2_norm);
+          if (q<=p)
+            Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
+                    ExcInternalError());
+
+          deallog << fe.get_name() << ", P_" << q
+                  << ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
+                  << std::endl;
+        }
     }
 }
 
@@ -122,7 +122,7 @@ int main ()
   std::ofstream logfile("interpolate_dgq_02/output");
   logfile.precision (3);
   deallog << std::setprecision(3);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
index 4ff83c24956b9dc11e8e67949ac2ae3339fa56d3..6281459e4b1a75240a1a1339d348e7f3d532130c 100644 (file)
 template <int dim>
 class F :  public Function<dim>
 {
-  public:
-    F (const unsigned int q) : q(q) {}
-    
-    virtual double value (const Point<dim> &p,
-                         const unsigned int) const
-      {
-       double v=0;
-       for (unsigned int d=0; d<dim; ++d)
-         for (unsigned int i=0; i<=q; ++i)
-           v += (d+1)*(i+1)*std::pow (p[d], 1.*i);
-       return v;
-      }
-
-  private:
-    const unsigned int q;
+public:
+  F (const unsigned int q) : q(q) {}
+
+  virtual double value (const Point<dim> &p,
+                        const unsigned int) const
+  {
+    double v=0;
+    for (unsigned int d=0; d<dim; ++d)
+      for (unsigned int i=0; i<=q; ++i)
+        v += (d+1)*(i+1)*std::pow (p[d], 1.*i);
+    return v;
+  }
+
+private:
+  const unsigned int q;
 };
 
 
@@ -75,34 +75,34 @@ void test ()
     {
       FE_Q<dim>              fe(p);
       hp::FECollection<dim> hp_fe (fe);
-      
+
       hp::DoFHandler<dim>        dof_handler(triangulation);
       dof_handler.distribute_dofs (hp_fe);
 
       Vector<double> interpolant (dof_handler.n_dofs());
       Vector<float>  error (triangulation.n_active_cells());
       for (unsigned int q=0; q<=p+2; ++q)
-       {
-                                          // interpolate the function
-         VectorTools::interpolate (dof_handler,
-                                   F<dim> (q),
-                                   interpolant);
-      
-                                          // then compute the interpolation error
-         VectorTools::integrate_difference (dof_handler,
-                                            interpolant,
-                                            F<dim> (q),
-                                            error,
-                                            hp::QCollection<dim>(QGauss<dim>(q+2)),
-                                            VectorTools::L2_norm);
-         if (q<=p)
-           Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
-                   ExcInternalError());
-
-         deallog << fe.get_name() << ", P_" << q
-                 << ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
-                 << std::endl;
-       }
+        {
+          // interpolate the function
+          VectorTools::interpolate (dof_handler,
+                                    F<dim> (q),
+                                    interpolant);
+
+          // then compute the interpolation error
+          VectorTools::integrate_difference (dof_handler,
+                                             interpolant,
+                                             F<dim> (q),
+                                             error,
+                                             hp::QCollection<dim>(QGauss<dim>(q+2)),
+                                             VectorTools::L2_norm);
+          if (q<=p)
+            Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
+                    ExcInternalError());
+
+          deallog << fe.get_name() << ", P_" << q
+                  << ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
+                  << std::endl;
+        }
     }
 }
 
@@ -113,7 +113,7 @@ int main ()
   std::ofstream logfile("interpolate_q_01/output");
   logfile.precision (3);
   deallog << std::setprecision(3);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
index 56aff7829ff86eb487f5802f704fee151499dcc5..8ac7743c2de2dd92eb392d7df0928c3d487fdc2d 100644 (file)
 template <int dim>
 class F :  public Function<dim>
 {
-  public:
-    F (const unsigned int q) : q(q) {}
-    
-    virtual double value (const Point<dim> &p,
-                         const unsigned int) const
-      {
-       double v=0;
-       for (unsigned int d=0; d<dim; ++d)
-         for (unsigned int i=0; i<=q; ++i)
-           v += (d+1)*(i+1)*std::pow (p[d], 1.*i);
-       return v;
-      }
-
-  private:
-    const unsigned int q;
+public:
+  F (const unsigned int q) : q(q) {}
+
+  virtual double value (const Point<dim> &p,
+                        const unsigned int) const
+  {
+    double v=0;
+    for (unsigned int d=0; d<dim; ++d)
+      for (unsigned int i=0; i<=q; ++i)
+        v += (d+1)*(i+1)*std::pow (p[d], 1.*i);
+    return v;
+  }
+
+private:
+  const unsigned int q;
 };
 
 
@@ -74,7 +74,7 @@ void test ()
   triangulation.refine_global (1);
   triangulation.begin_active()->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
-  triangulation.refine_global (1);  
+  triangulation.refine_global (1);
 
   for (unsigned int p=1; p<6-dim; ++p)
     {
@@ -86,32 +86,32 @@ void test ()
       ConstraintMatrix constraints;
       DoFTools::make_hanging_node_constraints (dof_handler, constraints);
       constraints.close ();
-      
+
       Vector<double> interpolant (dof_handler.n_dofs());
       Vector<float>  error (triangulation.n_active_cells());
       for (unsigned int q=0; q<=p+2; ++q)
-       {
-                                          // interpolate the function
-         VectorTools::interpolate (dof_handler,
-                                   F<dim> (q),
-                                   interpolant);
-         constraints.distribute (interpolant);
-         
-                                          // then compute the interpolation error
-         VectorTools::integrate_difference (dof_handler,
-                                            interpolant,
-                                            F<dim> (q),
-                                            error,
-                                            hp::QCollection<dim>(QGauss<dim>(q+2)),
-                                            VectorTools::L2_norm);
-         if (q<=p)
-           Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
-                   ExcInternalError());
-
-         deallog << fe.get_name() << ", P_" << q
-                 << ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
-                 << std::endl;
-       }
+        {
+          // interpolate the function
+          VectorTools::interpolate (dof_handler,
+                                    F<dim> (q),
+                                    interpolant);
+          constraints.distribute (interpolant);
+
+          // then compute the interpolation error
+          VectorTools::integrate_difference (dof_handler,
+                                             interpolant,
+                                             F<dim> (q),
+                                             error,
+                                             hp::QCollection<dim>(QGauss<dim>(q+2)),
+                                             VectorTools::L2_norm);
+          if (q<=p)
+            Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
+                    ExcInternalError());
+
+          deallog << fe.get_name() << ", P_" << q
+                  << ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
+                  << std::endl;
+        }
     }
 }
 
@@ -122,7 +122,7 @@ int main ()
   std::ofstream logfile("interpolate_q_02/output");
   logfile.precision (3);
   deallog << std::setprecision(3);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
index 229e917909b9bb05df75acbccd212affaea89a68..82b10e0de69814f234f05f429d433ff9699659e9 100644 (file)
 template <int dim>
 class F :  public Function<dim>
 {
-  public:
-    F (const unsigned int q) : Function<dim>(3), q(q) {}
-    
-    virtual void vector_value (const Point<dim> &p,
-                              Vector<double>   &v) const
+public:
+  F (const unsigned int q) : Function<dim>(3), q(q) {}
+
+  virtual void vector_value (const Point<dim> &p,
+                             Vector<double>   &v) const
+  {
+    for (unsigned int c=0; c<v.size(); ++c)
       {
-       for (unsigned int c=0; c<v.size(); ++c)
-         {
-           v(c) = 0;
-           for (unsigned int d=0; d<dim; ++d)
-             for (unsigned int i=0; i<=q; ++i)
-               v(c) += (d+1)*(i+1)*std::pow (p[d], 1.*i)+c;
-         }
+        v(c) = 0;
+        for (unsigned int d=0; d<dim; ++d)
+          for (unsigned int i=0; i<=q; ++i)
+            v(c) += (d+1)*(i+1)*std::pow (p[d], 1.*i)+c;
       }
+  }
 
-  private:
-    const unsigned int q;
+private:
+  const unsigned int q;
 };
 
 
@@ -79,7 +79,7 @@ void test ()
       FE_Q<dim> fe_p(p);
       FE_Q<dim> fe_p1(p+1);
       FESystem<dim>              fe(fe_p, 2,
-                                   fe_p1, 1);
+                                    fe_p1, 1);
       hp::FECollection<dim> hp_fe (fe);
       hp::DoFHandler<dim>        dof_handler(triangulation);
       dof_handler.distribute_dofs (hp_fe);
@@ -87,27 +87,27 @@ void test ()
       Vector<double> interpolant (dof_handler.n_dofs());
       Vector<float>  error (triangulation.n_active_cells());
       for (unsigned int q=0; q<=p+2; ++q)
-       {
-                                          // interpolate the function
-         VectorTools::interpolate (dof_handler,
-                                   F<dim> (q),
-                                   interpolant);
-      
-                                          // then compute the interpolation error
-         VectorTools::integrate_difference (dof_handler,
-                                            interpolant,
-                                            F<dim> (q),
-                                            error,
-                                            hp::QCollection<dim>(QGauss<dim>(q+2)),
-                                            VectorTools::L2_norm);
-         if (q<=p)
-           Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
-                   ExcInternalError());
-
-         deallog << fe.get_name() << ", P_" << q
-                 << ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
-                 << std::endl;
-       }
+        {
+          // interpolate the function
+          VectorTools::interpolate (dof_handler,
+                                    F<dim> (q),
+                                    interpolant);
+
+          // then compute the interpolation error
+          VectorTools::integrate_difference (dof_handler,
+                                             interpolant,
+                                             F<dim> (q),
+                                             error,
+                                             hp::QCollection<dim>(QGauss<dim>(q+2)),
+                                             VectorTools::L2_norm);
+          if (q<=p)
+            Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
+                    ExcInternalError());
+
+          deallog << fe.get_name() << ", P_" << q
+                  << ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
+                  << std::endl;
+        }
     }
 }
 
@@ -118,7 +118,7 @@ int main ()
   std::ofstream logfile("interpolate_q_system_01/output");
   logfile.precision (3);
   deallog << std::setprecision(3);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
index 1234bb1eadba6f1b5f5e584265b8e2742eb33299..799e2ce3d292cc7a8dd3944e7ee1ba234e5c3412 100644 (file)
 template <int dim>
 class F :  public Function<dim>
 {
-  public:
-    F (const unsigned int q) : Function<dim>(3), q(q) {}
-    
-    virtual void vector_value (const Point<dim> &p,
-                              Vector<double>   &v) const
+public:
+  F (const unsigned int q) : Function<dim>(3), q(q) {}
+
+  virtual void vector_value (const Point<dim> &p,
+                             Vector<double>   &v) const
+  {
+    for (unsigned int c=0; c<v.size(); ++c)
       {
-       for (unsigned int c=0; c<v.size(); ++c)
-         {
-           v(c) = 0;
-           for (unsigned int d=0; d<dim; ++d)
-             for (unsigned int i=0; i<=q; ++i)
-               v(c) += (d+1)*(i+1)*std::pow (p[d], 1.*i)+c;
-         }
+        v(c) = 0;
+        for (unsigned int d=0; d<dim; ++d)
+          for (unsigned int i=0; i<=q; ++i)
+            v(c) += (d+1)*(i+1)*std::pow (p[d], 1.*i)+c;
       }
+  }
 
-  private:
-    const unsigned int q;
+private:
+  const unsigned int q;
 };
 
 
@@ -78,14 +78,14 @@ void test ()
   triangulation.refine_global (1);
   triangulation.begin_active()->set_refine_flag ();
   triangulation.execute_coarsening_and_refinement ();
-  triangulation.refine_global (1);  
+  triangulation.refine_global (1);
 
   for (unsigned int p=1; p<6-dim; ++p)
     {
       FE_Q<dim> fe_p(p);
       FE_Q<dim> fe_p1(p+1);
       FESystem<dim>              fe(fe_p, 2,
-                                   fe_p1, 1);
+                                    fe_p1, 1);
       hp::FECollection<dim> hp_fe (fe);
       hp::DoFHandler<dim>        dof_handler(triangulation);
       dof_handler.distribute_dofs (hp_fe);
@@ -97,28 +97,28 @@ void test ()
       Vector<double> interpolant (dof_handler.n_dofs());
       Vector<float>  error (triangulation.n_active_cells());
       for (unsigned int q=0; q<=p+2; ++q)
-       {
-                                          // interpolate the function
-         VectorTools::interpolate (dof_handler,
-                                   F<dim> (q),
-                                   interpolant);
-         constraints.distribute (interpolant);
-      
-                                          // then compute the interpolation error
-         VectorTools::integrate_difference (dof_handler,
-                                            interpolant,
-                                            F<dim> (q),
-                                            error,
-                                            hp::QCollection<dim>(QGauss<dim>(q+2)),
-                                            VectorTools::L2_norm);
-         if (q<=p)
-           Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
-                   ExcInternalError());
-
-         deallog << fe.get_name() << ", P_" << q
-                 << ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
-                 << std::endl;
-       }
+        {
+          // interpolate the function
+          VectorTools::interpolate (dof_handler,
+                                    F<dim> (q),
+                                    interpolant);
+          constraints.distribute (interpolant);
+
+          // then compute the interpolation error
+          VectorTools::integrate_difference (dof_handler,
+                                             interpolant,
+                                             F<dim> (q),
+                                             error,
+                                             hp::QCollection<dim>(QGauss<dim>(q+2)),
+                                             VectorTools::L2_norm);
+          if (q<=p)
+            Assert (error.l2_norm() < 1e-12*interpolant.l2_norm(),
+                    ExcInternalError());
+
+          deallog << fe.get_name() << ", P_" << q
+                  << ", rel. error=" << error.l2_norm() / interpolant.l2_norm()
+                  << std::endl;
+        }
     }
 }
 
@@ -129,7 +129,7 @@ int main ()
   std::ofstream logfile("interpolate_q_system_02/output");
   logfile.precision (3);
   deallog << std::setprecision(3);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
index c09eb566135f40fd568352550e56a45d84835463..99931fcb1aeaaa84dd33f4c77e3c76a5630c0a7e 100644 (file)
@@ -37,9 +37,9 @@ void test ()
   mapping_collection.push_back (MappingQ<dim>(2));
   mapping_collection.push_back (MappingQ<dim>(1));
 
-                                   // now create a copy and make sure
-                                   // it goes out of scope before the
-                                   // original
+  // now create a copy and make sure
+  // it goes out of scope before the
+  // original
   {
     hp::MappingCollection<dim> copy (mapping_collection);
   }
@@ -51,14 +51,14 @@ int main ()
 {
   std::ofstream logfile("mapping_collection_01/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index c0f08828aa84abd39af733d21f2770ba1a8feb9e..bcc477af7aa87d592823305b9dad042b36638a17 100644 (file)
@@ -40,14 +40,14 @@ int main ()
 {
   std::ofstream logfile("mapping_collection_02/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 5d330895af1e0db461c492738cad36273f01dbd6..2fc09cd52c43ab15f86deded803e023af992dd39 100644 (file)
@@ -37,7 +37,7 @@ void test ()
   Mapping<dim> *copy = mapping.clone();
   deallog << "Deleting clone..." << std::endl;
   delete copy;
-  deallog << "Destroying original..." << std::endl;  
+  deallog << "Destroying original..." << std::endl;
 }
 
 
@@ -46,14 +46,14 @@ int main ()
 {
   std::ofstream logfile("mapping_collection_03/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 7f51c428607af428598fee143bc83672b4f8114b..ee1b0e7f0bd2b5f5cdcb72d4807116df20621481 100644 (file)
@@ -37,7 +37,7 @@ void test ()
     MappingQ<dim> copy(mapping);
     deallog << "Deleting clone..." << std::endl;
   }
-  deallog << "Destroying original..." << std::endl;  
+  deallog << "Destroying original..." << std::endl;
 }
 
 
@@ -46,14 +46,14 @@ int main ()
 {
   std::ofstream logfile("mapping_collection_04/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 1a016e2286e91bc95a9bfd83c3eb2d1525ad9219..5db9584b9e8d9280f445855709ad41cd0cba4287 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim>(2) {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square(); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { values(0) = value(p,0);
-       values(1) = value(p,1); }
+public:
+  MySquareFunction () : Function<dim>(2) {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square();
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+    values(1) = value(p,1);
+  }
 };
 
 
@@ -67,7 +71,7 @@ class MySquareFunction : public Function<dim>
 template <int dim>
 void
 check_boundary (const hp::DoFHandler<dim> &dof,
-               const hp::MappingCollection<dim>    &mapping)
+                const hp::MappingCollection<dim>    &mapping)
 {
   MySquareFunction<dim> coefficient;
   typename FunctionMap<dim>::type function_map;
@@ -75,41 +79,41 @@ check_boundary (const hp::DoFHandler<dim> &dof,
 
   hp::QCollection<dim-1> face_quadrature;
   face_quadrature.push_back (QGauss<dim-1>(6));
-  
+
   std::vector<types::global_dof_index> dof_to_boundary_mapping;
   DoFTools::map_dof_to_boundary_indices (dof,
-                                        dof_to_boundary_mapping);
+                                         dof_to_boundary_mapping);
 
   SparsityPattern sparsity(dof.n_boundary_dofs(function_map),
-                          dof.max_couplings_between_boundary_dofs());
+                           dof.max_couplings_between_boundary_dofs());
   DoFTools::make_boundary_sparsity_pattern (dof,
-                                           function_map,
-                                           dof_to_boundary_mapping,
-                                           sparsity);
+                                            function_map,
+                                            dof_to_boundary_mapping,
+                                            sparsity);
   sparsity.compress ();
 
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
-  
+
   Vector<double> rhs (dof.n_boundary_dofs(function_map));
   MatrixTools::
-    create_boundary_mass_matrix (mapping, dof,
-                                face_quadrature, matrix,
-                                function_map, rhs,
-                                dof_to_boundary_mapping,
-                                &coefficient);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_boundary_mass_matrix (mapping, dof,
+                               face_quadrature, matrix,
+                               function_map, rhs,
+                               dof_to_boundary_mapping,
+                               &coefficient);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     matrix.global_entry(i) *= 100;
-  
-                                  // finally write out matrix
+
+  // finally write out matrix
   matrix.print (deallog.get_file_stream());
 }
 
@@ -117,7 +121,7 @@ check_boundary (const hp::DoFHandler<dim> &dof,
 
 void
 check_boundary (const hp::DoFHandler<1> &,
-               const hp::MappingCollection<1>    &)
+                const hp::MappingCollection<1> &)
 {}
 
 
@@ -127,7 +131,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -138,27 +142,27 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   hp::FECollection<dim> element;
   element.push_back (FESystem<dim> (FE_Q<dim>(1), 1,
-                                   FE_Q<dim>(2), 1));
+                                    FE_Q<dim>(2), 1));
   hp::DoFHandler<dim> dof(tr);
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   hp::MappingCollection<dim> mapping;
   mapping.push_back (MappingQ<dim>(3));
 
   hp::QCollection<dim> quadrature;
   quadrature.push_back (QGauss<dim>(6));
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   std::vector<std::vector<bool> > mask (2, std::vector<bool>(2, false));
   mask[0][0] = mask[1][1] = true;
@@ -168,11 +172,11 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
 
   Functions::ExpFunction<dim> coefficient;
-  
+
   typename FunctionMap<dim>::type function_map;
   function_map[0] = &coefficient;
 
@@ -180,31 +184,31 @@ check ()
     {
       matrix.reinit(sparsity);
       switch (test)
-       {
-         case 0:
-               MatrixTools::
-                 create_mass_matrix (mapping, dof,
-                                     quadrature, matrix, &coefficient);
-               break;
-         case 1:
-               MatrixTools::
-                 create_laplace_matrix (mapping, dof,
-                                        quadrature, matrix, &coefficient);
-               break;
-         default:
-               Assert (false, ExcInternalError());
-       };
-
-                                      // since we only generate
-                                      // output with two digits after
-                                      // the dot, and since matrix
-                                      // entries are usually in the
-                                      // range of 1 or below,
-                                      // multiply matrix by 100 to
-                                      // make test more sensitive
+        {
+        case 0:
+          MatrixTools::
+          create_mass_matrix (mapping, dof,
+                              quadrature, matrix, &coefficient);
+          break;
+        case 1:
+          MatrixTools::
+          create_laplace_matrix (mapping, dof,
+                                 quadrature, matrix, &coefficient);
+          break;
+        default:
+          Assert (false, ExcInternalError());
+        };
+
+      // since we only generate
+      // output with two digits after
+      // the dot, and since matrix
+      // entries are usually in the
+      // range of 1 or below,
+      // multiply matrix by 100 to
+      // make test more sensitive
       for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
-       deallog.get_file_stream() << matrix.global_entry(i) * 100
-                                 << std::endl;
+        deallog.get_file_stream() << matrix.global_entry(i) * 100
+                                  << std::endl;
     };
 
   if (dim > 1)
@@ -217,7 +221,7 @@ int main ()
 {
   std::ofstream logfile ("matrices/output");
   logfile.precision (2);
-  logfile.setf(std::ios::fixed);  
+  logfile.setf(std::ios::fixed);
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index cccf37de63d84d75effd1d0ca2ac1c0626cc4f3c..72b68e276538f63e250b4bc3b424aa7e4cbf899b 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim>(2) {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square(); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { values(0) = value(p,0);
-       values(1) = value(p,1); }
+public:
+  MySquareFunction () : Function<dim>(2) {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square();
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+    values(1) = value(p,1);
+  }
 };
 
 
@@ -65,7 +69,7 @@ class MySquareFunction : public Function<dim>
 template <int dim>
 void
 check_boundary (const hp::DoFHandler<dim> &dof,
-               const hp::MappingCollection<dim>    &mapping)
+                const hp::MappingCollection<dim>    &mapping)
 {
   MySquareFunction<dim> coefficient;
   typename FunctionMap<dim>::type function_map;
@@ -74,41 +78,41 @@ check_boundary (const hp::DoFHandler<dim> &dof,
   hp::QCollection<dim-1> face_quadrature;
   for (unsigned int i=1; i<7-dim; ++i)
     face_quadrature.push_back (QGauss<dim-1>(3+i));
-  
+
   std::vector<types::global_dof_index> dof_to_boundary_mapping;
   DoFTools::map_dof_to_boundary_indices (dof,
-                                        dof_to_boundary_mapping);
+                                         dof_to_boundary_mapping);
 
   SparsityPattern sparsity(dof.n_boundary_dofs(function_map),
-                          dof.max_couplings_between_boundary_dofs());
+                           dof.max_couplings_between_boundary_dofs());
   DoFTools::make_boundary_sparsity_pattern (dof,
-                                           function_map,
-                                           dof_to_boundary_mapping,
-                                           sparsity);
+                                            function_map,
+                                            dof_to_boundary_mapping,
+                                            sparsity);
   sparsity.compress ();
 
   SparseMatrix<double> matrix;
   matrix.reinit (sparsity);
-  
+
   Vector<double> rhs (dof.n_boundary_dofs(function_map));
   MatrixTools::
-    create_boundary_mass_matrix (mapping, dof,
-                                face_quadrature, matrix,
-                                function_map, rhs,
-                                dof_to_boundary_mapping,
-                                &coefficient);
-
-                                  // since we only generate
-                                  // output with two digits after
-                                  // the dot, and since matrix
-                                  // entries are usually in the
-                                  // range of 1 or below,
-                                  // multiply matrix by 100 to
-                                  // make test more sensitive
+  create_boundary_mass_matrix (mapping, dof,
+                               face_quadrature, matrix,
+                               function_map, rhs,
+                               dof_to_boundary_mapping,
+                               &coefficient);
+
+  // since we only generate
+  // output with two digits after
+  // the dot, and since matrix
+  // entries are usually in the
+  // range of 1 or below,
+  // multiply matrix by 100 to
+  // make test more sensitive
   for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
     matrix.global_entry(i) *= 100;
-  
-                                  // finally write out matrix
+
+  // finally write out matrix
   matrix.print (deallog.get_file_stream());
 }
 
@@ -116,7 +120,7 @@ check_boundary (const hp::DoFHandler<dim> &dof,
 
 void
 check_boundary (const hp::DoFHandler<1> &,
-               const hp::MappingCollection<1>    &)
+                const hp::MappingCollection<1> &)
 {}
 
 
@@ -126,7 +130,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -137,23 +141,23 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   hp::FECollection<dim> element;
   for (unsigned int i=1; i<7-dim; ++i)
     element.push_back (FESystem<dim> (FE_Q<dim>(i), 1,
-                                     FE_Q<dim>(i+1), 1));
+                                      FE_Q<dim>(i+1), 1));
   hp::DoFHandler<dim> dof(tr);
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active(); cell!=dof.end(); ++cell)
+       cell = dof.begin_active(); cell!=dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
-  
+
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   hp::MappingCollection<dim> mapping;
   for (unsigned int i=1; i<7-dim; ++i)
     mapping.push_back (MappingQ<dim>(i+1));
@@ -162,9 +166,9 @@ check ()
   for (unsigned int i=1; i<7-dim; ++i)
     quadrature.push_back (QGauss<dim>(3+i));
 
-                                  // create sparsity pattern. note
-                                  // that different components should
-                                  // not couple, so use pattern
+  // create sparsity pattern. note
+  // that different components should
+  // not couple, so use pattern
   SparsityPattern sparsity (dof.n_dofs(), dof.n_dofs());
   std::vector<std::vector<bool> > mask (2, std::vector<bool>(2, false));
   mask[0][0] = mask[1][1] = true;
@@ -174,11 +178,11 @@ check ()
   constraints.close ();
   constraints.condense (sparsity);
   sparsity.compress ();
-  
+
   SparseMatrix<double> matrix;
 
   Functions::ExpFunction<dim> coefficient;
-  
+
   typename FunctionMap<dim>::type function_map;
   function_map[0] = &coefficient;
 
@@ -186,31 +190,31 @@ check ()
     {
       matrix.reinit(sparsity);
       switch (test)
-       {
-         case 0:
-               MatrixTools::
-                 create_mass_matrix (mapping, dof,
-                                     quadrature, matrix, &coefficient);
-               break;
-         case 1:
-               MatrixTools::
-                 create_laplace_matrix (mapping, dof,
-                                        quadrature, matrix, &coefficient);
-               break;
-         default:
-               Assert (false, ExcInternalError());
-       };
-
-                                      // since we only generate
-                                      // output with two digits after
-                                      // the dot, and since matrix
-                                      // entries are usually in the
-                                      // range of 1 or below,
-                                      // multiply matrix by 100 to
-                                      // make test more sensitive
+        {
+        case 0:
+          MatrixTools::
+          create_mass_matrix (mapping, dof,
+                              quadrature, matrix, &coefficient);
+          break;
+        case 1:
+          MatrixTools::
+          create_laplace_matrix (mapping, dof,
+                                 quadrature, matrix, &coefficient);
+          break;
+        default:
+          Assert (false, ExcInternalError());
+        };
+
+      // since we only generate
+      // output with two digits after
+      // the dot, and since matrix
+      // entries are usually in the
+      // range of 1 or below,
+      // multiply matrix by 100 to
+      // make test more sensitive
       for (unsigned int i=0; i<matrix.n_nonzero_elements(); ++i)
-       deallog.get_file_stream() << matrix.global_entry(i) * 100
-                                 << std::endl;
+        deallog.get_file_stream() << matrix.global_entry(i) * 100
+                                  << std::endl;
     };
 
   if (dim > 1)
@@ -223,7 +227,7 @@ int main ()
 {
   std::ofstream logfile ("matrices_hp/output");
   logfile.precision (2);
-  logfile.setf(std::ios::fixed);  
+  logfile.setf(std::ios::fixed);
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 70963129c82661544e01e5655af8e74cd2c2f21d..820b55d1640b9da3828b070babdfc5fdec4d4388 100644 (file)
@@ -38,7 +38,7 @@ template <int dim>
 void check_cells (const hp::DoFHandler<dim> &dof_handler)
 {
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-         cell=dof_handler.begin_active();
+       cell=dof_handler.begin_active();
        cell!=dof_handler.end(); ++cell)
     {
       deallog << "cell=" << cell << std::endl;
@@ -63,10 +63,10 @@ template <int dim>
 void check_faces (const hp::DoFHandler<dim> &dof_handler)
 {
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-         cell=dof_handler.begin_active();
+       cell=dof_handler.begin_active();
        cell!=dof_handler.end(); ++cell)
     for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
-      {        
+      {
         deallog << "face=" << cell->face(f) << std::endl;
         deallog << "n="
                 << cell->face(f)->n_active_fe_indices ()
@@ -94,10 +94,10 @@ template <int dim>
 void check_edges (const hp::DoFHandler<dim> &dof_handler)
 {
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-         cell=dof_handler.begin_active();
+       cell=dof_handler.begin_active();
        cell!=dof_handler.end(); ++cell)
     for (unsigned int e=0; e<GeometryInfo<dim>::lines_per_cell; ++e)
-      {        
+      {
         deallog << "edge=" << cell->line(e) << std::endl;
         deallog << "n="
                 << cell->line(e)->n_active_fe_indices ()
@@ -123,7 +123,7 @@ void test ()
   tria.refine_global (2);
   tria.begin_active()->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
-  tria.refine_global (2);  
+  tria.refine_global (2);
 
   hp::FECollection<dim> fe_collection;
   fe_collection.push_back(FE_Q<dim> (1));
@@ -134,10 +134,10 @@ void test ()
   hp::DoFHandler<dim> dof_handler(tria);
 
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell != dof_handler.end(); ++cell)
     cell->set_active_fe_index (rand() % fe_collection.size());
-  
+
   dof_handler.distribute_dofs(fe_collection);
 
   check_cells (dof_handler);
@@ -150,14 +150,14 @@ int main ()
 {
   std::ofstream logfile("n_active_fe_indices/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index cad700dbc91525f7e1208fe9917a5fe94e1539c6..9c932b6bfaa879a9a00ba5aed395ee992f1ced9d 100644 (file)
@@ -49,7 +49,7 @@ void test (const FiniteElement<dim> &fe)
   tria.refine_global (2);
   tria.begin_active()->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
-  tria.refine_global (1);  
+  tria.refine_global (1);
 
   const hp::FECollection<dim> fe_collection (fe);
 
@@ -60,36 +60,36 @@ void test (const FiniteElement<dim> &fe)
   dof_handler.distribute_dofs (fe);
 
   deallog << fe.get_name() << ' ' << dof_handler.n_dofs()
-         << ' ' << hp_dof_handler.n_dofs() << std::endl;
+          << ' ' << hp_dof_handler.n_dofs() << std::endl;
 
   Assert (dof_handler.n_dofs() == hp_dof_handler.n_dofs(),
-         ExcInternalError());
+          ExcInternalError());
 }
 
 
 
 #define CHECK(EL,deg,dim)\
- { FE_ ## EL<dim> EL(deg);   \
-   test(EL); }
 { FE_ ## EL<dim> EL(deg);   \
+    test(EL); }
 
 #define CHECK_SYS1(sub1,N1,dim) \
- { FESystem<dim> q(sub1, N1);   \
-   test(q); }
 { FESystem<dim> q(sub1, N1);   \
+    test(q); }
 
 #define CHECK_SYS2(sub1,N1,sub2,N2,dim) \
- { FESystem<dim> q(sub1, N1, sub2, N2); \
-   test(q); }
 { FESystem<dim> q(sub1, N1, sub2, N2); \
+    test(q); }
 
 #define CHECK_SYS3(sub1,N1,sub2,N2,sub3,N3,dim)   \
- { FESystem<dim> q(sub1, N1, sub2, N2, sub3, N3); \
-   test(q); }
 { FESystem<dim> q(sub1, N1, sub2, N2, sub3, N3); \
+    test(q); }
 
 
 #define CHECK_ALL(EL,deg)\
- { CHECK(EL,deg,1); \
-   CHECK(EL,deg,2); \
-   CHECK(EL,deg,3); \
- }
 { CHECK(EL,deg,1); \
+    CHECK(EL,deg,2); \
+    CHECK(EL,deg,3); \
 }
 
 
 
@@ -97,10 +97,10 @@ int main ()
 {
   std::ofstream logfile("n_dofs/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   CHECK_ALL(Q,1);
   CHECK_ALL(Q,2);
@@ -155,26 +155,26 @@ int main ()
 
   CHECK_SYS3(FE_DGQ<3>(1),  3,FE_DGP<3>(3),1,FE_Q<3>(1),3,3);
 
-                                  // systems of systems  
+  // systems of systems
   CHECK_SYS3((FESystem<2>(FE_Q<2>(1),3)), 3,
-            FE_DGQ<2>(0), 1,
-            FE_Q<2>(1), 3,
-            2);
+             FE_DGQ<2>(0), 1,
+             FE_Q<2>(1), 3,
+             2);
   CHECK_SYS3(FE_DGQ<2>(3), 1,
-            FESystem<2>(FE_DGQ<2>(0),3), 1,
-            FESystem<2>(FE_Q<2>(2),1,
-                        FE_DGQ<2>(0),1),2,
-            2);
+             FESystem<2>(FE_DGQ<2>(0),3), 1,
+             FESystem<2>(FE_Q<2>(2),1,
+                         FE_DGQ<2>(0),1),2,
+             2);
 
-                                  // systems with Nedelec elements
+  // systems with Nedelec elements
   CHECK_SYS2 (FE_DGQ<2>(3), 1,
-             FE_Nedelec<2>(0), 2,
-             2);
+              FE_Nedelec<2>(0), 2,
+              2);
   CHECK_SYS3(FE_Nedelec<2>(0), 1,
-            FESystem<2>(FE_DGQ<2>(1),2), 1,
-            FESystem<2>(FE_Q<2>(2),1,
-                        FE_Nedelec<2>(0),2),2,
-            2);
-  
+             FESystem<2>(FE_DGQ<2>(1),2), 1,
+             FESystem<2>(FE_Q<2>(2),1,
+                         FE_Nedelec<2>(0),2),2,
+             2);
+
   deallog << "OK" << std::endl;
 }
index 0ac115414c01cad8333faedcba3d5b3b8bcdf4ee..7c292efe7679a8946dc42b6fdfafaa45a6ed97d4 100644 (file)
@@ -36,9 +36,9 @@ void test ()
   q_collection.push_back (QGauss<dim>(2));
   q_collection.push_back (QGauss<dim>(3));
 
-                                   // now create a copy and make sure
-                                   // it goes out of scope before the
-                                   // original
+  // now create a copy and make sure
+  // it goes out of scope before the
+  // original
   {
     hp::QCollection<dim> copy (q_collection);
   }
@@ -50,14 +50,14 @@ int main ()
 {
   std::ofstream logfile("q_collection_01/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 37459772448757d53849885cc4cff5688b8d928c..0a4d10e645ae5e5975446c4c964a30acbe942cc6 100644 (file)
@@ -43,7 +43,7 @@ void test ()
   tria.refine_global (2);
   tria.begin_active()->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
-  tria.refine_global (2);  
+  tria.refine_global (2);
 
   hp::FECollection<dim> fe_collection;
   fe_collection.push_back(FE_Q<dim> (1));
@@ -54,15 +54,15 @@ void test ()
   hp::DoFHandler<dim> dof_handler(tria);
 
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof_handler.begin_active();
+       cell = dof_handler.begin_active();
        cell != dof_handler.end(); ++cell)
     cell->set_active_fe_index (rand() % fe_collection.size());
-  
+
   dof_handler.distribute_dofs(fe_collection);
 
   std::vector<types::global_dof_index> local_dof_indices;
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-         cell=dof_handler.begin_active();
+       cell=dof_handler.begin_active();
        cell!=dof_handler.end(); ++cell)
     {
       local_dof_indices.resize (cell->get_fe().dofs_per_cell);
@@ -80,14 +80,14 @@ int main ()
 {
   std::ofstream logfile("random/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   test<1> ();
   test<2> ();
   test<3> ();
-  
+
   deallog << "OK" << std::endl;
 }
index 7fe62407cf19c2963bba60b4dac95a58b520e34f..0a260c94dacf0aaec5c0cc092725684bcf77260d 100644 (file)
@@ -65,14 +65,14 @@ get_dofs (const hp::DoFHandler<dim> &dof)
 
 template <int dim>
 void
-check_renumbering(hp::DoFHandler<dim>dof)
+check_renumbering(hp::DoFHandler<dim> &dof)
 {
-                                  // do component-wise and save the
-                                  // results
+  // do component-wise and save the
+  // results
   DoFRenumbering::component_wise (dof);
   const std::vector<types::global_dof_index> vc = get_dofs (dof);
 
-                                  // now do the same with blocks
+  // now do the same with blocks
   DoFRenumbering::block_wise (dof);
   const std::vector<types::global_dof_index> vb = get_dofs (dof);
 
@@ -101,10 +101,10 @@ check ()
   {
     bool coin = false;
     for (typename hp::DoFHandler<dim>::active_cell_iterator cell=dof.begin_active();
-        cell != dof.end(); ++cell)
+         cell != dof.end(); ++cell)
       {
-       cell->set_active_fe_index (coin ? 0 : 1);
-       coin = !coin;
+        cell->set_active_fe_index (coin ? 0 : 1);
+        coin = !coin;
       }
   }
 
index 095ab644b6b158f4b964eb6ea111a8cb969ef404..9f37851e4d3c81c8f4901805d738842540bc9345 100644 (file)
@@ -64,10 +64,10 @@ get_dofs (const hp::DoFHandler<dim> &dof)
 
 template <int dim>
 void
-check_renumbering(hp::DoFHandler<dim>dof)
+check_renumbering(hp::DoFHandler<dim> &dof)
 {
-                                  // do component-wise and save the
-                                  // results
+  // do component-wise and save the
+  // results
   DoFRenumbering::component_wise (dof);
   const std::vector<types::global_dof_index> vc = get_dofs (dof);
 
@@ -87,10 +87,10 @@ check ()
   {
     bool coin = false;
     for (typename hp::DoFHandler<dim>::active_cell_iterator cell=dof.begin_active();
-        cell != dof.end(); ++cell)
+         cell != dof.end(); ++cell)
       {
-       cell->set_active_fe_index (coin ? 0 : 1);
-       coin = !coin;
+        cell->set_active_fe_index (coin ? 0 : 1);
+        coin = !coin;
       }
   }
 
index 98b391fdd7bcfea28f07560ee96d477b4ee4ea6e..bb415117231ea42c47c122e52d14d8638fe3bf01 100644 (file)
@@ -63,10 +63,10 @@ check ()
   {
     bool coin = false;
     for (typename hp::DoFHandler<dim>::active_cell_iterator cell=dof.begin_active();
-        cell != dof.end(); ++cell)
+         cell != dof.end(); ++cell)
       {
-       cell->set_active_fe_index (coin ? 0 : 1);
-       coin = !coin;
+        cell->set_active_fe_index (coin ? 0 : 1);
+        coin = !coin;
       }
   }
   dof.distribute_dofs(fe_collection);
@@ -74,7 +74,7 @@ check ()
   std::vector<bool> touched(dof.n_dofs(), false);
   std::vector<types::global_dof_index> local_dof_indices;
   for (typename hp::DoFHandler<dim>::active_cell_iterator cell=dof.begin_active();
-        cell != dof.end(); ++cell)
+       cell != dof.end(); ++cell)
     {
       const unsigned int fe_index = cell->active_fe_index();
       const unsigned int dofs_per_cell = fe_collection[fe_index].dofs_per_cell;
@@ -83,17 +83,17 @@ check ()
 
       deallog << "cell=" << cell << std::endl;
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       {
-         Assert (local_dof_indices[i] < dof.n_dofs(),
-                 ExcInternalError());
-         touched[local_dof_indices[i]] = true;
-         deallog << local_dof_indices[i] << ' ';
-       }
+        {
+          Assert (local_dof_indices[i] < dof.n_dofs(),
+                  ExcInternalError());
+          touched[local_dof_indices[i]] = true;
+          deallog << local_dof_indices[i] << ' ';
+        }
       deallog << std::endl;
     }
 
-                                  // make sure all dof indices have
-                                  // actually been used
+  // make sure all dof indices have
+  // actually been used
   for (unsigned int i=0; i<touched.size(); ++i)
     Assert (touched[i] == true, ExcInternalError());
 
index e15e33d6cfcc324eaab330f1199fb63c34c2b730..f9fe30fdfc3e20a4116ae100294a6f0289d6744c 100644 (file)
@@ -66,23 +66,23 @@ get_dofs (const hp::DoFHandler<dim> &dof)
 
 template <int dim>
 void
-check_renumbering(hp::DoFHandler<dim>dof)
+check_renumbering(hp::DoFHandler<dim> &dof)
 {
-                                  // Prepare a reordering of
-                                  // components so that each
-                                  // component maps to its natural
-                                  // block
+  // Prepare a reordering of
+  // components so that each
+  // component maps to its natural
+  // block
   std::vector<unsigned int> order(dof.get_fe().n_components());
   order[0] = 0;
   order[1] = 1;
   order[2] = 1;
 
-                                  // do component-wise and save the
-                                  // results
+  // do component-wise and save the
+  // results
   DoFRenumbering::component_wise (dof, order);
   const std::vector<types::global_dof_index> vc = get_dofs (dof);
 
-                                  // now do the same with blocks
+  // now do the same with blocks
   DoFRenumbering::block_wise (dof);
   const std::vector<types::global_dof_index> vb = get_dofs (dof);
 
@@ -111,15 +111,15 @@ check ()
   {
     bool coin = false;
     for (typename hp::DoFHandler<dim>::active_cell_iterator cell=dof.begin_active();
-        cell != dof.end(); ++cell)
+         cell != dof.end(); ++cell)
       {
-       cell->set_active_fe_index (coin ? 0 : 1);
-       coin = !coin;
+        cell->set_active_fe_index (coin ? 0 : 1);
+        coin = !coin;
       }
   }
 
-                                  // note that the following elements
-                                  // have 3 components but 2 blocks
+  // note that the following elements
+  // have 3 components but 2 blocks
   FESystem<dim> e1 (FE_DGQ<dim>(1), 1, FESystem<dim>(FE_DGQ<dim>(2), 2), 1);
   FESystem<dim> e2 (FE_DGQ<dim>(2), 1, FESystem<dim>(FE_DGQ<dim>(1), 2), 1);
 
index 6f17184219189471917c8bb5995c879831adcbb1..3d1d0e161c084c1678a8b54518ed186070253c63 100644 (file)
@@ -53,7 +53,7 @@ print_dofs (const hp::DoFHandler<dim> &dof)
       deallog << "Cell " << cell << " -- ";
       cell->get_dof_indices (v);
       for (unsigned int i=0; i<v.size(); ++i)
-       deallog << v[i] << ' ';
+        deallog << v[i] << ' ';
       deallog << std::endl;
     }
 }
@@ -62,10 +62,10 @@ print_dofs (const hp::DoFHandler<dim> &dof)
 
 template <int dim>
 void
-check_renumbering(hp::DoFHandler<dim>dof)
+check_renumbering(hp::DoFHandler<dim> &dof)
 {
-                                  // Prepare a reordering of
-                                  // components for later use
+  // Prepare a reordering of
+  // components for later use
   std::vector<unsigned int> order(dof.get_fe().n_components());
   for (unsigned int i=0; i<order.size(); ++i)
     order[i] = order.size()-i-1;
@@ -94,10 +94,10 @@ check ()
   {
     bool coin = false;
     for (typename hp::DoFHandler<dim>::active_cell_iterator cell=dof.begin_active();
-        cell != dof.end(); ++cell)
+         cell != dof.end(); ++cell)
       {
-       cell->set_active_fe_index (coin ? 0 : 1);
-       coin = !coin;
+        cell->set_active_fe_index (coin ? 0 : 1);
+        coin = !coin;
       }
   }
 
index 454a35a48d8437e048e357007ed32bd5bff87fa7..7c0ecec447c4aa551a2ae37a1e17971ce02aeda2 100644 (file)
 template<int dim>
 class MyFunction : public Function<dim>
 {
-  public:
-    MyFunction () : Function<dim>() {};
+public:
+  MyFunction () : Function<dim>() {};
 
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int) const
-      {
-       double f=0.25 + 2 * p[0];
-       if (dim>1)
-         f+=0.772 * p[1];
-       if (dim>2)
-         f-=3.112 * p[2];
-       return f;
-      };
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int) const
+  {
+    double f=0.25 + 2 * p[0];
+    if (dim>1)
+      f+=0.772 * p[1];
+    if (dim>2)
+      f-=3.112 * p[2];
+    return f;
+  };
 };
 
 
@@ -83,9 +83,9 @@ void transfer(std::ostream &out)
   Vector<double> dgq_solution;
   MappingQ1<dim> mapping;
 
-                               // refine a few cells
+  // refine a few cells
   typename Triangulation<dim>::active_cell_iterator cell=tria.begin_active(),
-                                                   endc=tria.end();
+                                                    endc=tria.end();
   ++cell;
   ++cell;
   for (; cell!=endc; ++cell)
@@ -93,23 +93,23 @@ void transfer(std::ostream &out)
   tria.prepare_coarsening_and_refinement();
   tria.execute_coarsening_and_refinement();
 
-                               // randomly assign FE orders
+  // randomly assign FE orders
   unsigned int counter = 0;
   {
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell=q_dof_handler.begin_active(),
-      celldg=dgq_dof_handler.begin_active(),
-      endc=q_dof_handler.end();
+    cell=q_dof_handler.begin_active(),
+    celldg=dgq_dof_handler.begin_active(),
+    endc=q_dof_handler.end();
     for (; cell!=endc; ++cell, ++celldg, ++counter)
       {
-       if (counter < 15)
-         cell->set_active_fe_index(1);
-       else
-         cell->set_active_fe_index(rand()%max_degree);
-       if (counter < 15)
-         celldg->set_active_fe_index(1);
-       else
-         celldg->set_active_fe_index(rand()%max_degree);
+        if (counter < 15)
+          cell->set_active_fe_index(1);
+        else
+          cell->set_active_fe_index(rand()%max_degree);
+        if (counter < 15)
+          celldg->set_active_fe_index(1);
+        else
+          celldg->set_active_fe_index(rand()%max_degree);
       }
   }
 
@@ -128,8 +128,8 @@ void transfer(std::ostream &out)
   SolutionTransfer<dim,Vector<double>,hp::DoFHandler<dim> > dgq_soltrans(dgq_dof_handler);
 
 
-                               // test b): do some coarsening and
-                               // refinement
+  // test b): do some coarsening and
+  // refinement
   q_soltrans.clear();
   dgq_soltrans.clear();
 
@@ -139,15 +139,15 @@ void transfer(std::ostream &out)
   for (; cell!=endc; ++cell, ++counter)
     {
       if (counter > 120)
-       cell->set_coarsen_flag();
+        cell->set_coarsen_flag();
       else if (rand() % 3 == 0)
-       cell->set_refine_flag();
+        cell->set_refine_flag();
       else if (rand() % 3 == 3)
-       cell->set_coarsen_flag();
+        cell->set_coarsen_flag();
     }
 
   Vector<double> q_old_solution=q_solution,
-    dgq_old_solution=dgq_solution;
+                 dgq_old_solution=dgq_solution;
   tria.prepare_coarsening_and_refinement();
   q_soltrans.prepare_for_coarsening_and_refinement(q_old_solution);
   dgq_soltrans.prepare_for_coarsening_and_refinement(dgq_old_solution);
@@ -156,19 +156,19 @@ void transfer(std::ostream &out)
   counter = 0;
   {
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = q_dof_handler.begin_active(),
-      celldg = dgq_dof_handler.begin_active(),
-      endc = q_dof_handler.end();
+    cell = q_dof_handler.begin_active(),
+    celldg = dgq_dof_handler.begin_active(),
+    endc = q_dof_handler.end();
     for (; cell!=endc; ++cell, ++celldg, ++counter)
       {
-       if (counter > 20 && counter < 90)
-         cell->set_active_fe_index(0);
-       else
-         cell->set_active_fe_index(rand()%max_degree);
-       if (counter > 20 && counter < 90)
-         celldg->set_active_fe_index(0);
-       else
-         celldg->set_active_fe_index(rand()%max_degree);
+        if (counter > 20 && counter < 90)
+          cell->set_active_fe_index(0);
+        else
+          cell->set_active_fe_index(rand()%max_degree);
+        if (counter > 20 && counter < 90)
+          celldg->set_active_fe_index(0);
+        else
+          celldg->set_active_fe_index(rand()%max_degree);
       }
   }
 
@@ -179,28 +179,28 @@ void transfer(std::ostream &out)
   q_soltrans.interpolate(q_old_solution, q_solution);
   dgq_soltrans.interpolate(dgq_old_solution, dgq_solution);
 
-                               // check correctness by comparing the values
-                               // on points of QGauss of order 2.
+  // check correctness by comparing the values
+  // on points of QGauss of order 2.
   MyFunction<dim> func;
   {
     double error = 0;
     const hp::QCollection<dim> quad (QGauss<dim> (2));
     hp::FEValues<dim> hp_fe_val (fe_q, quad, update_values |
-                                update_quadrature_points);
+                                 update_quadrature_points);
     std::vector<double> vals (quad[0].size());
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = q_dof_handler.begin_active(),
-      endc = q_dof_handler.end();
+    cell = q_dof_handler.begin_active(),
+    endc = q_dof_handler.end();
     for (; cell!=endc; ++cell)
       {
-       hp_fe_val.reinit (cell, 0);
-       const FEValues<dim> &fe_val = hp_fe_val.get_present_fe_values();
-       fe_val.get_function_values (q_solution, vals);
-       for (unsigned int q=0; q<fe_val.n_quadrature_points; ++q)
-         {
-           error += std::fabs(func.value(fe_val.quadrature_point(q),0)-
-                              vals[q]);
-         }
+        hp_fe_val.reinit (cell, 0);
+        const FEValues<dim> &fe_val = hp_fe_val.get_present_fe_values();
+        fe_val.get_function_values (q_solution, vals);
+        for (unsigned int q=0; q<fe_val.n_quadrature_points; ++q)
+          {
+            error += std::fabs(func.value(fe_val.quadrature_point(q),0)-
+                               vals[q]);
+          }
       }
     deallog << "Error in interpolating hp FE_Q: " << error << std::endl;
   }
@@ -208,21 +208,21 @@ void transfer(std::ostream &out)
     double error = 0;
     const hp::QCollection<dim> quad (QGauss<dim> (2));
     hp::FEValues<dim> hp_fe_val (fe_dgq, quad, update_values |
-                                update_quadrature_points);
+                                 update_quadrature_points);
     std::vector<double> vals (quad[0].size());
     typename hp::DoFHandler<dim>::active_cell_iterator
-      celldg = dgq_dof_handler.begin_active(),
-      endc =  dgq_dof_handler.end();
+    celldg = dgq_dof_handler.begin_active(),
+    endc =  dgq_dof_handler.end();
     for (; celldg!=endc; ++celldg)
       {
-       hp_fe_val.reinit (celldg, 0);
-       const FEValues<dim> &fe_val = hp_fe_val.get_present_fe_values();
-       fe_val.get_function_values (dgq_solution, vals);
-       for (unsigned int q=0; q<fe_val.n_quadrature_points; ++q)
-         {
-           error += std::fabs(func.value(fe_val.quadrature_point(q),0)-
-                              vals[q]);
-         }
+        hp_fe_val.reinit (celldg, 0);
+        const FEValues<dim> &fe_val = hp_fe_val.get_present_fe_values();
+        fe_val.get_function_values (dgq_solution, vals);
+        for (unsigned int q=0; q<fe_val.n_quadrature_points; ++q)
+          {
+            error += std::fabs(func.value(fe_val.quadrature_point(q),0)-
+                               vals[q]);
+          }
       }
     deallog << "Error in interpolating hp FE_DGQ: " << error << std::endl;
   }
index 9aac08eb60cfaac118b36cec02e4710996345418..6a47902c61672d843f9f0c9a5596f430e39cb3c3 100644 (file)
@@ -54,9 +54,9 @@ void transfer(std::ostream &out)
   fe.push_back (FE_Q<dim> (1));
   fe.push_back (FE_Nothing<dim>());
 
-                                  // create a DoFHandler on which we
-                                  // have both cells with FE_Q as
-                                  // well as FE_Nothing
+  // create a DoFHandler on which we
+  // have both cells with FE_Q as
+  // well as FE_Nothing
   hp::DoFHandler<dim> dof_handler(tria);
   dof_handler.begin(0)->child(0)->set_active_fe_index(1);
 
@@ -73,15 +73,15 @@ void transfer(std::ostream &out)
   SolutionTransfer<dim,Vector<double>,hp::DoFHandler<dim> > soltrans(dof_handler);
 
   typename Triangulation<dim>::active_cell_iterator cell=tria.begin_active(),
-                                                   endc=tria.end();
+                                                    endc=tria.end();
   ++cell;
   ++cell;
   for (; cell!=endc; ++cell)
     cell->set_refine_flag();
 
   Vector<double> old_solution=solution;
-                                  // the following line triggered an
-                                  // exception prior to r25670
+  // the following line triggered an
+  // exception prior to r25670
   tria.prepare_coarsening_and_refinement();
   soltrans.prepare_for_coarsening_and_refinement(old_solution);
   tria.execute_coarsening_and_refinement();
index 0c0e8725ecde81c20e8aa1f2a5c46e8542063156..0ca26e6ef2cf9cac2a1af7254a98a49f077c6c04 100644 (file)
@@ -52,7 +52,7 @@ template <int dim>
 void gnuplot_output()
 {
   deallog << "Output of grids into gnuplot files:" << std::endl
-           << "===================================" << std::endl;
+          << "===================================" << std::endl;
 
   Triangulation<dim> triangulation;
   GridGenerator::hyper_ball (triangulation);
@@ -68,18 +68,18 @@ void gnuplot_output()
       filename_base += '0'+refinement;
 
       for (unsigned int degree=1; degree<4; ++degree)
-       {
-         deallog << "Degree = " << degree << std::endl;
+        {
+          deallog << "Degree = " << degree << std::endl;
 
-         const MappingQ<dim> mapping (degree);
+          const MappingQ<dim> mapping (degree);
 
 
-         GridOut grid_out;
-         GridOutFlags::Gnuplot gnuplot_flags(false, 30);
-         grid_out.set_flags(gnuplot_flags);
-  
-         grid_out.write_gnuplot (triangulation, deallog.get_file_stream(), &mapping);
-       }
+          GridOut grid_out;
+          GridOutFlags::Gnuplot gnuplot_flags(false, 30);
+          grid_out.set_flags(gnuplot_flags);
+
+          grid_out.write_gnuplot (triangulation, deallog.get_file_stream(), &mapping);
+        }
       deallog << std::endl;
     }
 }
@@ -88,7 +88,7 @@ template <int dim>
 void compute_pi_by_area ()
 {
   deallog << "Computation of Pi by the area:" << std::endl
-           << "==============================" << std::endl;
+          << "==============================" << std::endl;
 
   const hp::QCollection<dim> quadrature(QGauss<dim>(4));
 
@@ -98,7 +98,7 @@ void compute_pi_by_area ()
 
       Triangulation<dim> triangulation;
       GridGenerator::hyper_ball (triangulation);
-  
+
       static const HyperBallBoundary<dim> boundary;
       triangulation.set_boundary (0, boundary);
 
@@ -110,33 +110,33 @@ void compute_pi_by_area ()
       hp::DoFHandler<dim> dof_handler (triangulation);
 
       hp::FEValues<dim> x_fe_values (mapping, dummy_fe, quadrature,
-                               update_JxW_values);
+                                     update_JxW_values);
 
       ConvergenceTable table;
 
       for (unsigned int refinement=0; refinement<6;
-          ++refinement, triangulation.refine_global (1))
-       {
-         table.add_value("cells", triangulation.n_active_cells());
+           ++refinement, triangulation.refine_global (1))
+        {
+          table.add_value("cells", triangulation.n_active_cells());
 
-         dof_handler.distribute_dofs (dummy_fe);
+          dof_handler.distribute_dofs (dummy_fe);
 
-         long double area = 0;
+          long double area = 0;
 
-         typename hp::DoFHandler<dim>::active_cell_iterator
-           cell = dof_handler.begin_active(),
-           endc = dof_handler.end();
-         for (; cell!=endc; ++cell)
-           {
-             x_fe_values.reinit (cell);
-             const FEValues<dim> &fe_values = x_fe_values.get_present_fe_values();
-             for (unsigned int i=0; i<fe_values.n_quadrature_points; ++i)
-               area += fe_values.JxW (i);
-           };
+          typename hp::DoFHandler<dim>::active_cell_iterator
+          cell = dof_handler.begin_active(),
+          endc = dof_handler.end();
+          for (; cell!=endc; ++cell)
+            {
+              x_fe_values.reinit (cell);
+              const FEValues<dim> &fe_values = x_fe_values.get_present_fe_values();
+              for (unsigned int i=0; i<fe_values.n_quadrature_points; ++i)
+                area += fe_values.JxW (i);
+            };
 
-         table.add_value("eval.pi", static_cast<double> (area));
-         table.add_value("error",   static_cast<double> (std::fabs(area-pi)));
-       };
+          table.add_value("eval.pi", static_cast<double> (area));
+          table.add_value("error",   static_cast<double> (std::fabs(area-pi)));
+        };
 
       table.omit_column_from_convergence_rate_evaluation("cells");
       table.omit_column_from_convergence_rate_evaluation("eval.pi");
@@ -156,7 +156,7 @@ template <int dim>
 void compute_pi_by_perimeter ()
 {
   deallog << "Computation of Pi by the perimeter:" << std::endl
-           << "===================================" << std::endl;
+          << "===================================" << std::endl;
 
   const hp::QCollection<dim-1> quadrature(QGauss<dim-1>(4));
 
@@ -165,7 +165,7 @@ void compute_pi_by_perimeter ()
       deallog << "Degree = " << degree << std::endl;
       Triangulation<dim> triangulation;
       GridGenerator::hyper_ball (triangulation);
-  
+
       static const HyperBallBoundary<dim> boundary;
       triangulation.set_boundary (0, boundary);
 
@@ -176,34 +176,34 @@ void compute_pi_by_perimeter ()
       hp::DoFHandler<dim> dof_handler (triangulation);
 
       hp::FEFaceValues<dim> x_fe_face_values (mapping, fe, quadrature,
-                                        update_JxW_values);
+                                              update_JxW_values);
       ConvergenceTable table;
 
       for (unsigned int refinement=0; refinement<6;
-          ++refinement, triangulation.refine_global (1))
-       {
-         table.add_value("cells", triangulation.n_active_cells());
-
-         dof_handler.distribute_dofs (fe);
-
-         typename hp::DoFHandler<dim>::active_cell_iterator
-           cell = dof_handler.begin_active(),
-           endc = dof_handler.end();
-         long double perimeter = 0;
-         for (; cell!=endc; ++cell)
-           for (unsigned int face_no=0; face_no<GeometryInfo<dim>::faces_per_cell; ++face_no)
-             if (cell->face(face_no)->at_boundary())
-               {
-                 x_fe_face_values.reinit (cell, face_no);
-                 const FEFaceValues<dim> &fe_face_values
-                   = x_fe_face_values.get_present_fe_values ();
-                 
-                 for (unsigned int i=0; i<fe_face_values.n_quadrature_points; ++i)
-                   perimeter += fe_face_values.JxW (i);
-               };
-         table.add_value("eval.pi", static_cast<double> (perimeter/2.));
-         table.add_value("error",   static_cast<double> (std::fabs(perimeter/2.-pi)));
-       };
+           ++refinement, triangulation.refine_global (1))
+        {
+          table.add_value("cells", triangulation.n_active_cells());
+
+          dof_handler.distribute_dofs (fe);
+
+          typename hp::DoFHandler<dim>::active_cell_iterator
+          cell = dof_handler.begin_active(),
+          endc = dof_handler.end();
+          long double perimeter = 0;
+          for (; cell!=endc; ++cell)
+            for (unsigned int face_no=0; face_no<GeometryInfo<dim>::faces_per_cell; ++face_no)
+              if (cell->face(face_no)->at_boundary())
+                {
+                  x_fe_face_values.reinit (cell, face_no);
+                  const FEFaceValues<dim> &fe_face_values
+                    = x_fe_face_values.get_present_fe_values ();
+
+                  for (unsigned int i=0; i<fe_face_values.n_quadrature_points; ++i)
+                    perimeter += fe_face_values.JxW (i);
+                };
+          table.add_value("eval.pi", static_cast<double> (perimeter/2.));
+          table.add_value("error",   static_cast<double> (std::fabs(perimeter/2.-pi)));
+        };
 
       table.omit_column_from_convergence_rate_evaluation("cells");
       table.omit_column_from_convergence_rate_evaluation("eval.pi");
@@ -219,18 +219,18 @@ void compute_pi_by_perimeter ()
 }
 
 
-int main () 
+int main ()
 {
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   gnuplot_output<2>();
 
   compute_pi_by_area<2> ();
   compute_pi_by_perimeter<2> ();
-  
+
   return 0;
 }
index 8178a50be0be0cf357a1fdcbc86134707f82f1ea..0a39ecffe36370c222e4fd022f22709a3da32805 100644 (file)
@@ -57,44 +57,44 @@ std::ofstream logfile("step-11/output");
 
 
 template <int dim>
-class LaplaceProblem 
+class LaplaceProblem
 {
-  public:
-    LaplaceProblem (const unsigned int mapping_degree);
-    void run ();
-    
-  private:
-    void setup_system ();
-    void assemble_and_solve ();
-    void solve ();
-
-    Triangulation<dim>   triangulation;
-    hp::FECollection<dim>            fe;
-    hp::DoFHandler<dim>      dof_handler;
-    hp::MappingCollection<dim>        mapping;
-
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> system_matrix;
-    ConstraintMatrix     mean_value_constraints;
-
-    Vector<double>       solution;
-    Vector<double>       system_rhs;
-
-    TableHandler         output_table;
+public:
+  LaplaceProblem (const unsigned int mapping_degree);
+  void run ();
+
+private:
+  void setup_system ();
+  void assemble_and_solve ();
+  void solve ();
+
+  Triangulation<dim>   triangulation;
+  hp::FECollection<dim>            fe;
+  hp::DoFHandler<dim>      dof_handler;
+  hp::MappingCollection<dim>        mapping;
+
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> system_matrix;
+  ConstraintMatrix     mean_value_constraints;
+
+  Vector<double>       solution;
+  Vector<double>       system_rhs;
+
+  TableHandler         output_table;
 };
 
 
 
 template <int dim>
 LaplaceProblem<dim>::LaplaceProblem (const unsigned int mapping_degree) :
-                fe (FE_Q<dim>(1)),
-               dof_handler (triangulation),
-               mapping (MappingQ<dim>(mapping_degree))
+  fe (FE_Q<dim>(1)),
+  dof_handler (triangulation),
+  mapping (MappingQ<dim>(mapping_degree))
 {
   deallog << "Using mapping with degree " << mapping_degree << ":"
-           << std::endl
-           << "============================"
-           << std::endl;
+          << std::endl
+          << "============================"
+          << std::endl;
 }
 
 
@@ -108,24 +108,24 @@ void LaplaceProblem<dim>::setup_system ()
 
   std::vector<bool> boundary_dofs (dof_handler.n_dofs(), false);
   DoFTools::extract_boundary_dofs (dof_handler, std::vector<bool>(1,true),
-                                  boundary_dofs);
+                                   boundary_dofs);
 
   const unsigned int first_boundary_dof
     = std::distance (boundary_dofs.begin(),
-                    std::find (boundary_dofs.begin(),
-                               boundary_dofs.end(),
-                               true));
+                     std::find (boundary_dofs.begin(),
+                                boundary_dofs.end(),
+                                true));
 
   mean_value_constraints.clear ();
   mean_value_constraints.add_line (first_boundary_dof);
   for (unsigned int i=first_boundary_dof+1; i<dof_handler.n_dofs(); ++i)
     if (boundary_dofs[i] == true)
       mean_value_constraints.add_entry (first_boundary_dof,
-                                       i, -1);
+                                        i, -1);
   mean_value_constraints.close ();
 
   CompressedSparsityPattern csp (dof_handler.n_dofs(),
-                                dof_handler.n_dofs());
+                                 dof_handler.n_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, csp);
   mean_value_constraints.condense (csp);
 
@@ -136,39 +136,39 @@ void LaplaceProblem<dim>::setup_system ()
 
 
 template <int dim>
-void LaplaceProblem<dim>::assemble_and_solve () 
+void LaplaceProblem<dim>::assemble_and_solve ()
 {
 
   const unsigned int gauss_degree
     = std::max (static_cast<unsigned int>(std::ceil(1.*(static_cast<const MappingQ<dim>&>(mapping[0]).get_degree()+1)/2)),
-               2U);
+                2U);
   MatrixTools::create_laplace_matrix (mapping, dof_handler,
-                                     hp::QCollection<dim>(QGauss<dim>(gauss_degree)),
-                                     system_matrix);
+                                      hp::QCollection<dim>(QGauss<dim>(gauss_degree)),
+                                      system_matrix);
   VectorTools::create_right_hand_side (mapping, dof_handler,
-                                      hp::QCollection<dim>(QGauss<dim>(gauss_degree)),
-                                      ConstantFunction<dim>(-2),
-                                      system_rhs);
+                                       hp::QCollection<dim>(QGauss<dim>(gauss_degree)),
+                                       ConstantFunction<dim>(-2),
+                                       system_rhs);
   Vector<double> tmp (system_rhs.size());
   VectorTools::create_boundary_right_hand_side (mapping, dof_handler,
-                                               hp::QCollection<dim-1>(QGauss<dim-1>(gauss_degree)),
-                                               ConstantFunction<dim>(1),
-                                               tmp);
+                                                hp::QCollection<dim-1>(QGauss<dim-1>(gauss_degree)),
+                                                ConstantFunction<dim>(1),
+                                                tmp);
   system_rhs += tmp;
 
   mean_value_constraints.condense (system_matrix);
-  mean_value_constraints.condense (system_rhs);  
+  mean_value_constraints.condense (system_rhs);
 
   solve ();
   mean_value_constraints.distribute (solution);
 
   Vector<float> norm_per_cell (triangulation.n_active_cells());
   VectorTools::integrate_difference (mapping, dof_handler,
-                                    solution,
-                                    ZeroFunction<dim>(),
-                                    norm_per_cell,
-                                    hp::QCollection<dim>(QGauss<dim>(gauss_degree+1)),
-                                    VectorTools::H1_seminorm);
+                                     solution,
+                                     ZeroFunction<dim>(),
+                                     norm_per_cell,
+                                     hp::QCollection<dim>(QGauss<dim>(gauss_degree+1)),
+                                     VectorTools::H1_seminorm);
   const double norm = norm_per_cell.l2_norm();
 
   output_table.add_value ("cells", triangulation.n_active_cells());
@@ -179,7 +179,7 @@ void LaplaceProblem<dim>::assemble_and_solve ()
 
 
 template <int dim>
-void LaplaceProblem<dim>::solve () 
+void LaplaceProblem<dim>::solve ()
 {
   SolverControl           solver_control (1000, 1e-12);
   SolverCG<>              cg (solver_control);
@@ -188,18 +188,18 @@ void LaplaceProblem<dim>::solve ()
   preconditioner.initialize(system_matrix, 1.2);
 
   cg.solve (system_matrix, solution, system_rhs,
-           preconditioner);
+            preconditioner);
 }
 
 
 
 template <int dim>
-void LaplaceProblem<dim>::run () 
+void LaplaceProblem<dim>::run ()
 {
   GridGenerator::hyper_ball (triangulation);
   static const HyperBallBoundary<dim> boundary;
   triangulation.set_boundary (0, boundary);
-  
+
   for (unsigned int cycle=0; cycle<6; ++cycle, triangulation.refine_global(1))
     {
       setup_system ();
@@ -212,9 +212,9 @@ void LaplaceProblem<dim>::run ()
   deallog << std::endl;
 }
 
-    
 
-int main () 
+
+int main ()
 {
   try
     {
@@ -223,32 +223,32 @@ int main ()
 
       deallog.attach(logfile);
       deallog.depth_console(0);
-      deallog.threshold_double(1.e-10);  
+      deallog.threshold_double(1.e-10);
 
       for (unsigned int mapping_degree=1; mapping_degree<=3; ++mapping_degree)
-       LaplaceProblem<2>(mapping_degree).run ();
+        LaplaceProblem<2>(mapping_degree).run ();
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 
index bd299b18f61651331898d00c9a62ab5acda1869b..fe750f54a7b2ae8665c410a64585a1abdfc69842 100644 (file)
@@ -60,44 +60,44 @@ std::ofstream logfile("step-11_compressed_set_sparsity/output");
 
 
 template <int dim>
-class LaplaceProblem 
+class LaplaceProblem
 {
-  public:
-    LaplaceProblem (const unsigned int mapping_degree);
-    void run ();
-    
-  private:
-    void setup_system ();
-    void assemble_and_solve ();
-    void solve ();
-
-    Triangulation<dim>   triangulation;
-    hp::FECollection<dim>            fe;
-    hp::DoFHandler<dim>      dof_handler;
-    hp::MappingCollection<dim>        mapping;
-
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> system_matrix;
-    ConstraintMatrix     mean_value_constraints;
-
-    Vector<double>       solution;
-    Vector<double>       system_rhs;
-
-    TableHandler         output_table;
+public:
+  LaplaceProblem (const unsigned int mapping_degree);
+  void run ();
+
+private:
+  void setup_system ();
+  void assemble_and_solve ();
+  void solve ();
+
+  Triangulation<dim>   triangulation;
+  hp::FECollection<dim>            fe;
+  hp::DoFHandler<dim>      dof_handler;
+  hp::MappingCollection<dim>        mapping;
+
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> system_matrix;
+  ConstraintMatrix     mean_value_constraints;
+
+  Vector<double>       solution;
+  Vector<double>       system_rhs;
+
+  TableHandler         output_table;
 };
 
 
 
 template <int dim>
 LaplaceProblem<dim>::LaplaceProblem (const unsigned int mapping_degree) :
-                fe (FE_Q<dim>(1)),
-               dof_handler (triangulation),
-               mapping (MappingQ<dim>(mapping_degree))
+  fe (FE_Q<dim>(1)),
+  dof_handler (triangulation),
+  mapping (MappingQ<dim>(mapping_degree))
 {
   deallog << "Using mapping with degree " << mapping_degree << ":"
-           << std::endl
-           << "============================"
-           << std::endl;
+          << std::endl
+          << "============================"
+          << std::endl;
 }
 
 
@@ -111,24 +111,24 @@ void LaplaceProblem<dim>::setup_system ()
 
   std::vector<bool> boundary_dofs (dof_handler.n_dofs(), false);
   DoFTools::extract_boundary_dofs (dof_handler, std::vector<bool>(1,true),
-                                  boundary_dofs);
+                                   boundary_dofs);
 
   const unsigned int first_boundary_dof
     = std::distance (boundary_dofs.begin(),
-                    std::find (boundary_dofs.begin(),
-                               boundary_dofs.end(),
-                               true));
+                     std::find (boundary_dofs.begin(),
+                                boundary_dofs.end(),
+                                true));
 
   mean_value_constraints.clear ();
   mean_value_constraints.add_line (first_boundary_dof);
   for (unsigned int i=first_boundary_dof+1; i<dof_handler.n_dofs(); ++i)
     if (boundary_dofs[i] == true)
       mean_value_constraints.add_entry (first_boundary_dof,
-                                       i, -1);
+                                        i, -1);
   mean_value_constraints.close ();
 
   CompressedSetSparsityPattern csp (dof_handler.n_dofs(),
-                                dof_handler.n_dofs());
+                                    dof_handler.n_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, csp);
   mean_value_constraints.condense (csp);
 
@@ -139,39 +139,39 @@ void LaplaceProblem<dim>::setup_system ()
 
 
 template <int dim>
-void LaplaceProblem<dim>::assemble_and_solve () 
+void LaplaceProblem<dim>::assemble_and_solve ()
 {
 
   const unsigned int gauss_degree
     = std::max (static_cast<unsigned int>(std::ceil(1.*(static_cast<const MappingQ<dim>&>(mapping[0]).get_degree()+1)/2)),
-               2U);
+                2U);
   MatrixTools::create_laplace_matrix (mapping, dof_handler,
-                                     hp::QCollection<dim>(QGauss<dim>(gauss_degree)),
-                                     system_matrix);
+                                      hp::QCollection<dim>(QGauss<dim>(gauss_degree)),
+                                      system_matrix);
   VectorTools::create_right_hand_side (mapping, dof_handler,
-                                      hp::QCollection<dim>(QGauss<dim>(gauss_degree)),
-                                      ConstantFunction<dim>(-2),
-                                      system_rhs);
+                                       hp::QCollection<dim>(QGauss<dim>(gauss_degree)),
+                                       ConstantFunction<dim>(-2),
+                                       system_rhs);
   Vector<double> tmp (system_rhs.size());
   VectorTools::create_boundary_right_hand_side (mapping, dof_handler,
-                                               hp::QCollection<dim-1>(QGauss<dim-1>(gauss_degree)),
-                                               ConstantFunction<dim>(1),
-                                               tmp);
+                                                hp::QCollection<dim-1>(QGauss<dim-1>(gauss_degree)),
+                                                ConstantFunction<dim>(1),
+                                                tmp);
   system_rhs += tmp;
 
   mean_value_constraints.condense (system_matrix);
-  mean_value_constraints.condense (system_rhs);  
+  mean_value_constraints.condense (system_rhs);
 
   solve ();
   mean_value_constraints.distribute (solution);
 
   Vector<float> norm_per_cell (triangulation.n_active_cells());
   VectorTools::integrate_difference (mapping, dof_handler,
-                                    solution,
-                                    ZeroFunction<dim>(),
-                                    norm_per_cell,
-                                    hp::QCollection<dim>(QGauss<dim>(gauss_degree+1)),
-                                    VectorTools::H1_seminorm);
+                                     solution,
+                                     ZeroFunction<dim>(),
+                                     norm_per_cell,
+                                     hp::QCollection<dim>(QGauss<dim>(gauss_degree+1)),
+                                     VectorTools::H1_seminorm);
   const double norm = norm_per_cell.l2_norm();
 
   output_table.add_value ("cells", triangulation.n_active_cells());
@@ -182,7 +182,7 @@ void LaplaceProblem<dim>::assemble_and_solve ()
 
 
 template <int dim>
-void LaplaceProblem<dim>::solve () 
+void LaplaceProblem<dim>::solve ()
 {
   SolverControl           solver_control (1000, 1e-12);
   SolverCG<>              cg (solver_control);
@@ -191,18 +191,18 @@ void LaplaceProblem<dim>::solve ()
   preconditioner.initialize(system_matrix, 1.2);
 
   cg.solve (system_matrix, solution, system_rhs,
-           preconditioner);
+            preconditioner);
 }
 
 
 
 template <int dim>
-void LaplaceProblem<dim>::run () 
+void LaplaceProblem<dim>::run ()
 {
   GridGenerator::hyper_ball (triangulation);
   static const HyperBallBoundary<dim> boundary;
   triangulation.set_boundary (0, boundary);
-  
+
   for (unsigned int cycle=0; cycle<6; ++cycle, triangulation.refine_global(1))
     {
       setup_system ();
@@ -215,43 +215,43 @@ void LaplaceProblem<dim>::run ()
   deallog << std::endl;
 }
 
-    
 
-int main () 
+
+int main ()
 {
   try
     {
       logfile.precision(2);
       deallog << std::setprecision(2);
-      
+
       deallog.attach(logfile);
       deallog.depth_console(0);
-      deallog.threshold_double(1.e-10);  
+      deallog.threshold_double(1.e-10);
 
       for (unsigned int mapping_degree=1; mapping_degree<=3; ++mapping_degree)
-       LaplaceProblem<2>(mapping_degree).run ();
+        LaplaceProblem<2>(mapping_degree).run ();
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 
index 508527f8a24e28631abdf98e18f550111ea93725..994e7ae7497a54cdebdd6eca54d08a55108736b7 100644 (file)
@@ -54,40 +54,40 @@ std::ofstream logfile("step-12/output");
 template <int dim>
 class RHS:  public Function<dim>
 {
-  public:
-    virtual void value_list (const std::vector<Point<dim> > &points,
-                            std::vector<double> &values,
-                            const unsigned int component=0) const;
+public:
+  virtual void value_list (const std::vector<Point<dim> > &points,
+                           std::vector<double> &values,
+                           const unsigned int component=0) const;
 };
 
 
 template <int dim>
 class BoundaryValues:  public Function<dim>
 {
-  public:
-    virtual void value_list (const std::vector<Point<dim> > &points,
-                            std::vector<double> &values,
-                            const unsigned int component=0) const;
+public:
+  virtual void value_list (const std::vector<Point<dim> > &points,
+                           std::vector<double> &values,
+                           const unsigned int component=0) const;
 };
 
 
 template <int dim>
 class Beta
 {
-  public:
-    Beta () {}
-    void value_list (const std::vector<Point<dim> > &points,
-                    std::vector<Point<dim> > &values) const;
+public:
+  Beta () {}
+  void value_list (const std::vector<Point<dim> > &points,
+                   std::vector<Point<dim> > &values) const;
 };
 
 
 template <int dim>
 void RHS<dim>::value_list(const std::vector<Point<dim> > &points,
-                         std::vector<double> &values,
-                         const unsigned int) const
+                          std::vector<double> &values,
+                          const unsigned int) const
 {
   Assert(values.size()==points.size(),
-        ExcDimensionMismatch(values.size(),points.size()));
+         ExcDimensionMismatch(values.size(),points.size()));
 
   for (unsigned int i=0; i<values.size(); ++i)
     values[i]=0;
@@ -96,10 +96,10 @@ void RHS<dim>::value_list(const std::vector<Point<dim> > &points,
 
 template <int dim>
 void Beta<dim>::value_list(const std::vector<Point<dim> > &points,
-                          std::vector<Point<dim> > &values) const
+                           std::vector<Point<dim> > &values) const
 {
   Assert(values.size()==points.size(),
-        ExcDimensionMismatch(values.size(),points.size()));
+         ExcDimensionMismatch(values.size(),points.size()));
 
   for (unsigned int i=0; i<points.size(); ++i)
     {
@@ -115,18 +115,18 @@ void Beta<dim>::value_list(const std::vector<Point<dim> > &points,
 
 template <int dim>
 void BoundaryValues<dim>::value_list(const std::vector<Point<dim> > &points,
-                                      std::vector<double> &values,
-                                      const unsigned int) const
+                                     std::vector<double> &values,
+                                     const unsigned int) const
 {
   Assert(values.size()==points.size(),
-        ExcDimensionMismatch(values.size(),points.size()));
+         ExcDimensionMismatch(values.size(),points.size()));
 
   for (unsigned int i=0; i<values.size(); ++i)
     {
       if (points[i](0)<0.5)
-       values[i]=1.;
+        values[i]=1.;
       else
-       values[i]=0.;
+        values[i]=0.;
     }
 }
 
@@ -134,43 +134,43 @@ void BoundaryValues<dim>::value_list(const std::vector<Point<dim> > &points,
 template <int dim>
 class DGTransportEquation
 {
-  public:
-    DGTransportEquation();
-
-    void assemble_cell_term(const hp::FEValues<dim>& fe_v,
-                           FullMatrix<double> &ui_vi_matrix,
-                           Vector<double> &cell_vector) const;
-    
-    void assemble_boundary_term(const hp::FEFaceValues<dim>& fe_v,
-                               FullMatrix<double> &ui_vi_matrix,
-                               Vector<double> &cell_vector) const;
-
-    template <class X, class Y>
-    void assemble_face_term1(const X& fe_v,
-                            const Y& fe_v_neighbor,
-                            FullMatrix<double> &ui_vi_matrix,
-                            FullMatrix<double> &ue_vi_matrix) const;
-
-    template <class X, class Y>
-    void assemble_face_term2(const X& fe_v,
-                            const Y& fe_v_neighbor,
-                            FullMatrix<double> &ui_vi_matrix,
-                            FullMatrix<double> &ue_vi_matrix,
-                            FullMatrix<double> &ui_ve_matrix,
-                            FullMatrix<double> &ue_ve_matrix) const;
-  private:
-    const Beta<dim> beta_function;
-    const RHS<dim> rhs_function;
-    const BoundaryValues<dim> boundary_function;
+public:
+  DGTransportEquation();
+
+  void assemble_cell_term(const hp::FEValues<dim> &fe_v,
+                          FullMatrix<double> &ui_vi_matrix,
+                          Vector<double> &cell_vector) const;
+
+  void assemble_boundary_term(const hp::FEFaceValues<dim> &fe_v,
+                              FullMatrix<double> &ui_vi_matrix,
+                              Vector<double> &cell_vector) const;
+
+  template <class X, class Y>
+  void assemble_face_term1(const X &fe_v,
+                           const Y &fe_v_neighbor,
+                           FullMatrix<double> &ui_vi_matrix,
+                           FullMatrix<double> &ue_vi_matrix) const;
+
+  template <class X, class Y>
+  void assemble_face_term2(const X &fe_v,
+                           const Y &fe_v_neighbor,
+                           FullMatrix<double> &ui_vi_matrix,
+                           FullMatrix<double> &ue_vi_matrix,
+                           FullMatrix<double> &ui_ve_matrix,
+                           FullMatrix<double> &ue_ve_matrix) const;
+private:
+  const Beta<dim> beta_function;
+  const RHS<dim> rhs_function;
+  const BoundaryValues<dim> boundary_function;
 };
 
 
 template <int dim>
 DGTransportEquation<dim>::DGTransportEquation ()
-               :
-               beta_function (),
-               rhs_function (),
-               boundary_function ()
+  :
+  beta_function (),
+  rhs_function (),
+  boundary_function ()
 {}
 
 
@@ -184,26 +184,26 @@ void DGTransportEquation<dim>::assemble_cell_term(
 
   std::vector<Point<dim> > beta (fe_v.get_present_fe_values().n_quadrature_points);
   std::vector<double> rhs (fe_v.get_present_fe_values().n_quadrature_points);
-  
+
   beta_function.value_list (fe_v.get_present_fe_values().get_quadrature_points(), beta);
   rhs_function.value_list (fe_v.get_present_fe_values().get_quadrature_points(), rhs);
-  
+
   for (unsigned int point=0; point<fe_v.get_present_fe_values().n_quadrature_points; ++point)
-    for (unsigned int i=0; i<fe_v.get_present_fe_values().dofs_per_cell; ++i) 
+    for (unsigned int i=0; i<fe_v.get_present_fe_values().dofs_per_cell; ++i)
       {
-       for (unsigned int j=0; j<fe_v.get_present_fe_values().dofs_per_cell; ++j)
-         ui_vi_matrix(i,j) -= beta[point]*fe_v.get_present_fe_values().shape_grad(i,point)*
-                             fe_v.get_present_fe_values().shape_value(j,point) *
-                             JxW[point];
-       
-       cell_vector(i) += rhs[point] * fe_v.get_present_fe_values().shape_value(i,point) * JxW[point];
+        for (unsigned int j=0; j<fe_v.get_present_fe_values().dofs_per_cell; ++j)
+          ui_vi_matrix(i,j) -= beta[point]*fe_v.get_present_fe_values().shape_grad(i,point)*
+                               fe_v.get_present_fe_values().shape_value(j,point) *
+                               JxW[point];
+
+        cell_vector(i) += rhs[point] * fe_v.get_present_fe_values().shape_value(i,point) * JxW[point];
       }
 }
 
 
 template <int dim>
 void DGTransportEquation<dim>::assemble_boundary_term(
-  const hp::FEFaceValues<dim>& fe_v,    
+  const hp::FEFaceValues<dim> &fe_v,
   FullMatrix<double> &ui_vi_matrix,
   Vector<double> &cell_vector) const
 {
@@ -212,26 +212,26 @@ void DGTransportEquation<dim>::assemble_boundary_term(
 
   std::vector<Point<dim> > beta (fe_v.get_present_fe_values().n_quadrature_points);
   std::vector<double> g(fe_v.get_present_fe_values().n_quadrature_points);
-  
+
   beta_function.value_list (fe_v.get_present_fe_values().get_quadrature_points(), beta);
   boundary_function.value_list (fe_v.get_present_fe_values().get_quadrature_points(), g);
 
   for (unsigned int point=0; point<fe_v.get_present_fe_values().n_quadrature_points; ++point)
     {
-      const double beta_n=beta[point] * normals[point];      
+      const double beta_n=beta[point] * normals[point];
       if (beta_n>0)
-       for (unsigned int i=0; i<fe_v.get_present_fe_values().dofs_per_cell; ++i)
-         for (unsigned int j=0; j<fe_v.get_present_fe_values().dofs_per_cell; ++j)
-           ui_vi_matrix(i,j) += beta_n *
-                              fe_v.get_present_fe_values().shape_value(j,point) *
-                              fe_v.get_present_fe_values().shape_value(i,point) *
-                              JxW[point];
+        for (unsigned int i=0; i<fe_v.get_present_fe_values().dofs_per_cell; ++i)
+          for (unsigned int j=0; j<fe_v.get_present_fe_values().dofs_per_cell; ++j)
+            ui_vi_matrix(i,j) += beta_n *
+                                 fe_v.get_present_fe_values().shape_value(j,point) *
+                                 fe_v.get_present_fe_values().shape_value(i,point) *
+                                 JxW[point];
       else
-       for (unsigned int i=0; i<fe_v.get_present_fe_values().dofs_per_cell; ++i)
-         cell_vector(i) -= beta_n *
-                           g[point] *
-                           fe_v.get_present_fe_values().shape_value(i,point) *
-                           JxW[point];
+        for (unsigned int i=0; i<fe_v.get_present_fe_values().dofs_per_cell; ++i)
+          cell_vector(i) -= beta_n *
+                            g[point] *
+                            fe_v.get_present_fe_values().shape_value(i,point) *
+                            JxW[point];
     }
 }
 
@@ -239,8 +239,8 @@ void DGTransportEquation<dim>::assemble_boundary_term(
 template <int dim>
 template <class X, class Y>
 void DGTransportEquation<dim>::assemble_face_term1(
-  const Xfe_v,
-  const Y& fe_v_neighbor,      
+  const X &fe_v,
+  const Y &fe_v_neighbor,
   FullMatrix<double> &ui_vi_matrix,
   FullMatrix<double> &ue_vi_matrix) const
 {
@@ -254,19 +254,19 @@ void DGTransportEquation<dim>::assemble_face_term1(
     {
       const double beta_n=beta[point] * normals[point];
       if (beta_n>0)
-       for (unsigned int i=0; i<fe_v.get_present_fe_values().dofs_per_cell; ++i)
-         for (unsigned int j=0; j<fe_v.get_present_fe_values().dofs_per_cell; ++j)
-           ui_vi_matrix(i,j) += beta_n *
-                              fe_v.get_present_fe_values().shape_value(j,point) *
-                              fe_v.get_present_fe_values().shape_value(i,point) *
-                              JxW[point];
+        for (unsigned int i=0; i<fe_v.get_present_fe_values().dofs_per_cell; ++i)
+          for (unsigned int j=0; j<fe_v.get_present_fe_values().dofs_per_cell; ++j)
+            ui_vi_matrix(i,j) += beta_n *
+                                 fe_v.get_present_fe_values().shape_value(j,point) *
+                                 fe_v.get_present_fe_values().shape_value(i,point) *
+                                 JxW[point];
       else
-       for (unsigned int i=0; i<fe_v.get_present_fe_values().dofs_per_cell; ++i)
-         for (unsigned int k=0; k<fe_v_neighbor.get_present_fe_values().dofs_per_cell; ++k)
-           ue_vi_matrix(i,k) += beta_n *
-                               fe_v_neighbor.get_present_fe_values().shape_value(k,point) *
-                               fe_v.get_present_fe_values().shape_value(i,point) *
-                               JxW[point];
+        for (unsigned int i=0; i<fe_v.get_present_fe_values().dofs_per_cell; ++i)
+          for (unsigned int k=0; k<fe_v_neighbor.get_present_fe_values().dofs_per_cell; ++k)
+            ue_vi_matrix(i,k) += beta_n *
+                                 fe_v_neighbor.get_present_fe_values().shape_value(k,point) *
+                                 fe_v.get_present_fe_values().shape_value(i,point) *
+                                 JxW[point];
     }
 }
 
@@ -274,8 +274,8 @@ void DGTransportEquation<dim>::assemble_face_term1(
 template <int dim>
 template <class X, class Y>
 void DGTransportEquation<dim>::assemble_face_term2(
-  const Xfe_v,
-  const Y& fe_v_neighbor,      
+  const X &fe_v,
+  const Y &fe_v_neighbor,
   FullMatrix<double> &ui_vi_matrix,
   FullMatrix<double> &ue_vi_matrix,
   FullMatrix<double> &ui_ve_matrix,
@@ -285,44 +285,44 @@ void DGTransportEquation<dim>::assemble_face_term2(
   const std::vector<Point<dim> > &normals = fe_v.get_present_fe_values().get_normal_vectors ();
 
   std::vector<Point<dim> > beta (fe_v.get_present_fe_values().n_quadrature_points);
-  
+
   beta_function.value_list (fe_v.get_present_fe_values().get_quadrature_points(), beta);
 
   for (unsigned int point=0; point<fe_v.get_present_fe_values().n_quadrature_points; ++point)
     {
       const double beta_n=beta[point] * normals[point];
       if (beta_n>0)
-       {
-         for (unsigned int i=0; i<fe_v.get_present_fe_values().dofs_per_cell; ++i)
-           for (unsigned int j=0; j<fe_v.get_present_fe_values().dofs_per_cell; ++j)
-             ui_vi_matrix(i,j) += beta_n *
-                                fe_v.get_present_fe_values().shape_value(j,point) *
-                                fe_v.get_present_fe_values().shape_value(i,point) *
-                                JxW[point];
-
-         for (unsigned int k=0; k<fe_v_neighbor.get_present_fe_values().dofs_per_cell; ++k)
-           for (unsigned int j=0; j<fe_v.get_present_fe_values().dofs_per_cell; ++j)
-             ui_ve_matrix(k,j) -= beta_n *
-                                 fe_v.get_present_fe_values().shape_value(j,point) *
-                                 fe_v_neighbor.get_present_fe_values().shape_value(k,point) *
-                                 JxW[point];
-       }
+        {
+          for (unsigned int i=0; i<fe_v.get_present_fe_values().dofs_per_cell; ++i)
+            for (unsigned int j=0; j<fe_v.get_present_fe_values().dofs_per_cell; ++j)
+              ui_vi_matrix(i,j) += beta_n *
+                                   fe_v.get_present_fe_values().shape_value(j,point) *
+                                   fe_v.get_present_fe_values().shape_value(i,point) *
+                                   JxW[point];
+
+          for (unsigned int k=0; k<fe_v_neighbor.get_present_fe_values().dofs_per_cell; ++k)
+            for (unsigned int j=0; j<fe_v.get_present_fe_values().dofs_per_cell; ++j)
+              ui_ve_matrix(k,j) -= beta_n *
+                                   fe_v.get_present_fe_values().shape_value(j,point) *
+                                   fe_v_neighbor.get_present_fe_values().shape_value(k,point) *
+                                   JxW[point];
+        }
       else
-       {
-         for (unsigned int i=0; i<fe_v.get_present_fe_values().dofs_per_cell; ++i)
-           for (unsigned int l=0; l<fe_v_neighbor.get_present_fe_values().dofs_per_cell; ++l)
-             ue_vi_matrix(i,l) += beta_n *
-                                 fe_v_neighbor.get_present_fe_values().shape_value(l,point) *
-                                 fe_v.get_present_fe_values().shape_value(i,point) *
-                                 JxW[point];
-
-         for (unsigned int k=0; k<fe_v_neighbor.get_present_fe_values().dofs_per_cell; ++k)
-           for (unsigned int l=0; l<fe_v_neighbor.get_present_fe_values().dofs_per_cell; ++l)
-             ue_ve_matrix(k,l) -= beta_n *
-                                  fe_v_neighbor.get_present_fe_values().shape_value(l,point) *
-                                  fe_v_neighbor.get_present_fe_values().shape_value(k,point) *
-                                  JxW[point];
-       }
+        {
+          for (unsigned int i=0; i<fe_v.get_present_fe_values().dofs_per_cell; ++i)
+            for (unsigned int l=0; l<fe_v_neighbor.get_present_fe_values().dofs_per_cell; ++l)
+              ue_vi_matrix(i,l) += beta_n *
+                                   fe_v_neighbor.get_present_fe_values().shape_value(l,point) *
+                                   fe_v.get_present_fe_values().shape_value(i,point) *
+                                   JxW[point];
+
+          for (unsigned int k=0; k<fe_v_neighbor.get_present_fe_values().dofs_per_cell; ++k)
+            for (unsigned int l=0; l<fe_v_neighbor.get_present_fe_values().dofs_per_cell; ++l)
+              ue_ve_matrix(k,l) -= beta_n *
+                                   fe_v_neighbor.get_present_fe_values().shape_value(l,point) *
+                                   fe_v_neighbor.get_present_fe_values().shape_value(k,point) *
+                                   JxW[point];
+        }
     }
 }
 
@@ -330,54 +330,54 @@ void DGTransportEquation<dim>::assemble_face_term2(
 template <int dim>
 class DGMethod
 {
-  public:
-    DGMethod ();
-    ~DGMethod ();
-
-    void run ();
-    
-  private:
-    void setup_system ();
-    void assemble_system1 ();
-    void assemble_system2 ();
-    void solve (Vector<double> &solution);
-    void refine_grid ();
-    void output_results (const unsigned int cycle) const;
-    
-    Triangulation<dim>   triangulation;
-    const hp::MappingCollection<dim> mapping;
-    
-    hp::FECollection<dim>          fe;
-    hp::DoFHandler<dim>      dof_handler;
-
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> system_matrix;
-
-    const hp::QCollection<dim>   quadrature;
-    const hp::QCollection<dim-1> face_quadrature;
-    
-    Vector<double>       solution1;
-    Vector<double>       solution2;
-    Vector<double>       right_hand_side;
-    
-    const DGTransportEquation<dim> dg;
+public:
+  DGMethod ();
+  ~DGMethod ();
+
+  void run ();
+
+private:
+  void setup_system ();
+  void assemble_system1 ();
+  void assemble_system2 ();
+  void solve (Vector<double> &solution);
+  void refine_grid ();
+  void output_results (const unsigned int cycle) const;
+
+  Triangulation<dim>   triangulation;
+  const hp::MappingCollection<dim> mapping;
+
+  hp::FECollection<dim>          fe;
+  hp::DoFHandler<dim>      dof_handler;
+
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> system_matrix;
+
+  const hp::QCollection<dim>   quadrature;
+  const hp::QCollection<dim-1> face_quadrature;
+
+  Vector<double>       solution1;
+  Vector<double>       solution2;
+  Vector<double>       right_hand_side;
+
+  const DGTransportEquation<dim> dg;
 };
 
 
 template <int dim>
 DGMethod<dim>::DGMethod ()
-               :
-               mapping (MappingQ1<dim>()),
-                fe (FE_DGQ<dim>(1)),
-               dof_handler (triangulation),
-               quadrature (QGauss<dim>(4)),
-               face_quadrature (QGauss<dim-1>(4)),
-               dg ()
+  :
+  mapping (MappingQ1<dim>()),
+  fe (FE_DGQ<dim>(1)),
+  dof_handler (triangulation),
+  quadrature (QGauss<dim>(4)),
+  face_quadrature (QGauss<dim-1>(4)),
+  dg ()
 {}
 
 
 template <int dim>
-DGMethod<dim>::~DGMethod () 
+DGMethod<dim>::~DGMethod ()
 {
   dof_handler.clear ();
 }
@@ -389,14 +389,14 @@ void DGMethod<dim>::setup_system ()
   dof_handler.distribute_dofs (fe);
 
   sparsity_pattern.reinit (dof_handler.n_dofs(),
-                          dof_handler.n_dofs(),
-                          (GeometryInfo<dim>::faces_per_cell
-                           *GeometryInfo<dim>::max_children_per_face+1)*fe[0].dofs_per_cell);
-  
+                           dof_handler.n_dofs(),
+                           (GeometryInfo<dim>::faces_per_cell
+                            *GeometryInfo<dim>::max_children_per_face+1)*fe[0].dofs_per_cell);
+
   DoFTools::make_flux_sparsity_pattern (dof_handler, sparsity_pattern);
-  
+
   sparsity_pattern.compress();
-  
+
   system_matrix.reinit (sparsity_pattern);
 
   solution1.reinit (dof_handler.n_dofs());
@@ -406,7 +406,7 @@ void DGMethod<dim>::setup_system ()
 
 
 template <int dim>
-void DGMethod<dim>::assemble_system1 () 
+void DGMethod<dim>::assemble_system1 ()
 {
   const unsigned int dofs_per_cell = dof_handler.get_fe()[0].dofs_per_cell;
   std::vector<types::global_dof_index> dofs (dofs_per_cell);
@@ -421,12 +421,12 @@ void DGMethod<dim>::assemble_system1 ()
                                         | update_q_points
                                         | update_JxW_values
                                         | update_normal_vectors;
-  
+
   const UpdateFlags neighbor_face_update_flags = update_values;
-   
+
   hp::FEValues<dim> fe_v (
     mapping, fe, quadrature, update_flags);
-  
+
   hp::FEFaceValues<dim> fe_v_face (
     mapping, fe, face_quadrature, face_update_flags);
   hp::FESubfaceValues<dim> fe_v_subface (
@@ -442,137 +442,137 @@ void DGMethod<dim>::assemble_system1 ()
   Vector<double>  cell_vector (dofs_per_cell);
 
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
 
-  for (;cell!=endc; ++cell) 
+  for (; cell!=endc; ++cell)
     {
       ui_vi_matrix = 0;
       cell_vector = 0;
-      
+
       fe_v.reinit (cell);
 
       dg.assemble_cell_term(fe_v,
-                           ui_vi_matrix,
-                           cell_vector);
+                            ui_vi_matrix,
+                            cell_vector);
 
       cell->get_dof_indices (dofs);
 
       for (unsigned int face_no=0; face_no<GeometryInfo<dim>::faces_per_cell; ++face_no)
-       {
-         typename hp::DoFHandler<dim>::face_iterator face=cell->face(face_no);
-         
-         ue_vi_matrix = 0;
-                 
-         if (face->at_boundary())
-           {
-             fe_v_face.reinit (cell, face_no);
-
-             dg.assemble_boundary_term(fe_v_face,
-                                       ui_vi_matrix,
-                                       cell_vector);
-           }
-         else
-           {
-             typename hp::DoFHandler<dim>::cell_iterator neighbor=
-               cell->neighbor(face_no);;
-
-             if (face->has_children())
-               {
-                 const unsigned int neighbor2=
-                   cell->neighbor_of_neighbor(face_no);
-                 
-                 
-                 for (unsigned int subface_no=0;
-                      subface_no<face->n_children(); ++subface_no)
-                   {
-                     typename hp::DoFHandler<dim>::active_cell_iterator
-                        neighbor_child
+        {
+          typename hp::DoFHandler<dim>::face_iterator face=cell->face(face_no);
+
+          ue_vi_matrix = 0;
+
+          if (face->at_boundary())
+            {
+              fe_v_face.reinit (cell, face_no);
+
+              dg.assemble_boundary_term(fe_v_face,
+                                        ui_vi_matrix,
+                                        cell_vector);
+            }
+          else
+            {
+              typename hp::DoFHandler<dim>::cell_iterator neighbor=
+                cell->neighbor(face_no);;
+
+              if (face->has_children())
+                {
+                  const unsigned int neighbor2=
+                    cell->neighbor_of_neighbor(face_no);
+
+
+                  for (unsigned int subface_no=0;
+                       subface_no<face->n_children(); ++subface_no)
+                    {
+                      typename hp::DoFHandler<dim>::active_cell_iterator
+                      neighbor_child
                         = cell->neighbor_child_on_subface (face_no, subface_no);
-                     
-                     Assert (neighbor_child->face(neighbor2) == face->child(subface_no),
-                             ExcInternalError());
-                     Assert (!neighbor_child->has_children(), ExcInternalError());
-
-                     ue_vi_matrix = 0;
-                     
-                     fe_v_subface.reinit (cell, face_no, subface_no);
-                     fe_v_face_neighbor.reinit (neighbor_child, neighbor2);
-
-                     dg.assemble_face_term1(fe_v_subface,
-                                            fe_v_face_neighbor,
-                                            ui_vi_matrix,
-                                            ue_vi_matrix);
-                     
-                     neighbor_child->get_dof_indices (dofs_neighbor);
-                                                               
-                     for (unsigned int i=0; i<dofs_per_cell; ++i)
-                       for (unsigned int k=0; k<dofs_per_cell; ++k)
-                         system_matrix.add(dofs[i], dofs_neighbor[k],
-                                           ue_vi_matrix(i,k));
-                   }
-               }
-             else
-               {
-                 if (neighbor->level() == cell->level()) 
-                   {
-                     const unsigned int neighbor2=cell->neighbor_of_neighbor(face_no);
-
-                     fe_v_face.reinit (cell, face_no);
-                     fe_v_face_neighbor.reinit (neighbor, neighbor2);
-                     
-                     dg.assemble_face_term1(fe_v_face,
-                                            fe_v_face_neighbor,
-                                            ui_vi_matrix,
-                                            ue_vi_matrix);
-                   }
-                 else
-                   {
-                     Assert(neighbor->level() < cell->level(), ExcInternalError());
-
-                     const std::pair<unsigned int, unsigned int> faceno_subfaceno=
-                       cell->neighbor_of_coarser_neighbor(face_no);
-                     const unsigned int neighbor_face_no=faceno_subfaceno.first,
-                                     neighbor_subface_no=faceno_subfaceno.second;
-
-                     Assert (neighbor->neighbor_child_on_subface (neighbor_face_no,
+
+                      Assert (neighbor_child->face(neighbor2) == face->child(subface_no),
+                              ExcInternalError());
+                      Assert (!neighbor_child->has_children(), ExcInternalError());
+
+                      ue_vi_matrix = 0;
+
+                      fe_v_subface.reinit (cell, face_no, subface_no);
+                      fe_v_face_neighbor.reinit (neighbor_child, neighbor2);
+
+                      dg.assemble_face_term1(fe_v_subface,
+                                             fe_v_face_neighbor,
+                                             ui_vi_matrix,
+                                             ue_vi_matrix);
+
+                      neighbor_child->get_dof_indices (dofs_neighbor);
+
+                      for (unsigned int i=0; i<dofs_per_cell; ++i)
+                        for (unsigned int k=0; k<dofs_per_cell; ++k)
+                          system_matrix.add(dofs[i], dofs_neighbor[k],
+                                            ue_vi_matrix(i,k));
+                    }
+                }
+              else
+                {
+                  if (neighbor->level() == cell->level())
+                    {
+                      const unsigned int neighbor2=cell->neighbor_of_neighbor(face_no);
+
+                      fe_v_face.reinit (cell, face_no);
+                      fe_v_face_neighbor.reinit (neighbor, neighbor2);
+
+                      dg.assemble_face_term1(fe_v_face,
+                                             fe_v_face_neighbor,
+                                             ui_vi_matrix,
+                                             ue_vi_matrix);
+                    }
+                  else
+                    {
+                      Assert(neighbor->level() < cell->level(), ExcInternalError());
+
+                      const std::pair<unsigned int, unsigned int> faceno_subfaceno=
+                        cell->neighbor_of_coarser_neighbor(face_no);
+                      const unsigned int neighbor_face_no=faceno_subfaceno.first,
+                                         neighbor_subface_no=faceno_subfaceno.second;
+
+                      Assert (neighbor->neighbor_child_on_subface (neighbor_face_no,
                                                                    neighbor_subface_no)
                               == cell,
                               ExcInternalError());
 
-                     fe_v_face.reinit (cell, face_no);
-                     fe_v_subface_neighbor.reinit (neighbor, neighbor_face_no,
-                                                   neighbor_subface_no);
-                     
-                     dg.assemble_face_term1(fe_v_face,
-                                            fe_v_subface_neighbor,
-                                            ui_vi_matrix,
-                                            ue_vi_matrix);
-                   }
-
-                 neighbor->get_dof_indices (dofs_neighbor);
-                                                               
-                 for (unsigned int i=0; i<dofs_per_cell; ++i)
-                   for (unsigned int k=0; k<dofs_per_cell; ++k)
-                     system_matrix.add(dofs[i], dofs_neighbor[k],
-                                       ue_vi_matrix(i,k));
-               }
-           }
-       }
-      
+                      fe_v_face.reinit (cell, face_no);
+                      fe_v_subface_neighbor.reinit (neighbor, neighbor_face_no,
+                                                    neighbor_subface_no);
+
+                      dg.assemble_face_term1(fe_v_face,
+                                             fe_v_subface_neighbor,
+                                             ui_vi_matrix,
+                                             ue_vi_matrix);
+                    }
+
+                  neighbor->get_dof_indices (dofs_neighbor);
+
+                  for (unsigned int i=0; i<dofs_per_cell; ++i)
+                    for (unsigned int k=0; k<dofs_per_cell; ++k)
+                      system_matrix.add(dofs[i], dofs_neighbor[k],
+                                        ue_vi_matrix(i,k));
+                }
+            }
+        }
+
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int j=0; j<dofs_per_cell; ++j)
-         system_matrix.add(dofs[i], dofs[j], ui_vi_matrix(i,j));
-      
+        for (unsigned int j=0; j<dofs_per_cell; ++j)
+          system_matrix.add(dofs[i], dofs[j], ui_vi_matrix(i,j));
+
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       right_hand_side(dofs[i]) += cell_vector(i);
+        right_hand_side(dofs[i]) += cell_vector(i);
     }
 }
 
 
 
 template <int dim>
-void DGMethod<dim>::assemble_system2 () 
+void DGMethod<dim>::assemble_system2 ()
 {
   const unsigned int dofs_per_cell = dof_handler.get_fe()[0].dofs_per_cell;
   std::vector<types::global_dof_index> dofs (dofs_per_cell);
@@ -582,12 +582,12 @@ void DGMethod<dim>::assemble_system2 ()
                                    | update_gradients
                                    | update_q_points
                                    | update_JxW_values;
-  
+
   const UpdateFlags face_update_flags = update_values
                                         | update_q_points
                                         | update_JxW_values
                                         | update_normal_vectors;
-  
+
   const UpdateFlags neighbor_face_update_flags = update_values;
 
   hp::FEValues<dim> fe_v (
@@ -602,16 +602,16 @@ void DGMethod<dim>::assemble_system2 ()
 
   FullMatrix<double> ui_vi_matrix (dofs_per_cell, dofs_per_cell);
   FullMatrix<double> ue_vi_matrix (dofs_per_cell, dofs_per_cell);
-  
+
   FullMatrix<double> ui_ve_matrix (dofs_per_cell, dofs_per_cell);
   FullMatrix<double> ue_ve_matrix (dofs_per_cell, dofs_per_cell);
-  
+
   Vector<double>  cell_vector (dofs_per_cell);
 
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
-  for (;cell!=endc; ++cell) 
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
+  for (; cell!=endc; ++cell)
     {
       ui_vi_matrix = 0;
       cell_vector = 0;
@@ -619,123 +619,123 @@ void DGMethod<dim>::assemble_system2 ()
       fe_v.reinit (cell);
 
       dg.assemble_cell_term(fe_v,
-                           ui_vi_matrix,
-                           cell_vector);
-      
+                            ui_vi_matrix,
+                            cell_vector);
+
       cell->get_dof_indices (dofs);
 
       for (unsigned int face_no=0; face_no<GeometryInfo<dim>::faces_per_cell; ++face_no)
-       {
-         typename hp::DoFHandler<dim>::face_iterator face=
-           cell->face(face_no);
-
-         if (face->at_boundary())
-           {
-             fe_v_face.reinit (cell, face_no);
-
-             dg.assemble_boundary_term(fe_v_face,
-                                       ui_vi_matrix,
-                                       cell_vector);
-           }
-         else
-           {
-             Assert (cell->neighbor(face_no).state() == IteratorState::valid,
-                     ExcInternalError());
-             typename hp::DoFHandler<dim>::cell_iterator neighbor=
-               cell->neighbor(face_no);
-             if (face->has_children())
-               {
-                 const unsigned int neighbor2=
-                   cell->neighbor_of_neighbor(face_no);
-                 
-                 for (unsigned int subface_no=0;
-                      subface_no<face->n_children(); ++subface_no)
-                   {
-                     typename hp::DoFHandler<dim>::cell_iterator neighbor_child
+        {
+          typename hp::DoFHandler<dim>::face_iterator face=
+            cell->face(face_no);
+
+          if (face->at_boundary())
+            {
+              fe_v_face.reinit (cell, face_no);
+
+              dg.assemble_boundary_term(fe_v_face,
+                                        ui_vi_matrix,
+                                        cell_vector);
+            }
+          else
+            {
+              Assert (cell->neighbor(face_no).state() == IteratorState::valid,
+                      ExcInternalError());
+              typename hp::DoFHandler<dim>::cell_iterator neighbor=
+                cell->neighbor(face_no);
+              if (face->has_children())
+                {
+                  const unsigned int neighbor2=
+                    cell->neighbor_of_neighbor(face_no);
+
+                  for (unsigned int subface_no=0;
+                       subface_no<face->n_children(); ++subface_no)
+                    {
+                      typename hp::DoFHandler<dim>::cell_iterator neighbor_child
                         = cell->neighbor_child_on_subface (face_no, subface_no);
-                     Assert (neighbor_child->face(neighbor2) == face->child(subface_no),
-                             ExcInternalError());
-                     Assert (!neighbor_child->has_children(), ExcInternalError());
-                     
-                     ue_vi_matrix = 0;
-                     ui_ve_matrix = 0;
-                     ue_ve_matrix = 0;
-                     
-                     fe_v_subface.reinit (cell, face_no, subface_no);
-                     fe_v_face_neighbor.reinit (neighbor_child, neighbor2);
-
-                     dg.assemble_face_term2(fe_v_subface,
-                                            fe_v_face_neighbor,
-                                            ui_vi_matrix,
-                                            ue_vi_matrix,
-                                            ui_ve_matrix,
-                                            ue_ve_matrix);
-                 
-                     neighbor_child->get_dof_indices (dofs_neighbor);
-                                                               
-                     for (unsigned int i=0; i<dofs_per_cell; ++i)
-                       for (unsigned int j=0; j<dofs_per_cell; ++j)
-                         {
-                           system_matrix.add(dofs[i], dofs_neighbor[j],
-                                             ue_vi_matrix(i,j));
-                           system_matrix.add(dofs_neighbor[i], dofs[j],
-                                             ui_ve_matrix(i,j));
-                           system_matrix.add(dofs_neighbor[i], dofs_neighbor[j],
-                                             ue_ve_matrix(i,j));
-                         }
-                   }
-               }
-             else
-               {
-                 if (neighbor->level() == cell->level() &&
-                     neighbor->index() > cell->index()) 
-                   {
-                     const unsigned int neighbor2=cell->neighbor_of_neighbor(face_no);
-                     
-                     ue_vi_matrix = 0;
-                     ui_ve_matrix = 0;
-                     ue_ve_matrix = 0;
-                     
-                     fe_v_face.reinit (cell, face_no);
-                     fe_v_face_neighbor.reinit (neighbor, neighbor2);
-                     
-                     dg.assemble_face_term2(fe_v_face,
-                                            fe_v_face_neighbor,
-                                            ui_vi_matrix,
-                                            ue_vi_matrix,
-                                            ui_ve_matrix,
-                                            ue_ve_matrix);
-
-                     neighbor->get_dof_indices (dofs_neighbor);
-
-                     for (unsigned int i=0; i<dofs_per_cell; ++i)
-                       for (unsigned int j=0; j<dofs_per_cell; ++j)
-                         {
-                           system_matrix.add(dofs[i], dofs_neighbor[j],
-                                             ue_vi_matrix(i,j));
-                           system_matrix.add(dofs_neighbor[i], dofs[j],
-                                             ui_ve_matrix(i,j));
-                           system_matrix.add(dofs_neighbor[i], dofs_neighbor[j],
-                                             ue_ve_matrix(i,j));
-                         }
-                   }
-
-               }
-           }
-       }
-      
+                      Assert (neighbor_child->face(neighbor2) == face->child(subface_no),
+                              ExcInternalError());
+                      Assert (!neighbor_child->has_children(), ExcInternalError());
+
+                      ue_vi_matrix = 0;
+                      ui_ve_matrix = 0;
+                      ue_ve_matrix = 0;
+
+                      fe_v_subface.reinit (cell, face_no, subface_no);
+                      fe_v_face_neighbor.reinit (neighbor_child, neighbor2);
+
+                      dg.assemble_face_term2(fe_v_subface,
+                                             fe_v_face_neighbor,
+                                             ui_vi_matrix,
+                                             ue_vi_matrix,
+                                             ui_ve_matrix,
+                                             ue_ve_matrix);
+
+                      neighbor_child->get_dof_indices (dofs_neighbor);
+
+                      for (unsigned int i=0; i<dofs_per_cell; ++i)
+                        for (unsigned int j=0; j<dofs_per_cell; ++j)
+                          {
+                            system_matrix.add(dofs[i], dofs_neighbor[j],
+                                              ue_vi_matrix(i,j));
+                            system_matrix.add(dofs_neighbor[i], dofs[j],
+                                              ui_ve_matrix(i,j));
+                            system_matrix.add(dofs_neighbor[i], dofs_neighbor[j],
+                                              ue_ve_matrix(i,j));
+                          }
+                    }
+                }
+              else
+                {
+                  if (neighbor->level() == cell->level() &&
+                      neighbor->index() > cell->index())
+                    {
+                      const unsigned int neighbor2=cell->neighbor_of_neighbor(face_no);
+
+                      ue_vi_matrix = 0;
+                      ui_ve_matrix = 0;
+                      ue_ve_matrix = 0;
+
+                      fe_v_face.reinit (cell, face_no);
+                      fe_v_face_neighbor.reinit (neighbor, neighbor2);
+
+                      dg.assemble_face_term2(fe_v_face,
+                                             fe_v_face_neighbor,
+                                             ui_vi_matrix,
+                                             ue_vi_matrix,
+                                             ui_ve_matrix,
+                                             ue_ve_matrix);
+
+                      neighbor->get_dof_indices (dofs_neighbor);
+
+                      for (unsigned int i=0; i<dofs_per_cell; ++i)
+                        for (unsigned int j=0; j<dofs_per_cell; ++j)
+                          {
+                            system_matrix.add(dofs[i], dofs_neighbor[j],
+                                              ue_vi_matrix(i,j));
+                            system_matrix.add(dofs_neighbor[i], dofs[j],
+                                              ui_ve_matrix(i,j));
+                            system_matrix.add(dofs_neighbor[i], dofs_neighbor[j],
+                                              ue_ve_matrix(i,j));
+                          }
+                    }
+
+                }
+            }
+        }
+
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int j=0; j<dofs_per_cell; ++j)
-         system_matrix.add(dofs[i], dofs[j], ui_vi_matrix(i,j));
-      
+        for (unsigned int j=0; j<dofs_per_cell; ++j)
+          system_matrix.add(dofs[i], dofs[j], ui_vi_matrix(i,j));
+
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       right_hand_side(dofs[i]) += cell_vector(i);
+        right_hand_side(dofs[i]) += cell_vector(i);
     }
 }
 
 
 template <int dim>
-void DGMethod<dim>::solve (Vector<double> &solution) 
+void DGMethod<dim>::solve (Vector<double> &solution)
 {
   SolverControl           solver_control (1000, 1e-12, false, false);
   SolverRichardson<>      solver (solver_control);
@@ -745,7 +745,7 @@ void DGMethod<dim>::solve (Vector<double> &solution)
   preconditioner.initialize(system_matrix, fe[0].dofs_per_cell);
 
   solver.solve (system_matrix, solution, right_hand_side,
-               preconditioner);
+                preconditioner);
 }
 
 
@@ -755,19 +755,19 @@ void DGMethod<dim>::refine_grid ()
   Vector<float> gradient_indicator (triangulation.n_active_cells());
 
   DerivativeApproximation::approximate_gradient (mapping[0],
-                                                dof_handler,
-                                                solution2,
-                                                gradient_indicator);
+                                                 dof_handler,
+                                                 solution2,
+                                                 gradient_indicator);
 
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (unsigned int cell_no=0; cell!=endc; ++cell, ++cell_no)
     gradient_indicator(cell_no)*=std::pow(cell->diameter(), 1+1.0*dim/2);
 
   GridRefinement::refine_and_coarsen_fixed_number (triangulation,
-                                                  gradient_indicator,
-                                                  0.3, 0.1);
+                                                   gradient_indicator,
+                                                   0.3, 0.1);
 
   triangulation.execute_coarsening_and_refinement ();
 }
@@ -779,57 +779,57 @@ void DGMethod<dim>::output_results (const unsigned int cycle) const
   std::string filename = "grid-";
   filename += ('0' + cycle);
   Assert (cycle < 10, ExcInternalError());
-  
+
   filename += ".eps";
   deallog << "Writing grid to <" << filename << ">..." << std::endl;
-  
+
   GridOut grid_out;
   grid_out.write_eps (triangulation, deallog.get_file_stream());
-  
+
   filename = "sol-";
   filename += ('0' + cycle);
   Assert (cycle < 10, ExcInternalError());
-  
+
   filename += ".gnuplot";
   deallog << "Writing solution to <" << filename << ">..."
-           << std::endl << std::endl;
-  
+          << std::endl << std::endl;
+
   DataOut<dim,hp::DoFHandler<dim> > data_out;
   data_out.attach_dof_handler (dof_handler);
   data_out.add_data_vector (solution2, "u");
 
   data_out.build_patches ();
-  
+
   data_out.write_gnuplot(deallog.get_file_stream());
 }
 
 
 template <int dim>
-void DGMethod<dim>::run () 
+void DGMethod<dim>::run ()
 {
   for (unsigned int cycle=0; cycle<6; ++cycle)
     {
       deallog << "Cycle " << cycle << ':' << std::endl;
 
       if (cycle == 0)
-       {
-         GridGenerator::hyper_cube (triangulation);
+        {
+          GridGenerator::hyper_cube (triangulation);
 
-         triangulation.refine_global (3);
-       }
+          triangulation.refine_global (3);
+        }
       else
-       refine_grid ();
-      
+        refine_grid ();
+
 
       deallog << "   Number of active cells:       "
-               << triangulation.n_active_cells()
-               << std::endl;
+              << triangulation.n_active_cells()
+              << std::endl;
 
       setup_system ();
 
       deallog << "   Number of degrees of freedom: "
-               << dof_handler.n_dofs()
-               << std::endl;
+              << dof_handler.n_dofs()
+              << std::endl;
 
       Timer assemble_timer;
       assemble_system1 ();
@@ -846,23 +846,23 @@ void DGMethod<dim>::run ()
       solution1-=solution2;
       const double difference=solution1.linfty_norm();
       if (difference>1e-13)
-       deallog << "solution1 and solution2 differ!!" << std::endl;
+        deallog << "solution1 and solution2 differ!!" << std::endl;
       else
-       deallog << "solution1 and solution2 coincide." << std::endl;
-       
+        deallog << "solution1 and solution2 coincide." << std::endl;
+
       output_results (cycle);
     }
 }
 
-int main () 
+int main ()
 {
   try
     {
       logfile.precision(2);
-  
+
       deallog.attach(logfile);
       deallog.depth_console(0);
-      deallog.threshold_double(1.e-10);  
+      deallog.threshold_double(1.e-10);
 
       DGMethod<2> dgmethod;
       dgmethod.run ();
@@ -870,27 +870,27 @@ int main ()
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
-  
+
   return 0;
 }
 
index a795666ee74020287894728a05b4c1154b379c60..ace52a9542fac4eb74503f229b8520df99ae0849 100644 (file)
@@ -62,26 +62,26 @@ namespace Evaluation
 {
 
   template <int dim>
-  class EvaluationBase 
+  class EvaluationBase
   {
-    public:
-      virtual ~EvaluationBase ();
-
-      void set_refinement_cycle (const unsigned int refinement_cycle);
-      
-      virtual void operator () (const hp::DoFHandler<dim> &dof_handler,
-                               const Vector<double>  &solution) const = 0;
-    protected:
-      unsigned int refinement_cycle;
+  public:
+    virtual ~EvaluationBase ();
+
+    void set_refinement_cycle (const unsigned int refinement_cycle);
+
+    virtual void operator () (const hp::DoFHandler<dim> &dof_handler,
+                              const Vector<double>  &solution) const = 0;
+  protected:
+    unsigned int refinement_cycle;
   };
 
 
   template <int dim>
   EvaluationBase<dim>::~EvaluationBase ()
   {}
-  
 
-  
+
+
   template <int dim>
   void
   EvaluationBase<dim>::set_refinement_cycle (const unsigned int step)
@@ -94,62 +94,62 @@ namespace Evaluation
   template <int dim>
   class PointValueEvaluation : public EvaluationBase<dim>
   {
-    public:
-      PointValueEvaluation (const Point<dim>   &evaluation_point,
-                           TableHandler       &results_table);
-      
-      virtual void operator () (const hp::DoFHandler<dim> &dof_handler,
-                               const Vector<double>  &solution) const;
-      
-      DeclException1 (ExcEvaluationPointNotFound,
-                     Point<dim>,
-                     << "The evaluation point " << arg1
-                     << " was not found among the vertices of the present grid.");
-    private:
-      const Point<dim>  evaluation_point;
-      TableHandler     &results_table;
+  public:
+    PointValueEvaluation (const Point<dim>   &evaluation_point,
+                          TableHandler       &results_table);
+
+    virtual void operator () (const hp::DoFHandler<dim> &dof_handler,
+                              const Vector<double>  &solution) const;
+
+    DeclException1 (ExcEvaluationPointNotFound,
+                    Point<dim>,
+                    << "The evaluation point " << arg1
+                    << " was not found among the vertices of the present grid.");
+  private:
+    const Point<dim>  evaluation_point;
+    TableHandler     &results_table;
   };
 
 
   template <int dim>
   PointValueEvaluation<dim>::
   PointValueEvaluation (const Point<dim>   &evaluation_point,
-                       TableHandler       &results_table)
-                 :
-                 evaluation_point (evaluation_point),
-                 results_table (results_table)
+                        TableHandler       &results_table)
+    :
+    evaluation_point (evaluation_point),
+    results_table (results_table)
   {}
-  
+
 
 
   template <int dim>
   void
   PointValueEvaluation<dim>::
   operator () (const hp::DoFHandler<dim> &dof_handler,
-              const Vector<double>  &solution) const 
+               const Vector<double>  &solution) const
   {
     double point_value = 1e20;
 
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     bool evaluation_point_found = false;
     for (; (cell!=endc) && !evaluation_point_found; ++cell)
       for (unsigned int vertex=0;
-          vertex<GeometryInfo<dim>::vertices_per_cell;
-          ++vertex)
-       if (cell->vertex(vertex) == evaluation_point)
-         {
-           point_value = solution(cell->vertex_dof_index(vertex,0,
-                                                         cell->active_fe_index()));
+           vertex<GeometryInfo<dim>::vertices_per_cell;
+           ++vertex)
+        if (cell->vertex(vertex) == evaluation_point)
+          {
+            point_value = solution(cell->vertex_dof_index(vertex,0,
+                                                          cell->active_fe_index()));
 
-           evaluation_point_found = true;
-           break;
-         };
+            evaluation_point_found = true;
+            break;
+          };
 
     AssertThrow (evaluation_point_found,
-                ExcEvaluationPointNotFound(evaluation_point));
-    
+                 ExcEvaluationPointNotFound(evaluation_point));
+
     results_table.add_value ("DoFs", dof_handler.n_dofs());
     results_table.add_value ("u(x_0)", point_value);
   }
@@ -161,53 +161,53 @@ namespace Evaluation
   template <int dim>
   class SolutionOutput : public EvaluationBase<dim>
   {
-    public:
-      SolutionOutput (const std::string                         &output_name_base,
-                     const typename DataOut<dim>::OutputFormat  output_format);
-      
-      virtual void operator () (const hp::DoFHandler<dim> &dof_handler,
-                               const Vector<double>  &solution) const;
-    private:
-      const std::string                         output_name_base;
-      const typename DataOut<dim>::OutputFormat output_format;
+  public:
+    SolutionOutput (const std::string                         &output_name_base,
+                    const typename DataOut<dim>::OutputFormat  output_format);
+
+    virtual void operator () (const hp::DoFHandler<dim> &dof_handler,
+                              const Vector<double>  &solution) const;
+  private:
+    const std::string                         output_name_base;
+    const typename DataOut<dim>::OutputFormat output_format;
   };
 
 
   template <int dim>
   SolutionOutput<dim>::
   SolutionOutput (const std::string                         &output_name_base,
-                 const typename DataOut<dim>::OutputFormat  output_format)
-                 :
-                 output_name_base (output_name_base),
-                 output_format (output_format)
+                  const typename DataOut<dim>::OutputFormat  output_format)
+    :
+    output_name_base (output_name_base),
+    output_format (output_format)
   {}
-  
+
 
   template <int dim>
   void
   SolutionOutput<dim>::operator () (const hp::DoFHandler<dim> &dof_handler,
-                                   const Vector<double>  &solution) const
+                                    const Vector<double>  &solution) const
   {
     DataOut<dim,hp::DoFHandler<dim> > data_out;
     data_out.attach_dof_handler (dof_handler);
     data_out.add_data_vector (solution, "solution");
     data_out.build_patches ();
-  
+
     std::ostringstream filename;
     filename << output_name_base << "-"
-            << this->refinement_cycle
-            << data_out.default_suffix (output_format)
-            << std::ends;
-    
+             << this->refinement_cycle
+             << data_out.default_suffix (output_format)
+             << std::ends;
+
     data_out.write (deallog.get_file_stream(), output_format);
   }
 
 
 
-  
+
 }
 
-  
+
 
 namespace LaplaceSolver
 {
@@ -215,106 +215,106 @@ namespace LaplaceSolver
   template <int dim>
   class Base
   {
-    public:
-      Base (Triangulation<dim> &coarse_grid);
-      virtual ~Base ();
-
-      virtual void solve_problem () = 0;
-      virtual void postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const = 0;
-      virtual void refine_grid () = 0;
-      virtual unsigned int n_dofs () const = 0;
-      
-    protected:
-      const SmartPointer<Triangulation<dim> > triangulation;
+  public:
+    Base (Triangulation<dim> &coarse_grid);
+    virtual ~Base ();
+
+    virtual void solve_problem () = 0;
+    virtual void postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const = 0;
+    virtual void refine_grid () = 0;
+    virtual unsigned int n_dofs () const = 0;
+
+  protected:
+    const SmartPointer<Triangulation<dim> > triangulation;
   };
 
 
   template <int dim>
   Base<dim>::Base (Triangulation<dim> &coarse_grid)
-                 :
-                 triangulation (&coarse_grid)
+    :
+    triangulation (&coarse_grid)
   {}
 
 
   template <int dim>
-  Base<dim>::~Base () 
+  Base<dim>::~Base ()
   {}
-  
+
 
 
   template <int dim>
   class Solver : public virtual Base<dim>
   {
-    public:
-      Solver (Triangulation<dim>       &triangulation,
-             const hp::FECollection<dim> &fe,
-             const hp::QCollection<dim>    &quadrature,
-             const Function<dim>      &boundary_values);
-      virtual
-      ~Solver ();
-
-      virtual
-      void
-      solve_problem ();
-
-      virtual
-      void
-      postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const;
-
-      virtual
-      unsigned int
-      n_dofs () const;
-      
-    protected:
-      const SmartPointer<const hp::FECollection<dim> >  fe;
-      const SmartPointer<const hp::QCollection<dim> >     quadrature;
-      hp::DoFHandler<dim>                                dof_handler;
-      Vector<double>                                 solution;
-      const SmartPointer<const Function<dim> >       boundary_values;
-
-      virtual void assemble_rhs (Vector<double> &rhs) const = 0;
-    
-    private:
-      struct LinearSystem
-      {
-         LinearSystem (const hp::DoFHandler<dim> &dof_handler);
-
-         void solve (Vector<double> &solution) const;
-       
-         ConstraintMatrix     hanging_node_constraints;
-         SparsityPattern      sparsity_pattern;
-         SparseMatrix<double> matrix;
-         Vector<double>       rhs;
-      };
+  public:
+    Solver (Triangulation<dim>       &triangulation,
+            const hp::FECollection<dim> &fe,
+            const hp::QCollection<dim>    &quadrature,
+            const Function<dim>      &boundary_values);
+    virtual
+    ~Solver ();
+
+    virtual
+    void
+    solve_problem ();
+
+    virtual
+    void
+    postprocess (const Evaluation::EvaluationBase<dim> &postprocessor) const;
+
+    virtual
+    unsigned int
+    n_dofs () const;
+
+  protected:
+    const SmartPointer<const hp::FECollection<dim> >  fe;
+    const SmartPointer<const hp::QCollection<dim> >     quadrature;
+    hp::DoFHandler<dim>                                dof_handler;
+    Vector<double>                                 solution;
+    const SmartPointer<const Function<dim> >       boundary_values;
+
+    virtual void assemble_rhs (Vector<double> &rhs) const = 0;
+
+  private:
+    struct LinearSystem
+    {
+      LinearSystem (const hp::DoFHandler<dim> &dof_handler);
+
+      void solve (Vector<double> &solution) const;
 
-      void
-      assemble_linear_system (LinearSystem &linear_system);
+      ConstraintMatrix     hanging_node_constraints;
+      SparsityPattern      sparsity_pattern;
+      SparseMatrix<double> matrix;
+      Vector<double>       rhs;
+    };
 
-      void
-      assemble_matrix (LinearSystem                                         &linear_system,
-                      const typename hp::DoFHandler<dim>::active_cell_iterator &begin_cell,
-                      const typename hp::DoFHandler<dim>::active_cell_iterator &end_cell,
-                      Threads::ThreadMutex                                 &mutex) const;
+    void
+    assemble_linear_system (LinearSystem &linear_system);
+
+    void
+    assemble_matrix (LinearSystem                                         &linear_system,
+                     const typename hp::DoFHandler<dim>::active_cell_iterator &begin_cell,
+                     const typename hp::DoFHandler<dim>::active_cell_iterator &end_cell,
+                     Threads::ThreadMutex                                 &mutex) const;
   };
 
 
 
   template <int dim>
   Solver<dim>::Solver (Triangulation<dim>       &triangulation,
-                      const hp::FECollection<dim> &fe,
-                      const hp::QCollection<dim>    &quadrature,
-                      const Function<dim>      &boundary_values)
-                 :
-                 Base<dim> (triangulation),
-                 fe (&fe),
-                  quadrature (&quadrature),
-                 dof_handler (triangulation),
-                 boundary_values (&boundary_values)
+                       const hp::FECollection<dim> &fe,
+                       const hp::QCollection<dim>    &quadrature,
+                       const Function<dim>      &boundary_values)
+    :
+    Base<dim> (triangulation),
+    fe (&fe),
+    quadrature (&quadrature),
+    dof_handler (triangulation),
+    boundary_values (&boundary_values)
   {}
 
 
   template <int dim>
-  Solver<dim>::~Solver () 
+  Solver<dim>::~Solver ()
   {
     dof_handler.clear ();
   }
@@ -348,22 +348,22 @@ namespace LaplaceSolver
   {
     return dof_handler.n_dofs();
   }
-  
+
 
   template <int dim>
   void
   Solver<dim>::assemble_linear_system (LinearSystem &linear_system)
   {
     typedef
-      typename hp::DoFHandler<dim>::active_cell_iterator
-      active_cell_iterator;
+    typename hp::DoFHandler<dim>::active_cell_iterator
+    active_cell_iterator;
 
     const unsigned int n_threads = multithread_info.n_default_threads;
     std::vector<std::pair<active_cell_iterator,active_cell_iterator> >
-      thread_ranges 
+    thread_ranges
       = Threads::split_range<active_cell_iterator> (dof_handler.begin_active (),
-                                                   dof_handler.end (),
-                                                   n_threads);
+                                                    dof_handler.end (),
+                                                    n_threads);
 
     Threads::ThreadMutex mutex;
     Threads::ThreadGroup<> threads;
@@ -379,18 +379,18 @@ namespace LaplaceSolver
 
     std::map<types::global_dof_index,double> boundary_value_map;
     VectorTools::interpolate_boundary_values (dof_handler,
-                                             0,
-                                             *boundary_values,
-                                             boundary_value_map);
-    
-    
+                                              0,
+                                              *boundary_values,
+                                              boundary_value_map);
+
+
     threads.join_all ();
     linear_system.hanging_node_constraints.condense (linear_system.matrix);
 
     MatrixTools::apply_boundary_values (boundary_value_map,
-                                       linear_system.matrix,
-                                       solution,
-                                       linear_system.rhs);
+                                        linear_system.matrix,
+                                        solution,
+                                        linear_system.rhs);
 
   }
 
@@ -398,12 +398,12 @@ namespace LaplaceSolver
   template <int dim>
   void
   Solver<dim>::assemble_matrix (LinearSystem                                         &linear_system,
-                               const typename hp::DoFHandler<dim>::active_cell_iterator &begin_cell,
-                               const typename hp::DoFHandler<dim>::active_cell_iterator &end_cell,
-                               Threads::ThreadMutex                                 &mutex) const
+                                const typename hp::DoFHandler<dim>::active_cell_iterator &begin_cell,
+                                const typename hp::DoFHandler<dim>::active_cell_iterator &end_cell,
+                                Threads::ThreadMutex                                 &mutex) const
   {
-    hp::FEValues<dim> fe_values (*fe, *quadrature, 
-                            update_gradients | update_JxW_values);
+    hp::FEValues<dim> fe_values (*fe, *quadrature,
+                                 update_gradients | update_JxW_values);
 
     const unsigned int   dofs_per_cell = (*fe)[0].dofs_per_cell;
     const unsigned int   n_q_points    = (*quadrature)[0].size();
@@ -413,28 +413,28 @@ namespace LaplaceSolver
     std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     for (typename hp::DoFHandler<dim>::active_cell_iterator cell=begin_cell;
-        cell!=end_cell; ++cell)
+         cell!=end_cell; ++cell)
       {
-       cell_matrix = 0;
+        cell_matrix = 0;
 
-       fe_values.reinit (cell);
+        fe_values.reinit (cell);
 
-       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-         for (unsigned int i=0; i<dofs_per_cell; ++i)
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += (fe_values.get_present_fe_values().shape_grad(i,q_point) *
-                                  fe_values.get_present_fe_values().shape_grad(j,q_point) *
-                                  fe_values.get_present_fe_values().JxW(q_point));
+        for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+          for (unsigned int i=0; i<dofs_per_cell; ++i)
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += (fe_values.get_present_fe_values().shape_grad(i,q_point) *
+                                   fe_values.get_present_fe_values().shape_grad(j,q_point) *
+                                   fe_values.get_present_fe_values().JxW(q_point));
 
 
-       cell->get_dof_indices (local_dof_indices);
+        cell->get_dof_indices (local_dof_indices);
 
         Threads::ThreadMutex::ScopedLock lock (mutex);
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           linear_system.matrix.add (local_dof_indices[i],
-                                     local_dof_indices[j],
-                                     cell_matrix(i,j));
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            linear_system.matrix.add (local_dof_indices[i],
+                                      local_dof_indices[j],
+                                      cell_matrix(i,j));
       };
   }
 
@@ -446,16 +446,16 @@ namespace LaplaceSolver
     hanging_node_constraints.clear ();
 
     void (*mhnc_p) (const hp::DoFHandler<dim> &,
-                   ConstraintMatrix      &)
+                    ConstraintMatrix &)
       = &DoFTools::make_hanging_node_constraints;
-    
+
     Threads::Thread<>
-      mhnc_thread = Threads::spawn (mhnc_p)(dof_handler,
-                                            hanging_node_constraints);
+    mhnc_thread = Threads::spawn (mhnc_p)(dof_handler,
+                                          hanging_node_constraints);
 
     sparsity_pattern.reinit (dof_handler.n_dofs(),
-                            dof_handler.n_dofs(),
-                            dof_handler.max_couplings_between_dofs());
+                             dof_handler.n_dofs(),
+                             dof_handler.max_couplings_between_dofs());
     DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
 
     mhnc_thread.join ();
@@ -491,30 +491,30 @@ namespace LaplaceSolver
   template <int dim>
   class PrimalSolver : public Solver<dim>
   {
-    public:
-      PrimalSolver (Triangulation<dim>       &triangulation,
-                   const hp::FECollection<dim> &fe,
-                   const hp::QCollection<dim>    &quadrature,
-                   const Function<dim>      &rhs_function,
-                   const Function<dim>      &boundary_values);
-    protected:
-      const SmartPointer<const Function<dim> > rhs_function;
-      virtual void assemble_rhs (Vector<double> &rhs) const;
+  public:
+    PrimalSolver (Triangulation<dim>       &triangulation,
+                  const hp::FECollection<dim> &fe,
+                  const hp::QCollection<dim>    &quadrature,
+                  const Function<dim>      &rhs_function,
+                  const Function<dim>      &boundary_values);
+  protected:
+    const SmartPointer<const Function<dim> > rhs_function;
+    virtual void assemble_rhs (Vector<double> &rhs) const;
   };
 
 
   template <int dim>
   PrimalSolver<dim>::
   PrimalSolver (Triangulation<dim>       &triangulation,
-               const hp::FECollection<dim> &fe,
-               const hp::QCollection<dim>    &quadrature,
-               const Function<dim>      &rhs_function,
-               const Function<dim>      &boundary_values)
-                 :
-                 Base<dim> (triangulation),
-                 Solver<dim> (triangulation, fe,
-                              quadrature, boundary_values),
-                  rhs_function (&rhs_function)
+                const hp::FECollection<dim> &fe,
+                const hp::QCollection<dim>    &quadrature,
+                const Function<dim>      &rhs_function,
+                const Function<dim>      &boundary_values)
+    :
+    Base<dim> (triangulation),
+    Solver<dim> (triangulation, fe,
+                 quadrature, boundary_values),
+    rhs_function (&rhs_function)
   {}
 
 
@@ -522,11 +522,11 @@ namespace LaplaceSolver
   template <int dim>
   void
   PrimalSolver<dim>::
-  assemble_rhs (Vector<double> &rhs) const 
+  assemble_rhs (Vector<double> &rhs) const
   {
-    hp::FEValues<dim> fe_values (*this->fe, *this->quadrature, 
-                            update_values | update_q_points  |
-                             update_JxW_values);
+    hp::FEValues<dim> fe_values (*this->fe, *this->quadrature,
+                                 update_values | update_q_points  |
+                                 update_JxW_values);
 
     const unsigned int   dofs_per_cell = (*this->fe)[0].dofs_per_cell;
     const unsigned int   n_q_points    = (*this->quadrature)[0].size();
@@ -536,24 +536,24 @@ namespace LaplaceSolver
     std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = this->dof_handler.begin_active(),
-      endc = this->dof_handler.end();
+    cell = this->dof_handler.begin_active(),
+    endc = this->dof_handler.end();
     for (; cell!=endc; ++cell)
       {
-       cell_rhs = 0;
-       fe_values.reinit (cell);
-       rhs_function->value_list (fe_values.get_present_fe_values().get_quadrature_points(),
-                                 rhs_values);
-      
-       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-         for (unsigned int i=0; i<dofs_per_cell; ++i)
-           cell_rhs(i) += (fe_values.get_present_fe_values().shape_value(i,q_point) *
-                           rhs_values[q_point] *
-                           fe_values.get_present_fe_values().JxW(q_point));
-
-       cell->get_dof_indices (local_dof_indices);
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         rhs(local_dof_indices[i]) += cell_rhs(i);
+        cell_rhs = 0;
+        fe_values.reinit (cell);
+        rhs_function->value_list (fe_values.get_present_fe_values().get_quadrature_points(),
+                                  rhs_values);
+
+        for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+          for (unsigned int i=0; i<dofs_per_cell; ++i)
+            cell_rhs(i) += (fe_values.get_present_fe_values().shape_value(i,q_point) *
+                            rhs_values[q_point] *
+                            fe_values.get_present_fe_values().JxW(q_point));
+
+        cell->get_dof_indices (local_dof_indices);
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          rhs(local_dof_indices[i]) += cell_rhs(i);
       };
   }
 
@@ -562,14 +562,14 @@ namespace LaplaceSolver
   template <int dim>
   class RefinementGlobal : public PrimalSolver<dim>
   {
-    public:
-      RefinementGlobal (Triangulation<dim>       &coarse_grid,
-                       const hp::FECollection<dim> &fe,
-                       const hp::QCollection<dim>    &quadrature,
-                       const Function<dim>      &rhs_function,
-                       const Function<dim>      &boundary_values);
-
-      virtual void refine_grid ();
+  public:
+    RefinementGlobal (Triangulation<dim>       &coarse_grid,
+                      const hp::FECollection<dim> &fe,
+                      const hp::QCollection<dim>    &quadrature,
+                      const Function<dim>      &rhs_function,
+                      const Function<dim>      &boundary_values);
+
+    virtual void refine_grid ();
   };
 
 
@@ -577,14 +577,14 @@ namespace LaplaceSolver
   template <int dim>
   RefinementGlobal<dim>::
   RefinementGlobal (Triangulation<dim>       &coarse_grid,
-                   const hp::FECollection<dim> &fe,
-                   const hp::QCollection<dim>    &quadrature,
-                   const Function<dim>      &rhs_function,
-                   const Function<dim>      &boundary_values)
-                 :
-                 Base<dim> (coarse_grid),
-                  PrimalSolver<dim> (coarse_grid, fe, quadrature,
-                                    rhs_function, boundary_values)
+                    const hp::FECollection<dim> &fe,
+                    const hp::QCollection<dim>    &quadrature,
+                    const Function<dim>      &rhs_function,
+                    const Function<dim>      &boundary_values)
+    :
+    Base<dim> (coarse_grid),
+    PrimalSolver<dim> (coarse_grid, fe, quadrature,
+                       rhs_function, boundary_values)
   {}
 
 
@@ -601,14 +601,14 @@ namespace LaplaceSolver
   template <int dim>
   class RefinementKelly : public PrimalSolver<dim>
   {
-    public:
-      RefinementKelly (Triangulation<dim>       &coarse_grid,
-                      const hp::FECollection<dim> &fe,
-                      const hp::QCollection<dim>    &quadrature,
-                      const Function<dim>      &rhs_function,
-                      const Function<dim>      &boundary_values);
-
-      virtual void refine_grid ();
+  public:
+    RefinementKelly (Triangulation<dim>       &coarse_grid,
+                     const hp::FECollection<dim> &fe,
+                     const hp::QCollection<dim>    &quadrature,
+                     const Function<dim>      &rhs_function,
+                     const Function<dim>      &boundary_values);
+
+    virtual void refine_grid ();
   };
 
 
@@ -616,14 +616,14 @@ namespace LaplaceSolver
   template <int dim>
   RefinementKelly<dim>::
   RefinementKelly (Triangulation<dim>       &coarse_grid,
-                  const hp::FECollection<dim> &fe,
-                  const hp::QCollection<dim>    &quadrature,
-                  const Function<dim>      &rhs_function,
-                  const Function<dim>      &boundary_values)
-                 :
-                 Base<dim> (coarse_grid),
-                  PrimalSolver<dim> (coarse_grid, fe, quadrature,
-                                    rhs_function, boundary_values)
+                   const hp::FECollection<dim> &fe,
+                   const hp::QCollection<dim>    &quadrature,
+                   const Function<dim>      &rhs_function,
+                   const Function<dim>      &boundary_values)
+    :
+    Base<dim> (coarse_grid),
+    PrimalSolver<dim> (coarse_grid, fe, quadrature,
+                       rhs_function, boundary_values)
   {}
 
 
@@ -634,13 +634,13 @@ namespace LaplaceSolver
   {
     Vector<float> estimated_error_per_cell (this->triangulation->n_active_cells());
     KellyErrorEstimator<dim>::estimate (this->dof_handler,
-                                       QGauss<dim-1>(3),
-                                       typename FunctionMap<dim>::type(),
-                                       this->solution,
-                                       estimated_error_per_cell);
+                                        QGauss<dim-1>(3),
+                                        typename FunctionMap<dim>::type(),
+                                        this->solution,
+                                        estimated_error_per_cell);
     GridRefinement::refine_and_coarsen_fixed_number (*this->triangulation,
-                                                    estimated_error_per_cell,
-                                                    0.3, 0.03);
+                                                     estimated_error_per_cell,
+                                                     0.3, 0.03);
     this->triangulation->execute_coarsening_and_refinement ();
   }
 
@@ -653,18 +653,18 @@ namespace LaplaceSolver
 template <int dim>
 class Solution : public Function<dim>
 {
-  public:
-    Solution () : Function<dim> () {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const;
+public:
+  Solution () : Function<dim> () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const;
 };
 
 
 template <int dim>
 double
 Solution<dim>::value (const Point<dim>   &p,
-                     const unsigned int  /*component*/) const
+                      const unsigned int  /*component*/) const
 {
   double q = p(0);
   for (unsigned int i=1; i<dim; ++i)
@@ -678,36 +678,36 @@ Solution<dim>::value (const Point<dim>   &p,
 template <int dim>
 class RightHandSide : public Function<dim>
 {
-  public:
-    RightHandSide () : Function<dim> () {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const;
+public:
+  RightHandSide () : Function<dim> () {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const;
 };
 
 
 template <int dim>
 double
 RightHandSide<dim>::value (const Point<dim>   &p,
-                          const unsigned int  /*component*/) const
+                           const unsigned int  /*component*/) const
 {
   double q = p(0);
   for (unsigned int i=1; i<dim; ++i)
     q += std::sin(10*p(i)+5*p(0)*p(0));
   const double u = std::exp(q);
   double t1 = 1,
-        t2 = 0,
-        t3 = 0;
+         t2 = 0,
+         t3 = 0;
   for (unsigned int i=1; i<dim; ++i)
     {
       t1 += std::cos(10*p(i)+5*p(0)*p(0)) * 10 * p(0);
       t2 += 10*std::cos(10*p(i)+5*p(0)*p(0)) -
-           100*std::sin(10*p(i)+5*p(0)*p(0)) * p(0)*p(0);
+            100*std::sin(10*p(i)+5*p(0)*p(0)) * p(0)*p(0);
       t3 += 100*std::cos(10*p(i)+5*p(0)*p(0))*std::cos(10*p(i)+5*p(0)*p(0)) -
-           100*std::sin(10*p(i)+5*p(0)*p(0));
+            100*std::sin(10*p(i)+5*p(0)*p(0));
     };
   t1 = t1*t1;
-  
+
   return -u*(t1+t2+t3);
 }
 
@@ -717,7 +717,7 @@ RightHandSide<dim>::value (const Point<dim>   &p,
 template <int dim>
 void
 run_simulation (LaplaceSolver::Base<dim>                     &solver,
-               const std::list<Evaluation::EvaluationBase<dim> *> &postprocessor_list)
+                const std::list<Evaluation::EvaluationBase<dim> *> &postprocessor_list)
 {
   deallog << "Refinement cycle: ";
 
@@ -728,18 +728,18 @@ run_simulation (LaplaceSolver::Base<dim>                     &solver,
       solver.solve_problem ();
 
       for (typename std::list<Evaluation::EvaluationBase<dim> *>::const_iterator
-            i = postprocessor_list.begin();
-          i != postprocessor_list.end(); ++i)
-       {
-         (*i)->set_refinement_cycle (step);
-         solver.postprocess (**i);
-       };
+           i = postprocessor_list.begin();
+           i != postprocessor_list.end(); ++i)
+        {
+          (*i)->set_refinement_cycle (step);
+          solver.postprocess (**i);
+        };
 
 
       if (solver.n_dofs() < 2000)
-       solver.refine_grid ();
+        solver.refine_grid ();
       else
-       break;
+        break;
     };
 
   deallog << std::endl;
@@ -748,12 +748,12 @@ run_simulation (LaplaceSolver::Base<dim>                     &solver,
 
 
 template <int dim>
-void solve_problem (const std::string &solver_name) 
+void solve_problem (const std::string &solver_name)
 {
   const std::string header = "Running tests with \"" + solver_name +
-                            "\" refinement criterion:";
+                             "\" refinement criterion:";
   deallog << header << std::endl
-           << std::string (header.size(), '-') << std::endl;
+          << std::string (header.size(), '-') << std::endl;
 
   Triangulation<dim> triangulation;
   GridGenerator::hyper_cube (triangulation, -1, 1);
@@ -763,27 +763,27 @@ void solve_problem (const std::string &solver_name)
   const RightHandSide<dim> rhs_function;
   const Solution<dim>      boundary_values;
 
-  LaplaceSolver::Base<dim> * solver = 0;
+  LaplaceSolver::Base<dim> *solver = 0;
   if (solver_name == "global")
     solver = new LaplaceSolver::RefinementGlobal<dim> (triangulation, fe,
-                                                      quadrature,
-                                                      rhs_function,
-                                                      boundary_values);
+                                                       quadrature,
+                                                       rhs_function,
+                                                       boundary_values);
   else if (solver_name == "kelly")
     solver = new LaplaceSolver::RefinementKelly<dim> (triangulation, fe,
-                                                     quadrature,
-                                                     rhs_function,
-                                                     boundary_values);
+                                                      quadrature,
+                                                      rhs_function,
+                                                      boundary_values);
   else
     AssertThrow (false, ExcNotImplemented());
 
   TableHandler results_table;
   Evaluation::PointValueEvaluation<dim>
-    postprocessor1 (Point<dim>(0.5,0.5), results_table);
+  postprocessor1 (Point<dim>(0.5,0.5), results_table);
 
   Evaluation::SolutionOutput<dim>
-    postprocessor2 (std::string("solution-")+solver_name,
-                   DataOut<dim>::gnuplot);
+  postprocessor2 (std::string("solution-")+solver_name,
+                  DataOut<dim>::gnuplot);
 
   std::list<Evaluation::EvaluationBase<dim> *> postprocessor_list;
   postprocessor_list.push_back (&postprocessor1);
@@ -799,41 +799,41 @@ void solve_problem (const std::string &solver_name)
 
 
 
-int main () 
+int main ()
 {
   try
     {
       logfile.precision(2);
       deallog << std::setprecision(2);
-  
+
       deallog.attach(logfile);
       deallog.depth_console(0);
       deallog.threshold_double(1.e-10);
 
       solve_problem<2> ("global");
-      solve_problem<2> ("kelly");      
+      solve_problem<2> ("kelly");
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 
index f8b3f1357743e69c9ae3fec92a9b67d9a4c17c0f..33ca1e312053439134001deb6e7927954e784dfd 100644 (file)
@@ -43,47 +43,47 @@ void make_grid (Triangulation<2> &triangulation)
 {
   const Point<2> center (1,0);
   const double inner_radius = 0.5,
-              outer_radius = 1.0;
+               outer_radius = 1.0;
   GridGenerator::hyper_shell (triangulation,
-                             center, inner_radius, outer_radius,
+                              center, inner_radius, outer_radius,
                               10);
 
   static const HyperShellBoundary<2> boundary_description(center);
   triangulation.set_boundary (0, boundary_description);
-  
+
   for (unsigned int step=0; step<5; ++step)
     {
       Triangulation<2>::active_cell_iterator
-       cell = triangulation.begin_active(),
-       endc = triangulation.end();
+      cell = triangulation.begin_active(),
+      endc = triangulation.end();
 
       for (; cell!=endc; ++cell)
-       for (unsigned int vertex=0;
-            vertex < GeometryInfo<2>::vertices_per_cell;
-            ++vertex)
-         {
+        for (unsigned int vertex=0;
+             vertex < GeometryInfo<2>::vertices_per_cell;
+             ++vertex)
+          {
             const double distance_from_center
               = center.distance (cell->vertex(vertex));
-           
-           if (std::fabs(distance_from_center - inner_radius) < 1e-10)
-             {
-               cell->set_refine_flag ();
-               break;
-             }
-         }
+
+            if (std::fabs(distance_from_center - inner_radius) < 1e-10)
+              {
+                cell->set_refine_flag ();
+                break;
+              }
+          }
 
       triangulation.execute_coarsening_and_refinement ();
     }
 }
 
 
-void distribute_dofs (hp::DoFHandler<2> &dof_handler) 
+void distribute_dofs (hp::DoFHandler<2> &dof_handler)
 {
   static const hp::FECollection<2> finite_element(FE_Q<2>(1));
   dof_handler.distribute_dofs (finite_element);
 
   SparsityPattern sparsity_pattern (dof_handler.n_dofs(),
-                                   dof_handler.n_dofs(),
+                                    dof_handler.n_dofs(),
                                     20);
 
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
@@ -94,11 +94,11 @@ void distribute_dofs (hp::DoFHandler<2> &dof_handler)
 
 
 
-void renumber_dofs (hp::DoFHandler<2> &dof_handler) 
+void renumber_dofs (hp::DoFHandler<2> &dof_handler)
 {
   DoFRenumbering::Cuthill_McKee (dof_handler);
   SparsityPattern sparsity_pattern (dof_handler.n_dofs(),
-                                   dof_handler.n_dofs());
+                                    dof_handler.n_dofs());
 
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
   sparsity_pattern.compress ();
@@ -110,13 +110,13 @@ void renumber_dofs (hp::DoFHandler<2> &dof_handler)
 
 
 
-int main () 
+int main ()
 {
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   Triangulation<2> triangulation;
   make_grid (triangulation);
index f0d3054f7ea2038035350a16274dea1b43c7243e..d77a6ffc1702bf9b1a8ec2a74a91f9f16e1779d3 100644 (file)
@@ -55,34 +55,34 @@ std::ofstream logfile("step-3/output");
 
 
 
-class LaplaceProblem 
+class LaplaceProblem
 {
-  public:
-    LaplaceProblem ();
-
-    void run ();
-    
-  private:
-    void make_grid_and_dofs ();
-    void assemble_system ();
-    void solve ();
-    void output_results () const;
-
-    Triangulation<2>     triangulation;
-    hp::FECollection<2>              fe;
-    hp::DoFHandler<2>        dof_handler;
-
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> system_matrix;
-
-    Vector<double>       solution;
-    Vector<double>       system_rhs;
+public:
+  LaplaceProblem ();
+
+  void run ();
+
+private:
+  void make_grid_and_dofs ();
+  void assemble_system ();
+  void solve ();
+  void output_results () const;
+
+  Triangulation<2>     triangulation;
+  hp::FECollection<2>              fe;
+  hp::DoFHandler<2>        dof_handler;
+
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> system_matrix;
+
+  Vector<double>       solution;
+  Vector<double>       system_rhs;
 };
 
 
 LaplaceProblem::LaplaceProblem () :
-                fe (FE_Q<2>(1)),
-               dof_handler (triangulation)
+  fe (FE_Q<2>(1)),
+  dof_handler (triangulation)
 {}
 
 
@@ -92,20 +92,20 @@ void LaplaceProblem::make_grid_and_dofs ()
   GridGenerator::hyper_cube (triangulation, -1, 1);
   triangulation.refine_global (5);
   deallog << "Number of active cells: "
-           << triangulation.n_active_cells()
-           << std::endl;
+          << triangulation.n_active_cells()
+          << std::endl;
   deallog << "Total number of cells: "
-           << triangulation.n_cells()
-           << std::endl;
-  
+          << triangulation.n_cells()
+          << std::endl;
+
   dof_handler.distribute_dofs (fe);
   deallog << "Number of degrees of freedom: "
-           << dof_handler.n_dofs()
-           << std::endl;
+          << dof_handler.n_dofs()
+          << std::endl;
 
   sparsity_pattern.reinit (dof_handler.n_dofs(),
-                          dof_handler.n_dofs(),
-                          dof_handler.max_couplings_between_dofs());
+                           dof_handler.n_dofs(),
+                           dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
   sparsity_pattern.compress();
 
@@ -117,12 +117,12 @@ void LaplaceProblem::make_grid_and_dofs ()
 
 
 
-void LaplaceProblem::assemble_system () 
+void LaplaceProblem::assemble_system ()
 {
   hp::QCollection<2>  quadrature_formula(QGauss<2>(2));
-  hp::FEValues<2> x_fe_values (fe, quadrature_formula, 
-                        update_values | update_gradients | update_JxW_values);
-  
+  hp::FEValues<2> x_fe_values (fe, quadrature_formula,
+                               update_values | update_gradients | update_JxW_values);
+
   const unsigned int   dofs_per_cell = fe[0].dofs_per_cell;
   const unsigned int   n_q_points    = quadrature_formula[0].size();
 
@@ -132,63 +132,63 @@ void LaplaceProblem::assemble_system ()
   std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
   hp::DoFHandler<2>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       x_fe_values.reinit (cell);
 
       const FEValues<2> &fe_values = x_fe_values.get_present_fe_values();
-      
+
       cell_matrix = 0;
       cell_rhs = 0;
 
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int j=0; j<dofs_per_cell; ++j)
-         for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-           cell_matrix(i,j) += (fe_values.shape_grad (i, q_point) *
-                                fe_values.shape_grad (j, q_point) *
-                                fe_values.JxW (q_point));
+        for (unsigned int j=0; j<dofs_per_cell; ++j)
+          for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+            cell_matrix(i,j) += (fe_values.shape_grad (i, q_point) *
+                                 fe_values.shape_grad (j, q_point) *
+                                 fe_values.JxW (q_point));
 
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-         cell_rhs(i) += (fe_values.shape_value (i, q_point) *
-                         1 *
-                         fe_values.JxW (q_point));
+        for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+          cell_rhs(i) += (fe_values.shape_value (i, q_point) *
+                          1 *
+                          fe_values.JxW (q_point));
 
       cell->get_dof_indices (local_dof_indices);
 
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int j=0; j<dofs_per_cell; ++j)
-         system_matrix.add (local_dof_indices[i],
-                            local_dof_indices[j],
-                            cell_matrix(i,j));
+        for (unsigned int j=0; j<dofs_per_cell; ++j)
+          system_matrix.add (local_dof_indices[i],
+                             local_dof_indices[j],
+                             cell_matrix(i,j));
 
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       system_rhs(local_dof_indices[i]) += cell_rhs(i);
+        system_rhs(local_dof_indices[i]) += cell_rhs(i);
     }
 
 
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           ZeroFunction<2>(),
-                                           boundary_values);
+                                            0,
+                                            ZeroFunction<2>(),
+                                            boundary_values);
   MatrixTools::apply_boundary_values (boundary_values,
-                                     system_matrix,
-                                     solution,
-                                     system_rhs);
+                                      system_matrix,
+                                      solution,
+                                      system_rhs);
 }
 
 
 
-void LaplaceProblem::solve () 
+void LaplaceProblem::solve ()
 {
   SolverControl           solver_control (1000, 1e-12);
   SolverCG<>              cg (solver_control);
 
   cg.solve (system_matrix, solution, system_rhs,
-           PreconditionIdentity());
+            PreconditionIdentity());
 }
 
 
@@ -205,7 +205,7 @@ void LaplaceProblem::output_results () const
 
 
 
-void LaplaceProblem::run () 
+void LaplaceProblem::run ()
 {
   make_grid_and_dofs ();
   assemble_system ();
@@ -215,14 +215,14 @@ void LaplaceProblem::run ()
 
 
 
-int main () 
+int main ()
 {
   logfile.precision(2);
   deallog << std::setprecision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   LaplaceProblem laplace_problem;
   laplace_problem.run ();
index 89f8c12f7134c238e4af396995aaeb4431bf6ee6..642d9ef77cd7517fb8132160b6212cc435b3fb41 100644 (file)
@@ -57,38 +57,38 @@ std::ofstream logfile("step-3a/output");
 
 
 
-class LaplaceProblem 
+class LaplaceProblem
 {
-  public:
-    LaplaceProblem ();
-
-    void run ();
-    
-  private:
-    void make_grid_and_dofs ();
-    void assemble_system ();
-    void solve ();
-    void output_results () const;
-
-    Triangulation<2>     triangulation;
-    hp::FECollection<2>              fe;
-    hp::DoFHandler<2>        dof_handler;
-
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> system_matrix;
-
-                                    // Although we do not have h-refinement,
-                                    // hanging nodes will inevitably appear
-                                    // due to different polynomial degrees.
-    ConstraintMatrix     hanging_node_constraints;
-    
-    Vector<double>       solution;
-    Vector<double>       system_rhs;
+public:
+  LaplaceProblem ();
+
+  void run ();
+
+private:
+  void make_grid_and_dofs ();
+  void assemble_system ();
+  void solve ();
+  void output_results () const;
+
+  Triangulation<2>     triangulation;
+  hp::FECollection<2>              fe;
+  hp::DoFHandler<2>        dof_handler;
+
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> system_matrix;
+
+  // Although we do not have h-refinement,
+  // hanging nodes will inevitably appear
+  // due to different polynomial degrees.
+  ConstraintMatrix     hanging_node_constraints;
+
+  Vector<double>       solution;
+  Vector<double>       system_rhs;
 };
 
 
 LaplaceProblem::LaplaceProblem () :
-               dof_handler (triangulation)
+  dof_handler (triangulation)
 {}
 
 
@@ -98,65 +98,65 @@ void LaplaceProblem::make_grid_and_dofs ()
   GridGenerator::hyper_cube (triangulation, -1, 1);
   triangulation.refine_global (2);
   deallog << "Number of active cells: "
-         << triangulation.n_active_cells()
-         << std::endl;
+          << triangulation.n_active_cells()
+          << std::endl;
   deallog << "Total number of cells: "
-         << triangulation.n_cells()
-         << std::endl;
+          << triangulation.n_cells()
+          << std::endl;
 
   hp::DoFHandler<2>::active_cell_iterator cell = dof_handler.begin_active (),
-                                         endc = dof_handler.end ();
-  
+                                          endc = dof_handler.end ();
+
   unsigned int cell_no = 0;
   for (; cell != endc; ++cell)
     {
       if (cell_no < triangulation.n_active_cells () / 2)
-       cell->set_active_fe_index (1);
+        cell->set_active_fe_index (1);
       else
-       cell->set_active_fe_index (0);
+        cell->set_active_fe_index (0);
       deallog << "Cell " << cell << " has fe_index=" << cell->active_fe_index()
-             << std::endl;
+              << std::endl;
       ++cell_no;
-    }  
-      
+    }
+
   dof_handler.distribute_dofs (fe);
   deallog << "Number of degrees of freedom: "
-         << dof_handler.n_dofs()
-         << std::endl;
+          << dof_handler.n_dofs()
+          << std::endl;
 
   solution.reinit (dof_handler.n_dofs());
   system_rhs.reinit (dof_handler.n_dofs());
 
-                                  // Create sparsity pattern.  
+  // Create sparsity pattern.
   sparsity_pattern.reinit (dof_handler.n_dofs(),
-                          dof_handler.n_dofs(),
-                          dof_handler.max_couplings_between_dofs());
+                           dof_handler.n_dofs(),
+                           dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
 
-                                  // Create constraints which stem from
-                                  // the different polynomial degrees on
-                                  // the different elements.
+  // Create constraints which stem from
+  // the different polynomial degrees on
+  // the different elements.
   hanging_node_constraints.clear ();
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          hanging_node_constraints);
+                                           hanging_node_constraints);
 
   hanging_node_constraints.print (deallog.get_file_stream());
 
   hanging_node_constraints.close ();
   hanging_node_constraints.condense (sparsity_pattern);
-  
+
   sparsity_pattern.compress();
   system_matrix.reinit (sparsity_pattern);
 }
 
 
 
-void LaplaceProblem::assemble_system () 
+void LaplaceProblem::assemble_system ()
 {
   hp::QCollection<2>  quadrature_formula(QGauss<2>(6));
-  hp::FEValues<2> x_fe_values (fe, quadrature_formula, 
-                              update_values | update_gradients | update_JxW_values);
-  
+  hp::FEValues<2> x_fe_values (fe, quadrature_formula,
+                               update_values | update_gradients | update_JxW_values);
+
   const unsigned int   max_dofs_per_cell = fe.max_dofs_per_cell ();
   const unsigned int   n_q_points    = quadrature_formula[0].size();
 
@@ -166,72 +166,72 @@ void LaplaceProblem::assemble_system ()
   std::vector<types::global_dof_index> local_dof_indices (max_dofs_per_cell);
 
   hp::DoFHandler<2>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       x_fe_values.reinit (cell);
 
       const FEValues<2> &fe_values = x_fe_values.get_present_fe_values();
-      
+
       cell_matrix = 0;
       cell_rhs = 0;
 
       const unsigned int dofs_per_cell = cell->get_fe ().dofs_per_cell;
-      
+
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int j=0; j<dofs_per_cell; ++j)
-         for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-           cell_matrix(i,j) += (fe_values.shape_grad (i, q_point) *
-                                fe_values.shape_grad (j, q_point) *
-                                fe_values.JxW (q_point));
+        for (unsigned int j=0; j<dofs_per_cell; ++j)
+          for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+            cell_matrix(i,j) += (fe_values.shape_grad (i, q_point) *
+                                 fe_values.shape_grad (j, q_point) *
+                                 fe_values.JxW (q_point));
 
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-         cell_rhs(i) += (fe_values.shape_value (i, q_point) *
-                         1 *
-                         fe_values.JxW (q_point));
+        for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+          cell_rhs(i) += (fe_values.shape_value (i, q_point) *
+                          1 *
+                          fe_values.JxW (q_point));
 
       local_dof_indices.resize (dofs_per_cell);
       cell->get_dof_indices (local_dof_indices);
 
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int j=0; j<dofs_per_cell; ++j)
-         system_matrix.add (local_dof_indices[i],
-                            local_dof_indices[j],
-                            cell_matrix(i,j));
+        for (unsigned int j=0; j<dofs_per_cell; ++j)
+          system_matrix.add (local_dof_indices[i],
+                             local_dof_indices[j],
+                             cell_matrix(i,j));
 
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       system_rhs(local_dof_indices[i]) += cell_rhs(i);
+        system_rhs(local_dof_indices[i]) += cell_rhs(i);
     }
 
-                                  // Include hanging nodes.
+  // Include hanging nodes.
   hanging_node_constraints.condense (system_matrix);
   hanging_node_constraints.condense (system_rhs);
-  
+
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           ZeroFunction<2>(),
-                                           boundary_values);
+                                            0,
+                                            ZeroFunction<2>(),
+                                            boundary_values);
   MatrixTools::apply_boundary_values (boundary_values,
-                                     system_matrix,
-                                     solution,
-                                     system_rhs);
+                                      system_matrix,
+                                      solution,
+                                      system_rhs);
 }
 
 
 
-void LaplaceProblem::solve () 
+void LaplaceProblem::solve ()
 {
   SolverControl           solver_control (1000, 1e-12);
   SolverCG<>              cg (solver_control);
 
   cg.solve (system_matrix, solution, system_rhs,
-           PreconditionIdentity());
+            PreconditionIdentity());
 
   solution.print (deallog.get_file_stream());
-  
+
   hanging_node_constraints.distribute (solution);
 }
 
@@ -249,12 +249,12 @@ void LaplaceProblem::output_results () const
 
 
 
-void LaplaceProblem::run () 
+void LaplaceProblem::run ()
 {
   FE_Q<2> fe_1 (1),
-    fe_2 (2),
-    fe_3 (3),
-    fe_4 (4);
+       fe_2 (2),
+       fe_3 (3),
+       fe_4 (4);
 
   fe.push_back (fe_1);
   fe.push_back (fe_2);
@@ -269,13 +269,13 @@ void LaplaceProblem::run ()
 
 
 
-int main () 
+int main ()
 {
   logfile.precision(6);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   LaplaceProblem laplace_problem;
   laplace_problem.run ();
index cc094b438966c56e5b5014444a596ec73191187b..8ff21a86e72b4792f4917cc86d8ddf1ba85fe4aa 100644 (file)
@@ -57,38 +57,38 @@ std::ofstream logfile("step-3b/output");
 
 
 
-class LaplaceProblem 
+class LaplaceProblem
 {
-  public:
-    LaplaceProblem ();
-
-    void run ();
-    
-  private:
-    void make_grid_and_dofs ();
-    void assemble_system ();
-    void solve ();
-    void output_results () const;
-
-    Triangulation<2>     triangulation;
-    hp::FECollection<2>              fe;
-    hp::DoFHandler<2>        dof_handler;
-
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> system_matrix;
-
-                                    // Although we do not have h-refinement,
-                                    // hanging nodes will inevitably appear
-                                    // due to different polynomial degrees.
-    ConstraintMatrix     hanging_node_constraints;
-    
-    Vector<double>       solution;
-    Vector<double>       system_rhs;
+public:
+  LaplaceProblem ();
+
+  void run ();
+
+private:
+  void make_grid_and_dofs ();
+  void assemble_system ();
+  void solve ();
+  void output_results () const;
+
+  Triangulation<2>     triangulation;
+  hp::FECollection<2>              fe;
+  hp::DoFHandler<2>        dof_handler;
+
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> system_matrix;
+
+  // Although we do not have h-refinement,
+  // hanging nodes will inevitably appear
+  // due to different polynomial degrees.
+  ConstraintMatrix     hanging_node_constraints;
+
+  Vector<double>       solution;
+  Vector<double>       system_rhs;
 };
 
 
 LaplaceProblem::LaplaceProblem () :
-               dof_handler (triangulation)
+  dof_handler (triangulation)
 {}
 
 
@@ -98,62 +98,62 @@ void LaplaceProblem::make_grid_and_dofs ()
   GridGenerator::hyper_cube (triangulation, -1, 1);
   triangulation.refine_global (4);
   deallog << "Number of active cells: "
-         << triangulation.n_active_cells()
-         << std::endl;
+          << triangulation.n_active_cells()
+          << std::endl;
   deallog << "Total number of cells: "
-         << triangulation.n_cells()
-         << std::endl;
+          << triangulation.n_cells()
+          << std::endl;
 
   hp::DoFHandler<2>::active_cell_iterator cell = dof_handler.begin_active (),
-                                         endc = dof_handler.end ();
-  
+                                          endc = dof_handler.end ();
+
   unsigned int cell_no = 0;
   for (; cell != endc; ++cell)
     {
       cell->set_active_fe_index (rand() % fe.size());
       deallog << "Cell " << cell << " has fe_index=" << cell->active_fe_index()
-             << std::endl;
+              << std::endl;
       ++cell_no;
-    }  
-      
+    }
+
   dof_handler.distribute_dofs (fe);
   deallog << "Number of degrees of freedom: "
-         << dof_handler.n_dofs()
-         << std::endl;
+          << dof_handler.n_dofs()
+          << std::endl;
 
   solution.reinit (dof_handler.n_dofs());
   system_rhs.reinit (dof_handler.n_dofs());
 
-                                  // Create sparsity pattern.  
+  // Create sparsity pattern.
   sparsity_pattern.reinit (dof_handler.n_dofs(),
-                          dof_handler.n_dofs(),
-                          dof_handler.max_couplings_between_dofs());
+                           dof_handler.n_dofs(),
+                           dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
 
-                                  // Create constraints which stem from
-                                  // the different polynomial degrees on
-                                  // the different elements.
+  // Create constraints which stem from
+  // the different polynomial degrees on
+  // the different elements.
   hanging_node_constraints.clear ();
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          hanging_node_constraints);
+                                           hanging_node_constraints);
 
   hanging_node_constraints.print (deallog.get_file_stream());
 
   hanging_node_constraints.close ();
   hanging_node_constraints.condense (sparsity_pattern);
-  
+
   sparsity_pattern.compress();
   system_matrix.reinit (sparsity_pattern);
 }
 
 
 
-void LaplaceProblem::assemble_system () 
+void LaplaceProblem::assemble_system ()
 {
   hp::QCollection<2>  quadrature_formula(QGauss<2>(6));
-  hp::FEValues<2> x_fe_values (fe, quadrature_formula, 
-                              update_values | update_gradients | update_JxW_values);
-  
+  hp::FEValues<2> x_fe_values (fe, quadrature_formula,
+                               update_values | update_gradients | update_JxW_values);
+
   const unsigned int   max_dofs_per_cell = fe.max_dofs_per_cell ();
   const unsigned int   n_q_points    = quadrature_formula[0].size();
 
@@ -163,72 +163,72 @@ void LaplaceProblem::assemble_system ()
   std::vector<types::global_dof_index> local_dof_indices (max_dofs_per_cell);
 
   hp::DoFHandler<2>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       x_fe_values.reinit (cell);
 
       const FEValues<2> &fe_values = x_fe_values.get_present_fe_values();
-      
+
       cell_matrix = 0;
       cell_rhs = 0;
 
       const unsigned int dofs_per_cell = cell->get_fe ().dofs_per_cell;
-      
+
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int j=0; j<dofs_per_cell; ++j)
-         for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-           cell_matrix(i,j) += (fe_values.shape_grad (i, q_point) *
-                                fe_values.shape_grad (j, q_point) *
-                                fe_values.JxW (q_point));
+        for (unsigned int j=0; j<dofs_per_cell; ++j)
+          for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+            cell_matrix(i,j) += (fe_values.shape_grad (i, q_point) *
+                                 fe_values.shape_grad (j, q_point) *
+                                 fe_values.JxW (q_point));
 
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-         cell_rhs(i) += (fe_values.shape_value (i, q_point) *
-                         1 *
-                         fe_values.JxW (q_point));
+        for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+          cell_rhs(i) += (fe_values.shape_value (i, q_point) *
+                          1 *
+                          fe_values.JxW (q_point));
 
       local_dof_indices.resize (dofs_per_cell);
       cell->get_dof_indices (local_dof_indices);
 
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int j=0; j<dofs_per_cell; ++j)
-         system_matrix.add (local_dof_indices[i],
-                            local_dof_indices[j],
-                            cell_matrix(i,j));
+        for (unsigned int j=0; j<dofs_per_cell; ++j)
+          system_matrix.add (local_dof_indices[i],
+                             local_dof_indices[j],
+                             cell_matrix(i,j));
 
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       system_rhs(local_dof_indices[i]) += cell_rhs(i);
+        system_rhs(local_dof_indices[i]) += cell_rhs(i);
     }
 
-                                  // Include hanging nodes.
+  // Include hanging nodes.
   hanging_node_constraints.condense (system_matrix);
   hanging_node_constraints.condense (system_rhs);
-  
+
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           ZeroFunction<2>(),
-                                           boundary_values);
+                                            0,
+                                            ZeroFunction<2>(),
+                                            boundary_values);
   MatrixTools::apply_boundary_values (boundary_values,
-                                     system_matrix,
-                                     solution,
-                                     system_rhs);
+                                      system_matrix,
+                                      solution,
+                                      system_rhs);
 }
 
 
 
-void LaplaceProblem::solve () 
+void LaplaceProblem::solve ()
 {
   SolverControl           solver_control (1000, 1e-12);
   SolverCG<>              cg (solver_control);
 
   cg.solve (system_matrix, solution, system_rhs,
-           PreconditionIdentity());
+            PreconditionIdentity());
 
   solution.print (deallog.get_file_stream());
-  
+
   hanging_node_constraints.distribute (solution);
 }
 
@@ -246,14 +246,14 @@ void LaplaceProblem::output_results () const
 
 
 
-void LaplaceProblem::run () 
+void LaplaceProblem::run ()
 {
   FE_Q<2> fe_1 (1),
-    fe_2 (2),
-    fe_3 (3),
-    fe_4 (4),
-    fe_5 (5),
-    fe_6 (6);
+       fe_2 (2),
+       fe_3 (3),
+       fe_4 (4),
+       fe_5 (5),
+       fe_6 (6);
 
   fe.push_back (fe_1);
   fe.push_back (fe_2);
@@ -269,13 +269,13 @@ void LaplaceProblem::run ()
 
 
 
-int main () 
+int main ()
 {
   logfile.precision(6);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   LaplaceProblem laplace_problem;
   laplace_problem.run ();
index 9ab3d64c4bac0d90d82bfd8375f4fa39ee93b536..2d3e06c504677f3e04bafb05d8c09871b8348eef 100644 (file)
@@ -56,38 +56,38 @@ std::ofstream logfile("step-3c/output");
 
 
 
-class LaplaceProblem 
+class LaplaceProblem
 {
-  public:
-    LaplaceProblem ();
-
-    void run ();
-    
-  private:
-    void make_grid_and_dofs ();
-    void assemble_system ();
-    void solve ();
-    void output_results () const;
-
-    Triangulation<2>     triangulation;
-    hp::FECollection<2>              fe;
-    hp::DoFHandler<2>        dof_handler;
-
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> system_matrix;
-
-                                    // Although we do not have h-refinement,
-                                    // hanging nodes will inevitably appear
-                                    // due to different polynomial degrees.
-    ConstraintMatrix     hanging_node_constraints;
-    
-    Vector<double>       solution;
-    Vector<double>       system_rhs;
+public:
+  LaplaceProblem ();
+
+  void run ();
+
+private:
+  void make_grid_and_dofs ();
+  void assemble_system ();
+  void solve ();
+  void output_results () const;
+
+  Triangulation<2>     triangulation;
+  hp::FECollection<2>              fe;
+  hp::DoFHandler<2>        dof_handler;
+
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> system_matrix;
+
+  // Although we do not have h-refinement,
+  // hanging nodes will inevitably appear
+  // due to different polynomial degrees.
+  ConstraintMatrix     hanging_node_constraints;
+
+  Vector<double>       solution;
+  Vector<double>       system_rhs;
 };
 
 
 LaplaceProblem::LaplaceProblem () :
-               dof_handler (triangulation)
+  dof_handler (triangulation)
 {}
 
 
@@ -97,66 +97,66 @@ void LaplaceProblem::make_grid_and_dofs ()
   GridGenerator::hyper_cube (triangulation, -1, 1);
   triangulation.refine_global (4);
   deallog << "Number of active cells: "
-         << triangulation.n_active_cells()
-         << std::endl;
+          << triangulation.n_active_cells()
+          << std::endl;
   deallog << "Total number of cells: "
-         << triangulation.n_cells()
-         << std::endl;
+          << triangulation.n_cells()
+          << std::endl;
 
   hp::DoFHandler<2>::active_cell_iterator cell = dof_handler.begin_active (),
-                                         endc = dof_handler.end ();
-  
+                                          endc = dof_handler.end ();
+
   unsigned int cell_no = 0;
   for (; cell != endc; ++cell)
     {
       cell->set_active_fe_index (rand() % fe.size());
       deallog << "Cell " << cell << " has fe_index=" << cell->active_fe_index()
-             << std::endl;
+              << std::endl;
       ++cell_no;
-    }  
-      
+    }
+
   dof_handler.distribute_dofs (fe);
   deallog << "Number of degrees of freedom: "
-         << dof_handler.n_dofs()
-         << std::endl;
+          << dof_handler.n_dofs()
+          << std::endl;
 
   solution.reinit (dof_handler.n_dofs());
   system_rhs.reinit (dof_handler.n_dofs());
 
-                                  // Create sparsity pattern.  
+  // Create sparsity pattern.
   sparsity_pattern.reinit (dof_handler.n_dofs(),
-                          dof_handler.n_dofs(),
-                          dof_handler.max_couplings_between_dofs());
+                           dof_handler.n_dofs(),
+                           dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
 
-                                  // Create constraints which stem from
-                                  // the different polynomial degrees on
-                                  // the different elements.
+  // Create constraints which stem from
+  // the different polynomial degrees on
+  // the different elements.
   hanging_node_constraints.clear ();
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          hanging_node_constraints);
+                                           hanging_node_constraints);
 
   hanging_node_constraints.print (deallog.get_file_stream());
 
   hanging_node_constraints.close ();
   hanging_node_constraints.condense (sparsity_pattern);
-  
+
   sparsity_pattern.compress();
   system_matrix.reinit (sparsity_pattern);
 }
 
 
 
-void LaplaceProblem::assemble_system () 
+void LaplaceProblem::assemble_system ()
 {
   hp::QCollection<2>  quadrature_formula;
 
   for (unsigned int p = 0; p < fe.size (); ++p)
     quadrature_formula.push_back (QGauss<2> (p + 2));
 
-  hp::FEValues<2> x_fe_values (fe, quadrature_formula, 
-                              update_values | update_gradients | update_JxW_values);
-  
+  hp::FEValues<2> x_fe_values (fe, quadrature_formula,
+                               update_values | update_gradients | update_JxW_values);
+
   const unsigned int   max_dofs_per_cell = fe.max_dofs_per_cell ();
 
   FullMatrix<double>   cell_matrix (max_dofs_per_cell, max_dofs_per_cell);
@@ -165,72 +165,72 @@ void LaplaceProblem::assemble_system ()
   std::vector<types::global_dof_index> local_dof_indices (max_dofs_per_cell);
 
   hp::DoFHandler<2>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       x_fe_values.reinit (cell);
 
       const FEValues<2> &fe_values = x_fe_values.get_present_fe_values();
-      
+
       cell_matrix = 0;
       cell_rhs = 0;
 
       const unsigned int dofs_per_cell = cell->get_fe ().dofs_per_cell;
       const unsigned int   n_q_points    = quadrature_formula[cell->active_fe_index ()].size();
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int j=0; j<dofs_per_cell; ++j)
-         for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-           cell_matrix(i,j) += (fe_values.shape_grad (i, q_point) *
-                                fe_values.shape_grad (j, q_point) *
-                                fe_values.JxW (q_point));
+        for (unsigned int j=0; j<dofs_per_cell; ++j)
+          for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+            cell_matrix(i,j) += (fe_values.shape_grad (i, q_point) *
+                                 fe_values.shape_grad (j, q_point) *
+                                 fe_values.JxW (q_point));
 
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-         cell_rhs(i) += (fe_values.shape_value (i, q_point) *
-                         1 *
-                         fe_values.JxW (q_point));
+        for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+          cell_rhs(i) += (fe_values.shape_value (i, q_point) *
+                          1 *
+                          fe_values.JxW (q_point));
 
       local_dof_indices.resize (dofs_per_cell);
       cell->get_dof_indices (local_dof_indices);
 
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int j=0; j<dofs_per_cell; ++j)
-         system_matrix.add (local_dof_indices[i],
-                            local_dof_indices[j],
-                            cell_matrix(i,j));
+        for (unsigned int j=0; j<dofs_per_cell; ++j)
+          system_matrix.add (local_dof_indices[i],
+                             local_dof_indices[j],
+                             cell_matrix(i,j));
 
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       system_rhs(local_dof_indices[i]) += cell_rhs(i);
+        system_rhs(local_dof_indices[i]) += cell_rhs(i);
     }
 
-                                  // Include hanging nodes.
+  // Include hanging nodes.
   hanging_node_constraints.condense (system_matrix);
   hanging_node_constraints.condense (system_rhs);
-  
+
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           ZeroFunction<2>(),
-                                           boundary_values);
+                                            0,
+                                            ZeroFunction<2>(),
+                                            boundary_values);
   MatrixTools::apply_boundary_values (boundary_values,
-                                     system_matrix,
-                                     solution,
-                                     system_rhs);
+                                      system_matrix,
+                                      solution,
+                                      system_rhs);
 }
 
 
 
-void LaplaceProblem::solve () 
+void LaplaceProblem::solve ()
 {
   SolverControl           solver_control (1000, 1e-6);
   SolverCG<>              cg (solver_control);
 
   cg.solve (system_matrix, solution, system_rhs,
-           PreconditionIdentity());
+            PreconditionIdentity());
 
   solution.print (deallog.get_file_stream());
-  
+
   hanging_node_constraints.distribute (solution);
 }
 
@@ -248,14 +248,14 @@ void LaplaceProblem::output_results () const
 
 
 
-void LaplaceProblem::run () 
+void LaplaceProblem::run ()
 {
   FE_Q<2> fe_1 (1),
-    fe_2 (2),
-    fe_3 (3),
-    fe_4 (4),
-    fe_5 (5),
-    fe_6 (6);
+       fe_2 (2),
+       fe_3 (3),
+       fe_4 (4),
+       fe_5 (5),
+       fe_6 (6);
 
   fe.push_back (fe_1);
   fe.push_back (fe_2);
@@ -272,13 +272,13 @@ void LaplaceProblem::run ()
 
 
 
-int main () 
+int main ()
 {
   logfile.precision(6);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   LaplaceProblem laplace_problem;
   laplace_problem.run ();
index 2cae4679042a1d7670948a070d90799860a74633..b7530311e7245d8cecce3968279a82b3f9bbcfdc 100644 (file)
@@ -53,51 +53,51 @@ std::ofstream logfile("step-4/output");
 
 
 template <int dim>
-class LaplaceProblem 
+class LaplaceProblem
 {
-  public:
-    LaplaceProblem ();
-    void run ();
-    
-  private:
-    void make_grid_and_dofs ();
-    void assemble_system ();
-    void solve ();
-    void output_results () const;
-
-    Triangulation<dim>   triangulation;
-    hp::FECollection<dim>            fe;
-    hp::DoFHandler<dim>      dof_handler;
-
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> system_matrix;
-
-    Vector<double>       solution;
-    Vector<double>       system_rhs;
+public:
+  LaplaceProblem ();
+  void run ();
+
+private:
+  void make_grid_and_dofs ();
+  void assemble_system ();
+  void solve ();
+  void output_results () const;
+
+  Triangulation<dim>   triangulation;
+  hp::FECollection<dim>            fe;
+  hp::DoFHandler<dim>      dof_handler;
+
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> system_matrix;
+
+  Vector<double>       solution;
+  Vector<double>       system_rhs;
 };
 
 
 
 template <int dim>
-class RightHandSide : public Function<dim> 
+class RightHandSide : public Function<dim>
 {
-  public:
-    RightHandSide () : Function<dim>() {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
+public:
+  RightHandSide () : Function<dim>() {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
 };
 
 
 
 template <int dim>
-class BoundaryValues : public Function<dim> 
+class BoundaryValues : public Function<dim>
 {
-  public:
-    BoundaryValues () : Function<dim>() {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
+public:
+  BoundaryValues () : Function<dim>() {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
 };
 
 
@@ -105,7 +105,7 @@ class BoundaryValues : public Function<dim>
 
 template <int dim>
 double RightHandSide<dim>::value (const Point<dim> &p,
-                                 const unsigned int /*component*/) const 
+                                  const unsigned int /*component*/) const
 {
   double return_value = 0;
   for (unsigned int i=0; i<dim; ++i)
@@ -117,7 +117,7 @@ double RightHandSide<dim>::value (const Point<dim> &p,
 
 template <int dim>
 double BoundaryValues<dim>::value (const Point<dim> &p,
-                                  const unsigned int /*component*/) const 
+                                   const unsigned int /*component*/) const
 {
   return p.square();
 }
@@ -130,8 +130,8 @@ double BoundaryValues<dim>::value (const Point<dim> &p,
 
 template <int dim>
 LaplaceProblem<dim>::LaplaceProblem () :
-                fe (FE_Q<dim>(1)),
-               dof_handler (triangulation)
+  fe (FE_Q<dim>(1)),
+  dof_handler (triangulation)
 {}
 
 
@@ -141,23 +141,23 @@ void LaplaceProblem<dim>::make_grid_and_dofs ()
 {
   GridGenerator::hyper_cube (triangulation, -1, 1);
   triangulation.refine_global (6-dim);
-  
+
   deallog << "   Number of active cells: "
-           << triangulation.n_active_cells()
-           << std::endl
-           << "   Total number of cells: "
-           << triangulation.n_cells()
-           << std::endl;
+          << triangulation.n_active_cells()
+          << std::endl
+          << "   Total number of cells: "
+          << triangulation.n_cells()
+          << std::endl;
 
   dof_handler.distribute_dofs (fe);
 
   deallog << "   Number of degrees of freedom: "
-           << dof_handler.n_dofs()
-           << std::endl;
+          << dof_handler.n_dofs()
+          << std::endl;
 
   sparsity_pattern.reinit (dof_handler.n_dofs(),
-                          dof_handler.n_dofs(),
-                          dof_handler.max_couplings_between_dofs());
+                           dof_handler.n_dofs(),
+                           dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
   sparsity_pattern.compress();
 
@@ -170,15 +170,15 @@ void LaplaceProblem<dim>::make_grid_and_dofs ()
 
 
 template <int dim>
-void LaplaceProblem<dim>::assemble_system () 
-{  
+void LaplaceProblem<dim>::assemble_system ()
+{
   hp::QCollection<dim>  quadrature_formula(QGauss<dim>(2));
 
   const RightHandSide<dim> right_hand_side;
 
-  hp::FEValues<dim> x_fe_values (fe, quadrature_formula, 
-                          update_values   | update_gradients |
-                           update_q_points | update_JxW_values);
+  hp::FEValues<dim> x_fe_values (fe, quadrature_formula,
+                                 update_values   | update_gradients |
+                                 update_q_points | update_JxW_values);
 
   const unsigned int   dofs_per_cell = fe[0].dofs_per_cell;
   const unsigned int   n_q_points    = quadrature_formula[0].size();
@@ -189,66 +189,66 @@ void LaplaceProblem<dim>::assemble_system ()
   std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
   typename hp::DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active(),
-                                                endc = dof_handler.end();
+                                                     endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       x_fe_values.reinit (cell);
 
       const FEValues<dim> &fe_values = x_fe_values.get_present_fe_values();
-      
+
       cell_matrix = 0;
       cell_rhs = 0;
 
       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         {
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += (fe_values.shape_grad (i, q_point) *
-                                  fe_values.shape_grad (j, q_point) *
-                                  fe_values.JxW (q_point));
-
-           cell_rhs(i) += (fe_values.shape_value (i, q_point) *
-                           right_hand_side.value (fe_values.quadrature_point (q_point)) *
-                           fe_values.JxW (q_point));
-         }
-      
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += (fe_values.shape_grad (i, q_point) *
+                                   fe_values.shape_grad (j, q_point) *
+                                   fe_values.JxW (q_point));
+
+            cell_rhs(i) += (fe_values.shape_value (i, q_point) *
+                            right_hand_side.value (fe_values.quadrature_point (q_point)) *
+                            fe_values.JxW (q_point));
+          }
+
       cell->get_dof_indices (local_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           system_matrix.add (local_dof_indices[i],
-                              local_dof_indices[j],
-                              cell_matrix(i,j));
-         
-         system_rhs(local_dof_indices[i]) += cell_rhs(i);
-       }
+        {
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            system_matrix.add (local_dof_indices[i],
+                               local_dof_indices[j],
+                               cell_matrix(i,j));
+
+          system_rhs(local_dof_indices[i]) += cell_rhs(i);
+        }
     }
 
-  
+
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           BoundaryValues<dim>(),
-                                           boundary_values);
+                                            0,
+                                            BoundaryValues<dim>(),
+                                            boundary_values);
   MatrixTools::apply_boundary_values (boundary_values,
-                                     system_matrix,
-                                     solution,
-                                     system_rhs);
+                                      system_matrix,
+                                      solution,
+                                      system_rhs);
 }
 
 
 
 template <int dim>
-void LaplaceProblem<dim>::solve () 
+void LaplaceProblem<dim>::solve ()
 {
   SolverControl           solver_control (1000, 1e-12);
   SolverCG<>              cg (solver_control);
   cg.solve (system_matrix, solution, system_rhs,
-           PreconditionIdentity());
+            PreconditionIdentity());
 
   deallog << "   " << solver_control.last_step()
-           << " CG iterations needed to obtain convergence."
-           << std::endl;
+          << " CG iterations needed to obtain convergence."
+          << std::endl;
 }
 
 
@@ -270,10 +270,10 @@ void LaplaceProblem<dim>::output_results () const
 
 
 template <int dim>
-void LaplaceProblem<dim>::run () 
+void LaplaceProblem<dim>::run ()
 {
   deallog << "Solving problem in " << dim << " space dimensions." << std::endl;
-  
+
   make_grid_and_dofs();
   assemble_system ();
   solve ();
@@ -282,25 +282,25 @@ void LaplaceProblem<dim>::run ()
 
 
 
-int main () 
+int main ()
 {
   logfile.precision(2);
   deallog << std::setprecision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   deallog.depth_console (0);
   {
     LaplaceProblem<2> laplace_problem_2d;
     laplace_problem_2d.run ();
   }
-  
+
   {
     LaplaceProblem<3> laplace_problem_3d;
     laplace_problem_3d.run ();
   }
-  
+
   return 0;
 }
index 3fcfe77cfd7f4247a1a285d1d9b0b6fed0945088..8636d8e790f6497aa7d850dd4e794461986cc59b 100644 (file)
@@ -55,50 +55,50 @@ std::ofstream logfile("step-5/output");
 
 
 template <int dim>
-class LaplaceProblem 
+class LaplaceProblem
 {
-  public:
-    LaplaceProblem ();
-    void run ();
-    
-  private:
-    void setup_system ();
-    void assemble_system ();
-    void solve ();
-    void output_results (const unsigned int cycle) const;
-
-    Triangulation<dim>   triangulation;
-    hp::FECollection<dim>            fe;
-    hp::DoFHandler<dim>      dof_handler;
-
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> system_matrix;
-
-    Vector<double>       solution;
-    Vector<double>       system_rhs;
+public:
+  LaplaceProblem ();
+  void run ();
+
+private:
+  void setup_system ();
+  void assemble_system ();
+  void solve ();
+  void output_results (const unsigned int cycle) const;
+
+  Triangulation<dim>   triangulation;
+  hp::FECollection<dim>            fe;
+  hp::DoFHandler<dim>      dof_handler;
+
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> system_matrix;
+
+  Vector<double>       solution;
+  Vector<double>       system_rhs;
 };
 
 
 
 template <int dim>
-class Coefficient : public Function<dim> 
+class Coefficient : public Function<dim>
 {
-  public:
-    Coefficient ()  : Function<dim>() {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
-    
-    virtual void value_list (const std::vector<Point<dim> > &points,
-                            std::vector<double>            &values,
-                            const unsigned int              component = 0) const;
+public:
+  Coefficient ()  : Function<dim>() {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
+
+  virtual void value_list (const std::vector<Point<dim> > &points,
+                           std::vector<double>            &values,
+                           const unsigned int              component = 0) const;
 };
 
 
 
 template <int dim>
 double Coefficient<dim>::value (const Point<dim> &p,
-                               const unsigned int /*component*/) const 
+                                const unsigned int /*component*/) const
 {
   if (p.square() < 0.5*0.5)
     return 20;
@@ -111,23 +111,23 @@ double Coefficient<dim>::value (const Point<dim> &p,
 
 template <int dim>
 void Coefficient<dim>::value_list (const std::vector<Point<dim> > &points,
-                                  std::vector<double>            &values,
-                                  const unsigned int              component) const 
+                                   std::vector<double>            &values,
+                                   const unsigned int              component) const
 {
-  Assert (values.size() == points.size(), 
-         ExcDimensionMismatch (values.size(), points.size()));
-  
-  Assert (component == 0, 
-         ExcIndexRange (component, 0, 1));
+  Assert (values.size() == points.size(),
+          ExcDimensionMismatch (values.size(), points.size()));
+
+  Assert (component == 0,
+          ExcIndexRange (component, 0, 1));
 
   const unsigned int n_points = points.size();
 
   for (unsigned int i=0; i<n_points; ++i)
     {
       if (points[i].square() < 0.5*0.5)
-       values[i] = 20;
+        values[i] = 20;
       else
-       values[i] = 1;
+        values[i] = 1;
     }
 }
 
@@ -136,8 +136,8 @@ void Coefficient<dim>::value_list (const std::vector<Point<dim> > &points,
 
 template <int dim>
 LaplaceProblem<dim>::LaplaceProblem () :
-                fe (FE_Q<dim>(1)),
-               dof_handler (triangulation)
+  fe (FE_Q<dim>(1)),
+  dof_handler (triangulation)
 {}
 
 
@@ -149,12 +149,12 @@ void LaplaceProblem<dim>::setup_system ()
   dof_handler.distribute_dofs (fe);
 
   deallog << "   Number of degrees of freedom: "
-           << dof_handler.n_dofs()
-           << std::endl;
+          << dof_handler.n_dofs()
+          << std::endl;
 
   sparsity_pattern.reinit (dof_handler.n_dofs(),
-                          dof_handler.n_dofs(),
-                          dof_handler.max_couplings_between_dofs());
+                           dof_handler.n_dofs(),
+                           dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
   sparsity_pattern.compress();
 
@@ -168,13 +168,13 @@ void LaplaceProblem<dim>::setup_system ()
 
 
 template <int dim>
-void LaplaceProblem<dim>::assemble_system () 
-{  
+void LaplaceProblem<dim>::assemble_system ()
+{
   hp::QCollection<dim>  quadrature_formula(QGauss<dim>(2));
 
-  hp::FEValues<dim> x_fe_values (fe, quadrature_formula, 
-                          update_values    |  update_gradients |
-                          update_q_points  |  update_JxW_values);
+  hp::FEValues<dim> x_fe_values (fe, quadrature_formula,
+                                 update_values    |  update_gradients |
+                                 update_q_points  |  update_JxW_values);
 
   const unsigned int   dofs_per_cell = fe[0].dofs_per_cell;
   const unsigned int   n_q_points    = quadrature_formula[0].size();
@@ -188,8 +188,8 @@ void LaplaceProblem<dim>::assemble_system ()
   std::vector<double>    coefficient_values (n_q_points);
 
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       cell_matrix = 0;
@@ -199,50 +199,50 @@ void LaplaceProblem<dim>::assemble_system ()
       const FEValues<2> &fe_values = x_fe_values.get_present_fe_values();
 
       coefficient.value_list (fe_values.get_quadrature_points(),
-                             coefficient_values);
-      
+                              coefficient_values);
+
       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         {
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += (coefficient_values[q_point] *
-                                  fe_values.shape_grad(i,q_point) *
-                                  fe_values.shape_grad(j,q_point) *
-                                  fe_values.JxW(q_point));
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += (coefficient_values[q_point] *
+                                   fe_values.shape_grad(i,q_point) *
+                                   fe_values.shape_grad(j,q_point) *
+                                   fe_values.JxW(q_point));
 
-           cell_rhs(i) += (fe_values.shape_value(i,q_point) *
-                           1.0 *
-                           fe_values.JxW(q_point));
-         }
+            cell_rhs(i) += (fe_values.shape_value(i,q_point) *
+                            1.0 *
+                            fe_values.JxW(q_point));
+          }
 
 
       cell->get_dof_indices (local_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           system_matrix.add (local_dof_indices[i],
-                              local_dof_indices[j],
-                              cell_matrix(i,j));
-         
-         system_rhs(local_dof_indices[i]) += cell_rhs(i);
-       }
+        {
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            system_matrix.add (local_dof_indices[i],
+                               local_dof_indices[j],
+                               cell_matrix(i,j));
+
+          system_rhs(local_dof_indices[i]) += cell_rhs(i);
+        }
     }
 
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           ZeroFunction<dim>(),
-                                           boundary_values);
+                                            0,
+                                            ZeroFunction<dim>(),
+                                            boundary_values);
   MatrixTools::apply_boundary_values (boundary_values,
-                                     system_matrix,
-                                     solution,
-                                     system_rhs);
+                                      system_matrix,
+                                      solution,
+                                      system_rhs);
 }
 
 
 
 template <int dim>
-void LaplaceProblem<dim>::solve () 
+void LaplaceProblem<dim>::solve ()
 {
   SolverControl           solver_control (1000, 1e-12);
   SolverCG<>              cg (solver_control);
@@ -251,11 +251,11 @@ void LaplaceProblem<dim>::solve ()
   preconditioner.initialize(system_matrix, 1.2);
 
   cg.solve (system_matrix, solution, system_rhs,
-           preconditioner);
+            preconditioner);
 
   deallog << "   " << solver_control.last_step()
-           << " CG iterations needed to obtain convergence."
-           << std::endl;
+          << " CG iterations needed to obtain convergence."
+          << std::endl;
 }
 
 
@@ -263,10 +263,10 @@ void LaplaceProblem<dim>::solve ()
 template <int dim>
 void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
 {
-                                   // reduce output a bit
+  // reduce output a bit
   if (cycle >= 2)
     return;
-  
+
   DataOut<dim,hp::DoFHandler<dim> > data_out;
 
   data_out.attach_dof_handler (dof_handler);
@@ -287,33 +287,33 @@ void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
 
 
 template <int dim>
-void LaplaceProblem<dim>::run () 
+void LaplaceProblem<dim>::run ()
 {
   for (unsigned int cycle=0; cycle<6; ++cycle)
     {
       deallog << "Cycle " << cycle << ':' << std::endl;
 
       if (cycle != 0)
-       triangulation.refine_global (1);
+        triangulation.refine_global (1);
       else
-       {
-         GridIn<dim> grid_in;
-         grid_in.attach_triangulation (triangulation);
-         std::ifstream input_file("step-5/circle-grid.inp");
-         Assert (dim==2, ExcInternalError());
-         
-         grid_in.read_ucd (input_file);
-
-         static const HyperBallBoundary<dim> boundary;
-         triangulation.set_boundary (0, boundary);
-       }
+        {
+          GridIn<dim> grid_in;
+          grid_in.attach_triangulation (triangulation);
+          std::ifstream input_file("step-5/circle-grid.inp");
+          Assert (dim==2, ExcInternalError());
+
+          grid_in.read_ucd (input_file);
+
+          static const HyperBallBoundary<dim> boundary;
+          triangulation.set_boundary (0, boundary);
+        }
 
       deallog << "   Number of active cells: "
-               << triangulation.n_active_cells()
-               << std::endl
-               << "   Total number of cells: "
-               << triangulation.n_cells()
-               << std::endl;
+              << triangulation.n_active_cells()
+              << std::endl
+              << "   Total number of cells: "
+              << triangulation.n_cells()
+              << std::endl;
 
       setup_system ();
       assemble_system ();
@@ -324,26 +324,26 @@ void LaplaceProblem<dim>::run ()
 
 
 
-int main () 
+int main ()
 {
   logfile.precision(2);
   deallog << std::setprecision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   deallog.depth_console (0);
 
   LaplaceProblem<2> laplace_problem_2d;
   laplace_problem_2d.run ();
 
-/*  
-  Coefficient<2>    coefficient;
-  std::vector<Point<2> > points (2);
-  std::vector<double>    coefficient_values (1);
-  coefficient.value_list (points, coefficient_values);
-*/
-  
+  /*
+    Coefficient<2>    coefficient;
+    std::vector<Point<2> > points (2);
+    std::vector<double>    coefficient_values (1);
+    coefficient.value_list (points, coefficient_values);
+  */
+
   return 0;
 }
index cb4746e7d20bac8e1fb2f7d3a2b3effdd9b51e44..6cbf55d6a32913a624a510faf9f2b08d96fdd2fb 100644 (file)
@@ -63,57 +63,57 @@ std::ofstream logfile("step-6/output");
 
 
 template <int dim>
-class LaplaceProblem 
+class LaplaceProblem
 {
-  public:
-    LaplaceProblem ();
-    ~LaplaceProblem ();
+public:
+  LaplaceProblem ();
+  ~LaplaceProblem ();
 
-    void run ();
-    
-  private:
-    void setup_system ();
-    void assemble_system ();
-    void solve ();
-    void refine_grid ();
-    void output_results (const unsigned int cycle) const;
+  void run ();
 
-    Triangulation<dim>   triangulation;
+private:
+  void setup_system ();
+  void assemble_system ();
+  void solve ();
+  void refine_grid ();
+  void output_results (const unsigned int cycle) const;
 
-    hp::DoFHandler<dim>      dof_handler;
-    hp::FECollection<dim>            fe;
+  Triangulation<dim>   triangulation;
 
-    ConstraintMatrix     hanging_node_constraints;
+  hp::DoFHandler<dim>      dof_handler;
+  hp::FECollection<dim>            fe;
 
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> system_matrix;
+  ConstraintMatrix     hanging_node_constraints;
 
-    Vector<double>       solution;
-    Vector<double>       system_rhs;
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> system_matrix;
+
+  Vector<double>       solution;
+  Vector<double>       system_rhs;
 };
 
 
 
 
 template <int dim>
-class Coefficient : public Function<dim> 
+class Coefficient : public Function<dim>
 {
-  public:
-    Coefficient () : Function<dim>() {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
-    
-    virtual void value_list (const std::vector<Point<dim> > &points,
-                            std::vector<double>            &values,
-                            const unsigned int              component = 0) const;
+public:
+  Coefficient () : Function<dim>() {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
+
+  virtual void value_list (const std::vector<Point<dim> > &points,
+                           std::vector<double>            &values,
+                           const unsigned int              component = 0) const;
 };
 
 
 
 template <int dim>
 double Coefficient<dim>::value (const Point<dim> &p,
-                               const unsigned int) const 
+                                const unsigned int) const
 {
   if (p.square() < 0.5*0.5)
     return 20;
@@ -125,23 +125,23 @@ double Coefficient<dim>::value (const Point<dim> &p,
 
 template <int dim>
 void Coefficient<dim>::value_list (const std::vector<Point<dim> > &points,
-                                  std::vector<double>            &values,
-                                  const unsigned int              component) const 
+                                   std::vector<double>            &values,
+                                   const unsigned int              component) const
 {
   const unsigned int n_points = points.size();
 
-  Assert (values.size() == n_points, 
-         ExcDimensionMismatch (values.size(), n_points));
-  
-  Assert (component == 0, 
-         ExcIndexRange (component, 0, 1));
-  
+  Assert (values.size() == n_points,
+          ExcDimensionMismatch (values.size(), n_points));
+
+  Assert (component == 0,
+          ExcIndexRange (component, 0, 1));
+
   for (unsigned int i=0; i<n_points; ++i)
     {
       if (points[i].square() < 0.5*0.5)
-       values[i] = 20;
+        values[i] = 20;
       else
-       values[i] = 1;
+        values[i] = 1;
     }
 }
 
@@ -150,14 +150,14 @@ void Coefficient<dim>::value_list (const std::vector<Point<dim> > &points,
 
 template <int dim>
 LaplaceProblem<dim>::LaplaceProblem () :
-               dof_handler (triangulation),
-                fe (FE_Q<dim>(2))
+  dof_handler (triangulation),
+  fe (FE_Q<dim>(2))
 {}
 
 
 
 template <int dim>
-LaplaceProblem<dim>::~LaplaceProblem () 
+LaplaceProblem<dim>::~LaplaceProblem ()
 {
   dof_handler.clear ();
 }
@@ -170,17 +170,17 @@ void LaplaceProblem<dim>::setup_system ()
   dof_handler.distribute_dofs (fe);
 
   sparsity_pattern.reinit (dof_handler.n_dofs(),
-                          dof_handler.n_dofs(),
-                          dof_handler.max_couplings_between_dofs());
+                           dof_handler.n_dofs(),
+                           dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
 
   solution.reinit (dof_handler.n_dofs());
   system_rhs.reinit (dof_handler.n_dofs());
 
-  
+
   hanging_node_constraints.clear ();
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          hanging_node_constraints);
+                                           hanging_node_constraints);
 
   hanging_node_constraints.close ();
 
@@ -193,13 +193,13 @@ void LaplaceProblem<dim>::setup_system ()
 
 
 template <int dim>
-void LaplaceProblem<dim>::assemble_system () 
-{  
+void LaplaceProblem<dim>::assemble_system ()
+{
   const hp::QCollection<dim>  quadrature_formula(QGauss<dim>(3));
 
-  hp::FEValues<dim> x_fe_values (fe, quadrature_formula, 
-                          update_values    |  update_gradients |
-                          update_q_points  |  update_JxW_values);
+  hp::FEValues<dim> x_fe_values (fe, quadrature_formula,
+                                 update_values    |  update_gradients |
+                                 update_q_points  |  update_JxW_values);
 
   const unsigned int   dofs_per_cell = fe[0].dofs_per_cell;
   const unsigned int   n_q_points    = quadrature_formula[0].size();
@@ -213,8 +213,8 @@ void LaplaceProblem<dim>::assemble_system ()
   std::vector<double>    coefficient_values (n_q_points);
 
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       cell_matrix = 0;
@@ -222,34 +222,34 @@ void LaplaceProblem<dim>::assemble_system ()
 
       x_fe_values.reinit (cell);
       const FEValues<dim> &fe_values = x_fe_values.get_present_fe_values();
-      
+
       coefficient.value_list (fe_values.get_quadrature_points(),
-                             coefficient_values);
-      
+                              coefficient_values);
+
       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         {
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += (coefficient_values[q_point] *
-                                  fe_values.shape_grad(i,q_point) *
-                                  fe_values.shape_grad(j,q_point) *
-                                  fe_values.JxW(q_point));
-
-           cell_rhs(i) += (fe_values.shape_value(i,q_point) *
-                           1.0 *
-                           fe_values.JxW(q_point));
-         }
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += (coefficient_values[q_point] *
+                                   fe_values.shape_grad(i,q_point) *
+                                   fe_values.shape_grad(j,q_point) *
+                                   fe_values.JxW(q_point));
+
+            cell_rhs(i) += (fe_values.shape_value(i,q_point) *
+                            1.0 *
+                            fe_values.JxW(q_point));
+          }
 
       cell->get_dof_indices (local_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           system_matrix.add (local_dof_indices[i],
-                              local_dof_indices[j],
-                              cell_matrix(i,j));
-         
-         system_rhs(local_dof_indices[i]) += cell_rhs(i);
-       }
+        {
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            system_matrix.add (local_dof_indices[i],
+                               local_dof_indices[j],
+                               cell_matrix(i,j));
+
+          system_rhs(local_dof_indices[i]) += cell_rhs(i);
+        }
     }
 
   hanging_node_constraints.condense (system_matrix);
@@ -257,13 +257,13 @@ void LaplaceProblem<dim>::assemble_system ()
 
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           ZeroFunction<dim>(),
-                                           boundary_values);
+                                            0,
+                                            ZeroFunction<dim>(),
+                                            boundary_values);
   MatrixTools::apply_boundary_values (boundary_values,
-                                     system_matrix,
-                                     solution,
-                                     system_rhs);
+                                      system_matrix,
+                                      solution,
+                                      system_rhs);
 }
 
 
@@ -271,7 +271,7 @@ void LaplaceProblem<dim>::assemble_system ()
 
 
 template <int dim>
-void LaplaceProblem<dim>::solve () 
+void LaplaceProblem<dim>::solve ()
 {
   SolverControl           solver_control (1000, 1e-12);
   SolverCG<>              cg (solver_control);
@@ -280,7 +280,7 @@ void LaplaceProblem<dim>::solve ()
   preconditioner.initialize(system_matrix, 1.2);
 
   cg.solve (system_matrix, solution, system_rhs,
-           preconditioner);
+            preconditioner);
 
   hanging_node_constraints.distribute (solution);
 }
@@ -293,14 +293,14 @@ void LaplaceProblem<dim>::refine_grid ()
   Vector<float> estimated_error_per_cell (triangulation.n_active_cells());
 
   KellyErrorEstimator<dim>::estimate (dof_handler,
-                                     QGauss<dim-1>(3),
-                                     typename FunctionMap<dim>::type(),
-                                     solution,
-                                     estimated_error_per_cell);
+                                      QGauss<dim-1>(3),
+                                      typename FunctionMap<dim>::type(),
+                                      solution,
+                                      estimated_error_per_cell);
 
   GridRefinement::refine_and_coarsen_fixed_number (triangulation,
-                                                  estimated_error_per_cell,
-                                                  0.3, 0.03);
+                                                   estimated_error_per_cell,
+                                                   0.3, 0.03);
 
   triangulation.execute_coarsening_and_refinement ();
 }
@@ -312,13 +312,13 @@ void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
 {
   if (cycle%3 != 0)
     return;
-  
+
   Assert (cycle < 10, ExcNotImplemented());
 
   std::string filename = "grid-";
   filename += ('0' + cycle);
   filename += ".eps";
-  
+
   GridOut grid_out;
   grid_out.write_eps (triangulation, deallog.get_file_stream());
 }
@@ -327,35 +327,35 @@ void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
 
 
 template <int dim>
-void LaplaceProblem<dim>::run () 
+void LaplaceProblem<dim>::run ()
 {
   for (unsigned int cycle=0; cycle<8; ++cycle)
     {
       deallog << "Cycle " << cycle << ':' << std::endl;
 
       if (cycle == 0)
-       {
-         GridGenerator::hyper_ball (triangulation);
+        {
+          GridGenerator::hyper_ball (triangulation);
 
-         static const HyperBallBoundary<dim> boundary;
-         triangulation.set_boundary (0, boundary);
+          static const HyperBallBoundary<dim> boundary;
+          triangulation.set_boundary (0, boundary);
 
-         triangulation.refine_global (1);
-       }
+          triangulation.refine_global (1);
+        }
       else
-       refine_grid ();
-      
+        refine_grid ();
+
 
       deallog << "   Number of active cells:       "
-               << triangulation.n_active_cells()
-               << std::endl;
+              << triangulation.n_active_cells()
+              << std::endl;
 
       setup_system ();
 
       deallog << "   Number of degrees of freedom: "
-               << dof_handler.n_dofs()
-               << std::endl;
-      
+              << dof_handler.n_dofs()
+              << std::endl;
+
       assemble_system ();
       solve ();
       output_results (cycle);
@@ -363,27 +363,27 @@ void LaplaceProblem<dim>::run ()
 
   DataOutBase::EpsFlags eps_flags;
   eps_flags.z_scaling = 4;
-  
+
   DataOut<dim,hp::DoFHandler<dim> > data_out;
   data_out.set_flags (eps_flags);
 
   data_out.attach_dof_handler (dof_handler);
   data_out.add_data_vector (solution, "solution");
   data_out.build_patches ();
-  
+
   data_out.write_eps (deallog.get_file_stream());
 }
 
 
 
-int main () 
+int main ()
 {
   logfile.precision(2);
   deallog << std::setprecision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   try
     {
@@ -395,25 +395,25 @@ int main ()
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
 
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     }
 
index 9231a83e622c97dbc37c353ce31faf9b0b90f1cb..150fc0b3b8dc72cff2498c40914dfc03cb4d7f7d 100644 (file)
@@ -61,28 +61,30 @@ std::ofstream logfile("step-7/output");
 
 
 template <int dim>
-class SolutionBase 
+class SolutionBase
 {
-  protected:
-    static const unsigned int n_source_centers = 3;    
-    static const Point<dim>   source_centers[n_source_centers];
-    static const double       width;
+protected:
+  static const unsigned int n_source_centers = 3;
+  static const Point<dim>   source_centers[n_source_centers];
+  static const double       width;
 };
 
 
 template <>
 const Point<1>
 SolutionBase<1>::source_centers[SolutionBase<1>::n_source_centers]
-= { Point<1>(-1.0 / 3.0), 
-    Point<1>(0.0), 
-    Point<1>(+1.0 / 3.0)   };
+  = { Point<1>(-1.0 / 3.0),
+      Point<1>(0.0),
+      Point<1>(+1.0 / 3.0)
+    };
 
 template <>
 const Point<2>
 SolutionBase<2>::source_centers[SolutionBase<2>::n_source_centers]
-= { Point<2>(-0.5, +0.5), 
-    Point<2>(-0.5, -0.5), 
-    Point<2>(+0.5, -0.5)   };
+  = { Point<2>(-0.5, +0.5),
+      Point<2>(-0.5, -0.5),
+      Point<2>(+0.5, -0.5)
+    };
 
 template <int dim>
 const double SolutionBase<dim>::width = 1./3.;
@@ -91,51 +93,51 @@ const double SolutionBase<dim>::width = 1./3.;
 
 template <int dim>
 class Solution : public Function<dim>,
-                protected SolutionBase<dim>
+  protected SolutionBase<dim>
 {
-  public:
-    Solution () : Function<dim>() {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
-    
-    virtual Tensor<1,dim> gradient (const Point<dim>   &p,
-                                   const unsigned int  component = 0) const;
+public:
+  Solution () : Function<dim>() {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
+
+  virtual Tensor<1,dim> gradient (const Point<dim>   &p,
+                                  const unsigned int  component = 0) const;
 };
 
 
 template <int dim>
 double Solution<dim>::value (const Point<dim>   &p,
-                            const unsigned int) const
+                             const unsigned int) const
 {
   double return_value = 0;
   for (unsigned int i=0; i<this->n_source_centers; ++i)
     {
       const Point<dim> x_minus_xi = p - this->source_centers[i];
       return_value += std::exp(-x_minus_xi.square() /
-                              (this->width * this->width));
+                               (this->width * this->width));
     }
-  
+
   return return_value;
 }
 
 
 template <int dim>
 Tensor<1,dim> Solution<dim>::gradient (const Point<dim>   &p,
-                                      const unsigned int) const
+                                       const unsigned int) const
 {
   Tensor<1,dim> return_value;
 
   for (unsigned int i=0; i<this->n_source_centers; ++i)
     {
       const Point<dim> x_minus_xi = p - this->source_centers[i];
-      
+
       return_value += (-2 / (this->width * this->width) *
-                      std::exp(-x_minus_xi.square() /
-                               (this->width * this->width)) *
-                      x_minus_xi);
+                       std::exp(-x_minus_xi.square() /
+                                (this->width * this->width)) *
+                       x_minus_xi);
     }
-  
+
   return return_value;
 }
 
@@ -143,77 +145,78 @@ Tensor<1,dim> Solution<dim>::gradient (const Point<dim>   &p,
 
 template <int dim>
 class RightHandSide : public Function<dim>,
-                     protected SolutionBase<dim>
+  protected SolutionBase<dim>
 {
-  public:
-    RightHandSide () : Function<dim>() {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
+public:
+  RightHandSide () : Function<dim>() {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
 };
 
 
 template <int dim>
 double RightHandSide<dim>::value (const Point<dim>   &p,
-                                 const unsigned int) const
+                                  const unsigned int) const
 {
   double return_value = 0;
   for (unsigned int i=0; i<this->n_source_centers; ++i)
     {
       const Point<dim> x_minus_xi = p - this->source_centers[i];
-      
+
       return_value += ((2*dim - 4*x_minus_xi.square()/
-                       (this->width * this->width)) / 
-                      (this->width * this->width) *
-                      std::exp(-x_minus_xi.square() /
-                               (this->width * this->width)));
+                        (this->width * this->width)) /
+                       (this->width * this->width) *
+                       std::exp(-x_minus_xi.square() /
+                                (this->width * this->width)));
       return_value += std::exp(-x_minus_xi.square() /
-                              (this->width * this->width));
+                               (this->width * this->width));
     }
-  
+
   return return_value;
 }
 
 
 
 template <int dim>
-class HelmholtzProblem 
+class HelmholtzProblem
 {
-  public:
-    enum RefinementMode {
-         global_refinement, adaptive_refinement
-    };
-    
-    HelmholtzProblem (const hp::FECollection<dim> &fe,
-                      const RefinementMode      refinement_mode);
+public:
+  enum RefinementMode
+  {
+    global_refinement, adaptive_refinement
+  };
 
-    ~HelmholtzProblem ();
+  HelmholtzProblem (const hp::FECollection<dim> &fe,
+                    const RefinementMode      refinement_mode);
 
-    void run ();
-    
-  private:
-    void setup_system ();
-    void assemble_system ();
-    void solve ();
-    void refine_grid ();
-    void process_solution (const unsigned int cycle);
+  ~HelmholtzProblem ();
 
-    Triangulation<dim>                      triangulation;
-    hp::DoFHandler<dim>                         dof_handler;
+  void run ();
 
-    SmartPointer<const hp::FECollection<dim> > fe;
+private:
+  void setup_system ();
+  void assemble_system ();
+  void solve ();
+  void refine_grid ();
+  void process_solution (const unsigned int cycle);
 
-    ConstraintMatrix                        hanging_node_constraints;
+  Triangulation<dim>                      triangulation;
+  hp::DoFHandler<dim>                         dof_handler;
 
-    SparsityPattern                         sparsity_pattern;
-    SparseMatrix<double>                    system_matrix;
+  SmartPointer<const hp::FECollection<dim> > fe;
 
-    Vector<double>                          solution;
-    Vector<double>                          system_rhs;
+  ConstraintMatrix                        hanging_node_constraints;
 
-    const RefinementMode                    refinement_mode;
+  SparsityPattern                         sparsity_pattern;
+  SparseMatrix<double>                    system_matrix;
 
-    ConvergenceTable                        convergence_table;
+  Vector<double>                          solution;
+  Vector<double>                          system_rhs;
+
+  const RefinementMode                    refinement_mode;
+
+  ConvergenceTable                        convergence_table;
 };
 
 
@@ -222,15 +225,15 @@ class HelmholtzProblem
 template <int dim>
 HelmholtzProblem<dim>::HelmholtzProblem (const hp::FECollection<dim> &fe,
                                          const RefinementMode refinement_mode) :
-               dof_handler (triangulation),
-               fe (&fe),
-               refinement_mode (refinement_mode)
+  dof_handler (triangulation),
+  fe (&fe),
+  refinement_mode (refinement_mode)
 {}
 
 
 
 template <int dim>
-HelmholtzProblem<dim>::~HelmholtzProblem () 
+HelmholtzProblem<dim>::~HelmholtzProblem ()
 {
   dof_handler.clear ();
 }
@@ -245,12 +248,12 @@ void HelmholtzProblem<dim>::setup_system ()
 
   hanging_node_constraints.clear ();
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          hanging_node_constraints);
+                                           hanging_node_constraints);
   hanging_node_constraints.close ();
 
   sparsity_pattern.reinit (dof_handler.n_dofs(),
-                          dof_handler.n_dofs(),
-                          dof_handler.max_couplings_between_dofs());
+                           dof_handler.n_dofs(),
+                           dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
   hanging_node_constraints.condense (sparsity_pattern);
   sparsity_pattern.compress();
@@ -264,8 +267,8 @@ void HelmholtzProblem<dim>::setup_system ()
 
 
 template <int dim>
-void HelmholtzProblem<dim>::assemble_system () 
-{  
+void HelmholtzProblem<dim>::assemble_system ()
+{
   hp::QCollection<dim>   quadrature_formula(QGauss<dim>(3));
   hp::QCollection<dim-1> face_quadrature_formula(QGauss<dim-1>(3));
 
@@ -278,23 +281,23 @@ void HelmholtzProblem<dim>::assemble_system ()
   Vector<double>       cell_rhs (dofs_per_cell);
 
   std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
-  
-  hp::FEValues<dim>  x_fe_values (*fe, quadrature_formula, 
-                           update_values   | update_gradients |
-                            update_q_points | update_JxW_values);
 
-  hp::FEFaceValues<dim> x_fe_face_values (*fe, face_quadrature_formula, 
-                                   update_values         | update_q_points  |
-                                    update_normal_vectors | update_JxW_values);
+  hp::FEValues<dim>  x_fe_values (*fe, quadrature_formula,
+                                  update_values   | update_gradients |
+                                  update_q_points | update_JxW_values);
+
+  hp::FEFaceValues<dim> x_fe_face_values (*fe, face_quadrature_formula,
+                                          update_values         | update_q_points  |
+                                          update_normal_vectors | update_JxW_values);
 
   const RightHandSide<dim> right_hand_side;
   std::vector<double>  rhs_values (n_q_points);
 
   const Solution<dim> exact_solution;
-  
+
   typename hp::DoFHandler<dim>::active_cell_iterator
-    cell = dof_handler.begin_active(),
-    endc = dof_handler.end();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       cell_matrix = 0;
@@ -305,55 +308,55 @@ void HelmholtzProblem<dim>::assemble_system ()
 
       right_hand_side.value_list (fe_values.get_quadrature_points(),
                                   rhs_values);
-      
+
       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         {
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += ((fe_values.shape_grad(i,q_point) *
-                                   fe_values.shape_grad(j,q_point)
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += ((fe_values.shape_grad(i,q_point) *
+                                    fe_values.shape_grad(j,q_point)
                                     +
                                     fe_values.shape_value(i,q_point) *
-                                   fe_values.shape_value(j,q_point)) *
+                                    fe_values.shape_value(j,q_point)) *
                                    fe_values.JxW(q_point));
 
-           cell_rhs(i) += (fe_values.shape_value(i,q_point) *
-                           rhs_values [q_point] *
-                           fe_values.JxW(q_point));
-         }
+            cell_rhs(i) += (fe_values.shape_value(i,q_point) *
+                            rhs_values [q_point] *
+                            fe_values.JxW(q_point));
+          }
 
       for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
-       if (cell->face(face)->at_boundary()
+        if (cell->face(face)->at_boundary()
             &&
             (cell->face(face)->boundary_indicator() == 1))
-         {
-           x_fe_face_values.reinit (cell, face);
-           const FEFaceValues<dim> &fe_face_values
-             = x_fe_face_values.get_present_fe_values ();
-
-           for (unsigned int q_point=0; q_point<n_face_q_points; ++q_point)
-             {
-               const double neumann_value
-                 = (exact_solution.gradient (fe_face_values.quadrature_point(q_point)) *
-                    fe_face_values.normal_vector(q_point));
-
-               for (unsigned int i=0; i<dofs_per_cell; ++i)
-                 cell_rhs(i) += (neumann_value *
-                                 fe_face_values.shape_value(i,q_point) *
-                                 fe_face_values.JxW(q_point));
-             }
-         }
+          {
+            x_fe_face_values.reinit (cell, face);
+            const FEFaceValues<dim> &fe_face_values
+              = x_fe_face_values.get_present_fe_values ();
+
+            for (unsigned int q_point=0; q_point<n_face_q_points; ++q_point)
+              {
+                const double neumann_value
+                  = (exact_solution.gradient (fe_face_values.quadrature_point(q_point)) *
+                     fe_face_values.normal_vector(q_point));
+
+                for (unsigned int i=0; i<dofs_per_cell; ++i)
+                  cell_rhs(i) += (neumann_value *
+                                  fe_face_values.shape_value(i,q_point) *
+                                  fe_face_values.JxW(q_point));
+              }
+          }
 
       cell->get_dof_indices (local_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           system_matrix.add (local_dof_indices[i],
-                              local_dof_indices[j],
-                              cell_matrix(i,j));
-         
-         system_rhs(local_dof_indices[i]) += cell_rhs(i);
-       }
+        {
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            system_matrix.add (local_dof_indices[i],
+                               local_dof_indices[j],
+                               cell_matrix(i,j));
+
+          system_rhs(local_dof_indices[i]) += cell_rhs(i);
+        }
     }
 
   hanging_node_constraints.condense (system_matrix);
@@ -361,19 +364,19 @@ void HelmholtzProblem<dim>::assemble_system ()
 
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           Solution<dim>(),
-                                           boundary_values);
+                                            0,
+                                            Solution<dim>(),
+                                            boundary_values);
   MatrixTools::apply_boundary_values (boundary_values,
-                                     system_matrix,
-                                     solution,
-                                     system_rhs);
+                                      system_matrix,
+                                      solution,
+                                      system_rhs);
 }
 
 
 
 template <int dim>
-void HelmholtzProblem<dim>::solve () 
+void HelmholtzProblem<dim>::solve ()
 {
   SolverControl           solver_control (1000, 1e-12);
   SolverCG<>              cg (solver_control);
@@ -382,7 +385,7 @@ void HelmholtzProblem<dim>::solve ()
   preconditioner.initialize(system_matrix, 1.2);
 
   cg.solve (system_matrix, solution, system_rhs,
-           preconditioner);
+            preconditioner);
 
   hanging_node_constraints.distribute (solution);
 }
@@ -392,38 +395,38 @@ void HelmholtzProblem<dim>::solve ()
 template <int dim>
 void HelmholtzProblem<dim>::refine_grid ()
 {
-  switch (refinement_mode) 
+  switch (refinement_mode)
     {
-      case global_refinement:
-      {
-       triangulation.refine_global (1);
-       break;
-      }
+    case global_refinement:
+    {
+      triangulation.refine_global (1);
+      break;
+    }
 
-      case adaptive_refinement:
-      {
-       Vector<float> estimated_error_per_cell (triangulation.n_active_cells());
-
-       typename FunctionMap<dim>::type neumann_boundary;
-       KellyErrorEstimator<dim>::estimate (dof_handler,
-                                           QGauss<dim-1>(3),
-                                           neumann_boundary,
-                                           solution,
-                                           estimated_error_per_cell);
-
-       GridRefinement::refine_and_coarsen_fixed_number (triangulation,
-                                                        estimated_error_per_cell,
-                                                        0.3, 0.03);
-       
-       triangulation.execute_coarsening_and_refinement ();
-
-       break;
-      }
+    case adaptive_refinement:
+    {
+      Vector<float> estimated_error_per_cell (triangulation.n_active_cells());
 
-      default:
-      {
-        Assert (false, ExcNotImplemented());
-      }
+      typename FunctionMap<dim>::type neumann_boundary;
+      KellyErrorEstimator<dim>::estimate (dof_handler,
+                                          QGauss<dim-1>(3),
+                                          neumann_boundary,
+                                          solution,
+                                          estimated_error_per_cell);
+
+      GridRefinement::refine_and_coarsen_fixed_number (triangulation,
+                                                       estimated_error_per_cell,
+                                                       0.3, 0.03);
+
+      triangulation.execute_coarsening_and_refinement ();
+
+      break;
+    }
+
+    default:
+    {
+      Assert (false, ExcNotImplemented());
+    }
     }
 }
 
@@ -434,42 +437,42 @@ void HelmholtzProblem<dim>::process_solution (const unsigned int cycle)
 {
   Vector<float> difference_per_cell (triangulation.n_active_cells());
   VectorTools::integrate_difference (dof_handler,
-                                    solution,
-                                    Solution<dim>(),
-                                    difference_per_cell,
-                                    hp::QCollection<dim>(QGauss<dim>(3)),
-                                    VectorTools::L2_norm);
+                                     solution,
+                                     Solution<dim>(),
+                                     difference_per_cell,
+                                     hp::QCollection<dim>(QGauss<dim>(3)),
+                                     VectorTools::L2_norm);
   const double L2_error = difference_per_cell.l2_norm();
 
   VectorTools::integrate_difference (dof_handler,
-                                    solution,
-                                    Solution<dim>(),
-                                    difference_per_cell,
-                                    hp::QCollection<dim>(QGauss<dim>(3)),
-                                    VectorTools::H1_seminorm);
+                                     solution,
+                                     Solution<dim>(),
+                                     difference_per_cell,
+                                     hp::QCollection<dim>(QGauss<dim>(3)),
+                                     VectorTools::H1_seminorm);
   const double H1_error = difference_per_cell.l2_norm();
 
   const QTrapez<1>     q_trapez;
   const QIterated<dim> q_iterated (q_trapez, 5);
   VectorTools::integrate_difference (dof_handler,
-                                    solution,
-                                    Solution<dim>(),
-                                    difference_per_cell,
-                                    hp::QCollection<dim>(q_iterated),
-                                    VectorTools::Linfty_norm);
+                                     solution,
+                                     Solution<dim>(),
+                                     difference_per_cell,
+                                     hp::QCollection<dim>(q_iterated),
+                                     VectorTools::Linfty_norm);
   const double Linfty_error = difference_per_cell.linfty_norm();
 
   const unsigned int n_active_cells=triangulation.n_active_cells();
   const unsigned int n_dofs=dof_handler.n_dofs();
-  
-  deallog << "Cycle " << cycle << ':' 
-           << std::endl
-           << "   Number of active cells:       "
-           << n_active_cells
-           << std::endl
-           << "   Number of degrees of freedom: "
-           << n_dofs
-           << std::endl;
+
+  deallog << "Cycle " << cycle << ':'
+          << std::endl
+          << "   Number of active cells:       "
+          << n_active_cells
+          << std::endl
+          << "   Number of degrees of freedom: "
+          << n_dofs
+          << std::endl;
 
   convergence_table.add_value("cycle", cycle);
   convergence_table.add_value("cells", n_active_cells);
@@ -482,67 +485,67 @@ void HelmholtzProblem<dim>::process_solution (const unsigned int cycle)
 
 
 template <int dim>
-void HelmholtzProblem<dim>::run () 
+void HelmholtzProblem<dim>::run ()
 {
   for (unsigned int cycle=0; cycle<7; ++cycle)
     {
       if (cycle == 0)
-       {
-         GridGenerator::hyper_cube (triangulation, -1, 1);
-         triangulation.refine_global (1);
+        {
+          GridGenerator::hyper_cube (triangulation, -1, 1);
+          triangulation.refine_global (1);
 
           typename Triangulation<dim>::cell_iterator
-            cell = triangulation.begin (),
-            endc = triangulation.end();
-         for (; cell!=endc; ++cell)
-           for (unsigned int face=0;
+          cell = triangulation.begin (),
+          endc = triangulation.end();
+          for (; cell!=endc; ++cell)
+            for (unsigned int face=0;
                  face<GeometryInfo<dim>::faces_per_cell;
                  ++face)
-             if ((cell->face(face)->center()(0) == -1)
-                 ||
-                 (cell->face(face)->center()(1) == -1))
-               cell->face(face)->set_boundary_indicator (1);
-       }
+              if ((cell->face(face)->center()(0) == -1)
+                  ||
+                  (cell->face(face)->center()(1) == -1))
+                cell->face(face)->set_boundary_indicator (1);
+        }
       else
         refine_grid ();
-      
+
 
       setup_system ();
-      
+
       assemble_system ();
       solve ();
 
       process_solution (cycle);
     }
-  
+
 
   if (refinement_mode == adaptive_refinement)
     {
       std::string gmv_filename;
       switch (refinement_mode)
-       {
-         case global_refinement:
-               gmv_filename = "solution-global";
-               break;
-         case adaptive_refinement:
-               gmv_filename = "solution-adaptive";
-               break;
-         default:
-               Assert (false, ExcNotImplemented());
-       }
+        {
+        case global_refinement:
+          gmv_filename = "solution-global";
+          break;
+        case adaptive_refinement:
+          gmv_filename = "solution-adaptive";
+          break;
+        default:
+          Assert (false, ExcNotImplemented());
+        }
 
       switch ((*fe)[0].degree)
-       {
-         case 1:
-               gmv_filename += "-q1";
-               break;
-         case 2:
-               gmv_filename += "-q2";
-               break;
-
-         default:
-               Assert (false, ExcNotImplemented());
-       }
+        {
+        case 1:
+          gmv_filename += "-q1";
+          break;
+        case 2:
+          gmv_filename += "-q2";
+          break;
+
+        default:
+          Assert (false, ExcNotImplemented());
+        }
 
       gmv_filename += ".gmv";
 
@@ -553,9 +556,9 @@ void HelmholtzProblem<dim>::run ()
       data_out.build_patches ((*fe)[0].degree);
 //      data_out.write_gmv (deallog.get_file_stream());
     }
-  
-  
-  
+
+
+
   convergence_table.set_precision("L2", 3);
   convergence_table.set_precision("H1", 3);
   convergence_table.set_precision("Linfty", 3);
@@ -575,43 +578,43 @@ void HelmholtzProblem<dim>::run ()
 
   deallog << std::endl;
   convergence_table.write_text(deallog.get_file_stream());
-  
+
   std::string error_filename = "error";
   switch (refinement_mode)
     {
-      case global_refinement:
-            error_filename += "-global";
-            break;
-      case adaptive_refinement:
-            error_filename += "-adaptive";
-            break;
-      default:
-            Assert (false, ExcNotImplemented());
+    case global_refinement:
+      error_filename += "-global";
+      break;
+    case adaptive_refinement:
+      error_filename += "-adaptive";
+      break;
+    default:
+      Assert (false, ExcNotImplemented());
     }
 
   switch ((*fe)[0].degree)
     {
-      case 1:
-            error_filename += "-q1";
-            break;
-      case 2:
-            error_filename += "-q2";
-            break;
-      default:
-            Assert (false, ExcNotImplemented());
+    case 1:
+      error_filename += "-q1";
+      break;
+    case 2:
+      error_filename += "-q2";
+      break;
+    default:
+      Assert (false, ExcNotImplemented());
     }
-  
+
   error_filename += ".tex";
-  
+
   convergence_table.write_tex(deallog.get_file_stream());
 
-  
+
 
   if (refinement_mode==global_refinement)
     {
       convergence_table.add_column_to_supercolumn("cycle", "n cells");
       convergence_table.add_column_to_supercolumn("cells", "n cells");
-      
+
       std::vector<std::string> new_order;
       new_order.push_back("n cells");
       new_order.push_back("H1");
@@ -619,38 +622,38 @@ void HelmholtzProblem<dim>::run ()
       convergence_table.set_column_order (new_order);
 
       convergence_table
-       .evaluate_convergence_rates("L2", ConvergenceTable::reduction_rate);
+      .evaluate_convergence_rates("L2", ConvergenceTable::reduction_rate);
       convergence_table
-       .evaluate_convergence_rates("L2", ConvergenceTable::reduction_rate_log2);
+      .evaluate_convergence_rates("L2", ConvergenceTable::reduction_rate_log2);
       convergence_table
-       .evaluate_convergence_rates("H1", ConvergenceTable::reduction_rate_log2);
+      .evaluate_convergence_rates("H1", ConvergenceTable::reduction_rate_log2);
 
       deallog << std::endl;
       convergence_table.write_text(deallog.get_file_stream());
 
       std::string conv_filename = "convergence";
       switch (refinement_mode)
-       {
-         case global_refinement:
-               conv_filename += "-global";
-               break;
-         case adaptive_refinement:
-               conv_filename += "-adaptive";
-               break;
-         default:
-               Assert (false, ExcNotImplemented());
-       }
+        {
+        case global_refinement:
+          conv_filename += "-global";
+          break;
+        case adaptive_refinement:
+          conv_filename += "-adaptive";
+          break;
+        default:
+          Assert (false, ExcNotImplemented());
+        }
       switch ((*fe)[0].degree)
-       {
-         case 1:
-               conv_filename += "-q1";
-               break;
-         case 2:
-               conv_filename += "-q2";
-               break;
-         default:
-               Assert (false, ExcNotImplemented());
-       }
+        {
+        case 1:
+          conv_filename += "-q1";
+          break;
+        case 2:
+          conv_filename += "-q2";
+          break;
+        default:
+          Assert (false, ExcNotImplemented());
+        }
       conv_filename += ".tex";
 
       convergence_table.write_tex(deallog.get_file_stream());
@@ -658,86 +661,86 @@ void HelmholtzProblem<dim>::run ()
 }
 
 
-int main () 
+int main ()
 {
   logfile.precision(2);
   deallog << std::setprecision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   const unsigned int dim = 2;
 
   try
     {
       deallog.depth_console (0);
-      
-      
+
+
       {
-       deallog << "Solving with Q1 elements, adaptive refinement" << std::endl
-                 << "=============================================" << std::endl
-                 << std::endl;
-       
-       hp::FECollection<dim> fe(FE_Q<dim>(1));
-       HelmholtzProblem<dim>
-         helmholtz_problem_2d (fe, HelmholtzProblem<dim>::adaptive_refinement);
+        deallog << "Solving with Q1 elements, adaptive refinement" << std::endl
+                << "=============================================" << std::endl
+                << std::endl;
 
-       helmholtz_problem_2d.run ();
+        hp::FECollection<dim> fe(FE_Q<dim>(1));
+        HelmholtzProblem<dim>
+        helmholtz_problem_2d (fe, HelmholtzProblem<dim>::adaptive_refinement);
 
-       deallog << std::endl;
+        helmholtz_problem_2d.run ();
+
+        deallog << std::endl;
       }
-       
+
       {
-       deallog << "Solving with Q1 elements, global refinement" << std::endl
-                 << "===========================================" << std::endl
-                 << std::endl;
-       
-       hp::FECollection<dim> fe(FE_Q<dim>(1));
-       HelmholtzProblem<dim>
-         helmholtz_problem_2d (fe, HelmholtzProblem<dim>::global_refinement);
+        deallog << "Solving with Q1 elements, global refinement" << std::endl
+                << "===========================================" << std::endl
+                << std::endl;
+
+        hp::FECollection<dim> fe(FE_Q<dim>(1));
+        HelmholtzProblem<dim>
+        helmholtz_problem_2d (fe, HelmholtzProblem<dim>::global_refinement);
 
-       helmholtz_problem_2d.run ();
+        helmholtz_problem_2d.run ();
 
-       deallog << std::endl;
+        deallog << std::endl;
       }
-       
+
       {
-       deallog << "Solving with Q2 elements, global refinement" << std::endl
-                 << "===========================================" << std::endl
-                 << std::endl;
-       
-       hp::FECollection<dim> fe(FE_Q<dim>(2));
-       HelmholtzProblem<dim>
-         helmholtz_problem_2d (fe, HelmholtzProblem<dim>::global_refinement);
+        deallog << "Solving with Q2 elements, global refinement" << std::endl
+                << "===========================================" << std::endl
+                << std::endl;
+
+        hp::FECollection<dim> fe(FE_Q<dim>(2));
+        HelmholtzProblem<dim>
+        helmholtz_problem_2d (fe, HelmholtzProblem<dim>::global_refinement);
 
-       helmholtz_problem_2d.run ();
+        helmholtz_problem_2d.run ();
 
-       deallog << std::endl;
+        deallog << std::endl;
       }
-       
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     }
 
index c0921ca324a6669feadc769b32d42b24d04b3738..36fa3750cee987fc80d1328ccdbab79b808be817 100644 (file)
@@ -58,96 +58,96 @@ std::ofstream logfile("step-8/output");
 
 
 template <int dim>
-class ElasticProblem 
+class ElasticProblem
 {
-  public:
-    ElasticProblem ();
-    ~ElasticProblem ();
-    void run ();
-    
-  private:
-    void setup_system ();
-    void assemble_system ();
-    void solve ();
-    void refine_grid ();
-    void output_results (const unsigned int cycle) const;
-
-    Triangulation<dim>   triangulation;
-    hp::DoFHandler<dim>      dof_handler;
-
-    hp::FECollection<dim>        fe;
-
-    ConstraintMatrix     hanging_node_constraints;
-
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> system_matrix;
-
-    Vector<double>       solution;
-    Vector<double>       system_rhs;
+public:
+  ElasticProblem ();
+  ~ElasticProblem ();
+  void run ();
+
+private:
+  void setup_system ();
+  void assemble_system ();
+  void solve ();
+  void refine_grid ();
+  void output_results (const unsigned int cycle) const;
+
+  Triangulation<dim>   triangulation;
+  hp::DoFHandler<dim>      dof_handler;
+
+  hp::FECollection<dim>        fe;
+
+  ConstraintMatrix     hanging_node_constraints;
+
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> system_matrix;
+
+  Vector<double>       solution;
+  Vector<double>       system_rhs;
 };
 
 
 
 template <int dim>
-class RightHandSide :  public Function<dim> 
+class RightHandSide :  public Function<dim>
 {
-  public:
-    RightHandSide ();
-    
-    virtual void vector_value (const Point<dim> &p,
-                              Vector<double>   &values) const;
-
-    virtual void vector_value_list (const std::vector<Point<dim> > &points,
-                                   std::vector<Vector<double> >   &value_list) const;
+public:
+  RightHandSide ();
+
+  virtual void vector_value (const Point<dim> &p,
+                             Vector<double>   &values) const;
+
+  virtual void vector_value_list (const std::vector<Point<dim> > &points,
+                                  std::vector<Vector<double> >   &value_list) const;
 };
 
 
 template <int dim>
 RightHandSide<dim>::RightHandSide ()
-               :
-               Function<dim> (dim)
+  :
+  Function<dim> (dim)
 {}
 
 
 template <int dim>
 inline
 void RightHandSide<dim>::vector_value (const Point<dim> &p,
-                                      Vector<double>   &values) const 
+                                       Vector<double>   &values) const
 {
-  Assert (values.size() == dim, 
-         ExcDimensionMismatch (values.size(), dim));
+  Assert (values.size() == dim,
+          ExcDimensionMismatch (values.size(), dim));
   Assert (dim >= 2, ExcNotImplemented());
-  
+
   Point<dim> point_1, point_2;
   point_1(0) = 0.5;
   point_2(0) = -0.5;
-  
+
   if (((p-point_1).square() < 0.2*0.2) ||
       ((p-point_2).square() < 0.2*0.2))
     values(0) = 1;
   else
     values(0) = 0;
-  
+
   if (p.square() < 0.2*0.2)
     values(1) = 1;
   else
-    values(1) = 0;    
+    values(1) = 0;
 }
 
 
 
 template <int dim>
 void RightHandSide<dim>::vector_value_list (const std::vector<Point<dim> > &points,
-                                           std::vector<Vector<double> >   &value_list) const 
+                                            std::vector<Vector<double> >   &value_list) const
 {
-  Assert (value_list.size() == points.size(), 
-         ExcDimensionMismatch (value_list.size(), points.size()));
+  Assert (value_list.size() == points.size(),
+          ExcDimensionMismatch (value_list.size(), points.size()));
 
   const unsigned int n_points = points.size();
 
   for (unsigned int p=0; p<n_points; ++p)
     RightHandSide<dim>::vector_value (points[p],
-                                     value_list[p]);
+                                      value_list[p]);
 }
 
 
@@ -157,16 +157,16 @@ void RightHandSide<dim>::vector_value_list (const std::vector<Point<dim> > &poin
 
 template <int dim>
 ElasticProblem<dim>::ElasticProblem ()
-               :
-               dof_handler (triangulation),
-               fe (FESystem<dim>(FE_Q<dim>(1), dim))
+  :
+  dof_handler (triangulation),
+  fe (FESystem<dim>(FE_Q<dim>(1), dim))
 {}
 
 
 
 
 template <int dim>
-ElasticProblem<dim>::~ElasticProblem () 
+ElasticProblem<dim>::~ElasticProblem ()
 {
   dof_handler.clear ();
 }
@@ -179,11 +179,11 @@ void ElasticProblem<dim>::setup_system ()
   dof_handler.distribute_dofs (fe);
   hanging_node_constraints.clear ();
   DoFTools::make_hanging_node_constraints (dof_handler,
-                                          hanging_node_constraints);
+                                           hanging_node_constraints);
   hanging_node_constraints.close ();
   sparsity_pattern.reinit (dof_handler.n_dofs(),
-                          dof_handler.n_dofs(),
-                          dof_handler.max_couplings_between_dofs());
+                           dof_handler.n_dofs(),
+                           dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
 
   hanging_node_constraints.condense (sparsity_pattern);
@@ -199,13 +199,13 @@ void ElasticProblem<dim>::setup_system ()
 
 
 template <int dim>
-void ElasticProblem<dim>::assemble_system () 
-{  
+void ElasticProblem<dim>::assemble_system ()
+{
   hp::QCollection<dim>  quadrature_formula(QGauss<dim>(2));
 
-  hp::FEValues<dim> x_fe_values (fe, quadrature_formula, 
-                          update_values   | update_gradients |
-                           update_q_points | update_JxW_values);
+  hp::FEValues<dim> x_fe_values (fe, quadrature_formula,
+                                 update_values   | update_gradients |
+                                 update_q_points | update_JxW_values);
 
   const unsigned int   dofs_per_cell = fe[0].dofs_per_cell;
   const unsigned int   n_q_points    = quadrature_formula[0].size();
@@ -222,11 +222,11 @@ void ElasticProblem<dim>::assemble_system ()
 
   RightHandSide<dim>      right_hand_side;
   std::vector<Vector<double> > rhs_values (n_q_points,
-                                          Vector<double>(dim));
+                                           Vector<double>(dim));
 
 
   typename hp::DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active(),
-                                                endc = dof_handler.end();
+                                                     endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       cell_matrix = 0;
@@ -234,70 +234,70 @@ void ElasticProblem<dim>::assemble_system ()
 
       x_fe_values.reinit (cell);
       const FEValues<dim> &fe_values = x_fe_values.get_present_fe_values();
-      
+
       lambda.value_list (fe_values.get_quadrature_points(), lambda_values);
       mu.value_list     (fe_values.get_quadrature_points(), mu_values);
 
       right_hand_side.vector_value_list (fe_values.get_quadrature_points(),
-                                        rhs_values);
-      
+                                         rhs_values);
+
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       {
-         const unsigned int 
-           component_i = fe[0].system_to_component_index(i).first;
-         
-         for (unsigned int j=0; j<dofs_per_cell; ++j) 
-           {
-             const unsigned int 
-               component_j = fe[0].system_to_component_index(j).first;
-             
-             for (unsigned int q_point=0; q_point<n_q_points;
-                  ++q_point)
-               {
-                 cell_matrix(i,j) 
-                   += 
-                   (
-                     (fe_values.shape_grad(i,q_point)[component_i] *
-                      fe_values.shape_grad(j,q_point)[component_j] *
-                      lambda_values[q_point])
-                     +
-                     (fe_values.shape_grad(i,q_point)[component_j] *
-                      fe_values.shape_grad(j,q_point)[component_i] *
-                      mu_values[q_point])
-                     +
-                     ((component_i == component_j) ?
-                      (fe_values.shape_grad(i,q_point) *
-                       fe_values.shape_grad(j,q_point) *
-                       mu_values[q_point])  :
-                      0)
-                   )
-                   *
-                   fe_values.JxW(q_point);
-               }
-           }
-       }
+        {
+          const unsigned int
+          component_i = fe[0].system_to_component_index(i).first;
+
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            {
+              const unsigned int
+              component_j = fe[0].system_to_component_index(j).first;
+
+              for (unsigned int q_point=0; q_point<n_q_points;
+                   ++q_point)
+                {
+                  cell_matrix(i,j)
+                  +=
+                    (
+                      (fe_values.shape_grad(i,q_point)[component_i] *
+                       fe_values.shape_grad(j,q_point)[component_j] *
+                       lambda_values[q_point])
+                      +
+                      (fe_values.shape_grad(i,q_point)[component_j] *
+                       fe_values.shape_grad(j,q_point)[component_i] *
+                       mu_values[q_point])
+                      +
+                      ((component_i == component_j) ?
+                       (fe_values.shape_grad(i,q_point) *
+                        fe_values.shape_grad(j,q_point) *
+                        mu_values[q_point])  :
+                       0)
+                    )
+                    *
+                    fe_values.JxW(q_point);
+                }
+            }
+        }
 
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       {
-         const unsigned int 
-           component_i = fe[0].system_to_component_index(i).first;
-         
-         for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-           cell_rhs(i) += fe_values.shape_value(i,q_point) *
-                          rhs_values[q_point](component_i) *
-                          fe_values.JxW(q_point);
-       }
+        {
+          const unsigned int
+          component_i = fe[0].system_to_component_index(i).first;
+
+          for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+            cell_rhs(i) += fe_values.shape_value(i,q_point) *
+                           rhs_values[q_point](component_i) *
+                           fe_values.JxW(q_point);
+        }
 
       cell->get_dof_indices (local_dof_indices);
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       {
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           system_matrix.add (local_dof_indices[i],
-                              local_dof_indices[j],
-                              cell_matrix(i,j));
-         
-         system_rhs(local_dof_indices[i]) += cell_rhs(i);
-       }
+        {
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            system_matrix.add (local_dof_indices[i],
+                               local_dof_indices[j],
+                               cell_matrix(i,j));
+
+          system_rhs(local_dof_indices[i]) += cell_rhs(i);
+        }
     }
 
   hanging_node_constraints.condense (system_matrix);
@@ -305,20 +305,20 @@ void ElasticProblem<dim>::assemble_system ()
 
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
-                                           0,
-                                           ZeroFunction<dim>(dim),
-                                           boundary_values);
+                                            0,
+                                            ZeroFunction<dim>(dim),
+                                            boundary_values);
   MatrixTools::apply_boundary_values (boundary_values,
-                                     system_matrix,
-                                     solution,
-                                     system_rhs);
+                                      system_matrix,
+                                      solution,
+                                      system_rhs);
 }
 
 
 
 
 template <int dim>
-void ElasticProblem<dim>::solve () 
+void ElasticProblem<dim>::solve ()
 {
   SolverControl           solver_control (1000, 1e-12);
   SolverCG<>              cg (solver_control);
@@ -327,7 +327,7 @@ void ElasticProblem<dim>::solve ()
   preconditioner.initialize(system_matrix, 1.2);
 
   cg.solve (system_matrix, solution, system_rhs,
-           preconditioner);
+            preconditioner);
 
   hanging_node_constraints.distribute (solution);
 }
@@ -341,14 +341,14 @@ void ElasticProblem<dim>::refine_grid ()
 
   typename FunctionMap<dim>::type neumann_boundary;
   KellyErrorEstimator<dim>::estimate (dof_handler,
-                                     QGauss<dim-1>(2),
-                                     neumann_boundary,
-                                     solution,
-                                     estimated_error_per_cell);
+                                      QGauss<dim-1>(2),
+                                      neumann_boundary,
+                                      solution,
+                                      estimated_error_per_cell);
 
   GridRefinement::refine_and_coarsen_fixed_number (triangulation,
-                                                  estimated_error_per_cell,
-                                                  0.3, 0.03);
+                                                   estimated_error_per_cell,
+                                                   0.3, 0.03);
 
   triangulation.execute_coarsening_and_refinement ();
 }
@@ -361,33 +361,33 @@ void ElasticProblem<dim>::output_results (const unsigned int cycle) const
   std::string filename = "solution-";
   filename += ('0' + cycle);
   Assert (cycle < 10, ExcInternalError());
-  
+
   filename += ".gmv";
 
   DataOut<dim,hp::DoFHandler<dim> > data_out;
   data_out.attach_dof_handler (dof_handler);
 
+
 
   std::vector<std::string> solution_names;
   switch (dim)
     {
-      case 1:
-           solution_names.push_back ("displacement");
-           break;
-      case 2:
-           solution_names.push_back ("x_displacement");            
-           solution_names.push_back ("y_displacement");
-           break;
-      case 3:
-           solution_names.push_back ("x_displacement");            
-           solution_names.push_back ("y_displacement");
-           solution_names.push_back ("z_displacement");
-           break;
-      default:
-           Assert (false, ExcNotImplemented());
+    case 1:
+      solution_names.push_back ("displacement");
+      break;
+    case 2:
+      solution_names.push_back ("x_displacement");
+      solution_names.push_back ("y_displacement");
+      break;
+    case 3:
+      solution_names.push_back ("x_displacement");
+      solution_names.push_back ("y_displacement");
+      solution_names.push_back ("z_displacement");
+      break;
+    default:
+      Assert (false, ExcNotImplemented());
     }
-            
+
   data_out.add_data_vector (solution, solution_names);
   data_out.build_patches ();
   data_out.write_gmv (deallog.get_file_stream());
@@ -397,30 +397,30 @@ void ElasticProblem<dim>::output_results (const unsigned int cycle) const
 
 
 template <int dim>
-void ElasticProblem<dim>::run () 
+void ElasticProblem<dim>::run ()
 {
   for (unsigned int cycle=0; cycle<8; ++cycle)
     {
       deallog << "Cycle " << cycle << ':' << std::endl;
 
       if (cycle == 0)
-       {
-         GridGenerator::hyper_cube (triangulation, -1, 1);
-         triangulation.refine_global (2);
-       }
+        {
+          GridGenerator::hyper_cube (triangulation, -1, 1);
+          triangulation.refine_global (2);
+        }
       else
-       refine_grid ();
+        refine_grid ();
 
       deallog << "   Number of active cells:       "
-               << triangulation.n_active_cells()
-               << std::endl;
+              << triangulation.n_active_cells()
+              << std::endl;
 
       setup_system ();
 
       deallog << "   Number of degrees of freedom: "
-               << dof_handler.n_dofs()
-               << std::endl;
-      
+              << dof_handler.n_dofs()
+              << std::endl;
+
       assemble_system ();
       solve ();
       output_results (cycle);
@@ -428,14 +428,14 @@ void ElasticProblem<dim>::run ()
 }
 
 
-int main () 
+int main ()
 {
   logfile.precision(2);
   deallog << std::setprecision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   try
     {
@@ -447,25 +447,25 @@ int main ()
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     }
 
index d57be4f01383517f4fee59bc961b86a8100675f0..9cf115d9f9adc9f01684632973e3f554ae3f308d 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim>(2) {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square(); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { values(0) = value(p,0);
-       values(1) = value(p,1); }
+public:
+  MySquareFunction () : Function<dim>(2) {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square();
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+    values(1) = value(p,1);
+  }
 };
 
 
@@ -68,7 +72,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -79,22 +83,22 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   hp::FECollection<dim> element;
   element.push_back (FESystem<dim> (FE_Q<dim>(1), 1,
-                                   FE_Q<dim>(2), 1));
+                                    FE_Q<dim>(2), 1));
   hp::DoFHandler<dim> dof(tr);
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active(); cell!=dof.end(); ++cell)
+       cell = dof.begin_active(); cell!=dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
-  
+
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   hp::MappingCollection<dim> mapping;
   mapping.push_back (MappingQ<dim>(3));
 
@@ -103,8 +107,8 @@ check ()
 
   Vector<double> rhs (dof.n_dofs());
   VectorTools::create_boundary_right_hand_side (dof, quadrature,
-                                      MySquareFunction<dim>(),
-                                      rhs);
+                                                MySquareFunction<dim>(),
+                                                rhs);
   for (unsigned int i=0; i<rhs.size(); ++i)
     deallog << rhs(i) << std::endl;
 }
@@ -115,7 +119,7 @@ int main ()
 {
   std::ofstream logfile ("vectors_boundary_rhs_01/output");
   logfile.precision (4);
-  logfile.setf(std::ios::fixed);  
+  logfile.setf(std::ios::fixed);
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 1834bb7eb7ab69f130b512a444d970f0aac1d478..42a8086d14ba2ad921626b910204e71773a41ea9 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim>(dim) {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square(); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      {
-       for (unsigned int d=0; d<dim; ++d)
-         values(d) = value(p,d);
-      }
+public:
+  MySquareFunction () : Function<dim>(dim) {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square();
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    for (unsigned int d=0; d<dim; ++d)
+      values(d) = value(p,d);
+  }
 };
 
 
@@ -70,7 +72,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -81,21 +83,21 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   hp::FECollection<dim> element;
   element.push_back (FE_RaviartThomas<dim> (0));
   hp::DoFHandler<dim> dof(tr);
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active(); cell!=dof.end(); ++cell)
+       cell = dof.begin_active(); cell!=dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
-  
+
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   hp::MappingCollection<dim> mapping;
   mapping.push_back (MappingQ<dim>(3));
 
@@ -104,8 +106,8 @@ check ()
 
   Vector<double> rhs (dof.n_dofs());
   VectorTools::create_boundary_right_hand_side (dof, quadrature,
-                                      MySquareFunction<dim>(),
-                                      rhs);
+                                                MySquareFunction<dim>(),
+                                                rhs);
   for (unsigned int i=0; i<rhs.size(); ++i)
     deallog << rhs(i) << std::endl;
 }
@@ -116,7 +118,7 @@ int main ()
 {
   std::ofstream logfile ("vectors_boundary_rhs_02/output");
   logfile.precision (4);
-  logfile.setf(std::ios::fixed);  
+  logfile.setf(std::ios::fixed);
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index cd235cb3751743a09b639bd1e8ef1da073e040e4..00f3793f9e9263f6277baa1f3b85f012e82569c0 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim>(1) {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square(); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { values(0) = value(p,0); }
+public:
+  MySquareFunction () : Function<dim>(1) {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square();
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+  }
 };
 
 
@@ -67,7 +71,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -78,21 +82,21 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   hp::FECollection<dim> element;
   element.push_back (FE_Q<dim>(1));
   hp::DoFHandler<dim> dof(tr);
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active(); cell!=dof.end(); ++cell)
+       cell = dof.begin_active(); cell!=dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
-  
+
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   hp::MappingCollection<dim> mapping;
   mapping.push_back (MappingQ<dim>(3));
 
@@ -101,8 +105,8 @@ check ()
 
   Vector<double> rhs (dof.n_dofs());
   VectorTools::create_boundary_right_hand_side (dof, quadrature,
-                                      MySquareFunction<dim>(),
-                                      rhs);
+                                                MySquareFunction<dim>(),
+                                                rhs);
   for (unsigned int i=0; i<rhs.size(); ++i)
     deallog << rhs(i) << std::endl;
 }
@@ -113,7 +117,7 @@ int main ()
 {
   std::ofstream logfile ("vectors_boundary_rhs_03/output");
   logfile.precision (4);
-  logfile.setf(std::ios::fixed);  
+  logfile.setf(std::ios::fixed);
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 51069c1cb772c603d8b6d1015c5ccdf1524d5a45..708d31102e5e8216442fd5dc7d93c8d15d8feae5 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim>(2) {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square(); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { values(0) = value(p,0);
-       values(1) = value(p,1); }
+public:
+  MySquareFunction () : Function<dim>(2) {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square();
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+    values(1) = value(p,1);
+  }
 };
 
 
@@ -68,7 +72,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -79,23 +83,23 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   hp::FECollection<dim> element;
   for (unsigned int i=1; i<7-dim; ++i)
     element.push_back (FESystem<dim> (FE_Q<dim>(i), 1,
-                                     FE_Q<dim>(i+1), 1));
+                                      FE_Q<dim>(i+1), 1));
   hp::DoFHandler<dim> dof(tr);
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active(); cell!=dof.end(); ++cell)
+       cell = dof.begin_active(); cell!=dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
-  
+
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   hp::MappingCollection<dim> mapping;
   for (unsigned int i=1; i<7-dim; ++i)
     mapping.push_back (MappingQ<dim>(i+1));
@@ -106,8 +110,8 @@ check ()
 
   Vector<double> rhs (dof.n_dofs());
   VectorTools::create_boundary_right_hand_side (dof, quadrature,
-                                      MySquareFunction<dim>(),
-                                      rhs);
+                                                MySquareFunction<dim>(),
+                                                rhs);
   for (unsigned int i=0; i<rhs.size(); ++i)
     deallog << rhs(i) << std::endl;
 }
@@ -118,7 +122,7 @@ int main ()
 {
   std::ofstream logfile ("vectors_boundary_rhs_hp_01/output");
   logfile.precision (4);
-  logfile.setf(std::ios::fixed);  
+  logfile.setf(std::ios::fixed);
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 8a08b13649ee33017501c9d6eea1e11b9ad7d372..2517398c2f8745d082a9471d8f3a34e36bd19790 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim>(1) {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square(); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { values(0) = value(p,0); }
+public:
+  MySquareFunction () : Function<dim>(1) {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square();
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+  }
 };
 
 
@@ -67,7 +71,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -78,22 +82,22 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   hp::FECollection<dim> element;
   for (unsigned int i=1; i<7-dim; ++i)
     element.push_back (FE_Q<dim>(i));
   hp::DoFHandler<dim> dof(tr);
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active(); cell!=dof.end(); ++cell)
+       cell = dof.begin_active(); cell!=dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
-  
+
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   hp::MappingCollection<dim> mapping;
   for (unsigned int i=1; i<7-dim; ++i)
     mapping.push_back (MappingQ<dim>(i+1));
@@ -104,8 +108,8 @@ check ()
 
   Vector<double> rhs (dof.n_dofs());
   VectorTools::create_boundary_right_hand_side (dof, quadrature,
-                                      MySquareFunction<dim>(),
-                                      rhs);
+                                                MySquareFunction<dim>(),
+                                                rhs);
   for (unsigned int i=0; i<rhs.size(); ++i)
     deallog << rhs(i) << std::endl;
 }
@@ -116,7 +120,7 @@ int main ()
 {
   std::ofstream logfile ("vectors_boundary_rhs_hp_03/output");
   logfile.precision (4);
-  logfile.setf(std::ios::fixed);  
+  logfile.setf(std::ios::fixed);
   deallog.attach(logfile);
   deallog.depth_console (0);
 
index 89b2e935cab3a1f8834391cdd1f3e63a816f0eea..f2bbdf261a3502e97fabe6557d1ec9134f595b8e 100644 (file)
@@ -50,7 +50,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -61,21 +61,21 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   hp::FECollection<dim> element;
   element.push_back (FE_Q<dim>(1));
   hp::DoFHandler<dim> dof(tr);
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active(); cell!=dof.end(); ++cell)
+       cell = dof.begin_active(); cell!=dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
-  
+
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   hp::MappingCollection<dim> mapping;
   mapping.push_back (MappingQ<dim>(3));
 
@@ -84,8 +84,8 @@ check ()
 
   Vector<double> rhs (dof.n_dofs());
   VectorTools::create_point_source_vector (dof,
-                                          tr.begin()->center(),
-                                          rhs);
+                                           tr.begin()->center(),
+                                           rhs);
   for (unsigned int i=0; i<rhs.size(); ++i)
     deallog << rhs(i) << std::endl;
 }
@@ -96,7 +96,7 @@ int main ()
 {
   std::ofstream logfile ("vectors_point_source_01/output");
   logfile.precision (4);
-  logfile.setf(std::ios::fixed);  
+  logfile.setf(std::ios::fixed);
   deallog << std::setprecision(4) << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
index 3ca17c291f7545983d13e608bbf076e4c595c904..c7f4a1059082fbfd4c792bf791096a18e4f02e1d 100644 (file)
@@ -49,7 +49,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -60,30 +60,30 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   hp::FECollection<dim> element;
   for (unsigned int i=1; i<7-dim; ++i)
     element.push_back (FE_Q<dim>(i));
   hp::DoFHandler<dim> dof(tr);
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active(); cell!=dof.end(); ++cell)
+       cell = dof.begin_active(); cell!=dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
-  
+
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   hp::MappingCollection<dim> mapping;
   for (unsigned int i=1; i<7-dim; ++i)
     mapping.push_back (MappingQ<dim>(i+1));
 
   Vector<double> rhs (dof.n_dofs());
   VectorTools::create_point_source_vector (mapping, dof,
-                                          tr.begin()->center(),
-                                          rhs);
+                                           tr.begin()->center(),
+                                           rhs);
   for (unsigned int i=0; i<rhs.size(); ++i)
     deallog << rhs(i) << std::endl;
 }
@@ -94,7 +94,7 @@ int main ()
 {
   std::ofstream logfile ("vectors_point_source_hp_01/output");
   logfile.precision (4);
-  logfile.setf(std::ios::fixed);  
+  logfile.setf(std::ios::fixed);
   deallog << std::setprecision(4) << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
index 22f7d2e4fe60ab26435e50723b93545168937f87..b779f9224a65b1a2a6878371c894f4b77ae4bfef 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim>(2) {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square(); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { values(0) = value(p,0);
-       values(1) = value(p,1); }
+public:
+  MySquareFunction () : Function<dim>(2) {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square();
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+    values(1) = value(p,1);
+  }
 };
 
 
@@ -68,7 +72,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -79,22 +83,22 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   hp::FECollection<dim> element;
   element.push_back (FESystem<dim> (FE_Q<dim>(1), 1,
-                                   FE_Q<dim>(2), 1));
+                                    FE_Q<dim>(2), 1));
   hp::DoFHandler<dim> dof(tr);
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active(); cell!=dof.end(); ++cell)
+       cell = dof.begin_active(); cell!=dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
-  
+
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   hp::MappingCollection<dim> mapping;
   mapping.push_back (MappingQ<dim>(3));
 
@@ -103,8 +107,8 @@ check ()
 
   Vector<double> rhs (dof.n_dofs());
   VectorTools::create_right_hand_side (dof, quadrature,
-                                      MySquareFunction<dim>(),
-                                      rhs);
+                                       MySquareFunction<dim>(),
+                                       rhs);
   for (unsigned int i=0; i<rhs.size(); ++i)
     deallog << rhs(i) << std::endl;
 }
@@ -115,7 +119,7 @@ int main ()
 {
   std::ofstream logfile ("vectors_rhs_01/output");
   logfile.precision (4);
-  logfile.setf(std::ios::fixed);  
+  logfile.setf(std::ios::fixed);
   deallog << std::setprecision(4) << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
index e73239a571f888e699f621f419166d7051f2eb2f..114dff0fe1fdae169df0a7e296910b62b67a5fb9 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim>(dim) {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square(); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      {
-       for (unsigned int d=0; d<dim; ++d)
-         values(d) = value(p,d);
-      }
+public:
+  MySquareFunction () : Function<dim>(dim) {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square();
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    for (unsigned int d=0; d<dim; ++d)
+      values(d) = value(p,d);
+  }
 };
 
 
@@ -70,7 +72,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -81,21 +83,21 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   hp::FECollection<dim> element;
   element.push_back (FE_RaviartThomas<dim> (0));
   hp::DoFHandler<dim> dof(tr);
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active(); cell!=dof.end(); ++cell)
+       cell = dof.begin_active(); cell!=dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
-  
+
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   hp::MappingCollection<dim> mapping;
   mapping.push_back (MappingQ<dim>(3));
 
@@ -104,8 +106,8 @@ check ()
 
   Vector<double> rhs (dof.n_dofs());
   VectorTools::create_right_hand_side (dof, quadrature,
-                                      MySquareFunction<dim>(),
-                                      rhs);
+                                       MySquareFunction<dim>(),
+                                       rhs);
   for (unsigned int i=0; i<rhs.size(); ++i)
     deallog << rhs(i) << std::endl;
 }
@@ -116,7 +118,7 @@ int main ()
 {
   std::ofstream logfile ("vectors_rhs_02/output");
   logfile.precision (4);
-  logfile.setf(std::ios::fixed);  
+  logfile.setf(std::ios::fixed);
   deallog << std::setprecision(4) << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
index c8c7fcef6f5dea6787f641906b12519b1458e7b1..54e55b62c865940a9a0fa87c7d02e51e9edb7455 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim>(1) {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square(); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { values(0) = value(p,0); }
+public:
+  MySquareFunction () : Function<dim>(1) {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square();
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+  }
 };
 
 
@@ -67,7 +71,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -78,21 +82,21 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   hp::FECollection<dim> element;
   element.push_back (FE_Q<dim>(1));
   hp::DoFHandler<dim> dof(tr);
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active(); cell!=dof.end(); ++cell)
+       cell = dof.begin_active(); cell!=dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
-  
+
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   hp::MappingCollection<dim> mapping;
   mapping.push_back (MappingQ<dim>(3));
 
@@ -101,8 +105,8 @@ check ()
 
   Vector<double> rhs (dof.n_dofs());
   VectorTools::create_right_hand_side (dof, quadrature,
-                                      MySquareFunction<dim>(),
-                                      rhs);
+                                       MySquareFunction<dim>(),
+                                       rhs);
   for (unsigned int i=0; i<rhs.size(); ++i)
     deallog << rhs(i) << std::endl;
 }
@@ -113,7 +117,7 @@ int main ()
 {
   std::ofstream logfile ("vectors_rhs_03/output");
   logfile.precision (4);
-  logfile.setf(std::ios::fixed);  
+  logfile.setf(std::ios::fixed);
   deallog << std::setprecision(4) << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
index 4953151cc663ccd21f05dc0fb56324aeb4c021f0..44b9acf42f264af778429d508fae5d5d31f17f76 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim>(2) {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square(); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { values(0) = value(p,0);
-       values(1) = value(p,1); }
+public:
+  MySquareFunction () : Function<dim>(2) {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square();
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+    values(1) = value(p,1);
+  }
 };
 
 
@@ -68,7 +72,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -79,23 +83,23 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   hp::FECollection<dim> element;
   for (unsigned int i=1; i<7-dim; ++i)
     element.push_back (FESystem<dim> (FE_Q<dim>(i), 1,
-                                     FE_Q<dim>(i+1), 1));
+                                      FE_Q<dim>(i+1), 1));
   hp::DoFHandler<dim> dof(tr);
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active(); cell!=dof.end(); ++cell)
+       cell = dof.begin_active(); cell!=dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
-  
+
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   hp::MappingCollection<dim> mapping;
   for (unsigned int i=1; i<7-dim; ++i)
     mapping.push_back (MappingQ<dim>(i+1));
@@ -106,8 +110,8 @@ check ()
 
   Vector<double> rhs (dof.n_dofs());
   VectorTools::create_right_hand_side (dof, quadrature,
-                                      MySquareFunction<dim>(),
-                                      rhs);
+                                       MySquareFunction<dim>(),
+                                       rhs);
   for (unsigned int i=0; i<rhs.size(); ++i)
     deallog << rhs(i) << std::endl;
 }
@@ -118,7 +122,7 @@ int main ()
 {
   std::ofstream logfile ("vectors_rhs_hp_01/output");
   logfile.precision (4);
-  logfile.setf(std::ios::fixed);  
+  logfile.setf(std::ios::fixed);
   deallog << std::setprecision(4) << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
index 75820cb5215bc42ef4d2bd95ad5aade4fdcfd3b6..88f19bdb9763d1fb6729295f7ed23bacc5aff5a9 100644 (file)
 template<int dim>
 class MySquareFunction : public Function<dim>
 {
-  public:
-    MySquareFunction () : Function<dim>(1) {}
-    
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component) const
-      {        return (component+1)*p.square(); }
-    
-    virtual void   vector_value (const Point<dim>   &p,
-                                Vector<double>     &values) const
-      { values(0) = value(p,0); }
+public:
+  MySquareFunction () : Function<dim>(1) {}
+
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component) const
+  {
+    return (component+1)*p.square();
+  }
+
+  virtual void   vector_value (const Point<dim>   &p,
+                               Vector<double>     &values) const
+  {
+    values(0) = value(p,0);
+  }
 };
 
 
@@ -67,7 +71,7 @@ template <int dim>
 void
 check ()
 {
-  Triangulation<dim> tr;  
+  Triangulation<dim> tr;
   if (dim==2)
     GridGenerator::hyper_ball(tr, Point<dim>(), 1);
   else
@@ -78,22 +82,22 @@ check ()
   if (dim==1)
     tr.refine_global(2);
 
-                                  // create a system element composed
-                                  // of one Q1 and one Q2 element
+  // create a system element composed
+  // of one Q1 and one Q2 element
   hp::FECollection<dim> element;
   for (unsigned int i=1; i<7-dim; ++i)
     element.push_back (FE_Q<dim>(i));
   hp::DoFHandler<dim> dof(tr);
   for (typename hp::DoFHandler<dim>::active_cell_iterator
-        cell = dof.begin_active(); cell!=dof.end(); ++cell)
+       cell = dof.begin_active(); cell!=dof.end(); ++cell)
     cell->set_active_fe_index (rand() % element.size());
-  
+
   dof.distribute_dofs(element);
 
-                                  // use a more complicated mapping
-                                  // of the domain and a quadrature
-                                  // formula suited to the elements
-                                  // we have here
+  // use a more complicated mapping
+  // of the domain and a quadrature
+  // formula suited to the elements
+  // we have here
   hp::MappingCollection<dim> mapping;
   for (unsigned int i=1; i<7-dim; ++i)
     mapping.push_back (MappingQ<dim>(i+1));
@@ -104,8 +108,8 @@ check ()
 
   Vector<double> rhs (dof.n_dofs());
   VectorTools::create_right_hand_side (dof, quadrature,
-                                      MySquareFunction<dim>(),
-                                      rhs);
+                                       MySquareFunction<dim>(),
+                                       rhs);
   for (unsigned int i=0; i<rhs.size(); ++i)
     deallog << rhs(i) << std::endl;
 }
@@ -116,7 +120,7 @@ int main ()
 {
   std::ofstream logfile ("vectors_rhs_hp_03/output");
   logfile.precision (4);
-  logfile.setf(std::ios::fixed);  
+  logfile.setf(std::ios::fixed);
   deallog << std::setprecision(4) << std::fixed;
   deallog.attach(logfile);
   deallog.depth_console (0);
index be4904b7b40c237c171fd38282d3dce2063ce806..4b42229c2d0888e52ea72c8fd4a2f1db1282228a 100644 (file)
@@ -47,39 +47,39 @@ template <int dim>
 void test ()
 {
   deallog << dim << 'd' << std::endl;
-  
-  Triangulation<dim> tria;  
+
+  Triangulation<dim> tria;
   GridGenerator::hyper_cube (tria,0,1);
   tria.refine_global (1);
 
-                                   // destroy the uniformity of the matrix by
-                                   // refining one cell
+  // destroy the uniformity of the matrix by
+  // refining one cell
   tria.begin_active()->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
   tria.refine_global(8-2*dim);
-  
+
   FE_Q<dim> fe (1);
   DoFHandler<dim> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
-    
+
   deallog << "Number of dofs = " << dof_handler.n_dofs() << std::endl;
-  
+
   SparsityPattern sparsity_pattern;
   sparsity_pattern.reinit (dof_handler.n_dofs(),
                            dof_handler.n_dofs(),
                            dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
   sparsity_pattern.compress ();
-  
+
   SparseMatrix<double> B;
-  B.reinit (sparsity_pattern);  
-  
+  B.reinit (sparsity_pattern);
+
   QGauss<dim> qr (2);
   MatrixTools::create_mass_matrix (dof_handler, qr, B);
 
-                                   // for a number of different solution
-                                   // vectors, make up a matching rhs vector
-                                   // and check what the MA27 solver finds
+  // for a number of different solution
+  // vectors, make up a matching rhs vector
+  // and check what the MA27 solver finds
   for (unsigned int i=0; i<3; ++i)
     {
       Vector<double> solution (dof_handler.n_dofs());
index 9f7b75b4f83e1a514085418e29e08ac78c541c1b..340741c8f624fbce3dc1743be518f32efe131db1 100644 (file)
@@ -49,13 +49,13 @@ template <int dim>
 void test ()
 {
   deallog << dim << 'd' << std::endl;
-  
-  Triangulation<dim> tria;  
+
+  Triangulation<dim> tria;
   GridGenerator::hyper_cube (tria,0,1);
   tria.refine_global (1);
 
-                                   // destroy the uniformity of the matrix by
-                                   // refining one cell
+  // destroy the uniformity of the matrix by
+  // refining one cell
   tria.begin_active()->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
   tria.refine_global(8-2*dim);
@@ -63,29 +63,29 @@ void test ()
   FE_Q<dim> fe (1);
   DoFHandler<dim> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
-    
+
   deallog << "Number of dofs = " << dof_handler.n_dofs() << std::endl;
-  
+
   SparsityPattern sparsity_pattern;
   sparsity_pattern.reinit (dof_handler.n_dofs(),
                            dof_handler.n_dofs(),
                            dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
   sparsity_pattern.compress ();
-  
+
   SparseMatrix<double> B;
-  B.reinit (sparsity_pattern);  
-  
+  B.reinit (sparsity_pattern);
+
   QGauss<dim> qr (2);
   MatrixTools::create_mass_matrix (dof_handler, qr, B);
 
-                                   // compute a decomposition of the matrix
+  // compute a decomposition of the matrix
   SparseDirectMA27 Binv;
   Binv.factorize (B);
-      
-                                   // for a number of different solution
-                                   // vectors, make up a matching rhs vector
-                                   // and check what the MA27 solver finds
+
+  // for a number of different solution
+  // vectors, make up a matching rhs vector
+  // and check what the MA27 solver finds
   for (unsigned int i=0; i<3; ++i)
     {
       Vector<double> solution (dof_handler.n_dofs());
index 59c01351c65cf1431858897638a5cd1f57a807b3..818dae45fc5dc15064e13fcb691516b5374b88f0 100644 (file)
@@ -47,13 +47,13 @@ template <int dim>
 void test ()
 {
   deallog << dim << 'd' << std::endl;
-  
-  Triangulation<dim> tria;  
+
+  Triangulation<dim> tria;
   GridGenerator::hyper_cube (tria,0,1);
   tria.refine_global (1);
 
-                                   // destroy the uniformity of the matrix by
-                                   // refining one cell
+  // destroy the uniformity of the matrix by
+  // refining one cell
   tria.begin_active()->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
   tria.refine_global(8-2*dim);
@@ -61,25 +61,25 @@ void test ()
   FE_Q<dim> fe (1);
   DoFHandler<dim> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
-    
+
   deallog << "Number of dofs = " << dof_handler.n_dofs() << std::endl;
-  
+
   SparsityPattern sparsity_pattern;
   sparsity_pattern.reinit (dof_handler.n_dofs(),
                            dof_handler.n_dofs(),
                            dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
   sparsity_pattern.compress ();
-  
+
   SparseMatrix<double> B;
-  B.reinit (sparsity_pattern);  
-  
+  B.reinit (sparsity_pattern);
+
   QGauss<dim> qr (2);
   MatrixTools::create_mass_matrix (dof_handler, qr, B);
 
-                                   // for a number of different solution
-                                   // vectors, make up a matching rhs vector
-                                   // and check what the MA47 solver finds
+  // for a number of different solution
+  // vectors, make up a matching rhs vector
+  // and check what the MA47 solver finds
   for (unsigned int i=0; i<3; ++i)
     {
       Vector<double> solution (dof_handler.n_dofs());
index acd9c918b1b80b114e1721948a3b2b7665f42d07..633cc601783beda392669657e1488c329a2ee630 100644 (file)
@@ -49,13 +49,13 @@ template <int dim>
 void test ()
 {
   deallog << dim << 'd' << std::endl;
-  
-  Triangulation<dim> tria;  
+
+  Triangulation<dim> tria;
   GridGenerator::hyper_cube (tria,0,1);
   tria.refine_global (1);
 
-                                   // destroy the uniformity of the matrix by
-                                   // refining one cell
+  // destroy the uniformity of the matrix by
+  // refining one cell
   tria.begin_active()->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
   tria.refine_global(8-2*dim);
@@ -63,29 +63,29 @@ void test ()
   FE_Q<dim> fe (1);
   DoFHandler<dim> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
-    
+
   deallog << "Number of dofs = " << dof_handler.n_dofs() << std::endl;
-  
+
   SparsityPattern sparsity_pattern;
   sparsity_pattern.reinit (dof_handler.n_dofs(),
                            dof_handler.n_dofs(),
                            dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
   sparsity_pattern.compress ();
-  
+
   SparseMatrix<double> B;
-  B.reinit (sparsity_pattern);  
-  
+  B.reinit (sparsity_pattern);
+
   QGauss<dim> qr (2);
   MatrixTools::create_mass_matrix (dof_handler, qr, B);
 
-                                   // compute a decomposition of the matrix
+  // compute a decomposition of the matrix
   SparseDirectMA47 Binv;
   Binv.factorize (B);
-      
-                                   // for a number of different solution
-                                   // vectors, make up a matching rhs vector
-                                   // and check what the MA47 solver finds
+
+  // for a number of different solution
+  // vectors, make up a matching rhs vector
+  // and check what the MA47 solver finds
   for (unsigned int i=0; i<3; ++i)
     {
       Vector<double> solution (dof_handler.n_dofs());
index ab6967b9cbba03daa2c2e5f064c73b2c35911061..8ecaec7d24abdc0a19aa3e4ab2f71dc88e5a1483 100644 (file)
 using namespace dealii;
 
 template <class DOFINFO, class MATRIX>
-void test(DOFINFO& info, MeshWorker::Assembler::MatrixSimple<MATRIX>& ass)
-{  
+void test(DOFINFO &info, MeshWorker::Assembler::MatrixSimple<MATRIX> &ass)
+{
   ass.initialize_info(info, false);
   deallog << "No faces" << std::endl;
   info.print_debug(deallog);
-  
+
   ass.initialize_info(info, true);
   deallog << "With faces" << std::endl;
   info.print_debug(deallog);
@@ -54,7 +54,7 @@ int main()
   std::ofstream logfile(logname.c_str());
   deallog.attach(logfile);
   deallog.depth_console (0);
-  
+
   Triangulation<2,2> tr;
   GridGenerator::hyper_cube(tr);
   FE_DGP<2,2> fe1(1);
@@ -67,7 +67,7 @@ int main()
   DoFHandler<2,2> dof1(tr);
   dof1.distribute_dofs(fes1);
   DoFHandler<2,2> dof2(tr);
-  dof2.distribute_dofs(fes2);    
+  dof2.distribute_dofs(fes2);
   dof1.initialize_local_block_info();
   dof2.initialize_local_block_info();
   MeshWorker::DoFInfo<2,2,double> info1(dof1);
@@ -82,5 +82,5 @@ int main()
   test(info1b, ass1);
   deallog.pop();
   deallog.push("More blocks");
-  test(info2b, ass1);  
+  test(info2b, ass1);
 }
index 4eb90b5497adf02311b77e8e8c51f979d5bc66dc..47144e3fa4e6348713d87c9a09d5c4c505e5f447 100644 (file)
 using namespace dealii;
 
 template <int dim>
-void test(FiniteElement<dim>fe)
+void test(FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
-  
+
   Triangulation<dim> tr;
   GridGenerator::hyper_cube(tr);
   tr.refine_global(1);
@@ -51,10 +51,10 @@ void test(FiniteElement<dim>& fe)
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
   dof.initialize_local_block_info();
-  
+
   typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active();
   typename DoFHandler<dim>::face_iterator face = cell->face(1);
-  
+
   MeshWorker::Assembler::MatrixSimple<FullMatrix<double> > ass;
   ass.initialize_local_blocks(dof.block_info().local());
   MeshWorker::DoFInfo<dim> info(dof.block_info());
@@ -64,7 +64,7 @@ void test(FiniteElement<dim>& fe)
   info.reinit(cell);
   info.print_debug(deallog);
   deallog.pop();
-  
+
   deallog.push("face1");
   info.reinit(cell, face, 1);
   info.print_debug(deallog);
@@ -92,7 +92,7 @@ int main()
   FESystem<2> sys1(p0,1, p1, 1);
   FESystem<2> sys2(p2,2,p0,3,p1,1);
   FESystem<2> sys3(p0, 2, rt0, 1);
-  
+
   test(sys1);
   test(sys2);
   test(sys3);
index 4b05e9fae576c4d1b7c97d35d2d3dd3af9b77344..5cf602c096e205e07cf0732ad5ff982883c48cc8 100644 (file)
 using namespace dealii;
 
 template <typename number>
-void fill_matrices(MeshWorker::LocalResults<number>results, bool face)
+void fill_matrices(MeshWorker::LocalResults<number> &results, bool face)
 {
-  for (unsigned int k=0;k<results.n_matrices();++k)
+  for (unsigned int k=0; k<results.n_matrices(); ++k)
     {
-      FullMatrix<number>M = results.matrix(k, false).matrix;
+      FullMatrix<number> &M = results.matrix(k, false).matrix;
       double base = 1000*(results.matrix(k).row+1) + 100*(results.matrix(k).column+1);
-      for (unsigned int i=0;i<M.m();++i)
-       for (unsigned int j=0;j<M.n();++j)
-         {
-           M(i,j) = base + 10*i+j;
-           if (face)
-             results.matrix(k, true).matrix(i,j) = base + 10*i+j;
-         }
+      for (unsigned int i=0; i<M.m(); ++i)
+        for (unsigned int j=0; j<M.n(); ++j)
+          {
+            M(i,j) = base + 10*i+j;
+            if (face)
+              results.matrix(k, true).matrix(i,j) = base + 10*i+j;
+          }
     }
 }
 
 
 template <int dim>
-void test(FiniteElement<dim>fe)
+void test(FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
-  
+
   Triangulation<dim> tr;
   GridGenerator::hyper_cube(tr);
   tr.refine_global(1);
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
   dof.initialize_local_block_info();
   DoFRenumbering::component_wise(dof);
-  
+
   deallog << "DoFs " << dof.n_dofs() << std::endl;
-  
+
   typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active();
   typename DoFHandler<dim>::face_iterator face = cell->face(1);
   typename DoFHandler<dim>::active_cell_iterator neighbor = cell->neighbor(1);
-  
+
   CompressedSparsityPattern csp(dof.n_dofs(),dof.n_dofs());
   DoFTools::make_flux_sparsity_pattern(dof, csp);
   SparsityPattern sparsity;
   sparsity.copy_from(csp);
   SparseMatrix<double> M(sparsity);
-  
+
   MeshWorker::Assembler::MatrixSimple<SparseMatrix<double> > ass;
   ass.initialize(M);
   ass.initialize_local_blocks(dof.block_info().local());
@@ -98,7 +98,7 @@ void test(FiniteElement<dim>& fe)
   ass.assemble(info);
   M.print_formatted(deallog.get_file_stream(), 0, false, 6);
   M = 0.;
-  
+
   deallog << "face" << std::endl;
   ass.initialize_info(info, true);
   info.reinit(cell, face, 1);
@@ -117,13 +117,13 @@ int main()
   FE_DGP<2> p1(1);
   FE_RaviartThomas<2> rt0(0);
   FE_Q<2> q2(2);
-  
+
   FESystem<2> sys1(p0, 2, p1, 1);
   FESystem<2> sys2(p0, 2, rt0, 1);
   FESystem<2> sys3(rt0, 1, p0, 2);
   FESystem<2> sys4(p1, 2, q2, 2);
   FESystem<2> sys5(q2, 2, p1, 2);
-  
+
   test(sys1);
   test(sys2);
   test(sys3);
index b37332deb76acdf8c42c3cbb1c3426d7150c97e4..fcd3f3204f116a83e72a04cfdd67cce54fa219e0 100644 (file)
 using namespace dealii;
 
 template <typename number>
-void fill_matrices(MeshWorker::LocalResults<number>results, bool face)
+void fill_matrices(MeshWorker::LocalResults<number> &results, bool face)
 {
-  for (unsigned int k=0;k<results.n_matrices();++k)
+  for (unsigned int k=0; k<results.n_matrices(); ++k)
     {
-      FullMatrix<number>M = results.matrix(k, false).matrix;
+      FullMatrix<number> &M = results.matrix(k, false).matrix;
       double base = 1000*(results.matrix(k).row+1) + 100*(results.matrix(k).column+1);
-      for (unsigned int i=0;i<M.m();++i)
-       for (unsigned int j=0;j<M.n();++j)
-         {
-           M(i,j) = base + 10*i+j;
-           if (face)
-             results.matrix(k, true).matrix(i,j) = base + 10*i+j;
-         }
+      for (unsigned int i=0; i<M.m(); ++i)
+        for (unsigned int j=0; j<M.n(); ++j)
+          {
+            M(i,j) = base + 10*i+j;
+            if (face)
+              results.matrix(k, true).matrix(i,j) = base + 10*i+j;
+          }
     }
 }
 
 
 template <int dim>
-void test(FiniteElement<dim>fe)
+void test(FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
-  
+
   Triangulation<dim> tr;
   GridGenerator::hyper_cube(tr);
   tr.refine_global(1);
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
   dof.initialize_local_block_info();
   DoFRenumbering::component_wise(dof);
-  
+
   deallog << "DoFs " << dof.n_dofs() << std::endl;
-  
+
   typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active();
   typename DoFHandler<dim>::face_iterator face = cell->face(1);
   typename DoFHandler<dim>::active_cell_iterator neighbor = cell->neighbor(1);
-  
+
   CompressedSparsityPattern csp(dof.n_dofs(),dof.n_dofs());
   DoFTools::make_flux_sparsity_pattern(dof, csp);
   TrilinosWrappers::SparsityPattern sparsity;
   sparsity.copy_from(csp);
   TrilinosWrappers::SparseMatrix M(sparsity);
-  
+
   MeshWorker::Assembler::MatrixSimple<TrilinosWrappers::SparseMatrix> ass;
   ass.initialize(M);
   ass.initialize_local_blocks(dof.block_info().local());
@@ -98,7 +98,7 @@ void test(FiniteElement<dim>& fe)
   ass.assemble(info);
   M.print(deallog.get_file_stream());
   M = 0.;
-  
+
   deallog << "face" << std::endl;
   ass.initialize_info(info, true);
   info.reinit(cell, face, 1);
@@ -109,22 +109,22 @@ void test(FiniteElement<dim>& fe)
   M.print(deallog.get_file_stream());
 }
 
-int main(int argc, char** argv)
+int main(int argc, char **argv)
 {
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
   initlog(__FILE__);
-  
+
   FE_DGP<2> p0(0);
   FE_DGP<2> p1(1);
   FE_RaviartThomas<2> rt0(0);
   FE_Q<2> q2(2);
-  
+
   FESystem<2> sys1(p0, 2, p1, 1);
   FESystem<2> sys2(p0, 2, rt0, 1);
   FESystem<2> sys3(rt0, 1, p0, 2);
   FESystem<2> sys4(p1, 2, q2, 2);
   FESystem<2> sys5(q2, 2, p1, 2);
-  
+
   test(sys1);
   test(sys2);
   test(sys3);
index a8fd1d889a65c621cbc658e971b901f558496997..f52b7feb13956e2e23e517e87e573304415c7e6f 100644 (file)
 using namespace dealii;
 
 template <typename number>
-void fill_matrices(MeshWorker::LocalResults<number>results, bool face)
+void fill_matrices(MeshWorker::LocalResults<number> &results, bool face)
 {
-  for (unsigned int k=0;k<results.n_matrices();++k)
+  for (unsigned int k=0; k<results.n_matrices(); ++k)
     {
-      FullMatrix<number>M = results.matrix(k, false).matrix;
+      FullMatrix<number> &M = results.matrix(k, false).matrix;
       double base = 1000*(results.matrix(k).row+1) + 100*(results.matrix(k).column+1);
-      for (unsigned int i=0;i<M.m();++i)
-       for (unsigned int j=0;j<M.n();++j)
-         {
-           M(i,j) = base + 10*i+j;
-           if (face)
-             results.matrix(k, true).matrix(i,j) = base + 10*i+j;
-         }
+      for (unsigned int i=0; i<M.m(); ++i)
+        for (unsigned int j=0; j<M.n(); ++j)
+          {
+            M(i,j) = base + 10*i+j;
+            if (face)
+              results.matrix(k, true).matrix(i,j) = base + 10*i+j;
+          }
     }
 }
 
 
 template <int dim>
-void test(FiniteElement<dim>fe)
+void test(FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
-  
+
   Triangulation<dim> tr;
   GridGenerator::hyper_cube(tr);
   tr.refine_global(1);
-  
+
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
   dof.initialize_local_block_info();
   DoFRenumbering::component_wise(dof);
-  
+
   deallog << "DoFs " << dof.n_dofs() << std::endl;
-  
+
   typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active();
   typename DoFHandler<dim>::face_iterator face = cell->face(1);
   typename DoFHandler<dim>::active_cell_iterator neighbor = cell->neighbor(1);
-  
+
   CompressedSparsityPattern csp(dof.n_dofs(),dof.n_dofs());
   DoFTools::make_flux_sparsity_pattern(dof, csp);
   SparsityPattern sparsity;
   sparsity.copy_from(csp);
   SparseMatrix<double> M(sparsity);
-  
+
   MeshWorker::Assembler::MatrixSimple<SparseMatrix<double> > ass;
   ass.initialize(M);
   ass.initialize_local_blocks(dof.block_info().local());
@@ -98,7 +98,7 @@ void test(FiniteElement<dim>& fe)
   ass.assemble(info);
   M.print_formatted(deallog.get_file_stream(), 0, false, 6);
   M = 0.;
-  
+
   deallog << "face" << std::endl;
   ass.initialize_info(info, true);
   info.reinit(cell, face, 1);
@@ -120,13 +120,13 @@ int main()
   FE_DGP<2> p1(1);
   FE_RaviartThomas<2> rt0(0);
   FE_Q<2> q2(2);
-  
+
   FESystem<2> sys1(p0, 2, p1, 1);
   FESystem<2> sys2(p0, 2, rt0, 1);
   FESystem<2> sys3(rt0, 1, p0, 2);
   FESystem<2> sys4(p1, 2, q2, 2);
   FESystem<2> sys5(q2, 2, p1, 2);
-  
+
   test(sys1);
   test(sys2);
   test(sys3);
index 2f9cd4f680d058f167434c8354b0c39840f94649..c7cdbef5f4532b793c228caf8619ebc5d3bb2b59 100644 (file)
 using namespace dealii;
 
 template <class DOFINFO, class MATRIX>
-void test(DOFINFO& info, MeshWorker::Assembler::MGMatrixSimple<MATRIX>& ass)
-{  
+void test(DOFINFO &info, MeshWorker::Assembler::MGMatrixSimple<MATRIX> &ass)
+{
   ass.initialize_info(info, false);
   deallog << "No faces" << std::endl;
   info.print_debug(deallog);
-  
+
   ass.initialize_info(info, true);
   deallog << "With faces" << std::endl;
   info.print_debug(deallog);
@@ -54,7 +54,7 @@ int main()
   std::ofstream logfile(logname.c_str());
   deallog.attach(logfile);
   deallog.depth_console (0);
-  
+
   Triangulation<2,2> tr;
   GridGenerator::hyper_cube(tr);
   FE_DGP<2,2> fe1(1);
@@ -67,7 +67,7 @@ int main()
   DoFHandler<2,2> dof1(tr);
   dof1.distribute_dofs(fes1);
   DoFHandler<2,2> dof2(tr);
-  dof2.distribute_dofs(fes2);    
+  dof2.distribute_dofs(fes2);
   dof1.initialize_local_block_info();
   dof2.initialize_local_block_info();
   MeshWorker::DoFInfo<2,2,double> info1(dof1);
@@ -82,5 +82,5 @@ int main()
   test(info1b, ass1);
   deallog.pop();
   deallog.push("More blocks");
-  test(info2b, ass1);  
+  test(info2b, ass1);
 }
index 6df51c596d7a0d69ece7b5d756ec3c6fb6caffb0..6499fe8e1066e9854ea75745554396e7c9506a77 100644 (file)
 using namespace dealii;
 
 template <int dim>
-void test(FiniteElement<dim>fe)
+void test(FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
-  
+
   Triangulation<dim> tr;
   GridGenerator::hyper_cube(tr);
   tr.refine_global(1);
@@ -51,10 +51,10 @@ void test(FiniteElement<dim>& fe)
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
   dof.initialize_local_block_info();
-  
+
   typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active();
   typename DoFHandler<dim>::face_iterator face = cell->face(1);
-  
+
   MeshWorker::Assembler::MGMatrixSimple<FullMatrix<double> > ass;
   ass.initialize_local_blocks(dof.block_info().local());
   MeshWorker::DoFInfo<dim> info(dof.block_info());
@@ -64,7 +64,7 @@ void test(FiniteElement<dim>& fe)
   info.reinit(cell);
   info.print_debug(deallog);
   deallog.pop();
-  
+
   deallog.push("face1");
   info.reinit(cell, face, 1);
   info.print_debug(deallog);
@@ -92,7 +92,7 @@ int main()
   FESystem<2> sys1(p0,1, p1, 1);
   FESystem<2> sys2(p2,2,p0,3,p1,1);
   FESystem<2> sys3(p0, 2, rt0, 1);
-  
+
   test(sys1);
   test(sys2);
   test(sys3);
index 29032f8846ba5dcdd2ce182e2926d4908cd950ed..2ec9a66783101c3e9e06a270535401acfcd71122 100644 (file)
 using namespace dealii;
 
 template <typename number>
-void fill_matrices(MeshWorker::LocalResults<number>results, bool face)
+void fill_matrices(MeshWorker::LocalResults<number> &results, bool face)
 {
-  for (unsigned int k=0;k<results.n_matrices();++k)
+  for (unsigned int k=0; k<results.n_matrices(); ++k)
     {
-      FullMatrix<number>M = results.matrix(k, false).matrix;
+      FullMatrix<number> &M = results.matrix(k, false).matrix;
       double base = 1000*(results.matrix(k).row+1) + 100*(results.matrix(k).column+1);
-      for (unsigned int i=0;i<M.m();++i)
-       for (unsigned int j=0;j<M.n();++j)
-         {
-           M(i,j) = base + 10*i+j;
-           if (face)
-             results.matrix(k, true).matrix(i,j) = base + 10*i+j;
-         }
+      for (unsigned int i=0; i<M.m(); ++i)
+        for (unsigned int j=0; j<M.n(); ++j)
+          {
+            M(i,j) = base + 10*i+j;
+            if (face)
+              results.matrix(k, true).matrix(i,j) = base + 10*i+j;
+          }
     }
 }
 
 
 template <int dim>
-void test(FiniteElement<dim>fe)
+void test(FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
-  
+
   Triangulation<dim> tr;
   GridGenerator::hyper_cube(tr);
   tr.refine_global(1);
-  
+
   MGDoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
   dof.initialize_local_block_info();
   DoFRenumbering::component_wise(dof);
-  
+
   deallog << "DoFs " << dof.n_dofs() << std::endl;
-  
+
   typename MGDoFHandler<dim>::cell_iterator cell = dof.begin_active();
   typename MGDoFHandler<dim>::face_iterator face = cell->face(1);
   typename MGDoFHandler<dim>::cell_iterator neighbor = cell->neighbor(1);
@@ -82,14 +82,14 @@ void test(FiniteElement<dim>& fe)
   MGLevelObject<SparsityPattern> sparsity(0, tr.n_levels()-1);
   MGLevelObject<SparseMatrix<double> > matrix(0, tr.n_levels()-1);
 
-  for (unsigned int level=0;level<tr.n_levels();++level)
+  for (unsigned int level=0; level<tr.n_levels(); ++level)
     {
       CompressedSparsityPattern csp(dof.n_dofs(level),dof.n_dofs(level));
       MGTools::make_flux_sparsity_pattern(dof, csp, level);
       sparsity[level].copy_from(csp);
       matrix[level].reinit(sparsity[level]);
     }
-  
+
   MeshWorker::Assembler::MGMatrixSimple<SparseMatrix<double> > ass;
   ass.initialize(matrix);
   ass.initialize_local_blocks(dof.block_info().local());
@@ -104,7 +104,7 @@ void test(FiniteElement<dim>& fe)
   ass.assemble(info);
   matrix[1].print_formatted(deallog.get_file_stream(), 0, false, 6);
   matrix[1] = 0.;
-  
+
   deallog << "face" << std::endl;
   ass.initialize_info(info, true);
   info.reinit(cell, face, 1);
@@ -126,13 +126,13 @@ int main()
   FE_DGP<2> p1(1);
   FE_RaviartThomas<2> rt0(0);
   FE_Q<2> q2(2);
-  
+
   FESystem<2> sys1(p0, 2, p1, 1);
   FESystem<2> sys2(p0, 2, rt0, 1);
   FESystem<2> sys3(rt0, 1, p0, 2);
   FESystem<2> sys4(p1, 2, q2, 2);
   FESystem<2> sys5(q2, 2, p1, 2);
-  
+
   test(sys1);
   test(sys2);
   test(sys3);
index 2e3a10519b9d9944ebd9af8d897141115d29e0e7..0e63ac9a04d93c216d0e123c6e8e09eaff141eab 100644 (file)
@@ -48,19 +48,19 @@ const unsigned int n_functionals = 3;
 template <int dim>
 class Local : public Subscriptor
 {
-  public:
-    typedef EmptyInfo CellInfo;
-    
-    void cell(MeshWorker::DoFInfo<dim>& dinfo, CellInfo& info) const;
-    void bdry(MeshWorker::DoFInfo<dim>& dinfo, CellInfo& info) const;
-    void face(MeshWorker::DoFInfo<dim>& dinfo1, MeshWorker::DoFInfo<dim>& dinfo2,
-             CellInfo& info1, CellInfo& info2) const;
+public:
+  typedef EmptyInfo CellInfo;
+
+  void cell(MeshWorker::DoFInfo<dim> &dinfo, CellInfo &info) const;
+  void bdry(MeshWorker::DoFInfo<dim> &dinfo, CellInfo &info) const;
+  void face(MeshWorker::DoFInfo<dim> &dinfo1, MeshWorker::DoFInfo<dim> &dinfo2,
+            CellInfo &info1, CellInfo &info2) const;
 };
 
 
 template <int dim>
 void
-Local<dim>::cell(MeshWorker::DoFInfo<dim>& info, CellInfo&) const
+Local<dim>::cell(MeshWorker::DoFInfo<dim> &info, CellInfo &) const
 {
   info.value(0) = 1.;
 }
@@ -68,7 +68,7 @@ Local<dim>::cell(MeshWorker::DoFInfo<dim>& info, CellInfo&) const
 
 template <int dim>
 void
-Local<dim>::bdry(MeshWorker::DoFInfo<dim>&  info, CellInfo&) const
+Local<dim>::bdry(MeshWorker::DoFInfo<dim>  &info, CellInfo &) const
 {
   info.value(2) = 1.;
 }
@@ -76,8 +76,8 @@ Local<dim>::bdry(MeshWorker::DoFInfo<dim>&  info, CellInfo&) const
 
 template <int dim>
 void
-Local<dim>::face(MeshWorker::DoFInfo<dim>&  info1, MeshWorker::DoFInfo<dim>& info2,
-                CellInfo&, CellInfo&) const
+Local<dim>::face(MeshWorker::DoFInfo<dim>  &info1, MeshWorker::DoFInfo<dim> &info2,
+                 CellInfo &, CellInfo &) const
 {
   info1.value(1) = 1./2.;
   info2.value(1) = 1./2.;
@@ -86,70 +86,70 @@ Local<dim>::face(MeshWorker::DoFInfo<dim>&  info1, MeshWorker::DoFInfo<dim>& inf
 
 template <int dim>
 void
-test_mesh(MGDoFHandler<dim>mgdofs)
+test_mesh(MGDoFHandler<dim> &mgdofs)
 {
-  const DoFHandler<dim>dofs = mgdofs;
+  const DoFHandler<dim> &dofs = mgdofs;
 
   BlockVector<double> cells(n_functionals);
   BlockVector<double> faces(n_functionals);
-  for (unsigned int i=0;i<n_functionals;++i)
+  for (unsigned int i=0; i<n_functionals; ++i)
     {
       cells.block(i).reinit(dofs.get_tria().n_cells());
-      faces.block(i).reinit(dofs.get_tria().n_faces());      
+      faces.block(i).reinit(dofs.get_tria().n_faces());
     }
   cells.collect_sizes();
   faces.collect_sizes();
-  
+
   NamedData<BlockVector<double>* > out_data;
-  BlockVector<double>p = &cells;
+  BlockVector<double> *p = &cells;
   out_data.add(p, "cells");
   p = &faces;
-  out_data.add(p, "faces");  
-  
+  out_data.add(p, "faces");
+
   Local<dim> local;
   EmptyInfoBox info_box;
   MeshWorker::DoFInfo<dim> dof_info(dofs);
-  
+
   MeshWorker::Assembler::CellsAndFaces<double> assembler;
   assembler.initialize(out_data, true);
-  
+
   MeshWorker::loop<dim, dim, MeshWorker::DoFInfo<dim>, EmptyInfoBox>
-    (dofs.begin_active(), dofs.end(),
-     dof_info, info_box,
-     std_cxx1x::bind (&Local<dim>::cell, local, std_cxx1x::_1, std_cxx1x::_2),
-     std_cxx1x::bind (&Local<dim>::bdry, local, std_cxx1x::_1, std_cxx1x::_2),
-     std_cxx1x::bind (&Local<dim>::face, local, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3, std_cxx1x::_4),
-     assembler, true);
+  (dofs.begin_active(), dofs.end(),
+   dof_info, info_box,
+   std_cxx1x::bind (&Local<dim>::cell, local, std_cxx1x::_1, std_cxx1x::_2),
+   std_cxx1x::bind (&Local<dim>::bdry, local, std_cxx1x::_1, std_cxx1x::_2),
+   std_cxx1x::bind (&Local<dim>::face, local, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3, std_cxx1x::_4),
+   assembler, true);
 
   deallog << "  Results cells";
-  for (unsigned int i=0;i<n_functionals;++i)
+  for (unsigned int i=0; i<n_functionals; ++i)
     deallog << '\t' << cells.block(i).l1_norm();
   deallog << std::endl;
 
   deallog << "  Results faces";
-  for (unsigned int i=0;i<n_functionals;++i)
+  for (unsigned int i=0; i<n_functionals; ++i)
     deallog << '\t' << faces.block(i).l1_norm();
   deallog << std::endl;
 
   cells = 0.;
   faces = 0.;
-  
+
   MeshWorker::DoFInfo<dim> mg_dof_info(mgdofs);
   MeshWorker::loop<dim, dim, MeshWorker::DoFInfo<dim>, EmptyInfoBox>
-    (mgdofs.begin(), mgdofs.end(),
-     mg_dof_info, info_box,
-     std_cxx1x::bind (&Local<dim>::cell, local, std_cxx1x::_1, std_cxx1x::_2),
-     std_cxx1x::bind (&Local<dim>::bdry, local, std_cxx1x::_1, std_cxx1x::_2),
-     std_cxx1x::bind (&Local<dim>::face, local, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3, std_cxx1x::_4),
-     assembler, true);
+  (mgdofs.begin(), mgdofs.end(),
+   mg_dof_info, info_box,
+   std_cxx1x::bind (&Local<dim>::cell, local, std_cxx1x::_1, std_cxx1x::_2),
+   std_cxx1x::bind (&Local<dim>::bdry, local, std_cxx1x::_1, std_cxx1x::_2),
+   std_cxx1x::bind (&Local<dim>::face, local, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3, std_cxx1x::_4),
+   assembler, true);
 
   deallog << "MGResults cells";
-  for (unsigned int i=0;i<n_functionals;++i)
+  for (unsigned int i=0; i<n_functionals; ++i)
     deallog << '\t' << cells.block(i).l1_norm();
   deallog << std::endl;
 
   deallog << "MGResults faces";
-  for (unsigned int i=0;i<n_functionals;++i)
+  for (unsigned int i=0; i<n_functionals; ++i)
     deallog << '\t' << faces.block(i).l1_norm();
   deallog << std::endl;
 }
@@ -157,7 +157,7 @@ test_mesh(MGDoFHandler<dim>& mgdofs)
 
 template<int dim>
 void
-test(const FiniteElement<dim>fe)
+test(const FiniteElement<dim> &fe)
 {
   Triangulation<dim> tr;
   MGDoFHandler<dim> dofs(tr);
@@ -188,10 +188,10 @@ int main ()
   std::ofstream logfile(logname.c_str());
   deallog.attach(logfile);
   deallog.depth_console (0);
-  
+
   FE_DGP<2> el2(0);
   FE_DGP<3> el3(0);
-  
+
   deallog.push("2D");
   test(el2);
   deallog.pop();
index 4b1176893f2d45a1f31f1a5cd3362f1faa0aae36..790a90e767124f692ce57c7a07cea0e0489c2164 100644 (file)
@@ -58,17 +58,17 @@ const bool debugging = false;
 
 template <int dim>
 void cell_matrix(
-  MeshWorker::DoFInfo<dim>dinfo,
-  typename MeshWorker::IntegrationInfo<dim,dim>info)
+  MeshWorker::DoFInfo<dim> &dinfo,
+  typename MeshWorker::IntegrationInfo<dim,dim> &info)
 {
   unsigned int dm=0; // Matrix index
   unsigned int de=0; // Element index
-  
+
   L2::mass_matrix(dinfo.matrix(dm++,false).matrix, info.fe_values(de));
   Laplace::cell_matrix(dinfo.matrix(dm++,false).matrix, info.fe_values(de));
   Divergence::gradient_matrix(dinfo.matrix(dm++,false).matrix, info.fe_values(de), info.fe_values(de+1));
 
-  
+
   ++de;
   L2::mass_matrix(dinfo.matrix(dm++,false).matrix, info.fe_values(de));
   Maxwell::curl_curl_matrix(dinfo.matrix(dm++,false).matrix, info.fe_values(de));
@@ -81,7 +81,7 @@ void cell_matrix(
       Divergence::grad_div_matrix(dinfo.matrix(dm++,false).matrix, info.fe_values(de));
       Divergence::cell_matrix(dinfo.matrix(dm++,false).matrix, info.fe_values(de), info.fe_values(de+1));
     }
-  
+
   ++de;
   L2::mass_matrix(dinfo.matrix(dm++,false).matrix, info.fe_values(de));
 }
@@ -90,44 +90,44 @@ void cell_matrix(
 
 template <int dim>
 void
-test_cochain(const Triangulation<dim>& tr, const FiniteElement<dim>& fe)
+test_cochain(const Triangulation<dim> &tr, const FiniteElement<dim> &fe)
 {
   MappingQ1<dim> mapping;
-                                  // Initialize DofHandler for a
-                                  // block system with local blocks
+  // Initialize DofHandler for a
+  // block system with local blocks
   DoFHandler<dim> dof(tr);
   dof.distribute_dofs(fe);
   DoFRenumbering::component_wise(dof);
   dof.initialize_local_block_info();
 
-                                  // Initialize hanging node constraints
+  // Initialize hanging node constraints
   ConstraintMatrix constraints;
 //  DoFTools::make_zero_boundary_constraints(dof, constraints);
   DoFTools::make_hanging_node_constraints (dof, constraints);
   constraints.close();
-                                  // Setup sparsity pattern for the
-                                  // whole system
+  // Setup sparsity pattern for the
+  // whole system
   BlockSparsityPattern sparsity;
   sparsity.reinit(dof.block_info().global().size(),
-                 dof.block_info().global().size());
+                  dof.block_info().global().size());
   BlockCompressedSparsityPattern c_sparsity(dof.block_info().global(),
-                                           dof.block_info().global());
+                                            dof.block_info().global());
   DoFTools::make_flux_sparsity_pattern(dof, c_sparsity, constraints, false);
   sparsity.copy_from(c_sparsity);
 
-                                  // Setup matrices
+  // Setup matrices
   MatrixBlockVector<SparseMatrix<double> > matrices;
 
   unsigned int d=0;
   matrices.add(d,d,"mass-H1");
   matrices.add(d,d,"Laplacian");
   matrices.add(d+1,d,"grad");
-  
+
   ++d;
   matrices.add(d,d,"mass-Hcurl");
   matrices.add(d,d,"curl-curl");
   matrices.add(d+1,d,"curl");
-  
+
   if (dim>2)
     {
       ++d;
@@ -142,81 +142,81 @@ test_cochain(const Triangulation<dim>& tr, const FiniteElement<dim>& fe)
   matrices.reinit(sparsity);
 
   if (debugging)
-    for (unsigned int i=0;i<matrices.size();++i)
+    for (unsigned int i=0; i<matrices.size(); ++i)
       deallog << "Block " << '(' << matrices.block(i).row
-             << ',' << matrices.block(i).column << ") "
-             << std::setw(3) << std::right << matrices.matrix(i).m() << std::left
-             << 'x' << std::setw(3) << matrices.matrix(i).n()
-             << ' ' << matrices.name(i) << std::endl;
-  
-                                  // Build matrices
-  
+              << ',' << matrices.block(i).column << ") "
+              << std::setw(3) << std::right << matrices.matrix(i).m() << std::left
+              << 'x' << std::setw(3) << matrices.matrix(i).n()
+              << ' ' << matrices.name(i) << std::endl;
+
+  // Build matrices
+
   MeshWorker::IntegrationInfoBox<dim> info_box;
   UpdateFlags update_flags = update_values | update_gradients;
   info_box.add_update_flags_cell(update_flags);
   info_box.initialize(fe, mapping, &dof.block_info());
   if (debugging)
     deallog << "Infobox ready" << std::endl;
-  
+
   MeshWorker::DoFInfo<dim> dof_info(dof.block_info());
-  
+
   MeshWorker::Assembler::MatrixLocalBlocksToGlobalBlocks<SparseMatrix<double> > assembler;
   assembler.initialize(&dof.block_info(), matrices);
   assembler.initialize(constraints);
-  
+
   MeshWorker::loop<dim, dim, MeshWorker::DoFInfo<dim>, MeshWorker::IntegrationInfoBox<dim> >(
     dof.begin_active(), dof.end(), dof_info, info_box,
     cell_matrix<dim>, 0, 0, assembler);
-  
-  for (unsigned int b=0;b<matrices.size();++b)
+
+  for (unsigned int b=0; b<matrices.size(); ++b)
     if (b%3 == 0)
-      for (unsigned int i=0;i<matrices.block(b).matrix.m();++i)
-       if (matrices.block(b).matrix.diag_element(i) == 0.)
-         matrices.block(b).matrix.diag_element(i) = 1.;
+      for (unsigned int i=0; i<matrices.block(b).matrix.m(); ++i)
+        if (matrices.block(b).matrix.diag_element(i) == 0.)
+          matrices.block(b).matrix.diag_element(i) = 1.;
   if (debugging)
     deallog << "Matrices ready" << std::endl;
-                                  // Set up vectors
+  // Set up vectors
   BlockVector<double> source(dof.block_info().global());
   BlockVector<double> result1(dof.block_info().global());
   BlockVector<double> result2(dof.block_info().global());
   BlockVector<double> aux(dof.block_info().global());
-  for (unsigned int i=0;i<source.size();++i)
+  for (unsigned int i=0; i<source.size(); ++i)
     source(i) = i%5;
 
-                                  // now check, whether d*d =
-                                  // D^TM^{-1}D
+  // now check, whether d*d =
+  // D^TM^{-1}D
   SolverControl control(100, 1.e-13, false, false);
   SolverCG<Vector<double> > solver(control);
-  
-  for (unsigned int d=0;d<dim;++d)
+
+  for (unsigned int d=0; d<dim; ++d)
     {
       deallog << "Form " << d << std::endl;
       const unsigned int m=3*d;
 
       if (d>0)
-       {
-         matrices.matrix(m+2).vmult(result2.block(d+1), aux.block(d));
-         deallog << "d^2            " << result2.block(d+1).l2_norm() << std::endl;  
-         matrices.matrix(m+1).vmult(result2.block(d), aux.block(d));
-         deallog << "d*d^2          " << result2.block(d).l2_norm() << std::endl;  
-       }
-      
-      matrices.matrix(m+2).vmult(result1.block(d+1), source.block(d));      
+        {
+          matrices.matrix(m+2).vmult(result2.block(d+1), aux.block(d));
+          deallog << "d^2            " << result2.block(d+1).l2_norm() << std::endl;
+          matrices.matrix(m+1).vmult(result2.block(d), aux.block(d));
+          deallog << "d*d^2          " << result2.block(d).l2_norm() << std::endl;
+        }
+
+      matrices.matrix(m+2).vmult(result1.block(d+1), source.block(d));
 
       PreconditionSSOR<SparseMatrix<double> > precondition;
       precondition.initialize(matrices.matrix(m+3), 1.2);
-      
+
       solver.solve(matrices.matrix(m+3), aux.block(d+1), result1.block(d+1), precondition);
-      
+
       matrices.matrix(m+2).Tvmult(result1.block(d), aux.block(d+1));
       matrices.matrix(m+1).vmult(result2.block(d), source.block(d));
 
       if (debugging)
-       deallog << "u " << source.block(d).l2_norm() << ' '
-               << matrices.name(m+2) << ' ' << result1.block(d+1).l2_norm()
-               << ' ' << matrices.name(m+3) << ' ' << aux.block(d+1).l2_norm()
-               << ' ' << matrices.name(m+2) << "^T " << result1.block(d).l2_norm()
-               << ' ' << matrices.name(m+1) << ' ' << result2.block(d).l2_norm() << std::endl;
+        deallog << "u " << source.block(d).l2_norm() << ' '
+                << matrices.name(m+2) << ' ' << result1.block(d+1).l2_norm()
+                << ' ' << matrices.name(m+3) << ' ' << aux.block(d+1).l2_norm()
+                << ' ' << matrices.name(m+2) << "^T " << result1.block(d).l2_norm()
+                << ' ' << matrices.name(m+1) << ' ' << result2.block(d).l2_norm() << std::endl;
       result2.block(d) -= result1.block(d);
       deallog << "Difference d*d " << result2.block(d).l2_norm() << std::endl;
     }
@@ -228,7 +228,7 @@ void run2d (unsigned int degree)
   prefix << "d2-p" << degree;
   deallog.push(prefix.str());
   deallog << "Setup" << std::endl;
-  
+
   FE_Q<2> h1(degree+1);
   FE_Nedelec<2> hdiv(degree);
   FE_DGQ<2> l2(degree);
@@ -241,21 +241,21 @@ void run2d (unsigned int degree)
       TestGrids::hypercube(tr, 1);
       test_cochain(tr, fe);
     }
-  
+
   if (true)
     {
       Triangulation<2> tr;
       TestGrids::hypercube(tr, 2, true);
       test_cochain(tr, fe);
     }
-  
+
   if (true)
     {
       Triangulation<2> tr;
       TestGrids::hypercube(tr, 3, true);
       test_cochain(tr, fe);
     }
-  
+
   deallog.pop();
 }
 
@@ -266,7 +266,7 @@ void run3d (unsigned int degree)
   prefix << "d3-p" << degree;
   deallog.push(prefix.str());
   deallog << "Setup" << std::endl;
-  
+
   FE_Q<3> h1(degree+1);
   if (debugging) deallog << "H1" << std::endl;
   FE_Nedelec<3> hcurl(degree);
@@ -278,20 +278,20 @@ void run3d (unsigned int degree)
 
   FESystem<3> fe(h1,1,hcurl,1,hdiv,1,l2,1);
 
-    if (true)
+  if (true)
     {
       Triangulation<3> tr;
       TestGrids::hypercube(tr, 1);
       test_cochain(tr, fe);
     }
-    
+
   if (true)
     {
       Triangulation<3> tr(Triangulation<3>::limit_level_difference_at_vertices);
       TestGrids::hypercube(tr, 2, true);
       test_cochain(tr, fe);
     }
-deallog.pop();
+  deallog.pop();
 }
 
 
@@ -306,11 +306,11 @@ int main()
       deallog.depth_console(0);
       deallog.threshold_double(1.e-10);
     }
-  
+
   run2d(0);
   run2d(1);
   run2d(2);
-  
+
   run3d(0);
   run3d(1);
 }
index 8ab1eaf268ecc520dbdafa5fed0562446b2f10f9..8907be10e838982255376734a28431b1f099c223 100644 (file)
 using namespace LocalIntegrators::Divergence;
 
 template <int dim>
-void test_cell(const FEValuesBase<dim>& fev, const FEValuesBase<dim>& fes)
+void test_cell(const FEValuesBase<dim> &fev, const FEValuesBase<dim> &fes)
 {
   AssertDimension(fev.get_fe().n_components(), dim);
   AssertDimension(fes.get_fe().n_components(), 1);
-  
+
   const unsigned int nv = fev.dofs_per_cell;
   const unsigned int ns = fes.dofs_per_cell;
-  
+
   FullMatrix<double> Md(ns,nv);
   cell_matrix(Md,fev,fes);
   Md.print(deallog,8);
@@ -49,17 +49,17 @@ void test_cell(const FEValuesBase<dim>& fev, const FEValuesBase<dim>& fes)
   gradient_matrix(Mg,fes,fev);
   Mg.print(deallog,8);
 
-  
+
   Vector<double> u(nv), v(ns), w(ns);
   std::vector<std::vector<Tensor<1,dim> > >
-    ugrad(dim,std::vector<Tensor<1,dim> >(fev.n_quadrature_points));
-  
+  ugrad(dim,std::vector<Tensor<1,dim> >(fev.n_quadrature_points));
+
   std::vector<types::global_dof_index> indices(nv);
-  for (unsigned int i=0;i<nv;++i)
+  for (unsigned int i=0; i<nv; ++i)
     indices[i] = i;
-  
+
   deallog << "Divergence-Residuals";
-  for (unsigned int i=0;i<nv;++i)
+  for (unsigned int i=0; i<nv; ++i)
     {
       u = 0.;
       u(i) = 1.;
@@ -74,11 +74,11 @@ void test_cell(const FEValuesBase<dim>& fev, const FEValuesBase<dim>& fes)
 
   v.reinit(nv);
   indices.resize(ns);
-  for (unsigned int i=0;i<ns;++i)
+  for (unsigned int i=0; i<ns; ++i)
     indices[i] = i;
-  
+
   deallog << "Gradient-Residuals";
-  for (unsigned int i=0;i<ns;++i)
+  for (unsigned int i=0; i<ns; ++i)
     {
       w = 0.;
       w(i) = 1.;
@@ -94,28 +94,28 @@ void test_cell(const FEValuesBase<dim>& fev, const FEValuesBase<dim>& fes)
 
 
 template <int dim>
-void test_boundary(const FEValuesBase<dim>& fev, const FEValuesBase<dim>& fes)
+void test_boundary(const FEValuesBase<dim> &fev, const FEValuesBase<dim> &fes)
 {
   AssertDimension(fev.get_fe().n_components(), dim);
   AssertDimension(fes.get_fe().n_components(), 1);
-  
+
   const unsigned int nv = fev.dofs_per_cell;
   const unsigned int ns = fes.dofs_per_cell;
-  
+
   FullMatrix<double> M(ns,nv);
   u_dot_n_matrix(M, fev, fes);
   M.print(deallog,8);
-  
+
   Vector<double> u(nv), v(ns), w(ns);
   std::vector<std::vector<double> >
-    uval    (dim,std::vector<double>(fev.n_quadrature_points));
-  
+  uval    (dim,std::vector<double>(fev.n_quadrature_points));
+
   std::vector<types::global_dof_index> indices(nv);
-  for (unsigned int i=0;i<nv;++i)
+  for (unsigned int i=0; i<nv; ++i)
     indices[i] = i;
-  
+
   deallog << "Residuals u dot n";
-  for (unsigned int i=0;i<nv;++i)
+  for (unsigned int i=0; i<nv; ++i)
     {
       u = 0.;
       u(i) = 1.;
@@ -131,26 +131,26 @@ void test_boundary(const FEValuesBase<dim>& fev, const FEValuesBase<dim>& fes)
 
 
 template <int dim>
-void test_face(const FEValuesBase<dim>fev1,
-              const FEValuesBase<dim>& fev2,
-              const FEValuesBase<dim>& fes1,
-              const FEValuesBase<dim>& fes2)
+void test_face(const FEValuesBase<dim> &fev1,
+               const FEValuesBase<dim> &fev2,
+               const FEValuesBase<dim> &fes1,
+               const FEValuesBase<dim> &fes2)
 {
   AssertDimension(fev1.get_fe().n_components(), dim);
   AssertDimension(fes1.get_fe().n_components(), 1);
   AssertDimension(fev2.get_fe().n_components(), dim);
   AssertDimension(fes2.get_fe().n_components(), 1);
-  
+
   const unsigned int nv1 = fev1.dofs_per_cell;
   const unsigned int nv2 = fev1.dofs_per_cell;
   const unsigned int ns1 = fes1.dofs_per_cell;
   const unsigned int ns2 = fes1.dofs_per_cell;
-  
+
   FullMatrix<double> M11(ns1,nv1);
   FullMatrix<double> M12(ns1,nv2);
   FullMatrix<double> M21(ns2,nv1);
   FullMatrix<double> M22(ns2,nv2);
-  
+
   u_dot_n_matrix(M11, M12, M21, M22, fev1, fev2, fes1, fes2);
   deallog << "M11" << std::endl;
   M11.print(deallog,8);
@@ -160,7 +160,7 @@ void test_face(const FEValuesBase<dim>& fev1,
   M12.print(deallog,8);
   deallog << "M21" << std::endl;
   M21.print(deallog,8);
-  
+
   // Vector<double> u1(n1), v1(n1), w1(n1);
   // Vector<double> u2(n2), v2(n2), w2(n2);
   // std::vector<std::vector<double> >
@@ -169,44 +169,44 @@ void test_face(const FEValuesBase<dim>& fev1,
   // std::vector<std::vector<Tensor<1,dim> > >
   //   u1grad(d,std::vector<Tensor<1,dim> >(fev1.n_quadrature_points)),
   //   u2grad(d,std::vector<Tensor<1,dim> >(fev2.n_quadrature_points));
-  
+
   // std::vector<unsigned int> indices1(n1), indices2(n2);
   // for (unsigned int i=0;i<n1;++i) indices1[i] = i;
   // for (unsigned int i=0;i<n2;++i) indices2[i] = i;
-  
+
   // deallog << "Residuals";  for (unsigned int i=0;i<n1;++i) indices1[i] = i;
 
   // for (unsigned int i1=0;i1<n1;++i1)
   //   for (unsigned int i2=0;i2<n2;++i2)
   //     {
-  //   u1 = 0.;
-  //   u1(i1) = 1.;
-  //   w1 = 0.;
-  //   fev1.get_function_values(u1, indices1, u1val, true);
-  //   fev1.get_function_gradients(u1, indices1, u1grad, true);
-  //   u2 = 0.;
-  //   u2(i2) = 1.;
-  //   w2 = 0.;
-  //   fev2.get_function_values(u2, indices2, u2val, true);
-  //   fev2.get_function_gradients(u2, indices2, u2grad, true);
-  //   ip_residual(w1, w2, fev1, fev2,
-  //               make_slice(u1val), make_slice(u1grad),
-  //               make_slice(u2val), make_slice(u2grad),
-  //               17);
-  //   M11.vmult(v1,u1); w1.add(-1., v1);
-  //   M12.vmult(v1,u2); w1.add(-1., v1);
-  //   M21.vmult(v2,u1); w2.add(-1., v2);
-  //   M22.vmult(v2,u2); w2.add(-1., v2);
-  //   deallog << ' ' << w1.l2_norm() + w2.l2_norm();
-  //   if (d==1)
-  //     {
-  //       ip_residual(w1, w2, fev1, fev2, u1val[0], u1grad[0], u2val[0], u2grad[0], 17);
-  //       M11.vmult(v1,u1); w1.add(-1., v1);
-  //       M12.vmult(v1,u2); w1.add(-1., v1);
-  //       M21.vmult(v2,u1); w2.add(-1., v2);
-  //       M22.vmult(v2,u2); w2.add(-1., v2);
-  //       deallog << " e" << w1.l2_norm() + w2.l2_norm();       
-  //     }
+  //  u1 = 0.;
+  //  u1(i1) = 1.;
+  //  w1 = 0.;
+  //  fev1.get_function_values(u1, indices1, u1val, true);
+  //  fev1.get_function_gradients(u1, indices1, u1grad, true);
+  //  u2 = 0.;
+  //  u2(i2) = 1.;
+  //  w2 = 0.;
+  //  fev2.get_function_values(u2, indices2, u2val, true);
+  //  fev2.get_function_gradients(u2, indices2, u2grad, true);
+  //  ip_residual(w1, w2, fev1, fev2,
+  //        make_slice(u1val), make_slice(u1grad),
+  //        make_slice(u2val), make_slice(u2grad),
+  //        17);
+  //  M11.vmult(v1,u1); w1.add(-1., v1);
+  //  M12.vmult(v1,u2); w1.add(-1., v1);
+  //  M21.vmult(v2,u1); w2.add(-1., v2);
+  //  M22.vmult(v2,u2); w2.add(-1., v2);
+  //  deallog << ' ' << w1.l2_norm() + w2.l2_norm();
+  //  if (d==1)
+  //    {
+  //      ip_residual(w1, w2, fev1, fev2, u1val[0], u1grad[0], u2val[0], u2grad[0], 17);
+  //      M11.vmult(v1,u1); w1.add(-1., v1);
+  //      M12.vmult(v1,u2); w1.add(-1., v1);
+  //      M21.vmult(v2,u1); w2.add(-1., v2);
+  //      M22.vmult(v2,u2); w2.add(-1., v2);
+  //      deallog << " e" << w1.l2_norm() + w2.l2_norm();
+  //    }
   //     }
   // deallog << std::endl;
 }
@@ -214,7 +214,7 @@ void test_face(const FEValuesBase<dim>& fev1,
 
 template <int dim>
 void
-test_fe(Triangulation<dim>& tr, FiniteElement<dim>& fv, FiniteElement<dim>& fs)
+test_fe(Triangulation<dim> &tr, FiniteElement<dim> &fv, FiniteElement<dim> &fs)
 {
   deallog << fv.get_name() << " x " << fs.get_name() << std::endl << "cell matrix" << std::endl;
   QGauss<dim> quadrature(fv.tensor_degree()+1);
@@ -225,45 +225,45 @@ test_fe(Triangulation<dim>& tr, FiniteElement<dim>& fv, FiniteElement<dim>& fs)
   fev.reinit(cell1);
   fes.reinit(cell1);
   test_cell(fev, fes);
-  
+
   QGauss<dim-1> face_quadrature(fv.tensor_degree()+1);
   FEFaceValues<dim> fev1(fv, face_quadrature, update_values | update_gradients | update_normal_vectors);
   FEFaceValues<dim> fes1(fs, face_quadrature, update_values | update_gradients | update_normal_vectors);
-  for (unsigned int i=0;i<GeometryInfo<dim>::faces_per_cell;++i)
+  for (unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
     {
       deallog << "boundary_matrix " << i << std::endl;
       fev1.reinit(cell1, i);
       fes1.reinit(cell1, i);
       test_boundary(fev1, fes1);
     }
-  
+
   FEFaceValues<dim> fev2(fv, face_quadrature, update_values | update_gradients);
   FEFaceValues<dim> fes2(fs, face_quadrature, update_values | update_gradients);
   typename Triangulation<dim>::cell_iterator cell2 = cell1->neighbor(1);
-  
+
   deallog << "face_matrix " << 0 << std::endl;
   cell1 = tr.begin(1);
   fev1.reinit(cell1, 1);
   fev2.reinit(cell2, 0);
   fes1.reinit(cell1, 1);
   fes2.reinit(cell2, 0);
-  test_face(fev1, fev2, fes1, fes2);  
+  test_face(fev1, fev2, fes1, fes2);
 }
 
 
 template <int dim>
 void
-test(Triangulation<dim>tr)
+test(Triangulation<dim> &tr)
 {
   FE_DGQ<dim> q1(1);
   FE_Nedelec<dim> n1(1);
   FE_RaviartThomas<dim> r1(1);
   FESystem<dim> s1(q1,dim);
-  
+
   test_fe(tr, r1, q1);
   test_fe(tr, n1, q1);
   test_fe(tr, s1, q1);
-  
+
 }
 
 
@@ -274,13 +274,13 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   Triangulation<2> tr2;
   TestGrids::hypercube(tr2, 1);
   test(tr2);
-  
+
 //  Triangulation<3> tr3;
 //  TestGrids::hypercube(tr3, 1);
 //  test(tr3);
-  
+
 }
index ebbde829b1544e1b1d1346c4511c681cfe68bf28..e62f83aa537b2b4ae0f04b0b69a48da63de566bd 100644 (file)
@@ -34,7 +34,7 @@
 using namespace LocalIntegrators::Laplace;
 
 template <int dim>
-void test_cell(const FEValuesBase<dim>fev)
+void test_cell(const FEValuesBase<dim> &fev)
 {
   const unsigned int n = fev.dofs_per_cell;
   FullMatrix<double> M(n,n);
@@ -43,27 +43,27 @@ void test_cell(const FEValuesBase<dim>& fev)
     LogStream::Prefix pre("cell");
     M.print(deallog,8);
   }
-  
+
   Vector<double> u(n), v(n), w(n);
   std::vector<std::vector<Tensor<1,dim> > >
-    ugrad(dim,std::vector<Tensor<1,dim> >(fev.n_quadrature_points));
-  
+  ugrad(dim,std::vector<Tensor<1,dim> >(fev.n_quadrature_points));
+
   std::vector<types::global_dof_index> indices(n);
-  for (unsigned int i=0;i<n;++i)
+  for (unsigned int i=0; i<n; ++i)
     indices[i] = i;
 
   {
     LogStream::Prefix pre("Residuals");
-    for (unsigned int i=0;i<n;++i)
+    for (unsigned int i=0; i<n; ++i)
       {
-       u = 0.;
-       u(i) = 1.;
-       w = 0.;
-       fev.get_function_gradients(u, indices, ugrad, true);
-       cell_residual(w, fev, make_slice(ugrad));
-       M.vmult(v,u);
-       w.add(-1., v);
-       deallog << ' ' << w.l2_norm();
+        u = 0.;
+        u(i) = 1.;
+        w = 0.;
+        fev.get_function_gradients(u, indices, ugrad, true);
+        cell_residual(w, fev, make_slice(ugrad));
+        M.vmult(v,u);
+        w.add(-1., v);
+        deallog << ' ' << w.l2_norm();
       }
     deallog << std::endl;
   }
@@ -71,7 +71,7 @@ void test_cell(const FEValuesBase<dim>& fev)
 
 
 template <int dim>
-void test_boundary(const FEValuesBase<dim>fev)
+void test_boundary(const FEValuesBase<dim> &fev)
 {
   const unsigned int n = fev.dofs_per_cell;
   unsigned int d=fev.get_fe().n_components();
@@ -81,38 +81,38 @@ void test_boundary(const FEValuesBase<dim>& fev)
     LogStream::Prefix pre("bdry");
     M.print(deallog,8);
   }
-  
+
   Vector<double> u(n), v(n), w(n);
   std::vector<std::vector<double> >
-    uval    (d,std::vector<double>(fev.n_quadrature_points)),
-    null_val(d,std::vector<double>(fev.n_quadrature_points, 0.));
+  uval    (d,std::vector<double>(fev.n_quadrature_points)),
+          null_val(d,std::vector<double>(fev.n_quadrature_points, 0.));
   std::vector<std::vector<Tensor<1,dim> > >
-    ugrad   (d,std::vector<Tensor<1,dim> >(fev.n_quadrature_points));
-  
+  ugrad   (d,std::vector<Tensor<1,dim> >(fev.n_quadrature_points));
+
   std::vector<types::global_dof_index> indices(n);
-  for (unsigned int i=0;i<n;++i)
+  for (unsigned int i=0; i<n; ++i)
     indices[i] = i;
-  
+
   {
     LogStream::Prefix pre("Residuals");
-    for (unsigned int i=0;i<n;++i)
+    for (unsigned int i=0; i<n; ++i)
       {
-       u = 0.;
-       u(i) = 1.;
-       w = 0.;
-       fev.get_function_values(u, indices, uval, true);
-       fev.get_function_gradients(u, indices, ugrad, true);
-       nitsche_residual(w, fev, make_slice(uval), make_slice(ugrad), make_slice(null_val), 17);
-       M.vmult(v,u);
-       w.add(-1., v);
-       deallog << ' ' << w.l2_norm();
-       if (d==1)
-         {
-           nitsche_residual(w, fev, uval[0], ugrad[0], null_val[0], 17);
-           M.vmult(v,u);
-           w.add(-1., v);
-           deallog << " e" << w.l2_norm();       
-         }
+        u = 0.;
+        u(i) = 1.;
+        w = 0.;
+        fev.get_function_values(u, indices, uval, true);
+        fev.get_function_gradients(u, indices, ugrad, true);
+        nitsche_residual(w, fev, make_slice(uval), make_slice(ugrad), make_slice(null_val), 17);
+        M.vmult(v,u);
+        w.add(-1., v);
+        deallog << ' ' << w.l2_norm();
+        if (d==1)
+          {
+            nitsche_residual(w, fev, uval[0], ugrad[0], null_val[0], 17);
+            M.vmult(v,u);
+            w.add(-1., v);
+            deallog << " e" << w.l2_norm();
+          }
       }
     deallog << std::endl;
   }
@@ -120,8 +120,8 @@ void test_boundary(const FEValuesBase<dim>& fev)
 
 
 template <int dim>
-void test_face(const FEValuesBase<dim>fev1,
-              const FEValuesBase<dim>& fev2)
+void test_face(const FEValuesBase<dim> &fev1,
+               const FEValuesBase<dim> &fev2)
 {
   const unsigned int n1 = fev1.dofs_per_cell;
   const unsigned int n2 = fev1.dofs_per_cell;
@@ -130,56 +130,72 @@ void test_face(const FEValuesBase<dim>& fev1,
   FullMatrix<double> M12(n1,n2);
   FullMatrix<double> M21(n2,n1);
   FullMatrix<double> M22(n2,n2);
-  
+
   ip_matrix(M11, M12, M21, M22, fev1, fev2, 17);
 
-  { LogStream::Prefix pre("M11"); M11.print(deallog,8); }
-  { LogStream::Prefix pre("M12"); M12.print(deallog,8); }
-  { LogStream::Prefix pre("M21"); M21.print(deallog,8); }
-  { LogStream::Prefix pre("M22"); M22.print(deallog,8); }
-  
+  {
+    LogStream::Prefix pre("M11");
+    M11.print(deallog,8);
+  }
+  {
+    LogStream::Prefix pre("M12");
+    M12.print(deallog,8);
+  }
+  {
+    LogStream::Prefix pre("M21");
+    M21.print(deallog,8);
+  }
+  {
+    LogStream::Prefix pre("M22");
+    M22.print(deallog,8);
+  }
+
   Vector<double> u1(n1), v1(n1), w1(n1);
   Vector<double> u2(n2), v2(n2), w2(n2);
   std::vector<std::vector<double> >
-    u1val (d,std::vector<double>(fev1.n_quadrature_points)),
-    nullval (d,std::vector<double>(fev2.n_quadrature_points, 0.));
+  u1val (d,std::vector<double>(fev1.n_quadrature_points)),
+        nullval (d,std::vector<double>(fev2.n_quadrature_points, 0.));
   std::vector<std::vector<Tensor<1,dim> > >
-    u1grad(d,std::vector<Tensor<1,dim> >(fev1.n_quadrature_points)),
-    nullgrad(d,std::vector<Tensor<1,dim> >(fev2.n_quadrature_points, Tensor<1,dim>()));
-  
+  u1grad(d,std::vector<Tensor<1,dim> >(fev1.n_quadrature_points)),
+         nullgrad(d,std::vector<Tensor<1,dim> >(fev2.n_quadrature_points, Tensor<1,dim>()));
+
   std::vector<types::global_dof_index> indices1(n1), indices2(n2);
-  for (unsigned int i=0;i<n1;++i) indices1[i] = i;
-  for (unsigned int i=0;i<n2;++i) indices2[i] = i;
-  
+  for (unsigned int i=0; i<n1; ++i) indices1[i] = i;
+  for (unsigned int i=0; i<n2; ++i) indices2[i] = i;
+
   {
     LogStream::Prefix pre("Residuals");
-    for (unsigned int i1=0;i1<n1;++i1)
+    for (unsigned int i1=0; i1<n1; ++i1)
       {
-       u1 = 0.;
-       u1(i1) = 1.;
-       w1 = 0.;
-       w2 = 0.;
-       fev1.get_function_values(u1, indices1, u1val, true);
-       fev1.get_function_gradients(u1, indices1, u1grad, true);
-       ip_residual(w1, w2, fev1, fev2,
-                   make_slice(u1val), make_slice(u1grad),
-                   make_slice(nullval), make_slice(nullgrad),
-                   17);
-       M11.vmult(v1,u1); w1.add(-1., v1);
-       M21.vmult(v2,u1); w2.add(-1., v2);
-       deallog << ' ' << w1.l2_norm() + w2.l2_norm();
-       
-       w1 = 0.;
-       w2 = 0.;
-       fev2.get_function_values(u1, indices2, u1val, true);
-       fev2.get_function_gradients(u1, indices2, u1grad, true);
-       ip_residual(w1, w2, fev1, fev2,
-                   make_slice(nullval), make_slice(nullgrad),
-                   make_slice(u1val), make_slice(u1grad),
-                   17);
-       M12.vmult(v1,u1); w1.add(-1., v1);
-       M22.vmult(v2,u1); w2.add(-1., v2);
-       deallog << ' ' << w1.l2_norm() + w2.l2_norm();
+        u1 = 0.;
+        u1(i1) = 1.;
+        w1 = 0.;
+        w2 = 0.;
+        fev1.get_function_values(u1, indices1, u1val, true);
+        fev1.get_function_gradients(u1, indices1, u1grad, true);
+        ip_residual(w1, w2, fev1, fev2,
+                    make_slice(u1val), make_slice(u1grad),
+                    make_slice(nullval), make_slice(nullgrad),
+                    17);
+        M11.vmult(v1,u1);
+        w1.add(-1., v1);
+        M21.vmult(v2,u1);
+        w2.add(-1., v2);
+        deallog << ' ' << w1.l2_norm() + w2.l2_norm();
+
+        w1 = 0.;
+        w2 = 0.;
+        fev2.get_function_values(u1, indices2, u1val, true);
+        fev2.get_function_gradients(u1, indices2, u1grad, true);
+        ip_residual(w1, w2, fev1, fev2,
+                    make_slice(nullval), make_slice(nullgrad),
+                    make_slice(u1val), make_slice(u1grad),
+                    17);
+        M12.vmult(v1,u1);
+        w1.add(-1., v1);
+        M22.vmult(v2,u1);
+        w2.add(-1., v2);
+        deallog << ' ' << w1.l2_norm() + w2.l2_norm();
       }
     deallog << std::endl;
   }
@@ -188,7 +204,7 @@ void test_face(const FEValuesBase<dim>& fev1,
 
 template <int dim>
 void
-test_fe(Triangulation<dim>& tr, FiniteElement<dim>& fe)
+test_fe(Triangulation<dim> &tr, FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl << "cell matrix" << std::endl;
   QGauss<dim> quadrature(fe.tensor_degree()+1);
@@ -196,10 +212,10 @@ test_fe(Triangulation<dim>& tr, FiniteElement<dim>& fe)
   typename Triangulation<dim>::cell_iterator cell1 = tr.begin(1);
   fev.reinit(cell1);
   test_cell(fev);
-  
+
   QGauss<dim-1> face_quadrature(fe.tensor_degree()+1);
   FEFaceValues<dim> fef1(fe, face_quadrature, update_values | update_gradients | update_normal_vectors);
-  for (unsigned int i=0;i<GeometryInfo<dim>::faces_per_cell;++i)
+  for (unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
     {
       deallog << "boundary_matrix " << i << std::endl;
       fef1.reinit(cell1, i);
@@ -208,32 +224,32 @@ test_fe(Triangulation<dim>& tr, FiniteElement<dim>& fe)
 
   FEFaceValues<dim> fef2(fe, face_quadrature, update_values | update_gradients);
   typename Triangulation<dim>::cell_iterator cell2 = cell1->neighbor(1);
-  
+
   deallog << "face_matrix " << 0 << std::endl;
   cell1 = tr.begin(1);
   fef1.reinit(cell1, 1);
   fef2.reinit(cell2, 0);
-  test_face(fef1, fef2);  
+  test_face(fef1, fef2);
 }
 
 
 template <int dim>
 void
-test(Triangulation<dim>tr)
+test(Triangulation<dim> &tr)
 {
   FE_DGQ<dim> q1(1);
   FESystem<dim> fe1(q1,dim);
   test_fe(tr, fe1);
-  
+
   FE_DGQ<dim> q2(2);
   FESystem<dim> fe2(q2,dim);
   test_fe(tr, fe2);
-  
-  FE_Nedelec<dim> n1(1);  
-  test_fe(tr, n1);  
-  
-  FE_RaviartThomas<dim> rt1(1);  
-  test_fe(tr, rt1);  
+
+  FE_Nedelec<dim> n1(1);
+  test_fe(tr, n1);
+
+  FE_RaviartThomas<dim> rt1(1);
+  test_fe(tr, rt1);
 }
 
 
@@ -241,12 +257,12 @@ int main()
 {
   initlog(__FILE__);
   deallog.threshold_double(1.e-10);
-  
+
   Triangulation<2> tr2;
   TestGrids::hypercube(tr2, 1);
   test(tr2);
-  
- Triangulation<3> tr3;
- TestGrids::hypercube(tr3, 1);
- test(tr3);  
+
 Triangulation<3> tr3;
 TestGrids::hypercube(tr3, 1);
+  test(tr3);
 }
index 0e9e59c99a6e3e5005c89d6dcf69b170b2156727..14d368bf1cbbe347b222d1fdf626bad94866f12a 100644 (file)
 
 class EmptyInfo
 {
-  public:
-    template <class DOFINFO>
-    void reinit(const DOFINFO&)
-      {}
+public:
+  template <class DOFINFO>
+  void reinit(const DOFINFO &)
+  {}
 };
 
 
 class EmptyInfoBox
 {
-   public:
-    typedef EmptyInfo CellInfo;
-    template <int dim, class DOFINFO>
-    void post_cell(const MeshWorker::DoFInfoBox<dim, DOFINFO>&)
-      {}
-    
-    template <int dim, class DOFINFO>
-    void post_faces(const MeshWorker::DoFInfoBox<dim, DOFINFO>&)
-      {}
-    
-    EmptyInfo cell;
-    EmptyInfo boundary;
-    EmptyInfo face;
-    EmptyInfo subface;
-    EmptyInfo neighbor;
+public:
+  typedef EmptyInfo CellInfo;
+  template <int dim, class DOFINFO>
+  void post_cell(const MeshWorker::DoFInfoBox<dim, DOFINFO> &)
+  {}
+
+  template <int dim, class DOFINFO>
+  void post_faces(const MeshWorker::DoFInfoBox<dim, DOFINFO> &)
+  {}
+
+  EmptyInfo cell;
+  EmptyInfo boundary;
+  EmptyInfo face;
+  EmptyInfo subface;
+  EmptyInfo neighbor;
 };
 
 
index 2f161d826468e8d79d3134d2b79468d6fb45a64d..a731e303545a25dd78aa7685d377dcc7b52710f8 100644 (file)
@@ -47,19 +47,19 @@ const unsigned int n_functionals = 3;
 template <int dim>
 class Local : public Subscriptor
 {
-  public:
-    typedef EmptyInfo CellInfo;
-    
-    void cell(MeshWorker::DoFInfo<dim>& dinfo, CellInfo& info) const;
-    void bdry(MeshWorker::DoFInfo<dim>& dinfo, CellInfo& info) const;
-    void face(MeshWorker::DoFInfo<dim>& dinfo1, MeshWorker::DoFInfo<dim>& dinfo2,
-             CellInfo& info1, CellInfo& info2) const;
+public:
+  typedef EmptyInfo CellInfo;
+
+  void cell(MeshWorker::DoFInfo<dim> &dinfo, CellInfo &info) const;
+  void bdry(MeshWorker::DoFInfo<dim> &dinfo, CellInfo &info) const;
+  void face(MeshWorker::DoFInfo<dim> &dinfo1, MeshWorker::DoFInfo<dim> &dinfo2,
+            CellInfo &info1, CellInfo &info2) const;
 };
 
 
 template <int dim>
 void
-Local<dim>::cell(MeshWorker::DoFInfo<dim>& info, CellInfo&) const
+Local<dim>::cell(MeshWorker::DoFInfo<dim> &info, CellInfo &) const
 {
   info.value(0) = 1.;
 }
@@ -67,7 +67,7 @@ Local<dim>::cell(MeshWorker::DoFInfo<dim>& info, CellInfo&) const
 
 template <int dim>
 void
-Local<dim>::bdry(MeshWorker::DoFInfo<dim>&  info, CellInfo&) const
+Local<dim>::bdry(MeshWorker::DoFInfo<dim>  &info, CellInfo &) const
 {
   info.value(2) = 1.;
 }
@@ -75,8 +75,8 @@ Local<dim>::bdry(MeshWorker::DoFInfo<dim>&  info, CellInfo&) const
 
 template <int dim>
 void
-Local<dim>::face(MeshWorker::DoFInfo<dim>&  info1, MeshWorker::DoFInfo<dim>& info2,
-                CellInfo&, CellInfo&) const
+Local<dim>::face(MeshWorker::DoFInfo<dim>  &info1, MeshWorker::DoFInfo<dim> &info2,
+                 CellInfo &, CellInfo &) const
 {
   info1.value(1) = 1./2.;
   info2.value(1) = 1./2.;
@@ -85,42 +85,42 @@ Local<dim>::face(MeshWorker::DoFInfo<dim>&  info1, MeshWorker::DoFInfo<dim>& inf
 
 template <int dim>
 void
-test_mesh(MGDoFHandler<dim>mgdofs)
+test_mesh(MGDoFHandler<dim> &mgdofs)
 {
-  const DoFHandler<dim>dofs = mgdofs;
-  
+  const DoFHandler<dim> &dofs = mgdofs;
+
   Local<dim> local;
   EmptyInfoBox info_box;
   MeshWorker::DoFInfo<dim> dof_info(dofs);
-  
+
   MeshWorker::Assembler::Functional<double> assembler;
   assembler.initialize(n_functionals);
-  
+
   MeshWorker::loop<dim, dim, MeshWorker::DoFInfo<dim>, EmptyInfoBox>
-    (dofs.begin_active(), dofs.end(),
-     dof_info, info_box,
-     std_cxx1x::bind (&Local<dim>::cell, local, std_cxx1x::_1, std_cxx1x::_2),
-     std_cxx1x::bind (&Local<dim>::bdry, local, std_cxx1x::_1, std_cxx1x::_2),
-     std_cxx1x::bind (&Local<dim>::face, local, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3, std_cxx1x::_4),
-     assembler, true);
+  (dofs.begin_active(), dofs.end(),
+   dof_info, info_box,
+   std_cxx1x::bind (&Local<dim>::cell, local, std_cxx1x::_1, std_cxx1x::_2),
+   std_cxx1x::bind (&Local<dim>::bdry, local, std_cxx1x::_1, std_cxx1x::_2),
+   std_cxx1x::bind (&Local<dim>::face, local, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3, std_cxx1x::_4),
+   assembler, true);
 
   deallog << "  Results";
-  for (unsigned int i=0;i<n_functionals;++i)
+  for (unsigned int i=0; i<n_functionals; ++i)
     deallog << '\t' << assembler(i);
   deallog << std::endl;
 
   assembler.initialize(n_functionals);
   MeshWorker::DoFInfo<dim> mg_dof_info(mgdofs);
   MeshWorker::loop<dim, dim, MeshWorker::DoFInfo<dim>, EmptyInfoBox>
-    (mgdofs.begin(), mgdofs.end(),
-     mg_dof_info, info_box,
-     std_cxx1x::bind (&Local<dim>::cell, local, std_cxx1x::_1, std_cxx1x::_2),
-     std_cxx1x::bind (&Local<dim>::bdry, local, std_cxx1x::_1, std_cxx1x::_2),
-     std_cxx1x::bind (&Local<dim>::face, local, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3, std_cxx1x::_4),
-     assembler, true);
+  (mgdofs.begin(), mgdofs.end(),
+   mg_dof_info, info_box,
+   std_cxx1x::bind (&Local<dim>::cell, local, std_cxx1x::_1, std_cxx1x::_2),
+   std_cxx1x::bind (&Local<dim>::bdry, local, std_cxx1x::_1, std_cxx1x::_2),
+   std_cxx1x::bind (&Local<dim>::face, local, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3, std_cxx1x::_4),
+   assembler, true);
 
   deallog << "MGResults";
-  for (unsigned int i=0;i<n_functionals;++i)
+  for (unsigned int i=0; i<n_functionals; ++i)
     deallog << '\t' << assembler(i);
   deallog << std::endl;
 }
@@ -128,7 +128,7 @@ test_mesh(MGDoFHandler<dim>& mgdofs)
 
 template<int dim>
 void
-test(const FiniteElement<dim>fe)
+test(const FiniteElement<dim> &fe)
 {
   Triangulation<dim> tr;
   MGDoFHandler<dim> dofs(tr);
@@ -159,10 +159,10 @@ int main ()
   std::ofstream logfile(logname.c_str());
   deallog.attach(logfile);
   deallog.depth_console (0);
-  
+
   FE_DGP<2> el2(0);
   FE_DGP<3> el3(0);
-  
+
   deallog.push("2D");
   test(el2);
   deallog.pop();
index f973f86c732c5c2fa56283d767d8a8f72ba79531..f18d7f9e61207411f7ebbe3426b6c3fd71fb4073 100644 (file)
@@ -30,7 +30,7 @@
 using namespace LocalIntegrators::Laplace;
 
 template <int dim>
-void test_cell(const FEValuesBase<dim>fev)
+void test_cell(const FEValuesBase<dim> &fev)
 {
   const unsigned int n = fev.dofs_per_cell;
   unsigned int d=fev.get_fe().n_components();
@@ -40,34 +40,34 @@ void test_cell(const FEValuesBase<dim>& fev)
     LogStream::Prefix pre("cell");
     M.print(deallog,8);
   }
-  
+
   Vector<double> u(n), v(n), w(n);
   std::vector<std::vector<Tensor<1,dim> > >
-    ugrad(d,std::vector<Tensor<1,dim> >(fev.n_quadrature_points));
-  
+  ugrad(d,std::vector<Tensor<1,dim> >(fev.n_quadrature_points));
+
   std::vector<types::global_dof_index> indices(n);
-  for (unsigned int i=0;i<n;++i)
+  for (unsigned int i=0; i<n; ++i)
     indices[i] = i;
 
   {
     LogStream::Prefix pre("Residuals");
-    for (unsigned int i=0;i<n;++i)
+    for (unsigned int i=0; i<n; ++i)
       {
-       u = 0.;
-       u(i) = 1.;
-       w = 0.;
-       fev.get_function_gradients(u, indices, ugrad, true);
-       cell_residual(w, fev, make_slice(ugrad));
-       M.vmult(v,u);
-       w.add(-1., v);
-       deallog << ' ' << w.l2_norm();
-       if (d==1)
-         {
-           cell_residual(w, fev, ugrad[0]);
-           M.vmult(v,u);
-           w.add(-1., v);
-           deallog << " e" << w.l2_norm();       
-         }
+        u = 0.;
+        u(i) = 1.;
+        w = 0.;
+        fev.get_function_gradients(u, indices, ugrad, true);
+        cell_residual(w, fev, make_slice(ugrad));
+        M.vmult(v,u);
+        w.add(-1., v);
+        deallog << ' ' << w.l2_norm();
+        if (d==1)
+          {
+            cell_residual(w, fev, ugrad[0]);
+            M.vmult(v,u);
+            w.add(-1., v);
+            deallog << " e" << w.l2_norm();
+          }
       }
     deallog << std::endl;
   }
@@ -75,7 +75,7 @@ void test_cell(const FEValuesBase<dim>& fev)
 
 
 template <int dim>
-void test_boundary(const FEValuesBase<dim>fev)
+void test_boundary(const FEValuesBase<dim> &fev)
 {
   const unsigned int n = fev.dofs_per_cell;
   unsigned int d=fev.get_fe().n_components();
@@ -85,38 +85,38 @@ void test_boundary(const FEValuesBase<dim>& fev)
     LogStream::Prefix pre("bdry");
     M.print(deallog,8);
   }
-  
+
   Vector<double> u(n), v(n), w(n);
   std::vector<std::vector<double> >
-    uval    (d,std::vector<double>(fev.n_quadrature_points)),
-    null_val(d,std::vector<double>(fev.n_quadrature_points, 0.));
+  uval    (d,std::vector<double>(fev.n_quadrature_points)),
+          null_val(d,std::vector<double>(fev.n_quadrature_points, 0.));
   std::vector<std::vector<Tensor<1,dim> > >
-    ugrad   (d,std::vector<Tensor<1,dim> >(fev.n_quadrature_points));
-  
+  ugrad   (d,std::vector<Tensor<1,dim> >(fev.n_quadrature_points));
+
   std::vector<types::global_dof_index> indices(n);
-  for (unsigned int i=0;i<n;++i)
+  for (unsigned int i=0; i<n; ++i)
     indices[i] = i;
-  
+
   {
     LogStream::Prefix pre("Residuals");
-    for (unsigned int i=0;i<n;++i)
+    for (unsigned int i=0; i<n; ++i)
       {
-       u = 0.;
-       u(i) = 1.;
-       w = 0.;
-       fev.get_function_values(u, indices, uval, true);
-       fev.get_function_gradients(u, indices, ugrad, true);
-       nitsche_residual(w, fev, make_slice(uval), make_slice(ugrad), make_slice(null_val), 17);
-       M.vmult(v,u);
-       w.add(-1., v);
-       deallog << ' ' << w.l2_norm();
-       if (d==1)
-         {
-           nitsche_residual(w, fev, uval[0], ugrad[0], null_val[0], 17);
-           M.vmult(v,u);
-           w.add(-1., v);
-           deallog << " e" << w.l2_norm();       
-         }
+        u = 0.;
+        u(i) = 1.;
+        w = 0.;
+        fev.get_function_values(u, indices, uval, true);
+        fev.get_function_gradients(u, indices, ugrad, true);
+        nitsche_residual(w, fev, make_slice(uval), make_slice(ugrad), make_slice(null_val), 17);
+        M.vmult(v,u);
+        w.add(-1., v);
+        deallog << ' ' << w.l2_norm();
+        if (d==1)
+          {
+            nitsche_residual(w, fev, uval[0], ugrad[0], null_val[0], 17);
+            M.vmult(v,u);
+            w.add(-1., v);
+            deallog << " e" << w.l2_norm();
+          }
       }
     deallog << std::endl;
   }
@@ -124,8 +124,8 @@ void test_boundary(const FEValuesBase<dim>& fev)
 
 
 template <int dim>
-void test_face(const FEValuesBase<dim>fev1,
-              const FEValuesBase<dim>& fev2)
+void test_face(const FEValuesBase<dim> &fev1,
+               const FEValuesBase<dim> &fev2)
 {
   const unsigned int n1 = fev1.dofs_per_cell;
   const unsigned int n2 = fev1.dofs_per_cell;
@@ -134,76 +134,96 @@ void test_face(const FEValuesBase<dim>& fev1,
   FullMatrix<double> M12(n1,n2);
   FullMatrix<double> M21(n2,n1);
   FullMatrix<double> M22(n2,n2);
-  
+
   ip_matrix(M11, M12, M21, M22, fev1, fev2, 17);
 
-  { LogStream::Prefix pre("M11"); M11.print(deallog,8); }
-  { LogStream::Prefix pre("M12"); M12.print(deallog,8); }
-  { LogStream::Prefix pre("M21"); M21.print(deallog,8); }
-  { LogStream::Prefix pre("M22"); M22.print(deallog,8); }
-  
+  {
+    LogStream::Prefix pre("M11");
+    M11.print(deallog,8);
+  }
+  {
+    LogStream::Prefix pre("M12");
+    M12.print(deallog,8);
+  }
+  {
+    LogStream::Prefix pre("M21");
+    M21.print(deallog,8);
+  }
+  {
+    LogStream::Prefix pre("M22");
+    M22.print(deallog,8);
+  }
+
   Vector<double> u1(n1), v1(n1), w1(n1);
   Vector<double> u2(n2), v2(n2), w2(n2);
   std::vector<std::vector<double> >
-    u1val (d,std::vector<double>(fev1.n_quadrature_points)),
-    nullval (d,std::vector<double>(fev2.n_quadrature_points, 0.));
+  u1val (d,std::vector<double>(fev1.n_quadrature_points)),
+        nullval (d,std::vector<double>(fev2.n_quadrature_points, 0.));
   std::vector<std::vector<Tensor<1,dim> > >
-    u1grad(d,std::vector<Tensor<1,dim> >(fev1.n_quadrature_points)),
-    nullgrad(d,std::vector<Tensor<1,dim> >(fev2.n_quadrature_points, Tensor<1,dim>()));
-  
+  u1grad(d,std::vector<Tensor<1,dim> >(fev1.n_quadrature_points)),
+         nullgrad(d,std::vector<Tensor<1,dim> >(fev2.n_quadrature_points, Tensor<1,dim>()));
+
   std::vector<types::global_dof_index> indices1(n1), indices2(n2);
-  for (unsigned int i=0;i<n1;++i) indices1[i] = i;
-  for (unsigned int i=0;i<n2;++i) indices2[i] = i;
-  
+  for (unsigned int i=0; i<n1; ++i) indices1[i] = i;
+  for (unsigned int i=0; i<n2; ++i) indices2[i] = i;
+
   {
     LogStream::Prefix pre("Residuals");
-    for (unsigned int i1=0;i1<n1;++i1)
+    for (unsigned int i1=0; i1<n1; ++i1)
       {
-       u1 = 0.;
-       u1(i1) = 1.;
-       w1 = 0.;
-       w2 = 0.;
-       fev1.get_function_values(u1, indices1, u1val, true);
-       fev1.get_function_gradients(u1, indices1, u1grad, true);
-       ip_residual(w1, w2, fev1, fev2,
-                   make_slice(u1val), make_slice(u1grad),
-                   make_slice(nullval), make_slice(nullgrad),
-                   17);
-       M11.vmult(v1,u1); w1.add(-1., v1);
-       M21.vmult(v2,u1); w2.add(-1., v2);
-       deallog << ' ' << w1.l2_norm() + w2.l2_norm();
-       
-       if (d==1)
-         {
-           w1 = 0.;
-           w2 = 0.;
-           ip_residual(w1, w2, fev1, fev2, u1val[0], u1grad[0], nullval[0], nullgrad[0], 17);
-           M11.vmult(v1,u1); w1.add(-1., v1);
-           M21.vmult(v2,u1); w2.add(-1., v2);
-           deallog << " e" << w1.l2_norm() + w2.l2_norm();
-         }
-       
-       w1 = 0.;
-       w2 = 0.;
-       fev2.get_function_values(u1, indices2, u1val, true);
-       fev2.get_function_gradients(u1, indices2, u1grad, true);
-       ip_residual(w1, w2, fev1, fev2,
-                   make_slice(nullval), make_slice(nullgrad),
-                   make_slice(u1val), make_slice(u1grad),
-                   17);
-       M12.vmult(v1,u1); w1.add(-1., v1);
-       M22.vmult(v2,u1); w2.add(-1., v2);
-       deallog << ' ' << w1.l2_norm() + w2.l2_norm();
-       
-       if (d==1)
-         {
-           w1 = 0.;
-           w2 = 0.;
-           ip_residual(w1, w2, fev1, fev2, nullval[0], nullgrad[0], u1val[0], u1grad[0], 17);
-           M12.vmult(v1,u1); w1.add(-1., v1);
-           M22.vmult(v2,u1); w2.add(-1., v2);
-           deallog << " e" << w1.l2_norm() + w2.l2_norm();
-         }
+        u1 = 0.;
+        u1(i1) = 1.;
+        w1 = 0.;
+        w2 = 0.;
+        fev1.get_function_values(u1, indices1, u1val, true);
+        fev1.get_function_gradients(u1, indices1, u1grad, true);
+        ip_residual(w1, w2, fev1, fev2,
+                    make_slice(u1val), make_slice(u1grad),
+                    make_slice(nullval), make_slice(nullgrad),
+                    17);
+        M11.vmult(v1,u1);
+        w1.add(-1., v1);
+        M21.vmult(v2,u1);
+        w2.add(-1., v2);
+        deallog << ' ' << w1.l2_norm() + w2.l2_norm();
+
+        if (d==1)
+          {
+            w1 = 0.;
+            w2 = 0.;
+            ip_residual(w1, w2, fev1, fev2, u1val[0], u1grad[0], nullval[0], nullgrad[0], 17);
+            M11.vmult(v1,u1);
+            w1.add(-1., v1);
+            M21.vmult(v2,u1);
+            w2.add(-1., v2);
+            deallog << " e" << w1.l2_norm() + w2.l2_norm();
+          }
+
+        w1 = 0.;
+        w2 = 0.;
+        fev2.get_function_values(u1, indices2, u1val, true);
+        fev2.get_function_gradients(u1, indices2, u1grad, true);
+        ip_residual(w1, w2, fev1, fev2,
+                    make_slice(nullval), make_slice(nullgrad),
+                    make_slice(u1val), make_slice(u1grad),
+                    17);
+        M12.vmult(v1,u1);
+        w1.add(-1., v1);
+        M22.vmult(v2,u1);
+        w2.add(-1., v2);
+        deallog << ' ' << w1.l2_norm() + w2.l2_norm();
+
+        if (d==1)
+          {
+            w1 = 0.;
+            w2 = 0.;
+            ip_residual(w1, w2, fev1, fev2, nullval[0], nullgrad[0], u1val[0], u1grad[0], 17);
+            M12.vmult(v1,u1);
+            w1.add(-1., v1);
+            M22.vmult(v2,u1);
+            w2.add(-1., v2);
+            deallog << " e" << w1.l2_norm() + w2.l2_norm();
+          }
       }
     deallog << std::endl;
   }
@@ -212,7 +232,7 @@ void test_face(const FEValuesBase<dim>& fev1,
 
 template <int dim>
 void
-test_fe(Triangulation<dim>& tr, FiniteElement<dim>& fe)
+test_fe(Triangulation<dim> &tr, FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl << "cell matrix" << std::endl;
   QGauss<dim> quadrature(fe.tensor_degree());
@@ -221,10 +241,10 @@ test_fe(Triangulation<dim>& tr, FiniteElement<dim>& fe)
   typename Triangulation<dim>::cell_iterator cell1 = tr.begin(1);
   fev.reinit(cell1);
   test_cell(fev);
-  
+
   QGauss<dim-1> face_quadrature(fe.tensor_degree()+1);
   FEFaceValues<dim> fef1(fe, face_quadrature, update_values | update_gradients | update_normal_vectors);
-  for (unsigned int i=0;i<GeometryInfo<dim>::faces_per_cell;++i)
+  for (unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
     {
       deallog << "boundary_matrix " << i << std::endl;
       fef1.reinit(cell1, i);
@@ -233,27 +253,27 @@ test_fe(Triangulation<dim>& tr, FiniteElement<dim>& fe)
 
   FEFaceValues<dim> fef2(fe, face_quadrature, update_values | update_gradients);
   typename Triangulation<dim>::cell_iterator cell2 = cell1->neighbor(1);
-  
+
   deallog << "face_matrix " << 0 << std::endl;
   cell1 = tr.begin(1);
   fef1.reinit(cell1, 1);
   fef2.reinit(cell2, 0);
-  test_face(fef1, fef2);  
+  test_face(fef1, fef2);
 }
 
 
 template <int dim>
 void
-test(Triangulation<dim>tr)
+test(Triangulation<dim> &tr)
 {
   FE_DGQ<dim> q1(1);
   test_fe(tr, q1);
-  
+
   FE_DGQ<dim> q2(2);
   test_fe(tr, q2);
-  
-  FE_Nedelec<dim> n1(1);  
-  test_fe(tr, n1);  
+
+  FE_Nedelec<dim> n1(1);
+  test_fe(tr, n1);
 }
 
 
@@ -261,12 +281,12 @@ int main()
 {
   initlog(__FILE__);
   deallog.threshold_double(1.e-10);
-  
+
   Triangulation<2> tr2;
   TestGrids::hypercube(tr2, 1);
   test(tr2);
-  
- Triangulation<3> tr3;
- TestGrids::hypercube(tr3, 1);
- test(tr3);  
+
 Triangulation<3> tr3;
 TestGrids::hypercube(tr3, 1);
+  test(tr3);
 }
index c120fbedb8d574ce64e339f0c4bbffed201d0b8a..66f81bbd6636ced252c31748c306975b71e42d19 100644 (file)
@@ -43,16 +43,16 @@ using namespace dealii;
 template <int dim>
 class Local : public Subscriptor
 {
-  public:
-    typedef MeshWorker::IntegrationInfo<dim> CellInfo;
-    
-    void cell(MeshWorker::DoFInfo<dim>& dinfo, CellInfo& info) const;
-    void bdry(MeshWorker::DoFInfo<dim>& dinfo, CellInfo& info) const;
-    void face(MeshWorker::DoFInfo<dim>& dinfo1, MeshWorker::DoFInfo<dim>& dinfo2,
-             CellInfo& info1, CellInfo& info2) const;
-
-    bool cells;
-    bool faces;
+public:
+  typedef MeshWorker::IntegrationInfo<dim> CellInfo;
+
+  void cell(MeshWorker::DoFInfo<dim> &dinfo, CellInfo &info) const;
+  void bdry(MeshWorker::DoFInfo<dim> &dinfo, CellInfo &info) const;
+  void face(MeshWorker::DoFInfo<dim> &dinfo1, MeshWorker::DoFInfo<dim> &dinfo2,
+            CellInfo &info1, CellInfo &info2) const;
+
+  bool cells;
+  bool faces;
 };
 
 // Fill local structures with the following format:
@@ -68,62 +68,62 @@ class Local : public Subscriptor
 
 template <int dim>
 void
-Local<dim>::cell(MeshWorker::DoFInfo<dim>& info, CellInfo&) const
+Local<dim>::cell(MeshWorker::DoFInfo<dim> &info, CellInfo &) const
 {
   if (!cells) return;
   const unsigned int cell = info.cell->user_index();
 
-                                  // Fill local residuals
-  for (unsigned int k=0;k<info.n_vectors();++k)
-    for (unsigned int b=0;b<info.vector(k).n_blocks();++b)
-      for (unsigned int i=0;i<info.vector(k).block(b).size();++i)
-       {
-         const double x = cell + 0.1 * b + 0.001 * i;
-         info.vector(k).block(b)(i) = x;
-       }
+  // Fill local residuals
+  for (unsigned int k=0; k<info.n_vectors(); ++k)
+    for (unsigned int b=0; b<info.vector(k).n_blocks(); ++b)
+      for (unsigned int i=0; i<info.vector(k).block(b).size(); ++i)
+        {
+          const double x = cell + 0.1 * b + 0.001 * i;
+          info.vector(k).block(b)(i) = x;
+        }
 
-  for (unsigned int k=0;k<info.n_matrices();++k)
+  for (unsigned int k=0; k<info.n_matrices(); ++k)
     {
       const unsigned int block_row = info.matrix(k).row;
       const unsigned int block_col = info.matrix(k).column;
-      FullMatrix<double>M1 = info.matrix(k).matrix;
-      for (unsigned int i=0;i<M1.m();++i)
-       for (unsigned int j=0;j<M1.n();++j)
-         {
-           double x = .1 * block_row + .001 * i;
-           x = .1 * block_col + .001 * j + .001 * x;
-           M1(i,j) = cell + x;
-         }
+      FullMatrix<double> &M1 = info.matrix(k).matrix;
+      for (unsigned int i=0; i<M1.m(); ++i)
+        for (unsigned int j=0; j<M1.n(); ++j)
+          {
+            double x = .1 * block_row + .001 * i;
+            x = .1 * block_col + .001 * j + .001 * x;
+            M1(i,j) = cell + x;
+          }
     }
 }
 
 
 template <int dim>
 void
-Local<dim>::bdry(MeshWorker::DoFInfo<dim>& , CellInfo&) const
+Local<dim>::bdry(MeshWorker::DoFInfo<dim> & , CellInfo &) const
 {}
 
 
 template <int dim>
 void
-Local<dim>::face(MeshWorker::DoFInfo<dim>& , MeshWorker::DoFInfo<dim>&,
-                CellInfo&, CellInfo&) const
+Local<dim>::face(MeshWorker::DoFInfo<dim> & , MeshWorker::DoFInfo<dim> &,
+                 CellInfo &, CellInfo &) const
 {}
 
 
 template <int dim>
 void
-test_simple(MGDoFHandler<dim>mgdofs)
+test_simple(MGDoFHandler<dim> &mgdofs)
 {
   SparsityPattern pattern;
   SparseMatrix<double> matrix;
   Vector<double> v;
 
-  const DoFHandler<dim>dofs = mgdofs;
-  const FiniteElement<dim>fe = dofs.get_fe();
+  const DoFHandler<dim> &dofs = mgdofs;
+  const FiniteElement<dim> &fe = dofs.get_fe();
   pattern.reinit (dofs.n_dofs(), dofs.n_dofs(),
-                 (GeometryInfo<dim>::faces_per_cell
-                  *GeometryInfo<dim>::max_children_per_face+1)*fe.dofs_per_cell);
+                  (GeometryInfo<dim>::faces_per_cell
+                   *GeometryInfo<dim>::max_children_per_face+1)*fe.dofs_per_cell);
   DoFTools::make_flux_sparsity_pattern (dofs, pattern);
   pattern.compress();
   matrix.reinit (pattern);
@@ -134,27 +134,27 @@ test_simple(MGDoFHandler<dim>& mgdofs)
   local.faces = false;
 
   MappingQ1<dim> mapping;
-  
+
   MeshWorker::IntegrationInfoBox<dim> info_box;
   info_box.initialize_gauss_quadrature(1, 1, 1);
   info_box.initialize_update_flags();
   info_box.initialize(fe, mapping);
-  
+
   MeshWorker::DoFInfo<dim> dof_info(dofs);
-  
+
   MeshWorker::Assembler::SystemSimple<SparseMatrix<double>, Vector<double> >
-    assembler;
+  assembler;
   assembler.initialize(matrix, v);
-  
+
   MeshWorker::loop<dim, dim, MeshWorker::DoFInfo<dim>, MeshWorker::IntegrationInfoBox<dim> >
-    (dofs.begin_active(), dofs.end(),
-     dof_info, info_box,
-     std_cxx1x::bind (&Local<dim>::cell, local, std_cxx1x::_1, std_cxx1x::_2),
-       std_cxx1x::bind (&Local<dim>::bdry, local, std_cxx1x::_1, std_cxx1x::_2),
-       std_cxx1x::bind (&Local<dim>::face, local, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3, std_cxx1x::_4),
-       assembler, true);
-  
-  for (unsigned int i=0;i<v.size();++i)
+  (dofs.begin_active(), dofs.end(),
+   dof_info, info_box,
+   std_cxx1x::bind (&Local<dim>::cell, local, std_cxx1x::_1, std_cxx1x::_2),
+   std_cxx1x::bind (&Local<dim>::bdry, local, std_cxx1x::_1, std_cxx1x::_2),
+   std_cxx1x::bind (&Local<dim>::face, local, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3, std_cxx1x::_4),
+   assembler, true);
+
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << std::setprecision(3) << v(i);
   deallog << std::endl;
 
@@ -165,7 +165,7 @@ test_simple(MGDoFHandler<dim>& mgdofs)
 
 template<int dim>
 void
-test(const FiniteElement<dim>fe)
+test(const FiniteElement<dim> &fe)
 {
   Triangulation<dim> tr;
   GridGenerator::hyper_cube(tr);
@@ -176,7 +176,7 @@ test(const FiniteElement<dim>& fe)
   tr.execute_coarsening_and_refinement();
 //  tr.refine_global(1);
   deallog << "Triangulation levels";
-  for (unsigned int l=0;l<tr.n_levels();++l)
+  for (unsigned int l=0; l<tr.n_levels(); ++l)
     deallog << ' ' << l << ':' << tr.n_cells(l);
   deallog << std::endl;
 
@@ -188,7 +188,7 @@ test(const FiniteElement<dim>& fe)
   MGDoFHandler<dim> dofs(tr);
   dofs.distribute_dofs(fe);
   deallog << "DoFHandler " << dofs.n_dofs() << " levels";
-  for (unsigned int l=0;l<tr.n_levels();++l)
+  for (unsigned int l=0; l<tr.n_levels(); ++l)
     deallog << ' ' << l << ':' << dofs.n_dofs(l);
   deallog << std::endl;
 
@@ -202,11 +202,11 @@ int main ()
   std::ofstream logfile(logname.c_str());
   deallog.attach(logfile);
   deallog.depth_console (0);
-  
+
   std::vector<std_cxx1x::shared_ptr<FiniteElement<2> > > fe2;
   fe2.push_back(std_cxx1x::shared_ptr<FiniteElement<2> >(new  FE_DGP<2>(1)));
   fe2.push_back(std_cxx1x::shared_ptr<FiniteElement<2> >(new  FE_Q<2>(1)));
 
-  for (unsigned int i=0;i<fe2.size();++i)
+  for (unsigned int i=0; i<fe2.size(); ++i)
     test(*fe2[i]);
 }
index d2d8ba44265ef6656702e9b675707a4bea94f0dd..3b7d9985d6cfbf937d15f3ee5316427a68cb0793 100644 (file)
@@ -42,102 +42,102 @@ using namespace dealii;
 template <int dim>
 class MatrixIntegrator : public Subscriptor
 {
-  public:
-    static void cell(MeshWorker::DoFInfo<dim>& dinfo,
-                    MeshWorker::IntegrationInfo<dim>& info);
-    static void bdry(MeshWorker::DoFInfo<dim>& dinfo,
-                    MeshWorker::IntegrationInfo<dim>& info);
-    static void face(MeshWorker::DoFInfo<dim>& dinfo1,
-                    MeshWorker::DoFInfo<dim>& dinfo2,
-                    MeshWorker::IntegrationInfo<dim>& info1,
-                    MeshWorker::IntegrationInfo<dim>& info2);
+public:
+  static void cell(MeshWorker::DoFInfo<dim> &dinfo,
+                   MeshWorker::IntegrationInfo<dim> &info);
+  static void bdry(MeshWorker::DoFInfo<dim> &dinfo,
+                   MeshWorker::IntegrationInfo<dim> &info);
+  static void face(MeshWorker::DoFInfo<dim> &dinfo1,
+                   MeshWorker::DoFInfo<dim> &dinfo2,
+                   MeshWorker::IntegrationInfo<dim> &info1,
+                   MeshWorker::IntegrationInfo<dim> &info2);
 };
 
 
 template <int dim>
-void MatrixIntegrator<dim>::cell(MeshWorker::DoFInfo<dim>dinfo,
-                                MeshWorker::IntegrationInfo<dim>& info)
+void MatrixIntegrator<dim>::cell(MeshWorker::DoFInfo<dim> &dinfo,
+                                 MeshWorker::IntegrationInfo<dim> &info)
 {
-  const FEValuesBase<dim>fe = info.fe_values();
-  FullMatrix<double>local_matrix = dinfo.matrix(0).matrix;
-  
+  const FEValuesBase<dim> &fe = info.fe_values();
+  FullMatrix<double> &local_matrix = dinfo.matrix(0).matrix;
+
   for (unsigned int k=0; k<fe.n_quadrature_points; ++k)
     for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
       for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
-       local_matrix(i,j) += (fe.shape_grad(i,k) * fe.shape_grad(j,k))
-                            * fe.JxW(k);
+        local_matrix(i,j) += (fe.shape_grad(i,k) * fe.shape_grad(j,k))
+                             * fe.JxW(k);
 }
 
 
 template <int dim>
-void MatrixIntegrator<dim>::bdry(MeshWorker::DoFInfo<dim>dinfo,
-                                MeshWorker::IntegrationInfo<dim>& info)
+void MatrixIntegrator<dim>::bdry(MeshWorker::DoFInfo<dim> &dinfo,
+                                 MeshWorker::IntegrationInfo<dim> &info)
 {
-  const FEValuesBase<dim>fe = info.fe_values();
-  FullMatrix<double>local_matrix = dinfo.matrix(0).matrix;
-  
+  const FEValuesBase<dim> &fe = info.fe_values();
+  FullMatrix<double> &local_matrix = dinfo.matrix(0).matrix;
+
   const unsigned int deg = fe.get_fe().tensor_degree();
   const double penalty = 2. * deg * (deg+1) * dinfo.face->measure() / dinfo.cell->measure();
-  
-  for (unsigned k=0;k<fe.n_quadrature_points;++k)
+
+  for (unsigned k=0; k<fe.n_quadrature_points; ++k)
     for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
       for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
-       local_matrix(i,j) += (fe.shape_value(i,k) * penalty * fe.shape_value(j,k)
-                             - (fe.normal_vector(k) * fe.shape_grad(i,k)) * fe.shape_value(j,k)
-                             - (fe.normal_vector(k) * fe.shape_grad(j,k)) * fe.shape_value(i,k))
-                            * fe.JxW(k);
+        local_matrix(i,j) += (fe.shape_value(i,k) * penalty * fe.shape_value(j,k)
+                              - (fe.normal_vector(k) * fe.shape_grad(i,k)) * fe.shape_value(j,k)
+                              - (fe.normal_vector(k) * fe.shape_grad(j,k)) * fe.shape_value(i,k))
+                             * fe.JxW(k);
 }
 
 
 template <int dim>
-void MatrixIntegrator<dim>::face(MeshWorker::DoFInfo<dim>dinfo1,
-                                MeshWorker::DoFInfo<dim>& dinfo2,
-                                MeshWorker::IntegrationInfo<dim>& info1,
-                                MeshWorker::IntegrationInfo<dim>& info2)
+void MatrixIntegrator<dim>::face(MeshWorker::DoFInfo<dim> &dinfo1,
+                                 MeshWorker::DoFInfo<dim> &dinfo2,
+                                 MeshWorker::IntegrationInfo<dim> &info1,
+                                 MeshWorker::IntegrationInfo<dim> &info2)
 {
-  const FEValuesBase<dim>fe1 = info1.fe_values();
-  const FEValuesBase<dim>fe2 = info2.fe_values();
-  FullMatrix<double>matrix_v1u1 = dinfo1.matrix(0, false).matrix;
-  FullMatrix<double>matrix_v1u2 = dinfo1.matrix(0, true).matrix;
-  FullMatrix<double>matrix_v2u1 = dinfo2.matrix(0, true).matrix;
-  FullMatrix<double>matrix_v2u2 = dinfo2.matrix(0, false).matrix;
-  
+  const FEValuesBase<dim> &fe1 = info1.fe_values();
+  const FEValuesBase<dim> &fe2 = info2.fe_values();
+  FullMatrix<double> &matrix_v1u1 = dinfo1.matrix(0, false).matrix;
+  FullMatrix<double> &matrix_v1u2 = dinfo1.matrix(0, true).matrix;
+  FullMatrix<double> &matrix_v2u1 = dinfo2.matrix(0, true).matrix;
+  FullMatrix<double> &matrix_v2u2 = dinfo2.matrix(0, false).matrix;
+
   const unsigned int deg = fe1.get_fe().tensor_degree();
   const double penalty1 = deg * (deg+1) * dinfo1.face->measure() / dinfo1.cell->measure();
   const double penalty2 = deg * (deg+1) * dinfo2.face->measure() / dinfo2.cell->measure();
   const double penalty = penalty1 + penalty2;
-  
-  for (unsigned k=0;k<fe1.n_quadrature_points;++k)
+
+  for (unsigned k=0; k<fe1.n_quadrature_points; ++k)
     for (unsigned int i=0; i<fe1.dofs_per_cell; ++i)
       for (unsigned int j=0; j<fe1.dofs_per_cell; ++j)
-       {
-         matrix_v1u1(i,j) += (fe1.shape_value(i,k) * penalty * fe1.shape_value(j,k)
-                              - (fe1.normal_vector(k) * fe1.shape_grad(i,k)) * fe1.shape_value(j,k)
-                              - (fe1.normal_vector(k) * fe1.shape_grad(j,k)) * fe1.shape_value(i,k)
-         ) * .5 * fe1.JxW(k);
-         matrix_v1u2(i,j) += (-fe1.shape_value(i,k) * penalty * fe2.shape_value(j,k)
-                              + (fe1.normal_vector(k) * fe1.shape_grad(i,k)) * fe2.shape_value(j,k)
-                              - (fe1.normal_vector(k) * fe2.shape_grad(j,k)) * fe1.shape_value(i,k)
-         ) * .5 * fe1.JxW(k);
-         matrix_v2u1(i,j) += (-fe2.shape_value(i,k) * penalty * fe1.shape_value(j,k)
-                              - (fe1.normal_vector(k) * fe2.shape_grad(i,k)) * fe1.shape_value(j,k)
-                              + (fe1.normal_vector(k) * fe1.shape_grad(j,k)) * fe2.shape_value(i,k)
-         ) * .5 * fe1.JxW(k);
-         matrix_v2u2(i,j) += (fe2.shape_value(i,k) * penalty * fe2.shape_value(j,k)
-                              + (fe1.normal_vector(k) * fe2.shape_grad(i,k)) * fe2.shape_value(j,k)
-                              + (fe1.normal_vector(k) * fe2.shape_grad(j,k)) * fe2.shape_value(i,k)
-         ) * .5 * fe1.JxW(k);
-       }
+        {
+          matrix_v1u1(i,j) += (fe1.shape_value(i,k) * penalty * fe1.shape_value(j,k)
+                               - (fe1.normal_vector(k) * fe1.shape_grad(i,k)) * fe1.shape_value(j,k)
+                               - (fe1.normal_vector(k) * fe1.shape_grad(j,k)) * fe1.shape_value(i,k)
+                              ) * .5 * fe1.JxW(k);
+          matrix_v1u2(i,j) += (-fe1.shape_value(i,k) * penalty * fe2.shape_value(j,k)
+                               + (fe1.normal_vector(k) * fe1.shape_grad(i,k)) * fe2.shape_value(j,k)
+                               - (fe1.normal_vector(k) * fe2.shape_grad(j,k)) * fe1.shape_value(i,k)
+                              ) * .5 * fe1.JxW(k);
+          matrix_v2u1(i,j) += (-fe2.shape_value(i,k) * penalty * fe1.shape_value(j,k)
+                               - (fe1.normal_vector(k) * fe2.shape_grad(i,k)) * fe1.shape_value(j,k)
+                               + (fe1.normal_vector(k) * fe1.shape_grad(j,k)) * fe2.shape_value(i,k)
+                              ) * .5 * fe1.JxW(k);
+          matrix_v2u2(i,j) += (fe2.shape_value(i,k) * penalty * fe2.shape_value(j,k)
+                               + (fe1.normal_vector(k) * fe2.shape_grad(i,k)) * fe2.shape_value(j,k)
+                               + (fe1.normal_vector(k) * fe2.shape_grad(j,k)) * fe2.shape_value(i,k)
+                              ) * .5 * fe1.JxW(k);
+        }
 }
 
 
 template <int dim>
 void
-assemble(const DoFHandler<dim>& dof_handler, SparseMatrix<double>& matrix)
+assemble(const DoFHandler<dim> &dof_handler, SparseMatrix<double> &matrix)
 {
-  const FiniteElement<dim>fe = dof_handler.get_fe();
-  MappingQ1<dim> mapping;  
-  
+  const FiniteElement<dim> &fe = dof_handler.get_fe();
+  MappingQ1<dim> mapping;
+
   MeshWorker::IntegrationInfoBox<dim> info_box;
   const unsigned int n_gauss_points = dof_handler.get_fe().tensor_degree()+1;
   info_box.initialize_gauss_quadrature(n_gauss_points, n_gauss_points, n_gauss_points);
@@ -145,34 +145,34 @@ assemble(const DoFHandler<dim>& dof_handler, SparseMatrix<double>& matrix)
   UpdateFlags update_flags = update_values | update_gradients;
   info_box.add_update_flags(update_flags, true, true, true, true);
   info_box.initialize(fe, mapping);
-  
+
   MeshWorker::DoFInfo<dim> dof_info(dof_handler);
-  
+
   MeshWorker::Assembler::MatrixSimple<SparseMatrix<double> > assembler;
   assembler.initialize(matrix);
-  
+
   MeshWorker::loop<dim, dim, MeshWorker::DoFInfo<dim>, MeshWorker::IntegrationInfoBox<dim> >
-    (dof_handler.begin_active(),
-     dof_handler.end(),
-     dof_info,
-     info_box,
-     &MatrixIntegrator<dim>::cell,
-     &MatrixIntegrator<dim>::bdry,
-     &MatrixIntegrator<dim>::face,
-     assembler);
+  (dof_handler.begin_active(),
+   dof_handler.end(),
+   dof_info,
+   info_box,
+   &MatrixIntegrator<dim>::cell,
+   &MatrixIntegrator<dim>::bdry,
+   &MatrixIntegrator<dim>::face,
+   assembler);
 }
 
 
 template <int dim>
 void
-assemble(const MGDoFHandler<dim>dof_handler,
-        MGLevelObject<SparseMatrix<double> > matrix,
-        MGLevelObject<SparseMatrix<double> > dg_up,
-        MGLevelObject<SparseMatrix<double> > dg_down)
+assemble(const MGDoFHandler<dim> &dof_handler,
+         MGLevelObject<SparseMatrix<double> > matrix,
+         MGLevelObject<SparseMatrix<double> > dg_up,
+         MGLevelObject<SparseMatrix<double> > dg_down)
 {
-  const FiniteElement<dim>fe = dof_handler.get_fe();
+  const FiniteElement<dim> &fe = dof_handler.get_fe();
   MappingQ1<dim> mapping;
-  
+
   MeshWorker::IntegrationInfoBox<dim> info_box;
   const unsigned int n_gauss_points = dof_handler.get_fe().tensor_degree()+1;
   info_box.initialize_gauss_quadrature(n_gauss_points, n_gauss_points, n_gauss_points);
@@ -180,41 +180,41 @@ assemble(const MGDoFHandler<dim>& dof_handler,
   UpdateFlags update_flags = update_values | update_gradients;
   info_box.add_update_flags(update_flags, true, true, true, true);
   info_box.initialize(fe, mapping);
-  
+
   MeshWorker::DoFInfo<dim> dof_info(dof_handler);
-  
+
   MeshWorker::Assembler::MGMatrixSimple<SparseMatrix<double> > assembler;
   assembler.initialize(matrix);
-  
+
   MeshWorker::loop<MeshWorker::DoFInfo<dim>, MeshWorker::IntegrationInfoBox<dim> >
-    (dof_handler.begin(),
-     dof_handler.end(),
-     dof_info,
-     info_box,
-     &MatrixIntegrator<dim>::cell,
-     &MatrixIntegrator<dim>::bdry,
-     &MatrixIntegrator<dim>::face,
-     assembler);
+  (dof_handler.begin(),
+   dof_handler.end(),
+   dof_info,
+   info_box,
+   &MatrixIntegrator<dim>::cell,
+   &MatrixIntegrator<dim>::bdry,
+   &MatrixIntegrator<dim>::face,
+   assembler);
 }
 
 
 template <int dim>
 void
-test_simple(MGDoFHandler<dim>mgdofs)
+test_simple(MGDoFHandler<dim> &mgdofs)
 {
   SparsityPattern pattern;
   SparseMatrix<double> matrix;
   Vector<double> v;
 
-  const DoFHandler<dim>dofs = mgdofs;
-  const FiniteElement<dim>fe = dofs.get_fe();
+  const DoFHandler<dim> &dofs = mgdofs;
+  const FiniteElement<dim> &fe = dofs.get_fe();
   pattern.reinit (dofs.n_dofs(), dofs.n_dofs(),
-                 (GeometryInfo<dim>::faces_per_cell
-                  *GeometryInfo<dim>::max_children_per_face+1)*fe.dofs_per_cell);
+                  (GeometryInfo<dim>::faces_per_cell
+                   *GeometryInfo<dim>::max_children_per_face+1)*fe.dofs_per_cell);
   DoFTools::make_flux_sparsity_pattern (dofs, pattern);
   pattern.compress();
   matrix.reinit (pattern);
-  
+
   assemble(dofs, matrix);
   deallog << std::setprecision(3);
   matrix.print(deallog);
@@ -226,41 +226,41 @@ test_simple(MGDoFHandler<dim>& mgdofs)
   MGLevelObject<SparseMatrix<double> > mg_matrix_dg_down;
 
   const unsigned int n_levels = mgdofs.get_tria().n_levels();
-  
+
   mg_sparsity.resize(0, n_levels-1);
   mg_sparsity_dg_interface.resize(0, n_levels-1);
   mg_matrix.resize(0, n_levels-1);
   mg_matrix_dg_up.resize(0, n_levels-1);
   mg_matrix_dg_down.resize(0, n_levels-1);
-  
+
   for (unsigned int level=mg_sparsity.min_level();
-       level<=mg_sparsity.max_level();++level)
+       level<=mg_sparsity.max_level(); ++level)
     {
       CompressedSparsityPattern c_sparsity(mgdofs.n_dofs(level));
       CompressedSparsityPattern ci_sparsity;
       if (level>0)
-       ci_sparsity.reinit(mgdofs.n_dofs(level-1), mgdofs.n_dofs(level));
-      
+        ci_sparsity.reinit(mgdofs.n_dofs(level-1), mgdofs.n_dofs(level));
+
       MGTools::make_flux_sparsity_pattern(mgdofs, c_sparsity, level);
       if (level>0)
-       MGTools::make_flux_sparsity_pattern_edge(mgdofs, ci_sparsity, level);
-      
+        MGTools::make_flux_sparsity_pattern_edge(mgdofs, ci_sparsity, level);
+
       mg_sparsity[level].copy_from(c_sparsity);
       mg_matrix[level].reinit(mg_sparsity[level]);
       if (level>0)
-       {
-         mg_sparsity_dg_interface[level].copy_from(ci_sparsity);
-         mg_matrix_dg_up[level].reinit(mg_sparsity_dg_interface[level]);
-         mg_matrix_dg_down[level].reinit(mg_sparsity_dg_interface[level]);
-       }
+        {
+          mg_sparsity_dg_interface[level].copy_from(ci_sparsity);
+          mg_matrix_dg_up[level].reinit(mg_sparsity_dg_interface[level]);
+          mg_matrix_dg_down[level].reinit(mg_sparsity_dg_interface[level]);
+        }
     }
-  
+
 }
 
 
 template<int dim>
 void
-test(const FiniteElement<dim>fe)
+test(const FiniteElement<dim> &fe)
 {
   Triangulation<dim> tr;
   GridGenerator::hyper_L(tr);
@@ -270,10 +270,10 @@ test(const FiniteElement<dim>& fe)
 //  tr.execute_coarsening_and_refinement();
 //  tr.refine_global(1);
   deallog << "Triangulation levels";
-  for (unsigned int l=0;l<tr.n_levels();++l)
+  for (unsigned int l=0; l<tr.n_levels(); ++l)
     deallog << ' ' << l << ':' << tr.n_cells(l);
   deallog << std::endl;
-  
+
   unsigned int cn = 0;
   for (typename Triangulation<dim>::cell_iterator cell = tr.begin();
        cell != tr.end(); ++cell, ++cn)
@@ -282,10 +282,10 @@ test(const FiniteElement<dim>& fe)
   MGDoFHandler<dim> dofs(tr);
   dofs.distribute_dofs(fe);
   deallog << "DoFHandler " << dofs.n_dofs() << " levels";
-  for (unsigned int l=0;l<tr.n_levels();++l)
+  for (unsigned int l=0; l<tr.n_levels(); ++l)
     deallog << ' ' << l << ':' << dofs.n_dofs(l);
   deallog << std::endl;
-  
+
   test_simple(dofs);
 }
 
@@ -296,11 +296,11 @@ int main ()
   std::ofstream logfile(logname.c_str());
   deallog.attach(logfile);
   deallog.depth_console (0);
-  
+
   std::vector<std_cxx1x::shared_ptr<FiniteElement<2> > > fe2;
   fe2.push_back(std_cxx1x::shared_ptr<FiniteElement<2> >(new  FE_DGP<2>(1)));
 //  fe2.push_back(std_cxx1x::shared_ptr<FiniteElement<2> >(new  FE_Q<2>(1)));
-  
-  for (unsigned int i=0;i<fe2.size();++i)
+
+  for (unsigned int i=0; i<fe2.size(); ++i)
     test(*fe2[i]);
 }
index 5791c99d944e1d065a58248ac5138b0435c484a5..609406761aeba07097f80f5f8c94078deef38fb8 100644 (file)
@@ -42,115 +42,115 @@ using namespace dealii;
 template <int dim>
 class MatrixIntegrator : public Subscriptor
 {
-  public:
-    static void cell(MeshWorker::DoFInfo<dim>& dinfo,
-                    MeshWorker::IntegrationInfo<dim>& info);
-    static void face(MeshWorker::DoFInfo<dim>& dinfo1,
-                    MeshWorker::DoFInfo<dim>& dinfo2,
-                    MeshWorker::IntegrationInfo<dim>& info1,
-                    MeshWorker::IntegrationInfo<dim>& info2);
-    static void block_cell(MeshWorker::DoFInfo<dim>& dinfo,
-                          MeshWorker::IntegrationInfo<dim>& info);
-    static void block_face(MeshWorker::DoFInfo<dim>& dinfo1,
-                          MeshWorker::DoFInfo<dim>& dinfo2,
-                          MeshWorker::IntegrationInfo<dim>& info1,
-                          MeshWorker::IntegrationInfo<dim>& info2);
+public:
+  static void cell(MeshWorker::DoFInfo<dim> &dinfo,
+                   MeshWorker::IntegrationInfo<dim> &info);
+  static void face(MeshWorker::DoFInfo<dim> &dinfo1,
+                   MeshWorker::DoFInfo<dim> &dinfo2,
+                   MeshWorker::IntegrationInfo<dim> &info1,
+                   MeshWorker::IntegrationInfo<dim> &info2);
+  static void block_cell(MeshWorker::DoFInfo<dim> &dinfo,
+                         MeshWorker::IntegrationInfo<dim> &info);
+  static void block_face(MeshWorker::DoFInfo<dim> &dinfo1,
+                         MeshWorker::DoFInfo<dim> &dinfo2,
+                         MeshWorker::IntegrationInfo<dim> &info1,
+                         MeshWorker::IntegrationInfo<dim> &info2);
 };
 
 
 template <int dim>
-void MatrixIntegrator<dim>::cell(MeshWorker::DoFInfo<dim>dinfo,
-                                MeshWorker::IntegrationInfo<dim>& info)
+void MatrixIntegrator<dim>::cell(MeshWorker::DoFInfo<dim> &dinfo,
+                                 MeshWorker::IntegrationInfo<dim> &info)
 {
-  const FiniteElement<dim>fe = info.fe_values().get_fe();
-  FullMatrix<double>local_matrix = dinfo.matrix(0).matrix;
-  
+  const FiniteElement<dim> &fe = info.fe_values().get_fe();
+  FullMatrix<double> &local_matrix = dinfo.matrix(0).matrix;
+
   for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
     for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
       {
-       local_matrix(i,j) = 10 * fe.system_to_block_index(i).first
-                           + fe.system_to_block_index(j).first;
+        local_matrix(i,j) = 10 * fe.system_to_block_index(i).first
+                            + fe.system_to_block_index(j).first;
       }
 }
 
 
 template <int dim>
-void MatrixIntegrator<dim>::face(MeshWorker::DoFInfo<dim>dinfo1,
-                                MeshWorker::DoFInfo<dim>& dinfo2,
-                                MeshWorker::IntegrationInfo<dim>& info1,
-                                MeshWorker::IntegrationInfo<dim>& info2)
+void MatrixIntegrator<dim>::face(MeshWorker::DoFInfo<dim> &dinfo1,
+                                 MeshWorker::DoFInfo<dim> &dinfo2,
+                                 MeshWorker::IntegrationInfo<dim> &info1,
+                                 MeshWorker::IntegrationInfo<dim> &info2)
 {
-  const FiniteElement<dim>fe1 = info1.fe_values().get_fe();
-  const FiniteElement<dim>fe2 = info2.fe_values().get_fe();
-  FullMatrix<double>matrix_v1u2 = dinfo1.matrix(0, true).matrix;
-  FullMatrix<double>matrix_v2u1 = dinfo2.matrix(0, true).matrix;
-  
+  const FiniteElement<dim> &fe1 = info1.fe_values().get_fe();
+  const FiniteElement<dim> &fe2 = info2.fe_values().get_fe();
+  FullMatrix<double> &matrix_v1u2 = dinfo1.matrix(0, true).matrix;
+  FullMatrix<double> &matrix_v2u1 = dinfo2.matrix(0, true).matrix;
+
   for (unsigned int i=0; i<fe1.dofs_per_cell; ++i)
     for (unsigned int j=0; j<fe1.dofs_per_cell; ++j)
       {
-       matrix_v1u2(i,j) = 10 * fe1.system_to_block_index(i).first
-                           + fe2.system_to_block_index(j).first;
-       matrix_v2u1(i,j) = 10 * fe2.system_to_block_index(i).first
-                           + fe1.system_to_block_index(j).first;
+        matrix_v1u2(i,j) = 10 * fe1.system_to_block_index(i).first
+                           + fe2.system_to_block_index(j).first;
+        matrix_v2u1(i,j) = 10 * fe2.system_to_block_index(i).first
+                           + fe1.system_to_block_index(j).first;
       }
 }
 
 
 template <int dim>
 void MatrixIntegrator<dim>::block_cell(
-  MeshWorker::DoFInfo<dim>dinfo,
-  MeshWorker::IntegrationInfo<dim>&)
+  MeshWorker::DoFInfo<dim> &dinfo,
+  MeshWorker::IntegrationInfo<dim> &)
 {
-  for (unsigned int m=0;m<dinfo.n_matrices();++m)
+  for (unsigned int m=0; m<dinfo.n_matrices(); ++m)
     {
-      MatrixBlock<FullMatrix<double> >loc = dinfo.matrix(m);
-      
+      MatrixBlock<FullMatrix<double> > &loc = dinfo.matrix(m);
+
       for (unsigned int i=0; i<loc.matrix.m(); ++i)
-       for (unsigned int j=0; j<loc.matrix.n(); ++j)
-         {
-           loc.matrix(i,j) = 10 * loc.row + loc.column;
-         }
+        for (unsigned int j=0; j<loc.matrix.n(); ++j)
+          {
+            loc.matrix(i,j) = 10 * loc.row + loc.column;
+          }
     }
 }
 
 
 template <int dim>
 void MatrixIntegrator<dim>::block_face(
-  MeshWorker::DoFInfo<dim>dinfo1,
-  MeshWorker::DoFInfo<dim>dinfo2,
-  MeshWorker::IntegrationInfo<dim>&,
-  MeshWorker::IntegrationInfo<dim>&)
+  MeshWorker::DoFInfo<dim> &dinfo1,
+  MeshWorker::DoFInfo<dim> &dinfo2,
+  MeshWorker::IntegrationInfo<dim> &,
+  MeshWorker::IntegrationInfo<dim> &)
 {
-  for (unsigned int m=0;m<dinfo1.n_matrices();++m)
+  for (unsigned int m=0; m<dinfo1.n_matrices(); ++m)
     {
-      MatrixBlock<FullMatrix<double> >loc = dinfo1.matrix(m, true);
-      
+      MatrixBlock<FullMatrix<double> > &loc = dinfo1.matrix(m, true);
+
       for (unsigned int i=0; i<loc.matrix.m(); ++i)
-       for (unsigned int j=0; j<loc.matrix.n(); ++j)
-         {
-           loc.matrix(i,j) = 10 * loc.row + loc.column;
-         }
+        for (unsigned int j=0; j<loc.matrix.n(); ++j)
+          {
+            loc.matrix(i,j) = 10 * loc.row + loc.column;
+          }
     }
-  for (unsigned int m=0;m<dinfo2.n_matrices();++m)
+  for (unsigned int m=0; m<dinfo2.n_matrices(); ++m)
     {
-      MatrixBlock<FullMatrix<double> >loc = dinfo2.matrix(m, true);
-      
+      MatrixBlock<FullMatrix<double> > &loc = dinfo2.matrix(m, true);
+
       for (unsigned int i=0; i<loc.matrix.m(); ++i)
-       for (unsigned int j=0; j<loc.matrix.n(); ++j)
-         {
-           loc.matrix(i,j) = 10 * loc.row + loc.column;
-         }
+        for (unsigned int j=0; j<loc.matrix.n(); ++j)
+          {
+            loc.matrix(i,j) = 10 * loc.row + loc.column;
+          }
     }
 }
 
 
 template <int dim>
 void
-assemble(const DoFHandler<dim>& dof_handler, SparseMatrix<double>& matrix)
+assemble(const DoFHandler<dim> &dof_handler, SparseMatrix<double> &matrix)
 {
-  const FiniteElement<dim>fe = dof_handler.get_fe();
-  MappingQ1<dim> mapping;  
-  
+  const FiniteElement<dim> &fe = dof_handler.get_fe();
+  MappingQ1<dim> mapping;
+
   MeshWorker::IntegrationInfoBox<dim> info_box;
   const unsigned int n_gauss_points = dof_handler.get_fe().tensor_degree()+1;
   info_box.initialize_gauss_quadrature(n_gauss_points, n_gauss_points, n_gauss_points);
@@ -158,34 +158,34 @@ assemble(const DoFHandler<dim>& dof_handler, SparseMatrix<double>& matrix)
   UpdateFlags update_flags = update_values | update_gradients;
   info_box.add_update_flags(update_flags, true, true, true, true);
   info_box.initialize(fe, mapping);
-  
+
   MeshWorker::DoFInfo<dim> dof_info(dof_handler);
-  
+
   MeshWorker::Assembler::MatrixSimple<SparseMatrix<double> > assembler;
   assembler.initialize(matrix);
-  
+
   MeshWorker::loop<dim, dim, MeshWorker::DoFInfo<dim>, MeshWorker::IntegrationInfoBox<dim> >
-    (dof_handler.begin_active(),
-     dof_handler.end(),
-     dof_info,
-     info_box,
-     &MatrixIntegrator<dim>::cell,
-     0,
-     &MatrixIntegrator<dim>::face,
-     assembler);
+  (dof_handler.begin_active(),
+   dof_handler.end(),
+   dof_info,
+   info_box,
+   &MatrixIntegrator<dim>::cell,
+   0,
+   &MatrixIntegrator<dim>::face,
+   assembler);
 }
 
 
 template <int dim>
 void
-assemble(const MGDoFHandler<dim>dof_handler,
-        MGLevelObject<SparseMatrix<double> > matrix,
-        MGLevelObject<SparseMatrix<double> > dg_up,
-        MGLevelObject<SparseMatrix<double> > dg_down)
+assemble(const MGDoFHandler<dim> &dof_handler,
+         MGLevelObject<SparseMatrix<double> > matrix,
+         MGLevelObject<SparseMatrix<double> > dg_up,
+         MGLevelObject<SparseMatrix<double> > dg_down)
 {
-  const FiniteElement<dim>fe = dof_handler.get_fe();
+  const FiniteElement<dim> &fe = dof_handler.get_fe();
   MappingQ1<dim> mapping;
-  
+
   MeshWorker::IntegrationInfoBox<dim> info_box;
   const unsigned int n_gauss_points = dof_handler.get_fe().tensor_degree()+1;
   info_box.initialize_gauss_quadrature(n_gauss_points, n_gauss_points, n_gauss_points);
@@ -193,41 +193,41 @@ assemble(const MGDoFHandler<dim>& dof_handler,
   UpdateFlags update_flags = update_values | update_gradients;
   info_box.add_update_flags(update_flags, true, true, true, true);
   info_box.initialize(fe, mapping);
-  
+
   MeshWorker::DoFInfo<dim> dof_info(dof_handler);
-  
+
   MeshWorker::Assembler::MGMatrixSimple<SparseMatrix<double> > assembler;
   assembler.initialize(matrix);
-  
+
   MeshWorker::loop<MeshWorker::DoFInfo<dim>, MeshWorker::IntegrationInfoBox<dim> >
-    (dof_handler.begin(),
-     dof_handler.end(),
-     dof_info,
-     info_box,
-     &MatrixIntegrator<dim>::cell,
-     &MatrixIntegrator<dim>::bdry,
-     &MatrixIntegrator<dim>::face,
-     assembler);
+  (dof_handler.begin(),
+   dof_handler.end(),
+   dof_info,
+   info_box,
+   &MatrixIntegrator<dim>::cell,
+   &MatrixIntegrator<dim>::bdry,
+   &MatrixIntegrator<dim>::face,
+   assembler);
 }
 
 
 template <int dim>
 void
-test_simple(MGDoFHandler<dim>mgdofs)
+test_simple(MGDoFHandler<dim> &mgdofs)
 {
   SparsityPattern pattern;
   SparseMatrix<double> matrix;
   Vector<double> v;
 
-  const DoFHandler<dim>dofs = mgdofs;
-  const FiniteElement<dim>fe = dofs.get_fe();
+  const DoFHandler<dim> &dofs = mgdofs;
+  const FiniteElement<dim> &fe = dofs.get_fe();
   pattern.reinit (dofs.n_dofs(), dofs.n_dofs(),
-                 (GeometryInfo<dim>::faces_per_cell
-                  *GeometryInfo<dim>::max_children_per_face+1)*fe.dofs_per_cell);
+                  (GeometryInfo<dim>::faces_per_cell
+                   *GeometryInfo<dim>::max_children_per_face+1)*fe.dofs_per_cell);
   DoFTools::make_flux_sparsity_pattern (dofs, pattern);
   pattern.compress();
   matrix.reinit (pattern);
-  
+
   assemble(dofs, matrix);
   deallog << std::setprecision(3);
   matrix.print_formatted(deallog.get_file_stream(),0,false,4);
@@ -239,41 +239,41 @@ test_simple(MGDoFHandler<dim>& mgdofs)
   MGLevelObject<SparseMatrix<double> > mg_matrix_dg_down;
 
   const unsigned int n_levels = mgdofs.get_tria().n_levels();
-  
+
   mg_sparsity.resize(0, n_levels-1);
   mg_sparsity_dg_interface.resize(0, n_levels-1);
   mg_matrix.resize(0, n_levels-1);
   mg_matrix_dg_up.resize(0, n_levels-1);
   mg_matrix_dg_down.resize(0, n_levels-1);
-  
+
   for (unsigned int level=mg_sparsity.min_level();
-       level<=mg_sparsity.max_level();++level)
+       level<=mg_sparsity.max_level(); ++level)
     {
       CompressedSparsityPattern c_sparsity(mgdofs.n_dofs(level));
       CompressedSparsityPattern ci_sparsity;
       if (level>0)
-       ci_sparsity.reinit(mgdofs.n_dofs(level-1), mgdofs.n_dofs(level));
-      
+        ci_sparsity.reinit(mgdofs.n_dofs(level-1), mgdofs.n_dofs(level));
+
       MGTools::make_flux_sparsity_pattern(mgdofs, c_sparsity, level);
       if (level>0)
-       MGTools::make_flux_sparsity_pattern_edge(mgdofs, ci_sparsity, level);
-      
+        MGTools::make_flux_sparsity_pattern_edge(mgdofs, ci_sparsity, level);
+
       mg_sparsity[level].copy_from(c_sparsity);
       mg_matrix[level].reinit(mg_sparsity[level]);
       if (level>0)
-       {
-         mg_sparsity_dg_interface[level].copy_from(ci_sparsity);
-         mg_matrix_dg_up[level].reinit(mg_sparsity_dg_interface[level]);
-         mg_matrix_dg_down[level].reinit(mg_sparsity_dg_interface[level]);
-       }
+        {
+          mg_sparsity_dg_interface[level].copy_from(ci_sparsity);
+          mg_matrix_dg_up[level].reinit(mg_sparsity_dg_interface[level]);
+          mg_matrix_dg_down[level].reinit(mg_sparsity_dg_interface[level]);
+        }
     }
-  
+
 }
 
 
 template<int dim>
 void
-test(const FiniteElement<dim>fe)
+test(const FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
   Triangulation<dim> tr;
@@ -284,10 +284,10 @@ test(const FiniteElement<dim>& fe)
 //  tr.execute_coarsening_and_refinement();
 //  tr.refine_global(1);
   deallog << "Triangulation levels";
-  for (unsigned int l=0;l<tr.n_levels();++l)
+  for (unsigned int l=0; l<tr.n_levels(); ++l)
     deallog << ' ' << l << ':' << tr.n_cells(l);
   deallog << std::endl;
-  
+
   unsigned int cn = 0;
   for (typename Triangulation<dim>::cell_iterator cell = tr.begin();
        cell != tr.end(); ++cell, ++cn)
@@ -296,10 +296,10 @@ test(const FiniteElement<dim>& fe)
   MGDoFHandler<dim> dofs(tr);
   dofs.distribute_dofs(fe);
   deallog << "DoFHandler " << dofs.n_dofs() << " levels";
-  for (unsigned int l=0;l<tr.n_levels();++l)
+  for (unsigned int l=0; l<tr.n_levels(); ++l)
     deallog << ' ' << l << ':' << dofs.n_dofs(l);
   deallog << std::endl;
-  
+
   test_simple(dofs);
 }
 
@@ -310,11 +310,11 @@ int main ()
   std::ofstream logfile(logname.c_str());
   deallog.attach(logfile);
   deallog.depth_console (0);
-  
+
   FE_DGP<2> dgp0(0);
   FE_DGP<2> dgp1(1);
   FE_Q<2> q1(1);
-  
+
   std::vector<std_cxx1x::shared_ptr<FiniteElement<2> > > fe2;
   fe2.push_back(std_cxx1x::shared_ptr<FiniteElement<2> >(new FE_DGP<2>(0)));
   fe2.push_back(std_cxx1x::shared_ptr<FiniteElement<2> >(new FESystem<2>(dgp0,3)));
@@ -322,7 +322,7 @@ int main ()
   fe2.push_back(std_cxx1x::shared_ptr<FiniteElement<2> >(new FESystem<2>(q1,2)));
   fe2.push_back(std_cxx1x::shared_ptr<FiniteElement<2> >(new FESystem<2>(dgp0,1,q1,1)));
 //  fe2.push_back(std_cxx1x::shared_ptr<FiniteElement<2> >(new  FE_Q<2>(1)));
-  
-  for (unsigned int i=0;i<fe2.size();++i)
+
+  for (unsigned int i=0; i<fe2.size(); ++i)
     test(*fe2[i]);
 }
index 7f9eeb50d0de7d8a618011664a0d6de217d1d7a3..4e5734fee477f1c8025f1b3905242435a01d9d87 100644 (file)
@@ -51,42 +51,42 @@ using namespace dealii;
 
 namespace Advection
 {
-using namespace dealii;
-
-/********************************************
- * ADVECTION PROBLEM
- ********************************************/
-template <int dim>
-class AdvectionProblem
-{
-public:
+  using namespace dealii;
+
+  /********************************************
  * ADVECTION PROBLEM
  ********************************************/
+  template <int dim>
+  class AdvectionProblem
+  {
+  public:
     AdvectionProblem ();
     ~AdvectionProblem ();
     void run ();
 
-private:
+  private:
 
     const MappingQ1<dim> mapping;
 
     void setup_system ();
 
-    void integrate_cell_term (MeshWorker::DoFInfo<dim>dinfo,
-                              MeshWorker::IntegrationInfo<dim>info);
+    void integrate_cell_term (MeshWorker::DoFInfo<dim> &dinfo,
+                              MeshWorker::IntegrationInfo<dim> &info);
 
-    void integrate_boundary_term (MeshWorker::DoFInfo<dim>dinfo,
-                                  MeshWorker::IntegrationInfo<dim>info);
+    void integrate_boundary_term (MeshWorker::DoFInfo<dim> &dinfo,
+                                  MeshWorker::IntegrationInfo<dim> &info);
 
-    void integrate_face_term (MeshWorker::DoFInfo<dim>dinfo1,
-                              MeshWorker::DoFInfo<dim>dinfo2,
-                              MeshWorker::IntegrationInfo<dim>info1,
-                              MeshWorker::IntegrationInfo<dim>info2);
+    void integrate_face_term (MeshWorker::DoFInfo<dim> &dinfo1,
+                              MeshWorker::DoFInfo<dim> &dinfo2,
+                              MeshWorker::IntegrationInfo<dim> &info1,
+                              MeshWorker::IntegrationInfo<dim> &info2);
 
     void output_results (int timestep) const;
 
     void create_grid ();
 
-    void assemble_rhs (Vector<double>solution,
-                       Vector<double>residual);
+    void assemble_rhs (Vector<double> &solution,
+                       Vector<double> &residual);
 
     // For problems with non-diagonal mass matrices
 //    void assemble_mass_matrix_and_multiply (Vector<double>& solution,
@@ -95,7 +95,7 @@ private:
     const double wavespeed;
 
 
-        // DATA:
+    // DATA:
     Triangulation<dim>   triangulation;
     DoFHandler<dim>      dof_handler;
 
@@ -104,38 +104,38 @@ private:
     Vector<double>       solution, stage;
 
     const FEValuesExtractors::Scalar upos;
-};
+  };
 
 
-template <int dim>
-AdvectionProblem<dim>::AdvectionProblem ()
-:
+  template <int dim>
+  AdvectionProblem<dim>::AdvectionProblem ()
+    :
     mapping(),
     wavespeed(1.0),
     dof_handler (triangulation),
     fe (FE_DGQ<dim>(0), 1),// p=0, and solving for a scalar
     upos(0)
-{}
+  {}
 
-template <int dim>
-AdvectionProblem<dim>::~AdvectionProblem ()
-{
+  template <int dim>
+  AdvectionProblem<dim>::~AdvectionProblem ()
+  {
     dof_handler.clear ();
-}
+  }
 
 
-template < >
-void AdvectionProblem<1>::create_grid()
-{
+  template < >
+  void AdvectionProblem<1>::create_grid()
+  {
     double ll_x=0.;
     double ur_x=1.;
 
     int n_cells_x = 10;
 
     const Point<1> LowerLeft (ll_x),
-                    UpperRight (ur_x);
+          UpperRight (ur_x);
 
-        // Define the subdivisions in the x1 and x2 coordinates.
+    // Define the subdivisions in the x1 and x2 coordinates.
     std::vector<unsigned int> subdivisions(1);
     subdivisions[0] =   n_cells_x;
 
@@ -145,11 +145,11 @@ void AdvectionProblem<1>::create_grid()
                                               UpperRight,
                                               true);
 
-}//create_grid()
+  }//create_grid()
 
-template < >
-void AdvectionProblem<2>::create_grid()
-{
+  template < >
+  void AdvectionProblem<2>::create_grid()
+  {
     // dim==1 implemented:
     double ll_x=0., ll_y=0.;
     double ur_x=1., ur_y=0.01;
@@ -158,7 +158,7 @@ void AdvectionProblem<2>::create_grid()
     int n_cells_y = 1;
 
     const Point<2> LowerLeft (ll_x, ll_y),
-    UpperRight (ur_x, ur_y );
+          UpperRight (ur_x, ur_y );
 
     // Define the subdivisions in the x1 and x2 coordinates.
     std::vector<unsigned int> subdivisions(2);
@@ -171,11 +171,11 @@ void AdvectionProblem<2>::create_grid()
                                               UpperRight,
                                               true);
 
-}//create_grid()
+  }//create_grid()
 
-template <>
-void AdvectionProblem<3>::create_grid()
-{
+  template <>
+  void AdvectionProblem<3>::create_grid()
+  {
     double ll_x=0., ll_y=0., ll_z=0.;
     double ur_x=1., ur_y=0.01, ur_z=0.01;
 
@@ -184,7 +184,7 @@ void AdvectionProblem<3>::create_grid()
     int n_cells_z = 1;
 
     const Point<3> LowerLeft (ll_x, ll_y, ll_z),
-            UpperRight (ur_x, ur_y, ur_z);
+          UpperRight (ur_x, ur_y, ur_z);
 
     // Define the subdivisions in the x1 and x2 coordinates.
     std::vector<unsigned int> subdivisions(3);
@@ -198,24 +198,24 @@ void AdvectionProblem<3>::create_grid()
                                               UpperRight,
                                               true);
 
-}//create_grid()
+  }//create_grid()
 
-template <int dim>
-void AdvectionProblem<dim>::setup_system ()
-{
+  template <int dim>
+  void AdvectionProblem<dim>::setup_system ()
+  {
     dof_handler.distribute_dofs (fe);
     solution.reinit(dof_handler.n_dofs());
     stage.reinit(dof_handler.n_dofs());
 
     solution = 0.0;
     stage = 0.0;
-}//setup_system
+  }//setup_system
 
 
-template <int dim>
-void AdvectionProblem<dim>::assemble_rhs (Vector<double> &solution,
-                                          Vector<double>& residual)
-{
+  template <int dim>
+  void AdvectionProblem<dim>::assemble_rhs (Vector<double> &solution,
+                                            Vector<double> &residual)
+  {
     const unsigned int n_gauss_points = std::ceil(((2.0*fe.degree) +1)/2);
 
     MeshWorker::IntegrationInfoBox<dim> info_box;
@@ -226,14 +226,14 @@ void AdvectionProblem<dim>::assemble_rhs (Vector<double> &solution,
 
     info_box.initialize_update_flags();
     UpdateFlags update_flags = update_quadrature_points |
-                                update_values |
-                                update_gradients;
+                               update_values |
+                               update_gradients;
 
     info_box.add_update_flags(update_flags, true, true, true, true);
 
     NamedData<Vector<double>* > solution_data;
 
-    Vector<double>u = &solution;
+    Vector<double> *u = &solution;
 
     solution_data.add(u, "solution");
     info_box.cell_selector.add("solution", true, true, false);
@@ -248,7 +248,7 @@ void AdvectionProblem<dim>::assemble_rhs (Vector<double> &solution,
 
     MeshWorker::Assembler::ResidualSimple<Vector<double> > assembler;
     NamedData<Vector<double>* > data;
-    Vector<double>rhs = &residual;
+    Vector<double> *rhs = &residual;
     data.add(rhs, "Residual");
     assembler.initialize(data);
 
@@ -263,15 +263,15 @@ void AdvectionProblem<dim>::assemble_rhs (Vector<double> &solution,
                      this, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3, std_cxx1x::_4),
      assembler, true);
 
-}//assemble_system
+  }//assemble_system
 
-template <int dim>
-void AdvectionProblem<dim>::integrate_cell_term (MeshWorker::DoFInfo<dim>& dinfo,
-                                                 MeshWorker::IntegrationInfo<dim>& info)
-{
-    const FEValuesBase<dim>fe_v = info.fe_values();
+  template <int dim>
+  void AdvectionProblem<dim>::integrate_cell_term (MeshWorker::DoFInfo<dim> &dinfo,
+                                                   MeshWorker::IntegrationInfo<dim> &info)
+  {
+    const FEValuesBase<dim> &fe_v = info.fe_values();
 
-    Vector<double>cell_rhs = dinfo.vector(0).block(0);
+    Vector<double> &cell_rhs = dinfo.vector(0).block(0);
 
     const unsigned int   dofs_per_cell = fe_v.dofs_per_cell;
     const unsigned int   n_q_points    = fe_v.n_quadrature_points;
@@ -283,63 +283,68 @@ void AdvectionProblem<dim>::integrate_cell_term (MeshWorker::DoFInfo<dim>& dinfo
 
     std::vector<double> u(values[0]);
 
-    for (unsigned int q_point=0; q_point<n_q_points; ++q_point){
-        for (unsigned int i=0; i<dofs_per_cell; ++i){
+    for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+      {
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
 
             cell_rhs(i) -= wavespeed*(u[q_point]*fe_v[upos].gradient(i,q_point)[0])*fe_v.JxW(q_point);
 
-            for (unsigned int j=0; j<dofs_per_cell; ++j){
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              {
                 cell_matrix(i,j) += fe_v[upos].value(i,q_point) *
-                fe_v[upos].value(j,q_point) *
-                fe_v.JxW(q_point);
-            }
-        }//i
-    }//q_point
-
-}//integrate_cell_term
-
-template <int dim>
-void AdvectionProblem<dim>::integrate_boundary_term (MeshWorker::DoFInfo<dim>& dinfo,
-                                                     MeshWorker::IntegrationInfo<dim>& info)
-{
+                                    fe_v[upos].value(j,q_point) *
+                                    fe_v.JxW(q_point);
+              }
+          }//i
+      }//q_point
+
+  }//integrate_cell_term
+
+  template <int dim>
+  void AdvectionProblem<dim>::integrate_boundary_term (MeshWorker::DoFInfo<dim> &dinfo,
+                                                       MeshWorker::IntegrationInfo<dim> &info)
+  {
     const unsigned int boundary_id = dinfo.face->boundary_indicator();
 
     // We only have a non-zero boundary contribution at the
     // x=0 boundary
-    if(boundary_id != 0)
-        return;
+    if (boundary_id != 0)
+      return;
 
-    const FEValuesBase<dim>fe_v = info.fe_values();
+    const FEValuesBase<dim> &fe_v = info.fe_values();
 
-    Vector<double>cell_rhs = dinfo.vector(0).block(0);
+    Vector<double> &cell_rhs = dinfo.vector(0).block(0);
 
     const unsigned int   dofs_per_cell = fe_v.dofs_per_cell;
     const unsigned int   n_q_points    = fe_v.n_quadrature_points;
 
     double boundary_flux = -1.0;
 
-    for (unsigned int q_point=0; q_point<n_q_points; ++q_point){
-        for (unsigned int i=0; i<dofs_per_cell; ++i){
+    for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+      {
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
 
             cell_rhs(i) += wavespeed*boundary_flux*
                            fe_v[upos].value(i,q_point)*fe_v.JxW(q_point);
 
-        }//i
-    }//q_point
+          }//i
+      }//q_point
 
-}//integrate_boundary_term
+  }//integrate_boundary_term
 
-template <int dim>
-void AdvectionProblem<dim>::integrate_face_term (MeshWorker::DoFInfo<dim>& dinfo1,
-                                                     MeshWorker::DoFInfo<dim>& dinfo2,
-                                                     MeshWorker::IntegrationInfo<dim>& info1,
-                                                     MeshWorker::IntegrationInfo<dim>& info2)
-{
-    const FEValuesBase<dim>fe_v_1 = info1.fe_values();
-    const FEValuesBase<dim>fe_v_2 = info2.fe_values();
+  template <int dim>
+  void AdvectionProblem<dim>::integrate_face_term (MeshWorker::DoFInfo<dim> &dinfo1,
+                                                   MeshWorker::DoFInfo<dim> &dinfo2,
+                                                   MeshWorker::IntegrationInfo<dim> &info1,
+                                                   MeshWorker::IntegrationInfo<dim> &info2)
+  {
+    const FEValuesBase<dim> &fe_v_1 = info1.fe_values();
+    const FEValuesBase<dim> &fe_v_2 = info2.fe_values();
 
-    Vector<double>cell_vector_1 = dinfo1.vector(0).block(0);
-    Vector<double>cell_vector_2 = dinfo2.vector(0).block(0);
+    Vector<double> &cell_vector_1 = dinfo1.vector(0).block(0);
+    Vector<double> &cell_vector_2 = dinfo2.vector(0).block(0);
 
     const unsigned int   dofs_per_cell = fe_v_1.dofs_per_cell;
     const unsigned int   n_q_points    = fe_v_1.n_quadrature_points;
@@ -349,28 +354,30 @@ void AdvectionProblem<dim>::integrate_face_term (MeshWorker::DoFInfo<dim>& dinfo
 
     double flux;
 
-    for (unsigned int q_point=0; q_point<n_q_points; ++q_point){
+    for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+      {
 
         if (fe_v_1.normal_vector(q_point)[0]>0)
-            flux = u_1[q_point]*fe_v_1.normal_vector(q_point)[0];
+          flux = u_1[q_point]*fe_v_1.normal_vector(q_point)[0];
         else
-            flux = u_2[q_point]*fe_v_1.normal_vector(q_point)[0];
+          flux = u_2[q_point]*fe_v_1.normal_vector(q_point)[0];
 
-        for (unsigned int i=0; i<dofs_per_cell; ++i){
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
 
             cell_vector_1(i) += wavespeed*flux*fe_v_1[upos].value(i,q_point)*fe_v_1.JxW(q_point);
 
             cell_vector_2(i) -= wavespeed*flux*fe_v_2[upos].value(i,q_point)*fe_v_1.JxW(q_point);
 
-        }//i
-    }//q_point
+          }//i
+      }//q_point
 
-}//integrate_face_term
+  }//integrate_face_term
 
 
-template <int dim>
-void AdvectionProblem<dim>::output_results (int timestep) const
-{
+  template <int dim>
+  void AdvectionProblem<dim>::output_results (int timestep) const
+  {
     DataOut<dim> data_out;
     data_out.attach_dof_handler (dof_handler);
 
@@ -387,16 +394,16 @@ void AdvectionProblem<dim>::output_results (int timestep) const
     data_out.build_patches (fe.degree);
     data_out.write_gnuplot (deallog.get_file_stream());
 
-}//output_results
+  }//output_results
 
 
-template <int dim>
-void AdvectionProblem<dim>::run ()
-{
-        // Make the mesh
+  template <int dim>
+  void AdvectionProblem<dim>::run ()
+  {
+    // Make the mesh
     create_grid();
 
-        // Setup the system
+    // Setup the system
     setup_system();
 
     deallog << "\tNumber of active cells:       "
@@ -410,7 +417,8 @@ void AdvectionProblem<dim>::run ()
 
     double inv_cell_vol = 1.0/std::pow(0.01, dim);
 
-    for (unsigned int dt=0; dt<n_dt; ++dt){
+    for (unsigned int dt=0; dt<n_dt; ++dt)
+      {
 
         assemble_rhs(solution, stage);
 
@@ -418,11 +426,11 @@ void AdvectionProblem<dim>::run ()
         stage *= inv_cell_vol;
         solution -= stage;
         stage = 0.0;
-    }
+      }
 
     output_results (n_dt);
 
-}//AdvectionProblem::run()
+  }//AdvectionProblem::run()
 
 }//namespace
 
index ea716a96aa3099ef961b8ecc314631e5c47ff843..2ed4bb5dad9f5683f1c48ea6965c7ebae49c3861 100644 (file)
@@ -44,121 +44,121 @@ using namespace dealii;
 template <int dim>
 class Local : public Subscriptor
 {
-  public:
-    typedef MeshWorker::IntegrationInfo<dim> CellInfo;
-    
-    void cell(MeshWorker::DoFInfo<dim>& dinfo, CellInfo& info) const;
-    void bdry(MeshWorker::DoFInfo<dim>& dinfo, CellInfo& info) const;
-    void face(MeshWorker::DoFInfo<dim>& dinfo1, MeshWorker::DoFInfo<dim>& dinfo2,
-             CellInfo& info1, CellInfo& info2) const;
-
-    bool cells;
-    bool faces;
+public:
+  typedef MeshWorker::IntegrationInfo<dim> CellInfo;
+
+  void cell(MeshWorker::DoFInfo<dim> &dinfo, CellInfo &info) const;
+  void bdry(MeshWorker::DoFInfo<dim> &dinfo, CellInfo &info) const;
+  void face(MeshWorker::DoFInfo<dim> &dinfo1, MeshWorker::DoFInfo<dim> &dinfo2,
+            CellInfo &info1, CellInfo &info2) const;
+
+  bool cells;
+  bool faces;
 };
 
 template <int dim>
 void
-Local<dim>::cell(MeshWorker::DoFInfo<dim>& info, CellInfo&) const
+Local<dim>::cell(MeshWorker::DoFInfo<dim> &info, CellInfo &) const
 {
   if (!cells) return;
-  for (unsigned int k=0;k<info.n_matrices();++k)
+  for (unsigned int k=0; k<info.n_matrices(); ++k)
     {
       const unsigned int block_row = info.matrix(k).row;
       const unsigned int block_col = info.matrix(k).column;
-      FullMatrix<double>M1 = info.matrix(k).matrix;
+      FullMatrix<double> &M1 = info.matrix(k).matrix;
       if (block_row == block_col)
-       for (unsigned int i=0;i<M1.m();++i)
-         for (unsigned int j=0;j<M1.n();++j)
-           {
-             M1(i,j) = 10.;
-           }
+        for (unsigned int i=0; i<M1.m(); ++i)
+          for (unsigned int j=0; j<M1.n(); ++j)
+            {
+              M1(i,j) = 10.;
+            }
     }
 }
 
 
 template <int dim>
 void
-Local<dim>::bdry(MeshWorker::DoFInfo<dim>& info, CellInfo&) const
+Local<dim>::bdry(MeshWorker::DoFInfo<dim> &info, CellInfo &) const
 {
   if (!faces) return;
-  for (unsigned int k=0;k<info.n_matrices();++k)
+  for (unsigned int k=0; k<info.n_matrices(); ++k)
     {
       const unsigned int block_row = info.matrix(k).row;
       const unsigned int block_col = info.matrix(k).column;
-      FullMatrix<double>M1 = info.matrix(k).matrix;
+      FullMatrix<double> &M1 = info.matrix(k).matrix;
       if (block_row == block_col)
-       for (unsigned int i=0;i<M1.m();++i)
-         for (unsigned int j=0;j<M1.n();++j)
-           {
-             M1(i,j) = 1.;
-           }
+        for (unsigned int i=0; i<M1.m(); ++i)
+          for (unsigned int j=0; j<M1.n(); ++j)
+            {
+              M1(i,j) = 1.;
+            }
     }
 }
 
 
 template <int dim>
 void
-Local<dim>::face(MeshWorker::DoFInfo<dim>& info1, MeshWorker::DoFInfo<dim>& info2,
-                CellInfo&, CellInfo&) const
+Local<dim>::face(MeshWorker::DoFInfo<dim> &info1, MeshWorker::DoFInfo<dim> &info2,
+                 CellInfo &, CellInfo &) const
 {
   if (!faces) return;
-  for (unsigned int k=0;k<info1.n_matrices();++k)
+  for (unsigned int k=0; k<info1.n_matrices(); ++k)
     {
       const unsigned int block_row = info1.matrix(k).row;
       const unsigned int block_col = info1.matrix(k).column;
-      FullMatrix<double>M1 = info1.matrix(k).matrix;
+      FullMatrix<double> &M1 = info1.matrix(k).matrix;
       if (block_row == block_col)
-       for (unsigned int i=0;i<M1.m();++i)
-         for (unsigned int j=0;j<M1.n();++j)
-           {
-             info1.matrix(k,false).matrix(i,j) = 1.;
-             info2.matrix(k,false).matrix(i,j) = 1.;
-             info1.matrix(k,true).matrix(i,j) = -1.;
-             info2.matrix(k,true).matrix(i,j) = -1.;
-           }
+        for (unsigned int i=0; i<M1.m(); ++i)
+          for (unsigned int j=0; j<M1.n(); ++j)
+            {
+              info1.matrix(k,false).matrix(i,j) = 1.;
+              info2.matrix(k,false).matrix(i,j) = 1.;
+              info1.matrix(k,true).matrix(i,j) = -1.;
+              info2.matrix(k,true).matrix(i,j) = -1.;
+            }
     }
 }
 
 
 template <int dim>
 void
-test_simple(DoFHandler<dim>dofs, bool faces)
+test_simple(DoFHandler<dim> &dofs, bool faces)
 {
   SparsityPattern pattern;
   SparseMatrix<double> matrix;
 
-  const FiniteElement<dim>fe = dofs.get_fe();
+  const FiniteElement<dim> &fe = dofs.get_fe();
   pattern.reinit (dofs.n_dofs(), dofs.n_dofs(),
-                 (GeometryInfo<dim>::faces_per_cell
-                  *GeometryInfo<dim>::max_children_per_face+1)*fe.dofs_per_cell);
+                  (GeometryInfo<dim>::faces_per_cell
+                   *GeometryInfo<dim>::max_children_per_face+1)*fe.dofs_per_cell);
   DoFTools::make_flux_sparsity_pattern (dofs, pattern);
   pattern.compress();
   matrix.reinit (pattern);
-  
+
   Local<dim> local;
   local.cells = true;
   local.faces = faces;
 
   MappingQ1<dim> mapping;
-  
+
   MeshWorker::IntegrationInfoBox<dim> info_box;
   info_box.initialize_gauss_quadrature(1, 1, 1);
   info_box.initialize_update_flags();
   info_box.initialize(fe, mapping);
-  
+
   MeshWorker::DoFInfo<dim> dof_info(dofs.block_info());
-  
+
   MeshWorker::Assembler::MatrixSimple<SparseMatrix<double> > assembler;
   assembler.initialize(matrix);
-  
+
   MeshWorker::loop<dim, dim, MeshWorker::DoFInfo<dim>, MeshWorker::IntegrationInfoBox<dim> >
-    (dofs.begin_active(), dofs.end(),
-     dof_info, info_box,
-     std_cxx1x::bind (&Local<dim>::cell, local, std_cxx1x::_1, std_cxx1x::_2),
-     std_cxx1x::bind (&Local<dim>::bdry, local, std_cxx1x::_1, std_cxx1x::_2),
-     std_cxx1x::bind (&Local<dim>::face, local, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3, std_cxx1x::_4),
-     assembler, true);
-  
+  (dofs.begin_active(), dofs.end(),
+   dof_info, info_box,
+   std_cxx1x::bind (&Local<dim>::cell, local, std_cxx1x::_1, std_cxx1x::_2),
+   std_cxx1x::bind (&Local<dim>::bdry, local, std_cxx1x::_1, std_cxx1x::_2),
+   std_cxx1x::bind (&Local<dim>::face, local, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3, std_cxx1x::_4),
+   assembler, true);
+
   //matrix.print_formatted(deallog.get_file_stream(), 0, false, 4);
   matrix.print(deallog.get_file_stream(), false, false);
 }
@@ -166,7 +166,7 @@ test_simple(DoFHandler<dim>& dofs, bool faces)
 
 template<int dim>
 void
-test(const FiniteElement<dim>fe)
+test(const FiniteElement<dim> &fe)
 {
   Triangulation<dim> tr;
   GridGenerator::hyper_cube(tr);
@@ -177,7 +177,7 @@ test(const FiniteElement<dim>& fe)
   // tr.execute_coarsening_and_refinement();
 //  tr.refine_global(1);
   deallog << "Triangulation levels";
-  for (unsigned int l=0;l<tr.n_levels();++l)
+  for (unsigned int l=0; l<tr.n_levels(); ++l)
     deallog << ' ' << l << ':' << tr.n_cells(l);
   deallog << std::endl;
 
@@ -203,7 +203,7 @@ int main ()
   std::ofstream logfile(logname.c_str());
   deallog.attach(logfile);
   deallog.depth_console (0);
-  
+
   FE_DGP<2> p0(0);
   FE_Q<2>   q1(1);
   FESystem<2,2> sys1(p0,1,q1,1);
@@ -211,7 +211,7 @@ int main ()
   fe2.push_back(&p0);
   fe2.push_back(&q1);
   fe2.push_back(&sys1);
-  
-  for (unsigned int i=0;i<fe2.size();++i)
+
+  for (unsigned int i=0; i<fe2.size(); ++i)
     test(*fe2[i]);
 }
index a6ae8160b4c8d97963426e171a0305022268ee49..6b6f974199dba695145bd73b6d45efacb825316c 100644 (file)
@@ -18,7 +18,7 @@
 
 // test contructing vectors
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/generic_linear_algebra.h>
 #include <fstream>
@@ -31,18 +31,18 @@ void test ()
   x(0)=10;
   deallog << x.l2_norm() << std::endl;
   x.compress();
-  
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("ala_01/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -51,31 +51,31 @@ int main (int argc,char **argv)
       {
         test<dealii::LinearAlgebraPETSc::Vector> ();
         test<dealii::LinearAlgebraDealII::Vector> ();
-       test<dealii::LinearAlgebraTrilinos::Vector> ();
+        test<dealii::LinearAlgebraTrilinos::Vector> ();
       }
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 586b1c6ccbe9906860bdcb872377054891945d0b..905937d68cb4d73a9b564a7a6c6809ec5d70e1da 100644 (file)
@@ -40,7 +40,7 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   GrowingVectorMemory<> mem;
   SolverControl control(100, 1.e-3);
   SolverBicgstab<> bicgstab(control, mem);
@@ -50,7 +50,7 @@ int main()
     for (unsigned int j=0; j<4; ++j)
       sparsity_pattern.add(i,j);
   sparsity_pattern.compress();
-  
+
   SparseMatrix<double> M(sparsity_pattern);
   M.set(0,0,21.1);
   M.set(0,1,0);
@@ -78,10 +78,10 @@ int main()
   ilu.decompose (M);
 
   Vector<double> solution (4);
-                                  // this would fail with elements of
-                                  // the solution vector being set to
-                                  // NaN before Roger's suggested
-                                  // change
+  // this would fail with elements of
+  // the solution vector being set to
+  // NaN before Roger's suggested
+  // change
   bicgstab.solve (M, solution, rhs, ilu);
 
   for (unsigned int i=0; i<4; ++i)
@@ -90,6 +90,6 @@ int main()
   Vector<double> res (4);
   M.residual (res, solution, rhs);
   deallog << "residual=" << res.l2_norm()
-         << std::endl;
+          << std::endl;
 }
 
index af44aadc979d121022d6bfc33fe787b387316dfc..81465e6413d7916840182bafb750a10f7790edd2 100644 (file)
@@ -37,10 +37,10 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   SparsityPattern sparsity_pattern(4,4);
   sparsity_pattern.compress();
-  
+
   SparseMatrix<double> M(sparsity_pattern);
   M.diag_element(0) = 1;
   M.diag_element(1) = 10;
@@ -63,7 +63,7 @@ int main()
   Vector<double> res (4);
   M.residual (res, solution, rhs);
   deallog << "residual=" << res.l2_norm()
-         << std::endl;
+          << std::endl;
 
   // now set up the same problem but with matrix entries scaled by 1e10 and
   // solver tolerance scaled by 1e10. should get the same solution
@@ -80,6 +80,6 @@ int main()
   solution.print(deallog);
   M1.residual (res, solution, rhs);
   deallog << "residual=" << res.l2_norm()
-         << std::endl;
+          << std::endl;
 }
 
index b7c5c2d9aee2dcdeeccc0cf69d36caad27a794ce..9b42a42f3fb2e66b1fbee0857537ddd46ca0aa0d 100644 (file)
@@ -41,28 +41,28 @@ int main()
   csp.block(0,1).reinit(2,1);
   csp.block(1,1).reinit(1,1);
   csp.collect_sizes();
-  for (int i=0;i<3;++i)
+  for (int i=0; i<3; ++i)
     csp.add(i,i);
   csp.add(1,0);
   csp.add(1,2);
   csp.compress();
-  
+
   deallog << "blocks: " << csp.n_block_rows() << "x" << csp.n_block_cols() << std::endl;
   deallog << "size: " << csp.n_rows() << "x" << csp.n_cols() << std::endl;
   deallog << "size block(1,0):" << csp.block(1,0).n_rows() << "x" << csp.block(1,0).n_cols() << std::endl;
-  
+
   csp.print(logfile);
 
   deallog << std::endl;
-  for (unsigned int i=0;i<3;++i)
+  for (unsigned int i=0; i<3; ++i)
     {
       deallog << "row " << i << ": ";
-      
-      for (unsigned int j=0;j<csp.row_length(i);++j)
-       deallog << csp.column_number(i,j) << " ";
+
+      for (unsigned int j=0; j<csp.row_length(i); ++j)
+        deallog << csp.column_number(i,j) << " ";
 
       deallog << std::endl;
     }
-  
+
   return 0;
 }
index 0e92cd4742b7657f462c0cb4ab4b8b28721662ac..9bd8f162cf45a9cda3435b9868402e52e061723b 100644 (file)
@@ -45,7 +45,7 @@ int main()
   part.push_back(b);
   part.push_back(a);
   BlockCompressedSimpleSparsityPattern csp(part);
-  
+
   deallog << "blocks: " << csp.n_block_rows() << "x" << csp.n_block_cols() << std::endl;
   deallog << "size: " << csp.n_rows() << "x" << csp.n_cols() << std::endl;
   deallog << "size block(1,0):" << csp.block(1,0).n_rows() << "x" << csp.block(1,0).n_cols() << std::endl;
@@ -57,16 +57,16 @@ int main()
   deallog << "size: " << csp.n_rows() << "x" << csp.n_cols() << std::endl;
   deallog << "size block(1,0):" << csp.block(1,0).n_rows() << "x" << csp.block(1,0).n_cols() << std::endl;
 
-  for (int i=0;i<13;++i)
+  for (int i=0; i<13; ++i)
     {
       if (i==0 || i==3 || i==5)
-       {
-         csp.add(i,0);
-         csp.add(i,i);
-       }
-    }  
+        {
+          csp.add(i,0);
+          csp.add(i,i);
+        }
+    }
+
+  csp.print(logfile);
 
-  csp.print(logfile);  
-  
   return 0;
 }
index 44c691004d988c85b6f77888df84ccc2bcffff20..8f0927e6a3c362077eb9ca70c2463ace20f4721c 100644 (file)
 #include <fstream>
 
 
-void test (const BlockIndicesidx)
+void test (const BlockIndices &idx)
 {
   const unsigned int n = idx.size();
   deallog << "sizes: " << idx << std::endl;
   deallog << "start:   ";
-  for (unsigned i=0;i<n;++i)
+  for (unsigned i=0; i<n; ++i)
     deallog << ' ' << idx.block_start(i);
 
   deallog << std::endl;
-  
-  for (unsigned int i=0;i<idx.total_size();++i)
+
+  for (unsigned int i=0; i<idx.total_size(); ++i)
     {
       const unsigned int b = idx.global_to_local(i).first;
       const unsigned int j = idx.global_to_local(i).second;
       deallog << ' '<< i << ':' << b << ':' << j;
     }
-  
+
   deallog << std::endl;
 
-  for (unsigned int b=0;b<n;++b)
-    for (unsigned int j=0;j<idx.block_size(b);++j)
+  for (unsigned int b=0; b<n; ++b)
+    for (unsigned int j=0; j<idx.block_size(b); ++j)
       {
-       const unsigned int i = idx.local_to_global(b,j);
-       deallog << ' '<< i << ':' << b << ':' << j;
+        const unsigned int i = idx.local_to_global(b,j);
+        deallog << ' '<< i << ':' << b << ':' << j;
       }
-  
+
   deallog << std::endl;
 }
 
@@ -59,7 +59,7 @@ int main()
   std::ofstream logfile("block_indices/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  
+
   BlockIndices bi0;
   deallog << "empty: " << bi0 << std::endl;
   bi0.push_back(3);
@@ -68,7 +68,7 @@ int main()
   deallog << "push:  " << bi0 << std::endl;
   bi0.reinit(0,0);
   deallog << "empty: " << bi0 << std::endl;
-  
+
   BlockIndices bi1(3);
   test(bi1);
   bi1.reinit(3,4);
@@ -79,11 +79,11 @@ int main()
   deallog << "push: " << bi1 << std::endl;
   bi1.push_back(4);
   test(bi1);
-  
+
   std::vector<types::global_dof_index> v(4);
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     v[i] = 4-i;
-  
+
   BlockIndices bi2(v);
   test(bi2);
 }
index 84ca53b784557ed0452b7b1c2ffd452264924bb8..ff30bd6dcea135267721c9f0f14ef518eb214a13 100644 (file)
@@ -28,7 +28,7 @@
 
 
 
-void test () 
+void test ()
 {
   std::ofstream logfile("block_matrices/output");
   deallog << std::fixed;
@@ -38,7 +38,7 @@ void test ()
   deallog.threshold_double(1.e-10);
 
   BlockSparsityPattern bsp(3,2);
-                                  // set sizes
+  // set sizes
   bsp.block(0,0).reinit ( 2, 10, 7);
   bsp.block(0,1).reinit ( 2, 19, 8);
   bsp.block(1,0).reinit ( 7, 10, 6);
@@ -47,120 +47,119 @@ void test ()
   bsp.block(2,1).reinit (10, 19, 12);
   bsp.collect_sizes ();
 
-                                  // add this pseudo-random sparsity
-                                  // pattern:
-                                  // 0   1    1 1 1    1 1 1    1 1 1 
-                                  // 1    1 1 1    1 1 1    1 1 1    1
-                                  // 2       1 1 1 1    1 1 1    1 1 1
-                                  // 3   1 1 1    1 1 1 1    1 1 1    
-                                  // 4   1    1 1 1    1 1 1 1    1 1 
-                                  // 5    1 1 1    1 1 1    1 1 1 1   
-                                  // 6    1    1 1 1    1 1 1    1 1 1
-                                  // 7   1 1 1 1    1 1 1    1 1 1    
-                                  // 8   1    1 1 1 1    1 1 1    1 1 
-                                  // 9   11 1 1    1 1 1 1    1 1 1   
-                                  // 1    1    1 1 1    1 1 1 1    1 1
-                                  // 11    1 1 1    1 1 1    1 1 1 1  
-                                  // 12  1 11   1 1 1    1 1 1    1 1 
-                                  // 13   1 111 1    1 1 1    1 1 1   
-                                  // 14   1   11 1 1 1    1 1 1    1 1
-                                  // 15    1 1 1    1 1 1 1    1 1 1  
-                                  // 16  1 1    1 1 1    1 1 1 1    1 
-                                  // 17     1 1 11   1 1 1    1 1 1 1 
-                                  // 18   1 1    111 1    1 1 1    1 1
+  // add this pseudo-random sparsity
+  // pattern:
+  // 0   1    1 1 1    1 1 1    1 1 1
+  // 1    1 1 1    1 1 1    1 1 1    1
+  // 2       1 1 1 1    1 1 1    1 1 1
+  // 3   1 1 1    1 1 1 1    1 1 1
+  // 4   1    1 1 1    1 1 1 1    1 1
+  // 5    1 1 1    1 1 1    1 1 1 1
+  // 6    1    1 1 1    1 1 1    1 1 1
+  // 7   1 1 1 1    1 1 1    1 1 1
+  // 8   1    1 1 1 1    1 1 1    1 1
+  // 9   11 1 1    1 1 1 1    1 1 1
+  // 1    1    1 1 1    1 1 1 1    1 1
+  // 11    1 1 1    1 1 1    1 1 1 1
+  // 12  1 11   1 1 1    1 1 1    1 1
+  // 13   1 111 1    1 1 1    1 1 1
+  // 14   1   11 1 1 1    1 1 1    1 1
+  // 15    1 1 1    1 1 1 1    1 1 1
+  // 16  1 1    1 1 1    1 1 1 1    1
+  // 17     1 1 11   1 1 1    1 1 1 1
+  // 18   1 1    111 1    1 1 1    1 1
   for (unsigned int row=0; row<19; ++row)
     for (unsigned int i=0; i<10; ++i)
       bsp.add (row, (row*5+i*9)%29);
   bsp.compress ();
 
-                                  // now check whether the elements
-                                  // we inserted are indeed those
-                                  // that are in there. for now, we
-                                  // only check their number, but
-                                  // their places are checked later
-                                  // with the matrix-vector
-                                  // operations.
+  // now check whether the elements
+  // we inserted are indeed those
+  // that are in there. for now, we
+  // only check their number, but
+  // their places are checked later
+  // with the matrix-vector
+  // operations.
   unsigned int total_nonzero_elements = 0;
   for (unsigned int row=0; row<19; ++row)
     {
-                                      // first count the number of
-                                      // elements in each row
+      // first count the number of
+      // elements in each row
       std::vector<bool> t(29, false);
       for (unsigned int i=0; i<10; ++i)
-       t[(row*5+i*9)%29] = true;
-                                      // if we are in the third block
-                                      // row, then the first matrix
-                                      // is square, so there may be
-                                      // an additional element
+        t[(row*5+i*9)%29] = true;
+      // if we are in the third block
+      // row, then the first matrix
+      // is square, so there may be
+      // an additional element
       if (row>=9)
-       t[row-9] = true;
+        t[row-9] = true;
 
       deallog << "Row " << row << " sparsity:  ";
       for (unsigned int i=0; i<29; ++i)
-       deallog << t[i];
+        deallog << t[i];
       deallog << std::endl;
-      
+
       const unsigned int c=count(t.begin(), t.end(), true);
-      
-                                      // now see how many elements
-                                      // there really are:
+
+      // now see how many elements
+      // there really are:
       unsigned int ac=0;
       for (unsigned int col=0; col<2; ++col)
-       if (row<2)
-         ac += bsp.block(0,col).row_length(row-0);
-       else
-         if (row<9)
-           ac += bsp.block(1,col).row_length(row-2);
-         else
-           ac += bsp.block(2,col).row_length(row-9);
+        if (row<2)
+          ac += bsp.block(0,col).row_length(row-0);
+        else if (row<9)
+          ac += bsp.block(1,col).row_length(row-2);
+        else
+          ac += bsp.block(2,col).row_length(row-9);
       deallog << "Row=" << row
-             << ": expected length=" << c
-             << ", actual length=" << ac
-             << std::endl;
+              << ": expected length=" << c
+              << ", actual length=" << ac
+              << std::endl;
       total_nonzero_elements += ac;
       AssertThrow (c==ac, ExcInternalError());
     };
   deallog << total_nonzero_elements << "=="
-         << bsp.n_nonzero_elements()
-         << std::endl;
+          << bsp.n_nonzero_elements()
+          << std::endl;
   AssertThrow (total_nonzero_elements == bsp.n_nonzero_elements(),
-              ExcInternalError());
+               ExcInternalError());
 
 
 
-  
-                                  // now make a matrix with this
-                                  // sparsity pattern
+
+  // now make a matrix with this
+  // sparsity pattern
   BlockSparseMatrix<double> bsm (bsp);
   deallog << total_nonzero_elements << "=="
-         << bsm.n_nonzero_elements()
-         << std::endl;
+          << bsm.n_nonzero_elements()
+          << std::endl;
   AssertThrow (total_nonzero_elements == bsm.n_nonzero_elements(),
-              ExcInternalError());
-  
-                                  // try to write something into it,
-                                  // set entry (i,j) to i*j
+               ExcInternalError());
+
+  // try to write something into it,
+  // set entry (i,j) to i*j
   for (unsigned int row=0; row<19; ++row)
     for (unsigned int i=0; i<10; ++i)
       bsm.set (row, (row*5+i*9)%29, row*((row*5+i*9)%29));
-                                  // and add .5 to each value
+  // and add .5 to each value
   for (unsigned int row=0; row<19; ++row)
     for (unsigned int i=0; i<10; ++i)
       bsm.add (row, (row*5+i*9)%29, 0.5);
 
 
-                                  // Check the iterator
+  // Check the iterator
   deallog.push("Iterator");
   BlockSparseMatrix<double>::const_iterator iter = bsm.begin();
   const BlockSparseMatrix<double>::const_iterator end_iter = bsm.end();
-  for (;iter != end_iter;++iter)
+  for (; iter != end_iter; ++iter)
     deallog << iter->row() << '\t' << iter->column()
-           << '\t' << iter->value() << std::endl;
+            << '\t' << iter->value() << std::endl;
   deallog.pop();
-  
-                                  // now allocate two block vectors
-                                  // and see what we can get after
-                                  // vmults:
+
+  // now allocate two block vectors
+  // and see what we can get after
+  // vmults:
   BlockVector<double> src;
   std::vector<types::global_dof_index> src_sizes (2);
   src_sizes[0] = 10;
@@ -178,30 +177,30 @@ void test ()
     src(i) = i;
 
   bsm.vmult (dst, src);
-                                  // now check what came out
+  // now check what came out
   for (unsigned int row=0; row<19; ++row)
     {
       std::vector<double> t(29, 0.);
-                                      // first check which elements
-                                      // in this row exist
+      // first check which elements
+      // in this row exist
       for (unsigned int i=0; i<10; ++i)
-       t[(row*5+i*9)%29] = row*((row*5+i*9)%29);
-      
+        t[(row*5+i*9)%29] = row*((row*5+i*9)%29);
+
       for (unsigned int i=0; i<10; ++i)
-       t[(row*5+i*9)%29] += 0.5;
+        t[(row*5+i*9)%29] += 0.5;
 
-                                      // compute the exact result
+      // compute the exact result
       double row_sum = 0;
       for (unsigned int i=0; i<29; ++i)
-       row_sum += t[i]*i;
+        row_sum += t[i]*i;
 
-                                      // compare to vmult result
+      // compare to vmult result
       Assert (row_sum == dst(row), ExcInternalError());
       deallog << "vmult " << row << ' ' << row_sum << ' ' << dst(row) << std::endl;
     };
 
 
-                                  // test matrix_scalar_product. note that dst=M*src
+  // test matrix_scalar_product. note that dst=M*src
   const double msp1 = dst.norm_sqr ();
   const double msp2 = bsm.matrix_scalar_product (dst, src);
   Assert (msp1 == msp2, ExcInternalError());
@@ -220,28 +219,28 @@ int main ()
   catch (std::exception &e)
     {
       std::cerr << std::endl << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << e.what() << std::endl
-          << "Aborting!" << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
-                                      // abort
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+      // abort
       return 2;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-          << "Aborting!" << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
-                                      // abort
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+      // abort
       return 3;
     };
-  
-  
+
+
   return 0;
 }
index 5b6376a7ecf42f436cf9b23be0d0ac3726f43001..b75f42fcf77b8a635f92b5392c5b1d1fb9900a5a 100644 (file)
@@ -38,8 +38,8 @@ int main()
   deallog.depth_console(0);
 
 
-                                  // assemble a 2x2 block identity
-                                  // matrix
+  // assemble a 2x2 block identity
+  // matrix
   BlockSparsityPattern block_structure(2,2);
   block_structure.block(0,0).reinit (2,2,1);
   block_structure.block(0,1).reinit (2,2,1);
@@ -59,29 +59,29 @@ int main()
   block_A.add(2,2,1);
   block_A.add(3,3,1);
 
-                                  // block vector with 2 blocks of 2
-                                  // components each
+  // block vector with 2 blocks of 2
+  // components each
   BlockVector<double> a (2,2);
   a(0) = 2;
   a(1) = 3;
   a(2) = 4;
   a(3) = 5;
-  
-                                  // this should work (check that
-                                  // sizes of objects are all
-                                  // correct)
+
+  // this should work (check that
+  // sizes of objects are all
+  // correct)
   BlockVector<double> b (2,2);
   block_A.vmult (b,a);
 
-                                  // and while at it also check
-                                  // whether the result was correct
+  // and while at it also check
+  // whether the result was correct
   Assert (b(0) == 2, ExcInternalError());
   Assert (b(1) == 3, ExcInternalError());
   Assert (b(2) == 4, ExcInternalError());
   Assert (b(3) == 5, ExcInternalError());
 
-                                  // now solve with MinRes. This
-                                  // didn't work at one point
+  // now solve with MinRes. This
+  // didn't work at one point
   SolverControl  solver_control (1000, 1e-12);
   SolverMinRes<BlockVector<double> > minres (solver_control);
 
index a638da5a05c33728c2759cb74968b6df27e93f78..3e5beb904a5fc48b5d3eb6eee447d5811e5d6f33 100644 (file)
@@ -49,34 +49,34 @@ int main()
   BlockIndices cols(col_blocks);
 
   std::vector<std::vector<unsigned int> >
-    row_length(cols.size(),
-              std::vector<unsigned int>(rows.total_size()));
-  for (unsigned int jb=0;jb<row_length.size();++jb)
-      for (unsigned int i=0;i<row_length[jb].size();++i)
-       {
-         const unsigned int d = col_blocks[jb]-1;
-         row_length[jb][i] = (i+1) % d +1;
-       }
-  
-  for (unsigned int j=0;j<row_length.size();++j)
+  row_length(cols.size(),
+             std::vector<unsigned int>(rows.total_size()));
+  for (unsigned int jb=0; jb<row_length.size(); ++jb)
+    for (unsigned int i=0; i<row_length[jb].size(); ++i)
+      {
+        const unsigned int d = col_blocks[jb]-1;
+        row_length[jb][i] = (i+1) % d +1;
+      }
+
+  for (unsigned int j=0; j<row_length.size(); ++j)
     {
-      for (unsigned int i=0;i<row_length[j].size();++i)
-       deallog << ' ' << row_length[j][i];
+      for (unsigned int i=0; i<row_length[j].size(); ++i)
+        deallog << ' ' << row_length[j][i];
       deallog << std::endl;
     }
-  
+
   sparsity.reinit(rows, cols, row_length);
 
-  for (unsigned int ib = 0;ib<rows.size();++ib)
-    for (unsigned int i=0;i<rows.block_size(ib);++i)
+  for (unsigned int ib = 0; ib<rows.size(); ++ib)
+    for (unsigned int i=0; i<rows.block_size(ib); ++i)
       {
-       const unsigned int ii = rows.local_to_global(ib,i);
-       for (unsigned int jb = 0;jb<cols.size();++jb)
-         for (unsigned int j=0;j<row_length[jb][ii];++j)
-           sparsity.add(ii, cols.local_to_global(jb,j));
+        const unsigned int ii = rows.local_to_global(ib,i);
+        for (unsigned int jb = 0; jb<cols.size(); ++jb)
+          for (unsigned int j=0; j<row_length[jb][ii]; ++j)
+            sparsity.add(ii, cols.local_to_global(jb,j));
       }
-  
+
   sparsity.print(logfile);
-  
+
   return 0;
 }
index 3a369c2444a9a6d08862c483314415ef2c7ea2fb..414581e9b13d70420518f5e785810f6cae8d680f 100644 (file)
@@ -51,8 +51,8 @@ int main()
 
   BlockSparsityPattern bsp;
 
-                                  // we used to access an invalid
-                                  // block number here
+  // we used to access an invalid
+  // block number here
   bsp.copy_from (bcsp);
 
   deallog << "OK" << std::endl;
index 32becde7acfa901a835a2ec11f3389e69536ccc9..2cc90f49dff03b76f6b08e7827d0df8e80f73edd 100644 (file)
@@ -35,30 +35,30 @@ int main()
 
   BlockCompressedSimpleSparsityPattern csp (row_blocks, row_blocks);
 
-      csp.reinit(2,2);
-    csp.block(0,0).reinit(10,10);
-    csp.block(0,1).reinit(10,5);
-    csp.block(1,0).reinit(5,10);
-    csp.block(1,1).reinit(5,5);
-    csp.collect_sizes();
-    csp.add(5,5);
-    csp.add(12,12);
-    csp.add(5,11);
-    csp.add(11,3);
+  csp.reinit(2,2);
+  csp.block(0,0).reinit(10,10);
+  csp.block(0,1).reinit(10,5);
+  csp.block(1,0).reinit(5,10);
+  csp.block(1,1).reinit(5,5);
+  csp.collect_sizes();
+  csp.add(5,5);
+  csp.add(12,12);
+  csp.add(5,11);
+  csp.add(11,3);
 
-    csp.print(deallog.get_file_stream());
+  csp.print(deallog.get_file_stream());
 
 
-    for (types::global_dof_index row=0; row<csp.n_rows(); ++row)
-      {
-        types::global_dof_index rlen = csp.row_length(row);
+  for (types::global_dof_index row=0; row<csp.n_rows(); ++row)
+    {
+      types::global_dof_index rlen = csp.row_length(row);
+
+      for (types::global_dof_index c=0; c<rlen; ++c)
+        {
+          types::global_dof_index column = csp.column_number(row, c);
+          deallog << row << "," << column << std::endl;
+        }
+    }
 
-        for (types::global_dof_index c=0; c<rlen; ++c)
-          {
-            types::global_dof_index column = csp.column_number(row, c);
-            deallog << row << "," << column << std::endl;
-          }
-      }
-  
   deallog << "OK" << std::endl;
 }
index 186ad003bfe4dccf0eb26d1278d8f9dc27414752..241c16408956900156f7ea7d700fc85c038a913f 100644 (file)
@@ -29,7 +29,7 @@
 void test ()
 {
   deallog.push("BlockIndices");
-  
+
   std::vector<types::global_dof_index> ivector(4);
   ivector[0] = 3;
   ivector[1] = 0;
@@ -37,37 +37,37 @@ void test ()
   ivector[3] = 2;
 
   const std::vector<types::global_dof_index> vector_indices(ivector);
-  
+
   BlockIndices i1(ivector);
   BlockIndices i2 = i1;
   BlockIndices i3;
-                                  // no output expected here
+  // no output expected here
   deallog.push("empty constructor");
   for (unsigned int i=0 ; i<i3.size() ; ++i)
     deallog << i << '\t' << i3.local_to_global(i,0) << std::endl;
   for (unsigned int i=0 ; i<i3.total_size() ; ++i)
     deallog << i
-           << '\t' << i3.global_to_local(i).first
-           << '\t' << i3.global_to_local(i).second
-           << std::endl;
+            << '\t' << i3.global_to_local(i).first
+            << '\t' << i3.global_to_local(i).second
+            << std::endl;
   deallog.pop();
 
 
   i3.reinit(ivector);
 
   deallog.push("global->local");
-  
+
   unsigned int n = i1.total_size();
-  for (unsigned int i=0;i<n;++i)
+  for (unsigned int i=0; i<n; ++i)
     {
       deallog << i
-             << '\t' << i1.global_to_local(i).first
-             << '\t' << i1.global_to_local(i).second
-             << '\t' << i2.global_to_local(i).first
-             << '\t' << i2.global_to_local(i).second
-             << '\t' << i3.global_to_local(i).first
-             << '\t' << i3.global_to_local(i).second
-             << std::endl;
+              << '\t' << i1.global_to_local(i).first
+              << '\t' << i1.global_to_local(i).second
+              << '\t' << i2.global_to_local(i).first
+              << '\t' << i2.global_to_local(i).second
+              << '\t' << i3.global_to_local(i).first
+              << '\t' << i3.global_to_local(i).second
+              << std::endl;
     }
 
   deallog.pop();
@@ -76,42 +76,42 @@ void test ()
   for (unsigned int i=0 ; i<i1.size() ; ++i)
     for (unsigned int j=0 ; j<ivector[i] ; ++j)
       deallog << i << '\t' << j << '\t'
-             << i1.local_to_global(i,j) << std::endl;
-  
+              << i1.local_to_global(i,j) << std::endl;
+
   deallog.pop();
 
   deallog.push("reinit");
-  
+
   ivector.insert(ivector.begin(), 5);
   i1.reinit(ivector);
   n = i1.total_size();
-  for (unsigned int i=0;i<n;++i)
+  for (unsigned int i=0; i<n; ++i)
     {
       deallog << i
-             << '\t' << i1.global_to_local(i).first
-             << '\t' << i1.global_to_local(i).second
-             << std::endl;
+              << '\t' << i1.global_to_local(i).first
+              << '\t' << i1.global_to_local(i).second
+              << std::endl;
     }
   deallog << "---" << std::endl;
-  
+
   ivector.erase(ivector.begin());
   ivector.erase(ivector.begin());
   ivector.erase(ivector.begin());
   i1.reinit(ivector);
   n = i1.total_size();
-  for (unsigned int i=0;i<n;++i)
+  for (unsigned int i=0; i<n; ++i)
     {
       deallog << i
-             << '\t' << i1.global_to_local(i).first
-             << '\t' << i1.global_to_local(i).second
-             << std::endl;
+              << '\t' << i1.global_to_local(i).first
+              << '\t' << i1.global_to_local(i).second
+              << std::endl;
     }
   deallog.pop();
 
   deallog.pop ();
   deallog.push("BlockVector");
-                                  // initialization by an iterator
-                                  // range
+  // initialization by an iterator
+  // range
   deallog.push ("Constructor with iterators");
   double array[] = { 0, 1, 2, 3, 4, 5 };
   BlockVector<double> v1(vector_indices, &array[0], &array[6]);
@@ -119,13 +119,13 @@ void test ()
     deallog << v1(i) << ' ';
   deallog << std::endl;
 
-                                  // same test, but do not initialize
-                                  // from double*'s, but from
-                                  // std::list iterators.
+  // same test, but do not initialize
+  // from double*'s, but from
+  // std::list iterators.
   std::list<double> l(&array[0], &array[6]);
   BlockVector<double> v2(vector_indices, l.begin(), l.end());
   for (unsigned int i=0; i<v2.n_blocks(); ++i)
-    for (unsigned int j=0;j<v2.block(i).size();++j)
+    for (unsigned int j=0; j<v2.block(i).size(); ++j)
       deallog << i << '\t' << j << '\t' <<v2.block(i)(j) << std::endl;
 
   deallog.pop();
@@ -135,7 +135,7 @@ void test ()
   for (unsigned int i=0; i<v2.size(); ++i)
     deallog << v2(i) << ' ';
   deallog << std::endl;
-  
+
   deallog.pop ();
   deallog.pop ();
 }
@@ -152,15 +152,15 @@ int main ()
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-                                   // do the same weird stuff as in
-                                   // tests/base/reference.cc
+  // do the same weird stuff as in
+  // tests/base/reference.cc
 #if __GNUC__ != 2
   std::basic_streambuf<char> *old_cerr_buf = std::cerr.rdbuf();
 #else
   streambuf *old_cerr_buf = std::cerr.rdbuf();
 #endif
   std::cerr.rdbuf(logfile.rdbuf());
-  
+
   try
     {
       test ();
@@ -168,28 +168,28 @@ int main ()
   catch (std::exception &e)
     {
       std::cerr << std::endl << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << e.what() << std::endl
-          << "Aborting!" << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
-                                      // abort
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+      // abort
       return 0;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-          << "Aborting!" << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
-                                      // abort
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+      // abort
       return 0;
     };
-  
+
   std::cerr.rdbuf(old_cerr_buf);
 }
 
index 3d1a8a0da9adb7c0cbca0b2bb9f835d8cce51323..4facfe013f72cb03f0e0c8215941633a855f8363 100644 (file)
 
 void test ()
 {
-  std::vector<double>          v(9);
+  std::vector<double>   v(9);
   for (unsigned int i = 0; i < v.size(); ++i)
     v[i] = double(i+1);
 
-  std::vector<types::global_dof_index> partition(3);
+  std::vector<types::global_dof_index>  partition(3);
   for (unsigned int i = 0; i < partition.size(); ++i)
     partition[i] = 3;
 
-  dealii::BlockVector<double>  b(partition);
+  dealii::BlockVector<double> b(partition);
   Assert (b.n_blocks() == partition.size(),
-         ExcInternalError());
+          ExcInternalError());
 
-  unsigned int                 size = 0;
+  unsigned int      size = 0;
   for (unsigned int i = 0; i < b.n_blocks(); ++i)
     {
       Assert (b.block(i).size() == partition[i], ExcInternalError());
@@ -53,7 +53,7 @@ void test ()
       Assert (b(i) == v[i], ExcInternalError());
     }
 
-  dealii::BlockVector<double>  c;
+  dealii::BlockVector<double> c;
   c = b;
   Assert (c == b, ExcInternalError());
   Assert (c.n_blocks() == b.n_blocks(), ExcInternalError());
@@ -73,8 +73,8 @@ int main ()
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-                                   // do the same weird stuff as in
-                                   // tests/base/reference.cc
+  // do the same weird stuff as in
+  // tests/base/reference.cc
 #if __GNUC__ != 2
   std::basic_streambuf<char> *old_cerr_buf = std::cerr.rdbuf();
 #else
@@ -89,25 +89,25 @@ int main ()
   catch (std::exception &e)
     {
       std::cerr << std::endl << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << e.what() << std::endl
-          << "Aborting!" << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
-                                      // abort
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+      // abort
       return 0;
     }
   catch (...)
     {
       std::cerr << std::endl << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-          << "Aborting!" << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
-                                      // abort
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+      // abort
       return 0;
     };
 
index f1ccfe5ca680754b5fd1c18ec85b9393bbe2cb9b..fc49b7f478d5bd5181f9d124fddb577b08cc0f2d 100644 (file)
@@ -29,7 +29,7 @@
 
 template <typename number>
 bool operator == (const BlockVector<number> &v1,
-                 const BlockVector<number> &v2)
+                  const BlockVector<number> &v2)
 {
   if (v1.size() != v2.size())
     return false;
@@ -47,165 +47,165 @@ void test ()
   ivector[1] = 4;
   ivector[2] = 3;
   ivector[3] = 5;
-  
-                                  // Check 1: initialization via
-                                  // iterators
+
+  // Check 1: initialization via
+  // iterators
   if (true)
     {
       BlockVector<double> v1(ivector);
       BlockVector<double> v2(ivector);
 
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
-                                      // initialize other vector
-                                      // through iterators
+        v1(i) = i;
+      // initialize other vector
+      // through iterators
       BlockVector<double>::iterator p2 = v2.begin();
       for (unsigned int i=0; i<v1.size(); ++i, ++p2)
-       *p2 = i;
+        *p2 = i;
       Assert (p2==v2.end(), ExcInternalError());
-      
-                                      // check that the two vectors are equal
+
+      // check that the two vectors are equal
       deallog << "Check 1: " << (v1==v2 ? "true" : "false") << std::endl;
     };
 
-                                  // Check 1: initialization via
-                                  // iterators
+  // Check 1: initialization via
+  // iterators
   if (true)
     {
       BlockVector<double> v1(ivector);
 
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
-                                      // initialize other vector
-                                      // through iterators into first
-                                      // vector
+        v1(i) = i;
+      // initialize other vector
+      // through iterators into first
+      // vector
       BlockVector<double> v2(ivector, v1.begin(), v1.end());
-                                      // check that the two vectors are equal
+      // check that the two vectors are equal
       deallog << "Check 2: " << (v1==v2 ? "true" : "false") << std::endl;
     };
 
-                                  // Check 3: loop forward and back
-                                  // and check that things are the
-                                  // same
+  // Check 3: loop forward and back
+  // and check that things are the
+  // same
   if (true)
     {
       BlockVector<double> v1(ivector);
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
+        v1(i) = i;
 
       BlockVector<double>::iterator p1 = v1.begin();
       for (unsigned int i=0; i<v1.size(); ++i, ++p1)
-       Assert (*p1 == i, ExcInternalError());
+        Assert (*p1 == i, ExcInternalError());
 
       Assert (p1 == v1.end(), ExcInternalError());
-      
-                                      // move back into allowable
-                                      // region
+
+      // move back into allowable
+      // region
       --p1;
 
-                                      // check backwards
+      // check backwards
       for (unsigned int i=0; i<v1.size(); ++i, --p1)
-       Assert (*p1 == v1.size()-i-1, ExcInternalError());
+        Assert (*p1 == v1.size()-i-1, ExcInternalError());
 
-                                      // if we came thus far,
-                                      // everything is alright
+      // if we came thus far,
+      // everything is alright
       deallog << "Check 3: true" << std::endl;
     };
 
 
-                                  // Check 4: same, but this time
-                                  // with const iterators
+  // Check 4: same, but this time
+  // with const iterators
   if (true)
     {
       BlockVector<double> v1(ivector);
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
+        v1(i) = i;
 
       BlockVector<double>::const_iterator p1 = v1.begin();
       for (unsigned int i=0; i<v1.size(); ++i, ++p1)
-       Assert (*p1 == i, ExcInternalError());
+        Assert (*p1 == i, ExcInternalError());
 
       Assert (p1 == v1.end(), ExcInternalError());
 
-                                      // move back into allowable
-                                      // region
+      // move back into allowable
+      // region
       --p1;
 
-                                      // check backwards
+      // check backwards
       for (unsigned int i=0; i<v1.size(); ++i, --p1)
-       {
-         const double val = *p1;
-         const double ref = v1.size()-i-1;
-         Assert (val==ref, ExcInternalError());
-       };
-
-                                      // if we came thus far,
-                                      // everything is alright
+        {
+          const double val = *p1;
+          const double ref = v1.size()-i-1;
+          Assert (val==ref, ExcInternalError());
+        };
+
+      // if we came thus far,
+      // everything is alright
       deallog << "Check 4: true" << std::endl;
     };
 
-                                  // Checks 5-14: use some standard
-                                  // algorithms
+  // Checks 5-14: use some standard
+  // algorithms
   if (true)
     {
       BlockVector<double> v1(ivector);
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
+        v1(i) = i;
 
-                                      // check std::distance
-                                      // algorithm
+      // check std::distance
+      // algorithm
       deallog << "Check 5: "
-             << (std::distance (v1.begin(), v1.end()) ==
-                 static_cast<signed int>(v1.size()) ?
-                 "true" : "false")
-             << std::endl;
+              << (std::distance (v1.begin(), v1.end()) ==
+                  static_cast<signed int>(v1.size()) ?
+                  "true" : "false")
+              << std::endl;
 
-                                      // check std::copy
+      // check std::copy
       BlockVector<double> v2(ivector);
       std::copy (v1.begin(), v1.end(), v2.begin());
       deallog << "Check 6: " << (v1 == v2 ? "true" : "false") << std::endl;
 
-                                      // check std::transform
+      // check std::transform
       std::transform (v1.begin(), v1.end(), v2.begin(),
-                     std::bind2nd (std::multiplies<double>(),
-                                   2.0));
+                      std::bind2nd (std::multiplies<double>(),
+                                    2.0));
       v2.scale (1./2.);
       deallog << "Check 7: " << (v1 == v2 ? "true" : "false") << std::endl;
 
 
-                                      // check operators +/-, +=/-=
+      // check operators +/-, +=/-=
       deallog << "Check 8: "
-             << (std::distance(v1.begin(), v1.begin()+3) == 3 ?
-                 "true" : "false")
-             << std::endl;
+              << (std::distance(v1.begin(), v1.begin()+3) == 3 ?
+                  "true" : "false")
+              << std::endl;
       deallog << "Check 9: "
-             << (std::distance(v1.end()-6, v1.end()) == 6 ?
-                 "true" : "false")
-             << std::endl;
+              << (std::distance(v1.end()-6, v1.end()) == 6 ?
+                  "true" : "false")
+              << std::endl;
       deallog << "Check 10: "
-             << (std::distance(v1.begin(), v1.end()) == (signed)v1.size() ?
-                 "true" : "false")
-             << std::endl;
+              << (std::distance(v1.begin(), v1.end()) == (signed)v1.size() ?
+                  "true" : "false")
+              << std::endl;
       deallog << "Check 11: "
-             << (std::distance(v1.begin(), (v1.begin()+=7)) == 7 ?
-                 "true" : "false")
-             << std::endl;
+              << (std::distance(v1.begin(), (v1.begin()+=7)) == 7 ?
+                  "true" : "false")
+              << std::endl;
       deallog << "Check 12: "
-             << (std::distance((v1.end()-=4), v1.end()) == 4 ?
-                 "true" : "false")
-             << std::endl;
+              << (std::distance((v1.end()-=4), v1.end()) == 4 ?
+                  "true" : "false")
+              << std::endl;
 
-                                      // check advance
+      // check advance
       BlockVector<double>::iterator p2 = v1.begin();
       std::advance (p2, v1.size());
       deallog << "Check 13: " << (p2 == v1.end() ? "true" : "false") << std::endl;
@@ -215,104 +215,104 @@ void test ()
       deallog << "Check 14: " << (p3 == v1.end() ? "true" : "false") << std::endl;
     };
 
-                                  // Check 15: initialization through
-                                  // iterators
+  // Check 15: initialization through
+  // iterators
   if (true)
     {
       BlockVector<double> v1(ivector);
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
+        v1(i) = i;
 
-                                      // initialize a normal vector
-                                      // from it
+      // initialize a normal vector
+      // from it
       Vector<double> v2(v1.begin(), v1.end());
 
-                                      // and reverse way
+      // and reverse way
       BlockVector<double> v3(ivector, v2.begin(), v2.end());
       deallog << "Check 15: " << (v1==v3 ? "true" : "false") << std::endl;
     };
 
-                                  // Check 16: initialization through
-                                  // iterators. variant with one
-                                  // constant object
+  // Check 16: initialization through
+  // iterators. variant with one
+  // constant object
   if (true)
     {
       BlockVector<double> v1(ivector);
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
+        v1(i) = i;
 
-                                      // initialize a normal vector
-                                      // from it
+      // initialize a normal vector
+      // from it
       const Vector<double> v2(v1.begin(), v1.end());
 
-                                      // and reverse way
+      // and reverse way
       BlockVector<double> v3(ivector, v2.begin(), v2.end());
       deallog << "Check 16: " << (v1==v3 ? "true" : "false") << std::endl;
     };
-  
-                                  // Check 17: initialization through
-                                  // iterators. variant with two
-                                  // constant object
+
+  // Check 17: initialization through
+  // iterators. variant with two
+  // constant object
   if (true)
     {
       BlockVector<double> v1(ivector);
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
+        v1(i) = i;
 
-                                      // initialize a normal vector
-                                      // from it
+      // initialize a normal vector
+      // from it
       const Vector<double> v2(v1.begin(), v1.end());
 
-                                      // and reverse way
+      // and reverse way
       const BlockVector<double> v3(ivector, v2.begin(), v2.end());
       deallog << "Check 17: " << (v1==v3 ? "true" : "false") << std::endl;
     };
 
-                                  // Check 18: initialization through
-                                  // iterators. variant with three
-                                  // constant object
+  // Check 18: initialization through
+  // iterators. variant with three
+  // constant object
   if (true)
     {
       BlockVector<double> v0(ivector);
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v0.size(); ++i)
-       v0(i) = i;
+        v0(i) = i;
 
       const BlockVector<double> v1 = v0;
-      
-                                      // initialize a normal vector
-                                      // from it
+
+      // initialize a normal vector
+      // from it
       const Vector<double> v2(v1.begin(), v1.end());
 
-                                      // and reverse way
+      // and reverse way
       const BlockVector<double> v3(ivector, v2.begin(), v2.end());
       deallog << "Check 18: " << (v1==v3 ? "true" : "false") << std::endl;
     };
-  
-                                  // Check 19: operator[]
+
+  // Check 19: operator[]
   if (true)
     {
       BlockVector<double> v1(ivector);
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
+        v1(i) = i;
 
       for (unsigned int i=0; i<v1.size(); ++i)
-       {
-         const BlockVector<double>::iterator p = (v1.begin()+i);
-         for (unsigned int j=0; j<v1.size(); ++j)
-           Assert (p[(signed)j-(signed)i] == j, ExcInternalError());
-       };
-
-                                      // if we came thus far,
-                                      // everything is alright
-      deallog << "Check 19: true" << std::endl;      
+        {
+          const BlockVector<double>::iterator p = (v1.begin()+i);
+          for (unsigned int j=0; j<v1.size(); ++j)
+            Assert (p[(signed)j-(signed)i] == j, ExcInternalError());
+        };
+
+      // if we came thus far,
+      // everything is alright
+      deallog << "Check 19: true" << std::endl;
     };
 }
 
@@ -328,7 +328,7 @@ int main ()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   try
     {
       test ();
@@ -336,29 +336,29 @@ int main ()
   catch (std::exception &e)
     {
       deallog << std::endl << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << e.what() << std::endl
-          << "Aborting!" << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
-                                      // abort
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+      // abort
       return 2;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-          << "Aborting!" << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
-                                      // abort
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+      // abort
       return 3;
     };
-  
-  
+
+
   return 0;
 }
 
index 247166575176a1e5742420737d46c496a3fc91d6..00c93e074d0c1d939ebcc1779e4cf272cf6dfc3b 100644 (file)
@@ -30,7 +30,7 @@
 
 template <typename Vector1, typename Vector2>
 bool operator == (const Vector1 &v1,
-                 const Vector2 &v2)
+                  const Vector2 &v2)
 {
   if (v1.size() != v2.size())
     return false;
@@ -48,7 +48,7 @@ void test ()
   ivector[1] = 4;
   ivector[2] = 3;
   ivector[3] = 5;
-  
+
   BlockVector<double> v1(ivector);
   Vector<double> v2(v1.size());
 
@@ -78,7 +78,7 @@ int main ()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   try
     {
       test ();
@@ -86,29 +86,29 @@ int main ()
   catch (std::exception &e)
     {
       deallog << std::endl << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << e.what() << std::endl
-          << "Aborting!" << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
-                                      // abort
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+      // abort
       return 2;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-          << "Aborting!" << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
-                                      // abort
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+      // abort
       return 3;
     };
-  
-  
+
+
   return 0;
 }
 
index 42605d0a6c98a3c373b8f49280382eaa38fb8c4b..1fdec862ee4046d10bc766f9fc198418f14fbdff 100644 (file)
@@ -37,5 +37,5 @@ int main ()
     }
 }
 
-  
-  
+
+
index 3d58959b0ef355fc1ac4de75c541acb207e60487..8032e51a373a725a9134b1e74ad94b4635200f98 100644 (file)
@@ -37,5 +37,5 @@ int main ()
     }
 }
 
-  
-  
+
+
index 20b05a162381959a0235ef6cc6e3924dc4e616fa..c98d5a0f4397553699a35411c415a26ef3493837 100644 (file)
@@ -37,5 +37,5 @@ int main ()
     }
 }
 
-  
-  
+
+
index 41af08e1644099ac2ea2c6b89ffd84fc7d1ccd4f..aaca9f8fa6190cb6798794a9332507dee199507d 100644 (file)
@@ -37,5 +37,5 @@ int main ()
     }
 }
 
-  
-  
+
+
index 43ff07fb475f2863d3e6b3ede9a79f766879a7f9..5034ae0b099bfa9d52e9f559f3dbf6634a4823f6 100644 (file)
@@ -37,5 +37,5 @@ int main ()
     }
 }
 
-  
-  
+
+
index 401f30cf54f4f65ead1421d717f1e764b9bc319a..518bd9be98e1c19d03f261a7a621dddf62271856 100644 (file)
@@ -37,5 +37,5 @@ int main ()
     }
 }
 
-  
-  
+
+
index cd5d516ce0b7f88a602f50f7e432d6ac38fa49b4..f790a904f9f537dc00fd655775b4f7da47b9e776 100644 (file)
@@ -37,5 +37,5 @@ int main ()
     }
 }
 
-  
-  
+
+
index 0a474687b39e80766ef72c05dadb4c480ee64ee9..f52d88948c320926694bbda83e9239190e5e069d 100644 (file)
@@ -37,5 +37,5 @@ int main ()
     }
 }
 
-  
-  
+
+
index a879a8d7bafa5b47bdf7fa9e63e0078e9e1da140..69e79b6ac82029bd02a989d33c51ea3948af2bd0 100644 (file)
@@ -37,5 +37,5 @@ int main ()
     }
 }
 
-  
-  
+
+
index 40fd1dc3e4cd31f36e6ac4280c939be906b9f8b0..81ed3152ff6ec27a7606fe32224fc0a15c64c96e 100644 (file)
@@ -37,5 +37,5 @@ int main ()
     }
 }
 
-  
-  
+
+
index 1247488e0bc3b3373270fdc0403f380776e00648..78f1b715ea2a6afe7cc227f72518f23685c7df0a 100644 (file)
@@ -37,5 +37,5 @@ int main ()
     }
 }
 
-  
-  
+
+
index 9b601a785e4c119fce2abfae54582c37cf0625bf..eb494c1ae1d87c5d5f32597429cf1fa9d071772b 100644 (file)
@@ -29,7 +29,7 @@
 void test ()
 {
   deallog.push("BlockIndices");
-  
+
   std::vector<types::global_dof_index> ivector(4);
   ivector[0] = 3;
   ivector[1] = 0;
@@ -37,37 +37,37 @@ void test ()
   ivector[3] = 2;
 
   const std::vector<types::global_dof_index> vector_indices(ivector);
-  
+
   BlockIndices i1(ivector);
   BlockIndices i2 = i1;
   BlockIndices i3;
-                                  // no output expected here
+  // no output expected here
   deallog.push("empty constructor");
   for (unsigned int i=0 ; i<i3.size() ; ++i)
     deallog << i << '\t' << i3.local_to_global(i,0) << std::endl;
   for (unsigned int i=0 ; i<i3.total_size() ; ++i)
     deallog << i
-           << '\t' << i3.global_to_local(i).first
-           << '\t' << i3.global_to_local(i).second
-           << std::endl;
+            << '\t' << i3.global_to_local(i).first
+            << '\t' << i3.global_to_local(i).second
+            << std::endl;
   deallog.pop();
 
 
   i3.reinit(ivector);
 
   deallog.push("global->local");
-  
+
   unsigned int n = i1.total_size();
-  for (unsigned int i=0;i<n;++i)
+  for (unsigned int i=0; i<n; ++i)
     {
       deallog << i
-             << '\t' << i1.global_to_local(i).first
-             << '\t' << i1.global_to_local(i).second
-             << '\t' << i2.global_to_local(i).first
-             << '\t' << i2.global_to_local(i).second
-             << '\t' << i3.global_to_local(i).first
-             << '\t' << i3.global_to_local(i).second
-             << std::endl;
+              << '\t' << i1.global_to_local(i).first
+              << '\t' << i1.global_to_local(i).second
+              << '\t' << i2.global_to_local(i).first
+              << '\t' << i2.global_to_local(i).second
+              << '\t' << i3.global_to_local(i).first
+              << '\t' << i3.global_to_local(i).second
+              << std::endl;
     }
 
   deallog.pop();
@@ -76,44 +76,44 @@ void test ()
   for (unsigned int i=0 ; i<i1.size() ; ++i)
     for (unsigned int j=0 ; j<ivector[i] ; ++j)
       deallog << i << '\t' << j << '\t'
-             << i1.local_to_global(i,j) << std::endl;
-  
+              << i1.local_to_global(i,j) << std::endl;
+
   deallog.pop();
 
   deallog.push("reinit");
-  
+
   ivector.insert(ivector.begin(), 5);
   i1.reinit(ivector);
   n = i1.total_size();
-  for (unsigned int i=0;i<n;++i)
+  for (unsigned int i=0; i<n; ++i)
     {
       deallog << i
-             << '\t' << i1.global_to_local(i).first
-             << '\t' << i1.global_to_local(i).second
-             << std::endl;
+              << '\t' << i1.global_to_local(i).first
+              << '\t' << i1.global_to_local(i).second
+              << std::endl;
     }
   deallog << "---" << std::endl;
-  
+
   ivector.erase(ivector.begin());
   ivector.erase(ivector.begin());
   ivector.erase(ivector.begin());
   i1.reinit(ivector);
   n = i1.total_size();
-  for (unsigned int i=0;i<n;++i)
+  for (unsigned int i=0; i<n; ++i)
     {
       deallog << i
-             << '\t' << i1.global_to_local(i).first
-             << '\t' << i1.global_to_local(i).second
-             << std::endl;
+              << '\t' << i1.global_to_local(i).first
+              << '\t' << i1.global_to_local(i).second
+              << std::endl;
     }
   deallog.pop();
 
   deallog.pop ();
   deallog.push("BlockVector");
-                                  // initialization by an iterator
-                                  // range. first for real-valued
-                                  // arguments in a complex-valued
-                                  // vector
+  // initialization by an iterator
+  // range. first for real-valued
+  // arguments in a complex-valued
+  // vector
   {
     deallog.push ("Constructor with iterators");
     double array[] = { 0, 1, 2, 3, 4, 5 };
@@ -122,58 +122,60 @@ void test ()
       deallog << v1(i) << ' ';
     deallog << std::endl;
 
-                                    // same test, but do not initialize
-                                    // from double*'s, but from
-                                    // std::list iterators.
+    // same test, but do not initialize
+    // from double*'s, but from
+    // std::list iterators.
     std::list<double> l(&array[0], &array[6]);
     BlockVector<std::complex<double> > v2(vector_indices, l.begin(), l.end());
     for (unsigned int i=0; i<v2.n_blocks(); ++i)
-      for (unsigned int j=0;j<v2.block(i).size();++j)
-       deallog << i << '\t' << j << '\t' <<v2.block(i)(j) << std::endl;
+      for (unsigned int j=0; j<v2.block(i).size(); ++j)
+        deallog << i << '\t' << j << '\t' <<v2.block(i)(j) << std::endl;
 
     deallog.pop();
-  
+
     deallog.push("reinit block");
     v2.block(1).reinit(5);
     v2.collect_sizes();
     for (unsigned int i=0; i<v2.size(); ++i)
       deallog << v2(i) << ' ';
-    deallog << std::endl;  
+    deallog << std::endl;
     deallog.pop ();
   }
 
-                                  // now the same with complex-valued
-                                  // arguments
+  // now the same with complex-valued
+  // arguments
   {
     deallog.push ("Constructor with iterators");
     std::complex<double> array[] = { std::complex<double>(0,1),
-                                    std::complex<double>(1,2),
-                                    std::complex<double>(2,3),
-                                    std::complex<double>(3,4),
-                                    std::complex<double>(4,5),
-                                    std::complex<double>(5,6) };
+                                     std::complex<double>(1,2),
+                                     std::complex<double>(2,3),
+                                     std::complex<double>(3,4),
+                                     std::complex<double>(4,5),
+                                     std::complex<double>(5,6)
+                                   };
     BlockVector<std::complex<double> > v1(vector_indices, &array[0], &array[6]);
     for (unsigned int i=0; i<v1.size(); ++i)
       deallog << v1(i) << ' ';
     deallog << std::endl;
 
-                                    // same test, but do not initialize
-                                    // from double*'s, but from
-                                    // std::list iterators.
+    // same test, but do not initialize
+    // from double*'s, but from
+    // std::list iterators.
     std::list<std::complex<double> > l(&array[0], &array[6]);
     BlockVector<std::complex<double> > v2(vector_indices, l.begin(), l.end());
     for (unsigned int i=0; i<v2.n_blocks(); ++i)
-      for (unsigned int j=0;j<v2.block(i).size();++j)
-       deallog << i << '\t' << j << '\t' <<v2.block(i)(j) << std::endl;
+      for (unsigned int j=0; j<v2.block(i).size(); ++j)
+        deallog << i << '\t' << j << '\t' <<v2.block(i)(j) << std::endl;
 
     deallog.pop();
-  
+
     deallog.push("reinit block");
     v2.block(1).reinit(5);
     v2.collect_sizes();
     for (unsigned int i=0; i<v2.size(); ++i)
       deallog << v2(i) << ' ';
-    deallog << std::endl;    deallog.pop ();
+    deallog << std::endl;
+    deallog.pop ();
   }
 
   deallog.pop ();
@@ -191,15 +193,15 @@ int main ()
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-                                   // do the same weird stuff as in
-                                   // tests/base/reference.cc
+  // do the same weird stuff as in
+  // tests/base/reference.cc
 #if __GNUC__ != 2
   std::basic_streambuf<char> *old_cerr_buf = std::cerr.rdbuf();
 #else
   streambuf *old_cerr_buf = std::cerr.rdbuf();
 #endif
   std::cerr.rdbuf(logfile.rdbuf());
-  
+
   try
     {
       test ();
@@ -207,28 +209,28 @@ int main ()
   catch (std::exception &e)
     {
       std::cerr << std::endl << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << e.what() << std::endl
-          << "Aborting!" << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
-                                      // abort
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+      // abort
       return 0;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-          << "Aborting!" << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
-                                      // abort
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+      // abort
       return 0;
     };
-  
+
   std::cerr.rdbuf(old_cerr_buf);
 }
 
index c3d48f64cbd7021cbae3013087ec3ba3b6517e3d..9b1fd5691819cf64491999a24b980ca3d2db6d1a 100644 (file)
@@ -29,7 +29,7 @@
 
 template <typename number>
 bool operator == (const BlockVector<number> &v1,
-                 const BlockVector<number> &v2)
+                  const BlockVector<number> &v2)
 {
   if (v1.size() != v2.size())
     return false;
@@ -47,165 +47,165 @@ void test ()
   ivector[1] = 4;
   ivector[2] = 3;
   ivector[3] = 5;
-  
-                                  // Check 1: initialization via
-                                  // iterators
+
+  // Check 1: initialization via
+  // iterators
   if (true)
     {
       BlockVector<std::complex<double> > v1(ivector);
       BlockVector<std::complex<double> > v2(ivector);
 
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = std::complex<double>(i,i+1);
-                                      // initialize other vector
-                                      // through iterators
+        v1(i) = std::complex<double>(i,i+1);
+      // initialize other vector
+      // through iterators
       BlockVector<std::complex<double> >::iterator p2 = v2.begin();
       for (unsigned int i=0; i<v1.size(); ++i, ++p2)
-       *p2 = std::complex<double>(i,i+1);
+        *p2 = std::complex<double>(i,i+1);
       Assert (p2==v2.end(), ExcInternalError());
-      
-                                      // check that the two vectors are equal
+
+      // check that the two vectors are equal
       deallog << "Check 1: " << (v1==v2 ? "true" : "false") << std::endl;
     };
 
-                                  // Check 1: initialization via
-                                  // iterators
+  // Check 1: initialization via
+  // iterators
   if (true)
     {
       BlockVector<std::complex<double> > v1(ivector);
 
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = std::complex<double>(i,i+1);
-                                      // initialize other vector
-                                      // through iterators into first
-                                      // vector
+        v1(i) = std::complex<double>(i,i+1);
+      // initialize other vector
+      // through iterators into first
+      // vector
       BlockVector<std::complex<double> > v2(ivector, v1.begin(), v1.end());
-                                      // check that the two vectors are equal
+      // check that the two vectors are equal
       deallog << "Check 2: " << (v1==v2 ? "true" : "false") << std::endl;
     };
 
-                                  // Check 3: loop forward and back
-                                  // and check that things are the
-                                  // same
+  // Check 3: loop forward and back
+  // and check that things are the
+  // same
   if (true)
     {
       BlockVector<std::complex<double> > v1(ivector);
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = std::complex<double>(i,i+1);
+        v1(i) = std::complex<double>(i,i+1);
 
       BlockVector<std::complex<double> >::iterator p1 = v1.begin();
       for (unsigned int i=0; i<v1.size(); ++i, ++p1)
-       Assert (*p1 == std::complex<double>(i,i+1), ExcInternalError());
+        Assert (*p1 == std::complex<double>(i,i+1), ExcInternalError());
 
       Assert (p1 == v1.end(), ExcInternalError());
-      
-                                      // move back into allowable
-                                      // region
+
+      // move back into allowable
+      // region
       --p1;
 
-                                      // check backwards
+      // check backwards
       for (unsigned int i=0; i<v1.size(); ++i, --p1)
-       Assert (*p1 == std::complex<double>(v1.size()-i-1, v1.size()-i), ExcInternalError());
+        Assert (*p1 == std::complex<double>(v1.size()-i-1, v1.size()-i), ExcInternalError());
 
-                                      // if we came thus far,
-                                      // everything is alright
+      // if we came thus far,
+      // everything is alright
       deallog << "Check 3: true" << std::endl;
     };
 
 
-                                  // Check 4: same, but this time
-                                  // with const iterators
+  // Check 4: same, but this time
+  // with const iterators
   if (true)
     {
       BlockVector<std::complex<double> > v1(ivector);
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
+        v1(i) = i;
 
       BlockVector<std::complex<double> >::const_iterator p1 = v1.begin();
       for (unsigned int i=0; i<v1.size(); ++i, ++p1)
-       Assert (*p1 == std::complex<double>(i,0), ExcInternalError());
+        Assert (*p1 == std::complex<double>(i,0), ExcInternalError());
 
       Assert (p1 == v1.end(), ExcInternalError());
 
-                                      // move back into allowable
-                                      // region
+      // move back into allowable
+      // region
       --p1;
 
-                                      // check backwards
+      // check backwards
       for (unsigned int i=0; i<v1.size(); ++i, --p1)
-       {
-         const std::complex<double> val = *p1;
-         const std::complex<double> ref(v1.size()-i-1);
-         Assert (val==ref, ExcInternalError());
-       };
-
-                                      // if we came thus far,
-                                      // everything is alright
+        {
+          const std::complex<double> val = *p1;
+          const std::complex<double> ref(v1.size()-i-1);
+          Assert (val==ref, ExcInternalError());
+        };
+
+      // if we came thus far,
+      // everything is alright
       deallog << "Check 4: true" << std::endl;
     };
 
-                                  // Checks 5-14: use some standard
-                                  // algorithms
+  // Checks 5-14: use some standard
+  // algorithms
   if (true)
     {
       BlockVector<std::complex<double> > v1(ivector);
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
+        v1(i) = i;
 
-                                      // check std::distance
-                                      // algorithm
+      // check std::distance
+      // algorithm
       deallog << "Check 5: "
-             << (std::distance (v1.begin(), v1.end()) ==
-                 static_cast<signed int>(v1.size()) ?
-                 "true" : "false")
-             << std::endl;
+              << (std::distance (v1.begin(), v1.end()) ==
+                  static_cast<signed int>(v1.size()) ?
+                  "true" : "false")
+              << std::endl;
 
-                                      // check std::copy
+      // check std::copy
       BlockVector<std::complex<double> > v2(ivector);
       std::copy (v1.begin(), v1.end(), v2.begin());
       deallog << "Check 6: " << (v1 == v2 ? "true" : "false") << std::endl;
 
-                                      // check std::transform
+      // check std::transform
       std::transform (v1.begin(), v1.end(), v2.begin(),
-                     std::bind2nd (std::multiplies<std::complex<double> >(),
-                                   2.0));
+                      std::bind2nd (std::multiplies<std::complex<double> >(),
+                                    2.0));
       v2.scale (std::complex<double>(1./2.));
       deallog << "Check 7: " << (v1 == v2 ? "true" : "false") << std::endl;
 
 
-                                      // check operators +/-, +=/-=
+      // check operators +/-, +=/-=
       deallog << "Check 8: "
-             << (std::distance(v1.begin(), v1.begin()+3) == 3 ?
-                 "true" : "false")
-             << std::endl;
+              << (std::distance(v1.begin(), v1.begin()+3) == 3 ?
+                  "true" : "false")
+              << std::endl;
       deallog << "Check 9: "
-             << (std::distance(v1.end()-6, v1.end()) == 6 ?
-                 "true" : "false")
-             << std::endl;
+              << (std::distance(v1.end()-6, v1.end()) == 6 ?
+                  "true" : "false")
+              << std::endl;
       deallog << "Check 10: "
-             << (std::distance(v1.begin(), v1.end()) == (signed)v1.size() ?
-                 "true" : "false")
-             << std::endl;
+              << (std::distance(v1.begin(), v1.end()) == (signed)v1.size() ?
+                  "true" : "false")
+              << std::endl;
       deallog << "Check 11: "
-             << (std::distance(v1.begin(), (v1.begin()+=7)) == 7 ?
-                 "true" : "false")
-             << std::endl;
+              << (std::distance(v1.begin(), (v1.begin()+=7)) == 7 ?
+                  "true" : "false")
+              << std::endl;
       deallog << "Check 12: "
-             << (std::distance((v1.end()-=4), v1.end()) == 4 ?
-                 "true" : "false")
-             << std::endl;
+              << (std::distance((v1.end()-=4), v1.end()) == 4 ?
+                  "true" : "false")
+              << std::endl;
 
-                                      // check advance
+      // check advance
       BlockVector<std::complex<double> >::iterator p2 = v1.begin();
       std::advance (p2, v1.size());
       deallog << "Check 13: " << (p2 == v1.end() ? "true" : "false") << std::endl;
@@ -215,104 +215,104 @@ void test ()
       deallog << "Check 14: " << (p3 == v1.end() ? "true" : "false") << std::endl;
     };
 
-                                  // Check 15: initialization through
-                                  // iterators
+  // Check 15: initialization through
+  // iterators
   if (true)
     {
       BlockVector<std::complex<double> > v1(ivector);
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
+        v1(i) = i;
 
-                                      // initialize a normal vector
-                                      // from it
+      // initialize a normal vector
+      // from it
       Vector<std::complex<double> > v2(v1.begin(), v1.end());
 
-                                      // and reverse way
+      // and reverse way
       BlockVector<std::complex<double> > v3(ivector, v2.begin(), v2.end());
       deallog << "Check 15: " << (v1==v3 ? "true" : "false") << std::endl;
     };
 
-                                  // Check 16: initialization through
-                                  // iterators. variant with one
-                                  // constant object
+  // Check 16: initialization through
+  // iterators. variant with one
+  // constant object
   if (true)
     {
       BlockVector<std::complex<double> > v1(ivector);
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
+        v1(i) = i;
 
-                                      // initialize a normal vector
-                                      // from it
+      // initialize a normal vector
+      // from it
       const Vector<std::complex<double> > v2(v1.begin(), v1.end());
 
-                                      // and reverse way
+      // and reverse way
       BlockVector<std::complex<double> > v3(ivector, v2.begin(), v2.end());
       deallog << "Check 16: " << (v1==v3 ? "true" : "false") << std::endl;
     };
-  
-                                  // Check 17: initialization through
-                                  // iterators. variant with two
-                                  // constant object
+
+  // Check 17: initialization through
+  // iterators. variant with two
+  // constant object
   if (true)
     {
       BlockVector<std::complex<double> > v1(ivector);
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
+        v1(i) = i;
 
-                                      // initialize a normal vector
-                                      // from it
+      // initialize a normal vector
+      // from it
       const Vector<std::complex<double> > v2(v1.begin(), v1.end());
 
-                                      // and reverse way
+      // and reverse way
       const BlockVector<std::complex<double> > v3(ivector, v2.begin(), v2.end());
       deallog << "Check 17: " << (v1==v3 ? "true" : "false") << std::endl;
     };
 
-                                  // Check 18: initialization through
-                                  // iterators. variant with three
-                                  // constant object
+  // Check 18: initialization through
+  // iterators. variant with three
+  // constant object
   if (true)
     {
       BlockVector<std::complex<double> > v0(ivector);
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v0.size(); ++i)
-       v0(i) = i;
+        v0(i) = i;
 
       const BlockVector<std::complex<double> > v1 = v0;
-      
-                                      // initialize a normal vector
-                                      // from it
+
+      // initialize a normal vector
+      // from it
       const Vector<std::complex<double> > v2(v1.begin(), v1.end());
 
-                                      // and reverse way
+      // and reverse way
       const BlockVector<std::complex<double> > v3(ivector, v2.begin(), v2.end());
       deallog << "Check 18: " << (v1==v3 ? "true" : "false") << std::endl;
     };
-  
-                                  // Check 19: operator[]
+
+  // Check 19: operator[]
   if (true)
     {
       BlockVector<std::complex<double> > v1(ivector);
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
+        v1(i) = i;
 
       for (unsigned int i=0; i<v1.size(); ++i)
-       {
-         const BlockVector<std::complex<double> >::iterator p = (v1.begin()+i);
-         for (unsigned int j=0; j<v1.size(); ++j)
-           Assert (p[(signed)j-(signed)i] == std::complex<double>(j), ExcInternalError());
-       };
-
-                                      // if we came thus far,
-                                      // everything is alright
-      deallog << "Check 19: true" << std::endl;      
+        {
+          const BlockVector<std::complex<double> >::iterator p = (v1.begin()+i);
+          for (unsigned int j=0; j<v1.size(); ++j)
+            Assert (p[(signed)j-(signed)i] == std::complex<double>(j), ExcInternalError());
+        };
+
+      // if we came thus far,
+      // everything is alright
+      deallog << "Check 19: true" << std::endl;
     };
 }
 
@@ -328,7 +328,7 @@ int main ()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   try
     {
       test ();
@@ -336,29 +336,29 @@ int main ()
   catch (std::exception &e)
     {
       deallog << std::endl << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << e.what() << std::endl
-          << "Aborting!" << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
-                                      // abort
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+      // abort
       return 2;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-          << "Aborting!" << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
-                                      // abort
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+      // abort
       return 3;
     };
-  
-  
+
+
   return 0;
 }
 
index 614476807d98ddc5e617c0fbc139e04796da31e0..d7dfc36f428bfc5fc9ff701e2d334644ce7aeadd 100644 (file)
@@ -30,7 +30,7 @@
 
 template <typename Vector1, typename Vector2>
 bool operator == (const Vector1 &v1,
-                 const Vector2 &v2)
+                  const Vector2 &v2)
 {
   if (v1.size() != v2.size())
     return false;
@@ -48,7 +48,7 @@ void test ()
   ivector[1] = 4;
   ivector[2] = 3;
   ivector[3] = 5;
-  
+
   BlockVector<std::complex<double> > v1(ivector);
   Vector<std::complex<double> > v2(v1.size());
 
@@ -78,7 +78,7 @@ int main ()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   try
     {
       test ();
@@ -86,29 +86,29 @@ int main ()
   catch (std::exception &e)
     {
       deallog << std::endl << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << e.what() << std::endl
-          << "Aborting!" << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
-                                      // abort
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+      // abort
       return 2;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-          << "Aborting!" << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
-                                      // abort
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+      // abort
       return 3;
     };
-  
-  
+
+
   return 0;
 }
 
index 19851d651027603079e913d2a941ef70566615ba..82a7e3e1006bb334b21ed93f1b4be4e0b762f685 100644 (file)
@@ -32,5 +32,5 @@ int main ()
   row_length<CompressedSetSparsityPattern> ();
 }
 
-  
-  
+
+
index ffecb029fa02017b9284a4762a6ffce6caf24f0f..170f8a2f0240b0ad571c3d8722613e5569d456a2 100644 (file)
@@ -32,5 +32,5 @@ int main ()
   print_gnuplot<CompressedSetSparsityPattern> ();
 }
 
-  
-  
+
+
index 2ca9dacc10105d777e76acaf722db531883e3848..974f95f00139f81a4bb9e169bde8d6bd8369b1bb 100644 (file)
@@ -32,5 +32,5 @@ int main ()
   print<CompressedSetSparsityPattern> ();
 }
 
-  
-  
+
+
index 090808009259d0a35aa3e4e05c3733c83b6f8022..c2c5a16a79f81f14b35f69cee4a09e91ff0a883c 100644 (file)
@@ -32,5 +32,5 @@ int main ()
   copy_with_offdiagonals_1<CompressedSetSparsityPattern> ();
 }
 
-  
-  
+
+
index fcf996ecc46dc2617b7ca369e9a5c490be9f0217..5524d43cd8c8af60731407a32748863beb5b2f50 100644 (file)
@@ -32,5 +32,5 @@ int main ()
   copy_with_offdiagonals_2<CompressedSetSparsityPattern> ();
 }
 
-  
-  
+
+
index ae73810241080ffdad8b4586f81203a46cbf3930..58b8a10ea8dc05045ce82cc99276796e12108d89 100644 (file)
@@ -32,5 +32,5 @@ int main ()
   matrix_position<CompressedSetSparsityPattern> ();
 }
 
-  
-  
+
+
index 3f118db8bb668e13700a6557abc4d4e8dbef9948..7247df3180334f36eab90dfd631cc2ea16907121 100644 (file)
@@ -32,5 +32,5 @@ int main ()
   block_read_write<CompressedSetSparsityPattern> ();
 }
 
-  
-  
+
+
index 39632d15f052949e8cfa2f9a7fc6d1f827b94226..2f4c130e7f9138398f81aad8f09980ed77add982 100644 (file)
@@ -32,5 +32,5 @@ int main ()
   row_length<CompressedSparsityPattern> ();
 }
 
-  
-  
+
+
index 22992b05263adf5572b057ff1c27065d80bef7e5..0d6822d9593d9808f2f7213f7c7ac034c2968120 100644 (file)
@@ -32,5 +32,5 @@ int main ()
   print_gnuplot<CompressedSparsityPattern> ();
 }
 
-  
-  
+
+
index aa6f68619741f42024d1a976b734fd1c5d609f01..636b079f9de9915a08610f82daf97c8615397ab4 100644 (file)
@@ -32,5 +32,5 @@ int main ()
   print<CompressedSparsityPattern> ();
 }
 
-  
-  
+
+
index 434c1b35f3b09a7ba2fe1d6512f64ee98a882040..eb5e582a3145679520e0d095a329b078fb0e7ad0 100644 (file)
@@ -32,5 +32,5 @@ int main ()
   copy_with_offdiagonals_1<CompressedSparsityPattern> ();
 }
 
-  
-  
+
+
index a458215ab830287c8494b19f3b14af2350150010..d8515dec03b14856fbbed265097353593c6f142b 100644 (file)
@@ -32,5 +32,5 @@ int main ()
   copy_with_offdiagonals_2<CompressedSparsityPattern> ();
 }
 
-  
-  
+
+
index b3c22df074be555d9e8399d4c614658a9ae763ed..ac154a2058d73327583768bb3f4934c9fc735736 100644 (file)
@@ -32,5 +32,5 @@ int main ()
   matrix_position<CompressedSparsityPattern> ();
 }
 
-  
-  
+
+
index 78c7512baf2103dbb049287d8b6f3ef5d546047c..9bbd7c8aad91eb3d17b7db9526ae818d5359a092 100644 (file)
@@ -32,5 +32,5 @@ int main ()
   block_read_write<CompressedSparsityPattern> ();
 }
 
-  
-  
+
+
index 52e839b66e92a95ae77e39b8aa5ef8dc648b8969..38c9db28b8bc91e62eaa38452c56bb63de7f9102 100644 (file)
@@ -37,13 +37,13 @@ void test ()
 
   ConstraintMatrix cm;
 
-                                  // a "regular" constraint
+  // a "regular" constraint
   cm.add_line (1);
   cm.add_entry (1, 2, 42.);
 
-                                  // a "singular" constraint
+  // a "singular" constraint
   cm.add_line (4);
-  
+
   cm.write_dot (deallog.get_file_stream());
 }
 
@@ -52,12 +52,12 @@ int main ()
 {
   std::ofstream logfile("constraint_graph_zero/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   test ();
-  
+
   deallog << "OK" << std::endl;
 }
index 94c5d8ad56f0fe3beca8c5b6a9179d2b014f223a..a6215d2b7e67e57021abffc427ae57c031a696e1 100644 (file)
@@ -33,26 +33,27 @@ void test ()
   IndexSet rel;
   std::ifstream f("constraints_01/is.23");
   rel.read(f);
-  
+
   ConstraintMatrix cm;
   cm.clear();
   cm.reinit(rel);
 
-  unsigned int inhoms[]={
-8385, 8386, 8391, 17886, 17892, 17895, 18066, 18069, 18072, 18075, 18086, 18089, 18092, 18095, 18138, 18141, 18144, 18147, 18158, 18161, 18164
+  unsigned int inhoms[]=
+  {
+    8385, 8386, 8391, 17886, 17892, 17895, 18066, 18069, 18072, 18075, 18086, 18089, 18092, 18095, 18138, 18141, 18144, 18147, 18158, 18161, 18164
   };
 
-  for (unsigned int i=0;i<sizeof(inhoms) / sizeof(inhoms[0]);++i)
+  for (unsigned int i=0; i<sizeof(inhoms) / sizeof(inhoms[0]); ++i)
     {
       deallog << inhoms[i] << std::endl;
       cm.add_line(inhoms[i]);
       cm.set_inhomogeneity(inhoms[i],1.0);
-    }  
-  
+    }
+
   cm.print (deallog.get_file_stream());
 
   bool is = cm.is_inhomogeneously_constrained(18466);
-  deallog << "constraint 18466 inhom? " << is << std::endl;  
+  deallog << "constraint 18466 inhom? " << is << std::endl;
   Assert(!is, ExcInternalError());
 }
 
@@ -61,12 +62,12 @@ int main ()
 {
   std::ofstream logfile("constraints_01/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   test ();
-  
+
   deallog << "OK" << std::endl;
 }
index 17ffe6d7672399f3a7579139d910ac5aca73d745..dbbbc52378a8a83375e2221c9aea56025b5b514c 100644 (file)
@@ -39,102 +39,101 @@ using namespace dealii;
 
 template <int dim>
 void
-setup_constraints(const DoFHandler<dim>dof_handler)
+setup_constraints(const DoFHandler<dim> &dof_handler)
 {
   ConstraintMatrix     constraints;
   constraints.clear();
-  const FiniteElement<dim>fe = dof_handler.get_fe();
-  
-                                  // Set up derivative constraints to
-                                  // make element C1
+  const FiniteElement<dim> &fe = dof_handler.get_fe();
+
+  // Set up derivative constraints to
+  // make element C1
   std::vector<std::vector<std::vector<double> > > vertex_constraints(
     GeometryInfo<dim>::vertices_per_cell, std::vector<std::vector<double> >(
       dim+1, std::vector<double>(fe.dofs_per_cell, 0.)));
-  
-  for (unsigned int vertex=0;vertex<GeometryInfo<dim>::vertices_per_cell;++vertex)
+
+  for (unsigned int vertex=0; vertex<GeometryInfo<dim>::vertices_per_cell; ++vertex)
     {
       Point<dim> v;
-      for (unsigned int d=0;d<dim;++d)
-       {
-         const unsigned int ds = 1<<d;
-         const unsigned int id = vertex/ds;
-         v[d] = (id%2 != 0) ? 1. : 0.;
-       }
-      
-      for (unsigned int j=0;j<fe.dofs_per_cell;++j)
-       {
-         for (unsigned int d=0;d<dim;++d)
-           {
-             const double f = fe.shape_grad(j,v)[d];
-             if (std::fabs(f) > 1.e-12)
-               vertex_constraints[vertex][d][j] = f;
-           }
-         const double f = fe.shape_grad_grad(j,v)[0][1];
-         if (std::fabs(f) > 1.e-12)
-           vertex_constraints[vertex][dim][j] = f;
-       }      
+      for (unsigned int d=0; d<dim; ++d)
+        {
+          const unsigned int ds = 1<<d;
+          const unsigned int id = vertex/ds;
+          v[d] = (id%2 != 0) ? 1. : 0.;
+        }
+
+      for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
+        {
+          for (unsigned int d=0; d<dim; ++d)
+            {
+              const double f = fe.shape_grad(j,v)[d];
+              if (std::fabs(f) > 1.e-12)
+                vertex_constraints[vertex][d][j] = f;
+            }
+          const double f = fe.shape_grad_grad(j,v)[0][1];
+          if (std::fabs(f) > 1.e-12)
+            vertex_constraints[vertex][dim][j] = f;
+        }
     }
-  
+
   std::vector<types::global_dof_index> cell_indices(fe.dofs_per_cell);
   std::vector<types::global_dof_index> neighbor_indices(fe.dofs_per_cell);
-  
+
   for (typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active();
-       cell != dof_handler.end();++cell)
+       cell != dof_handler.end(); ++cell)
     {
       deallog << "New cell" << std::endl;
-      
+
       cell->get_dof_indices(cell_indices);
-      
-                                      // Do lower left and upper
-                                      // right vertex
-      for (unsigned int face=0;face<GeometryInfo<dim>::faces_per_cell;face+=2)
-      {
-       if (cell->at_boundary(face)) continue;
-       for (unsigned int fvertex=0;fvertex<GeometryInfo<dim>::vertices_per_face;++fvertex)
-           {
-             const unsigned int other_face = (face==0) ? (2+fvertex) : fvertex;
-             if (cell->at_boundary(other_face)) continue;
-             
-             const unsigned int vertex = GeometryInfo<dim>::face_to_cell_vertices(face, fvertex);
-             typename DoFHandler<dim>::active_cell_iterator neighbor = cell->neighbor(other_face);
-             const unsigned int neighbor_face = cell->neighbor_of_neighbor(other_face);
-             neighbor->get_dof_indices(neighbor_indices);
-             unsigned int neighbor_vertex = GeometryInfo<dim>::face_to_cell_vertices(neighbor_face, fvertex);
-             
-             const unsigned int d = GeometryInfo<dim>::unit_normal_direction[other_face];
-             
-             std::vector<std::pair<types::global_dof_index, double> > rhs;
-             const unsigned int constrained = fe.face_to_cell_index(
-               (fvertex == 0) ? 2 : fe.dofs_per_face-1, face);
-             double constrained_weight = 0.;
-             
-             for (unsigned int i=0;i<fe.dofs_per_cell;++i)
-               {
-                 if (i == constrained)
-                   constrained_weight = vertex_constraints[vertex][d][i];
-                 else
-                   if (vertex_constraints[vertex][d][i] != 0.)
-                     rhs.push_back(std::make_pair(cell_indices[i], -vertex_constraints[vertex][d][i]));
-                 if (vertex_constraints[neighbor_vertex][d][i] != 0.)
-                   rhs.push_back(std::make_pair(neighbor_indices[i], vertex_constraints[neighbor_vertex][d][i]));
-               }
-             deallog << " v" << vertex
-                     << " f" << face
-                     << " o" << other_face
-                     << " d" << d
-                     << " l" << constrained
-                     << " g" << cell_indices[constrained]
-//                   << " w " << constrained_weight
-                     << " rhs ";
-             for (unsigned int i=0;i<rhs.size();++i)
-               deallog << ' ' << rhs[i].first;
-             deallog << std::endl;
-             for (unsigned int i=0;i<rhs.size();++i)
-               rhs[i].second /= constrained_weight;
-             constraints.add_line(cell_indices[constrained]);
-             constraints.add_entries(cell_indices[constrained], rhs);
-           }
-       }
+
+      // Do lower left and upper
+      // right vertex
+      for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; face+=2)
+        {
+          if (cell->at_boundary(face)) continue;
+          for (unsigned int fvertex=0; fvertex<GeometryInfo<dim>::vertices_per_face; ++fvertex)
+            {
+              const unsigned int other_face = (face==0) ? (2+fvertex) : fvertex;
+              if (cell->at_boundary(other_face)) continue;
+
+              const unsigned int vertex = GeometryInfo<dim>::face_to_cell_vertices(face, fvertex);
+              typename DoFHandler<dim>::active_cell_iterator neighbor = cell->neighbor(other_face);
+              const unsigned int neighbor_face = cell->neighbor_of_neighbor(other_face);
+              neighbor->get_dof_indices(neighbor_indices);
+              unsigned int neighbor_vertex = GeometryInfo<dim>::face_to_cell_vertices(neighbor_face, fvertex);
+
+              const unsigned int d = GeometryInfo<dim>::unit_normal_direction[other_face];
+
+              std::vector<std::pair<types::global_dof_index, double> > rhs;
+              const unsigned int constrained = fe.face_to_cell_index(
+                                                 (fvertex == 0) ? 2 : fe.dofs_per_face-1, face);
+              double constrained_weight = 0.;
+
+              for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
+                {
+                  if (i == constrained)
+                    constrained_weight = vertex_constraints[vertex][d][i];
+                  else if (vertex_constraints[vertex][d][i] != 0.)
+                    rhs.push_back(std::make_pair(cell_indices[i], -vertex_constraints[vertex][d][i]));
+                  if (vertex_constraints[neighbor_vertex][d][i] != 0.)
+                    rhs.push_back(std::make_pair(neighbor_indices[i], vertex_constraints[neighbor_vertex][d][i]));
+                }
+              deallog << " v" << vertex
+                      << " f" << face
+                      << " o" << other_face
+                      << " d" << d
+                      << " l" << constrained
+                      << " g" << cell_indices[constrained]
+//          << " w " << constrained_weight
+                      << " rhs ";
+              for (unsigned int i=0; i<rhs.size(); ++i)
+                deallog << ' ' << rhs[i].first;
+              deallog << std::endl;
+              for (unsigned int i=0; i<rhs.size(); ++i)
+                rhs[i].second /= constrained_weight;
+              constraints.add_line(cell_indices[constrained]);
+              constraints.add_entries(cell_indices[constrained], rhs);
+            }
+        }
     }
 
   deallog << "Closing" << std::endl;
@@ -152,7 +151,7 @@ setup_constraints(const DoFHandler<dim>& dof_handler)
 
 template <int dim>
 void
-run(const FiniteElement<dim>fe)
+run(const FiniteElement<dim> &fe)
 {
   deallog << "Element: " << fe.get_name() << std::endl;
 
@@ -160,11 +159,11 @@ run(const FiniteElement<dim>& fe)
   GridGenerator::hyper_cube (triangulation, -1, 1);
   triangulation.refine_global(2);
   deallog << "Triangulation "
-         << triangulation.n_active_cells() << " cells, "
-         << triangulation.n_levels() << " levels" << std::endl;
+          << triangulation.n_active_cells() << " cells, "
+          << triangulation.n_levels() << " levels" << std::endl;
   DoFHandler<dim> dof_handler(triangulation);
   dof_handler.distribute_dofs(fe);
-  setup_constraints (dof_handler);  
+  setup_constraints (dof_handler);
 }
 
 
@@ -176,7 +175,7 @@ int main()
   std::ofstream logfile(logname.c_str());
   deallog.attach(logfile);
   deallog.depth_console(0);
-  
+
   FE_Q<2> fe(3);
   run(fe);
 }
index 1518a657c2d3f0c55b2954b6c04091f83d2639cc..8ce8200f4b9912b27fa0167ae397b836643e0d7c 100644 (file)
@@ -39,25 +39,25 @@ run()
   ConstraintMatrix     constraints;
 
   {
-  constraints.add_line(7);
-  std::vector<std::pair<types::global_dof_index, double> > rhs;
-  rhs.push_back(std::pair<types::global_dof_index, double>(41,1.0));
-  rhs.push_back(std::pair<types::global_dof_index, double>(42,1.0));
-  constraints.add_entries(7, rhs);
+    constraints.add_line(7);
+    std::vector<std::pair<types::global_dof_index, double> > rhs;
+    rhs.push_back(std::pair<types::global_dof_index, double>(41,1.0));
+    rhs.push_back(std::pair<types::global_dof_index, double>(42,1.0));
+    constraints.add_entries(7, rhs);
   }
 
   {
-  constraints.add_line(41);
-  std::vector<std::pair<types::global_dof_index, double> > rhs;
-  rhs.push_back(std::pair<types::global_dof_index, double>(42,1.0));
-  constraints.add_entries(41, rhs);
+    constraints.add_line(41);
+    std::vector<std::pair<types::global_dof_index, double> > rhs;
+    rhs.push_back(std::pair<types::global_dof_index, double>(42,1.0));
+    constraints.add_entries(41, rhs);
   }
 
   {
-  constraints.add_line(42);
-  std::vector<std::pair<types::global_dof_index, double> > rhs;
-  rhs.push_back(std::pair<types::global_dof_index, double>(41,1.0));
-  constraints.add_entries(42, rhs);
+    constraints.add_line(42);
+    std::vector<std::pair<types::global_dof_index, double> > rhs;
+    rhs.push_back(std::pair<types::global_dof_index, double>(41,1.0));
+    constraints.add_entries(42, rhs);
   }
 
   deallog << "Closing" << std::endl;
@@ -70,7 +70,7 @@ run()
     {
       deallog << e.get_exc_name() << std::endl;
     }
-  
+
   deallog << "Closed" << std::endl;
 
 }
@@ -84,6 +84,6 @@ int main()
   std::ofstream logfile(logname.c_str());
   deallog.attach(logfile);
   deallog.depth_console(0);
-  
+
   run();
 }
index 562e0157e559b4cf7ce2ebd579d4055b68504ae1..a57ab956269e3501e2a6db6efa668bf651ea3e7c 100644 (file)
@@ -32,25 +32,25 @@ void test ()
 
   ConstraintMatrix cm;
 
-                                  // an inhomogeneous constraint
+  // an inhomogeneous constraint
   cm.add_line (4);
   cm.set_inhomogeneity (4, 3.14159);
 
-                                  // a homogeneous constraint that is
-                                  // constrained to the inhomogeneous one
+  // a homogeneous constraint that is
+  // constrained to the inhomogeneous one
   cm.add_line (1);
   cm.add_entry (1, 2, 42.);
   cm.add_entry (1, 4, 1.);
 
-                                  // and a standard homogeneous constraint
+  // and a standard homogeneous constraint
   cm.add_line (17);
   cm.add_entry(17, 6, 2.);
   cm.add_entry(17, 15, 3.);
 
-                                  // a "singular" constraint
+  // a "singular" constraint
   cm.add_line (3);
 
-                                  // now close the constraint matrix
+  // now close the constraint matrix
   cm.close();
 
   cm.print (deallog.get_file_stream());
@@ -61,12 +61,12 @@ int main ()
 {
   std::ofstream logfile("constraints_inhomogeneous/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   test ();
-  
+
   deallog << "OK" << std::endl;
 }
index b27959c75db33ac064ec7f5a9fcd548339122c73..31c192a31748d196b74f4872330d9255e06566e0 100644 (file)
@@ -37,13 +37,13 @@ void test ()
 
   ConstraintMatrix cm;
 
-                                  // a "regular" constraint
+  // a "regular" constraint
   cm.add_line (1);
   cm.add_entry (1, 2, 42.);
 
-                                  // a "singular" constraint
+  // a "singular" constraint
   cm.add_line (4);
-  
+
   cm.print (deallog.get_file_stream());
 }
 
@@ -52,12 +52,12 @@ int main ()
 {
   std::ofstream logfile("constraints_zero/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   test ();
-  
+
   deallog << "OK" << std::endl;
 }
index 82aa5ba162bd08ea45cc00b9dec7b881c3364a13..d9c2c6fbbfe612a1cc17fc327a66eca4c3cca25e 100644 (file)
 void test ()
 {
 
-                                  // constrain each dof to zero. this
-                                  // should yield a diagonal matrix
+  // constrain each dof to zero. this
+  // should yield a diagonal matrix
   ConstraintMatrix cm;
 
   for (unsigned int i=0; i<5; ++i)
     cm.add_line (i);
   cm.close ();
-  
-                                  // completely fill a 5x5 matrix
-                                  // with some values
+
+  // completely fill a 5x5 matrix
+  // with some values
   SparsityPattern sp (5,5,5);
   for (unsigned int i=0; i<5; ++i)
     for (unsigned int j=0; j<5; ++j)
       sp.add(i,j);
   sp.compress ();
-  
+
   SparseMatrix<double> m(sp);
   for (unsigned int i=0; i<5; ++i)
     for (unsigned int j=0; j<5; ++j)
       m.set(i,j, i+j+2);
 
-                                  // now condense it
+  // now condense it
   cm.condense (m);
 
-                                  // and print it
+  // and print it
   for (unsigned int i=0; i<5; ++i)
     {
       for (unsigned int j=0; j<5; ++j)
-       deallog << m(i,j) << ' ';
+        deallog << m(i,j) << ' ';
       deallog << std::endl;
     }
 }
@@ -72,12 +72,12 @@ int main ()
 {
   std::ofstream logfile("constraints_zero_condense/output");
   deallog << std::setprecision (2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   test ();
-  
+
   deallog << "OK" << std::endl;
 }
index 7907fbfb7fb5531589a07a763852a703cbd8885f..acf174cfd0d075852ce67676bf98c7e7d36081bf 100644 (file)
@@ -34,9 +34,9 @@ void test ()
 
   ConstraintMatrix cm1, cm2;
 
-                                  // a "regular" and a singular
-                                  // constraint to each of the
-                                  // constraint matrices
+  // a "regular" and a singular
+  // constraint to each of the
+  // constraint matrices
   cm1.add_line (1);
   cm1.add_entry (1, 2, 42.);
   cm1.add_line (4);
@@ -59,12 +59,12 @@ int main ()
 {
   std::ofstream logfile("constraints_zero_merge/output");
   logfile.precision(2);
-  
+
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10);  
+  deallog.threshold_double(1.e-10);
 
   test ();
-  
+
   deallog << "OK" << std::endl;
 }
index 4dd8e386d36f520b24f25655d1a03316fa3c462f..6891163a4864a5571cad0c6992de7940eca9a2d7 100644 (file)
@@ -53,7 +53,7 @@ int main()
   ez.set(4,3,14.);
 
   deallog << "FullMatrix<float>::copy_transposed  SparseMatrixEZ<double>"
-         << std::endl;
+          << std::endl;
   FullMatrix<float> ff;
   ff.copy_transposed(ez);
   ff.print_formatted(logfile, 0, false, 5, "~");
index 3b0c928dc8a48121eea0b3409e1f459695b15d0e..c8100383d634dc9e031faabaa0739fda837c0cfb 100644 (file)
 
 int main()
 {
-    std::ofstream logfile("eigen/output");
+  std::ofstream logfile("eigen/output");
 //  logfile.setf(std::ios::fixed);
   deallog << std::setprecision(4);
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   GrowingVectorMemory<> mem;
   SolverControl control(1000, 1.e-5);
-  
+
   const unsigned int size = 10;
   const unsigned int dim = (size-1)*(size-1);
 
-                                  /*
-                                   * Compute minimal and maximal
-                                   * eigenvalues of the 5-point
-                                   * stencil matrix
-                                   * (Hackbusch:Iterative Lösung...,
-                                   * Satz 4.1.1)
-                                   */
+  /*
+   * Compute minimal and maximal
+   * eigenvalues of the 5-point
+   * stencil matrix
+   * (Hackbusch:Iterative Lösung...,
+   * Satz 4.1.1)
+   */
   const double h = 1./size;
   const double s = std::sin(numbers::PI*h/2.);
   const double c = std::cos(numbers::PI*h/2.);
   const double lambda_max = 8.*c*c;
   const double lambda_min = 8.*s*s;
-  
+
   FDMatrix testproblem(size, size);
   SparsityPattern structure(dim, dim, 5);
   testproblem.five_point_structure(structure);
@@ -75,7 +75,7 @@ int main()
 
   double lambda2;
   u = 1.;
-  
+
   EigenPower<> mises2(control, mem, -1.5*lambda);
   mises2.solve(lambda2, A, u);
   deallog << "Eigenvalue " << lambda2 << " Error " << lambda2-lambda_min << std::endl;
@@ -84,16 +84,16 @@ int main()
   lambda = 0.;
   EigenInverse<> wieland(control, mem);
   wieland.solve(lambda, A, u);
-  deallog << "Eigenvalue " << lambda << " Error " << lambda-lambda_min << std::endl;  
+  deallog << "Eigenvalue " << lambda << " Error " << lambda-lambda_min << std::endl;
 
   u = 1.;
   lambda = 10.;
   wieland.solve(lambda, A, u);
-  deallog << "Eigenvalue " << lambda << " Error " << lambda-lambda_max << std::endl;  
+  deallog << "Eigenvalue " << lambda << " Error " << lambda-lambda_max << std::endl;
 
   u = 1.;
   lambda = 10.;
   EigenInverse<> wieland2(control, mem, .2);
   wieland2.solve(lambda, A, u);
-  deallog << "Eigenvalue " << lambda << " Error " << lambda-lambda_max << std::endl;  
+  deallog << "Eigenvalue " << lambda << " Error " << lambda-lambda_max << std::endl;
 }
index f5527f4f5d4ab504cd406a958755ac1bfb6e4f6d..15e5ad63cd52a9a02d45bd98ebb009848f079e63 100644 (file)
 
 
 template<class VECTOR>
-void test (const FilteredMatrix<VECTOR>M)
+void test (const FilteredMatrix<VECTOR> &M)
 {
   deallog << "Iterator";
-  
+
   unsigned int max = 0;
   for (typename FilteredMatrix<VECTOR>::const_iterator i= M.begin();
-       i != M.end();++i)
+       i != M.end(); ++i)
     {
       Assert(i->row() == i->column(), ExcInternalError());
       deallog << ' ' << i->row() << ':' << i->value();
@@ -42,42 +42,42 @@ void test (const FilteredMatrix<VECTOR>& M)
     }
   VECTOR v(max+1);
   VECTOR w(max+1);
-  
-  for (unsigned int i=0;i<v.size();++i)
+
+  for (unsigned int i=0; i<v.size(); ++i)
     v(i) = 31+i;
 
   deallog << std::endl << "vmult ";
 
   w = 0.;
   M.vmult(w,v);
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << w(i);
-  
+
   deallog << std::endl << "Tvmult";
-  
+
   w = 0.;
   M.Tvmult(w,v);
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << w(i);
-  
+
   deallog << std::endl << "vmult_add";
-  
+
   M.vmult_add(w,v);
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << w(i);
 
   deallog << std::endl << "boundary";
-  
+
   M.apply_constraints(w, true);
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << w(i);
 
   deallog << std::endl << "boundary";
-  
+
   M.apply_constraints(w, false);
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << w(i);
-  
+
   deallog << std::endl;
 }
 
@@ -88,19 +88,19 @@ int main()
   std::ofstream logfile("filtered_matrix/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  
+
   PreconditionIdentity identity;
   ScaledMatrix<Vector<double> > s(identity, 3.);
-  
+
   FilteredMatrix<Vector<double> > f;
   f.initialize(s, false);
   test(f);
 
-  for (unsigned int i=0;i<5;++i)
+  for (unsigned int i=0; i<5; ++i)
     f.add_constraint(i*i,i/2.);
   test(f);
-  
+
   f.initialize(s, true);
   test(f);
-  
+
 }
index f8c5947baff549112637939bbf13f403053c6f36..8c57a49c3abb15777650fa9222b39e57778d4f84 100644 (file)
@@ -32,14 +32,14 @@ const double entries[9] = { 11,12,13,21,22,23,31,32,33 };
 
 // Create a positive definite random matrix
 
-void random_matrix(FullMatrix<double>A)
+void random_matrix(FullMatrix<double> &A)
 {
-  for (unsigned int i=0; i<A.m();++i)
-    for (unsigned int j=0; j<A.n();++j)
+  for (unsigned int i=0; i<A.m(); ++i)
+    for (unsigned int j=0; j<A.n(); ++j)
       {
-       double rnd = std::rand();
-       rnd /= RAND_MAX;
-       A(i,j) = (i==j) ? A.m()+rnd : rnd;
+        double rnd = std::rand();
+        rnd /= RAND_MAX;
+        A(i,j) = (i==j) ? A.m()+rnd : rnd;
       }
 }
 
@@ -62,9 +62,9 @@ main ()
   while (it != end)
     {
       deallog << "Row " << it->row()
-             << "\tCol " << it->column()
-             << "\tVal " << it->value()
-             << std::endl;
+              << "\tCol " << it->column()
+              << "\tVal " << it->value()
+              << std::endl;
       ++it;
     }
 
@@ -73,34 +73,34 @@ main ()
   while (it != end)
     {
       deallog << "Row " << it->row()
-             << "\tCol " << it->column()
-             << "\tVal " << it->value()
-             << std::endl;
+              << "\tCol " << it->column()
+              << "\tVal " << it->value()
+              << std::endl;
       ++it;
-    }  
-  
-  for (unsigned int i=1;i<10;++i)
+    }
+
+  for (unsigned int i=1; i<10; ++i)
     {
       FullMatrix<double> A(i,i), B(i,i);
-                                      // Create matrix and its inverse
+
+      // Create matrix and its inverse
       random_matrix(A);
       B.invert(A);
 
-                                      // Check if unit vectors are recovered
+      // Check if unit vectors are recovered
       deallog << "Inverse(dim=" << i <<"):";
-      for (unsigned int j=0;j<i;++j)
-       {
-         Vector<double> x(i);
-         Vector<double> y(i);
-         Vector<double> z(i);
-         x(j) = 1.;
-         A.vmult(y,x);
-         B.vmult(z,y);
-         z.add(-1.,x);
-         double a = z.l2_norm();
-         if (a > 1.e-12) deallog << a << ' ';
-       }
+      for (unsigned int j=0; j<i; ++j)
+        {
+          Vector<double> x(i);
+          Vector<double> y(i);
+          Vector<double> z(i);
+          x(j) = 1.;
+          A.vmult(y,x);
+          B.vmult(z,y);
+          z.add(-1.,x);
+          double a = z.l2_norm();
+          if (a > 1.e-12) deallog << a << ' ';
+        }
       deallog << std::endl;
     }
 
@@ -114,76 +114,76 @@ main ()
       D(4,4) = 5.;
 
       A = D;
-  
-      for (unsigned int i=0;i<4;++i)
-       {
-                                          // Setup rotation matrix
-         C = 0;
-         C.diagadd(1.);
-         C(i,i) = C(i+1,i+1) = std::cos(i+1.);
-         C(i+1,i) = std::sin(i+1.);
-         C(i,i+1) = -std::sin(i+1.);
-         
-         C.print_formatted (logfile,3,false);
-         deallog << "l1-norm: " << C.l1_norm() << std::endl;
-         D = C;
-         D.gauss_jordan();
-         D.print_formatted (logfile,3,false);
-         deallog << "linfty-norm: " << D.linfty_norm() << std::endl
-                 << "Frobenius-norm: " << D.frobenius_norm() << std::endl;
-         
-                                          // Rotate original matrix
-         A.mmult(H,C);
-         C.Tmmult(A,H);
-       }
-      
+
+      for (unsigned int i=0; i<4; ++i)
+        {
+          // Setup rotation matrix
+          C = 0;
+          C.diagadd(1.);
+          C(i,i) = C(i+1,i+1) = std::cos(i+1.);
+          C(i+1,i) = std::sin(i+1.);
+          C(i,i+1) = -std::sin(i+1.);
+
+          C.print_formatted (logfile,3,false);
+          deallog << "l1-norm: " << C.l1_norm() << std::endl;
+          D = C;
+          D.gauss_jordan();
+          D.print_formatted (logfile,3,false);
+          deallog << "linfty-norm: " << D.linfty_norm() << std::endl
+                  << "Frobenius-norm: " << D.frobenius_norm() << std::endl;
+
+          // Rotate original matrix
+          A.mmult(H,C);
+          C.Tmmult(A,H);
+        }
+
       A.print_formatted (logfile,3,false);
-      
+
       Vector<double> u(5);
       GrowingVectorMemory<Vector<double> > mem;
-      
+
       SolverControl control (500,1.e-8, false, false);
-      
+
       if (true)
-       {
-         u = 1.;
-         EigenPower<Vector<double> >
-           von_Mises(control, mem, 0.);
-         double eigen = 0.;
-         von_Mises.solve(eigen, A, u);
-         deallog << "Eigenvalue: " << eigen << std::endl;
-       }
+        {
+          u = 1.;
+          EigenPower<Vector<double> >
+          von_Mises(control, mem, 0.);
+          double eigen = 0.;
+          von_Mises.solve(eigen, A, u);
+          deallog << "Eigenvalue: " << eigen << std::endl;
+        }
       if (true)
-       {
-         u = 1.;
-         EigenPower<Vector<double> >
-           von_Mises(control, mem, -4.);
-         double eigen = 0.;
-         von_Mises.solve(eigen, A, u);
-         deallog << "Eigenvalue: " << eigen << std::endl;
-       }
+        {
+          u = 1.;
+          EigenPower<Vector<double> >
+          von_Mises(control, mem, -4.);
+          double eigen = 0.;
+          von_Mises.solve(eigen, A, u);
+          deallog << "Eigenvalue: " << eigen << std::endl;
+        }
       H = A;
       H.gauss_jordan();
       H.print_formatted (logfile,3,false);
       if (true)
-       {
-         u = 1.;
-         EigenPower<Vector<double> >
-           von_Mises(control, mem, 0.);
-         double eigen = 0.;
-         von_Mises.solve(eigen, H, u);
-         deallog << "Eigenvalue: " << eigen << std::endl;
-       }
+        {
+          u = 1.;
+          EigenPower<Vector<double> >
+          von_Mises(control, mem, 0.);
+          double eigen = 0.;
+          von_Mises.solve(eigen, H, u);
+          deallog << "Eigenvalue: " << eigen << std::endl;
+        }
       if (true)
-       {
-         u = 1.;
-         EigenPower<Vector<double> >
-           von_Mises(control, mem, -4.);
-         double eigen = 0.;
-         von_Mises.solve(eigen, H, u);
-         deallog << "Eigenvalue: " << eigen << std::endl;
-       }
+        {
+          u = 1.;
+          EigenPower<Vector<double> >
+          von_Mises(control, mem, -4.);
+          double eigen = 0.;
+          von_Mises.solve(eigen, H, u);
+          deallog << "Eigenvalue: " << eigen << std::endl;
+        }
     }
 }
 
-      
+
index 8987776294f11a5a1418b91cb097af47b84a7d08..a2f4ce0fe43958db0f909082cf92a5e53bfec923 100644 (file)
@@ -51,14 +51,14 @@ main ()
   FullMatrix<double> Z(3,3,entries_Z);
   FullMatrix<double> C(3,3);
   FullMatrix<double> D(3,3);
+
   //compute C= A*B^T in two different ways and compare for equality
   Z.Tadd(1.,B);
   A.mmult(D,Z);
   A.mTmult(C,B);
-  
+
   D.add(-1,C);
   Assert ( D.frobenius_norm() < 1e-15,
            ExcInternalError());
   deallog << "OK" << std::endl;
-}    
+}
index 91e1feac5e09997eff44b2111516358bc0c21b42..28fd94761776ea32ad1833d9b01b9f9ab370b815 100644 (file)
@@ -52,15 +52,15 @@ main ()
   FullMatrix<double> Zb(3,3,entries_Z);
   FullMatrix<double> C(3,3);
   FullMatrix<double> D(3,3);
+
   //compute C= A^T*B^T in two different ways and compare for equality
   Za.Tadd(1.,A);
   Zb.Tadd(1.,B);
   Za.mmult(D,Zb);
   A.TmTmult(C,B);
-  
+
   D.add(-1,C);
   Assert ( D.frobenius_norm() < 1e-15,
            ExcInternalError());
   deallog << "OK" << std::endl;
-}    
+}
index c734596baccf31b69490e214af6a76a263a74178..3844b8845035f3f3639d9ffce3b294ccc57e11cb 100644 (file)
@@ -29,7 +29,7 @@
 #include <deal.II/lac/full_matrix.h>
 #include <deal.II/lac/eigen.h>
 
-void diff(FullMatrix<double>M)
+void diff(FullMatrix<double> &M)
 {
   const double err = M.frobenius_norm();
   if (err < 1.e-14)
@@ -41,7 +41,7 @@ void diff(FullMatrix<double>& M)
 
 void test (const unsigned int n, const unsigned int m)
 {
-                                  // Create some random matrices
+  // Create some random matrices
   FullMatrix<double> A(n,n);
   FullMatrix<double> C(m,m);
   FullMatrix<double> B(n,m);
@@ -49,22 +49,22 @@ void test (const unsigned int n, const unsigned int m)
   FullMatrix<double> Bt(m,n);
   FullMatrix<double> Dt(n,m);
 
-  for (unsigned int i=0;i<n;++i)
+  for (unsigned int i=0; i<n; ++i)
     {
-      for (unsigned int j=0;j<n;++j)
-       A(i,j) = std::rand();
-      for (unsigned int j=0;j<m;++j)
-       {
-         B(i,j) = Bt(j,i) = std::rand();
-         D(j,i) = Dt(i,j) = std::rand();
-       }
+      for (unsigned int j=0; j<n; ++j)
+        A(i,j) = std::rand();
+      for (unsigned int j=0; j<m; ++j)
+        {
+          B(i,j) = Bt(j,i) = std::rand();
+          D(j,i) = Dt(i,j) = std::rand();
+        }
     }
-  for (unsigned int i=0;i<m;++i)
-    for (unsigned int j=0;j<m;++j)
+  for (unsigned int i=0; i<m; ++i)
+    for (unsigned int j=0; j<m; ++j)
       C(i,j) = std::rand();
 
-                                  // Compare first Schur complement
-                                  // with mmult.
+  // Compare first Schur complement
+  // with mmult.
   FullMatrix<double> S1(m,m);
   S1.triple_product(A, D, B, false, false);
 
@@ -75,8 +75,8 @@ void test (const unsigned int n, const unsigned int m)
   aux2.add(-1., S1);
   diff(aux2);
 
-                                  // Compare second Schur complement
-                                  // with mmult
+  // Compare second Schur complement
+  // with mmult
   FullMatrix<double> S2(n,n);
   S2.triple_product(C, B, D, false, false);
 
@@ -87,7 +87,7 @@ void test (const unsigned int n, const unsigned int m)
   aux4.add(-1., S2);
   diff(aux4);
 
-                                  // Check transpose versions
+  // Check transpose versions
   aux2 = 0.;
   aux2.triple_product(A, Dt, B, true, false);
   aux2.add(-1., S1);
index 1a4e2fa73d6ce309376a94c44e150058de31a8a9..914d3d344b28a3e7f18aa87dc675f3a0c61c3dc3 100644 (file)
 
 void test ()
 {
-                                  // create a matrix with known
-                                  // elements
+  // create a matrix with known
+  // elements
   FullMatrix<double> A(10,12);
   for (unsigned int i=0; i<A.m(); ++i)
     for (unsigned int j=0; j<A.n(); ++j)
       A(i,j) = i+j;
 
-                                  // pick every other row and column
+  // pick every other row and column
   std::vector<types::global_dof_index> rows (A.m()/2);
   for (unsigned int i=0; i<rows.size(); ++i)
     rows[i] = 2*i;
@@ -45,16 +45,16 @@ void test ()
   for (unsigned int i=0; i<cols.size(); ++i)
     cols[i] = 2*i;
 
-                                  // do the extraction
+  // do the extraction
   FullMatrix<double> X(rows.size(), cols.size());
   X.extract_submatrix_from (A, rows, cols);
 
-                                  // verify that the elements are
-                                  // correct
+  // verify that the elements are
+  // correct
   for (unsigned int i=0; i<X.m(); ++i)
     for (unsigned int j=0; j<X.n(); ++j)
       Assert (X(i,j) == 2*i + 2*j,
-             ExcInternalError());
+              ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
index 7f4cfc3a6bd47a0fada3dcb9bf3dbfe2adcf8bd1..e8d3d2e5c0bc3aca99f699bed13ef9bd10682010 100644 (file)
 
 void test ()
 {
-                                  // create a matrix with known
-                                  // elements
+  // create a matrix with known
+  // elements
   FullMatrix<double> A(5,6);
   for (unsigned int i=0; i<A.m(); ++i)
     for (unsigned int j=0; j<A.n(); ++j)
       A(i,j) = i+j;
 
-                                  // pick every other row and column
+  // pick every other row and column
   std::vector<types::global_dof_index> rows (A.m());
   for (unsigned int i=0; i<rows.size(); ++i)
     rows[i] = 2*i;
@@ -45,20 +45,20 @@ void test ()
   for (unsigned int i=0; i<cols.size(); ++i)
     cols[i] = 2*i;
 
-                                  // do the scatter
+  // do the scatter
   FullMatrix<double> X(rows.size()*2, cols.size()*2);
   A.scatter_matrix_to (rows, cols, X);
 
-                                  // verify that the elements are
-                                  // correct
+  // verify that the elements are
+  // correct
   for (unsigned int i=0; i<X.m(); ++i)
     for (unsigned int j=0; j<X.n(); ++j)
       if ((i % 2 == 0) && (j % 2 == 0))
-       Assert (X(i,j) == i/2 + j/2,
-               ExcInternalError())
-       else
-       Assert (X(i,j) == 0,
-               ExcInternalError());
+        Assert (X(i,j) == i/2 + j/2,
+                ExcInternalError())
+        else
+          Assert (X(i,j) == 0,
+                  ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
index 530d7e1f58e2e3c8daa10da40c060a148988dcb9..47173505f5853237ac33f0b0e6c2beb17acffb6b 100644 (file)
@@ -43,12 +43,12 @@ main ()
   FullMatrix<double> A(3,3,entries_A);
   FullMatrix<double> C(3,3);
   FullMatrix<double> D(3,3,compare);
+
   //compute C= A*A^T
   A.mTmult(C,A);
 
   C.add(-1., D);
   Assert(C.frobenius_norm() < 1e-12, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
-}    
+}
index 8fbf77a0017fc151fa55f6780e55648fb723702d..500f458427d3c7962b38afb9f116d9f0a88e1102 100644 (file)
@@ -43,12 +43,12 @@ main ()
   FullMatrix<double> A(3,3,entries_A);
   FullMatrix<double> C(3,3);
   FullMatrix<double> D(3,3,compare);
+
   //compute C= A^T*A
   A.Tmmult(C,A);
 
   C.add(-1., D);
   Assert(C.frobenius_norm() < 1e-12, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
-}    
+}
index 3a69c591d94a08719f46985678d9eb0dfc79a954..eec4721a7b877684d861b2aab15b9677e7c7d4d2 100644 (file)
@@ -39,7 +39,7 @@ main ()
   deallog.threshold_double(1.e-10);
 
   logfile << numbers::PI << std::endl;
-  
+
   FullMatrix<double> T(3,3,entries);
 
   // try writing to a regular stream
@@ -55,4 +55,4 @@ main ()
   logfile << numbers::PI << std::endl;
 }
 
-      
+
index 4aef7e48f8de0c36b758708fcee6241130178d78..a889289508536677e961908880af46775cdb365c 100644 (file)
 // reimplements things from vector.templates.h in another way which is more
 // prone to roundoff, the linker will select this version instead of the one
 // in the deal.II library
-namespace dealii{
-template <typename Number>
-template <typename Number2>
-Number Vector<Number>::operator* (const Vector<Number2> &v) const
+namespace dealii
 {
-  Number sum = 0;
-  for (unsigned int i=0; i<size(); ++i)
-    sum += val[i] * v.val[i];
-  return sum;
-}
-template <typename Number>
-typename Vector<Number>::real_type Vector<Number>::l2_norm () const
-{
-  real_type sum = 0;
-  for (unsigned int i=0; i<size(); ++i)
-    sum += val[i] * val[i];
-  return std::sqrt(sum);
-}
+  template <typename Number>
+  template <typename Number2>
+  Number Vector<Number>::operator* (const Vector<Number2> &v) const
+  {
+    Number sum = 0;
+    for (unsigned int i=0; i<size(); ++i)
+      sum += val[i] * v.val[i];
+    return sum;
+  }
+  template <typename Number>
+  typename Vector<Number>::real_type Vector<Number>::l2_norm () const
+  {
+    real_type sum = 0;
+    for (unsigned int i=0; i<size(); ++i)
+      sum += val[i] * val[i];
+    return std::sqrt(sum);
+  }
 }
 
 
index f3774c4f383dd8f88e5854e21fd40f981788820f..616bdfd4085acd1f31ec6f079f7742159ddab8ab 100644 (file)
 // reimplements things from vector.templates.h in another way which is more
 // prone to roundoff, the linker will select this version instead of the one
 // in the deal.II library
-namespace dealii{
-template <typename Number>
-template <typename Number2>
-Number Vector<Number>::operator* (const Vector<Number2> &v) const
+namespace dealii
 {
-  Number sum = 0;
-  for (unsigned int i=0; i<size(); ++i)
-    sum += val[i] * v.val[i];
-  return sum;
-}
-template <typename Number>
-typename Vector<Number>::real_type Vector<Number>::l2_norm () const
-{
-  real_type sum = 0;
-  for (unsigned int i=0; i<size(); ++i)
-    sum += val[i] * val[i];
-  return std::sqrt(sum);
-}
+  template <typename Number>
+  template <typename Number2>
+  Number Vector<Number>::operator* (const Vector<Number2> &v) const
+  {
+    Number sum = 0;
+    for (unsigned int i=0; i<size(); ++i)
+      sum += val[i] * v.val[i];
+    return sum;
+  }
+  template <typename Number>
+  typename Vector<Number>::real_type Vector<Number>::l2_norm () const
+  {
+    real_type sum = 0;
+    for (unsigned int i=0; i<size(); ++i)
+      sum += val[i] * val[i];
+    return std::sqrt(sum);
+  }
 }
 
 
index e75cfd4ce66938050d9c248f7d86d029aee4fb0e..1e5b74ed4d0674696b3f824df5eaeea4d77da23e 100644 (file)
@@ -28,9 +28,9 @@
 
 const double rect[] =
 {
-      4., 3., 2., 1.,
-      5., 8., 1., -2.,
-      11., 13., -4., -5
+  4., 3., 2., 1.,
+  5., 8., 1., -2.,
+  11., 13., -4., -5
 };
 
 
@@ -40,15 +40,15 @@ int main()
   deallog << std::setprecision(3);
   deallog.attach(logfile);
   deallog.depth_console(0);
-  
+
   FullMatrix<double> A(4,3,rect);
   Householder<double> H(A);
-  
+
   Vector<double> u(4);
   Vector<double> v1(3);
-  Vector<double> v2(3);  
-  
-  for (unsigned int i=0;i<u.size();++i)
+  Vector<double> v2(3);
+
+  for (unsigned int i=0; i<u.size(); ++i)
     u(i) = i*i;
   deallog << "Distance " << H.least_squares(v1,u) << std::endl;
 }
index f38ec9949bfd66b7c41f3d87b78af933d6e81a24..5f52004b0b732cb8f1ee307b0cab25707de8818d 100644 (file)
@@ -35,32 +35,32 @@ check_vmult()
   Vector<number> u(4);
   Vector<number> v(4);
 
-  for (unsigned int i=0;i<4;++i)
+  for (unsigned int i=0; i<4; ++i)
     u(i) = i+1;
-  
+
   M.vmult(v,u);
   Assert (v == u, ExcInternalError());
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v(i);
   deallog << std::endl;
 
   M.vmult_add(v,u);
   v /= 2;
   Assert (v == u, ExcInternalError());
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v(i);
   deallog << std::endl;
 
   M.Tvmult(v,u);
   Assert (v == u, ExcInternalError());
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v(i);
   deallog << std::endl;
 
   M.Tvmult_add(v,u);
   v /= 2;
   Assert (v == u, ExcInternalError());
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v(i);
   deallog << std::endl;
 }
@@ -74,7 +74,7 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   check_vmult<double>();
   check_vmult<float>();
 }
index 779273195eb50685e05f83e80fd2bd722c5a18a4..9dc5153c40a3074300cdef67b40ef5f5741dfa13 100644 (file)
@@ -36,32 +36,32 @@ check_vmult()
   Vector<number> u(4);
   Vector<number> v(4);
 
-  for (unsigned int i=0;i<4;++i)
+  for (unsigned int i=0; i<4; ++i)
     u(i) = i+1;
-  
+
   M.vmult(v,u);
   Assert (v == u, ExcInternalError());
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v(i);
   deallog << std::endl;
 
   M.vmult_add(v,u);
   v /= 2;
   Assert (v == u, ExcInternalError());
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v(i);
   deallog << std::endl;
 
   M.Tvmult(v,u);
   Assert (v == u, ExcInternalError());
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v(i);
   deallog << std::endl;
 
   M.Tvmult_add(v,u);
   v /= 2;
   Assert (v == u, ExcInternalError());
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v(i);
   deallog << std::endl;
 }
@@ -75,7 +75,7 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   check_vmult<double>();
   check_vmult<float>();
 }
index aede2733148b5d6c7aeb4cf56997fa134d2b37b7..a582bfdab2cf4e69d071926358d74202ed6a8e27 100644 (file)
@@ -37,32 +37,32 @@ check_vmult()
   Vector<number> u(4);
   Vector<number> v(4);
 
-  for (unsigned int i=0;i<4;++i)
+  for (unsigned int i=0; i<4; ++i)
     u(i) = i+1;
-  
+
   M.vmult(v,u);
   Assert (v == u, ExcInternalError());
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v(i);
   deallog << std::endl;
 
   M.vmult_add(v,u);
   v /= 2;
   Assert (v == u, ExcInternalError());
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v(i);
   deallog << std::endl;
 
   M.Tvmult(v,u);
   Assert (v == u, ExcInternalError());
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v(i);
   deallog << std::endl;
 
   M.Tvmult_add(v,u);
   v /= 2;
   Assert (v == u, ExcInternalError());
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v(i);
   deallog << std::endl;
 }
@@ -76,7 +76,7 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   check_vmult<double>();
   check_vmult<float>();
 }
index b538fa872fd704f1e8112a966c8f301305b877ed..36befdf1a7148582be2ac3a86a5a545273c33daa 100644 (file)
@@ -36,37 +36,37 @@ check_vmult()
   for (unsigned int i=0; i<4; ++i)
     sp.add (i,i);
   sp.compress ();
-  
+
   SparseMatrix<number> M(sp, IdentityMatrix(4));
   Vector<number> u(4);
   Vector<number> v(4);
 
-  for (unsigned int i=0;i<4;++i)
+  for (unsigned int i=0; i<4; ++i)
     u(i) = i+1;
-  
+
   M.vmult(v,u);
   Assert (v == u, ExcInternalError());
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v(i);
   deallog << std::endl;
 
   M.vmult_add(v,u);
   v /= 2;
   Assert (v == u, ExcInternalError());
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v(i);
   deallog << std::endl;
 
   M.Tvmult(v,u);
   Assert (v == u, ExcInternalError());
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v(i);
   deallog << std::endl;
 
   M.Tvmult_add(v,u);
   v /= 2;
   Assert (v == u, ExcInternalError());
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v(i);
   deallog << std::endl;
 }
@@ -80,7 +80,7 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   check_vmult<double>();
   check_vmult<float>();
 }
index f8c9daebd7c9292ee6650df1a1bbaea6abb46602..792cc5b6da47ecbd859eac2c237a02a25995fa5e 100644 (file)
@@ -36,38 +36,38 @@ check_vmult()
   for (unsigned int i=0; i<4; ++i)
     sp.add (i,i);
   sp.compress ();
-  
+
   SparseMatrix<number> M(sp);
   M = IdentityMatrix(4);
   Vector<number> u(4);
   Vector<number> v(4);
 
-  for (unsigned int i=0;i<4;++i)
+  for (unsigned int i=0; i<4; ++i)
     u(i) = i+1;
-  
+
   M.vmult(v,u);
   Assert (v == u, ExcInternalError());
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v(i);
   deallog << std::endl;
 
   M.vmult_add(v,u);
   v /= 2;
   Assert (v == u, ExcInternalError());
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v(i);
   deallog << std::endl;
 
   M.Tvmult(v,u);
   Assert (v == u, ExcInternalError());
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v(i);
   deallog << std::endl;
 
   M.Tvmult_add(v,u);
   v /= 2;
   Assert (v == u, ExcInternalError());
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v(i);
   deallog << std::endl;
 }
@@ -81,7 +81,7 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   check_vmult<double>();
   check_vmult<float>();
 }
index 34c028b5e53922264f3d3cf2c091f5e307a7531d..baddaa2e25a745d1a9428601994f01e41599fd54 100644 (file)
@@ -40,32 +40,32 @@ check_vmult()
   Vector<number> u(4);
   Vector<number> v(4);
 
-  for (unsigned int i=0;i<4;++i)
+  for (unsigned int i=0; i<4; ++i)
     u(i) = i+1;
 
   M.vmult(v,u);
   Assert (v == u, ExcInternalError());
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v(i);
   deallog << std::endl;
 
   M.vmult_add(v,u);
   v /= 2;
   Assert (v == u, ExcInternalError());
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v(i);
   deallog << std::endl;
 
   M.Tvmult(v,u);
   Assert (v == u, ExcInternalError());
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v(i);
   deallog << std::endl;
 
   M.Tvmult_add(v,u);
   v /= 2;
   Assert (v == u, ExcInternalError());
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v(i);
   deallog << std::endl;
 }
index 7e5cd6eda67950867891435a406f1b5efb43a7f8..8d35d1addd449ae88dbd2f8c83bc2b471e660167 100644 (file)
@@ -33,7 +33,7 @@
 
 
 
-void test () 
+void test ()
 {
   std::ofstream logfile("is_block_matrix/output");
   deallog << std::fixed;
@@ -43,24 +43,24 @@ void test ()
   deallog.threshold_double(1.e-10);
 
   deallog << IsBlockMatrix<SparseMatrix<double> >::value << ' '
-         << IsBlockMatrix<SparseMatrix<float> >::value << ' '
-         << IsBlockMatrix<SparseMatrixEZ<double> >::value << ' '
-         << IsBlockMatrix<SparseMatrixEZ<float> >::value << std::endl;
-  
+          << IsBlockMatrix<SparseMatrix<float> >::value << ' '
+          << IsBlockMatrix<SparseMatrixEZ<double> >::value << ' '
+          << IsBlockMatrix<SparseMatrixEZ<float> >::value << std::endl;
+
   deallog << IsBlockMatrix<BlockSparseMatrix<double> >::value << ' '
-         << IsBlockMatrix<BlockSparseMatrix<float> >::value << ' '
-         << IsBlockMatrix<BlockSparseMatrixEZ<double> >::value << ' '
-         << IsBlockMatrix<BlockSparseMatrixEZ<float> >::value << std::endl;
+          << IsBlockMatrix<BlockSparseMatrix<float> >::value << ' '
+          << IsBlockMatrix<BlockSparseMatrixEZ<double> >::value << ' '
+          << IsBlockMatrix<BlockSparseMatrixEZ<float> >::value << std::endl;
 
   deallog << IsBlockMatrix<SparsityPattern>::value << ' '
-         << IsBlockMatrix<CompressedSparsityPattern>::value << ' '
-         << IsBlockMatrix<CompressedSetSparsityPattern>::value << ' '
-         << IsBlockMatrix<CompressedSimpleSparsityPattern>::value << std::endl;
+          << IsBlockMatrix<CompressedSparsityPattern>::value << ' '
+          << IsBlockMatrix<CompressedSetSparsityPattern>::value << ' '
+          << IsBlockMatrix<CompressedSimpleSparsityPattern>::value << std::endl;
 
   deallog << IsBlockMatrix<BlockSparsityPattern>::value << ' '
-         << IsBlockMatrix<BlockCompressedSparsityPattern>::value << ' '
-         << IsBlockMatrix<BlockCompressedSetSparsityPattern>::value << ' '
-         << IsBlockMatrix<BlockCompressedSimpleSparsityPattern>::value << std::endl;
+          << IsBlockMatrix<BlockCompressedSparsityPattern>::value << ' '
+          << IsBlockMatrix<BlockCompressedSetSparsityPattern>::value << ' '
+          << IsBlockMatrix<BlockCompressedSimpleSparsityPattern>::value << std::endl;
 }
 
 
@@ -75,28 +75,28 @@ int main ()
   catch (std::exception &e)
     {
       std::cerr << std::endl << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << e.what() << std::endl
-          << "Aborting!" << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
-                                      // abort
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+      // abort
       return 2;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-          << "Aborting!" << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
-                                      // abort
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+      // abort
       return 3;
     };
-  
-  
+
+
   return 0;
 }
index c6813d93b2136fefee5fd58cf478d3d23484ff51..c469d715fc87edc0f34e6abd67e4f0e1aa927639 100644 (file)
@@ -38,9 +38,9 @@ void test ()
   deallog.threshold_double(1.e-10);
 
   deallog << IsBlockVector<Vector<double> >::value << ' '
-         << IsBlockVector<Vector<float> >::value << ' '
-         << IsBlockVector<BlockVector<double> >::value << ' '
-         << IsBlockVector<BlockVector<float> >::value << std::endl;
+          << IsBlockVector<Vector<float> >::value << ' '
+          << IsBlockVector<BlockVector<double> >::value << ' '
+          << IsBlockVector<BlockVector<float> >::value << std::endl;
 }
 
 
@@ -55,25 +55,25 @@ int main ()
   catch (std::exception &e)
     {
       std::cerr << std::endl << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << e.what() << std::endl
-          << "Aborting!" << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
-                                      // abort
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+      // abort
       return 2;
     }
   catch (...)
     {
       std::cerr << std::endl << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-          << "Aborting!" << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
-                                      // abort
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+      // abort
       return 3;
     };
 
index 726f46e1ae5b4f2c1d58f5e9ab71b27e5edf56af..1970244a99c4d27a88d2cff06458d42620ca1284 100644 (file)
 // the additional Information: Index 6 is not in [0,3[.
 // Bug reported by Florian Prill
 
-int main () 
+int main ()
 {
   std::ofstream logfile("lapack_fill/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  
-                                  // matrix sizes
+
+  // matrix sizes
   const unsigned int m = 3;
-  const unsigned int n = 10;       
+  const unsigned int n = 10;
 
   LAPACKFullMatrix<double> A(n);
   FullMatrix<double>       C(m);
-                                  // fill some entries:
+  // fill some entries:
   C(0,0)     = 1.0;
   C(m-1,m-1) = 1.0;
-                                  // insert C into A's middle:
+  // insert C into A's middle:
   A.fill(C,
-        3,3,
-        0,0);
-                                  // check some values
+         3,3,
+         0,0);
+  // check some values
   Assert(A(3,3)==1, ExcInternalError());
   Assert(A(5,5)==1, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
index 333ef3db9eb5228648bb111c645891c886f469d1..c0ab9ecf5f4522a8a3ff5db1b015b4db006acfa2 100644 (file)
@@ -36,7 +36,7 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   SparseMatrixEZ<double> ez(5,4);
   ez.set(0,0,2.);
   ez.set(0,2,3.);
@@ -51,26 +51,26 @@ int main()
   ez.set(4,0,12.);
   ez.set(4,2,13.);
   ez.set(4,3,14.);
-  
+
   deallog << "FullMatrix<float>::copy_from  SparseMatrixEZ<double>"
-         << std::endl;
+          << std::endl;
   FullMatrix<float> ff;
   ff.copy_from(ez);
   ff.print_formatted(logfile, 0, false, 5, "~");
-  
+
   deallog << "LAPACKFullMatrix<double>::copy_from  SparseMatrixEZ<double>"
-         << std::endl;
+          << std::endl;
   LAPACKFullMatrix<double> lfd;
   lfd.copy_from(ez);
   lfd.print_formatted(logfile, 0, false, 5, "~");
 
   lfd.reinit(2, 3);
   deallog << "LAPACKFullMatrix<double>::fill  SparseMatrixEZ<double>"
-         << std::endl;
+          << std::endl;
   lfd.fill(ez, 0, 0, 2, 1);
   lfd.print_formatted(logfile, 0, false, 5, "~");
   deallog << "LAPACKFullMatrix<double>::fill  SparseMatrixEZ<double>"
-         << std::endl;
+          << std::endl;
   lfd.fill(ez, 1, 1, 4, 2);
   lfd.print_formatted(logfile, 0, false, 5, "~");
 }
index 3df4344a526cebb6b2f2a1188384ff9bbc1cfa47..67433bf368649327f6fff4135359325b60c61036 100644 (file)
@@ -53,7 +53,7 @@ int main()
   ez.set(4,3,14.);
 
   deallog << "SparseMatrixEZ<float>::copy_from  SparseMatrixEZ<double>"
-         << std::endl;
+          << std::endl;
   SparseMatrixEZ<float> ff;
   ff.copy_from(ez);
   ff.print_formatted(logfile, 0, false, 5, "~");
index 7cd4b0dc9198d22e28c4ed40d348149cc6e8725b..7ebbb27b9f69d046bcec17df09bb293726cfdabe 100644 (file)
@@ -53,7 +53,7 @@ int main()
   ez.set(4,3,14.);
 
   deallog << "SparseMatrixEZ<float>::copy_from  SparseMatrixEZ<double>"
-         << std::endl;
+          << std::endl;
   SparseMatrixEZ<float> ff(ez.m(), ez.n());
   ff.add(2, ez);
   ff.print_formatted(logfile, 0, false, 5, "~");
index d7a5a27716cf1489bfcd5da2dc75eed1de605667..6b4ae1683522d7d8e39dc37806493ead702e223f 100644 (file)
@@ -53,7 +53,7 @@ int main()
   ez.set(4,3,14.);
 
   deallog << "SparseMatrixEZ<float>::copy_from  SparseMatrixEZ<double>"
-         << std::endl;
+          << std::endl;
   LAPACKFullMatrix<float> ff;
   ff.copy_from(ez);
   ff.print_formatted(logfile, 0, false, 5, "~");
index 9a99454aee1008bc900d9cd99b87f5d625c1f7a3..0dc19a9e29a362e8ee8ba3769448599d402be1f2 100644 (file)
@@ -54,7 +54,7 @@ int main()
 
   {
     deallog << "SparseMatrixEZ<float>::fill  SparseMatrixEZ<double>"
-           << std::endl;
+            << std::endl;
     LAPACKFullMatrix<float> ff(ez.m(), ez.n());
     ff.fill(ez, 0,0,0,0, 2, false);
     ff.print_formatted(logfile, 0, false, 5, "~");
@@ -62,7 +62,7 @@ int main()
 
   {
     deallog << "SparseMatrixEZ<float>::fill  SparseMatrixEZ<double>  transpose"
-           << std::endl;
+            << std::endl;
     LAPACKFullMatrix<float> ff(ez.n(), ez.m());
     ff.fill(ez, 0,0,0,0, 2, true);
     ff.print_formatted(logfile, 0, false, 5, "~");
index c6c0e49b47b5606bb31e7b9c2594164d8409bdbe..e9cfca571193012af8202ed0e99f4ff43a65612c 100644 (file)
 #include <cmath>
 
 template<typename number>
-void check_sparse_product(const SparseMatrix<number>& m1, SparseMatrix<number>& m2)
+void check_sparse_product(const SparseMatrix<number> &m1, SparseMatrix<number> &m2)
 {
   Vector<double> v(m2.n());
   Vector<double> w(m1.m());
   deallog << "Sizes\t" << v.size() << '\t' << w.size() << std::endl;
-  
-  for (unsigned int i=0;i<v.size();++i)
+
+  for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i+1.;
-  
-  for (unsigned int i=0;i<v.size();++i)
+
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v(i);
   deallog << std::endl;
-  
+
   GrowingVectorMemory<Vector<double> > mem;
-  
+
   ProductSparseMatrix<number, number> product(m1, m2, mem);
-  
+
   product.vmult(w,v);
-  for (unsigned int i=0;i<w.size();++i)
+  for (unsigned int i=0; i<w.size(); ++i)
     deallog << ' ' << w(i);
   deallog << std::endl;
-  
+
   product.vmult_add(w,v);
-  for (unsigned int i=0;i<w.size();++i)
+  for (unsigned int i=0; i<w.size(); ++i)
     deallog << ' ' << w(i);
   deallog << std::endl;
-  
+
   product.Tvmult(v,w);
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v(i);
   deallog << std::endl;
-  
+
   product.Tvmult_add(v,w);
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v(i);
   deallog << std::endl;
 }
@@ -75,16 +75,16 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   SparsityPattern sparsity1(2,3,3);
   SparsityPattern sparsity2(3,4,4);
 
-  for (unsigned int i=0;i<2;++i)
-    for (unsigned int j=0;j<3;++j)
+  for (unsigned int i=0; i<2; ++i)
+    for (unsigned int j=0; j<3; ++j)
       {
-       sparsity1.add(i,j);
-       sparsity2.add(j,i);
-       sparsity2.add(j,2+i);
+        sparsity1.add(i,j);
+        sparsity2.add(j,i);
+        sparsity2.add(j,2+i);
       }
   sparsity1.compress();
   sparsity2.compress();
@@ -92,12 +92,12 @@ int main()
   SparseMatrix<double> m1(sparsity1);
   SparseMatrix<double> m2(sparsity2);
 
-  for (unsigned int i=0;i<2;++i)
-    for (unsigned int j=0;j<3;++j)
+  for (unsigned int i=0; i<2; ++i)
+    for (unsigned int j=0; j<3; ++j)
       {
-       m1.set(i, j, 1.*i-j);
-       m2.set(j, i, 1.*i-j);
-       m2.set(j, 2+i, 1.*j-i);
+        m1.set(i, j, 1.*i-j);
+        m2.set(j, i, 1.*i-j);
+        m2.set(j, 2+i, 1.*j-i);
       }
   check_sparse_product(m1, m2);
 }
index 01634fced15a6f4e095d86d287f9ddee25ac17ee..83515b00c69292982db3178d2a6254d24478a6d8 100644 (file)
@@ -23,7 +23,7 @@
 #include <fstream>
 #include <iomanip>
 
-int main () 
+int main ()
 {
   std::ofstream logfile("matrix_out/output");
   logfile << std::fixed;
@@ -34,51 +34,51 @@ int main ()
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-                                  // test for a square full matrix
+  // test for a square full matrix
   if (true)
     {
       FullMatrix<double> full_matrix(4,4);
       for (unsigned int i=0; i<4; ++i)
-       full_matrix(i,i) = 1;
-      
+        full_matrix(i,i) = 1;
+
       MatrixOut matrix_out;
       matrix_out.build_patches (full_matrix, "full_matrix");
       matrix_out.write_gnuplot (logfile);
     };
-  
-                                  // test for a rectangular sparse
-                                  // matrix
+
+  // test for a rectangular sparse
+  // matrix
   if (true)
     {
       SparsityPattern sparsity (4,8,7);
       for (unsigned int i=0; i<4; ++i)
-       for (unsigned int j=0; j<8; ++j)
-         if (i!=j)
-           sparsity.add (i,j);
+        for (unsigned int j=0; j<8; ++j)
+          if (i!=j)
+            sparsity.add (i,j);
       sparsity.compress ();
 
       SparseMatrix<double> sparse_matrix(sparsity);
       for (unsigned int i=0; i<4; ++i)
-       for (unsigned int j=0; j<8; ++j)
-         sparse_matrix.set(i,j, static_cast<signed int>(i-j));
-  
+        for (unsigned int j=0; j<8; ++j)
+          sparse_matrix.set(i,j, static_cast<signed int>(i-j));
+
       MatrixOut matrix_out;
       matrix_out.build_patches (sparse_matrix, "sparse_matrix",
-                               MatrixOut::Options (true));
+                                MatrixOut::Options (true));
       matrix_out.write_eps (logfile);
     };
 
-                                  // test collation of elements
+  // test collation of elements
   if (true)
     {
       FullMatrix<double> full_matrix(20,20);
       for (unsigned int i=0; i<20; ++i)
-       for (unsigned int j=0; j<20; ++j)
-         full_matrix(i,j) = (1.*i*i/20/20-1.*j*j*j/20/20/20);
-  
+        for (unsigned int j=0; j<20; ++j)
+          full_matrix(i,j) = (1.*i*i/20/20-1.*j*j*j/20/20/20);
+
       MatrixOut matrix_out;
       matrix_out.build_patches (full_matrix, "collated_matrix",
-                               MatrixOut::Options (false, 4));
+                                MatrixOut::Options (false, 4));
       matrix_out.write_gmv (logfile);
     };
 }
index 26ab3913ead8a961a217159d2111165dc29c8b09..2f45ffe7dfaf5b9388fc0fe7f062c5980ece707c 100644 (file)
@@ -34,19 +34,19 @@ int main()
 
   FullMatrix<double> A(5,5);
   unsigned int k=0;
-  for (unsigned int i=0;i<A.m();++i)
-    for (unsigned int j=0;j<A.n();++j)
+  for (unsigned int i=0; i<A.m(); ++i)
+    for (unsigned int j=0; j<A.n(); ++j)
       A(i,j) = ++k;
 
   PointerMatrix<FullMatrix<double>, Vector<double> > P(&A, "P");
   TransposeMatrix<FullMatrix<double>, Vector<double> > T(&A, "T");
-  
+
   Vector<double> x(5);
   Vector<double> y(5);
   Vector<double> y2(5);
   Vector<double> diff(5);
-  
-  for (unsigned int i=0;i<x.size();++i)
+
+  for (unsigned int i=0; i<x.size(); ++i)
     {
       x = 0.;
       x(i) = 1.;
@@ -59,7 +59,7 @@ int main()
       diff = y;
       diff.add(-1., y2);
       deallog << "T.Tvmult: diff " << diff.l2_norm() << std::endl;
-      
+
       A.Tvmult(y,x);
       P.Tvmult(y2,x);
       diff = y;
@@ -69,7 +69,7 @@ int main()
       diff = y;
       diff.add(-1., y2);
       deallog << "T.vmult:  diff " << diff.l2_norm() << std::endl;
-      
-      
+
+
     }
 }
index fc7ef05b47c12c8966e4ed71782a3a6eafd36734..54effe0f1793144c1a18df47106d7aa9188548e8 100644 (file)
@@ -29,38 +29,38 @@ int main()
   std::ofstream logfile("pointer_matrix_vector/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  
+
   Vector<double> u(5);
   Vector<double> v(5);
   Vector<double> w(1);
   Vector<float>  x(5);
   Vector<float>  y(5);
   Vector<float>  z(1);
-  
 
-  for (unsigned int i=0;i<u.size();++i)
+
+  for (unsigned int i=0; i<u.size(); ++i)
     {
       u(i) = 1 << i;
       x(i) = 1 << i;
       v(i) = 6-i;
       y(i) = 6-i;
     }
-  
+
   PointerMatrixVector<double> Mu(&u);
   Mu.vmult(w,v);
   deallog << "vmult  " << w(0) << std::endl << "Tvmult";
   w(0) = 2.;
   Mu.Tvmult(v,w);
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << v(i);
   deallog << std::endl;
-  
+
   PointerMatrixVector<float> Mx(&x);
   Mx.vmult(z,y);
   deallog << "vmult  " << z(0) << std::endl << "Tvmult";
   z(0) = 2.;
   Mx.Tvmult(y,z);
-  for (unsigned int i=0;i<y.size();++i)
+  for (unsigned int i=0; i<y.size(); ++i)
     deallog << ' ' << y(i);
   deallog << std::endl;
 }
index c5f02e420e15be5c9439f32487b786a4f73e629a..3e5e25563661346bccb4059c3a0f9e4ab0423a14 100644 (file)
@@ -34,7 +34,7 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   SparseMatrixEZ<double> ez(5,4);
   ez.set(0,0,2.);
   ez.set(0,2,3.);
index 18af4f6af500197eaf0ed78b3ae3cbfabf1f8569..bac80df3f2a0f2134e8d8af66e78c84327cb7b5f 100644 (file)
@@ -21,7 +21,7 @@ public:
    * Matrix-vector-product.
    */
   template <typename number2>
-  void vmult(Vector<number2>&, const Vector<number2>&) const;
+  void vmult(Vector<number2> &, const Vector<number2> &) const;
 protected:
   const unsigned int nx;
   const unsigned int ny;
@@ -31,21 +31,21 @@ protected:
 template<typename number>
 QuickMatrix<number>::QuickMatrix(unsigned int nx, unsigned int ny)
   :
-nx(nx), ny(ny)
+  nx(nx), ny(ny)
 {}
 
 template<typename number>
 template <typename number2>
 void
-QuickMatrix<number>::vmult(Vector<number2>d,
-                          const Vector<number2>& s) const
+QuickMatrix<number>::vmult(Vector<number2> &d,
+                           const Vector<number2> &s) const
 {
   const unsigned int step = nx-1;
   const unsigned int right = step-1;
   const unsigned int top = ny-1;
 
   // Bottom row
-  
+
   d(0) = s(0) - .25 * ( s(1) + s(step) );
 
   for (unsigned int x=1; x<right; ++x)
@@ -60,30 +60,30 @@ QuickMatrix<number>::vmult(Vector<number2>& d,
     {
       start += step;
       d(start) = s(start)
-       - .25 * ( s(start-step) + s(start+1) + s(start+step) );
-      
+                 - .25 * ( s(start-step) + s(start+1) + s(start+step) );
+
       for (unsigned int x=1; x<right; ++x)
-       {
-         const unsigned int xy = start+x;
-         d(xy) = s(xy)
-           - .25 * ( s(xy-step) + s(xy-1) + s(xy+1) + s(xy+step) );
-       }
+        {
+          const unsigned int xy = start+x;
+          d(xy) = s(xy)
+                  - .25 * ( s(xy-step) + s(xy-1) + s(xy+1) + s(xy+step) );
+        }
       d(start+right) = s(start+right)
-       - .25 * ( s(start+right-1) + s(start+right+step) );
+                       - .25 * ( s(start+right-1) + s(start+right+step) );
     }
-  
+
   // Top row
 
   start += step;
   d(start) = s(start)
-    - .25 * ( s(start-step) + s(start+1) );
+             - .25 * ( s(start-step) + s(start+1) );
 
   for (unsigned int x=1; x<right; ++x)
     {
       const unsigned int xy = start+x;
       d(xy) = s(xy)
-       - .25 * ( s(xy-step) + s(xy-1) + s(xy+1) );
+              - .25 * ( s(xy-step) + s(xy-1) + s(xy+1) );
     }
   d(start+right) = s(start+right)
-    - .25 * ( s(start+right-step) + s(start+right-1) );
+                   - .25 * ( s(start+right-step) + s(start+right-1) );
 }
index e0e43636711808ba447007755dd197ca2d7acfff..534f7967ced8b82c3a256ad261d9a9c10a24ae0e 100644 (file)
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   u = 0.;
   f = 1.;
-  try 
+  try
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
-    }  
+    }
 }
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_Tsolve(SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_Tsolve(SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   u = 0.;
   f = 1.;
-  try 
+  try
     {
       solver.Tsolve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
-    }  
+    }
 }
 
 int main()
@@ -76,14 +76,14 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   GrowingVectorMemory<> mem;
   SolverControl control(100, 1.e-3);
   SolverControl verbose_control(100, 1.e-3, true);
   SolverCG<> cg(control, mem);
   SolverGMRES<> gmres(control, mem, 8);
   SolverGMRES<>::AdditionalData data(8, true);
-  SolverGMRES<> gmresright(control, mem, data);  
+  SolverGMRES<> gmresright(control, mem, data);
   SolverMinRes<> minres(control, mem);
   SolverBicgstab<> bicgstab(control, mem);
   SolverRichardson<> rich(control, mem);
@@ -94,8 +94,8 @@ int main()
       unsigned int dim = (size-1)*(size-1);
 
       deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                      // Make matrix
+
+      // Make matrix
       FDMatrix testproblem(size, size);
       SparsityPattern structure(dim, dim, 5);
       testproblem.five_point_structure(structure);
@@ -114,130 +114,130 @@ int main()
       std::vector<types::global_dof_index> permutation(dim);
       std::vector<types::global_dof_index> inverse_permutation(dim);
 
-                                      // Create a permutation: Blocks
-                                      // backwards and every second
-                                      // block backwards
+      // Create a permutation: Blocks
+      // backwards and every second
+      // block backwards
       unsigned int k = 0;
-      for (unsigned int i=0;i<size-1;++i)
-       for (unsigned int j=0;j<size-1;++j)
-         {
-           if (i % 2)
-             permutation[k++] = (size-i-2) * (size-1) + j;
-           else
-             permutation[k++] = (size-i-2) * (size-1) + size-j-2;
-         }
-      
-
-      for (unsigned int i=0;i<dim;++i)
-       inverse_permutation[permutation[i]] = i;
+      for (unsigned int i=0; i<size-1; ++i)
+        for (unsigned int j=0; j<size-1; ++j)
+          {
+            if (i % 2)
+              permutation[k++] = (size-i-2) * (size-1) + j;
+            else
+              permutation[k++] = (size-i-2) * (size-1) + size-j-2;
+          }
+
+
+      for (unsigned int i=0; i<dim; ++i)
+        inverse_permutation[permutation[i]] = i;
 
       PreconditionPSOR<> prec_psor;
       prec_psor.initialize(A, permutation, inverse_permutation, 1.2);
-      
+
       Vector<double>  f(dim);
       Vector<double>  u(dim);
       Vector<double> res(dim);
 
       f = 1.;
       u = 1.;
-      
+
       A.residual(res,u,f);
       A.SOR(res);
       res.add(1.,u);
       A.SOR_step(u,f);
       res.add(-1.,u);
-    
-      deallog << "SOR-diff:" << res*res << std::endl;
+
+      deallog << "SOR-diff:" << res *res << std::endl;
 
       try
-       {
-         deallog.push("no-fail");
-
-         control.set_max_steps(10);
-         check_solve(cg,A,u,f,prec_no);
-         check_solve(bicgstab,A,u,f,prec_no);
-         check_solve(gmres,A,u,f,prec_no);
-         check_solve(gmresright,A,u,f,prec_no);
-//       check_solve(minres,A,u,f,prec_no);
-         check_solve(qmrs,A,u,f,prec_no);
-         control.set_max_steps(100);
-         
-         deallog.pop();
-         
-         deallog.push("no");
-
-         rich.set_omega(1./A.diag_element(0)); 
-         check_solve(rich,A,u,f,prec_no);
-         check_solve(cg,A,u,f,prec_no);
-         check_solve(bicgstab,A,u,f,prec_no);
-         check_solve(gmres,A,u,f,prec_no);
-         check_solve(gmresright,A,u,f,prec_no);
-         check_solve(qmrs,A,u,f,prec_no);
-         rich.set_omega(1.);
-         
-         deallog.pop();
-         
-         deallog.push("rich");
-         
-         rich.set_omega(1./A.diag_element(0)); 
-         check_solve(rich,A,u,f,prec_richardson);
-         check_solve(cg,A,u,f,prec_richardson);
-         check_solve(bicgstab,A,u,f,prec_richardson);
-         check_solve(gmres,A,u,f,prec_richardson);
-         check_solve(gmresright,A,u,f,prec_richardson);
-         check_solve(qmrs,A,u,f,prec_richardson);
-         rich.set_omega(1.);
-         
-         deallog.pop();
-         
-         deallog.push("ssor");
-         
-         check_Tsolve(rich,A,u,f,prec_ssor);
-         check_solve(rich,A,u,f,prec_ssor);
-         check_solve(cg,A,u,f,prec_ssor);
-         check_solve(bicgstab,A,u,f,prec_ssor);
-         check_solve(gmres,A,u,f,prec_ssor);
-         check_solve(gmresright,A,u,f,prec_ssor);
-         check_solve(qmrs,A,u,f,prec_ssor);
-         
-         deallog.pop();
-         
-         deallog.push("sor");
-         
-         check_Tsolve(rich,A,u,f,prec_sor);
-         check_solve(rich,A,u,f,prec_sor);
-         check_solve(cg,A,u,f,prec_sor);
-         check_solve(bicgstab,A,u,f,prec_sor);
-         check_solve(gmres,A,u,f,prec_sor);
-         check_solve(gmresright,A,u,f,prec_sor);
-         
-         deallog.pop();
-         
-         deallog.push("psor");
-
-         check_Tsolve(rich,A,u,f,prec_psor);
-         check_solve(rich,A,u,f,prec_psor);
-         check_solve(cg,A,u,f,prec_psor);
-         check_solve(bicgstab,A,u,f,prec_psor);
-         check_solve(gmres,A,u,f,prec_psor);
-         check_solve(gmresright,A,u,f,prec_psor);
-         
-         deallog.pop();
-       }
-      catch (std::exceptione)
-       {
-         std::cerr << "Exception: " << e.what() << std::endl;
-       }
+        {
+          deallog.push("no-fail");
+
+          control.set_max_steps(10);
+          check_solve(cg,A,u,f,prec_no);
+          check_solve(bicgstab,A,u,f,prec_no);
+          check_solve(gmres,A,u,f,prec_no);
+          check_solve(gmresright,A,u,f,prec_no);
+//    check_solve(minres,A,u,f,prec_no);
+          check_solve(qmrs,A,u,f,prec_no);
+          control.set_max_steps(100);
+
+          deallog.pop();
+
+          deallog.push("no");
+
+          rich.set_omega(1./A.diag_element(0));
+          check_solve(rich,A,u,f,prec_no);
+          check_solve(cg,A,u,f,prec_no);
+          check_solve(bicgstab,A,u,f,prec_no);
+          check_solve(gmres,A,u,f,prec_no);
+          check_solve(gmresright,A,u,f,prec_no);
+          check_solve(qmrs,A,u,f,prec_no);
+          rich.set_omega(1.);
+
+          deallog.pop();
+
+          deallog.push("rich");
+
+          rich.set_omega(1./A.diag_element(0));
+          check_solve(rich,A,u,f,prec_richardson);
+          check_solve(cg,A,u,f,prec_richardson);
+          check_solve(bicgstab,A,u,f,prec_richardson);
+          check_solve(gmres,A,u,f,prec_richardson);
+          check_solve(gmresright,A,u,f,prec_richardson);
+          check_solve(qmrs,A,u,f,prec_richardson);
+          rich.set_omega(1.);
+
+          deallog.pop();
+
+          deallog.push("ssor");
+
+          check_Tsolve(rich,A,u,f,prec_ssor);
+          check_solve(rich,A,u,f,prec_ssor);
+          check_solve(cg,A,u,f,prec_ssor);
+          check_solve(bicgstab,A,u,f,prec_ssor);
+          check_solve(gmres,A,u,f,prec_ssor);
+          check_solve(gmresright,A,u,f,prec_ssor);
+          check_solve(qmrs,A,u,f,prec_ssor);
+
+          deallog.pop();
+
+          deallog.push("sor");
+
+          check_Tsolve(rich,A,u,f,prec_sor);
+          check_solve(rich,A,u,f,prec_sor);
+          check_solve(cg,A,u,f,prec_sor);
+          check_solve(bicgstab,A,u,f,prec_sor);
+          check_solve(gmres,A,u,f,prec_sor);
+          check_solve(gmresright,A,u,f,prec_sor);
+
+          deallog.pop();
+
+          deallog.push("psor");
+
+          check_Tsolve(rich,A,u,f,prec_psor);
+          check_solve(rich,A,u,f,prec_psor);
+          check_solve(cg,A,u,f,prec_psor);
+          check_solve(bicgstab,A,u,f,prec_psor);
+          check_solve(gmres,A,u,f,prec_psor);
+          check_solve(gmresright,A,u,f,prec_psor);
+
+          deallog.pop();
+        }
+      catch (std::exception &e)
+        {
+          std::cerr << "Exception: " << e.what() << std::endl;
+        }
     };
 
-                                  // Solve advection problem
+  // Solve advection problem
   for (unsigned int size=4; size <= 3; size *= 3)
     {
       unsigned int dim = (size-1)*(size-1);
-      
+
       deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                      // Make matrix
+
+      // Make matrix
       FDMatrix testproblem(size, size);
       SparsityPattern structure(dim, dim, 5);
       testproblem.five_point_structure(structure);
@@ -251,27 +251,27 @@ int main()
       std::vector<types::global_dof_index> permutation(dim);
       std::vector<types::global_dof_index> inverse_permutation(dim);
 
-                                      // Create a permutation: Blocks
-                                      // backwards and every second
-                                      // block backwards
+      // Create a permutation: Blocks
+      // backwards and every second
+      // block backwards
       unsigned int k = 0;
-      for (unsigned int i=0;i<size-1;++i)
-       for (unsigned int j=0;j<size-1;++j)
-         {
-           permutation[k++] = i * (size-1) + size-j-2;
-         }
-      
-      for (unsigned int i=0;i<permutation.size();++i)
-       std::cerr << ' ' << permutation[i];
+      for (unsigned int i=0; i<size-1; ++i)
+        for (unsigned int j=0; j<size-1; ++j)
+          {
+            permutation[k++] = i * (size-1) + size-j-2;
+          }
+
+      for (unsigned int i=0; i<permutation.size(); ++i)
+        std::cerr << ' ' << permutation[i];
       std::cerr << std::endl;
-      
-      for (unsigned int i=0;i<permutation.size();++i)
-       inverse_permutation[permutation[i]] = i;
 
-      for (unsigned int i=0;i<permutation.size();++i)
-       std::cerr << ' ' << inverse_permutation[i];
+      for (unsigned int i=0; i<permutation.size(); ++i)
+        inverse_permutation[permutation[i]] = i;
+
+      for (unsigned int i=0; i<permutation.size(); ++i)
+        std::cerr << ' ' << inverse_permutation[i];
       std::cerr << std::endl;
-      
+
       PreconditionPSOR<> prec_psor;
       prec_psor.initialize(A, permutation, inverse_permutation, 1.);
 
@@ -281,7 +281,7 @@ int main()
       u = 1.;
 
       std::cerr << "******************************" << std::endl;
-      
+
       check_solve(rich,A,u,f,prec_sor);
       check_solve(rich,A,u,f,prec_psor);
     }
index 8281f58960438afde448ec4c7e2dc131fa9e9152..82a0b7dd040de8897f2d754387ab41e23eb11fe0 100644 (file)
@@ -42,14 +42,14 @@ void test()
   SparseMatrix<double> mat;
   mat.reinit(sparsity);
   mat = IdentityMatrix(size);
-  
+
   Vector<double> rhs;
   Vector<double> solvec;
   solvec.reinit(size);
-    
+
   rhs.reinit(size);
   rhs(size-1)=1.0;
-  
+
   SolverControl solvctrl(1000, 1e-12, true);
   SOLVER solver(solvctrl);
 
@@ -68,6 +68,6 @@ int main()
 
   test<SolverGMRES<Vector<double> > >();
   test<SolverCG<Vector<double> > >();
-  test<SolverFGMRES<Vector<double> > >();    
+  test<SolverFGMRES<Vector<double> > >();
 }
 
index 0b03e79f3b68c95cb9163f89bb63b0ca2dba004d..c291acae4a38ba2f4e438e5005dd8b5c24db865a 100644 (file)
@@ -40,8 +40,8 @@
 
 template<class SOLVER, class MATRIX, class VECTOR>
 void
-check_solve( const MATRIXA,
-            VECTOR& u, VECTOR& f)
+check_solve( const MATRIX &A,
+             VECTOR &u, VECTOR &f)
 {
   GrowingVectorMemory<> mem;
   SolverControl control(100, 1.e-3);
@@ -49,15 +49,15 @@ check_solve( const MATRIX& A,
   PreconditionIdentity prec_no;
   u = 0.;
   f = 0.;
-  
-  try 
+
+  try
     {
       solver.solve(A, u, f, prec_no);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
-    }  
+    }
 }
 
 int main()
@@ -68,26 +68,26 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   for (unsigned int size=4; size <= 30; size *= 3)
     {
       unsigned int dim = (size-1)*(size-1);
 
       deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                      // Make matrix
+
+      // Make matrix
       FDMatrix testproblem(size, size);
       SparsityPattern structure(dim, dim, 5);
       testproblem.five_point_structure(structure);
       structure.compress();
       SparseMatrix<double>  A(structure);
       testproblem.five_point(A);
-      
+
       Vector<double>  f(dim);
       Vector<double>  u(dim);
       Vector<double> res(dim);
 
-      deallog.push("alreadydone");      
+      deallog.push("alreadydone");
       check_solve<SolverCG<> >(A,u,f);
       check_solve<SolverGMRES<> >(A,u,f);
 //      check_solve<SolverFGMRES<> >(A,u,f);
index 318183e82e234f0ba66f856254b170647e671796..006abd5d3bec1ca7b12bf3dbd271b17ea391eb22 100644 (file)
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 double
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   double result = 0.;
   u = 0.;
   f = 1.;
-  try 
+  try
     {
       solver.solve(A,u,f,P);
     }
-  catch (SolverControl::NoConvergencee)
+  catch (SolverControl::NoConvergence &e)
     {
       result = e.last_residual;
     }
@@ -60,18 +60,18 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   SolverControl control(10, 1.e-3);
   SolverRichardson<> rich(control);
   SolverRelaxation<> relax(control);
-  
+
   for (unsigned int size=7; size <= 30; size *= 3)
     {
       unsigned int dim = (size-1)*(size-1);
 
       deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                      // Make matrix
+
+      // Make matrix
       FDMatrix testproblem(size, size);
       SparsityPattern structure(dim, dim, 5);
       testproblem.five_point_structure(structure);
@@ -94,41 +94,41 @@ int main()
 
       f = 1.;
       u = 1.;
-      
+
       try
-       {
-         double r1, r2;
-         
-         r1 = check_solve(rich,A,u,f,prec_jacobi);
-         r2 = check_solve(relax,A,u,f,prec_jacobi);
-         deallog << "Jacobi  diff " << std::fabs(r1-r2)/r1 << std::endl;
-         
-         r1 = check_solve(rich,A,u,f,prec_sor);
-         r2 = check_solve(relax,A,u,f,prec_sor);
-         deallog << "SOR     diff " << std::fabs(r1-r2)/r1 << std::endl;
-         
-         r1 = check_solve(rich,A,u,f,prec_ssor1);
-         r2 = check_solve(relax,A,u,f,prec_ssor1);
-         deallog << "SSOR1   diff " << std::fabs(r1-r2)/r1 << std::endl;
-         
-         r1 = check_solve(rich,A,u,f,prec_ssor2);
-         r2 = check_solve(relax,A,u,f,prec_ssor2);
-         deallog << "SSOR1.2 diff " << std::fabs(r1-r2)/r1 << std::endl;
-       }
-      catch (std::exceptione)
-       {
-         std::cerr << "Exception: " << e.what() << std::endl;
-       }
+        {
+          double r1, r2;
+
+          r1 = check_solve(rich,A,u,f,prec_jacobi);
+          r2 = check_solve(relax,A,u,f,prec_jacobi);
+          deallog << "Jacobi  diff " << std::fabs(r1-r2)/r1 << std::endl;
+
+          r1 = check_solve(rich,A,u,f,prec_sor);
+          r2 = check_solve(relax,A,u,f,prec_sor);
+          deallog << "SOR     diff " << std::fabs(r1-r2)/r1 << std::endl;
+
+          r1 = check_solve(rich,A,u,f,prec_ssor1);
+          r2 = check_solve(relax,A,u,f,prec_ssor1);
+          deallog << "SSOR1   diff " << std::fabs(r1-r2)/r1 << std::endl;
+
+          r1 = check_solve(rich,A,u,f,prec_ssor2);
+          r2 = check_solve(relax,A,u,f,prec_ssor2);
+          deallog << "SSOR1.2 diff " << std::fabs(r1-r2)/r1 << std::endl;
+        }
+      catch (std::exception &e)
+        {
+          std::cerr << "Exception: " << e.what() << std::endl;
+        }
     };
 
-                                  // Solve advection problem
+  // Solve advection problem
   for (unsigned int size=4; size <= 3; size *= 3)
     {
       unsigned int dim = (size-1)*(size-1);
-      
+
       deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                      // Make matrix
+
+      // Make matrix
       FDMatrix testproblem(size, size);
       SparsityPattern structure(dim, dim, 5);
       testproblem.five_point_structure(structure);
@@ -142,27 +142,27 @@ int main()
       std::vector<types::global_dof_index> permutation(dim);
       std::vector<types::global_dof_index> inverse_permutation(dim);
 
-                                      // Create a permutation: Blocks
-                                      // backwards and every second
-                                      // block backwards
+      // Create a permutation: Blocks
+      // backwards and every second
+      // block backwards
       unsigned int k = 0;
-      for (unsigned int i=0;i<size-1;++i)
-       for (unsigned int j=0;j<size-1;++j)
-         {
-           permutation[k++] = i * (size-1) + size-j-2;
-         }
-      
-      for (unsigned int i=0;i<permutation.size();++i)
-       std::cerr << ' ' << permutation[i];
+      for (unsigned int i=0; i<size-1; ++i)
+        for (unsigned int j=0; j<size-1; ++j)
+          {
+            permutation[k++] = i * (size-1) + size-j-2;
+          }
+
+      for (unsigned int i=0; i<permutation.size(); ++i)
+        std::cerr << ' ' << permutation[i];
       std::cerr << std::endl;
-      
-      for (unsigned int i=0;i<permutation.size();++i)
-       inverse_permutation[permutation[i]] = i;
 
-      for (unsigned int i=0;i<permutation.size();++i)
-       std::cerr << ' ' << inverse_permutation[i];
+      for (unsigned int i=0; i<permutation.size(); ++i)
+        inverse_permutation[permutation[i]] = i;
+
+      for (unsigned int i=0; i<permutation.size(); ++i)
+        std::cerr << ' ' << inverse_permutation[i];
       std::cerr << std::endl;
-      
+
       PreconditionPSOR<> prec_psor;
       prec_psor.initialize(A, permutation, inverse_permutation, 1.);
 
@@ -172,7 +172,7 @@ int main()
       u = 1.;
 
       std::cerr << "******************************" << std::endl;
-      
+
       check_solve(rich,A,u,f,prec_sor);
       check_solve(rich,A,u,f,prec_psor);
     }
index c7e55541b8a6de4271baa679506f2b1c8f164012..2d99424b4736f91cccbe51bc85eb37ef6aa5ff18 100644 (file)
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 double
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   double result = 0.;
   u = 0.;
   f = 1.;
-  try 
+  try
     {
       solver.solve(A,u,f,P);
     }
-  catch (SolverControl::NoConvergencee)
+  catch (SolverControl::NoConvergence &e)
     {
       result = e.last_residual;
     }
@@ -61,95 +61,95 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   SolverControl control(10, 1.e-3);
   SolverRichardson<> rich(control);
   SolverRelaxation<> relax(control);
-  
+
   for (unsigned int size=33; size <= 33; size *= 3)
     {
       unsigned int dim = (size-1)*(size-1);
 
       deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                      // Make matrix
+
+      // Make matrix
       FDMatrix testproblem(size, size);
       SparsityPattern structure(dim, dim, 5);
       testproblem.five_point_structure(structure);
       structure.compress();
       SparseMatrix<double>  A(structure);
       testproblem.five_point(A);
-      
+
       for (unsigned int blocksize = 2; blocksize < 32; blocksize <<= 1)
-       {
-         deallog << "Block size " << blocksize << std::endl;
-
-         const unsigned int n_blocks = dim/blocksize;    
-         RelaxationBlock<SparseMatrix<double>,double>::AdditionalData relax_data(0.8);
-         PreconditionBlock<SparseMatrix<double>,double>::AdditionalData prec_data(blocksize, 0.8);
-         
-         relax_data.block_list.reinit(n_blocks, dim, blocksize);
-         for (unsigned int block=0;block<n_blocks;++block)
-           {
-             for (unsigned int i=0;i<blocksize;++i)
-               relax_data.block_list.add(block, i+block*blocksize);
-           }
-         relax_data.block_list.compress();
-         
-         PreconditionBlockJacobi<SparseMatrix<double>,double> prec_jacobi;
-         prec_jacobi.initialize(A, prec_data);
-         PreconditionBlockSOR<SparseMatrix<double>,double> prec_sor;
-         prec_sor.initialize(A, prec_data);
-         PreconditionBlockSSOR<SparseMatrix<double>,double> prec_ssor;
-         prec_ssor.initialize(A, prec_data);
-
-         RelaxationBlockJacobi<SparseMatrix<double>,double> relax_jacobi;
-         relax_jacobi.initialize(A, relax_data);
-         RelaxationBlockSOR<SparseMatrix<double>,double> relax_sor;
-         relax_sor.initialize(A, relax_data);
-         RelaxationBlockSSOR<SparseMatrix<double>,double> relax_ssor;
-         relax_ssor.initialize(A, relax_data);
-         
-         Vector<double>  f(dim);
-         Vector<double>  u(dim);
-         Vector<double> res(dim);
-         
-         f = 1.;
-         u = 1.;
-         
-         try
-           {
-             double r1, r2;
-
-             deallog.push("Jacobi");
-             r1 = check_solve(rich,A,u,f,prec_jacobi);
-             r2 = check_solve(relax,A,u,f,prec_jacobi);
-             deallog << "diff " << std::fabs(r1-r2)/r1 << std::endl;
-             r2 = check_solve(relax,A,u,f,relax_jacobi);
-             deallog << "diff " << std::fabs(r1-r2)/r1 << std::endl;
-             deallog.pop();
-             
-             deallog.push("SOR   ");
-             r1 = check_solve(rich,A,u,f,prec_sor);
-             r2 = check_solve(relax,A,u,f,prec_sor);
-             deallog << "diff " << std::fabs(r1-r2)/r1 << std::endl;
-             r2 = check_solve(relax,A,u,f,relax_sor);
-             deallog << "diff " << std::fabs(r1-r2)/r1 << std::endl;
-             deallog.pop();
-             
-             deallog.push("SSOR  ");
-             r1 = check_solve(rich,A,u,f,prec_ssor);
-             r2 = check_solve(relax,A,u,f,prec_ssor);
-             deallog << "diff " << std::fabs(r1-r2)/r1 << std::endl;
-             r2 = check_solve(relax,A,u,f,relax_ssor);
-             deallog << "diff " << std::fabs(r1-r2)/r1 << std::endl;
-             deallog.pop();
-           }
-         catch (std::exception& e)
-           {
-             std::cerr << "Exception: " << e.what() << std::endl;
-           }
-       }
-    }  
+        {
+          deallog << "Block size " << blocksize << std::endl;
+
+          const unsigned int n_blocks = dim/blocksize;
+          RelaxationBlock<SparseMatrix<double>,double>::AdditionalData relax_data(0.8);
+          PreconditionBlock<SparseMatrix<double>,double>::AdditionalData prec_data(blocksize, 0.8);
+
+          relax_data.block_list.reinit(n_blocks, dim, blocksize);
+          for (unsigned int block=0; block<n_blocks; ++block)
+            {
+              for (unsigned int i=0; i<blocksize; ++i)
+                relax_data.block_list.add(block, i+block*blocksize);
+            }
+          relax_data.block_list.compress();
+
+          PreconditionBlockJacobi<SparseMatrix<double>,double> prec_jacobi;
+          prec_jacobi.initialize(A, prec_data);
+          PreconditionBlockSOR<SparseMatrix<double>,double> prec_sor;
+          prec_sor.initialize(A, prec_data);
+          PreconditionBlockSSOR<SparseMatrix<double>,double> prec_ssor;
+          prec_ssor.initialize(A, prec_data);
+
+          RelaxationBlockJacobi<SparseMatrix<double>,double> relax_jacobi;
+          relax_jacobi.initialize(A, relax_data);
+          RelaxationBlockSOR<SparseMatrix<double>,double> relax_sor;
+          relax_sor.initialize(A, relax_data);
+          RelaxationBlockSSOR<SparseMatrix<double>,double> relax_ssor;
+          relax_ssor.initialize(A, relax_data);
+
+          Vector<double>  f(dim);
+          Vector<double>  u(dim);
+          Vector<double> res(dim);
+
+          f = 1.;
+          u = 1.;
+
+          try
+            {
+              double r1, r2;
+
+              deallog.push("Jacobi");
+              r1 = check_solve(rich,A,u,f,prec_jacobi);
+              r2 = check_solve(relax,A,u,f,prec_jacobi);
+              deallog << "diff " << std::fabs(r1-r2)/r1 << std::endl;
+              r2 = check_solve(relax,A,u,f,relax_jacobi);
+              deallog << "diff " << std::fabs(r1-r2)/r1 << std::endl;
+              deallog.pop();
+
+              deallog.push("SOR   ");
+              r1 = check_solve(rich,A,u,f,prec_sor);
+              r2 = check_solve(relax,A,u,f,prec_sor);
+              deallog << "diff " << std::fabs(r1-r2)/r1 << std::endl;
+              r2 = check_solve(relax,A,u,f,relax_sor);
+              deallog << "diff " << std::fabs(r1-r2)/r1 << std::endl;
+              deallog.pop();
+
+              deallog.push("SSOR  ");
+              r1 = check_solve(rich,A,u,f,prec_ssor);
+              r2 = check_solve(relax,A,u,f,prec_ssor);
+              deallog << "diff " << std::fabs(r1-r2)/r1 << std::endl;
+              r2 = check_solve(relax,A,u,f,relax_ssor);
+              deallog << "diff " << std::fabs(r1-r2)/r1 << std::endl;
+              deallog.pop();
+            }
+          catch (std::exception &e)
+            {
+              std::cerr << "Exception: " << e.what() << std::endl;
+            }
+        }
+    }
 }
 
index a1ddfeab10e98ec45e9e8415cab6df257f54785b..91261a00a5c1749b8705233b1341818192884c3e 100644 (file)
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 double
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   double result = 0.;
   u = 0.;
   f = 1.;
-  try 
+  try
     {
       solver.solve(A,u,f,P);
     }
-  catch (SolverControl::NoConvergencee)
+  catch (SolverControl::NoConvergence &e)
     {
       result = e.last_residual;
     }
@@ -62,18 +62,18 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   SolverControl control(10, 1.e-3);
   SolverRichardson<> rich(control);
   SolverRelaxation<> relax(control);
-  
+
   for (unsigned int size=33; size <= 33; size *= 3)
     {
       unsigned int dim = (size-1)*(size-1);
 
       deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                      // Make matrix
+
+      // Make matrix
       FDMatrix testproblem(size, size);
       SparsityPattern structure(dim, dim, 5);
       testproblem.five_point_structure(structure);
@@ -81,131 +81,131 @@ int main()
       SparseMatrix<double>  A(structure);
       testproblem.five_point(A, true);
 
-                                      // The permutation vectors;
+      // The permutation vectors;
       std::vector<types::global_dof_index> perm(dim);
       std::vector<types::global_dof_index> iperm(dim);
-      
+
       for (unsigned int blocksize = 4; blocksize < 32; blocksize <<= 1)
-       {
-         deallog << "Block size " << blocksize << std::endl;
-
-         const unsigned int n_blocks = dim/blocksize;    
-         RelaxationBlock<SparseMatrix<double>,double>::AdditionalData relax_data(0.8);
-         PreconditionBlock<SparseMatrix<double>,double>::AdditionalData prec_data(blocksize, 0.8);
-         
-                                          // The permutation vectors;
-         std::vector<types::global_dof_index> bperm(n_blocks);
-         std::vector<types::global_dof_index> ibperm(n_blocks);
-         
-         relax_data.block_list.reinit(n_blocks, dim, blocksize);
-         for (unsigned int block=0;block<n_blocks;++block)
-           {
-             bperm[block] = n_blocks-block-1;
-             for (unsigned int i=0;i<blocksize;++i)
-               relax_data.block_list.add(block, i+block*blocksize);
-           }
-         relax_data.block_list.compress();
-                                          // Currently, bperm is just
-                                          // the inversion.
-                                          // Now swap the last two
-                                          // and cyclically exchange
-                                          // the first three
-         unsigned int swap=bperm[n_blocks-1];
-         bperm[n_blocks-1] = bperm[n_blocks-2];
-         bperm[n_blocks-2] = swap;
-
-         swap = bperm[0];
-         bperm[0] = bperm[1];
-         bperm[1] = bperm[2];
-         bperm[2] = swap;
-
-         for (unsigned int block=0;block<n_blocks;++block)
-           {
-             ibperm[bperm[block]] = block;
-             for (unsigned int i=0;i<blocksize;++i)
-               perm[i+block*blocksize] = i+bperm[block]*blocksize;
-           }
-
-         for (unsigned int i=0;i<dim;++i)
-           iperm[perm[i]] = i;
-
-         deallog << "Size " << bperm.size() << std::endl;
-         
-         PreconditionBlockJacobi<SparseMatrix<double>,double> prec_jacobi;
-         prec_jacobi.initialize(A, perm, iperm, prec_data);
-         PreconditionBlockSOR<SparseMatrix<double>,double> prec_sor;
-         prec_sor.initialize(A, perm, iperm, prec_data);
-         PreconditionBlockSSOR<SparseMatrix<double>,double> prec_ssor;
-         prec_ssor.initialize(A, perm, iperm, prec_data);
-         
-         PreconditionBlockJacobi<SparseMatrix<double>,double> prec_bjacobi;
-         prec_bjacobi.initialize(A, bperm, ibperm, prec_data);
-         PreconditionBlockSOR<SparseMatrix<double>,double> prec_bsor;
-         prec_bsor.initialize(A, bperm, ibperm, prec_data);
-         PreconditionBlockSOR<SparseMatrix<double>,double> prec_bsor2;
-         prec_bsor2.initialize(A, prec_data);
-         prec_bsor2.set_permutation(bperm, ibperm);
-         PreconditionBlockSSOR<SparseMatrix<double>,double> prec_bssor;
-         prec_bssor.initialize(A, bperm, ibperm, prec_data);
-
-         relax_data.order.resize(1);
-         relax_data.order[0].resize(bperm.size());
-         for (unsigned int i=0;i<bperm.size();++i)
-           relax_data.order[0][i] = bperm[i];
-         
-         RelaxationBlockSOR<SparseMatrix<double>,double> relax_sor;
-         relax_sor.initialize(A, relax_data);
-         
-         RelaxationBlockSSOR<SparseMatrix<double>,double> relax_ssor;
-         relax_ssor.initialize(A, relax_data);
-         
-         Vector<double>  f(dim);
-         Vector<double>  u(dim);
-         Vector<double> res(dim);
-         
-         f = 1.;
-         u = 1.;
-         
-         try
-           {
-             double r1, r2;
-
-             deallog.push("Jacobi");
-             r1 = check_solve(rich,A,u,f,prec_jacobi);
-             r2 = check_solve(relax,A,u,f,prec_jacobi);
-             deallog << "diff " << std::fabs(r1-r2)/r1 << std::endl;
-             r2 = check_solve(relax,A,u,f,prec_bjacobi);
-             deallog << "diff " << std::fabs(r1-r2)/r1 << std::endl;
-             deallog.pop();
-             
-             deallog.push("SOR   ");
-             r1 = check_solve(rich,A,u,f,prec_sor);
-             r2 = check_solve(relax,A,u,f,prec_sor);
-             deallog << "diff " << std::fabs(r1-r2)/r1 << std::endl;
-             r2 = check_solve(relax,A,u,f,prec_bsor);
-             deallog << "diff " << std::fabs(r1-r2)/r1 << std::endl;
-             r2 = check_solve(relax,A,u,f,prec_bsor2);
-             deallog << "diff " << std::fabs(r1-r2)/r1 << std::endl;
-             r2 = check_solve(relax,A,u,f,relax_sor);
-             deallog << "diff " << std::fabs(r1-r2)/r1 << std::endl;
-             deallog.pop();
-             
-             deallog.push("SSOR  ");
-             r1 = check_solve(rich,A,u,f,prec_ssor);
-             r2 = check_solve(relax,A,u,f,prec_ssor);
-             deallog << "diff " << std::fabs(r1-r2)/r1 << std::endl;
-             r2 = check_solve(relax,A,u,f,prec_bssor);
-             deallog << "diff " << std::fabs(r1-r2)/r1 << std::endl;
-             r2 = check_solve(relax,A,u,f,relax_ssor);
-             deallog << "diff " << std::fabs(r1-r2)/r1 << std::endl;
-             deallog.pop();
-             
-           }
-         catch (std::exception& e)
-           {
-             std::cerr << "Exception: " << e.what() << std::endl;
-           }
-       }
-    }  
+        {
+          deallog << "Block size " << blocksize << std::endl;
+
+          const unsigned int n_blocks = dim/blocksize;
+          RelaxationBlock<SparseMatrix<double>,double>::AdditionalData relax_data(0.8);
+          PreconditionBlock<SparseMatrix<double>,double>::AdditionalData prec_data(blocksize, 0.8);
+
+          // The permutation vectors;
+          std::vector<types::global_dof_index> bperm(n_blocks);
+          std::vector<types::global_dof_index> ibperm(n_blocks);
+
+          relax_data.block_list.reinit(n_blocks, dim, blocksize);
+          for (unsigned int block=0; block<n_blocks; ++block)
+            {
+              bperm[block] = n_blocks-block-1;
+              for (unsigned int i=0; i<blocksize; ++i)
+                relax_data.block_list.add(block, i+block*blocksize);
+            }
+          relax_data.block_list.compress();
+          // Currently, bperm is just
+          // the inversion.
+          // Now swap the last two
+          // and cyclically exchange
+          // the first three
+          unsigned int swap=bperm[n_blocks-1];
+          bperm[n_blocks-1] = bperm[n_blocks-2];
+          bperm[n_blocks-2] = swap;
+
+          swap = bperm[0];
+          bperm[0] = bperm[1];
+          bperm[1] = bperm[2];
+          bperm[2] = swap;
+
+          for (unsigned int block=0; block<n_blocks; ++block)
+            {
+              ibperm[bperm[block]] = block;
+              for (unsigned int i=0; i<blocksize; ++i)
+                perm[i+block*blocksize] = i+bperm[block]*blocksize;
+            }
+
+          for (unsigned int i=0; i<dim; ++i)
+            iperm[perm[i]] = i;
+
+          deallog << "Size " << bperm.size() << std::endl;
+
+          PreconditionBlockJacobi<SparseMatrix<double>,double> prec_jacobi;
+          prec_jacobi.initialize(A, perm, iperm, prec_data);
+          PreconditionBlockSOR<SparseMatrix<double>,double> prec_sor;
+          prec_sor.initialize(A, perm, iperm, prec_data);
+          PreconditionBlockSSOR<SparseMatrix<double>,double> prec_ssor;
+          prec_ssor.initialize(A, perm, iperm, prec_data);
+
+          PreconditionBlockJacobi<SparseMatrix<double>,double> prec_bjacobi;
+          prec_bjacobi.initialize(A, bperm, ibperm, prec_data);
+          PreconditionBlockSOR<SparseMatrix<double>,double> prec_bsor;
+          prec_bsor.initialize(A, bperm, ibperm, prec_data);
+          PreconditionBlockSOR<SparseMatrix<double>,double> prec_bsor2;
+          prec_bsor2.initialize(A, prec_data);
+          prec_bsor2.set_permutation(bperm, ibperm);
+          PreconditionBlockSSOR<SparseMatrix<double>,double> prec_bssor;
+          prec_bssor.initialize(A, bperm, ibperm, prec_data);
+
+          relax_data.order.resize(1);
+          relax_data.order[0].resize(bperm.size());
+          for (unsigned int i=0; i<bperm.size(); ++i)
+            relax_data.order[0][i] = bperm[i];
+
+          RelaxationBlockSOR<SparseMatrix<double>,double> relax_sor;
+          relax_sor.initialize(A, relax_data);
+
+          RelaxationBlockSSOR<SparseMatrix<double>,double> relax_ssor;
+          relax_ssor.initialize(A, relax_data);
+
+          Vector<double>  f(dim);
+          Vector<double>  u(dim);
+          Vector<double> res(dim);
+
+          f = 1.;
+          u = 1.;
+
+          try
+            {
+              double r1, r2;
+
+              deallog.push("Jacobi");
+              r1 = check_solve(rich,A,u,f,prec_jacobi);
+              r2 = check_solve(relax,A,u,f,prec_jacobi);
+              deallog << "diff " << std::fabs(r1-r2)/r1 << std::endl;
+              r2 = check_solve(relax,A,u,f,prec_bjacobi);
+              deallog << "diff " << std::fabs(r1-r2)/r1 << std::endl;
+              deallog.pop();
+
+              deallog.push("SOR   ");
+              r1 = check_solve(rich,A,u,f,prec_sor);
+              r2 = check_solve(relax,A,u,f,prec_sor);
+              deallog << "diff " << std::fabs(r1-r2)/r1 << std::endl;
+              r2 = check_solve(relax,A,u,f,prec_bsor);
+              deallog << "diff " << std::fabs(r1-r2)/r1 << std::endl;
+              r2 = check_solve(relax,A,u,f,prec_bsor2);
+              deallog << "diff " << std::fabs(r1-r2)/r1 << std::endl;
+              r2 = check_solve(relax,A,u,f,relax_sor);
+              deallog << "diff " << std::fabs(r1-r2)/r1 << std::endl;
+              deallog.pop();
+
+              deallog.push("SSOR  ");
+              r1 = check_solve(rich,A,u,f,prec_ssor);
+              r2 = check_solve(relax,A,u,f,prec_ssor);
+              deallog << "diff " << std::fabs(r1-r2)/r1 << std::endl;
+              r2 = check_solve(relax,A,u,f,prec_bssor);
+              deallog << "diff " << std::fabs(r1-r2)/r1 << std::endl;
+              r2 = check_solve(relax,A,u,f,relax_ssor);
+              deallog << "diff " << std::fabs(r1-r2)/r1 << std::endl;
+              deallog.pop();
+
+            }
+          catch (std::exception &e)
+            {
+              std::cerr << "Exception: " << e.what() << std::endl;
+            }
+        }
+    }
 }
 
index dcaa68c4d3834a6af885567e932fa2adab6746ed..0b0783e60ac12eda65ac06bcc7673d3e309495ea 100644 (file)
@@ -26,8 +26,8 @@
 // instantiation here
 template class SolverSelector<>;
 
-int main () 
-{  
+int main ()
+{
   std::ofstream logfile("solver_selector_00/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
index 6a5da227ad4d884771f19c676884fa48edc562c7..a4fd8a34c5a06b88059335b28c6b95221f55a398 100644 (file)
@@ -29,7 +29,7 @@
 
 template <class MATRIX, class VECTOR>
 void
-check(const MATRIX& A, const VECTOR& f)
+check(const MATRIX &A, const VECTOR &f)
 {
   std::vector<std::string> names;
   names.push_back("cg");
@@ -42,28 +42,28 @@ check(const MATRIX& A, const VECTOR& f)
   SolverSelector<VECTOR> solver;
   PreconditionSSOR<SparseMatrix<double> > pre;
   pre.initialize(A);
-  
+
   VECTOR u;
   u.reinit(f);
 
   std::vector<std::string>::const_iterator name;
-  
+
   solver.set_control(cont1);
-  for (name = names.begin(); name != names.end();++name)
+  for (name = names.begin(); name != names.end(); ++name)
     {
       solver.select(*name);
       u = 0.;
       solver.solve(A, u, f, pre);
     }
-  
+
   solver.set_control(cont2);
-  for (name = names.begin(); name != names.end();++name)
+  for (name = names.begin(); name != names.end(); ++name)
     {
       solver.select(*name);
       u = 0.;
       solver.solve(A, u, f, pre);
     }
-  
+
 }
 
 
@@ -78,10 +78,10 @@ int main()
 
   unsigned int size=37;
   unsigned int dim = (size-1)*(size-1);
-  
+
   deallog << "Size " << size << " Unknowns " << dim << std::endl;
-  
-                                  // Make matrix
+
+  // Make matrix
   FDMatrix testproblem(size, size);
   SparsityPattern structure(dim, dim, 5);
   testproblem.five_point_structure(structure);
@@ -90,6 +90,6 @@ int main()
   testproblem.five_point(A);
   Vector<double>  f(dim);
   f = 1.;
-  
+
   check(A, f);
 }
index 21a4a48ca5098affdfb0bdf6bd282c63b0658f7d..49ed1eb0c404ab4187f42b70c703d047bca74ea4 100644 (file)
 #include <fstream>
 
 class MySolverControl:
-   public SolverControl
+  public SolverControl
 {
-  public:
-    virtual State check(const unsigned int step,const double)
-      {
-       deallog << "MySolverControl " << step << std::endl;
-       return SolverControl::check(step, 0);
-      }
+public:
+  virtual State check(const unsigned int step,const double)
+  {
+    deallog << "MySolverControl " << step << std::endl;
+    return SolverControl::check(step, 0);
+  }
 };
 
 
@@ -44,7 +44,7 @@ class MySolverControl:
 
 template <class MATRIX, class VECTOR>
 void
-check(const MATRIX& A, const VECTOR& f)
+check(const MATRIX &A, const VECTOR &f)
 {
   std::vector<std::string> names;
   names.push_back("cg");
@@ -63,14 +63,14 @@ check(const MATRIX& A, const VECTOR& f)
   std::vector<std::string>::const_iterator name;
 
   solver.set_control(mycont);
-  for (name = names.begin(); name != names.end();++name)
+  for (name = names.begin(); name != names.end(); ++name)
     {
       solver.select(*name);
       u = 0.;
       solver.solve(A, u, f, pre);
     }
 
-                                  //test deprecated constructor too:
+  //test deprecated constructor too:
   GrowingVectorMemory<VECTOR> mem;
   SolverSelector<VECTOR> solver2("gmres", mycont, mem);
   u = 0.;
@@ -91,7 +91,7 @@ int main()
 
   deallog << "Size " << size << " Unknowns " << dim << std::endl;
 
-                                  // Make matrix
+  // Make matrix
   FDMatrix testproblem(size, size);
   SparsityPattern structure(dim, dim, 5);
   testproblem.five_point_structure(structure);
index 320c55831fe74aebe06cb76e0c6b29688abfde17..4191c7aa16ac766024fe4ab00b60f1ff80eef879 100644 (file)
@@ -41,15 +41,15 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
 
   for (unsigned int size=4; size <= 16; size *= 2)
     {
       unsigned int dim = (size-1)*(size-1);
 
       deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                      // Make matrix
+
+      // Make matrix
       FDMatrix testproblem(size, size);
       SparsityPattern structure(dim, dim, 5);
       testproblem.five_point_structure(structure);
@@ -57,72 +57,72 @@ int main()
       SparseMatrix<double>  A(structure);
       testproblem.five_point(A);
 
-      
+
       for (unsigned int test=0; test<2; ++test)
-       {
-         deallog << "Test " << test << std::endl;
-         
-                                          // generate sparse ILU.
-                                          //
-                                          // for test 1, test with
-                                          // full pattern.  for test
-                                          // 2, test with same
-                                          // pattern as A
-         SparsityPattern ilu_pattern (dim, dim,
-                                      (test==0 ? dim : 5));
-         switch (test)
-           {
-             case 0:
-                   for (unsigned int i=0; i<dim; ++i)
-                     for (unsigned int j=0; j<dim; ++j)
-                       ilu_pattern.add(i,j);
-                   break;
-
-             case 1:
-                   for (unsigned int i=0; i<dim; ++i)
-                     for (unsigned int j=0; j<dim; ++j)
-                       if (structure(i,j) != SparsityPattern::invalid_entry)
-                         ilu_pattern.add(i,j);
-                   break;
-
-             default:
-                   Assert (false, ExcNotImplemented());
-           };
-         ilu_pattern.compress();
-         SparseILU<double> ilu (ilu_pattern);
-         ilu.decompose (A);
-         
-                                          // now for three test vectors v
-                                          // determine norm of
-                                          // (I-BA)v, where B is ILU of A.
-                                          // since matrix is symmetric,
-                                          // likewise test for right
-                                          // preconditioner
-         Vector<double> v(dim);
-         Vector<double> tmp1(dim), tmp2(dim);
-         for (unsigned int i=0; i<3; ++i)
-           {
-             for (unsigned int j=0; j<dim; ++j)
-               v(j) = 1. * std::rand()/RAND_MAX;
-             
-             A.vmult (tmp1, v);
-             ilu.vmult (tmp2, tmp1);
-             tmp2 -= v;
-             const double left_residual = tmp2.l2_norm();
-             
-             ilu.vmult (tmp1, v);
-             A.vmult (tmp2, tmp1);
-             tmp2 -= v;
-             const double right_residual = tmp2.l2_norm();
-             
-             
-             deallog << "Residual with test vector " << i << ":  "
-                     << " left=" << left_residual
-                     << ", right=" << right_residual
-                     << std::endl;
-           };
-       };
-      
+        {
+          deallog << "Test " << test << std::endl;
+
+          // generate sparse ILU.
+          //
+          // for test 1, test with
+          // full pattern.  for test
+          // 2, test with same
+          // pattern as A
+          SparsityPattern ilu_pattern (dim, dim,
+                                       (test==0 ? dim : 5));
+          switch (test)
+            {
+            case 0:
+              for (unsigned int i=0; i<dim; ++i)
+                for (unsigned int j=0; j<dim; ++j)
+                  ilu_pattern.add(i,j);
+              break;
+
+            case 1:
+              for (unsigned int i=0; i<dim; ++i)
+                for (unsigned int j=0; j<dim; ++j)
+                  if (structure(i,j) != SparsityPattern::invalid_entry)
+                    ilu_pattern.add(i,j);
+              break;
+
+            default:
+              Assert (false, ExcNotImplemented());
+            };
+          ilu_pattern.compress();
+          SparseILU<double> ilu (ilu_pattern);
+          ilu.decompose (A);
+
+          // now for three test vectors v
+          // determine norm of
+          // (I-BA)v, where B is ILU of A.
+          // since matrix is symmetric,
+          // likewise test for right
+          // preconditioner
+          Vector<double> v(dim);
+          Vector<double> tmp1(dim), tmp2(dim);
+          for (unsigned int i=0; i<3; ++i)
+            {
+              for (unsigned int j=0; j<dim; ++j)
+                v(j) = 1. * std::rand()/RAND_MAX;
+
+              A.vmult (tmp1, v);
+              ilu.vmult (tmp2, tmp1);
+              tmp2 -= v;
+              const double left_residual = tmp2.l2_norm();
+
+              ilu.vmult (tmp1, v);
+              A.vmult (tmp2, tmp1);
+              tmp2 -= v;
+              const double right_residual = tmp2.l2_norm();
+
+
+              deallog << "Residual with test vector " << i << ":  "
+                      << " left=" << left_residual
+                      << ", right=" << right_residual
+                      << std::endl;
+            };
+        };
+
     };
 }
 
index a0b60054de6a7d0fe337562f6ab28c2fb7a63d7a..471dd5e04c6a2f13d1d830a328779ab18c03d48f 100644 (file)
@@ -41,47 +41,47 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
 
   for (unsigned int N=1; N<5; ++N)
     {
       deallog << "N=" << N << std::endl;
-      
+
       SparsityPattern structure(N, N, N);
       for (unsigned int i=0; i<N; ++i)
-       for (unsigned int j=0; j<N; ++j)
-         structure.add(i,j);
+        for (unsigned int j=0; j<N; ++j)
+          structure.add(i,j);
       structure.compress();
       SparseMatrix<double>  A(structure);
       for (unsigned int i=0; i<N; ++i)
-       {
-         A.set(i,i,2);
-         if (i>=1)
-           A.set(i,i-1, -1);
-         if (i<N-1)
-           A.set(i,i+1, -1);
-       }
+        {
+          A.set(i,i,2);
+          if (i>=1)
+            A.set(i,i-1, -1);
+          if (i<N-1)
+            A.set(i,i+1, -1);
+        }
 
       SparseILU<double> ilu;
       ilu.initialize (A, SparseILU<double>::AdditionalData());
 
-                                      // now get an explicit
-                                      // representation of the
-                                      // inverse
+      // now get an explicit
+      // representation of the
+      // inverse
       FullMatrix<double> inverse (N,N);
       Vector<double> tmp1(N), tmp2(N);
       for (unsigned int i=0; i<N; ++i)
-       {
-         tmp1 = 0;
-         tmp1(i) = 1;
-         ilu.vmult (tmp2, tmp1);
-         for (unsigned int j=0; j<N; ++j)
-           inverse(i,j) = tmp2(j);
-       }
+        {
+          tmp1 = 0;
+          tmp1(i) = 1;
+          ilu.vmult (tmp2, tmp1);
+          for (unsigned int j=0; j<N; ++j)
+            inverse(i,j) = tmp2(j);
+        }
 
       deallog << "Matrix A:" << std::endl;
       A.print_formatted (deallog.get_file_stream(), 3, false);
-  
+
       deallog << "Matrix A^{-1}:" << std::endl;
       inverse.print_formatted (deallog.get_file_stream(), 3, false);
 
index 0f085672c86f3b0b1c7340ce5b1b66c384b2d0ba..264f6775c86a15fe20dd13650ceda7201c71a31f 100644 (file)
@@ -41,15 +41,15 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
 
   for (unsigned int size=4; size <= 16; size *= 2)
     {
       unsigned int dim = (size-1)*(size-1);
 
       deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                      // Make matrix
+
+      // Make matrix
       FDMatrix testproblem(size, size);
       SparsityPattern structure(dim, dim, 5);
       testproblem.five_point_structure(structure);
@@ -57,73 +57,73 @@ int main()
       SparseMatrix<double>  A(structure);
       testproblem.five_point(A);
 
-      
+
       for (unsigned int test=0; test<2; ++test)
-       {
-         deallog << "Test " << test << std::endl;
-         
-                                          // generate sparse ILU.
-                                          //
-                                          // for test 1, test with
-                                          // full pattern.  for test
-                                          // 2, test with same
-                                          // pattern as A
-         SparsityPattern ilu_pattern (dim, dim,
-                                      (test==0 ? dim : 5));
-         switch (test)
-           {
-             case 0:
-                   for (unsigned int i=0; i<dim; ++i)
-                     for (unsigned int j=0; j<dim; ++j)
-                       ilu_pattern.add(i,j);
-                   break;
-
-             case 1:
-                   for (unsigned int i=0; i<dim; ++i)
-                     for (unsigned int j=0; j<dim; ++j)
-                       if (structure(i,j) != SparsityPattern::invalid_entry)
-                         ilu_pattern.add(i,j);
-                   break;
-
-             default:
-                   Assert (false, ExcNotImplemented());
-           };
-         ilu_pattern.compress();
-         SparseILU<double> ilu (ilu_pattern);
-         ilu.decompose (A);
-         
-                                          // now for three test vectors v
-                                          // determine norm of
-                                          // (I-B'A')v, where B' is the ILU 
-                                          // of A transposed.
-                                          // Since matrix is symmetric,
-                                          // likewise test for right
-                                          // preconditioner
-         Vector<double> v(dim);
-         Vector<double> tmp1(dim), tmp2(dim);
-         for (unsigned int i=0; i<3; ++i)
-           {
-             for (unsigned int j=0; j<dim; ++j)
-               v(j) = 1. * std::rand()/RAND_MAX;
-             
-             A.Tvmult (tmp1, v);
-             ilu.Tvmult (tmp2, tmp1);
-             tmp2 -= v;
-             const double left_residual = tmp2.l2_norm();
-             
-             ilu.Tvmult (tmp1, v);
-             A.Tvmult (tmp2, tmp1);
-             tmp2 -= v;
-             const double right_residual = tmp2.l2_norm();
-             
-             
-             deallog << "Residual with test vector " << i << ":  "
-                     << " left=" << left_residual
-                     << ", right=" << right_residual
-                     << std::endl;
-           };
-       };
-      
+        {
+          deallog << "Test " << test << std::endl;
+
+          // generate sparse ILU.
+          //
+          // for test 1, test with
+          // full pattern.  for test
+          // 2, test with same
+          // pattern as A
+          SparsityPattern ilu_pattern (dim, dim,
+                                       (test==0 ? dim : 5));
+          switch (test)
+            {
+            case 0:
+              for (unsigned int i=0; i<dim; ++i)
+                for (unsigned int j=0; j<dim; ++j)
+                  ilu_pattern.add(i,j);
+              break;
+
+            case 1:
+              for (unsigned int i=0; i<dim; ++i)
+                for (unsigned int j=0; j<dim; ++j)
+                  if (structure(i,j) != SparsityPattern::invalid_entry)
+                    ilu_pattern.add(i,j);
+              break;
+
+            default:
+              Assert (false, ExcNotImplemented());
+            };
+          ilu_pattern.compress();
+          SparseILU<double> ilu (ilu_pattern);
+          ilu.decompose (A);
+
+          // now for three test vectors v
+          // determine norm of
+          // (I-B'A')v, where B' is the ILU
+          // of A transposed.
+          // Since matrix is symmetric,
+          // likewise test for right
+          // preconditioner
+          Vector<double> v(dim);
+          Vector<double> tmp1(dim), tmp2(dim);
+          for (unsigned int i=0; i<3; ++i)
+            {
+              for (unsigned int j=0; j<dim; ++j)
+                v(j) = 1. * std::rand()/RAND_MAX;
+
+              A.Tvmult (tmp1, v);
+              ilu.Tvmult (tmp2, tmp1);
+              tmp2 -= v;
+              const double left_residual = tmp2.l2_norm();
+
+              ilu.Tvmult (tmp1, v);
+              A.Tvmult (tmp2, tmp1);
+              tmp2 -= v;
+              const double right_residual = tmp2.l2_norm();
+
+
+              deallog << "Residual with test vector " << i << ":  "
+                      << " left=" << left_residual
+                      << ", right=" << right_residual
+                      << std::endl;
+            };
+        };
+
     };
 }
 
index 3209c25235fc7fbe6941129d67317c12f9e057fb..60479f158c8505ddb0df2cc0fb977e2bd88756d7 100644 (file)
 
 template<class MATRIX>
 void
-check_vmult_quadratic(std::vector<double>residuals,
-                     const MATRIX& A,
-                     const char* prefix)
+check_vmult_quadratic(std::vector<double> &residuals,
+                      const MATRIX &A,
+                      const char *prefix)
 {
   deallog.push(prefix);
-  
+
   Vector<double> u(A.n());
   Vector<double> f(A.m());
   GrowingVectorMemory<> mem;
@@ -60,18 +60,18 @@ check_vmult_quadratic(std::vector<double>& residuals,
 
   const types::global_dof_index block_size = (types::global_dof_index) std::sqrt(A.n()+.3);
   const unsigned int n_blocks = A.n()/block_size;
-  
+
   typename PreconditionBlock<MATRIX, float>::AdditionalData
-    data(block_size, 1.2);
+  data(block_size, 1.2);
   std::vector<types::global_dof_index> perm(A.n());
   std::vector<types::global_dof_index> iperm(A.n());
-  for (unsigned int i=0;i<n_blocks;++i)
-    for (unsigned int j=0;j<block_size;++j)
+  for (unsigned int i=0; i<n_blocks; ++i)
+    for (unsigned int j=0; j<block_size; ++j)
       {
-       perm[block_size*i+j] = block_size*((i+1)%n_blocks)+j;
-       iperm[perm[block_size*i+j]] = block_size*i+j;
+        perm[block_size*i+j] = block_size*((i+1)%n_blocks)+j;
+        iperm[perm[block_size*i+j]] = block_size*i+j;
       }
-  
+
   PreconditionIdentity identity;
   PreconditionJacobi<MATRIX> jacobi;
   jacobi.initialize(A, .5);
@@ -91,7 +91,7 @@ check_vmult_quadratic(std::vector<double>& residuals,
   PreconditionBlockSOR<MATRIX, float> block_psor;
   block_psor.set_permutation(perm, iperm);
   block_psor.initialize(A, data);
-  
+
   f = 1.;
 
   PREC_CHECK(rich, solve, identity);
@@ -103,7 +103,7 @@ check_vmult_quadratic(std::vector<double>& residuals,
   PREC_CHECK(prich, solve, block_ssor);
   PREC_CHECK(prich, solve, block_sor);
   PREC_CHECK(prich, solve, block_psor);
-  
+
   deallog << "Transpose" << std::endl;
   PREC_CHECK(rich, Tsolve, identity);
   PREC_CHECK(prich, Tsolve, jacobi);
@@ -120,12 +120,12 @@ check_vmult_quadratic(std::vector<double>& residuals,
 
 
 void
-check_vmult_quadratic(std::vector<double>residuals,
-                     const BlockSparseMatrix<double> & A,
-                     const char* prefix)
+check_vmult_quadratic(std::vector<double> &residuals,
+                      const BlockSparseMatrix<double> &A,
+                      const char *prefix)
 {
   deallog.push(prefix);
-  
+
   Vector<double> u(A.n());
   Vector<double> f(A.m());
   GrowingVectorMemory<> mem;
@@ -138,11 +138,11 @@ check_vmult_quadratic(std::vector<double>& residuals,
   jacobi.initialize(A, .5);
 
   PreconditionBlock<BlockSparseMatrix<double>, float>::AdditionalData
-    data((unsigned int) std::sqrt(A.n()+.3), 1.2);
-  
+  data((unsigned int) std::sqrt(A.n()+.3), 1.2);
+
   PreconditionBlockJacobi<BlockSparseMatrix<double>, float> block_jacobi;
   block_jacobi.initialize(A, data);
-  
+
   u = 0.;
   f = 1.;
 
@@ -150,7 +150,7 @@ check_vmult_quadratic(std::vector<double>& residuals,
   PREC_CHECK(prich, solve, jacobi);
   u = 0.;
   PREC_CHECK(prich, solve, block_jacobi);
-  
+
   u = 0.;
   deallog << "Transpose" << std::endl;
   PREC_CHECK(rich, Tsolve, identity);
@@ -163,48 +163,48 @@ check_vmult_quadratic(std::vector<double>& residuals,
 
 template <class MATRIX>
 void
-check_iterator (const MATRIXA)
+check_iterator (const MATRIX &A)
 {
 //  deallog.push("it");
-  
+
   typename MATRIX::const_iterator E = A.end();
 
   if (A.m() < 10)
-    for (unsigned int r=0;r<A.m();++r)
+    for (unsigned int r=0; r<A.m(); ++r)
       {
-       typename MATRIX::const_iterator b = A.begin(r);
-       if (b == E)
-         deallog << "Final" << std::endl;
-       else
-         deallog << r
-                 << '\t' << b->row()
-                 << '\t' << b->column()
-                 << '\t' << b->value()
-                 << std::endl;
-       typename MATRIX::const_iterator e = A.end(r);
-       if (e == E)
-         deallog << "Final" << std::endl;
-       else
-         deallog << '\t' << e->row()
-                 << std::endl;
-       deallog << "cols:";
-       
-       for (typename MATRIX::const_iterator i=b;i!=e;++i)
-         deallog << '\t' << ',' << i->column();
-       deallog << std::endl;
+        typename MATRIX::const_iterator b = A.begin(r);
+        if (b == E)
+          deallog << "Final" << std::endl;
+        else
+          deallog << r
+                  << '\t' << b->row()
+                  << '\t' << b->column()
+                  << '\t' << b->value()
+                  << std::endl;
+        typename MATRIX::const_iterator e = A.end(r);
+        if (e == E)
+          deallog << "Final" << std::endl;
+        else
+          deallog << '\t' << e->row()
+                  << std::endl;
+        deallog << "cols:";
+
+        for (typename MATRIX::const_iterator i=b; i!=e; ++i)
+          deallog << '\t' << ',' << i->column();
+        deallog << std::endl;
       }
   for (typename MATRIX::const_iterator i = A.begin(); i!= A.end(); ++i)
     deallog << '\t' << i->row()
-           << '\t' << i->column()
-           << '\t' << i->value()
-           << std::endl;
+            << '\t' << i->column()
+            << '\t' << i->value()
+            << std::endl;
   deallog << "Repeat row 2" << std::endl;
   for (typename MATRIX::const_iterator i = A.begin(2); i!= A.end(2); ++i)
     deallog << '\t' << i->row()
-           << '\t' << i->column()
-           << '\t' << i->value()
-           << std::endl;
-  
+            << '\t' << i->column()
+            << '\t' << i->value()
+            << std::endl;
+
 //  deallog.pop();
 }
 
@@ -214,11 +214,11 @@ void check_ez_iterator()
   SparseMatrixEZ<float> m (6, 6, 0);
 
   deallog << "Empty matrix" << std::endl;
-  
+
   check_iterator(m);
 
   deallog << "Irregular matrix" << std::endl;
-  
+
   m.set (0, 0, 1.);
   m.set (1, 0, 2.);
   m.set (2, 0, 3.);
@@ -232,7 +232,7 @@ void check_ez_iterator()
 }
 
 
-void check_conjugate(std::ostreamout)
+void check_conjugate(std::ostream &out)
 {
   SparseMatrixEZ<double> B(3,2);
   SparseMatrixEZ<float>  A1(2,2);
@@ -267,7 +267,7 @@ void check_conjugate(std::ostream& out)
 
   out << "First conjugate" << std::endl;
   C1.print(out);
-  
+
   out << "Second conjugate" << std::endl;
   C2.print(out);
 }
@@ -280,9 +280,9 @@ int main()
   deallog << std::setprecision(3);
   deallog.attach(logfile);
 
-                                  // Switch between regression test
-                                  // and benchmark
-#ifdef DEBUG  
+  // Switch between regression test
+  // and benchmark
+#ifdef DEBUG
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
   const unsigned int size = 5;
@@ -294,17 +294,17 @@ int main()
   const unsigned int size = 50;
   const unsigned int row_length = 9;
 #endif
-  
+
   check_ez_iterator();
   check_conjugate(logfile);
-  
+
   FDMatrix testproblem (size, size);
   unsigned int dim = (size-1)*(size-1);
 
   std::vector<double> A_res;
   std::vector<double> E_res;
 
-                                  // usual sparse matrix
+  // usual sparse matrix
   SparsityPattern structure(dim, dim, 5);
   SparseMatrix<double>  A;
   {
@@ -320,8 +320,8 @@ int main()
 #endif
   }
 
-                                  // block sparse matrix with only
-                                  // one block
+  // block sparse matrix with only
+  // one block
   {
     deallog << "Structure" << std::endl;
     BlockSparsityPattern block_structure(1,1);
@@ -339,7 +339,7 @@ int main()
 #endif
   }
 
-                                  // ez sparse matrix
+  // ez sparse matrix
   SparseMatrixEZ<double> E(dim,dim,row_length,2);
   {
     deallog << "Assemble" << std::endl;
@@ -355,7 +355,7 @@ int main()
     else
       deallog << "Matrices differ!!" << std::endl;
   }
-  
+
   {
     structure.reinit(dim, dim, 5);
     deallog << "Structure" << std::endl;
@@ -367,7 +367,7 @@ int main()
     testproblem.nine_point(A);
     check_vmult_quadratic(A_res, A, "9-SparseMatrix<double>");
   }
-  
+
   E.clear();
   E.reinit(dim,dim,row_length,2);
   deallog << "Assemble" << std::endl;
@@ -375,17 +375,17 @@ int main()
   check_vmult_quadratic(E_res, E, "9-SparseMatrixEZ<double>");
   E.print_statistics(deallog, true);
 
-  for (unsigned int i=0;i<E_res.size();++i)
+  for (unsigned int i=0; i<E_res.size(); ++i)
     if (std::fabs(A_res[i] - E_res[i]) > 1.e-13)
       deallog << "SparseMatrix and SparseMatrixEZ differ!!!"
-             << std::endl;
-                                   // dump A into a file, and re-read
-                                   // it, then delete tmp file and
-                                   // check equality
+              << std::endl;
+  // dump A into a file, and re-read
+  // it, then delete tmp file and
+  // check equality
   std::ofstream tmp_write ("sparse_matrices.tmp");
   A.block_write (tmp_write);
   tmp_write.close ();
-  
+
   std::ifstream tmp_read ("sparse_matrices.tmp");
   SparseMatrix<double> A_tmp;
   A_tmp.reinit (A.get_sparsity_pattern());
@@ -396,7 +396,7 @@ int main()
 
   for (unsigned int i=0; i<A.n_nonzero_elements(); ++i)
     if (std::fabs(A.global_entry(i) - A_tmp.global_entry(i)) <=
-            std::fabs(1e-14*A.global_entry(i)))
+        std::fabs(1e-14*A.global_entry(i)))
       deallog << "write/read-error at global position "
-             << i << std::endl;
+              << i << std::endl;
 }
index 37103897ef69bc67184f767ecab572e4374f7c84..835294744fe23549fb85cf0c196c9023ab230a43 100644 (file)
 
 void test (const unsigned int n)
 {
-                                  // Create some random full matrices in the
-                                  // data structures of a sparse matrix
+  // Create some random full matrices in the
+  // data structures of a sparse matrix
   SparsityPattern sp (n,n);
   SparsityPattern C_sp (n,n);
-  for (unsigned int i=0;i<n;++i)
-    for (unsigned int j=0;j<n;++j)
+  for (unsigned int i=0; i<n; ++i)
+    for (unsigned int j=0; j<n; ++j)
       {
-       sp.add (i,j);
-       C_sp.add (i,j);
+        sp.add (i,j);
+        C_sp.add (i,j);
       }
   sp.compress ();
   C_sp.compress ();
@@ -53,23 +53,23 @@ void test (const unsigned int n)
   SparseMatrix<double> B(sp);
   SparseMatrix<double> C(C_sp);
 
-  for (unsigned int i=0;i<n;++i)
+  for (unsigned int i=0; i<n; ++i)
     {
-      for (unsigned int j=0;j<n;++j)
-       A.set(i,j,std::rand());
-      for (unsigned int j=0;j<n;++j)
-       B.set(i,j,std::rand());
+      for (unsigned int j=0; j<n; ++j)
+        A.set(i,j,std::rand());
+      for (unsigned int j=0; j<n; ++j)
+        B.set(i,j,std::rand());
     }
 
-                                  // now form the matrix-matrix product and
-                                  // initialize a test rhs
+  // now form the matrix-matrix product and
+  // initialize a test rhs
   A.Tmmult (C, B);
 
   Vector<double> x(n), y(n), z(n), tmp(n);
-  for (unsigned int j=0;j<n;++j)
+  for (unsigned int j=0; j<n; ++j)
     x(j) = std::rand();
 
-                                  // then test for correctness
+  // then test for correctness
   C.vmult (y, x);
 
   B.vmult (tmp, x);
@@ -77,7 +77,7 @@ void test (const unsigned int n)
 
   y -= z;
   Assert (y.l2_norm() <= 1e-12 * z.l2_norm(),
-         ExcInternalError());
+          ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
index 7405268aa4a7216c7cd909bd742590ca4d1f6753..1ba45271f2b2a34f18c51184546244fcb98025ed 100644 (file)
 
 void test (const unsigned int n)
 {
-                                  // Create some random full matrices in the
-                                  // data structures of a sparse matrix
+  // Create some random full matrices in the
+  // data structures of a sparse matrix
   SparsityPattern sp (n,n);
   SparsityPattern C_sp (n,n);
-  for (unsigned int i=0;i<n;++i)
-    for (unsigned int j=0;j<n;++j)
+  for (unsigned int i=0; i<n; ++i)
+    for (unsigned int j=0; j<n; ++j)
       {
-       sp.add (i,j);
-       C_sp.add (i,j);
+        sp.add (i,j);
+        C_sp.add (i,j);
       }
   sp.compress ();
   C_sp.compress ();
@@ -53,27 +53,27 @@ void test (const unsigned int n)
   SparseMatrix<double> B(sp);
   SparseMatrix<double> C(C_sp);
 
-  for (unsigned int i=0;i<n;++i)
+  for (unsigned int i=0; i<n; ++i)
     {
-      for (unsigned int j=0;j<n;++j)
-       A.set(i,j,std::rand());
-      for (unsigned int j=0;j<n;++j)
-       B.set(i,j,std::rand());
+      for (unsigned int j=0; j<n; ++j)
+        A.set(i,j,std::rand());
+      for (unsigned int j=0; j<n; ++j)
+        B.set(i,j,std::rand());
     }
 
   Vector<double> v(n);
-  for (unsigned int j=0;j<n;++j)
+  for (unsigned int j=0; j<n; ++j)
     v(j) = std::rand();
 
-                                  // now form the matrix-matrix product and
-                                  // initialize a test rhs
+  // now form the matrix-matrix product and
+  // initialize a test rhs
   A.Tmmult (C, B, v);
 
   Vector<double> x(n), y(n), z(n), tmp(n);
-  for (unsigned int j=0;j<n;++j)
+  for (unsigned int j=0; j<n; ++j)
     x(j) = std::rand();
 
-                                  // then test for correctness
+  // then test for correctness
   C.vmult (y, x);
 
   B.vmult (tmp, x);
@@ -82,7 +82,7 @@ void test (const unsigned int n)
 
   y -= z;
   Assert (y.l2_norm() <= 1e-12 * z.l2_norm(),
-         ExcInternalError());
+          ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
index 173054175681e32098dbdd5624229674fad1cd6c..4943737e60528322b6c4fc65ec38d5478b5cd440 100644 (file)
@@ -36,7 +36,7 @@ int main()
   pattern.add(3,0);
   pattern.add(3,4);
   pattern.compress();
-  
+
   SparseMatrix<float> matrix(pattern);
   matrix.set(0,2, 3.5);
   matrix.set(0,0, 1.);
@@ -47,33 +47,33 @@ int main()
   matrix.set(3,0, 2.);
   matrix.set(3,4, 0.);
 
-                                  // Print the matrix
-  for (SparseMatrix<float>::const_iterator i=matrix.begin(); i != matrix.end();++i)
+  // Print the matrix
+  for (SparseMatrix<float>::const_iterator i=matrix.begin(); i != matrix.end(); ++i)
     deallog << i->row() << ' ' << i->column() << ' ' << i->value() << std::endl;
   deallog << std::endl;
-  
-                                  // Add 0.5 to each element
-  for (SparseMatrix<float>::iterator i=matrix.begin(); i != matrix.end();++i)
+
+  // Add 0.5 to each element
+  for (SparseMatrix<float>::iterator i=matrix.begin(); i != matrix.end(); ++i)
     i->value() += .5;
-  
-                                  // Print the matrix
-  for (SparseMatrix<float>::const_iterator i=matrix.begin(); i != matrix.end();++i)
+
+  // Print the matrix
+  for (SparseMatrix<float>::const_iterator i=matrix.begin(); i != matrix.end(); ++i)
     deallog << i->row() << ' ' << i->column() << ' ' << i->value() << std::endl;
   deallog << std::endl;
-  
-                                  // Subtract 1 from each element in row 2
-  for (SparseMatrix<float>::iterator i=matrix.begin(2); i != matrix.end(2);++i)
+
+  // Subtract 1 from each element in row 2
+  for (SparseMatrix<float>::iterator i=matrix.begin(2); i != matrix.end(2); ++i)
     i->value() -= 1.;
 
-                                  //  Double each element in row 1
-  for (SparseMatrix<float>::iterator i=matrix.begin(1); i != matrix.end(1);++i)
+  //  Double each element in row 1
+  for (SparseMatrix<float>::iterator i=matrix.begin(1); i != matrix.end(1); ++i)
     i->value() *= 2;
 
-                                  // Set the first entry to zero
+  // Set the first entry to zero
   matrix.begin()->value() = 0;
-  
-                                  // Print the matrix
-  for (SparseMatrix<float>::const_iterator i=matrix.begin(); i != matrix.end();++i)
+
+  // Print the matrix
+  for (SparseMatrix<float>::const_iterator i=matrix.begin(); i != matrix.end(); ++i)
     deallog << i->row() << ' ' << i->column() << ' ' << i->value() << std::endl;
   deallog << std::endl;
 }
index 281915c4556ff73c280c203f93aeea126b094a81..48c6e6d2d4cc437460e7e4d3f25022ce64eaaeca 100644 (file)
 
 void test (const unsigned int n)
 {
-                                  // Create some random full matrices in the
-                                  // data structures of a sparse matrix
+  // Create some random full matrices in the
+  // data structures of a sparse matrix
   SparsityPattern sp (n,n);
   SparsityPattern C_sp (n,n);
-  for (unsigned int i=0;i<n;++i)
-    for (unsigned int j=0;j<n;++j)
+  for (unsigned int i=0; i<n; ++i)
+    for (unsigned int j=0; j<n; ++j)
       {
-       sp.add (i,j);
-       C_sp.add (i,j);
+        sp.add (i,j);
+        C_sp.add (i,j);
       }
   sp.compress ();
   C_sp.compress ();
@@ -53,23 +53,23 @@ void test (const unsigned int n)
   SparseMatrix<double> B(sp);
   SparseMatrix<double> C(C_sp);
 
-  for (unsigned int i=0;i<n;++i)
+  for (unsigned int i=0; i<n; ++i)
     {
-      for (unsigned int j=0;j<n;++j)
-       A.set(i,j,std::rand());
-      for (unsigned int j=0;j<n;++j)
-       B.set(i,j,std::rand());
+      for (unsigned int j=0; j<n; ++j)
+        A.set(i,j,std::rand());
+      for (unsigned int j=0; j<n; ++j)
+        B.set(i,j,std::rand());
     }
 
-                                  // now form the matrix-matrix product and
-                                  // initialize a test rhs
+  // now form the matrix-matrix product and
+  // initialize a test rhs
   A.mmult (C, B);
 
   Vector<double> x(n), y(n), z(n), tmp(n);
-  for (unsigned int j=0;j<n;++j)
+  for (unsigned int j=0; j<n; ++j)
     x(j) = std::rand();
 
-                                  // then test for correctness
+  // then test for correctness
   C.vmult (y, x);
 
   B.vmult (tmp, x);
@@ -77,7 +77,7 @@ void test (const unsigned int n)
 
   y -= z;
   Assert (y.l2_norm() <= 1e-12 * z.l2_norm(),
-         ExcInternalError());
+          ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
index 948f16615a4f7f083e64e8f6e3ab0d45a6fdf91b..f247afa29e020163d9fe0a870bf189e9efee5a0b 100644 (file)
 
 void test (const unsigned int n)
 {
-                                  // Create some random full matrices in the
-                                  // data structures of a sparse matrix
+  // Create some random full matrices in the
+  // data structures of a sparse matrix
   SparsityPattern sp (n,n);
   SparsityPattern C_sp (n,n);
-  for (unsigned int i=0;i<n;++i)
-    for (unsigned int j=0;j<n;++j)
+  for (unsigned int i=0; i<n; ++i)
+    for (unsigned int j=0; j<n; ++j)
       {
-       sp.add (i,j);
-       C_sp.add (i,j);
+        sp.add (i,j);
+        C_sp.add (i,j);
       }
   sp.compress ();
   C_sp.compress ();
@@ -53,27 +53,27 @@ void test (const unsigned int n)
   SparseMatrix<double> B(sp);
   SparseMatrix<double> C(C_sp);
 
-  for (unsigned int i=0;i<n;++i)
+  for (unsigned int i=0; i<n; ++i)
     {
-      for (unsigned int j=0;j<n;++j)
-       A.set(i,j,std::rand());
-      for (unsigned int j=0;j<n;++j)
-       B.set(i,j,std::rand());
+      for (unsigned int j=0; j<n; ++j)
+        A.set(i,j,std::rand());
+      for (unsigned int j=0; j<n; ++j)
+        B.set(i,j,std::rand());
     }
 
   Vector<double> v(n);
-  for (unsigned int j=0;j<n;++j)
+  for (unsigned int j=0; j<n; ++j)
     v(j) = std::rand();
 
-                                  // now form the matrix-matrix product and
-                                  // initialize a test rhs
+  // now form the matrix-matrix product and
+  // initialize a test rhs
   A.mmult (C, B, v);
 
   Vector<double> x(n), y(n), z(n), tmp(n);
-  for (unsigned int j=0;j<n;++j)
+  for (unsigned int j=0; j<n; ++j)
     x(j) = std::rand();
 
-                                  // then test for correctness
+  // then test for correctness
   C.vmult (y, x);
 
   B.vmult (tmp, x);
@@ -82,7 +82,7 @@ void test (const unsigned int n)
 
   y -= z;
   Assert (y.l2_norm() <= 1e-12 * z.l2_norm(),
-         ExcInternalError());
+          ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
index 02c598c87ac37d54f82aee94c292d8bcad034d14..93d65978ec526b72221b7e035e271d0e8236a06a 100644 (file)
@@ -49,81 +49,81 @@ int main()
 
       deallog << "Size " << size << " Unknowns " << dim << std::endl;
 
-                                      // Make matrix
+      // Make matrix
       FDMatrix testproblem(size, size);
       SparsityPattern structure(dim, dim, dim);
       //      testproblem.five_point_structure(structure);
       for (unsigned int i=0; i<dim; ++i)
-       for (unsigned int j=0; j<dim; ++j)
-         structure.add(i,j);
+        for (unsigned int j=0; j<dim; ++j)
+          structure.add(i,j);
       structure.compress();
       SparseMatrix<double>  A(structure);
       testproblem.five_point(A);
 
 
       for (unsigned int test=0; test<2; ++test)
-       {
-         deallog << "Test " << test << std::endl;
-
-                                          // generate sparse ILU.
-                                          //
-                                          // for test 1, test with
-                                          // full pattern.  for test
-                                          // 2, test with same
-                                          // pattern as A
-         SparsityPattern mic_pattern (dim, dim, dim);
-         switch (test)
-           {
-             case 0:
-                   for (unsigned int i=0; i<dim; ++i)
-                     for (unsigned int j=0; j<dim; ++j)
-                       mic_pattern.add(i,j);
-                   break;
-
-             case 1:
-                   for (unsigned int i=0; i<dim; ++i)
-                     for (unsigned int j=0; j<dim; ++j)
-                       if (structure(i,j) != SparsityPattern::invalid_entry)
-                         mic_pattern.add(i,j);
-                   break;
-
-             default:
-                   Assert (false, ExcNotImplemented());
-           };
-         mic_pattern.compress();
-         SparseMIC<double> mic (mic_pattern);
-         mic.decompose (A);
-
-                                          // now for three test vectors v
-                                          // determine norm of
-                                          // (I-BA)v, where B is MIC of A.
-                                          // since matrix is symmetric,
-                                          // likewise test for right
-                                          // preconditioner
-         Vector<double> v(dim);
-         Vector<double> tmp1(dim), tmp2(dim);
-         for (unsigned int i=0; i<3; ++i)
-           {
-             for (unsigned int j=0; j<dim; ++j)
-               v(j) = 1. * std::rand()/RAND_MAX;
-
-             A.vmult (tmp1, v);
-             mic.vmult (tmp2, tmp1);
-             tmp2 -= v;
-             const double left_residual = tmp2.l2_norm() / v.l2_norm();
-
-             mic.vmult (tmp1, v);
-             A.vmult (tmp2, tmp1);
-             tmp2 -= v;
-             const double right_residual = tmp2.l2_norm() / v.l2_norm();
-
-
-             deallog << "Relative residual with test vector " << i << ":  "
-                     << " left=" << left_residual
-                     << ", right=" << right_residual
-                     << std::endl;
-           };
-       };
+        {
+          deallog << "Test " << test << std::endl;
+
+          // generate sparse ILU.
+          //
+          // for test 1, test with
+          // full pattern.  for test
+          // 2, test with same
+          // pattern as A
+          SparsityPattern mic_pattern (dim, dim, dim);
+          switch (test)
+            {
+            case 0:
+              for (unsigned int i=0; i<dim; ++i)
+                for (unsigned int j=0; j<dim; ++j)
+                  mic_pattern.add(i,j);
+              break;
+
+            case 1:
+              for (unsigned int i=0; i<dim; ++i)
+                for (unsigned int j=0; j<dim; ++j)
+                  if (structure(i,j) != SparsityPattern::invalid_entry)
+                    mic_pattern.add(i,j);
+              break;
+
+            default:
+              Assert (false, ExcNotImplemented());
+            };
+          mic_pattern.compress();
+          SparseMIC<double> mic (mic_pattern);
+          mic.decompose (A);
+
+          // now for three test vectors v
+          // determine norm of
+          // (I-BA)v, where B is MIC of A.
+          // since matrix is symmetric,
+          // likewise test for right
+          // preconditioner
+          Vector<double> v(dim);
+          Vector<double> tmp1(dim), tmp2(dim);
+          for (unsigned int i=0; i<3; ++i)
+            {
+              for (unsigned int j=0; j<dim; ++j)
+                v(j) = 1. * std::rand()/RAND_MAX;
+
+              A.vmult (tmp1, v);
+              mic.vmult (tmp2, tmp1);
+              tmp2 -= v;
+              const double left_residual = tmp2.l2_norm() / v.l2_norm();
+
+              mic.vmult (tmp1, v);
+              A.vmult (tmp2, tmp1);
+              tmp2 -= v;
+              const double right_residual = tmp2.l2_norm() / v.l2_norm();
+
+
+              deallog << "Relative residual with test vector " << i << ":  "
+                      << " left=" << left_residual
+                      << ", right=" << right_residual
+                      << std::endl;
+            };
+        };
 
     };
 }
index 08dcd80d898b80712a434614d9706d12aea350c9..677bced3a9d128608b4afe71b26a296cd5fb5327 100644 (file)
@@ -37,139 +37,139 @@ main ()
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-                                  // generate usual sparsity pattern
+  // generate usual sparsity pattern
   const unsigned int N = 15;
   SparsityPattern sp1((N-1)*(N-1), (N-1)*(N-1), 5);
   FDMatrix(N,N).five_point_structure (sp1);
   sp1.compress ();
   deallog << sp1.n_rows() << " " << sp1.n_cols() << " "
-         << sp1.bandwidth() << " " << sp1.n_nonzero_elements()
-         << std::endl;
+          << sp1.bandwidth() << " " << sp1.n_nonzero_elements()
+          << std::endl;
   for (unsigned int i=0; i<sp1.n_rows(); ++i)
     deallog << sp1.row_length(i) << std::endl;
   sp1.print_gnuplot(deallog.get_file_stream());
 
-                                  // generate copy of sp1 with extra
-                                  // off-diagonals
+  // generate copy of sp1 with extra
+  // off-diagonals
   SparsityPattern sp2(sp1, 10, 2);
   sp2.compress ();
   deallog << sp2.n_rows() << " " << sp2.n_cols() << " "
-         << sp2.bandwidth() << " " << sp2.n_nonzero_elements()
-         << std::endl;
+          << sp2.bandwidth() << " " << sp2.n_nonzero_elements()
+          << std::endl;
   for (unsigned int i=0; i<sp2.n_rows(); ++i)
     deallog << sp2.row_length(i) << std::endl;
   sp2.print_gnuplot(deallog.get_file_stream());
 
 
-                                  // generate copy of sp1 with extra
-                                  // off-diagonals, add some
-                                  // non-symmetric elements and
-                                  // symmetrize again
+  // generate copy of sp1 with extra
+  // off-diagonals, add some
+  // non-symmetric elements and
+  // symmetrize again
   SparsityPattern sp3(sp1, (N-1)*(N-1), 2);
   for (unsigned int i=0; i<(N-1)*(N-1); ++i)
     sp3.add (0,i);
   sp3.symmetrize ();
   sp3.compress ();
   deallog << sp3.n_rows() << " " << sp3.n_cols() << " "
-         << sp3.bandwidth() << " " << sp3.n_nonzero_elements()
-         << std::endl;
+          << sp3.bandwidth() << " " << sp3.n_nonzero_elements()
+          << std::endl;
   for (unsigned int i=0; i<sp3.n_rows(); ++i)
     deallog << sp3.row_length(i) << std::endl;
   sp3.print_gnuplot(deallog.get_file_stream());
 
 
-                                  // now test the copy_from
-                                  // function. for this copy over the
-                                  // column indices, but in different
-                                  // order as the order should not
-                                  // matter to that function
+  // now test the copy_from
+  // function. for this copy over the
+  // column indices, but in different
+  // order as the order should not
+  // matter to that function
   std::list<std::set<unsigned int,std::greater<unsigned int> > > sparsity;
   for (unsigned int row=0; row<sp3.n_rows(); ++row)
     {
       sparsity.push_back (std::set<unsigned int,std::greater<unsigned int> >());
       for (const types::global_dof_index *p=sp3.get_column_numbers()+sp3.get_rowstart_indices()[row];
-          p != sp3.get_column_numbers()+sp3.get_rowstart_indices()[row+1]; ++p)
-       sparsity.back().insert (*p);
+           p != sp3.get_column_numbers()+sp3.get_rowstart_indices()[row+1]; ++p)
+        sparsity.back().insert (*p);
     };
   SparsityPattern sp4;
   sp4.copy_from ((N-1)*(N-1), (N-1)*(N-1),
-                sparsity.begin(), sparsity.end());
+                 sparsity.begin(), sparsity.end());
 
-                                  // now check for equivalence of sp3 and sp4
+  // now check for equivalence of sp3 and sp4
   for (unsigned int row=0; row<sp3.n_rows(); ++row)
     {
       const types::global_dof_index
-        *sp3_p=sp3.get_column_numbers()+sp3.get_rowstart_indices()[row];
+      *sp3_p=sp3.get_column_numbers()+sp3.get_rowstart_indices()[row];
       const types::global_dof_index
-        *sp4_p=sp4.get_column_numbers()+sp4.get_rowstart_indices()[row];
+      *sp4_p=sp4.get_column_numbers()+sp4.get_rowstart_indices()[row];
       for (; sp3_p != (sp3.get_column_numbers() +
                        sp3.get_rowstart_indices()[row+1]);
            ++sp3_p, ++sp4_p)
-       Assert (*sp3_p == *sp4_p, ExcInternalError());
+        Assert (*sp3_p == *sp4_p, ExcInternalError());
     };
 
 
-                                  // check the matrix_position
-                                  // function with sparsity patterns
-                                  // sp1 through sp4. the checked
-                                  // function should be the inverse
-                                  // of operator()
-                                  //
-                                  // check inverseness property first
-                                  // forward, then backward
+  // check the matrix_position
+  // function with sparsity patterns
+  // sp1 through sp4. the checked
+  // function should be the inverse
+  // of operator()
+  //
+  // check inverseness property first
+  // forward, then backward
   for (unsigned int loop=1; loop<=4; ++loop)
     {
       const SparsityPattern &
-       sp = (loop==1 ? sp1 : (loop==2 ? sp2 : (loop==3 ? sp3 : sp4)));
+      sp = (loop==1 ? sp1 : (loop==2 ? sp2 : (loop==3 ? sp3 : sp4)));
       for (unsigned int i=0; i<sp.n_nonzero_elements(); ++i)
-       Assert (sp(sp.matrix_position(i).first,
-                   sp.matrix_position(i).second) == i,
-               ExcInternalError());
+        Assert (sp(sp.matrix_position(i).first,
+                   sp.matrix_position(i).second) == i,
+                ExcInternalError());
       for (types::global_dof_index row=0; row<sp.n_rows(); ++row)
-       for (types::global_dof_index col=0; col<sp.n_cols(); ++col)
-         if (sp(row,col) != SparsityPattern::invalid_entry)
-           Assert (sp.matrix_position(sp(row,col)) ==
-                   std::make_pair(row,col),
-                   ExcInternalError());
+        for (types::global_dof_index col=0; col<sp.n_cols(); ++col)
+          if (sp(row,col) != SparsityPattern::invalid_entry)
+            Assert (sp.matrix_position(sp(row,col)) ==
+                    std::make_pair(row,col),
+                    ExcInternalError());
     };
 
-  
-                                   // check block_write/block_read by
-                                   // dumping a sparsity pattern and
-                                   // checking whether the
-                                   // read-back-in pattern is the same
+
+  // check block_write/block_read by
+  // dumping a sparsity pattern and
+  // checking whether the
+  // read-back-in pattern is the same
   std::ofstream tmp_write("sparsity_pattern.tmp");
   sp3.block_write (tmp_write);
   tmp_write.close ();
 
   SparsityPattern sp5;
-  
+
   std::ifstream tmp_read("sparsity_pattern.tmp");
   sp5.block_read (tmp_read);
   tmp_read.close ();
 
-                                   // delete temporary file
+  // delete temporary file
   std::remove ("sparsity_pattern.tmp");
-  
-                                  // now check for equivalence of sp3 and sp5
+
+  // now check for equivalence of sp3 and sp5
   deallog << sp3.n_rows() - sp5.n_rows() << ' '
-         << sp3.n_cols() - sp5.n_cols() << ' '
-         << (sp3.is_compressed() ^ sp5.is_compressed()) << ' '
-         << (sp3.is_compressed() ^ sp5.is_compressed()) << ' '
-         << std::endl;
-  
+          << sp3.n_cols() - sp5.n_cols() << ' '
+          << (sp3.is_compressed() ^ sp5.is_compressed()) << ' '
+          << (sp3.is_compressed() ^ sp5.is_compressed()) << ' '
+          << std::endl;
+
   for (unsigned int row=0; row<sp3.n_rows(); ++row)
     {
       const types::global_dof_index
-        *sp3_p=sp3.get_column_numbers()+sp3.get_rowstart_indices()[row];
+      *sp3_p=sp3.get_column_numbers()+sp3.get_rowstart_indices()[row];
       const types::global_dof_index
-        *sp5_p=sp5.get_column_numbers()+sp5.get_rowstart_indices()[row];
+      *sp5_p=sp5.get_column_numbers()+sp5.get_rowstart_indices()[row];
       for (; sp3_p != (sp3.get_column_numbers() +
                        sp3.get_rowstart_indices()[row+1]);
            ++sp3_p, ++sp5_p)
-       Assert (*sp3_p == *sp5_p, ExcInternalError());
+        Assert (*sp3_p == *sp5_p, ExcInternalError());
     };
 }
 
-  
-  
+
+
index 4a05f7095373c4261506cecb6ffc4bb07ce2fd9d..53dcae4483be5df45d7ebcc6f2b02232f14def19 100644 (file)
@@ -32,5 +32,5 @@ int main ()
   row_length<SparsityPattern> ();
 }
 
-  
-  
+
+
index b8da36a9bff9dab537bc1a2caba55e0cbea3381f..61b9d06695f26115fe8887d1ad834184140c9796 100644 (file)
@@ -32,5 +32,5 @@ int main ()
   print_gnuplot<SparsityPattern> ();
 }
 
-  
-  
+
+
index e1cc2b7dcdd3fa8010cfe9e1b467da7ec659917d..fcae85224747fcefbd4ef7ee2f2c9a981a4bf766 100644 (file)
@@ -32,5 +32,5 @@ int main ()
   print<SparsityPattern> ();
 }
 
-  
-  
+
+
index 92ba4fb4562964e6e79d65a09d47106269646bd8..a9c0c4479db665be21cdf21f30bb34e913b68e7e 100644 (file)
@@ -32,5 +32,5 @@ int main ()
   copy_with_offdiagonals_1<SparsityPattern> ();
 }
 
-  
-  
+
+
index 2e772e746e2502bde9db6f78bfd71ec1aa5da1a3..963e96c950740974360e7317399121f275c6bcc6 100644 (file)
@@ -32,5 +32,5 @@ int main ()
   copy_with_offdiagonals_2<SparsityPattern> ();
 }
 
-  
-  
+
+
index c870327a193b6b209fabffcbb61e31ddb1a9e64a..6ed9f98cd9c929d5fe7fbca09c6b2b52ddb3a779 100644 (file)
@@ -32,5 +32,5 @@ int main ()
   copy_from_1<SparsityPattern> ();
 }
 
-  
-  
+
+
index 60eb412cab5474c644beb2f07ef1aebdeaea6007..b1ebeebe4593e954c514d054f53152b14d1b39a0 100644 (file)
@@ -32,5 +32,5 @@ int main ()
   copy_from_2<SparsityPattern, CompressedSparsityPattern> ();
 }
 
-  
-  
+
+
index 49a1f132017016066c648e4838fa07d1d155550e..4dab855164b32cab3be71b4371a7035edb2b0012 100644 (file)
@@ -32,5 +32,5 @@ int main ()
   copy_from_2<SparsityPattern, CompressedSetSparsityPattern> ();
 }
 
-  
-  
+
+
index ed1d5bf0054ded7069b22846a4069560a82cb6c1..6ff867f71234d316a201bd9a499f79cfadaa9921 100644 (file)
@@ -32,5 +32,5 @@ int main ()
   copy_from_4<SparsityPattern> ();
 }
 
-  
-  
+
+
index 6d372a6faa71b214bb32603617b06c66787e91a6..2104aa39373ecd50ddfa7df732eded5ca66f7587 100644 (file)
@@ -32,5 +32,5 @@ int main ()
   matrix_position<SparsityPattern> ();
 }
 
-  
-  
+
+
index 1e66fc76dc5d49390d79a7f90d5b132896dae385..91e99ebfc31584395583b7ef6cb88589c4086cbd 100644 (file)
@@ -32,5 +32,5 @@ int main ()
   block_read_write<SparsityPattern> ();
 }
 
-  
-  
+
+
index f731f56db26eba03a18455c3e56ef6ee48c1cc3b..8beb4a6e81e30cfc8d4b805bbeab558acafbab6c 100644 (file)
@@ -57,7 +57,7 @@ void do_reinit (CompressedSparsityPattern &sp)
 }
 
 void do_reinit (CompressedSimpleSparsityPattern &sp,
-               const IndexSet &index_set = IndexSet())
+                const IndexSet &index_set = IndexSet())
 {
   sp.reinit((N-1)*(N-1), (N-1)*(N-1), index_set);
 }
@@ -72,16 +72,16 @@ void do_reinit (CompressedSetSparsityPattern &sp)
 template <typename SP>
 void build_sparsity (SP &sparsity_pattern)
 {
-                                  // generate usual 5-point sparsity pattern
+  // generate usual 5-point sparsity pattern
   do_reinit (sparsity_pattern);
   FDMatrix(N,N).five_point_structure (sparsity_pattern);
   sparsity_pattern.compress ();
 
   deallog << sparsity_pattern.n_rows() << " "
-         << sparsity_pattern.n_cols() << " "
-         << sparsity_pattern.bandwidth() << " "
-         << sparsity_pattern.n_nonzero_elements()
-         << std::endl;
+          << sparsity_pattern.n_cols() << " "
+          << sparsity_pattern.bandwidth() << " "
+          << sparsity_pattern.n_nonzero_elements()
+          << std::endl;
 }
 
 
@@ -127,8 +127,8 @@ template <typename SP>
 void copy_with_offdiagonals_check (SP &sp2)
 {
   deallog << sp2.n_rows() << " " << sp2.n_cols() << " "
-         << sp2.bandwidth() << " " << sp2.n_nonzero_elements()
-         << std::endl;
+          << sp2.bandwidth() << " " << sp2.n_nonzero_elements()
+          << std::endl;
   for (unsigned int i=0; i<sp2.n_rows(); ++i)
     deallog << sp2.row_length(i) << std::endl;
   sp2.print_gnuplot(deallog.get_file_stream());
@@ -142,8 +142,8 @@ void copy_with_offdiagonals_1 ()
   SparsityPattern sparsity_pattern;
   build_sparsity (sparsity_pattern);
 
-                                  // generate copy of sp1 with extra
-                                  // off-diagonals
+  // generate copy of sp1 with extra
+  // off-diagonals
   SP sp2(sparsity_pattern, 10, 2);
   sp2.compress ();
 
@@ -157,8 +157,8 @@ void copy_with_offdiagonals_1 ()
 template <>
 void copy_with_offdiagonals_1<ChunkSparsityPattern> ()
 {
-                                  // this sparsity pattern doesn't have this
-                                  // function
+  // this sparsity pattern doesn't have this
+  // function
   deallog << "OK" << std::endl;
 }
 
@@ -167,24 +167,24 @@ void copy_with_offdiagonals_1<ChunkSparsityPattern> ()
 template <>
 void copy_with_offdiagonals_1<CompressedSparsityPattern> ()
 {
-                                  // this sparsity pattern doesn't have this
-                                  // function
+  // this sparsity pattern doesn't have this
+  // function
   deallog << "OK" << std::endl;
 }
 
 template <>
 void copy_with_offdiagonals_1<CompressedSimpleSparsityPattern> ()
 {
-                   // this sparsity pattern doesn't have this
-                   // function
+  // this sparsity pattern doesn't have this
+  // function
   deallog << "OK" << std::endl;
 }
 
 template <>
 void copy_with_offdiagonals_1<CompressedSetSparsityPattern> ()
 {
-                                  // this sparsity pattern doesn't have this
-                                  // function
+  // this sparsity pattern doesn't have this
+  // function
   deallog << "OK" << std::endl;
 }
 
@@ -196,10 +196,10 @@ void copy_with_offdiagonals_2 ()
   SparsityPattern sparsity_pattern;
   build_sparsity (sparsity_pattern);
 
-                                  // generate copy of sp1 with
-                                  // extra off-diagonals, add some
-                                  // non-symmetric elements and symmetrize
-                                  // again
+  // generate copy of sp1 with
+  // extra off-diagonals, add some
+  // non-symmetric elements and symmetrize
+  // again
   SP sp3(sparsity_pattern, (N-1)*(N-1), 2);
   for (unsigned int i=0; i<(N-1)*(N-1); ++i)
     sp3.add (0,i);
@@ -215,8 +215,8 @@ void copy_with_offdiagonals_2 ()
 template <>
 void copy_with_offdiagonals_2<ChunkSparsityPattern> ()
 {
-                                  // this sparsity pattern doesn't have this
-                                  // function
+  // this sparsity pattern doesn't have this
+  // function
   deallog << "OK" << std::endl;
 }
 
@@ -225,8 +225,8 @@ void copy_with_offdiagonals_2<ChunkSparsityPattern> ()
 template <>
 void copy_with_offdiagonals_2<CompressedSparsityPattern> ()
 {
-                                  // this sparsity pattern doesn't have this
-                                  // function
+  // this sparsity pattern doesn't have this
+  // function
   deallog << "OK" << std::endl;
 }
 
@@ -235,8 +235,8 @@ void copy_with_offdiagonals_2<CompressedSparsityPattern> ()
 template <>
 void copy_with_offdiagonals_2<CompressedSimpleSparsityPattern> ()
 {
-                   // this sparsity pattern doesn't have this
-                   // function
+  // this sparsity pattern doesn't have this
+  // function
   deallog << "OK" << std::endl;
 }
 
@@ -245,8 +245,8 @@ void copy_with_offdiagonals_2<CompressedSimpleSparsityPattern> ()
 template <>
 void copy_with_offdiagonals_2<CompressedSetSparsityPattern> ()
 {
-                                  // this sparsity pattern doesn't have this
-                                  // function
+  // this sparsity pattern doesn't have this
+  // function
   deallog << "OK" << std::endl;
 }
 
@@ -254,38 +254,38 @@ void copy_with_offdiagonals_2<CompressedSetSparsityPattern> ()
 
 void
 do_copy_from (const std::list<std::set<unsigned int,std::greater<unsigned int> > > &sparsity,
-             SparsityPattern &sp4)
+              SparsityPattern &sp4)
 {
   sp4.copy_from ((N-1)*(N-1), (N-1)*(N-1),
-                sparsity.begin(), sparsity.end());
+                 sparsity.begin(), sparsity.end());
 }
 
 
 
 void
 do_copy_from (const std::list<std::set<unsigned int,std::greater<unsigned int> > > &sparsity,
-             ChunkSparsityPattern &sp4)
+              ChunkSparsityPattern &sp4)
 {
   sp4.copy_from ((N-1)*(N-1), (N-1)*(N-1),
-                sparsity.begin(), sparsity.end(),
-                chunk_size);
+                 sparsity.begin(), sparsity.end(),
+                 chunk_size);
 }
 
 
 template <typename SP>
 void
 do_copy_from (const CompressedSparsityPattern &sparsity,
-             SP &sp4)
+              SP &sp4)
 {
   std::list<std::set<unsigned int,std::greater<unsigned int> > > sparsity_x;
   for (unsigned int i=0; i<sparsity.n_rows(); ++i)
     {
       sparsity_x.push_back
-       (std::set<unsigned int,std::greater<unsigned int> >());
+      (std::set<unsigned int,std::greater<unsigned int> >());
 
       for (unsigned int j=0; j<sparsity.n_cols(); ++j)
-       if (sparsity.exists(i,j))
-         sparsity_x.back().insert (j);
+        if (sparsity.exists(i,j))
+          sparsity_x.back().insert (j);
     }
 
   do_copy_from (sparsity_x, sp4);
@@ -295,17 +295,17 @@ do_copy_from (const CompressedSparsityPattern &sparsity,
 template <typename SP>
 void
 do_copy_from (const CompressedSimpleSparsityPattern &sparsity,
-          SP &sp4)
+              SP &sp4)
 {
   std::list<std::set<unsigned int,std::greater<unsigned int> > > sparsity_x;
   for (unsigned int i=0; i<sparsity.n_rows(); ++i)
     {
       sparsity_x.push_back
-    (std::set<unsigned int,std::greater<unsigned int> >());
+      (std::set<unsigned int,std::greater<unsigned int> >());
 
       for (unsigned int j=0; j<sparsity.n_cols(); ++j)
-    if (sparsity.exists(i,j))
-      sparsity_x.back().insert (j);
+        if (sparsity.exists(i,j))
+          sparsity_x.back().insert (j);
     }
 
   do_copy_from (sparsity_x, sp4);
@@ -315,17 +315,17 @@ do_copy_from (const CompressedSimpleSparsityPattern &sparsity,
 template <typename SP>
 void
 do_copy_from (const CompressedSetSparsityPattern &sparsity,
-             SP &sp4)
+              SP &sp4)
 {
   std::list<std::set<unsigned int,std::greater<unsigned int> > > sparsity_x;
   for (unsigned int i=0; i<sparsity.n_rows(); ++i)
     {
       sparsity_x.push_back
-       (std::set<unsigned int,std::greater<unsigned int> >());
+      (std::set<unsigned int,std::greater<unsigned int> >());
 
       for (unsigned int j=0; j<sparsity.n_cols(); ++j)
-       if (sparsity.exists(i,j))
-         sparsity_x.back().insert (j);
+        if (sparsity.exists(i,j))
+          sparsity_x.back().insert (j);
     }
 
   do_copy_from (sparsity_x, sp4);
@@ -336,7 +336,7 @@ do_copy_from (const CompressedSetSparsityPattern &sparsity,
 template <typename SP>
 void
 do_copy_from (const FullMatrix<double> &sparsity,
-             SP &sp4)
+              SP &sp4)
 {
   sp4.copy_from (sparsity);
 }
@@ -344,7 +344,7 @@ do_copy_from (const FullMatrix<double> &sparsity,
 
 void
 do_copy_from (const FullMatrix<double> &sparsity,
-             ChunkSparsityPattern &sp4)
+              ChunkSparsityPattern &sp4)
 {
   sp4.copy_from (sparsity, chunk_size);
 }
@@ -358,44 +358,43 @@ void copy_from_1 ()
   SparsityPattern sparsity_pattern;
   build_sparsity (sparsity_pattern);
 
-                                  // now test the copy_from function. for
-                                  // this copy over the column indices, but
-                                  // in different order as the order should
-                                  // not matter to that function
+  // now test the copy_from function. for
+  // this copy over the column indices, but
+  // in different order as the order should
+  // not matter to that function
   std::list<std::set<unsigned int,std::greater<unsigned int> > > sparsity;
   for (unsigned int row=0; row<sparsity_pattern.n_rows(); ++row)
     {
       sparsity.push_back
-       (std::set<unsigned int,std::greater<unsigned int> >());
+      (std::set<unsigned int,std::greater<unsigned int> >());
       for (SparsityPattern::iterator p = sparsity_pattern.begin(row);
-          p != sparsity_pattern.end(row);
-          ++p)
-       sparsity.back().insert (p->column());
+           p != sparsity_pattern.end(row);
+           ++p)
+        sparsity.back().insert (p->column());
     }
   SP sp4;
   do_copy_from (sparsity, sp4);
 
-                                  // now check for equivalence of original
-                                  // and copy if both only store explicitly
-                                  // added elements. otherwise, check that
-                                  // the presence of an element in the source
-                                  // implies an element in the copy
+  // now check for equivalence of original
+  // and copy if both only store explicitly
+  // added elements. otherwise, check that
+  // the presence of an element in the source
+  // implies an element in the copy
   if ((sparsity_pattern.stores_only_added_elements() == true)
       &&
       (sp4.stores_only_added_elements() == true))
     Assert (sparsity_pattern.n_nonzero_elements() ==
-           sp4.n_nonzero_elements(),
-           ExcInternalError());
+            sp4.n_nonzero_elements(),
+            ExcInternalError());
   for (unsigned int i=0; i<sparsity_pattern.n_rows(); ++i)
     for (unsigned int j=0; j<sparsity_pattern.n_cols(); ++j)
       if ((sparsity_pattern.stores_only_added_elements() == true)
-         &&
-         (sp4.stores_only_added_elements() == true))
-       Assert (sparsity_pattern.exists(i,j) == sp4.exists (i,j),
-               ExcInternalError())
-      else
-       if (sparsity_pattern.exists(i,j))
-         Assert (sp4.exists (i,j), ExcInternalError());
+          &&
+          (sp4.stores_only_added_elements() == true))
+        Assert (sparsity_pattern.exists(i,j) == sp4.exists (i,j),
+                ExcInternalError())
+        else if (sparsity_pattern.exists(i,j))
+          Assert (sp4.exists (i,j), ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
@@ -411,27 +410,26 @@ void copy_from_2 ()
   SP sp4;
   do_copy_from (sparsity_pattern, sp4);
 
-                                  // now check for equivalence of original
-                                  // and copy if both only store explicitly
-                                  // added elements. otherwise, check that
-                                  // the presence of an element in the source
-                                  // implies an element in the copy
+  // now check for equivalence of original
+  // and copy if both only store explicitly
+  // added elements. otherwise, check that
+  // the presence of an element in the source
+  // implies an element in the copy
   if ((sparsity_pattern.stores_only_added_elements() == true)
       &&
       (sp4.stores_only_added_elements() == true))
     Assert (sparsity_pattern.n_nonzero_elements() ==
-           sp4.n_nonzero_elements(),
-           ExcInternalError());
+            sp4.n_nonzero_elements(),
+            ExcInternalError());
   for (unsigned int i=0; i<sparsity_pattern.n_rows(); ++i)
     for (unsigned int j=0; j<sparsity_pattern.n_cols(); ++j)
       if ((sparsity_pattern.stores_only_added_elements() == true)
-         &&
-         (sp4.stores_only_added_elements() == true))
-       Assert (sparsity_pattern.exists(i,j) == sp4.exists (i,j),
-               ExcInternalError())
-      else
-       if (sparsity_pattern.exists(i,j))
-         Assert (sp4.exists (i,j), ExcInternalError());
+          &&
+          (sp4.stores_only_added_elements() == true))
+        Assert (sparsity_pattern.exists(i,j) == sp4.exists (i,j),
+                ExcInternalError())
+        else if (sparsity_pattern.exists(i,j))
+          Assert (sp4.exists (i,j), ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
@@ -446,33 +444,33 @@ void copy_from_4 ()
   for (unsigned int i=0; i<M; ++i)
     for (unsigned int j=0; j<M; ++j)
       if (std::abs((int)(i-j)) == 3)
-       sparsity_pattern (i,j) = 1;
+        sparsity_pattern (i,j) = 1;
 
   SP sp4;
   do_reinit (sp4);
   do_copy_from (sparsity_pattern, sp4);
 
-                                  // now check for equivalence of original
-                                  // and copy
+  // now check for equivalence of original
+  // and copy
   if (sp4.stores_only_added_elements() == true)
     Assert (sp4.n_nonzero_elements() ==
-           static_cast<unsigned int>(sparsity_pattern.frobenius_norm() *
-                                     sparsity_pattern.frobenius_norm()
-                                     + 0.5),
-           ExcInternalError())
-  else
-    Assert (sp4.n_nonzero_elements() >=
-           static_cast<unsigned int>(sparsity_pattern.frobenius_norm() *
-                                     sparsity_pattern.frobenius_norm()
-                                     + 0.5),
-           ExcInternalError());
+            static_cast<unsigned int>(sparsity_pattern.frobenius_norm() *
+                                      sparsity_pattern.frobenius_norm()
+                                      + 0.5),
+            ExcInternalError())
+    else
+      Assert (sp4.n_nonzero_elements() >=
+              static_cast<unsigned int>(sparsity_pattern.frobenius_norm() *
+                                        sparsity_pattern.frobenius_norm()
+                                        + 0.5),
+              ExcInternalError());
 
   for (unsigned int i=0; i<M; ++i)
     for (unsigned int j=0; j<M; ++j)
       if (std::abs((int)(i-j)) == 3)
-       Assert (sp4.exists (i,j)
-               == true,
-               ExcInternalError());
+        Assert (sp4.exists (i,j)
+                == true,
+                ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
@@ -485,20 +483,20 @@ void matrix_position ()
   SP sparsity_pattern;
   build_sparsity (sparsity_pattern);
 
-                                  // check the matrix_position
-                                  // function. the checked
-                                  // function should be the inverse
-                                  // of operator()
+  // check the matrix_position
+  // function. the checked
+  // function should be the inverse
+  // of operator()
   for (unsigned int i=0; i<sparsity_pattern.n_nonzero_elements(); ++i)
     Assert (sparsity_pattern(sparsity_pattern.matrix_position(i).first,
-                            sparsity_pattern.matrix_position(i).second) == i,
-           ExcInternalError());
+                             sparsity_pattern.matrix_position(i).second) == i,
+            ExcInternalError());
   for (types::global_dof_index row=0; row<sparsity_pattern.n_rows(); ++row)
     for (types::global_dof_index col=0; col<sparsity_pattern.n_cols(); ++col)
       if (sparsity_pattern(row,col) != SparsityPattern::invalid_entry)
-       Assert (sparsity_pattern.matrix_position(sparsity_pattern(row,col)) ==
-               std::make_pair(row,col),
-               ExcInternalError());
+        Assert (sparsity_pattern.matrix_position(sparsity_pattern(row,col)) ==
+                std::make_pair(row,col),
+                ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
@@ -507,7 +505,7 @@ void matrix_position ()
 template <>
 void matrix_position<ChunkSparsityPattern> ()
 {
-                                  // this class doesn't have that function
+  // this class doesn't have that function
   deallog << "OK" << std::endl;
 }
 
@@ -515,7 +513,7 @@ void matrix_position<ChunkSparsityPattern> ()
 template <>
 void matrix_position<CompressedSparsityPattern> ()
 {
-                                  // this class doesn't have that function
+  // this class doesn't have that function
   deallog << "OK" << std::endl;
 }
 
@@ -524,7 +522,7 @@ void matrix_position<CompressedSparsityPattern> ()
 template <>
 void matrix_position<CompressedSimpleSparsityPattern> ()
 {
-                   // this class doesn't have that function
+  // this class doesn't have that function
   deallog << "OK" << std::endl;
 }
 
@@ -533,7 +531,7 @@ void matrix_position<CompressedSimpleSparsityPattern> ()
 template <>
 void matrix_position<CompressedSetSparsityPattern> ()
 {
-                                  // this class doesn't have that function
+  // this class doesn't have that function
   deallog << "OK" << std::endl;
 }
 
@@ -545,10 +543,10 @@ void block_read_write ()
   SP sparsity_pattern;
   build_sparsity (sparsity_pattern);
 
-                                // check block_write/block_read by
-                                // dumping a sparsity pattern and
-                                // checking whether the
-                                // read-back-in pattern is the same
+  // check block_write/block_read by
+  // dumping a sparsity pattern and
+  // checking whether the
+  // read-back-in pattern is the same
   std::ostringstream tmp_write;
   sparsity_pattern.block_write (tmp_write);
 
@@ -557,16 +555,16 @@ void block_read_write ()
   std::istringstream tmp_read(tmp_write.str());
   sp5.block_read (tmp_read);
 
-                                  // now check for equivalence of
-                                  // sparsity_pattern and sp5
+  // now check for equivalence of
+  // sparsity_pattern and sp5
   deallog << sparsity_pattern.n_rows() - sp5.n_rows() << ' '
-         << sparsity_pattern.n_cols() - sp5.n_cols() << ' '
-         << std::endl;
+          << sparsity_pattern.n_cols() - sp5.n_cols() << ' '
+          << std::endl;
 
   for (unsigned int i=0; i<sparsity_pattern.n_rows(); ++i)
     for (unsigned int j=0; j<sparsity_pattern.n_cols(); ++j)
       Assert (sparsity_pattern.exists(i,j) == sp5.exists (i,j),
-             ExcInternalError());
+              ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
@@ -576,8 +574,8 @@ void block_read_write ()
 template <>
 void block_read_write<CompressedSparsityPattern> ()
 {
-                                  // not implemented for this sparsity
-                                  // pattern
+  // not implemented for this sparsity
+  // pattern
   deallog << "OK" << std::endl;
 }
 
@@ -586,8 +584,8 @@ void block_read_write<CompressedSparsityPattern> ()
 template <>
 void block_read_write<CompressedSimpleSparsityPattern> ()
 {
-                   // not implemented for this sparsity
-                   // pattern
+  // not implemented for this sparsity
+  // pattern
   deallog << "OK" << std::endl;
 }
 
@@ -596,8 +594,8 @@ void block_read_write<CompressedSimpleSparsityPattern> ()
 template <>
 void block_read_write<CompressedSetSparsityPattern> ()
 {
-                                  // not implemented for this sparsity
-                                  // pattern
+  // not implemented for this sparsity
+  // pattern
   deallog << "OK" << std::endl;
 }
 
@@ -628,23 +626,23 @@ void test_index_set (const bool contiguous)
   for (unsigned int i=0; i<sp1.n_rows(); ++i)
     {
       deallog << sp1.row_length(i) << ' '
-             << (index_set.is_element(i) ? (int)sp2.row_length(i) : -1)
-             << std::endl;
+              << (index_set.is_element(i) ? (int)sp2.row_length(i) : -1)
+              << std::endl;
       if (index_set.is_element(i))
-       Assert (sp2.row_length(i) == sp1.row_length(i), ExcInternalError());
+        Assert (sp2.row_length(i) == sp1.row_length(i), ExcInternalError());
 
       if (index_set.is_element(i))
-       {
-         deallog << "      columns=";
-         for (unsigned int j=0; j<sp2.row_length(i); ++j)
-           {
-             deallog << sp1.column_number(i,j) << ' ';
-             Assert (sp1.column_number(i,j) ==
-                     sp2.column_number(i,j),
-                     ExcInternalError());
-           }
-         deallog << std::endl;
-       }
+        {
+          deallog << "      columns=";
+          for (unsigned int j=0; j<sp2.row_length(i); ++j)
+            {
+              deallog << sp1.column_number(i,j) << ' ';
+              Assert (sp1.column_number(i,j) ==
+                      sp2.column_number(i,j),
+                      ExcInternalError());
+            }
+          deallog << std::endl;
+        }
     }
 
   deallog << "OK" << std::endl;
index 0b34fe4628071af3e29257ec33a4a02b6df232a1..71b6383e95a7922c6777634686e762b68e93a34c 100644 (file)
@@ -40,9 +40,9 @@ int main ()
   for (unsigned int i=0; i<4; ++i)
     sp.add (i,i);
 
-                                  // create a graph with components
-                                  // 0,2 and 1,3 that are
-                                  // disconnected
+  // create a graph with components
+  // 0,2 and 1,3 that are
+  // disconnected
   sp.add (0,2);
   sp.add (2,0);
 
@@ -51,7 +51,7 @@ int main ()
 
   sp.compress ();
 
-                                  // now find permutation
+  // now find permutation
   std::vector<types::global_dof_index> permutation(4);
   SparsityTools::reorder_Cuthill_McKee (sp, permutation);
 
index 57bab8f60cdca1f9cba23f094b0603371705c294..ae5fab6a9da74c4c3497a521bb6a1bf18519fb38 100644 (file)
 
 class FDMatrix
 {
-  public:
-                                    /**
-                                     * Constructor specifying grid resolution.
-                                     */
-    FDMatrix(unsigned int nx, unsigned int ny);
-    
-                                    /**
-                                     * Generate the matrix structure.
-                                     */
-    template <typename SP>
-    void five_point_structure(SP& structure) const;
-    
-                                    /**
-                                     * Generate the matrix structure.
-                                     */
-    template <typename SP>
-    void nine_point_structure(SP& structure) const;
-    
-                                    /**
-                                     * Fill the matrix with values.
-                                     */
-    template <typename MATRIX>
-    void five_point(MATRIX&, bool nonsymmetric = false) const;
-
-                                    /**
-                                     * Fill the matrix with values.
-                                     */
-    template <typename MATRIX>
-    void nine_point(MATRIX&, bool nonsymmetric = false) const;
-
-                                    /**
-                                     * Fill the matrix with values.
-                                     */
-    template <typename MATRIX>
-    void upwind(MATRIX&, bool back = false) const;
-
-    template <typename number>
-    void gnuplot_print(std::ostream&, const Vector<number>&) const;
-    
-  private:
-                                    /**
-                                     * Number of gridpoints in x-direction.
-                                     */
-    unsigned int nx;
-
-                                    /**
-                                     * Number of gridpoints in y-direction.
-                                     */
-    unsigned int ny;
+public:
+  /**
+   * Constructor specifying grid resolution.
+   */
+  FDMatrix(unsigned int nx, unsigned int ny);
+
+  /**
+   * Generate the matrix structure.
+   */
+  template <typename SP>
+  void five_point_structure(SP &structure) const;
+
+  /**
+   * Generate the matrix structure.
+   */
+  template <typename SP>
+  void nine_point_structure(SP &structure) const;
+
+  /**
+   * Fill the matrix with values.
+   */
+  template <typename MATRIX>
+  void five_point(MATRIX &, bool nonsymmetric = false) const;
+
+  /**
+   * Fill the matrix with values.
+   */
+  template <typename MATRIX>
+  void nine_point(MATRIX &, bool nonsymmetric = false) const;
+
+  /**
+   * Fill the matrix with values.
+   */
+  template <typename MATRIX>
+  void upwind(MATRIX &, bool back = false) const;
+
+  template <typename number>
+  void gnuplot_print(std::ostream &, const Vector<number> &) const;
+
+private:
+  /**
+   * Number of gridpoints in x-direction.
+   */
+  unsigned int nx;
+
+  /**
+   * Number of gridpoints in y-direction.
+   */
+  unsigned int ny;
 };
 
 
@@ -72,8 +72,8 @@ class FDMatrix
 
 inline
 FDMatrix::FDMatrix(unsigned int nx, unsigned int ny)
-               :
-               nx(nx), ny(ny)
+  :
+  nx(nx), ny(ny)
 {}
 
 
@@ -81,36 +81,36 @@ FDMatrix::FDMatrix(unsigned int nx, unsigned int ny)
 template <typename SP>
 inline
 void
-FDMatrix::five_point_structure(SPstructure) const
+FDMatrix::five_point_structure(SP &structure) const
 {
-  for(unsigned int i=0;i<=ny-2;i++)
+  for (unsigned int i=0; i<=ny-2; i++)
     {
-      for(unsigned int j=0;j<=nx-2; j++)
-       {
-                                          // Number of the row to be entered
-         unsigned int row = j+(nx-1)*i;
-         structure.add(row, row);
-         if (j>0)
-           {
-             structure.add(row-1, row);
-             structure.add(row, row-1);
-           }
-         if (j<nx-2)
-           {
-             structure.add(row+1, row);
-             structure.add(row, row+1);
-           }
-         if (i>0)
-           {
-             structure.add(row-(nx-1), row);
-             structure.add(row, row-(nx-1));
-           }
-         if (i<ny-2)
-           {
-             structure.add(row+(nx-1), row);
-             structure.add(row, row+(nx-1));
-           }
-       }
+      for (unsigned int j=0; j<=nx-2; j++)
+        {
+          // Number of the row to be entered
+          unsigned int row = j+(nx-1)*i;
+          structure.add(row, row);
+          if (j>0)
+            {
+              structure.add(row-1, row);
+              structure.add(row, row-1);
+            }
+          if (j<nx-2)
+            {
+              structure.add(row+1, row);
+              structure.add(row, row+1);
+            }
+          if (i>0)
+            {
+              structure.add(row-(nx-1), row);
+              structure.add(row, row-(nx-1));
+            }
+          if (i<ny-2)
+            {
+              structure.add(row+(nx-1), row);
+              structure.add(row, row+(nx-1));
+            }
+        }
     }
 }
 
@@ -119,56 +119,56 @@ FDMatrix::five_point_structure(SP& structure) const
 template <typename SP>
 inline
 void
-FDMatrix::nine_point_structure(SPstructure) const
+FDMatrix::nine_point_structure(SP &structure) const
 {
-  for(unsigned int i=0;i<=ny-2;i++)
+  for (unsigned int i=0; i<=ny-2; i++)
     {
-      for(unsigned int j=0;j<=nx-2; j++)
-       {
-                                          // Number of the row to be entered
-         unsigned int row = j+(nx-1)*i;
-         structure.add(row, row);
-         if (j>0)
-           {
-             structure.add(row-1, row);
-             structure.add(row, row-1);
-             if (i>0)
-               {
-                 structure.add(row-1, row-(nx-1));
-                 structure.add(row-(nx-1), row-1);
-               }
-             if (i<ny-2)
-               {
-                 structure.add(row-1, row+(nx-1));
-                 structure.add(row+(nx-1), row-1);
-               }
-           }
-         if (j<nx-2)
-           {
-             structure.add(row+1, row);
-             structure.add(row, row+1);
-             if (i>0)
-               {
-                 structure.add(row+1, row-(nx-1));
-                 structure.add(row-(nx-1), row+1);
-               }
-             if (i<ny-2)
-               {
-                 structure.add(row+1, row+(nx-1));
-                 structure.add(row+(nx-1), row+1);
-               }
-           }
-         if (i>0)
-           {
-             structure.add(row-(nx-1), row);
-             structure.add(row, row-(nx-1));
-           }
-         if (i<ny-2)
-           {
-             structure.add(row+(nx-1), row);
-             structure.add(row, row+(nx-1));
-           }
-       }
+      for (unsigned int j=0; j<=nx-2; j++)
+        {
+          // Number of the row to be entered
+          unsigned int row = j+(nx-1)*i;
+          structure.add(row, row);
+          if (j>0)
+            {
+              structure.add(row-1, row);
+              structure.add(row, row-1);
+              if (i>0)
+                {
+                  structure.add(row-1, row-(nx-1));
+                  structure.add(row-(nx-1), row-1);
+                }
+              if (i<ny-2)
+                {
+                  structure.add(row-1, row+(nx-1));
+                  structure.add(row+(nx-1), row-1);
+                }
+            }
+          if (j<nx-2)
+            {
+              structure.add(row+1, row);
+              structure.add(row, row+1);
+              if (i>0)
+                {
+                  structure.add(row+1, row-(nx-1));
+                  structure.add(row-(nx-1), row+1);
+                }
+              if (i<ny-2)
+                {
+                  structure.add(row+1, row+(nx-1));
+                  structure.add(row+(nx-1), row+1);
+                }
+            }
+          if (i>0)
+            {
+              structure.add(row-(nx-1), row);
+              structure.add(row, row-(nx-1));
+            }
+          if (i<ny-2)
+            {
+              structure.add(row+(nx-1), row);
+              structure.add(row, row+(nx-1));
+            }
+        }
     }
 }
 
@@ -176,100 +176,100 @@ FDMatrix::nine_point_structure(SP& structure) const
 
 template<typename MATRIX>
 void
-FDMatrix::nine_point(MATRIXA, bool) const
+FDMatrix::nine_point(MATRIX &A, bool) const
 {
-   for(unsigned int i=0;i<=ny-2;i++)
+  for (unsigned int i=0; i<=ny-2; i++)
     {
-      for(unsigned int j=0;j<=nx-2; j++)
-       {
-                                          // Number of the row to be entered
-         unsigned int row = j+(nx-1)*i;
-         
-         A.set(row, row, 20.);
-         if (j>0)
-           {
-             A.set(row-1, row, -4.);
-             A.set(row, row-1, -4.);
-             if (i>0)
-               {
-                 A.set(row-1, row-(nx-1), -1.);
-                 A.set(row-(nx-1), row-1, -1.);
-               }
-             if (i<ny-2)
-               {
-                 A.set(row-1, row+(nx-1), -1.);
-                 A.set(row+(nx-1), row-1, -1.);
-               }
-           }
-         if (j<nx-2)
-           {
-             A.set(row+1, row, -4.);
-             A.set(row, row+1, -4.);
-             if (i>0)
-               {
-                 A.set(row+1, row-(nx-1), -1.);
-                 A.set(row-(nx-1), row+1, -1.);
-               }
-             if (i<ny-2)
-               {
-                 A.set(row+1, row+(nx-1), -1.);
-                 A.set(row+(nx-1), row+1, -1.);
-               }
-           }
-         if (i>0)
-           {
-             A.set(row-(nx-1), row, -4.);
-             A.set(row, row-(nx-1), -4.);
-           }
-         if (i<ny-2)
-           {
-             A.set(row+(nx-1), row, -4.);
-             A.set(row, row+(nx-1), -4.);
-           }
-       }
-    } 
+      for (unsigned int j=0; j<=nx-2; j++)
+        {
+          // Number of the row to be entered
+          unsigned int row = j+(nx-1)*i;
+
+          A.set(row, row, 20.);
+          if (j>0)
+            {
+              A.set(row-1, row, -4.);
+              A.set(row, row-1, -4.);
+              if (i>0)
+                {
+                  A.set(row-1, row-(nx-1), -1.);
+                  A.set(row-(nx-1), row-1, -1.);
+                }
+              if (i<ny-2)
+                {
+                  A.set(row-1, row+(nx-1), -1.);
+                  A.set(row+(nx-1), row-1, -1.);
+                }
+            }
+          if (j<nx-2)
+            {
+              A.set(row+1, row, -4.);
+              A.set(row, row+1, -4.);
+              if (i>0)
+                {
+                  A.set(row+1, row-(nx-1), -1.);
+                  A.set(row-(nx-1), row+1, -1.);
+                }
+              if (i<ny-2)
+                {
+                  A.set(row+1, row+(nx-1), -1.);
+                  A.set(row+(nx-1), row+1, -1.);
+                }
+            }
+          if (i>0)
+            {
+              A.set(row-(nx-1), row, -4.);
+              A.set(row, row-(nx-1), -4.);
+            }
+          if (i<ny-2)
+            {
+              A.set(row+(nx-1), row, -4.);
+              A.set(row, row+(nx-1), -4.);
+            }
+        }
+    }
 }
 
 template<typename MATRIX>
 inline
 void
-FDMatrix::five_point(MATRIXA, bool nonsymmetric) const
+FDMatrix::five_point(MATRIX &A, bool nonsymmetric) const
 {
-   for(unsigned int i=0;i<=ny-2;i++)
+  for (unsigned int i=0; i<=ny-2; i++)
     {
-      for(unsigned int j=0;j<=nx-2; j++)
-       {
-                                          // Number of the row to be entered
-         unsigned int row = j+(nx-1)*i;
-         if (nonsymmetric)
-           A.set(row, row, 5.);
-         else
-           A.set(row, row, 4.);
-         if (j>0)
-           {
-             if (nonsymmetric)
-               A.set(row-1, row, -2.);
-             else
-               A.set(row-1, row, -1.);
-             A.set(row, row-1, -1.);
-           }
-         if (j<nx-2)
-           {
-             A.set(row+1, row, -1.);
-             A.set(row, row+1, -1.);
-           }
-         if (i>0)
-           {
-             A.set(row-(nx-1), row, -1.);
-             A.set(row, row-(nx-1), -1.);
-           }
-         if (i<ny-2)
-           {
-             A.set(row+(nx-1), row, -1.);
-             A.set(row, row+(nx-1), -1.);
-           }
-       }
-    } 
+      for (unsigned int j=0; j<=nx-2; j++)
+        {
+          // Number of the row to be entered
+          unsigned int row = j+(nx-1)*i;
+          if (nonsymmetric)
+            A.set(row, row, 5.);
+          else
+            A.set(row, row, 4.);
+          if (j>0)
+            {
+              if (nonsymmetric)
+                A.set(row-1, row, -2.);
+              else
+                A.set(row-1, row, -1.);
+              A.set(row, row-1, -1.);
+            }
+          if (j<nx-2)
+            {
+              A.set(row+1, row, -1.);
+              A.set(row, row+1, -1.);
+            }
+          if (i>0)
+            {
+              A.set(row-(nx-1), row, -1.);
+              A.set(row, row-(nx-1), -1.);
+            }
+          if (i<ny-2)
+            {
+              A.set(row+(nx-1), row, -1.);
+              A.set(row, row+(nx-1), -1.);
+            }
+        }
+    }
 }
 
 
@@ -277,39 +277,39 @@ FDMatrix::five_point(MATRIX& A, bool nonsymmetric) const
 template<typename MATRIX>
 inline
 void
-FDMatrix::upwind(MATRIXA, bool back) const
+FDMatrix::upwind(MATRIX &A, bool back) const
 {
-   for(unsigned int i=0;i<=ny-2;i++)
+  for (unsigned int i=0; i<=ny-2; i++)
     {
-      for(unsigned int j=0;j<=nx-2; j++)
-       {
-                                          // Number of the row to be entered
-         unsigned int row = j+(nx-1)*i;
-         A.set(row, row, 3.);
-
-         if (j>0 && !back)
-           A.set(row, row-1, -1.);
-
-         if (j<nx-2 && back)
-             A.set(row, row+1, -1.);
-       }
-    } 
+      for (unsigned int j=0; j<=nx-2; j++)
+        {
+          // Number of the row to be entered
+          unsigned int row = j+(nx-1)*i;
+          A.set(row, row, 3.);
+
+          if (j>0 && !back)
+            A.set(row, row-1, -1.);
+
+          if (j<nx-2 && back)
+            A.set(row, row+1, -1.);
+        }
+    }
 }
 
 template<typename number>
 inline
 void
-FDMatrix::gnuplot_print(std::ostream& s, const Vector<number>& V) const
+FDMatrix::gnuplot_print(std::ostream &s, const Vector<number> &V) const
 {
-   for(unsigned int i=0;i<=ny-2;i++)
+  for (unsigned int i=0; i<=ny-2; i++)
     {
-      for(unsigned int j=0;j<=nx-2; j++)
-       {
-                                          // Number of the row to be entered
-         unsigned int row = j+(nx-1)*i;
-         s << (j+1)/(float)nx << '\t' << (i+1)/(float)ny << '\t' << V(row) << std::endl;
-       }
+      for (unsigned int j=0; j<=nx-2; j++)
+        {
+          // Number of the row to be entered
+          unsigned int row = j+(nx-1)*i;
+          s << (j+1)/(float)nx << '\t' << (i+1)/(float)ny << '\t' << V(row) << std::endl;
+        }
       s << std::endl;
-    } 
-   s << std::endl;
+    }
+  s << std::endl;
 }
index 47ead516ccee390390380f949f48d00ccf293964..a67d63d6a3f980a533318a6cf472e62f9c18bee1 100644 (file)
@@ -43,9 +43,9 @@ int main()
   for (unsigned int i=0; i<N; ++i)
     for (unsigned int j=0; j<N; ++j)
       {
-       m(i,j) = i+j;
-       if (i==j)
-         tr += i+j;
+        m(i,j) = i+j;
+        if (i==j)
+          tr += i+j;
       }
 
   deallog << "Trace=" << m.trace() << std::endl;
index ee6c816b6e0bcd32b64e9903aeab6783419ddec1..640a846f2c9a4dd10742726640da73293d8a7728 100644 (file)
 // Symmetric matrix with constant diagonals [-1,2,-1]
 template<typename number>
 void
-matrix1(TridiagonalMatrix<number>M)
+matrix1(TridiagonalMatrix<number> &M)
 {
   const unsigned int n = M.n();
-  for (unsigned int i=0;i<n;++i)
+  for (unsigned int i=0; i<n; ++i)
     {
       M(i,i) = 2.;
       if (i>0) M(i,i-1) = -1.;
@@ -53,10 +53,10 @@ matrix1(TridiagonalMatrix<number>& M)
 // Nonsymmetric matrix with constant diagonals [-1,2,-3]
 template<typename number>
 void
-matrix2(TridiagonalMatrix<number>M)
+matrix2(TridiagonalMatrix<number> &M)
 {
   const unsigned int n = M.n();
-  for (unsigned int i=0;i<n;++i)
+  for (unsigned int i=0; i<n; ++i)
     {
       M(i,i) = 2.;
       if (i>0) M(i,i-1) = -1.;
@@ -68,10 +68,10 @@ matrix2(TridiagonalMatrix<number>& M)
 // Matrix with increasing diagonals and symmetric rows
 template<typename number>
 void
-matrix3(TridiagonalMatrix<number>M)
+matrix3(TridiagonalMatrix<number> &M)
 {
   const unsigned int n = M.n();
-  for (unsigned int i=0;i<n;++i)
+  for (unsigned int i=0; i<n; ++i)
     {
       M(i,i) = 2.+i;
       if (i>0) M(i,i-1) = -1.-i;
@@ -83,10 +83,10 @@ matrix3(TridiagonalMatrix<number>& M)
 // Symmetric matrix with increasing diagonals
 template<typename number>
 void
-matrix4(TridiagonalMatrix<number>M)
+matrix4(TridiagonalMatrix<number> &M)
 {
   const unsigned int n = M.n();
-  for (unsigned int i=0;i<n;++i)
+  for (unsigned int i=0; i<n; ++i)
     {
       M(i,i) = 2.+i;
       if (i>0) M(i,i-1) = 0.-i;
@@ -98,10 +98,10 @@ matrix4(TridiagonalMatrix<number>& M)
 // Nonsymmetric matrix with increasing diagonals
 template<typename number>
 void
-matrix5(TridiagonalMatrix<number>M)
+matrix5(TridiagonalMatrix<number> &M)
 {
   const unsigned int n = M.n();
-  for (unsigned int i=0;i<n;++i)
+  for (unsigned int i=0; i<n; ++i)
     {
       M(i,i) = 2.+i;
       if (i>0) M(i,i-1) = -1.-i;
@@ -112,25 +112,25 @@ matrix5(TridiagonalMatrix<number>& M)
 
 template<typename number>
 void
-check_vmult(TridiagonalMatrix<number>M)
+check_vmult(TridiagonalMatrix<number> &M)
 {
   const unsigned int n = M.n();
   Vector<number> u(n);
   Vector<number> v(n);
   Vector<number> w(n);
 
-  for (unsigned int i=0;i<n;++i)
+  for (unsigned int i=0; i<n; ++i)
     u(i) = 1 << i;
-  
+
   deallog << "u     ";
-  for (unsigned int i=0;i<u.size();++i)
+  for (unsigned int i=0; i<u.size(); ++i)
     deallog << ' ' << std::setw(6) << u(i);
   deallog << std::endl;
 
   M.vmult(v,u);
 
   deallog << "u^TMw ";
-  for (unsigned int i=0;i<w.size();++i)
+  for (unsigned int i=0; i<w.size(); ++i)
     {
       w = 0.;
       w(i) = 2.;
@@ -139,27 +139,27 @@ check_vmult(TridiagonalMatrix<number>& M)
       deallog << ' ' << std::setw(6) << p2;
     }
   deallog << std::endl;
-  
+
   deallog << "vmult ";
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << std::setw(6) << v(i);
   deallog << std::endl;
-  
+
   M.Tvmult_add(v,u);
   deallog << "+Tvm  ";
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << std::setw(6) << v(i);
   deallog << std::endl;
-  
+
   M.Tvmult(v,u);
   deallog << "Tvmult";
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << std::setw(6) << v(i);
   deallog << std::endl;
-  
+
   M.vmult_add(v,u);
   deallog << "+vm   ";
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << std::setw(6) << v(i);
   deallog << std::endl;
 }
@@ -202,7 +202,7 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   check<double>(5);
   check<float>(4);
 }
index 9523bc7338b0107d7e79cb8c018a2b5f45f6e063..e753adc7045c1f58b05cc209df468bae6c22df56 100644 (file)
 // Symmetric matrix with constant diagonals [-1,2,-1]
 template<typename number>
 void
-matrix1(TridiagonalMatrix<number>M)
+matrix1(TridiagonalMatrix<number> &M)
 {
   const unsigned int n = M.n();
-  for (unsigned int i=0;i<n;++i)
+  for (unsigned int i=0; i<n; ++i)
     {
       M(i,i) = 2.;
-                                      // Set both diagonals, one will
-                                      // override other.
+      // Set both diagonals, one will
+      // override other.
       if (i>0) M(i,i-1) = -1.;
       if (i<n-1) M(i,i+1) = -1.;
     }
@@ -58,10 +58,10 @@ matrix1(TridiagonalMatrix<number>& M)
 // Symmetric matrix with increasing diagonals
 template<typename number>
 void
-matrix4(TridiagonalMatrix<number>M)
+matrix4(TridiagonalMatrix<number> &M)
 {
   const unsigned int n = M.n();
-  for (unsigned int i=0;i<n;++i)
+  for (unsigned int i=0; i<n; ++i)
     {
       M(i,i) = 2.+i;
       if (i>0) M(i,i-1) = 0.-i;
@@ -72,25 +72,25 @@ matrix4(TridiagonalMatrix<number>& M)
 
 template<typename number>
 void
-check_vmult(TridiagonalMatrix<number>M)
+check_vmult(TridiagonalMatrix<number> &M)
 {
   const unsigned int n = M.n();
   Vector<number> u(n);
   Vector<number> v(n);
   Vector<number> w(n);
 
-  for (unsigned int i=0;i<n;++i)
+  for (unsigned int i=0; i<n; ++i)
     u(i) = 1 << i;
-  
+
   deallog << "u     ";
-  for (unsigned int i=0;i<u.size();++i)
+  for (unsigned int i=0; i<u.size(); ++i)
     deallog << ' ' << std::setw(6) << u(i);
   deallog << std::endl;
 
   M.vmult(v,u);
 
   deallog << "u^TMw ";
-  for (unsigned int i=0;i<w.size();++i)
+  for (unsigned int i=0; i<w.size(); ++i)
     {
       w = 0.;
       w(i) = 2.;
@@ -99,27 +99,27 @@ check_vmult(TridiagonalMatrix<number>& M)
       deallog << ' ' << std::setw(6) << p2;
     }
   deallog << std::endl;
-  
+
   deallog << "vmult ";
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << std::setw(6) << v(i);
   deallog << std::endl;
-  
+
   M.Tvmult_add(v,u);
   deallog << "+Tvm  ";
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << std::setw(6) << v(i);
   deallog << std::endl;
-  
+
   M.Tvmult(v,u);
   deallog << "Tvmult";
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << std::setw(6) << v(i);
   deallog << std::endl;
-  
+
   M.vmult_add(v,u);
   deallog << "+vm   ";
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << std::setw(6) << v(i);
   deallog << std::endl;
 }
@@ -150,7 +150,7 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   check<double>(5);
   check<float>(4);
 }
index 05c6ce1a481f7ddea270649487af215e913b43ad..d8e9ea358082c66c8f6f666076a7f3366171a921 100644 (file)
@@ -33,11 +33,11 @@ unsigned int check_point = 0;
 
 
 template <typename number>
-void print (const Vector<number> &v) 
+void print (const Vector<number> &v)
 {
 //  deallog << "Check point " << check_point << std::endl;
 //  check_point++;
-  
+
   for (unsigned int i=0; i<v.size(); ++i)
     deallog << v(i) << '\t';
   deallog << std::endl;
@@ -51,7 +51,7 @@ void check_vectors (Vector<number1> &d1, Vector<number2> &d2)
   deallog << "Fill & Swap" << std::endl;
   Vector<number1> d3(d1.size());
   print (d3);
-  
+
   for (unsigned int i=0; i<N; ++i)
     {
       d1(i) = 2. * i;
@@ -65,27 +65,27 @@ void check_vectors (Vector<number1> &d1, Vector<number2> &d2)
 
   swap (d1, d2);
   print (d1);
-  
+
   d1 = d2;
   print (d1);
-  
+
   d1 = 2.5;
   print (d1);
 
-                                  // initialize with iterators
+  // initialize with iterators
   number1 array[] = { 0.0, 1.1, 2.2, 3.3 };
   Vector<number1> d4 (&array[0], &array[4]);
   print (d4);
-  
+
   deallog << "Extract number" << std::endl;
-                                  // Each line should contain two equal numbers
+  // Each line should contain two equal numbers
   double sum = 0.;
-  for (unsigned int i=0;i<N;++i)
+  for (unsigned int i=0; i<N; ++i)
     sum += 4.*i-i*i;
-  deallog << d3 * d2 << '\t' << sum << std::endl;
+  deallog << d3 *d2 << '\t' << sum << std::endl;
 
   sum = 0.;
-  for (unsigned int i=0;i<N;++i)
+  for (unsigned int i=0; i<N; ++i)
     sum += 4.*i*i;
   deallog << d2.norm_sqr() << '\t' << sum << std::endl;
 
@@ -93,17 +93,17 @@ void check_vectors (Vector<number1> &d1, Vector<number2> &d2)
   deallog << d2.l2_norm() << '\t' << sum << std::endl;
 
   sum = 0.;
-  for (unsigned int i=0;i<N;++i)
+  for (unsigned int i=0; i<N; ++i)
     sum += (2.-.5*i)/N;
   deallog << d3.mean_value() << '\t' << sum << std::endl;
 
   sum = 0.;
-  for (unsigned int i=0;i<N;++i)
+  for (unsigned int i=0; i<N; ++i)
     sum += std::fabs(2.-.5*i);
   deallog << d3.l1_norm() << '\t' << sum << std::endl;
 
   sum = 0.;
-  for (unsigned int i=0;i<N;++i)
+  for (unsigned int i=0; i<N; ++i)
     {
       double t = std::fabs(2.-.5*i);
       if (t>sum) sum = t;
@@ -111,44 +111,44 @@ void check_vectors (Vector<number1> &d1, Vector<number2> &d2)
   deallog << d3.linfty_norm() << '\t' << sum << std::endl;
 
   deallog << "add & sub" << std::endl;
-  
+
   d1 += d2;
   print (d1);
-  
+
   d2 -= d1;
   print (d2);
-  
+
   d1.add (1.5);
   print (d1);
-  
+
   d1.add (2, d3);
   print (d1);
-  
+
   d1.add (2., d2, .5, d3);
   print (d1);
-  
+
   deallog << "sadd & scale" << std::endl;
-  
+
   d2.sadd (2., d1);
   print (d2);
-  
+
   d2.sadd (2., .5, d1);
   print (d2);
-  
+
   d1.sadd (2, 2, d2, 2, d3);
   print (d1);
-  
+
   d1.scale (4.);
   print (d1);
-  
+
   deallog << "equ" << std::endl;
-  
+
   d2.equ (.25, d1);
   print (d2);
-  
+
   d2.equ (.25, d1, 2, d3);
   print (d2);
-  
+
   d1.ratio (d1, d2);
   print (d1);
 }
@@ -162,20 +162,20 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   Vector<double>      d1(N), d2(N);
   Vector<float>       f1(N), f2(N);
   Vector<long double> l1(N), l2(N);
 
-                                  // cross-tests with double/float
-                                  // vectors at the same time are not
-                                  // supported at present,
-                                  // unfortunately, as many functions
-                                  // don't accept other data types as
-                                  // arguments
+  // cross-tests with double/float
+  // vectors at the same time are not
+  // supported at present,
+  // unfortunately, as many functions
+  // don't accept other data types as
+  // arguments
   check_vectors (d1, d2);
   check_vectors (f1, f2);
   check_vectors (l1, l2);
 }
 
-  
+
index a0b8edd29a62a9ad670d9cdfe2fa39108fd1da7a..9f252609bc6f247ad47d6b110dd5e30e9fdb58b7 100644 (file)
@@ -30,7 +30,7 @@ void
 test_leak()
 {
   GrowingVectorMemory<VECTOR> mem;
-  VECTORv = mem.alloc();
+  VECTOR *v = mem.alloc();
   v->reinit(5);
 }
 
@@ -40,12 +40,12 @@ void
 test_stat()
 {
   GrowingVectorMemory<VECTOR> mem(1, true);
-  VECTORv1 = mem.alloc();
-  VECTORv2 = mem.alloc();
-  VECTORv3 = mem.alloc();
-  VECTORv4 = mem.alloc();
-  VECTORv5 = mem.alloc();
-  VECTORv6 = mem.alloc();
+  VECTOR *v1 = mem.alloc();
+  VECTOR *v2 = mem.alloc();
+  VECTOR *v3 = mem.alloc();
+  VECTOR *v4 = mem.alloc();
+  VECTOR *v5 = mem.alloc();
+  VECTOR *v6 = mem.alloc();
   v1->reinit(5);
   v2->reinit(5);
   v3->reinit(5);
@@ -78,7 +78,7 @@ main()
   deallog.threshold_double(1.e-10);
 
   test_stat<Vector<double> >();
-  
+
   try
     {
       test_leak<Vector<double> >();
index b6e4453e84a3c8d8f71a079c5ac3d616ff75e8b0..1f41cfe47030535e6a04f738e8c414389d60de17 100644 (file)
@@ -36,7 +36,7 @@ void check_norms ()
   unsigned int skip = 73;
   for (unsigned int size=1; size<200000; size+=skip)
     {
-                                // test correctness
+      // test correctness
       if (size > 10000)
         skip += 17;
       Vector<number> vec(size);
@@ -47,7 +47,7 @@ void check_norms ()
       Assert (std::abs(l1_norm-0.5*size*(size+1)) < acc*0.5*size*(size+1),
               ExcInternalError());
 
-                                // test accuracy of summation
+      // test accuracy of summation
       const long double value = 3.14159265358979323846;
       vec = (number)value;
       const number l1_norma = vec.l1_norm();
@@ -73,7 +73,7 @@ void check_complex_norms ()
   unsigned int skip = 73;
   for (unsigned int size=1; size<100000; size+=skip)
     {
-                                // test correctness
+      // test correctness
       if (size > 10000)
         skip += 17;
       Vector<std::complex<number> > vec(size);
@@ -88,7 +88,7 @@ void check_complex_norms ()
       Assert (std::abs(l1_norm-sum) < acc*sum,
               ExcInternalError());
 
-                                // test accuracy of summation
+      // test accuracy of summation
       const std::complex<long double> value (3.14159265358979323846, 0.1);
       vec = std::complex<number>(value);
       const number l1_norma = vec.l1_norm();
index 5fbc374ab5f5dc7e81e5f324ea913c14a98fd186..ddcbc6f642517acd321e8caff148e244debdcc59 100644 (file)
@@ -28,7 +28,7 @@ const unsigned int N=10;
 unsigned int check_point = 0;
 
 template <typename number>
-void print (const Vector<number> &v) 
+void print (const Vector<number> &v)
 {
   for (unsigned int i=0; i<v.size(); ++i)
     deallog << v(i) << '\t';
@@ -36,9 +36,10 @@ void print (const Vector<number> &v)
 }
 
 template<typename T>
-void fill( T &a) {
-    for(unsigned int i=0; i<a.size(); ++i)
-       a(i) = i;
+void fill( T &a)
+{
+  for (unsigned int i=0; i<a.size(); ++i)
+    a(i) = i;
 }
 
 int main()
@@ -49,37 +50,37 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   Vector<double>  v1(N);
   fill(v1);
-  
+
   deallog << "Vector" << std::endl;
   print(v1);
+
   VectorView<double> v2(N, v1.begin() );
   deallog << "Vector View" << std::endl;
   print(v2);
-  
+
   v2(4) = 0;
   deallog << "Modified element 4" << std::endl;
   deallog << "Vector" << std::endl;
   print(v1);
+
   deallog << "Vector View" << std::endl;
   print(v2);
-  
-  // Const vector. 
+
+  // Const vector.
   const Vector<double> v3(v1);
+
   deallog << "const Vector" << std::endl;
   print(v3);
+
   VectorView<double> v4(N, v3.begin());
   deallog << "const Vector View" << std::endl;
-  print(v4); 
+  print(v4);
 
   v4.reinit(N, v1.begin());
   v4.reinit(N, v3.begin());
 }
 
-  
+
index 4dbc69af5d3fefcfe6179bd45dc3a531568d0936..304d4d476b4fbd1e4f2bfa3509486bccc12a62c0 100644 (file)
  */
 const double symm[] =
 {
-      4., -1., -1., -1.,
-      -1., 4., -1., -1.,
-      -1., -1., 4., -1.,
-      -1., -1., -1., 4.
+  4., -1., -1., -1.,
+  -1., 4., -1., -1.,
+  -1., -1., 4., -1.,
+  -1., -1., -1., 4.
 };
 
 const double rect[] =
 {
-      4., 3., 2., 1.,
-      5., 8., 1., -2.,
-      11., 13., -4., -5
+  4., 3., 2., 1.,
+  5., 8., 1., -2.,
+  11., 13., -4., -5
 };
 
 
-void test_rect(unsigned int m, unsigned int n, const doublevalues)
+void test_rect(unsigned int m, unsigned int n, const double *values)
 {
   std::ostringstream prefix;
   prefix << m << 'x' << n;
   deallog.push(prefix.str());
-  
+
   FullMatrix<double> A(m,n,values);
   LAPACKFullMatrix<double> LA(m,n);
   LA = A;
-  
+
   Vector<double> u(n);
   Vector<double> v1(m);
   Vector<double> v2(m);
-  
-  for (unsigned int i=0;i<u.size();++i)
+
+  for (unsigned int i=0; i<u.size(); ++i)
     u(i) = i*i;
-  
+
   deallog << "operator= (const FullMatrix<number>&) ok" << std::endl;
-  
+
   A.vmult(v1,u);
   LA.vmult(v2,u);
   v1 -= v2;
   if (v1.l2_norm() < 1.e-14)
     deallog << "vmult ok" << std::endl;
   v1 = v2;
-  
+
   A.vmult_add(v1,u);
   LA.vmult_add(v2,u);
   v1 -= v2;
   if (v1.l2_norm() < 1.e-14)
     deallog << "vmult_add ok" << std::endl;
-  
+
   LA.Tvmult(u, v2);
   u *= -1;
   A.Tvmult_add(u, v2);
   if (u.l2_norm() < 1.e-14)
     deallog << "Tvmult ok" << std::endl;
-  
+
   A.Tvmult(u, v2);
   u *= -1;
   LA.Tvmult_add(u, v2);
   if (u.l2_norm() < 1.e-14)
     deallog << "Tvmult_add ok" << std::endl;
-  
+
   deallog.pop();
 }
 
@@ -109,17 +109,17 @@ int main()
   test_rect(4,3,rect);
   test_rect(4,4,symm);
 
-                                  // Test symmetric system
+  // Test symmetric system
   FullMatrix<double> A(4,4,symm);
   LAPACKFullMatrix<double> LA(4,4);
   A.fill(symm);
   LA = A;
   LA.compute_eigenvalues();
-  for (unsigned int i=0;i<A.m();++i)
+  for (unsigned int i=0; i<A.m(); ++i)
     {
       std::complex<double> lambda = LA.eigenvalue(i);
       deallog << "Eigenvalues "
-             << (int) (lambda.real()+.0001) << '\t'
-             << (int) (lambda.imag()+.0001) << std::endl;
+              << (int) (lambda.real()+.0001) << '\t'
+              << (int) (lambda.imag()+.0001) << std::endl;
     }
 }
index 0d43bca2479e55ed7d9cddc54dd31235d439cc9e..016bb8d4e2c92850af1aef1f550d1a2240011837 100644 (file)
 // Fill a matrix with the values of the Hilbert matrix
 template <typename number>
 void
-hilbert (LAPACKFullMatrix<number>M,
-        const bool nonsymmetric)
+hilbert (LAPACKFullMatrix<number> &M,
+         const bool nonsymmetric)
 {
   const unsigned int n = M.n_rows();
-  for (unsigned int i=0;i<n;++i)
-    for (unsigned int j=0;j<n;++j)
+  for (unsigned int i=0; i<n; ++i)
+    for (unsigned int j=0; j<n; ++j)
       M(i,j) = 1./(i+j+1.)
-              * (nonsymmetric
-                 ? ((i<j) ? -1. : 1.)
-                 : 1.);
+               * (nonsymmetric
+                  ? ((i<j) ? -1. : 1.)
+                  : 1.);
 }
 
 
@@ -52,13 +52,13 @@ test(const unsigned int size, const bool nonsymmetric)
 {
   LAPACKFullMatrix<double> M(size, size);
   hilbert(M, nonsymmetric);
-  
+
   Vector<double> u(size);
   Vector<double> v(size);
   Vector<double> x(size);
   Vector<double> y(size);
-  
-  for (unsigned int i=0;i<size;++i)
+
+  for (unsigned int i=0; i<size; ++i)
     {
       u(i) = i+2.;
       x(i) = i+2.;
index d25a61cb0295d85ea43768c9f4cfd0a7932380a1..22d70ad69b8c4f3669345e34566b063b28120435 100644 (file)
  */
 const double symm[] =
 {
-      4., -1., -1., -1.,
-      -1., 4., -1., -1.,
-      -1., -1., 4., -1.,
-      -1., -1., -1., 4.
+  4., -1., -1., -1.,
+  -1., 4., -1., -1.,
+  -1., -1., 4., -1.,
+  -1., -1., -1., 4.
 };
 
 const double rect[] =
 {
-      4., 3., 2., 1.,
-      5., 8., 1., -2.,
-      11., 13., -4., -5
+  4., 3., 2., 1.,
+  5., 8., 1., -2.,
+  11., 13., -4., -5
 };
 
 
-void test_rect(unsigned int m, unsigned int n, const doublevalues)
+void test_rect(unsigned int m, unsigned int n, const double *values)
 {
   std::ostringstream prefix;
   prefix << m << 'x' << n;
   deallog.push(prefix.str());
-  
+
   FullMatrix<double> A(m,n,values);
   LAPACKFullMatrix<double> LA(m,n);
   LA = A;
   LA.compute_svd();
-  
+
   deallog << "Singular values";
-  for (unsigned int i=0;i<LA.n_rows();++i)
+  for (unsigned int i=0; i<LA.n_rows(); ++i)
     deallog << ' ' << LA.singular_value(i);
   deallog << std::endl;
-  
+
   Vector<double> u(n);
   Vector<double> v1(m);
   Vector<double> v2(m);
-  
-  for (unsigned int i=0;i<u.size();++i)
+
+  for (unsigned int i=0; i<u.size(); ++i)
     u(i) = i*i;
-  
-                                  // Test rectangular vmult. All
-                                  // results compare with same
-                                  // operation for FullMatrix.
-  
+
+  // Test rectangular vmult. All
+  // results compare with same
+  // operation for FullMatrix.
+
   A.vmult(v1,u);
   LA.vmult(v2,u);
   v1 -= v2;
@@ -84,7 +84,7 @@ void test_rect(unsigned int m, unsigned int n, const double* values)
   else
     deallog << "vmult error " << v1.l2_norm() << std::endl;
   v1 = v2;
-  
+
   A.vmult_add(v1,u);
   LA.vmult_add(v2,u);
   v1 -= v2;
@@ -92,7 +92,7 @@ void test_rect(unsigned int m, unsigned int n, const double* values)
     deallog << "vmult_add ok" << std::endl;
   else
     deallog << "vmult_add error " << v1.l2_norm() << std::endl;
-  
+
   LA.Tvmult(u, v2);
   u *= -1;
   A.Tvmult_add(u, v2);
@@ -100,7 +100,7 @@ void test_rect(unsigned int m, unsigned int n, const double* values)
     deallog << "Tvmult ok" << std::endl;
   else
     deallog << "Tvmult error " << u.l2_norm() << std::endl;
-  
+
   A.Tvmult(u, v2);
   u *= -1;
   LA.Tvmult_add(u, v2);
@@ -108,7 +108,7 @@ void test_rect(unsigned int m, unsigned int n, const double* values)
     deallog << "Tvmult_add ok" << std::endl;
   else
     deallog << "Tvmult_add error " << u.l2_norm() << std::endl;
-  
+
   deallog.pop();
 }
 
@@ -123,18 +123,18 @@ int main()
   test_rect(4,4,symm);
   test_rect(4,3,rect);
   test_rect(3,4,rect);
-  
-                                  // Test symmetric system
+
+  // Test symmetric system
   FullMatrix<double> A(4,4,symm);
   LAPACKFullMatrix<double> LA(4,4);
   A.fill(symm);
   LA = A;
   LA.compute_eigenvalues();
-  for (unsigned int i=0;i<A.m();++i)
+  for (unsigned int i=0; i<A.m(); ++i)
     {
       std::complex<double> lambda = LA.eigenvalue(i);
       deallog << "Eigenvalues "
-             << (int) (lambda.real()+.0001) << '\t'
-             << (int) (lambda.imag()+.0001) << std::endl;
+              << (int) (lambda.real()+.0001) << '\t'
+              << (int) (lambda.imag()+.0001) << std::endl;
     }
 }
index 31d7598cfc1b18a7351528d8cb19727d7080ade3..3ee7b22c894cf6a374128aa51a85f943acc953b9 100644 (file)
  */
 const double symm[] =
 {
-      4., -1., -1., -1.,
-      -1., 4., -1., -1.,
-      -1., -1., 4., -1.,
-      -1., -1., -1., 4.
+  4., -1., -1., -1.,
+  -1., 4., -1., -1.,
+  -1., -1., 4., -1.,
+  -1., -1., -1., 4.
 };
 
 const double rect[] =
 {
-      4., 3., 2., 1.,
-      5., 8., 1., -2.,
-      11., 13., -4., -5
+  4., 3., 2., 1.,
+  5., 8., 1., -2.,
+  11., 13., -4., -5
 };
 
 
-void test_rect(unsigned int m, unsigned int n, const doublevalues)
+void test_rect(unsigned int m, unsigned int n, const double *values)
 {
   std::ostringstream prefix;
   prefix << m << 'x' << n;
   deallog.push(prefix.str());
-  
+
   FullMatrix<double> A(m,n,values);
   LAPACKFullMatrix<double> LA(m,n);
   LA = A;
   LA.compute_inverse_svd();
-  
+
   deallog << "Singular values";
-  for (unsigned int i=0;i<LA.n_rows();++i)
+  for (unsigned int i=0; i<LA.n_rows(); ++i)
     deallog << ' ' << LA.singular_value(i);
   deallog << std::endl;
-  
+
   Vector<double> u1(n);
   Vector<double> u2(n);
   Vector<double> v1(m);
   Vector<double> v2(m);
-  
-  for (unsigned int i=0;i<u1.size();++i)
+
+  for (unsigned int i=0; i<u1.size(); ++i)
     u1(i) = i*i;
-  for (unsigned int i=0;i<v1.size();++i)
+  for (unsigned int i=0; i<v1.size(); ++i)
     v1(i) = i*i;
 
-                                  // Test if LA is a left inverse of A
+  // Test if LA is a left inverse of A
   A.vmult(v2,u1);
   LA.vmult(u2,v2);
   u2 -= u1;
@@ -83,18 +83,18 @@ void test_rect(unsigned int m, unsigned int n, const double* values)
     deallog << "vmult ok" << std::endl;
   else
     deallog << "vmult error " << u2.l2_norm() << std::endl;
-  
-                                  // Test if LA is a right inverse of A
+
+  // Test if LA is a right inverse of A
   LA.vmult(u2,v1);
   A.vmult(v2,u2);
   v2 -= v1;
   if (v2.l2_norm() < 1.e-12)
     deallog << "vmult ok" << std::endl;
   else
-    deallog << "vmult error " << v2.l2_norm() << std::endl;  
+    deallog << "vmult error " << v2.l2_norm() << std::endl;
 
-                                  // Test if LA^T is a left inverse
-                                  // of A^T
+  // Test if LA^T is a left inverse
+  // of A^T
   A.Tvmult(u2,v1);
   LA.Tvmult(v2, u2);
   v2 -= v1;
@@ -102,7 +102,7 @@ void test_rect(unsigned int m, unsigned int n, const double* values)
     deallog << "Tvmult ok" << std::endl;
   else
     deallog << "Tvmult error " << v2.l2_norm() << std::endl;
-  
+
   LA.Tvmult(v2,u1);
   A.Tvmult(u2,v2);
   u2 -= u1;
@@ -110,7 +110,7 @@ void test_rect(unsigned int m, unsigned int n, const double* values)
     deallog << "Tvmult ok" << std::endl;
   else
     deallog << "Tvmult error " << u2.l2_norm() << std::endl;
-  
+
   deallog.pop();
 }
 
index 22082df7d29a3c152926dfcedb3dc1f41c8beebe..59f06f6e7a6deea4e8dc782a12bfd195ce698076 100644 (file)
 
 const double left[] =
 {
-      4., -1., -1., -1.,
-      -1., 4., -1., -1.,
-      -1., -1., 4., -1.,
-      -1., -1., -1., 4.
+  4., -1., -1., -1.,
+  -1., 4., -1., -1.,
+  -1., -1., 4., -1.,
+  -1., -1., -1., 4.
 };
 
 const double right[] =
 {
-      4., -1., -1., -1.,
-      -1., 5., -1., -1.,
-      -1., -1., 6., -1.,
-      -1., -1., -1., 7.
+  4., -1., -1., -1.,
+  -1., 5., -1., -1.,
+  -1., -1., 6., -1.,
+  -1., -1., -1., 7.
 };
 
 
@@ -52,35 +52,35 @@ int main()
   logfile.precision(1);
   deallog.attach(logfile);
   deallog.depth_console(0);
-  
+
   FullMatrix<double> A(4,4,left),
-                     B(4,4,right);
+             B(4,4,right);
   LAPACKFullMatrix<double> LA(4,4),
-                           LB(4,4);
-  for(unsigned int itype=1;itype<=3; ++itype)
-    {                     
-      deallog << std::endl 
-              << "generalized eigenvalue problem of type " 
-             << itype << std::endl;
+                   LB(4,4);
+  for (unsigned int itype=1; itype<=3; ++itype)
+    {
+      deallog << std::endl
+              << "generalized eigenvalue problem of type "
+              << itype << std::endl;
       LA = A;
       LB = B;
       std::vector<Vector<double> > eigenvectors(A.m());
       LA.compute_generalized_eigenvalues_symmetric (LB, eigenvectors, itype);
-      
-      for (unsigned int i=0;i<A.m();++i)
-       {
-         std::complex<double> lambda = LA.eigenvalue(i);
-         deallog << "generalized eigenvalue "
-                 << std::scientific << lambda.real() << '\t'
-                 << std::scientific << lambda.imag() << std::endl
-                 << "generalized eigenvector ";
-         for (unsigned int j=0;j<A.m();++j)
-           {
-             deallog << std::scientific 
-                     << eigenvectors[i](j)/eigenvectors[i](0) 
-                     << '\t';
-           }
-         deallog << std::endl;
-       }
+
+      for (unsigned int i=0; i<A.m(); ++i)
+        {
+          std::complex<double> lambda = LA.eigenvalue(i);
+          deallog << "generalized eigenvalue "
+                  << std::scientific << lambda.real() << '\t'
+                  << std::scientific << lambda.imag() << std::endl
+                  << "generalized eigenvector ";
+          for (unsigned int j=0; j<A.m(); ++j)
+            {
+              deallog << std::scientific
+                      << eigenvectors[i](j)/eigenvectors[i](0)
+                      << '\t';
+            }
+          deallog << std::endl;
+        }
     }
 }
index 49c91efb23be5fd6291bf7af8c4d3b192be9fe8a..45adba318dfdb05a8cfa94a33c24e172dd678429 100644 (file)
 
 const double left[] =
 {
-      4., -1., -1., -1.,
-      -1., 4., -1., -1.,
-      -1., -1., 4., -1.,
-      -1., -1., -1., 4.
+  4., -1., -1., -1.,
+  -1., 4., -1., -1.,
+  -1., -1., 4., -1.,
+  -1., -1., -1., 4.
 };
 
 const double right[] =
 {
-      4., -1., -1., -1.,
-      -1., 5., -1., -1.,
-      -1., -1., 6., -1.,
-      -1., -1., -1., 7.
+  4., -1., -1., -1.,
+  -1., 5., -1., -1.,
+  -1., -1., 6., -1.,
+  -1., -1., -1., 7.
 };
 
 
@@ -53,39 +53,39 @@ int main()
   logfile.precision(1);
   deallog.attach(logfile);
   deallog.depth_console(0);
-  
+
   FullMatrix<double> A(4,4,left),
-                     B(4,4,right);
+             B(4,4,right);
   LAPACKFullMatrix<double> LA(4,4),
-                           LB(4,4);
-  for(unsigned int itype=1;itype<=3; ++itype)
-    {                     
-      deallog << std::endl 
-              << "generalized eigenvalue problem of type " 
-             << itype << std::endl;
+                   LB(4,4);
+  for (unsigned int itype=1; itype<=3; ++itype)
+    {
+      deallog << std::endl
+              << "generalized eigenvalue problem of type "
+              << itype << std::endl;
       LA = A;
       LB = B;
       std::vector<Vector<double> > eigenvectors(0);
       Vector<double> eigenvalues(0);
-      
+
       LA.compute_generalized_eigenvalues_symmetric (LB, 0.5, 3.0,
-                                                   2.0*DBL_MIN,
-                                                   eigenvalues,
-                                                   eigenvectors,
-                                                   itype);
-      
-      for (unsigned int i=0;i<eigenvectors.size();++i)
-       {
-         deallog << "generalized eigenvalue "
-                 << std::scientific << eigenvalues(i) << std::endl
-                 << "generalized eigenvector ";
-         for (unsigned int j=0;j<A.m();++j)
-           {
-             deallog << std::scientific 
-                     << eigenvectors[i](j)/eigenvectors[i](0) 
-                     << '\t';
-           }
-         deallog << std::endl;
-       }
+                                                    2.0*DBL_MIN,
+                                                    eigenvalues,
+                                                    eigenvectors,
+                                                    itype);
+
+      for (unsigned int i=0; i<eigenvectors.size(); ++i)
+        {
+          deallog << "generalized eigenvalue "
+                  << std::scientific << eigenvalues(i) << std::endl
+                  << "generalized eigenvector ";
+          for (unsigned int j=0; j<A.m(); ++j)
+            {
+              deallog << std::scientific
+                      << eigenvectors[i](j)/eigenvectors[i](0)
+                      << '\t';
+            }
+          deallog << std::endl;
+        }
     }
 }
index a4f9a166a466cf3aee3ae9775538af642b1c6c8f..ed20ae9b6b5d69b942ff651fe0d199a52eb445d4 100644 (file)
 
 const double left[] =
 {
-  
-   1.75, -0.433012701892219, 0.0, 0.0,
-   -0.433012701892219, 1.25, 0.0, 0.0,
-   0.0, 0.0, 3.5, -0.5,
-   0.0, 0.0, -0.5, 3.5
+
+  1.75, -0.433012701892219, 0.0, 0.0,
+  -0.433012701892219, 1.25, 0.0, 0.0,
+  0.0, 0.0, 3.5, -0.5,
+  0.0, 0.0, -0.5, 3.5
 };
 
 
@@ -46,29 +46,29 @@ int main()
   logfile.precision(1);
   deallog.attach(logfile);
   deallog.depth_console(0);
-  
+
   FullMatrix<double> A(4,4,left);
-  LAPACKFullMatrix<double> LA(4,4);                   
+  LAPACKFullMatrix<double> LA(4,4);
   LA = A;
   FullMatrix<double> eigenvectors;
   Vector<double> eigenvalues(0);
-  
+
   LA.compute_eigenvalues_symmetric (0.5, 2.5,
-                                   2.0*DBL_MIN,
-                                   eigenvalues,
-                                   eigenvectors);
-  
-  for (unsigned int i=0;i<eigenvalues.size();++i)
+                                    2.0*DBL_MIN,
+                                    eigenvalues,
+                                    eigenvectors);
+
+  for (unsigned int i=0; i<eigenvalues.size(); ++i)
     {
       deallog << "eigenvalue "
-             << std::scientific << eigenvalues(i) << std::endl
-             << "eigenvector ";
-      for (unsigned int j=0;j<A.m();++j)
-       {
-         deallog << std::scientific 
-                 << eigenvectors(j,i)/eigenvectors(0,i)
-                 << '\t';
-       }
+              << std::scientific << eigenvalues(i) << std::endl
+              << "eigenvector ";
+      for (unsigned int j=0; j<A.m(); ++j)
+        {
+          deallog << std::scientific
+                  << eigenvectors(j,i)/eigenvectors(0,i)
+                  << '\t';
+        }
       deallog << std::endl;
     }
 }
index 6f386b199a2d416a231f756d26941e898efe98ff..971484e1e7e6702ca8da98d8363f7ba9b6d2a3cc 100644 (file)
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   u = 0.;
   f = 1.;
-  try 
+  try
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
-    }  
+    }
 }
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_Tsolve(SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_Tsolve(SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   u = 0.;
   f = 1.;
-  try 
+  try
     {
       solver.Tsolve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
-    }  
+    }
 }
 
 int main()
@@ -74,7 +74,7 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   GrowingVectorMemory<> mem;
   SolverControl control(100, 1.e-3);
   SolverControl verbose_control(100, 1.e-3, true);
@@ -86,8 +86,8 @@ int main()
       unsigned int dim = (size-1)*(size-1);
 
       deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                      // Make matrix
+
+      // Make matrix
       FDMatrix testproblem(size, size);
       SparsityPattern structure(dim, dim, 5);
       testproblem.five_point_structure(structure);
@@ -110,31 +110,31 @@ int main()
 
       f = 1.;
       u = 1.;
-      
+
       try
-       {
-         deallog.push("no-fail");
-         control.set_max_steps(10);
-         check_solve(cg,A,u,f,prec_no);
-         control.set_max_steps(100);
-         deallog.pop();
-         
-         deallog.push("no");
-         check_solve(cg,A,u,f,prec_no);
-         deallog.pop();
-         
-         deallog.push("rich");
-         check_solve(cg,A,u,f,prec_richardson);
-         deallog.pop();
-         
-         deallog.push("ssor");
-         check_solve(cg,A,u,f,prec_ssor);
-         deallog.pop();
-       }
-      catch (std::exceptione)
-       {
-         std::cerr << "Exception: " << e.what() << std::endl;
-       }
+        {
+          deallog.push("no-fail");
+          control.set_max_steps(10);
+          check_solve(cg,A,u,f,prec_no);
+          control.set_max_steps(100);
+          deallog.pop();
+
+          deallog.push("no");
+          check_solve(cg,A,u,f,prec_no);
+          deallog.pop();
+
+          deallog.push("rich");
+          check_solve(cg,A,u,f,prec_richardson);
+          deallog.pop();
+
+          deallog.push("ssor");
+          check_solve(cg,A,u,f,prec_ssor);
+          deallog.pop();
+        }
+      catch (std::exception &e)
+        {
+          std::cerr << "Exception: " << e.what() << std::endl;
+        }
     }
 }
 
index 719596d680c6f111de2261c0d4445bf54e193489..e3270b9e16d269ffb3bf8054cf1e29a64d79783c 100644 (file)
@@ -31,7 +31,7 @@ template <typename number>
 void test_laplacian(unsigned int n)
 {
   TridiagonalMatrix<number> M(n-1, true);
-  for (unsigned int i=0;i<n-2;++i)
+  for (unsigned int i=0; i<n-2; ++i)
     {
       M(i,i) = 2.;
       M(i,i+1) = -1.;
@@ -39,14 +39,14 @@ void test_laplacian(unsigned int n)
   M(n-2,n-2) = 2.;
 
   M.compute_eigenvalues();
-  for (unsigned int i=0;i<5;++i)
-    deallog << '\t' << M.eigenvalue(i)*n*n;
+  for (unsigned int i=0; i<5; ++i)
+    deallog << '\t' << M.eigenvalue(i)*n *n;
   deallog << "\t cond " << M.eigenvalue(n-2)/M.eigenvalue(0) << std::endl;
 }
 
 
 int main()
-{ 
+{
   const std::string logname = JobIdentifier::base_name(__FILE__) + std::string("/output");
   std::ofstream logfile(logname.c_str());
   deallog.attach(logfile);
index ef1d450313d9ffcbd6f5d159528b32b7b6625782..25d60b638af01203210568f871bda2ac5a8480bd 100644 (file)
@@ -1,6 +1,6 @@
 //----------------------------------------------------------------------
 //    $Id$
-//    Version: $Name$ 
+//    Version: $Name$
 //
 //    Copyright (C) 2003, 2004, 2005, 2006 by the deal.II authors
 //
@@ -43,7 +43,7 @@ check_this (const DoFHandler<dim> &dof_handler);
 void
 output_vector (std::vector<bool> &v)
 {
-for (unsigned int i=0; i<v.size(); ++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << (v[i] ? '1' : '0');
   deallog << std::endl;
 }
@@ -52,8 +52,8 @@ for (unsigned int i=0; i<v.size(); ++i)
 void
 output_vector (std::vector<unsigned int> &v)
 {
-for (unsigned int i=0; i<v.size(); ++i)
-  deallog << ' ' << v[i];
+  for (unsigned int i=0; i<v.size(); ++i)
+    deallog << ' ' << v[i];
   deallog << std::endl;
 }
 
@@ -61,21 +61,21 @@ for (unsigned int i=0; i<v.size(); ++i)
 
 template <int dim>
 void
-check (const Triangulation<dim>tria,
+check (const Triangulation<dim> &tria,
        const FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
-  
+
   DoFHandler<dim> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
 
-                                   // call main function in .cc files
+  // call main function in .cc files
   check_this (dof_handler);
 }
 
 
 template <int dim>
-void check_grid(const Triangulation<dim>tr)
+void check_grid(const Triangulation<dim> &tr)
 {
   FE_Q<dim> q1(1);
   check(tr, q1);
@@ -83,7 +83,7 @@ void check_grid(const Triangulation<dim>& tr)
   check(tr, q2);
   FE_Q<dim> q3(3);
   check(tr, q3);
-  
+
   FE_DGQ<dim> dgq0(0);
   check(tr, dgq0);
   FE_DGQ<dim> dgq1(1);
@@ -95,7 +95,7 @@ void check_grid(const Triangulation<dim>& tr)
   check(tr, dgp1);
   FE_DGP<dim> dgp2(2);
   check(tr, dgp2);
-  
+
   FE_Nedelec<dim> nedelec1(1);
   check(tr, nedelec1);
 
index 74a32352fb992728c0ede2560d75d6c02d28b488..542058c21e31eea6507b2d4b3c0044d673b667d3 100644 (file)
  */
 namespace TestGrids
 {
-                                  /**
-                                   * Generate grids based on
-                                   * hypercube. These meshes have a
-                                   * regular geometry and topology.
-                                   *
-                                   * @param <tt>refinement</tt>
-                                   * denotes the number of refinement
-                                   * steps of the root cell.
-                                   *
-                                   * @param if <tt>local</tt> is
-                                   * <tt>true</tt>, refine only the
-                                   * cell containing the corner with
-                                   * only negative coordinates.
-                                   */
+  /**
+   * Generate grids based on
+   * hypercube. These meshes have a
+   * regular geometry and topology.
+   *
+   * @param <tt>refinement</tt>
+   * denotes the number of refinement
+   * steps of the root cell.
+   *
+   * @param if <tt>local</tt> is
+   * <tt>true</tt>, refine only the
+   * cell containing the corner with
+   * only negative coordinates.
+   */
   template <int dim>
-  void hypercube(Triangulation<dim>tr,
-                unsigned int refinement = 0,
-                bool local = false)
+  void hypercube(Triangulation<dim> &tr,
+                 unsigned int refinement = 0,
+                 bool local = false)
   {
     GridGenerator::hyper_cube(tr, -1., 1.);
     if (refinement && !local)
       tr.refine_global(refinement);
     if (refinement && local)
       {
-       tr.refine_global(1);
-       for (unsigned int i=1;i<refinement;++i)
-         {
-           for (typename Triangulation<dim>::active_cell_iterator
-                  cell = tr.begin_active(); cell != tr.end(); ++cell)
-             {
-               const Point<dim>& p = cell->center();
-               bool negative = true;
-               for (unsigned int d=0;d<dim;++d)
-                 if (p(d) >= 0.)negative = false;
-               if (negative)
-                 cell->set_refine_flag();
-             }
-           tr.execute_coarsening_and_refinement();
-         }
+        tr.refine_global(1);
+        for (unsigned int i=1; i<refinement; ++i)
+          {
+            for (typename Triangulation<dim>::active_cell_iterator
+                 cell = tr.begin_active(); cell != tr.end(); ++cell)
+              {
+                const Point<dim> &p = cell->center();
+                bool negative = true;
+                for (unsigned int d=0; d<dim; ++d)
+                  if (p(d) >= 0.)negative = false;
+                if (negative)
+                  cell->set_refine_flag();
+              }
+            tr.execute_coarsening_and_refinement();
+          }
       }
     deallog << "Triangulation hypercube " << dim << "D refinement " << refinement;
     if (local)
       deallog << " local ";
     deallog << " steps " << tr.n_active_cells() << " active cells "
-           << tr.n_cells() << " total cells " << std::endl;
+            << tr.n_cells() << " total cells " << std::endl;
   }
 
-                                  /**
-                                   * Create a star-shaped mesh,
-                                   * having more than the average
-                                   * <tt>2<sup>dim</sup></tt> cells
-                                   * in the central vertex.
-                                   *
-                                   * @param <tt>refinement</tt>
-                                   * denotes the number of refinement
-                                   * steps of the root mesh.
-                                   *
-                                   * @param if <tt>local</tt> is
-                                   * <tt>true</tt>, refine only one
-                                   * of the coarse cells.
-                                   */
+  /**
+   * Create a star-shaped mesh,
+   * having more than the average
+   * <tt>2<sup>dim</sup></tt> cells
+   * in the central vertex.
+   *
+   * @param <tt>refinement</tt>
+   * denotes the number of refinement
+   * steps of the root mesh.
+   *
+   * @param if <tt>local</tt> is
+   * <tt>true</tt>, refine only one
+   * of the coarse cells.
+   */
   template <int dim>
-  void star_shaped(Triangulation<dim>tr,
-                  unsigned int refinement = 0,
-                  bool local = false);
-                                  /**
-                                   * Local refinement of every other
-                                   * cell in a checkerboard fashion.
-                                   */
+  void star_shaped(Triangulation<dim> &tr,
+                   unsigned int refinement = 0,
+                   bool local = false);
+  /**
+   * Local refinement of every other
+   * cell in a checkerboard fashion.
+   */
   template <int dim>
-  void checkers(Triangulation<dim>tr);
-                                  /**
-                                   * Islands of local refinement
-                                   */
+  void checkers(Triangulation<dim> &tr);
+  /**
+   * Islands of local refinement
+   */
   template <int dim>
-  void islands(Triangulation<dim>tr);
-                                  /**
-                                   * Local refinement with an
-                                   * unrefined hole.
-                                   */
+  void islands(Triangulation<dim> &tr);
+  /**
+   * Local refinement with an
+   * unrefined hole.
+   */
   template <int dim>
-  void laguna(Triangulation<dim>tr);
+  void laguna(Triangulation<dim> &tr);
 }
index c827ef5d976cbf4bed37cb59d5f00f9daee19ee2..9ee1f2d55bfc59c995858f378b5447c44e5b3c6b 100644 (file)
@@ -85,7 +85,7 @@ void test ()
   const unsigned int n_affine = mf.get_mapping_info().affine_data.size();
   const unsigned int n_general = mf.get_mapping_info().mapping_data_gen[0].rowstart_jacobians.size()-1;
 
-                                // should do at least some compression
+  // should do at least some compression
   Assert(n_cartesian+n_affine+n_general < n_macro_cells, ExcInternalError());
   Assert(n_cartesian * 5 < n_macro_cells, ExcInternalError());
   Assert(n_affine * 10 < n_macro_cells, ExcInternalError());
@@ -121,8 +121,8 @@ void test_cube ()
   const unsigned int n_affine = mf.get_mapping_info().affine_data.size();
   const unsigned int n_general = mf.get_mapping_info().mapping_data_gen[0].rowstart_jacobians.size()-1;
 
-                                // should have one Cartesian cell and no other
-                                // cell type
+  // should have one Cartesian cell and no other
+  // cell type
   AssertDimension(n_cartesian, 1);
   AssertDimension(n_affine, 0);
   AssertDimension(n_general, 0);
@@ -166,8 +166,8 @@ void test_parallelogram ()
   const unsigned int n_affine = mf.get_mapping_info().affine_data.size();
   const unsigned int n_general = mf.get_mapping_info().mapping_data_gen[0].rowstart_jacobians.size()-1;
 
-                                // should have one affine cell and no other
-                                // cell type
+  // should have one affine cell and no other
+  // cell type
   AssertDimension(n_cartesian, 0);
   AssertDimension(n_affine, 1);
   AssertDimension(n_general, 0);
index 7b28b942c8db192231125f9e18cc986b00a8529b..af56180cae52c9b451078ecaf13907f1ab38061f 100644 (file)
@@ -34,8 +34,8 @@ void sub_test()
   Triangulation<dim> tria;
   GridGenerator::hyper_cube (tria);
   typename Triangulation<dim>::active_cell_iterator
-    cell = tria.begin_active (),
-    endc = tria.end();
+  cell = tria.begin_active (),
+  endc = tria.end();
   for (; cell!=endc; ++cell)
     if (cell->center().norm()<1e-8)
       cell->set_refine_flag();
@@ -56,7 +56,7 @@ void sub_test()
   DoFHandler<dim> dof (tria);
   deallog << "Testing " << fe.get_name() << std::endl;
 
-                                // run test for several different meshes
+  // run test for several different meshes
   for (unsigned int i=0; i<8-2*dim; ++i)
     {
       cell = tria.begin_active ();
@@ -94,7 +94,7 @@ void sub_test()
 
       for (unsigned int i=0; i<dof.n_dofs(); ++i)
         {
-          if(constraints.is_constrained(i))
+          if (constraints.is_constrained(i))
             continue;
           const double entry = rand()/(double)RAND_MAX;
           in_dist(i) = entry;
@@ -105,7 +105,7 @@ void sub_test()
 
       out_copy -= out_ref;
       double diff_norm = out_copy.linfty_norm();
-      deallog << "Error in copied MF: " << diff_norm 
+      deallog << "Error in copied MF: " << diff_norm
               << std::endl;
     }
   deallog << std::endl;
index 4d9689e3c8008cdbd192bc8952554370e7798aeb..0902585a5ae7888b6f9ac8e3897fe7cf86d34b71 100644 (file)
@@ -23,37 +23,37 @@ void create_mesh (Triangulation<2> &tria,
   const unsigned int dim = 2;
   std::vector<Point<dim> > points (12);
 
-                                // build the mesh layer by layer from points
+  // build the mesh layer by layer from points
 
-                                // 1. cube cell
+  // 1. cube cell
   points[0] = Point<dim> (0, 0);
   points[1] = Point<dim> (0, 1);
   points[2] = Point<dim> (1 ,0);
   points[3] = Point<dim> (1 ,1);
 
-                                // 2. rectangular cell
+  // 2. rectangular cell
   points[4] = Point<dim> (3., 0);
   points[5] = Point<dim> (3., 1);
 
-                                // 3. parallelogram cell
+  // 3. parallelogram cell
   points[6] = Point<dim> (5., 1.);
   points[7] = Point<dim> (5., 2.);
 
-                                // almost square cell (but trapezoidal by
-                                // 1e-8)
+  // almost square cell (but trapezoidal by
+  // 1e-8)
   points[8] = Point<dim> (6., 1.);
   points[9] = Point<dim> (6., 2.+1e-8);
 
-                                // apparently trapezoidal cell
+  // apparently trapezoidal cell
   points[10] = Point<dim> (7., 1.4);
   points[11] = Point<dim> (7.5, numbers::PI);
 
   if (scale_grid != 1.)
     for (unsigned int i=0; i<points.size(); ++i)
       points[i] *= scale_grid;
-                    
 
-                                // connect the points to cells
+
+  // connect the points to cells
   std::vector<CellData<dim> > cells(5);
   for (unsigned int i=0; i<5; ++i)
     {
@@ -75,9 +75,9 @@ void create_mesh (Triangulation<3> &tria,
   const unsigned int dim = 3;
   std::vector<Point<dim> > points (24);
 
-                                // build the mesh layer by layer from points
+  // build the mesh layer by layer from points
 
-                                // 1. cube cell
+  // 1. cube cell
   points[0] = Point<dim> (0,0,0);
   points[1] = Point<dim> (0,1.,0);
   points[2] = Point<dim> (0,0,1);
@@ -87,26 +87,26 @@ void create_mesh (Triangulation<3> &tria,
   points[6] = Point<dim> (1.,0,1);
   points[7] = Point<dim> (1.,1.,1);
 
-                                // 2. rectangular cell
+  // 2. rectangular cell
   points[8] = Point<dim> (3., 0, 0);
   points[9] = Point<dim> (3., 1, 0);
   points[10] = Point<dim> (3., 0,1);
   points[11] = Point<dim> (3., 1,1);
 
-                                // 3. parallelogram cell
+  // 3. parallelogram cell
   points[12] = Point<dim> (5., 1., 1.);
   points[13] = Point<dim> (5., 2., 1.);
   points[14] = Point<dim> (5., 1., 2.);
   points[15] = Point<dim> (5., 2., 2.);
 
-                                // almost square cell (but trapezoidal by
-                                // 1e-8 in y-direction)
+  // almost square cell (but trapezoidal by
+  // 1e-8 in y-direction)
   points[16] = Point<dim> (6., 1., 1.);
   points[17] = Point<dim> (6., 2.+1e-8, 1.);
   points[18] = Point<dim> (6., 1., 2.);
   points[19] = Point<dim> (6., 2., 2.);
 
-                                // apparently trapezoidal cell
+  // apparently trapezoidal cell
   points[20] = Point<dim> (7., 1.4, 1.2231);
   points[21] = Point<dim> (7.5, numbers::PI, 1.334);
   points[22] = Point<dim> (7., 1.5, 7.1);
@@ -116,7 +116,7 @@ void create_mesh (Triangulation<3> &tria,
     for (unsigned int i=0; i<points.size(); ++i)
       points[i] *= scale_grid;
 
-                                // connect the points to cells
+  // connect the points to cells
   std::vector<CellData<dim> > cells(5);
   for (unsigned int i=0; i<5; ++i)
     {
index 38a73bf0b55e43f354d24bed21965e1944d0f71c..a3e4d6d8306eaf13d8a413c253be623a1977eb42 100644 (file)
@@ -48,7 +48,7 @@ mass_operator (const MatrixFree<dim,Number>  &data,
   FEEvaluationGeneral<dim,fe_degree,fe_degree+1,1,Number> fe_eval (data);
   const unsigned int n_q_points = fe_eval.n_q_points;
 
-  for(unsigned int cell=cell_range.first;cell<cell_range.second;++cell)
+  for (unsigned int cell=cell_range.first; cell<cell_range.second; ++cell)
     {
       fe_eval.reinit (cell);
       fe_eval.read_dof_values (src);
@@ -67,7 +67,7 @@ mass_operator (const MatrixFree<dim,Number>  &data,
 template <int dim, int fe_degree, typename Number>
 class MatrixFreeTest
 {
- public:
+public:
   typedef VectorizedArray<Number> vector_t;
 
   MatrixFreeTest(const MatrixFree<dim,Number> &data_in):
@@ -78,11 +78,11 @@ class MatrixFreeTest
               const Vector<Number> &src) const
   {
     dst = 0;
-    const std_cxx1x::function<void(const MatrixFree<dim,Number>  &,
-                                   Vector<Number>       &,
+    const std_cxx1x::function<void(const MatrixFree<dim,Number> &,
+                                   Vector<Number> &,
                                    const Vector<Number> &,
-                                   const std::pair<unsigned int,unsigned int>&)>
-      wrap = mass_operator<dim,fe_degree,Number>;
+                                   const std::pair<unsigned int,unsigned int> &)>
+    wrap = mass_operator<dim,fe_degree,Number>;
     data.cell_loop (wrap, dst, src);
   };
 
index 95c2a2871996e6cb4f84dbb7297e5e29bc5279b2..5a920a7c9e2d0cb7d427b5c3ea149b1158f092b8 100644 (file)
@@ -36,7 +36,7 @@ void test ()
   GridGenerator::hyper_ball (tria);
   static const HyperBallBoundary<dim> boundary;
   tria.set_boundary (0, boundary);
-                                // refine first and last cell
+  // refine first and last cell
   tria.begin(tria.n_levels()-1)->set_refine_flag();
   tria.last()->set_refine_flag();
   tria.execute_coarsening_and_refinement();
index f3e66e8c2522094680258bf6a743bd0e2e9f044a..6e23e6e2ba142c6162fd13dfcc6275f8db77f8f2 100644 (file)
@@ -41,7 +41,7 @@ void test ();
 template <int dim, int fe_degree, int n_q_points_1d=fe_degree+1, typename Number=double>
 class MatrixFreeTest
 {
- public:
+public:
   MatrixFreeTest(const MatrixFree<dim,Number> &data_in):
     data   (data_in),
     fe_val (data.get_dof_handler().get_fe(),
@@ -50,18 +50,18 @@ class MatrixFreeTest
   {};
 
   MatrixFreeTest(const MatrixFree<dim,Number> &data_in,
-             const Mapping<dim>               &mapping):
+                 const Mapping<dim>               &mapping):
     data   (data_in),
     fe_val (mapping, data.get_dof_handler().get_fe(),
             Quadrature<dim>(data.get_quadrature(0)),
             update_values | update_gradients | update_hessians)
   {};
 
-    virtual ~MatrixFreeTest ()
-      {}
+  virtual ~MatrixFreeTest ()
+  {}
 
-                                // make function virtual to allow derived
-                                // classes to define a different function
+  // make function virtual to allow derived
+  // classes to define a different function
   virtual void
   operator () (const MatrixFree<dim,Number> &data,
                Vector<Number> &,
@@ -74,14 +74,14 @@ class MatrixFreeTest
     std::vector<Tensor<1,dim> > reference_grads (fe_eval.n_q_points);
     std::vector<Tensor<2,dim> > reference_hess (fe_eval.n_q_points);
 
-    for(unsigned int cell=cell_range.first;cell<cell_range.second;++cell)
+    for (unsigned int cell=cell_range.first; cell<cell_range.second; ++cell)
       {
         fe_eval.reinit (cell);
         fe_eval.read_dof_values(src);
         fe_eval.evaluate (true,true,true);
 
-                                // compare values with the ones the FEValues
-                                // gives us. Those are seen as reference
+        // compare values with the ones the FEValues
+        // gives us. Those are seen as reference
         for (unsigned int j=0; j<data.n_components_filled(cell); ++j)
           {
             fe_val.reinit (data.get_cell_iterator(cell,j));
@@ -101,7 +101,7 @@ class MatrixFreeTest
                 for (unsigned int d=0; d<dim; ++d)
                   {
                     errors[3] += std::fabs(fe_eval.get_hessian_diagonal(q)[d][j]-
-                                             reference_hess[q][d][d]);
+                                           reference_hess[q][d][d]);
                     for (unsigned int e=0; e<dim; ++e)
                       errors[4] += std::fabs(fe_eval.get_hessian(q)[d][e][j]-
                                              reference_hess[q][d][e]);
@@ -111,9 +111,9 @@ class MatrixFreeTest
                 for (unsigned int d=0; d<dim; ++d)
                   total[1] += std::fabs(reference_grads[q][d]);
 
-                                // reference for second derivatives computed
-                                // from fe_eval because FEValues is not
-                                // accurate enough with finite differences
+                // reference for second derivatives computed
+                // from fe_eval because FEValues is not
+                // accurate enough with finite differences
                 total[2] += std::fabs(fe_eval.get_laplacian(q)[j]);
                 for (unsigned int d=0; d<dim; ++d)
                   {
@@ -138,8 +138,8 @@ class MatrixFreeTest
     Vector<Number> dst_dummy;
     data.cell_loop (&MatrixFreeTest::operator(), this, dst_dummy, src);
 
-                                // for doubles, use a stricter condition than
-                                // for floats for the relative error size
+    // for doubles, use a stricter condition than
+    // for floats for the relative error size
     if (types_are_equal<Number,double>::value == true)
       {
         deallog.threshold_double (5e-14);
@@ -148,14 +148,14 @@ class MatrixFreeTest
         deallog << "Error function gradients: "
                 << errors[1]/total[1] << std::endl;
 
-                                // need to set quite a loose tolerance because
-                                // FEValues approximates Hessians with finite
-                                // differences, which are not so
-                                // accurate. moreover, Hessians are quite
-                                // large since we chose random numbers. for
-                                // some elements, it might also be zero
-                                // (linear elements on quadrilaterals), so
-                                // need to check for division by 0, too.
+        // need to set quite a loose tolerance because
+        // FEValues approximates Hessians with finite
+        // differences, which are not so
+        // accurate. moreover, Hessians are quite
+        // large since we chose random numbers. for
+        // some elements, it might also be zero
+        // (linear elements on quadrilaterals), so
+        // need to check for division by 0, too.
         deallog.threshold_double (5e-7);
         const double output2 = total[2] == 0 ? 0. : errors[2] / total[2];
         deallog << "Error function Laplacians: " << output2 << std::endl;
@@ -194,15 +194,15 @@ protected:
 template <int dim, int fe_degree,typename Number>
 class MatrixFreeTest<dim,fe_degree,0,Number>
 {
- public:
+public:
   MatrixFreeTest(const MatrixFree<dim,Number> &)
   {};
 
   MatrixFreeTest(const MatrixFree<dim,Number> &,
-             const Mapping<dim>               &)
+                 const Mapping<dim> &)
   {};
 
-  void cell_integration (Vector<Number>       &,
+  void cell_integration (Vector<Number> &,
                          const Vector<Number> &,
                          const std::pair<unsigned int,unsigned int>) const {}
 
@@ -215,7 +215,7 @@ class MatrixFreeTest<dim,fe_degree,0,Number>
 
 template <int dim, int fe_degree, typename number>
 void do_test (const DoFHandler<dim> &dof,
-              const ConstraintMatrix&constraints)
+              const ConstraintMatrix &constraints)
 {
   deallog << "Testing " << dof.get_fe().get_name() << std::endl;
   // use this for info on problem
@@ -226,10 +226,10 @@ void do_test (const DoFHandler<dim> &dof,
 
   Vector<number> solution (dof.n_dofs());
 
-                                // create vector with random entries
+  // create vector with random entries
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
     {
-      if(constraints.is_constrained(i))
+      if (constraints.is_constrained(i))
         continue;
       const double entry = rand()/(double)RAND_MAX;
       solution(i) = entry;
index dca0350b5997e306d3ae1a2d6c35a42ee72b2efd..93f665ba455e7254e70cb65a212a350a1a14c82b 100644 (file)
@@ -37,12 +37,12 @@ void test ()
   create_mesh (tria);
   tria.refine_global(4-dim);
 
-                                // refine a few cells
+  // refine a few cells
   for (unsigned int i=0; i<10-3*dim; ++i)
     {
       typename Triangulation<dim>::active_cell_iterator
-        cell = tria.begin_active (),
-        endc = tria.end();
+      cell = tria.begin_active (),
+      endc = tria.end();
       unsigned int counter = 0;
       for (; cell!=endc; ++cell, ++counter)
         if (counter % (7-i) == 0)
index ec37076db2fb32967a738af5327fdef86d06f72c..fa524669f938367abcc3c9ccd4909fce5c8e9b85 100644 (file)
@@ -33,20 +33,20 @@ std::ofstream logfile("get_functions_gl/output");
 template <int dim, int fe_degree, typename Number>
 class MatrixFreeTestGL : public MatrixFreeTest<dim, fe_degree, fe_degree+1, Number>
 {
- public:
+public:
 
   MatrixFreeTestGL(const MatrixFree<dim,Number> &data,
-               const Mapping<dim>               &mapping):
+                   const Mapping<dim>               &mapping):
     MatrixFreeTest<dim, fe_degree, fe_degree+1, Number>(data, mapping)
   {};
 
   void operator() (const MatrixFree<dim,Number> &data,
-                   Vector<Number>       &,
+                   Vector<Number> &,
                    const Vector<Number> &src,
                    const std::pair<unsigned int,unsigned int> &cell_range) const
   {
     FEEvaluationGL<dim,fe_degree,1,Number> fe_eval (this->data);
-    for(unsigned int cell=cell_range.first;cell<cell_range.second;++cell)
+    for (unsigned int cell=cell_range.first; cell<cell_range.second; ++cell)
       {
         fe_eval.reinit (cell);
         std::vector<double> reference_values (fe_eval.n_q_points);
@@ -55,8 +55,8 @@ class MatrixFreeTestGL : public MatrixFreeTest<dim, fe_degree, fe_degree+1, Numb
         fe_eval.read_dof_values(src);
         fe_eval.evaluate (true,true,true);
 
-                                // compare values with the ones the FEValues
-                                // gives us. Those are seen as reference
+        // compare values with the ones the FEValues
+        // gives us. Those are seen as reference
         for (unsigned int j=0; j<data.n_components_filled(cell); ++j)
           {
             this->fe_val.reinit (data.get_cell_iterator(cell,j));
@@ -93,7 +93,7 @@ void test ()
   GridGenerator::hyper_ball (tria);
   static const HyperBallBoundary<dim> boundary;
   tria.set_boundary (0, boundary);
-                                // refine first and last cell
+  // refine first and last cell
   tria.begin(tria.n_levels()-1)->set_refine_flag();
   tria.last()->set_refine_flag();
   tria.execute_coarsening_and_refinement();
@@ -115,10 +115,10 @@ void test ()
 
   Vector<number> solution (dof.n_dofs());
 
-                                // create vector with random entries
+  // create vector with random entries
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
     {
-      if(constraints.is_constrained(i))
+      if (constraints.is_constrained(i))
         continue;
       const double entry = rand()/(double)RAND_MAX;
       solution(i) = entry;
index ec459e4ff43a322cb6b7629530c98cbdc2dda50c..f9c6a015b10c7069e3e830177a97f632e60cb04b 100644 (file)
@@ -37,7 +37,7 @@ void test ()
   GridGenerator::hyper_ball (tria);
   static const HyperBallBoundary<dim> boundary;
   tria.set_boundary (0, boundary);
-                                // refine first and last cell
+  // refine first and last cell
   tria.begin(tria.n_levels()-1)->set_refine_flag();
   tria.last()->set_refine_flag();
   tria.execute_coarsening_and_refinement();
@@ -51,9 +51,9 @@ void test ()
   DoFTools::make_hanging_node_constraints (dof, constraints);
   constraints.close();
 
-                                // in the other functions, use do_test in
-                                // get_functions_common, but here we have to
-                                // manually choose another mapping
+  // in the other functions, use do_test in
+  // get_functions_common, but here we have to
+  // manually choose another mapping
   deallog << "Testing " << dof.get_fe().get_name() << std::endl;
   //std::cout << "Number of cells: " << dof.get_tria().n_active_cells()
   //          << std::endl;
@@ -62,10 +62,10 @@ void test ()
 
   Vector<number> solution (dof.n_dofs());
 
-                                // create vector with random entries
+  // create vector with random entries
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
     {
-      if(constraints.is_constrained(i))
+      if (constraints.is_constrained(i))
         continue;
       const double entry = rand()/(double)RAND_MAX;
       solution(i) = entry;
index 2efb99e10f044394e7b2646bebda6c2b8db14e4d..cdd15fa7c7f68176baeeb032e207f1be903a6b16 100644 (file)
@@ -48,7 +48,7 @@ std::ofstream logfile("get_functions_multife/output");
 template <int dim, int fe_degree, int n_q_points_1d=fe_degree+1, typename Number=double>
 class MatrixFreeTest
 {
- public:
+public:
   typedef std::vector<Vector<Number> > VectorType;
 
   MatrixFreeTest(const MatrixFree<dim,Number> &data_in):
@@ -75,7 +75,7 @@ class MatrixFreeTest
     std::vector<double> reference_values1 (fe_eval1.n_q_points);
     std::vector<Tensor<1,dim> > reference_grads1 (fe_eval1.n_q_points);
     std::vector<Tensor<2,dim> > reference_hess1 (fe_eval1.n_q_points);
-    for(unsigned int cell=cell_range.first;cell<cell_range.second;++cell)
+    for (unsigned int cell=cell_range.first; cell<cell_range.second; ++cell)
       {
         fe_eval0.reinit (cell);
         fe_eval0.read_dof_values(src[0]);
@@ -85,11 +85,11 @@ class MatrixFreeTest
         fe_eval1.read_dof_values(src[1]);
         fe_eval1.evaluate (true,true,true);
 
-                                // compare values with the ones the FEValues
-                                // gives us. Those are seen as reference
+        // compare values with the ones the FEValues
+        // gives us. Those are seen as reference
         for (unsigned int j=0; j<data.n_components_filled(cell); ++j)
           {
-                                // FE 0
+            // FE 0
             fe_val0.reinit (data.get_cell_iterator(cell,j,0));
             fe_val0.get_function_values(src[0], reference_values0);
             fe_val0.get_function_gradients(src[0], reference_grads0);
@@ -110,7 +110,7 @@ class MatrixFreeTest
                 total[2] += std::fabs(fe_eval0.get_laplacian(q)[j]);
               }
 
-                                // FE 1
+            // FE 1
             fe_val1.reinit (data.get_cell_iterator(cell,j,1));
             fe_val1.get_function_values(src[1], reference_values1);
             fe_val1.get_function_gradients(src[1], reference_grads1);
@@ -145,8 +145,8 @@ class MatrixFreeTest
     data.cell_loop (&MatrixFreeTest<dim,fe_degree,n_q_points_1d,Number>::operator(),
                     this, dst_dummy, src);
 
-                                // for doubles, use a stricter condition then
-                                // for floats for the relative error size
+    // for doubles, use a stricter condition then
+    // for floats for the relative error size
     for (unsigned int i=0; i<2; ++i)
       {
         if (types_are_equal<Number,double>::value == true)
@@ -157,14 +157,14 @@ class MatrixFreeTest
             deallog << "Error function gradients FE " << i << ": "
                     << errors[i*3+1]/total[i*3+1] << std::endl;
 
-                                // need to set quite a loose tolerance because
-                                // FEValues approximates Hessians with finite
-                                // differences, which are not so
-                                // accurate. moreover, Hessians are quite
-                                // large since we chose random numbers. for
-                                // some elements, it might also be zero
-                                // (linear elements on quadrilaterals), so
-                                // need to check for division by 0, too.
+            // need to set quite a loose tolerance because
+            // FEValues approximates Hessians with finite
+            // differences, which are not so
+            // accurate. moreover, Hessians are quite
+            // large since we chose random numbers. for
+            // some elements, it might also be zero
+            // (linear elements on quadrilaterals), so
+            // need to check for division by 0, too.
             deallog.threshold_double (5e-7);
             const double output2 = total[i*3+2] == 0 ? 0. : errors[i*3+2] / total[i*3+2];
             deallog << "Error function Laplacians FE " << i << ": " << output2 << std::endl;
@@ -247,7 +247,7 @@ void test ()
   for (unsigned int no=0; no<2; ++no)
     for (unsigned int i=0; i<dof[no]->n_dofs(); ++i)
       {
-        if(constraints[no]->is_constrained(i))
+        if (constraints[no]->is_constrained(i))
           continue;
         const double entry = rand()/(double)RAND_MAX;
         src[no](i) = entry;
@@ -277,9 +277,9 @@ int main ()
 {
   deallog.attach(logfile);
   deallog.depth_console(0);
-                                // need to set quite a loose tolerance because
-                                // FEValues approximates Hessians with finite
-                                // differences, which are not so accurate
+  // need to set quite a loose tolerance because
+  // FEValues approximates Hessians with finite
+  // differences, which are not so accurate
   deallog.threshold_double(2.e-5);
   deallog << std::setprecision (3);
 
index a6e3fb687c6de7de9f8cfdf8a7bacb05030265d2..b2beb0a55036d6ac8251c28dc844374f55b290f4 100644 (file)
@@ -50,7 +50,7 @@ std::ofstream logfile("get_functions_multife2/output");
 template <int dim, int fe_degree, int n_q_points_1d=fe_degree+1, typename Number=double>
 class MatrixFreeTest
 {
- public:
+public:
   typedef std::vector<Vector<Number> > VectorType;
 
   MatrixFreeTest(const MatrixFree<dim,Number> &data_in):
@@ -84,7 +84,7 @@ class MatrixFreeTest
     std::vector<double> reference_values2 (fe_eval2.n_q_points);
     std::vector<Tensor<1,dim> > reference_grads2 (fe_eval2.n_q_points);
     std::vector<Tensor<2,dim> > reference_hess2 (fe_eval2.n_q_points);
-    for(unsigned int cell=cell_range.first;cell<cell_range.second;++cell)
+    for (unsigned int cell=cell_range.first; cell<cell_range.second; ++cell)
       {
         fe_eval0.reinit (cell);
         fe_eval0.read_dof_values(src[0]);
@@ -98,11 +98,11 @@ class MatrixFreeTest
         fe_eval2.read_dof_values(src[2]);
         fe_eval2.evaluate (true,true,true);
 
-                                // compare values with the ones the FEValues
-                                // gives us. Those are seen as reference
+        // compare values with the ones the FEValues
+        // gives us. Those are seen as reference
         for (unsigned int j=0; j<data.n_components_filled(cell); ++j)
           {
-                                // FE 0
+            // FE 0
             fe_val0.reinit (data.get_cell_iterator(cell,j,0));
             fe_val0.get_function_values(src[0], reference_values0);
             fe_val0.get_function_gradients(src[0], reference_grads0);
@@ -123,7 +123,7 @@ class MatrixFreeTest
                 total[2] += std::fabs(fe_eval0.get_laplacian(q)[j]);
               }
 
-                                // FE 1
+            // FE 1
             fe_val1.reinit (data.get_cell_iterator(cell,j,1));
             fe_val1.get_function_values(src[1], reference_values1);
             fe_val1.get_function_gradients(src[1], reference_grads1);
@@ -144,7 +144,7 @@ class MatrixFreeTest
                 total[5] += std::fabs(fe_eval1.get_laplacian(q)[j]);
               }
 
-                                // FE 2
+            // FE 2
             fe_val2.reinit (data.get_cell_iterator(cell,j,2));
             fe_val2.get_function_values(src[2], reference_values2);
             fe_val2.get_function_gradients(src[2], reference_grads2);
@@ -179,13 +179,13 @@ class MatrixFreeTest
     data.cell_loop (&MatrixFreeTest<dim,fe_degree,n_q_points_1d,Number>::operator(),
                     this, dst_dummy, src);
 
-                                // avoid dividing by zero
+    // avoid dividing by zero
     for (unsigned int i=0; i<9; ++i)
       if (std::fabs(total[i]) < 1e-20)
         total[i] = 1;
 
-                                // for doubles, use a stricter condition then
-                                // for floats for the relative error size
+    // for doubles, use a stricter condition then
+    // for floats for the relative error size
     for (unsigned int i=0; i<3; ++i)
       {
         if (types_are_equal<Number,double>::value == true)
@@ -196,14 +196,14 @@ class MatrixFreeTest
             deallog << "Error function gradients FE " << i << ": "
                     << errors[i*3+1]/total[i*3+1] << std::endl;
 
-                                // need to set quite a loose tolerance because
-                                // FEValues approximates Hessians with finite
-                                // differences, which are not so
-                                // accurate. moreover, Hessians are quite
-                                // large since we chose random numbers. for
-                                // some elements, it might also be zero
-                                // (linear elements on quadrilaterals), so
-                                // need to check for division by 0, too.
+            // need to set quite a loose tolerance because
+            // FEValues approximates Hessians with finite
+            // differences, which are not so
+            // accurate. moreover, Hessians are quite
+            // large since we chose random numbers. for
+            // some elements, it might also be zero
+            // (linear elements on quadrilaterals), so
+            // need to check for division by 0, too.
             deallog.threshold_double (2e-6);
             const double output2 = total[i*3+2] == 0 ? 0. : errors[i*3+2] / total[i*3+2];
             deallog << "Error function Laplacians FE " << i << ": " << output2 << std::endl;
@@ -298,7 +298,7 @@ void test ()
   for (unsigned int no=0; no<3; ++no)
     for (unsigned int i=0; i<dof[no]->n_dofs(); ++i)
       {
-        if(constraints[no]->is_constrained(i))
+        if (constraints[no]->is_constrained(i))
           continue;
         const double entry = rand()/(double)RAND_MAX;
         src[no](i) = entry;
@@ -329,9 +329,9 @@ int main ()
 {
   deallog.attach(logfile);
   deallog.depth_console(0);
-                                // need to set quite a loose tolerance because
-                                // FEValues approximates Hessians with finite
-                                // differences, which are not so accurate
+  // need to set quite a loose tolerance because
+  // FEValues approximates Hessians with finite
+  // differences, which are not so accurate
   deallog.threshold_double(2.e-5);
   deallog << std::setprecision (3);
 
index 91b7b58139a3e4b34954b6aaa89a99fdb0d1aabe..0eb6128e1b6e0fae2fa4885b3c2da29f41d09b9b 100644 (file)
@@ -35,19 +35,19 @@ std::ofstream logfile("get_functions_q_hierarchical/output");
 template <int dim, int fe_degree, typename Number>
 class MatrixFreeTestGen : public MatrixFreeTest<dim, fe_degree, fe_degree+1, Number>
 {
- public:
+public:
   MatrixFreeTestGen(const MatrixFree<dim,Number> &data,
-                const Mapping<dim>               &mapping):
+                    const Mapping<dim>               &mapping):
     MatrixFreeTest<dim, fe_degree, fe_degree+1, Number>(data, mapping)
   {};
 
   void operator () (const MatrixFree<dim,Number> &data,
-                    Vector<Number>       &,
+                    Vector<Number> &,
                     const Vector<Number> &src,
                     const std::pair<unsigned int,unsigned int> &cell_range) const
   {
     FEEvaluationGeneral<dim,fe_degree,fe_degree+1,1,Number> fe_eval (data);
-    for(unsigned int cell=cell_range.first;cell<cell_range.second;++cell)
+    for (unsigned int cell=cell_range.first; cell<cell_range.second; ++cell)
       {
         fe_eval.reinit (cell);
         std::vector<double> reference_values (fe_eval.n_q_points);
@@ -56,8 +56,8 @@ class MatrixFreeTestGen : public MatrixFreeTest<dim, fe_degree, fe_degree+1, Num
         fe_eval.read_dof_values(src);
         fe_eval.evaluate (true,true,true);
 
-                                // compare values with the ones the FEValues
-                                // gives us. Those are seen as reference
+        // compare values with the ones the FEValues
+        // gives us. Those are seen as reference
         for (unsigned int j=0; j<data.n_components_filled(cell); ++j)
           {
             this->fe_val.reinit (data.get_cell_iterator(cell,j));
@@ -71,8 +71,8 @@ class MatrixFreeTestGen : public MatrixFreeTest<dim, fe_degree, fe_degree+1, Num
                                              reference_values[q]);
                 for (unsigned int d=0; d<dim; ++d)
                   {
-                  this->errors[1] += std::fabs(fe_eval.get_gradient(q)[d][j]-
-                                               reference_grads[q][d]);
+                    this->errors[1] += std::fabs(fe_eval.get_gradient(q)[d][j]-
+                                                 reference_grads[q][d]);
                   }
                 this->errors[2] += std::fabs(fe_eval.get_laplacian(q)[j]-
                                              trace(reference_hess[q]));
@@ -96,7 +96,7 @@ void test ()
   GridGenerator::hyper_ball (tria);
   static const HyperBallBoundary<dim> boundary;
   tria.set_boundary (0, boundary);
-                                // refine first and last cell
+  // refine first and last cell
   tria.begin(tria.n_levels()-1)->set_refine_flag();
   tria.last()->set_refine_flag();
   tria.execute_coarsening_and_refinement();
@@ -118,10 +118,10 @@ void test ()
 
   Vector<number> solution (dof.n_dofs());
 
-                                // create vector with random entries
+  // create vector with random entries
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
     {
-      if(constraints.is_constrained(i))
+      if (constraints.is_constrained(i))
         continue;
       const double entry = rand()/(double)RAND_MAX;
       solution(i) = entry;
index cabb1ad2c1a6fd42ef6656b6995bf88137687de5..fa960c5f198f0bd081fce0be61e05d5ce650dff3 100644 (file)
@@ -58,7 +58,7 @@ void test ()
   GridGenerator::hyper_ball (tria);
   static const HyperBallBoundary<dim> boundary;
   tria.set_boundary (0, boundary);
-                                // refine first and last cell
+  // refine first and last cell
   tria.begin(tria.n_levels()-1)->set_refine_flag();
   tria.last()->set_refine_flag();
   tria.execute_coarsening_and_refinement();
@@ -73,9 +73,9 @@ void test ()
   constraints.close();
 
 
-                                // in the other functions, use do_test in
-                                // get_functions_common, but here we have to
-                                // manually choose non-rectangular tests.
+  // in the other functions, use do_test in
+  // get_functions_common, but here we have to
+  // manually choose non-rectangular tests.
   deallog << "Testing " << dof.get_fe().get_name() << std::endl;
   //std::cout << "Number of cells: " << dof.get_tria().n_active_cells()
   //          << std::endl;
@@ -84,10 +84,10 @@ void test ()
 
   Vector<number> solution (dof.n_dofs());
 
-                                // create vector with random entries
+  // create vector with random entries
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
     {
-      if(constraints.is_constrained(i))
+      if (constraints.is_constrained(i))
         continue;
       const double entry = rand()/(double)RAND_MAX;
       solution(i) = entry;
index 2df2fb412790b25628c3835bdda75731dc1d2563..b3156eb72dc782a958452f36907f766857cec195 100644 (file)
@@ -47,7 +47,7 @@ std::ofstream logfile("get_functions_variants/output");
 template <int dim, int fe_degree, typename Number>
 class MatrixFreeTest
 {
- public:
+public:
   typedef Vector<Number> VectorType;
 
   MatrixFreeTest(const MatrixFree<dim,Number> &data_in):
@@ -64,7 +64,7 @@ class MatrixFreeTest
     for (unsigned int i=0; i<5; ++i)
       errors[i] = 0;
     data.cell_loop (&MatrixFreeTest<dim,fe_degree,Number>::operator(), this,
-                    const_cast<VectorType&>(src), src);
+                    const_cast<VectorType &>(src), src);
 
     deallog << "Error val, function values alone: "
             << errors[0] << std::endl;
@@ -89,7 +89,7 @@ private:
 template <int dim, int fe_degree, typename Number>
 void MatrixFreeTest<dim,fe_degree,Number>::
 operator () (const MatrixFree<dim,Number> &data,
-             VectorType       &,
+             VectorType &,
              const VectorType &src,
              const std::pair<unsigned int,unsigned int> &cell_range) const
 {
@@ -98,37 +98,37 @@ operator () (const MatrixFree<dim,Number> &data,
   FEEvaluation<dim,fe_degree,fe_degree+1,1,Number> fe_eval3 (data);
   FEEvaluation<dim,fe_degree,fe_degree+1,1,Number> fe_eval4 (data);
   FEEvaluation<dim,fe_degree,fe_degree+1,1,Number> fe_eval5 (data);
-  for(unsigned int cell=cell_range.first;cell<cell_range.second;++cell)
-    {  
+  for (unsigned int cell=cell_range.first; cell<cell_range.second; ++cell)
+    {
       fe_eval.reinit (cell);
       fe_eval.read_dof_values(src);
       fe_eval.evaluate (true,true,true);
 
-                                // only for values (additional test)
+      // only for values (additional test)
       fe_eval2.reinit (cell);
       fe_eval2.read_dof_values(src);
       fe_eval2.evaluate (true,false,false);
 
-                                // only gradients
+      // only gradients
       fe_eval3.reinit (cell);
       fe_eval3.read_dof_values(src);
       fe_eval3.evaluate (false,true,false);
 
-                                // only values and gradients
+      // only values and gradients
       fe_eval4.reinit (cell);
       fe_eval4.read_dof_values(src);
       fe_eval4.evaluate(true,true,false);
 
-                                // only laplacians
+      // only laplacians
       fe_eval5.reinit (cell);
       fe_eval5.read_dof_values(src);
       fe_eval5.evaluate (false,false,true);
 
-                                // compare values with the values that we get
-                                // when expanding the full
-                                // FEEvaluations. Those are tested in other
-                                // functions and seen as reference here
+
+      // compare values with the values that we get
+      // when expanding the full
+      // FEEvaluations. Those are tested in other
+      // functions and seen as reference here
       for (unsigned int q=0; q<fe_eval.n_q_points; ++q)
         for (unsigned int j=0; j<VectorizedArray<Number>::n_array_elements; ++j)
           {
@@ -166,7 +166,7 @@ void test ()
 
   Vector<double> solution_dist (dof.n_dofs());
 
-                                // create vector with random entries
+  // create vector with random entries
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
     {
       const double entry = rand()/(double)RAND_MAX;
index 7660228acbdcf13cd5e57e38ca8e0b163a6f6b0e..854aab5984b279949c8d8a3ee973de7d038c06e4 100644 (file)
@@ -48,13 +48,13 @@ std::ofstream logfile("get_values_plain/output");
 template <int dim, int fe_degree, int n_q_points_1d=fe_degree+1, typename Number=double>
 class MatrixFreeTest
 {
- public:
+public:
   MatrixFreeTest(const MatrixFree<dim,Number> &data_in):
     data   (data_in)
   {};
 
-                                // make function virtual to allow derived
-                                // classes to define a different function
+  // make function virtual to allow derived
+  // classes to define a different function
   virtual void
   operator () (const MatrixFree<dim,Number> &data,
                Vector<Number> &,
@@ -63,7 +63,7 @@ class MatrixFreeTest
   {
     FEEvaluation<dim,fe_degree,n_q_points_1d,1,Number> fe_eval (data);
     FEEvaluation<dim,fe_degree,n_q_points_1d,1,Number> fe_eval_plain (data);
-    for(unsigned int cell=cell_range.first;cell<cell_range.second;++cell)
+    for (unsigned int cell=cell_range.first; cell<cell_range.second; ++cell)
       {
         fe_eval.reinit (cell);
         fe_eval.read_dof_values(src);
@@ -105,7 +105,7 @@ protected:
 
 template <int dim, int fe_degree, typename number>
 void do_test (const DoFHandler<dim> &dof,
-              const ConstraintMatrix&constraints)
+              const ConstraintMatrix &constraints)
 {
   deallog << "Testing " << dof.get_fe().get_name() << std::endl;
   //std::cout << "Number of cells: " << dof.get_tria().n_active_cells()
@@ -115,10 +115,10 @@ void do_test (const DoFHandler<dim> &dof,
 
   Vector<number> solution (dof.n_dofs());
 
-                                // create vector with random entries
+  // create vector with random entries
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
     {
-      if(constraints.is_constrained(i))
+      if (constraints.is_constrained(i))
         continue;
       const double entry = rand()/(double)RAND_MAX;
       solution(i) = entry;
@@ -147,12 +147,12 @@ void test ()
   tria.set_boundary (0, boundary);
   tria.set_boundary (1, boundary);
 
-                                // refine a few cells
+  // refine a few cells
   for (unsigned int i=0; i<11-3*dim; ++i)
     {
       typename Triangulation<dim>::active_cell_iterator
-        cell = tria.begin_active (),
-        endc = tria.end();
+      cell = tria.begin_active (),
+      endc = tria.end();
       unsigned int counter = 0;
       for (; cell!=endc; ++cell, ++counter)
         if (counter % (7-i) == 0)
index 867312223695dce06731313f9721960e2e2bf2b7..201a2e29391aa613ce3709c7618a3a4b01595558 100644 (file)
@@ -46,7 +46,7 @@ std::ofstream logfile("integrate_functions/output");
 template <int dim, int fe_degree, typename Number>
 class MatrixFreeTest
 {
- public:
+public:
   typedef std::vector<Vector<Number>*> VectorType;
 
   MatrixFreeTest(const MatrixFree<dim,Number> &data_in):
@@ -95,16 +95,16 @@ operator () (const MatrixFree<dim,Number> &data,
   AlignedVector<VectorizedArray<Number> > values (n_q_points);
   AlignedVector<VectorizedArray<Number> > gradients (dim*n_q_points);
   std::vector<types::global_dof_index> dof_indices (dofs_per_cell);
-  for(unsigned int cell=cell_range.first;cell<cell_range.second;++cell)
+  for (unsigned int cell=cell_range.first; cell<cell_range.second; ++cell)
     {
       fe_eval.reinit(cell);
-                                // compare values with the ones the FEValues
-                                // gives us. Those are seen as reference
+      // compare values with the ones the FEValues
+      // gives us. Those are seen as reference
       for (unsigned int j=0; j<data.n_components_filled(cell); ++j)
         {
-                                // generate random numbers at quadrature
-                                // points and test them with basis functions
-                                // and their gradients
+          // generate random numbers at quadrature
+          // points and test them with basis functions
+          // and their gradients
           for (unsigned int q=0; q<n_q_points; ++q)
             {
               values[q][j] = rand()/(double)RAND_MAX;
@@ -151,8 +151,8 @@ void test ()
   static const HyperBallBoundary<dim> boundary;
   tria.set_boundary (0, boundary);
   typename Triangulation<dim>::active_cell_iterator
-    cell = tria.begin_active (),
-    endc = tria.end();
+  cell = tria.begin_active (),
+  endc = tria.end();
   for (; cell!=endc; ++cell)
     if (cell->center().norm()<1e-8)
       cell->set_refine_flag();
index c1ef85f72221647e6808e72caa8972999ca3d397..3a1a8844ed910756f76f99380a174fa422584bbd 100644 (file)
@@ -47,7 +47,7 @@ std::ofstream logfile("integrate_functions_multife/output");
 template <int dim, int fe_degree, typename Number>
 class MatrixFreeTest
 {
- public:
+public:
   typedef std::vector<Vector<Number> > VectorType;
 
   MatrixFreeTest(const MatrixFree<dim,Number> &data_in):
@@ -107,20 +107,20 @@ operator () (const MatrixFree<dim,Number> &data,
   AlignedVector<VectorizedArray<Number> > gradients1 (dim*n_q_points1);
   std::vector<types::global_dof_index> dof_indices0 (dofs_per_cell0);
   std::vector<types::global_dof_index> dof_indices1 (dofs_per_cell1);
-  for(unsigned int cell=cell_range.first;cell<cell_range.second;++cell)
+  for (unsigned int cell=cell_range.first; cell<cell_range.second; ++cell)
     {
       fe_eval0.reinit(cell);
       fe_eval1.reinit(cell);
       fe_eval01.reinit(cell);
 
-                                // compare values with the ones the FEValues
-                                // gives us. Those are seen as reference
+      // compare values with the ones the FEValues
+      // gives us. Those are seen as reference
       for (unsigned int j=0; j<data.n_components_filled(cell); ++j)
         {
-                                // FE 0, Quad 0
-                                // generate random numbers at quadrature
-                                // points and test them with basis functions
-                                // and their gradients
+          // FE 0, Quad 0
+          // generate random numbers at quadrature
+          // points and test them with basis functions
+          // and their gradients
           for (unsigned int q=0; q<n_q_points0; ++q)
             {
               values0[q][j] = rand()/(double)RAND_MAX;
@@ -143,7 +143,7 @@ operator () (const MatrixFree<dim,Number> &data,
               dst[0+1](dof_indices0[i]) += sum;
             }
 
-                                // FE 1, Quad 1
+          // FE 1, Quad 1
           fe_val1.reinit (data.get_cell_iterator(cell,j,1));
           data.get_cell_iterator(cell,j,1)->get_dof_indices(dof_indices1);
 
@@ -166,7 +166,7 @@ operator () (const MatrixFree<dim,Number> &data,
               dst[2+1](dof_indices1[i]) += sum;
             }
 
-                                // FE 0, Quad 1
+          // FE 0, Quad 1
           fe_val01.reinit (data.get_cell_iterator(cell,j,0));
           for (unsigned int i=0; i<dofs_per_cell0; ++i)
             {
@@ -182,7 +182,7 @@ operator () (const MatrixFree<dim,Number> &data,
             }
         }
 
-                                // FE 0, Quad 0
+      // FE 0, Quad 0
       for (unsigned int q=0; q<n_q_points0; ++q)
         {
           fe_eval0.submit_value (values0[q], q);
@@ -194,7 +194,7 @@ operator () (const MatrixFree<dim,Number> &data,
       fe_eval0.integrate (true,true);
       fe_eval0.distribute_local_to_global (dst[0]);
 
-                                // FE 1, Quad 1
+      // FE 1, Quad 1
       for (unsigned int q=0; q<n_q_points1; ++q)
         {
           fe_eval1.submit_value (values1[q], q);
@@ -206,7 +206,7 @@ operator () (const MatrixFree<dim,Number> &data,
       fe_eval1.integrate (true,true);
       fe_eval1.distribute_local_to_global (dst[2]);
 
-                                // FE 0, Quad 1
+      // FE 0, Quad 1
       for (unsigned int q=0; q<n_q_points1; ++q)
         {
           fe_eval01.submit_value (values1[q], q);
@@ -225,15 +225,15 @@ operator () (const MatrixFree<dim,Number> &data,
 template <int dim, int fe_degree, typename number>
 void test ()
 {
-                                // create hyper ball geometry and refine some
-                                // cells
+  // create hyper ball geometry and refine some
+  // cells
   Triangulation<dim> tria;
   GridGenerator::hyper_ball (tria);
   static const HyperBallBoundary<dim> boundary;
   tria.set_boundary (0, boundary);
   typename Triangulation<dim>::active_cell_iterator
-    cell = tria.begin_active (),
-    endc = tria.end();
+  cell = tria.begin_active (),
+  endc = tria.end();
   for (; cell!=endc; ++cell)
     if (cell->center().norm()<1e-8)
       cell->set_refine_flag();
index deaf0c85381de0076f0c80b5e7be9ef304a2e587..9fbf6c09e94fc7b02685711d036d9ae694aeefe4 100644 (file)
@@ -50,7 +50,7 @@ std::ofstream logfile("integrate_functions_multife2/output");
 template <int dim, int fe_degree, typename Number>
 class MatrixFreeTest
 {
- public:
+public:
   typedef std::vector<Vector<Number> > VectorType;
 
   MatrixFreeTest(const MatrixFree<dim,Number> &data_in):
@@ -110,20 +110,20 @@ operator () (const MatrixFree<dim,Number> &data,
   AlignedVector<VectorizedArray<Number> > gradients1 (dim*n_q_points1);
   std::vector<types::global_dof_index> dof_indices0 (dofs_per_cell0);
   std::vector<types::global_dof_index> dof_indices1 (dofs_per_cell1);
-  for(unsigned int cell=cell_range.first;cell<cell_range.second;++cell)
+  for (unsigned int cell=cell_range.first; cell<cell_range.second; ++cell)
     {
       fe_eval0.reinit(cell);
       fe_eval1.reinit(cell);
       fe_eval01.reinit(cell);
 
-                                // compare values with the ones the FEValues
-                                // gives us. Those are seen as reference
+      // compare values with the ones the FEValues
+      // gives us. Those are seen as reference
       for (unsigned int j=0; j<data.n_components_filled(cell); ++j)
         {
-                                // FE 0, Quad 0
-                                // generate random numbers at quadrature
-                                // points and test them with basis functions
-                                // and their gradients
+          // FE 0, Quad 0
+          // generate random numbers at quadrature
+          // points and test them with basis functions
+          // and their gradients
           for (unsigned int q=0; q<n_q_points0; ++q)
             {
               values0[q][j] = rand()/(double)RAND_MAX;
@@ -146,7 +146,7 @@ operator () (const MatrixFree<dim,Number> &data,
               dst[0+1](dof_indices0[i]) += sum;
             }
 
-                                // FE 1, Quad 1
+          // FE 1, Quad 1
           fe_val1.reinit (data.get_cell_iterator(cell,j,1));
           data.get_cell_iterator(cell,j,1)->get_dof_indices(dof_indices1);
 
@@ -169,7 +169,7 @@ operator () (const MatrixFree<dim,Number> &data,
               dst[2+1](dof_indices1[i]) += sum;
             }
 
-                                // FE 0, Quad 1
+          // FE 0, Quad 1
           fe_val01.reinit (data.get_cell_iterator(cell,j,0));
           for (unsigned int i=0; i<dofs_per_cell0; ++i)
             {
@@ -185,7 +185,7 @@ operator () (const MatrixFree<dim,Number> &data,
             }
         }
 
-                                // FE 0, Quad 0
+      // FE 0, Quad 0
       for (unsigned int q=0; q<n_q_points0; ++q)
         {
           fe_eval0.submit_value (values0[q], q);
@@ -197,7 +197,7 @@ operator () (const MatrixFree<dim,Number> &data,
       fe_eval0.integrate (true,true);
       fe_eval0.distribute_local_to_global (dst[0]);
 
-                                // FE 1, Quad 1
+      // FE 1, Quad 1
       for (unsigned int q=0; q<n_q_points1; ++q)
         {
           fe_eval1.submit_value (values1[q], q);
@@ -209,7 +209,7 @@ operator () (const MatrixFree<dim,Number> &data,
       fe_eval1.integrate (true,true);
       fe_eval1.distribute_local_to_global (dst[2]);
 
-                                // FE 0, Quad 1
+      // FE 0, Quad 1
       for (unsigned int q=0; q<n_q_points1; ++q)
         {
           fe_eval01.submit_value (values1[q], q);
@@ -228,8 +228,8 @@ operator () (const MatrixFree<dim,Number> &data,
 template <int dim, int fe_degree, typename number>
 void test ()
 {
-                                // create hyper ball geometry and refine some
-                                // cells
+  // create hyper ball geometry and refine some
+  // cells
   Triangulation<dim> tria;
   create_mesh (tria);
   tria.begin_active ()->set_refine_flag();
index f72b66f0f0ab9108bce5ab55b4bbac31c50329ea..917e9f3682c9279797cc4eb2464a4daa6e124468 100644 (file)
@@ -34,8 +34,8 @@ void test ()
   Triangulation<dim> tria;
   GridGenerator::hyper_cube (tria);
   typename Triangulation<dim>::active_cell_iterator
-    cell = tria.begin_active (),
-    endc = tria.end();
+  cell = tria.begin_active (),
+  endc = tria.end();
   for (; cell!=endc; ++cell)
     if (cell->center().norm()<1e-8)
       cell->set_refine_flag();
index 5a525a6e062947fff45cd0a990d6e3da16117c4b..ca6858c29074544f0e58cfc8913bd22870bf58ad 100644 (file)
@@ -44,8 +44,8 @@ void test ()
     }
   GridGenerator::parallelepiped (tria, points);
   typename Triangulation<dim>::active_cell_iterator
-    cell = tria.begin_active (),
-    endc = tria.end();
+  cell = tria.begin_active (),
+  endc = tria.end();
   for (; cell!=endc; ++cell)
     if (cell->center().norm()<1e-8)
       cell->set_refine_flag();
index c99ad660675ecfaeb874287cc73d17ed186baef6..13f2ca60de9e8a7ba6c1a4377cb735c410b490a1 100644 (file)
@@ -41,8 +41,8 @@ void test ()
   static const HyperBallBoundary<dim> boundary;
   tria.set_boundary (0, boundary);
   typename Triangulation<dim>::active_cell_iterator
-    cell = tria.begin_active (),
-    endc = tria.end();
+  cell = tria.begin_active (),
+  endc = tria.end();
   for (; cell!=endc; ++cell)
     if (cell->center().norm()<1e-8)
       cell->set_refine_flag();
@@ -73,10 +73,10 @@ void test ()
   DoFHandler<dim> dof (tria);
   dof.distribute_dofs(fe);
   ConstraintMatrix constraints;
-                                // there should not be any hanging nodes or
-                                // boundary conditions for FE_DGQ as there are
-                                // only interior DoFs on the elements, but try
-                                // anyway
+  // there should not be any hanging nodes or
+  // boundary conditions for FE_DGQ as there are
+  // only interior DoFs on the elements, but try
+  // anyway
   DoFTools::make_hanging_node_constraints(dof, constraints);
   VectorTools::interpolate_boundary_values (dof, 0, ZeroFunction<dim>(),
                                             constraints);
@@ -84,6 +84,6 @@ void test ()
 
   do_test<dim, fe_degree, double> (dof, constraints);
 
-                                // test with coloring only as well
+  // test with coloring only as well
   do_test<dim, fe_degree, double> (dof, constraints, 2);
 }
index 45c2200b17d1f72cff12ace190884e6b80d4a4cd..e832c951f25e69096d43f65d73b51b457ac2e25f 100644 (file)
@@ -49,7 +49,7 @@ helmholtz_operator (const MatrixFree<dim,Number>  &data,
   FEEvaluation<dim,fe_degree,fe_degree+1,1,Number> fe_eval (data);
   const unsigned int n_q_points = fe_eval.n_q_points;
 
-  for(unsigned int cell=cell_range.first;cell<cell_range.second;++cell)
+  for (unsigned int cell=cell_range.first; cell<cell_range.second; ++cell)
     {
       fe_eval.reinit (cell);
       fe_eval.read_dof_values (src);
@@ -69,7 +69,7 @@ helmholtz_operator (const MatrixFree<dim,Number>  &data,
 template <int dim, int fe_degree, typename Number>
 class MatrixFreeTest
 {
- public:
+public:
   typedef VectorizedArray<Number> vector_t;
 
   MatrixFreeTest(const MatrixFree<dim,Number> &data_in):
@@ -80,11 +80,11 @@ class MatrixFreeTest
               const Vector<Number> &src) const
   {
     dst = 0;
-    const std_cxx1x::function<void(const MatrixFree<dim,Number>  &,
-                                   Vector<Number>       &,
+    const std_cxx1x::function<void(const MatrixFree<dim,Number> &,
+                                   Vector<Number> &,
                                    const Vector<Number> &,
-                                   const std::pair<unsigned int,unsigned int>&)>
-      wrap = helmholtz_operator<dim,fe_degree,Number>;
+                                   const std::pair<unsigned int,unsigned int> &)>
+    wrap = helmholtz_operator<dim,fe_degree,Number>;
     data.cell_loop (wrap, dst, src);
   };
 
@@ -98,7 +98,7 @@ private:
 
 template <int dim, int fe_degree, typename number>
 void do_test (const DoFHandler<dim> &dof,
-              const ConstraintMatrix&constraints,
+              const ConstraintMatrix &constraints,
               const unsigned int     parallel_option = 0)
 {
 
@@ -137,7 +137,7 @@ void do_test (const DoFHandler<dim> &dof,
 
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
     {
-      if(constraints.is_constrained(i))
+      if (constraints.is_constrained(i))
         continue;
       const double entry = rand()/(double)RAND_MAX;
       in(i) = entry;
@@ -147,8 +147,8 @@ void do_test (const DoFHandler<dim> &dof,
   mf.vmult (out_dist, in_dist);
 
 
-                                // assemble sparse matrix with (\nabla v,
-                                // \nabla u) + (v, 10 * u)
+  // assemble sparse matrix with (\nabla v,
+  // \nabla u) + (v, 10 * u)
   SparsityPattern sparsity;
   {
     CompressedSimpleSparsityPattern csp(dof.n_dofs(), dof.n_dofs());
@@ -170,8 +170,8 @@ void do_test (const DoFHandler<dim> &dof,
     std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     typename DoFHandler<dim>::active_cell_iterator
-      cell = dof.begin_active(),
-      endc = dof.end();
+    cell = dof.begin_active(),
+    endc = dof.end();
     for (; cell!=endc; ++cell)
       {
         cell_matrix = 0;
index a10cdfb66ac074d88530bece81cc6d1e9998dfbb..b6092e2e7794f6fbff17e55457f57df101bf073b 100644 (file)
@@ -56,7 +56,7 @@ const double global_coefficient = 0.1;
 template <int dim, int degree, typename VectorType>
 class MatrixFreeTest
 {
- public:
+public:
   typedef typename DoFHandler<dim>::active_cell_iterator CellIterator;
   typedef double Number;
 
@@ -74,7 +74,7 @@ class MatrixFreeTest
     FEEvaluation<dim,degree,degree+1,dim,Number> phi (data);
     vector_t coeff = make_vectorized_array(global_coefficient);
 
-    for(unsigned int cell=cell_range.first;cell<cell_range.second;++cell)
+    for (unsigned int cell=cell_range.first; cell<cell_range.second; ++cell)
       {
         phi.reinit (cell);
         phi.read_dof_values (src);
@@ -111,12 +111,12 @@ void test ()
   tria.set_boundary (0, boundary);
   tria.refine_global(4-dim);
 
-                                // refine a few cells
+  // refine a few cells
   for (unsigned int i=0; i<10-3*dim; ++i)
     {
       typename Triangulation<dim>::active_cell_iterator
-        cell = tria.begin_active (),
-        endc = tria.end();
+      cell = tria.begin_active (),
+      endc = tria.end();
       unsigned int counter = 0;
       for (; cell!=endc; ++cell, ++counter)
         if (counter % (7-i) == 0)
@@ -170,7 +170,7 @@ void test ()
   system_rhs.reinit (solution);
   mf_solution.reinit (solution);
 
-                                // assemble curl-curl operator
+  // assemble curl-curl operator
   {
     QGauss<dim>   quadrature_formula(fe_degree+1);
 
@@ -192,8 +192,8 @@ void test ()
     std::vector<Tensor<1,curl_dim> > phi_curl (dofs_per_cell);
 
     typename DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     for (; cell!=endc; ++cell)
       {
         fe_values.reinit (cell);
@@ -220,7 +220,7 @@ void test ()
                   {
                     local_matrix(i,j) += (phi_curl[i] * phi_curl[j] *
                                           global_coefficient)
-                      * fe_values.JxW(q);
+                                         * fe_values.JxW(q);
                   }
               }
           }
@@ -235,7 +235,7 @@ void test ()
       }
   }
 
-                                // first system_rhs with random numbers
+  // first system_rhs with random numbers
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<system_rhs.block(i).size(); ++j)
       {
@@ -244,7 +244,7 @@ void test ()
       }
   constraints.condense(system_rhs);
 
-                                // setup matrix-free structure
+  // setup matrix-free structure
   {
     QGauss<1> quad(fe_degree+1);
     mf_data.reinit (dof_handler_sca, constraints, quad,
@@ -258,7 +258,7 @@ void test ()
   MatrixFreeTest<dim,fe_degree,BlockVector<double> > mf (mf_data);
   mf.vmult (mf_solution, system_rhs);
 
-                                // Verification
+  // Verification
   mf_solution -= solution;
   const double error = mf_solution.linfty_norm();
   const double relative = solution.linfty_norm();
index 78eb66a74e7f1358a634f7977ea208bc902d7de6..d52e114535912076815d006bf0c6c9271a231fb7 100644 (file)
@@ -58,7 +58,7 @@ const double global_coefficient = 0.1;
 template <int dim, int degree, typename VectorType>
 class MatrixFreeTest
 {
- public:
+public:
   typedef typename DoFHandler<dim>::active_cell_iterator CellIterator;
   typedef double Number;
 
@@ -76,7 +76,7 @@ class MatrixFreeTest
     FEEvaluation<dim,degree,degree+1,dim,Number> phi (data);
     vector_t coeff = make_vectorized_array(global_coefficient);
 
-    for(unsigned int cell=cell_range.first;cell<cell_range.second;++cell)
+    for (unsigned int cell=cell_range.first; cell<cell_range.second; ++cell)
       {
         phi.reinit (cell);
         phi.read_dof_values (src);
@@ -113,12 +113,12 @@ void test ()
   create_mesh (tria);
   tria.refine_global(4-dim);
 
-                                // refine a few cells
+  // refine a few cells
   for (unsigned int i=0; i<10-3*dim; ++i)
     {
       typename Triangulation<dim>::active_cell_iterator
-        cell = tria.begin_active (),
-        endc = tria.end();
+      cell = tria.begin_active (),
+      endc = tria.end();
       unsigned int counter = 0;
       for (; cell!=endc; ++cell, ++counter)
         if (counter % (7-i) == 0)
@@ -182,7 +182,7 @@ void test ()
       vec2[i].reinit (vec1[0]);
     }
 
-                                // assemble curl-curl operator
+  // assemble curl-curl operator
   {
     QGauss<dim>   quadrature_formula(fe_degree+1);
 
@@ -203,8 +203,8 @@ void test ()
     std::vector<double> phi_div (dofs_per_cell);
 
     typename DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     for (; cell!=endc; ++cell)
       {
         fe_values.reinit (cell);
@@ -224,7 +224,7 @@ void test ()
                   {
                     local_matrix(i,j) += (phi_div[i] * phi_div[j] *
                                           global_coefficient)
-                      * fe_values.JxW(q);
+                                         * fe_values.JxW(q);
                   }
               }
           }
@@ -239,7 +239,7 @@ void test ()
       }
   }
 
-                                // first system_rhs with random numbers
+  // first system_rhs with random numbers
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<system_rhs.block(i).size(); ++j)
       {
@@ -250,7 +250,7 @@ void test ()
   for (unsigned int i=0; i<dim; ++i)
     vec1[i] = system_rhs.block(i);
 
-                                // setup matrix-free structure
+  // setup matrix-free structure
   {
     QGauss<1> quad(fe_degree+1);
     mf_data.reinit (dof_handler_sca, constraints, quad,
@@ -265,7 +265,7 @@ void test ()
   MatrixFreeTest<dim,fe_degree,VectorType> mf (mf_data);
   mf.vmult (vec2, vec1);
 
-                                // Verification
+  // Verification
   double error = 0.;
   for (unsigned int i=0; i<dim; ++i)
     for (unsigned int j=0; j<system_rhs.block(i).size(); ++j)
index c3f92512c9c2d5ba2d9f26bee210e8b018261cca..c5f48154f8ac39f2d8563b9654eb3a5de5d3c83f 100644 (file)
@@ -35,8 +35,8 @@ void test ()
   Triangulation<dim> tria;
   create_mesh (tria);
   typename Triangulation<dim>::active_cell_iterator
-    cell = tria.begin_active (),
-    endc = tria.end();
+  cell = tria.begin_active (),
+  endc = tria.end();
   for (; cell!=endc; ++cell)
     if (cell->center().norm()<1e-8)
       cell->set_refine_flag();
index 666800b12fde8716670fc9dacb6a39efc8b8c30c..ff8b43fa5106c3df3b2894adaf150b5bb52fdb5f 100644 (file)
@@ -35,7 +35,7 @@ std::ofstream logfile("matrix_vector_hp/output");
 template <int dim, typename Number>
 class MatrixFreeTestHP
 {
- public:
+public:
   MatrixFreeTestHP(const MatrixFree<dim,Number> &data_in):
     data (data_in)
   {};
@@ -103,12 +103,12 @@ void test ()
   tria.set_boundary (0, boundary);
   tria.refine_global(1);
 
-                                // refine a few cells
+  // refine a few cells
   for (unsigned int i=0; i<11-3*dim; ++i)
     {
       typename Triangulation<dim>::active_cell_iterator
-        cell = tria.begin_active (),
-        endc = tria.end();
+      cell = tria.begin_active (),
+      endc = tria.end();
       unsigned int counter = 0;
       for (; cell!=endc; ++cell, ++counter)
         if (counter % (7-i) == 0)
@@ -130,11 +130,11 @@ void test ()
     }
 
   hp::DoFHandler<dim> dof(tria);
-                                // set the active FE index in a random order
+  // set the active FE index in a random order
   {
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = dof.begin_active(),
-      endc = dof.end();
+    cell = dof.begin_active(),
+    endc = dof.end();
     for (; cell!=endc; ++cell)
       {
         const unsigned int fe_index = rand() % max_degree;
@@ -142,7 +142,7 @@ void test ()
       }
   }
 
-                                // setup DoFs
+  // setup DoFs
   dof.distribute_dofs(fe_collection);
   ConstraintMatrix constraints;
   DoFTools::make_hanging_node_constraints (dof,
@@ -163,7 +163,7 @@ void test ()
   //std::cout << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
   //std::cout << "Number of constraints: " << constraints.n_constraints() << std::endl;
 
-                                // set up MatrixFree
+  // set up MatrixFree
   MatrixFree<dim,number> mf_data;
   typename MatrixFree<dim,number>::AdditionalData data;
   data.tasks_parallel_scheme =
@@ -171,8 +171,8 @@ void test ()
   mf_data.reinit (dof, constraints, quadrature_collection_mf, data);
   MatrixFreeTestHP<dim,number> mf (mf_data);
 
-                                // assemble sparse matrix with (\nabla v,
-                                // \nabla u) + (v, 10 * u)
+  // assemble sparse matrix with (\nabla v,
+  // \nabla u) + (v, 10 * u)
   {
     hp::FEValues<dim> hp_fe_values (fe_collection,
                                     quadrature_collection,
@@ -182,8 +182,8 @@ void test ()
     std::vector<types::global_dof_index> local_dof_indices;
 
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = dof.begin_active(),
-      endc = dof.end();
+    cell = dof.begin_active(),
+    endc = dof.end();
     for (; cell!=endc; ++cell)
       {
         const unsigned int   dofs_per_cell = cell->get_fe().dofs_per_cell;
@@ -214,8 +214,8 @@ void test ()
       }
   }
 
-                                // fill a right hand side vector with random
-                                // numbers in unconstrained degrees of freedom
+  // fill a right hand side vector with random
+  // numbers in unconstrained degrees of freedom
   Vector<double> src (dof.n_dofs());
   Vector<double> result_spmv(src), result_mf (src);
 
@@ -225,8 +225,8 @@ void test ()
         src(i) = (double)rand()/RAND_MAX;
     }
 
-                                // now perform matrix-vector product and check
-                                // its correctness
+  // now perform matrix-vector product and check
+  // its correctness
   system_matrix.vmult (result_spmv, src);
   mf.vmult (result_mf, src);
 
index a8c504150bf7530ba9b5845e40b4a47a4bda2ba8..deb7009e24856528340a75e9e75e184fc1da2700 100644 (file)
@@ -43,7 +43,7 @@ void test ()
 
   FE_Q<dim> fe (fe_degree);
 
-                                // setup DoFs
+  // setup DoFs
   DoFHandler<dim> dof(tria);
   dof.distribute_dofs(fe);
   dof.distribute_mg_dofs(fe);
@@ -57,7 +57,7 @@ void test ()
   //std::cout << "Number of cells: " << dof.get_tria().n_active_cells() << std::endl;
   //std::cout << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
 
-                                // set up MatrixFree
+  // set up MatrixFree
   QGauss<1> quad (fe_degree+1);
   MatrixFree<dim> mf_data;
   mf_data.reinit (dof, constraints, quad);
@@ -71,7 +71,7 @@ void test ()
   }
   system_matrix.reinit (sparsity);
 
-                                // setup MG levels
+  // setup MG levels
   const unsigned int nlevels = tria.n_levels();
   typedef MatrixFree<dim> MatrixFreeTestType;
   MGLevelObject<MatrixFreeTestType>    mg_matrices;
@@ -88,7 +88,7 @@ void test ()
   dirichlet_boundary[0] = &homogeneous_dirichlet_bc;
   std::vector<std::set<types::global_dof_index> > boundary_indices(nlevels);
   MGTools::make_boundary_list (dof, dirichlet_boundary, boundary_indices);
-  for (unsigned int level=0;level<nlevels;++level)
+  for (unsigned int level=0; level<nlevels; ++level)
     {
       std::set<types::global_dof_index>::iterator bc_it = boundary_indices[level].begin();
       for ( ; bc_it != boundary_indices[level].end(); ++bc_it)
@@ -105,9 +105,9 @@ void test ()
       mg_ref_matrices[level].reinit (mg_sparsities[level]);
     }
 
-                                // assemble sparse matrix with (\nabla v,
-                                // \nabla u) + (v, 10 * u) on the actual
-                                // discretization and on all levels
+  // assemble sparse matrix with (\nabla v,
+  // \nabla u) + (v, 10 * u) on the actual
+  // discretization and on all levels
   {
     QGauss<dim> quad (fe_degree+1);
     FEValues<dim> fe_values (fe, quad,
@@ -119,8 +119,8 @@ void test ()
     std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     typename DoFHandler<dim>::active_cell_iterator
-      cell = dof.begin_active(),
-      endc = dof.end();
+    cell = dof.begin_active(),
+    endc = dof.end();
     for (; cell!=endc; ++cell)
       {
         cell_matrix = 0;
@@ -144,8 +144,8 @@ void test ()
 
     // now to the MG assembly
     typename DoFHandler<dim>::cell_iterator
-      cellm = dof.begin(),
-      endcm = dof.end();
+    cellm = dof.begin(),
+    endcm = dof.end();
     for (; cellm!=endcm; ++cellm)
       {
         cell_matrix = 0;
@@ -163,14 +163,14 @@ void test ()
             }
         cellm->get_mg_dof_indices (local_dof_indices);
         mg_constraints[cellm->level()]
-          .distribute_local_to_global (cell_matrix,
-                                       local_dof_indices,
-                                       mg_ref_matrices[cellm->level()]);
+        .distribute_local_to_global (cell_matrix,
+                                     local_dof_indices,
+                                     mg_ref_matrices[cellm->level()]);
       }
   }
 
-                                // fill a right hand side vector with random
-                                // numbers in unconstrained degrees of freedom
+  // fill a right hand side vector with random
+  // numbers in unconstrained degrees of freedom
   Vector<double> src (dof.n_dofs());
   Vector<double> result_spmv(src), result_mf (src);
 
@@ -180,8 +180,8 @@ void test ()
         src(i) = (double)rand()/RAND_MAX;
     }
 
-                                // now perform matrix-vector product and check
-                                // its correctness
+  // now perform matrix-vector product and check
+  // its correctness
   system_matrix.vmult (result_spmv, src);
   MatrixFreeTest<dim,fe_degree,double> mf (mf_data);
   mf.vmult (result_mf, src);
@@ -201,15 +201,15 @@ void test ()
             src(i) = (double)rand()/RAND_MAX;
         }
 
-                                // now perform matrix-vector product and check
-                                // its correctness
+      // now perform matrix-vector product and check
+      // its correctness
       mg_ref_matrices[level].vmult (result_spmv, src);
       MatrixFreeTest<dim,fe_degree,double> mf_lev (mg_matrices[level]);
       mf_lev.vmult (result_mf, src);
 
       result_mf -= result_spmv;
       const double diff_norm = result_mf.linfty_norm();
-      deallog << "Norm of difference MG level " << level  
+      deallog << "Norm of difference MG level " << level
               << ": " << diff_norm << std::endl;
     }
   deallog << std::endl;
index 1652530e14e95db71630e422622e0bb33459e674..2ae0057b7f1a75f121a02ec7aa212c928acb6ebb 100644 (file)
@@ -56,7 +56,7 @@ std::ofstream logfile("matrix_vector_stokes/output");
 template <int dim, int degree_p, typename VectorType>
 class MatrixFreeTest
 {
- public:
+public:
   typedef typename DoFHandler<dim>::active_cell_iterator CellIterator;
   typedef double Number;
 
@@ -74,7 +74,7 @@ class MatrixFreeTest
     FEEvaluation<dim,degree_p+1,degree_p+2,dim,Number> velocity (data, 0);
     FEEvaluation<dim,degree_p  ,degree_p+2,1,  Number> pressure (data, 1);
 
-    for(unsigned int cell=cell_range.first;cell<cell_range.second;++cell)
+    for (unsigned int cell=cell_range.first; cell<cell_range.second; ++cell)
       {
         velocity.reinit (cell);
         velocity.read_dof_values (src, 0);
@@ -91,7 +91,7 @@ class MatrixFreeTest
             vector_t div = -velocity.get_divergence(q);
             pressure.submit_value   (div, q);
 
-                               // subtract p * I
+            // subtract p * I
             for (unsigned int d=0; d<dim; ++d)
               sym_grad_u[d][d] -= pres;
 
@@ -202,7 +202,7 @@ void test ()
   vec1[dim].reinit (dofs_per_block[dim]);
   vec2[dim].reinit (vec1[dim]);
 
-                                // this is from step-22
+  // this is from step-22
   {
     QGauss<dim>   quadrature_formula(fe_degree+2);
 
@@ -226,8 +226,8 @@ void test ()
     std::vector<double>                  phi_p       (dofs_per_cell);
 
     typename DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     for (; cell!=endc; ++cell)
       {
         fe_values.reinit (cell);
@@ -249,7 +249,7 @@ void test ()
                     local_matrix(i,j) += (phi_grads_u[i] * phi_grads_u[j]
                                           - div_phi_u[i] * phi_p[j]
                                           - phi_p[i] * div_phi_u[j])
-                      * fe_values.JxW(q);
+                                         * fe_values.JxW(q);
                   }
               }
           }
@@ -264,7 +264,7 @@ void test ()
       }
   }
 
-                                // first system_rhs with random numbers
+  // first system_rhs with random numbers
   for (unsigned int i=0; i<dim+1; ++i)
     for (unsigned int j=0; j<system_rhs.block(i).size(); ++j)
       {
@@ -273,14 +273,14 @@ void test ()
         vec1[i](j) = val;
       }
 
-                                // setup matrix-free structure
+  // setup matrix-free structure
   {
     std::vector<const DoFHandler<dim>*> dofs;
     dofs.push_back(&dof_handler_u);
     dofs.push_back(&dof_handler_p);
     ConstraintMatrix dummy_constraints;
     dummy_constraints.close();
-    std::vector<const ConstraintMatrix*> constraints;
+    std::vector<const ConstraintMatrix *> constraints;
     constraints.push_back (&dummy_constraints);
     constraints.push_back (&dummy_constraints);
     QGauss<1> quad(fe_degree+2);
@@ -296,7 +296,7 @@ void test ()
   MatrixFreeTest<dim,fe_degree,VectorType> mf (mf_data);
   mf.vmult (vec2, vec1);
 
-                                // Verification
+  // Verification
   double error = 0.;
   for (unsigned int i=0; i<dim+1; ++i)
     for (unsigned int j=0; j<system_rhs.block(i).size(); ++j)
index 25f45adf40730cf1bbbf33f3b98a4f487dae7546..145ed7dc48192b48bd951225c4de8623d63992f4 100644 (file)
@@ -55,7 +55,7 @@ std::ofstream logfile("matrix_vector_stokes_noflux/output");
 template <int dim, int degree_p, typename VectorType>
 class MatrixFreeTest
 {
- public:
+public:
   typedef typename DoFHandler<dim>::active_cell_iterator CellIterator;
   typedef double Number;
 
@@ -73,7 +73,7 @@ class MatrixFreeTest
     FEEvaluation<dim,degree_p+1,degree_p+2,dim,Number> velocity (data, 0);
     FEEvaluation<dim,degree_p,  degree_p+2,1,  Number> pressure (data, 1);
 
-    for(unsigned int cell=cell_range.first;cell<cell_range.second;++cell)
+    for (unsigned int cell=cell_range.first; cell<cell_range.second; ++cell)
       {
         velocity.reinit (cell);
         velocity.read_dof_values (src.block(0));
@@ -90,7 +90,7 @@ class MatrixFreeTest
             vector_t div = -velocity.get_divergence(q);
             pressure.submit_value   (div, q);
 
-                               // subtract p * I
+            // subtract p * I
             for (unsigned int d=0; d<dim; ++d)
               sym_grad_u[d][d] -= pres;
 
@@ -208,7 +208,7 @@ void test ()
 
   system_matrix.reinit (sparsity_pattern);
 
-                                // this is from step-22
+  // this is from step-22
   {
     QGauss<dim>   quadrature_formula(fe_degree+2);
 
@@ -232,8 +232,8 @@ void test ()
     std::vector<double>                  phi_p       (dofs_per_cell);
 
     typename DoFHandler<dim>::active_cell_iterator
-      cell = dof_handler.begin_active(),
-      endc = dof_handler.end();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     for (; cell!=endc; ++cell)
       {
         fe_values.reinit (cell);
@@ -255,7 +255,7 @@ void test ()
                     local_matrix(i,j) += (phi_grads_u[i] * phi_grads_u[j]
                                           - div_phi_u[i] * phi_p[j]
                                           - phi_p[i] * div_phi_u[j])
-                      * fe_values.JxW(q);
+                                         * fe_values.JxW(q);
                   }
               }
           }
@@ -279,7 +279,7 @@ void test ()
   system_rhs.reinit (solution);
   mf_solution.reinit (solution);
 
-                                // fill system_rhs with random numbers
+  // fill system_rhs with random numbers
   for (unsigned int j=0; j<system_rhs.block(0).size(); ++j)
     if (constraints_u.is_constrained(j) == false)
       {
@@ -293,16 +293,16 @@ void test ()
         system_rhs.block(1)(j) = val;
       }
 
-                                // setup matrix-free structure
+  // setup matrix-free structure
   {
     std::vector<const DoFHandler<dim>*> dofs;
     dofs.push_back(&dof_handler_u);
     dofs.push_back(&dof_handler_p);
-    std::vector<const ConstraintMatrix*> constraints;
+    std::vector<const ConstraintMatrix *> constraints;
     constraints.push_back (&constraints_u);
     constraints.push_back (&constraints_p);
     QGauss<1> quad(fe_degree+2);
-                                // no parallelism
+    // no parallelism
     mf_data.reinit (mapping, dofs, constraints, quad,
                     typename MatrixFree<dim>::AdditionalData
                     (MPI_COMM_WORLD,
@@ -314,7 +314,7 @@ void test ()
   MatrixFreeTest<dim,fe_degree,BlockVector<double> > mf (mf_data);
   mf.vmult (mf_solution, system_rhs);
 
-                                // Verification
+  // Verification
   mf_solution -= solution;
   const double error = mf_solution.linfty_norm();
   const double relative = solution.linfty_norm();
index b085fcbf77a5ae62cebe6cb725c2dbc94f60f9aa..5cec8344df9f8b4e43763a66255908631437c987 100644 (file)
@@ -53,7 +53,7 @@ void test ();
 template <int dim, int fe_degree, int n_q_points_1d=fe_degree+1, typename Number=double>
 class MatrixFreeTest
 {
- public:
+public:
   bool read_vector;
 
   MatrixFreeTest(const MatrixFree<dim,Number> &data_in):
@@ -69,7 +69,7 @@ class MatrixFreeTest
   {
     FEEvaluation<dim,fe_degree,n_q_points_1d,1,Number> fe_eval (data);
 
-    for(unsigned int cell=cell_range.first;cell<cell_range.second;++cell)
+    for (unsigned int cell=cell_range.first; cell<cell_range.second; ++cell)
       {
         fe_eval.reinit (cell);
 
@@ -111,7 +111,7 @@ protected:
 
 template <int dim, int fe_degree, typename number>
 void do_test (const DoFHandler<dim> &dof,
-              const ConstraintMatrix&constraints)
+              const ConstraintMatrix &constraints)
 {
   // use this for info on problem
   //std::cout << "Number of cells: " << dof.get_tria().n_active_cells()
@@ -121,10 +121,10 @@ void do_test (const DoFHandler<dim> &dof,
 
   Vector<number> solution (dof.n_dofs());
 
-                                // create vector with random entries
+  // create vector with random entries
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
     {
-      if(constraints.is_constrained(i))
+      if (constraints.is_constrained(i))
         continue;
       const double entry = rand()/(double)RAND_MAX;
       solution(i) = entry;
@@ -176,7 +176,7 @@ void test ()
   GridGenerator::hyper_ball (tria);
   static const HyperBallBoundary<dim> boundary;
   tria.set_boundary (0, boundary);
-                                // refine first and last cell
+  // refine first and last cell
   tria.begin(tria.n_levels()-1)->set_refine_flag();
   tria.last()->set_refine_flag();
   tria.execute_coarsening_and_refinement();
index c3138057180343ccccce0685f33165ed6160e04f..18350033d2186285ba0fcdf00b8ba015b95a8b8d 100644 (file)
@@ -576,7 +576,7 @@ namespace Step37
 
     typedef PreconditionChebyshev<LevelMatrixType,Vector<double> > SMOOTHER;
     MGSmootherPrecondition<LevelMatrixType, SMOOTHER, Vector<double> >
-      mg_smoother;
+    mg_smoother;
 
     typename SMOOTHER::AdditionalData smoother_data;
     smoother_data.smoothing_range = 10.;
index ee20b126f3ad4ef3a8e40552db65fcf7dc408dda..d3dd5eedc87c64c6a1c1e44781493c193774765b 100644 (file)
@@ -36,8 +36,8 @@ void sub_test()
   tria.begin_active ()->set_refine_flag();
   tria.execute_coarsening_and_refinement();
   typename Triangulation<dim>::active_cell_iterator
-    cell = tria.begin_active (),
-    endc = tria.end();
+  cell = tria.begin_active (),
+  endc = tria.end();
   for (; cell!=endc; ++cell)
     if (cell->center().norm()<0.5)
       cell->set_refine_flag();
@@ -56,7 +56,7 @@ void sub_test()
   DoFHandler<dim> dof (tria);
   deallog << "Testing " << fe.get_name() << std::endl;
 
-                                // run test for several different meshes
+  // run test for several different meshes
   for (unsigned int i=0; i<8-2*dim; ++i)
     {
       cell = tria.begin_active ();
@@ -84,9 +84,9 @@ void sub_test()
         mf_data.reinit (dof, constraints, quad,
                         typename MatrixFree<dim,number>::AdditionalData(MPI_COMM_SELF,MatrixFree<dim,number>::AdditionalData::none));
 
-                                // choose block size of 3 which introduces
-                                // some irregularity to the blocks (stress the
-                                // non-overlapping computation harder)
+        // choose block size of 3 which introduces
+        // some irregularity to the blocks (stress the
+        // non-overlapping computation harder)
         mf_data_color.reinit (dof, constraints, quad,
                               typename MatrixFree<dim,number>::AdditionalData
                               (MPI_COMM_SELF,
@@ -104,11 +104,11 @@ void sub_test()
       MatrixFreeTest<dim,fe_degree,number> mf_partition (mf_data_partition);
       Vector<number> in_dist (dof.n_dofs());
       Vector<number> out_dist (in_dist), out_color (in_dist),
-        out_partition(in_dist);
+             out_partition(in_dist);
 
       for (unsigned int i=0; i<dof.n_dofs(); ++i)
         {
-          if(constraints.is_constrained(i))
+          if (constraints.is_constrained(i))
             continue;
           const double entry = rand()/(double)RAND_MAX;
           in_dist(i) = entry;
@@ -116,22 +116,22 @@ void sub_test()
 
       mf_ref.vmult (out_dist, in_dist);
 
-                                // make 10 sweeps in order to get in some
-                                // variation to the threaded program
+      // make 10 sweeps in order to get in some
+      // variation to the threaded program
       for (unsigned int sweep = 0; sweep < 10; ++sweep)
         {
           mf_color.vmult (out_color, in_dist);
           mf_partition.vmult (out_partition, in_dist);
-      
+
           out_color -= out_dist;
           double diff_norm = out_color.linfty_norm();
-          deallog << "Sweep " << sweep 
-                  << ", error in partition/color:     " << diff_norm 
+          deallog << "Sweep " << sweep
+                  << ", error in partition/color:     " << diff_norm
                   << std::endl;
           out_partition -= out_dist;
           diff_norm = out_partition.linfty_norm();
-          deallog << "Sweep " << sweep 
-                  << ", error in partition/partition: " << diff_norm 
+          deallog << "Sweep " << sweep
+                  << ", error in partition/partition: " << diff_norm
                   << std::endl;
         }
       deallog << std::endl;
index d5323565183a608c3f886cfad347a492a9baa144..e5ec29044d34b85854b9d67e4ad2732a2fdf70ac 100644 (file)
@@ -36,7 +36,7 @@ std::ofstream logfile("thread_correctness_hp/output");
 template <int dim, typename Number>
 class MatrixFreeTestHP
 {
- public:
+public:
   MatrixFreeTestHP(const MatrixFree<dim,Number> &data_in):
     data (data_in)
   {};
@@ -47,8 +47,8 @@ class MatrixFreeTestHP
                const Vector<Number> &src,
                const std::pair<unsigned int,unsigned int> &cell_range) const
   {
-                                // Ask MatrixFree for cell_range for different
-                                // orders
+    // Ask MatrixFree for cell_range for different
+    // orders
     std::pair<unsigned int,unsigned int> subrange_deg =
       data.create_cell_subrange_hp (cell_range, 1);
     if (subrange_deg.second > subrange_deg.first)
@@ -100,12 +100,12 @@ void do_test (const unsigned int parallel_option)
   create_mesh (tria);
   tria.refine_global(2);
 
-                                // refine a few cells
+  // refine a few cells
   for (unsigned int i=0; i<11-3*dim; ++i)
     {
       typename Triangulation<dim>::active_cell_iterator
-        cell = tria.begin_active (),
-        endc = tria.end();
+      cell = tria.begin_active (),
+      endc = tria.end();
       for (; cell!=endc; ++cell)
         if (rand() % (7-i) == 0)
           cell->set_refine_flag();
@@ -124,11 +124,11 @@ void do_test (const unsigned int parallel_option)
     }
 
   hp::DoFHandler<dim> dof(tria);
-                                // set the active FE index in a random order
+  // set the active FE index in a random order
   {
     typename hp::DoFHandler<dim>::active_cell_iterator
-      cell = dof.begin_active(),
-      endc = dof.end();
+    cell = dof.begin_active(),
+    endc = dof.end();
     for (; cell!=endc; ++cell)
       {
         const unsigned int fe_index = rand() % max_degree;
@@ -136,7 +136,7 @@ void do_test (const unsigned int parallel_option)
       }
   }
 
-                                // setup DoFs
+  // setup DoFs
   dof.distribute_dofs(fe_collection);
   ConstraintMatrix constraints;
   DoFTools::make_hanging_node_constraints (dof,
@@ -151,7 +151,7 @@ void do_test (const unsigned int parallel_option)
   //std::cout << "Number of degrees of freedom: " << dof.n_dofs() << std::endl;
   //std::cout << "Number of constraints: " << constraints.n_constraints() << std::endl;
 
-                                // set up reference MatrixFree
+  // set up reference MatrixFree
   MatrixFree<dim,number> mf_data;
   typename MatrixFree<dim,number>::AdditionalData data;
   data.tasks_parallel_scheme =
@@ -159,8 +159,8 @@ void do_test (const unsigned int parallel_option)
   mf_data.reinit (dof, constraints, quadrature_collection_mf, data);
   MatrixFreeTestHP<dim,number> mf (mf_data);
 
-                                // test different block sizes, starting from
-                                // auto setting (= 0)
+  // test different block sizes, starting from
+  // auto setting (= 0)
   for (unsigned int block_size = 0; block_size < 5; ++block_size)
     {
       deallog.push ("blk_" + Utilities::int_to_string(block_size,1));
@@ -181,8 +181,8 @@ void do_test (const unsigned int parallel_option)
       mf_data_par.reinit (dof, constraints, quadrature_collection_mf, data);
       MatrixFreeTestHP<dim,number> mf_par(mf_data_par);
 
-                                // fill a right hand side vector with random
-                                // numbers in unconstrained degrees of freedom
+      // fill a right hand side vector with random
+      // numbers in unconstrained degrees of freedom
       Vector<number> src (dof.n_dofs());
       Vector<number> result_ref(src), result_mf (src);
 
@@ -192,10 +192,10 @@ void do_test (const unsigned int parallel_option)
             src(i) = (double)rand()/RAND_MAX;
         }
 
-                                // now perform 30 matrix-vector products in
-                                // parallel and check their correctness (take
-                                // many of them to make sure that we hit an
-                                // error)
+      // now perform 30 matrix-vector products in
+      // parallel and check their correctness (take
+      // many of them to make sure that we hit an
+      // error)
       mf.vmult (result_ref, src);
       deallog << "Norm of difference: ";
       for (unsigned int i=0; i<50; ++i)
@@ -214,8 +214,8 @@ void do_test (const unsigned int parallel_option)
 template <int dim, int fe_degree>
 void test ()
 {
-                                // 'misuse' fe_degree for setting the parallel
-                                // option here
+  // 'misuse' fe_degree for setting the parallel
+  // option here
   unsigned int parallel_option = 0;
   if (fe_degree == 1)
     parallel_option = 0;
index 4568a0267139c34a6cf46096fb5426523aae6db5..3ec881dd019232c0a2566d2f6ef4128f44a3055a 100644 (file)
@@ -53,10 +53,10 @@ void test ()
 
   Vector<double> solution (dof.n_dofs());
 
-                                // create vector with random entries
+  // create vector with random entries
   for (unsigned int i=0; i<dof.n_dofs(); ++i)
     {
-      if(constraints.is_constrained(i))
+      if (constraints.is_constrained(i))
         continue;
       const double entry = rand()/(double)RAND_MAX;
       solution(i) = entry;
@@ -78,7 +78,7 @@ void test ()
           shift(1) = -0.005;
         }
       MappingQEulerian<dim> mapping(2,shift,dofh_eulerian);
-      
+
       {
         const QGauss<1> quad (fe_degree+1);
         typename MatrixFree<dim,double>::AdditionalData data;
@@ -88,7 +88,7 @@ void test ()
           data.initialize_indices = false;
         mf_data.reinit (mapping, dof, constraints, quad, data);
       }
-      
+
       MatrixFreeTest<dim,fe_degree,fe_degree+1> mf (mf_data, mapping);
       mf.test_functions(solution);
     }
index 4c53594c27ad15a7afbd733d59b910d8e5dd760e..df99f4a6f89fb1c1812dc569ae5bde7f4d066b0c 100644 (file)
@@ -35,22 +35,22 @@ void test ()
   GridGenerator::hyper_cube (triangulation);
   triangulation.refine_global (5-dim);
 
-                                   // subdivide into 5 subdomains
+  // subdivide into 5 subdomains
   deallog << "RECURSIVE" << std::endl;
   GridTools::partition_triangulation (5, triangulation);
   for (typename Triangulation<dim>::active_cell_iterator
-         cell = triangulation.begin_active();
+       cell = triangulation.begin_active();
        cell != triangulation.end(); ++cell)
     deallog << cell << ' ' << cell->subdomain_id() << std::endl;
 
-                                   // subdivide into 9 subdomains. note that
-                                   // this uses the k-way subdivision (for
-                                   // more than 8 subdomains) rather than the
-                                   // recursive one
+  // subdivide into 9 subdomains. note that
+  // this uses the k-way subdivision (for
+  // more than 8 subdomains) rather than the
+  // recursive one
   deallog << "K-WAY" << std::endl;
   GridTools::partition_triangulation (9, triangulation);
   for (typename Triangulation<dim>::active_cell_iterator
-         cell = triangulation.begin_active();
+       cell = triangulation.begin_active();
        cell != triangulation.end(); ++cell)
     deallog << cell << ' ' << cell->subdomain_id() << std::endl;
 }
@@ -73,25 +73,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index e276e5347dc76da387a01a8406098cd20978c27e..6ebdde90c25fab75015f9a432377fd8842a6108c 100644 (file)
@@ -40,34 +40,34 @@ template <int dim>
 void test ()
 {
   deallog << dim << "D" << std::endl;
-  
+
   Triangulation<dim> triangulation;
   GridGenerator::hyper_cube (triangulation);
   triangulation.refine_global (4-dim);
   for (unsigned int i=0; i<11-2*dim; ++i)
     {
       typename Triangulation<dim>::active_cell_iterator
-        cell = triangulation.begin_active();
+      cell = triangulation.begin_active();
       for (unsigned int index=0; cell != triangulation.end(); ++cell, ++index)
         if (index % (3*dim) == 0)
           cell->set_refine_flag();
       triangulation.execute_coarsening_and_refinement ();
     }
-  
 
-                                   // subdivide into 5 subdomains
+
+  // subdivide into 5 subdomains
   GridTools::partition_triangulation (5, triangulation);
 
-                                   // generate a field where the value equals
-                                   // the subdomain number, and output it
+  // generate a field where the value equals
+  // the subdomain number, and output it
   FE_Q<dim> fe(2);
   DoFHandler<dim> dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
-  
+
   Vector<double> partitions (triangulation.n_active_cells());
   {
     typename Triangulation<dim>::active_cell_iterator
-      cell = triangulation.begin_active();
+    cell = triangulation.begin_active();
     for (unsigned int index=0; cell != triangulation.end(); ++cell, ++index)
       partitions(index) = cell->subdomain_id();
   }
@@ -78,11 +78,11 @@ void test ()
   deallog << "Cell association:" << std::endl;
   for (unsigned int i=0; i<partitions.size(); ++i)
     deallog << i << ' ' << partitions(i) << std::endl;
-  
+
   deallog << "DoF association:" << std::endl;
   for (unsigned int i=0; i<assoc.size(); ++i)
     deallog << i << ' ' << assoc[i] << std::endl;
-  
+
 }
 
 
@@ -103,25 +103,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 514bcdb3a5fb493480952caf90697629c1e3cf3e..2239ba6a499800ae94fd93bda1743a3b1c908ab9 100644 (file)
@@ -40,34 +40,34 @@ template <int dim>
 void test ()
 {
   deallog << "Dimension = " << dim << std::endl;
-  
+
   Triangulation<dim> triangulation;
   GridGenerator::hyper_cube (triangulation);
   triangulation.refine_global (4-dim);
   for (unsigned int i=0; i<11-2*dim; ++i)
     {
       typename Triangulation<dim>::active_cell_iterator
-        cell = triangulation.begin_active();
+      cell = triangulation.begin_active();
       for (unsigned int index=0; cell != triangulation.end(); ++cell, ++index)
         if (index % (3*dim) == 0)
           cell->set_refine_flag();
       triangulation.execute_coarsening_and_refinement ();
     }
-  
 
-                                   // subdivide into 5 subdomains
+
+  // subdivide into 5 subdomains
   GridTools::partition_triangulation (5, triangulation);
 
-                                   // generate a field where the value equals
-                                   // the subdomain number, and output it
+  // generate a field where the value equals
+  // the subdomain number, and output it
   FE_DGQ<dim> fe(0);
   DoFHandler<dim> dof_handler (triangulation);
   dof_handler.distribute_dofs (fe);
-  
+
   Vector<double> partitions (triangulation.n_active_cells());
   {
     typename Triangulation<dim>::active_cell_iterator
-      cell = triangulation.begin_active();
+    cell = triangulation.begin_active();
     for (unsigned int index=0; cell != triangulation.end(); ++cell, ++index)
       partitions(index) = cell->subdomain_id();
   }
@@ -98,25 +98,25 @@ int main ()
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 869012b05e9250d7eb77582874157c1d457d657c..a764e0efef9cfc373ddbcc9944120da2e590c77f 100644 (file)
@@ -34,13 +34,13 @@ void test ()
 {
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
   unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
-  
+
   if (myid==0)
     deallog << "numproc=" << numproc << std::endl;
 
   std::vector<IndexSet> local_active(2);
 
-                                  // block 0:
+  // block 0:
   local_active[0].set_size(numproc);
   local_active[0].add_range(myid,myid+1);
 
@@ -56,15 +56,15 @@ void test ()
 
   v.compress(VectorOperation::insert);
 
-                                  //Assert(!v.has_ghost_elements(), ExcInternalError());
+  //Assert(!v.has_ghost_elements(), ExcInternalError());
 
   deallog << "size: " << v.size() << std::endl;
   deallog << "size[0]: " << v.block(0).size() << std::endl;
-  deallog << "size[1]: " << v.block(1).size() << std::endl;  
-  
+  deallog << "size[1]: " << v.block(1).size() << std::endl;
+
   {
     std::ofstream file((JobIdentifier::base_name(__FILE__)+"/ncpu_" + Utilities::int_to_string(Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(myid)).c_str());
-    
+
     file << "**** proc " << myid << std::endl;
     v.print(file);
   }
@@ -73,27 +73,27 @@ void test ()
 
   if (myid==0)
     {
-      for (unsigned int i=0;i<Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);++i)
+      for (unsigned int i=0; i<Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); ++i)
         {
           cat_file((JobIdentifier::base_name(__FILE__)+"/ncpu_" + Utilities::int_to_string(Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(i)).c_str());
         }
-    } 
+    }
 
-                                  // now test the constructor
+  // now test the constructor
 
   IndexSet id(7);
   if (myid==0)
     id.add_range(0,7);
   local_active.push_back(id);
-  
+
   BLOCKVEC xy(local_active);
-  
+
   deallog << "size: " << xy.size() << std::endl;
   deallog << "size[0]: " << xy.block(0).size() << std::endl;
-  deallog << "size[1]: " << xy.block(1).size() << std::endl;  
+  deallog << "size[1]: " << xy.block(1).size() << std::endl;
   deallog << "size[2]: " << xy.block(2).size() << std::endl;
-  
-                                  // done
+
+  // done
   if (myid==0)
     deallog << "OK" << std::endl;
 }
@@ -116,12 +116,12 @@ int main (int argc, char **argv)
       deallog.threshold_double(1.e-10);
 
       test<PETScWrappers::MPI::BlockVector>();
-                                      //test<TrilinosWrappers::MPI::BlockVector>();
+      //test<TrilinosWrappers::MPI::BlockVector>();
     }
   else
     {
       test<PETScWrappers::MPI::BlockVector>();
-                                      //test<TrilinosWrappers::MPI::BlockVector>();
+      //test<TrilinosWrappers::MPI::BlockVector>();
     }
-  
+
 }
index fffee6e19d60fe48df3f40766f0ea1b7e7e56f5e..3c9ea2e5f527d6c2a24d5f9c4c6c5dd98392a7e1 100644 (file)
 
 // given the name of a file, copy it to deallog
 // and then delete it
-void cat_file(const char * filename)
+void cat_file(const char *filename)
 {
   std::ifstream in(filename);
   Assert (in, ExcIO());
-  
+
   while (in)
     {
       std::string s;
@@ -38,19 +38,19 @@ void cat_file(const char * filename)
       deallog.get_file_stream() << s << "\n";
     }
   in.close();
-  
+
   std::remove (filename);
 }
 
 
 template <int dim>
 void write_vtk (const parallel::distributed::Triangulation<dim> &tria,
-               const char *                               dirname,
-               const char *                               filename)
+                const char                                *dirname,
+                const char                                *filename)
 {
   deallog << "Checksum: "
-         << tria.get_checksum ()
-         << std::endl;
+          << tria.get_checksum ()
+          << std::endl;
 
   chdir (dirname);
   tria.write_mesh_vtk (filename);
@@ -61,29 +61,29 @@ void write_vtk (const parallel::distributed::Triangulation<dim> &tria,
       int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
 
 
-                                      // copy the .pvtu and .vtu files
-                                      // into the logstream
+      // copy the .pvtu and .vtu files
+      // into the logstream
       if (myid==0)
-       {
-         std::ifstream in((std::string(filename) + ".pvtu").c_str());
-         while (in)
-           {
-             std::string s;
-             std::getline(in, s);
-             deallog.get_file_stream() << s << "\n";
-           }
-       }
+        {
+          std::ifstream in((std::string(filename) + ".pvtu").c_str());
+          while (in)
+            {
+              std::string s;
+              std::getline(in, s);
+              deallog.get_file_stream() << s << "\n";
+            }
+        }
 
       if (myid==0)
-       {
-         std::ifstream in((std::string(filename) + "_0000.vtu").c_str());
-         while (in)
-           {
-             std::string s;
-             std::getline(in, s);
-             deallog.get_file_stream() << s << "\n";
-           }
-       }
+        {
+          std::ifstream in((std::string(filename) + "_0000.vtu").c_str());
+          while (in)
+            {
+              std::string s;
+              std::getline(in, s);
+              deallog.get_file_stream() << s << "\n";
+            }
+        }
     }
 
 
@@ -92,10 +92,10 @@ void write_vtk (const parallel::distributed::Triangulation<dim> &tria,
 
 
 template <int dim>
-void assert_tria_equal(const char* testdir, const Triangulation<dim> & a, const Triangulation<dim> & b)
+void assert_tria_equal(const char *testdir, const Triangulation<dim> &a, const Triangulation<dim> &b)
 {
   Assert (a.n_active_cells() == b.n_active_cells(),
-             ExcInternalError());
+          ExcInternalError());
 
   std::string file1=std::string(testdir)+"/tmp_grid1";
   std::string file2=std::string(testdir)+"/tmp_grid2";
@@ -108,11 +108,11 @@ void assert_tria_equal(const char* testdir, const Triangulation<dim> & a, const
   out1.close();
   out2.close();
 
-                                  //compare the two files
+  //compare the two files
   std::string cmd = std::string("diff -q ")+file1+std::string(" ")+file2;
   Assert (system(cmd.c_str()) == 0, ExcInternalError());
 
-                                  //and delete them
+  //and delete them
   std::remove (file1.c_str());
   std::remove (file2.c_str());
 }
@@ -121,7 +121,7 @@ void assert_tria_equal(const char* testdir, const Triangulation<dim> & a, const
 template <typename T>
 LogStream &
 operator << (LogStream &out,
-            const std::vector<T> &v)
+             const std::vector<T> &v)
 {
   for (unsigned int i=0; i<v.size(); ++i)
     out << v[i] << (i == v.size()-1 ? "" : " ");
index 463b6fd624b743e97a94dd116c5dcc498ad0466c..e6c7d8c11677c992dd28492a6c69bf9dab13b0f3 100644 (file)
 #include <deal.II/base/utilities.h>
 #include <fstream>
 
-void print_it(Utilities::MPI::MinMaxAvg & result)
+void print_it(Utilities::MPI::MinMaxAvg &result)
 {
   deallog << "sum: " << result.sum
-         << " avg: " << result.avg
-         << " min: " << result.min << " @" << result.min_index
-         << " max: " << result.max << " @" << result.max_index
-         << std::endl;
+          << " avg: " << result.avg
+          << " min: " << result.min << " @" << result.min_index
+          << " max: " << result.max << " @" << result.max_index
+          << std::endl;
 }
 
 void test()
index 86036972d9c90e70f14ad687ba8e6a70ad9a6645..7e6807e0c86b863346ab3a0aeed6adae17d2321f 100644 (file)
@@ -35,20 +35,20 @@ void test()
 
   int_sum
     =
-    Utilities::MPI::sum<int>(myid+1,
-                            MPI_COMM_WORLD);
+      Utilities::MPI::sum<int>(myid+1,
+                               MPI_COMM_WORLD);
   uint_sum
     =
-    Utilities::MPI::sum<unsigned int>(myid+1,
-                                     MPI_COMM_WORLD);
+      Utilities::MPI::sum<unsigned int>(myid+1,
+                                        MPI_COMM_WORLD);
   float_sum
     =
-    Utilities::MPI::sum<float>(myid+1,
-                              MPI_COMM_WORLD);
+      Utilities::MPI::sum<float>(myid+1,
+                                 MPI_COMM_WORLD);
   double_sum
     =
-    Utilities::MPI::sum<double>(myid+1,
-                               MPI_COMM_WORLD);
+      Utilities::MPI::sum<double>(myid+1,
+                                  MPI_COMM_WORLD);
 
   if (myid==0)
     deallog << int_sum << ' ' << uint_sum << ' ' << double_sum << ' ' << float_sum << std::endl;
index 42f6a10c3c36c58486f434536c552555e891cf3e..29c864e5910a17058812fc749a7e157b6acd2cd8 100644 (file)
@@ -31,8 +31,8 @@ void test()
   unsigned int values[2] = { 1, 2 };
   unsigned int sums[2];
   Utilities::MPI::sum (values,
-                      MPI_COMM_WORLD,
-                      sums);
+                       MPI_COMM_WORLD,
+                       sums);
   Assert (sums[0] == numprocs, ExcInternalError());
   Assert (sums[1] == 2*numprocs, ExcInternalError());
 
index bafc3f98a9a503b7220d538af02cc17baa4e9f82..5234930097b6ffad8f94f43545cd325f2c4e2a4b 100644 (file)
@@ -35,20 +35,20 @@ void test()
 
   int_sum
     =
-    Utilities::MPI::max<int>(myid+1,
-                            MPI_COMM_WORLD);
+      Utilities::MPI::max<int>(myid+1,
+                               MPI_COMM_WORLD);
   uint_sum
     =
-    Utilities::MPI::max<unsigned int>(myid+1,
-                                     MPI_COMM_WORLD);
+      Utilities::MPI::max<unsigned int>(myid+1,
+                                        MPI_COMM_WORLD);
   float_sum
     =
-    Utilities::MPI::max<float>(myid+1,
-                              MPI_COMM_WORLD);
+      Utilities::MPI::max<float>(myid+1,
+                                 MPI_COMM_WORLD);
   double_sum
     =
-    Utilities::MPI::max<double>(myid+1,
-                               MPI_COMM_WORLD);
+      Utilities::MPI::max<double>(myid+1,
+                                  MPI_COMM_WORLD);
 
   if (myid==0)
     deallog << int_sum << ' ' << uint_sum << ' ' << double_sum << ' ' << float_sum << std::endl;
index 25883d4bcfab10c442b7cfa824bd3364a5078b8b..5020043760356a3a4fb5c1ad163af6c61f8f579e 100644 (file)
@@ -31,8 +31,8 @@ void test()
   unsigned int values[2] = { 1, 2 };
   unsigned int maxima[2];
   Utilities::MPI::max (values,
-                      MPI_COMM_WORLD,
-                      maxima);
+                       MPI_COMM_WORLD,
+                       maxima);
   Assert (maxima[0] == 1, ExcInternalError());
   Assert (maxima[1] == 2, ExcInternalError());
 
index a4ad03701d454f94c9916bbe9052f8d61986da4b..255c3a684ee253e1d4094dd83244f9357f022adc 100644 (file)
 
 
 template <int dim>
-class LinearFunction : public Function<dim> 
+class LinearFunction : public Function<dim>
 {
-  public:
-    double value (const Point<dim> &p,
-                 const unsigned int) const
-      {
-       return p[0] + 2;
-      }
+public:
+  double value (const Point<dim> &p,
+                const unsigned int) const
+  {
+    return p[0] + 2;
+  }
 };
 
 
@@ -69,11 +69,11 @@ void test()
   dofh.distribute_dofs (fe);
 
   TrilinosWrappers::MPI::Vector interpolated(dofh.locally_owned_dofs(),
-                                            MPI_COMM_WORLD);
+                                             MPI_COMM_WORLD);
   VectorTools::interpolate (dofh,
-                           LinearFunction<dim>(),
-                           interpolated);
-  
+                            LinearFunction<dim>(),
+                            interpolated);
+
   IndexSet relevant_set;
   DoFTools::extract_locally_relevant_dofs (dofh, relevant_set);
   TrilinosWrappers::MPI::Vector x_rel(relevant_set, MPI_COMM_WORLD);
@@ -84,8 +84,8 @@ void test()
 
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     deallog << "mean=" << mean
-           << std::endl;
-  
+            << std::endl;
+
   Assert (std::fabs(mean - 2) < 1e-3, ExcInternalError());
 }
 
index 6512929ef71d23caf2dfc23f0219ce46fa70ef63..3f7d52aae146ec63eb352fbef70f26166b01ec68 100644 (file)
@@ -57,18 +57,18 @@ void test ()
   {
     IndexSet boundary_dofs (dof_handler.n_dofs());
     DoFTools::extract_boundary_dofs
-      (dof_handler, std::vector<bool>(1,true),boundary_dofs);
+    (dof_handler, std::vector<bool>(1,true),boundary_dofs);
 
     unsigned int first_nboundary_dof = 0;
-    while(boundary_dofs.is_element(first_nboundary_dof))
+    while (boundary_dofs.is_element(first_nboundary_dof))
       first_nboundary_dof++;
 
     if (locally_relevant_dofs.is_element(first_nboundary_dof))
       {
-       constraints.add_line (first_nboundary_dof);
-       for (unsigned int i=0; i<dof_handler.n_dofs();++i)
-         if (boundary_dofs.is_element(i) == true)
-           constraints.add_entry (first_nboundary_dof, i, -1);
+        constraints.add_line (first_nboundary_dof);
+        for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
+          if (boundary_dofs.is_element(i) == true)
+            constraints.add_entry (first_nboundary_dof, i, -1);
       }
   }
   constraints.close();
@@ -98,6 +98,6 @@ int main(int argc, char *argv[])
   else
     test();
 
-  
+
   return 0;
 }
index d714f2067c3cd79be9f2643097904c9011c981dd..0d609bba582698d2683fa27d21d5783a7383bea2 100644 (file)
@@ -35,7 +35,7 @@ void test ()
 {
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
   unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
+
   std::vector<IndexSet> local_active(2);
 
   // block 0:
@@ -48,27 +48,27 @@ void test ()
 
   PETScWrappers::MPI::BlockVector v(local_active, MPI_COMM_WORLD);
 
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     v(i)=1.0+i;
   v.compress(VectorOperation::insert);
 
   IndexSet local_active_together(3*numproc);
   local_active_together.add_range(myid,myid+1);
   local_active_together.add_range(numproc+myid*2,numproc+myid*2+2);
-  
+
   ConstraintMatrix cm(local_active_together);
   cm.add_line(numproc + myid*2);
   cm.close();
 
-  deallog << "vector before:" << std::endl;  
+  deallog << "vector before:" << std::endl;
   v.print(deallog.get_file_stream());
 
-  deallog << "CM:" << std::endl;  
+  deallog << "CM:" << std::endl;
   cm.print(deallog.get_file_stream());
-  
+
   cm.set_zero(v);
-  
-  deallog << "vector after:" << std::endl;  
+
+  deallog << "vector after:" << std::endl;
   v.print(deallog.get_file_stream());
 
   deallog << "OK" << std::endl;
index a6d9431b8b9ca7d135f643401dfef1f1df5cdcaa..89d89fa4cce8acf33260102d2321b233ce71f138 100644 (file)
@@ -32,7 +32,7 @@ void test ()
 {
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
   unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
+
   std::vector<IndexSet> local_active(2);
 
   // block 0:
@@ -48,29 +48,29 @@ void test ()
   v.block(1).reinit(local_active[1], complete_index_set(2*numproc), MPI_COMM_WORLD);
   v.collect_sizes();
 
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     v(i)=1.0+i;
   v.compress(VectorOperation::insert);
 
   IndexSet local_active_together(3*numproc);
   local_active_together.add_range(myid,myid+1);
   local_active_together.add_range(numproc+myid*2,numproc+myid*2+2);
-  
+
   ConstraintMatrix cm(local_active_together);
   cm.add_line(numproc + myid*2);
   cm.close();
 
-  deallog << "vector before:" << std::endl;  
+  deallog << "vector before:" << std::endl;
   v.block(0).print(deallog.get_file_stream());
   v.block(1).print(deallog.get_file_stream());
 
   deallog << std::endl;
-  deallog << "CM:" << std::endl;  
+  deallog << "CM:" << std::endl;
   cm.print(deallog.get_file_stream());
-  
+
   cm.set_zero(v);
-  
-  deallog << "vector after:" << std::endl;  
+
+  deallog << "vector after:" << std::endl;
   v.block(0).print(deallog.get_file_stream());
   v.block(1).print(deallog.get_file_stream());
 
index 68a09b940301eea3158f027f054c9de6ce7e8df3..096ab7d1259008ecb7bb6069070a9aad0c6d615e 100644 (file)
@@ -61,22 +61,22 @@ void test()
   GridGenerator::hyper_cube(tr);
 
   tr.refine_global (1);
-  for (unsigned int step=0; step<5;++step)
-        {
-          typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active(),
-            endc = tr.end();
-
-            for (; cell!=endc; ++cell)
-                if (std::rand()%42==1)
-                cell->set_refine_flag ();
-
-         tr.execute_coarsening_and_refinement ();
-        }
+  for (unsigned int step=0; step<5; ++step)
+    {
+      typename Triangulation<dim>::active_cell_iterator
+      cell = tr.begin_active(),
+      endc = tr.end();
+
+      for (; cell!=endc; ++cell)
+        if (std::rand()%42==1)
+          cell->set_refine_flag ();
+
+      tr.execute_coarsening_and_refinement ();
+    }
   DoFHandler<dim> dofh(tr);
 
   static FESystem<dim> fe (FE_Q<dim>(1+1), dim,
-                          FE_Q<dim>(1), 1);
+                           FE_Q<dim>(1), 1);
 
   dofh.distribute_dofs (fe);
 
@@ -99,45 +99,45 @@ void test()
   velocity_mask[dim] = false;
 
   VectorTools::interpolate_boundary_values (dofh,
-                                           0,
-                                           ZeroFunction<dim>(dim+1),
-                                           cm,
-                                           velocity_mask);
-
-    cm.close ();
-
-    TrilinosWrappers::MPI::Vector x_test;
-    x_test.reinit(x_rel);
-
-    x_test=x;
-
-    bool throwing=false;
-    deal_II_exceptions::disable_abort_on_exception();
-    try
-      {
-       cm.distribute(x_test);
-      }
-    catch (const ExceptionBase &e)
-      {
-       if (myid==0)
-         deallog << "Exception: " << e.get_exc_name() << std::endl;
-       throwing=true;
-      }
-    Assert(throwing, ExcInternalError());
-
-    cm.distribute(x);
-    x_rel = x;
-
-                                    //l2_norm() not possible for ghosted vectors...
-    //double a=0;//x_test.l2_norm();
-    //double b=0;//x_rel.l2_norm();
-
-/*    if (myid==0)
-      deallog << a << " vs " << b << std::endl;
-*/
-/*    Assert (x_test.l2_norm() == x_rel.l2_norm(),
-      ExcInternalError());
-*/
+                                            0,
+                                            ZeroFunction<dim>(dim+1),
+                                            cm,
+                                            velocity_mask);
+
+  cm.close ();
+
+  TrilinosWrappers::MPI::Vector x_test;
+  x_test.reinit(x_rel);
+
+  x_test=x;
+
+  bool throwing=false;
+  deal_II_exceptions::disable_abort_on_exception();
+  try
+    {
+      cm.distribute(x_test);
+    }
+  catch (const ExceptionBase &e)
+    {
+      if (myid==0)
+        deallog << "Exception: " << e.get_exc_name() << std::endl;
+      throwing=true;
+    }
+  Assert(throwing, ExcInternalError());
+
+  cm.distribute(x);
+  x_rel = x;
+
+  //l2_norm() not possible for ghosted vectors...
+  //double a=0;//x_test.l2_norm();
+  //double b=0;//x_rel.l2_norm();
+
+  /*    if (myid==0)
+        deallog << a << " vs " << b << std::endl;
+  */
+  /*    Assert (x_test.l2_norm() == x_rel.l2_norm(),
+        ExcInternalError());
+  */
 }
 
 
index c156430fdc5f5a70c188a301074dfa1e8ec8f7fd..d8b4d26a3413e10f7e20995df2eb522bf58dfbc0 100644 (file)
@@ -43,11 +43,11 @@ template<int dim>
 void test()
 {
   parallel::distributed::Triangulation<dim>
-    triangulation (MPI_COMM_WORLD,
-                  Triangulation<dim>::limit_level_difference_at_vertices);
+  triangulation (MPI_COMM_WORLD,
+                 Triangulation<dim>::limit_level_difference_at_vertices);
 
   FESystem<dim> fe (FE_Q<dim>(3),2,
-                   FE_DGQ<dim>(1),1);
+                    FE_DGQ<dim>(1),1);
 
   GridGenerator::hyper_cube(triangulation);
   triangulation.refine_global (4);
index 3ac7a5a92b6f35623e35d333ffa1b8b348b803d8..6242127ff41218091f091ee622ebae0fccc4e48d 100644 (file)
@@ -43,11 +43,11 @@ template<int dim>
 void test()
 {
   parallel::distributed::Triangulation<dim>
-    triangulation (MPI_COMM_WORLD,
-                  Triangulation<dim>::limit_level_difference_at_vertices);
+  triangulation (MPI_COMM_WORLD,
+                 Triangulation<dim>::limit_level_difference_at_vertices);
 
   FESystem<dim> fe (FE_Q<dim>(3),2,
-                   FE_DGQ<dim>(1),1);
+                    FE_DGQ<dim>(1),1);
 
   DoFHandler<dim> dof_handler (triangulation);
 
@@ -57,33 +57,33 @@ void test()
   const unsigned int n_refinements[] = { 0, 4, 3, 2 };
   for (unsigned int i=0; i<n_refinements[dim]; ++i)
     {
-                                      // refine one-fifth of cells randomly
+      // refine one-fifth of cells randomly
       std::vector<bool> flags (triangulation.n_active_cells(), false);
       for (unsigned int k=0; k<flags.size()/5 + 1; ++k)
-       flags[rand() % flags.size()] = true;
-                                      // make sure there's at least one that
-                                      // will be refined
+        flags[rand() % flags.size()] = true;
+      // make sure there's at least one that
+      // will be refined
       flags[0] = true;
 
-                                      // refine triangulation
+      // refine triangulation
       unsigned int index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = triangulation.begin_active();
-          cell != triangulation.end(); ++cell, ++index)
-       if (flags[index])
-         cell->set_refine_flag();
+           cell = triangulation.begin_active();
+           cell != triangulation.end(); ++cell, ++index)
+        if (flags[index])
+          cell->set_refine_flag();
       Assert (index == triangulation.n_active_cells(), ExcInternalError());
 
-                                      // flag all other cells for coarsening
-                                      // (this should ensure that at least
-                                      // some of them will actually be
-                                      // coarsened)
+      // flag all other cells for coarsening
+      // (this should ensure that at least
+      // some of them will actually be
+      // coarsened)
       index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = triangulation.begin_active();
-          cell != triangulation.end(); ++cell, ++index)
-       if (!flags[index])
-         cell->set_coarsen_flag();
+           cell = triangulation.begin_active();
+           cell != triangulation.end(); ++cell, ++index)
+        if (!flags[index])
+          cell->set_coarsen_flag();
 
       triangulation.execute_coarsening_and_refinement ();
       dof_handler.distribute_dofs (fe);
@@ -92,17 +92,17 @@ void test()
       DoFTools::count_dofs_per_block (dof_handler, dofs_per_block);
 
       Assert (std::accumulate (dofs_per_block.begin(), dofs_per_block.end(), 0U)
-             == dof_handler.n_dofs(),
-             ExcInternalError());
-      
+              == dof_handler.n_dofs(),
+              ExcInternalError());
+
       unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
       if (myid == 0)
-       {
-         deallog << "Total number of dofs: " << dof_handler.n_dofs() << std::endl;
-         for (unsigned int i=0; i<dofs_per_block.size(); ++i)
-           deallog << "Block " << i << " has " << dofs_per_block[i] << " global dofs"
-                   << std::endl;
-       }
+        {
+          deallog << "Total number of dofs: " << dof_handler.n_dofs() << std::endl;
+          for (unsigned int i=0; i<dofs_per_block.size(); ++i)
+            deallog << "Block " << i << " has " << dofs_per_block[i] << " global dofs"
+                    << std::endl;
+        }
     }
 }
 
index f69b0aecb7faeb3d8dbb69f52820e9008135f958..3e74a4d065d385e4435c1fdc8cab7c253eb68d39 100644 (file)
@@ -43,11 +43,11 @@ template<int dim>
 void test()
 {
   parallel::distributed::Triangulation<dim>
-    triangulation (MPI_COMM_WORLD,
-                  Triangulation<dim>::limit_level_difference_at_vertices);
+  triangulation (MPI_COMM_WORLD,
+                 Triangulation<dim>::limit_level_difference_at_vertices);
 
   FESystem<dim> fe (FE_Q<dim>(3),2,
-                   FE_DGQ<dim>(1),1);
+                    FE_DGQ<dim>(1),1);
 
   DoFHandler<dim> dof_handler (triangulation);
 
@@ -59,16 +59,16 @@ void test()
   DoFTools::count_dofs_per_component (dof_handler, dofs_per_component);
 
   Assert (std::accumulate (dofs_per_component.begin(), dofs_per_component.end(), 0U)
-         == dof_handler.n_dofs(),
-         ExcInternalError());
-      
+          == dof_handler.n_dofs(),
+          ExcInternalError());
+
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
   if (myid == 0)
     {
       deallog << "Total number of dofs: " << dof_handler.n_dofs() << std::endl;
       for (unsigned int i=0; i<dofs_per_component.size(); ++i)
-       deallog << "Component " << i << " has " << dofs_per_component[i] << " global dofs"
-               << std::endl;
+        deallog << "Component " << i << " has " << dofs_per_component[i] << " global dofs"
+                << std::endl;
     }
 }
 
index e562a9cc75285a94d205b6cf58c3acfa4cd09c76..0892259f09d1d2bbc80ec3263f4999646ec718f8 100644 (file)
@@ -42,8 +42,8 @@ template<int dim>
 void test()
 {
   parallel::distributed::Triangulation<dim>
-    triangulation (MPI_COMM_WORLD,
-                  Triangulation<dim>::limit_level_difference_at_vertices);
+  triangulation (MPI_COMM_WORLD,
+                 Triangulation<dim>::limit_level_difference_at_vertices);
 
   FE_Q<dim> fe(1);
 
@@ -62,7 +62,7 @@ void test()
 int main(int argc, char *argv[])
 {
   Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
-  
+
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
   if (myid == 0)
     {
index b0dc99c436f584598c87e2739d46bebd6c7d18f4..3e461b1bf0cfd08649e5646b9aff44bdaafdd555 100644 (file)
@@ -42,8 +42,8 @@ template<int dim>
 void test()
 {
   parallel::distributed::Triangulation<dim>
-    triangulation (MPI_COMM_WORLD,
-                  Triangulation<dim>::limit_level_difference_at_vertices);
+  triangulation (MPI_COMM_WORLD,
+                 Triangulation<dim>::limit_level_difference_at_vertices);
 
   FESystem<dim> fe (FE_DGQ<dim>(0),2);
 
index 3c9fe04dc346f869cfe4ee4f22708260651f84c2..96c1b50e35b57855c6419a44ee5f63afa7139dd8 100644 (file)
@@ -43,41 +43,41 @@ template<int dim>
 void test()
 {
   parallel::distributed::Triangulation<dim>
-    triangulation (MPI_COMM_WORLD,
-                  Triangulation<dim>::limit_level_difference_at_vertices);
+  triangulation (MPI_COMM_WORLD,
+                 Triangulation<dim>::limit_level_difference_at_vertices);
 
   GridGenerator::hyper_cube(triangulation);
   triangulation.refine_global (2);
 
   for (unsigned int i=0; i<2; ++i)
     {
-                                      // refine one-fifth of cells randomly
+      // refine one-fifth of cells randomly
       std::vector<bool> flags (triangulation.n_active_cells(), false);
       for (unsigned int k=0; k<flags.size()/5 + 1; ++k)
-       flags[rand() % flags.size()] = true;
-                                      // make sure there's at least one that
-                                      // will be refined
+        flags[rand() % flags.size()] = true;
+      // make sure there's at least one that
+      // will be refined
       flags[0] = true;
 
-                                      // refine triangulation
+      // refine triangulation
       unsigned int index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = triangulation.begin_active();
-          cell != triangulation.end(); ++cell, ++index)
-       if (flags[index])
-         cell->set_refine_flag();
+           cell = triangulation.begin_active();
+           cell != triangulation.end(); ++cell, ++index)
+        if (flags[index])
+          cell->set_refine_flag();
       Assert (index == triangulation.n_active_cells(), ExcInternalError());
 
-                                      // flag all other cells for coarsening
-                                      // (this should ensure that at least
-                                      // some of them will actually be
-                                      // coarsened)
+      // flag all other cells for coarsening
+      // (this should ensure that at least
+      // some of them will actually be
+      // coarsened)
       index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = triangulation.begin_active();
-          cell != triangulation.end(); ++cell, ++index)
-       if (!flags[index])
-         cell->set_coarsen_flag();
+           cell = triangulation.begin_active();
+           cell != triangulation.end(); ++cell, ++index)
+        if (!flags[index])
+          cell->set_coarsen_flag();
 
       triangulation.execute_coarsening_and_refinement ();
     }
index 0a2095fdf4b1f7635eae018ca1d2dba394c5db8c..d91098a4f552ec6e506018bb3219087724196cc5 100644 (file)
@@ -44,63 +44,66 @@ template<int dim>
 void test()
 {
   parallel::distributed::Triangulation<dim>
-    triangulation (MPI_COMM_WORLD,
-                  Triangulation<dim>::limit_level_difference_at_vertices);
+  triangulation (MPI_COMM_WORLD,
+                 Triangulation<dim>::limit_level_difference_at_vertices);
 
   GridGenerator::hyper_cube(triangulation);
   triangulation.refine_global (1);
 
   {
     typename Triangulation<dim>::cell_iterator
-      it=triangulation.begin_active();
+    it=triangulation.begin_active();
     it->set_refine_flag();
     triangulation.execute_coarsening_and_refinement ();
-    
+
     it=triangulation.begin(1);
-    ++it;++it;++it;
+    ++it;
+    ++it;
+    ++it;
     it=triangulation.begin(1);
-    for (unsigned int a=0;a<4;a++)
+    for (unsigned int a=0; a<4; a++)
       it->child(a)->set_coarsen_flag();
-    
+
     triangulation.prepare_coarsening_and_refinement ();
-    
-    { //data out
+
+    {
+      //data out
       FE_Q<dim>            fe(1);
       DoFHandler<dim>      dof_handler(triangulation);
-      
+
       dof_handler.distribute_dofs(fe);
-      
+
       unsigned int n_coarse=0;
       Vector<float> subdomain (triangulation.n_active_cells());
       {
-       unsigned int index = 0;
-       
-       for (typename Triangulation<dim>::active_cell_iterator
-              cell = triangulation.begin_active();
-            cell != triangulation.end(); ++cell, ++index)
-         {
-           subdomain(index)=0;
-           
-           if (cell->is_ghost() || cell->is_artificial())
-             subdomain(index)=-4;
-           
-           if (cell->refine_flag_set())
-             subdomain(index)+=1;
-           if (cell->coarsen_flag_set())
-             {
-               subdomain(index)+=2;
-               ++n_coarse;
-             }
-         }
+        unsigned int index = 0;
+
+        for (typename Triangulation<dim>::active_cell_iterator
+             cell = triangulation.begin_active();
+             cell != triangulation.end(); ++cell, ++index)
+          {
+            subdomain(index)=0;
+
+            if (cell->is_ghost() || cell->is_artificial())
+              subdomain(index)=-4;
+
+            if (cell->refine_flag_set())
+              subdomain(index)+=1;
+            if (cell->coarsen_flag_set())
+              {
+                subdomain(index)+=2;
+                ++n_coarse;
+              }
+          }
       }
       if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
-       {
-         deallog << "id=" << triangulation.locally_owned_subdomain()
-                 << " n_coarsen=" << n_coarse << std::endl;
-         for (unsigned int i=0; i<subdomain.size(); ++i)
-           deallog << subdomain(i) << std::endl;
-       }
-      
+        {
+          deallog << "id=" << triangulation.locally_owned_subdomain()
+                  << " n_coarsen=" << n_coarse << std::endl;
+          for (unsigned int i=0; i<subdomain.size(); ++i)
+            deallog << subdomain(i) << std::endl;
+        }
+
       triangulation.execute_coarsening_and_refinement ();
     }
   }
index d9d01079a919f33383481cb7d53be5ecd9e55193..204bbe65702512f4d789a64a146144a6c0113103 100644 (file)
@@ -43,7 +43,7 @@ void test_mpi()
   unsigned int num_local=10;
   unsigned int n=numprocs*num_local;
   std::vector<types::global_dof_index> rows_per_cpu;
-  for (unsigned int i=0;i<numprocs;++i)
+  for (unsigned int i=0; i<numprocs; ++i)
     rows_per_cpu.push_back(num_local);
 
   IndexSet locally_rel(n);
@@ -52,23 +52,23 @@ void test_mpi()
     locally_rel.add_range((myid-1)*num_local, (myid+0)*num_local);
   if (myid<numprocs-1)
     locally_rel.add_range((myid+1)*num_local, (myid+2)*num_local);
-   
+
   CompressedSimpleSparsityPattern csp(n,n, locally_rel);
-  
-  for (unsigned int i=0;i<n;++i)
+
+  for (unsigned int i=0; i<n; ++i)
     csp.add(i, myid);
 
   SparsityTools::distribute_sparsity_pattern<>(csp,
-                                              rows_per_cpu,
-                                              MPI_COMM_WORLD,
-                                              locally_rel);
-/*  {
-    std::ofstream f((std::string("after")+Utilities::int_to_string(myid)).c_str());
-    csp.print(f);
-    }*/
-
-                                  // checking...
-   for (unsigned int r=0;r<num_local;++r)
+                                               rows_per_cpu,
+                                               MPI_COMM_WORLD,
+                                               locally_rel);
+  /*  {
+      std::ofstream f((std::string("after")+Utilities::int_to_string(myid)).c_str());
+      csp.print(f);
+      }*/
+
+  // checking...
+  for (unsigned int r=0; r<num_local; ++r)
     {
       unsigned int indx=r+myid*num_local;
       unsigned int len=csp.row_length(indx);
@@ -76,17 +76,17 @@ void test_mpi()
 //std::cout << "myid=" << myid << " idx=" << indx << " len=" << len <<std::endl;
 
       if (myid>0 && myid<numprocs-1)
-       Assert(len==3, ExcInternalError());
+        Assert(len==3, ExcInternalError());
       if (myid==0 || myid==numprocs-1)
-       Assert(len==2, ExcInternalError());
+        Assert(len==2, ExcInternalError());
 
       Assert(csp.exists(indx, myid), ExcInternalError());
       if (myid>0)
-       Assert(csp.exists(indx, myid-1), ExcInternalError());
+        Assert(csp.exists(indx, myid-1), ExcInternalError());
       if (myid<numprocs-1)
-       Assert(csp.exists(indx, myid+1), ExcInternalError());
+        Assert(csp.exists(indx, myid+1), ExcInternalError());
     }
-  
+
   if (myid==0)
     deallog << "done" << std::endl;
 
index 4179f663cb66d5323a11d6f22caffde333ce0abd..6c1f92138aab82b1555c09f9c8a0f2cc66d21f49 100644 (file)
@@ -43,7 +43,7 @@ void test_mpi()
   unsigned int num_local=10;
   unsigned int n=numprocs*num_local;
   std::vector<types::global_dof_index> rows_per_cpu;
-  for (unsigned int i=0;i<numprocs;++i)
+  for (unsigned int i=0; i<numprocs; ++i)
     rows_per_cpu.push_back(num_local);
 
   IndexSet locally_rel(n);
@@ -55,29 +55,29 @@ void test_mpi()
 
   std::vector<IndexSet> partitioning;
   partitioning.push_back(locally_rel);
-  
+
   BlockCompressedSimpleSparsityPattern csp(partitioning);
-  
-  for (unsigned int i=0;i<n;++i)
+
+  for (unsigned int i=0; i<n; ++i)
     csp.add(i, myid);
-  
+
   if (myid==0)
     {
       deallog << "blocks: " << csp.n_block_rows() << "x" << csp.n_block_cols() << std::endl;
       deallog << "size: " << csp.n_rows() << "x" << csp.n_cols() << std::endl;
     }
-  
+
   SparsityTools::distribute_sparsity_pattern<>(csp,
-                                              rows_per_cpu,
-                                              MPI_COMM_WORLD,
-                                              locally_rel);
-/*  {
-    std::ofstream f((std::string("after")+Utilities::int_to_string(myid)).c_str());
-    csp.print(f);
-    }*/
-
-                                  // checking...
-   for (unsigned int r=0;r<num_local;++r)
+                                               rows_per_cpu,
+                                               MPI_COMM_WORLD,
+                                               locally_rel);
+  /*  {
+      std::ofstream f((std::string("after")+Utilities::int_to_string(myid)).c_str());
+      csp.print(f);
+      }*/
+
+  // checking...
+  for (unsigned int r=0; r<num_local; ++r)
     {
       unsigned int indx=r+myid*num_local;
       unsigned int len=csp.row_length(indx);
@@ -85,15 +85,15 @@ void test_mpi()
 //std::cout << "myid=" << myid << " idx=" << indx << " len=" << len <<std::endl;
 
       if (myid>0 && myid<numprocs-1)
-       Assert(len==3, ExcInternalError());
+        Assert(len==3, ExcInternalError());
       if (myid==0 || myid==numprocs-1)
-       Assert(len==2, ExcInternalError());
+        Assert(len==2, ExcInternalError());
 
       Assert(csp.exists(indx, myid), ExcInternalError());
       if (myid>0)
-       Assert(csp.exists(indx, myid-1), ExcInternalError());
+        Assert(csp.exists(indx, myid-1), ExcInternalError());
       if (myid<numprocs-1)
-       Assert(csp.exists(indx, myid+1), ExcInternalError());
+        Assert(csp.exists(indx, myid+1), ExcInternalError());
     }
 
   if (myid==0)
@@ -102,26 +102,26 @@ void test_mpi()
   IndexSet bla(1);
   if (myid==0)
     bla.add_index(0);
-  
+
   partitioning.push_back(bla);
 
   csp.reinit(partitioning);
-  for (unsigned int i=0;i<n;++i)
+  for (unsigned int i=0; i<n; ++i)
     csp.add(i, myid);
 
   SparsityTools::distribute_sparsity_pattern<>(csp,
-                                              rows_per_cpu,
-                                              MPI_COMM_WORLD,
-                                              locally_rel);
+                                               rows_per_cpu,
+                                               MPI_COMM_WORLD,
+                                               locally_rel);
 
   if (myid==0)
     {
       deallog << "blocks: " << csp.n_block_rows() << "x" << csp.n_block_cols() << std::endl;
       deallog << "size: " << csp.n_rows() << "x" << csp.n_cols() << std::endl;
     }
-  
-                                  // checking...
-  for (unsigned int r=0;r<num_local;++r)
+
+  // checking...
+  for (unsigned int r=0; r<num_local; ++r)
     {
       unsigned int indx=r+myid*num_local;
       unsigned int len=csp.row_length(indx);
@@ -129,17 +129,17 @@ void test_mpi()
       //std::cout << "myid=" << myid << " idx=" << indx << " len=" << len <<std::endl;
 
       if (myid>0 && myid<numprocs-1)
-       Assert(len==3, ExcInternalError());
+        Assert(len==3, ExcInternalError());
       if (myid==numprocs-1 || myid==0)
-       Assert(len==2, ExcInternalError());
-      
+        Assert(len==2, ExcInternalError());
+
       Assert(csp.exists(indx, myid), ExcInternalError());
       if (myid>0)
-       Assert(csp.exists(indx, myid-1), ExcInternalError());
+        Assert(csp.exists(indx, myid-1), ExcInternalError());
       if (myid<numprocs-1)
-       Assert(csp.exists(indx, myid+1), ExcInternalError());
+        Assert(csp.exists(indx, myid+1), ExcInternalError());
     }
-   
+
   if (myid==0)
     deallog << "done" << std::endl;
 
index 8ccb5d5dee7ff3d03e90a26b9d0ce206fed78108..59954ac9b6e9b61f8b1c446ec0b976125112467c 100644 (file)
@@ -45,11 +45,11 @@ template<int dim>
 void test()
 {
   parallel::distributed::Triangulation<dim>
-    triangulation (MPI_COMM_WORLD,
-                  Triangulation<dim>::limit_level_difference_at_vertices);
+  triangulation (MPI_COMM_WORLD,
+                 Triangulation<dim>::limit_level_difference_at_vertices);
 
   FESystem<dim> fe (FE_Q<dim>(3),2,
-                   FE_DGQ<dim>(1),1);
+                    FE_DGQ<dim>(1),1);
 
   DoFHandler<dim> dof_handler (triangulation);
 
@@ -59,75 +59,75 @@ void test()
   const unsigned int n_refinements[] = { 0, 4, 3, 2 };
   for (unsigned int i=0; i<n_refinements[dim]; ++i)
     {
-                                      // refine one-fifth of cells randomly
+      // refine one-fifth of cells randomly
       std::vector<bool> flags (triangulation.n_active_cells(), false);
       for (unsigned int k=0; k<flags.size()/5 + 1; ++k)
-       flags[rand() % flags.size()] = true;
-                                      // make sure there's at least one that
-                                      // will be refined
+        flags[rand() % flags.size()] = true;
+      // make sure there's at least one that
+      // will be refined
       flags[0] = true;
 
-                                      // refine triangulation
+      // refine triangulation
       unsigned int index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = triangulation.begin_active();
-          cell != triangulation.end(); ++cell)
-       if (!cell->is_ghost() && !cell->is_artificial())
-         {
-           if (flags[index])
-             cell->set_refine_flag();
-           ++index;
-         }
+           cell = triangulation.begin_active();
+           cell != triangulation.end(); ++cell)
+        if (!cell->is_ghost() && !cell->is_artificial())
+          {
+            if (flags[index])
+              cell->set_refine_flag();
+            ++index;
+          }
 
       Assert (index <= triangulation.n_active_cells(), ExcInternalError());
 
-                                      // flag all other cells for coarsening
-                                      // (this should ensure that at least
-                                      // some of them will actually be
-                                      // coarsened)
+      // flag all other cells for coarsening
+      // (this should ensure that at least
+      // some of them will actually be
+      // coarsened)
       index=0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = triangulation.begin_active();
-          cell != triangulation.end(); ++cell)
-       if (!cell->is_ghost() && !cell->is_artificial())
-         {
-           if (!flags[index])
-             cell->set_coarsen_flag();
-           ++index;
-         }
+           cell = triangulation.begin_active();
+           cell != triangulation.end(); ++cell)
+        if (!cell->is_ghost() && !cell->is_artificial())
+          {
+            if (!flags[index])
+              cell->set_coarsen_flag();
+            ++index;
+          }
 
       triangulation.execute_coarsening_and_refinement ();
       dof_handler.distribute_dofs (fe);
 
       const unsigned int N = dof_handler.n_dofs();
       if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
-       deallog << N << std::endl;
+        deallog << N << std::endl;
 
       Assert (dof_handler.n_locally_owned_dofs() <= N,
-             ExcInternalError());
+              ExcInternalError());
       for (unsigned int i=0;
-          i<dof_handler.n_locally_owned_dofs_per_processor().size(); ++i)
-       Assert (dof_handler.n_locally_owned_dofs_per_processor()[i] <= N,
-               ExcInternalError());
+           i<dof_handler.n_locally_owned_dofs_per_processor().size(); ++i)
+        Assert (dof_handler.n_locally_owned_dofs_per_processor()[i] <= N,
+                ExcInternalError());
       Assert (std::accumulate (dof_handler.n_locally_owned_dofs_per_processor().begin(),
-                              dof_handler.n_locally_owned_dofs_per_processor().end(),
-                              0U) == N,
-             ExcInternalError());
+                               dof_handler.n_locally_owned_dofs_per_processor().end(),
+                               0U) == N,
+              ExcInternalError());
 
       IndexSet all (N), really_all (N);
-                                      // poor man's union operation
+      // poor man's union operation
       for (unsigned int i=0;
-          i<dof_handler.n_locally_owned_dofs_per_processor().size(); ++i)
-       for (unsigned int j=0; j<N; ++j)
-         if (dof_handler.locally_owned_dofs_per_processor()[i]
-             .is_element(j))
-           {
-             Assert (all.is_element(j) == false, ExcInternalError());
-             all.add_index (j);
-           }
+           i<dof_handler.n_locally_owned_dofs_per_processor().size(); ++i)
+        for (unsigned int j=0; j<N; ++j)
+          if (dof_handler.locally_owned_dofs_per_processor()[i]
+              .is_element(j))
+            {
+              Assert (all.is_element(j) == false, ExcInternalError());
+              all.add_index (j);
+            }
       really_all.add_range (0, N);
       Assert (all == really_all,
-             ExcInternalError());
+              ExcInternalError());
     }
 }
 
index d63a8e6b81dc6e9665d9c5c8519125ba345d19ef..81e0dacc803f2a5939d5679e5c20f0c46af24baf 100644 (file)
@@ -44,20 +44,20 @@ void test()
 
   IndexSet relevant_set, boundary_dofs;
   DoFTools::extract_boundary_dofs (dofh,
-                                  std::vector<bool>(1,true),
-                                  boundary_dofs);
+                                   std::vector<bool>(1,true),
+                                   boundary_dofs);
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     boundary_dofs.write (deallog.get_file_stream());
 
-                                  // the result of
-                                  // extract_boundary_dofs is
-                                  // supposed to be a subset of the
-                                  // locally relevant dofs, so test
-                                  // this
+  // the result of
+  // extract_boundary_dofs is
+  // supposed to be a subset of the
+  // locally relevant dofs, so test
+  // this
   DoFTools::extract_locally_relevant_dofs (dofh, relevant_set);
   boundary_dofs.subtract_set (relevant_set);
   Assert (boundary_dofs.n_elements() == 0,
-         ExcInternalError());
+          ExcInternalError());
 }
 
 
index 2425fa9e716b057967e097c3103780be945686a5..7069b9c2fe36129aa7cfb93e779fb692fad99576 100644 (file)
@@ -51,51 +51,51 @@ void test()
   sub[0] = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
   sub[1] = 1;
   GridGenerator::subdivided_hyper_rectangle(static_cast<Triangulation<dim>&>(tr),
-                                           sub, Point<2>(0,0), Point<2>(1,1));
+                                            sub, Point<2>(0,0), Point<2>(1,1));
 
   FESystem<dim> fe(FE_Q<dim>(1),2,
-                  FE_DGQ<dim>(0),1);
+                   FE_DGQ<dim>(0),1);
   DoFHandler<dim> dofh(tr);
   dofh.distribute_dofs (fe);
 
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     deallog << "Total dofs=" << dofh.n_dofs() << std::endl;
 
-                                  // extract constant modes and print
+  // extract constant modes and print
   if (myid == 0)
     for (unsigned int c=0; c<fe.n_components(); ++c)
       {
-       std::vector<bool> mask(fe.n_components(), false);
-       mask[c] = true;
-
-       std::vector<std::vector<bool> > constant_modes;
-       DoFTools::extract_constant_modes (dofh, mask, constant_modes);
-
-       for (unsigned int i=0; i<constant_modes.size(); ++i)
-         {
-           for (unsigned int j=0; j<constant_modes[i].size(); ++j)
-             deallog << (constant_modes[i][j] ? '1' : '0') << ' ';
-           deallog << std::endl;
-         }
+        std::vector<bool> mask(fe.n_components(), false);
+        mask[c] = true;
+
+        std::vector<std::vector<bool> > constant_modes;
+        DoFTools::extract_constant_modes (dofh, mask, constant_modes);
+
+        for (unsigned int i=0; i<constant_modes.size(); ++i)
+          {
+            for (unsigned int j=0; j<constant_modes[i].size(); ++j)
+              deallog << (constant_modes[i][j] ? '1' : '0') << ' ';
+            deallog << std::endl;
+          }
       }
 
-                                  // renumber dofs and do the same again
+  // renumber dofs and do the same again
   DoFRenumbering::component_wise(dofh);
   if (myid == 0)
     for (unsigned int c=0; c<fe.n_components(); ++c)
       {
-       std::vector<bool> mask(fe.n_components(), false);
-       mask[c] = true;
-
-       std::vector<std::vector<bool> > constant_modes;
-       DoFTools::extract_constant_modes (dofh, mask, constant_modes);
-
-       for (unsigned int i=0; i<constant_modes.size(); ++i)
-         {
-           for (unsigned int j=0; j<constant_modes[i].size(); ++j)
-             deallog << (constant_modes[i][j] ? '1' : '0') << ' ';
-           deallog << std::endl;
-         }
+        std::vector<bool> mask(fe.n_components(), false);
+        mask[c] = true;
+
+        std::vector<std::vector<bool> > constant_modes;
+        DoFTools::extract_constant_modes (dofh, mask, constant_modes);
+
+        for (unsigned int i=0; i<constant_modes.size(); ++i)
+          {
+            for (unsigned int j=0; j<constant_modes[i].size(); ++j)
+              deallog << (constant_modes[i][j] ? '1' : '0') << ' ';
+            deallog << std::endl;
+          }
       }
 }
 
index c127c78e841ea137537c6d17706656f953bda847..c91abb5455e3c1edbf393bfeeea4da822073f313 100644 (file)
@@ -56,22 +56,22 @@ void test()
   DoFTools::extract_locally_active_dofs (dofh, locally_active);
 
   Assert (locally_active ==
-         DoFTools::dof_indices_with_subdomain_association (dofh,
-                                                           tr.locally_owned_subdomain()),
-         ExcInternalError());
+          DoFTools::dof_indices_with_subdomain_association (dofh,
+                                                            tr.locally_owned_subdomain()),
+          ExcInternalError());
   // Assert (locally_active.n_elements() ==
-  //     DoFTools::count_dofs_with_subdomain_association (dofh,
-  //                                                      tr.locally_owned_subdomain()),
-  //     ExcInternalError());
+  //    DoFTools::count_dofs_with_subdomain_association (dofh,
+  //                 tr.locally_owned_subdomain()),
+  //    ExcInternalError());
 
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     {
       deallog << locally_active.size() << ' ' << locally_active.n_elements()
-             << std::endl;
+              << std::endl;
 
       for (unsigned int i=0; i<locally_active.size(); ++i)
-       if (locally_active.is_element(i))
-         deallog << i << ' ';
+        if (locally_active.is_element(i))
+          deallog << i << ' ';
       deallog << "OK" << std::endl;
     }
 }
index 7087465241a05efafe00027b66707ea60ec687c1..65bbc28207acbbee8eb5b0b8d12f135d12b47f40 100644 (file)
 
 
 template <int dim>
-class LinearFunction : public Function<dim> 
+class LinearFunction : public Function<dim>
 {
-  public:
-    double value (const Point<dim> &p,
-                 const unsigned int) const
-      {
-       return p[0] + 2;
-      }
+public:
+  double value (const Point<dim> &p,
+                const unsigned int) const
+  {
+    return p[0] + 2;
+  }
 };
 
 
@@ -72,45 +72,45 @@ void test()
   dofh.distribute_dofs (fe);
 
   TrilinosWrappers::MPI::Vector interpolated(dofh.locally_owned_dofs(),
-                                            MPI_COMM_WORLD);
+                                             MPI_COMM_WORLD);
   VectorTools::interpolate (dofh,
-                           LinearFunction<dim>(),
-                           interpolated);
-  
+                            LinearFunction<dim>(),
+                            interpolated);
+
   IndexSet relevant_set;
   DoFTools::extract_locally_relevant_dofs (dofh, relevant_set);
   TrilinosWrappers::MPI::Vector x_rel(relevant_set, MPI_COMM_WORLD);
   x_rel = interpolated;
 
   Functions::FEFieldFunction<dim,DoFHandler<dim>,TrilinosWrappers::MPI::Vector>
-    field_function (dofh, x_rel);
+  field_function (dofh, x_rel);
 
   for (unsigned int test=0; test<4; ++test)
     {
       double value;
       Point<dim> p = (dim == 2 ?
-                     Point<dim>(test/2+1,test%2+1)/3 :
-                     Point<dim>(test/2+1,test/2+1,test%2+1)/3);
+                      Point<dim>(test/2+1,test%2+1)/3 :
+                      Point<dim>(test/2+1,test/2+1,test%2+1)/3);
 
       // see if we can find the point on the current processor
       bool point_found = false;
       try
-       {
-         value = field_function.value (p);
-         point_found = true;
+        {
+          value = field_function.value (p);
+          point_found = true;
 
-         Assert (std::fabs(value - (p[0]+2)) < 1e-8* std::fabs(value + (p[0]+2)),
-                 ExcInternalError());
-       }
+          Assert (std::fabs(value - (p[0]+2)) < 1e-8* std::fabs(value + (p[0]+2)),
+                  ExcInternalError());
+        }
       catch (typename Functions::FEFieldFunction<dim,DoFHandler<dim>,TrilinosWrappers::MPI::Vector>::ExcPointNotAvailableHere &)
-       {
-         point_found = false;
-       }
+        {
+          point_found = false;
+        }
 
       Assert (Utilities::MPI::sum(point_found ? 1 : 0, MPI_COMM_WORLD) == 1,
-             ExcInternalError());  
+              ExcInternalError());
     }
-  
+
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     deallog << "OK" << std::endl;
 
index e1f8161b1047420908c6210a3ba28644531b3101..7eb36863921fcb7e7dbe45bfba059c07a82e8fdc 100644 (file)
@@ -80,9 +80,9 @@ namespace Step39
     const MappingQ1<dim>      mapping;
     const FiniteElement<dim> &fe;
     DoFHandler<dim>           dof_handler;
-    
+
     IndexSet locally_relevant_set;
-    
+
     TrilinosWrappers::SparseMatrix matrix;
 
     MGLevelObject<TrilinosWrappers::SparseMatrix> mg_matrix;
@@ -112,9 +112,9 @@ namespace Step39
   {
     dof_handler.distribute_dofs(fe);
     dof_handler.distribute_mg_dofs (fe);
-    
+
     DoFTools::extract_locally_relevant_dofs (dof_handler, locally_relevant_set);
-    
+
     CompressedSimpleSparsityPattern c_sparsity(dof_handler.n_dofs(), dof_handler.n_dofs());
     DoFTools::make_flux_sparsity_pattern(dof_handler, c_sparsity);
     matrix.reinit(dof_handler.locally_owned_dofs(), c_sparsity, MPI_COMM_WORLD, true);
@@ -126,16 +126,16 @@ namespace Step39
     mg_matrix_dg_up.clear();
     mg_matrix_dg_down.resize(0, n_levels-1);
     mg_matrix_dg_down.clear();
-    
+
     for (unsigned int level=mg_matrix.min_level();
          level<=mg_matrix.max_level(); ++level)
       {
         CompressedSimpleSparsityPattern c_sparsity(dof_handler.n_dofs(level));
         MGTools::make_flux_sparsity_pattern(dof_handler, c_sparsity, level);
-       mg_matrix[level].reinit(dof_handler.locally_owned_mg_dofs(level),
-                               dof_handler.locally_owned_mg_dofs(level),
-                               c_sparsity,
-                               MPI_COMM_WORLD, true);
+        mg_matrix[level].reinit(dof_handler.locally_owned_mg_dofs(level),
+                                dof_handler.locally_owned_mg_dofs(level),
+                                c_sparsity,
+                                MPI_COMM_WORLD, true);
 
         if (level>0)
           {
@@ -143,14 +143,14 @@ namespace Step39
             ci_sparsity.reinit(dof_handler.n_dofs(level-1), dof_handler.n_dofs(level));
             MGTools::make_flux_sparsity_pattern_edge(dof_handler, ci_sparsity, level);
 
-           mg_matrix_dg_up[level].reinit(dof_handler.locally_owned_mg_dofs(level-1),
-                                         dof_handler.locally_owned_mg_dofs(level),
-                                         ci_sparsity,
-                                         MPI_COMM_WORLD, true);
-           mg_matrix_dg_down[level].reinit(dof_handler.locally_owned_mg_dofs(level-1),
-                                           dof_handler.locally_owned_mg_dofs(level),
-                                           ci_sparsity,
-                                           MPI_COMM_WORLD, true);
+            mg_matrix_dg_up[level].reinit(dof_handler.locally_owned_mg_dofs(level-1),
+                                          dof_handler.locally_owned_mg_dofs(level),
+                                          ci_sparsity,
+                                          MPI_COMM_WORLD, true);
+            mg_matrix_dg_down[level].reinit(dof_handler.locally_owned_mg_dofs(level-1),
+                                            dof_handler.locally_owned_mg_dofs(level),
+                                            ci_sparsity,
+                                            MPI_COMM_WORLD, true);
           }
       }
   }
@@ -166,13 +166,13 @@ namespace Step39
         deallog << "Step " << s << std::endl;
         if (s==0)
           triangulation.refine_global(1);
-       else
-        {
-         if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0)
-           triangulation.begin_active(triangulation.n_levels()-1)->set_refine_flag();
-             
-         triangulation.execute_coarsening_and_refinement ();
-        }
+        else
+          {
+            if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0)
+              triangulation.begin_active(triangulation.n_levels()-1)->set_refine_flag();
+
+            triangulation.execute_coarsening_and_refinement ();
+          }
 
         deallog << "Triangulation "
                 << triangulation.n_active_cells() << " cells, "
@@ -193,10 +193,10 @@ int main(int argc, char *argv[])
 {
   dealii::Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv);
   mpi_initlog(__FILE__, true);
-    
+
   using namespace dealii;
   using namespace Step39;
-  
+
   try
     {
       FE_DGQ<2> fe1(0);
index 7e30aec9a9a53c09b6ac5f2a0351b41aec7b1b9e..322d960943efc838c3abef768bfd1c5c5711e4a3 100644 (file)
@@ -31,12 +31,12 @@ void test ()
 {
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
   unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
-  
+
   if (myid==0)
     deallog << "numproc=" << numproc << std::endl;
 
-                                  // each processor owns 2 indices and all
-                                  // are ghosting Element 1 (the second)
+  // each processor owns 2 indices and all
+  // are ghosting Element 1 (the second)
 
   IndexSet local_active(numproc*2);
   local_active.add_range(myid*2,myid*2+2);
@@ -46,35 +46,35 @@ void test ()
   PETScWrappers::MPI::Vector vb(local_active, MPI_COMM_WORLD);
   PETScWrappers::MPI::Vector v(local_active, local_relevant, MPI_COMM_WORLD);
 
-                                  // set local values
+  // set local values
   vb(myid*2)=myid*2.0;
   vb(myid*2+1)=myid*2.0+1.0;
 
   vb.compress(VectorOperation::insert);
   vb*=2.0;
   v=vb;
-                                  //v.update_ghost_values();
+  //v.update_ghost_values();
 
   Assert(!vb.has_ghost_elements(), ExcInternalError());
   Assert(v.has_ghost_elements(), ExcInternalError());
-  
-                                  // check local values
+
+  // check local values
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     {
       deallog << myid*2 << ":" << v(myid*2) << std::endl;
       deallog << myid*2+1 << ":" << v(myid*2+1) << std::endl;
     }
-  
+
   Assert(v(myid*2) == myid*4.0, ExcInternalError());
   Assert(v(myid*2+1) == myid*4.0+2.0, ExcInternalError());
-  
 
-                                  // check ghost values
+
+  // check ghost values
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     deallog << "ghost: " << v(1) << std::endl;
   Assert(v(1) == 2.0, ExcInternalError());
 
-                                  // done
+  // done
   if (myid==0)
     deallog << "OK" << std::endl;
 }
index aa668c914fbf32d45d9ec5c9a6cc57dd2f08ba5d..90de40f7a6732d57a48e9fd86b644520501fe09b 100644 (file)
@@ -31,12 +31,12 @@ void test ()
 {
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
   unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
-  
+
   if (myid==0)
     deallog << "numproc=" << numproc << std::endl;
 
-                                  // each processor owns 2 indices and all
-                                  // are ghosting Element 1 (the second)
+  // each processor owns 2 indices and all
+  // are ghosting Element 1 (the second)
 
   IndexSet local_active(numproc*2);
   local_active.add_range(myid*2,myid*2+2);
@@ -54,41 +54,41 @@ void test ()
   Assert(v2(1) == 1.5, ExcInternalError());
   Assert(v2(myid*2) == 1.5, ExcInternalError());
   Assert(v2(myid*2+1) == 1.5, ExcInternalError());
-  
-                                  // set local values
+
+  // set local values
   vb(myid*2)=myid*2.0;
   vb(myid*2+1)=myid*2.0+1.0;
 
   vb.compress(VectorOperation::insert);
   vb*=2.0;
   v=vb;
-  
-  
-                                  // check local values
+
+
+  // check local values
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     {
       deallog << myid*2 << ":" << v(myid*2) << std::endl;
       deallog << myid*2+1 << ":" << v(myid*2+1) << std::endl;
     }
-  
+
   Assert(v(myid*2) == myid*4.0, ExcInternalError());
   Assert(v(myid*2+1) == myid*4.0+2.0, ExcInternalError());
-  
 
-                                  // check ghost values
+
+  // check ghost values
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     deallog << "ghost: " << v(1) << std::endl;
   Assert(v(1) == 2.0, ExcInternalError());
 
-                                  //assignment from ghosted to ghosted
+  //assignment from ghosted to ghosted
   v2 = v;
   Assert(v2(1) == 2.0, ExcInternalError());
   Assert(v2(myid*2) == myid*4.0, ExcInternalError());
   Assert(v2(myid*2+1) == myid*4.0+2.0, ExcInternalError());
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     deallog << "ghost: " << v2(1) << std::endl;
-  
-                                  // done
+
+  // done
   if (myid==0)
     deallog << "OK" << std::endl;
 }
@@ -114,6 +114,6 @@ int main (int argc, char **argv)
     }
   else
     test();
-  
-  
+
+
 }
index dbbfd0c46b9f33ad995ed0656ba7aee0c484b156..a94007a035d3ec9ac945e884502561d42b24fa46 100644 (file)
@@ -31,12 +31,12 @@ void test ()
 {
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
   unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
-  
+
   if (myid==0)
     deallog << "numproc=" << numproc << std::endl;
 
-                                  // each processor owns 2 indices and all
-                                  // are ghosting Element 1 (the second)
+  // each processor owns 2 indices and all
+  // are ghosting Element 1 (the second)
 
   IndexSet local_active(numproc*2);
   local_active.add_range(myid*2,myid*2+2);
@@ -46,7 +46,7 @@ void test ()
   PETScWrappers::MPI::Vector vb(local_active, MPI_COMM_WORLD);
   PETScWrappers::MPI::Vector v(local_active, local_relevant, MPI_COMM_WORLD);
 
-                                  // set local values
+  // set local values
   vb(myid*2)=myid*2.0;
   vb(myid*2+1)=myid*2.0+1.0;
 
@@ -90,7 +90,7 @@ void test ()
       deallog << e.get_exc_name() << std::endl;
     }
 
-                                  // done
+  // done
   if (myid==0)
     deallog << "OK" << std::endl;
 }
index aca7be70e7c1940271f351695d9868e35b5f9fb0..314e017fa47034cb0ea4522c59e04d6b8593a4fc 100644 (file)
 
 
 template <int dim>
-class LinearFunction : public Function<dim> 
+class LinearFunction : public Function<dim>
 {
-  public:
-    double value (const Point<dim> &p,
-                 const unsigned int) const
-      {
-       return p[0];
-      }
+public:
+  double value (const Point<dim> &p,
+                const unsigned int) const
+  {
+    return p[0];
+  }
 };
 
 
@@ -67,47 +67,47 @@ void test()
   dofh.distribute_dofs (fe);
 
   TrilinosWrappers::MPI::Vector interpolated(dofh.locally_owned_dofs(),
-                                            MPI_COMM_WORLD);
+                                             MPI_COMM_WORLD);
   VectorTools::interpolate (dofh,
-                           LinearFunction<dim>(),
-                           interpolated);
-  
+                            LinearFunction<dim>(),
+                            interpolated);
+
   IndexSet relevant_set;
   DoFTools::extract_locally_relevant_dofs (dofh, relevant_set);
   TrilinosWrappers::MPI::Vector x_rel(relevant_set, MPI_COMM_WORLD);
   x_rel = interpolated;
 
-                                  // integrate the difference between the
-                                  // linear function above and the zero
-                                  // function. for this case, we can
-                                  // compute the exact values by hand. the
-                                  // ones printed in the output are correct
+  // integrate the difference between the
+  // linear function above and the zero
+  // function. for this case, we can
+  // compute the exact values by hand. the
+  // ones printed in the output are correct
   Vector<float> results (tr.n_active_cells());
   VectorTools::integrate_difference (dofh, x_rel,
-                                    ZeroFunction<dim>(),
-                                    results,
-                                    QGauss<dim>(3),
-                                    VectorTools::L2_norm);
+                                     ZeroFunction<dim>(),
+                                     results,
+                                     QGauss<dim>(3),
+                                     VectorTools::L2_norm);
   double local = results.l2_norm() * results.l2_norm();
   double global;
 
   MPI_Allreduce (&local, &global, 1, MPI_DOUBLE,
-                MPI_SUM, 
-                tr.get_communicator());
+                 MPI_SUM,
+                 tr.get_communicator());
 
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     deallog << "difference = " << std::sqrt(global)
-           << std::endl;
-
-                                  // we have f(\vec x)=x, so the difference
-                                  // squared is \int f(x)^2 = 1/3 and the
-                                  // norm is 1/sqrt(3)
-                                  //
-                                  // note that we have used a quadrature
-                                  // formula of sufficient order to get exact
-                                  // results
+            << std::endl;
+
+  // we have f(\vec x)=x, so the difference
+  // squared is \int f(x)^2 = 1/3 and the
+  // norm is 1/sqrt(3)
+  //
+  // note that we have used a quadrature
+  // formula of sufficient order to get exact
+  // results
   Assert (std::fabs(std::sqrt(global) - 1./std::sqrt(3.)) < 1e-6,
-         ExcInternalError());
+          ExcInternalError());
 }
 
 
index 5c15a1705c409676655ef0c0861dfd2ba61a3a4d..6af6a0e1fb91775260d1bc115c32696f0a9b0098 100644 (file)
@@ -55,8 +55,8 @@ void test()
 {
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
 
-                                  // create a mesh so that all but one
-                                  // processor are empty
+  // create a mesh so that all but one
+  // processor are empty
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
   GridGenerator::hyper_cube (tr);
   FE_Q<dim> fe (1);
@@ -69,14 +69,14 @@ void test()
   x.reinit(owned_set, MPI_COMM_WORLD);
 
   VectorTools::interpolate(dofh,
-                          ConstantFunction<dim>(1),
-                          x);
+                           ConstantFunction<dim>(1),
+                           x);
   const double norm = x.l2_norm();
   if (myid == 0)
     deallog << dofh.n_locally_owned_dofs() << ' ' << dofh.n_dofs()
-           << std::endl
-           << norm
-           << std::endl;
+            << std::endl
+            << norm
+            << std::endl;
 }
 
 
index 6d9f369cd351c7b94bcbbad2024917695de06978..7753b2323c3fb8c237dfa4ea31e56e3e6c664bac 100644 (file)
@@ -56,8 +56,8 @@ void test()
 {
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
 
-                                  // create a mesh so that all but one
-                                  // processor are empty
+  // create a mesh so that all but one
+  // processor are empty
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
   GridGenerator::hyper_cube (tr);
   FE_Q<dim> fe (1);
@@ -68,14 +68,14 @@ void test()
   PETScWrappers::MPI::Vector x (MPI_COMM_WORLD,dofh.n_dofs(),owned_set.n_elements());
 
   VectorTools::interpolate(dofh,
-                          ConstantFunction<dim>(1),
-                          x);
+                           ConstantFunction<dim>(1),
+                           x);
   const double norm = x.l2_norm();
   if (myid == 0)
     deallog << dofh.n_locally_owned_dofs() << ' ' << dofh.n_dofs()
-           << std::endl
-           << norm
-           << std::endl;
+            << std::endl
+            << norm
+            << std::endl;
 }
 
 
@@ -106,5 +106,5 @@ int main(int argc, char *argv[])
       test<3>();
     }
 
-  
+
 }
index 2d9f5ddf58964e76e9e243db3a4881f48861c294..37d4fe1462f3724f08fe7d645ad5d5cffdd4cb82 100644 (file)
 
 
 template <int dim>
-class LinearFunction : public Function<dim> 
+class LinearFunction : public Function<dim>
 {
-  public:
-    double value (const Point<dim> &p,
-                 const unsigned int) const
-      {
-       return 1;
-      }
+public:
+  double value (const Point<dim> &p,
+                const unsigned int) const
+  {
+    return 1;
+  }
 };
 
 
@@ -69,17 +69,17 @@ void test()
   const FE_Q<dim> fe(2);
   DoFHandler<dim> dofh(tr);
   dofh.distribute_dofs (fe);
-  
+
   TrilinosWrappers::MPI::Vector interpolated(dofh.locally_owned_dofs(),
-                                            MPI_COMM_WORLD);
+                                             MPI_COMM_WORLD);
   VectorTools::interpolate (dofh,
-                           LinearFunction<dim>(),
-                           interpolated);
+                            LinearFunction<dim>(),
+                            interpolated);
 
   double norm = interpolated.l2_norm();
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     deallog << "norm = " << norm
-           << std::endl;
+            << std::endl;
 }
 
 
@@ -104,7 +104,7 @@ int main(int argc, char *argv[])
       deallog.pop();
 
       deallog.push("3d");
-                                      //    test<3>();
+      //    test<3>();
       deallog.pop();
     }
   else
index 1d470e740640858cdaaa69fba45871616c985893..9275422184a19b3d58ca1af0611c55a16175f3dd 100644 (file)
@@ -65,28 +65,28 @@ void test()
   cm1.close();
   ConstraintMatrix cm2;
   cm2.close();
-  
+
   IndexSet  dof1_locally_owned_dofs = dofh1.locally_owned_dofs();
   IndexSet  dof2_locally_owned_dofs = dofh2.locally_owned_dofs();
   IndexSet  dof1_locally_relevant_dofs;
   IndexSet  dof2_locally_relevant_dofs;
   DoFTools::extract_locally_relevant_dofs (dofh2,
-                                          dof2_locally_relevant_dofs);
+                                           dof2_locally_relevant_dofs);
   DoFTools::extract_locally_relevant_dofs (dofh1,
-                                          dof1_locally_relevant_dofs);
-  
+                                           dof1_locally_relevant_dofs);
+
   PETScWrappers::MPI::Vector u1(dof1_locally_owned_dofs, dof1_locally_relevant_dofs, MPI_COMM_WORLD);
 
   PETScWrappers::MPI::Vector out(dof1_locally_owned_dofs, MPI_COMM_WORLD);
 
   FETools::interpolation_difference
-    (dofh1, cm1, u1, dofh2, cm2, out);
+  (dofh1, cm1, u1, dofh2, cm2, out);
 
   double norm = out.l2_norm();
 
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     deallog << "norm = " << norm
-           << std::endl;
+            << std::endl;
 }
 
 
@@ -111,7 +111,7 @@ int main(int argc, char *argv[])
       deallog.pop();
 
       deallog.push("3d");
-                                      //    test<3>();
+      //    test<3>();
       deallog.pop();
     }
   else
index 91551cf1ebe450ea5c1ebe012e9f8783c5c827f3..42d6fec40f8b16df8236beedbf79bc46c9f21d67 100644 (file)
@@ -54,31 +54,31 @@ void test()
        ++cell)
     {
       if (cell->is_locally_owned())
-       {
-         if (myid==0)
-           deallog << cell << ": locally owned"
-                   << std::endl;
-         Assert (!cell->is_ghost() && !cell->is_artificial(),
-                 ExcInternalError());
-       }
+        {
+          if (myid==0)
+            deallog << cell << ": locally owned"
+                    << std::endl;
+          Assert (!cell->is_ghost() && !cell->is_artificial(),
+                  ExcInternalError());
+        }
       else if (cell->is_ghost())
-       {
-         if (myid==0)
-           deallog << cell << ": ghost"
-                   << std::endl;
-         Assert (!cell->is_locally_owned() && !cell->is_artificial(),
-                 ExcInternalError());
-       }
+        {
+          if (myid==0)
+            deallog << cell << ": ghost"
+                    << std::endl;
+          Assert (!cell->is_locally_owned() && !cell->is_artificial(),
+                  ExcInternalError());
+        }
       else if (cell->is_artificial())
-       {
-         if (myid==0)
-           deallog << cell << ": artificial"
-                   << std::endl;
-         Assert (!cell->is_locally_owned() && !cell->is_ghost(),
-                 ExcInternalError());
-       }
+        {
+          if (myid==0)
+            deallog << cell << ": artificial"
+                    << std::endl;
+          Assert (!cell->is_locally_owned() && !cell->is_ghost(),
+                  ExcInternalError());
+        }
       else
-       Assert (false, ExcInternalError());
+        Assert (false, ExcInternalError());
     }
 }
 
@@ -105,5 +105,5 @@ int main(int argc, char *argv[])
     }
   else
     test<2>();
-  
+
 }
index 598d2c6ad514ba6e66604b1f7f4f6eb14270cc7e..b0bffab4dae7b31619020bb2a37f6be64ae99b46 100644 (file)
@@ -45,21 +45,21 @@ void test()
   {
     ConstraintMatrix boundary_values;
     DoFTools::make_zero_boundary_constraints (dofh,
-                                             boundary_values);
+                                              boundary_values);
     if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
       boundary_values.print (deallog.get_file_stream());
   }
 
-                                  // the result of extract_boundary_dofs is
-                                  // supposed to be a subset of the locally
-                                  // relevant dofs, so do the test again with
-                                  // that
+  // the result of extract_boundary_dofs is
+  // supposed to be a subset of the locally
+  // relevant dofs, so do the test again with
+  // that
   {
     IndexSet relevant_set (dofh.n_dofs());
     DoFTools::extract_locally_relevant_dofs (dofh, relevant_set);
     ConstraintMatrix boundary_values (relevant_set);
     DoFTools::make_zero_boundary_constraints (dofh,
-                                             boundary_values);
+                                              boundary_values);
     if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
       boundary_values.print (deallog.get_file_stream());
   }
index c16aebd6a008ffbcfa158f51cd854cef027d0104..d21c0f3b87fb129b6b9083483b6fcd98d7789712 100644 (file)
@@ -44,32 +44,32 @@ void test()
 
   std::map<types::global_dof_index, Point<dim> > points;
   DoFTools::map_dofs_to_support_points (MappingQ1<dim>(),
-                                       dofh,
-                                       points);
+                                        dofh,
+                                        points);
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     {
       for (typename std::map<types::global_dof_index, Point<dim> >::const_iterator
-            p = points.begin();
-          p != points.end();
-          ++p)
-       deallog << p->first << " -> " << p->second
-               << std::endl;
+           p = points.begin();
+           p != points.end();
+           ++p)
+        deallog << p->first << " -> " << p->second
+                << std::endl;
     }
 
-                                  // the result of the call above is
-                                  // supposed to be a map that
-                                  // contains exactly the locally
-                                  // relevant dofs, so test this
+  // the result of the call above is
+  // supposed to be a map that
+  // contains exactly the locally
+  // relevant dofs, so test this
   IndexSet relevant_set;
   DoFTools::extract_locally_relevant_dofs (dofh, relevant_set);
 
   for (unsigned int i=0; i<dofh.n_dofs(); ++i)
     if (relevant_set.is_element(i))
       Assert (points.find(i) != points.end(),
-             ExcInternalError())
+              ExcInternalError())
       else
-      Assert (points.find(i) == points.end(),
-             ExcInternalError());
+        Assert (points.find(i) == points.end(),
+                ExcInternalError());
 }
 
 
index bf8d37b040df8c9283feef2e2467ea0e501b7241..619067c8ea31cda616217b27e0eece6b121366f2 100644 (file)
@@ -59,7 +59,7 @@ helmholtz_operator (const MatrixFree<dim,Number>  &data,
   FEEvaluation<dim,fe_degree,fe_degree+1,1,Number> fe_eval (data);
   const unsigned int n_q_points = fe_eval.n_q_points;
 
-  for(unsigned int cell=cell_range.first;cell<cell_range.second;++cell)
+  for (unsigned int cell=cell_range.first; cell<cell_range.second; ++cell)
     {
       fe_eval.reinit (cell);
 
@@ -80,7 +80,7 @@ helmholtz_operator (const MatrixFree<dim,Number>  &data,
 template <int dim, int fe_degree, typename Number>
 class MatrixFreeTest
 {
- public:
+public:
   typedef VectorizedArray<Number> vector_t;
   static const std::size_t n_vectors = VectorizedArray<Number>::n_array_elements;
 
@@ -92,11 +92,11 @@ class MatrixFreeTest
               const parallel::distributed::Vector<Number> &src) const
   {
     dst = 0;
-    const std_cxx1x::function<void(const MatrixFree<dim,Number>  &,
-                                   parallel::distributed::Vector<Number>&,
-                                   const parallel::distributed::Vector<Number>&,
-                                   const std::pair<unsigned int,unsigned int>&)>
-      wrap = helmholtz_operator<dim,fe_degree,Number>;
+    const std_cxx1x::function<void(const MatrixFree<dim,Number> &,
+                                   parallel::distributed::Vector<Number> &,
+                                   const parallel::distributed::Vector<Number> &,
+                                   const std::pair<unsigned int,unsigned int> &)>
+    wrap = helmholtz_operator<dim,fe_degree,Number>;
     data.cell_loop (wrap, dst, src);
   };
 
@@ -117,9 +117,9 @@ void test ()
   GridGenerator::hyper_cube (tria);
   tria.refine_global(1);
   typename Triangulation<dim>::active_cell_iterator
-    cell = tria.begin_active (),
-    endc = tria.end();
-   cell = tria.begin_active ();
+  cell = tria.begin_active (),
+  endc = tria.end();
+  cell = tria.begin_active ();
   for (; cell!=endc; ++cell)
     if (cell->is_locally_owned())
       if (cell->center().norm()<0.2)
@@ -186,7 +186,7 @@ void test ()
     {
       const unsigned int glob_index =
         owned_set.nth_index_in_set (i);
-      if(constraints.is_constrained(glob_index))
+      if (constraints.is_constrained(glob_index))
         continue;
       in.local_element(i) = (double)rand()/RAND_MAX;
     }
@@ -194,9 +194,9 @@ void test ()
   mf.vmult (out, in);
 
 
-                                // assemble trilinos sparse matrix with
-                                // (\nabla v, \nabla u) + (v, 10 * u) for
-                                // reference
+  // assemble trilinos sparse matrix with
+  // (\nabla v, \nabla u) + (v, 10 * u) for
+  // reference
   TrilinosWrappers::SparseMatrix sparse_matrix;
   {
     TrilinosWrappers::SparsityPattern csp (owned_set, MPI_COMM_WORLD);
@@ -219,32 +219,32 @@ void test ()
     std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     typename DoFHandler<dim>::active_cell_iterator
-      cell = dof.begin_active(),
-      endc = dof.end();
+    cell = dof.begin_active(),
+    endc = dof.end();
     for (; cell!=endc; ++cell)
       if (cell->is_locally_owned())
-      {
-        cell_matrix = 0;
-        fe_values.reinit (cell);
-
-        for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-          for (unsigned int i=0; i<dofs_per_cell; ++i)
-            {
-              for (unsigned int j=0; j<dofs_per_cell; ++j)
-                cell_matrix(i,j) += ((fe_values.shape_grad(i,q_point) *
-                                      fe_values.shape_grad(j,q_point)
-                                      +
-                                      10. *
-                                      fe_values.shape_value(i,q_point) *
-                                      fe_values.shape_value(j,q_point)) *
-                                     fe_values.JxW(q_point));
-            }
-
-        cell->get_dof_indices(local_dof_indices);
-        constraints.distribute_local_to_global (cell_matrix,
-                                                local_dof_indices,
-                                                sparse_matrix);
-      }
+        {
+          cell_matrix = 0;
+          fe_values.reinit (cell);
+
+          for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+            for (unsigned int i=0; i<dofs_per_cell; ++i)
+              {
+                for (unsigned int j=0; j<dofs_per_cell; ++j)
+                  cell_matrix(i,j) += ((fe_values.shape_grad(i,q_point) *
+                                        fe_values.shape_grad(j,q_point)
+                                        +
+                                        10. *
+                                        fe_values.shape_value(i,q_point) *
+                                        fe_values.shape_value(j,q_point)) *
+                                       fe_values.JxW(q_point));
+              }
+
+          cell->get_dof_indices(local_dof_indices);
+          constraints.distribute_local_to_global (cell_matrix,
+                                                  local_dof_indices,
+                                                  sparse_matrix);
+        }
   }
   sparse_matrix.compress(VectorOperation::add);
 
@@ -256,7 +256,7 @@ void test ()
 }
 
 
-int main (int argc, char ** argv)
+int main (int argc, char **argv)
 {
   Utilities::System::MPI_InitFinalize mpi_initialization(argc, argv,
                                                          numbers::invalid_unsigned_int);
index 047646ffe82fb6f51893676b45dd482fd707e291..a9b26a05124031d9d9002d121fb3eae165be7a3a 100644 (file)
@@ -51,7 +51,7 @@ helmholtz_operator (const MatrixFree<dim,Number>  &data,
   FEEvaluation<dim,fe_degree,fe_degree+1,1,Number> fe_eval (data);
   const unsigned int n_q_points = fe_eval.n_q_points;
 
-  for(unsigned int cell=cell_range.first;cell<cell_range.second;++cell)
+  for (unsigned int cell=cell_range.first; cell<cell_range.second; ++cell)
     {
       fe_eval.reinit (cell);
 
@@ -72,7 +72,7 @@ helmholtz_operator (const MatrixFree<dim,Number>  &data,
 template <int dim, int fe_degree, typename Number>
 class MatrixFreeTest
 {
- public:
+public:
   typedef VectorizedArray<Number> vector_t;
   static const std::size_t n_vectors = VectorizedArray<Number>::n_array_elements;
 
@@ -84,11 +84,11 @@ class MatrixFreeTest
               const parallel::distributed::Vector<Number> &src) const
   {
     dst = 0;
-    const std_cxx1x::function<void(const MatrixFree<dim,Number>  &,
-                                   parallel::distributed::Vector<Number>&,
-                                   const parallel::distributed::Vector<Number>&,
-                                   const std::pair<unsigned int,unsigned int>&)>
-      wrap = helmholtz_operator<dim,fe_degree,Number>;
+    const std_cxx1x::function<void(const MatrixFree<dim,Number> &,
+                                   parallel::distributed::Vector<Number> &,
+                                   const parallel::distributed::Vector<Number> &,
+                                   const std::pair<unsigned int,unsigned int> &)>
+    wrap = helmholtz_operator<dim,fe_degree,Number>;
     data.cell_loop (wrap, dst, src);
   };
 
@@ -109,9 +109,9 @@ void test ()
   GridGenerator::hyper_cube (tria);
   tria.refine_global(1);
   typename Triangulation<dim>::active_cell_iterator
-    cell = tria.begin_active (),
-    endc = tria.end();
-   cell = tria.begin_active ();
+  cell = tria.begin_active (),
+  endc = tria.end();
+  cell = tria.begin_active ();
   for (; cell!=endc; ++cell)
     if (cell->is_locally_owned())
       if (cell->center().norm()<0.2)
@@ -178,7 +178,7 @@ void test ()
     {
       const unsigned int glob_index =
         owned_set.nth_index_in_set (i);
-      if(constraints.is_constrained(glob_index))
+      if (constraints.is_constrained(glob_index))
         continue;
       in.local_element(i) = (double)rand()/RAND_MAX;
     }
@@ -218,8 +218,8 @@ void test ()
       MPI_Barrier(MPI_COMM_WORLD);
       deallog << "Norm of difference:";
 
-                                // run 10 times to make a possible error more
-                                // likely to show up
+      // run 10 times to make a possible error more
+      // likely to show up
       for (unsigned int run=0; run<10; ++run)
         {
           mf.vmult (out, in);
@@ -233,7 +233,7 @@ void test ()
 }
 
 
-int main (int argc, char ** argv)
+int main (int argc, char **argv)
 {
   Utilities::System::MPI_InitFinalize mpi_initialization(argc, argv,
                                                          numbers::invalid_unsigned_int);
index 812d183c9f8f42e27f5fb5eec5f7fa2fe76f6efe..ecb62403c79e09dd5776b4dc86a32b78f6fa2d06 100644 (file)
@@ -53,7 +53,7 @@ helmholtz_operator (const MatrixFree<dim,Number>  &data,
   FEEvaluation<dim,fe_degree,fe_degree+1,2,Number> fe_eval (data);
   const unsigned int n_q_points = fe_eval.n_q_points;
 
-  for(unsigned int cell=cell_range.first;cell<cell_range.second;++cell)
+  for (unsigned int cell=cell_range.first; cell<cell_range.second; ++cell)
     {
       fe_eval.reinit (cell);
 
@@ -75,7 +75,7 @@ helmholtz_operator (const MatrixFree<dim,Number>  &data,
 template <int dim, int fe_degree, typename Number>
 class MatrixFreeTest
 {
- public:
+public:
   typedef VectorizedArray<Number> vector_t;
   static const std::size_t n_vectors = VectorizedArray<Number>::n_array_elements;
 
@@ -88,11 +88,11 @@ class MatrixFreeTest
   {
     for (unsigned int i=0; i<dst.size(); ++i)
       dst[i] = 0;
-    const std_cxx1x::function<void(const MatrixFree<dim,Number>  &,
-                                   std::vector<parallel::distributed::Vector<Number> >&,
-                                   const std::vector<parallel::distributed::Vector<Number> >&,
-                                   const std::pair<unsigned int,unsigned int>&)>
-      wrap = helmholtz_operator<dim,fe_degree,Number>;
+    const std_cxx1x::function<void(const MatrixFree<dim,Number> &,
+                                   std::vector<parallel::distributed::Vector<Number> > &,
+                                   const std::vector<parallel::distributed::Vector<Number> > &,
+                                   const std::pair<unsigned int,unsigned int> &)>
+    wrap = helmholtz_operator<dim,fe_degree,Number>;
     data.cell_loop (wrap, dst, src);
   };
 
@@ -113,9 +113,9 @@ void test ()
   GridGenerator::hyper_cube (tria);
   tria.refine_global(1);
   typename Triangulation<dim>::active_cell_iterator
-    cell = tria.begin_active (),
-    endc = tria.end();
-   cell = tria.begin_active ();
+  cell = tria.begin_active (),
+  endc = tria.end();
+  cell = tria.begin_active ();
   for (; cell!=endc; ++cell)
     if (cell->is_locally_owned())
       if (cell->center().norm()<0.2)
@@ -186,7 +186,7 @@ void test ()
     {
       const unsigned int glob_index =
         owned_set.nth_index_in_set (i);
-      if(constraints.is_constrained(glob_index))
+      if (constraints.is_constrained(glob_index))
         continue;
       in[0].local_element(i) = (double)rand()/RAND_MAX;
       in[1].local_element(i) = (double)rand()/RAND_MAX;
@@ -195,9 +195,9 @@ void test ()
   mf.vmult (out, in);
 
 
-                                // assemble trilinos sparse matrix with
-                                // (\nabla v, \nabla u) + (v, 10 * u) for
-                                // reference
+  // assemble trilinos sparse matrix with
+  // (\nabla v, \nabla u) + (v, 10 * u) for
+  // reference
   TrilinosWrappers::SparseMatrix sparse_matrix;
   {
     TrilinosWrappers::SparsityPattern csp (owned_set, MPI_COMM_WORLD);
@@ -220,32 +220,32 @@ void test ()
     std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     typename DoFHandler<dim>::active_cell_iterator
-      cell = dof.begin_active(),
-      endc = dof.end();
+    cell = dof.begin_active(),
+    endc = dof.end();
     for (; cell!=endc; ++cell)
       if (cell->is_locally_owned())
-      {
-        cell_matrix = 0;
-        fe_values.reinit (cell);
-
-        for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-          for (unsigned int i=0; i<dofs_per_cell; ++i)
-            {
-              for (unsigned int j=0; j<dofs_per_cell; ++j)
-                cell_matrix(i,j) += ((fe_values.shape_grad(i,q_point) *
-                                      fe_values.shape_grad(j,q_point)
-                                      +
-                                      10. *
-                                      fe_values.shape_value(i,q_point) *
-                                      fe_values.shape_value(j,q_point)) *
-                                     fe_values.JxW(q_point));
-            }
-
-        cell->get_dof_indices(local_dof_indices);
-        constraints.distribute_local_to_global (cell_matrix,
-                                                local_dof_indices,
-                                                sparse_matrix);
-      }
+        {
+          cell_matrix = 0;
+          fe_values.reinit (cell);
+
+          for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+            for (unsigned int i=0; i<dofs_per_cell; ++i)
+              {
+                for (unsigned int j=0; j<dofs_per_cell; ++j)
+                  cell_matrix(i,j) += ((fe_values.shape_grad(i,q_point) *
+                                        fe_values.shape_grad(j,q_point)
+                                        +
+                                        10. *
+                                        fe_values.shape_value(i,q_point) *
+                                        fe_values.shape_value(j,q_point)) *
+                                       fe_values.JxW(q_point));
+              }
+
+          cell->get_dof_indices(local_dof_indices);
+          constraints.distribute_local_to_global (cell_matrix,
+                                                  local_dof_indices,
+                                                  sparse_matrix);
+        }
   }
   sparse_matrix.compress(VectorOperation::add);
 
@@ -261,7 +261,7 @@ void test ()
 }
 
 
-int main (int argc, char ** argv)
+int main (int argc, char **argv)
 {
   Utilities::System::MPI_InitFinalize mpi_initialization(argc, argv,
                                                          numbers::invalid_unsigned_int);
index dd18227532d360b462499c3567ee2c7f87b9ece1..f99610b8f99c0984588ee7429b09eceb76a3148f 100644 (file)
@@ -54,7 +54,7 @@ helmholtz_operator (const MatrixFree<dim,Number>  &data,
   FEEvaluation<dim,fe_degree,fe_degree+1,2,Number> fe_eval (data);
   const unsigned int n_q_points = fe_eval.n_q_points;
 
-  for(unsigned int cell=cell_range.first;cell<cell_range.second;++cell)
+  for (unsigned int cell=cell_range.first; cell<cell_range.second; ++cell)
     {
       fe_eval.reinit (cell);
 
@@ -76,7 +76,7 @@ helmholtz_operator (const MatrixFree<dim,Number>  &data,
 template <int dim, int fe_degree, typename Number>
 class MatrixFreeTest
 {
- public:
+public:
   typedef VectorizedArray<Number> vector_t;
   static const std::size_t n_vectors = VectorizedArray<Number>::n_array_elements;
 
@@ -88,11 +88,11 @@ class MatrixFreeTest
               const parallel::distributed::BlockVector<Number> &src) const
   {
     dst = 0;
-    const std_cxx1x::function<void(const MatrixFree<dim,Number>  &,
+    const std_cxx1x::function<void(const MatrixFree<dim,Number> &,
                                    parallel::distributed::BlockVector<Number> &,
                                    const parallel::distributed::BlockVector<Number> &,
-                                   const std::pair<unsigned int,unsigned int>&)>
-      wrap = helmholtz_operator<dim,fe_degree,Number>;
+                                   const std::pair<unsigned int,unsigned int> &)>
+    wrap = helmholtz_operator<dim,fe_degree,Number>;
     data.cell_loop (wrap, dst, src);
   };
 
@@ -113,9 +113,9 @@ void test ()
   GridGenerator::hyper_cube (tria);
   tria.refine_global(1);
   typename Triangulation<dim>::active_cell_iterator
-    cell = tria.begin_active (),
-    endc = tria.end();
-   cell = tria.begin_active ();
+  cell = tria.begin_active (),
+  endc = tria.end();
+  cell = tria.begin_active ();
   for (; cell!=endc; ++cell)
     if (cell->is_locally_owned())
       if (cell->center().norm()<0.2)
@@ -189,7 +189,7 @@ void test ()
     {
       const unsigned int glob_index =
         owned_set.nth_index_in_set (i);
-      if(constraints.is_constrained(glob_index))
+      if (constraints.is_constrained(glob_index))
         continue;
       in.block(0).local_element(i) = (double)rand()/RAND_MAX;
       in.block(1).local_element(i) = (double)rand()/RAND_MAX;
@@ -198,9 +198,9 @@ void test ()
   mf.vmult (out, in);
 
 
-                                // assemble trilinos sparse matrix with
-                                // (\nabla v, \nabla u) + (v, 10 * u) for
-                                // reference
+  // assemble trilinos sparse matrix with
+  // (\nabla v, \nabla u) + (v, 10 * u) for
+  // reference
   TrilinosWrappers::SparseMatrix sparse_matrix;
   {
     TrilinosWrappers::SparsityPattern csp (owned_set, MPI_COMM_WORLD);
@@ -222,32 +222,32 @@ void test ()
     std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
     typename DoFHandler<dim>::active_cell_iterator
-      cell = dof.begin_active(),
-      endc = dof.end();
+    cell = dof.begin_active(),
+    endc = dof.end();
     for (; cell!=endc; ++cell)
       if (cell->is_locally_owned())
-      {
-        cell_matrix = 0;
-        fe_values.reinit (cell);
-
-        for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-          for (unsigned int i=0; i<dofs_per_cell; ++i)
-            {
-              for (unsigned int j=0; j<dofs_per_cell; ++j)
-                cell_matrix(i,j) += ((fe_values.shape_grad(i,q_point) *
-                                      fe_values.shape_grad(j,q_point)
-                                      +
-                                      10. *
-                                      fe_values.shape_value(i,q_point) *
-                                      fe_values.shape_value(j,q_point)) *
-                                     fe_values.JxW(q_point));
-            }
-
-        cell->get_dof_indices(local_dof_indices);
-        constraints.distribute_local_to_global (cell_matrix,
-                                                local_dof_indices,
-                                                sparse_matrix);
-      }
+        {
+          cell_matrix = 0;
+          fe_values.reinit (cell);
+
+          for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+            for (unsigned int i=0; i<dofs_per_cell; ++i)
+              {
+                for (unsigned int j=0; j<dofs_per_cell; ++j)
+                  cell_matrix(i,j) += ((fe_values.shape_grad(i,q_point) *
+                                        fe_values.shape_grad(j,q_point)
+                                        +
+                                        10. *
+                                        fe_values.shape_value(i,q_point) *
+                                        fe_values.shape_value(j,q_point)) *
+                                       fe_values.JxW(q_point));
+              }
+
+          cell->get_dof_indices(local_dof_indices);
+          constraints.distribute_local_to_global (cell_matrix,
+                                                  local_dof_indices,
+                                                  sparse_matrix);
+        }
   }
   sparse_matrix.compress(VectorOperation::add);
 
@@ -263,7 +263,7 @@ void test ()
 }
 
 
-int main (int argc, char ** argv)
+int main (int argc, char **argv)
 {
   Utilities::System::MPI_InitFinalize mpi_initialization(argc, argv,
                                                          numbers::invalid_unsigned_int);
index f30e082c9cf410cbecb998e5aeacfd14450d07bc..9825575b54f55514eb3de3d367e7ddb3369f0722 100644 (file)
@@ -48,127 +48,127 @@ using namespace dealii;
 template <int dim>
 class Local : public Subscriptor
 {
-  public:
-    typedef MeshWorker::IntegrationInfo<dim> CellInfo;
-    
-    void cell(MeshWorker::DoFInfo<dim>& dinfo, CellInfo& info) const;
-    void bdry(MeshWorker::DoFInfo<dim>& dinfo, CellInfo& info) const;
-    void face(MeshWorker::DoFInfo<dim>& dinfo1, MeshWorker::DoFInfo<dim>& dinfo2,
-             CellInfo& info1, CellInfo& info2) const;
-
-    bool cells;
-    bool faces;
+public:
+  typedef MeshWorker::IntegrationInfo<dim> CellInfo;
+
+  void cell(MeshWorker::DoFInfo<dim> &dinfo, CellInfo &info) const;
+  void bdry(MeshWorker::DoFInfo<dim> &dinfo, CellInfo &info) const;
+  void face(MeshWorker::DoFInfo<dim> &dinfo1, MeshWorker::DoFInfo<dim> &dinfo2,
+            CellInfo &info1, CellInfo &info2) const;
+
+  bool cells;
+  bool faces;
 };
 
 template <int dim>
 void
-Local<dim>::cell(MeshWorker::DoFInfo<dim>& info, CellInfo&) const
+Local<dim>::cell(MeshWorker::DoFInfo<dim> &info, CellInfo &) const
 {
   if (!cells) return;
-  for (unsigned int k=0;k<info.n_matrices();++k)
+  for (unsigned int k=0; k<info.n_matrices(); ++k)
     {
       const unsigned int block_row = info.matrix(k).row;
       const unsigned int block_col = info.matrix(k).column;
-      FullMatrix<double>M1 = info.matrix(k).matrix;
+      FullMatrix<double> &M1 = info.matrix(k).matrix;
       if (block_row == block_col)
-       for (unsigned int i=0;i<M1.m();++i)
-         for (unsigned int j=0;j<M1.n();++j)
-           {
-             M1(i,j) = 10.;
-           }
+        for (unsigned int i=0; i<M1.m(); ++i)
+          for (unsigned int j=0; j<M1.n(); ++j)
+            {
+              M1(i,j) = 10.;
+            }
     }
 }
 
 
 template <int dim>
 void
-Local<dim>::bdry(MeshWorker::DoFInfo<dim>& info, CellInfo&) const
+Local<dim>::bdry(MeshWorker::DoFInfo<dim> &info, CellInfo &) const
 {
   if (!faces) return;
-  for (unsigned int k=0;k<info.n_matrices();++k)
+  for (unsigned int k=0; k<info.n_matrices(); ++k)
     {
       const unsigned int block_row = info.matrix(k).row;
       const unsigned int block_col = info.matrix(k).column;
-      FullMatrix<double>M1 = info.matrix(k).matrix;
+      FullMatrix<double> &M1 = info.matrix(k).matrix;
       if (block_row == block_col)
-       for (unsigned int i=0;i<M1.m();++i)
-         for (unsigned int j=0;j<M1.n();++j)
-           {
-             M1(i,j) = 1.;
-           }
+        for (unsigned int i=0; i<M1.m(); ++i)
+          for (unsigned int j=0; j<M1.n(); ++j)
+            {
+              M1(i,j) = 1.;
+            }
     }
 }
 
 
 template <int dim>
 void
-Local<dim>::face(MeshWorker::DoFInfo<dim>& info1, MeshWorker::DoFInfo<dim>& info2,
-                CellInfo&, CellInfo&) const
+Local<dim>::face(MeshWorker::DoFInfo<dim> &info1, MeshWorker::DoFInfo<dim> &info2,
+                 CellInfo &, CellInfo &) const
 {
   if (!faces) return;
-  for (unsigned int k=0;k<info1.n_matrices();++k)
+  for (unsigned int k=0; k<info1.n_matrices(); ++k)
     {
       const unsigned int block_row = info1.matrix(k).row;
       const unsigned int block_col = info1.matrix(k).column;
-      FullMatrix<double>M1 = info1.matrix(k).matrix;
+      FullMatrix<double> &M1 = info1.matrix(k).matrix;
       if (block_row == block_col)
-       for (unsigned int i=0;i<M1.m();++i)
-         for (unsigned int j=0;j<M1.n();++j)
-           {
-             info1.matrix(k,false).matrix(i,j) = 1.;
-             info2.matrix(k,false).matrix(i,j) = 1.;
-             info1.matrix(k,true).matrix(i,j) = -1.;
-             info2.matrix(k,true).matrix(i,j) = -1.;
-           }
+        for (unsigned int i=0; i<M1.m(); ++i)
+          for (unsigned int j=0; j<M1.n(); ++j)
+            {
+              info1.matrix(k,false).matrix(i,j) = 1.;
+              info2.matrix(k,false).matrix(i,j) = 1.;
+              info1.matrix(k,true).matrix(i,j) = -1.;
+              info2.matrix(k,true).matrix(i,j) = -1.;
+            }
     }
 }
 
 
 template <int dim>
 void
-test_simple(DoFHandler<dim>dofs, bool faces)
+test_simple(DoFHandler<dim> &dofs, bool faces)
 {
   TrilinosWrappers::SparseMatrix matrix;
 
-  const FiniteElement<dim>fe = dofs.get_fe();
+  const FiniteElement<dim> &fe = dofs.get_fe();
   CompressedSimpleSparsityPattern csp(dofs.n_dofs(), dofs.n_dofs());
   DoFTools::make_flux_sparsity_pattern (dofs, csp);
   matrix.reinit (dofs.locally_owned_dofs(), csp, MPI_COMM_WORLD, true);
-  
+
   Local<dim> local;
   local.cells = true;
   local.faces = faces;
 
   MappingQ1<dim> mapping;
-  
+
   MeshWorker::IntegrationInfoBox<dim> info_box;
   info_box.initialize_gauss_quadrature(1, 1, 1);
   info_box.initialize_update_flags();
   info_box.initialize(fe, mapping);
-  
+
   MeshWorker::DoFInfo<dim> dof_info(dofs.block_info());
-  
+
   MeshWorker::Assembler::MatrixSimple<TrilinosWrappers::SparseMatrix> assembler;
   assembler.initialize(matrix);
-  
+
   FilteredIterator<typename DoFHandler<dim>::active_cell_iterator>
-    cell(IteratorFilters::LocallyOwnedCell(), dofs.begin_active());
+  cell(IteratorFilters::LocallyOwnedCell(), dofs.begin_active());
   FilteredIterator<typename DoFHandler<dim>::active_cell_iterator>
-    end(IteratorFilters::LocallyOwnedCell(), dofs.end());
+  end(IteratorFilters::LocallyOwnedCell(), dofs.end());
 
   MeshWorker::loop<dim, dim, MeshWorker::DoFInfo<dim>, MeshWorker::IntegrationInfoBox<dim> >
-    (cell, end,
-     dof_info, info_box,
-     std_cxx1x::bind (&Local<dim>::cell, local, std_cxx1x::_1, std_cxx1x::_2),
-     std_cxx1x::bind (&Local<dim>::bdry, local, std_cxx1x::_1, std_cxx1x::_2),
-     std_cxx1x::bind (&Local<dim>::face, local, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3, std_cxx1x::_4),
-     assembler, true);
+  (cell, end,
+   dof_info, info_box,
+   std_cxx1x::bind (&Local<dim>::cell, local, std_cxx1x::_1, std_cxx1x::_2),
+   std_cxx1x::bind (&Local<dim>::bdry, local, std_cxx1x::_1, std_cxx1x::_2),
+   std_cxx1x::bind (&Local<dim>::face, local, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3, std_cxx1x::_4),
+   assembler, true);
 
   matrix.compress(VectorOperation::add);
   matrix.print(deallog.get_file_stream());
 }
 
-std::string id_to_string(const CellId & id)
+std::string id_to_string(const CellId &id)
 {
   std::ostringstream ss;
   ss << id;
@@ -178,11 +178,11 @@ std::string id_to_string(const CellId & id)
 
 template<int dim>
 void
-test(const FiniteElement<dim>fe)
+test(const FiniteElement<dim> &fe)
 {
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD,
-                                              Triangulation<dim>::none/*,
-                                                                        parallel::distributed::Triangulation<dim>::construct_multigrid_hierarchy*/);
+                                               Triangulation<dim>::none/*,
+                   parallel::distributed::Triangulation<dim>::construct_multigrid_hierarchy*/);
   GridGenerator::hyper_cube(tr);
   tr.refine_global(2);
   unsigned int myid=Utilities::MPI::this_mpi_process(MPI_COMM_WORLD);
@@ -191,7 +191,7 @@ test(const FiniteElement<dim>& fe)
   tr.execute_coarsening_and_refinement();
 
   deallog << "Triangulation levels";
-  for (unsigned int l=0;l<tr.n_levels();++l)
+  for (unsigned int l=0; l<tr.n_levels(); ++l)
     deallog << ' ' << l << ':' << tr.n_cells(l);
   deallog << std::endl;
 
@@ -204,71 +204,71 @@ test(const FiniteElement<dim>& fe)
   dofs.distribute_dofs(fe);
 
 
-  
+
   unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
   if (numprocs==1) // renumber DoFs
     {
       std::map<std::string,std::vector<types::global_dof_index> > dofmap;
       std::ifstream f("mesh_worker_matrix_01/ordering.2");
       while (!f.eof())
-       {
-         CellId id;
-         f >> id;
-         if (f.eof())
-           break;
-         std::vector<types::global_dof_index> & d = dofmap[id_to_string(id)];
-         d.reserve(fe.dofs_per_cell);
-         for (unsigned int i=0;i<fe.dofs_per_cell;++i)
-           {
-             unsigned int temp;
-             f >> temp;
-             d.push_back(temp);
-           }
-       }
+        {
+          CellId id;
+          f >> id;
+          if (f.eof())
+            break;
+          std::vector<types::global_dof_index> &d = dofmap[id_to_string(id)];
+          d.reserve(fe.dofs_per_cell);
+          for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
+            {
+              unsigned int temp;
+              f >> temp;
+              d.push_back(temp);
+            }
+        }
 
       for (typename DoFHandler<dim>::active_cell_iterator cell = dofs.begin_active();
-          cell != dofs.end(); ++cell)
-       {
-         if (!cell->is_locally_owned())
-           continue;
-         
-         std::vector<types::global_dof_index>  & renumbered = dofmap[id_to_string(cell->id())];
-         cell->set_dof_indices(renumbered);
-         cell->update_cell_dof_indices_cache();
-         
-       }      
+           cell != dofs.end(); ++cell)
+        {
+          if (!cell->is_locally_owned())
+            continue;
+
+          std::vector<types::global_dof_index>   &renumbered = dofmap[id_to_string(cell->id())];
+          cell->set_dof_indices(renumbered);
+          cell->update_cell_dof_indices_cache();
+
+        }
     }
-  
+
   if (0)
     {
       unsigned int myid=Utilities::MPI::this_mpi_process(MPI_COMM_WORLD);
       unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
-     
-      for (unsigned int i=0;i<numprocs;++i)
-       {
-         MPI_Barrier(MPI_COMM_WORLD);
-         if (myid==i)
-           {    
-             std::ofstream f("ordering", (myid>0)?std::ofstream::app:std::ofstream::out);
-             std::vector<types::global_dof_index> local_dof_indices (fe.dofs_per_cell);
-             for (typename DoFHandler<dim>::active_cell_iterator cell = dofs.begin_active();
-                  cell != dofs.end(); ++cell)
-               {
-                 if (!cell->is_locally_owned())
-                   continue;
-                 
-                 f << cell->id() << ' ';
-                 cell->get_dof_indices(local_dof_indices);
-                 for (unsigned int i=0;i<fe.dofs_per_cell;++i)
-                   f << local_dof_indices[i] << ' ';
-                 f << std::endl;
-               }
-             f.close();
-           }
-       }
-    }    
-  
-  
+
+      for (unsigned int i=0; i<numprocs; ++i)
+        {
+          MPI_Barrier(MPI_COMM_WORLD);
+          if (myid==i)
+            {
+              std::ofstream f("ordering", (myid>0)?std::ofstream::app:std::ofstream::out);
+              std::vector<types::global_dof_index> local_dof_indices (fe.dofs_per_cell);
+              for (typename DoFHandler<dim>::active_cell_iterator cell = dofs.begin_active();
+                   cell != dofs.end(); ++cell)
+                {
+                  if (!cell->is_locally_owned())
+                    continue;
+
+                  f << cell->id() << ' ';
+                  cell->get_dof_indices(local_dof_indices);
+                  for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
+                    f << local_dof_indices[i] << ' ';
+                  f << std::endl;
+                }
+              f.close();
+            }
+        }
+    }
+
+
   dofs.initialize_local_block_info();
   deallog << "DoFHandler " << dofs.n_dofs() << std::endl;
 
@@ -278,11 +278,11 @@ test(const FiniteElement<dim>& fe)
 }
 
 
-int main (int argc, char** argv)
+int main (int argc, char **argv)
 {
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
   MPILogInitAll i(__FILE__);
-  
+
   FE_DGP<2> p0(0);
   FE_Q<2>   q1(1);
   FESystem<2,2> sys1(p0,1,q1,1);
@@ -290,7 +290,7 @@ int main (int argc, char** argv)
   fe2.push_back(&p0);
   //  fe2.push_back(&q1);
   //fe2.push_back(&sys1);
-  
-  for (unsigned int i=0;i<fe2.size();++i)
+
+  for (unsigned int i=0; i<fe2.size(); ++i)
     test(*fe2[i]);
 }
index 862ee5320c2a85f533d2778bcd97c634ef6d588c..a4094355430cd8e22826216c5b45a90146f2fa83 100644 (file)
 #include <fstream>
 
 template<int dim>
-void output(parallel::distributed::Triangulation<dim> & tr)
+void output(parallel::distributed::Triangulation<dim> &tr)
 {
-    const std::string filename = ("mg_01/mesh." +
+  const std::string filename = ("mg_01/mesh." +
                                 Utilities::int_to_string
                                 (tr.locally_owned_subdomain(), 4) +
                                 ".fig");
-    std::ofstream stream(filename.c_str());
+  std::ofstream stream(filename.c_str());
 
-       GridOutFlags::XFig flags;
-       flags.color_by = GridOutFlags::XFig::level_subdomain_id;
-       GridOut out;
-       out.set_flags(flags);
+  GridOutFlags::XFig flags;
+  flags.color_by = GridOutFlags::XFig::level_subdomain_id;
+  GridOut out;
+  out.set_flags(flags);
 
-       out.write_xfig(tr, stream);
+  out.write_xfig(tr, stream);
 }
 
 template<int dim>
@@ -64,8 +64,8 @@ void test()
     deallog << "hyper_cube" << std::endl;
 
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD,
-                                              Triangulation<dim>::none,
-                                              parallel::distributed::Triangulation<dim>::construct_multigrid_hierarchy);
+                                               Triangulation<dim>::none,
+                                               parallel::distributed::Triangulation<dim>::construct_multigrid_hierarchy);
 
   GridGenerator::hyper_cube(tr);
   tr.refine_global(2);
@@ -75,14 +75,14 @@ void test()
 
   //tr.begin_active()->set_level_subdomain_id(1+myid);
 
-  for (unsigned int i=0;i<10;++i)
-  {
+  for (unsigned int i=0; i<10; ++i)
+    {
 
       MPI_Barrier(MPI_COMM_WORLD);
       if (myid==i)
         {
           deallog << "ID = " << i << std::endl;
-          for (unsigned int lvl=0;lvl<tr.n_levels();++lvl)
+          for (unsigned int lvl=0; lvl<tr.n_levels(); ++lvl)
             {
               typename Triangulation<dim>::cell_iterator
               cell = tr.begin(lvl),
@@ -97,11 +97,11 @@ void test()
             }
           deallog << std::endl;
         }
-  }
+    }
 
   if (myid==0)
     deallog << "my levels: " << tr.n_levels() << "<= global levels:" << tr.n_global_levels() << std::endl;
-  
+
 
 }
 
index 6ee25273cdd1fa0da3aa6a886c87deeb36a9f6ff..171f110facca7a86929fcfdaee56cc29407e4e84 100644 (file)
@@ -49,31 +49,31 @@ void test()
     deallog << "hyper_cube" << std::endl;
 
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD,
-                                              Triangulation<dim>::none,
-                                              parallel::distributed::Triangulation<dim>::construct_multigrid_hierarchy);
+                                               Triangulation<dim>::none,
+                                               parallel::distributed::Triangulation<dim>::construct_multigrid_hierarchy);
 
   GridGenerator::hyper_cube(tr);
   tr.refine_global(2);
   DoFHandler<dim> dofh(tr);
 
-    {
-          for (unsigned int lvl=0;lvl<tr.n_levels();++lvl)
-            {
-              deallog << "level " << lvl << ": ";
-              typename DoFHandler<dim>::cell_iterator
-              cell = dofh.begin(lvl),
-              endc = dofh.end(lvl);
-
-              for (;cell!=endc;++cell)
-                {
-                if (cell->level_subdomain_id()!=4294967294)
-                  deallog << cell->level_subdomain_id();
-                else
-                  deallog << "-";
-                }
-              deallog << std::endl;
-            }
-    }
+  {
+    for (unsigned int lvl=0; lvl<tr.n_levels(); ++lvl)
+      {
+        deallog << "level " << lvl << ": ";
+        typename DoFHandler<dim>::cell_iterator
+        cell = dofh.begin(lvl),
+        endc = dofh.end(lvl);
+
+        for (; cell!=endc; ++cell)
+          {
+            if (cell->level_subdomain_id()!=4294967294)
+              deallog << cell->level_subdomain_id();
+            else
+              deallog << "-";
+          }
+        deallog << std::endl;
+      }
+  }
 
   static const FE_DGP<dim> fe(0);
   Assert(dofh.has_active_dofs()==false, ExcInternalError());
@@ -88,25 +88,25 @@ void test()
 
   Assert(dofh.has_active_dofs()==true, ExcInternalError());
   Assert(dofh.has_level_dofs()==true, ExcInternalError());
-    {
-      deallog << "Levels: " << tr.n_global_levels() << std::endl;
-      std::cout << "Levels: " << tr.n_global_levels() << std::endl;
-      
-      deallog << "n_locally_owned_dofs_per_processor:" << std::endl;
-      for (unsigned int i=0; i<dofh.n_locally_owned_dofs_per_processor().size(); ++i)
-       deallog << dofh.n_locally_owned_dofs_per_processor()[i] << std::endl;
-
-      deallog << "locally_owned_mg_dofs_per_processor:" << std::endl;
-      for (unsigned int lvl=0;lvl<tr.n_global_levels();++lvl)
-       {
-         deallog << "level " << lvl << ":" << std::endl;
-         
-         const std::vector<IndexSet> & vec = dofh.locally_owned_mg_dofs_per_processor(lvl);
-      
-         for (unsigned int i=0; i<vec.size(); ++i)
-           deallog << vec[i].n_elements() << std::endl;
-       }
-    }
+  {
+    deallog << "Levels: " << tr.n_global_levels() << std::endl;
+    std::cout << "Levels: " << tr.n_global_levels() << std::endl;
+
+    deallog << "n_locally_owned_dofs_per_processor:" << std::endl;
+    for (unsigned int i=0; i<dofh.n_locally_owned_dofs_per_processor().size(); ++i)
+      deallog << dofh.n_locally_owned_dofs_per_processor()[i] << std::endl;
+
+    deallog << "locally_owned_mg_dofs_per_processor:" << std::endl;
+    for (unsigned int lvl=0; lvl<tr.n_global_levels(); ++lvl)
+      {
+        deallog << "level " << lvl << ":" << std::endl;
+
+        const std::vector<IndexSet> &vec = dofh.locally_owned_mg_dofs_per_processor(lvl);
+
+        for (unsigned int i=0; i<vec.size(); ++i)
+          deallog << vec[i].n_elements() << std::endl;
+      }
+  }
 }
 
 
index 86a10cd356d40ff59265737687559b30c312e3f6..0b5ce46215d49799c3978e9aa07a5a3816028baa 100644 (file)
@@ -54,7 +54,7 @@
 #include <fstream>
 
 template<int dim>
-void output(parallel::distributed::Triangulation<dim> & tr)
+void output(parallel::distributed::Triangulation<dim> &tr)
 {
   const std::string filename = ("mg_03/mesh." +
                                 Utilities::int_to_string
@@ -73,8 +73,8 @@ void test()
     deallog << "hyper_cube" << std::endl;
 
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD,
-                                              Triangulation<dim>::none,
-                                              parallel::distributed::Triangulation<dim>::construct_multigrid_hierarchy);
+                                               Triangulation<dim>::none,
+                                               parallel::distributed::Triangulation<dim>::construct_multigrid_hierarchy);
 
   GridGenerator::hyper_cube(tr);
   tr.refine_global(2);
@@ -87,26 +87,26 @@ void test()
   dofh.distribute_mg_dofs (fe);
 
   {
-    for (unsigned int lvl=0;lvl<tr.n_levels();++lvl)
+    for (unsigned int lvl=0; lvl<tr.n_levels(); ++lvl)
       {
-       deallog << "level " << lvl << ": ";
-       typename DoFHandler<dim>::cell_iterator
-         cell = dofh.begin(lvl),
-         endc = dofh.end(lvl);
-       
-       for (;cell!=endc;++cell)
-         {
-           std::vector<types::global_dof_index> dofs(fe.n_dofs_per_cell());
-           cell->get_mg_dof_indices(dofs);
-           
-           for (unsigned int i=0;i<dofs.size();++i)
-             if (dofs[i]==numbers::invalid_dof_index)
-               deallog << "- ";
-             else
-               deallog << dofs[i] << " ";
-           deallog << " | ";
-         }
-       deallog << std::endl;
+        deallog << "level " << lvl << ": ";
+        typename DoFHandler<dim>::cell_iterator
+        cell = dofh.begin(lvl),
+        endc = dofh.end(lvl);
+
+        for (; cell!=endc; ++cell)
+          {
+            std::vector<types::global_dof_index> dofs(fe.n_dofs_per_cell());
+            cell->get_mg_dof_indices(dofs);
+
+            for (unsigned int i=0; i<dofs.size(); ++i)
+              if (dofs[i]==numbers::invalid_dof_index)
+                deallog << "- ";
+              else
+                deallog << dofs[i] << " ";
+            deallog << " | ";
+          }
+        deallog << std::endl;
       }
   }
 
index 4c1366436a9170d23a7cccc80948525f84969727..e8b104a628549d9e0868f9890a1cf766f0a8bded 100644 (file)
 /*
 An error occurred in line <1344> of file </scratch/deal-trunk/deal.II/source/dofs/dof_handler_policy.cc> in function
     void dealii::internal::DoFHandler::Policy::{anonymous}::set_mg_dofindices_recursively(const dealii::parallel::distributed::Triangulation<dim, spacedim>&, const typename dealii::internal::p4est::types<dim>::quadrant&, const typename dealii::DoFHandler<dim, spacedim>::level_cell_iterator&, const typename dealii::internal::p4est::types<dim>::quadrant&, unsigned int*, unsigned int) [with int dim = 2; int spacedim = 2; typename dealii::internal::p4est::types<dim>::quadrant = p4est_quadrant; typename dealii::DoFHandler<dim, spacedim>::level_cell_iterator = dealii::TriaIterator<dealii::DoFCellAccessor<dealii::DoFHandler<2>, true> >]
-The violated condition was: 
+The violated condition was:
     (dof_indices[i] == (DoFHandler<dim,spacedim>::invalid_dof_index)) || (dof_indices[i]==dofs[i])
 The name and call sequence of the exception was:
     ExcInternalError()
-Additional Information: 
+Additional Information:
 (none)
 */
 
@@ -51,7 +51,7 @@ Additional Information:
 #include <fstream>
 
 template<int dim>
-void output(parallel::distributed::Triangulation<dim> & tr)
+void output(parallel::distributed::Triangulation<dim> &tr)
 {
   const std::string filename = ("mg_04/mesh." +
                                 Utilities::int_to_string
@@ -70,8 +70,8 @@ void test()
     deallog << "hyper_cube" << std::endl;
 
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD,
-                                              Triangulation<dim>::none,
-                                              parallel::distributed::Triangulation<dim>::construct_multigrid_hierarchy);
+                                               Triangulation<dim>::none,
+                                               parallel::distributed::Triangulation<dim>::construct_multigrid_hierarchy);
   GridGenerator::hyper_cube(tr);
   tr.refine_global(2);
   DoFHandler<dim> dofh(tr);
@@ -83,29 +83,29 @@ void test()
   dofh.distribute_mg_dofs (fe);
 
   {
-    for (unsigned int lvl=0;lvl<tr.n_levels();++lvl)
+    for (unsigned int lvl=0; lvl<tr.n_levels(); ++lvl)
       {
-       deallog << "level " << lvl << ": ";
-       typename DoFHandler<dim>::cell_iterator
-         cell = dofh.begin(lvl),
-         endc = dofh.end(lvl);
-       
-       for (;cell!=endc;++cell)
-         {
-           std::vector<types::global_dof_index> dofs(fe.n_dofs_per_cell());
-           cell->get_mg_dof_indices(dofs);
-           
-           for (unsigned int i=0;i<dofs.size();++i)
-             if (dofs[i]==numbers::invalid_dof_index)
-               deallog << "- ";
-             else
-               deallog << dofs[i] << " ";
-           deallog << " | ";
-         }
-       deallog << std::endl;
+        deallog << "level " << lvl << ": ";
+        typename DoFHandler<dim>::cell_iterator
+        cell = dofh.begin(lvl),
+        endc = dofh.end(lvl);
+
+        for (; cell!=endc; ++cell)
+          {
+            std::vector<types::global_dof_index> dofs(fe.n_dofs_per_cell());
+            cell->get_mg_dof_indices(dofs);
+
+            for (unsigned int i=0; i<dofs.size(); ++i)
+              if (dofs[i]==numbers::invalid_dof_index)
+                deallog << "- ";
+              else
+                deallog << dofs[i] << " ";
+            deallog << " | ";
+          }
+        deallog << std::endl;
       }
   }
-  
+
   if (myid==0)
     deallog << "OK" << std::endl;
 }
index 716cc78e765aad661281fdb3ae0f6dbff92e7737..72b519329e51c29e3db4562aa83c34a2e91e8009 100644 (file)
@@ -175,7 +175,7 @@ namespace Step50
   {
     mg_dof_handler.distribute_dofs (fe);
     mg_dof_handler.distribute_mg_dofs (fe);
-    
+
     deallog << "Number of degrees of freedom: "
             << mg_dof_handler.n_dofs();
 
@@ -226,14 +226,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);
+                                            mg_dof_handler.locally_owned_mg_dofs(level),
+                                            csp,
+                                            MPI_COMM_WORLD, true);
       }
   }
 
@@ -353,7 +353,7 @@ namespace Step50
                                      fe_values.JxW(q_point));
 
           cell->get_mg_dof_indices (local_dof_indices);
-         
+
           boundary_constraints[cell->level()]
           .distribute_local_to_global (cell_matrix,
                                        local_dof_indices,
@@ -371,7 +371,7 @@ namespace Step50
                                        mg_interface_matrices[cell->level()]);
         }
 
-    for (unsigned int i=0;i<triangulation.n_global_levels();++i)
+    for (unsigned int i=0; i<triangulation.n_global_levels(); ++i)
       {
         mg_matrices[i].compress(VectorOperation::add);
         mg_interface_matrices[i].compress(VectorOperation::add);
@@ -440,7 +440,7 @@ namespace Step50
                                              idx);
     temp_solution.reinit(idx, MPI_COMM_WORLD);
     temp_solution = solution;
-    
+
     KellyErrorEstimator<dim>::estimate (static_cast<DoFHandler<dim>&>(mg_dof_handler),
                                         QGauss<dim-1>(3),
                                         typename FunctionMap<dim>::type(),
@@ -476,9 +476,9 @@ namespace Step50
                 << triangulation.n_global_active_cells()
                 << std::endl;
 
-       MPI_Barrier(MPI_COMM_WORLD);
+        MPI_Barrier(MPI_COMM_WORLD);
         setup_system ();
-       MPI_Barrier(MPI_COMM_WORLD);
+        MPI_Barrier(MPI_COMM_WORLD);
 
         deallog << "   Number of degrees of freedom: "
                 << mg_dof_handler.n_dofs()
@@ -489,11 +489,11 @@ namespace Step50
                       ? ")" : ", ");
         deallog << std::endl;
 
-       MPI_Barrier(MPI_COMM_WORLD);
+        MPI_Barrier(MPI_COMM_WORLD);
         assemble_system ();
-       MPI_Barrier(MPI_COMM_WORLD);
+        MPI_Barrier(MPI_COMM_WORLD);
         assemble_multigrid ();
-       MPI_Barrier(MPI_COMM_WORLD);
+        MPI_Barrier(MPI_COMM_WORLD);
         solve ();
       }
   }
index 32463f1e774eaf55ae45457248c497a81a7471a3..4c2b36faacff1748a8ba8dad4cb436ba4d532122 100644 (file)
@@ -175,7 +175,7 @@ namespace Step50
   {
     mg_dof_handler.distribute_dofs (fe);
     mg_dof_handler.distribute_mg_dofs (fe);
-    
+
     deallog << "Number of degrees of freedom: "
             << mg_dof_handler.n_dofs();
 
@@ -226,14 +226,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);
+                                            mg_dof_handler.locally_owned_mg_dofs(level),
+                                            csp,
+                                            MPI_COMM_WORLD, true);
       }
   }
 
@@ -353,7 +353,7 @@ namespace Step50
                                      fe_values.JxW(q_point));
 
           cell->get_mg_dof_indices (local_dof_indices);
-         
+
           boundary_constraints[cell->level()]
           .distribute_local_to_global (cell_matrix,
                                        local_dof_indices,
@@ -371,7 +371,7 @@ namespace Step50
                                        mg_interface_matrices[cell->level()]);
         }
 
-    for (unsigned int i=0;i<triangulation.n_global_levels();++i)
+    for (unsigned int i=0; i<triangulation.n_global_levels(); ++i)
       {
         mg_matrices[i].compress(VectorOperation::add);
         mg_interface_matrices[i].compress(VectorOperation::add);
@@ -463,16 +463,16 @@ namespace Step50
           }
         else
           triangulation.refine_global (1);
-          //refine_grid ();
+        //refine_grid ();
 
 
         deallog << "   Number of active cells:       "
                 << triangulation.n_global_active_cells()
                 << std::endl;
 
-       MPI_Barrier(MPI_COMM_WORLD);
+        MPI_Barrier(MPI_COMM_WORLD);
         setup_system ();
-       MPI_Barrier(MPI_COMM_WORLD);
+        MPI_Barrier(MPI_COMM_WORLD);
 
         deallog << "   Number of degrees of freedom: "
                 << mg_dof_handler.n_dofs()
@@ -483,11 +483,11 @@ namespace Step50
                       ? ")" : ", ");
         deallog << std::endl;
 
-       MPI_Barrier(MPI_COMM_WORLD);
+        MPI_Barrier(MPI_COMM_WORLD);
         assemble_system ();
-       MPI_Barrier(MPI_COMM_WORLD);
+        MPI_Barrier(MPI_COMM_WORLD);
         assemble_multigrid ();
-       MPI_Barrier(MPI_COMM_WORLD);
+        MPI_Barrier(MPI_COMM_WORLD);
         solve ();
       }
   }
index 46f14ba2f4c0295261ce76ce9de3672399fd06c9..e3a5ce17cc9105f63e76a328dcf7ca4ae92fbbad 100644 (file)
@@ -49,41 +49,41 @@ void test()
 
   parallel::distributed::Triangulation<dim> triangulation(MPI_COMM_WORLD);
 
-                               // create hypershell mesh and refine some
-                               // cells. use some large numbers which make
-                               // round-off influence more pronounced
+  // create hypershell mesh and refine some
+  // cells. use some large numbers which make
+  // round-off influence more pronounced
   const double R0      = 6371000.-2890000.;     /* m          */
   const double R1      = 6371000.-  35000.;     /* m          */
   GridGenerator::hyper_shell (triangulation,
-                             Point<dim>(),
-                             R0,
-                             R1,
-                             96, true);
+                              Point<dim>(),
+                              R0,
+                              R1,
+                              96, true);
   triangulation.refine_global (2);
 
   for (typename Triangulation<dim>::active_cell_iterator
-        cell = triangulation.begin_active();
+       cell = triangulation.begin_active();
        cell != triangulation.end(); ++cell)
     if (!cell->is_ghost() && !cell->is_artificial())
       if (cell->center()[2] > 0.75 * R1)
-       {
-         cell->set_refine_flag();
-         for (unsigned int c=0; c<8; ++c)
-           cell->parent()->child(c)->set_refine_flag();
-       }
+        {
+          cell->set_refine_flag();
+          for (unsigned int c=0; c<8; ++c)
+            cell->parent()->child(c)->set_refine_flag();
+        }
 
   {
     unsigned int n_flagged_cells = 0;
     for (typename Triangulation<dim>::active_cell_iterator
-          cell = triangulation.begin_active();
-        cell != triangulation.end(); ++cell)
+         cell = triangulation.begin_active();
+         cell != triangulation.end(); ++cell)
       if (!cell->is_ghost() && !cell->is_artificial())
-       if (cell->refine_flag_set())
-         ++n_flagged_cells;
+        if (cell->refine_flag_set())
+          ++n_flagged_cells;
 
     unsigned int global_f_c = 0;
     MPI_Allreduce (&n_flagged_cells, &global_f_c, 1, MPI_UNSIGNED,
-                  MPI_SUM, MPI_COMM_WORLD);
+                   MPI_SUM, MPI_COMM_WORLD);
     if (myid == 0)
       deallog << "# flagged cells = " << global_f_c << std::endl;
   }
@@ -93,16 +93,16 @@ void test()
 
   if (myid == 0)
     deallog <<  "#cells = " << triangulation.n_global_active_cells()
-           << std::endl;
+            << std::endl;
 
-                               // create FE_System and fill in no-normal flux
-                               // conditions on boundary 1 (outer)
+  // create FE_System and fill in no-normal flux
+  // conditions on boundary 1 (outer)
   static const FESystem<dim> fe(FE_Q<dim> (1), dim);
   DoFHandler<dim> dofh(triangulation);
   dofh.distribute_dofs (fe);
   if (myid == 0)
     deallog <<  "#dofs = " << dofh.locally_owned_dofs().size()
-           << std::endl;
+            << std::endl;
 
   IndexSet relevant_set;
   DoFTools::extract_locally_relevant_dofs (dofh, relevant_set);
@@ -114,25 +114,25 @@ void test()
   no_normal_flux_boundaries.insert (1);
   const unsigned int degree = 1;
   VectorTools::compute_no_normal_flux_constraints (dofh, 0,
-                                                  no_normal_flux_boundaries,
-                                                  constraints,
-                                                  MappingQ<dim>(degree));
+                                                   no_normal_flux_boundaries,
+                                                   constraints,
+                                                   MappingQ<dim>(degree));
   constraints.close();
 
-                               // print the number of constraints. since
-                               // processors might write info in different
-                               // orders, copy all numbers to root processor
+  // print the number of constraints. since
+  // processors might write info in different
+  // orders, copy all numbers to root processor
   std::vector<unsigned int> n_constraints_glob (numprocs);
   unsigned int n_constraints = constraints.n_constraints();
   MPI_Gather (&n_constraints, 1, MPI_UNSIGNED,
-             &n_constraints_glob[0], 1, MPI_UNSIGNED, 0, MPI_COMM_WORLD);
+              &n_constraints_glob[0], 1, MPI_UNSIGNED, 0, MPI_COMM_WORLD);
   if (myid == 0)
     for (unsigned int i=0; i<numprocs; ++i)
       deallog <<  "#constraints on " << i << ": " << n_constraints_glob[i]
-             << std::endl;
+              << std::endl;
 
-                               // dummy assembly: put 1 in all components of
-                               // the vector
+  // dummy assembly: put 1 in all components of
+  // the vector
   TrilinosWrappers::MPI::Vector vector;
   vector.reinit (dofh.locally_owned_dofs(), MPI_COMM_WORLD);
   {
@@ -142,22 +142,22 @@ void test()
     for (unsigned int i=0; i<dofs_per_cell; ++i)
       local_vector(i) = 1.;
     typename DoFHandler<dim>::active_cell_iterator
-      cell = dofh.begin_active(),
-      endc = dofh.end();
+    cell = dofh.begin_active(),
+    endc = dofh.end();
     for (; cell!=endc; ++cell)
       if (cell->subdomain_id() == triangulation.locally_owned_subdomain())
-       {
-         cell->get_dof_indices (local_dof_indices);
-         constraints.distribute_local_to_global (local_vector,
-                                                 local_dof_indices,
-                                                 vector);
-       }
+        {
+          cell->get_dof_indices (local_dof_indices);
+          constraints.distribute_local_to_global (local_vector,
+                                                  local_dof_indices,
+                                                  vector);
+        }
     vector.compress (VectorOperation::add);
   }
 
-                               // now check that no entries were generated
-                               // for constrained entries on the locally
-                               // owned range.
+  // now check that no entries were generated
+  // for constrained entries on the locally
+  // owned range.
   const std::pair<unsigned int,unsigned int> range = vector.local_range();
   for (unsigned int i=range.first; i<range.second; ++i)
     if (constraints.is_constrained(i))
@@ -179,14 +179,14 @@ int main(int argc, char *argv[])
 
     if (myid == 0)
       {
-       std::ofstream logfile(output_file_for_mpi("no_flux_constraints").c_str());
-       deallog.attach(logfile);
-       deallog.depth_console(0);
-       deallog.threshold_double(1.e-10);
-
-       deallog.push("3d");
-       test<3>();
-       deallog.pop();
+        std::ofstream logfile(output_file_for_mpi("no_flux_constraints").c_str());
+        deallog.attach(logfile);
+        deallog.depth_console(0);
+        deallog.threshold_double(1.e-10);
+
+        deallog.push("3d");
+        test<3>();
+        deallog.pop();
       }
     else
       test<3>();
index 0332638b8028912200c37a552b8e02049aeb46ed..9f4c3e38916917bf39e2556d4f95ebfb9f9375f7 100644 (file)
@@ -52,41 +52,41 @@ void test()
 
   parallel::distributed::Triangulation<dim> triangulation(MPI_COMM_WORLD);
 
-                               // create hypershell mesh and refine some
-                               // cells. use some large numbers which make
-                               // round-off influence more pronounced
+  // create hypershell mesh and refine some
+  // cells. use some large numbers which make
+  // round-off influence more pronounced
   const double R0      = 6371000.-2890000.;     /* m          */
   const double R1      = 6371000.-  35000.;     /* m          */
   GridGenerator::hyper_shell (triangulation,
-                             Point<dim>(),
-                             R0,
-                             R1,
-                             96, true);
+                              Point<dim>(),
+                              R0,
+                              R1,
+                              96, true);
   triangulation.refine_global (2);
 
   for (typename Triangulation<dim>::active_cell_iterator
-        cell = triangulation.begin_active();
+       cell = triangulation.begin_active();
        cell != triangulation.end(); ++cell)
     if (!cell->is_ghost() && !cell->is_artificial())
       if (cell->center()[2] > 0.75 * R1)
-       {
-         cell->set_refine_flag();
-         for (unsigned int c=0; c<8; ++c)
-           cell->parent()->child(c)->set_refine_flag();
-       }
+        {
+          cell->set_refine_flag();
+          for (unsigned int c=0; c<8; ++c)
+            cell->parent()->child(c)->set_refine_flag();
+        }
 
   {
     unsigned int n_flagged_cells = 0;
     for (typename Triangulation<dim>::active_cell_iterator
-          cell = triangulation.begin_active();
-        cell != triangulation.end(); ++cell)
+         cell = triangulation.begin_active();
+         cell != triangulation.end(); ++cell)
       if (!cell->is_ghost() && !cell->is_artificial())
-       if (cell->refine_flag_set())
-         ++n_flagged_cells;
+        if (cell->refine_flag_set())
+          ++n_flagged_cells;
 
     unsigned int global_f_c = 0;
     MPI_Allreduce (&n_flagged_cells, &global_f_c, 1, MPI_UNSIGNED,
-                  MPI_SUM, MPI_COMM_WORLD);
+                   MPI_SUM, MPI_COMM_WORLD);
     if (myid == 0)
       deallog << "# flagged cells = " << global_f_c << std::endl;
   }
@@ -96,10 +96,10 @@ void test()
 
   if (myid == 0)
     deallog <<  "#cells = " << triangulation.n_global_active_cells()
-           << std::endl;
+            << std::endl;
 
-                               // create FE_System and fill in no-normal flux
-                               // conditions on boundary 1 (outer)
+  // create FE_System and fill in no-normal flux
+  // conditions on boundary 1 (outer)
   static const FESystem<dim> fe(FE_Q<dim> (1), dim);
   DoFHandler<dim> dofh(triangulation);
   dofh.distribute_dofs (fe);
@@ -107,7 +107,7 @@ void test()
 
   if (myid == 0)
     deallog <<  "#dofs = " << dofh.locally_owned_dofs().size()
-           << std::endl;
+            << std::endl;
 
   IndexSet relevant_set;
   DoFTools::extract_locally_relevant_dofs (dofh, relevant_set);
@@ -118,64 +118,65 @@ void test()
   std::set<types::boundary_id> no_normal_flux_boundaries;
   no_normal_flux_boundaries.insert (1);
   const unsigned int degree = 1;
-/*  VectorTools::compute_no_normal_flux_constraints (dofh, 0,
-                                                  no_normal_flux_boundaries,
-                                                  constraints,
-                                                  MappingQ<dim>(degree));*/
+  /*  VectorTools::compute_no_normal_flux_constraints (dofh, 0,
+                 no_normal_flux_boundaries,
+                 constraints,
+                 MappingQ<dim>(degree));*/
   constraints.close();
 
   std::string base = output_file_for_mpi("no_flux_constraints_02");
 
   MPI_Barrier(MPI_COMM_WORLD);
 
-  { //write the constraintmatrix to a file on each cpu
-       std::string fname = base+"cm_" + Utilities::int_to_string(myid) + ".dot";
-       std::ofstream file(fname.c_str());
-       constraints.print(file);
+  {
+    //write the constraintmatrix to a file on each cpu
+    std::string fname = base+"cm_" + Utilities::int_to_string(myid) + ".dot";
+    std::ofstream file(fname.c_str());
+    constraints.print(file);
   }
   MPI_Barrier(MPI_COMM_WORLD);
   sleep(1);
   if (myid==0)
-  {
-       //sort and merge the constraint matrices on proc 0, generate a checksum
-       //and output that into the deallog
-       system((std::string("cat ") + base+"cm_?.dot|sort -n|uniq >" + base+"cm").c_str());
-       system((std::string("md5sum ") + base + "cm >" + base + "cm.check").c_str());
-       {
-         std::ifstream file((base+"cm.check").c_str());
-         std::string str;
-         while (!file.eof())
-         {
-               std::getline(file, str);
-               deallog << str << std::endl;
-         }
-       }
-                                        // delete the files created
-                                        // by processor 0
-       std::remove ((base + "cm").c_str());
-       std::remove ((base + "cm.check").c_str());
-  }
-
-                                  // remove tmp files again. wait
-                                  // till processor 0 has done its
-                                  // job with them
+    {
+      //sort and merge the constraint matrices on proc 0, generate a checksum
+      //and output that into the deallog
+      system((std::string("cat ") + base+"cm_?.dot|sort -n|uniq >" + base+"cm").c_str());
+      system((std::string("md5sum ") + base + "cm >" + base + "cm.check").c_str());
+      {
+        std::ifstream file((base+"cm.check").c_str());
+        std::string str;
+        while (!file.eof())
+          {
+            std::getline(file, str);
+            deallog << str << std::endl;
+          }
+      }
+      // delete the files created
+      // by processor 0
+      std::remove ((base + "cm").c_str());
+      std::remove ((base + "cm.check").c_str());
+    }
+
+  // remove tmp files again. wait
+  // till processor 0 has done its
+  // job with them
   MPI_Barrier(MPI_COMM_WORLD);
   std::remove ((base + "cm_" + Utilities::int_to_string(myid) + ".dot").c_str());
 
-                               // print the number of constraints. since
-                               // processors might write info in different
-                               // orders, copy all numbers to root processor
+  // print the number of constraints. since
+  // processors might write info in different
+  // orders, copy all numbers to root processor
   std::vector<unsigned int> n_constraints_glob (numprocs);
   unsigned int n_constraints = constraints.n_constraints();
   MPI_Gather (&n_constraints, 1, MPI_UNSIGNED,
-             &n_constraints_glob[0], 1, MPI_UNSIGNED, 0, MPI_COMM_WORLD);
+              &n_constraints_glob[0], 1, MPI_UNSIGNED, 0, MPI_COMM_WORLD);
   if (myid == 0)
     for (unsigned int i=0; i<numprocs; ++i)
       deallog <<  "#constraints on " << i << ": " << n_constraints_glob[i]
-             << std::endl;
+              << std::endl;
 
-                               // dummy assembly: put 1 in all components of
-                               // the vector
+  // dummy assembly: put 1 in all components of
+  // the vector
   TrilinosWrappers::MPI::Vector vector;
   vector.reinit (dofh.locally_owned_dofs(), MPI_COMM_WORLD);
   {
@@ -185,22 +186,22 @@ void test()
     for (unsigned int i=0; i<dofs_per_cell; ++i)
       local_vector(i) = 1.;
     typename DoFHandler<dim>::active_cell_iterator
-      cell = dofh.begin_active(),
-      endc = dofh.end();
+    cell = dofh.begin_active(),
+    endc = dofh.end();
     for (; cell!=endc; ++cell)
       if (cell->subdomain_id() == triangulation.locally_owned_subdomain())
-       {
-         cell->get_dof_indices (local_dof_indices);
-         constraints.distribute_local_to_global (local_vector,
-                                                 local_dof_indices,
-                                                 vector);
-       }
+        {
+          cell->get_dof_indices (local_dof_indices);
+          constraints.distribute_local_to_global (local_vector,
+                                                  local_dof_indices,
+                                                  vector);
+        }
     vector.compress (VectorOperation::add);
   }
 
-                               // now check that no entries were generated
-                               // for constrained entries on the locally
-                               // owned range.
+  // now check that no entries were generated
+  // for constrained entries on the locally
+  // owned range.
   const std::pair<unsigned int,unsigned int> range = vector.local_range();
   for (unsigned int i=range.first; i<range.second; ++i)
     if (constraints.is_constrained(i))
@@ -222,14 +223,14 @@ int main(int argc, char *argv[])
 
     if (myid == 0)
       {
-       std::ofstream logfile(output_file_for_mpi("no_flux_constraints_02").c_str());
-       deallog.attach(logfile);
-       deallog.depth_console(0);
-       deallog.threshold_double(1.e-10);
-
-       deallog.push("3d");
-       test<3>();
-       deallog.pop();
+        std::ofstream logfile(output_file_for_mpi("no_flux_constraints_02").c_str());
+        deallog.attach(logfile);
+        deallog.depth_console(0);
+        deallog.threshold_double(1.e-10);
+
+        deallog.push("3d");
+        test<3>();
+        deallog.pop();
       }
     else
       test<3>();
index f93ba5e6a31f5ca1fb30e07ded8f67d82f1d3658..0ea73accaf2f8b0e9230bbde86c68d660a88ecd9 100644 (file)
@@ -67,10 +67,10 @@ void test()
 
   if (myid == 0)
     deallog <<  "#cells = " << triangulation.n_global_active_cells()
-           << std::endl;
+            << std::endl;
 
-                               // create FE_System and fill in no-normal flux
-                               // conditions on boundary 1 (outer)
+  // create FE_System and fill in no-normal flux
+  // conditions on boundary 1 (outer)
   static const FESystem<dim> fe(FE_Q<dim> (1), dim);
   DoFHandler<dim> dofh(triangulation);
   dofh.distribute_dofs (fe);
@@ -78,7 +78,7 @@ void test()
 
   if (myid == 0)
     deallog <<  "#dofs = " << dofh.locally_owned_dofs().size()
-           << std::endl;
+            << std::endl;
 
   IndexSet relevant_set;
   DoFTools::extract_locally_relevant_dofs (dofh, relevant_set);
@@ -90,16 +90,17 @@ void test()
   no_normal_flux_boundaries.insert (0);
   const unsigned int degree = 1;
   VectorTools::compute_no_normal_flux_constraints (dofh, 0,
-                                                  no_normal_flux_boundaries,
-                                                  constraints,
-                                                  MappingQ<dim>(degree));
+                                                   no_normal_flux_boundaries,
+                                                   constraints,
+                                                   MappingQ<dim>(degree));
   constraints.close();
 
   std::string base = output_file_for_mpi("no_flux_constraints_03");
 
   MPI_Barrier(MPI_COMM_WORLD);
 
-  { //write the constraintmatrix to a file on each cpu
+  {
+    //write the constraintmatrix to a file on each cpu
     std::string fname = base + "cm_" + Utilities::int_to_string(myid) + ".dot";
     std::ofstream file(fname.c_str());
     constraints.print(file);
@@ -107,48 +108,48 @@ void test()
   MPI_Barrier(MPI_COMM_WORLD);
   sleep(1);
   if (myid==0)
-  {
-       //sort and merge the constraint matrices on proc 0, generate a checksum
-       //and output that into the deallog
-        system((std::string("cat ") + base + "cm_*.dot | sort -n | uniq > " + base + "cm").c_str());
-        system((std::string("md5sum ") + base + "cm > " + base + "cm.check").c_str());
-        {
-          std::ifstream file((base+"cm.check").c_str());
-          std::string str;
-          while (!file.eof())
-            {
-              std::getline(file, str);
-              deallog << str << std::endl;
-            }
-        }
+    {
+      //sort and merge the constraint matrices on proc 0, generate a checksum
+      //and output that into the deallog
+      system((std::string("cat ") + base + "cm_*.dot | sort -n | uniq > " + base + "cm").c_str());
+      system((std::string("md5sum ") + base + "cm > " + base + "cm.check").c_str());
+      {
+        std::ifstream file((base+"cm.check").c_str());
+        std::string str;
+        while (!file.eof())
+          {
+            std::getline(file, str);
+            deallog << str << std::endl;
+          }
+      }
 
-                                        // delete the files created
-                                        // by processor 0
-       std::remove ((base + "cm").c_str());
-       std::remove ((base + "cm.check").c_str());
-  }
+      // delete the files created
+      // by processor 0
+      std::remove ((base + "cm").c_str());
+      std::remove ((base + "cm.check").c_str());
+    }
 
-                                  // remove tmp files again. wait
-                                  // till processor 0 has done its
-                                  // job with them
+  // remove tmp files again. wait
+  // till processor 0 has done its
+  // job with them
   MPI_Barrier(MPI_COMM_WORLD);
   std::remove ((base + "cm_" + Utilities::int_to_string(myid) + ".dot").c_str());
 
 
-                               // print the number of constraints. since
-                               // processors might write info in different
-                               // orders, copy all numbers to root processor
+  // print the number of constraints. since
+  // processors might write info in different
+  // orders, copy all numbers to root processor
   std::vector<unsigned int> n_constraints_glob (numprocs);
   unsigned int n_constraints = constraints.n_constraints();
   MPI_Gather (&n_constraints, 1, MPI_UNSIGNED,
-             &n_constraints_glob[0], 1, MPI_UNSIGNED, 0, MPI_COMM_WORLD);
+              &n_constraints_glob[0], 1, MPI_UNSIGNED, 0, MPI_COMM_WORLD);
   if (myid == 0)
     for (unsigned int i=0; i<numprocs; ++i)
       deallog <<  "#constraints on " << i << ": " << n_constraints_glob[i]
-             << std::endl;
+              << std::endl;
 
-                               // dummy assembly: put 1 in all components of
-                               // the vector
+  // dummy assembly: put 1 in all components of
+  // the vector
   TrilinosWrappers::MPI::Vector vector;
   vector.reinit (dofh.locally_owned_dofs(), MPI_COMM_WORLD);
   {
@@ -158,22 +159,22 @@ void test()
     for (unsigned int i=0; i<dofs_per_cell; ++i)
       local_vector(i) = 1.;
     typename DoFHandler<dim>::active_cell_iterator
-      cell = dofh.begin_active(),
-      endc = dofh.end();
+    cell = dofh.begin_active(),
+    endc = dofh.end();
     for (; cell!=endc; ++cell)
       if (cell->subdomain_id() == triangulation.locally_owned_subdomain())
-       {
-         cell->get_dof_indices (local_dof_indices);
-         constraints.distribute_local_to_global (local_vector,
-                                                 local_dof_indices,
-                                                 vector);
-       }
+        {
+          cell->get_dof_indices (local_dof_indices);
+          constraints.distribute_local_to_global (local_vector,
+                                                  local_dof_indices,
+                                                  vector);
+        }
     vector.compress (VectorOperation::add);
   }
 
-                               // now check that no entries were generated
-                               // for constrained entries on the locally
-                               // owned range.
+  // now check that no entries were generated
+  // for constrained entries on the locally
+  // owned range.
   const std::pair<unsigned int,unsigned int> range = vector.local_range();
   for (unsigned int i=range.first; i<range.second; ++i)
     if (constraints.is_constrained(i))
@@ -195,14 +196,14 @@ int main(int argc, char *argv[])
 
     if (myid == 0)
       {
-       std::ofstream logfile(output_file_for_mpi("no_flux_constraints_03").c_str());
-       deallog.attach(logfile);
-       deallog.depth_console(0);
-       deallog.threshold_double(1.e-10);
-
-       deallog.push("3d");
-       test<3>();
-       deallog.pop();
+        std::ofstream logfile(output_file_for_mpi("no_flux_constraints_03").c_str());
+        deallog.attach(logfile);
+        deallog.depth_console(0);
+        deallog.threshold_double(1.e-10);
+
+        deallog.push("3d");
+        test<3>();
+        deallog.pop();
       }
     else
       test<3>();
index 80c95b33ae91a6c623896b3581492f009fcfc725..095bf8208b577aa65353b7f86d0797d70a7dc688 100644 (file)
@@ -47,43 +47,43 @@ void test()
       gi.attach_triangulation (tr);
       std::ifstream in ("../deal.II/grid_in_02/2d.xda");
       try
-       {
-         gi.read_xda (in);
-       }
+        {
+          gi.read_xda (in);
+        }
       catch (const typename Triangulation<dim>::DistortedCellList &distorted_cells)
-       {
-                                          // ignore distorted cells
-         deallog << distorted_cells.distorted_cells.size()
-                 << " distorted cells after creating mesh."
-                 << std::endl;
-       }
+        {
+          // ignore distorted cells
+          deallog << distorted_cells.distorted_cells.size()
+                  << " distorted cells after creating mesh."
+                  << std::endl;
+        }
 
       if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
-       deallog << "subdomainid = "
-               << tr.begin_active()->subdomain_id()
-               << std::endl;
+        deallog << "subdomainid = "
+                << tr.begin_active()->subdomain_id()
+                << std::endl;
 
 //      std::vector< unsigned int > cell_subd;
 //      cell_subd.resize(tr.n_active_cells());
 
 //      GridTools::get_subdomain_association(tr, cell_subd);
 //       for (unsigned int i=0;i<tr.n_active_cells();++i)
-//     deallog << cell_subd[i] << " ";
+//  deallog << cell_subd[i] << " ";
 //       deallog << std::endl;
 
       if (myid == 0)
-       {
-         deallog << "#cells = " << tr.n_global_active_cells() << std::endl;
+        {
+          deallog << "#cells = " << tr.n_global_active_cells() << std::endl;
 
-         Assert(tr.n_global_active_cells() == tr.n_active_cells(),
-                ExcInternalError() );
-       }
+          Assert(tr.n_global_active_cells() == tr.n_active_cells(),
+                 ExcInternalError() );
+        }
 
       const unsigned int checksum = tr.get_checksum ();
       if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
-       deallog << "Checksum: "
-               << checksum
-               << std::endl;
+        deallog << "Checksum: "
+                << checksum
+                << std::endl;
     }
 
 
index 408d16407fefd33573d9e704b5c0ac41a20ff9c7..de0360a56d914a93205c5d83603333e28e995734 100644 (file)
@@ -84,10 +84,10 @@ void test()
 
   if (myid==0)
     {
-      for (unsigned int i=0;i<numproc;++i)
-       {
-         cat_file((std::string("p4est_2d_constraintmatrix_01/ncpu_") + Utilities::int_to_string(Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(i)).c_str());
-       }
+      for (unsigned int i=0; i<numproc; ++i)
+        {
+          cat_file((std::string("p4est_2d_constraintmatrix_01/ncpu_") + Utilities::int_to_string(Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(i)).c_str());
+        }
 
     }
 }
index 383f5da69329f68541a16f6e005e56de152138c2..bf88a996f82d681d734ca91c73b82b41cfd8564d 100644 (file)
@@ -49,10 +49,10 @@ void test()
 
   GridGenerator::hyper_cube(tr);
 
-  for (int i=0;i<12;++i)
+  for (int i=0; i<12; ++i)
     {
       if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
-       deallog << "step " << i << std::endl;
+        deallog << "step " << i << std::endl;
 
 
       tr.begin_active()->set_refine_flag();
@@ -72,22 +72,22 @@ void test()
       DoFTools::make_hanging_node_constraints (dofh, cm2);
 
       if (myid==0)
-       {
-         std::stringstream s;
-         cm.print(s);
-         deallog << s.str();
-
-         deallog << "****" << std::endl;
-
-         std::stringstream s2;
-         cm2.print(s2);
-         deallog << s2.str();
-
-         if (s.str()==s2.str())
-           deallog << "ok" << std::endl;
-         else
-           deallog << "not ok" << std::endl;
-       }
+        {
+          std::stringstream s;
+          cm.print(s);
+          deallog << s.str();
+
+          deallog << "****" << std::endl;
+
+          std::stringstream s2;
+          cm2.print(s2);
+          deallog << s2.str();
+
+          if (s.str()==s2.str())
+            deallog << "ok" << std::endl;
+          else
+            deallog << "not ok" << std::endl;
+        }
     }
 
 }
index b1c63795b6e7a75fad0d96ba99344375a73d9b7a..0b29c5ce1f8f96c5dd1c9060a988c9a79bb81e55 100644 (file)
 template<int dim>
 class FilteredDataOut : public DataOut<dim>
 {
-  public:
-    FilteredDataOut (const unsigned int subdomain_id)
-                   :
-                   subdomain_id (subdomain_id)
-      {}
-
-    virtual typename DoFHandler<dim>::cell_iterator
-    first_cell ()
+public:
+  FilteredDataOut (const unsigned int subdomain_id)
+    :
+    subdomain_id (subdomain_id)
+  {}
+
+  virtual typename DoFHandler<dim>::cell_iterator
+  first_cell ()
+  {
+    typename DoFHandler<dim>::active_cell_iterator
+    cell = this->dofs->begin_active();
+    while ((cell != this->dofs->end()) &&
+           (cell->subdomain_id() != subdomain_id))
+      ++cell;
+
+    return cell;
+  }
+
+  virtual typename DoFHandler<dim>::cell_iterator
+  next_cell (const typename DoFHandler<dim>::cell_iterator &old_cell)
+  {
+    if (old_cell != this->dofs->end())
       {
-       typename DoFHandler<dim>::active_cell_iterator
-         cell = this->dofs->begin_active();
-       while ((cell != this->dofs->end()) &&
-              (cell->subdomain_id() != subdomain_id))
-         ++cell;
+        const IteratorFilters::SubdomainEqualTo
+        predicate(subdomain_id);
 
-       return cell;
+        return
+          ++(FilteredIterator
+             <typename DoFHandler<dim>::active_cell_iterator>
+             (predicate,old_cell));
       }
+    else
+      return old_cell;
+  }
 
-    virtual typename DoFHandler<dim>::cell_iterator
-    next_cell (const typename DoFHandler<dim>::cell_iterator &old_cell)
-      {
-       if (old_cell != this->dofs->end())
-         {
-           const IteratorFilters::SubdomainEqualTo
-             predicate(subdomain_id);
-
-           return
-             ++(FilteredIterator
-                <typename DoFHandler<dim>::active_cell_iterator>
-                (predicate,old_cell));
-         }
-       else
-         return old_cell;
-      }
-
-  private:
-    const unsigned int subdomain_id;
+private:
+  const unsigned int subdomain_id;
 };
 
 
@@ -106,33 +106,33 @@ void test()
 
 
   GridGenerator::hyper_shell (tr,
-                             Point<dim>(),
-                             R0,
-                             R1,
-                             12,
-                             true);
+                              Point<dim>(),
+                              R0,
+                              R1,
+                              12,
+                              true);
   static HyperShellBoundary<dim> boundary;
   tr.set_boundary (0, boundary);
   tr.set_boundary (1, boundary);
 
   tr.refine_global (1);
-  for (unsigned int step=0; step<20;++step)
-        {
-          typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active(),
-            endc = tr.end();
+  for (unsigned int step=0; step<20; ++step)
+    {
+      typename Triangulation<dim>::active_cell_iterator
+      cell = tr.begin_active(),
+      endc = tr.end();
 
-            for (; cell!=endc; ++cell)
-                if (std::rand()%42==1)
-                cell->set_refine_flag ();
+      for (; cell!=endc; ++cell)
+        if (std::rand()%42==1)
+          cell->set_refine_flag ();
 
-         tr.execute_coarsening_and_refinement ();
-        }
+      tr.execute_coarsening_and_refinement ();
+    }
 
   DoFHandler<dim> dofh(tr);
 
   static FESystem<dim> fe (FE_Q<dim>(1+1), dim,
-                          FE_Q<dim>(1), 1);
+                           FE_Q<dim>(1), 1);
 
   dofh.distribute_dofs (fe);
 
@@ -158,65 +158,65 @@ void test()
   velocity_mask[dim] = false;
 
   VectorTools::interpolate_boundary_values (dofh,
-                                             0,
-                                             ZeroFunction<dim>(dim+1),
-                                             cm,
-                                             velocity_mask);
+                                            0,
+                                            ZeroFunction<dim>(dim+1),
+                                            cm,
+                                            velocity_mask);
 
-    std::set<types::boundary_id> no_normal_flux_boundaries;
-    no_normal_flux_boundaries.insert (1);
+  std::set<types::boundary_id> no_normal_flux_boundaries;
+  no_normal_flux_boundaries.insert (1);
 
 
-    VectorTools::compute_no_normal_flux_constraints (dofh, 0,
-                                                    no_normal_flux_boundaries,
-                                                    cm);
+  VectorTools::compute_no_normal_flux_constraints (dofh, 0,
+                                                   no_normal_flux_boundaries,
+                                                   cm);
 
-    cm.close ();
+  cm.close ();
 
-    cm.distribute(x);
-    x_rel = x;
+  cm.distribute(x);
+  x_rel = x;
 
-    std::vector<std::string> joint_solution_names (dim, "vel");
-    joint_solution_names.push_back ("p");
+  std::vector<std::string> joint_solution_names (dim, "vel");
+  joint_solution_names.push_back ("p");
 
-    FilteredDataOut<dim> data_out (tr.locally_owned_subdomain());
-    data_out.attach_dof_handler (dofh);
+  FilteredDataOut<dim> data_out (tr.locally_owned_subdomain());
+  data_out.attach_dof_handler (dofh);
 
-    std::vector<DataComponentInterpretation::DataComponentInterpretation>
-      data_component_interpretation
-      (dim+1, DataComponentInterpretation::component_is_scalar);
-    for (unsigned int i=0; i<dim; ++i)
-      data_component_interpretation[i]
-       = DataComponentInterpretation::component_is_part_of_vector;
+  std::vector<DataComponentInterpretation::DataComponentInterpretation>
+  data_component_interpretation
+  (dim+1, DataComponentInterpretation::component_is_scalar);
+  for (unsigned int i=0; i<dim; ++i)
+    data_component_interpretation[i]
+      = DataComponentInterpretation::component_is_part_of_vector;
 
-    data_out.add_data_vector(x_rel, joint_solution_names,
-                            DataOut<dim>::type_dof_data,
-                            data_component_interpretation);
-    data_out.build_patches (4);
-    const std::string filename = ("p4est_2d_constraintmatrix_03/solution." +
-                                 Utilities::int_to_string
-                                 (tr.locally_owned_subdomain(), 4) +
-                                 ".d2");
-    std::ofstream output (filename.c_str());
-    data_out.write_deal_II_intermediate (output);
+  data_out.add_data_vector(x_rel, joint_solution_names,
+                           DataOut<dim>::type_dof_data,
+                           data_component_interpretation);
+  data_out.build_patches (4);
+  const std::string filename = ("p4est_2d_constraintmatrix_03/solution." +
+                                Utilities::int_to_string
+                                (tr.locally_owned_subdomain(), 4) +
+                                ".d2");
+  std::ofstream output (filename.c_str());
+  data_out.write_deal_II_intermediate (output);
 
-    TrilinosWrappers::Vector x_dub;
-    x_dub.reinit(dof_set.size());
-    x_dub = x_rel;
+  TrilinosWrappers::Vector x_dub;
+  x_dub.reinit(dof_set.size());
+  x_dub = x_rel;
 
-    if (myid==0)
-      {
-       std::ofstream file((std::string("p4est_2d_constraintmatrix_03/ncpu_") + Utilities::int_to_string(Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(myid)).c_str());
-       file << "**** proc " << myid << std::endl;
-       x_dub.print(file);
-      }
+  if (myid==0)
+    {
+      std::ofstream file((std::string("p4est_2d_constraintmatrix_03/ncpu_") + Utilities::int_to_string(Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(myid)).c_str());
+      file << "**** proc " << myid << std::endl;
+      x_dub.print(file);
+    }
 
-    MPI_Barrier(MPI_COMM_WORLD);
+  MPI_Barrier(MPI_COMM_WORLD);
 
-    if (myid==0)
-      {
-       cat_file((std::string("p4est_2d_constraintmatrix_03/ncpu_") + Utilities::int_to_string(Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(0)).c_str());
-      }
+  if (myid==0)
+    {
+      cat_file((std::string("p4est_2d_constraintmatrix_03/ncpu_") + Utilities::int_to_string(Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(0)).c_str());
+    }
 
   tr.set_boundary (0);
   tr.set_boundary (1);
index 613c2a4fb0168853ec14fd9b9ce6995430c938a0..70462edc71b1e3f656a07912cd53f399a3d207cf 100644 (file)
@@ -59,56 +59,56 @@ const double T1 = 2.0;
 template<int dim>
 class FilteredDataOut : public DataOut<dim>
 {
-  public:
-    FilteredDataOut (const unsigned int subdomain_id)
-                   :
-                   subdomain_id (subdomain_id)
-      {}
-
-    virtual typename DoFHandler<dim>::cell_iterator
-    first_cell ()
+public:
+  FilteredDataOut (const unsigned int subdomain_id)
+    :
+    subdomain_id (subdomain_id)
+  {}
+
+  virtual typename DoFHandler<dim>::cell_iterator
+  first_cell ()
+  {
+    typename DoFHandler<dim>::active_cell_iterator
+    cell = this->dofs->begin_active();
+    while ((cell != this->dofs->end()) &&
+           (cell->subdomain_id() != subdomain_id))
+      ++cell;
+
+    return cell;
+  }
+
+  virtual typename DoFHandler<dim>::cell_iterator
+  next_cell (const typename DoFHandler<dim>::cell_iterator &old_cell)
+  {
+    if (old_cell != this->dofs->end())
       {
-       typename DoFHandler<dim>::active_cell_iterator
-         cell = this->dofs->begin_active();
-       while ((cell != this->dofs->end()) &&
-              (cell->subdomain_id() != subdomain_id))
-         ++cell;
+        const IteratorFilters::SubdomainEqualTo
+        predicate(subdomain_id);
 
-       return cell;
+        return
+          ++(FilteredIterator
+             <typename DoFHandler<dim>::active_cell_iterator>
+             (predicate,old_cell));
       }
+    else
+      return old_cell;
+  }
 
-    virtual typename DoFHandler<dim>::cell_iterator
-    next_cell (const typename DoFHandler<dim>::cell_iterator &old_cell)
-      {
-       if (old_cell != this->dofs->end())
-         {
-           const IteratorFilters::SubdomainEqualTo
-             predicate(subdomain_id);
-
-           return
-             ++(FilteredIterator
-                <typename DoFHandler<dim>::active_cell_iterator>
-                (predicate,old_cell));
-         }
-       else
-         return old_cell;
-      }
-
-  private:
-    const unsigned int subdomain_id;
+private:
+  const unsigned int subdomain_id;
 };
 
 template <int dim>
 class TemperatureInitialValues : public Function<dim>
 {
-  public:
-    TemperatureInitialValues () : Function<dim>(1) {}
+public:
+  TemperatureInitialValues () : Function<dim>(1) {}
 
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
 
-    virtual void vector_value (const Point<dim> &p,
-                              Vector<double>   &value) const;
+  virtual void vector_value (const Point<dim> &p,
+                             Vector<double>   &value) const;
 };
 
 
@@ -116,7 +116,7 @@ class TemperatureInitialValues : public Function<dim>
 template <int dim>
 double
 TemperatureInitialValues<dim>::value (const Point<dim>  &p,
-                                     const unsigned int) const
+                                      const unsigned int) const
 {
   return p(0)*T1+p(1)*(T0-T1); //simple
 }
@@ -125,7 +125,7 @@ TemperatureInitialValues<dim>::value (const Point<dim>  &p,
 template <int dim>
 void
 TemperatureInitialValues<dim>::vector_value (const Point<dim> &p,
-                                            Vector<double>   &values) const
+                                             Vector<double>   &values) const
 {
   for (unsigned int c=0; c<this->n_components; ++c)
     values(c) = TemperatureInitialValues<dim>::value (p, c);
@@ -142,28 +142,28 @@ void test()
 
 
   GridGenerator::hyper_shell (tr,
-                             Point<dim>(),
-                             R0,
-                             R1,
-                             12,
-                             true);
+                              Point<dim>(),
+                              R0,
+                              R1,
+                              12,
+                              true);
   static HyperShellBoundary<dim> boundary;
 //  tr.set_boundary (0, boundary);
 // tr.set_boundary (1, boundary);
 
   tr.refine_global (3);
   if (1)
-    for (unsigned int step=0; step<5;++step)
+    for (unsigned int step=0; step<5; ++step)
       {
-       typename Triangulation<dim>::active_cell_iterator
-         cell = tr.begin_active(),
-         endc = tr.end();
+        typename Triangulation<dim>::active_cell_iterator
+        cell = tr.begin_active(),
+        endc = tr.end();
 
-       for (; cell!=endc; ++cell)
-         if (std::rand()%42==1)
-           cell->set_refine_flag ();
+        for (; cell!=endc; ++cell)
+          if (std::rand()%42==1)
+            cell->set_refine_flag ();
 
-       tr.execute_coarsening_and_refinement ();
+        tr.execute_coarsening_and_refinement ();
       }
 
   DoFHandler<dim> dofh(tr);
@@ -184,53 +184,53 @@ void test()
   x.reinit(owned_set, MPI_COMM_WORLD);
 
   VectorTools::interpolate(dofh,
-                          TemperatureInitialValues<dim>(),
-                          x);
+                           TemperatureInitialValues<dim>(),
+                           x);
   TrilinosWrappers::MPI::Vector x_rel;
   x_rel.reinit(relevant_set, MPI_COMM_WORLD);
   x_rel = x;
 
-  for (unsigned int steps=0;steps<3;++steps)
+  for (unsigned int steps=0; steps<3; ++steps)
     {
       {
-       typename Triangulation<dim>::active_cell_iterator
-         cell = tr.begin_active(),
-         endc = tr.end();
-
-       for (; cell!=endc; ++cell)
-         if (!cell->is_artificial() && !cell->is_ghost())
-           {
-             if (std::rand()%12==1)
-               cell->set_refine_flag ();
-             else if (std::rand()%7==1)
-               cell->set_coarsen_flag ();
-           }
+        typename Triangulation<dim>::active_cell_iterator
+        cell = tr.begin_active(),
+        endc = tr.end();
+
+        for (; cell!=endc; ++cell)
+          if (!cell->is_artificial() && !cell->is_ghost())
+            {
+              if (std::rand()%12==1)
+                cell->set_refine_flag ();
+              else if (std::rand()%7==1)
+                cell->set_coarsen_flag ();
+            }
       }
       for (typename Triangulation<dim>::cell_iterator
-            cell = tr.begin();
-          cell != tr.end(); ++cell)
-       {
-         if (!cell->has_children())
-           continue;
+           cell = tr.begin();
+           cell != tr.end(); ++cell)
+        {
+          if (!cell->has_children())
+            continue;
 
-         bool coarsen_me = false;
-         for (unsigned int i=0;i<cell->n_children();++i)
-           if (cell->child(i)->coarsen_flag_set())
-             {
-               coarsen_me = true;
-               break;
-             }
-         if (coarsen_me)
-           for (unsigned int i=0;i<cell->n_children();++i)
-             {
-               if (cell->child(i)->active() && cell->child(i)->is_locally_owned())
-                 {
-                   cell->child(i)->clear_refine_flag();
-                   cell->child(i)->set_coarsen_flag();
-                 }
-             }
+          bool coarsen_me = false;
+          for (unsigned int i=0; i<cell->n_children(); ++i)
+            if (cell->child(i)->coarsen_flag_set())
+              {
+                coarsen_me = true;
+                break;
+              }
+          if (coarsen_me)
+            for (unsigned int i=0; i<cell->n_children(); ++i)
+              {
+                if (cell->child(i)->active() && cell->child(i)->is_locally_owned())
+                  {
+                    cell->child(i)->clear_refine_flag();
+                    cell->child(i)->set_coarsen_flag();
+                  }
+              }
 
-       }
+        }
 
 
 
@@ -238,7 +238,7 @@ void test()
 
 
       parallel::distributed::SolutionTransfer<dim,TrilinosWrappers::MPI::Vector>
-       trans(dofh);
+      trans(dofh);
       tr.prepare_coarsening_and_refinement();
 
 
@@ -264,15 +264,15 @@ void test()
 
       ConstraintMatrix cm(relevant_set);
       DoFTools::make_hanging_node_constraints (dofh, cm);
-/*  std::vector<bool> velocity_mask (dim+1, true);
+      /*  std::vector<bool> velocity_mask (dim+1, true);
 
-    velocity_mask[dim] = false;
+          velocity_mask[dim] = false;
 
-    VectorTools::interpolate_boundary_values (dofh,
-    0,
-    ZeroFunction<dim>(1),
-    cm,
-    velocity_mask);                               */
+          VectorTools::interpolate_boundary_values (dofh,
+          0,
+          ZeroFunction<dim>(1),
+          cm,
+          velocity_mask);          */
 
       cm.close ();
 
@@ -285,8 +285,8 @@ void test()
   x_ref.reinit(owned_set, MPI_COMM_WORLD);
 
   VectorTools::interpolate(dofh,
-                          TemperatureInitialValues<dim>(),
-                          x_ref);
+                           TemperatureInitialValues<dim>(),
+                           x_ref);
 
   x_ref -= x;
   double err = x_ref.linfty_norm();
@@ -294,7 +294,7 @@ void test()
     if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
       deallog << "err:" << err << std::endl;
 
-//     x_rel=x_ref; //uncomment to output error
+//  x_rel=x_ref; //uncomment to output error
 
   std::vector<std::string> solution_names(1,"T");
 
@@ -305,9 +305,9 @@ void test()
 
   data_out.build_patches (1);
   const std::string filename = ("p4est_2d_constraintmatrix_04/solution." +
-                               Utilities::int_to_string
-                               (tr.locally_owned_subdomain(), 4) +
-                               ".d2");
+                                Utilities::int_to_string
+                                (tr.locally_owned_subdomain(), 4) +
+                                ".d2");
   std::ofstream output (filename.c_str());
   data_out.write_deal_II_intermediate (output);
 
index 1aede8ed590707303375c31c63669d506932a470..40f5ec46b39ffde5e7069274e21217a0d79f4e03 100644 (file)
@@ -59,14 +59,14 @@ void test()
   TrilinosWrappers::MPI::Vector x_ref;
   x_ref.reinit(owned_set, MPI_COMM_WORLD);
   VectorTools::interpolate(dofh,
-                          ConstantFunction<dim> (1.),
-                          x_ref);
+                           ConstantFunction<dim> (1.),
+                           x_ref);
 
   TrilinosWrappers::MPI::Vector x1 (x_ref);
 
-                               // we have interpolated values, so
-                               // ConstraintMatrix::distribute should not do
-                               // anything
+  // we have interpolated values, so
+  // ConstraintMatrix::distribute should not do
+  // anything
   x1 = x_ref;
   ConstraintMatrix cm(relevant_set);
   DoFTools::make_hanging_node_constraints (dofh, cm);
@@ -79,9 +79,9 @@ void test()
     if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
       deallog << "err:" << err << std::endl;
 
-                               // now test the same thing with a fresh vector
-                               // that we manually fill with ones, not by a
-                               // function in interpolate
+  // now test the same thing with a fresh vector
+  // that we manually fill with ones, not by a
+  // function in interpolate
   TrilinosWrappers::MPI::Vector x2 (owned_set, MPI_COMM_WORLD);
   x2 = 1;
   cm.distribute(x2);
index 3d336af8ad835d03f979bf1f879ac36d913a44cd..a9f4849fdfa1ed4b991b67c07d016dbad1f5cd12 100644 (file)
@@ -55,31 +55,31 @@ void test()
   static const FE_Q<dim> fe(2);
   dofh.distribute_dofs (fe);
 
-   if (myid==0)
-     {
-       deallog << "dofh.n_dofs() " << dofh.n_locally_owned_dofs_per_processor() << std::endl;
-       deallog << "dofh.n_locally_owned_dofs() " << dofh.n_locally_owned_dofs() << std::endl;
-     }
+  if (myid==0)
+    {
+      deallog << "dofh.n_dofs() " << dofh.n_locally_owned_dofs_per_processor() << std::endl;
+      deallog << "dofh.n_locally_owned_dofs() " << dofh.n_locally_owned_dofs() << std::endl;
+    }
 
-   typename
-     DoFHandler<dim>::active_cell_iterator cell
-     = dofh.begin_active();
+  typename
+  DoFHandler<dim>::active_cell_iterator cell
+    = dofh.begin_active();
 
-   const unsigned int dofs_per_cell = dofh.get_fe().dofs_per_cell;
-   std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
+  const unsigned int dofs_per_cell = dofh.get_fe().dofs_per_cell;
+  std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
 
-   if (myid==0)
-     for (; cell != dofh.end(); ++cell)
-       if (!cell->is_artificial())
-        {
-          cell->get_dof_indices (local_dof_indices);
+  if (myid==0)
+    for (; cell != dofh.end(); ++cell)
+      if (!cell->is_artificial())
+        {
+          cell->get_dof_indices (local_dof_indices);
 
-          for (unsigned int i=0;i<dofs_per_cell;++i)
-            deallog << local_dof_indices[i] << " ";
+          for (unsigned int i=0; i<dofs_per_cell; ++i)
+            deallog << local_dof_indices[i] << " ";
 
-          deallog << std::endl;
-        }
+          deallog << std::endl;
+        }
 
 }
 
index b575e88faa0916a1d0ef0b6be43edad19b298903..ee405ebce4f753a81074d34711976253ccb4e817 100644 (file)
@@ -54,43 +54,43 @@ void test()
   while (tr.n_locally_owned_active_cells() < 2000)
     {
       if (tr.n_locally_owned_active_cells())
-       {
-
-      std::vector<bool> flags (tr.n_locally_owned_active_cells(), false);
-      for (unsigned int i=0; i<tr.n_locally_owned_active_cells() / 5 + 1; ++i)
         {
-          const unsigned int x = rand() % flags.size();
-          flags[x] = true;
-        }
 
-      unsigned int index = 0;
-      for (typename Triangulation<dim>::active_cell_iterator
-             cell = tr.begin_active();
-           cell != tr.end(); ++cell)
-        if (cell->subdomain_id()==myid)
-         {
-           if (flags[index])
-             {
-               cell->set_refine_flag();
-             }
-           ++index;
-         }
-       }
+          std::vector<bool> flags (tr.n_locally_owned_active_cells(), false);
+          for (unsigned int i=0; i<tr.n_locally_owned_active_cells() / 5 + 1; ++i)
+            {
+              const unsigned int x = rand() % flags.size();
+              flags[x] = true;
+            }
+
+          unsigned int index = 0;
+          for (typename Triangulation<dim>::active_cell_iterator
+               cell = tr.begin_active();
+               cell != tr.end(); ++cell)
+            if (cell->subdomain_id()==myid)
+              {
+                if (flags[index])
+                  {
+                    cell->set_refine_flag();
+                  }
+                ++index;
+              }
+        }
 
       tr.execute_coarsening_and_refinement ();
       if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
-       deallog << "#local cells:" << tr.n_locally_owned_active_cells() << std::endl;
+        deallog << "#local cells:" << tr.n_locally_owned_active_cells() << std::endl;
 
       DoFHandler<dim> dofh(tr);
 
-       static const FE_Q<dim> fe(2);
-       dofh.distribute_dofs (fe);
+      static const FE_Q<dim> fe(2);
+      dofh.distribute_dofs (fe);
 
-       if (myid==0)
-       {
-         deallog << "dofh.n_dofs() " << dofh.n_locally_owned_dofs_per_processor() << std::endl;
-         deallog << "dofh.n_locally_owned_dofs() " << dofh.n_locally_owned_dofs() << std::endl;
-       }
+      if (myid==0)
+        {
+          deallog << "dofh.n_dofs() " << dofh.n_locally_owned_dofs_per_processor() << std::endl;
+          deallog << "dofh.n_locally_owned_dofs() " << dofh.n_locally_owned_dofs() << std::endl;
+        }
 
     }
 
index 37bea7da5482e81962173236bcdd9a6e772fd04e..ec67bb81e6c36af5a4a6f7910f2f97337ac873ce 100644 (file)
@@ -55,32 +55,32 @@ void test()
   while (tr.n_locally_owned_active_cells() < 2000)
     {
       if (tr.n_locally_owned_active_cells() > 0)
-       {
-
-         std::vector<bool> flags (tr.n_locally_owned_active_cells(), false);
-         for (unsigned int i=0; i<tr.n_locally_owned_active_cells() / 5 + 1; ++i)
-           {
-             const unsigned int x = rand() % flags.size();
-             flags[x] = true;
-           }
-
-         unsigned int index = 0;
-         for (typename Triangulation<dim>::active_cell_iterator
-                cell = tr.begin_active();
-              cell != tr.end(); ++cell)
-           if (cell->subdomain_id()==myid)
-             {
-               if (flags[index])
-                 {
-                   cell->set_refine_flag();
-                 }
-               ++index;
-             }
-       }
+        {
+
+          std::vector<bool> flags (tr.n_locally_owned_active_cells(), false);
+          for (unsigned int i=0; i<tr.n_locally_owned_active_cells() / 5 + 1; ++i)
+            {
+              const unsigned int x = rand() % flags.size();
+              flags[x] = true;
+            }
+
+          unsigned int index = 0;
+          for (typename Triangulation<dim>::active_cell_iterator
+               cell = tr.begin_active();
+               cell != tr.end(); ++cell)
+            if (cell->subdomain_id()==myid)
+              {
+                if (flags[index])
+                  {
+                    cell->set_refine_flag();
+                  }
+                ++index;
+              }
+        }
 
       tr.execute_coarsening_and_refinement ();
       if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
-       deallog << "#local cells:" << tr.n_locally_owned_active_cells() << std::endl;
+        deallog << "#local cells:" << tr.n_locally_owned_active_cells() << std::endl;
 
       DoFHandler<dim> dofh(tr);
 
@@ -88,29 +88,29 @@ void test()
       dofh.distribute_dofs (fe);
 
       if (myid==0)
-       {
-         deallog << "dofh.n_dofs() " << dofh.n_locally_owned_dofs_per_processor() << std::endl;
-         deallog << "dofh.n_locally_owned_dofs() " << dofh.n_locally_owned_dofs() << std::endl;
-       }
+        {
+          deallog << "dofh.n_dofs() " << dofh.n_locally_owned_dofs_per_processor() << std::endl;
+          deallog << "dofh.n_locally_owned_dofs() " << dofh.n_locally_owned_dofs() << std::endl;
+        }
 
       typename
-       DoFHandler<dim>::active_cell_iterator cell
-       = dofh.begin_active();
+      DoFHandler<dim>::active_cell_iterator cell
+        = dofh.begin_active();
 
       const unsigned int dofs_per_cell = dofh.get_fe().dofs_per_cell;
       std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
 
       for (; cell != dofh.end(); ++cell)
-       if (cell->is_ghost())
-         {
-           cell->get_dof_indices (local_dof_indices);
-           std::sort(local_dof_indices.begin(), local_dof_indices.end());
+        if (cell->is_ghost())
+          {
+            cell->get_dof_indices (local_dof_indices);
+            std::sort(local_dof_indices.begin(), local_dof_indices.end());
 
-                                            //macros are evil...
-      types::global_dof_index invalid_dofindex = DoFHandler<dim,dim>::invalid_dof_index;
-           Assert((*local_dof_indices.rbegin())!=invalid_dofindex, ExcInternalError());
+            //macros are evil...
+            types::global_dof_index invalid_dofindex = DoFHandler<dim,dim>::invalid_dof_index;
+            Assert((*local_dof_indices.rbegin())!=invalid_dofindex, ExcInternalError());
 
-         }
+          }
     }
 
 }
index 81d4b4f134ad17c41d0ab926f175e1da0d70143c..25e17bb5835cf21807ad789eebaf7aab765b078b 100644 (file)
@@ -55,72 +55,72 @@ void test()
   while (tr.n_locally_owned_active_cells() < 2000)
     {
       if (tr.n_locally_owned_active_cells())
-       {
-
-      std::vector<bool> flags (tr.n_locally_owned_active_cells(), false);
-      for (unsigned int i=0; i<tr.n_locally_owned_active_cells() / 5 + 1; ++i)
         {
-          const unsigned int x = rand() % flags.size();
-          flags[x] = true;
-        }
 
-      unsigned int index = 0;
-      for (typename Triangulation<dim>::active_cell_iterator
-             cell = tr.begin_active();
-           cell != tr.end(); ++cell)
-        if (cell->subdomain_id()==myid)
-         {
-           if (flags[index])
-             {
-               cell->set_refine_flag();
-             }
-           ++index;
-         }
-       }
+          std::vector<bool> flags (tr.n_locally_owned_active_cells(), false);
+          for (unsigned int i=0; i<tr.n_locally_owned_active_cells() / 5 + 1; ++i)
+            {
+              const unsigned int x = rand() % flags.size();
+              flags[x] = true;
+            }
+
+          unsigned int index = 0;
+          for (typename Triangulation<dim>::active_cell_iterator
+               cell = tr.begin_active();
+               cell != tr.end(); ++cell)
+            if (cell->subdomain_id()==myid)
+              {
+                if (flags[index])
+                  {
+                    cell->set_refine_flag();
+                  }
+                ++index;
+              }
+        }
 
       tr.execute_coarsening_and_refinement ();
       if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
-       deallog << "#local cells:" << tr.n_locally_owned_active_cells() << std::endl;
+        deallog << "#local cells:" << tr.n_locally_owned_active_cells() << std::endl;
 
       DoFHandler<dim> dofh(tr);
 
-       static const FE_Q<dim> fe(2);
-       dofh.distribute_dofs (fe);
-
-       if (myid==0)
-       {
-         deallog << "dofh.n_dofs() " << dofh.n_locally_owned_dofs_per_processor() << std::endl;
-         deallog << "dofh.n_locally_owned_dofs() " << dofh.n_locally_owned_dofs() << std::endl;
-       }
-
-       IndexSet dof_set;
-       DoFTools::extract_locally_active_dofs<> (dofh, dof_set);
-       std::set<unsigned int> control_dof_set;
-
-       typename
-       DoFHandler<dim>::active_cell_iterator cell
-       = dofh.begin_active();
-
-       const unsigned int dofs_per_cell = dofh.get_fe().dofs_per_cell;
-       std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
-
-       for (; cell != dofh.end(); ++cell)
-        if (!cell->is_artificial())
-        {
-          cell->get_dof_indices (local_dof_indices);
-          for (std::vector<types::global_dof_index>::iterator it=local_dof_indices.begin(); it!= local_dof_indices.end(); ++it)
-            {
-         types::global_dof_index invalid_dofindex = DoFHandler<dim,dim>::invalid_dof_index;
-              Assert(*it!=invalid_dofindex, ExcInternalError());
-              control_dof_set.insert(*it);
-            }
-        }
-
-       if (myid==0)
-        {
-          deallog << "# in locally_active_dofs:" << dof_set.n_elements() << std::endl;
-          dof_set.print(deallog);
-        }
+      static const FE_Q<dim> fe(2);
+      dofh.distribute_dofs (fe);
+
+      if (myid==0)
+        {
+          deallog << "dofh.n_dofs() " << dofh.n_locally_owned_dofs_per_processor() << std::endl;
+          deallog << "dofh.n_locally_owned_dofs() " << dofh.n_locally_owned_dofs() << std::endl;
+        }
+
+      IndexSet dof_set;
+      DoFTools::extract_locally_active_dofs<> (dofh, dof_set);
+      std::set<unsigned int> control_dof_set;
+
+      typename
+      DoFHandler<dim>::active_cell_iterator cell
+        = dofh.begin_active();
+
+      const unsigned int dofs_per_cell = dofh.get_fe().dofs_per_cell;
+      std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
+
+      for (; cell != dofh.end(); ++cell)
+        if (!cell->is_artificial())
+          {
+            cell->get_dof_indices (local_dof_indices);
+            for (std::vector<types::global_dof_index>::iterator it=local_dof_indices.begin(); it!= local_dof_indices.end(); ++it)
+              {
+                types::global_dof_index invalid_dofindex = DoFHandler<dim,dim>::invalid_dof_index;
+                Assert(*it!=invalid_dofindex, ExcInternalError());
+                control_dof_set.insert(*it);
+              }
+          }
+
+      if (myid==0)
+        {
+          deallog << "# in locally_active_dofs:" << dof_set.n_elements() << std::endl;
+          dof_set.print(deallog);
+        }
     }
 
 }
index cce4a2e51c9e22dfef09f9619264684fe13d243d..626684e29e257076e46e8d7bd62e323efdd22bad 100644 (file)
@@ -43,69 +43,69 @@ void test()
   if (true)
     {
       if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
-       deallog << "hyper_cube" << std::endl;
+        deallog << "hyper_cube" << std::endl;
 
       parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
       GridGenerator::subdivided_hyper_cube(tr, 2);
 
       if (myid==0)
-       {
+        {
 
-         std::vector< unsigned int > cell_subd;
-         cell_subd.resize(tr.n_active_cells());
+          std::vector< unsigned int > cell_subd;
+          cell_subd.resize(tr.n_active_cells());
 
-         GridTools::get_subdomain_association(tr, cell_subd);
-         for (unsigned int i=0;i<tr.n_active_cells();++i)
-           deallog << cell_subd[i] << " ";
-         deallog << std::endl;
-       }
+          GridTools::get_subdomain_association(tr, cell_subd);
+          for (unsigned int i=0; i<tr.n_active_cells(); ++i)
+            deallog << cell_subd[i] << " ";
+          deallog << std::endl;
+        }
 
-                                      //check that all local
-                                      //neighbors have the
-                                      //correct level and a valid
-                                      //subdomainid
+      //check that all local
+      //neighbors have the
+      //correct level and a valid
+      //subdomainid
       typename Triangulation<dim,dim>::active_cell_iterator cell;
 
       for (cell = tr.begin_active();
-          cell != tr.end();
-          ++cell)
-       {
-         if (cell->subdomain_id() != (unsigned int)myid)
-           {
-             Assert (cell->is_ghost() || cell->is_artificial(),
-                     ExcInternalError());
-             continue;
-           }
-
-         for (unsigned int n=0;n<GeometryInfo<dim>::faces_per_cell;++n)
-           {
-             if (cell->at_boundary(n))
-               continue;
-             Assert (cell->neighbor(n).state() == IteratorState::valid,
+           cell != tr.end();
+           ++cell)
+        {
+          if (cell->subdomain_id() != (unsigned int)myid)
+            {
+              Assert (cell->is_ghost() || cell->is_artificial(),
+                      ExcInternalError());
+              continue;
+            }
+
+          for (unsigned int n=0; n<GeometryInfo<dim>::faces_per_cell; ++n)
+            {
+              if (cell->at_boundary(n))
+                continue;
+              Assert (cell->neighbor(n).state() == IteratorState::valid,
                       ExcInternalError());
 
-             Assert( cell->neighbor(n)->level() == cell->level(),
-                     ExcInternalError());
+              Assert( cell->neighbor(n)->level() == cell->level(),
+                      ExcInternalError());
 
-             Assert(!cell->neighbor(n)->has_children(), ExcInternalError() );
-             Assert( cell->neighbor(n)->subdomain_id()< numprocs, ExcInternalError());
+              Assert(!cell->neighbor(n)->has_children(), ExcInternalError() );
+              Assert( cell->neighbor(n)->subdomain_id()< numprocs, ExcInternalError());
 
-                                              // all neighbors of
-                                              // locally owned cells
-                                              // must be ghosts but
-                                              // can't be artificial
-             Assert (cell->neighbor(n)->is_ghost(), ExcInternalError());
-             Assert (!cell->neighbor(n)->is_artificial(), ExcInternalError());
-           }
+              // all neighbors of
+              // locally owned cells
+              // must be ghosts but
+              // can't be artificial
+              Assert (cell->neighbor(n)->is_ghost(), ExcInternalError());
+              Assert (!cell->neighbor(n)->is_artificial(), ExcInternalError());
+            }
 
 
-       }
+        }
 
       const unsigned int checksum = tr.get_checksum ();
       deallog << "Checksum: "
-             << checksum
-             << std::endl;
+              << checksum
+              << std::endl;
     }
 
   deallog << "OK" << std::endl;
index ef59284dce07a1290c6f7553fe47469961952088..8539c27e21396e66b48da31f77a022a5258d9e14 100644 (file)
@@ -42,71 +42,71 @@ void test()
   if (true)
     {
       if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
-       deallog << "hyper_cube" << std::endl;
+        deallog << "hyper_cube" << std::endl;
 
       parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
       GridGenerator::hyper_cube(tr);
 
-      for (int i=0;i<5;++i)
-       {
-         if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
-           deallog << "refine loop:" << i << std::endl;
-
-         tr.refine_global(1);
-
-         if (myid==0)
-           {
-
-             std::vector< unsigned int > cell_subd;
-             cell_subd.resize(tr.n_active_cells());
-
-             GridTools::get_subdomain_association(tr, cell_subd);
-             for (unsigned int i=0;i<tr.n_active_cells();++i)
-               deallog << cell_subd[i] << " ";
-             deallog << std::endl;
-           }
-
-                                          //check that all local
-                                          //neighbors have the
-                                          //correct level
-         typename Triangulation<dim,dim>::active_cell_iterator cell;
-
-         for (cell = tr.begin_active();
-              cell != tr.end();
-              ++cell)
-           {
-             if (cell->subdomain_id() != (unsigned int)myid)
-               {
-                 Assert (cell->is_ghost() || cell->is_artificial(),
-                         ExcInternalError());
-                 continue;
-               }
-
-             for (unsigned int n=0;n<GeometryInfo<dim>::faces_per_cell;++n)
-               {
-                 if (cell->at_boundary(n))
-                   continue;
-                 Assert (cell->neighbor(n).state() == IteratorState::valid,
-                         ExcInternalError());
-
-                 Assert( cell->neighbor(n)->level() == cell->level(),
-                         ExcInternalError());
-
-                 Assert(!cell->neighbor(n)->has_children(), ExcInternalError() );
-               }
-           }
-
-         const unsigned int checksum = tr.get_checksum ();
-         if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
-           deallog << "Checksum: "
-                   << checksum
-                   << std::endl;
-
-         Assert (tr.n_global_active_cells() ==
-                 static_cast<unsigned int>(std::pow (1.*GeometryInfo<dim>::max_children_per_cell, i+1)),
-                 ExcInternalError());
-       }
+      for (int i=0; i<5; ++i)
+        {
+          if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
+            deallog << "refine loop:" << i << std::endl;
+
+          tr.refine_global(1);
+
+          if (myid==0)
+            {
+
+              std::vector< unsigned int > cell_subd;
+              cell_subd.resize(tr.n_active_cells());
+
+              GridTools::get_subdomain_association(tr, cell_subd);
+              for (unsigned int i=0; i<tr.n_active_cells(); ++i)
+                deallog << cell_subd[i] << " ";
+              deallog << std::endl;
+            }
+
+          //check that all local
+          //neighbors have the
+          //correct level
+          typename Triangulation<dim,dim>::active_cell_iterator cell;
+
+          for (cell = tr.begin_active();
+               cell != tr.end();
+               ++cell)
+            {
+              if (cell->subdomain_id() != (unsigned int)myid)
+                {
+                  Assert (cell->is_ghost() || cell->is_artificial(),
+                          ExcInternalError());
+                  continue;
+                }
+
+              for (unsigned int n=0; n<GeometryInfo<dim>::faces_per_cell; ++n)
+                {
+                  if (cell->at_boundary(n))
+                    continue;
+                  Assert (cell->neighbor(n).state() == IteratorState::valid,
+                          ExcInternalError());
+
+                  Assert( cell->neighbor(n)->level() == cell->level(),
+                          ExcInternalError());
+
+                  Assert(!cell->neighbor(n)->has_children(), ExcInternalError() );
+                }
+            }
+
+          const unsigned int checksum = tr.get_checksum ();
+          if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
+            deallog << "Checksum: "
+                    << checksum
+                    << std::endl;
+
+          Assert (tr.n_global_active_cells() ==
+                  static_cast<unsigned int>(std::pow (1.*GeometryInfo<dim>::max_children_per_cell, i+1)),
+                  ExcInternalError());
+        }
     }
 
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
index 1e4c3610ae59c5647aa9281eae0481a324c557fc..f4709b2a1170fd44f92add3d1254cd014198bcf9 100644 (file)
@@ -42,7 +42,7 @@ void test()
   if (true)
     {
       if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
-       deallog << "hyper_cube" << std::endl;
+        deallog << "hyper_cube" << std::endl;
 
       parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
@@ -54,22 +54,22 @@ void test()
 
       GridTools::get_subdomain_association(tr, cell_subd);
       if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
-       {
-         for (unsigned int i=0;i<tr.n_active_cells();++i)
-           deallog << cell_subd[i] << " ";
-         deallog << std::endl;
-       }
+        {
+          for (unsigned int i=0; i<tr.n_active_cells(); ++i)
+            deallog << cell_subd[i] << " ";
+          deallog << std::endl;
+        }
 
       if (myid == 0)
-       {
-         deallog << "#cells = " << tr.n_global_active_cells() << std::endl;
-       }
+        {
+          deallog << "#cells = " << tr.n_global_active_cells() << std::endl;
+        }
 
       const unsigned int checksum = tr.get_checksum ();
       if (myid == 0)
-       deallog << "Checksum: "
-               << checksum
-               << std::endl;
+        deallog << "Checksum: "
+                << checksum
+                << std::endl;
     }
 
 
index 08dd6070e3104e1b7e5a196a26bba2fd8f3a1b39..65c37871512d1e43c5b223c3182ea2b03760bb72 100644 (file)
 #include <fstream>
 
 template <class TRIA>
-void check (TRIA & tr)
+void check (TRIA &tr)
 {
   typename TRIA::cell_iterator cell = tr.begin(),
-        endc = tr.end();
-  
+                               endc = tr.end();
+
   for (; cell!=endc; ++cell)
     {
       deallog << "cell level=" << cell->level() << " index=" << cell->index();
       if (!cell->has_children())
-       deallog << " subdomain: " << cell->subdomain_id();
+        deallog << " subdomain: " << cell->subdomain_id();
       deallog << std::endl;
     }
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -59,7 +59,7 @@ void test()
   if (true)
     {
       if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
-       deallog << "hyper_cube" << std::endl;
+        deallog << "hyper_cube" << std::endl;
 
       parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
@@ -70,17 +70,17 @@ void test()
       tr.execute_coarsening_and_refinement ();
 
       if (myid == 0)
-       {
-         deallog << "#cells = " << tr.n_global_active_cells() << std::endl;
-       }
+        {
+          deallog << "#cells = " << tr.n_global_active_cells() << std::endl;
+        }
 
       const unsigned int checksum = tr.get_checksum ();
       deallog << "Checksum: "
-             << checksum
-             << std::endl;
+              << checksum
+              << std::endl;
 
-      check(tr); 
-      }
+      check(tr);
+    }
 
 
 
index ee184f895a1b9233cd1340fa155fa951468ccbaf..2d3e86fc4a3af1edf37fd0ffa093630b963a1cc6 100644 (file)
@@ -41,7 +41,7 @@ void test()
   if (true)
     {
       if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
-       deallog << "hyper_cube" << std::endl;
+        deallog << "hyper_cube" << std::endl;
 
       parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
@@ -49,38 +49,38 @@ void test()
       tr.refine_global(1);
 
       while (tr.n_global_active_cells() < 20000/Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD))
-       {
-         if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
-           deallog << "refine_loop..." << std::endl;
-         std::vector<bool> flags (tr.n_active_cells(), false);
-
-                                          // refine one fifth of all cells each
-                                          // time (but at least one).
-                                          // note that only the own marked cells
-                                          // will be refined.
-         for (unsigned int i=0; i<tr.n_active_cells() / 5 + 1; ++i)
-           {
-             const unsigned int x = rand() % flags.size();
-             flags[x] = true;
-           }
-
-         unsigned int index=0;
-         for (typename Triangulation<dim>::active_cell_iterator
-                cell = tr.begin_active();
-              cell != tr.end(); ++cell, ++index)
-           if (flags[index])
-             {
-               cell->set_refine_flag();
-             }
-
-         Assert (index == tr.n_active_cells(), ExcInternalError());
-         tr.execute_coarsening_and_refinement ();
-
-         if (myid == 0)
-           {
-             deallog << "#cells = " << tr.n_global_active_cells() << std::endl;
-           }
-       }
+        {
+          if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
+            deallog << "refine_loop..." << std::endl;
+          std::vector<bool> flags (tr.n_active_cells(), false);
+
+          // refine one fifth of all cells each
+          // time (but at least one).
+          // note that only the own marked cells
+          // will be refined.
+          for (unsigned int i=0; i<tr.n_active_cells() / 5 + 1; ++i)
+            {
+              const unsigned int x = rand() % flags.size();
+              flags[x] = true;
+            }
+
+          unsigned int index=0;
+          for (typename Triangulation<dim>::active_cell_iterator
+               cell = tr.begin_active();
+               cell != tr.end(); ++cell, ++index)
+            if (flags[index])
+              {
+                cell->set_refine_flag();
+              }
+
+          Assert (index == tr.n_active_cells(), ExcInternalError());
+          tr.execute_coarsening_and_refinement ();
+
+          if (myid == 0)
+            {
+              deallog << "#cells = " << tr.n_global_active_cells() << std::endl;
+            }
+        }
     }
 
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
index 702530b9d98960342799260ec6fdd180f57c6ae8..2ee57c14282bc54c8b7b5ac8b9933b5a2440a068 100644 (file)
@@ -64,52 +64,53 @@ void test()
       IndexSet dof_set;
       DoFTools::extract_locally_active_dofs (dofh, dof_set);
       if (myid==0)
-       dof_set.print(deallog);
+        dof_set.print(deallog);
     }
 
     unsigned int n_dofs = dofh.n_dofs();
     if (myid==0)
       deallog << "**** n_dofs = " << n_dofs  << std::endl;
-    
+
     DoFRenumbering::component_wise(dofh);
-                                    //check if n_dofs() is still
-                                    //correct. This was a bug at some point.
+    //check if n_dofs() is still
+    //correct. This was a bug at some point.
     Assert(n_dofs == dofh.n_dofs(),ExcInternalError());
     {
       IndexSet dof_set;
       DoFTools::extract_locally_active_dofs (dofh, dof_set);
 
       if (myid==0)
-       dof_set.print(deallog);
+        dof_set.print(deallog);
 
       if (myid==0)
-       {
-
-         std::vector<types::global_dof_index> local_dof_indices;
-       typename DoFHandler<dim>::active_cell_iterator
-         cell, endc = dofh.end();
-
-       if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
-         for (cell = dofh.begin_active(); cell != endc; ++cell)
-           if (!cell->is_artificial() && !cell->is_ghost())
-             {
-               local_dof_indices.resize (cell->get_fe().dofs_per_cell);
-               cell->get_dof_indices (local_dof_indices);
-               for (unsigned int i=0;i< cell->get_fe().dofs_per_cell;++i)
-                 deallog << local_dof_indices[i] << " ";
-               deallog << std::endl;
-             }
-       }
+        {
+
+          std::vector<types::global_dof_index> local_dof_indices;
+          typename DoFHandler<dim>::active_cell_iterator
+          cell, endc = dofh.end();
+
+          if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
+            for (cell = dofh.begin_active(); cell != endc; ++cell)
+              if (!cell->is_artificial() && !cell->is_ghost())
+                {
+                  local_dof_indices.resize (cell->get_fe().dofs_per_cell);
+                  cell->get_dof_indices (local_dof_indices);
+                  for (unsigned int i=0; i< cell->get_fe().dofs_per_cell; ++i)
+                    deallog << local_dof_indices[i] << " ";
+                  deallog << std::endl;
+                }
+        }
 
     }
   }
 
-  if (0){
-    tr.refine_global (1);
-    DoFHandler<dim> dofh(tr);
-    dofh.distribute_dofs (fe);
+  if (0)
+    {
+      tr.refine_global (1);
+      DoFHandler<dim> dofh(tr);
+      dofh.distribute_dofs (fe);
 
-  }
+    }
 
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     deallog << "OK" << std::endl;
index 700f7c7a8e5b90d07d16f511f8e98a0106bfc44e..73af9407b9130fa969f72bc6a792ae4eca332ef9 100644 (file)
@@ -55,7 +55,7 @@ void test()
   sub[0] = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
   sub[1] = 1;
   GridGenerator::subdivided_hyper_rectangle(static_cast<Triangulation<dim>&>(tr),
-                                           sub, Point<2>(0,0), Point<2>(1,1));
+                                            sub, Point<2>(0,0), Point<2>(1,1));
 
   const FE_Q<dim> fe_q(1);
   FESystem<dim> fe(fe_q,2);
@@ -82,32 +82,32 @@ void test()
 
     if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
       {
-       dof_set.print(deallog);
-       for (unsigned int i=0; i<Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); ++i)
-         {
-           deallog << "Dofs owned by processor " << i << ": ";
-           dofh.locally_owned_dofs_per_processor()[i].print(deallog);
-           deallog << std::endl;
-         }
+        dof_set.print(deallog);
+        for (unsigned int i=0; i<Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); ++i)
+          {
+            deallog << "Dofs owned by processor " << i << ": ";
+            dofh.locally_owned_dofs_per_processor()[i].print(deallog);
+            deallog << std::endl;
+          }
       }
 
     if (myid==0)
       {
 
-       std::vector<types::global_dof_index> local_dof_indices;
-       typename DoFHandler<dim>::active_cell_iterator
-         cell, endc = dofh.end();
-
-       if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
-         for (cell = dofh.begin_active(); cell != endc; ++cell)
-           if (!cell->is_artificial() && !cell->is_ghost())
-             {
-               local_dof_indices.resize (cell->get_fe().dofs_per_cell);
-               cell->get_dof_indices (local_dof_indices);
-               for (unsigned int i=0;i< cell->get_fe().dofs_per_cell;++i)
-                 deallog << local_dof_indices[i] << " ";
-               deallog << std::endl;
-             }
+        std::vector<types::global_dof_index> local_dof_indices;
+        typename DoFHandler<dim>::active_cell_iterator
+        cell, endc = dofh.end();
+
+        if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
+          for (cell = dofh.begin_active(); cell != endc; ++cell)
+            if (!cell->is_artificial() && !cell->is_ghost())
+              {
+                local_dof_indices.resize (cell->get_fe().dofs_per_cell);
+                cell->get_dof_indices (local_dof_indices);
+                for (unsigned int i=0; i< cell->get_fe().dofs_per_cell; ++i)
+                  deallog << local_dof_indices[i] << " ";
+                deallog << std::endl;
+              }
       }
   }
 }
index 662b7b89b5c0ee854a58c4516a324ea55079b735..a94c17c09a91b001f05845ee16675bb5f90da80d 100644 (file)
@@ -42,37 +42,37 @@ void test()
   if (true)
     {
       if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
-       deallog << "hyper_cube" << std::endl;
+        deallog << "hyper_cube" << std::endl;
 
       parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
       GridGenerator::hyper_cube(tr);
-                                      //tr.refine_global(1);
+      //tr.refine_global(1);
 
       Assert(tr.n_active_cells()==1, ExcInternalError());
 
       if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
-       deallog << "subdomainid = "
-               << tr.begin_active()->subdomain_id()
-               << std::endl;
+        deallog << "subdomainid = "
+                << tr.begin_active()->subdomain_id()
+                << std::endl;
 
       if (myid == numproc-1)
-       {
-         Assert( tr.begin_active()->subdomain_id()==(unsigned int)myid,
-                 ExcInternalError() );
-       }
+        {
+          Assert( tr.begin_active()->subdomain_id()==(unsigned int)myid,
+                  ExcInternalError() );
+        }
       else
-       {
-         Assert( tr.begin_active()->subdomain_id()==numbers::artificial_subdomain_id,
-                 ExcInternalError() );
-       }
+        {
+          Assert( tr.begin_active()->subdomain_id()==numbers::artificial_subdomain_id,
+                  ExcInternalError() );
+        }
 
 
       const unsigned int checksum = tr.get_checksum ();
       if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
-       deallog << "Checksum: "
-               << checksum
-               << std::endl;
+        deallog << "Checksum: "
+                << checksum
+                << std::endl;
     }
 
 
index 29fbbb0a0641d169f1e4e77e7d749e15b5d933bd..802c97f28db65e1cd6d4b116d69c2c2c6bca53aa 100644 (file)
@@ -53,18 +53,18 @@ void test()
 
   GridGenerator::hyper_cube(tr);
   tr.refine_global (2);
-            for (unsigned int step=0; step<8; ++step)
-        {
-          typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active(),
-            endc = tr.end();
+  for (unsigned int step=0; step<8; ++step)
+    {
+      typename Triangulation<dim>::active_cell_iterator
+      cell = tr.begin_active(),
+      endc = tr.end();
 
-            for (; cell!=endc; ++cell)
-                if (std::rand()%42==1)
-                cell->set_refine_flag ();
+      for (; cell!=endc; ++cell)
+        if (std::rand()%42==1)
+          cell->set_refine_flag ();
 
-         tr.execute_coarsening_and_refinement ();
-        }
+      tr.execute_coarsening_and_refinement ();
+    }
 
   DoFHandler<dim> dofh(tr);
 
@@ -94,10 +94,10 @@ void test()
 
   if (myid==0)
     {
-      for (unsigned int i=0;i<numproc;++i)
-       {
-         cat_file((std::string("p4est_3d_constraintmatrix_01/ncpu_") + Utilities::int_to_string(Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(i)).c_str());
-       }
+      for (unsigned int i=0; i<numproc; ++i)
+        {
+          cat_file((std::string("p4est_3d_constraintmatrix_01/ncpu_") + Utilities::int_to_string(Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(i)).c_str());
+        }
 
     }
 }
index 88380ccc06ef7d3e8dca235d959fd813d62f3df2..3661d7195ab3e186e8463bdb483275addaf793ee 100644 (file)
@@ -54,17 +54,17 @@ void test()
   GridGenerator::hyper_cube(tr);
   tr.refine_global (2);
   for (unsigned int step=0; step<15; ++step)
-        {
-          typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active(),
-            endc = tr.end();
+    {
+      typename Triangulation<dim>::active_cell_iterator
+      cell = tr.begin_active(),
+      endc = tr.end();
 
-            for (; cell!=endc; ++cell)
-                if (std::rand()%42==1)
-                cell->set_refine_flag ();
+      for (; cell!=endc; ++cell)
+        if (std::rand()%42==1)
+          cell->set_refine_flag ();
 
-         tr.execute_coarsening_and_refinement ();
-        }
+      tr.execute_coarsening_and_refinement ();
+    }
 
   DoFHandler<dim> dofh(tr);
 
@@ -93,7 +93,7 @@ void test()
   cm.distribute(x);
   x_rel = x;
 
-                                  //x.print(std::cout);
+  //x.print(std::cout);
 
 //  x_rel.print(std::cout);
 
@@ -103,28 +103,28 @@ void test()
   x_dub = x_rel;
 
   {
-       std::stringstream out;
+    std::stringstream out;
     out << "**** proc " << myid << std::endl;
     x_dub.print (out);
 
-       if (myid==0)
-         deallog << out.str() << std::endl;
-       else
-         MPI_Send((void*)out.str().c_str(),out.str().size()+1, MPI_CHAR, 0, 1, MPI_COMM_WORLD);
+    if (myid==0)
+      deallog << out.str() << std::endl;
+    else
+      MPI_Send((void *)out.str().c_str(),out.str().size()+1, MPI_CHAR, 0, 1, MPI_COMM_WORLD);
   }
 
   if (myid == 0)
     {
-      for (unsigned int i = 1;i < numproc;++i)
+      for (unsigned int i = 1; i < numproc; ++i)
         {
-                 MPI_Status status;
-                 int msglen;
-                 MPI_Probe(i, 1, MPI_COMM_WORLD, &status);
-                 MPI_Get_count(&status, MPI_CHAR, &msglen);
-                 std::vector<char> buf(msglen);
-                 MPI_Recv(&buf[0], msglen, MPI_CHAR, status.MPI_SOURCE, 1,
-                 MPI_COMM_WORLD, &status);
-                 deallog << &buf[0] << std::endl;
+          MPI_Status status;
+          int msglen;
+          MPI_Probe(i, 1, MPI_COMM_WORLD, &status);
+          MPI_Get_count(&status, MPI_CHAR, &msglen);
+          std::vector<char> buf(msglen);
+          MPI_Recv(&buf[0], msglen, MPI_CHAR, status.MPI_SOURCE, 1,
+                   MPI_COMM_WORLD, &status);
+          deallog << &buf[0] << std::endl;
         }
     }
 
index e6a7196f91a875a8b5aa7cd4649a44cedf7ba193..ebbcd9066d505555e049917483e246303bc38d55 100644 (file)
@@ -58,56 +58,56 @@ const double T1 = 2.0;
 template<int dim>
 class FilteredDataOut : public DataOut<dim>
 {
-  public:
-    FilteredDataOut (const unsigned int subdomain_id)
-                   :
-                   subdomain_id (subdomain_id)
-      {}
-
-    virtual typename DoFHandler<dim>::cell_iterator
-    first_cell ()
+public:
+  FilteredDataOut (const unsigned int subdomain_id)
+    :
+    subdomain_id (subdomain_id)
+  {}
+
+  virtual typename DoFHandler<dim>::cell_iterator
+  first_cell ()
+  {
+    typename DoFHandler<dim>::active_cell_iterator
+    cell = this->dofs->begin_active();
+    while ((cell != this->dofs->end()) &&
+           (cell->subdomain_id() != subdomain_id))
+      ++cell;
+
+    return cell;
+  }
+
+  virtual typename DoFHandler<dim>::cell_iterator
+  next_cell (const typename DoFHandler<dim>::cell_iterator &old_cell)
+  {
+    if (old_cell != this->dofs->end())
       {
-       typename DoFHandler<dim>::active_cell_iterator
-         cell = this->dofs->begin_active();
-       while ((cell != this->dofs->end()) &&
-              (cell->subdomain_id() != subdomain_id))
-         ++cell;
+        const IteratorFilters::SubdomainEqualTo
+        predicate(subdomain_id);
 
-       return cell;
+        return
+          ++(FilteredIterator
+             <typename DoFHandler<dim>::active_cell_iterator>
+             (predicate,old_cell));
       }
+    else
+      return old_cell;
+  }
 
-    virtual typename DoFHandler<dim>::cell_iterator
-    next_cell (const typename DoFHandler<dim>::cell_iterator &old_cell)
-      {
-       if (old_cell != this->dofs->end())
-         {
-           const IteratorFilters::SubdomainEqualTo
-             predicate(subdomain_id);
-
-           return
-             ++(FilteredIterator
-                <typename DoFHandler<dim>::active_cell_iterator>
-                (predicate,old_cell));
-         }
-       else
-         return old_cell;
-      }
-
-  private:
-    const unsigned int subdomain_id;
+private:
+  const unsigned int subdomain_id;
 };
 
 template <int dim>
 class TemperatureInitialValues : public Function<dim>
 {
-  public:
-    TemperatureInitialValues () : Function<dim>(1) {}
+public:
+  TemperatureInitialValues () : Function<dim>(1) {}
 
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
 
-    virtual void vector_value (const Point<dim> &p,
-                              Vector<double>   &value) const;
+  virtual void vector_value (const Point<dim> &p,
+                             Vector<double>   &value) const;
 };
 
 
@@ -115,7 +115,7 @@ class TemperatureInitialValues : public Function<dim>
 template <int dim>
 double
 TemperatureInitialValues<dim>::value (const Point<dim>  &p,
-                                     const unsigned int) const
+                                      const unsigned int) const
 {
   return p(0)*T1+p(1)*(T0-T1); //simple
 }
@@ -124,7 +124,7 @@ TemperatureInitialValues<dim>::value (const Point<dim>  &p,
 template <int dim>
 void
 TemperatureInitialValues<dim>::vector_value (const Point<dim> &p,
-                                            Vector<double>   &values) const
+                                             Vector<double>   &values) const
 {
   for (unsigned int c=0; c<this->n_components; ++c)
     values(c) = TemperatureInitialValues<dim>::value (p, c);
@@ -141,28 +141,28 @@ void test()
 
 
   GridGenerator::hyper_shell (tr,
-                             Point<dim>(),
-                             R0,
-                             R1,
-                             12,
-                             true);
+                              Point<dim>(),
+                              R0,
+                              R1,
+                              12,
+                              true);
   static HyperShellBoundary<dim> boundary;
 //  tr.set_boundary (0, boundary);
 //tr.set_boundary (1, boundary);
 
   tr.refine_global (1);
   if (1)
-    for (unsigned int step=0; step<5;++step)
+    for (unsigned int step=0; step<5; ++step)
       {
-       typename Triangulation<dim>::active_cell_iterator
-         cell = tr.begin_active(),
-         endc = tr.end();
+        typename Triangulation<dim>::active_cell_iterator
+        cell = tr.begin_active(),
+        endc = tr.end();
 
-       for (; cell!=endc; ++cell)
-         if (std::rand()%42==1)
-           cell->set_refine_flag ();
+        for (; cell!=endc; ++cell)
+          if (std::rand()%42==1)
+            cell->set_refine_flag ();
 
-       tr.execute_coarsening_and_refinement ();
+        tr.execute_coarsening_and_refinement ();
       }
 
   DoFHandler<dim> dofh(tr);
@@ -183,56 +183,56 @@ void test()
   x.reinit(owned_set, MPI_COMM_WORLD);
 
   VectorTools::interpolate(dofh,
-                          TemperatureInitialValues<dim>(),
-                          x);
+                           TemperatureInitialValues<dim>(),
+                           x);
   TrilinosWrappers::MPI::Vector x_rel;
   x_rel.reinit(relevant_set, MPI_COMM_WORLD);
   x_rel = x;
 
-  for (unsigned int steps=0;steps<7;++steps)
+  for (unsigned int steps=0; steps<7; ++steps)
     {
       {
-       typename Triangulation<dim>::active_cell_iterator
-         cell = tr.begin_active(),
-         endc = tr.end();
-
-       for (; cell!=endc; ++cell)
-         if (!cell->is_artificial() && !cell->is_ghost())
-           {
-             if (std::rand()%12==1)
-               cell->set_refine_flag ();
-             else if (std::rand()%7==1)
-               cell->set_coarsen_flag ();
-           }
+        typename Triangulation<dim>::active_cell_iterator
+        cell = tr.begin_active(),
+        endc = tr.end();
+
+        for (; cell!=endc; ++cell)
+          if (!cell->is_artificial() && !cell->is_ghost())
+            {
+              if (std::rand()%12==1)
+                cell->set_refine_flag ();
+              else if (std::rand()%7==1)
+                cell->set_coarsen_flag ();
+            }
       }
       for (typename Triangulation<dim>::cell_iterator
-            cell = tr.begin();
-          cell != tr.end(); ++cell)
-       {
-         if (!cell->has_children())
-           continue;
-
-         bool coarsen_me = false;
-         for (unsigned int i=0;i<cell->n_children();++i)
-           if (cell->child(i)->coarsen_flag_set())
-             {
-               coarsen_me = true;
-               break;
-             }
-         if (coarsen_me)
-           for (unsigned int i=0;i<cell->n_children();++i)
-             {
-               if (cell->child(i)->active() && cell->child(i)->is_locally_owned())
-                 {
-                   cell->child(i)->clear_refine_flag();
-                   cell->child(i)->set_coarsen_flag();
-                 }
-             }
-
-       }
+           cell = tr.begin();
+           cell != tr.end(); ++cell)
+        {
+          if (!cell->has_children())
+            continue;
+
+          bool coarsen_me = false;
+          for (unsigned int i=0; i<cell->n_children(); ++i)
+            if (cell->child(i)->coarsen_flag_set())
+              {
+                coarsen_me = true;
+                break;
+              }
+          if (coarsen_me)
+            for (unsigned int i=0; i<cell->n_children(); ++i)
+              {
+                if (cell->child(i)->active() && cell->child(i)->is_locally_owned())
+                  {
+                    cell->child(i)->clear_refine_flag();
+                    cell->child(i)->set_coarsen_flag();
+                  }
+              }
+
+        }
 
       parallel::distributed::SolutionTransfer<dim,TrilinosWrappers::MPI::Vector>
-       trans(dofh);
+      trans(dofh);
       tr.prepare_coarsening_and_refinement();
 
 
@@ -259,15 +259,15 @@ void test()
 
       ConstraintMatrix cm(relevant_set);
       DoFTools::make_hanging_node_constraints (dofh, cm);
-/*  std::vector<bool> velocity_mask (dim+1, true);
+      /*  std::vector<bool> velocity_mask (dim+1, true);
 
-    velocity_mask[dim] = false;
+          velocity_mask[dim] = false;
 
-    VectorTools::interpolate_boundary_values (dofh,
-    0,
-    ZeroFunction<dim>(1),
-    cm,
-    velocity_mask);                               */
+          VectorTools::interpolate_boundary_values (dofh,
+          0,
+          ZeroFunction<dim>(1),
+          cm,
+          velocity_mask);          */
 
       cm.close ();
 
@@ -280,8 +280,8 @@ void test()
   x_ref.reinit(owned_set, MPI_COMM_WORLD);
 
   VectorTools::interpolate(dofh,
-                          TemperatureInitialValues<dim>(),
-                          x_ref);
+                           TemperatureInitialValues<dim>(),
+                           x_ref);
 
   x_ref -= x;
   double err = x_ref.linfty_norm();
@@ -289,7 +289,7 @@ void test()
     if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
       deallog << "err:" << err << std::endl;
 
-//     x_rel=x_ref; //uncomment to output error
+//  x_rel=x_ref; //uncomment to output error
 
   std::vector<std::string> solution_names(1,"T");
 
@@ -300,9 +300,9 @@ void test()
 
   data_out.build_patches (1);
   const std::string filename = ("p4est_3d_constraintmatrix_03/solution." +
-                               Utilities::int_to_string
-                               (tr.locally_owned_subdomain(), 4) +
-                               ".vtu");
+                                Utilities::int_to_string
+                                (tr.locally_owned_subdomain(), 4) +
+                                ".vtu");
   std::ofstream output (filename.c_str());
   data_out.write_vtu (output);
 
index 33432085bcf3c7b0bfaff687d23a1e197b1aecc8..1d3ca34a5652efb7c379417c14fe8ad1c2322685 100644 (file)
@@ -45,29 +45,29 @@ void test ()
   GridGenerator::hyper_cube (tria, 0, 1);
   tria.refine_global(1);
 
-                               // refine all cells except the one located at
-                               // [0.25, 0.25, 0.25]
+  // refine all cells except the one located at
+  // [0.25, 0.25, 0.25]
   for (typename Triangulation<dim>::active_cell_iterator
-        cell = tria.begin_active();
+       cell = tria.begin_active();
        cell != tria.end(); ++cell)
     {
       Point<dim> diff(0.25,0.25,0.25);
       diff -= cell->center();
       if (diff.norm() > 0.25 && !(cell->is_ghost() || cell->is_artificial()))
-       cell->set_refine_flag();
+        cell->set_refine_flag();
     }
   tria.execute_coarsening_and_refinement();
   dof.distribute_dofs(fe);
 
-                               // build constraint matrix
+  // build constraint matrix
   IndexSet locally_relevant (dof.n_dofs());
   DoFTools::extract_locally_relevant_dofs (dof, locally_relevant);
   ConstraintMatrix constraints (locally_relevant);
   DoFTools::make_hanging_node_constraints (dof, constraints);
   constraints.close();
 
-                               // print out constraints for each
-                               // processor.
+  // print out constraints for each
+  // processor.
   const unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
   const unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
 
@@ -86,14 +86,14 @@ void test ()
 
   if (myid==0)
     {
-      for (unsigned int i=0;i<numproc;++i)
-       {
-         cat_file((std::string("p4est_3d_constraintmatrix_04/ncpu_") + Utilities::int_to_string(Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(i)).c_str());
-       }
+      for (unsigned int i=0; i<numproc; ++i)
+        {
+          cat_file((std::string("p4est_3d_constraintmatrix_04/ncpu_") + Utilities::int_to_string(Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(i)).c_str());
+        }
     }
 }
 
-int main(int argc, char** argv)
+int main(int argc, char **argv)
 {
   Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv);
   const unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
index 6afbbd58b2e3f26659203b005883a29bd44069fd..54f183c7ed852134b76aff029c71418aa544c2d8 100644 (file)
@@ -43,7 +43,7 @@ void test()
   if (true)
     {
       if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
-       deallog << "hyper_cube" << std::endl;
+        deallog << "hyper_cube" << std::endl;
 
       parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
@@ -61,60 +61,60 @@ void test()
 
 
       if (myid==0)
-       {
+        {
 
-         std::vector< unsigned int > cell_subd;
-         cell_subd.resize(tr.n_active_cells());
+          std::vector< unsigned int > cell_subd;
+          cell_subd.resize(tr.n_active_cells());
 
-         GridTools::get_subdomain_association(tr, cell_subd);
-         for (unsigned int i=0;i<tr.n_active_cells();++i)
-           deallog << cell_subd[i] << " ";
-         deallog << std::endl;
-       }
+          GridTools::get_subdomain_association(tr, cell_subd);
+          for (unsigned int i=0; i<tr.n_active_cells(); ++i)
+            deallog << cell_subd[i] << " ";
+          deallog << std::endl;
+        }
 
-                                      //check that all local
-                                      //neighbors have the
-                                      //correct level
+      //check that all local
+      //neighbors have the
+      //correct level
       typename Triangulation<dim,dim>::active_cell_iterator cell;
 
       for (cell = tr.begin_active();
-          cell != tr.end();
-          ++cell)
-       {
-         if (cell->subdomain_id() != (unsigned int)myid)
-           {
-             Assert (cell->is_ghost() || cell->is_artificial(),
-                     ExcInternalError());
-           }
-         else
-         for (unsigned int n=0;n<GeometryInfo<dim>::faces_per_cell;++n)
-           {
-             if (cell->at_boundary(n))
-               continue;
-             Assert (cell->neighbor(n).state() == IteratorState::valid,
-                     ExcInternalError());
+           cell != tr.end();
+           ++cell)
+        {
+          if (cell->subdomain_id() != (unsigned int)myid)
+            {
+              Assert (cell->is_ghost() || cell->is_artificial(),
+                      ExcInternalError());
+            }
+          else
+            for (unsigned int n=0; n<GeometryInfo<dim>::faces_per_cell; ++n)
+              {
+                if (cell->at_boundary(n))
+                  continue;
+                Assert (cell->neighbor(n).state() == IteratorState::valid,
+                        ExcInternalError());
 
-             Assert( cell->neighbor(n)->level() == cell->level(),
-                     ExcInternalError());
+                Assert( cell->neighbor(n)->level() == cell->level(),
+                        ExcInternalError());
 
-             Assert(!cell->neighbor(n)->has_children(), ExcInternalError() );
+                Assert(!cell->neighbor(n)->has_children(), ExcInternalError() );
 
-           }
+              }
 
 
 
-       }
+        }
 
       const unsigned int checksum = tr.get_checksum ();
       if (myid==0)
-       {
-         deallog << "Checksum: "
-                 << checksum
-                 << std::endl;
+        {
+          deallog << "Checksum: "
+                  << checksum
+                  << std::endl;
 
-         std::ofstream file("p4est_3d_ghost_01/1.gpl");
-         GridOut().write_gnuplot (tr, file);
-       }
+          std::ofstream file("p4est_3d_ghost_01/1.gpl");
+          GridOut().write_gnuplot (tr, file);
+        }
 
       deallog << "#global cells " << tr.n_global_active_cells() << std::endl;
     }
@@ -130,7 +130,7 @@ int main(int argc, char *argv[])
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
 
   std::cout << myid << ":" << getpid() << std::endl;
-                                  //system("sleep 20");
+  //system("sleep 20");
 
 
   deallog.push(Utilities::int_to_string(myid));
index f44d4b19179acf8ce98d3d666f7851e024191e72..66922e39000d81e646104db9a1c310aaa5321deb 100644 (file)
@@ -41,7 +41,7 @@ void test()
   if (true)
     {
       if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
-       deallog << "hyper_cube" << std::endl;
+        deallog << "hyper_cube" << std::endl;
 
       parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
@@ -49,67 +49,67 @@ void test()
       tr.refine_global(1);
 
       while (tr.n_active_cells() < 20000/Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD))
-       {
-         if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
-           deallog << "refine_loop..." << std::endl;
-         std::vector<bool> flags (tr.n_active_cells(), false);
-
-                                          // refine one fifth of all cells each
-                                          // time (but at least one).
-                                          // note that only the own marked cells
-                                          // will be refined.
-         for (unsigned int i=0; i<tr.n_active_cells() / 5 + 1; ++i)
-           {
-             const unsigned int x = rand() % flags.size();
-             flags[x] = true;
-           }
-
-         unsigned int index=0;
-         unsigned int locals=0;
-
-         for (typename Triangulation<dim>::active_cell_iterator
-                cell = tr.begin_active();
-              cell != tr.end(); ++cell, ++index)
-           if (flags[index])
-             {
-               if (cell->subdomain_id()==myid)
-                 ++locals;
-               cell->set_refine_flag();
-             }
-
-                                          //and atleast one cell:
-         if (!locals)
-           {
-
-             for (typename Triangulation<dim>::active_cell_iterator
-                    cell = tr.begin_active();
-                  cell != tr.end(); ++cell)
-               if (cell->subdomain_id()==myid)
-                 {
-                   cell->set_refine_flag();
-                   ++locals;
-                   if (locals>5)
-
-
-                     break;
-                 }
-           }
-
-
-
-
-         Assert (index == tr.n_active_cells(), ExcInternalError());
-         tr.execute_coarsening_and_refinement ();
-
-         unsigned int checksum = tr.get_checksum ();
-         if (myid == 0)
-           {
-             deallog << "#cells = " << tr.n_global_active_cells() << std::endl;
-             deallog << "Checksum: "
-                     << checksum
-                     << std::endl;
-           }
-       }
+        {
+          if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
+            deallog << "refine_loop..." << std::endl;
+          std::vector<bool> flags (tr.n_active_cells(), false);
+
+          // refine one fifth of all cells each
+          // time (but at least one).
+          // note that only the own marked cells
+          // will be refined.
+          for (unsigned int i=0; i<tr.n_active_cells() / 5 + 1; ++i)
+            {
+              const unsigned int x = rand() % flags.size();
+              flags[x] = true;
+            }
+
+          unsigned int index=0;
+          unsigned int locals=0;
+
+          for (typename Triangulation<dim>::active_cell_iterator
+               cell = tr.begin_active();
+               cell != tr.end(); ++cell, ++index)
+            if (flags[index])
+              {
+                if (cell->subdomain_id()==myid)
+                  ++locals;
+                cell->set_refine_flag();
+              }
+
+          //and atleast one cell:
+          if (!locals)
+            {
+
+              for (typename Triangulation<dim>::active_cell_iterator
+                   cell = tr.begin_active();
+                   cell != tr.end(); ++cell)
+                if (cell->subdomain_id()==myid)
+                  {
+                    cell->set_refine_flag();
+                    ++locals;
+                    if (locals>5)
+
+
+                      break;
+                  }
+            }
+
+
+
+
+          Assert (index == tr.n_active_cells(), ExcInternalError());
+          tr.execute_coarsening_and_refinement ();
+
+          unsigned int checksum = tr.get_checksum ();
+          if (myid == 0)
+            {
+              deallog << "#cells = " << tr.n_global_active_cells() << std::endl;
+              deallog << "Checksum: "
+                      << checksum
+                      << std::endl;
+            }
+        }
     }
 
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
index d0ba1e58d3fa6f2a2571b4a0dca571e9922b312f..39f89d45e91cc3ee393b264460aba51b9f42a8da 100644 (file)
@@ -44,34 +44,34 @@ void test()
 {
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
 
-      parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
-      GridGenerator::hyper_shell (tr,
-                             Point<dim>(),
-                                 0.5, 1.0,
-                             12,
-                             true);
-
-      int ind = 0;
-      for (typename Triangulation<dim>::active_cell_iterator
-            cell = tr.begin_active(); cell != tr.end(); ++cell, ++ind)
-       if (!cell->is_artificial())
-         {
-           if (myid==0 && (ind==4 || ind==5 || ind==6 || ind== 8))
-             cell->set_refine_flag();
-           if (myid==1 && (ind==0 || ind==2 || ind==10))
-           cell->set_refine_flag();
-         }
-
-      tr.execute_coarsening_and_refinement ();
-
-      unsigned int checksum = tr.get_checksum ();
-      if (myid == 0)
-       {
-         deallog << "#cells = " << tr.n_global_active_cells() << std::endl;
-         deallog << "Checksum: "
-                 << checksum
-                 << std::endl;
-       }
+  parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
+  GridGenerator::hyper_shell (tr,
+                              Point<dim>(),
+                              0.5, 1.0,
+                              12,
+                              true);
+
+  int ind = 0;
+  for (typename Triangulation<dim>::active_cell_iterator
+       cell = tr.begin_active(); cell != tr.end(); ++cell, ++ind)
+    if (!cell->is_artificial())
+      {
+        if (myid==0 && (ind==4 || ind==5 || ind==6 || ind== 8))
+          cell->set_refine_flag();
+        if (myid==1 && (ind==0 || ind==2 || ind==10))
+          cell->set_refine_flag();
+      }
+
+  tr.execute_coarsening_and_refinement ();
+
+  unsigned int checksum = tr.get_checksum ();
+  if (myid == 0)
+    {
+      deallog << "#cells = " << tr.n_global_active_cells() << std::endl;
+      deallog << "Checksum: "
+              << checksum
+              << std::endl;
+    }
 
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     deallog << "OK" << std::endl;
index 9db753163bb465c6b6e25b35dce110ed5b243da1..63ed4d0d7d05c138cfb5f40526ec702a190d4354 100644 (file)
     at /scratch/p4estbuild/p4est-0.3.1.55-67fe1/sc/src/sc.c:603
 #18 0x00007fffec2a2d4b in p8est_quadrant_parent (q=0x834670, r=0x833a50)
     at /scratch/p4estbuild/p4est-0.3.1.55-67fe1/src/p4est_bits.c:756
-#19 0x00007fffec29e46c in p4est_correct_partition (p4est=0x835b40, 
+#19 0x00007fffec29e46c in p4est_correct_partition (p4est=0x835b40,
     num_quadrants_in_proc=0x834750)
     at /scratch/p4estbuild/p4est-0.3.1.55-67fe1/src/p4est.c:2430
-#20 0x00007fffec29ddaf in p8est_partition_ext (p4est=0x835b40, 
+#20 0x00007fffec29ddaf in p8est_partition_ext (p4est=0x835b40,
     partition_for_coarsening=1, weight_fn=0)
     at /scratch/p4estbuild/p4est-0.3.1.55-67fe1/src/p4est.c:2293
 #21 0x00007ffff68a73c7 in dealii::parallel::distributed::Triangulation<3, 3>::execute_coarsening_and_refinement (this=0x7fffffffb7d0)
@@ -35,7 +35,7 @@
 #23 0x000000000040c6e5 in main (argc=1, argv=0x7fffffffdd98)
     at p4est_3d_refine_02.cc:106
     */
-    
+
 #include "../tests.h"
 #include "coarse_grid_common.h"
 #include <deal.II/base/logstream.h>
@@ -56,19 +56,19 @@ void test()
 {
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
 
-      parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
-      GridGenerator::hyper_cube(tr);
-      
-      tr.execute_coarsening_and_refinement ();
-
-      unsigned int checksum = tr.get_checksum ();
-      if (myid == 0)
-       {
-         deallog << "#cells = " << tr.n_global_active_cells() << std::endl;
-         deallog << "Checksum: "
-                 << checksum
-                 << std::endl;
-       }
+  parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
+  GridGenerator::hyper_cube(tr);
+
+  tr.execute_coarsening_and_refinement ();
+
+  unsigned int checksum = tr.get_checksum ();
+  if (myid == 0)
+    {
+      deallog << "#cells = " << tr.n_global_active_cells() << std::endl;
+      deallog << "Checksum: "
+              << checksum
+              << std::endl;
+    }
 
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     deallog << "OK" << std::endl;
index 3fa2e69996d3c12c9dd3404b4c715818ad0be39b..48adcb1466de5dd0e87f444a164b589c065de5a9 100644 (file)
@@ -47,67 +47,67 @@ void test()
   if (true)
     {
       parallel::distributed::Triangulation<dim>
-       triangulation(MPI_COMM_WORLD);
+      triangulation(MPI_COMM_WORLD);
 
-                                      // create a mesh for the
-                                      // hypershell and refine it
-                                      // twice globally
+      // create a mesh for the
+      // hypershell and refine it
+      // twice globally
       const double R0 = 6371000.-2890000.;
       const double R1 = 6371000.-  35000.;
       GridGenerator::hyper_shell (triangulation,
-                                 Point<dim>(),
-                                 R0,
-                                 R1,
-                                 (dim==3) ? 96 : 12,
-                                 true);
+                                  Point<dim>(),
+                                  R0,
+                                  R1,
+                                  (dim==3) ? 96 : 12,
+                                  true);
       triangulation.refine_global (2);
 
-                                      // then flag all cells for
-                                      // refinement that are close to
-                                      // the north pole
+      // then flag all cells for
+      // refinement that are close to
+      // the north pole
       unsigned int x_flagged_cells = 0;
       for (typename Triangulation<dim>::active_cell_iterator
-            cell = triangulation.begin_active();
-          cell != triangulation.end(); ++cell)
-       if (!cell->is_ghost() && !cell->is_artificial())
-         if (cell->center()[2] > R1*0.75)
-           {
-             ++x_flagged_cells;
-             cell->set_refine_flag();
-           }
-
-                                      // count how many cells
-                                      // actually have the refinement
-                                      // flag after preparing for
-                                      // refinement, and ensure that
-                                      // this number is still the
-                                      // same as before
+           cell = triangulation.begin_active();
+           cell != triangulation.end(); ++cell)
+        if (!cell->is_ghost() && !cell->is_artificial())
+          if (cell->center()[2] > R1*0.75)
+            {
+              ++x_flagged_cells;
+              cell->set_refine_flag();
+            }
+
+      // count how many cells
+      // actually have the refinement
+      // flag after preparing for
+      // refinement, and ensure that
+      // this number is still the
+      // same as before
       triangulation.prepare_coarsening_and_refinement ();
       {
-       unsigned int n_flagged_cells = 0;
-       for (typename Triangulation<dim>::active_cell_iterator
-              cell = triangulation.begin_active();
-            cell != triangulation.end(); ++cell)
-         if (!cell->is_ghost() && !cell->is_artificial())
-           if (cell->refine_flag_set())
-             ++n_flagged_cells;
-
-       Assert (n_flagged_cells == x_flagged_cells,
-               ExcInternalError());
-
-       unsigned int global_f_c = 0;
-       MPI_Allreduce (&n_flagged_cells, &global_f_c, 1, MPI_UNSIGNED,
-                      MPI_SUM, MPI_COMM_WORLD);
-
-       if (myid == 0)
-         deallog << "# flagged cells = " << global_f_c << std::endl;
+        unsigned int n_flagged_cells = 0;
+        for (typename Triangulation<dim>::active_cell_iterator
+             cell = triangulation.begin_active();
+             cell != triangulation.end(); ++cell)
+          if (!cell->is_ghost() && !cell->is_artificial())
+            if (cell->refine_flag_set())
+              ++n_flagged_cells;
+
+        Assert (n_flagged_cells == x_flagged_cells,
+                ExcInternalError());
+
+        unsigned int global_f_c = 0;
+        MPI_Allreduce (&n_flagged_cells, &global_f_c, 1, MPI_UNSIGNED,
+                       MPI_SUM, MPI_COMM_WORLD);
+
+        if (myid == 0)
+          deallog << "# flagged cells = " << global_f_c << std::endl;
       }
 
       triangulation.execute_coarsening_and_refinement ();
 
       if (myid == 0)
-       deallog << "#cells = " << triangulation.n_global_active_cells()
-               << std::endl;
+        deallog << "#cells = " << triangulation.n_global_active_cells()
+                << std::endl;
     }
 
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
index f28d82ef4a110397faa465aa92d5966f98988eb3..7f0a30b325a36d9fdef5c82b06aebba2604989d8 100644 (file)
@@ -71,11 +71,11 @@ void test()
 
   data_out.add_data_vector (x, "x");
   data_out.build_patches ();
-    
+
   if (myid==0)
     {
       for (unsigned int i=0; i<dofh.n_locally_owned_dofs_per_processor().size(); ++i)
-       deallog << dofh.n_locally_owned_dofs_per_processor()[i] << std::endl;
+        deallog << dofh.n_locally_owned_dofs_per_processor()[i] << std::endl;
       data_out.write_vtu (deallog.get_file_stream());
     }
 }
index e5e050e2ac32c2d27eaf6af750611b4f9633351c..4442c57d1573039650e09e9fd1c071ff34565601 100644 (file)
@@ -59,20 +59,20 @@ void test()
   static const FE_Q<dim> fe(2);
   dofh.distribute_dofs (fe);
 
-   if (myid==1)
-     {
-       deallog << "dofh.n_dofs() " << dofh.n_locally_owned_dofs_per_processor() << std::endl;
-       deallog << "dofh.n_locally_owned_dofs() " << dofh.n_locally_owned_dofs() << std::endl;
-
-       const IndexSet set
-        = DoFTools::dof_indices_with_subdomain_association
-        (dofh,
-         tr.locally_owned_subdomain());
-
-       deallog << set.n_elements() << std::endl;
-       for (unsigned int i=0; i<set.n_elements(); ++i)
-        deallog << "   " << set.nth_index_in_set(i) << std::endl;
-     }
+  if (myid==1)
+    {
+      deallog << "dofh.n_dofs() " << dofh.n_locally_owned_dofs_per_processor() << std::endl;
+      deallog << "dofh.n_locally_owned_dofs() " << dofh.n_locally_owned_dofs() << std::endl;
+
+      const IndexSet set
+        = DoFTools::dof_indices_with_subdomain_association
+          (dofh,
+           tr.locally_owned_subdomain());
+
+      deallog << set.n_elements() << std::endl;
+      for (unsigned int i=0; i<set.n_elements(); ++i)
+        deallog << "   " << set.nth_index_in_set(i) << std::endl;
+    }
 }
 
 
index 513b93dd203fa25c5db3311ff86ad5f8994e38fa..5cb7726a123b2c6e3f1eaab9fc5e9266603b27f7 100644 (file)
@@ -41,7 +41,7 @@ void test()
   if (true)
     {
       if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
-       deallog << "hyper_cube" << std::endl;
+        deallog << "hyper_cube" << std::endl;
 
       parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
@@ -49,27 +49,27 @@ void test()
 //      tr.refine_global(1);
 
       int level = 0;
-      
-      for (int i=0;i<29;++i)
-       {
-         if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
-           deallog << "refine_loop... level=" << level  << std::endl;
-         
-         if (myid==0)
-           tr.begin_active(level)->set_refine_flag();
-
-         deallog.push("crap");
-         tr.execute_coarsening_and_refinement ();
-         deallog.pop();
-         
-
-         if (myid == 0)
-           {
-             deallog << "#cells = " << tr.n_global_active_cells() << std::endl;
-           }
-
-         level++;
-       }
+
+      for (int i=0; i<29; ++i)
+        {
+          if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
+            deallog << "refine_loop... level=" << level  << std::endl;
+
+          if (myid==0)
+            tr.begin_active(level)->set_refine_flag();
+
+          deallog.push("crap");
+          tr.execute_coarsening_and_refinement ();
+          deallog.pop();
+
+
+          if (myid == 0)
+            {
+              deallog << "#cells = " << tr.n_global_active_cells() << std::endl;
+            }
+
+          level++;
+        }
     }
 
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
@@ -80,7 +80,7 @@ void test()
 int main(int argc, char *argv[])
 {
   Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
-  
+
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
 
 
index 5341f8ce4a58b4d49e2a10747a3e6b9ce7a8674e..ea61c0fd7662598cf2f2bbafb662a242fb906aca 100644 (file)
@@ -52,7 +52,7 @@ void test()
     deallog << "hyper_cube" << std::endl;
 
   std::string filename =
-      (std::string("p4est_save_01/ncpu_") + Utilities::int_to_string(Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)) + "/dat");
+    (std::string("p4est_save_01/ncpu_") + Utilities::int_to_string(Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)) + "/dat");
   {
     parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
@@ -60,27 +60,27 @@ void test()
 
     tr.refine_global(2);
     for (typename Triangulation<dim>::active_cell_iterator
-          cell = tr.begin_active();
-        cell != tr.end(); ++cell)
+         cell = tr.begin_active();
+         cell != tr.end(); ++cell)
       if (!cell->is_ghost() && !cell->is_artificial())
-       if (cell->center().norm() < 0.3)
-         {
-           cell->set_refine_flag();
-         }
+        if (cell->center().norm() < 0.3)
+          {
+            cell->set_refine_flag();
+          }
 
     tr.execute_coarsening_and_refinement ();
 
     tr.save(filename.c_str());
-  
+
     if (myid == 0)
       {
-       deallog << "#cells = " << tr.n_global_active_cells() << std::endl;
-       deallog << "cells(0) = " << tr.n_active_cells() << std::endl;
+        deallog << "#cells = " << tr.n_global_active_cells() << std::endl;
+        deallog << "cells(0) = " << tr.n_active_cells() << std::endl;
       }
     deallog << "Checksum: "
-           << tr.get_checksum ()
-           << std::endl;
-  
+            << tr.get_checksum ()
+            << std::endl;
+
   }
   MPI_Barrier(MPI_COMM_WORLD);
 
@@ -92,12 +92,12 @@ void test()
 
     if (myid == 0)
       {
-       deallog << "#cells = " << tr.n_global_active_cells() << std::endl;
-       deallog << "cells(0) = " << tr.n_active_cells() << std::endl;
+        deallog << "#cells = " << tr.n_global_active_cells() << std::endl;
+        deallog << "cells(0) = " << tr.n_active_cells() << std::endl;
       }
     deallog << "Checksum: "
-           << tr.get_checksum ()
-           << std::endl;
+            << tr.get_checksum ()
+            << std::endl;
   }
 
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
index 269c5383b21054892ed03cf1c4b17045f7a68b4e..8e16a9611426681f41a518657a09ca558633fea8 100644 (file)
@@ -52,7 +52,7 @@ void test()
     deallog << "hyper_cube" << std::endl;
 
   std::string filename =
-      (std::string("p4est_save_02/ncpu_") + Utilities::int_to_string(Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)) + "/dat");
+    (std::string("p4est_save_02/ncpu_") + Utilities::int_to_string(Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)) + "/dat");
   {
     parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
 
@@ -60,13 +60,13 @@ void test()
 
     tr.refine_global(2);
     for (typename Triangulation<dim>::active_cell_iterator
-          cell = tr.begin_active();
-        cell != tr.end(); ++cell)
+         cell = tr.begin_active();
+         cell != tr.end(); ++cell)
       if (!cell->is_ghost() && !cell->is_artificial())
-       if (cell->center().norm() < 0.3)
-         {
-           cell->set_refine_flag();
-         }
+        if (cell->center().norm() < 0.3)
+          {
+            cell->set_refine_flag();
+          }
 
     tr.execute_coarsening_and_refinement ();
 
@@ -85,30 +85,30 @@ void test()
 
     parallel::distributed::SolutionTransfer<dim,PETScWrappers::MPI::Vector> soltrans(dh);
 
-    for (unsigned int i=0;i<locally_owned_dofs.n_elements();++i)
+    for (unsigned int i=0; i<locally_owned_dofs.n_elements(); ++i)
       {
-       unsigned int idx = locally_owned_dofs.nth_index_in_set(i);
-       x(idx)=idx;
-       
-//     std::cout << '[' << idx << ']' << ' ' << solution(idx) << std::endl;
+        unsigned int idx = locally_owned_dofs.nth_index_in_set(i);
+        x(idx)=idx;
+
+//  std::cout << '[' << idx << ']' << ' ' << solution(idx) << std::endl;
       }
 
     x.compress(VectorOperation::insert);
     solution=x;
-    
+
     soltrans.prepare_serialization (solution);
 
     tr.save(filename.c_str());
-  
+
     if (myid == 0)
       {
-       deallog << "#cells = " << tr.n_global_active_cells() << std::endl;
-       deallog << "cells(0) = " << tr.n_active_cells() << std::endl;
+        deallog << "#cells = " << tr.n_global_active_cells() << std::endl;
+        deallog << "cells(0) = " << tr.n_active_cells() << std::endl;
       }
     deallog << "Checksum: "
-           << tr.get_checksum ()
-           << std::endl;
-  
+            << tr.get_checksum ()
+            << std::endl;
+
   }
   MPI_Barrier(MPI_COMM_WORLD);
 
@@ -131,28 +131,28 @@ void test()
     parallel::distributed::SolutionTransfer<dim,PETScWrappers::MPI::Vector> soltrans(dh);
     solution = 2;
     soltrans.deserialize(solution);
-    
-    for (unsigned int i=0;i<locally_owned_dofs.n_elements();++i)
+
+    for (unsigned int i=0; i<locally_owned_dofs.n_elements(); ++i)
       {
-       unsigned int idx = locally_owned_dofs.nth_index_in_set(i);
-       //std::cout << '[' << idx << ']' << ' ' << solution(idx) << std::endl;
-       Assert(idx == solution(idx),ExcInternalError());
-       
+        unsigned int idx = locally_owned_dofs.nth_index_in_set(i);
+        //std::cout << '[' << idx << ']' << ' ' << solution(idx) << std::endl;
+        Assert(idx == solution(idx),ExcInternalError());
+
       }
 
     double norm = solution.l1_norm();
 
     if (myid == 0)
       {
-       deallog << "#cells = " << tr.n_global_active_cells() << std::endl;
-       deallog << "cells(0) = " << tr.n_active_cells() << std::endl;
+        deallog << "#cells = " << tr.n_global_active_cells() << std::endl;
+        deallog << "cells(0) = " << tr.n_active_cells() << std::endl;
       }
     deallog << "Checksum: "
-           << tr.get_checksum ()
-           << std::endl;
+            << tr.get_checksum ()
+            << std::endl;
     deallog << "sum: "
-           << norm
-           << std::endl;
+            << norm
+            << std::endl;
   }
 
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
index 86fc6a72c16a866511e8e43025bd257075f77926..e8b5724c8b11e01f8ee9062eeb25c9116293926e 100644 (file)
@@ -89,20 +89,20 @@ void test()
     parallel::distributed::SolutionTransfer<dim, PETScWrappers::MPI::Vector> soltrans (dh);
     parallel::distributed::SolutionTransfer<dim, PETScWrappers::MPI::Vector> soltrans2 (dh);
 
-    for (unsigned int i = 0;i < locally_owned_dofs.n_elements();++i)
+    for (unsigned int i = 0; i < locally_owned_dofs.n_elements(); ++i)
       {
         unsigned int idx = locally_owned_dofs.nth_index_in_set (i);
         x (idx) = idx;
         x2 (idx) = 2 * idx;
 
-//     std::cout << '[' << idx << ']' << ' ' << solution(idx) << std::endl;
+//  std::cout << '[' << idx << ']' << ' ' << solution(idx) << std::endl;
       }
 
     x.compress(VectorOperation::insert);
     solution=x;
     x*=2.0;
     solution2 = x;
-    
+
 
     soltrans.prepare_serialization (solution);
     soltrans2.prepare_serialization (solution2);
@@ -115,8 +115,8 @@ void test()
         deallog << "cells(0) = " << tr.n_active_cells() << std::endl;
       }
     deallog << "Checksum: "
-    << tr.get_checksum ()
-    << std::endl;
+            << tr.get_checksum ()
+            << std::endl;
 
   }
   MPI_Barrier (MPI_COMM_WORLD);
@@ -144,7 +144,7 @@ void test()
     soltrans.deserialize (solution);
     soltrans2.deserialize (solution2);
 
-    for (unsigned int i = 0;i < locally_owned_dofs.n_elements();++i)
+    for (unsigned int i = 0; i < locally_owned_dofs.n_elements(); ++i)
       {
         unsigned int idx = locally_owned_dofs.nth_index_in_set (i);
         //std::cout << '[' << idx << ']' << ' ' << solution(idx) << std::endl;
@@ -153,7 +153,7 @@ void test()
       }
 
     double norm = solution.l1_norm();
-       double norm2 = solution2.l1_norm();
+    double norm2 = solution2.l1_norm();
 
     if (myid == 0)
       {
@@ -161,11 +161,11 @@ void test()
         deallog << "cells(0) = " << tr.n_active_cells() << std::endl;
       }
     deallog << "Checksum: "
-    << tr.get_checksum ()
-    << std::endl;
+            << tr.get_checksum ()
+            << std::endl;
     deallog << "sum: "
-    << norm << " " << norm2
-    << std::endl;
+            << norm << " " << norm2
+            << std::endl;
   }
 
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
@@ -176,7 +176,7 @@ void test()
 int main (int argc, char *argv[])
 {
   Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
-  
+
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
 
 
index 6bbbf65cb39f57fe36d400f82bdf6a55607dbf45..6efa357d4b460f371275f99235d13f371813bd29 100644 (file)
@@ -36,10 +36,10 @@ void test ()
   if (myid==0) deallog << "numproc=" << numproc << std::endl;
 
 
-                                   // each processor from processor 1 to 8
-                                   // owns 2 indices (the other processors do
-                                   // not own any dof), and all processors are
-                                   // ghosting element 1 (the second)
+  // each processor from processor 1 to 8
+  // owns 2 indices (the other processors do
+  // not own any dof), and all processors are
+  // ghosting element 1 (the second)
   IndexSet local_owned(std::min(16U,numproc*2));
   if (myid < 8)
     local_owned.add_range(myid*2,myid*2+2);
@@ -49,7 +49,7 @@ void test ()
 
   parallel::distributed::Vector<double> v(local_owned, local_owned, MPI_COMM_WORLD);
 
-                                     // set local values
+  // set local values
   if (myid < 8)
     {
       v(myid*2)=myid*2.0;
@@ -68,7 +68,7 @@ void test ()
     w.block(i) = v;
   w.collect_sizes();
 
-                                // check l2 norm
+  // check l2 norm
   {
     const double l2_norm = w.l2_norm();
     if (myid == 0)
@@ -77,7 +77,7 @@ void test ()
            ExcInternalError());
   }
 
-                                // check l1 norm
+  // check l1 norm
   {
     const double l1_norm = w.l1_norm();
     if (myid == 0)
@@ -86,7 +86,7 @@ void test ()
            ExcInternalError());
   }
 
-                                // check linfty norm
+  // check linfty norm
   {
     const double linfty_norm = w.linfty_norm();
     if (myid == 0)
@@ -95,7 +95,7 @@ void test ()
            ExcInternalError());
   }
 
-                                // check lp norm
+  // check lp norm
   {
     const double lp_norm = w.lp_norm(2.2);
     if (myid == 0)
@@ -105,9 +105,9 @@ void test ()
             ExcInternalError());
   }
 
-                                // check mean value (should be equal to l1
-                                // norm divided by vector size here since we
-                                // have no negative entries)
+  // check mean value (should be equal to l1
+  // norm divided by vector size here since we
+  // have no negative entries)
   {
     const double mean = w.mean_value();
     if (myid == 0)
@@ -116,7 +116,7 @@ void test ()
     Assert (std::fabs (mean * w.size() - w.l1_norm()) < 1e-15,
             ExcInternalError());
   }
-                                // check inner product
+  // check inner product
   {
     const double norm_sqr = w.norm_sqr();
     Assert (std::fabs(w * w - norm_sqr) < 1e-15,
@@ -126,14 +126,14 @@ void test ()
     Assert (std::fabs(w2 * w - norm_sqr) < 1e-15,
             ExcInternalError());
 
-    if(myid<8)
+    if (myid<8)
       w2.block(0).local_element(0) = -1;
     const double inner_prod = w * w2;
     if (myid == 0)
       deallog << "Inner product: " << inner_prod << std::endl;
   }
 
-                                // check operator ==
+  // check operator ==
   {
     parallel::distributed::BlockVector<double> w2 (w);
     bool equal = (w2 == w);
@@ -144,7 +144,7 @@ void test ()
     if (myid == 0)
       deallog << " v!=v2 ? " << not_equal << std::endl;
 
-                                // change v2 on one proc only
+    // change v2 on one proc only
     if (myid == 0)
       w2.block(0).local_element(1) = 2.2212;
 
@@ -155,7 +155,7 @@ void test ()
     if (myid == 0)
       deallog << " v!=v2 ? " << not_equal << std::endl;
 
-                                // reset
+    // reset
     w2 = w;
     equal = (w2 == w);
     if (myid == 0)
@@ -164,7 +164,7 @@ void test ()
     if (myid == 0)
       deallog << " v!=v2 ? " << not_equal << std::endl;
 
-                                // change some value on all procs
+    // change some value on all procs
     if (myid < 8)
       w2.block(1).local_element(0) = -1;
     equal = (w2 == w);
@@ -175,7 +175,7 @@ void test ()
       deallog << " v!=v2 ? " << not_equal << std::endl;
   }
 
-                                // check all_zero
+  // check all_zero
   {
     bool allzero = w.all_zero();
     if (myid == 0)
@@ -186,7 +186,7 @@ void test ()
     if (myid == 0)
       deallog << " v2==0 ? " << allzero << std::endl;
 
-                                // now change one element to nonzero
+    // now change one element to nonzero
     if (myid == 0)
       w2.block(1).local_element(1) = 1;
     allzero = w2.all_zero();
@@ -195,15 +195,15 @@ void test ()
   }
 
 
-                                // check all_non_negative
+  // check all_non_negative
   {
     bool allnonneg = w.is_non_negative();
     if (myid == 0)
       deallog << " v>=0 ? " << allnonneg << std::endl;
     parallel::distributed::BlockVector<double> w2, w3;
 
-                                // vector where all processors have
-                                // non-negative entries
+    // vector where all processors have
+    // non-negative entries
     w2 = w;
     if (myid < 8)
       w2.block(0).local_element(0) = -1;
@@ -211,13 +211,13 @@ void test ()
     if (myid == 0)
       deallog << " v2>=0 ? " << allnonneg << std::endl;
 
-                                // zero vector
+    // zero vector
     w3.reinit (w2);
     allnonneg = w3.is_non_negative();
     if (myid == 0)
       deallog << " v3>=0 ? " << allnonneg << std::endl;
 
-                                // only one processor has non-negative entry
+    // only one processor has non-negative entry
     w3 = w;
     if (myid == 1 || numproc==1)
       w3.block(0).local_element(0) = -1;
index 70baff18df17bbef86eb9378b720211070220c92..2c2256298f64cbe3f90e9e795630b4961085a617 100644 (file)
@@ -45,23 +45,24 @@ void test ()
       if (i<myid)
         my_start += set - i;
     }
-                                   // each processor owns some indices and all
-                                   // are ghosting elements from three
-                                   // processors (the second). some entries
-                                   // are right around the border between two
-                                   // processors
+  // each processor owns some indices and all
+  // are ghosting elements from three
+  // processors (the second). some entries
+  // are right around the border between two
+  // processors
   IndexSet local_owned(global_size);
   local_owned.add_range(my_start, my_start + local_size);
   IndexSet local_relevant(global_size);
   local_relevant = local_owned;
   unsigned int ghost_indices [10] = {1, 2, 13, set-2, set-1, set, set+1, 2*set,
-                                     2*set+1, 2*set+3};
+                                     2*set+1, 2*set+3
+                                    };
   local_relevant.add_indices (&ghost_indices[0], &ghost_indices[0]+10);
 
   Utilities::MPI::Partitioner v(local_owned, local_relevant, MPI_COMM_WORLD);
 
-                                // check number of ghosts everywhere (counted
-                                // the above)
+  // check number of ghosts everywhere (counted
+  // the above)
   if (myid == 0)
     {
       AssertDimension (v.n_ghost_indices(), 5);
@@ -79,8 +80,8 @@ void test ()
       AssertDimension (v.n_ghost_indices(), 10);
     }
 
-                                // count that 13 is ghost only on non-owning
-                                // processors
+  // count that 13 is ghost only on non-owning
+  // processors
   if (myid == 0)
     {
       Assert (v.is_ghost_entry (13) == false, ExcInternalError());
@@ -90,7 +91,7 @@ void test ()
       Assert (v.is_ghost_entry (13) == true, ExcInternalError());
     }
 
-                                // count that 27 is ghost nowhere
+  // count that 27 is ghost nowhere
   Assert (v.is_ghost_entry (27) == false, ExcInternalError());
   if (myid == 0)
     {
@@ -101,7 +102,7 @@ void test ()
       Assert (v.in_local_range (27) == false, ExcInternalError());
     }
 
-                                // element with number set is ghost
+  // element with number set is ghost
   if (myid == 1)
     {
       Assert (v.is_ghost_entry (set) == false, ExcInternalError());
index f0596ddb15b58a8ff3907bf62b7db400b10a4550..acdfc411e3e7199a7040200f0f35b21661361b82 100644 (file)
@@ -44,11 +44,11 @@ void test ()
       if (i<myid)
         my_start += set - i;
     }
-                                   // each processor owns some indices and all
-                                   // are ghosting elements from three
-                                   // processors (the second). some entries
-                                   // are right around the border between two
-                                   // processors
+  // each processor owns some indices and all
+  // are ghosting elements from three
+  // processors (the second). some entries
+  // are right around the border between two
+  // processors
   IndexSet local_owned(global_size);
   local_owned.add_range(my_start, my_start + local_size);
   IndexSet local_relevant(global_size);
@@ -56,15 +56,16 @@ void test ()
   if (myid < 6)
     {
       unsigned int ghost_indices [10] = {1, 2, 13, set-2, set-1, set, set+1, 2*set,
-                                         2*set+1, 2*set+3};
+                                         2*set+1, 2*set+3
+                                        };
       local_relevant.add_indices (&ghost_indices[0], &ghost_indices[0]+10);
     }
 
   Utilities::MPI::Partitioner v(local_owned, local_relevant, MPI_COMM_WORLD);
 
-                                // check number of import indices everywhere
-                                // (counted the above) times the number of
-                                // processors which have these as ghosts
+  // check number of import indices everywhere
+  // (counted the above) times the number of
+  // processors which have these as ghosts
   const unsigned int n_procs_with_ghosts = std::min (numproc-1, 5U);
   if (myid == 0)
     {
index 5734c1ee46e8b63992c4e9604aa7aef819d2ff3d..b5774dd29243c44b5a7e5a7e6dda271fdd1f0526 100644 (file)
@@ -45,22 +45,23 @@ void test ()
       if (i<myid)
         my_start += set - i;
     }
-                                   // each processor owns some indices and all
-                                   // are ghosting elements from three
-                                   // processors (the second). some entries
-                                   // are right around the border between two
-                                   // processors
+  // each processor owns some indices and all
+  // are ghosting elements from three
+  // processors (the second). some entries
+  // are right around the border between two
+  // processors
   IndexSet local_owned(global_size);
   local_owned.add_range(my_start, my_start + local_size);
   IndexSet local_relevant(global_size);
   local_relevant = local_owned;
   unsigned int ghost_indices [10] = {1, 2, 13, set-2, set-1, set, set+1, 2*set,
-                                     2*set+1, 2*set+3};
+                                     2*set+1, 2*set+3
+                                    };
   local_relevant.add_indices (&ghost_indices[0], &ghost_indices[0]+10);
 
   Utilities::MPI::Partitioner v(local_owned, local_relevant, MPI_COMM_WORLD);
 
-                                // write the info on ghost processors and import indices to file
+  // write the info on ghost processors and import indices to file
   {
     std::ofstream file((std::string("parallel_partitioner_03/ncpu_") + Utilities::int_to_string(Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(myid)).c_str());
     file << "**** proc " << myid << std::endl;
@@ -85,7 +86,7 @@ void test ()
 
   if (myid==0)
     {
-      for (unsigned int i=0;i<numproc;++i)
+      for (unsigned int i=0; i<numproc; ++i)
         {
           cat_file((std::string("parallel_partitioner_03/ncpu_") + Utilities::int_to_string(Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(i)).c_str());
         }
index 01a9e88d9c27ac8849ee99125172adceca4270f8..23bcee5d89b43ba9e0633f9f2488ab04252b046e 100644 (file)
@@ -45,29 +45,30 @@ void test ()
       if (i<myid)
         my_start += set - i;
     }
-                                   // each processor owns some indices and all
-                                   // are ghosting elements from three
-                                   // processors (the second). some entries
-                                   // are right around the border between two
-                                   // processors
+  // each processor owns some indices and all
+  // are ghosting elements from three
+  // processors (the second). some entries
+  // are right around the border between two
+  // processors
   IndexSet local_owned(global_size);
   local_owned.add_range(my_start, my_start + local_size);
   IndexSet local_relevant(global_size);
   local_relevant = local_owned;
   unsigned int ghost_indices [10] = {1, 2, 13, set-2, set-1, set, set+1, 2*set,
-                                     2*set+1, 2*set+3};
+                                     2*set+1, 2*set+3
+                                    };
   local_relevant.add_indices (&ghost_indices[0], &ghost_indices[0]+10);
 
   Utilities::MPI::Partitioner v(local_owned, local_relevant, MPI_COMM_WORLD);
 
-                                // check locally owned range
+  // check locally owned range
   for (unsigned int i=my_start; i<my_start+local_size; ++i)
     {
       AssertDimension (v.global_to_local(i), i-my_start);
       AssertDimension (v.local_to_global(i-my_start), i);
     }
 
-                                // check ghost indices
+  // check ghost indices
   for (unsigned int i=0, count=0; i<10; ++i)
     if (ghost_indices[i] < my_start || ghost_indices[i] >= my_start+local_size)
       {
@@ -76,8 +77,8 @@ void test ()
         ++count;
       }
 
-                                // check that loc->glob and glob->loc form an
-                                // identity operation
+  // check that loc->glob and glob->loc form an
+  // identity operation
   for (unsigned int i=0; i<local_size+v.n_ghost_indices(); ++i)
     AssertDimension (i, v.global_to_local(v.local_to_global(i)));
 
index ca38553c26a4141d1ebec4783c292183bc87f335..88ac91fd94c256d5695df427343f9302d426b4b6 100644 (file)
@@ -34,14 +34,14 @@ void test ()
   if (myid==0) deallog << "numproc=" << numproc << std::endl;
 
 
-                                   // each processor owns 2 indices and all
-                                   // are ghosting element 1 (the second)
+  // each processor owns 2 indices and all
+  // are ghosting element 1 (the second)
   IndexSet local_owned(numproc*2);
   local_owned.add_range(myid*2,myid*2+2);
 
   parallel::distributed::Vector<double> v(local_owned, local_owned, MPI_COMM_WORLD);
 
-                                     // set local values
+  // set local values
   v(myid*2)=myid*2.0;
   v(myid*2+1)=myid*2.0+1.0;
 
@@ -57,7 +57,7 @@ void test ()
   Assert(v(myid*2) == myid*4.0, ExcInternalError());
   Assert(v(myid*2+1) == myid*4.0+2.0, ExcInternalError());
 
-                                // check l2 norm
+  // check l2 norm
   const double l2_norm = v.l2_norm();
   if (myid == 0)
     deallog << "L2 norm: " << l2_norm << std::endl;
index 83cf526b3f8bbdb2d5184d82af2f98c04cf9c552..ec3e2a961f44799e0a0b26cc0306f2520a1f59d9 100644 (file)
@@ -34,8 +34,8 @@ void test ()
   if (myid==0) deallog << "numproc=" << numproc << std::endl;
 
 
-                                   // each processor owns 2 indices and all
-                                   // are ghosting element 1 (the second)
+  // each processor owns 2 indices and all
+  // are ghosting element 1 (the second)
   IndexSet local_owned(numproc*2);
   local_owned.add_range(myid*2,myid*2+2);
   IndexSet local_relevant(numproc*2);
@@ -44,7 +44,7 @@ void test ()
 
   parallel::distributed::Vector<double> v(local_owned, local_relevant, MPI_COMM_WORLD);
 
-                                     // set local values and check them
+  // set local values and check them
   v(myid*2)=myid*2.0;
   v(myid*2+1)=myid*2.0+1.0;
 
@@ -54,7 +54,7 @@ void test ()
   Assert(v(myid*2) == myid*4.0, ExcInternalError());
   Assert(v(myid*2+1) == myid*4.0+2.0, ExcInternalError());
 
-                                // set ghost dof, compress
+  // set ghost dof, compress
   v(1) = 7;
   v.compress(VectorOperation::add);
 
@@ -64,11 +64,11 @@ void test ()
       deallog << myid*2+1 << ":" << v(myid*2+1) << std::endl;
     }
 
-                                // import ghosts onto all procs
+  // import ghosts onto all procs
   v.update_ghost_values();
   Assert (v(1) == 7. * numproc, ExcInternalError());
 
-                                // check l2 norm
+  // check l2 norm
   const double l2_norm = v.l2_norm();
   if (myid == 0)
     deallog << "L2 norm: " << l2_norm << std::endl;
index dfafd8e884c88d8c405d03fbe6a211740a202fee..5c67d47868c7ad1bc5b429c61ffb43f0e0b5d967 100644 (file)
@@ -34,8 +34,8 @@ void test ()
   if (myid==0) deallog << "numproc=" << numproc << std::endl;
 
 
-                                   // each processor owns 2 indices and all
-                                   // are ghosting element 1 (the second)
+  // each processor owns 2 indices and all
+  // are ghosting element 1 (the second)
   IndexSet local_owned(numproc*2);
   local_owned.add_range(myid*2,myid*2+2);
   IndexSet local_relevant(numproc*2);
@@ -44,7 +44,7 @@ void test ()
 
   parallel::distributed::Vector<double> v(local_owned, local_relevant, MPI_COMM_WORLD);
 
-                                     // set local values and check them
+  // set local values and check them
   v(myid*2)=myid*2.0;
   v(myid*2+1)=myid*2.0+1.0;
 
@@ -54,8 +54,8 @@ void test ()
   Assert(v(myid*2) == myid*4.0, ExcInternalError());
   Assert(v(myid*2+1) == myid*4.0+2.0, ExcInternalError());
 
-                                // set ghost dof on all processors, compress
-                                // (insert mode)
+  // set ghost dof on all processors, compress
+  // (insert mode)
   v(1) = 7;
   v.compress(VectorOperation::insert);
 
@@ -65,11 +65,11 @@ void test ()
       deallog << myid*2+1 << ":" << v(myid*2+1) << std::endl;
     }
 
-                                // import ghosts onto all procs
+  // import ghosts onto all procs
   v.update_ghost_values();
   Assert (v(1) == 7.0, ExcInternalError());
 
-                                // check l2 norm
+  // check l2 norm
   const double l2_norm = v.l2_norm();
   if (myid == 0)
     deallog << "L2 norm: " << l2_norm << std::endl;
index 6e3e7b355d6928b8580e46b3afc24f876207aba3..bb736e34a850e28fa729f065e33eb772757ade3e 100644 (file)
@@ -35,8 +35,8 @@ void test ()
   if (myid==0) deallog << "numproc=" << numproc << std::endl;
 
 
-                                   // each processor owns 2 indices and all
-                                   // are ghosting element 1 (the second)
+  // each processor owns 2 indices and all
+  // are ghosting element 1 (the second)
   IndexSet local_owned(numproc*2);
   local_owned.add_range(myid*2,myid*2+2);
   IndexSet local_relevant(numproc*2);
@@ -45,7 +45,7 @@ void test ()
 
   parallel::distributed::Vector<double> v(local_owned, local_relevant, MPI_COMM_WORLD);
 
-                                     // set local values and check them
+  // set local values and check them
   v(myid*2)=myid*2.0;
   v(myid*2+1)=myid*2.0+1.0;
 
@@ -55,8 +55,8 @@ void test ()
   Assert(v(myid*2) == myid*4.0, ExcInternalError());
   Assert(v(myid*2+1) == myid*4.0+2.0, ExcInternalError());
 
-                                // set ghost dof on remote process, no
-                                // compress called
+  // set ghost dof on remote process, no
+  // compress called
   if (myid > 0)
     v(1) = 7;
 
@@ -66,29 +66,29 @@ void test ()
   if (myid > 0)
     Assert (v(1) == 7.0, ExcInternalError());
 
-                                // reset to zero
+  // reset to zero
   v = 0;
 
   Assert(v(myid*2) == 0., ExcInternalError());
   Assert(v(myid*2+1) == 0., ExcInternalError());
 
-                                // check that everything remains zero also
-                                // after compress
+  // check that everything remains zero also
+  // after compress
   v.compress(VectorOperation::add);
 
   Assert(v(myid*2) == 0., ExcInternalError());
   Assert(v(myid*2+1) == 0., ExcInternalError());
 
-                                // set element 1 on owning process to
-                                // something nonzero
+  // set element 1 on owning process to
+  // something nonzero
   if (myid == 0)
     v(1) = 2.;
   if (myid > 0)
     Assert (v(1) == 0., ExcInternalError());
 
-                                // check that all processors get the correct
-                                // value again, and that it is erased by
-                                // operator=
+  // check that all processors get the correct
+  // value again, and that it is erased by
+  // operator=
   v.update_ghost_values();
 
   Assert (v(1) == 2.0, ExcInternalError());
index 12f63d0c67b65c81d0b31a338697fe2861a2ee0a..f240d1de17e36674cac25ce19f2f3a266b6f5227 100644 (file)
@@ -34,8 +34,8 @@ void test ()
   if (myid==0) deallog << "numproc=" << numproc << std::endl;
 
 
-                                   // each processor owns 2 indices and all
-                                   // are ghosting element 1 (the second)
+  // each processor owns 2 indices and all
+  // are ghosting element 1 (the second)
   IndexSet local_owned(numproc*2);
   local_owned.add_range(myid*2,myid*2+2);
   IndexSet local_relevant(numproc*2);
@@ -44,7 +44,7 @@ void test ()
 
   parallel::distributed::Vector<double> v(local_owned, local_relevant, MPI_COMM_WORLD);
 
-                                     // set local values and check them
+  // set local values and check them
   v(myid*2)=myid*2.0;
   v(myid*2+1)=myid*2.0+1.0;
 
@@ -54,14 +54,14 @@ void test ()
   Assert(v(myid*2) == myid*4.0, ExcInternalError());
   Assert(v(myid*2+1) == myid*4.0+2.0, ExcInternalError());
 
-                                // set ghost dof to zero on remote processors,
-                                // compress
+  // set ghost dof to zero on remote processors,
+  // compress
   if (myid > 0)
     v(1) = 0;
 
   v.compress(VectorOperation::add);
 
-                                // check that nothing has changed
+  // check that nothing has changed
   Assert(v(myid*2) == myid*4.0, ExcInternalError());
   Assert(v(myid*2+1) == myid*4.0+2.0, ExcInternalError());
 
index 76520a1380c0ec0a8c58abf2ca12ccc0902acf7e..d62928f39584c5c50654a29baa6087f67b7c11f4 100644 (file)
@@ -35,10 +35,10 @@ void test ()
   if (myid==0) deallog << "numproc=" << numproc << std::endl;
 
 
-                                   // each processor from processor 1 to 8
-                                   // owns 2 indices (the other processors do
-                                   // not own any dof), and all processors are
-                                   // ghosting element 1 (the second)
+  // each processor from processor 1 to 8
+  // owns 2 indices (the other processors do
+  // not own any dof), and all processors are
+  // ghosting element 1 (the second)
   IndexSet local_owned(std::min(16U,numproc*2));
   if (myid < 8)
     local_owned.add_range(myid*2,myid*2+2);
@@ -48,7 +48,7 @@ void test ()
 
   parallel::distributed::Vector<double> v(local_owned, local_owned, MPI_COMM_WORLD);
 
-                                     // set local values
+  // set local values
   if (myid < 8)
     {
       v(myid*2)=myid*2.0;
@@ -62,28 +62,28 @@ void test ()
       Assert(v(myid*2+1) == myid*4.0+2.0, ExcInternalError());
     }
 
-                                // check l2 norm
+  // check l2 norm
   {
     const double l2_norm = v.l2_norm();
     if (myid == 0)
       deallog << "l2 norm: " << l2_norm << std::endl;
   }
 
-                                // check l1 norm
+  // check l1 norm
   {
     const double l1_norm = v.l1_norm();
     if (myid == 0)
       deallog << "l1 norm: " << l1_norm << std::endl;
   }
 
-                                // check linfty norm
+  // check linfty norm
   {
     const double linfty_norm = v.linfty_norm();
     if (myid == 0)
       deallog << "linfty norm: " << linfty_norm << std::endl;
   }
 
-                                // check lp norm
+  // check lp norm
   {
     const double lp_norm = v.lp_norm(2.2);
     if (myid == 0)
@@ -93,9 +93,9 @@ void test ()
             ExcInternalError());
   }
 
-                                // check mean value (should be equal to l1
-                                // norm divided by vector size here since we
-                                // have no negative entries)
+  // check mean value (should be equal to l1
+  // norm divided by vector size here since we
+  // have no negative entries)
   {
     const double mean = v.mean_value();
     if (myid == 0)
@@ -104,7 +104,7 @@ void test ()
     Assert (std::fabs (mean * v.size() - v.l1_norm()) < 1e-15,
             ExcInternalError());
   }
-                                // check inner product
+  // check inner product
   {
     const double norm_sqr = v.norm_sqr();
     Assert (std::fabs(v * v - norm_sqr) < 1e-15,
@@ -114,14 +114,14 @@ void test ()
     Assert (std::fabs(v2 * v - norm_sqr) < 1e-15,
             ExcInternalError());
 
-    if(myid<8)
+    if (myid<8)
       v2.local_element(0) = -1;
     const double inner_prod = v * v2;
     if (myid == 0)
       deallog << "Inner product: " << inner_prod << std::endl;
   }
 
-                                // check operator ==
+  // check operator ==
   {
     parallel::distributed::Vector<double> v2 (v);
     bool equal = (v2 == v);
@@ -132,7 +132,7 @@ void test ()
     if (myid == 0)
       deallog << " v!=v2 ? " << not_equal << std::endl;
 
-                                // change v2 on one proc only
+    // change v2 on one proc only
     if (myid == 0)
       v2.local_element(1) = 2.2212;
 
@@ -143,7 +143,7 @@ void test ()
     if (myid == 0)
       deallog << " v!=v2 ? " << not_equal << std::endl;
 
-                                // reset
+    // reset
     v2 = v;
     equal = (v2 == v);
     if (myid == 0)
@@ -152,7 +152,7 @@ void test ()
     if (myid == 0)
       deallog << " v!=v2 ? " << not_equal << std::endl;
 
-                                // change some value on all procs
+    // change some value on all procs
     if (myid < 8)
       v2.local_element(0) = -1;
     equal = (v2 == v);
@@ -163,7 +163,7 @@ void test ()
       deallog << " v!=v2 ? " << not_equal << std::endl;
   }
 
-                                // check all_zero
+  // check all_zero
   {
     bool allzero = v.all_zero();
     if (myid == 0)
@@ -174,7 +174,7 @@ void test ()
     if (myid == 0)
       deallog << " v2==0 ? " << allzero << std::endl;
 
-                                // now change one element to nonzero
+    // now change one element to nonzero
     if (myid == 0)
       v2.local_element(1) = 1;
     allzero = v2.all_zero();
@@ -183,15 +183,15 @@ void test ()
   }
 
 
-                                // check all_non_negative
+  // check all_non_negative
   {
     bool allnonneg = v.is_non_negative();
     if (myid == 0)
       deallog << " v>=0 ? " << allnonneg << std::endl;
     parallel::distributed::Vector<double> v2, v3;
 
-                                // vector where all processors have
-                                // non-negative entries
+    // vector where all processors have
+    // non-negative entries
     v2 = v;
     if (myid < 8)
       v2.local_element(0) = -1;
@@ -199,13 +199,13 @@ void test ()
     if (myid == 0)
       deallog << " v2>=0 ? " << allnonneg << std::endl;
 
-                                // zero vector
+    // zero vector
     v3.reinit (v2);
     allnonneg = v3.is_non_negative();
     if (myid == 0)
       deallog << " v3>=0 ? " << allnonneg << std::endl;
 
-                                // only one processor has non-negative entry
+    // only one processor has non-negative entry
     v3 = v;
     if (myid == 1 || numproc==1)
       v3.local_element(0) = -1;
index 62d36addfd64ab6b8d0bc81b49d3bf6998e1b3cd..efeb4c8b744efd5393294bb04f9ca60adb07294b 100644 (file)
@@ -44,43 +44,44 @@ void test ()
       if (i<myid)
         my_start += set - i;
     }
-                                   // each processor owns some indices and all
-                                   // are ghosting elements from three
-                                   // processors (the second). some entries
-                                   // are right around the border between two
-                                   // processors
+  // each processor owns some indices and all
+  // are ghosting elements from three
+  // processors (the second). some entries
+  // are right around the border between two
+  // processors
   IndexSet local_owned(global_size);
   local_owned.add_range(my_start, my_start + local_size);
   IndexSet local_relevant(global_size);
   local_relevant = local_owned;
   unsigned int ghost_indices [10] = {1, 2, 13, set-2, set-1, set, set+1, 2*set,
-                                     2*set+1, 2*set+3};
+                                     2*set+1, 2*set+3
+                                    };
   local_relevant.add_indices (&ghost_indices[0], &ghost_indices[0]+10);
 
   parallel::distributed::Vector<double> v(local_owned, local_relevant, MPI_COMM_WORLD);
 
-                                // set a few of the local elements
+  // set a few of the local elements
   for (unsigned i=0; i<local_size; ++i)
     v.local_element(i) = 2.0 * (i + my_start);
 
   v.update_ghost_values();
 
-                                // check local values for correctness
+  // check local values for correctness
   for (unsigned int i=0; i<local_size; ++i)
     Assert (v.local_element(i) == 2.0 * (i + my_start), ExcInternalError());
 
-                                // check local values with two different
-                                // access operators
+  // check local values with two different
+  // access operators
   for (unsigned int i=0; i<local_size; ++i)
     Assert (v.local_element(i) == v(local_owned.nth_index_in_set (i)), ExcInternalError());
   for (unsigned int i=0; i<local_size; ++i)
     Assert (v.local_element(i) == v(i+my_start), ExcInternalError());
-  
-                                // check non-local entries on all processors
+
+  // check non-local entries on all processors
   for (unsigned int i=0; i<10; ++i)
     Assert (v(ghost_indices[i])== 2. * ghost_indices[i], ExcInternalError());
 
-                                // compare direct access [] with access ()
+  // compare direct access [] with access ()
   for (unsigned int i=0; i<10; ++i)
     if (ghost_indices[i] < my_start)
       Assert (v(ghost_indices[i])==v.local_element(local_size+i), ExcInternalError());
index a0bbcd4a2cc6a23638a2c64f9f9713520e434f34..7725acfd75f2f8822eabd1e19d5bbea430045abe 100644 (file)
@@ -45,48 +45,49 @@ void test ()
       if (i<myid)
         my_start += set - i;
     }
-                                   // each processor owns some indices and all
-                                   // are ghosting elements from three
-                                   // processors (the second). some entries
-                                   // are right around the border between two
-                                   // processors
+  // each processor owns some indices and all
+  // are ghosting elements from three
+  // processors (the second). some entries
+  // are right around the border between two
+  // processors
   IndexSet local_owned(global_size);
   local_owned.add_range(my_start, my_start + local_size);
   IndexSet local_relevant(global_size);
   local_relevant = local_owned;
   unsigned int ghost_indices [10] = {1, 2, 13, set-2, set-1, set, set+1, 2*set,
-                                     2*set+1, 2*set+3};
+                                     2*set+1, 2*set+3
+                                    };
   local_relevant.add_indices (&ghost_indices[0], &ghost_indices[0]+10);
 
-                                // v has ghosts, w has none. set some entries
-                                // on w, copy into v and check if they are
-                                // there
+  // v has ghosts, w has none. set some entries
+  // on w, copy into v and check if they are
+  // there
   parallel::distributed::Vector<double> v(local_owned, local_relevant, MPI_COMM_WORLD);
   parallel::distributed::Vector<double> w(local_owned, local_owned, MPI_COMM_WORLD);
 
-                                // set a few of the local elements
+  // set a few of the local elements
   for (unsigned i=0; i<local_size; ++i)
     w.local_element(i) = 2.0 * (i + my_start);
 
   v.copy_from(w);
   v.update_ghost_values();
 
-                                // check local values for correctness
+  // check local values for correctness
   for (unsigned int i=0; i<local_size; ++i)
     Assert (v.local_element(i) == 2.0 * (i + my_start), ExcInternalError());
 
-                                // check local values with two different
-                                // access operators
+  // check local values with two different
+  // access operators
   for (unsigned int i=0; i<local_size; ++i)
     Assert (v.local_element(i) == v(local_owned.nth_index_in_set (i)), ExcInternalError());
   for (unsigned int i=0; i<local_size; ++i)
     Assert (v.local_element(i) == v(i+my_start), ExcInternalError());
-  
-                                // check non-local entries on all processors
+
+  // check non-local entries on all processors
   for (unsigned int i=0; i<10; ++i)
     Assert (v(ghost_indices[i])== 2. * ghost_indices[i], ExcInternalError());
 
-                                // compare direct access local_element with access ()
+  // compare direct access local_element with access ()
   for (unsigned int i=0; i<10; ++i)
     if (ghost_indices[i] < my_start)
       Assert (v(ghost_indices[i])==v.local_element(local_size+i), ExcInternalError());
@@ -96,27 +97,27 @@ void test ()
       Assert (v(ghost_indices[i])==v.local_element(local_size+i-5), ExcInternalError());
 
 
-                                // now the same again, but import ghosts
-                                // through the call to copy_from
+  // now the same again, but import ghosts
+  // through the call to copy_from
   v.reinit (local_owned, local_relevant, MPI_COMM_WORLD);
   v.copy_from(w, true);
 
-                                // check local values for correctness
+  // check local values for correctness
   for (unsigned int i=0; i<local_size; ++i)
     Assert (v.local_element(i) == 2.0 * (i + my_start), ExcInternalError());
 
-                                // check local values with two different
-                                // access operators
+  // check local values with two different
+  // access operators
   for (unsigned int i=0; i<local_size; ++i)
     Assert (v.local_element(i) == v(local_owned.nth_index_in_set (i)), ExcInternalError());
   for (unsigned int i=0; i<local_size; ++i)
     Assert (v.local_element(i) == v(i+my_start), ExcInternalError());
-  
-                                // check non-local entries on all processors
+
+  // check non-local entries on all processors
   for (unsigned int i=0; i<10; ++i)
     Assert (v(ghost_indices[i])== 2. * ghost_indices[i], ExcInternalError());
 
-                                // compare direct access [] with access ()
+  // compare direct access [] with access ()
   for (unsigned int i=0; i<10; ++i)
     if (ghost_indices[i] < my_start)
       Assert (v(ghost_indices[i])==v.local_element(local_size+i), ExcInternalError());
@@ -126,12 +127,12 @@ void test ()
       Assert (v(ghost_indices[i])==v.local_element(local_size+i-5), ExcInternalError());
 
 
-                                // now do not call import_ghosts and check
-                                // whether ghosts really are zero
+  // now do not call import_ghosts and check
+  // whether ghosts really are zero
   v.reinit (local_owned, local_relevant, MPI_COMM_WORLD);
   v.copy_from(w, false);
 
-                                  // check non-local entries on all processors
+  // check non-local entries on all processors
   for (unsigned int i=0; i<10; ++i)
     if (local_owned.is_element (ghost_indices[i]) == false)
       Assert (v(ghost_indices[i]) == 0., ExcInternalError());
index c34d6364ac9604e79265091f17a192b8fe3f7e64..7077791c5229e3e34b49ddc82fd3edab126945f3 100644 (file)
@@ -44,23 +44,24 @@ void test ()
       if (i<myid)
         my_start += set - i;
     }
-                                   // each processor owns some indices and all
-                                   // are ghosting elements from three
-                                   // processors (the second). some entries
-                                   // are right around the border between two
-                                   // processors
+  // each processor owns some indices and all
+  // are ghosting elements from three
+  // processors (the second). some entries
+  // are right around the border between two
+  // processors
   IndexSet local_owned(global_size);
   local_owned.add_range(my_start, my_start + local_size);
   IndexSet local_relevant(global_size);
   local_relevant = local_owned;
   unsigned int ghost_indices [10] = {1, 2, 13, set-2, set-1, set, set+1, 2*set,
-                                     2*set+1, 2*set+3};
+                                     2*set+1, 2*set+3
+                                    };
   local_relevant.add_indices (&ghost_indices[0], &ghost_indices[0]+10);
 
   parallel::distributed::Vector<double> v(local_owned, local_relevant, MPI_COMM_WORLD);
 
-                                // check number of ghosts everywhere (counted
-                                // the above)
+  // check number of ghosts everywhere (counted
+  // the above)
   if (myid == 0)
     {
       AssertDimension (v.n_ghost_entries(), 5);
@@ -78,8 +79,8 @@ void test ()
       AssertDimension (v.n_ghost_entries(), 10);
     }
 
-                                // count that 13 is ghost only on non-owning
-                                // processors
+  // count that 13 is ghost only on non-owning
+  // processors
   if (myid == 0)
     {
       Assert (v.is_ghost_entry (13) == false, ExcInternalError());
@@ -89,7 +90,7 @@ void test ()
       Assert (v.is_ghost_entry (13) == true, ExcInternalError());
     }
 
-                                // count that 27 is ghost nowhere
+  // count that 27 is ghost nowhere
   Assert (v.is_ghost_entry (27) == false, ExcInternalError());
   if (myid == 0)
     {
@@ -100,7 +101,7 @@ void test ()
       Assert (v.in_local_range (27) == false, ExcInternalError());
     }
 
-                                // element with number set is ghost
+  // element with number set is ghost
   if (myid == 1)
     {
       Assert (v.is_ghost_entry (set) == false, ExcInternalError());
index 775d436b31ec6487b7375aa44f19a56f178dca2a..97be2bd2dfda164a7d72ea60c55a286a8a9f82e5 100644 (file)
@@ -34,8 +34,8 @@ void test ()
   if (myid==0) deallog << "numproc=" << numproc << std::endl;
 
 
-                                   // each processor owns 2 indices and all
-                                   // are ghosting element 1 (the second)
+  // each processor owns 2 indices and all
+  // are ghosting element 1 (the second)
   IndexSet local_owned(numproc*2);
   local_owned.add_range(myid*2,myid*2+2);
   IndexSet local_relevant(numproc*2);
@@ -45,16 +45,16 @@ void test ()
   parallel::distributed::Vector<double> v(local_owned, local_relevant, MPI_COMM_WORLD);
   parallel::distributed::Vector<double> w(v);
 
-                                     // set local values and check them
+  // set local values and check them
   v(myid*2)=myid*2.0;
   v(myid*2+1)=myid*2.0+1.0;
 
   v.update_ghost_values();
 
-                                // check that the value of the ghost is 1.0
+  // check that the value of the ghost is 1.0
   Assert (v(1) == 1., ExcInternalError());
 
-                                // copy vector
+  // copy vector
   w  = v;
   v *= 2.0;
 
index 6a42b9d6173c318c960f26c96940abad6065bc4d..8ee6f0c9842bf4116dd49691e3b67b3701fcfd42 100644 (file)
@@ -34,8 +34,8 @@ void test ()
 
   if (myid==0) deallog << "numproc=" << numproc << std::endl;
 
-                                // global size: 20, local_size: 3 as long as
-                                // less than 20
+  // global size: 20, local_size: 3 as long as
+  // less than 20
   const unsigned int local_size = 3;
   const unsigned int global_size = std::min(20U, local_size * numproc);
   const int my_start = std::min (local_size * myid, global_size);
@@ -55,7 +55,7 @@ void test ()
   AssertDimension (static_cast<unsigned int>(actual_local_size), v.local_size());
   parallel::distributed::Vector<double> w (v), x(v), y(v);
 
-                                // set local elements
+  // set local elements
   for (int i=0; i<actual_local_size; ++i)
     {
       v.local_element(i) = i + my_start;
index 89fae634ad66587c07d9a58d6583b82cf8749f89..5157c18fcd55231dbdd2343f3052ace0f3b70577 100644 (file)
@@ -36,9 +36,9 @@ void test ()
 
   if (myid==0) deallog << "numproc=" << numproc << std::endl;
 
-                                // vector 0:
-                                // global size: 20, local_size: 3 as long as
-                                // less than 20
+  // vector 0:
+  // global size: 20, local_size: 3 as long as
+  // less than 20
   const unsigned int local_size0 = 3;
   const unsigned int global_size0 = std::min(20U, local_size0 * numproc);
   const unsigned int my_start0 = std::min (local_size0 * myid, global_size0);
@@ -58,7 +58,7 @@ void test ()
   parallel::distributed::Vector<double> v0(local_owned0, local_relevant0,
                                            MPI_COMM_WORLD);
 
-                                // vector1: local size 4
+  // vector1: local size 4
   const unsigned int local_size1 = 4;
   const unsigned int global_size1 = local_size1 * numproc;
   const int my_start1 = local_size1 * myid;
@@ -82,13 +82,13 @@ void test ()
 
   v0 = 1;
   v1 = 2;
-                                // check assignment in initial state
+  // check assignment in initial state
   for (unsigned int i=0; i<v0.local_size(); ++i)
     Assert (v0.local_element(i) == 1., ExcNonEqual(v0.local_element(i),1.));
   for (unsigned int i=0; i<v1.local_size(); ++i)
     Assert (v1.local_element(i) == 2., ExcNonEqual(v1.local_element(i),2.));
 
-                                // check ghost elements in initial state
+  // check ghost elements in initial state
   v0.update_ghost_values();
   v1.update_ghost_values();
   Assert (v0(2) == 1., ExcNonEqual(v0(2),1.));
@@ -104,7 +104,7 @@ void test ()
   if (myid==0) deallog << "Initial set and ghost update OK" << std::endl;
   MPI_Barrier (MPI_COMM_WORLD);
 
-                                // now swap v1 and v0
+  // now swap v1 and v0
   v0.swap (v1);
   AssertDimension (v0.local_size(), local_size1);
   AssertDimension (v1.local_size(), actual_local_size0);
@@ -129,8 +129,8 @@ void test ()
     }
   if (myid==0) deallog << "Ghost values after first swap OK" << std::endl;
 
-                                // now set the vectors to some different
-                                // values and check the ghost values again
+  // now set the vectors to some different
+  // values and check the ghost values again
   v0 = 7.;
   v1 = 42.;
   v0.update_ghost_values();
@@ -147,7 +147,7 @@ void test ()
     }
   if (myid==0) deallog << "Ghost values after re-set OK" << std::endl;
 
-                                // swap with an empty vector
+  // swap with an empty vector
   parallel::distributed::Vector<double> v2;
   v2.swap (v0);
   AssertDimension (v0.size(), 0);
index 9b68abce61c3612e7dfd2e3acac0d3daf14316af..4abc873540ac6740d066b288d7c42c322718bcdb 100644 (file)
@@ -36,8 +36,8 @@ void test ()
   if (myid==0) deallog << "numproc=" << numproc << std::endl;
 
 
-                                   // each processor owns 2 indices and all
-                                   // are ghosting element 1 (the second)
+  // each processor owns 2 indices and all
+  // are ghosting element 1 (the second)
   IndexSet local_owned(numproc*2);
   local_owned.add_range(myid*2,myid*2+2);
   IndexSet local_relevant(numproc*2);
@@ -47,7 +47,7 @@ void test ()
 
   parallel::distributed::Vector<double> v(local_owned, local_relevant, MPI_COMM_WORLD);
 
-                                     // set local values and check them
+  // set local values and check them
   v(myid*2)=myid*2.0;
   v(myid*2+1)=myid*2.0+1.0;
 
@@ -58,8 +58,8 @@ void test ()
   Assert(v(myid*2) == myid*4.0+1, ExcInternalError());
   Assert(v(myid*2+1) == myid*4.0+3.0, ExcInternalError());
 
-                                // set ghost dof on all processors, compress
-                                // (insert mode)
+  // set ghost dof on all processors, compress
+  // (insert mode)
   v(1) = 7;
   v.compress(VectorOperation::insert);
 
@@ -78,11 +78,11 @@ void test ()
       deallog << myid*2+1 << ":" << v(myid*2+1) << std::endl;
     }
 
-                                // import ghosts onto all procs
+  // import ghosts onto all procs
   v.update_ghost_values();
   Assert (v(1) == -7.0, ExcInternalError());
 
-                                // check l2 norm
+  // check l2 norm
   const double l2_norm = v.l2_norm();
   if (myid == 0)
     deallog << "L2 norm: " << l2_norm << std::endl;
index 49197b928ef3c22e4020e76962796e6063928d95..fb3a6183f38fb4b1d4532b113110e3ec047134f1 100644 (file)
@@ -59,9 +59,9 @@ void test ()
   DoFTools::extract_locally_relevant_dofs (dof2,
                                            locally_relevant_dofs2);
 
-  parallel::distributed::Vector<double> 
-    v2(dof2.locally_owned_dofs(), locally_relevant_dofs2, MPI_COMM_WORLD),
-    v2_interpolated(v2);
+  parallel::distributed::Vector<double>
+  v2(dof2.locally_owned_dofs(), locally_relevant_dofs2, MPI_COMM_WORLD),
+  v2_interpolated(v2);
 
   // set first vector to 1
   VectorTools::interpolate(dof2, ConstantFunction<dim>(1.), v2);
index 49b1f1a755b1c95179e42317b9d9ca81969f6dd2..9d506085df5c688cecb9f72ae03b1bcb47704774 100644 (file)
@@ -56,7 +56,7 @@ void test ()
   parallel::distributed::Vector<double> v1(dof1.locally_owned_dofs(),
                                            locally_relevant_dofs1,
                                            MPI_COMM_WORLD),
-    v2(dof2.locally_owned_dofs(), locally_relevant_dofs2, MPI_COMM_WORLD);
+                                           v2(dof2.locally_owned_dofs(), locally_relevant_dofs2, MPI_COMM_WORLD);
 
   // set first vector to 1
   VectorTools::interpolate(dof1, ConstantFunction<dim>(1.), v1);
index ba61bfc4a7e5404bccbf75f4ed4adacb16c2d8ad..6b043e565fc94cfa28a520c32492db11bde85937 100644 (file)
@@ -24,8 +24,8 @@
 #include "../tests.h"
 
 #include <deal.II/lac/compressed_simple_sparsity_pattern.h>
-#include <deal.II/lac/petsc_sparse_matrix.h>    
-#include <deal.II/lac/petsc_parallel_sparse_matrix.h>    
+#include <deal.II/lac/petsc_sparse_matrix.h>
+#include <deal.II/lac/petsc_parallel_sparse_matrix.h>
 #include <deal.II/base/logstream.h>
 #include <deal.II/base/utilities.h>
 
@@ -42,37 +42,37 @@ void test()
     deallog << "Running on " << numprocs << " CPU(s)." << std::endl;
 
   CompressedSimpleSparsityPattern csp(2*numprocs);
-  for (unsigned int i=0;i<numprocs*2;++i)
+  for (unsigned int i=0; i<numprocs*2; ++i)
     csp.add(i,i);
   csp.add(1,0);
-  
+
   PETScWrappers::MPI::SparseMatrix mat;
   std::vector<types::global_dof_index> local_rows(numprocs,2);
-  
+
   mat.reinit(MPI_COMM_WORLD, csp, local_rows, local_rows, myid);
-  
+
   mat.add(2*myid,2*myid,1.0);
   mat.add(2*myid+1,2*myid+1,1.0);
   mat.add(1,0,42.0);
-  
+
   mat.add((2*myid+2)%(2*numprocs),(2*myid+2)%(2*numprocs),0.1);
-  
+
   mat.compress(VectorOperation::add);
 
   std::vector<types::global_dof_index> rows(1,1);
   mat.clear_rows(rows);
-  
+
 //    mat.write_ascii();
   if (myid==0)
     deallog << "2nd try" << std::endl;
-  
+
   mat = 0;
   mat.add(1,0,42.0);
   mat.add(2*myid,2*myid,1.0);
   mat.add(2*myid+1,2*myid+1,1.0);
-  
+
   mat.add((2*myid+2)%(2*numprocs),(2*myid+2)%(2*numprocs),0.1);
-  
+
   mat.compress(VectorOperation::add);
 //    mat.write_ascii();
 
@@ -85,7 +85,7 @@ void test()
 int main(int argc, char *argv[])
 {
   Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv);
+
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     {
       std::ofstream logfile(output_file_for_mpi("petsc_01").c_str());
index 93691877172635e4bf4a3fedfa9bc66e493a0841..0b8fea2dc7bdf53db21fce0656f02639619478bb 100644 (file)
@@ -77,5 +77,5 @@ int main(int argc, char *argv[])
   else
     test();
 
-  
+
 }
index 7bd9680f5415631d66755fa22d1a0eadbc7b8933..d803814ff600e74b5ba1cb0f75381e9646fafb10 100644 (file)
@@ -65,7 +65,7 @@ void test()
   // owned range by 50 on each side
   IndexSet locally_relevant_range (vec.size());
   locally_relevant_range.add_range (std::max<int> (100*myid-50, 0),
-                                   std::min (static_cast<types::global_dof_index>(100*myid+150), vec.size()));
+                                    std::min (static_cast<types::global_dof_index>(100*myid+150), vec.size()));
   ConstraintMatrix cm (locally_relevant_range);
 
   // add constraints that constrain an element in the middle of the
@@ -78,20 +78,20 @@ void test()
   for (unsigned int p=0; p<n_processes; ++p)
     {
       if ((p != 0) && locally_relevant_range.is_element (p*100+10))
-       {
-         cm.add_line (p*100+10);
-         cm.add_entry (p*100+10,
-                       p*100-25,
-                       1);
-       }
+        {
+          cm.add_line (p*100+10);
+          cm.add_entry (p*100+10,
+                        p*100-25,
+                        1);
+        }
 
       if ((p != n_processes-1) && locally_relevant_range.is_element (p*100+90))
-       {
-         cm.add_line (p*100+90);
-         cm.add_entry (p*100+90,
-                       p*100+105,
-                       1);
-       }
+        {
+          cm.add_line (p*100+90);
+          cm.add_entry (p*100+90,
+                        p*100+105,
+                        1);
+        }
     }
   cm.close ();
 
@@ -101,21 +101,21 @@ void test()
   // verify correctness
   if (myid != 0)
     Assert (vec(vec.local_range().first+10) == vec.local_range().first-25,
-           ExcInternalError());
+            ExcInternalError());
 
   if (myid != n_processes-1)
     Assert (vec(vec.local_range().first+90) == vec.local_range().first+105,
-           ExcInternalError());
+            ExcInternalError());
 
   for (unsigned int i=vec.local_range().first; i<vec.local_range().second; ++i)
     {
       if ((i != vec.local_range().first+10)
-         &&
-         (i != vec.local_range().first+90))
-       {
-         double val = vec(i);
-         Assert (std::fabs(val - i) <= 1e-6, ExcInternalError());
-       }
+          &&
+          (i != vec.local_range().first+90))
+        {
+          double val = vec(i);
+          Assert (std::fabs(val - i) <= 1e-6, ExcInternalError());
+        }
     }
 
   {
@@ -128,10 +128,10 @@ void test()
     // but then correct for the constrained values
     for (unsigned int p=0; p<n_processes; ++p)
       {
-       if (p != 0)
-         exact_l1 = exact_l1 - (p*100+10) + (p*100-25);
-       if (p != n_processes-1)
-         exact_l1 = exact_l1 - (p*100+90) + (p*100+105);
+        if (p != 0)
+          exact_l1 = exact_l1 - (p*100+10) + (p*100-25);
+        if (p != n_processes-1)
+          exact_l1 = exact_l1 - (p*100+90) + (p*100+105);
       }
 
     const double l1_norm = vec.l1_norm();
index 944327052ab3885a0b3882b8e809b45f81e55452..3c2fe3cfd225ebc1d0767c8516eca8d8dd3f31a2 100644 (file)
@@ -68,9 +68,9 @@ void test()
   // owned range by 50 on each side
   IndexSet locally_relevant_range (vec.size());
   locally_relevant_range.add_range (std::max<int> (100*myid-50, 0),
-                                   std::min (static_cast<types::global_dof_index>(100*myid+150), vec.block(0).size()));
+                                    std::min (static_cast<types::global_dof_index>(100*myid+150), vec.block(0).size()));
   locally_relevant_range.add_range (vec.block(0).size()+std::max<int> (100*myid-50, 0),
-                                   vec.block(0).size()+std::min (static_cast<types::global_dof_index>(100*myid+150), vec.block(0).size()));
+                                    vec.block(0).size()+std::min (static_cast<types::global_dof_index>(100*myid+150), vec.block(0).size()));
   ConstraintMatrix cm (locally_relevant_range);
 
   // add constraints that constrain an element in the middle of the
@@ -83,28 +83,28 @@ void test()
   for (unsigned int p=0; p<n_processes; ++p)
     {
       if ((p != 0) && locally_relevant_range.is_element (p*100+10))
-       {
-         cm.add_line (p*100+10);
-         cm.add_entry (p*100+10,
-                       p*100-25,
-                       1);
-         cm.add_line (vec.block(0).size()+p*100+10);
-         cm.add_entry (vec.block(0).size()+p*100+10,
-                       vec.block(0).size()+p*100-25,
-                       1);
-       }
+        {
+          cm.add_line (p*100+10);
+          cm.add_entry (p*100+10,
+                        p*100-25,
+                        1);
+          cm.add_line (vec.block(0).size()+p*100+10);
+          cm.add_entry (vec.block(0).size()+p*100+10,
+                        vec.block(0).size()+p*100-25,
+                        1);
+        }
 
       if ((p != n_processes-1) && locally_relevant_range.is_element (p*100+90))
-       {
-         cm.add_line (p*100+90);
-         cm.add_entry (p*100+90,
-                       p*100+105,
-                       1);
-         cm.add_line (vec.block(0).size()+p*100+90);
-         cm.add_entry (vec.block(0).size()+p*100+90,
-                       vec.block(0).size()+p*100+105,
-                       1);
-       }
+        {
+          cm.add_line (p*100+90);
+          cm.add_entry (p*100+90,
+                        p*100+105,
+                        1);
+          cm.add_line (vec.block(0).size()+p*100+90);
+          cm.add_entry (vec.block(0).size()+p*100+90,
+                        vec.block(0).size()+p*100+105,
+                        1);
+        }
     }
   cm.close ();
 
@@ -114,40 +114,40 @@ void test()
   // verify correctness
   if (myid != 0)
     Assert (vec(vec.block(0).local_range().first+10) == vec.block(0).local_range().first-25,
-           ExcInternalError());
+            ExcInternalError());
 
   if (myid != n_processes-1)
     Assert (vec(vec.block(0).local_range().first+90) == vec.block(0).local_range().first+105,
-           ExcInternalError());
+            ExcInternalError());
 
   if (myid != 0)
     Assert (vec(vec.block(0).size()+vec.block(1).local_range().first+10) == vec.block(1).local_range().first-25,
-           ExcInternalError());
+            ExcInternalError());
 
   if (myid != n_processes-1)
     Assert (vec(vec.block(0).size()+vec.block(1).local_range().first+90) == vec.block(1).local_range().first+105,
-           ExcInternalError());
+            ExcInternalError());
+
 
-  
   for (unsigned int i=vec.block(0).local_range().first; i<vec.block(0).local_range().second; ++i)
     {
       if ((i != vec.block(0).local_range().first+10)
-         &&
-         (i != vec.block(0).local_range().first+90))
-       {
-         double val = vec.block(0)(i);
-         Assert (std::fabs(val - i) <= 1e-6, ExcInternalError());
-       }
+          &&
+          (i != vec.block(0).local_range().first+90))
+        {
+          double val = vec.block(0)(i);
+          Assert (std::fabs(val - i) <= 1e-6, ExcInternalError());
+        }
     }
   for (unsigned int i=vec.block(1).local_range().first; i<vec.block(1).local_range().second; ++i)
     {
       if ((i != vec.block(1).local_range().first+10)
-         &&
-         (i != vec.block(1).local_range().first+90))
-       {
-         double val = vec.block(1)(i);
-         Assert (std::fabs(val - i) <= 1e-6, ExcInternalError());
-       }
+          &&
+          (i != vec.block(1).local_range().first+90))
+        {
+          double val = vec.block(1)(i);
+          Assert (std::fabs(val - i) <= 1e-6, ExcInternalError());
+        }
     }
 
   {
@@ -160,10 +160,10 @@ void test()
     // but then correct for the constrained values
     for (unsigned int p=0; p<n_processes; ++p)
       {
-       if (p != 0)
-         exact_l1 = exact_l1 - (p*100+10) + (p*100-25);
-       if (p != n_processes-1)
-         exact_l1 = exact_l1 - (p*100+90) + (p*100+105);
+        if (p != 0)
+          exact_l1 = exact_l1 - (p*100+10) + (p*100-25);
+        if (p != n_processes-1)
+          exact_l1 = exact_l1 - (p*100+90) + (p*100+105);
       }
 
     const double l1_norm = vec.l1_norm();
index aad0a8e9424520d88ac30c79fe25cb923bf3b71c..148de3facf1d9e031db45ad6af2eca30ebfda4fd 100644 (file)
@@ -57,7 +57,7 @@ void test()
   // owned range by 50 on each side
   IndexSet locally_relevant_range (vec.size());
   locally_relevant_range.add_range (std::max<int> (100*myid-50, 0),
-                                   std::min (static_cast<types::global_dof_index>(100*myid+150), vec.size()));
+                                    std::min (static_cast<types::global_dof_index>(100*myid+150), vec.size()));
   ConstraintMatrix cm (locally_relevant_range);
 
   // add constraints that constrain an element in the middle of the
@@ -70,22 +70,22 @@ void test()
   for (unsigned int p=0; p<n_processes; ++p)
     {
       if ((p != 0) && locally_relevant_range.is_element (p*100+10))
-       {
-         cm.add_line (p*100+10);
-         cm.add_entry (p*100+10,
-                       p*100-25,
-                       1);
-         cm.set_inhomogeneity (p*100+10, 1);
-       }
+        {
+          cm.add_line (p*100+10);
+          cm.add_entry (p*100+10,
+                        p*100-25,
+                        1);
+          cm.set_inhomogeneity (p*100+10, 1);
+        }
 
       if ((p != n_processes-1) && locally_relevant_range.is_element (p*100+90))
-       {
-         cm.add_line (p*100+90);
-         cm.add_entry (p*100+90,
-                       p*100+105,
-                       1);
-         cm.set_inhomogeneity (p*100+90, -1);
-       }
+        {
+          cm.add_line (p*100+90);
+          cm.add_entry (p*100+90,
+                        p*100+105,
+                        1);
+          cm.set_inhomogeneity (p*100+90, -1);
+        }
     }
   cm.close ();
 
@@ -95,21 +95,21 @@ void test()
   // verify correctness
   if (myid != 0)
     Assert (vec(vec.local_range().first+10) == vec.local_range().first-25+1,
-           ExcInternalError());
-  
+            ExcInternalError());
+
   if (myid != n_processes-1)
     Assert (vec(vec.local_range().first+90) == vec.local_range().first+105-1,
-           ExcInternalError());
+            ExcInternalError());
 
   for (unsigned int i=vec.local_range().first; i<vec.local_range().second; ++i)
     {
       if ((i != vec.local_range().first+10)
-         &&
-         (i != vec.local_range().first+90))
-       {
-         double val = vec(i);
-         Assert (std::fabs(val - i) <= 1e-6, ExcInternalError());
-       }
+          &&
+          (i != vec.local_range().first+90))
+        {
+          double val = vec(i);
+          Assert (std::fabs(val - i) <= 1e-6, ExcInternalError());
+        }
     }
 
   {
@@ -122,10 +122,10 @@ void test()
     // but then correct for the constrained values
     for (unsigned int p=0; p<n_processes; ++p)
       {
-       if (p != 0)
-         exact_l1 = exact_l1 - (p*100+10) + (p*100-25);
-       if (p != n_processes-1)
-         exact_l1 = exact_l1 - (p*100+90) + (p*100+105);
+        if (p != 0)
+          exact_l1 = exact_l1 - (p*100+10) + (p*100-25);
+        if (p != n_processes-1)
+          exact_l1 = exact_l1 - (p*100+90) + (p*100+105);
       }
 
     const double l1_norm = vec.l1_norm();
index dbd3944049c2b4a41dc5b586c113c1602d920c31..aed2b9b94ba4786138c614f67b2d5f9821c31421 100644 (file)
@@ -52,9 +52,9 @@ void test()
   IndexSet locally_owned (vec.size());
   locally_owned.add_range (100*myid, 100*myid+100);
   locally_owned.add_range (vec.block(0).size()+100*myid,
-                          vec.block(0).size()+100*myid+100);
+                           vec.block(0).size()+100*myid+100);
   Assert (vec.locally_owned_elements() == locally_owned,
-         ExcInternalError());
+          ExcInternalError());
 
   if (myid == 0)
     deallog << "OK" << std::endl;
index eca40ff52239bc2294082ab11733b8f8f59caa86..74e3f0898f8a4629b110d7f2ffa09f1bf03e9b82 100644 (file)
@@ -33,7 +33,7 @@ void test_mpi()
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
   const unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
 
-                                  // select a few destinations
+  // select a few destinations
   std::vector<unsigned int> destinations;
   for (unsigned int i=0; i<3+myid/3; ++i)
     if ((myid + 17*i) % numprocs != myid)
@@ -43,23 +43,23 @@ void test_mpi()
     {
       deallog << "Processor 0 wants to send to ";
       for (unsigned int i=0; i<destinations.size(); ++i)
-       deallog << destinations[i] << ' ';
+        deallog << destinations[i] << ' ';
       deallog << std::endl;
 
       for (unsigned int p=1; p<numprocs; ++p)
-       {
-         MPI_Status status;
-         unsigned int size = 0;
-         MPI_Recv (&size, 1, MPI_UNSIGNED, p, 0, MPI_COMM_WORLD, &status);
-
-         std::vector<unsigned int> dest (size);
-         MPI_Recv (&dest[0], size, MPI_UNSIGNED, p, 0, MPI_COMM_WORLD, &status);
-
-         deallog << "Processor " << p << " wants to send to ";
-         for (unsigned int i=0; i<size; ++i)
-           deallog << dest[i] << ' ';
-         deallog << std::endl;
-       }
+        {
+          MPI_Status status;
+          unsigned int size = 0;
+          MPI_Recv (&size, 1, MPI_UNSIGNED, p, 0, MPI_COMM_WORLD, &status);
+
+          std::vector<unsigned int> dest (size);
+          MPI_Recv (&dest[0], size, MPI_UNSIGNED, p, 0, MPI_COMM_WORLD, &status);
+
+          deallog << "Processor " << p << " wants to send to ";
+          for (unsigned int i=0; i<size; ++i)
+            deallog << dest[i] << ' ';
+          deallog << std::endl;
+        }
     }
   else
     {
@@ -74,29 +74,29 @@ void test_mpi()
 
   std::vector<unsigned int> origins
     = Utilities::MPI::compute_point_to_point_communication_pattern (MPI_COMM_WORLD,
-                                                                   destinations);
+        destinations);
 
   if (myid == 0)
     {
       deallog << "Processor 0 will receive from ";
       for (unsigned int i=0; i<origins.size(); ++i)
-       deallog << origins[i] << ' ';
+        deallog << origins[i] << ' ';
       deallog << std::endl;
 
       for (unsigned int p=1; p<numprocs; ++p)
-       {
-         MPI_Status status;
-         unsigned int size = 0;
-         MPI_Recv (&size, 1, MPI_UNSIGNED, p, 0, MPI_COMM_WORLD, &status);
-
-         std::vector<unsigned int> orig (size);
-         MPI_Recv (&orig[0], size, MPI_UNSIGNED, p, 0, MPI_COMM_WORLD, &status);
-
-         deallog << "Processor " << p << " will receive from ";
-         for (unsigned int i=0; i<size; ++i)
-           deallog << orig[i] << ' ';
-         deallog << std::endl;
-       }
+        {
+          MPI_Status status;
+          unsigned int size = 0;
+          MPI_Recv (&size, 1, MPI_UNSIGNED, p, 0, MPI_COMM_WORLD, &status);
+
+          std::vector<unsigned int> orig (size);
+          MPI_Recv (&orig[0], size, MPI_UNSIGNED, p, 0, MPI_COMM_WORLD, &status);
+
+          deallog << "Processor " << p << " will receive from ";
+          for (unsigned int i=0; i<size; ++i)
+            deallog << orig[i] << ' ';
+          deallog << std::endl;
+        }
     }
   else
     {
index d380c87e3336a5a144a8670c3cf75aed4abfcf5d..3a296c876ba508c536c844e4c46d9627af906933 100644 (file)
@@ -47,7 +47,7 @@ void test()
   sub[0] = 5*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
   sub[1] = 1;
   GridGenerator::subdivided_hyper_rectangle(static_cast<Triangulation<2>&>(tr),
-                                           sub, Point<2>(0,0), Point<2>(1,1));
+                                            sub, Point<2>(0,0), Point<2>(1,1));
   tr.refine_global (1);
 
   Vector<float> indicators (tr.dealii::Triangulation<2>::n_active_cells());
@@ -55,56 +55,56 @@ void test()
     unsigned int cell_index = 0;
     unsigned int my_cell_index = 0;
     for (Triangulation<2>::active_cell_iterator
-          cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
+         cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
       if (cell->subdomain_id() == myid)
-       {
-         ++my_cell_index;
-         indicators(cell_index) = my_cell_index;
-       }
+        {
+          ++my_cell_index;
+          indicators(cell_index) = my_cell_index;
+        }
     Assert (my_cell_index == 20, ExcInternalError());
   }
 
 
-                                  // each processor has 20 cells,
-                                  // with indicators 1..20, for a
-                                  // total error of 10*21=210 on each
-                                  // processor. the 4 cells with the
-                                  // smallest indicators together
-                                  // have an error of 1+2+3+4=10, for
-                                  // a total fraction of 10/210. the
-                                  // 4 cells with the highest error
-                                  // have 20+19+18+17=74, for a total
-                                  // fraction of 74/210
+  // each processor has 20 cells,
+  // with indicators 1..20, for a
+  // total error of 10*21=210 on each
+  // processor. the 4 cells with the
+  // smallest indicators together
+  // have an error of 1+2+3+4=10, for
+  // a total fraction of 10/210. the
+  // 4 cells with the highest error
+  // have 20+19+18+17=74, for a total
+  // fraction of 74/210
   parallel::distributed::GridRefinement
-    ::refine_and_coarsen_fixed_fraction (tr, indicators,
-                                        74./210+1e-5, 10./210-1e-5);
+  ::refine_and_coarsen_fixed_fraction (tr, indicators,
+                                       74./210+1e-5, 10./210-1e-5);
 
-                                  // now count number of cells
-                                  // flagged for refinement and
-                                  // coarsening. we have to
-                                  // accumulate over all processors
+  // now count number of cells
+  // flagged for refinement and
+  // coarsening. we have to
+  // accumulate over all processors
   unsigned int my_refined   = 0,
-              my_coarsened = 0;
+               my_coarsened = 0;
   for (Triangulation<2>::active_cell_iterator
-        cell = tr.begin_active(); cell != tr.end(); ++cell)
+       cell = tr.begin_active(); cell != tr.end(); ++cell)
     if (cell->refine_flag_set())
       ++my_refined;
     else if (cell->coarsen_flag_set())
       ++my_coarsened;
 
   unsigned int n_refined   = 0,
-              n_coarsened = 0;
+               n_coarsened = 0;
   MPI_Reduce (&my_refined, &n_refined, 1, MPI_UNSIGNED, MPI_SUM, 0,
-             MPI_COMM_WORLD);
+              MPI_COMM_WORLD);
   MPI_Reduce (&my_coarsened, &n_coarsened, 1, MPI_UNSIGNED, MPI_SUM, 0,
-             MPI_COMM_WORLD);
+              MPI_COMM_WORLD);
 
-                                  // make sure we have indeed flagged
-                                  // exactly 20% of cells
+  // make sure we have indeed flagged
+  // exactly 20% of cells
   if (myid == 0)
     {
       deallog << "total active cells = "
-               << tr.n_global_active_cells() << std::endl;
+              << tr.n_global_active_cells() << std::endl;
       deallog << "n_refined = " << n_refined << std::endl;
       deallog << "n_coarsened = " << n_coarsened << std::endl;
 
@@ -112,17 +112,17 @@ void test()
 // since that would make 'make' delete the output file without us
 // ever seeing what we want to see if things go wrong
 //       Assert (n_refined ==
-//           4*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD),
-//           ExcInternalError());
+//        4*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD),
+//        ExcInternalError());
 //       Assert (n_coarsened ==
-//           4*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD),
-//           ExcInternalError());
+//        4*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD),
+//        ExcInternalError());
     }
 
   tr.execute_coarsening_and_refinement ();
   if (myid == 0)
     deallog << "total active cells = "
-           << tr.n_global_active_cells() << std::endl;
+            << tr.n_global_active_cells() << std::endl;
 }
 
 
index 7227d7cb2f22b794c8b1b4a88a19b4f332a67be9..fae48e3d1ba62384093c645b6aa60526073c0ef4 100644 (file)
@@ -51,7 +51,7 @@ void test()
   sub[0] = 5*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
   sub[1] = 1;
   GridGenerator::subdivided_hyper_rectangle(static_cast<Triangulation<2>&>(tr),
-                                           sub, Point<2>(0,0), Point<2>(1,1));
+                                            sub, Point<2>(0,0), Point<2>(1,1));
   tr.refine_global (1);
 
   Vector<float> indicators (tr.dealii::Triangulation<2>::n_active_cells());
@@ -59,62 +59,62 @@ void test()
     unsigned int cell_index = 0;
     unsigned int my_cell_index = 0;
     for (Triangulation<2>::active_cell_iterator
-          cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
+         cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
       if (cell->subdomain_id() == myid)
-       {
-         ++my_cell_index;
-         indicators(cell_index) = std::pow (2, (float)my_cell_index);
-       }
+        {
+          ++my_cell_index;
+          indicators(cell_index) = std::pow (2, (float)my_cell_index);
+        }
   }
 
   const double total_error = indicators.l1_norm();
 
-                                  // each processor has 20 cells,
-                                  // with indicators 2..2^20 on
-                                  // each processor. the 4 cells with
-                                  // the smallest indicators together
-                                  // have an error of 2+4+8+16=30. the
-                                  // 4 cells with the highest error
-                                  // have 2^20+2^19+2^18+2^17
-                                  // = 2^16 * (2+4+8+16)
-                                  // = 30*2^16
-                                  //
-                                  // since we function compares for
-                                  // > or < of errors, we have to
-                                  // set the thresholds slightly
-                                  // above or below what we'd really
-                                  // like
+  // each processor has 20 cells,
+  // with indicators 2..2^20 on
+  // each processor. the 4 cells with
+  // the smallest indicators together
+  // have an error of 2+4+8+16=30. the
+  // 4 cells with the highest error
+  // have 2^20+2^19+2^18+2^17
+  // = 2^16 * (2+4+8+16)
+  // = 30*2^16
+  //
+  // since we function compares for
+  // > or < of errors, we have to
+  // set the thresholds slightly
+  // above or below what we'd really
+  // like
   parallel::distributed::GridRefinement
-    ::refine_and_coarsen_fixed_fraction (tr, indicators,
-                                        30.00000000001/total_error * std::pow(2,(double)16),
-                                        29.9/total_error);
-
-                                  // now count number of cells
-                                  // flagged for refinement and
-                                  // coarsening. we have to
-                                  // accumulate over all processors
+  ::refine_and_coarsen_fixed_fraction (tr, indicators,
+                                       30.00000000001/total_error * std::pow(2,(double)16),
+                                       29.9/total_error);
+
+  // now count number of cells
+  // flagged for refinement and
+  // coarsening. we have to
+  // accumulate over all processors
   unsigned int my_refined   = 0,
-              my_coarsened = 0;
+               my_coarsened = 0;
   for (Triangulation<2>::active_cell_iterator
-        cell = tr.begin_active(); cell != tr.end(); ++cell)
+       cell = tr.begin_active(); cell != tr.end(); ++cell)
     if (cell->refine_flag_set())
       ++my_refined;
     else if (cell->coarsen_flag_set())
       ++my_coarsened;
 
   unsigned int n_refined   = 0,
-              n_coarsened = 0;
+               n_coarsened = 0;
   MPI_Reduce (&my_refined, &n_refined, 1, MPI_UNSIGNED, MPI_SUM, 0,
-             MPI_COMM_WORLD);
+              MPI_COMM_WORLD);
   MPI_Reduce (&my_coarsened, &n_coarsened, 1, MPI_UNSIGNED, MPI_SUM, 0,
-             MPI_COMM_WORLD);
+              MPI_COMM_WORLD);
 
-                                  // make sure we have indeed flagged
-                                  // exactly 20% of cells
+  // make sure we have indeed flagged
+  // exactly 20% of cells
   if (myid == 0)
     {
       deallog << "total active cells = "
-               << tr.n_global_active_cells() << std::endl;
+              << tr.n_global_active_cells() << std::endl;
       deallog << "n_refined = " << n_refined << std::endl;
       deallog << "n_coarsened = " << n_coarsened << std::endl;
 
@@ -122,17 +122,17 @@ void test()
 // since that would make 'make' delete the output file without us
 // ever seeing what we want to see if things go wrong
 //       Assert (n_refined ==
-//           4*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD),
-//           ExcInternalError());
+//        4*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD),
+//        ExcInternalError());
 //       Assert (n_coarsened ==
-//           4*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD),
-//           ExcInternalError());
+//        4*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD),
+//        ExcInternalError());
     }
 
   tr.execute_coarsening_and_refinement ();
   if (myid == 0)
     deallog << "total active cells = "
-           << tr.n_global_active_cells() << std::endl;
+            << tr.n_global_active_cells() << std::endl;
 }
 
 
index a8d0c5c4f840b08814af26814c518826e803b7f2..f86c6d9ac8faceceabe8572adbcb31949c1c0494 100644 (file)
@@ -56,7 +56,7 @@ void test()
   sub[0] = 5*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
   sub[1] = 1;
   GridGenerator::subdivided_hyper_rectangle(static_cast<Triangulation<2>&>(tr),
-                                           sub, Point<2>(0,0), Point<2>(1,1));
+                                            sub, Point<2>(0,0), Point<2>(1,1));
   tr.refine_global (1);
 
   Vector<float> indicators (tr.dealii::Triangulation<2>::n_active_cells());
@@ -64,54 +64,54 @@ void test()
     unsigned int cell_index = 0;
     unsigned int my_cell_index = 0;
     for (Triangulation<2>::active_cell_iterator
-          cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
+         cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
       if (cell->subdomain_id() == myid)
-       {
-         ++my_cell_index;
-         indicators(cell_index) = my_cell_index+1;
-       }
+        {
+          ++my_cell_index;
+          indicators(cell_index) = my_cell_index+1;
+        }
     Assert (my_cell_index == 20, ExcInternalError());
   }
 
   parallel::distributed::GridRefinement
-    ::refine_and_coarsen_fixed_fraction (tr, indicators,
-                                        (74.+0.5)/210, 0);
+  ::refine_and_coarsen_fixed_fraction (tr, indicators,
+                                       (74.+0.5)/210, 0);
 
-                                  // now count number of cells
-                                  // flagged for refinement and
-                                  // coarsening. we have to
-                                  // accumulate over all processors
+  // now count number of cells
+  // flagged for refinement and
+  // coarsening. we have to
+  // accumulate over all processors
   unsigned int my_refined   = 0,
-              my_coarsened = 0;
+               my_coarsened = 0;
   for (Triangulation<2>::active_cell_iterator
-        cell = tr.begin_active(); cell != tr.end(); ++cell)
+       cell = tr.begin_active(); cell != tr.end(); ++cell)
     if (cell->refine_flag_set())
       ++my_refined;
     else if (cell->coarsen_flag_set())
       ++my_coarsened;
 
   unsigned int n_refined   = 0,
-              n_coarsened = 0;
+               n_coarsened = 0;
   MPI_Reduce (&my_refined, &n_refined, 1, MPI_UNSIGNED, MPI_SUM, 0,
-             MPI_COMM_WORLD);
+              MPI_COMM_WORLD);
   MPI_Reduce (&my_coarsened, &n_coarsened, 1, MPI_UNSIGNED, MPI_SUM, 0,
-             MPI_COMM_WORLD);
+              MPI_COMM_WORLD);
 
-                                  // make sure we have indeed flagged
-                                  // exactly 20% of cells
+  // make sure we have indeed flagged
+  // exactly 20% of cells
   if (myid == 0)
     {
       deallog << "total active cells = "
-               << tr.n_global_active_cells() << std::endl;
+              << tr.n_global_active_cells() << std::endl;
       deallog << "n_refined = " << n_refined << std::endl;
-                                      // the following should be 0
+      // the following should be 0
       deallog << "n_coarsened = " << n_coarsened << std::endl;
     }
 
   tr.execute_coarsening_and_refinement ();
   if (myid == 0)
     deallog << "total active cells = "
-           << tr.n_global_active_cells() << std::endl;
+            << tr.n_global_active_cells() << std::endl;
 }
 
 
index c230c7d442febca516ed644d60249ee78c96bed3..093c09f62d6f71ce3032c8688266507e0c0111b6 100644 (file)
@@ -50,86 +50,86 @@ void test()
 
   Vector<float> indicators (tr.dealii::Triangulation<2>::n_active_cells());
   float min_indicator = tr.dealii::Triangulation<2>::n_active_cells(),
-       max_indicator = 0;
+        max_indicator = 0;
   {
     unsigned int cell_index = 0;
     unsigned int my_cell_index = 0;
     for (Triangulation<2>::active_cell_iterator
-          cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
+         cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
       if (cell->subdomain_id() == myid)
-       {
-         ++my_cell_index;
-         indicators(cell_index) = my_cell_index;
-         min_indicator = std::min (min_indicator, indicators(cell_index));
-         max_indicator = std::max (max_indicator, indicators(cell_index));
-       }
+        {
+          ++my_cell_index;
+          indicators(cell_index) = my_cell_index;
+          min_indicator = std::min (min_indicator, indicators(cell_index));
+          max_indicator = std::max (max_indicator, indicators(cell_index));
+        }
   }
 
-                                  // use one strategy to compute
-                                  // thresholds and obtain those
-                                  // thresholds
+  // use one strategy to compute
+  // thresholds and obtain those
+  // thresholds
   parallel::distributed::GridRefinement
-    ::refine_and_coarsen_fixed_fraction (tr, indicators, 2./3, 1./6);
+  ::refine_and_coarsen_fixed_fraction (tr, indicators, 2./3, 1./6);
   {
     float coarsen_indicator = min_indicator-1,
-         refine_indicator  = max_indicator+1;
+          refine_indicator  = max_indicator+1;
     unsigned int cell_index=0;
     for (Triangulation<2>::active_cell_iterator
-          cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
+         cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
       if (cell->refine_flag_set())
-       refine_indicator = std::min (refine_indicator,
-                                    indicators(cell_index));
+        refine_indicator = std::min (refine_indicator,
+                                     indicators(cell_index));
       else if (cell->coarsen_flag_set())
-       coarsen_indicator = std::max (coarsen_indicator,
-                                     indicators(cell_index));
+        coarsen_indicator = std::max (coarsen_indicator,
+                                      indicators(cell_index));
     if (myid == 0)
       {
-       deallog << "thresholds = " << refine_indicator << ' '
-               << coarsen_indicator << std::endl;
+        deallog << "thresholds = " << refine_indicator << ' '
+                << coarsen_indicator << std::endl;
       }
 
     for (Triangulation<2>::active_cell_iterator
-          cell = tr.begin_active(); cell != tr.end(); ++cell)
+         cell = tr.begin_active(); cell != tr.end(); ++cell)
       {
-       cell->clear_coarsen_flag();
-       cell->clear_refine_flag();
+        cell->clear_coarsen_flag();
+        cell->clear_refine_flag();
       }
   }
 
-                                  // now use the second strategy to
-                                  // compute thresholds and obtain
-                                  // those thresholds. note that this
-                                  // only works because we are
-                                  // working on only a single
-                                  // processor
+  // now use the second strategy to
+  // compute thresholds and obtain
+  // those thresholds. note that this
+  // only works because we are
+  // working on only a single
+  // processor
   dealii::GridRefinement
-    ::refine_and_coarsen_fixed_fraction (tr, indicators, 2./3, 1./6);
+  ::refine_and_coarsen_fixed_fraction (tr, indicators, 2./3, 1./6);
   {
     float coarsen_indicator = min_indicator-1,
-         refine_indicator  = max_indicator+1;
+          refine_indicator  = max_indicator+1;
     unsigned int cell_index=0;
     for (Triangulation<2>::active_cell_iterator
-          cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
+         cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
       if (cell->refine_flag_set())
-       refine_indicator = std::min (refine_indicator,
-                                    indicators(cell_index));
+        refine_indicator = std::min (refine_indicator,
+                                     indicators(cell_index));
       else if (cell->coarsen_flag_set())
-       coarsen_indicator = std::max (coarsen_indicator,
-                                     indicators(cell_index));
+        coarsen_indicator = std::max (coarsen_indicator,
+                                      indicators(cell_index));
     if (myid == 0)
       {
-       deallog << "thresholds = " << refine_indicator << ' '
-               << coarsen_indicator << std::endl;
+        deallog << "thresholds = " << refine_indicator << ' '
+                << coarsen_indicator << std::endl;
       }
 
     for (Triangulation<2>::active_cell_iterator
-          cell = tr.begin_active(); cell != tr.end(); ++cell)
+         cell = tr.begin_active(); cell != tr.end(); ++cell)
       {
-       cell->clear_coarsen_flag();
-       cell->clear_refine_flag();
+        cell->clear_coarsen_flag();
+        cell->clear_refine_flag();
       }
   }
-  
+
 }
 
 
index 37f98eebdc64426f041d6b55cdcdc1feab4ad3b9..f970e5f275c5381bb5578894ec1d7c1563d4bc13 100644 (file)
@@ -47,83 +47,83 @@ void test()
 
   Vector<float> indicators (tr.dealii::Triangulation<2>::n_active_cells());
   float min_indicator = tr.dealii::Triangulation<2>::n_active_cells(),
-       max_indicator = 0;
+        max_indicator = 0;
   {
     unsigned int cell_index = 0;
     unsigned int my_cell_index = 0;
     for (Triangulation<2>::active_cell_iterator
-          cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
+         cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
       if (cell->subdomain_id() == myid)
-       {
-         ++my_cell_index;
-         indicators(cell_index) = std::pow(2.,(int)my_cell_index/4);
-         min_indicator = std::min (min_indicator, indicators(cell_index));
-         max_indicator = std::max (max_indicator, indicators(cell_index));
-       }
+        {
+          ++my_cell_index;
+          indicators(cell_index) = std::pow(2.,(int)my_cell_index/4);
+          min_indicator = std::min (min_indicator, indicators(cell_index));
+          max_indicator = std::max (max_indicator, indicators(cell_index));
+        }
   }
 
-                                  // use one strategy to compute
-                                  // thresholds and obtain those
-                                  // thresholds
+  // use one strategy to compute
+  // thresholds and obtain those
+  // thresholds
   parallel::distributed::GridRefinement
-    ::refine_and_coarsen_fixed_fraction (tr, indicators, 2./3, 1./6);
+  ::refine_and_coarsen_fixed_fraction (tr, indicators, 2./3, 1./6);
   {
     float coarsen_indicator = min_indicator-1,
-         refine_indicator  = max_indicator+1;
+          refine_indicator  = max_indicator+1;
     unsigned int cell_index=0;
     for (Triangulation<2>::active_cell_iterator
-          cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
+         cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
       if (cell->refine_flag_set())
-       refine_indicator = std::min (refine_indicator,
-                                    indicators(cell_index));
+        refine_indicator = std::min (refine_indicator,
+                                     indicators(cell_index));
       else if (cell->coarsen_flag_set())
-       coarsen_indicator = std::max (coarsen_indicator,
-                                     indicators(cell_index));
+        coarsen_indicator = std::max (coarsen_indicator,
+                                      indicators(cell_index));
     if (myid == 0)
       {
-       deallog << "thresholds = " << refine_indicator << ' '
-               << coarsen_indicator << std::endl;
+        deallog << "thresholds = " << refine_indicator << ' '
+                << coarsen_indicator << std::endl;
       }
 
     for (Triangulation<2>::active_cell_iterator
-          cell = tr.begin_active(); cell != tr.end(); ++cell)
+         cell = tr.begin_active(); cell != tr.end(); ++cell)
       {
-       cell->clear_coarsen_flag();
-       cell->clear_refine_flag();
+        cell->clear_coarsen_flag();
+        cell->clear_refine_flag();
       }
   }
 
-                                  // now use the second strategy to
-                                  // compute thresholds and obtain
-                                  // those thresholds. note that this
-                                  // only works because we are
-                                  // working on only a single
-                                  // processor
+  // now use the second strategy to
+  // compute thresholds and obtain
+  // those thresholds. note that this
+  // only works because we are
+  // working on only a single
+  // processor
   dealii::GridRefinement
-    ::refine_and_coarsen_fixed_fraction (tr, indicators, 2./3, 1./6);
+  ::refine_and_coarsen_fixed_fraction (tr, indicators, 2./3, 1./6);
   {
     float coarsen_indicator = min_indicator-1,
-         refine_indicator  = max_indicator+1;
+          refine_indicator  = max_indicator+1;
     unsigned int cell_index=0;
     for (Triangulation<2>::active_cell_iterator
-          cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
+         cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
       if (cell->refine_flag_set())
-       refine_indicator = std::min (refine_indicator,
-                                    indicators(cell_index));
+        refine_indicator = std::min (refine_indicator,
+                                     indicators(cell_index));
       else if (cell->coarsen_flag_set())
-       coarsen_indicator = std::max (coarsen_indicator,
-                                     indicators(cell_index));
+        coarsen_indicator = std::max (coarsen_indicator,
+                                      indicators(cell_index));
     if (myid == 0)
       {
-       deallog << "thresholds = " << refine_indicator << ' '
-               << coarsen_indicator << std::endl;
+        deallog << "thresholds = " << refine_indicator << ' '
+                << coarsen_indicator << std::endl;
       }
 
     for (Triangulation<2>::active_cell_iterator
-          cell = tr.begin_active(); cell != tr.end(); ++cell)
+         cell = tr.begin_active(); cell != tr.end(); ++cell)
       {
-       cell->clear_coarsen_flag();
-       cell->clear_refine_flag();
+        cell->clear_coarsen_flag();
+        cell->clear_refine_flag();
       }
   }
 
index 4ad2266be64ee183831b7bec8a6909396ac95249..dbbca1b6071f5362602d12648d3897ab70ba158b 100644 (file)
@@ -51,11 +51,11 @@ void test()
 
   const unsigned int initial_refinement = 3;
   GridGenerator::hyper_shell (tr,
-                             Point<2>(),
-                             EquationData::R0,
-                             EquationData::R1,
-                             12,
-                             true);
+                              Point<2>(),
+                              EquationData::R0,
+                              EquationData::R1,
+                              12,
+                              true);
   static HyperShellBoundary<2> boundary;
   tr.set_boundary (0, boundary);
   tr.set_boundary (1, boundary);
@@ -63,9 +63,9 @@ void test()
   tr.refine_global (initial_refinement);
 
   Assert (tr.dealii::Triangulation<2>::n_active_cells()==768,
-         ExcInternalError());
+          ExcInternalError());
 
-                                  // now read indicators
+  // now read indicators
   Vector<float> indicators (tr.dealii::Triangulation<2>::n_active_cells());
   {
     std::ifstream in("refine_and_coarsen_fixed_fraction_06/indicators");
@@ -74,74 +74,74 @@ void test()
   }
 
   double min_indicator = *std::min_element (indicators.begin(),
-                                           indicators.end()),
-        max_indicator = *std::max_element (indicators.begin(),
-                                           indicators.end());
+                                            indicators.end()),
+                         max_indicator = *std::max_element (indicators.begin(),
+                                                            indicators.end());
 
 
 
-                                  // use one strategy to compute
-                                  // thresholds and obtain those
-                                  // thresholds
+  // use one strategy to compute
+  // thresholds and obtain those
+  // thresholds
   parallel::distributed::GridRefinement
-    ::refine_and_coarsen_fixed_fraction (tr, indicators, 0.6, 0.2);
+  ::refine_and_coarsen_fixed_fraction (tr, indicators, 0.6, 0.2);
   {
     float coarsen_indicator = min_indicator-1,
-         refine_indicator  = max_indicator+1;
+          refine_indicator  = max_indicator+1;
     unsigned int cell_index=0;
     for (Triangulation<2>::active_cell_iterator
-          cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
+         cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
       if (cell->refine_flag_set())
-       refine_indicator = std::min (refine_indicator,
-                                    indicators(cell_index));
+        refine_indicator = std::min (refine_indicator,
+                                     indicators(cell_index));
       else if (cell->coarsen_flag_set())
-       coarsen_indicator = std::max (coarsen_indicator,
-                                     indicators(cell_index));
+        coarsen_indicator = std::max (coarsen_indicator,
+                                      indicators(cell_index));
     if (myid == 0)
       {
-       deallog << "thresholds = " << refine_indicator << ' '
-               << coarsen_indicator << std::endl;
+        deallog << "thresholds = " << refine_indicator << ' '
+                << coarsen_indicator << std::endl;
       }
 
     for (Triangulation<2>::active_cell_iterator
-          cell = tr.begin_active(); cell != tr.end(); ++cell)
+         cell = tr.begin_active(); cell != tr.end(); ++cell)
       {
-       cell->clear_coarsen_flag();
-       cell->clear_refine_flag();
+        cell->clear_coarsen_flag();
+        cell->clear_refine_flag();
       }
   }
 
-                                  // now use the second strategy to
-                                  // compute thresholds and obtain
-                                  // those thresholds. note that this
-                                  // only works because we are
-                                  // working on only a single
-                                  // processor
+  // now use the second strategy to
+  // compute thresholds and obtain
+  // those thresholds. note that this
+  // only works because we are
+  // working on only a single
+  // processor
   dealii::GridRefinement
-    ::refine_and_coarsen_fixed_fraction (tr, indicators, 0.6, 0.2);
+  ::refine_and_coarsen_fixed_fraction (tr, indicators, 0.6, 0.2);
   {
     float coarsen_indicator = min_indicator-1,
-         refine_indicator  = max_indicator+1;
+          refine_indicator  = max_indicator+1;
     unsigned int cell_index=0;
     for (Triangulation<2>::active_cell_iterator
-          cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
+         cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
       if (cell->refine_flag_set())
-       refine_indicator = std::min (refine_indicator,
-                                    indicators(cell_index));
+        refine_indicator = std::min (refine_indicator,
+                                     indicators(cell_index));
       else if (cell->coarsen_flag_set())
-       coarsen_indicator = std::max (coarsen_indicator,
-                                     indicators(cell_index));
+        coarsen_indicator = std::max (coarsen_indicator,
+                                      indicators(cell_index));
     if (myid == 0)
       {
-       deallog << "thresholds = " << refine_indicator << ' '
-               << coarsen_indicator << std::endl;
+        deallog << "thresholds = " << refine_indicator << ' '
+                << coarsen_indicator << std::endl;
       }
 
     for (Triangulation<2>::active_cell_iterator
-          cell = tr.begin_active(); cell != tr.end(); ++cell)
+         cell = tr.begin_active(); cell != tr.end(); ++cell)
       {
-       cell->clear_coarsen_flag();
-       cell->clear_refine_flag();
+        cell->clear_coarsen_flag();
+        cell->clear_refine_flag();
       }
   }
 
index 90c415f32ba99672abe22a2e0c8f9f4e68c3038d..0cf5ffead10f6e9bc27593c015e739d3d0e9e11a 100644 (file)
@@ -47,7 +47,7 @@ void test()
   sub[0] = 5*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
   sub[1] = 1;
   GridGenerator::subdivided_hyper_rectangle(static_cast<Triangulation<2>&>(tr),
-                                           sub, Point<2>(0,0), Point<2>(1,1));
+                                            sub, Point<2>(0,0), Point<2>(1,1));
   tr.refine_global (1);
 
   Vector<float> indicators (tr.dealii::Triangulation<2>::n_active_cells());
@@ -55,44 +55,44 @@ void test()
     unsigned int cell_index = 0;
     unsigned int my_cell_index = 0;
     for (Triangulation<2>::active_cell_iterator
-          cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
+         cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
       if (cell->subdomain_id() == myid)
-       {
-         ++my_cell_index;
-         indicators(cell_index) = my_cell_index;
-       }
+        {
+          ++my_cell_index;
+          indicators(cell_index) = my_cell_index;
+        }
   }
 
 
   parallel::distributed::GridRefinement
-    ::refine_and_coarsen_fixed_number (tr, indicators, 0.2, 0.2);
+  ::refine_and_coarsen_fixed_number (tr, indicators, 0.2, 0.2);
 
-                                  // now count number of cells
-                                  // flagged for refinement and
-                                  // coarsening. we have to
-                                  // accumulate over all processors
+  // now count number of cells
+  // flagged for refinement and
+  // coarsening. we have to
+  // accumulate over all processors
   unsigned int my_refined   = 0,
-              my_coarsened = 0;
+               my_coarsened = 0;
   for (Triangulation<2>::active_cell_iterator
-        cell = tr.begin_active(); cell != tr.end(); ++cell)
+       cell = tr.begin_active(); cell != tr.end(); ++cell)
     if (cell->refine_flag_set())
       ++my_refined;
     else if (cell->coarsen_flag_set())
       ++my_coarsened;
 
   unsigned int n_refined   = 0,
-              n_coarsened = 0;
+               n_coarsened = 0;
   MPI_Reduce (&my_refined, &n_refined, 1, MPI_UNSIGNED, MPI_SUM, 0,
-             MPI_COMM_WORLD);
+              MPI_COMM_WORLD);
   MPI_Reduce (&my_coarsened, &n_coarsened, 1, MPI_UNSIGNED, MPI_SUM, 0,
-             MPI_COMM_WORLD);
+              MPI_COMM_WORLD);
 
-                                  // make sure we have indeed flagged
-                                  // exactly 20% of cells
+  // make sure we have indeed flagged
+  // exactly 20% of cells
   if (myid == 0)
     {
       deallog << "total active cells = "
-               << tr.n_global_active_cells() << std::endl;
+              << tr.n_global_active_cells() << std::endl;
       deallog << "n_refined = " << n_refined << std::endl;
       deallog << "n_coarsened = " << n_coarsened << std::endl;
 
@@ -100,17 +100,17 @@ void test()
 // since that would make 'make' delete the output file without us
 // ever seeing what we want to see if things go wrong
 //       Assert (n_refined ==
-//           4*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD),
-//           ExcInternalError());
+//        4*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD),
+//        ExcInternalError());
 //       Assert (n_coarsened ==
-//           4*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD),
-//           ExcInternalError());
+//        4*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD),
+//        ExcInternalError());
     }
 
   tr.execute_coarsening_and_refinement ();
   if (myid == 0)
     deallog << "total active cells = "
-           << tr.n_global_active_cells() << std::endl;
+            << tr.n_global_active_cells() << std::endl;
 }
 
 
index aa5e4a3f639cfac4af118efea57499fa8f40296e..37ce0a6945ea5b87d76e75b0680ccd99d251df3c 100644 (file)
@@ -48,7 +48,7 @@ void test()
   sub[0] = 5*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
   sub[1] = 1;
   GridGenerator::subdivided_hyper_rectangle(static_cast<Triangulation<2>&>(tr),
-                                           sub, Point<2>(0,0), Point<2>(1,1));
+                                            sub, Point<2>(0,0), Point<2>(1,1));
   tr.refine_global (1);
 
   Vector<float> indicators (tr.dealii::Triangulation<2>::n_active_cells());
@@ -56,44 +56,44 @@ void test()
     unsigned int cell_index = 0;
     unsigned int my_cell_index = 0;
     for (Triangulation<2>::active_cell_iterator
-          cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
+         cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
       if (cell->subdomain_id() == myid)
-       {
-         ++my_cell_index;
-         indicators(cell_index) = std::pow (10, (float)my_cell_index);
-       }
+        {
+          ++my_cell_index;
+          indicators(cell_index) = std::pow (10, (float)my_cell_index);
+        }
   }
 
 
   parallel::distributed::GridRefinement
-    ::refine_and_coarsen_fixed_number (tr, indicators, 0.2, 0.2);
+  ::refine_and_coarsen_fixed_number (tr, indicators, 0.2, 0.2);
 
-                                  // now count number of cells
-                                  // flagged for refinement and
-                                  // coarsening. we have to
-                                  // accumulate over all processors
+  // now count number of cells
+  // flagged for refinement and
+  // coarsening. we have to
+  // accumulate over all processors
   unsigned int my_refined   = 0,
-              my_coarsened = 0;
+               my_coarsened = 0;
   for (Triangulation<2>::active_cell_iterator
-        cell = tr.begin_active(); cell != tr.end(); ++cell)
+       cell = tr.begin_active(); cell != tr.end(); ++cell)
     if (cell->refine_flag_set())
       ++my_refined;
     else if (cell->coarsen_flag_set())
       ++my_coarsened;
 
   unsigned int n_refined   = 0,
-              n_coarsened = 0;
+               n_coarsened = 0;
   MPI_Reduce (&my_refined, &n_refined, 1, MPI_UNSIGNED, MPI_SUM, 0,
-             MPI_COMM_WORLD);
+              MPI_COMM_WORLD);
   MPI_Reduce (&my_coarsened, &n_coarsened, 1, MPI_UNSIGNED, MPI_SUM, 0,
-             MPI_COMM_WORLD);
+              MPI_COMM_WORLD);
 
-                                  // make sure we have indeed flagged
-                                  // exactly 20% of cells
+  // make sure we have indeed flagged
+  // exactly 20% of cells
   if (myid == 0)
     {
       deallog << "total active cells = "
-               << tr.n_global_active_cells() << std::endl;
+              << tr.n_global_active_cells() << std::endl;
       deallog << "n_refined = " << n_refined << std::endl;
       deallog << "n_coarsened = " << n_coarsened << std::endl;
 
@@ -101,17 +101,17 @@ void test()
 // since that would make 'make' delete the output file without us
 // ever seeing what we want to see if things go wrong
 //       Assert (n_refined ==
-//           4*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD),
-//           ExcInternalError());
+//        4*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD),
+//        ExcInternalError());
 //       Assert (n_coarsened ==
-//           4*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD),
-//           ExcInternalError());
+//        4*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD),
+//        ExcInternalError());
     }
 
   tr.execute_coarsening_and_refinement ();
   if (myid == 0)
     deallog << "total active cells = "
-           << tr.n_global_active_cells() << std::endl;
+            << tr.n_global_active_cells() << std::endl;
 }
 
 
index 20e007de438ca5c5e067a1ef00fef9cd2e26ccb0..11ed30771ec1454f4dfdbfe90e2ee17d9026c949 100644 (file)
@@ -45,7 +45,7 @@ void test()
   sub[0] = 5*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
   sub[1] = 1;
   GridGenerator::subdivided_hyper_rectangle(static_cast<Triangulation<2>&>(tr),
-                                           sub, Point<2>(0,0), Point<2>(1,1));
+                                            sub, Point<2>(0,0), Point<2>(1,1));
   tr.refine_global (1);
 
   Vector<float> indicators (tr.dealii::Triangulation<2>::n_active_cells());
@@ -53,46 +53,46 @@ void test()
     unsigned int cell_index = 0;
     unsigned int my_cell_index = 0;
     for (Triangulation<2>::active_cell_iterator
-          cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
+         cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
       if (cell->subdomain_id() == myid)
-       {
-         ++my_cell_index;
-         indicators(cell_index) = my_cell_index;
-       }
+        {
+          ++my_cell_index;
+          indicators(cell_index) = my_cell_index;
+        }
   }
 
 
   parallel::distributed::GridRefinement
-    ::refine_and_coarsen_fixed_number (tr, indicators, 0.2, 0);
+  ::refine_and_coarsen_fixed_number (tr, indicators, 0.2, 0);
 
-                                  // now count number of cells
-                                  // flagged for refinement and
-                                  // coarsening. we have to
-                                  // accumulate over all processors
+  // now count number of cells
+  // flagged for refinement and
+  // coarsening. we have to
+  // accumulate over all processors
   unsigned int my_refined   = 0,
-              my_coarsened = 0;
+               my_coarsened = 0;
   for (Triangulation<2>::active_cell_iterator
-        cell = tr.begin_active(); cell != tr.end(); ++cell)
+       cell = tr.begin_active(); cell != tr.end(); ++cell)
     if (cell->refine_flag_set())
       ++my_refined;
     else if (cell->coarsen_flag_set())
       ++my_coarsened;
 
   unsigned int n_refined   = 0,
-              n_coarsened = 0;
+               n_coarsened = 0;
   MPI_Reduce (&my_refined, &n_refined, 1, MPI_UNSIGNED, MPI_SUM, 0,
-             MPI_COMM_WORLD);
+              MPI_COMM_WORLD);
   MPI_Reduce (&my_coarsened, &n_coarsened, 1, MPI_UNSIGNED, MPI_SUM, 0,
-             MPI_COMM_WORLD);
+              MPI_COMM_WORLD);
 
-                                  // make sure we have indeed flagged
-                                  // exactly 20% of cells for
-                                  // refinement, and none for
-                                  // coarsening
+  // make sure we have indeed flagged
+  // exactly 20% of cells for
+  // refinement, and none for
+  // coarsening
   if (myid == 0)
     {
       deallog << "total active cells = "
-               << tr.n_global_active_cells() << std::endl;
+              << tr.n_global_active_cells() << std::endl;
       deallog << "n_refined = " << n_refined << std::endl;
       deallog << "n_coarsened = " << n_coarsened << std::endl;
     }
@@ -100,7 +100,7 @@ void test()
   tr.execute_coarsening_and_refinement ();
   if (myid == 0)
     deallog << "total active cells = "
-           << tr.n_global_active_cells() << std::endl;
+            << tr.n_global_active_cells() << std::endl;
 }
 
 
index 4d00ed9be60df977a4099c6c5edb35f8c091e10f..b9a6754428514049bfac208f3f5f93d7f7301f23 100644 (file)
@@ -50,86 +50,86 @@ void test()
 
   Vector<float> indicators (tr.dealii::Triangulation<2>::n_active_cells());
   float min_indicator = tr.dealii::Triangulation<2>::n_active_cells(),
-       max_indicator = 0;
+        max_indicator = 0;
   {
     unsigned int cell_index = 0;
     unsigned int my_cell_index = 0;
     for (Triangulation<2>::active_cell_iterator
-          cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
+         cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
       if (cell->subdomain_id() == myid)
-       {
-         ++my_cell_index;
-         indicators(cell_index) = my_cell_index;
-         min_indicator = std::min (min_indicator, indicators(cell_index));
-         max_indicator = std::max (max_indicator, indicators(cell_index));
-       }
+        {
+          ++my_cell_index;
+          indicators(cell_index) = my_cell_index;
+          min_indicator = std::min (min_indicator, indicators(cell_index));
+          max_indicator = std::max (max_indicator, indicators(cell_index));
+        }
   }
 
-                                  // use one strategy to compute
-                                  // thresholds and obtain those
-                                  // thresholds
+  // use one strategy to compute
+  // thresholds and obtain those
+  // thresholds
   parallel::distributed::GridRefinement
-    ::refine_and_coarsen_fixed_number (tr, indicators, 2./3, 1./6);
+  ::refine_and_coarsen_fixed_number (tr, indicators, 2./3, 1./6);
   {
     float coarsen_indicator = min_indicator-1,
-         refine_indicator  = max_indicator+1;
+          refine_indicator  = max_indicator+1;
     unsigned int cell_index=0;
     for (Triangulation<2>::active_cell_iterator
-          cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
+         cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
       if (cell->refine_flag_set())
-       refine_indicator = std::min (refine_indicator,
-                                    indicators(cell_index));
+        refine_indicator = std::min (refine_indicator,
+                                     indicators(cell_index));
       else if (cell->coarsen_flag_set())
-       coarsen_indicator = std::max (coarsen_indicator,
-                                     indicators(cell_index));
+        coarsen_indicator = std::max (coarsen_indicator,
+                                      indicators(cell_index));
     if (myid == 0)
       {
-       deallog << "thresholds = " << refine_indicator << ' '
-               << coarsen_indicator << std::endl;
+        deallog << "thresholds = " << refine_indicator << ' '
+                << coarsen_indicator << std::endl;
       }
 
     for (Triangulation<2>::active_cell_iterator
-          cell = tr.begin_active(); cell != tr.end(); ++cell)
+         cell = tr.begin_active(); cell != tr.end(); ++cell)
       {
-       cell->clear_coarsen_flag();
-       cell->clear_refine_flag();
+        cell->clear_coarsen_flag();
+        cell->clear_refine_flag();
       }
   }
 
-                                  // now use the second strategy to
-                                  // compute thresholds and obtain
-                                  // those thresholds. note that this
-                                  // only works because we are
-                                  // working on only a single
-                                  // processor
+  // now use the second strategy to
+  // compute thresholds and obtain
+  // those thresholds. note that this
+  // only works because we are
+  // working on only a single
+  // processor
   dealii::GridRefinement
-    ::refine_and_coarsen_fixed_number (tr, indicators, 2./3, 1./6);
+  ::refine_and_coarsen_fixed_number (tr, indicators, 2./3, 1./6);
   {
     float coarsen_indicator = min_indicator-1,
-         refine_indicator  = max_indicator+1;
+          refine_indicator  = max_indicator+1;
     unsigned int cell_index=0;
     for (Triangulation<2>::active_cell_iterator
-          cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
+         cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
       if (cell->refine_flag_set())
-       refine_indicator = std::min (refine_indicator,
-                                    indicators(cell_index));
+        refine_indicator = std::min (refine_indicator,
+                                     indicators(cell_index));
       else if (cell->coarsen_flag_set())
-       coarsen_indicator = std::max (coarsen_indicator,
-                                     indicators(cell_index));
+        coarsen_indicator = std::max (coarsen_indicator,
+                                      indicators(cell_index));
     if (myid == 0)
       {
-       deallog << "thresholds = " << refine_indicator << ' '
-               << coarsen_indicator << std::endl;
+        deallog << "thresholds = " << refine_indicator << ' '
+                << coarsen_indicator << std::endl;
       }
 
     for (Triangulation<2>::active_cell_iterator
-          cell = tr.begin_active(); cell != tr.end(); ++cell)
+         cell = tr.begin_active(); cell != tr.end(); ++cell)
       {
-       cell->clear_coarsen_flag();
-       cell->clear_refine_flag();
+        cell->clear_coarsen_flag();
+        cell->clear_refine_flag();
       }
   }
-  
+
 }
 
 
index bfcffc74fea93c434ffeb306979a777ae756b646..c0ca2d0401424655ef4ca1d30e0b7530b4951b28 100644 (file)
@@ -47,83 +47,83 @@ void test()
 
   Vector<float> indicators (tr.dealii::Triangulation<2>::n_active_cells());
   float min_indicator = tr.dealii::Triangulation<2>::n_active_cells(),
-       max_indicator = 0;
+        max_indicator = 0;
   {
     unsigned int cell_index = 0;
     unsigned int my_cell_index = 0;
     for (Triangulation<2>::active_cell_iterator
-          cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
+         cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
       if (cell->subdomain_id() == myid)
-       {
-         ++my_cell_index;
-         indicators(cell_index) = std::pow(2.0,static_cast<double>(my_cell_index/4));
-         min_indicator = std::min (min_indicator, indicators(cell_index));
-         max_indicator = std::max (max_indicator, indicators(cell_index));
-       }
+        {
+          ++my_cell_index;
+          indicators(cell_index) = std::pow(2.0,static_cast<double>(my_cell_index/4));
+          min_indicator = std::min (min_indicator, indicators(cell_index));
+          max_indicator = std::max (max_indicator, indicators(cell_index));
+        }
   }
 
-                                  // use one strategy to compute
-                                  // thresholds and obtain those
-                                  // thresholds
+  // use one strategy to compute
+  // thresholds and obtain those
+  // thresholds
   parallel::distributed::GridRefinement
-    ::refine_and_coarsen_fixed_number (tr, indicators, 2./3, 1./6);
+  ::refine_and_coarsen_fixed_number (tr, indicators, 2./3, 1./6);
   {
     float coarsen_indicator = min_indicator-1,
-         refine_indicator  = max_indicator+1;
+          refine_indicator  = max_indicator+1;
     unsigned int cell_index=0;
     for (Triangulation<2>::active_cell_iterator
-          cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
+         cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
       if (cell->refine_flag_set())
-       refine_indicator = std::min (refine_indicator,
-                                    indicators(cell_index));
+        refine_indicator = std::min (refine_indicator,
+                                     indicators(cell_index));
       else if (cell->coarsen_flag_set())
-       coarsen_indicator = std::max (coarsen_indicator,
-                                     indicators(cell_index));
+        coarsen_indicator = std::max (coarsen_indicator,
+                                      indicators(cell_index));
     if (myid == 0)
       {
-       deallog << "thresholds = " << refine_indicator << ' '
-               << coarsen_indicator << std::endl;
+        deallog << "thresholds = " << refine_indicator << ' '
+                << coarsen_indicator << std::endl;
       }
 
     for (Triangulation<2>::active_cell_iterator
-          cell = tr.begin_active(); cell != tr.end(); ++cell)
+         cell = tr.begin_active(); cell != tr.end(); ++cell)
       {
-       cell->clear_coarsen_flag();
-       cell->clear_refine_flag();
+        cell->clear_coarsen_flag();
+        cell->clear_refine_flag();
       }
   }
 
-                                  // now use the second strategy to
-                                  // compute thresholds and obtain
-                                  // those thresholds. note that this
-                                  // only works because we are
-                                  // working on only a single
-                                  // processor
+  // now use the second strategy to
+  // compute thresholds and obtain
+  // those thresholds. note that this
+  // only works because we are
+  // working on only a single
+  // processor
   dealii::GridRefinement
-    ::refine_and_coarsen_fixed_number (tr, indicators, 2./3, 1./6);
+  ::refine_and_coarsen_fixed_number (tr, indicators, 2./3, 1./6);
   {
     float coarsen_indicator = min_indicator-1,
-         refine_indicator  = max_indicator+1;
+          refine_indicator  = max_indicator+1;
     unsigned int cell_index=0;
     for (Triangulation<2>::active_cell_iterator
-          cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
+         cell = tr.begin_active(); cell != tr.end(); ++cell, ++cell_index)
       if (cell->refine_flag_set())
-       refine_indicator = std::min (refine_indicator,
-                                    indicators(cell_index));
+        refine_indicator = std::min (refine_indicator,
+                                     indicators(cell_index));
       else if (cell->coarsen_flag_set())
-       coarsen_indicator = std::max (coarsen_indicator,
-                                     indicators(cell_index));
+        coarsen_indicator = std::max (coarsen_indicator,
+                                      indicators(cell_index));
     if (myid == 0)
       {
-       deallog << "thresholds = " << refine_indicator << ' '
-               << coarsen_indicator << std::endl;
+        deallog << "thresholds = " << refine_indicator << ' '
+                << coarsen_indicator << std::endl;
       }
 
     for (Triangulation<2>::active_cell_iterator
-          cell = tr.begin_active(); cell != tr.end(); ++cell)
+         cell = tr.begin_active(); cell != tr.end(); ++cell)
       {
-       cell->clear_coarsen_flag();
-       cell->clear_refine_flag();
+        cell->clear_coarsen_flag();
+        cell->clear_refine_flag();
       }
   }
 
index 27348e523ab803bb98847adf6e187b2156259a4c..3e5042bba099905117aff70cb1743b644e95c459 100644 (file)
@@ -50,19 +50,19 @@ void test()
 
   Vector<float> estimated_error_per_cell (triangulation.n_active_cells());
   parallel::distributed::GridRefinement::
-    refine_and_coarsen_fixed_number (triangulation,
-                                    estimated_error_per_cell,
-                                    0.3, 0.03);
+  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);
+  refine_and_coarsen_fixed_fraction (triangulation,
+                                     estimated_error_per_cell,
+                                     0.3, 0.03);
   triangulation.execute_coarsening_and_refinement ();
 
   if (myid==0)
-       deallog << "n_global_active_cells="
-       << triangulation.n_global_active_cells()
-       << std::endl;
+    deallog << "n_global_active_cells="
+            << triangulation.n_global_active_cells()
+            << std::endl;
 
   if (myid==0)
     deallog << "OK" << std::endl;
index b4c13345ff90a8e44ed0803d2a3ec1d5c99d601a..0e01673f671d74d05a3d0e9f370166e8727caf57 100644 (file)
@@ -57,13 +57,13 @@ void test()
   tr.refine_global (1);
   if (myid == 0)
     deallog << "refine_global(1) results in a total of " << counter
-           << std::endl;
+            << std::endl;
 
   counter = 0;
   tr.refine_global (3);
   if (myid == 0)
     deallog << "refine_global(3) results in a total of " << counter
-           << std::endl;
+            << std::endl;
 
 
   // now also find the bottom left corner of the domain and, on the processor
@@ -73,13 +73,13 @@ void test()
       counter = 0;
       Triangulation<2>::cell_iterator cell = tr.begin(0);
       while (cell->has_children())
-       cell = cell->child(0);
+        cell = cell->child(0);
       if (cell->is_locally_owned())
-       cell->set_refine_flag();
+        cell->set_refine_flag();
       tr.execute_coarsening_and_refinement ();
       if (myid == 0)
-       deallog << "local refinement results in a total of " << counter
-               << std::endl;
+        deallog << "local refinement results in a total of " << counter
+                << std::endl;
     }
 }
 
index 3bcc20332ff726877d34ca194d470c8813adcc7a..cc712d997ee4c920066dcde6991e646f09b9e55d 100644 (file)
@@ -49,9 +49,9 @@ void test()
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
 
   parallel::distributed::Triangulation<2>
-    tr(MPI_COMM_WORLD,
-       Triangulation<2>::MeshSmoothing(),
-       parallel::distributed::Triangulation<2>::mesh_reconstruction_after_repartitioning);
+  tr(MPI_COMM_WORLD,
+     Triangulation<2>::MeshSmoothing(),
+     parallel::distributed::Triangulation<2>::mesh_reconstruction_after_repartitioning);
   GridGenerator::hyper_cube(tr);
   tr.signals.post_refinement.connect (&listener);
 
@@ -60,13 +60,13 @@ void test()
   tr.refine_global (1);
   if (myid == 0)
     deallog << "refine_global(1) results in a total of " << counter
-           << std::endl;
+            << std::endl;
 
   counter = 0;
   tr.refine_global (3);
   if (myid == 0)
     deallog << "refine_global(3) results in a total of " << counter
-           << std::endl;
+            << std::endl;
 
 
   // now also find the bottom left corner of the domain and, on the processor
@@ -76,13 +76,13 @@ void test()
       counter = 0;
       Triangulation<2>::cell_iterator cell = tr.begin(0);
       while (cell->has_children())
-       cell = cell->child(0);
+        cell = cell->child(0);
       if (cell->is_locally_owned())
-       cell->set_refine_flag();
+        cell->set_refine_flag();
       tr.execute_coarsening_and_refinement ();
       if (myid == 0)
-       deallog << "local refinement results in a total of " << counter
-               << std::endl;
+        deallog << "local refinement results in a total of " << counter
+                << std::endl;
     }
 }
 
index 13eb7a86736547a73bfd7f564bbfb7c09bcd2d9c..55206cdbfd40817747e690f7ef7aa6a67a480d77 100644 (file)
@@ -74,7 +74,7 @@ void test()
   DoFRenumbering::hierarchical (dofh);
 
   if (myid == 0)
-      deallog << "n_global_active_cells: " << tr.n_global_active_cells() << std::endl;
+    deallog << "n_global_active_cells: " << tr.n_global_active_cells() << std::endl;
 
   TrilinosWrappers::MPI::Vector vector;
   vector.reinit (dofh.locally_owned_dofs(), MPI_COMM_WORLD);
@@ -91,7 +91,7 @@ void test()
 
     typename DoFHandler<dim>::active_cell_iterator
     cell = dofh.begin_active(),
-           endc = dofh.end();
+    endc = dofh.end();
     for (; cell != endc; ++cell)
       if (cell->subdomain_id() == tr.locally_owned_subdomain())
         {
index 350b5ea10ae135cee8051489cab225d13f5f9d1e..7875b8f9d23c2eb0c880e60f17fbcb4291c96318 100644 (file)
@@ -56,10 +56,10 @@ void test()
   parallel::distributed::Triangulation<dim> tr (MPI_COMM_WORLD);
 
   GridGenerator::hyper_shell (tr,
-                             Point<dim>(),
-                             0.3,
-                             1.0,
-                             12, true);
+                              Point<dim>(),
+                              0.3,
+                              1.0,
+                              12, true);
 //  GridGenerator::hyper_cube (tr, -1.0, 1.0);
   tr.refine_global (1);
 
@@ -81,7 +81,7 @@ void test()
   DoFRenumbering::hierarchical (dofh);
 
   if (myid == 0)
-      deallog << "n_global_active_cells: " << tr.n_global_active_cells() << std::endl;
+    deallog << "n_global_active_cells: " << tr.n_global_active_cells() << std::endl;
 
   TrilinosWrappers::MPI::Vector vector;
   vector.reinit (dofh.locally_owned_dofs(), MPI_COMM_WORLD);
@@ -98,7 +98,7 @@ void test()
 
     typename DoFHandler<dim>::active_cell_iterator
     cell = dofh.begin_active(),
-           endc = dofh.end();
+    endc = dofh.end();
     for (; cell != endc; ++cell)
       if (cell->subdomain_id() == tr.locally_owned_subdomain())
         {
index 53234caf2b4e4ed4d60e8a573cc97046e0f26fcb..c7e72409d4bffd7833b5be5782916a871ac16415 100644 (file)
@@ -37,24 +37,24 @@ void test_mpi()
   if (myid==0)
     deallog << "Running on " << numprocs << " CPU(s)." << std::endl;
 
-  for (unsigned int i=1;i<numprocs;++i)
+  for (unsigned int i=1; i<numprocs; ++i)
     {
       MPI_Barrier(MPI_COMM_WORLD);
 //      system("sleep 1");
 
       if (myid==0)
-       {
-         unsigned int buf=numbers::invalid_unsigned_int;
-         MPI_Status status;
-         MPI_Recv(&buf, 1, MPI_UNSIGNED, i, 1, MPI_COMM_WORLD, &status);
-         deallog << "got message '" << buf << "' from CPU " << i+1 << "!" << std::endl;
-         Assert(buf == i, ExcInternalError());
-
-       }
+        {
+          unsigned int buf=numbers::invalid_unsigned_int;
+          MPI_Status status;
+          MPI_Recv(&buf, 1, MPI_UNSIGNED, i, 1, MPI_COMM_WORLD, &status);
+          deallog << "got message '" << buf << "' from CPU " << i+1 << "!" << std::endl;
+          Assert(buf == i, ExcInternalError());
+
+        }
       else if (myid==i )
-       {
-         MPI_Send(&myid, 1, MPI_INT, 0, 1, MPI_COMM_WORLD);
-       }
+        {
+          MPI_Send(&myid, 1, MPI_INT, 0, 1, MPI_COMM_WORLD);
+        }
 
 
     }
index 580dd48fb9a5a083f61e3d27410e865fc11515f8..57373bb475a08ff1303e2d5bc82b37480c882c22 100644 (file)
@@ -53,9 +53,9 @@ template<int dim>
 void test()
 {
   parallel::distributed::Triangulation<2> tria(MPI_COMM_WORLD,
-                                              typename Triangulation<2>::MeshSmoothing
-                                              (Triangulation<2>::smoothing_on_refinement |
-                                               Triangulation<2>::smoothing_on_coarsening));
+                                               typename Triangulation<2>::MeshSmoothing
+                                               (Triangulation<2>::smoothing_on_refinement |
+                                                Triangulation<2>::smoothing_on_coarsening));
 
   GridGenerator::hyper_cube (tria,-1.0,1.0);
 
@@ -92,8 +92,8 @@ void test()
   solution.reinit(locally_owned_dofs, locally_relevant_dofs, MPI_COMM_WORLD);
   solution = tmp;
 
-                                  // make sure no processor is
-                                  // hanging
+  // make sure no processor is
+  // hanging
   MPI_Barrier (MPI_COMM_WORLD);
 
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
@@ -131,5 +131,5 @@ int main(int argc, char *argv[])
       test<3>();
     }
 
-  
+
 }
index 36ec30f6b1f454b897c1d992199680c4c0d271bf..20c6b32868262308d5e786d24b867c6a56e67d58 100644 (file)
@@ -74,13 +74,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;
   };
 
 
@@ -126,9 +126,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;
   };
 
 
@@ -172,9 +172,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;
   };
 
 
@@ -250,9 +250,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;
   };
 
 
@@ -365,9 +365,9 @@ namespace Step39
     const MappingQ1<dim>      mapping;
     const FiniteElement<dim> &fe;
     DoFHandler<dim>           dof_handler;
-    
+
     IndexSet locally_relevant_set;
-    
+
     TrilinosWrappers::SparseMatrix matrix;
     TrilinosWrappers::MPI::Vector       solution;
     TrilinosWrappers::MPI::Vector       right_hand_side;
@@ -401,7 +401,7 @@ namespace Step39
   {
     dof_handler.distribute_dofs(fe);
     dof_handler.distribute_mg_dofs (fe);
-    
+
     DoFTools::extract_locally_relevant_dofs (dof_handler, locally_relevant_set);
     solution.reinit(dof_handler.locally_owned_dofs(), MPI_COMM_WORLD);
     right_hand_side.reinit(dof_handler.locally_owned_dofs(), MPI_COMM_WORLD);
@@ -417,16 +417,16 @@ namespace Step39
     mg_matrix_dg_up.clear();
     mg_matrix_dg_down.resize(0, n_levels-1);
     mg_matrix_dg_down.clear();
-    
+
     for (unsigned int level=mg_matrix.min_level();
          level<=mg_matrix.max_level(); ++level)
       {
         CompressedSimpleSparsityPattern c_sparsity(dof_handler.n_dofs(level));
         MGTools::make_flux_sparsity_pattern(dof_handler, c_sparsity, level);
-       mg_matrix[level].reinit(dof_handler.locally_owned_mg_dofs(level),
-                               dof_handler.locally_owned_mg_dofs(level),
-                               c_sparsity,
-                               MPI_COMM_WORLD, true);
+        mg_matrix[level].reinit(dof_handler.locally_owned_mg_dofs(level),
+                                dof_handler.locally_owned_mg_dofs(level),
+                                c_sparsity,
+                                MPI_COMM_WORLD, true);
 
         if (level>0)
           {
@@ -434,14 +434,14 @@ namespace Step39
             ci_sparsity.reinit(dof_handler.n_dofs(level-1), dof_handler.n_dofs(level));
             MGTools::make_flux_sparsity_pattern_edge(dof_handler, ci_sparsity, level);
 
-           mg_matrix_dg_up[level].reinit(dof_handler.locally_owned_mg_dofs(level-1),
-                                         dof_handler.locally_owned_mg_dofs(level),
-                                         ci_sparsity,
-                                         MPI_COMM_WORLD, true);
-           mg_matrix_dg_down[level].reinit(dof_handler.locally_owned_mg_dofs(level-1),
-                                           dof_handler.locally_owned_mg_dofs(level),
-                                           ci_sparsity,
-                                           MPI_COMM_WORLD, true);
+            mg_matrix_dg_up[level].reinit(dof_handler.locally_owned_mg_dofs(level-1),
+                                          dof_handler.locally_owned_mg_dofs(level),
+                                          ci_sparsity,
+                                          MPI_COMM_WORLD, true);
+            mg_matrix_dg_down[level].reinit(dof_handler.locally_owned_mg_dofs(level-1),
+                                            dof_handler.locally_owned_mg_dofs(level),
+                                            ci_sparsity,
+                                            MPI_COMM_WORLD, true);
           }
       }
   }
@@ -460,18 +460,18 @@ namespace Step39
 
     MeshWorker::Assembler::MatrixSimple<TrilinosWrappers::SparseMatrix> assembler;
     assembler.initialize(matrix);
-    
+
     FilteredIterator<typename DoFHandler<dim>::active_cell_iterator>
-      begin(IteratorFilters::LocallyOwnedCell(), dof_handler.begin_active());
+    begin(IteratorFilters::LocallyOwnedCell(), dof_handler.begin_active());
     FilteredIterator<typename DoFHandler<dim>::active_cell_iterator>
-      end(IteratorFilters::LocallyOwnedCell(), dof_handler.end());
-    
+    end(IteratorFilters::LocallyOwnedCell(), dof_handler.end());
+
     MatrixIntegrator<dim> integrator;
     MeshWorker::integration_loop<dim, dim>(
       begin, end,
       dof_info, info_box,
       integrator, assembler);
-    
+
     matrix.compress(VectorOperation::add);
   }
 
@@ -490,26 +490,26 @@ namespace Step39
     MeshWorker::Assembler::MGMatrixSimple<TrilinosWrappers::SparseMatrix> assembler;
     assembler.initialize(mg_matrix);
     assembler.initialize_fluxes(mg_matrix_dg_up, mg_matrix_dg_down);
-    
+
     FilteredIterator<typename DoFHandler<dim>::level_cell_iterator>
-      begin(IteratorFilters::LocallyOwnedLevelCell(), dof_handler.begin());
+    begin(IteratorFilters::LocallyOwnedLevelCell(), dof_handler.begin());
     FilteredIterator<typename DoFHandler<dim>::level_cell_iterator>
-      end(IteratorFilters::LocallyOwnedLevelCell(), dof_handler.end());
+    end(IteratorFilters::LocallyOwnedLevelCell(), dof_handler.end());
 
     MatrixIntegrator<dim> integrator;
     MeshWorker::integration_loop<dim, dim> (
       begin, end,
       dof_info, info_box,
       integrator, assembler);
-    
-    for (unsigned int level=mg_matrix.min_level(); level <= mg_matrix.max_level();++level)
+
+    for (unsigned int level=mg_matrix.min_level(); level <= mg_matrix.max_level(); ++level)
       {
-       mg_matrix[level].compress(VectorOperation::add);
-       if (level > mg_matrix.min_level())
-         {
-           mg_matrix_dg_up[level].compress(VectorOperation::add);
-           mg_matrix_dg_down[level].compress(VectorOperation::add);
-         }
+        mg_matrix[level].compress(VectorOperation::add);
+        if (level > mg_matrix.min_level())
+          {
+            mg_matrix_dg_up[level].compress(VectorOperation::add);
+            mg_matrix_dg_down[level].compress(VectorOperation::add);
+          }
       }
   }
 
@@ -526,21 +526,21 @@ namespace Step39
     MeshWorker::DoFInfo<dim> dof_info(dof_handler);
 
     MeshWorker::Assembler::ResidualSimple<TrilinosWrappers::MPI::Vector> assembler;
-    NamedData<TrilinosWrappers::MPI::Vector*> data;
+    NamedData<TrilinosWrappers::MPI::Vector *> data;
     TrilinosWrappers::MPI::Vector *rhs = &right_hand_side;
     data.add(rhs, "RHS");
     assembler.initialize(data);
 
     FilteredIterator<typename DoFHandler<dim>::active_cell_iterator>
-      begin(IteratorFilters::LocallyOwnedCell(), dof_handler.begin_active());
+    begin(IteratorFilters::LocallyOwnedCell(), dof_handler.begin_active());
     FilteredIterator<typename DoFHandler<dim>::active_cell_iterator>
-      end(IteratorFilters::LocallyOwnedCell(), dof_handler.end());
-    
+    end(IteratorFilters::LocallyOwnedCell(), dof_handler.end());
+
 
     RHSIntegrator<dim> integrator;
     MeshWorker::integration_loop<dim, dim>(begin, end,
-      dof_info, info_box,
-      integrator, assembler);
+                                           dof_info, info_box,
+                                           integrator, assembler);
 
     right_hand_side.compress(VectorOperation::add);
     right_hand_side *= -1.;
@@ -562,7 +562,7 @@ namespace Step39
     PreconditionIdentity identity;
     TrilinosWrappers::SparseMatrix coarse_matrix = mg_matrix[0];
     MGCoarseGridLACIteration<SolverCG<TrilinosWrappers::MPI::Vector>,TrilinosWrappers::MPI::Vector>
-      coarse_grid_solver(coarse_solver, coarse_matrix, identity);
+    coarse_grid_solver(coarse_solver, coarse_matrix, identity);
 
     typedef TrilinosWrappers::PreconditionJacobi Smoother;
     MGSmootherPrecondition<TrilinosWrappers::SparseMatrix, Smoother, TrilinosWrappers::MPI::Vector> mg_smoother;
@@ -574,8 +574,8 @@ namespace Step39
     MGMatrix<TrilinosWrappers::SparseMatrix, TrilinosWrappers::MPI::Vector> mgup(&mg_matrix_dg_up);
 
     Multigrid<TrilinosWrappers::MPI::Vector > mg(dof_handler, mgmatrix,
-                                  coarse_grid_solver, mg_transfer,
-                                  mg_smoother, mg_smoother);
+                                                 coarse_grid_solver, mg_transfer,
+                                                 mg_smoother, mg_smoother);
     mg.set_edge_flux_matrices(mgdown, mgup);
 
     PreconditionMG<dim, TrilinosWrappers::MPI::Vector,
@@ -592,7 +592,7 @@ namespace Step39
     TrilinosWrappers::MPI::Vector ghost;
     ghost.reinit(locally_relevant_set, MPI_COMM_WORLD);
     ghost = solution;
-    
+
     std::vector<unsigned int> old_user_indices;
     triangulation.save_user_indices(old_user_indices);
 
@@ -606,7 +606,7 @@ namespace Step39
     const unsigned int n_gauss_points = dof_handler.get_fe().tensor_degree()+1;
     info_box.initialize_gauss_quadrature(n_gauss_points, n_gauss_points+1, n_gauss_points);
 
-    NamedData<TrilinosWrappers::MPI::Vector* > solution_data;
+    NamedData<TrilinosWrappers::MPI::Vector * > solution_data;
     solution_data.add(&ghost, "solution");
 
     info_box.cell_selector.add("solution", false, false, true);
@@ -623,17 +623,17 @@ namespace Step39
     BlockVector<double> *est = &estimates;
     out_data.add(est, "cells");
     assembler.initialize(out_data, false);
-    
+
     FilteredIterator<typename DoFHandler<dim>::active_cell_iterator>
-      begin(IteratorFilters::LocallyOwnedCell(), dof_handler.begin_active());
+    begin(IteratorFilters::LocallyOwnedCell(), dof_handler.begin_active());
     FilteredIterator<typename DoFHandler<dim>::active_cell_iterator>
-      end(IteratorFilters::LocallyOwnedCell(), dof_handler.end());
-    
+    end(IteratorFilters::LocallyOwnedCell(), dof_handler.end());
+
     Estimator<dim> integrator;
     MeshWorker::integration_loop<dim, dim> (
-                                           begin, end,
-                                           dof_info, info_box,
-                                           integrator, assembler);
+      begin, end,
+      dof_info, info_box,
+      integrator, assembler);
 
     triangulation.load_user_indices(old_user_indices);
     return estimates.block(0).l2_norm();
@@ -691,20 +691,20 @@ namespace Step39
   // {
   //   char *fn = new char[100];
   //   sprintf(fn, "step-39/sol-%02d", cycle);
-    
+
   //   std::string filename(fn);
   //   filename += ".gnuplot";
   //   deallog << "Writing solution to <" << filename << ">..."
   //           << std::endl << std::endl;
   //   std::ofstream gnuplot_output (filename.c_str());
-    
+
   //   DataOut<dim> data_out;
   //   data_out.attach_dof_handler (dof_handler);
   //   data_out.add_data_vector (solution, "u");
   //   data_out.add_data_vector (estimates.block(0), "est");
-    
+
   //   data_out.build_patches ();
-    
+
   //   data_out.write_gnuplot(gnuplot_output);
   // }
 
@@ -718,13 +718,13 @@ namespace Step39
         deallog << "Step " << s << std::endl;
         if (estimates.block(0).size() == 0)
           triangulation.refine_global(1);
-       else
-        {
-         parallel::distributed::GridRefinement::refine_and_coarsen_fixed_fraction (triangulation,
-                                                                                   estimates.block(0),
-                                                                                   0.5, 0.0);
-         triangulation.execute_coarsening_and_refinement ();
-        }
+        else
+          {
+            parallel::distributed::GridRefinement::refine_and_coarsen_fixed_fraction (triangulation,
+                estimates.block(0),
+                0.5, 0.0);
+            triangulation.execute_coarsening_and_refinement ();
+          }
 
         deallog << "Triangulation "
                 << triangulation.n_active_cells() << " cells, "
@@ -744,7 +744,7 @@ namespace Step39
         assemble_right_hand_side();
         deallog << "Solve" << std::endl;
         solve();
-       //error();
+        //error();
         deallog << "Estimate " << estimate() << std::endl;
         //output_results(s);
       }
@@ -757,10 +757,10 @@ int main(int argc, char *argv[])
 {
   dealii::Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv);
   mpi_initlog(__FILE__, true);
-    
+
   using namespace dealii;
   using namespace Step39;
-  
+
   try
     {
       FE_DGQ<2> fe1(2);
index 591bb657c67b83359d1707862dccd3e02744222e..634545427fd6a61451cd8335e34b2ee6b4dc8857 100644 (file)
@@ -62,35 +62,35 @@ namespace Step40
   template <int dim>
   class LaplaceProblem
   {
-    public:
-      LaplaceProblem ();
-      ~LaplaceProblem ();
+  public:
+    LaplaceProblem ();
+    ~LaplaceProblem ();
 
-      void run ();
+    void run ();
 
-    private:
-      void setup_system ();
-      void assemble_system ();
-      void solve ();
-      void refine_grid ();
+  private:
+    void setup_system ();
+    void assemble_system ();
+    void solve ();
+    void refine_grid ();
 
-      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;
+    PETScWrappers::MPI::SparseMatrix system_matrix;
+    PETScWrappers::MPI::Vector locally_relevant_solution;
+    PETScWrappers::MPI::Vector system_rhs;
 
-      ConditionalOStream                pcout;
+    ConditionalOStream                pcout;
   };
 
 
@@ -98,22 +98,22 @@ namespace Step40
 
   template <int dim>
   LaplaceProblem<dim>::LaplaceProblem ()
-                  :
-                  mpi_communicator (MPI_COMM_WORLD),
-                  triangulation (mpi_communicator,
-                                 typename Triangulation<dim>::MeshSmoothing
-                                 (Triangulation<dim>::smoothing_on_refinement |
-                                  Triangulation<dim>::smoothing_on_coarsening)),
-                  dof_handler (triangulation),
-                  fe (2),
-                  pcout (Utilities::MPI::this_mpi_process(mpi_communicator)
-                          == 0
-                        ?
-                        deallog.get_file_stream()
-                        :
-                        std::cout,
-                         (Utilities::MPI::this_mpi_process(mpi_communicator)
-                          == 0))
+    :
+    mpi_communicator (MPI_COMM_WORLD),
+    triangulation (mpi_communicator,
+                   typename Triangulation<dim>::MeshSmoothing
+                   (Triangulation<dim>::smoothing_on_refinement |
+                    Triangulation<dim>::smoothing_on_coarsening)),
+    dof_handler (triangulation),
+    fe (2),
+    pcout (Utilities::MPI::this_mpi_process(mpi_communicator)
+           == 0
+           ?
+           deallog.get_file_stream()
+           :
+           std::cout,
+           (Utilities::MPI::this_mpi_process(mpi_communicator)
+            == 0))
   {}
 
 
@@ -137,7 +137,7 @@ namespace Step40
 
     locally_relevant_solution.reinit (locally_owned_dofs,
                                       locally_relevant_dofs,
-                                     mpi_communicator);
+                                      mpi_communicator);
     system_rhs.reinit (locally_owned_dofs, mpi_communicator);
     system_rhs = 0;
 
@@ -189,8 +189,8 @@ namespace Step40
     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();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     for (; cell!=endc; ++cell)
       if (cell->is_locally_owned())
         {
@@ -202,7 +202,7 @@ namespace Step40
           for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
             {
               const double
-                rhs_value
+              rhs_value
                 = (fe_values.quadrature_point(q_point)[1]
                    >
                    0.5+0.25*std::sin(4.0 * numbers::PI *
@@ -241,17 +241,17 @@ namespace Step40
   void LaplaceProblem<dim>::solve ()
   {
     PETScWrappers::MPI::Vector
-      completely_distributed_solution (mpi_communicator,
-                                       dof_handler.n_dofs(),
-                                       dof_handler.n_locally_owned_dofs());
+    completely_distributed_solution (mpi_communicator,
+                                     dof_handler.n_dofs(),
+                                     dof_handler.n_locally_owned_dofs());
 
     SolverControl solver_control (dof_handler.n_dofs(), 1e-12);
 
     PETScWrappers::SolverCG solver(solver_control, mpi_communicator);
 
     PETScWrappers::PreconditionBoomerAMG
-      preconditioner(system_matrix,
-                     PETScWrappers::PreconditionBoomerAMG::AdditionalData(true));
+    preconditioner(system_matrix,
+                   PETScWrappers::PreconditionBoomerAMG::AdditionalData(true));
 
     solver.solve (system_matrix, completely_distributed_solution, system_rhs,
                   preconditioner);
@@ -297,20 +297,20 @@ namespace Step40
         pcout << "   Number of active cells:       "
               << triangulation.n_global_active_cells()
               << std::endl
-             << "      ";
-       for (unsigned int i=0; i<Utilities::MPI::n_mpi_processes(mpi_communicator); ++i)
-         pcout << triangulation.n_locally_owned_active_cells_per_processor()[i]
-               << '+';
-       pcout << std::endl;
+              << "      ";
+        for (unsigned int i=0; i<Utilities::MPI::n_mpi_processes(mpi_communicator); ++i)
+          pcout << triangulation.n_locally_owned_active_cells_per_processor()[i]
+                << '+';
+        pcout << std::endl;
 
-       pcout << "   Number of degrees of freedom: "
+        pcout << "   Number of degrees of freedom: "
               << dof_handler.n_dofs()
               << std::endl
-             << "      ";
-       for (unsigned int i=0; i<Utilities::MPI::n_mpi_processes(mpi_communicator); ++i)
-         pcout << dof_handler.n_locally_owned_dofs_per_processor()[i]
-               << '+';
-       pcout << std::endl;
+              << "      ";
+        for (unsigned int i=0; i<Utilities::MPI::n_mpi_processes(mpi_communicator); ++i)
+          pcout << dof_handler.n_locally_owned_dofs_per_processor()[i]
+                << '+';
+        pcout << std::endl;
 
         assemble_system ();
         solve ();
index 28f53629181c2e3c7f7273a77b2593e2220b7b50..db5f417ac95f72d29bfe778fa2e66549383e9a76 100644 (file)
@@ -62,35 +62,35 @@ namespace Step40
   template <int dim>
   class LaplaceProblem
   {
-    public:
-      LaplaceProblem ();
-      ~LaplaceProblem ();
+  public:
+    LaplaceProblem ();
+    ~LaplaceProblem ();
 
-      void run ();
+    void run ();
 
-    private:
-      void setup_system ();
-      void assemble_system ();
-      void solve ();
-      void refine_grid ();
+  private:
+    void setup_system ();
+    void assemble_system ();
+    void solve ();
+    void refine_grid ();
 
-      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;
+    PETScWrappers::MPI::SparseMatrix system_matrix;
+    PETScWrappers::MPI::Vector locally_relevant_solution;
+    PETScWrappers::MPI::Vector system_rhs;
 
-      ConditionalOStream                pcout;
+    ConditionalOStream                pcout;
   };
 
 
@@ -98,22 +98,22 @@ namespace Step40
 
   template <int dim>
   LaplaceProblem<dim>::LaplaceProblem ()
-                  :
-                  mpi_communicator (MPI_COMM_WORLD),
-                  triangulation (mpi_communicator,
-                                 typename Triangulation<dim>::MeshSmoothing
-                                 (Triangulation<dim>::smoothing_on_refinement |
-                                  Triangulation<dim>::smoothing_on_coarsening)),
-                  dof_handler (triangulation),
-                  fe (2),
-                  pcout (Utilities::MPI::this_mpi_process(mpi_communicator)
-                          == 0
-                        ?
-                        deallog.get_file_stream()
-                        :
-                        std::cout,
-                         (Utilities::MPI::this_mpi_process(mpi_communicator)
-                          == 0))
+    :
+    mpi_communicator (MPI_COMM_WORLD),
+    triangulation (mpi_communicator,
+                   typename Triangulation<dim>::MeshSmoothing
+                   (Triangulation<dim>::smoothing_on_refinement |
+                    Triangulation<dim>::smoothing_on_coarsening)),
+    dof_handler (triangulation),
+    fe (2),
+    pcout (Utilities::MPI::this_mpi_process(mpi_communicator)
+           == 0
+           ?
+           deallog.get_file_stream()
+           :
+           std::cout,
+           (Utilities::MPI::this_mpi_process(mpi_communicator)
+            == 0))
   {}
 
 
@@ -137,7 +137,7 @@ namespace Step40
 
     locally_relevant_solution.reinit (locally_owned_dofs,
                                       locally_relevant_dofs,
-                                     mpi_communicator);
+                                      mpi_communicator);
     system_rhs.reinit (locally_owned_dofs, mpi_communicator);
     system_rhs = 0;
 
@@ -189,8 +189,8 @@ namespace Step40
     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();
+    cell = dof_handler.begin_active(),
+    endc = dof_handler.end();
     for (; cell!=endc; ++cell)
       if (cell->is_locally_owned())
         {
@@ -202,7 +202,7 @@ namespace Step40
           for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
             {
               const double
-                rhs_value
+              rhs_value
                 = (fe_values.quadrature_point(q_point)[1]
                    >
                    0.5+0.25*std::sin(4.0 * numbers::PI *
@@ -241,9 +241,9 @@ namespace Step40
   void LaplaceProblem<dim>::solve ()
   {
     PETScWrappers::MPI::Vector
-      completely_distributed_solution (mpi_communicator,
-                                       dof_handler.n_dofs(),
-                                       dof_handler.n_locally_owned_dofs());
+    completely_distributed_solution (mpi_communicator,
+                                     dof_handler.n_dofs(),
+                                     dof_handler.n_locally_owned_dofs());
 
     SolverControl solver_control (dof_handler.n_dofs(), 1e-12);
     PETScWrappers::SparseDirectMUMPS solver(solver_control, mpi_communicator);
@@ -291,20 +291,20 @@ namespace Step40
         pcout << "   Number of active cells:       "
               << triangulation.n_global_active_cells()
               << std::endl
-             << "      ";
-       for (unsigned int i=0; i<Utilities::MPI::n_mpi_processes(mpi_communicator); ++i)
-         pcout << triangulation.n_locally_owned_active_cells_per_processor()[i]
-               << '+';
-       pcout << std::endl;
+              << "      ";
+        for (unsigned int i=0; i<Utilities::MPI::n_mpi_processes(mpi_communicator); ++i)
+          pcout << triangulation.n_locally_owned_active_cells_per_processor()[i]
+                << '+';
+        pcout << std::endl;
 
-       pcout << "   Number of degrees of freedom: "
+        pcout << "   Number of degrees of freedom: "
               << dof_handler.n_dofs()
               << std::endl
-             << "      ";
-       for (unsigned int i=0; i<Utilities::MPI::n_mpi_processes(mpi_communicator); ++i)
-         pcout << dof_handler.n_locally_owned_dofs_per_processor()[i]
-               << '+';
-       pcout << std::endl;
+              << "      ";
+        for (unsigned int i=0; i<Utilities::MPI::n_mpi_processes(mpi_communicator); ++i)
+          pcout << dof_handler.n_locally_owned_dofs_per_processor()[i]
+                << '+';
+        pcout << std::endl;
 
         assemble_system ();
         solve ();
index 014a4eade94ecdfe3718e58b4c15a96d0a1d6939..874706492391a3c84eeb1a96b8c0b610a194f693 100644 (file)
@@ -381,7 +381,7 @@ namespace Step48
 
 
 
-int main (int argc, char ** argv)
+int main (int argc, char **argv)
 {
   Utilities::System::MPI_InitFinalize mpi_initialization(argc, argv);
 
index 94d7ee52e8b33e1f1dd64977b941a84ae8a6cb8b..82fa9e680c40d325a369dd80728510fd352d5478 100644 (file)
@@ -46,28 +46,28 @@ void test()
   tr.refine_global(1);
   if (myid == 0)
     deallog << "#cells = " << tr.n_global_active_cells() << std::endl;
-  
+
   deallog << "proc " << myid << ", n levels " << tr.n_levels() << std::endl;
   deallog << "proc " << myid << ", n gobal levels " << tr.n_global_levels() << std::endl;
-  
+
   deallog << "begin().cell_index " << tr.begin()->index() << std::endl;
   deallog << "begin(0).cell_index " << tr.begin(0)->index() << std::endl;
-  
+
   deallog << "begin(1)==end(1)? " << (tr.begin(1)==tr.end(1)) << std::endl;
 
-  
+
   deallog << "subdomainid = "
-         << tr.begin_active()->subdomain_id()
-         << std::endl;
+          << tr.begin_active()->subdomain_id()
+          << std::endl;
 
   //if (myid!=0)
-    //   Assert(tr.begin(1)==tr.end(1), ExcInternalError());  
-  
+  //   Assert(tr.begin(1)==tr.end(1), ExcInternalError());
+
   const unsigned int checksum = tr.get_checksum ();
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     deallog << "Checksum: "
-           << checksum
-           << std::endl;
+            << checksum
+            << std::endl;
 
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     deallog << "OK" << std::endl;
@@ -78,7 +78,7 @@ int main(int argc, char *argv[])
 {
   Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
   MPILogInitAll log(__FILE__);
-  
+
   deallog.push("2d");
   test<2>();
   deallog.pop();
index 537e765d75e161fccb3fd0d89c2e5e504db0b6d8..b74be93aeef4e4232f91c541de0ea7d8c07b0c9d 100644 (file)
@@ -35,8 +35,8 @@ void test ()
   if (myid==0) deallog << "numproc=" << numproc << std::endl;
 
 
-                                  // each processor owns 2 indices and all
-                                   // are ghosting element 1 (the second)
+  // each processor owns 2 indices and all
+  // are ghosting element 1 (the second)
   IndexSet local_active(numproc*2);
   local_active.add_range(myid*2,myid*2+2);
   IndexSet local_relevant(numproc*2);
@@ -46,7 +46,7 @@ void test ()
   TrilinosWrappers::MPI::Vector v(local_active, MPI_COMM_WORLD);
   TrilinosWrappers::MPI::Vector v_tmp(local_relevant, MPI_COMM_WORLD);
 
-                                  // only one CPU checks has_ghost_elements()
+  // only one CPU checks has_ghost_elements()
   MPI_Barrier(MPI_COMM_WORLD);
   if (myid==0)
     {
@@ -58,25 +58,25 @@ void test ()
   if (myid==1)
     {
       MPI_Status status;
-      MPI_Request request;     
+      MPI_Request request;
       int flag=0;
       int tests=0;
-      
+
       while (!flag && tests<10)
-       {
-         tests++;
-         MPI_Iprobe(0, 12345, MPI_COMM_WORLD, &flag, &status);
-         std::cout << flag << std::endl;
-         
-         sleep(1);
-       }
-      
+        {
+          tests++;
+          MPI_Iprobe(0, 12345, MPI_COMM_WORLD, &flag, &status);
+          std::cout << flag << std::endl;
+
+          sleep(1);
+        }
+
       Assert(flag!=0, ExcMessage("hang in has_ghost_elements()"));
     }
-  
+
 
   MPI_Barrier(MPI_COMM_WORLD);
-  
+
   deallog << v_tmp.has_ghost_elements() << std::endl;
 
   if (myid==0)
index e225de9e22575ccb3ffe678c75e8d3f3686d2373..be9c781cb9b45255c8f4fe07a266b4e2d624cdde 100644 (file)
@@ -26,7 +26,7 @@
 #include <iostream>
 #include <vector>
 
-void check(TrilinosWrappers::MPI::Vector & v, bool ghost)
+void check(TrilinosWrappers::MPI::Vector &v, bool ghost)
 {
   Assert(v.has_ghost_elements()==ghost, ExcMessage("wrong ghost elements"));
 }
index a26dcf860f38e6633338709f7434d8bda90e5339..8d3348cb22798a02115c97f23031f08626bdb4ff 100644 (file)
@@ -40,7 +40,7 @@ void test ()
   Epetra_FEVector x1(Map);
   x1.PutScalar (0);
 
-                               // let all processors set global entry 0 to 1
+  // let all processors set global entry 0 to 1
   const int GID = 0;
   const double value = 1;
   x1.ReplaceGlobalValues(1, &GID, &value);
@@ -48,16 +48,16 @@ void test ()
   if (Comm.MyPID()==0)
     Assert (x1[0][0] == 1, ExcInternalError());
 
-                               // copy vector
+  // copy vector
   Epetra_FEVector x2 (x1);
 
   x2.PutScalar(0);
 
-                               // re-apply 1 to the vector, but only on the
-                               // owning processor. should be enough to set
-                               // the value (as non-local data in x1 should
-                               // be been eliminated after calling
-                               // GlobalAssemble).
+  // re-apply 1 to the vector, but only on the
+  // owning processor. should be enough to set
+  // the value (as non-local data in x1 should
+  // be been eliminated after calling
+  // GlobalAssemble).
   if (Comm.MyPID()==0)
     x2.ReplaceGlobalValues(1, &GID, &value);
   x2.GlobalAssemble (Insert);
index 80d2c1f619b7357643ecedd1fe2501e4f1d9f469..a61af3604386189bb82c72982f8fd5a810e94ba0 100644 (file)
@@ -43,23 +43,23 @@ void test ()
     locally_owned.add_range(0,9);
   else
     locally_owned.add_range(9,21);
-// 
+//
   TrilinosWrappers::MPI::Vector test1(locally_owned);
   if (myid==0)
-  {
-    types::global_dof_index idx[]={0,1,2,3,4,5,6,7,8};
-    double val[]={0,1,2,3,4,5,6,7,8};
-    test1.add(9,idx,val);
-  }
+    {
+      types::global_dof_index idx[]= {0,1,2,3,4,5,6,7,8};
+      double val[]= {0,1,2,3,4,5,6,7,8};
+      test1.add(9,idx,val);
+    }
   else
-  {
-   {
-    types::global_dof_index idx[]={1,9,3,10,5,11,12,13,14};
-    double val[]={1,9,3,10,5,11,12,13,14};
-    test1.add(9,idx,val);
+    {
+      {
+        types::global_dof_index idx[]= {1,9,3,10,5,11,12,13,14};
+        double val[]= {1,9,3,10,5,11,12,13,14};
+        test1.add(9,idx,val);
+      }
     }
-  }
-  
+
   test1.compress(VectorOperation::add);
 
   //TrilinosWrappers::MPI::Vector test(test1.vector_partitioner()); // works
@@ -69,21 +69,21 @@ void test ()
   test = 0;
 
   if (myid==0)
-    test(locally_owned.nth_index_in_set(5))=7;  
+    test(locally_owned.nth_index_in_set(5))=7;
 
   if (myid==0)
     deallog << "before compress: " << test(locally_owned.nth_index_in_set(5)) << endl;
-      
+
   test.compress(VectorOperation::insert);
-  
+
   if (myid==0)
     deallog << "after compress: " << test(locally_owned.nth_index_in_set(5)) << endl;
-      
-  // Trilinos produces a 0 instead of a 7 here. Why? 
+
+  // Trilinos produces a 0 instead of a 7 here. Why?
   if (myid==0)
-  {
-    Assert(test(locally_owned.nth_index_in_set(5)) == 7, ExcInternalError());
-  }
+    {
+      Assert(test(locally_owned.nth_index_in_set(5)) == 7, ExcInternalError());
+    }
 
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     deallog << "OK" << std::endl;
index 25b8927250e8550300275df8017cf4da9fd39679..69b688a02c1783f9afea736e9a25bdf2dded4532 100644 (file)
@@ -70,7 +70,7 @@ void test()
   // owned range by 50 on each side
   IndexSet locally_relevant_range (vec.size());
   locally_relevant_range.add_range (std::max<int> (100*myid-50, 0),
-                                   std::min (static_cast<types::global_dof_index>(100*myid+150), vec.size()));
+                                    std::min (static_cast<types::global_dof_index>(100*myid+150), vec.size()));
   ConstraintMatrix cm (locally_relevant_range);
 
   // add constraints that constrain an element in the middle of the
@@ -83,20 +83,20 @@ void test()
   for (unsigned int p=0; p<n_processes; ++p)
     {
       if ((p != 0) && locally_relevant_range.is_element (p*100+10))
-       {
-         cm.add_line (p*100+10);
-         cm.add_entry (p*100+10,
-                       p*100-25,
-                       1);
-       }
+        {
+          cm.add_line (p*100+10);
+          cm.add_entry (p*100+10,
+                        p*100-25,
+                        1);
+        }
 
       if ((p != n_processes-1) && locally_relevant_range.is_element (p*100+90))
-       {
-         cm.add_line (p*100+90);
-         cm.add_entry (p*100+90,
-                       p*100+105,
-                       1);
-       }
+        {
+          cm.add_line (p*100+90);
+          cm.add_entry (p*100+90,
+                        p*100+105,
+                        1);
+        }
     }
   cm.close ();
 
@@ -106,21 +106,21 @@ void test()
   // verify correctness
   if (myid != 0)
     Assert (vec(vec.local_range().first+10) == vec.local_range().first-25,
-           ExcInternalError());
+            ExcInternalError());
 
   if (myid != n_processes-1)
     Assert (vec(vec.local_range().first+90) == vec.local_range().first+105,
-           ExcInternalError());
+            ExcInternalError());
 
   for (unsigned int i=vec.local_range().first; i<vec.local_range().second; ++i)
     {
       if ((i != vec.local_range().first+10)
-         &&
-         (i != vec.local_range().first+90))
-       {
-         double val = vec(i);
-         Assert (std::fabs(val - i) <= 1e-6, ExcInternalError());
-       }
+          &&
+          (i != vec.local_range().first+90))
+        {
+          double val = vec(i);
+          Assert (std::fabs(val - i) <= 1e-6, ExcInternalError());
+        }
     }
 
   {
@@ -133,10 +133,10 @@ void test()
     // but then correct for the constrained values
     for (unsigned int p=0; p<n_processes; ++p)
       {
-       if (p != 0)
-         exact_l1 = exact_l1 - (p*100+10) + (p*100-25);
-       if (p != n_processes-1)
-         exact_l1 = exact_l1 - (p*100+90) + (p*100+105);
+        if (p != 0)
+          exact_l1 = exact_l1 - (p*100+10) + (p*100-25);
+        if (p != n_processes-1)
+          exact_l1 = exact_l1 - (p*100+90) + (p*100+105);
       }
 
     const double l1_norm = vec.l1_norm();
index 631a817e1721640e829acbb44df96e5d1aec7ecb..25f6c6420c4f31e7503e8f99f189482349ab8274 100644 (file)
@@ -72,9 +72,9 @@ void test()
   // owned range by 50 on each side
   IndexSet locally_relevant_range (vec.size());
   locally_relevant_range.add_range (std::max<int> (100*myid-50, 0),
-                                   std::min (static_cast<types::global_dof_index>(100*myid+150), vec.block(0).size()));
+                                    std::min (static_cast<types::global_dof_index>(100*myid+150), vec.block(0).size()));
   locally_relevant_range.add_range (vec.block(0).size()+std::max<int> (100*myid-50, 0),
-                                   vec.block(0).size()+std::min (static_cast<types::global_dof_index>(100*myid+150), vec.block(0).size()));
+                                    vec.block(0).size()+std::min (static_cast<types::global_dof_index>(100*myid+150), vec.block(0).size()));
   ConstraintMatrix cm (locally_relevant_range);
 
   // add constraints that constrain an element in the middle of the
@@ -87,28 +87,28 @@ void test()
   for (unsigned int p=0; p<n_processes; ++p)
     {
       if ((p != 0) && locally_relevant_range.is_element (p*100+10))
-       {
-         cm.add_line (p*100+10);
-         cm.add_entry (p*100+10,
-                       p*100-25,
-                       1);
-         cm.add_line (vec.block(0).size()+p*100+10);
-         cm.add_entry (vec.block(0).size()+p*100+10,
-                       vec.block(0).size()+p*100-25,
-                       1);
-       }
+        {
+          cm.add_line (p*100+10);
+          cm.add_entry (p*100+10,
+                        p*100-25,
+                        1);
+          cm.add_line (vec.block(0).size()+p*100+10);
+          cm.add_entry (vec.block(0).size()+p*100+10,
+                        vec.block(0).size()+p*100-25,
+                        1);
+        }
 
       if ((p != n_processes-1) && locally_relevant_range.is_element (p*100+90))
-       {
-         cm.add_line (p*100+90);
-         cm.add_entry (p*100+90,
-                       p*100+105,
-                       1);
-         cm.add_line (vec.block(0).size()+p*100+90);
-         cm.add_entry (vec.block(0).size()+p*100+90,
-                       vec.block(0).size()+p*100+105,
-                       1);
-       }
+        {
+          cm.add_line (p*100+90);
+          cm.add_entry (p*100+90,
+                        p*100+105,
+                        1);
+          cm.add_line (vec.block(0).size()+p*100+90);
+          cm.add_entry (vec.block(0).size()+p*100+90,
+                        vec.block(0).size()+p*100+105,
+                        1);
+        }
     }
   cm.close ();
 
@@ -118,40 +118,40 @@ void test()
   // verify correctness
   if (myid != 0)
     Assert (vec(vec.block(0).local_range().first+10) == vec.block(0).local_range().first-25,
-           ExcInternalError());
+            ExcInternalError());
 
   if (myid != n_processes-1)
     Assert (vec(vec.block(0).local_range().first+90) == vec.block(0).local_range().first+105,
-           ExcInternalError());
+            ExcInternalError());
 
   if (myid != 0)
     Assert (vec(vec.block(0).size()+vec.block(1).local_range().first+10) == vec.block(1).local_range().first-25,
-           ExcInternalError());
+            ExcInternalError());
 
   if (myid != n_processes-1)
     Assert (vec(vec.block(0).size()+vec.block(1).local_range().first+90) == vec.block(1).local_range().first+105,
-           ExcInternalError());
+            ExcInternalError());
+
 
-  
   for (unsigned int i=vec.block(0).local_range().first; i<vec.block(0).local_range().second; ++i)
     {
       if ((i != vec.block(0).local_range().first+10)
-         &&
-         (i != vec.block(0).local_range().first+90))
-       {
-         double val = vec.block(0)(i);
-         Assert (std::fabs(val - i) <= 1e-6, ExcInternalError());
-       }
+          &&
+          (i != vec.block(0).local_range().first+90))
+        {
+          double val = vec.block(0)(i);
+          Assert (std::fabs(val - i) <= 1e-6, ExcInternalError());
+        }
     }
   for (unsigned int i=vec.block(1).local_range().first; i<vec.block(1).local_range().second; ++i)
     {
       if ((i != vec.block(1).local_range().first+10)
-         &&
-         (i != vec.block(1).local_range().first+90))
-       {
-         double val = vec.block(1)(i);
-         Assert (std::fabs(val - i) <= 1e-6, ExcInternalError());
-       }
+          &&
+          (i != vec.block(1).local_range().first+90))
+        {
+          double val = vec.block(1)(i);
+          Assert (std::fabs(val - i) <= 1e-6, ExcInternalError());
+        }
     }
 
   {
@@ -164,10 +164,10 @@ void test()
     // but then correct for the constrained values
     for (unsigned int p=0; p<n_processes; ++p)
       {
-       if (p != 0)
-         exact_l1 = exact_l1 - (p*100+10) + (p*100-25);
-       if (p != n_processes-1)
-         exact_l1 = exact_l1 - (p*100+90) + (p*100+105);
+        if (p != 0)
+          exact_l1 = exact_l1 - (p*100+10) + (p*100-25);
+        if (p != n_processes-1)
+          exact_l1 = exact_l1 - (p*100+90) + (p*100+105);
       }
 
     const double l1_norm = vec.l1_norm();
index 933f9f09151b1c430ea6ec2c5bda89bfca00b9f4..ae48e7350a02a66256544a194f6928e0ba78cc3c 100644 (file)
@@ -62,7 +62,7 @@ void test()
   // owned range by 50 on each side
   IndexSet locally_relevant_range (vec.size());
   locally_relevant_range.add_range (std::max<int> (100*myid-50, 0),
-                                   std::min (static_cast<types::global_dof_index>(100*myid+150), vec.size()));
+                                    std::min (static_cast<types::global_dof_index>(100*myid+150), vec.size()));
   ConstraintMatrix cm (locally_relevant_range);
 
   // add constraints that constrain an element in the middle of the
@@ -75,22 +75,22 @@ void test()
   for (unsigned int p=0; p<n_processes; ++p)
     {
       if ((p != 0) && locally_relevant_range.is_element (p*100+10))
-       {
-         cm.add_line (p*100+10);
-         cm.add_entry (p*100+10,
-                       p*100-25,
-                       1);
-         cm.set_inhomogeneity (p*100+10, 1);
-       }
+        {
+          cm.add_line (p*100+10);
+          cm.add_entry (p*100+10,
+                        p*100-25,
+                        1);
+          cm.set_inhomogeneity (p*100+10, 1);
+        }
 
       if ((p != n_processes-1) && locally_relevant_range.is_element (p*100+90))
-       {
-         cm.add_line (p*100+90);
-         cm.add_entry (p*100+90,
-                       p*100+105,
-                       1);
-         cm.set_inhomogeneity (p*100+90, -1);
-       }
+        {
+          cm.add_line (p*100+90);
+          cm.add_entry (p*100+90,
+                        p*100+105,
+                        1);
+          cm.set_inhomogeneity (p*100+90, -1);
+        }
     }
   cm.close ();
 
@@ -100,21 +100,21 @@ void test()
   // verify correctness
   if (myid != 0)
     Assert (vec(vec.local_range().first+10) == vec.local_range().first-25+1,
-           ExcInternalError());
+            ExcInternalError());
 
   if (myid != n_processes-1)
     Assert (vec(vec.local_range().first+90) == vec.local_range().first+105-1,
-           ExcInternalError());
+            ExcInternalError());
 
   for (unsigned int i=vec.local_range().first; i<vec.local_range().second; ++i)
     {
       if ((i != vec.local_range().first+10)
-         &&
-         (i != vec.local_range().first+90))
-       {
-         double val = vec(i);
-         Assert (std::fabs(val - i) <= 1e-6, ExcInternalError());
-       }
+          &&
+          (i != vec.local_range().first+90))
+        {
+          double val = vec(i);
+          Assert (std::fabs(val - i) <= 1e-6, ExcInternalError());
+        }
     }
 
   {
@@ -127,10 +127,10 @@ void test()
     // but then correct for the constrained values
     for (unsigned int p=0; p<n_processes; ++p)
       {
-       if (p != 0)
-         exact_l1 = exact_l1 - (p*100+10) + (p*100-25);
-       if (p != n_processes-1)
-         exact_l1 = exact_l1 - (p*100+90) + (p*100+105);
+        if (p != 0)
+          exact_l1 = exact_l1 - (p*100+10) + (p*100-25);
+        if (p != n_processes-1)
+          exact_l1 = exact_l1 - (p*100+90) + (p*100+105);
       }
 
     const double l1_norm = vec.l1_norm();
index 401bb0de0fa0aa60187810fb90c7e9b434e79183..2ccf07d7a5f3b5e45e201cb24148828099f8b70b 100644 (file)
@@ -39,7 +39,7 @@ void test()
   IndexSet idx(100);
   if (myid==0)
     idx.add_range(0,100);
-  
+
   TrilinosWrappers::MPI::Vector vec (idx, MPI_COMM_WORLD);
 
   for (unsigned int i=vec.local_range().first; i<vec.local_range().second; ++i)
index e882231d8f98e283f749b37608d92fbcf990f54e..214a6414d67cbf6f53e2cdfac4bb9359ee9284f1 100644 (file)
 --------------------------------------------------------
 An error occurred in line <1028> of file </scratch/deal-trunk/deal.II/include/deal.II/lac/constraint_matrix.templates.h> in function
     void dealii::ConstraintMatrix::distribute(VectorType&) const [with VectorType = dealii::TrilinosWrappers::MPI::Vector]
-The violated condition was: 
+The violated condition was:
     vec(it->line) == it->entries.size()
 The name and call sequence of the exception was:
     ExcIncorrectConstraint(it->line, it->entries.size())
-Additional Information: 
+Additional Information:
 While distributing the constraint for DoF 41, it turns out that one of the processors who own the 2 degrees of freedom that x_41 is constrained against does not know about the constraint on x_41. Did you not initialize the ConstraintMatrix with the appropriate locally_relevant set so that every processor who owns a DoF that constrains another DoF also knows about this constraint?
 --------------------------------------------------------
 
@@ -64,12 +64,14 @@ void test()
   if (myid==0)
     {
       typename Triangulation<dim>::active_cell_iterator it = tr.begin_active();
-      ++it;++it;++it;
-      for (unsigned int i=0;i<5;++i)
-       {
-         it->set_refine_flag();
-         ++it;   
-       }
+      ++it;
+      ++it;
+      ++it;
+      for (unsigned int i=0; i<5; ++i)
+        {
+          it->set_refine_flag();
+          ++it;
+        }
     }
   tr.execute_coarsening_and_refinement();
 
@@ -79,8 +81,8 @@ void test()
 
   IndexSet locally_relevant_set;
   DoFTools::extract_locally_relevant_dofs (dofh,
-                                          locally_relevant_set);
-  
+                                           locally_relevant_set);
+
   ConstraintMatrix cm;
   cm.reinit (locally_relevant_set);
   DoFTools::make_hanging_node_constraints (dofh, cm);
@@ -89,11 +91,11 @@ void test()
   ZeroFunction<dim>                    homogeneous_dirichlet_bc (1);
   dirichlet_boundary[0] = &homogeneous_dirichlet_bc;
   VectorTools::interpolate_boundary_values (dofh,
-                                           dirichlet_boundary,
-                                           cm);
-  
+                                            dirichlet_boundary,
+                                            cm);
+
   cm.close();
-  
+
   TrilinosWrappers::MPI::Vector vec (dofh.locally_owned_dofs(), MPI_COMM_WORLD);
   for (unsigned int i=vec.local_range().first; i<vec.local_range().second; ++i)
     vec(i) = i;
@@ -108,7 +110,7 @@ void test()
       deallog <<"constraint_matrix:" << std::endl;
       cm.print(deallog.get_file_stream());
     }
-  
+
   cm.distribute (vec);
 
   if (myid == 0)
index 3189bddc5ae4b8bf52466cad26526e9367717283..59236559d1cec4f50ef8263cc57b85bea6ab6ded 100644 (file)
@@ -36,8 +36,8 @@ void test ()
   if (myid==0) deallog << "numproc=" << numproc << std::endl;
 
 
-                                  // each processor owns 2 indices and all
-                                   // are ghosting element 1 (the second)
+  // each processor owns 2 indices and all
+  // are ghosting element 1 (the second)
   IndexSet local_active(numproc*2);
   local_active.add_range(myid*2,myid*2+2);
   IndexSet local_relevant(numproc*2);
@@ -47,7 +47,7 @@ void test ()
   TrilinosWrappers::MPI::Vector v(local_active, MPI_COMM_WORLD);
   TrilinosWrappers::MPI::Vector v_tmp(local_relevant, MPI_COMM_WORLD);
 
-                                     // set local values
+  // set local values
   v(myid*2)=myid*2.0;
   v(myid*2+1)=myid*2.0+1.0;
 
@@ -65,7 +65,7 @@ void test ()
 
   v_tmp.reinit(v,false,true);
 
-                                  // check ghost values
+  // check ghost values
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     deallog << "ghost: " << v_tmp(1) << std::endl;
   Assert(v_tmp(1) == 2.0, ExcInternalError());
index 4fa124e464c5c7946f4124b267e5e05f4eade4af..0d62ca2ee2d159339272e1c266656a6594c71c1b 100644 (file)
 
 // check correct behaviour of Trilinos ghosted vectors
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/base/index_set.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -35,8 +35,8 @@ void test ()
   if (myid==0) deallog << "numproc=" << numproc << std::endl;
 
 
-                                  // each processor owns 2 indices and all
-                                   // are ghosting element 1 (the second)
+  // each processor owns 2 indices and all
+  // are ghosting element 1 (the second)
   IndexSet local_active(numproc*2);
   local_active.add_range(myid*2,myid*2+2);
   IndexSet local_relevant(numproc*2);
@@ -45,22 +45,22 @@ void test ()
 
   TrilinosWrappers::MPI::Vector v(local_active, MPI_COMM_WORLD);
   TrilinosWrappers::MPI::Vector v_tmp(local_relevant, MPI_COMM_WORLD);
-  
 
-  
-                                     // set local values
+
+
+  // set local values
   v(myid*2)=myid*2.0;
   v(myid*2+1)=myid*2.0+1.0;
 
   v.compress(VectorOperation::insert);
 
-                                 // assignment with transfer to ghost 
+  // assignment with transfer to ghost
   v_tmp = v;
-                                  // check ghost values
+  // check ghost values
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     deallog << "ghost: " << v_tmp(1) << std::endl;
   Assert(v_tmp(1) == 1.0, ExcInternalError());
-  
+
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     deallog << "OK" << std::endl;
 }
index d6183daf16ff6b4a03a74b92c7cbc91a16452f8b..7a9118e4c6ed55756da90dd16c9f2a796051a647 100644 (file)
 // check correct behaviour of Trilinos ghosted vectors.  The
 // test now checks that v.l2_norm() and v(idx)=... is disabled.
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/base/index_set.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -36,8 +36,8 @@ void test ()
   if (myid==0) deallog << "numproc=" << numproc << std::endl;
 
 
-                                  // each processor owns 2 indices and all
-                                   // are ghosting element 1 (the second)
+  // each processor owns 2 indices and all
+  // are ghosting element 1 (the second)
   IndexSet local_active(numproc*2);
   local_active.add_range(myid*2,myid*2+2);
   IndexSet local_relevant(numproc*2);
@@ -46,9 +46,9 @@ void test ()
 
   TrilinosWrappers::MPI::Vector v(local_active, MPI_COMM_WORLD);
   TrilinosWrappers::MPI::Vector v_tmp(local_relevant, MPI_COMM_WORLD);
-  
 
-                                     // set local values
+
+  // set local values
   v(myid*2)=1.0;
   v(myid*2+1)=1.0;
 
@@ -74,7 +74,7 @@ void test ()
     {
       deallog << e.get_exc_name() << std::endl;
     }
-  
+
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     deallog << "OK" << std::endl;
 }
index e1a8b861bfc59a6675ea5c7ca6523992260f9dd4..ae7158f223a4e7c65aa41b8b41d8621cbd6aec18 100644 (file)
 // while computing the l2norm on ghosted vectors is unsafe, computing
 // the linfty norm should be ok. test this
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/base/index_set.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -36,8 +36,8 @@ void test ()
   if (myid==0) deallog << "numproc=" << numproc << std::endl;
 
 
-                                  // each processor owns 2 indices and all
-                                   // are ghosting element 1 (the second)
+  // each processor owns 2 indices and all
+  // are ghosting element 1 (the second)
   IndexSet local_active(numproc*2);
   local_active.add_range(myid*2,myid*2+2);
   IndexSet local_relevant(numproc*2);
@@ -46,9 +46,9 @@ void test ()
 
   TrilinosWrappers::MPI::Vector v(local_active, MPI_COMM_WORLD);
   TrilinosWrappers::MPI::Vector v_tmp(local_relevant, MPI_COMM_WORLD);
-  
 
-                                     // set local values
+
+  // set local values
   v(myid*2)=myid*2;
   v(myid*2+1)=myid*2+1;
 
@@ -67,10 +67,10 @@ void test ()
       deallog << e.get_exc_name() << std::endl;
       exc = true;
     }
-  
+
   Assert (exc == false, ExcInternalError());
   Assert (norm == 2.*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)-1,
-         ExcInternalError());
+          ExcInternalError());
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     {
       deallog << norm << std::endl;
index 6b357c272951f7868f299e0fc45b55a62dc6f534..32e294ccd83ac057305f59d800c0eb549906ada6 100644 (file)
 // check correct behaviour of Trilinos ghosted vectors
 // check if assignment from a normal vector works correctly and updates the ghost values
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/base/index_set.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -38,8 +38,8 @@ void test ()
 
   unsigned int ghostel=(numproc>1)?2:1;
 
-                                  // each processor owns 2 indices and all
-                                   // are ghosting one element
+  // each processor owns 2 indices and all
+  // are ghosting one element
   IndexSet local_active(numproc*2);
   local_active.add_range(myid*2,myid*2+2);
   IndexSet local_relevant(numproc*2);
@@ -49,11 +49,11 @@ void test ()
   TrilinosWrappers::MPI::Vector x(local_active, MPI_COMM_WORLD);
   TrilinosWrappers::MPI::Vector v(local_relevant, MPI_COMM_WORLD);
 
-                                     // set local values
+  // set local values
   x(myid*2)=myid*2.0;
   x(myid*2+1)=myid*2.0+1.0;
 
-                                  // transfer to ghosted vector v and check
+  // transfer to ghosted vector v and check
   x.compress(VectorOperation::insert);
   v=x;
 
@@ -61,10 +61,10 @@ void test ()
   Assert(v(myid*2+1) == myid*2.0+1.0, ExcInternalError());
   Assert(v(ghostel) == ghostel, ExcInternalError());
 
-                                  // change x, transfer, and check again
+  // change x, transfer, and check again
   x*=2.0;
   v=x;
-  
+
   Assert(v(myid*2) == myid*4.0, ExcInternalError());
   Assert(v(myid*2+1) == myid*4.0+2.0, ExcInternalError());
   Assert(v(ghostel) == 2.0*ghostel, ExcInternalError());
@@ -74,7 +74,7 @@ void test ()
       deallog << myid*2 << ":" << v(myid*2) << std::endl;
       deallog << myid*2+1 << ":" << v(myid*2+1) << std::endl;
     }
-  
+
   if (myid == 0)
     deallog << "OK" << std::endl;
 }
index 8473ec1faab55e8472ca7901339a68bf6be832aa..38e43cb345c6ac983df4b121c699d7df004ce99c 100644 (file)
@@ -49,25 +49,25 @@ void test ()
     }
   else if (n_procs == 2)
     {
-                                      // row_partitioning should be { [0, 2), [2, n_rows) }
-                                      // col_partitioning should be { [0, 2), [2, n_cols) }
-                                      // col_relevant_set should be { [0, 3), [1, n_cols) }
+      // row_partitioning should be { [0, 2), [2, n_rows) }
+      // col_partitioning should be { [0, 2), [2, n_cols) }
+      // col_relevant_set should be { [0, 3), [1, n_cols) }
       if (my_id == 0)
-       {
-         row_partitioning.add_range(0, 2);
-         col_partitioning.add_range(0, 2);
-       }
+        {
+          row_partitioning.add_range(0, 2);
+          col_partitioning.add_range(0, 2);
+        }
       else if (my_id == 1)
-       {
-         row_partitioning.add_range(2, n_rows);
-         col_partitioning.add_range(2, n_cols);
-       }
+        {
+          row_partitioning.add_range(2, n_rows);
+          col_partitioning.add_range(2, n_cols);
+        }
     }
   else
     Assert (false, ExcNotImplemented());
 
   TrilinosWrappers::SparsityPattern sp (row_partitioning,
-                                       col_partitioning, MPI_COMM_WORLD);
+                                        col_partitioning, MPI_COMM_WORLD);
   if (my_id == 0)
     {
       sp.add (0, 0);
@@ -94,8 +94,8 @@ void test ()
   y.reinit (row_partitioning, MPI_COMM_WORLD);
 
   parallel::distributed::Vector<double>
-    dx (col_partitioning, col_partitioning, MPI_COMM_WORLD),
-    dy (row_partitioning, row_partitioning, MPI_COMM_WORLD);
+  dx (col_partitioning, col_partitioning, MPI_COMM_WORLD),
+  dy (row_partitioning, row_partitioning, MPI_COMM_WORLD);
 
   for (unsigned int i=0; i<col_partitioning.n_elements(); ++i)
     {
@@ -108,8 +108,8 @@ void test ()
   A.vmult (y, x);
   A.vmult (dy, dx);
 
-                               // compare whether we got the same result
-                               // (should be no roundoff difference)
+  // compare whether we got the same result
+  // (should be no roundoff difference)
   for (unsigned int i=0; i<row_partitioning.n_elements(); ++i)
     {
       const unsigned int global_index = row_partitioning.nth_index_in_set(i);
index ac31f545a03990421405db79139eb739f33833cf..3b91ef83adad956bf53e279b100a05fdfd1b4bf6 100644 (file)
@@ -49,25 +49,25 @@ void test ()
     }
   else if (n_procs == 2)
     {
-                                      // row_partitioning should be { [0, 2), [2, n_rows) }
-                                      // col_partitioning should be { [0, 2), [2, n_cols) }
-                                      // col_relevant_set should be { [0, 3), [1, n_cols) }
+      // row_partitioning should be { [0, 2), [2, n_rows) }
+      // col_partitioning should be { [0, 2), [2, n_cols) }
+      // col_relevant_set should be { [0, 3), [1, n_cols) }
       if (my_id == 0)
-       {
-         row_partitioning.add_range(0, 2);
-         col_partitioning.add_range(0, 2);
-       }
+        {
+          row_partitioning.add_range(0, 2);
+          col_partitioning.add_range(0, 2);
+        }
       else if (my_id == 1)
-       {
-         row_partitioning.add_range(2, n_rows);
-         col_partitioning.add_range(2, n_cols);
-       }
+        {
+          row_partitioning.add_range(2, n_rows);
+          col_partitioning.add_range(2, n_cols);
+        }
     }
   else
     Assert (false, ExcNotImplemented());
 
   TrilinosWrappers::SparsityPattern sp (row_partitioning,
-                                       col_partitioning, MPI_COMM_WORLD);
+                                        col_partitioning, MPI_COMM_WORLD);
   if (my_id == 0)
     {
       sp.add (0, 0);
@@ -94,8 +94,8 @@ void test ()
   y.reinit (row_partitioning, MPI_COMM_WORLD);
 
   parallel::distributed::Vector<double>
-    dx (col_partitioning, col_partitioning, MPI_COMM_WORLD),
-    dy (row_partitioning, row_partitioning, MPI_COMM_WORLD);
+  dx (col_partitioning, col_partitioning, MPI_COMM_WORLD),
+  dy (row_partitioning, row_partitioning, MPI_COMM_WORLD);
 
   for (unsigned int i=0; i<row_partitioning.n_elements(); ++i)
     {
@@ -108,8 +108,8 @@ void test ()
   A.Tvmult (x, y);
   A.Tvmult (dx, dy);
 
-                               // compare whether we got the same result
-                               // (should be no roundoff difference)
+  // compare whether we got the same result
+  // (should be no roundoff difference)
   for (unsigned int i=0; i<col_partitioning.n_elements(); ++i)
     {
       const unsigned int global_index = col_partitioning.nth_index_in_set(i);
index 95fbef428fce54152bbd83c6801fe282d6746a70..2df37d5176a0749e0408deae7000bef3038db59a 100644 (file)
@@ -54,16 +54,16 @@ void test ()
       // col_partitioning should be { [0, 2), [2, n_cols) }
       // col_relevant_set should be { [0, 3), [1, n_cols) }
       if (my_id == 0)
-       {
-         row_partitioning.add_range(0, n_rows);
-         col_partitioning.add_range(0, n_cols);
-       }
+        {
+          row_partitioning.add_range(0, n_rows);
+          col_partitioning.add_range(0, n_cols);
+        }
     }
   else
     Assert (false, ExcNotImplemented());
 
   TrilinosWrappers::SparsityPattern sp (row_partitioning,
-                                       col_partitioning, MPI_COMM_WORLD);
+                                        col_partitioning, MPI_COMM_WORLD);
   if (my_id == 0)
     {
       sp.add (0, 0);
@@ -88,8 +88,8 @@ void test ()
   y.reinit (row_partitioning, MPI_COMM_WORLD);
 
   parallel::distributed::Vector<double>
-    dx (col_partitioning, col_partitioning, MPI_COMM_WORLD),
-    dy (row_partitioning, row_partitioning, MPI_COMM_WORLD);
+  dx (col_partitioning, col_partitioning, MPI_COMM_WORLD),
+  dy (row_partitioning, row_partitioning, MPI_COMM_WORLD);
 
   for (unsigned int i=0; i<col_partitioning.n_elements(); ++i)
     {
@@ -102,8 +102,8 @@ void test ()
   A.vmult (y, x);
   A.vmult (dy, dx);
 
-                               // compare whether we got the same result
-                               // (should be no roundoff difference)
+  // compare whether we got the same result
+  // (should be no roundoff difference)
   for (unsigned int i=0; i<row_partitioning.n_elements(); ++i)
     {
       const unsigned int global_index = row_partitioning.nth_index_in_set(i);
@@ -113,8 +113,8 @@ void test ()
   A.vmult_add (y, x);
   A.vmult_add (dy, dx);
 
-                               // compare whether we got the same result
-                               // (should be no roundoff difference)
+  // compare whether we got the same result
+  // (should be no roundoff difference)
   for (unsigned int i=0; i<row_partitioning.n_elements(); ++i)
     {
       const unsigned int global_index = row_partitioning.nth_index_in_set(i);
index 4967404753a8724769692f24ce12874fd3c13cbb..f11130bc84c76f6c598651ea660920e20623022d 100644 (file)
@@ -49,25 +49,25 @@ void test ()
     }
   else if (n_procs == 2)
     {
-                                      // row_partitioning should be { [0, 2), [2, n_rows) }
-                                      // col_partitioning should be { [0, 2), [2, n_cols) }
-                                      // col_relevant_set should be { [0, 3), [1, n_cols) }
+      // row_partitioning should be { [0, 2), [2, n_rows) }
+      // col_partitioning should be { [0, 2), [2, n_cols) }
+      // col_relevant_set should be { [0, 3), [1, n_cols) }
       if (my_id == 0)
-       {
-         row_partitioning.add_range(0, 2);
-         col_partitioning.add_range(0, 2);
-       }
+        {
+          row_partitioning.add_range(0, 2);
+          col_partitioning.add_range(0, 2);
+        }
       else if (my_id == 1)
-       {
-         row_partitioning.add_range(2, n_rows);
-         col_partitioning.add_range(2, n_cols);
-       }
+        {
+          row_partitioning.add_range(2, n_rows);
+          col_partitioning.add_range(2, n_cols);
+        }
     }
   else
     Assert (false, ExcNotImplemented());
 
   TrilinosWrappers::SparsityPattern sp (row_partitioning,
-                                       col_partitioning, MPI_COMM_WORLD);
+                                        col_partitioning, MPI_COMM_WORLD);
   if (my_id == 0)
     {
       sp.add (0, 0);
@@ -89,10 +89,10 @@ void test ()
       A.set(0, 0, 0.1);
       A.set(0, 2, 0.2);
       A.set(2,3, 0.3);
-    }  
+    }
 
   A.compress(VectorOperation::insert);
-  
+
   if (my_id == 0)
     {
       //A.add (0, 0, 1.33);
@@ -100,23 +100,24 @@ void test ()
     }
   if ((n_procs == 1) || (my_id == 1))
     A.add(0,0, 1.67);
-    //A.begin()->value() += 1.67; // crashes
-  
+  //A.begin()->value() += 1.67; // crashes
+
   A.compress(VectorOperation::add);
 
   if (my_id==0)
     {
       deallog << "A(0,0)=" << A(0,0) << std::endl;
     }
-  
-    if (my_id == 0) deallog << "OK" << std::endl;
+
+
+  if (my_id == 0) deallog << "OK" << std::endl;
 }
 
 
 
 int main (int argc, char **argv)
-{  Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv);
+{
+  Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv);
 
   const unsigned int n_procs = Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD);
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
index 40bf1691e12ccdd8ce9b286a97c8f1df1d7b72de..f6deedddfba20e0ecad8307fd5362c529c5d1bcc 100644 (file)
@@ -47,24 +47,24 @@ void test ()
   else if (n_procs == 2)
     {
       if (my_id == 0)
-       {
-         row_partitioning.add_range(0, 1);
-         col_partitioning.add_range(0, 1);
-       }
+        {
+          row_partitioning.add_range(0, 1);
+          col_partitioning.add_range(0, 1);
+        }
       else if (my_id == 1)
-       {
-         row_partitioning.add_range(1, n_rows);
-         col_partitioning.add_range(1, n_cols);
-       }
+        {
+          row_partitioning.add_range(1, n_rows);
+          col_partitioning.add_range(1, n_cols);
+        }
     }
   else
     Assert (false, ExcNotImplemented());
 
-                                  /* A is
+  /* A is
 
-                                     0     1
-                                     0     1
-                                  */
+     0     1
+     0     1
+  */
   const unsigned int n_entries = 2;
   const unsigned int line [n_entries] = {0, 1};
   const unsigned int local_index [n_entries] = {1, 1};
@@ -98,47 +98,47 @@ void test ()
   TrilinosWrappers::SparseMatrix AtA;
   A.Tmmult (AtA, A);
 
-                                  /* AtA should be
+  /* AtA should be
 
-                                     0     0
-                                     0     2
-                                  */
+     0     0
+     0     2
+  */
 
-                                  // checking AtA row partitioning
+  // checking AtA row partitioning
   if (n_procs == 2)
     {
       if (my_id == 0)
-       {
-         Assert(AtA.local_range().first == 0,
-                ExcMessage("AtA Local Range is not as expected."));
-         Assert(AtA.local_range().second == 1,
-                ExcMessage("AtA Local Range is not as expected."));
-       }
+        {
+          Assert(AtA.local_range().first == 0,
+                 ExcMessage("AtA Local Range is not as expected."));
+          Assert(AtA.local_range().second == 1,
+                 ExcMessage("AtA Local Range is not as expected."));
+        }
       if (my_id == 1)
-       {
-         Assert(AtA.local_range().first == 1,
-                ExcMessage("AtA Local Range is not as expected."));
-         Assert(AtA.local_range().second == 2,
-                ExcMessage("AtA Local Range is not as expected."));
-       }
+        {
+          Assert(AtA.local_range().first == 1,
+                 ExcMessage("AtA Local Range is not as expected."));
+          Assert(AtA.local_range().second == 2,
+                 ExcMessage("AtA Local Range is not as expected."));
+        }
     }
 
-                                  // checking AtA elements. note that
-                                  // the el() function either returns
-                                  // the correct value, or zero in
-                                  // case the element is stored on
-                                  // other processors. consequently,
-                                  // in the following we only test
-                                  // that the values that *must* be
-                                  // zero in AtA are indeed zero, but
-                                  // not that the others have the
-                                  // correct value
+  // checking AtA elements. note that
+  // the el() function either returns
+  // the correct value, or zero in
+  // case the element is stored on
+  // other processors. consequently,
+  // in the following we only test
+  // that the values that *must* be
+  // zero in AtA are indeed zero, but
+  // not that the others have the
+  // correct value
   Assert(AtA.el(0, 0) == 0, ExcMessage("Wrong element in AtA!"));
   Assert(AtA.el(0, 1) == 0, ExcMessage("Wrong element in AtA!"));
   Assert(AtA.el(1, 0) == 0, ExcMessage("Wrong element in AtA!"));
 
-                                  // now also check the one nonzero
-                                  // element
+  // now also check the one nonzero
+  // element
   if ((n_procs == 1) || (my_id == 1))
     Assert(AtA.el(1, 1) == 2, ExcMessage("Wrong element in AtA!"));
 
index 0acc2188ccede76168ac9b9ef334c173c3b7b52d..712493ccf046ec80a4b83fc1fc6b5ee2225eeaee 100644 (file)
@@ -46,25 +46,25 @@ void test ()
     }
   else if (n_procs == 2)
     {
-                                      // row_partitioning should be { [0, 2), [2, n_rows) }
-                                      // col_partitioning should be { [0, 2), [2, n_cols) }
-                                      // col_relevant_set should be { [0, 3), [1, n_cols) }
+      // row_partitioning should be { [0, 2), [2, n_rows) }
+      // col_partitioning should be { [0, 2), [2, n_cols) }
+      // col_relevant_set should be { [0, 3), [1, n_cols) }
       if (my_id == 0)
-       {
-         row_partitioning.add_range(0, 2);
-         col_partitioning.add_range(0, 2);
-       }
+        {
+          row_partitioning.add_range(0, 2);
+          col_partitioning.add_range(0, 2);
+        }
       else if (my_id == 1)
-       {
-         row_partitioning.add_range(2, n_rows);
-         col_partitioning.add_range(2, n_cols);
-       }
+        {
+          row_partitioning.add_range(2, n_rows);
+          col_partitioning.add_range(2, n_cols);
+        }
     }
   else
     Assert (false, ExcNotImplemented());
 
   TrilinosWrappers::SparsityPattern sp (row_partitioning,
-                                       col_partitioning, MPI_COMM_WORLD);
+                                        col_partitioning, MPI_COMM_WORLD);
   if ((n_procs == 1) || (my_id == 1))
     sp.add(2,3);
   sp.compress();
@@ -90,8 +90,8 @@ int main (int argc, char **argv)
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
   deallog.push(Utilities::int_to_string(myid));
 
-                                  // let processor 1 speak if we run
-                                  // in parallel
+  // let processor 1 speak if we run
+  // in parallel
   if ((n_procs == 1) || (myid == 1))
     {
       std::ofstream logfile(output_file_for_mpi("trilinos_sparse_matrix_print_01").c_str());
index c3398266c5719730daa5fec910bba1a7b3360dcb..0b5a1f3110002f43ce184fddd25d5738f21fea3f 100644 (file)
@@ -57,9 +57,9 @@ void test()
   dofh.distribute_dofs (fe);
 
   TrilinosWrappers::MPI::Vector interpolated(dofh.locally_owned_dofs(),
-                                            MPI_COMM_WORLD);
+                                             MPI_COMM_WORLD);
   Assert (interpolated.has_ghost_elements() == false,
-         ExcInternalError());
+          ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
index 4f07554d6c86292f6c7b4357ba16e91926a2ffc4..cb10089551394c5782f5c3fda1849ac192fbfa59 100644 (file)
@@ -38,21 +38,21 @@ void test ()
   TrilinosWrappers::MPI::Vector test1, test2;
 
   Assert (test1.vector_partitioner().SameAs(test2.vector_partitioner()),
-         ExcInternalError());
+          ExcInternalError());
 
-                                  // first processor owns 2 indices, second
-                                  // processor owns none
+  // first processor owns 2 indices, second
+  // processor owns none
   IndexSet local_owned(2);
   if (myid == 0)
     local_owned.add_range (0,2);
 
   test1.reinit (local_owned, MPI_COMM_WORLD);
 
-                               // reinit Trilinos vector from other vector
+  // reinit Trilinos vector from other vector
   test2.reinit (test1, true);
 
   Assert (test1.vector_partitioner().SameAs(test2.vector_partitioner()),
-         ExcInternalError());
+          ExcInternalError());
 
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     deallog << "OK" << std::endl;
index 7989dca9e3c35947f9bb47745b001db231343743..2dad33fa8a743ee98bc7546e634b4c8bc99c07b0 100644 (file)
 
 using namespace std;
 
-void log_vector (const std::vector<std::set<types::global_dof_index> >count)
+void log_vector (const std::vector<std::set<types::global_dof_index> > &count)
 {
-  for (unsigned int l=0;l<count.size();++l)
+  for (unsigned int l=0; l<count.size(); ++l)
     {
       deallog << "Level " << l << ':';
       for (std::set<types::global_dof_index>::const_iterator c=count[l].begin();
-          c != count[l].end();++c)
-       deallog << ' ' << *c;
+           c != count[l].end(); ++c)
+        deallog << ' ' << *c;
       deallog << std::endl;
     }
 }
 
 
 template <int dim>
-void check_fe(FiniteElement<dim>fe)
+void check_fe(FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
-  
+
   Triangulation<dim> tr;
   GridGenerator::hyper_cube(tr);
   tr.refine_global(2);
   ZeroFunction<dim> zero;
   typename FunctionMap<dim>::type fmap;
   fmap.insert(std::make_pair(0, &zero));
-  
+
   MGDoFHandler<dim> mgdof(tr);
   mgdof.distribute_dofs(fe);
-  
+
   std::vector<std::set<types::global_dof_index> > boundary_indices(tr.n_levels());
   MGTools::make_boundary_list(mgdof, fmap, boundary_indices);
   log_vector(boundary_indices);
@@ -82,7 +82,7 @@ void check()
   FE_Q<dim> q1(1);
   FE_Q<dim> q2(2);
 //  FE_DGQ<dim> dq1(1);
-  
+
   FESystem<dim> s1(q1, 2, q2,1);
 
   check_fe(q1);
index 34fc171ac6461bc56ec068a20b663bbbfffcb89d..26207cba697bdd9ed8cc48d35d40865521f21603 100644 (file)
 
 using namespace std;
 
-void log_vector (const std::vector<std::vector<types::global_dof_index> >count)
+void log_vector (const std::vector<std::vector<types::global_dof_index> > &count)
 {
-  for (unsigned int l=0;l<count.size();++l)
+  for (unsigned int l=0; l<count.size(); ++l)
     {
       deallog << "Level " << l;
-      for (unsigned int c=0;c<count[l].size();++c)
-       deallog << '\t' << count[l][c];
+      for (unsigned int c=0; c<count[l].size(); ++c)
+        deallog << '\t' << count[l][c];
       deallog << std::endl;
     }
 }
 
 template <int dim>
-void check_fe(FiniteElement<dim>fe)
+void check_fe(FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
-  
+
   Triangulation<dim> tr;
   GridGenerator::hyper_cube(tr);
   tr.refine_global(1);
   tr.begin_active()->set_refine_flag();
   tr.execute_coarsening_and_refinement ();
   tr.refine_global(1);
-  
+
   MGDoFHandler<dim> mgdof(tr);
   mgdof.distribute_dofs(fe);
-  
+
   std::vector<std::vector<types::global_dof_index> > count(tr.n_levels());
   MGTools::count_dofs_per_component(mgdof, count, false);
   log_vector(count);
@@ -72,18 +72,18 @@ void check_fe(FiniteElement<dim>& fe)
   log_vector(count);
 
   std::vector<unsigned int> target(fe.n_components());
-  for (unsigned int i=0;i<target.size();++i)
+  for (unsigned int i=0; i<target.size(); ++i)
     target[i] = i/3;
   deallog << std::endl << "Target";
-  for (unsigned int i=0;i<target.size();++i)
+  for (unsigned int i=0; i<target.size(); ++i)
     deallog << '\t' << target[i];
   deallog << std::endl;
-  
+
   MGTools::count_dofs_per_component(mgdof, count, false, target);
   log_vector(count);
   MGTools::count_dofs_per_component(mgdof, count, true, target);
   log_vector(count);
-  
+
 }
 
 
@@ -93,7 +93,7 @@ void check()
   FE_Q<dim> q1(1);
   FE_Q<dim> q2(2);
   FE_DGQ<dim> dq1(1);
-  
+
   FESystem<dim> s1(q1, 2, q2,1);
 
   check_fe(s1);
@@ -102,7 +102,7 @@ void check()
       FE_RaviartThomas<dim> rt(1);
       FESystem<dim> s2(rt, 2, dq1,1);
       FESystem<dim> s3(rt,1, s1, 2);
-      
+
       check_fe(s2);
       check_fe(s3);
     }
index aca97c0ebf6c4f4a3451e977403f957c1ac32ea4..d8a2c7f66ff92b6a9176de9df3f7f56b5e557dac 100644 (file)
@@ -41,50 +41,50 @@ class MGAll
   public MGTransferBase<VECTOR>,
   public MGCoarseGridBase<VECTOR>
 {
-  public:
-    virtual ~MGAll()
-      {}
-    
-    virtual void smooth (const unsigned int,
-                        VECTOR &, const VECTOR &) const
-      {}
-
-    virtual void prolongate (const unsigned int,
-                            VECTOR &, const VECTOR &) const
-      {}
-    
-    virtual void restrict_and_add (const unsigned int,
-                                  VECTOR &, const VECTOR &) const
-      {}
-
-    virtual void clear () 
-      {}
-    
-    virtual void operator() (const unsigned int,
-                            VECTOR &, const VECTOR &) const
-      {}
+public:
+  virtual ~MGAll()
+  {}
+
+  virtual void smooth (const unsigned int,
+                       VECTOR &, const VECTOR &) const
+  {}
+
+  virtual void prolongate (const unsigned int,
+                           VECTOR &, const VECTOR &) const
+  {}
+
+  virtual void restrict_and_add (const unsigned int,
+                                 VECTOR &, const VECTOR &) const
+  {}
+
+  virtual void clear ()
+  {}
+
+  virtual void operator() (const unsigned int,
+                           VECTOR &, const VECTOR &) const
+  {}
 };
 
 void test_cycles(unsigned int minlevel, unsigned int maxlevel)
 {
   MGAll all;
   MGLevelObject<FullMatrix<double> > level_matrices(0, maxlevel);
-  for (unsigned int i=0;i<=maxlevel;++i)
+  for (unsigned int i=0; i<=maxlevel; ++i)
     level_matrices[i].reinit(N, N);
   MGMatrix<FullMatrix<double>, VECTOR> mgmatrix(&level_matrices);
-  
+
   Multigrid<VECTOR> mg1(minlevel, maxlevel, mgmatrix, all, all, all, all,
-                       Multigrid<VECTOR>::v_cycle);
+                        Multigrid<VECTOR>::v_cycle);
   mg1.set_debug(3);
-  for (unsigned int i=minlevel;i<=maxlevel;++i)
+  for (unsigned int i=minlevel; i<=maxlevel; ++i)
     mg1.defect[i].reinit(N);
   mg1.cycle();
   deallog << std::endl;
-  
+
   mg1.set_cycle(Multigrid<VECTOR>::w_cycle);
   mg1.cycle();
   deallog << std::endl;
-  
+
   mg1.set_cycle(Multigrid<VECTOR>::f_cycle);
   mg1.cycle();
 }
@@ -95,7 +95,7 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   test_cycles (0,4);
   test_cycles (2,5);
 }
index a5e975fac088c6b3df8538f438b4812ce013b282..804c0cc6becd8c1eec346a49f72c3ca95c9c9a13 100644 (file)
@@ -44,41 +44,41 @@ using namespace std;
 
 
 template <int dim>
-void dofs(const MGDoFHandler<dim>dof)
+void dofs(const MGDoFHandler<dim> &dof)
 {
   typename MGDoFHandler<dim>::cell_iterator cell;
   const typename MGDoFHandler<dim>::cell_iterator end = dof.end();
 
   std::vector<types::global_dof_index> indices;
-  
+
   for (cell = dof.begin(); cell != end; ++cell)
     {
       indices.resize(cell->get_fe().dofs_per_cell);
       cell->get_mg_dof_indices(indices);
-      
+
       deallog << "Level " << cell->level();
-      for (unsigned int i=0;i<GeometryInfo<dim>::vertices_per_cell;++i)
-       deallog << " v" << cell->vertex(i);
+      for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
+        deallog << " v" << cell->vertex(i);
       deallog << " dofs ";
-      for (unsigned int i=0;i<indices.size();++i)
-       deallog << ' ' << indices[i];
+      for (unsigned int i=0; i<indices.size(); ++i)
+        deallog << ' ' << indices[i];
       deallog << std::endl;
     }
 }
 
 
 template <int dim>
-void check_fe(FiniteElement<dim>fe)
+void check_fe(FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
-  
+
   Triangulation<dim> tr;
   GridGenerator::hyper_cube(tr);
   tr.refine_global(2);
   ZeroFunction<dim> zero;
   typename FunctionMap<dim>::type fmap;
   fmap.insert(std::make_pair(0, &zero));
-  
+
   MGDoFHandler<dim> mgdof(tr);
   mgdof.distribute_dofs(fe);
   dofs(mgdof);
@@ -91,7 +91,7 @@ void check()
   FE_Q<dim> q1(1);
   FE_Q<dim> q2(2);
 //  FE_DGQ<dim> dq1(1);
-  
+
   FESystem<dim> s1(q1, 2, q2,1);
 
   check_fe(q1);
index 7b97da64bac8683a1760721d90a3c8c6e08eae7e..ec4cec5d0c168995e969d0db971835f4ee444769 100644 (file)
@@ -44,46 +44,46 @@ using namespace std;
 
 
 template <int dim>
-void dofs(const MGDoFHandler<dim>dof)
+void dofs(const MGDoFHandler<dim> &dof)
 {
   typename MGDoFHandler<dim>::cell_iterator cell;
   const typename MGDoFHandler<dim>::cell_iterator end = dof.end();
 
   std::vector<types::global_dof_index> indices;
-  
+
   for (cell = dof.begin(); cell != end; ++cell)
     {
       indices.resize(cell->get_fe().dofs_per_face);
-      
+
       deallog << "Level " << cell->level() << std::endl;
-      for (unsigned int f=0;f<GeometryInfo<dim>::faces_per_cell;++f)
-       {
-         typename MGDoFHandler<dim>::face_iterator face = cell->face(f);
-         face->get_mg_dof_indices(cell->level(), indices);
-         
-         for (unsigned int i=0;i<GeometryInfo<dim>::vertices_per_face;++i)
-           deallog << " v" << face->vertex(i);
-         deallog << " dofs ";
-         for (unsigned int i=0;i<indices.size();++i)
-           deallog << ' ' << indices[i];
-         deallog << std::endl;
-       }
+      for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+        {
+          typename MGDoFHandler<dim>::face_iterator face = cell->face(f);
+          face->get_mg_dof_indices(cell->level(), indices);
+
+          for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_face; ++i)
+            deallog << " v" << face->vertex(i);
+          deallog << " dofs ";
+          for (unsigned int i=0; i<indices.size(); ++i)
+            deallog << ' ' << indices[i];
+          deallog << std::endl;
+        }
     }
 }
 
 
 template <int dim>
-void check_fe(FiniteElement<dim>fe)
+void check_fe(FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
-  
+
   Triangulation<dim> tr;
   GridGenerator::hyper_cube(tr);
   tr.refine_global(2);
   ZeroFunction<dim> zero;
   typename FunctionMap<dim>::type fmap;
   fmap.insert(std::make_pair(0, &zero));
-  
+
   MGDoFHandler<dim> mgdof(tr);
   mgdof.distribute_dofs(fe);
   dofs(mgdof);
@@ -96,7 +96,7 @@ void check()
   FE_Q<dim> q1(1);
   FE_Q<dim> q2(2);
 //  FE_DGQ<dim> dq1(1);
-  
+
   FESystem<dim> s1(q1, 2, q2,1);
 
   check_fe(q1);
index 11b31e14b35ef80eecb660df15037a0838ca8b8a..a044988cf3488ccfa32128c2bd1c12ce1ba12386 100644 (file)
@@ -42,60 +42,60 @@ void check()
   GridGenerator::hyper_cube(tr);
   tr.refine_global(1);
 
-                                  // check the two functions mentioned above
-                                  // in their natural order
+  // check the two functions mentioned above
+  // in their natural order
   {
     DoFHandler<dim> dof(tr);
     deallog << "check " << dim << " before distribute "
-           << dof.has_active_dofs() << ' '
-           << dof.has_level_dofs()
-           << std::endl;
+            << dof.has_active_dofs() << ' '
+            << dof.has_level_dofs()
+            << std::endl;
 
     dof.distribute_dofs(fe);
     deallog << "check " << dim << " after  distribute "
-           << dof.has_active_dofs() << ' '
-           << dof.has_level_dofs()
-           << std::endl;
+            << dof.has_active_dofs() << ' '
+            << dof.has_level_dofs()
+            << std::endl;
 
 
     dof.distribute_mg_dofs(fe);
     deallog << "check " << dim << " level  distribute "
-           << dof.has_active_dofs() << ' '
-           << dof.has_level_dofs()
-           << std::endl;
+            << dof.has_active_dofs() << ' '
+            << dof.has_level_dofs()
+            << std::endl;
 
     dof.clear();
     deallog << "check " << dim << " after  clear      "
-           << dof.has_active_dofs() << ' '
-           << dof.has_level_dofs()
-           << std::endl;
+            << dof.has_active_dofs() << ' '
+            << dof.has_level_dofs()
+            << std::endl;
   }
 
-                                  // now check them the other way around
+  // now check them the other way around
   {
     DoFHandler<dim> dof(tr);
     deallog << "check " << dim << " before distribute "
-           << dof.has_active_dofs() << ' '
-           << dof.has_level_dofs()
-           << std::endl;
+            << dof.has_active_dofs() << ' '
+            << dof.has_level_dofs()
+            << std::endl;
 
     dof.distribute_mg_dofs(fe);
     deallog << "check " << dim << " level  distribute "
-           << dof.has_active_dofs() << ' '
-           << dof.has_level_dofs()
-           << std::endl;
+            << dof.has_active_dofs() << ' '
+            << dof.has_level_dofs()
+            << std::endl;
 
     dof.distribute_dofs(fe);
     deallog << "check " << dim << " after  distribute "
-           << dof.has_active_dofs() << ' '
-           << dof.has_level_dofs()
-           << std::endl;
+            << dof.has_active_dofs() << ' '
+            << dof.has_level_dofs()
+            << std::endl;
 
     dof.clear();
     deallog << "check " << dim << " after  clear      "
-           << dof.has_active_dofs() << ' '
-           << dof.has_level_dofs()
-           << std::endl;
+            << dof.has_active_dofs() << ' '
+            << dof.has_level_dofs()
+            << std::endl;
   }
 }
 
index adfb0bb7c3fc3f2c20363bfd271350eae0fd6a1a..4d8ca154f0ae7bb7391c4dec14c88072dd80de8e 100644 (file)
@@ -53,10 +53,10 @@ using namespace std;
 template <int dim, typename number, int spacedim>
 void
 reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
-              MGLevelObject<dealii::Vector<number> > &v)
+               MGLevelObject<dealii::Vector<number> > &v)
 {
   for (unsigned int level=v.min_level();
-       level<=v.max_level();++level)
+       level<=v.max_level(); ++level)
     {
       unsigned int n = mg_dof.n_dofs (level);
       v[level].reinit(n);
@@ -69,110 +69,110 @@ void refine_mesh (Triangulation<dim> &triangulation)
 {
   bool cell_refined = false;
   for (typename Triangulation<dim>::active_cell_iterator
-      cell = triangulation.begin_active();
-      cell != triangulation.end(); ++cell)
-  {
-   for (unsigned int vertex=0;
-          vertex < GeometryInfo<dim>::vertices_per_cell;
-          ++vertex)
-      {
-        const Point<dim> p = cell->vertex(vertex);
-        const Point<dim> origin = (dim == 2 ?
-                                    Point<dim>(0,0) :
-                                    Point<dim>(0,0,0));
-        const double dist = p.distance(origin);
-        if(dist<0.25/M_PI)
+       cell = triangulation.begin_active();
+       cell != triangulation.end(); ++cell)
+    {
+      for (unsigned int vertex=0;
+           vertex < GeometryInfo<dim>::vertices_per_cell;
+           ++vertex)
         {
-          cell->set_refine_flag ();
-          cell_refined = true;
-          break;
+          const Point<dim> p = cell->vertex(vertex);
+          const Point<dim> origin = (dim == 2 ?
+                                     Point<dim>(0,0) :
+                                     Point<dim>(0,0,0));
+          const double dist = p.distance(origin);
+          if (dist<0.25/M_PI)
+            {
+              cell->set_refine_flag ();
+              cell_refined = true;
+              break;
+            }
         }
-      }
-  }
-  if(!cell_refined)//if no cell was selected for refinement, refine global
+    }
+  if (!cell_refined) //if no cell was selected for refinement, refine global
     for (typename Triangulation<dim>::active_cell_iterator
-        cell = triangulation.begin_active();
-        cell != triangulation.end(); ++cell)
+         cell = triangulation.begin_active();
+         cell != triangulation.end(); ++cell)
       cell->set_refine_flag();
   triangulation.execute_coarsening_and_refinement ();
 }
 
 template <int dim>
 void initialize (const MGDoFHandler<dim> &dof,
-    Vector<double> &u)
+                 Vector<double> &u)
 {
   unsigned int counter=0;
   const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
   std::vector<types::global_dof_index> dof_indices(dofs_per_cell);
   for (typename MGDoFHandler<dim>::active_cell_iterator
-      cell = dof.begin_active();
-      cell != dof.end(); ++cell)
-  {
-    cell->get_dof_indices(dof_indices);
-    for(unsigned int i=0; i<dofs_per_cell; ++i)
-      u(dof_indices[i]) = ++counter;
-  }
+       cell = dof.begin_active();
+       cell != dof.end(); ++cell)
+    {
+      cell->get_dof_indices(dof_indices);
+      for (unsigned int i=0; i<dofs_per_cell; ++i)
+        u(dof_indices[i]) = ++counter;
+    }
 }
 
 template <int dim>
 void initialize (const MGDoFHandler<dim> &dof,
-    MGLevelObject<Vector<double> > &u)
+                 MGLevelObject<Vector<double> > &u)
 {
   const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
   const unsigned int dofs_per_face = dof.get_fe().dofs_per_face;
   std::vector<types::global_dof_index> dof_indices(dofs_per_cell);
   std::vector<types::global_dof_index> face_indices(dofs_per_face);
 
-  for(unsigned int l=0; l<dof.get_tria().n_levels(); ++l)
-  {
-    for (typename MGDoFHandler<dim>::cell_iterator
-        cell = dof.begin(l);
-        cell != dof.end(l); ++cell)
+  for (unsigned int l=0; l<dof.get_tria().n_levels(); ++l)
     {
-      cell->get_mg_dof_indices(dof_indices);
-      for(unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
-      {
-        cell->face(f)->get_mg_dof_indices(cell->level(),face_indices);
-        if(cell->face(f)->at_boundary())
-        {
-          for(unsigned int i=0; i<dofs_per_face; ++i)
-            u[cell->level()](face_indices[i]) = 1;
-        }
-        else
+      for (typename MGDoFHandler<dim>::cell_iterator
+           cell = dof.begin(l);
+           cell != dof.end(l); ++cell)
         {
-          for(unsigned int i=0; i<dofs_per_face; ++i)
-            if(u[cell->level()](face_indices[i]) != 1)
-              u[cell->level()](face_indices[i]) = 0;
+          cell->get_mg_dof_indices(dof_indices);
+          for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+            {
+              cell->face(f)->get_mg_dof_indices(cell->level(),face_indices);
+              if (cell->face(f)->at_boundary())
+                {
+                  for (unsigned int i=0; i<dofs_per_face; ++i)
+                    u[cell->level()](face_indices[i]) = 1;
+                }
+              else
+                {
+                  for (unsigned int i=0; i<dofs_per_face; ++i)
+                    if (u[cell->level()](face_indices[i]) != 1)
+                      u[cell->level()](face_indices[i]) = 0;
+                }
+            }
         }
-      }
     }
-  }
 }
 
 template <int dim>
 void print (const MGDoFHandler<dim> &dof,
-    MGLevelObject<Vector<double> > &u)
+            MGLevelObject<Vector<double> > &u)
 {
   const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
   std::vector<types::global_dof_index> dof_indices(dofs_per_cell);
-  for(unsigned int l=0; l<dof.get_tria().n_levels(); ++l)
-  {
-    deallog << std::endl;
-    deallog << "Level " << l << std::endl;
-    for (typename MGDoFHandler<dim>::cell_iterator
-        cell = dof.begin(l);
-        cell != dof.end(l); ++cell)
+  for (unsigned int l=0; l<dof.get_tria().n_levels(); ++l)
     {
-      cell->get_mg_dof_indices(dof_indices);
-      for(unsigned int i=0; i<dofs_per_cell; ++i)
-        deallog << ' ' << (int)u[l](dof_indices[i]);
+      deallog << std::endl;
+      deallog << "Level " << l << std::endl;
+      for (typename MGDoFHandler<dim>::cell_iterator
+           cell = dof.begin(l);
+           cell != dof.end(l); ++cell)
+        {
+          cell->get_mg_dof_indices(dof_indices);
+          for (unsigned int i=0; i<dofs_per_cell; ++i)
+            deallog << ' ' << (int)u[l](dof_indices[i]);
+        }
     }
-  }
 }
 
 template <int dim>
 void print_diff (const MGDoFHandler<dim> &dof_1, const MGDoFHandler<dim> &dof_2,
-    const Vector<double> &u, const Vector<double> &v)
+                 const Vector<double> &u, const Vector<double> &v)
 {
   Vector<double> diff;
   diff.reinit (u);
@@ -180,20 +180,20 @@ void print_diff (const MGDoFHandler<dim> &dof_1, const MGDoFHandler<dim> &dof_2,
   std::vector<types::global_dof_index> dof_indices_1(dofs_per_cell);
   std::vector<types::global_dof_index> dof_indices_2(dofs_per_cell);
   for (typename MGDoFHandler<dim>::active_cell_iterator
-      cell_1 = dof_1.begin_active(), cell_2 = dof_2.begin_active();
-      cell_1 != dof_1.end(); ++cell_1, ++cell_2)
-  {
-    cell_1->get_dof_indices(dof_indices_1);
-    cell_2->get_dof_indices(dof_indices_2);
-    for(unsigned int i=0; i<dofs_per_cell; ++i)
-      diff(dof_indices_1[i]) = u(dof_indices_1[i]) - v(dof_indices_2[i]);
-  }
+       cell_1 = dof_1.begin_active(), cell_2 = dof_2.begin_active();
+       cell_1 != dof_1.end(); ++cell_1, ++cell_2)
+    {
+      cell_1->get_dof_indices(dof_indices_1);
+      cell_2->get_dof_indices(dof_indices_2);
+      for (unsigned int i=0; i<dofs_per_cell; ++i)
+        diff(dof_indices_1[i]) = u(dof_indices_1[i]) - v(dof_indices_2[i]);
+    }
   deallog << std::endl;
   deallog << "diff " << diff.l2_norm() << std::endl;
 }
 
 template <int dim>
-void check_simple(const FiniteElement<dim>fe)
+void check_simple(const FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
 
@@ -217,12 +217,12 @@ void check_simple(const FiniteElement<dim>& fe)
   hnc.clear ();
   hnc_renumbered.clear ();
   DoFTools::make_hanging_node_constraints (
-      mgdof, 
-      hnc);
+    mgdof,
+    hnc);
 
   DoFTools::make_hanging_node_constraints (
-      mgdof_renumbered, 
-      hnc_renumbered);
+    mgdof_renumbered,
+    hnc_renumbered);
   hnc.close ();
   hnc_renumbered.close ();
 
@@ -232,7 +232,7 @@ void check_simple(const FiniteElement<dim>& fe)
   block_component[3] = 1;
 
   DoFRenumbering::component_wise (mgdof_renumbered, block_component);
-  for (unsigned int level=0;level<tr.n_levels();++level)
+  for (unsigned int level=0; level<tr.n_levels(); ++level)
     DoFRenumbering::component_wise (mgdof_renumbered, level, block_component);
 
 
@@ -259,7 +259,7 @@ void check_simple(const FiniteElement<dim>& fe)
 
   u=0;
   initialize(mgdof, v);
-  for(unsigned int l=0; l<tr.n_levels()-1; ++l)
+  for (unsigned int l=0; l<tr.n_levels()-1; ++l)
     transfer.prolongate (l+1, v[l+1], v[l]);
 
   transfer.copy_from_mg(mgdof, u, v);
@@ -273,7 +273,7 @@ void check_simple(const FiniteElement<dim>& fe)
 
   u=0;
   initialize(mgdof_renumbered, v);
-  for(unsigned int l=0; l<tr.n_levels()-1; ++l)
+  for (unsigned int l=0; l<tr.n_levels()-1; ++l)
     transfer_renumbered.prolongate (l+1, v[l+1], v[l]);
 
   transfer_renumbered.copy_from_mg(mgdof_renumbered, u, v);
index b9309844b83361493d2e218b9780a2d2e178c6ec..ffa4202d32be493da15c038efee333a1de8f0369 100644 (file)
@@ -67,10 +67,10 @@ using namespace dealii;
 template <int dim, typename number, int spacedim>
 void
 reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
-              MGLevelObject<dealii::Vector<number> > &v)
+               MGLevelObject<dealii::Vector<number> > &v)
 {
   for (unsigned int level=v.min_level();
-       level<=v.max_level();++level)
+       level<=v.max_level(); ++level)
     {
       unsigned int n = mg_dof.n_dofs (level);
       v[level].reinit(n);
@@ -79,41 +79,41 @@ reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
 
 template <int dim>
 void initialize (const MGDoFHandler<dim> &dof,
-    Vector<double> &u)
+                 Vector<double> &u)
 {
   unsigned int counter=0;
   const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
   std::vector<types::global_dof_index> dof_indices(dofs_per_cell);
   for (typename MGDoFHandler<dim>::active_cell_iterator
-      cell = dof.begin_active();
-      cell != dof.end(); ++cell)
-  {
-    cell->get_dof_indices(dof_indices);
-    for(unsigned int i=0; i<dofs_per_cell; ++i)
-      u(dof_indices[i]) = ++counter;
-  }
+       cell = dof.begin_active();
+       cell != dof.end(); ++cell)
+    {
+      cell->get_dof_indices(dof_indices);
+      for (unsigned int i=0; i<dofs_per_cell; ++i)
+        u(dof_indices[i]) = ++counter;
+    }
 }
 
 
 
 template <int dim>
 void initialize (const MGDoFHandler<dim> &dof,
-    MGLevelObject<Vector<double> > &u)
+                 MGLevelObject<Vector<double> > &u)
 {
   unsigned int counter=0;
   const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
   std::vector<unsigned int> dof_indices(dofs_per_cell);
   typename MGDoFHandler<dim>::cell_iterator
-      cell = dof.begin(0);
-    cell->get_mg_dof_indices(dof_indices);
-    for(unsigned int i=0; i<dofs_per_cell; ++i)
-      u[0](dof_indices[i]) = ++counter;
+  cell = dof.begin(0);
+  cell->get_mg_dof_indices(dof_indices);
+  for (unsigned int i=0; i<dofs_per_cell; ++i)
+    u[0](dof_indices[i]) = ++counter;
 }
 
 
 template <int dim>
 void print_diff (const MGDoFHandler<dim> &dof_1, const MGDoFHandler<dim> &dof_2,
-    const Vector<double> &u, const Vector<double> &v)
+                 const Vector<double> &u, const Vector<double> &v)
 {
   Vector<double> diff;
   diff.reinit (u);
@@ -121,14 +121,14 @@ void print_diff (const MGDoFHandler<dim> &dof_1, const MGDoFHandler<dim> &dof_2,
   std::vector<types::global_dof_index> dof_indices_1(dofs_per_cell);
   std::vector<types::global_dof_index> dof_indices_2(dofs_per_cell);
   for (typename MGDoFHandler<dim>::active_cell_iterator
-      cell_1 = dof_1.begin_active(), cell_2 = dof_2.begin_active();
-      cell_1 != dof_1.end(); ++cell_1, ++cell_2)
-  {
-    cell_1->get_dof_indices(dof_indices_1);
-    cell_2->get_dof_indices(dof_indices_2);
-    for(unsigned int i=0; i<dofs_per_cell; ++i)
-      diff(dof_indices_1[i]) = u(dof_indices_1[i]) - v(dof_indices_2[i]);
-  }
+       cell_1 = dof_1.begin_active(), cell_2 = dof_2.begin_active();
+       cell_1 != dof_1.end(); ++cell_1, ++cell_2)
+    {
+      cell_1->get_dof_indices(dof_indices_1);
+      cell_2->get_dof_indices(dof_indices_2);
+      for (unsigned int i=0; i<dofs_per_cell; ++i)
+        diff(dof_indices_1[i]) = u(dof_indices_1[i]) - v(dof_indices_2[i]);
+    }
   deallog << std::endl;
   deallog << "diff " << diff.l2_norm() << std::endl;
 }
@@ -138,53 +138,53 @@ void print(const MGDoFHandler<dim> &dof, std::vector<std::vector<bool> > &interf
 {
   const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
   std::vector<unsigned int> dof_indices(dofs_per_cell);
-  for(unsigned int l=0; l<dof.get_tria().n_levels(); ++l)
-  {
-    deallog << std::endl;
-    deallog << "Level " << l << std::endl;
-    for (typename MGDoFHandler<dim>::cell_iterator
-        cell = dof.begin(l);
-        cell != dof.end(l); ++cell)
+  for (unsigned int l=0; l<dof.get_tria().n_levels(); ++l)
     {
-      cell->get_mg_dof_indices(dof_indices);
-      for(unsigned int i=0; i<dofs_per_cell; ++i)
-        deallog << ' ' << interface_dofs[l][dof_indices[i]];
+      deallog << std::endl;
+      deallog << "Level " << l << std::endl;
+      for (typename MGDoFHandler<dim>::cell_iterator
+           cell = dof.begin(l);
+           cell != dof.end(l); ++cell)
+        {
+          cell->get_mg_dof_indices(dof_indices);
+          for (unsigned int i=0; i<dofs_per_cell; ++i)
+            deallog << ' ' << interface_dofs[l][dof_indices[i]];
+        }
     }
-  }
 }
 
 
 template <int dim>
-class LaplaceProblem 
+class LaplaceProblem
 {
-  public:
-    LaplaceProblem (const unsigned int deg);
-    void run ();
-
-  private:
-    void setup_system ();
-    void test ();
-    void test_renumber ();
-    void test_interface_dofs ();
-    void refine_local ();
-
-    Triangulation<dim>   triangulation;
-    FESystem<dim>            fe;
-    MGDoFHandler<dim>    mg_dof_handler;
-    MGDoFHandler<dim>    mg_dof_handler_renumbered;
-
-    MGLevelObject<SparsityPattern> mg_sparsity_renumbered;
-    MGLevelObject<SparseMatrix<double> > mg_matrices_renumbered;
-    MGLevelObject<SparsityPattern> mg_sparsity;
-    MGLevelObject<SparseMatrix<double> > mg_matrices;
-
-    const unsigned int degree;
-
-    std::vector<std::set<unsigned int> > 
-    boundary_indices;
-
-    std::vector<std::set<unsigned int> > 
-    boundary_indices_renumbered;
+public:
+  LaplaceProblem (const unsigned int deg);
+  void run ();
+
+private:
+  void setup_system ();
+  void test ();
+  void test_renumber ();
+  void test_interface_dofs ();
+  void refine_local ();
+
+  Triangulation<dim>   triangulation;
+  FESystem<dim>            fe;
+  MGDoFHandler<dim>    mg_dof_handler;
+  MGDoFHandler<dim>    mg_dof_handler_renumbered;
+
+  MGLevelObject<SparsityPattern> mg_sparsity_renumbered;
+  MGLevelObject<SparseMatrix<double> > mg_matrices_renumbered;
+  MGLevelObject<SparsityPattern> mg_sparsity;
+  MGLevelObject<SparseMatrix<double> > mg_matrices;
+
+  const unsigned int degree;
+
+  std::vector<std::set<unsigned int> >
+  boundary_indices;
+
+  std::vector<std::set<unsigned int> >
+  boundary_indices_renumbered;
 };
 
 
@@ -198,14 +198,14 @@ LaplaceProblem<dim>::LaplaceProblem (const unsigned int deg) :
 {}
 
 
-  template <int dim>
+template <int dim>
 void LaplaceProblem<dim>::setup_system ()
 {
   mg_dof_handler.distribute_dofs (fe);
   mg_dof_handler_renumbered.distribute_dofs (fe);
 
   std::vector<unsigned int> block_component (2*dim,0);
-  for(unsigned int c=dim; c<2*dim; ++c)
+  for (unsigned int c=dim; c<2*dim; ++c)
     block_component[c] = 1;
 
   const unsigned int nlevels = triangulation.n_levels();
@@ -213,28 +213,28 @@ void LaplaceProblem<dim>::setup_system ()
   DoFHandler<dim> &dof = mg_dof_handler_renumbered;
   DoFRenumbering::component_wise (dof, block_component);
   //DoFRenumbering::Cuthill_McKee (dof);
-  for (unsigned int level=0;level<nlevels;++level)
-  {
-    DoFRenumbering::component_wise (mg_dof_handler_renumbered, level, block_component);
-    //DoFRenumbering::Cuthill_McKee (mg_dof_handler_renumbered, level);
-  }
+  for (unsigned int level=0; level<nlevels; ++level)
+    {
+      DoFRenumbering::component_wise (mg_dof_handler_renumbered, level, block_component);
+      //DoFRenumbering::Cuthill_McKee (mg_dof_handler_renumbered, level);
+    }
 
   deallog << "Number of degrees of freedom: "
-    << mg_dof_handler.n_dofs();
+          << mg_dof_handler.n_dofs();
 
-  for (unsigned int l=0;l<triangulation.n_levels();++l)
+  for (unsigned int l=0; l<triangulation.n_levels(); ++l)
     deallog << "   " << 'L' << l << ": "
-      << mg_dof_handler.n_dofs(l);
+            << mg_dof_handler.n_dofs(l);
   deallog  << std::endl;
 
   boundary_indices.resize(triangulation.n_levels());
   boundary_indices_renumbered.resize(triangulation.n_levels());
 
-  for(unsigned int l=0; l<triangulation.n_levels(); ++l)
-  {
-    boundary_indices_renumbered[l].clear();
-    boundary_indices[l].clear();
-  }
+  for (unsigned int l=0; l<triangulation.n_levels(); ++l)
+    {
+      boundary_indices_renumbered[l].clear();
+      boundary_indices[l].clear();
+    }
 
   mg_matrices.resize(0, nlevels-1);
   mg_matrices.clear ();
@@ -243,85 +243,85 @@ void LaplaceProblem<dim>::setup_system ()
   mg_sparsity.resize(0, nlevels-1);
   mg_sparsity_renumbered.resize(0, nlevels-1);
 
-  for (unsigned int level=0;level<nlevels;++level)
-  {
-    mg_sparsity[level].reinit (mg_dof_handler.n_dofs(level),
-        mg_dof_handler.n_dofs(level),
-        mg_dof_handler.max_couplings_between_dofs());
-    mg_sparsity_renumbered[level].reinit (mg_dof_handler_renumbered.n_dofs(level),
-        mg_dof_handler_renumbered.n_dofs(level),
-        mg_dof_handler_renumbered.max_couplings_between_dofs());
-    MGTools::make_sparsity_pattern (mg_dof_handler, mg_sparsity[level], level);
-    MGTools::make_sparsity_pattern (mg_dof_handler_renumbered, 
-        mg_sparsity_renumbered[level], level);
-    mg_sparsity[level].compress();
-    mg_sparsity_renumbered[level].compress();
-    mg_matrices[level].reinit(mg_sparsity[level]);
-    mg_matrices_renumbered[level].reinit(mg_sparsity_renumbered[level]);
-  }
+  for (unsigned int level=0; level<nlevels; ++level)
+    {
+      mg_sparsity[level].reinit (mg_dof_handler.n_dofs(level),
+                                 mg_dof_handler.n_dofs(level),
+                                 mg_dof_handler.max_couplings_between_dofs());
+      mg_sparsity_renumbered[level].reinit (mg_dof_handler_renumbered.n_dofs(level),
+                                            mg_dof_handler_renumbered.n_dofs(level),
+                                            mg_dof_handler_renumbered.max_couplings_between_dofs());
+      MGTools::make_sparsity_pattern (mg_dof_handler, mg_sparsity[level], level);
+      MGTools::make_sparsity_pattern (mg_dof_handler_renumbered,
+                                      mg_sparsity_renumbered[level], level);
+      mg_sparsity[level].compress();
+      mg_sparsity_renumbered[level].compress();
+      mg_matrices[level].reinit(mg_sparsity[level]);
+      mg_matrices_renumbered[level].reinit(mg_sparsity_renumbered[level]);
+    }
 }
 
 
-  template <int dim>
-void LaplaceProblem<dim>::test_interface_dofs () 
+template <int dim>
+void LaplaceProblem<dim>::test_interface_dofs ()
 {
   std::vector<std::vector<bool> > interface_dofs;
   std::vector<std::vector<bool> > boundary_interface_dofs;
   for (unsigned int level = 0; level<triangulation.n_levels(); ++level)
-  {
-    std::vector<bool> tmp (mg_dof_handler.n_dofs(level));
-    interface_dofs.push_back (tmp);
-    boundary_interface_dofs.push_back (tmp);
-  }
-
-  MGTools::extract_inner_interface_dofs(mg_dof_handler_renumbered, 
-      interface_dofs, boundary_interface_dofs);
+    {
+      std::vector<bool> tmp (mg_dof_handler.n_dofs(level));
+      interface_dofs.push_back (tmp);
+      boundary_interface_dofs.push_back (tmp);
+    }
+
+  MGTools::extract_inner_interface_dofs(mg_dof_handler_renumbered,
+                                        interface_dofs, boundary_interface_dofs);
   deallog << "1. Test" << std::endl;
   print(mg_dof_handler_renumbered, interface_dofs);
 
   deallog << std::endl;
 
-  MGTools::extract_inner_interface_dofs(mg_dof_handler, 
-      interface_dofs, boundary_interface_dofs);
+  MGTools::extract_inner_interface_dofs(mg_dof_handler,
+                                        interface_dofs, boundary_interface_dofs);
 
   deallog << "2. Test" << std::endl;
   print(mg_dof_handler, interface_dofs);
 }
 
-  template <int dim>
-void LaplaceProblem<dim>::test_renumber () 
+template <int dim>
+void LaplaceProblem<dim>::test_renumber ()
 {
   std::vector<std::vector<bool> > v(triangulation.n_levels());
-  for(unsigned int l=0; l<triangulation.n_levels(); ++l)
-  {
-    v[l].resize(mg_dof_handler_renumbered.n_dofs(l));
-    std::fill (v[l].begin(), v[l].end(), false);
-  }
+  for (unsigned int l=0; l<triangulation.n_levels(); ++l)
+    {
+      v[l].resize(mg_dof_handler_renumbered.n_dofs(l));
+      std::fill (v[l].begin(), v[l].end(), false);
+    }
 
-  const unsigned int dofs_per_cell = 
+  const unsigned int dofs_per_cell =
     mg_dof_handler_renumbered.get_fe().dofs_per_cell;
   std::vector<unsigned int> dof_indices(dofs_per_cell);
   for (typename MGDoFHandler<dim>::cell_iterator
-      cell = mg_dof_handler_renumbered.begin();
-      cell != mg_dof_handler_renumbered.end(); ++cell)
-  {
-    cell->get_mg_dof_indices(dof_indices);
-    for(unsigned int i=0; i<dofs_per_cell; ++i)
-      v[cell->level()][dof_indices[i]] = true;
-  }
-  for(unsigned int l=0; l<triangulation.n_levels(); ++l)
-  {
-    deallog << "Level " << l << std::endl;
-    for(unsigned int dof=0; dof<mg_dof_handler_renumbered.n_dofs(l);
-        ++dof)
-      if(!v[l][dof])
-        deallog << "FALSE " << dof << std::endl;
-  }
+       cell = mg_dof_handler_renumbered.begin();
+       cell != mg_dof_handler_renumbered.end(); ++cell)
+    {
+      cell->get_mg_dof_indices(dof_indices);
+      for (unsigned int i=0; i<dofs_per_cell; ++i)
+        v[cell->level()][dof_indices[i]] = true;
+    }
+  for (unsigned int l=0; l<triangulation.n_levels(); ++l)
+    {
+      deallog << "Level " << l << std::endl;
+      for (unsigned int dof=0; dof<mg_dof_handler_renumbered.n_dofs(l);
+           ++dof)
+        if (!v[l][dof])
+          deallog << "FALSE " << dof << std::endl;
+    }
 }
 
 
-  template <int dim>
-void LaplaceProblem<dim>::test () 
+template <int dim>
+void LaplaceProblem<dim>::test ()
 {
   typename FunctionMap<dim>::type      dirichlet_boundary;
   ZeroFunction<dim>                    dirichlet_bc(fe.n_components());
@@ -329,11 +329,11 @@ void LaplaceProblem<dim>::test ()
 
   const unsigned int min_l = mg_matrices.min_level();
   const unsigned int max_l = mg_matrices.max_level();
-  for(unsigned int l=min_l; l<max_l; ++l)
-  {
-    mg_matrices[l] = IdentityMatrix(mg_dof_handler.n_dofs(l));
-    mg_matrices_renumbered[l] = IdentityMatrix(mg_dof_handler.n_dofs(l));
-  }
+  for (unsigned int l=min_l; l<max_l; ++l)
+    {
+      mg_matrices[l] = IdentityMatrix(mg_dof_handler.n_dofs(l));
+      mg_matrices_renumbered[l] = IdentityMatrix(mg_dof_handler.n_dofs(l));
+    }
 
   MGConstrainedDoFs mg_constrained_dofs;
   mg_constrained_dofs.initialize(mg_dof_handler, dirichlet_boundary);
@@ -360,10 +360,10 @@ void LaplaceProblem<dim>::test ()
 
   typedef PreconditionIdentity RELAXATION;
   MGSmootherPrecondition<SparseMatrix<double>, RELAXATION, Vector<double> >
-    mg_smoother;
+  mg_smoother;
 
   MGSmootherPrecondition<SparseMatrix<double>, RELAXATION, Vector<double> >
-    mg_smoother_renumbered;
+  mg_smoother_renumbered;
 
   RELAXATION::AdditionalData smoother_data;
   mg_smoother.initialize(mg_matrices, smoother_data);
@@ -373,33 +373,33 @@ void LaplaceProblem<dim>::test ()
   mg_smoother_renumbered.set_steps(1);
 
   MGMatrix<SparseMatrix<double>, Vector<double> >
-    mg_matrix(&mg_matrices);
+  mg_matrix(&mg_matrices);
 
   MGMatrix<SparseMatrix<double>, Vector<double> >
-    mg_matrix_renumbered(&mg_matrices_renumbered);
+  mg_matrix_renumbered(&mg_matrices_renumbered);
 
   Multigrid<Vector<double> > mg(mg_dof_handler,
-      mg_matrix,
-      mg_coarse,
-      mg_transfer,
-      mg_smoother,
-      mg_smoother);
+                                mg_matrix,
+                                mg_coarse,
+                                mg_transfer,
+                                mg_smoother,
+                                mg_smoother);
 
   Multigrid<Vector<double> > mg_renumbered(mg_dof_handler_renumbered,
-      mg_matrix_renumbered,
-      mg_coarse_renumbered,
-      mg_transfer_renumbered,
-      mg_smoother_renumbered,
-      mg_smoother_renumbered);
+                                           mg_matrix_renumbered,
+                                           mg_coarse_renumbered,
+                                           mg_transfer_renumbered,
+                                           mg_smoother_renumbered,
+                                           mg_smoother_renumbered);
 
   PreconditionMG<dim, Vector<double>,
-    MGTransferPrebuilt<Vector<double> > >
-      preconditioner(mg_dof_handler, mg, mg_transfer);
+                 MGTransferPrebuilt<Vector<double> > >
+                 preconditioner(mg_dof_handler, mg, mg_transfer);
 
   PreconditionMG<dim, Vector<double>,
-    MGTransferPrebuilt<Vector<double> > >
-      preconditioner_renumbered(mg_dof_handler_renumbered, 
-          mg_renumbered, mg_transfer_renumbered);
+                 MGTransferPrebuilt<Vector<double> > >
+                 preconditioner_renumbered(mg_dof_handler_renumbered,
+                                           mg_renumbered, mg_transfer_renumbered);
 
   Vector<double> test, dst, dst_renumbered;
   test.reinit(mg_dof_handler.n_dofs());
@@ -422,62 +422,62 @@ void LaplaceProblem<dim>::test ()
 
 
 
-  template <int dim>
+template <int dim>
 void LaplaceProblem<dim>::refine_local ()
 {
   bool cell_refined = false;
   for (typename Triangulation<dim>::active_cell_iterator
-      cell = triangulation.begin_active();
-      cell != triangulation.end(); ++cell)
-  {
+       cell = triangulation.begin_active();
+       cell != triangulation.end(); ++cell)
+    {
       for (unsigned int vertex=0;
-          vertex < GeometryInfo<dim>::vertices_per_cell;
-          ++vertex)
-      {
-        const Point<dim> p = cell->vertex(vertex);
-        const Point<dim> origin = (dim == 2 ?
-                                    Point<dim>(0,0) :
-                                    Point<dim>(0,0,0));
-        const double dist = p.distance(origin);
-        if(dist<0.25/M_PI)
+           vertex < GeometryInfo<dim>::vertices_per_cell;
+           ++vertex)
         {
-          cell->set_refine_flag ();
-          cell_refined = true;
-          break;
+          const Point<dim> p = cell->vertex(vertex);
+          const Point<dim> origin = (dim == 2 ?
+                                     Point<dim>(0,0) :
+                                     Point<dim>(0,0,0));
+          const double dist = p.distance(origin);
+          if (dist<0.25/M_PI)
+            {
+              cell->set_refine_flag ();
+              cell_refined = true;
+              break;
+            }
         }
-      }
-  }
+    }
   //Wenn nichts verfeinert wurde bisher, global verfeinern!
-  if(!cell_refined)
+  if (!cell_refined)
     for (typename Triangulation<dim>::active_cell_iterator
-        cell = triangulation.begin_active();
-        cell != triangulation.end(); ++cell)
+         cell = triangulation.begin_active();
+         cell != triangulation.end(); ++cell)
       cell->set_refine_flag();
 
 
   triangulation.execute_coarsening_and_refinement ();
 }
 
-  template <int dim>
-void LaplaceProblem<dim>::run () 
+template <int dim>
+void LaplaceProblem<dim>::run ()
 {
   for (unsigned int cycle=0; cycle<7; ++cycle)
-  {
-    deallog << "Cycle " << cycle << std::endl;
-
-    if (cycle == 0)
     {
-      GridGenerator::hyper_cube(triangulation, -1, 1);
-      triangulation.refine_global (1);
-    }
-    //triangulation.refine_global (1);
-    refine_local ();
-    setup_system ();
-    test();
-  };
+      deallog << "Cycle " << cycle << std::endl;
+
+      if (cycle == 0)
+        {
+          GridGenerator::hyper_cube(triangulation, -1, 1);
+          triangulation.refine_global (1);
+        }
+      //triangulation.refine_global (1);
+      refine_local ();
+      setup_system ();
+      test();
+    };
 }
 
-int main () 
+int main ()
 {
   std::ofstream logfile("mg_renumbered_01/output");
   deallog << std::setprecision(4);
index bb2f4f27805f0ac43d2b6cb5d99355560f7405ce..2b5fa393aee7eb2c7cb348620053f88ea29c235f 100644 (file)
@@ -70,10 +70,10 @@ using namespace dealii;
 template <int dim, typename number, int spacedim>
 void
 reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
-              MGLevelObject<dealii::Vector<number> > &v)
+               MGLevelObject<dealii::Vector<number> > &v)
 {
   for (unsigned int level=v.min_level();
-       level<=v.max_level();++level)
+       level<=v.max_level(); ++level)
     {
       unsigned int n = mg_dof.n_dofs (level);
       v[level].reinit(n);
@@ -82,121 +82,121 @@ reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
 
 template <int dim>
 void initialize (const MGDoFHandler<dim> &dof,
-    Vector<double> &u)
+                 Vector<double> &u)
 {
   const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
   std::vector<types::global_dof_index> dof_indices(dofs_per_cell);
   for (typename MGDoFHandler<dim>::active_cell_iterator
-      cell = dof.begin_active();
-      cell != dof.end(); ++cell)
-  {
-    cell->get_dof_indices(dof_indices);
-    for(unsigned int i=0; i<dofs_per_cell; ++i)
+       cell = dof.begin_active();
+       cell != dof.end(); ++cell)
     {
-      const unsigned int comp = dof.get_fe().system_to_component_index(i).first;
-      u(dof_indices[i]) = comp+1;
+      cell->get_dof_indices(dof_indices);
+      for (unsigned int i=0; i<dofs_per_cell; ++i)
+        {
+          const unsigned int comp = dof.get_fe().system_to_component_index(i).first;
+          u(dof_indices[i]) = comp+1;
+        }
     }
-  }
 }
 
 
 template <int dim>
 void initialize (const MGDoFHandler<dim> &dof,
-    MGLevelObject<Vector<double> > &u)
+                 MGLevelObject<Vector<double> > &u)
 {
   unsigned int counter=0;
   const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
   std::vector<types::global_dof_index> dof_indices(dofs_per_cell);
   typename MGDoFHandler<dim>::cell_iterator
-      cell = dof.begin(0);
-    cell->get_mg_dof_indices(dof_indices);
-    for(unsigned int i=0; i<dofs_per_cell; ++i)
-      u[0](dof_indices[i]) = ++counter;
+  cell = dof.begin(0);
+  cell->get_mg_dof_indices(dof_indices);
+  for (unsigned int i=0; i<dofs_per_cell; ++i)
+    u[0](dof_indices[i]) = ++counter;
 }
 
 
 template <int dim>
 void diff (Vector<double> &diff, const MGDoFHandler<dim> &dof,
-    const Vector<double> &v, const unsigned int level)
+           const Vector<double> &v, const unsigned int level)
 {
   diff.reinit (v);
   const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
   std::vector<unsigned int> mg_dof_indices(dofs_per_cell);
   const unsigned int n_comp = dof.get_fe().n_components();
   for (typename MGDoFHandler<dim>::cell_iterator
-      cell= dof.begin(level);
-      cell != dof.end(level); ++cell)
-  {
-    cell->get_mg_dof_indices(mg_dof_indices);
-    for(unsigned int i=0; i<dofs_per_cell/n_comp; ++i)
+       cell= dof.begin(level);
+       cell != dof.end(level); ++cell)
     {
-      const unsigned int ni = n_comp* i;
-      const unsigned int i0 = mg_dof_indices[ni];
-      const unsigned int i1 = mg_dof_indices[ni+1];
-      const unsigned int i2 = mg_dof_indices[ni+2];
-      diff(i0) = 2*v(i0) - v(i1);
-      diff(i1) = 3*v(i1) - 2*v(i2);
-      diff(i2) = v(i2) - 3*v(i0);
+      cell->get_mg_dof_indices(mg_dof_indices);
+      for (unsigned int i=0; i<dofs_per_cell/n_comp; ++i)
+        {
+          const unsigned int ni = n_comp* i;
+          const unsigned int i0 = mg_dof_indices[ni];
+          const unsigned int i1 = mg_dof_indices[ni+1];
+          const unsigned int i2 = mg_dof_indices[ni+2];
+          diff(i0) = 2*v(i0) - v(i1);
+          diff(i1) = 3*v(i1) - 2*v(i2);
+          diff(i2) = v(i2) - 3*v(i0);
+        }
     }
-  }
 }
 
 
 template <int dim>
 class OutputCreator : public Subscriptor
 {
-  public:
-    void cell(MeshWorker::DoFInfo<dim>& dinfo,
-                    MeshWorker::IntegrationInfo<dim>& info);
+public:
+  void cell(MeshWorker::DoFInfo<dim> &dinfo,
+            MeshWorker::IntegrationInfo<dim> &info);
 
 };
 
 template <int dim>
 void OutputCreator<dim>::cell(
-  MeshWorker::DoFInfo<dim>dinfo,
-  MeshWorker::IntegrationInfo<dim>info)
+  MeshWorker::DoFInfo<dim> &dinfo,
+  MeshWorker::IntegrationInfo<dim> &info)
 {
-  const FEValuesBase<dim>fe = info.fe_values();
-  const std::vector<std::vector<double> >uh = info.values[0];
+  const FEValuesBase<dim> &fe = info.fe_values();
+  const std::vector<std::vector<double> > &uh = info.values[0];
 
   const unsigned int square_root = static_cast<unsigned int>(std::pow(fe.n_quadrature_points, 1./dim)+.5);
   for (unsigned int k1=0; k1<square_root; ++k1)
-  {
-    for (unsigned int k2=0; k2<square_root; ++k2)
     {
-      for(unsigned int d=0; d<dim; ++d)
-        dinfo.quadrature_value(k1*square_root+k2, d) = fe.quadrature_point(k1*square_root+k2)[d];
-      for(unsigned int i=0; i<uh.size(); ++i)
-        dinfo.quadrature_value(k1*square_root+k2, i+dim) = uh[i][k1*square_root+k2];
+      for (unsigned int k2=0; k2<square_root; ++k2)
+        {
+          for (unsigned int d=0; d<dim; ++d)
+            dinfo.quadrature_value(k1*square_root+k2, d) = fe.quadrature_point(k1*square_root+k2)[d];
+          for (unsigned int i=0; i<uh.size(); ++i)
+            dinfo.quadrature_value(k1*square_root+k2, i+dim) = uh[i][k1*square_root+k2];
+        }
     }
-  }
 }
 
 
 template <int dim>
 class LaplaceProblem
 {
-  public:
-    typedef MeshWorker::IntegrationInfo<dim> CellInfo;
+public:
+  typedef MeshWorker::IntegrationInfo<dim> CellInfo;
 
-    LaplaceProblem (const unsigned int deg);
-    void run ();
+  LaplaceProblem (const unsigned int deg);
+  void run ();
 
-  private:
-    void setup_system ();
-    void test_boundary ();
-    void output_gpl(const MGDoFHandler<dim> &dof,
-        MGLevelObject<Vector<double> > &v);
-    void refine_local ();
+private:
+  void setup_system ();
+  void test_boundary ();
+  void output_gpl(const MGDoFHandler<dim> &dof,
+                  MGLevelObject<Vector<double> > &v);
+  void refine_local ();
 
-    Triangulation<dim>   triangulation;
-    const MappingQ1<dim> mapping;
-    FESystem<dim>        fe;
-    MGDoFHandler<dim>    mg_dof_handler_renumbered;
+  Triangulation<dim>   triangulation;
+  const MappingQ1<dim> mapping;
+  FESystem<dim>        fe;
+  MGDoFHandler<dim>    mg_dof_handler_renumbered;
 
-    const unsigned int degree;
-    std::vector<std::set<types::global_dof_index> >
-      boundary_indices_renumbered;
+  const unsigned int degree;
+  std::vector<std::set<types::global_dof_index> >
+  boundary_indices_renumbered;
 
 };
 
@@ -210,7 +210,7 @@ LaplaceProblem<dim>::LaplaceProblem (const unsigned int deg) :
 {}
 
 
-  template <int dim>
+template <int dim>
 void LaplaceProblem<dim>::setup_system ()
 {
   mg_dof_handler_renumbered.distribute_dofs (fe);
@@ -219,26 +219,26 @@ void LaplaceProblem<dim>::setup_system ()
 
   DoFHandler<dim> &dof = mg_dof_handler_renumbered;
   DoFRenumbering::component_wise (dof);
-  for (unsigned int level=0;level<nlevels;++level)
+  for (unsigned int level=0; level<nlevels; ++level)
     DoFRenumbering::component_wise (mg_dof_handler_renumbered, level);
 
   boundary_indices_renumbered.resize(nlevels);
-  for(unsigned int l=0; l<nlevels; ++l)
+  for (unsigned int l=0; l<nlevels; ++l)
     boundary_indices_renumbered[l].clear();
 
   deallog << "Number of degrees of freedom: "
-    << mg_dof_handler_renumbered.n_dofs();
+          << mg_dof_handler_renumbered.n_dofs();
 
-  for (unsigned int l=0;l<triangulation.n_levels();++l)
+  for (unsigned int l=0; l<triangulation.n_levels(); ++l)
     deallog << "   " << 'L' << l << ": "
-      << mg_dof_handler_renumbered.n_dofs(l);
+            << mg_dof_handler_renumbered.n_dofs(l);
   deallog  << std::endl;
 }
 
 template <int dim>
 void
 LaplaceProblem<dim>::output_gpl(const MGDoFHandler<dim> &dof,
-    MGLevelObject<Vector<double> > &v)
+                                MGLevelObject<Vector<double> > &v)
 {
   MeshWorker::IntegrationInfoBox<dim> info_box;
   const unsigned int n_gauss_points = dof.get_fe().tensor_degree();
@@ -259,100 +259,100 @@ LaplaceProblem<dim>::output_gpl(const MGDoFHandler<dim> &dof,
   MeshWorker::Assembler::GnuplotPatch assembler;
   assembler.initialize(n_gauss_points+1, dof.get_fe().n_components());
 
-  for(unsigned int l=0; l<triangulation.n_levels(); ++l)
-  {
-    OutputCreator<dim> matrix_integrator;
-    MeshWorker::loop<dim, dim, MeshWorker::DoFInfo<dim>, MeshWorker::IntegrationInfoBox<dim> > (
-      dof.begin(l), dof.end(l),
-      dof_info, info_box,
-      std_cxx1x::bind(&OutputCreator<dim>::cell, &matrix_integrator, std_cxx1x::_1, std_cxx1x::_2),
-      0,
-      0,
-      assembler);
-  }
+  for (unsigned int l=0; l<triangulation.n_levels(); ++l)
+    {
+      OutputCreator<dim> matrix_integrator;
+      MeshWorker::loop<dim, dim, MeshWorker::DoFInfo<dim>, MeshWorker::IntegrationInfoBox<dim> > (
+        dof.begin(l), dof.end(l),
+        dof_info, info_box,
+        std_cxx1x::bind(&OutputCreator<dim>::cell, &matrix_integrator, std_cxx1x::_1, std_cxx1x::_2),
+        0,
+        0,
+        assembler);
+    }
 }
 
-  template <int dim>
+template <int dim>
 void LaplaceProblem<dim>::test_boundary ()
 {
   typename FunctionMap<dim>::type      dirichlet_boundary;
   ZeroFunction<dim>                    dirichlet_bc(fe.n_components());
   dirichlet_boundary[0] =             &dirichlet_bc;
   MGTools::make_boundary_list (mg_dof_handler_renumbered, dirichlet_boundary,
-                              boundary_indices_renumbered);
+                               boundary_indices_renumbered);
 
   MGLevelObject<Vector<double> > u(0, triangulation.n_levels()-1);
   MGLevelObject<Vector<double> > d(0, triangulation.n_levels()-1);
 
-  for(unsigned int l=0; l<triangulation.n_levels(); ++l)
-  {
-    u[l].reinit(mg_dof_handler_renumbered.n_dofs(l));
-    u[l] = 1.;
-
-    for(std::set<types::global_dof_index>::const_iterator i = boundary_indices_renumbered[l].begin();
-      i!=boundary_indices_renumbered[l].end(); ++i)
+  for (unsigned int l=0; l<triangulation.n_levels(); ++l)
     {
-      u[l](*i) = 0;
+      u[l].reinit(mg_dof_handler_renumbered.n_dofs(l));
+      u[l] = 1.;
+
+      for (std::set<types::global_dof_index>::const_iterator i = boundary_indices_renumbered[l].begin();
+           i!=boundary_indices_renumbered[l].end(); ++i)
+        {
+          u[l](*i) = 0;
+        }
     }
-  }
   output_gpl(mg_dof_handler_renumbered, u);
 }
 
 
 
-  template <int dim>
+template <int dim>
 void LaplaceProblem<dim>::refine_local ()
 {
   bool cell_refined = false;
   for (typename Triangulation<dim>::active_cell_iterator
-      cell = triangulation.begin_active();
-      cell != triangulation.end(); ++cell)
-  {
+       cell = triangulation.begin_active();
+       cell != triangulation.end(); ++cell)
+    {
       for (unsigned int vertex=0;
-          vertex < GeometryInfo<dim>::vertices_per_cell;
-          ++vertex)
-      {
-        const Point<dim> p = cell->vertex(vertex);
-        const Point<dim> origin = (dim == 2 ?
-                                    Point<dim>(0,0) :
-                                    Point<dim>(0,0,0));
-        const double dist = p.distance(origin);
-        if(dist<0.25/M_PI)
+           vertex < GeometryInfo<dim>::vertices_per_cell;
+           ++vertex)
         {
-          cell->set_refine_flag ();
-          cell_refined = true;
-          break;
+          const Point<dim> p = cell->vertex(vertex);
+          const Point<dim> origin = (dim == 2 ?
+                                     Point<dim>(0,0) :
+                                     Point<dim>(0,0,0));
+          const double dist = p.distance(origin);
+          if (dist<0.25/M_PI)
+            {
+              cell->set_refine_flag ();
+              cell_refined = true;
+              break;
+            }
         }
-      }
-  }
+    }
   //Wenn nichts verfeinert wurde bisher, global verfeinern!
-  if(!cell_refined)
+  if (!cell_refined)
     for (typename Triangulation<dim>::active_cell_iterator
-        cell = triangulation.begin_active();
-        cell != triangulation.end(); ++cell)
+         cell = triangulation.begin_active();
+         cell != triangulation.end(); ++cell)
       cell->set_refine_flag();
 
 
   triangulation.execute_coarsening_and_refinement ();
 }
 
-  template <int dim>
+template <int dim>
 void LaplaceProblem<dim>::run ()
 {
   for (unsigned int cycle=0; cycle<6; ++cycle)
-  {
-    deallog << "Cycle " << cycle << std::endl;
-
-    if (cycle == 0)
     {
-      GridGenerator::hyper_cube(triangulation, -1, 1);
-      triangulation.refine_global (1);
-    }
-    //triangulation.refine_global (1);
-    refine_local ();
-    setup_system ();
-    test_boundary();
-  };
+      deallog << "Cycle " << cycle << std::endl;
+
+      if (cycle == 0)
+        {
+          GridGenerator::hyper_cube(triangulation, -1, 1);
+          triangulation.refine_global (1);
+        }
+      //triangulation.refine_global (1);
+      refine_local ();
+      setup_system ();
+      test_boundary();
+    };
 }
 
 int main ()
index b91c4631f1cef654161aec16a847b57d575bb073..eec64558458331fb3ff02d2d0c020b66dff9f575 100644 (file)
@@ -70,10 +70,10 @@ using namespace dealii;
 template <int dim, typename number, int spacedim>
 void
 reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
-              MGLevelObject<dealii::Vector<number> > &v)
+               MGLevelObject<dealii::Vector<number> > &v)
 {
   for (unsigned int level=v.min_level();
-       level<=v.max_level();++level)
+       level<=v.max_level(); ++level)
     {
       unsigned int n = mg_dof.n_dofs (level);
       v[level].reinit(n);
@@ -82,83 +82,83 @@ reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
 
 template <int dim>
 void initialize (const MGDoFHandler<dim> &dof,
-    Vector<double> &u)
+                 Vector<double> &u)
 {
   const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
   std::vector<types::global_dof_index> dof_indices(dofs_per_cell);
   for (typename MGDoFHandler<dim>::active_cell_iterator
-      cell = dof.begin_active();
-      cell != dof.end(); ++cell)
-  {
-    cell->get_dof_indices(dof_indices);
-    for(unsigned int i=0; i<dofs_per_cell; ++i)
+       cell = dof.begin_active();
+       cell != dof.end(); ++cell)
     {
-      const unsigned int comp = dof.get_fe().system_to_component_index(i).first;
-      u(dof_indices[i]) = comp+1;
+      cell->get_dof_indices(dof_indices);
+      for (unsigned int i=0; i<dofs_per_cell; ++i)
+        {
+          const unsigned int comp = dof.get_fe().system_to_component_index(i).first;
+          u(dof_indices[i]) = comp+1;
+        }
     }
-  }
 }
 
 
 
 template <int dim>
 void initialize (const MGDoFHandler<dim> &dof,
-    MGLevelObject<Vector<double> > &u)
+                 MGLevelObject<Vector<double> > &u)
 {
   unsigned int counter=0;
   const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
   std::vector<types::global_dof_index> dof_indices(dofs_per_cell);
   typename MGDoFHandler<dim>::cell_iterator
-      cell = dof.begin(0);
-    cell->get_mg_dof_indices(dof_indices);
-    for(unsigned int i=0; i<dofs_per_cell; ++i)
-      u[0](dof_indices[i]) = ++counter;
+  cell = dof.begin(0);
+  cell->get_mg_dof_indices(dof_indices);
+  for (unsigned int i=0; i<dofs_per_cell; ++i)
+    u[0](dof_indices[i]) = ++counter;
 }
 
 
 template <int dim>
 void diff (Vector<double> &diff, const MGDoFHandler<dim> &dof,
-    const Vector<double> &v, const unsigned int level)
+           const Vector<double> &v, const unsigned int level)
 {
   diff.reinit (v);
   const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
   std::vector<types::global_dof_index> mg_dof_indices(dofs_per_cell);
   const unsigned int n_comp = dof.get_fe().n_components();
   for (typename MGDoFHandler<dim>::cell_iterator
-      cell= dof.begin(level);
-      cell != dof.end(level); ++cell)
-  {
-    cell->get_mg_dof_indices(mg_dof_indices);
-    for(unsigned int i=0; i<dofs_per_cell/n_comp; ++i)
+       cell= dof.begin(level);
+       cell != dof.end(level); ++cell)
     {
-      const unsigned int ni = n_comp* i;
-      const unsigned int i0 = mg_dof_indices[ni];
-      const unsigned int i1 = mg_dof_indices[ni+1];
-      const unsigned int i2 = mg_dof_indices[ni+2];
-      diff(i0) = 2*v(i0) - v(i1);
-      diff(i1) = 3*v(i1) - 2*v(i2);
-      diff(i2) = v(i2) - 3*v(i0);
+      cell->get_mg_dof_indices(mg_dof_indices);
+      for (unsigned int i=0; i<dofs_per_cell/n_comp; ++i)
+        {
+          const unsigned int ni = n_comp* i;
+          const unsigned int i0 = mg_dof_indices[ni];
+          const unsigned int i1 = mg_dof_indices[ni+1];
+          const unsigned int i2 = mg_dof_indices[ni+2];
+          diff(i0) = 2*v(i0) - v(i1);
+          diff(i1) = 3*v(i1) - 2*v(i2);
+          diff(i2) = v(i2) - 3*v(i0);
+        }
     }
-  }
 }
 
 template <int dim>
 void diff (Vector<double> &diff, const MGDoFHandler<dim> &dof_1, const MGDoFHandler<dim> &dof_2,
-    const Vector<double> &u, const Vector<double> &v, const unsigned int level)
+           const Vector<double> &u, const Vector<double> &v, const unsigned int level)
 {
   diff.reinit (u);
   const unsigned int dofs_per_cell = dof_1.get_fe().dofs_per_cell;
   std::vector<unsigned int> dof_indices_1(dofs_per_cell);
   std::vector<unsigned int> dof_indices_2(dofs_per_cell);
   for (typename MGDoFHandler<dim>::cell_iterator
-      cell_1 = dof_1.begin(level), cell_2 = dof_2.begin(level);
-      cell_1 != dof_1.end(level); ++cell_1, ++cell_2)
-  {
-    cell_1->get_mg_dof_indices(dof_indices_1);
-    cell_2->get_mg_dof_indices(dof_indices_2);
-    for(unsigned int i=0; i<dofs_per_cell; ++i)
-      diff(dof_indices_1[i]) = u(dof_indices_1[i]) - v(dof_indices_2[i]);
-  }
+       cell_1 = dof_1.begin(level), cell_2 = dof_2.begin(level);
+       cell_1 != dof_1.end(level); ++cell_1, ++cell_2)
+    {
+      cell_1->get_mg_dof_indices(dof_indices_1);
+      cell_2->get_mg_dof_indices(dof_indices_2);
+      for (unsigned int i=0; i<dofs_per_cell; ++i)
+        diff(dof_indices_1[i]) = u(dof_indices_1[i]) - v(dof_indices_2[i]);
+    }
 }
 
 template <int dim>
@@ -166,77 +166,77 @@ void print(const MGDoFHandler<dim> &dof, std::vector<std::vector<bool> > &interf
 {
   const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
   std::vector<types::global_dof_index> dof_indices(dofs_per_cell);
-  for(unsigned int l=0; l<dof.get_tria().n_levels(); ++l)
-  {
-    deallog << std::endl;
-    deallog << "Level " << l << std::endl;
-    for (typename MGDoFHandler<dim>::cell_iterator
-        cell = dof.begin(l);
-        cell != dof.end(l); ++cell)
+  for (unsigned int l=0; l<dof.get_tria().n_levels(); ++l)
     {
-      cell->get_mg_dof_indices(dof_indices);
-      for(unsigned int i=0; i<dofs_per_cell; ++i)
-        deallog << ' ' << interface_dofs[l][dof_indices[i]];
+      deallog << std::endl;
+      deallog << "Level " << l << std::endl;
+      for (typename MGDoFHandler<dim>::cell_iterator
+           cell = dof.begin(l);
+           cell != dof.end(l); ++cell)
+        {
+          cell->get_mg_dof_indices(dof_indices);
+          for (unsigned int i=0; i<dofs_per_cell; ++i)
+            deallog << ' ' << interface_dofs[l][dof_indices[i]];
+        }
     }
-  }
 }
 
 template <int dim>
 class OutputCreator : public Subscriptor
 {
-  public:
-    void cell(MeshWorker::DoFInfo<dim>& dinfo,
-                    MeshWorker::IntegrationInfo<dim>& info);
+public:
+  void cell(MeshWorker::DoFInfo<dim> &dinfo,
+            MeshWorker::IntegrationInfo<dim> &info);
 
 };
 
 template <int dim>
 void OutputCreator<dim>::cell(
-  MeshWorker::DoFInfo<dim>dinfo,
-  MeshWorker::IntegrationInfo<dim>info)
+  MeshWorker::DoFInfo<dim> &dinfo,
+  MeshWorker::IntegrationInfo<dim> &info)
 {
-  const FEValuesBase<dim>fe = info.fe_values();
-  const std::vector<std::vector<double> >uh = info.values[0];
+  const FEValuesBase<dim> &fe = info.fe_values();
+  const std::vector<std::vector<double> > &uh = info.values[0];
 
   const unsigned int square_root = static_cast<unsigned int>(std::pow(fe.n_quadrature_points, 1./dim)+.5);
   for (unsigned int k1=0; k1<square_root; ++k1)
-  {
-    for (unsigned int k2=0; k2<square_root; ++k2)
     {
-      for(unsigned int d=0; d<dim; ++d)
-        dinfo.quadrature_value(k1*square_root+k2, d) = fe.quadrature_point(k1*square_root+k2)[d];
-      for(unsigned int i=0; i<uh.size(); ++i)
-        dinfo.quadrature_value(k1*square_root+k2, i+dim) = uh[i][k1*square_root+k2];
+      for (unsigned int k2=0; k2<square_root; ++k2)
+        {
+          for (unsigned int d=0; d<dim; ++d)
+            dinfo.quadrature_value(k1*square_root+k2, d) = fe.quadrature_point(k1*square_root+k2)[d];
+          for (unsigned int i=0; i<uh.size(); ++i)
+            dinfo.quadrature_value(k1*square_root+k2, i+dim) = uh[i][k1*square_root+k2];
+        }
     }
-  }
 }
 
 
 template <int dim>
 class LaplaceProblem
 {
-  public:
-    typedef MeshWorker::IntegrationInfo<dim> CellInfo;
+public:
+  typedef MeshWorker::IntegrationInfo<dim> CellInfo;
 
-    LaplaceProblem (const unsigned int deg);
-    void run ();
+  LaplaceProblem (const unsigned int deg);
+  void run ();
 
-  private:
-    void setup_system ();
-    void test ();
-    void output_gpl(const MGDoFHandler<dim> &dof,
-        MGLevelObject<Vector<double> > &v);
-    void refine_local ();
+private:
+  void setup_system ();
+  void test ();
+  void output_gpl(const MGDoFHandler<dim> &dof,
+                  MGLevelObject<Vector<double> > &v);
+  void refine_local ();
 
-    Triangulation<dim>   triangulation;
-    const MappingQ1<dim>      mapping;
-    FESystem<dim>            fe;
-    MGDoFHandler<dim>    mg_dof_handler;
-    MGDoFHandler<dim>    mg_dof_handler_renumbered;
+  Triangulation<dim>   triangulation;
+  const MappingQ1<dim>      mapping;
+  FESystem<dim>            fe;
+  MGDoFHandler<dim>    mg_dof_handler;
+  MGDoFHandler<dim>    mg_dof_handler_renumbered;
 
-    const unsigned int degree;
-    std::vector<std::set<unsigned int> >
-      boundary_indices, boundary_indices_renumbered;
+  const unsigned int degree;
+  std::vector<std::set<unsigned int> >
+  boundary_indices, boundary_indices_renumbered;
 
 };
 
@@ -251,7 +251,7 @@ LaplaceProblem<dim>::LaplaceProblem (const unsigned int deg) :
 {}
 
 
-  template <int dim>
+template <int dim>
 void LaplaceProblem<dim>::setup_system ()
 {
   mg_dof_handler.distribute_dofs (fe);
@@ -261,24 +261,24 @@ void LaplaceProblem<dim>::setup_system ()
 
   DoFHandler<dim> &dof = mg_dof_handler_renumbered;
   DoFRenumbering::component_wise (dof);
-  for (unsigned int level=0;level<nlevels;++level)
+  for (unsigned int level=0; level<nlevels; ++level)
     DoFRenumbering::component_wise (mg_dof_handler_renumbered, level);
 
   boundary_indices.resize(nlevels);
   boundary_indices_renumbered.resize(nlevels);
 
-  for(unsigned int l=0; l<nlevels; ++l)
-  {
-    boundary_indices_renumbered[l].clear();
-    boundary_indices[l].clear();
-  }
+  for (unsigned int l=0; l<nlevels; ++l)
+    {
+      boundary_indices_renumbered[l].clear();
+      boundary_indices[l].clear();
+    }
 
   deallog << "Number of degrees of freedom: "
-    << mg_dof_handler.n_dofs();
+          << mg_dof_handler.n_dofs();
 
-  for (unsigned int l=0;l<triangulation.n_levels();++l)
+  for (unsigned int l=0; l<triangulation.n_levels(); ++l)
     deallog << "   " << 'L' << l << ": "
-      << mg_dof_handler.n_dofs(l);
+            << mg_dof_handler.n_dofs(l);
   deallog  << std::endl;
 
 }
@@ -286,7 +286,7 @@ void LaplaceProblem<dim>::setup_system ()
 template <int dim>
 void
 LaplaceProblem<dim>::output_gpl(const MGDoFHandler<dim> &dof,
-    MGLevelObject<Vector<double> > &v)
+                                MGLevelObject<Vector<double> > &v)
 {
   MeshWorker::IntegrationInfoBox<dim> info_box;
   const unsigned int n_gauss_points = dof.get_fe().tensor_degree();
@@ -306,23 +306,23 @@ LaplaceProblem<dim>::output_gpl(const MGDoFHandler<dim> &dof,
   MeshWorker::Assembler::GnuplotPatch assembler;
   assembler.initialize(n_gauss_points+1, dof.get_fe().n_components());
 
-  for(unsigned int l=0; l<triangulation.n_levels(); ++l)
-  {
-    OutputCreator<dim> matrix_integrator;
-    MeshWorker::loop<dim, dim, MeshWorker::DoFInfo<dim>, MeshWorker::IntegrationInfoBox<dim> > (
-      dof.begin(l), dof.end(l),
-      dof_info, info_box,
-      std_cxx1x::bind(&OutputCreator<dim>::cell, &matrix_integrator, std_cxx1x::_1, std_cxx1x::_2),
-      0,
-      0,
-      assembler);
-  }
+  for (unsigned int l=0; l<triangulation.n_levels(); ++l)
+    {
+      OutputCreator<dim> matrix_integrator;
+      MeshWorker::loop<dim, dim, MeshWorker::DoFInfo<dim>, MeshWorker::IntegrationInfoBox<dim> > (
+        dof.begin(l), dof.end(l),
+        dof_info, info_box,
+        std_cxx1x::bind(&OutputCreator<dim>::cell, &matrix_integrator, std_cxx1x::_1, std_cxx1x::_2),
+        0,
+        0,
+        assembler);
+    }
 }
 
 
 
 
-  template <int dim>
+template <int dim>
 void LaplaceProblem<dim>::test ()
 {
   typename FunctionMap<dim>::type      dirichlet_boundary;
@@ -354,73 +354,73 @@ void LaplaceProblem<dim>::test ()
 
   initialize(mg_dof_handler_renumbered, test);
   mg_transfer_renumbered.copy_to_mg(mg_dof_handler_renumbered, u, test);
-  for(unsigned int l=0; l<triangulation.n_levels(); ++l)
-  {
-    diff(d[l], mg_dof_handler_renumbered, u[l],l);
-    deallog << l << " " << u[l].l2_norm() << '\t' << v[l].l2_norm() << '\t'
-      << d[l].l2_norm()<< std::endl;
-    for(unsigned int i=0; i<d[l].size(); ++i)
-      if(d[l](i)!=0)
-        deallog << i << " " << d[l](i) << std::endl;
-  }
+  for (unsigned int l=0; l<triangulation.n_levels(); ++l)
+    {
+      diff(d[l], mg_dof_handler_renumbered, u[l],l);
+      deallog << l << " " << u[l].l2_norm() << '\t' << v[l].l2_norm() << '\t'
+              << d[l].l2_norm()<< std::endl;
+      for (unsigned int i=0; i<d[l].size(); ++i)
+        if (d[l](i)!=0)
+          deallog << i << " " << d[l](i) << std::endl;
+    }
   output_gpl(mg_dof_handler_renumbered, d);
 }
 
 
 
-  template <int dim>
+template <int dim>
 void LaplaceProblem<dim>::refine_local ()
 {
   bool cell_refined = false;
   for (typename Triangulation<dim>::active_cell_iterator
-      cell = triangulation.begin_active();
-      cell != triangulation.end(); ++cell)
-  {
+       cell = triangulation.begin_active();
+       cell != triangulation.end(); ++cell)
+    {
       for (unsigned int vertex=0;
-          vertex < GeometryInfo<dim>::vertices_per_cell;
-          ++vertex)
-      {
-        const Point<dim> p = cell->vertex(vertex);
-        const Point<dim> origin = (dim == 2 ?
-                                    Point<dim>(0,0) :
-                                    Point<dim>(0,0,0));
-        const double dist = p.distance(origin);
-        if(dist<0.25/M_PI)
+           vertex < GeometryInfo<dim>::vertices_per_cell;
+           ++vertex)
         {
-          cell->set_refine_flag ();
-          cell_refined = true;
-          break;
+          const Point<dim> p = cell->vertex(vertex);
+          const Point<dim> origin = (dim == 2 ?
+                                     Point<dim>(0,0) :
+                                     Point<dim>(0,0,0));
+          const double dist = p.distance(origin);
+          if (dist<0.25/M_PI)
+            {
+              cell->set_refine_flag ();
+              cell_refined = true;
+              break;
+            }
         }
-      }
-  }
+    }
   //Wenn nichts verfeinert wurde bisher, global verfeinern!
-  if(!cell_refined)
+  if (!cell_refined)
     for (typename Triangulation<dim>::active_cell_iterator
-        cell = triangulation.begin_active();
-        cell != triangulation.end(); ++cell)
+         cell = triangulation.begin_active();
+         cell != triangulation.end(); ++cell)
       cell->set_refine_flag();
 
 
   triangulation.execute_coarsening_and_refinement ();
 }
 
-  template <int dim>
+template <int dim>
 void LaplaceProblem<dim>::run ()
 {
   for (unsigned int cycle=0; cycle<6; ++cycle)
-  {
-    deallog << "Cycle " << cycle << std::endl;
-
-    if (cycle == 0)
     {
-      GridGenerator::hyper_cube(triangulation, -1, 1);
-      triangulation.refine_global (1);
-    }
-    //triangulation.refine_global (1);
-    refine_local ();
-    setup_system ();
-    test();
-  };
+      deallog << "Cycle " << cycle << std::endl;
+
+      if (cycle == 0)
+        {
+          GridGenerator::hyper_cube(triangulation, -1, 1);
+          triangulation.refine_global (1);
+        }
+      //triangulation.refine_global (1);
+      refine_local ();
+      setup_system ();
+      test();
+    };
 }
 
 int main ()
index 878b01afe0d94a87643facacdd3e3a7452dd9b8f..e11ec2828e73526d481beb002cb8b7c3a22a92a6 100644 (file)
@@ -44,54 +44,53 @@ void check()
 {
   FESystem<dim> fe(FE_DGP<dim>(1), 1, FE_DGQ<dim>(2), 2, FE_Q<dim>(3), 1);
   deallog << fe.get_name() << std::endl;
-  
+
   Triangulation<dim> tr;
   GridGenerator::hyper_cube(tr);
   tr.refine_global(1);
   tr.begin_active()->set_refine_flag();
   tr.execute_coarsening_and_refinement ();
-  
+
   MGDoFHandler<dim> mgdof(tr);
   mgdof.distribute_dofs(fe);
   DoFRenumbering::component_wise (mgdof);
 
   typename MGDoFHandler<dim>::cell_iterator
-    cell = mgdof.begin(),
-    endc = mgdof.end();
+  cell = mgdof.begin(),
+  endc = mgdof.end();
   std::vector<types::global_dof_index> local_dof_indices (fe.dofs_per_cell);
   std::vector<types::global_dof_index> mg_dof_indices (fe.dofs_per_cell);
   for (; cell!=endc; ++cell)
     {
       if (!cell->has_children())
-       {
-         deallog << "Global numbering: ";
-         cell->get_dof_indices (local_dof_indices);
-         for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
-           deallog << local_dof_indices[i] << ' ';
-         deallog << std::endl;
-       }
-      
+        {
+          deallog << "Global numbering: ";
+          cell->get_dof_indices (local_dof_indices);
+          for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
+            deallog << local_dof_indices[i] << ' ';
+          deallog << std::endl;
+        }
+
       deallog << "MG levelwise numbering: ";
       cell->get_mg_dof_indices (mg_dof_indices);
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
-       deallog << mg_dof_indices[i] << ' ';
+        deallog << mg_dof_indices[i] << ' ';
       deallog << std::endl;
 
-                                      // assert at locally on each
-                                      // cell that dofs with lower
-                                      // component also have lower
-                                      // dof index
+      // assert at locally on each
+      // cell that dofs with lower
+      // component also have lower
+      // dof index
       for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
-       for (unsigned int j=i+1; j<fe.dofs_per_cell; ++j)
-         if (fe.system_to_component_index(i).first <
-             fe.system_to_component_index(j).first)
-           Assert (mg_dof_indices[i] < mg_dof_indices[j],
-                   ExcInternalError())
-         else
-           if (fe.system_to_component_index(i).first >
-               fe.system_to_component_index(j).first)
-             Assert (mg_dof_indices[i] > mg_dof_indices[j],
-                     ExcInternalError());
+        for (unsigned int j=i+1; j<fe.dofs_per_cell; ++j)
+          if (fe.system_to_component_index(i).first <
+              fe.system_to_component_index(j).first)
+            Assert (mg_dof_indices[i] < mg_dof_indices[j],
+                    ExcInternalError())
+            else if (fe.system_to_component_index(i).first >
+                     fe.system_to_component_index(j).first)
+              Assert (mg_dof_indices[i] > mg_dof_indices[j],
+                      ExcInternalError());
     }
 }
 
index e14d0d0829de40d5a454d280a762c8f8cfdacce4..21c419049a4cb0ef99b701d108a6a39d93f2c52c 100644 (file)
@@ -45,7 +45,7 @@ void check()
 {
   FE_DGQ<dim> fe(1);
   deallog << fe.get_name() << std::endl;
-  
+
   Triangulation<dim> tria;
   GridGenerator::hyper_cube(tria);
   tria.refine_global(2);
@@ -53,7 +53,7 @@ void check()
   for (unsigned int i=0; i<GeometryInfo<dim>::max_children_per_cell; ++i, ++cell)
     cell->set_coarsen_flag();
   tria.execute_coarsening_and_refinement ();
-  
+
   MGDoFHandler<dim> mg_dof_handler(tria);
   mg_dof_handler.distribute_dofs(fe);
   Point<dim> a;
index 76cadb50ecaf94016da1249aa8e4b0625bd601e5..b770c0cd3dab1e6933c76807f17da2d01bf87bb5 100644 (file)
@@ -47,7 +47,7 @@ void check()
 {
   FE_Q<dim> fe(3);
   deallog << fe.get_name() << std::endl;
-  
+
   Triangulation<dim> tria;
   GridGenerator::hyper_cube(tria);
   tria.refine_global(2);
@@ -55,7 +55,7 @@ void check()
   for (unsigned int i=0; i<GeometryInfo<dim>::max_children_per_cell; ++i, ++cell)
     cell->set_coarsen_flag();
   tria.execute_coarsening_and_refinement ();
-  
+
   MGDoFHandler<dim> mg_dof_handler(tria);
   mg_dof_handler.distribute_dofs(fe);
   for (unsigned int level=0; level<tria.n_levels(); ++level)
@@ -63,7 +63,7 @@ void check()
       const types::global_dof_index n_dofs=mg_dof_handler.n_dofs(level);
       vector<types::global_dof_index> new_numbers(n_dofs);
       for (unsigned int i=0; i<n_dofs; ++i)
-       new_numbers[i]=n_dofs-1-i;
+        new_numbers[i]=n_dofs-1-i;
 
       mg_dof_handler.renumber_dofs(level, new_numbers);
     }
index 89db6012a546abae6ad38459d8d5ef1df6a40fe5..d9d86cab4dde88b658bd736b2ed35cfd274cfd8c 100644 (file)
@@ -33,47 +33,47 @@ using namespace std;
 template <typename number>
 class ScalingMatrix : public Subscriptor
 {
-  public:
-                                    /**
-                                     * Constructor setting the
-                                     * scaling factor. Default is
-                                     * constructing the identity
-                                     * matrix.
-                                     */
-    ScalingMatrix(number scaling_factor = 1.);
-                                    /**
-                                     * Apply preconditioner.
-                                     */
-    template<class VECTOR>
-    void vmult (VECTOR&, const VECTOR&) const;
-
-                                    /**
-                                     * Apply transpose
-                                     * preconditioner. Since this is
-                                     * the identity, this function is
-                                     * the same as
-                                     * vmult().
-                                     */
-    template<class VECTOR>
-    void Tvmult (VECTOR&, const VECTOR&) const;
-                                    /**
-                                     * Apply preconditioner, adding to the previous value.
-                                     */
-    template<class VECTOR>
-    void vmult_add (VECTOR&, const VECTOR&) const;
-
-                                    /**
-                                     * Apply transpose
-                                     * preconditioner, adding. Since this is
-                                     * the identity, this function is
-                                     * the same as
-                                     * vmult_add().
-                                     */
-    template<class VECTOR>
-    void Tvmult_add (VECTOR&, const VECTOR&) const;
-
-  private:
-    number factor;
+public:
+  /**
+   * Constructor setting the
+   * scaling factor. Default is
+   * constructing the identity
+   * matrix.
+   */
+  ScalingMatrix(number scaling_factor = 1.);
+  /**
+  * Apply preconditioner.
+  */
+  template<class VECTOR>
+  void vmult (VECTOR &, const VECTOR &) const;
+
+  /**
+   * Apply transpose
+   * preconditioner. Since this is
+   * the identity, this function is
+   * the same as
+   * vmult().
+   */
+  template<class VECTOR>
+  void Tvmult (VECTOR &, const VECTOR &) const;
+  /**
+   * Apply preconditioner, adding to the previous value.
+   */
+  template<class VECTOR>
+  void vmult_add (VECTOR &, const VECTOR &) const;
+
+  /**
+   * Apply transpose
+   * preconditioner, adding. Since this is
+   * the identity, this function is
+   * the same as
+   * vmult_add().
+   */
+  template<class VECTOR>
+  void Tvmult_add (VECTOR &, const VECTOR &) const;
+
+private:
+  number factor;
 };
 
 
@@ -81,8 +81,8 @@ class ScalingMatrix : public Subscriptor
 
 template<typename number>
 ScalingMatrix<number>::ScalingMatrix(number factor)
-               :
-               factor(factor)
+  :
+  factor(factor)
 {}
 
 
@@ -123,59 +123,59 @@ ScalingMatrix<number>::Tvmult_add (VECTOR &dst, const VECTOR &src) const
 //----------------------------------------------------------------------//
 
 template<class MATRIX, class RELAX>
-void check_smoother(const MGLevelObject<MATRIX>m,
-                   const MGLevelObject<RELAX>& r)
+void check_smoother(const MGLevelObject<MATRIX> &m,
+                    const MGLevelObject<RELAX> &r)
 {
   GrowingVectorMemory<BlockVector<double> > mem;
   MGSmootherBlock<MATRIX, RELAX, double> smoother(mem);
-  
+
   smoother.initialize(m, r);
 
-  for (unsigned int l=m.min_level(); l<= m.max_level();++l)
+  for (unsigned int l=m.min_level(); l<= m.max_level(); ++l)
     {
       deallog << "Level " << l << std::endl;
-      
-      BlockVector<double>u = *mem.alloc();
-      BlockVector<double>f = *mem.alloc();
+
+      BlockVector<double> &u = *mem.alloc();
+      BlockVector<double> &f = *mem.alloc();
       u.reinit(m[l].n_block_rows(), 3);
       f.reinit(u);
-      for (unsigned int b=0;b<f.n_blocks();++b)
-       for (unsigned int i=0;i<f.block(b).size();++i)
-         f.block(b)(i) = (b+1)*(i+l);
-      
+      for (unsigned int b=0; b<f.n_blocks(); ++b)
+        for (unsigned int i=0; i<f.block(b).size(); ++i)
+          f.block(b)(i) = (b+1)*(i+l);
+
       deallog << "First step" << std::endl;
       smoother.set_steps(1);
       smoother.smooth(l, u, f);
-      
-      for (unsigned int b=0;b<u.n_blocks();++b)
-       {
-         for (unsigned int i=0;i<u.block(b).size();++i)
-           deallog << '\t' << (int) (u.block(b)(i)+.5);
-         deallog << std::endl;
-       }
-      
+
+      for (unsigned int b=0; b<u.n_blocks(); ++b)
+        {
+          for (unsigned int i=0; i<u.block(b).size(); ++i)
+            deallog << '\t' << (int) (u.block(b)(i)+.5);
+          deallog << std::endl;
+        }
+
       deallog << "Second step" << std::endl;
       smoother.smooth(l, u, f);
-      
-      for (unsigned int b=0;b<u.n_blocks();++b)
-       {
-         for (unsigned int i=0;i<u.block(b).size();++i)
-           deallog << '\t' << (int) (u.block(b)(i)+.5);
-         deallog << std::endl;
-       }
-      
+
+      for (unsigned int b=0; b<u.n_blocks(); ++b)
+        {
+          for (unsigned int i=0; i<u.block(b).size(); ++i)
+            deallog << '\t' << (int) (u.block(b)(i)+.5);
+          deallog << std::endl;
+        }
+
       deallog << "Two steps" << std::endl;
       u = 0.;
       smoother.set_steps(2);
       smoother.smooth(l, u, f);
-      
-      for (unsigned int b=0;b<u.n_blocks();++b)
-       {
-         for (unsigned int i=0;i<u.block(b).size();++i)
-           deallog << '\t' << (int) (u.block(b)(i)+.5);
-         deallog << std::endl;
-       }
-      
+
+      for (unsigned int b=0; b<u.n_blocks(); ++b)
+        {
+          for (unsigned int i=0; i<u.block(b).size(); ++i)
+            deallog << '\t' << (int) (u.block(b)(i)+.5);
+          deallog << std::endl;
+        }
+
       mem.free(&u);
       mem.free(&f);
     }
@@ -186,24 +186,24 @@ void check()
   ScalingMatrix<double> s1(-1.);
   ScalingMatrix<double> s2(2.);
   ScalingMatrix<double> s8(8.);
-  
+
   GrowingVectorMemory<Vector<double> > mem;
   MGLevelObject<BlockMatrixArray<double> > A (2,4);
   MGLevelObject<BlockTrianglePrecondition<double> > P(2,4);
-  
-  for (unsigned int l=A.min_level(); l<= A.max_level();++l)
+
+  for (unsigned int l=A.min_level(); l<= A.max_level(); ++l)
     {
       A[l].initialize(3, 3);
       P[l].reinit(3);
-      for (unsigned int b=0;b<A[l].n_block_rows();++b)
-       {
-         P[l].enter(s2, b, b, A[l].n_block_rows()-b);
-         A[l].enter(s8, b, b, 1);
-         for (unsigned int b2=0;b2<A[l].n_block_rows();++b2)
-           A[l].enter(s1,b,b2,1.);
-       }
+      for (unsigned int b=0; b<A[l].n_block_rows(); ++b)
+        {
+          P[l].enter(s2, b, b, A[l].n_block_rows()-b);
+          A[l].enter(s8, b, b, 1);
+          for (unsigned int b2=0; b2<A[l].n_block_rows(); ++b2)
+            A[l].enter(s1,b,b2,1.);
+        }
     }
-  
+
   check_smoother(A, P);
 }
 
index 812f68beb01ab0f9e66f40e85642f1948944892e..1d881e62b5f41400bb878eee7fc5ce82f101219b 100644 (file)
 #include "../tests.h"
 #include <deal.II/base/logstream.h>
 
-                                // As discussed in the introduction, most of
-                                // this program is copied almost verbatim
-                                // from step-6, which itself is only a slight
-                                // modification of step-5. Consequently, a
-                                // significant part of this program is not
-                                // new if you've read all the material up to
-                                // step-6, and we won't comment on that part
-                                // of the functionality that is
-                                // unchanged. Rather, we will focus on those
-                                // aspects of the program that have to do
-                                // with the multigrid functionality which
-                                // forms the new aspect of this tutorial
-                                // program.
-
-                                 // @sect3{Include files}
-
-                                // Again, the first few include files
-                                // are already known, so we won't
-                                // comment on them:
+// As discussed in the introduction, most of
+// this program is copied almost verbatim
+// from step-6, which itself is only a slight
+// modification of step-5. Consequently, a
+// significant part of this program is not
+// new if you've read all the material up to
+// step-6, and we won't comment on that part
+// of the functionality that is
+// unchanged. Rather, we will focus on those
+// aspects of the program that have to do
+// with the multigrid functionality which
+// forms the new aspect of this tutorial
+// program.
+
+// @sect3{Include files}
+
+// Again, the first few include files
+// are already known, so we won't
+// comment on them:
 #include <deal.II/base/quadrature_lib.h>
 #include <deal.II/base/function.h>
 #include <deal.II/base/logstream.h>
 #include <deal.II/numerics/data_out.h>
 #include <deal.II/numerics/error_estimator.h>
 
-                                // These, now, are the include necessary for
-                                // the multi-level methods. The first two
-                                // declare classes that allow us to enumerate
-                                // degrees of freedom not only on the finest
-                                // mesh level, but also on intermediate
-                                // levels (that's what the MGDoFHandler class
-                                // does) as well as allow to access this
-                                // information (iterators and accessors over
-                                // these cells).
-                                //
-                                // The rest of the include files deals with
-                                // the mechanics of multigrid as a linear
-                                // operator (solver or preconditioner).
+// These, now, are the include necessary for
+// the multi-level methods. The first two
+// declare classes that allow us to enumerate
+// degrees of freedom not only on the finest
+// mesh level, but also on intermediate
+// levels (that's what the MGDoFHandler class
+// does) as well as allow to access this
+// information (iterators and accessors over
+// these cells).
+//
+// The rest of the include files deals with
+// the mechanics of multigrid as a linear
+// operator (solver or preconditioner).
 #include <deal.II/multigrid/mg_dof_handler.h>
 #include <deal.II/multigrid/multigrid.h>
 #include <deal.II/multigrid/mg_transfer.h>
 #include <deal.II/multigrid/mg_smoother.h>
 #include <deal.II/multigrid/mg_matrix.h>
 
-                                // This is C++:
+// This is C++:
 #include <fstream>
 #include <sstream>
 
-                                // The last step is as in all
-                                // previous programs:
+// The last step is as in all
+// previous programs:
 using namespace dealii;
 
 
-                                 // @sect3{The <code>LaplaceProblem</code> class template}
+// @sect3{The <code>LaplaceProblem</code> class template}
 
-                                // This main class is basically the same
-                                // class as in step-6. As far as member
-                                // functions is concerned, the only addition
-                                // is the <code>assemble_multigrid</code>
-                                // function that assembles the matrices that
-                                // correspond to the discrete operators on
-                                // intermediate levels:
+// This main class is basically the same
+// class as in step-6. As far as member
+// functions is concerned, the only addition
+// is the <code>assemble_multigrid</code>
+// function that assembles the matrices that
+// correspond to the discrete operators on
+// intermediate levels:
 template <int dim>
 class LaplaceProblem
 {
-  public:
-    LaplaceProblem (const unsigned int deg);
-    void run ();
-
-  private:
-    void setup_system ();
-    void assemble_system ();
-    void assemble_multigrid ();
-    void solve ();
-    void refine_grid ();
-    void output_results (const unsigned int cycle) const;
-
-    Triangulation<dim>   triangulation;
-    FE_Q<dim>            fe;
-    MGDoFHandler<dim>    mg_dof_handler;
-
-    SparsityPattern      sparsity_pattern;
-    SparseMatrix<double> system_matrix;
-
-    ConstraintMatrix     hanging_node_constraints;
-    ConstraintMatrix     constraints;
-
-    Vector<double>       solution;
-    Vector<double>       system_rhs;
-
-    const unsigned int degree;
-
-                                    // The following three objects are the
-                                    // only additional member variables,
-                                    // compared to step-6. They represent the
-                                    // operators that act on individual
-                                    // levels of the multilevel hierarchy,
-                                    // rather than on the finest mesh as do
-                                    // the objects above.
-                                    //
-                                    // To facilitate having objects on each
-                                    // level of a multilevel hierarchy,
-                                    // deal.II has the MGLevelObject class
-                                    // template that provides storage for
-                                    // objects on each level. What we need
-                                    // here are matrices on each level, which
-                                    // implies that we also need sparsity
-                                    // patterns on each level. As outlined in
-                                    // the @ref mg_paper, the operators
-                                    // (matrices) that we need are actually
-                                    // twofold: one on the interior of each
-                                    // level, and one at the interface
-                                    // between each level and that part of
-                                    // the domain where the mesh is
-                                    // coarser. In fact, we will need the
-                                    // latter in two versions: for the
-                                    // direction from coarse to fine mesh and
-                                    // from fine to coarse. Fortunately,
-                                    // however, we here have a self-adjoint
-                                    // problem for which one of these is the
-                                    // transpose of the other, and so we only
-                                    // have to build one; we choose the one
-                                    // from coarse to fine.
-    MGLevelObject<SparsityPattern>       mg_sparsity_patterns;
-    MGLevelObject<SparseMatrix<double> > mg_matrices;
-    MGLevelObject<SparseMatrix<double> > mg_interface_matrices;
-    MGConstrainedDoFs                    mg_constrained_dofs;
+public:
+  LaplaceProblem (const unsigned int deg);
+  void run ();
+
+private:
+  void setup_system ();
+  void assemble_system ();
+  void assemble_multigrid ();
+  void solve ();
+  void refine_grid ();
+  void output_results (const unsigned int cycle) const;
+
+  Triangulation<dim>   triangulation;
+  FE_Q<dim>            fe;
+  MGDoFHandler<dim>    mg_dof_handler;
+
+  SparsityPattern      sparsity_pattern;
+  SparseMatrix<double> system_matrix;
+
+  ConstraintMatrix     hanging_node_constraints;
+  ConstraintMatrix     constraints;
+
+  Vector<double>       solution;
+  Vector<double>       system_rhs;
+
+  const unsigned int degree;
+
+  // The following three objects are the
+  // only additional member variables,
+  // compared to step-6. They represent the
+  // operators that act on individual
+  // levels of the multilevel hierarchy,
+  // rather than on the finest mesh as do
+  // the objects above.
+  //
+  // To facilitate having objects on each
+  // level of a multilevel hierarchy,
+  // deal.II has the MGLevelObject class
+  // template that provides storage for
+  // objects on each level. What we need
+  // here are matrices on each level, which
+  // implies that we also need sparsity
+  // patterns on each level. As outlined in
+  // the @ref mg_paper, the operators
+  // (matrices) that we need are actually
+  // twofold: one on the interior of each
+  // level, and one at the interface
+  // between each level and that part of
+  // the domain where the mesh is
+  // coarser. In fact, we will need the
+  // latter in two versions: for the
+  // direction from coarse to fine mesh and
+  // from fine to coarse. Fortunately,
+  // however, we here have a self-adjoint
+  // problem for which one of these is the
+  // transpose of the other, and so we only
+  // have to build one; we choose the one
+  // from coarse to fine.
+  MGLevelObject<SparsityPattern>       mg_sparsity_patterns;
+  MGLevelObject<SparseMatrix<double> > mg_matrices;
+  MGLevelObject<SparseMatrix<double> > mg_interface_matrices;
+  MGConstrainedDoFs                    mg_constrained_dofs;
 };
 
 
 
-                                 // @sect3{Nonconstant coefficients}
+// @sect3{Nonconstant coefficients}
 
-                                // The implementation of nonconstant
-                                // coefficients is copied verbatim
-                                // from step-5 and step-6:
+// The implementation of nonconstant
+// coefficients is copied verbatim
+// from step-5 and step-6:
 
 template <int dim>
 class Coefficient : public Function<dim>
 {
-  public:
-    Coefficient () : Function<dim>() {}
+public:
+  Coefficient () : Function<dim>() {}
 
-    virtual double value (const Point<dim>   &p,
-                         const unsigned int  component = 0) const;
+  virtual double value (const Point<dim>   &p,
+                        const unsigned int  component = 0) const;
 
-    virtual void value_list (const std::vector<Point<dim> > &points,
-                            std::vector<double>            &values,
-                            const unsigned int              component = 0) const;
+  virtual void value_list (const std::vector<Point<dim> > &points,
+                           std::vector<double>            &values,
+                           const unsigned int              component = 0) const;
 };
 
 
 
 template <int dim>
 double Coefficient<dim>::value (const Point<dim> &p,
-                               const unsigned int) const
+                                const unsigned int) const
 {
   if (p.square() < 0.5*0.5)
     return 20;
@@ -215,87 +215,87 @@ double Coefficient<dim>::value (const Point<dim> &p,
 
 template <int dim>
 void Coefficient<dim>::value_list (const std::vector<Point<dim> > &points,
-                                  std::vector<double>            &values,
-                                  const unsigned int              component) const
+                                   std::vector<double>            &values,
+                                   const unsigned int              component) const
 {
   const unsigned int n_points = points.size();
 
   Assert (values.size() == n_points,
-         ExcDimensionMismatch (values.size(), n_points));
+          ExcDimensionMismatch (values.size(), n_points));
 
   Assert (component == 0,
-         ExcIndexRange (component, 0, 1));
+          ExcIndexRange (component, 0, 1));
 
   for (unsigned int i=0; i<n_points; ++i)
     values[i] = Coefficient<dim>::value (points[i]);
 }
 
 
-                                 // @sect3{The <code>LaplaceProblem</code> class implementation}
-
-                                 // @sect4{LaplaceProblem::LaplaceProblem}
-
-                                // The constructor is left mostly
-                                // unchanged. We take the polynomial degree
-                                // of the finite elements to be used as a
-                                // constructor argument and store it in a
-                                // member variable.
-                                //
-                                // By convention, all adaptively refined
-                                // triangulations in deal.II never change by
-                                // more than one level across a face between
-                                // cells. For our multigrid algorithms,
-                                // however, we need a slightly stricter
-                                // guarantee, namely that the mesh also does
-                                // not change by more than refinement level
-                                // across vertices that might connect two
-                                // cells. In other words, we must prevent the
-                                // following situation:
-                                //
-                                // @image html limit_level_difference_at_vertices.png ""
-                                //
-                                // This is achieved by passing the
-                                // Triangulation::limit_level_difference_at_vertices
-                                // flag to the constructor of the
-                                // triangulation class.
+// @sect3{The <code>LaplaceProblem</code> class implementation}
+
+// @sect4{LaplaceProblem::LaplaceProblem}
+
+// The constructor is left mostly
+// unchanged. We take the polynomial degree
+// of the finite elements to be used as a
+// constructor argument and store it in a
+// member variable.
+//
+// By convention, all adaptively refined
+// triangulations in deal.II never change by
+// more than one level across a face between
+// cells. For our multigrid algorithms,
+// however, we need a slightly stricter
+// guarantee, namely that the mesh also does
+// not change by more than refinement level
+// across vertices that might connect two
+// cells. In other words, we must prevent the
+// following situation:
+//
+// @image html limit_level_difference_at_vertices.png ""
+//
+// This is achieved by passing the
+// Triangulation::limit_level_difference_at_vertices
+// flag to the constructor of the
+// triangulation class.
 template <int dim>
 LaplaceProblem<dim>::LaplaceProblem (const unsigned int degree)
-               :
-               triangulation (Triangulation<dim>::
-                              limit_level_difference_at_vertices),
-               fe (degree),
-               mg_dof_handler (triangulation),
-               degree(degree)
+  :
+  triangulation (Triangulation<dim>::
+                 limit_level_difference_at_vertices),
+  fe (degree),
+  mg_dof_handler (triangulation),
+  degree(degree)
 {}
 
 
 
-                                 // @sect4{LaplaceProblem::setup_system}
+// @sect4{LaplaceProblem::setup_system}
 
-                                // The following function extends what the
-                                // corresponding one in step-6 did. The top
-                                // part, apart from the additional output,
-                                // does the same:
+// The following function extends what the
+// corresponding one in step-6 did. The top
+// part, apart from the additional output,
+// does the same:
 template <int dim>
 void LaplaceProblem<dim>::setup_system ()
 {
   mg_dof_handler.distribute_dofs (fe);
 
-                                  // Here we output not only the
-                                  // degrees of freedom on the finest
-                                  // level, but also in the
-                                  // multilevel structure
+  // Here we output not only the
+  // degrees of freedom on the finest
+  // level, but also in the
+  // multilevel structure
   deallog << "Number of degrees of freedom: "
-         << mg_dof_handler.n_dofs();
+          << mg_dof_handler.n_dofs();
 
-  for (unsigned int l=0;l<triangulation.n_levels();++l)
+  for (unsigned int l=0; l<triangulation.n_levels(); ++l)
     deallog << "   " << 'L' << l << ": "
-           << mg_dof_handler.n_dofs(l);
+            << mg_dof_handler.n_dofs(l);
   deallog  << std::endl;
 
   sparsity_pattern.reinit (mg_dof_handler.n_dofs(),
-                          mg_dof_handler.n_dofs(),
-                          mg_dof_handler.max_couplings_between_dofs());
+                           mg_dof_handler.n_dofs(),
+                           mg_dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (
     static_cast<const DoFHandler<dim>&>(mg_dof_handler),
     sparsity_pattern);
@@ -303,28 +303,28 @@ void LaplaceProblem<dim>::setup_system ()
   solution.reinit (mg_dof_handler.n_dofs());
   system_rhs.reinit (mg_dof_handler.n_dofs());
 
-                                  // But it starts to be a wee bit different
-                                  // here, although this still doesn't have
-                                  // anything to do with multigrid
-                                  // methods. step-6 took care of boundary
-                                  // values and hanging nodes in a separate
-                                  // step after assembling the global matrix
-                                  // from local contributions. This works,
-                                  // but the same can be done in a slightly
-                                  // simpler way if we already take care of
-                                  // these constraints at the time of copying
-                                  // local contributions into the global
-                                  // matrix. To this end, we here do not just
-                                  // compute the constraints do to hanging
-                                  // nodes, but also due to zero boundary
-                                  // conditions. Both kinds of constraints
-                                  // can be put into the same object
-                                  // (<code>constraints</code>), and we will
-                                  // use this set of constraints later on to
-                                  // help us copy local contributions
-                                  // correctly into the global linear system
-                                  // right away, without the need for a later
-                                  // clean-up stage:
+  // But it starts to be a wee bit different
+  // here, although this still doesn't have
+  // anything to do with multigrid
+  // methods. step-6 took care of boundary
+  // values and hanging nodes in a separate
+  // step after assembling the global matrix
+  // from local contributions. This works,
+  // but the same can be done in a slightly
+  // simpler way if we already take care of
+  // these constraints at the time of copying
+  // local contributions into the global
+  // matrix. To this end, we here do not just
+  // compute the constraints do to hanging
+  // nodes, but also due to zero boundary
+  // conditions. Both kinds of constraints
+  // can be put into the same object
+  // (<code>constraints</code>), and we will
+  // use this set of constraints later on to
+  // help us copy local contributions
+  // correctly into the global linear system
+  // right away, without the need for a later
+  // clean-up stage:
   constraints.clear ();
   hanging_node_constraints.clear ();
   DoFTools::make_hanging_node_constraints (mg_dof_handler, constraints);
@@ -335,8 +335,8 @@ void LaplaceProblem<dim>::setup_system ()
   MappingQ1<dim> mapping;
   VectorTools::interpolate_boundary_values (mapping,
                                             mg_dof_handler,
-                                           dirichlet_boundary,
-                                           constraints);
+                                            dirichlet_boundary,
+                                            constraints);
   constraints.close ();
   hanging_node_constraints.close ();
   constraints.condense (sparsity_pattern);
@@ -345,21 +345,21 @@ void LaplaceProblem<dim>::setup_system ()
 
   mg_constrained_dofs.clear();
   mg_constrained_dofs.initialize(mg_dof_handler, dirichlet_boundary);
-                                  // Now for the things that concern the
-                                  // multigrid data structures. First, we
-                                  // resize the multi-level objects to hold
-                                  // matrices and sparsity patterns for every
-                                  // level. The coarse level is zero (this is
-                                  // mandatory right now but may change in a
-                                  // future revision). Note that these
-                                  // functions take a complete, inclusive
-                                  // range here (not a starting index and
-                                  // size), so the finest level is
-                                  // <code>n_levels-1</code>.  We first have
-                                  // to resize the container holding the
-                                  // SparseMatrix classes, since they have to
-                                  // release their SparsityPattern before the
-                                  // can be destroyed upon resizing.
+  // Now for the things that concern the
+  // multigrid data structures. First, we
+  // resize the multi-level objects to hold
+  // matrices and sparsity patterns for every
+  // level. The coarse level is zero (this is
+  // mandatory right now but may change in a
+  // future revision). Note that these
+  // functions take a complete, inclusive
+  // range here (not a starting index and
+  // size), so the finest level is
+  // <code>n_levels-1</code>.  We first have
+  // to resize the container holding the
+  // SparseMatrix classes, since they have to
+  // release their SparsityPattern before the
+  // can be destroyed upon resizing.
   const unsigned int n_levels = triangulation.n_levels();
 
   mg_interface_matrices.resize(0, n_levels-1);
@@ -368,37 +368,37 @@ void LaplaceProblem<dim>::setup_system ()
   mg_matrices.clear ();
   mg_sparsity_patterns.resize(0, n_levels-1);
 
-                                  // Now, we have to provide a matrix on each
-                                  // level. To this end, we first use the
-                                  // MGTools::make_sparsity_pattern function
-                                  // to first generate a preliminary
-                                  // compressed sparsity pattern on each
-                                  // level (see the @ref Sparsity module for
-                                  // more information on this topic) and then
-                                  // copy it over to the one we really
-                                  // want. The next step is to initialize
-                                  // both kinds of level matrices with these
-                                  // sparsity patterns.
-                                  //
-                                  // It may be worth pointing out that the
-                                  // interface matrices only have entries for
-                                  // degrees of freedom that sit at or next
-                                  // to the interface between coarser and
-                                  // finer levels of the mesh. They are
-                                  // therefore even sparser than the matrices
-                                  // on the individual levels of our
-                                  // multigrid hierarchy. If we were more
-                                  // concerned about memory usage (and
-                                  // possibly the speed with which we can
-                                  // multiply with these matrices), we should
-                                  // use separate and different sparsity
-                                  // patterns for these two kinds of
-                                  // matrices.
+  // Now, we have to provide a matrix on each
+  // level. To this end, we first use the
+  // MGTools::make_sparsity_pattern function
+  // to first generate a preliminary
+  // compressed sparsity pattern on each
+  // level (see the @ref Sparsity module for
+  // more information on this topic) and then
+  // copy it over to the one we really
+  // want. The next step is to initialize
+  // both kinds of level matrices with these
+  // sparsity patterns.
+  //
+  // It may be worth pointing out that the
+  // interface matrices only have entries for
+  // degrees of freedom that sit at or next
+  // to the interface between coarser and
+  // finer levels of the mesh. They are
+  // therefore even sparser than the matrices
+  // on the individual levels of our
+  // multigrid hierarchy. If we were more
+  // concerned about memory usage (and
+  // possibly the speed with which we can
+  // multiply with these matrices), we should
+  // use separate and different sparsity
+  // patterns for these two kinds of
+  // matrices.
   for (unsigned int level=0; level<n_levels; ++level)
     {
       CompressedSparsityPattern csp;
       csp.reinit(mg_dof_handler.n_dofs(level),
-                mg_dof_handler.n_dofs(level));
+                 mg_dof_handler.n_dofs(level));
       MGTools::make_sparsity_pattern(mg_dof_handler, csp, level);
 
       mg_sparsity_patterns[level].copy_from (csp);
@@ -409,25 +409,25 @@ void LaplaceProblem<dim>::setup_system ()
 }
 
 
-                                 // @sect4{LaplaceProblem::assemble_system}
+// @sect4{LaplaceProblem::assemble_system}
 
-                                // The following function assembles the
-                                // linear system on the finesh level of the
-                                // mesh. It is almost exactly the same as in
-                                // step-6, with the exception that we don't
-                                // eliminate hanging nodes and boundary
-                                // values after assembling, but while copying
-                                // local contributions into the global
-                                // matrix. This is not only simpler but also
-                                // more efficient for large problems.
+// The following function assembles the
+// linear system on the finesh level of the
+// mesh. It is almost exactly the same as in
+// step-6, with the exception that we don't
+// eliminate hanging nodes and boundary
+// values after assembling, but while copying
+// local contributions into the global
+// matrix. This is not only simpler but also
+// more efficient for large problems.
 template <int dim>
 void LaplaceProblem<dim>::assemble_system ()
 {
   const QGauss<dim>  quadrature_formula(degree+1);
 
   FEValues<dim> fe_values (fe, quadrature_formula,
-                          update_values    |  update_gradients |
-                          update_quadrature_points  |  update_JxW_values);
+                           update_values    |  update_gradients |
+                           update_quadrature_points  |  update_JxW_values);
 
   const unsigned int   dofs_per_cell = fe.dofs_per_cell;
   const unsigned int   n_q_points    = quadrature_formula.size();
@@ -441,8 +441,8 @@ void LaplaceProblem<dim>::assemble_system ()
   std::vector<double>    coefficient_values (n_q_points);
 
   typename MGDoFHandler<dim>::active_cell_iterator
-    cell = mg_dof_handler.begin_active(),
-    endc = mg_dof_handler.end();
+  cell = mg_dof_handler.begin_active(),
+  endc = mg_dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       cell_matrix = 0;
@@ -451,55 +451,55 @@ void LaplaceProblem<dim>::assemble_system ()
       fe_values.reinit (cell);
 
       coefficient.value_list (fe_values.get_quadrature_points(),
-                             coefficient_values);
+                              coefficient_values);
 
       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         {
-           for (unsigned int j=0; j<dofs_per_cell; ++j)
-             cell_matrix(i,j) += (coefficient_values[q_point] *
-                                  fe_values.shape_grad(i,q_point) *
-                                  fe_values.shape_grad(j,q_point) *
-                                  fe_values.JxW(q_point));
-
-           cell_rhs(i) += (fe_values.shape_value(i,q_point) *
-                           1.0 *
-                           fe_values.JxW(q_point));
-         }
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          {
+            for (unsigned int j=0; j<dofs_per_cell; ++j)
+              cell_matrix(i,j) += (coefficient_values[q_point] *
+                                   fe_values.shape_grad(i,q_point) *
+                                   fe_values.shape_grad(j,q_point) *
+                                   fe_values.JxW(q_point));
+
+            cell_rhs(i) += (fe_values.shape_value(i,q_point) *
+                            1.0 *
+                            fe_values.JxW(q_point));
+          }
 
       cell->get_dof_indices (local_dof_indices);
       constraints.distribute_local_to_global (cell_matrix, cell_rhs,
-                                             local_dof_indices,
-                                             system_matrix, system_rhs);
+                                              local_dof_indices,
+                                              system_matrix, system_rhs);
     }
 }
 
 
-                                 // @sect4{LaplaceProblem::assemble_multigrid}
-
-                                // The next function is the one that builds
-                                // the linear operators (matrices) that
-                                // define the multigrid method on each level
-                                // of the mesh. The integration core is the
-                                // same as above, but the loop below will go
-                                // over all existing cells instead of just
-                                // the active ones, and the results must be
-                                // entered into the correct matrix. Note also
-                                // that since we only do multi-level
-                                // preconditioning, no right-hand side needs
-                                // to be assembled here.
-                                //
-                                // Before we go there, however, we have to
-                                // take care of a significant amount of book
-                                // keeping:
+// @sect4{LaplaceProblem::assemble_multigrid}
+
+// The next function is the one that builds
+// the linear operators (matrices) that
+// define the multigrid method on each level
+// of the mesh. The integration core is the
+// same as above, but the loop below will go
+// over all existing cells instead of just
+// the active ones, and the results must be
+// entered into the correct matrix. Note also
+// that since we only do multi-level
+// preconditioning, no right-hand side needs
+// to be assembled here.
+//
+// Before we go there, however, we have to
+// take care of a significant amount of book
+// keeping:
 template <int dim>
 void LaplaceProblem<dim>::assemble_multigrid ()
 {
   QGauss<dim>  quadrature_formula(1+degree);
 
   FEValues<dim> fe_values (fe, quadrature_formula,
-                          update_values   | update_gradients |
-                          update_quadrature_points | update_JxW_values);
+                           update_values   | update_gradients |
+                           update_quadrature_points | update_JxW_values);
 
   const unsigned int   dofs_per_cell   = fe.dofs_per_cell;
   const unsigned int   n_q_points      = quadrature_formula.size();
@@ -511,70 +511,70 @@ void LaplaceProblem<dim>::assemble_multigrid ()
   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.
-                                  //
-                                  // 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:
-  std::vector<std::vector<bool> > interface_dofs 
+  // 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:
+  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 impose zero boundary
-                                  // conditions for the operator that we will
-                                  // apply on each level. On the other hand,
-                                  // we also have to impose zero boundary
-                                  // conditions on the external boundary of
-                                  // each level. So let's identify these
-                                  // nodes as well (this time as a set of
-                                  // degrees of freedom, rather than a
-                                  // boolean mask; the reason for this being
-                                  // that we will not need fast tests whether
-                                  // a certain degree of freedom is in the
-                                  // boundary list, though we will need such
-                                  // access for the interface degrees of
-                                  // freedom further down below):
-
-                                  // 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():
+  // The indices just identified will later
+  // be used to impose zero boundary
+  // conditions for the operator that we will
+  // apply on each level. On the other hand,
+  // we also have to impose zero boundary
+  // conditions on the external boundary of
+  // each level. So let's identify these
+  // nodes as well (this time as a set of
+  // degrees of freedom, rather than a
+  // boolean mask; the reason for this being
+  // that we will not need fast tests whether
+  // a certain degree of freedom is in the
+  // boundary list, though we will need such
+  // access for the interface degrees of
+  // freedom further down below):
+
+  // 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)
@@ -584,26 +584,26 @@ void LaplaceProblem<dim>::assemble_multigrid ()
       boundary_constraints[level].close ();
 
       boundary_interface_constraints[level]
-       .add_lines (boundary_interface_dofs[level]);
+      .add_lines (boundary_interface_dofs[level]);
       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
-                                  // han 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
+  // han 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 MGDoFHandler<dim>::cell_iterator cell = mg_dof_handler.begin(),
-                                           endc = mg_dof_handler.end();
+                                            endc = mg_dof_handler.end();
 
   for (; cell!=endc; ++cell)
     {
@@ -611,143 +611,143 @@ void LaplaceProblem<dim>::assemble_multigrid ()
       fe_values.reinit (cell);
 
       coefficient.value_list (fe_values.get_quadrature_points(),
-                             coefficient_values);
+                              coefficient_values);
 
       for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         for (unsigned int j=0; j<dofs_per_cell; ++j)
-           cell_matrix(i,j) += (coefficient_values[q_point] *
-                                fe_values.shape_grad(i,q_point) *
-                                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:
+        for (unsigned int i=0; i<dofs_per_cell; ++i)
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            cell_matrix(i,j) += (coefficient_values[q_point] *
+                                 fe_values.shape_grad(i,q_point) *
+                                 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:
       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
-                                      // refinement level.
+      // 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 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.
+      .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 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.
       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 &&
-               interface_dofs[cell->level()][local_dof_indices[j]]==false))
-           cell_matrix(i,j) = 0;
+        for (unsigned int j=0; j<dofs_per_cell; ++j)
+          if ( !(interface_dofs[cell->level()][local_dof_indices[i]]==true &&
+                 interface_dofs[cell->level()][local_dof_indices[j]]==false))
+            cell_matrix(i,j) = 0;
 
       boundary_interface_constraints[cell->level()]
-       .distribute_local_to_global (cell_matrix,
-                                    local_dof_indices,
-                                    mg_interface_matrices[cell->level()]);
+      .distribute_local_to_global (cell_matrix,
+                                   local_dof_indices,
+                                   mg_interface_matrices[cell->level()]);
     }
 }
 
 
 
-                                 // @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).
-                                //
-                                // 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.
+// @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).
+//
+// 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.
 template <int dim>
 void LaplaceProblem<dim>::solve ()
 {
@@ -758,11 +758,11 @@ void LaplaceProblem<dim>::solve ()
   coarse_matrix.copy_from (mg_matrices[0]);
   MGCoarseGridHouseholder<> coarse_grid_solver;
   coarse_grid_solver.initialize (coarse_matrix);
-  
+
   typedef PreconditionSOR<SparseMatrix<double> > Smoother;
   GrowingVectorMemory<>   vector_memory;
   MGSmootherRelaxation<SparseMatrix<double>, Smoother, Vector<double> >
-    mg_smoother;
+  mg_smoother;
   mg_smoother.initialize(mg_matrices);
   mg_smoother.set_steps(2);
   mg_smoother.set_symmetric(true);
@@ -772,11 +772,11 @@ void LaplaceProblem<dim>::solve ()
   MGMatrix<> mg_interface_down(&mg_interface_matrices);
 
   Multigrid<Vector<double> > mg(mg_dof_handler,
-                               mg_matrix,
-                               coarse_grid_solver,
-                               mg_transfer,
-                               mg_smoother,
-                               mg_smoother);
+                                mg_matrix,
+                                coarse_grid_solver,
+                                mg_transfer,
+                                mg_smoother,
+                                mg_smoother);
   mg.set_edge_matrices(mg_interface_down, mg_interface_up);
 
   PreconditionMG<dim, Vector<double>, MGTransferPrebuilt<Vector<double> > >
@@ -788,47 +788,47 @@ void LaplaceProblem<dim>::solve ()
   solution = 0;
 
   cg.solve (system_matrix, solution, system_rhs,
-           preconditioner);
+            preconditioner);
   constraints.distribute (solution);
 
   deallog << "   " << solver_control.last_step()
-           << " CG iterations needed to obtain convergence."
-           << std::endl;
+          << " CG iterations needed to obtain convergence."
+          << std::endl;
 }
 
 
 
-                                 // @sect4{Postprocessing}
-
-                                // The following two functions postprocess a
-                                // solution once it is computed. In
-                                // particular, the first one refines the mesh
-                                // at the beginning of each cycle while the
-                                // second one outputs results at the end of
-                                // each such cycle. The functions are almost
-                                // unchanged from those in step-6, with the
-                                // exception of two minor differences: The
-                                // KellyErrorEstimator::estimate function
-                                // wants an argument of type DoFHandler, not
-                                // MGDoFHandler, and so we have to cast from
-                                // derived to base class; and we generate
-                                // output in VTK format, to use the more
-                                // modern visualization programs available
-                                // today compared to those that were
-                                // available when step-6 was written.
+// @sect4{Postprocessing}
+
+// The following two functions postprocess a
+// solution once it is computed. In
+// particular, the first one refines the mesh
+// at the beginning of each cycle while the
+// second one outputs results at the end of
+// each such cycle. The functions are almost
+// unchanged from those in step-6, with the
+// exception of two minor differences: The
+// KellyErrorEstimator::estimate function
+// wants an argument of type DoFHandler, not
+// MGDoFHandler, and so we have to cast from
+// derived to base class; and we generate
+// output in VTK format, to use the more
+// modern visualization programs available
+// today compared to those that were
+// available when step-6 was written.
 template <int dim>
 void LaplaceProblem<dim>::refine_grid ()
 {
   Vector<float> estimated_error_per_cell (triangulation.n_active_cells());
 
   KellyErrorEstimator<dim>::estimate (static_cast<DoFHandler<dim>&>(mg_dof_handler),
-                                     QGauss<dim-1>(3),
-                                     typename FunctionMap<dim>::type(),
-                                     solution,
-                                     estimated_error_per_cell);
+                                      QGauss<dim-1>(3),
+                                      typename FunctionMap<dim>::type(),
+                                      solution,
+                                      estimated_error_per_cell);
   GridRefinement::refine_and_coarsen_fixed_number (triangulation,
-                                                  estimated_error_per_cell,
-                                                  0.3, 0.03);
+                                                   estimated_error_per_cell,
+                                                   0.3, 0.03);
   triangulation.execute_coarsening_and_refinement ();
 }
 
@@ -845,24 +845,24 @@ void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
 
   std::ostringstream filename;
   filename << "solution-"
-          << cycle
-          << ".vtk";
+           << cycle
+           << ".vtk";
 
 //  std::ofstream output (filename.str().c_str());
 //  data_out.write_vtk (output);
 }
 
 
-                                 // @sect4{LaplaceProblem::run}
+// @sect4{LaplaceProblem::run}
 
-                                // Like several of the functions above, this
-                                // is almost exactly a copy of of the
-                                // corresponding function in step-6. The only
-                                // difference is the call to
-                                // <code>assemble_multigrid</code> that takes
-                                // care of forming the matrices on every
-                                // level that we need in the multigrid
-                                // method.
+// Like several of the functions above, this
+// is almost exactly a copy of of the
+// corresponding function in step-6. The only
+// difference is the call to
+// <code>assemble_multigrid</code> that takes
+// care of forming the matrices on every
+// level that we need in the multigrid
+// method.
 template <int dim>
 void LaplaceProblem<dim>::run ()
 {
@@ -871,31 +871,31 @@ void LaplaceProblem<dim>::run ()
       deallog << "Cycle " << cycle << ':' << std::endl;
 
       if (cycle == 0)
-       {
-         GridGenerator::hyper_ball (triangulation);
+        {
+          GridGenerator::hyper_ball (triangulation);
 
-         static const HyperBallBoundary<dim> boundary;
-         triangulation.set_boundary (0, boundary);
+          static const HyperBallBoundary<dim> boundary;
+          triangulation.set_boundary (0, boundary);
 
-         triangulation.refine_global (1);
-       }
+          triangulation.refine_global (1);
+        }
       else
-       refine_grid ();
+        refine_grid ();
 
 
       deallog << "   Number of active cells:       "
-               << triangulation.n_active_cells()
-               << std::endl;
+              << triangulation.n_active_cells()
+              << std::endl;
 
       setup_system ();
 
       deallog << "   Number of degrees of freedom: "
-               << mg_dof_handler.n_dofs()
-               << " (by level: ";
+              << mg_dof_handler.n_dofs()
+              << " (by level: ";
       for (unsigned int level=0; level<triangulation.n_levels(); ++level)
-       deallog << mg_dof_handler.n_dofs(level)
-                 << (level == triangulation.n_levels()-1
-                     ? ")" : ", ");
+        deallog << mg_dof_handler.n_dofs(level)
+                << (level == triangulation.n_levels()-1
+                    ? ")" : ", ");
       deallog << std::endl;
 
       assemble_system ();
@@ -907,10 +907,10 @@ void LaplaceProblem<dim>::run ()
 }
 
 
-                                // @sect3{The main() function}
-                                //
-                                // This is again the same function as
-                                // in step-6:
+// @sect3{The main() function}
+//
+// This is again the same function as
+// in step-6:
 int main ()
 {
   std::ofstream logfile("step-16/output");
@@ -929,25 +929,25 @@ int main ()
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
 
       return 1;
     }
   catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     }
 
index e2e8cd6e183c03685fc11422382df3995334380c..c3c1279750b6865dcbeb00ff4cd7e850d6e6f72a 100644 (file)
@@ -70,13 +70,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;
   };
 
 
@@ -122,9 +122,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;
   };
 
 
@@ -168,9 +168,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;
   };
 
 
@@ -246,9 +246,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;
   };
 
 
@@ -477,17 +477,17 @@ namespace Step39
     assembler.initialize(mg_matrix);
     assembler.initialize_interfaces(mg_matrix_in_out, mg_matrix_in_out);
     assembler.initialize_fluxes(mg_matrix_dg_up, mg_matrix_dg_down);
-    
+
     MatrixIntegrator<dim> integrator;
     MeshWorker::integration_loop<dim, dim> (
       mg_dof_handler.begin(), mg_dof_handler.end(),
       dof_info, info_box,
       integrator, assembler);
-    
+
     for (unsigned int level=mg_matrix_in_out.min_level();
-        level<=mg_matrix_in_out.min_level(); ++level)
+         level<=mg_matrix_in_out.min_level(); ++level)
       if (mg_matrix_in_out[level].frobenius_norm() != 0.)
-       deallog << "Oops!" << std::endl;
+        deallog << "Oops!" << std::endl;
   }
 
 
@@ -728,7 +728,7 @@ int main()
       using namespace dealii;
       using namespace Step39;
       initlog(__FILE__);
-      
+
       FE_DGQ<2> fe1(2);
       InteriorPenaltyProblem<2> test1(fe1);
       test1.run(6);
index 53d3bbc9e210f8f581cab7318c97111f2212dd27..51283061681e632192a6f108f393666a30f9fbc5 100644 (file)
@@ -71,13 +71,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;
   };
 
 
@@ -123,9 +123,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;
   };
 
 
@@ -169,9 +169,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;
   };
 
 
@@ -247,9 +247,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;
   };
 
 
@@ -478,17 +478,17 @@ namespace Step39
     assembler.initialize(mg_matrix);
     assembler.initialize_interfaces(mg_matrix_in_out, mg_matrix_in_out);
     assembler.initialize_fluxes(mg_matrix_dg_up, mg_matrix_dg_down);
-    
+
     MatrixIntegrator<dim> integrator;
     MeshWorker::integration_loop<dim, dim> (
       mg_dof_handler.begin(), mg_dof_handler.end(),
       dof_info, info_box,
       integrator, assembler);
-    
+
     for (unsigned int level=mg_matrix_in_out.min_level();
-        level<=mg_matrix_in_out.min_level(); ++level)
+         level<=mg_matrix_in_out.min_level(); ++level)
       if (mg_matrix_in_out[level].frobenius_norm() != 0.)
-       deallog << "Oops!" << std::endl;
+        deallog << "Oops!" << std::endl;
   }
 
 
@@ -729,7 +729,7 @@ int main()
       using namespace dealii;
       using namespace Step39;
       initlog(__FILE__);
-      
+
       FESystem<2> fe1(FE_DGQ<2>(2), 1, FE_Q<2>(2), 1);
       InteriorPenaltyProblem<2> test1(fe1);
       test1.run(6);
index 02179a8b795fbef545d62d39dc82a2b6b220199a..b0964a4a17886774fe778d271a8c990f621213df 100644 (file)
@@ -71,13 +71,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;
   };
 
 
@@ -123,9 +123,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;
   };
 
 
@@ -169,9 +169,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;
   };
 
 
@@ -247,9 +247,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;
   };
 
 
@@ -473,7 +473,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;
     MeshWorker::integration_loop<dim, dim> (
       mg_dof_handler.begin(), mg_dof_handler.end(),
@@ -717,7 +717,7 @@ int main()
       using namespace dealii;
       using namespace Step39;
       initlog(__FILE__);
-      
+
       FE_DGQ<2> fe1(2);
       InteriorPenaltyProblem<2> test1(fe1);
       test1.run(6);
index 1a27a189ad1bd1b4172feb30239b24f1f3d9642c..5927575dfbceda6ba62d6853a0bf9ea1d1ed4f1e 100644 (file)
@@ -45,10 +45,10 @@ using namespace std;
 template <int dim, typename number, int spacedim>
 void
 reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
-              MGLevelObject<dealii::Vector<number> > &v)
+               MGLevelObject<dealii::Vector<number> > &v)
 {
   for (unsigned int level=v.min_level();
-       level<=v.max_level();++level)
+       level<=v.max_level(); ++level)
     {
       unsigned int n = mg_dof.n_dofs (level);
       v[level].reinit(n);
@@ -58,7 +58,7 @@ reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
 
 
 template <int dim>
-void check_simple(const FiniteElement<dim>fe)
+void check_simple(const FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
 
@@ -74,61 +74,61 @@ void check_simple(const FiniteElement<dim>& fe)
 
   MGLevelObject<Vector<double> > u(0, tr.n_levels()-1);
   reinit_vector(mgdof, u);
-                                  // First prolongate the constant
-                                  // vector.  For Lagrange elements,
-                                  // the values are just the number
-                                  // of degrees of freedom.
+  // First prolongate the constant
+  // vector.  For Lagrange elements,
+  // the values are just the number
+  // of degrees of freedom.
   u[0] = 1;
   transfer.prolongate(1,u[1],u[0]);
   transfer.prolongate(2,u[2],u[1]);
   deallog << "u0\t" <<  (u[0]*u[0]+.5) << std::endl
-         << "u1\t" <<  (u[1]*u[1]+.5) << std::endl
-         << "u2\t" <<  (u[2]*u[2]+.5) << std::endl;
-                                  // Now restrict the same vectors.
+          << "u1\t" <<  (u[1]*u[1]+.5) << std::endl
+          << "u2\t" <<  (u[2]*u[2]+.5) << std::endl;
+  // Now restrict the same vectors.
   u[1] = 0.;
   u[0] = 0.;
   transfer.restrict_and_add(2,u[1],u[2]);
   transfer.restrict_and_add(1,u[0],u[1]);
   deallog << "u1\t" <<  (u[1]*u[1]+.5) << std::endl
-         << "u0\t" <<  (u[0]*u[0]+.5) << std::endl;
+          << "u0\t" <<  (u[0]*u[0]+.5) << std::endl;
 
-                                  // Now the same for a non-constant
-                                  // vector
-  for (unsigned int i=0;i<u[0].size();++i)
+  // Now the same for a non-constant
+  // vector
+  for (unsigned int i=0; i<u[0].size(); ++i)
     u[0](i) = i;
   transfer.prolongate(1,u[1],u[0]);
   transfer.prolongate(2,u[2],u[1]);
   deallog << "u0\t" <<  (u[0]*u[0]+.5) << std::endl
-         << "u1\t" <<  (u[1]*u[1]+.5) << std::endl
-         << "u2\t" <<  (u[2]*u[2]+.5) << std::endl;
-                                  // Now restrict the same vectors.
+          << "u1\t" <<  (u[1]*u[1]+.5) << std::endl
+          << "u2\t" <<  (u[2]*u[2]+.5) << std::endl;
+  // Now restrict the same vectors.
   u[1] = 0.;
   u[0] = 0.;
   transfer.restrict_and_add(2,u[1],u[2]);
   transfer.restrict_and_add(1,u[0],u[1]);
   deallog << "u1\t" <<  (u[1]*u[1]+.5) << std::endl
-         << "u0\t" <<  (u[0]*u[0]+.5) << std::endl;
+          << "u0\t" <<  (u[0]*u[0]+.5) << std::endl;
 
-                                  // Fill a global vector by counting
-                                  // from one up
+  // Fill a global vector by counting
+  // from one up
   Vector<double> v;
   v.reinit (mgdof.n_dofs());
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i+1;
 
   transfer.copy_to_mg(mgdof, u, v);
-  for (unsigned int i=0; i<u[2].size();++i)
+  for (unsigned int i=0; i<u[2].size(); ++i)
     deallog << ' ' << (int) u[2](i);
   deallog << std::endl;
 
-                                  // Now do the opposite: fill a
-                                  // multigrid vector counting the
-                                  // dofs and see where the numbers go
+  // Now do the opposite: fill a
+  // multigrid vector counting the
+  // dofs and see where the numbers go
   v = 0.;
-  for (unsigned int i=0;i<u[2].size();++i)
+  for (unsigned int i=0; i<u[2].size(); ++i)
     u[2](i) = i+1;
   transfer.copy_from_mg(mgdof, v, u);
-  for (unsigned int i=0; i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << (int) v(i);
   deallog << std::endl;
   v.equ(-1., v);
index 76870d0d781acb2c97a3acb6bbaddfe0046880fb..8f3f824e49dd5526cbb2154433e38d3199f28083 100644 (file)
@@ -49,10 +49,10 @@ using namespace std;
 template <int dim, typename number, int spacedim>
 void
 reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
-              MGLevelObject<dealii::Vector<number> > &v)
+               MGLevelObject<dealii::Vector<number> > &v)
 {
   for (unsigned int level=v.min_level();
-       level<=v.max_level();++level)
+       level<=v.max_level(); ++level)
     {
       unsigned int n = mg_dof.n_dofs (level);
       v[level].reinit(n);
@@ -66,28 +66,28 @@ void refine_mesh (Triangulation<dim> &triangulation)
 {
   bool cell_refined = false;
   for (typename Triangulation<dim>::active_cell_iterator
-      cell = triangulation.begin_active();
-      cell != triangulation.end(); ++cell)
-  {
+       cell = triangulation.begin_active();
+       cell != triangulation.end(); ++cell)
+    {
       const Point<dim> p = cell->center();
       bool positive = p(0) > 0;
       if (positive)
-      {
-        cell->set_refine_flag();
-        cell_refined = true;
-      }
-  }
-  if(!cell_refined)//if no cell was selected for refinement, refine global
+        {
+          cell->set_refine_flag();
+          cell_refined = true;
+        }
+    }
+  if (!cell_refined) //if no cell was selected for refinement, refine global
     for (typename Triangulation<dim>::active_cell_iterator
-        cell = triangulation.begin_active();
-        cell != triangulation.end(); ++cell)
+         cell = triangulation.begin_active();
+         cell != triangulation.end(); ++cell)
       cell->set_refine_flag();
   triangulation.execute_coarsening_and_refinement ();
 }
 
 
 template <int dim>
-void check_simple(const FiniteElement<dim>fe)
+void check_simple(const FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
 
@@ -104,61 +104,61 @@ void check_simple(const FiniteElement<dim>& fe)
 
   MGLevelObject<Vector<double> > u(0, tr.n_levels()-1);
   reinit_vector(mgdof, u);
-                                  // First prolongate the constant
-                                  // vector.  For Lagrange elements,
-                                  // the values are just the number
-                                  // of degrees of freedom.
+  // First prolongate the constant
+  // vector.  For Lagrange elements,
+  // the values are just the number
+  // of degrees of freedom.
   u[0] = 1;
   transfer.prolongate(1,u[1],u[0]);
   transfer.prolongate(2,u[2],u[1]);
   deallog << "u0\t" <<  (u[0]*u[0]+.5) << std::endl
-         << "u1\t" <<  (u[1]*u[1]+.5) << std::endl
-         << "u2\t" <<  (u[2]*u[2]+.5) << std::endl;
-                                  // Now restrict the same vectors.
+          << "u1\t" <<  (u[1]*u[1]+.5) << std::endl
+          << "u2\t" <<  (u[2]*u[2]+.5) << std::endl;
+  // Now restrict the same vectors.
   u[1] = 0.;
   u[0] = 0.;
   transfer.restrict_and_add(2,u[1],u[2]);
   transfer.restrict_and_add(1,u[0],u[1]);
   deallog << "u1\t" <<  (u[1]*u[1]+.5) << std::endl
-         << "u0\t" <<  (u[0]*u[0]+.5) << std::endl;
+          << "u0\t" <<  (u[0]*u[0]+.5) << std::endl;
 
-                                  // Now the same for a non-constant
-                                  // vector
-  for (unsigned int i=0;i<u[0].size();++i)
+  // Now the same for a non-constant
+  // vector
+  for (unsigned int i=0; i<u[0].size(); ++i)
     u[0](i) = i;
   transfer.prolongate(1,u[1],u[0]);
   transfer.prolongate(2,u[2],u[1]);
   deallog << "u0\t" <<  (u[0]*u[0]+.5) << std::endl
-         << "u1\t" <<  (u[1]*u[1]+.5) << std::endl
-         << "u2\t" <<  (u[2]*u[2]+.5) << std::endl;
-                                  // Now restrict the same vectors.
+          << "u1\t" <<  (u[1]*u[1]+.5) << std::endl
+          << "u2\t" <<  (u[2]*u[2]+.5) << std::endl;
+  // Now restrict the same vectors.
   u[1] = 0.;
   u[0] = 0.;
   transfer.restrict_and_add(2,u[1],u[2]);
   transfer.restrict_and_add(1,u[0],u[1]);
   deallog << "u1\t" <<  (u[1]*u[1]+.5) << std::endl
-         << "u0\t" <<  (u[0]*u[0]+.5) << std::endl;
+          << "u0\t" <<  (u[0]*u[0]+.5) << std::endl;
 
-                                  // Fill a global vector by counting
-                                  // from one up
+  // Fill a global vector by counting
+  // from one up
   Vector<double> v;
   v.reinit (mgdof.n_dofs());
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i+1;
 
   transfer.copy_to_mg(mgdof, u, v);
-  for (unsigned int i=0; i<u[2].size();++i)
+  for (unsigned int i=0; i<u[2].size(); ++i)
     deallog << ' ' << (int) u[2](i);
   deallog << std::endl;
 
-                                  // Now do the opposite: fill a
-                                  // multigrid vector counting the
-                                  // dofs and see where the numbers go
+  // Now do the opposite: fill a
+  // multigrid vector counting the
+  // dofs and see where the numbers go
   v = 0.;
-  for (unsigned int i=0;i<u[2].size();++i)
+  for (unsigned int i=0; i<u[2].size(); ++i)
     u[2](i) = i+1;
   transfer.copy_from_mg(mgdof, v, u);
-  for (unsigned int i=0; i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << (int) v(i);
   deallog << std::endl;
   v.equ(-1., v);
index 8c46199fd8f3323b0222b0bd8590de880c52edfb..c5279c3066e42a5c6c51d604735a40f21156eb35 100644 (file)
@@ -51,10 +51,10 @@ using namespace std;
 template <int dim, typename number, int spacedim>
 void
 reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
-              MGLevelObject<dealii::Vector<number> > &v)
+               MGLevelObject<dealii::Vector<number> > &v)
 {
   for (unsigned int level=v.min_level();
-       level<=v.max_level();++level)
+       level<=v.max_level(); ++level)
     {
       unsigned int n = mg_dof.n_dofs (level);
       v[level].reinit(n);
@@ -68,89 +68,89 @@ void refine_mesh (Triangulation<dim> &triangulation)
 {
   bool cell_refined = false;
   for (typename Triangulation<dim>::active_cell_iterator
-      cell = triangulation.begin_active();
-      cell != triangulation.end(); ++cell)
-  {
-   for (unsigned int vertex=0;
-          vertex < GeometryInfo<dim>::vertices_per_cell;
-          ++vertex)
-      {
-        const Point<dim> p = cell->vertex(vertex);
-        const Point<dim> origin = (dim == 2 ?
-                                    Point<dim>(0,0) :
-                                    Point<dim>(0,0,0));
-        const double dist = p.distance(origin);
-        if(dist<0.25/M_PI)
+       cell = triangulation.begin_active();
+       cell != triangulation.end(); ++cell)
+    {
+      for (unsigned int vertex=0;
+           vertex < GeometryInfo<dim>::vertices_per_cell;
+           ++vertex)
         {
-          cell->set_refine_flag ();
-          cell_refined = true;
-          break;
+          const Point<dim> p = cell->vertex(vertex);
+          const Point<dim> origin = (dim == 2 ?
+                                     Point<dim>(0,0) :
+                                     Point<dim>(0,0,0));
+          const double dist = p.distance(origin);
+          if (dist<0.25/M_PI)
+            {
+              cell->set_refine_flag ();
+              cell_refined = true;
+              break;
+            }
         }
-      }
-  }
-  if(!cell_refined)//if no cell was selected for refinement, refine global
+    }
+  if (!cell_refined) //if no cell was selected for refinement, refine global
     for (typename Triangulation<dim>::active_cell_iterator
-        cell = triangulation.begin_active();
-        cell != triangulation.end(); ++cell)
+         cell = triangulation.begin_active();
+         cell != triangulation.end(); ++cell)
       cell->set_refine_flag();
   triangulation.execute_coarsening_and_refinement ();
 }
 
 template <int dim>
 void initialize (const MGDoFHandler<dim> &dof,
-    Vector<double> &u)
+                 Vector<double> &u)
 {
   unsigned int counter=0;
   const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
   std::vector<types::global_dof_index> dof_indices(dofs_per_cell);
   for (typename MGDoFHandler<dim>::active_cell_iterator
-      cell = dof.begin_active();
-      cell != dof.end(); ++cell)
-  {
-    cell->get_dof_indices(dof_indices);
-    for(unsigned int i=0; i<dofs_per_cell; ++i)
-      u(dof_indices[i]) = ++counter;
-  }
+       cell = dof.begin_active();
+       cell != dof.end(); ++cell)
+    {
+      cell->get_dof_indices(dof_indices);
+      for (unsigned int i=0; i<dofs_per_cell; ++i)
+        u(dof_indices[i]) = ++counter;
+    }
 }
 
 template <int dim>
 void initialize (const MGDoFHandler<dim> &dof,
-    MGLevelObject<Vector<double> > &u)
+                 MGLevelObject<Vector<double> > &u)
 {
   unsigned int counter=0;
   const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
   std::vector<types::global_dof_index> dof_indices(dofs_per_cell);
   typename MGDoFHandler<dim>::cell_iterator
-      cell = dof.begin(0);
-    cell->get_mg_dof_indices(dof_indices);
-    for(unsigned int i=0; i<dofs_per_cell; ++i)
-      u[0](dof_indices[i]) = ++counter;
+  cell = dof.begin(0);
+  cell->get_mg_dof_indices(dof_indices);
+  for (unsigned int i=0; i<dofs_per_cell; ++i)
+    u[0](dof_indices[i]) = ++counter;
 }
 
 template <int dim>
 void print (const MGDoFHandler<dim> &dof,
-    MGLevelObject<Vector<double> > &u)
+            MGLevelObject<Vector<double> > &u)
 {
   const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
   std::vector<types::global_dof_index> dof_indices(dofs_per_cell);
-  for(unsigned int l=0; l<dof.get_tria().n_levels(); ++l)
-  {
-    deallog << std::endl;
-    deallog << "Level " << l << std::endl;
-    for (typename MGDoFHandler<dim>::cell_iterator
-        cell = dof.begin(l);
-        cell != dof.end(l); ++cell)
+  for (unsigned int l=0; l<dof.get_tria().n_levels(); ++l)
     {
-      cell->get_mg_dof_indices(dof_indices);
-      for(unsigned int i=0; i<dofs_per_cell; ++i)
-        deallog << ' ' << (int)u[l](dof_indices[i]);
+      deallog << std::endl;
+      deallog << "Level " << l << std::endl;
+      for (typename MGDoFHandler<dim>::cell_iterator
+           cell = dof.begin(l);
+           cell != dof.end(l); ++cell)
+        {
+          cell->get_mg_dof_indices(dof_indices);
+          for (unsigned int i=0; i<dofs_per_cell; ++i)
+            deallog << ' ' << (int)u[l](dof_indices[i]);
+        }
     }
-  }
 }
 
 template <int dim>
 void print_diff (const MGDoFHandler<dim> &dof_1, const MGDoFHandler<dim> &dof_2,
-    const Vector<double> &u, const Vector<double> &v)
+                 const Vector<double> &u, const Vector<double> &v)
 {
   Vector<double> diff;
   diff.reinit (u);
@@ -158,20 +158,20 @@ void print_diff (const MGDoFHandler<dim> &dof_1, const MGDoFHandler<dim> &dof_2,
   std::vector<types::global_dof_index> dof_indices_1(dofs_per_cell);
   std::vector<types::global_dof_index> dof_indices_2(dofs_per_cell);
   for (typename MGDoFHandler<dim>::active_cell_iterator
-      cell_1 = dof_1.begin_active(), cell_2 = dof_2.begin_active();
-      cell_1 != dof_1.end(); ++cell_1, ++cell_2)
-  {
-    cell_1->get_dof_indices(dof_indices_1);
-    cell_2->get_dof_indices(dof_indices_2);
-    for(unsigned int i=0; i<dofs_per_cell; ++i)
-      diff(dof_indices_1[i]) = u(dof_indices_1[i]) - v(dof_indices_2[i]);
-  }
+       cell_1 = dof_1.begin_active(), cell_2 = dof_2.begin_active();
+       cell_1 != dof_1.end(); ++cell_1, ++cell_2)
+    {
+      cell_1->get_dof_indices(dof_indices_1);
+      cell_2->get_dof_indices(dof_indices_2);
+      for (unsigned int i=0; i<dofs_per_cell; ++i)
+        diff(dof_indices_1[i]) = u(dof_indices_1[i]) - v(dof_indices_2[i]);
+    }
   deallog << std::endl;
   deallog << "diff " << diff.l2_norm() << std::endl;
 }
 
 template <int dim>
-void check_simple(const FiniteElement<dim>fe)
+void check_simple(const FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
 
@@ -197,14 +197,14 @@ void check_simple(const FiniteElement<dim>& fe)
   block_component[3] = 1;
 
   DoFRenumbering::component_wise (mgdof_renumbered, block_component);
-  for (unsigned int level=0;level<tr.n_levels();++level)
+  for (unsigned int level=0; level<tr.n_levels(); ++level)
     DoFRenumbering::component_wise (mgdof_renumbered, level, block_component);
 
   MGTransferPrebuilt<Vector<double> > transfer;
   transfer.build_matrices(mgdof);
 
   MGTransferPrebuilt<Vector<double> > transfer_renumbered;
-  transfer_renumbered.build_matrices(mgdof_renumbered); 
+  transfer_renumbered.build_matrices(mgdof_renumbered);
 
   Vector<double> u(mgdof.n_dofs());
   initialize(mgdof,u);
@@ -218,7 +218,7 @@ void check_simple(const FiniteElement<dim>& fe)
 
   u=0;
   initialize(mgdof, v);
-  for(unsigned int l=0; l<tr.n_levels()-1; ++l)
+  for (unsigned int l=0; l<tr.n_levels()-1; ++l)
     transfer.prolongate (l+1, v[l+1], v[l]);
 
   transfer.copy_from_mg(mgdof, u, v);
@@ -234,7 +234,7 @@ void check_simple(const FiniteElement<dim>& fe)
 
   u=0;
   initialize(mgdof_renumbered, v);
-  for(unsigned int l=0; l<tr.n_levels()-1; ++l)
+  for (unsigned int l=0; l<tr.n_levels()-1; ++l)
     transfer_renumbered.prolongate (l+1, v[l+1], v[l]);
 
   transfer_renumbered.copy_from_mg(mgdof_renumbered, u, v);
index 3d1e6bbe6ec1820288c4c8f3ee48104c1a9aa140..0edda40480969a0c02015e145bf7f5099fe951f3 100644 (file)
@@ -48,47 +48,47 @@ reinit_vector_by_blocks (
   const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
   MGLevelObject<BlockVector<number> > &v,
   const std::vector<bool> &sel,
-  std::vector<std::vector<types::global_dof_index> >ndofs)
+  std::vector<std::vector<types::global_dof_index> > &ndofs)
 {
   std::vector<bool> selected=sel;
-                                  // Compute the number of blocks needed
+  // Compute the number of blocks needed
   const unsigned int n_selected
     = std::accumulate(selected.begin(),
-                     selected.end(),
-                     0U);
+                      selected.end(),
+                      0U);
 
   if (ndofs.size() == 0)
     {
       std::vector<std::vector<types::global_dof_index> >
-       new_dofs(mg_dof.get_tria().n_levels(),
-                std::vector<types::global_dof_index>(selected.size()));
+      new_dofs(mg_dof.get_tria().n_levels(),
+               std::vector<types::global_dof_index>(selected.size()));
       std::swap(ndofs, new_dofs);
       MGTools::count_dofs_per_block (mg_dof, ndofs);
     }
 
   for (unsigned int level=v.min_level();
-       level<=v.max_level();++level)
+       level<=v.max_level(); ++level)
     {
       v[level].reinit(n_selected, 0);
       unsigned int k=0;
-      for (unsigned int i=0;i<selected.size() && (k<v[level].n_blocks());++i)
-       {
-         if (selected[i])
-           {
-             v[level].block(k++).reinit(ndofs[level][i]);
-           }
-         v[level].collect_sizes();
-       }
+      for (unsigned int i=0; i<selected.size() && (k<v[level].n_blocks()); ++i)
+        {
+          if (selected[i])
+            {
+              v[level].block(k++).reinit(ndofs[level][i]);
+            }
+          v[level].collect_sizes();
+        }
     }
 }
 
 template <int dim>
-void check_block(const FiniteElement<dim>fe,
-                const vector<bool>& selected,
-                const vector<double>& factors)
+void check_block(const FiniteElement<dim> &fe,
+                 const vector<bool> &selected,
+                 const vector<double> &factors)
 {
   deallog << fe.get_name() << std::endl << "selected ";
-  for (unsigned int i=0;i<selected.size();++i)
+  for (unsigned int i=0; i<selected.size(); ++i)
     if (selected[i])
       deallog << ' ' << i;
   deallog << std::endl;
@@ -98,27 +98,27 @@ void check_block(const FiniteElement<dim>& fe,
   tr.refine_global(2);
 
   MGDoFHandler<dim> mgdof(tr);
-  DoFHandler<dim>dof=mgdof;
+  DoFHandler<dim> &dof=mgdof;
   mgdof.distribute_dofs(fe);
   DoFRenumbering::component_wise(mgdof);
   vector<types::global_dof_index> ndofs(fe.n_blocks());
   DoFTools::count_dofs_per_block(mgdof, ndofs);
 
-  for (unsigned int l=0;l<tr.n_levels();++l)
+  for (unsigned int l=0; l<tr.n_levels(); ++l)
     DoFRenumbering::component_wise(mgdof, l);
   std::vector<std::vector<types::global_dof_index> > mg_ndofs(mgdof.get_tria().n_levels(),
-                                                  std::vector<types::global_dof_index>(fe.n_blocks()));
+                                                              std::vector<types::global_dof_index>(fe.n_blocks()));
   MGTools::count_dofs_per_block(mgdof, mg_ndofs);
 
   deallog << "Global  dofs:";
-  for (unsigned int i=0;i<ndofs.size();++i)
+  for (unsigned int i=0; i<ndofs.size(); ++i)
     deallog << ' ' << ndofs[i];
   deallog << std::endl;
-  for (unsigned int l=0;l<mg_ndofs.size();++l)
+  for (unsigned int l=0; l<mg_ndofs.size(); ++l)
     {
       deallog << "Level " << l << " dofs:";
-      for (unsigned int i=0;i<mg_ndofs[l].size();++i)
-       deallog << ' ' << mg_ndofs[l][i];
+      for (unsigned int i=0; i<mg_ndofs[l].size(); ++i)
+        deallog << ' ' << mg_ndofs[l][i];
       deallog << std::endl;
     }
 
@@ -132,21 +132,21 @@ void check_block(const FiniteElement<dim>& fe,
 
   reinit_vector_by_blocks(mgdof, u, selected, mg_ndofs);
 
-                                  // Prolongate a constant function
-                                  // twice
+  // Prolongate a constant function
+  // twice
   u[0] = 1;
   transfer.prolongate(1,u[1],u[0]);
   transfer.prolongate(2,u[2],u[1]);
-                                  // These outputs are just the
-                                  // number of dofs on each level
+  // These outputs are just the
+  // number of dofs on each level
   deallog << "u0";
-  for (unsigned int b=0;b<u[0].n_blocks();++b)
+  for (unsigned int b=0; b<u[0].n_blocks(); ++b)
     deallog << '\t' << (int) (u[0].block(b)*u[0].block(b)+.4);
   deallog << std::endl << "u1";
-  for (unsigned int b=0;b<u[1].n_blocks();++b)
+  for (unsigned int b=0; b<u[1].n_blocks(); ++b)
     deallog << '\t' << (int) (u[1].block(b)*u[1].block(b)+.4);
   deallog << std::endl << "u2";
-  for (unsigned int b=0;b<u[2].n_blocks();++b)
+  for (unsigned int b=0; b<u[2].n_blocks(); ++b)
     deallog << '\t' << (int) (u[2].block(b)*u[2].block(b)+.4);
   deallog << std::endl;
 
@@ -154,41 +154,41 @@ void check_block(const FiniteElement<dim>& fe,
   u[0] = 0.;
   transfer.restrict_and_add(2,u[1],u[2]);
   transfer.restrict_and_add(1,u[0],u[1]);
-                                  // After adding the restrictions,
-                                  // things get bigger.
+  // After adding the restrictions,
+  // things get bigger.
   deallog << "u1";
-  for (unsigned int b=0;b<u[1].n_blocks();++b)
+  for (unsigned int b=0; b<u[1].n_blocks(); ++b)
     deallog << '\t' << (int) (u[1].block(b)*u[1].block(b)+.5);
   deallog << std::endl << "u0";
-  for (unsigned int b=0;b<u[0].n_blocks();++b)
+  for (unsigned int b=0; b<u[0].n_blocks(); ++b)
     deallog << '\t' << (int) (u[0].block(b)*u[0].block(b)+.5);
   deallog << std::endl;
 
-                                  // Check copy to mg and back
-                                  // Fill a global vector by counting
-                                  // from one up
+  // Check copy to mg and back
+  // Fill a global vector by counting
+  // from one up
   BlockVector<double> v;
   v.reinit (ndofs);
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i+1;
 
-                                  // See what part gets copied to mg
+  // See what part gets copied to mg
   u.resize(0, tr.n_levels()-1);
   reinit_vector_by_blocks(mgdof, u, selected, mg_ndofs);
 
   transfer.copy_to_mg(mgdof, u, v);
-  for (unsigned int i=0; i<u[2].size();++i)
+  for (unsigned int i=0; i<u[2].size(); ++i)
     deallog << ' ' << (int) u[2](i);
   deallog << std::endl;
 
-                                  // Now do the opposite: fill a
-                                  // multigrid vector counting the
-                                  // dofs and see where the numbers go
-  for (unsigned int i=0;i<u[2].size();++i)
+  // Now do the opposite: fill a
+  // multigrid vector counting the
+  // dofs and see where the numbers go
+  for (unsigned int i=0; i<u[2].size(); ++i)
     u[2](i) = i+1;
   v = 0.;
   transfer.copy_from_mg(mgdof, v, u);
-  for (unsigned int i=0; i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << (int) v(i);
   deallog << std::endl;
   v.equ(-1., v);
index 354fb5bc95cfd07579ceae8dd5633e35f96a85a4..a2597b678710eee1dfd1226f80d7a6a5763da9de 100644 (file)
@@ -48,7 +48,7 @@ reinit_vector_by_blocks (
   const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
   MGLevelObject<dealii::Vector<number> > &v,
   const unsigned int selected_block,
-  std::vector<std::vector<types::global_dof_index> >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));
@@ -59,14 +59,14 @@ reinit_vector_by_blocks (
   if (ndofs.size() == 0)
     {
       std::vector<std::vector<types::global_dof_index> >
-       new_dofs(mg_dof.get_tria().n_levels(),
-                std::vector<types::global_dof_index>(selected.size()));
+      new_dofs(mg_dof.get_tria().n_levels(),
+               std::vector<types::global_dof_index>(selected.size()));
       std::swap(ndofs, new_dofs);
       MGTools::count_dofs_per_block (mg_dof, ndofs);
     }
 
   for (unsigned int level=v.min_level();
-       level<=v.max_level();++level)
+       level<=v.max_level(); ++level)
     {
       v[level].reinit(ndofs[level][selected_block]);
     }
@@ -74,49 +74,49 @@ reinit_vector_by_blocks (
 
 
 template <int dim>
-void check_select(const FiniteElement<dim>fe, unsigned int selected)
+void check_select(const FiniteElement<dim> &fe, unsigned int selected)
 {
   deallog << fe.get_name()
-         << " select " << selected << std::endl;
+          << " select " << selected << std::endl;
 
   Triangulation<dim> tr;
   GridGenerator::hyper_cube(tr);
   tr.refine_global(2);
 
   MGDoFHandler<dim> mgdof(tr);
-  DoFHandler<dim>dof=mgdof;
+  DoFHandler<dim> &dof=mgdof;
   mgdof.distribute_dofs(fe);
   DoFRenumbering::component_wise(mgdof);
   vector<types::global_dof_index> ndofs(fe.n_blocks());
   DoFTools::count_dofs_per_block(mgdof, ndofs);
 
-  for (unsigned int l=0;l<tr.n_levels();++l)
+  for (unsigned int l=0; l<tr.n_levels(); ++l)
     DoFRenumbering::component_wise(mgdof, l);
   std::vector<std::vector<types::global_dof_index> > mg_ndofs(mgdof.get_tria().n_levels(),
-                                                  std::vector<types::global_dof_index>(fe.n_blocks()));
+                                                              std::vector<types::global_dof_index>(fe.n_blocks()));
   MGTools::count_dofs_per_block(mgdof, mg_ndofs);
 
   deallog << "Global  dofs:";
-  for (unsigned int i=0;i<ndofs.size();++i)
+  for (unsigned int i=0; i<ndofs.size(); ++i)
     deallog << ' ' << ndofs[i];
   deallog << std::endl;
-  for (unsigned int l=0;l<mg_ndofs.size();++l)
+  for (unsigned int l=0; l<mg_ndofs.size(); ++l)
     {
       deallog << "Level " << l << " dofs:";
-      for (unsigned int i=0;i<mg_ndofs[l].size();++i)
-       deallog << ' ' << mg_ndofs[l][i];
+      for (unsigned int i=0; i<mg_ndofs[l].size(); ++i)
+        deallog << ' ' << mg_ndofs[l][i];
       deallog << std::endl;
     }
 
   MGTransferBlockSelect<double> transfer;
   transfer.build_matrices(dof, mgdof, selected);
 
-                                  // First, prolongate the constant
-                                  // function from the coarsest mesh
-                                  // to the finer ones. Since this is
-                                  // the embedding, we obtain the
-                                  // constant one and the l2-norm is
-                                  // the number of degrees of freedom.
+  // First, prolongate the constant
+  // function from the coarsest mesh
+  // to the finer ones. Since this is
+  // the embedding, we obtain the
+  // constant one and the l2-norm is
+  // the number of degrees of freedom.
   MGLevelObject< Vector<double> > u(0, tr.n_levels()-1);
 
   reinit_vector_by_blocks(mgdof, u, selected, mg_ndofs);
@@ -125,41 +125,41 @@ void check_select(const FiniteElement<dim>& fe, unsigned int selected)
   transfer.prolongate(1,u[1],u[0]);
   transfer.prolongate(2,u[2],u[1]);
   deallog << "u0\t" << (int) (u[0]*u[0]+.4) << std::endl
-         << "u1\t" << (int) (u[1]*u[1]+.4) << std::endl
-         << "u2\t" << (int) (u[2]*u[2]+.4) << std::endl;
-                                  // Now restrict the same vectors.
+          << "u1\t" << (int) (u[1]*u[1]+.4) << std::endl
+          << "u2\t" << (int) (u[2]*u[2]+.4) << std::endl;
+  // Now restrict the same vectors.
   u[1] = 0.;
   u[0] = 0.;
   transfer.restrict_and_add(2,u[1],u[2]);
   transfer.restrict_and_add(1,u[0],u[1]);
   deallog << "u1\t" << (int) (u[1]*u[1]+.5) << std::endl
-         << "u0\t" << (int) (u[0]*u[0]+.5) << std::endl;
+          << "u0\t" << (int) (u[0]*u[0]+.5) << std::endl;
 
-                                  // Check copy to mg and back
-                                  // Fill a global vector by counting
-                                  // from one up
+  // Check copy to mg and back
+  // Fill a global vector by counting
+  // from one up
   BlockVector<double> v;
   v.reinit (ndofs);
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i+1;
 
-                                  // See what part gets copied to mg
+  // See what part gets copied to mg
   u.resize(0, tr.n_levels()-1);
   reinit_vector_by_blocks(mgdof, u, selected, mg_ndofs);
 
   transfer.copy_to_mg(mgdof, u, v);
-  for (unsigned int i=0; i<u[2].size();++i)
+  for (unsigned int i=0; i<u[2].size(); ++i)
     deallog << ' ' << (int) u[2](i);
   deallog << std::endl;
 
-                                  // Now do the opposite: fill a
-                                  // multigrid vector counting the
-                                  // dofs and see where the numbers go
-  for (unsigned int i=0;i<u[2].size();++i)
+  // Now do the opposite: fill a
+  // multigrid vector counting the
+  // dofs and see where the numbers go
+  for (unsigned int i=0; i<u[2].size(); ++i)
     u[2](i) = i+1;
   v = 0.;
   transfer.copy_from_mg(mgdof, v, u);
-  for (unsigned int i=0; i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << (int) v(i);
   deallog << std::endl;
   v.equ(-1., v);
index 197affe4aa9964c1bfe63620c26319ede5e3a56a..14065a0777117672243656b8f3ccfd7258c29a1c 100644 (file)
@@ -51,7 +51,7 @@ reinit_vector_by_blocks (
   const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
   MGLevelObject<dealii::Vector<number> > &v,
   const unsigned int selected_block,
-  std::vector<std::vector<types::global_dof_index> >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));
@@ -62,14 +62,14 @@ reinit_vector_by_blocks (
   if (ndofs.size() == 0)
     {
       std::vector<std::vector<types::global_dof_index> >
-       new_dofs(mg_dof.get_tria().n_levels(),
-                std::vector<types::global_dof_index>(selected.size()));
+      new_dofs(mg_dof.get_tria().n_levels(),
+               std::vector<types::global_dof_index>(selected.size()));
       std::swap(ndofs, new_dofs);
       MGTools::count_dofs_per_block (mg_dof, ndofs);
     }
 
   for (unsigned int level=v.min_level();
-       level<=v.max_level();++level)
+       level<=v.max_level(); ++level)
     {
       v[level].reinit(ndofs[level][selected_block]);
     }
@@ -82,37 +82,37 @@ reinit_vector_by_blocks (
   const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
   MGLevelObject<BlockVector<number> > &v,
   const std::vector<bool> &sel,
-  std::vector<std::vector<types::global_dof_index> >ndofs)
+  std::vector<std::vector<types::global_dof_index> > &ndofs)
 {
   std::vector<bool> selected=sel;
-                                  // Compute the number of blocks needed
+  // Compute the number of blocks needed
   const unsigned int n_selected
     = std::accumulate(selected.begin(),
-                     selected.end(),
-                     0U);
+                      selected.end(),
+                      0U);
 
   if (ndofs.size() == 0)
     {
       std::vector<std::vector<types::global_dof_index> >
-       new_dofs(mg_dof.get_tria().n_levels(),
-                std::vector<types::global_dof_index>(selected.size()));
+      new_dofs(mg_dof.get_tria().n_levels(),
+               std::vector<types::global_dof_index>(selected.size()));
       std::swap(ndofs, new_dofs);
       MGTools::count_dofs_per_block (mg_dof, ndofs);
     }
 
   for (unsigned int level=v.min_level();
-       level<=v.max_level();++level)
+       level<=v.max_level(); ++level)
     {
       v[level].reinit(n_selected, 0);
       unsigned int k=0;
-      for (unsigned int i=0;i<selected.size() && (k<v[level].n_blocks());++i)
-       {
-         if (selected[i])
-           {
-             v[level].block(k++).reinit(ndofs[level][i]);
-           }
-         v[level].collect_sizes();
-       }
+      for (unsigned int i=0; i<selected.size() && (k<v[level].n_blocks()); ++i)
+        {
+          if (selected[i])
+            {
+              v[level].block(k++).reinit(ndofs[level][i]);
+            }
+          v[level].collect_sizes();
+        }
     }
 }
 
@@ -120,7 +120,7 @@ reinit_vector_by_blocks (
 
 
 template <int dim>
-void check_block(const FiniteElement<dim>fe)
+void check_block(const FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
   std::vector<bool> selected(fe.n_blocks(), true);
@@ -130,27 +130,27 @@ void check_block(const FiniteElement<dim>& fe)
   tr.refine_global(2);
 
   MGDoFHandler<dim> mgdof(tr);
-  DoFHandler<dim>dof=mgdof;
+  DoFHandler<dim> &dof=mgdof;
   mgdof.distribute_dofs(fe);
 
-                                  // Make sure all orderings are the
-                                  // same
+  // Make sure all orderings are the
+  // same
   Point<dim> direction;
-  for (unsigned int d=0;d<dim;++d)
+  for (unsigned int d=0; d<dim; ++d)
     direction[d] = d*d*d;
   DoFRenumbering::downstream(dof, direction);
   DoFRenumbering::component_wise(dof);
-  for (unsigned int l=0;l<tr.n_levels();++l)
+  for (unsigned int l=0; l<tr.n_levels(); ++l)
     {
       DoFRenumbering::downstream(mgdof, l, direction);
       DoFRenumbering::component_wise(mgdof, l);
     }
 
-                                  // Store sizes
+  // Store sizes
   vector<types::global_dof_index> ndofs(fe.n_blocks());
   DoFTools::count_dofs_per_block(mgdof, ndofs);
   std::vector<std::vector<types::global_dof_index> > mg_ndofs(mgdof.get_tria().n_levels(),
-                                                  std::vector<types::global_dof_index>(fe.n_blocks()));
+                                                              std::vector<types::global_dof_index>(fe.n_blocks()));
   MGTools::count_dofs_per_block(mgdof, mg_ndofs);
 
   MGTransferPrebuilt<BlockVector<double> > transfer;
@@ -167,8 +167,8 @@ void check_block(const FiniteElement<dim>& fe)
   BlockVector<double> v1(mg_ndofs[1]);
   BlockVector<double> v0(mg_ndofs[0]);
 
-                                  // Prolongate a constant function
-                                  // twice
+  // Prolongate a constant function
+  // twice
   u0 = 1;
   transfer.prolongate(1,u1,u0);
   transfer.prolongate(2,u2,u1);
@@ -178,12 +178,12 @@ void check_block(const FiniteElement<dim>& fe)
   v0.add(-1., u0);
   v1.add(-1., u1);
   v2.add(-1., u2);
-                                  // These outputs are just the
-                                  // number of dofs on each level
+  // These outputs are just the
+  // number of dofs on each level
   deallog << "Prolongate " << v0.l2_norm()
-         << ' ' << v1.l2_norm()
-         << ' ' << v2.l2_norm()
-         << std::endl;
+          << ' ' << v1.l2_norm()
+          << ' ' << v2.l2_norm()
+          << std::endl;
 
   v0 = 1.;
   transfer_select.prolongate(1,v1.block(0),v0.block(0));
@@ -192,9 +192,9 @@ void check_block(const FiniteElement<dim>& fe)
   v1.add(-1., u1);
   v2.add(-1., u2);
   deallog << "Select     " << v0.block(0).l2_norm()
-         << ' ' << v1.block(0).l2_norm()
-         << ' ' << v2.block(0).l2_norm()
-         << std::endl;
+          << ' ' << v1.block(0).l2_norm()
+          << ' ' << v2.block(0).l2_norm()
+          << std::endl;
 
   v2 = u2;
   u1 = 0.;
@@ -208,8 +208,8 @@ void check_block(const FiniteElement<dim>& fe)
   v0.add(-1., u0);
   v1.add(-1., u1);
   deallog << "Restrict " << v0.l2_norm()
-         << ' ' << v1.l2_norm()
-         << std::endl;
+          << ' ' << v1.l2_norm()
+          << std::endl;
 
   v1 = 0.;
   v0 = 0.;
@@ -218,14 +218,14 @@ void check_block(const FiniteElement<dim>& fe)
   v0.add(-1., u0);
   v1.add(-1., u1);
   deallog << "Select   " << v0.block(0).l2_norm()
-         << ' ' << v1.block(0).l2_norm()
-         << std::endl;
+          << ' ' << v1.block(0).l2_norm()
+          << std::endl;
 
 
-                                  // Check copy to mg and back
+  // Check copy to mg and back
   BlockVector<double> u;
   u.reinit (ndofs);
-  for (unsigned int i=0;i<u.size();++i)
+  for (unsigned int i=0; i<u.size(); ++i)
     u(i) = i+1;
 
   std::vector<std::vector<types::global_dof_index> > cached_sizes;
@@ -244,7 +244,7 @@ void check_block(const FiniteElement<dim>& fe)
   transfer_block.copy_to_mg(mgdof, wb, u);
   transfer_select.copy_to_mg(mgdof, ws, u);
 
-  for (unsigned int l=0; l<tr.n_levels();++l)
+  for (unsigned int l=0; l<tr.n_levels(); ++l)
     {
       wb[l].add(-1., v[l]);
       ws[l].add(-1., v[l].block(0));
@@ -252,16 +252,16 @@ void check_block(const FiniteElement<dim>& fe)
       deallog << ' ' << ws[l].l2_norm();
     }
   deallog << std::endl << "copy from mg ";
-                                  // Now do the opposite: fill a
-                                  // multigrid vector counting the
-                                  // dofs and see where the numbers go
+  // Now do the opposite: fill a
+  // multigrid vector counting the
+  // dofs and see where the numbers go
   u = 0.;
-  for (unsigned int i=0;i<v[2].size();++i)
+  for (unsigned int i=0; i<v[2].size(); ++i)
     {
       v[2](i) = i+1;
       wb[2](i) = i+1;
     }
-  for (unsigned int i=0;i<ws[2].size();++i)
+  for (unsigned int i=0; i<ws[2].size(); ++i)
     ws[2](i) = i+1;
   BlockVector<double> uu;
   uu.reinit(u);
index ada725320aea47b9d6fd148ee617cf9311b3e454..ca75008680d714095e9e58dbcedbdea14435323a 100644 (file)
@@ -43,7 +43,7 @@
 using namespace std;
 
 template <int dim>
-void check_simple(const FiniteElement<dim>fe)
+void check_simple(const FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
 
@@ -60,7 +60,7 @@ void check_simple(const FiniteElement<dim>& fe)
 
   MGTransferPrebuilt<Vector<double> > transfer;
   transfer.build_matrices(mgdof);
-  
+
   transfer.print_matrices(deallog.get_file_stream());
   transfer.print_indices(deallog.get_file_stream());
 }
@@ -69,7 +69,7 @@ void check_simple(const FiniteElement<dim>& fe)
 int main()
 {
   initlog(__FILE__);
-  
+
   check_simple (FE_DGP<2>(0));
   check_simple (FE_DGP<2>(1));
   check_simple (FE_DGQ<2>(1));
index f0e94bc95addca321fe23b17b1c33c5cd64d4a86..bb37ca1983a25e4e414e54766a1b45441a47c92d 100644 (file)
@@ -44,7 +44,7 @@
 using namespace std;
 
 template <int dim>
-void check_simple(const FiniteElement<dim>fe)
+void check_simple(const FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
 
@@ -62,13 +62,13 @@ void check_simple(const FiniteElement<dim>& fe)
   ConstraintMatrix     hanging_node_constraints;
   DoFTools::make_hanging_node_constraints (mgdof, hanging_node_constraints);
   hanging_node_constraints.close ();
-  
+
   MGConstrainedDoFs mg_constrained_dofs;
   mg_constrained_dofs.initialize(mgdof);
 
   MGTransferPrebuilt<Vector<double> > transfer(hanging_node_constraints, mg_constrained_dofs);
   transfer.build_matrices(mgdof);
-  
+
   transfer.print_matrices(deallog.get_file_stream());
   transfer.print_indices(deallog.get_file_stream());
 }
@@ -77,7 +77,7 @@ void check_simple(const FiniteElement<dim>& fe)
 int main()
 {
   initlog(__FILE__);
-  
+
   check_simple (FE_DGP<2>(0));
   check_simple (FE_DGP<2>(1));
   check_simple (FE_DGQ<2>(1));
index fa8a91ceb562076ad98f1e9b01d8776fd6cc6027..da4916e329603e7b76bc2ea5ba4fea72bd28b6e0 100644 (file)
@@ -45,7 +45,7 @@
 using namespace std;
 
 template <int dim>
-void check_simple(const FiniteElement<dim>fe)
+void check_simple(const FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
 
@@ -67,13 +67,13 @@ void check_simple(const FiniteElement<dim>& fe)
   typename FunctionMap<dim>::type dirichlet_boundary;
   ZeroFunction<dim> homogeneous_dirichlet_bc (1);
   dirichlet_boundary[0] = &homogeneous_dirichlet_bc;
-  
+
   MGConstrainedDoFs mg_constrained_dofs;
   mg_constrained_dofs.initialize(mgdof, dirichlet_boundary);
 
   MGTransferPrebuilt<Vector<double> > transfer(hanging_node_constraints, mg_constrained_dofs);
   transfer.build_matrices(mgdof);
-  
+
   transfer.print_matrices(deallog.get_file_stream());
   transfer.print_indices(deallog.get_file_stream());
 }
@@ -82,7 +82,7 @@ void check_simple(const FiniteElement<dim>& fe)
 int main()
 {
   initlog(__FILE__);
-  
+
   check_simple (FE_DGP<2>(0));
   check_simple (FE_DGP<2>(1));
   check_simple (FE_DGQ<2>(1));
index bc336af250afec1f2c148c9345062c139ca9ec48..c7ffc4ff873edfd570d30606554ccdb00f07d3d8 100644 (file)
 using namespace std;
 
 template <int dim>
-void check_select(const FiniteElement<dim>fe,
-                 unsigned int selected,
-                 unsigned int mg_selected,
-                 std::vector<unsigned int> target_component,
-                 std::vector<unsigned int> mg_target_component)
+void check_select(const FiniteElement<dim> &fe,
+                  unsigned int selected,
+                  unsigned int mg_selected,
+                  std::vector<unsigned int> target_component,
+                  std::vector<unsigned int> mg_target_component)
 {
   deallog << fe.get_name()
-         << " select " << selected
-         << " (global) and " << mg_selected
-         << " (mg)" << std::endl;
-  
+          << " select " << selected
+          << " (global) and " << mg_selected
+          << " (mg)" << std::endl;
+
   Triangulation<dim> tr;
   GridGenerator::hyper_cube(tr);
   tr.refine_global(2);
-  
+
   MGDoFHandler<dim> mgdof(tr);
-  DoFHandler<dim>dof=mgdof;
+  DoFHandler<dim> &dof=mgdof;
   mgdof.distribute_dofs(fe);
   DoFRenumbering::component_wise(static_cast<DoFHandler<dim>&>(mgdof),
                                  target_component);
   vector<types::global_dof_index> ndofs(*std::max_element (target_component.begin(),
-                                               target_component.end()) + 1);
+                                                           target_component.end()) + 1);
   DoFTools::count_dofs_per_component(dof, ndofs, true, target_component);
-  
-  for (unsigned int l=0;l<tr.n_levels();++l)
+
+  for (unsigned int l=0; l<tr.n_levels(); ++l)
     DoFRenumbering::component_wise(mgdof, l, mg_target_component);
 
   std::vector<std::vector<types::global_dof_index> > mg_ndofs(mgdof.get_tria().n_levels());
   MGTools::count_dofs_per_component(mgdof, mg_ndofs, true, mg_target_component);
 
   deallog << "Global  dofs:";
-  for (unsigned int i=0;i<ndofs.size();++i)
+  for (unsigned int i=0; i<ndofs.size(); ++i)
     deallog << ' ' << ndofs[i];
   deallog << std::endl;
-  for (unsigned int l=0;l<mg_ndofs.size();++l)
+  for (unsigned int l=0; l<mg_ndofs.size(); ++l)
     {
       deallog << "Level " << l << " dofs:";
-      for (unsigned int i=0;i<mg_ndofs[l].size();++i)
-       deallog << ' ' << mg_ndofs[l][i];
+      for (unsigned int i=0; i<mg_ndofs[l].size(); ++i)
+        deallog << ' ' << mg_ndofs[l][i];
       deallog << std::endl;
     }
-  
-  
+
+
   MGTransferSelect<double> transfer;
   transfer.build_matrices(dof, mgdof, selected, mg_selected,
-                         target_component, mg_target_component);
+                          target_component, mg_target_component);
 
   Vector<double> u2(mg_ndofs[2][mg_selected]);
   Vector<double> u1(mg_ndofs[1][mg_selected]);
@@ -96,28 +96,28 @@ void check_select(const FiniteElement<dim>& fe,
   transfer.prolongate(1,u1,u0);
   transfer.prolongate(2,u2,u1);
   deallog << "u0\t" << (int) (u0*u0+.5) << std::endl
-         << "u1\t" << (int) (u1*u1+.5) << std::endl
-         << "u2\t" << (int) (u2*u2+.5) << std::endl;
-                                  // Now restrict the same vectors.
+          << "u1\t" << (int) (u1*u1+.5) << std::endl
+          << "u2\t" << (int) (u2*u2+.5) << std::endl;
+  // Now restrict the same vectors.
   u1 = 0.;
   u0 = 0.;
   transfer.restrict_and_add(2,u1,u2);
   transfer.restrict_and_add(1,u0,u1);
   deallog << "u1\t" << (int) (u1*u1+.5) << std::endl
-         << "u0\t" << (int) (u0*u0+.5) << std::endl;
-                                  // Check copy to mg and back
+          << "u0\t" << (int) (u0*u0+.5) << std::endl;
+  // Check copy to mg and back
   BlockVector<double> u;
   u.reinit (ndofs);
-  for (unsigned int i=0;i<u.size();++i)
+  for (unsigned int i=0; i<u.size(); ++i)
     u(i) = i;
-  
+
   MGLevelObject<Vector<double> > v(0,tr.n_levels()-1);
-  for(unsigned int l=0; l<tr.n_levels()-1; ++l)
+  for (unsigned int l=0; l<tr.n_levels()-1; ++l)
     v[l].reinit(mg_ndofs[l][mg_target_component[mg_selected]]);
 
 
   transfer.copy_to_mg(mgdof, v, u);
-  for (unsigned int i=0; i<v[2].size();++i)
+  for (unsigned int i=0; i<v[2].size(); ++i)
     deallog << ' ' << (int) v[2](i);
   deallog << std::endl;
 }
@@ -130,11 +130,11 @@ int main()
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   std::vector<unsigned int> v1(4);
   std::vector<unsigned int> v2(4);
   std::vector<unsigned int> v3(4);
-  for (unsigned int i=0;i<4;++i)
+  for (unsigned int i=0; i<4; ++i)
     {
       v1[i] = i;
       v2[i] = 0;
@@ -146,7 +146,7 @@ int main()
   v3[3] = 2;
 
   FESystem<2> fe1(FE_DGQ<2>(1), 4);
-  
+
   check_select (fe1, 0, 0, v1, v1);
   check_select (fe1, 1, 1, v1, v1);
   check_select (fe1, 1, 2, v1, v1);
index 6f29c25c20ee9be3b0e9e34880a3bea2af69e64c..7d150ae66bab2d3a6384b6a1e7b8b7b3665c44e7 100644 (file)
@@ -42,10 +42,10 @@ using namespace std;
 template <int dim, typename number, int spacedim>
 void
 reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
-              MGLevelObject<dealii::Vector<number> > &v)
+               MGLevelObject<dealii::Vector<number> > &v)
 {
   for (unsigned int level=v.min_level();
-       level<=v.max_leve();++level)
+       level<=v.max_leve(); ++level)
     {
       unsigned int n = mg_dof.n_dofs (level);
       v[level].reinit(n);
@@ -57,8 +57,8 @@ reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
 template <typename Transfer>
 void
 make_matrix (const Transfer &transfer,
-            const unsigned int high_level,
-            FullMatrix<double> &matrix)
+             const unsigned int high_level,
+             FullMatrix<double> &matrix)
 {
   Vector<double> src (matrix.n());
   Vector<double> dst (matrix.m());
@@ -68,7 +68,7 @@ make_matrix (const Transfer &transfer,
       src(i) = 1;
       transfer.prolongate (high_level, dst, src);
       for (unsigned int j=0; j<dst.size(); ++j)
-       matrix(j,i) = dst(j);
+        matrix(j,i) = dst(j);
     }
 }
 
@@ -79,7 +79,7 @@ void print_matrix (const FullMatrix<double> &m)
   for (unsigned int i=0; i<m.m(); ++i)
     {
       for (unsigned int j=0; j<m.n(); ++j)
-       deallog << m(i,j) << ' ';
+        deallog << m(i,j) << ' ';
       deallog << std::endl;
     }
 }
@@ -88,7 +88,7 @@ void print_matrix (const FullMatrix<double> &m)
 
 
 template <int dim>
-void check (const FiniteElement<dim>fe)
+void check (const FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
 
@@ -107,9 +107,9 @@ void check (const FiniteElement<dim>& fe)
   transfer.build_matrices(mg_dof_handler);
 
   FullMatrix<double> prolong_0_1 (mg_dof_handler.n_dofs(1),
-                                 mg_dof_handler.n_dofs(0));
+                                  mg_dof_handler.n_dofs(0));
   FullMatrix<double> prolong_1_2 (mg_dof_handler.n_dofs(2),
-                                 mg_dof_handler.n_dofs(1));
+                                  mg_dof_handler.n_dofs(1));
 
   deallog << "Level 0->1" << std::endl;
   make_matrix (transfer, 1, prolong_0_1);
index 368bd36e1c5613a56070aaa2112bf413950dd4de..6568622c84320874e8310c5cf987ad4b742fe27f 100644 (file)
@@ -43,10 +43,10 @@ using namespace std;
 template <int dim, typename number, int spacedim>
 void
 reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
-              MGLevelObject<dealii::Vector<number> > &v)
+               MGLevelObject<dealii::Vector<number> > &v)
 {
   for (unsigned int level=v.min_level();
-       level<=v.max_leve();++level)
+       level<=v.max_leve(); ++level)
     {
       unsigned int n = mg_dof.n_dofs (level);
       v[level].reinit(n);
@@ -58,8 +58,8 @@ reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
 template <typename Transfer>
 void
 make_matrix (const Transfer &transfer,
-            const unsigned int high_level,
-            FullMatrix<double> &matrix)
+             const unsigned int high_level,
+             FullMatrix<double> &matrix)
 {
   Vector<double> src (matrix.n());
   Vector<double> dst (matrix.m());
@@ -69,7 +69,7 @@ make_matrix (const Transfer &transfer,
       src(i) = 1;
       transfer.prolongate (high_level, dst, src);
       for (unsigned int j=0; j<dst.size(); ++j)
-       matrix(j,i) = dst(j);
+        matrix(j,i) = dst(j);
     }
 }
 
@@ -80,7 +80,7 @@ void print_matrix (const FullMatrix<double> &m)
   for (unsigned int i=0; i<m.m(); ++i)
     {
       for (unsigned int j=0; j<m.n(); ++j)
-       deallog << m(i,j) << ' ';
+        deallog << m(i,j) << ' ';
       deallog << std::endl;
     }
 }
@@ -89,7 +89,7 @@ void print_matrix (const FullMatrix<double> &m)
 
 
 template <int dim>
-void check (const FiniteElement<dim>fe)
+void check (const FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
 
@@ -106,18 +106,18 @@ void check (const FiniteElement<dim>& fe)
 
   MGTransferSelect<double> transfer;
 
-                                  // group all components into one
-                                  // block, and do the transfer
-                                  // matrices on this block
+  // group all components into one
+  // block, and do the transfer
+  // matrices on this block
   transfer.build_matrices(mg_dof_handler, mg_dof_handler,
-                         0, 0,
-                         std::vector<unsigned int>(2, 0U),
-                         std::vector<unsigned int>(2, 0U));
+                          0, 0,
+                          std::vector<unsigned int>(2, 0U),
+                          std::vector<unsigned int>(2, 0U));
 
   FullMatrix<double> prolong_0_1 (mg_dof_handler.n_dofs(1),
-                                 mg_dof_handler.n_dofs(0));
+                                  mg_dof_handler.n_dofs(0));
   FullMatrix<double> prolong_1_2 (mg_dof_handler.n_dofs(2),
-                                 mg_dof_handler.n_dofs(1));
+                                  mg_dof_handler.n_dofs(1));
 
   deallog << "Level 0->1" << std::endl;
   make_matrix (transfer, 1, prolong_0_1);
index ae0463b93cd03ff49f1031cd605b923096640cd8..411f2a58c6d9b012858bdebc63ed59454efe833f 100644 (file)
@@ -43,10 +43,10 @@ using namespace std;
 template <int dim, typename number, int spacedim>
 void
 reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
-              MGLevelObject<dealii::Vector<number> > &v)
+               MGLevelObject<dealii::Vector<number> > &v)
 {
   for (unsigned int level=v.min_level();
-       level<=v.max_leve();++level)
+       level<=v.max_leve(); ++level)
     {
       unsigned int n = mg_dof.n_dofs (level);
       v[level].reinit(n);
@@ -58,8 +58,8 @@ reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
 template <typename Transfer>
 void
 make_matrix (const Transfer &transfer,
-            const unsigned int high_level,
-            FullMatrix<double> &matrix)
+             const unsigned int high_level,
+             FullMatrix<double> &matrix)
 {
   Vector<double> src (matrix.n());
   Vector<double> dst (matrix.m());
@@ -69,7 +69,7 @@ make_matrix (const Transfer &transfer,
       src(i) = 1;
       transfer.prolongate (high_level, dst, src);
       for (unsigned int j=0; j<dst.size(); ++j)
-       matrix(j,i) = dst(j);
+        matrix(j,i) = dst(j);
     }
 }
 
@@ -80,7 +80,7 @@ void print_matrix (const FullMatrix<double> &m)
   for (unsigned int i=0; i<m.m(); ++i)
     {
       for (unsigned int j=0; j<m.n(); ++j)
-       deallog << m(i,j) << ' ';
+        deallog << m(i,j) << ' ';
       deallog << std::endl;
     }
 }
@@ -89,7 +89,7 @@ void print_matrix (const FullMatrix<double> &m)
 
 
 template <int dim>
-void check (const FiniteElement<dim>fe)
+void check (const FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
 
@@ -110,15 +110,15 @@ void check (const FiniteElement<dim>& fe)
   mask[0] = 0;
   mask[1] = 1;
   transfer.build_matrices(mg_dof_handler, mg_dof_handler,
-                         0, 0,
-                         mask, mask);
+                          0, 0,
+                          mask, mask);
 
-                                  // use only the first half of all
-                                  // components
+  // use only the first half of all
+  // components
   FullMatrix<double> prolong_0_1 (mg_dof_handler.n_dofs(1)/2,
-                                 mg_dof_handler.n_dofs(0)/2);
+                                  mg_dof_handler.n_dofs(0)/2);
   FullMatrix<double> prolong_1_2 (mg_dof_handler.n_dofs(2)/2,
-                                 mg_dof_handler.n_dofs(1)/2);
+                                  mg_dof_handler.n_dofs(1)/2);
 
   deallog << "Level 0->1" << std::endl;
   make_matrix (transfer, 1, prolong_0_1);
index 5958a2355f9a842053489d967689826908de490d..1234a8d9f19c4311778eff7d005f9578c24b75a0 100644 (file)
@@ -43,10 +43,10 @@ using namespace std;
 template <int dim, typename number, int spacedim>
 void
 reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
-              MGLevelObject<dealii::Vector<number> > &v)
+               MGLevelObject<dealii::Vector<number> > &v)
 {
   for (unsigned int level=v.min_level();
-       level<=v.max_leve();++level)
+       level<=v.max_leve(); ++level)
     {
       unsigned int n = mg_dof.n_dofs (level);
       v[level].reinit(n);
@@ -58,8 +58,8 @@ reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
 template <typename Transfer>
 void
 make_matrix (const Transfer &transfer,
-            const unsigned int high_level,
-            FullMatrix<double> &matrix)
+             const unsigned int high_level,
+             FullMatrix<double> &matrix)
 {
   Vector<double> src (matrix.n());
   Vector<double> dst (matrix.m());
@@ -69,7 +69,7 @@ make_matrix (const Transfer &transfer,
       src(i) = 1;
       transfer.prolongate (high_level, dst, src);
       for (unsigned int j=0; j<dst.size(); ++j)
-       matrix(j,i) = dst(j);
+        matrix(j,i) = dst(j);
     }
 }
 
@@ -80,7 +80,7 @@ void print_matrix (const FullMatrix<double> &m)
   for (unsigned int i=0; i<m.m(); ++i)
     {
       for (unsigned int j=0; j<m.n(); ++j)
-       deallog << m(i,j) << ' ';
+        deallog << m(i,j) << ' ';
       deallog << std::endl;
     }
 }
@@ -89,7 +89,7 @@ void print_matrix (const FullMatrix<double> &m)
 
 
 template <int dim>
-void check (const FiniteElement<dim>fe)
+void check (const FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
 
@@ -110,8 +110,8 @@ void check (const FiniteElement<dim>& fe)
   MGTransferSelect<double> transfer;
 
   transfer.build_matrices(mg_dof_handler, mg_dof_handler,
-                         0, 0,
-                         block_component, block_component);
+                          0, 0,
+                          block_component, block_component);
 
   std::vector<std::vector<types::global_dof_index> > dofs_per_block(tr.n_levels(), std::vector<types::global_dof_index>(2));
   MGTools::count_dofs_per_block(mg_dof_handler, dofs_per_block, block_component);
index 066ea32fa1b66d952ac3c09730d9121e92dc71f1..b81f3d88ec5373bc89cd083c93285948489adb8a 100644 (file)
@@ -42,7 +42,7 @@ using namespace std;
 
 
 template <int dim>
-void check (const FiniteElement<dim>fe, const unsigned int selected_block)
+void check (const FiniteElement<dim> &fe, const unsigned int selected_block)
 {
   deallog << fe.get_name() << std::endl;
 
@@ -66,58 +66,58 @@ void check (const FiniteElement<dim>& fe, const unsigned int selected_block)
   MGTransferSelect<double> transfer;
 
   transfer.build_matrices(mg_dof_handler, mg_dof_handler,
-                         selected_block, selected_block,
-                         block_component, block_component);
+                          selected_block, selected_block,
+                          block_component, block_component);
 
   std::vector<types::global_dof_index> dofs_per_block(3);
   DoFTools::count_dofs_per_block(mg_dof_handler, dofs_per_block, block_component);
-  std::vector<std::vector<types::global_dof_index> > mg_dofs_per_block(tr.n_levels(), 
+  std::vector<std::vector<types::global_dof_index> > mg_dofs_per_block(tr.n_levels(),
       std::vector<types::global_dof_index>(3));
   MGTools::count_dofs_per_block(mg_dof_handler, mg_dofs_per_block, block_component);
 
   deallog << "Global  dofs:";
-  for (unsigned int i=0;i<dofs_per_block.size();++i)
+  for (unsigned int i=0; i<dofs_per_block.size(); ++i)
     deallog << ' ' << dofs_per_block[i];
   deallog << std::endl;
-  for (unsigned int l=0;l<mg_dofs_per_block.size();++l)
+  for (unsigned int l=0; l<mg_dofs_per_block.size(); ++l)
     {
       deallog << "Level " << l << " dofs:";
-      for (unsigned int i=0;i<mg_dofs_per_block[l].size();++i)
-       deallog << ' ' << mg_dofs_per_block[l][i];
+      for (unsigned int i=0; i<mg_dofs_per_block[l].size(); ++i)
+        deallog << ' ' << mg_dofs_per_block[l][i];
       deallog << std::endl;
     }
 
   BlockVector<double> u;
   u.reinit (dofs_per_block);
-  for (unsigned int i=0;i<u.size();++i)
+  for (unsigned int i=0; i<u.size(); ++i)
     u(i) = i;
-  
+
   MGLevelObject<Vector<double> > v(0,tr.n_levels()-1);
-  for(unsigned int l=0; l<tr.n_levels()-1; ++l)
+  for (unsigned int l=0; l<tr.n_levels()-1; ++l)
     v[l].reinit(mg_dofs_per_block[l][2]);
 
 
   transfer.copy_to_mg(mg_dof_handler, v, u);
-  for(unsigned int l=0; l<tr.n_levels(); ++l)
-  {
-    deallog << "Level " << l << std::endl;
-    for (unsigned int i=0; i<v[l].size();++i)
-      deallog << ' ' << (int) v[l](i);
-    deallog << std::endl;
-  }
-
-  for(unsigned int l=0; l<tr.n_levels(); ++l)
-    for (unsigned int i=0;i<v[l].size();++i)
+  for (unsigned int l=0; l<tr.n_levels(); ++l)
+    {
+      deallog << "Level " << l << std::endl;
+      for (unsigned int i=0; i<v[l].size(); ++i)
+        deallog << ' ' << (int) v[l](i);
+      deallog << std::endl;
+    }
+
+  for (unsigned int l=0; l<tr.n_levels(); ++l)
+    for (unsigned int i=0; i<v[l].size(); ++i)
       v[l](i) = i;
-  
+
   u=0;
   transfer.copy_from_mg(mg_dof_handler, u, v);
   deallog << "Global" << std::endl;
-  for (unsigned int i=0; i<u.block(selected_block).size();++i)
-      deallog << ' ' << (int) u.block(selected_block)(i);
+  for (unsigned int i=0; i<u.block(selected_block).size(); ++i)
+    deallog << ' ' << (int) u.block(selected_block)(i);
   deallog << std::endl;
-  for (unsigned int i=0; i<u.size();++i)
-      deallog << ' ' << (int) u(i);
+  for (unsigned int i=0; i<u.size(); ++i)
+    deallog << ' ' << (int) u(i);
   deallog << std::endl;
 }
 
index 12d317c61397b9b35fffefec443c78d258489a7d..6b9e1c1a7086b88acce53d4ff2bf882cc1daef15 100644 (file)
@@ -45,10 +45,10 @@ using namespace std;
 template <int dim, typename number, int spacedim>
 void
 reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
-              MGLevelObject<dealii::Vector<number> > &v)
+               MGLevelObject<dealii::Vector<number> > &v)
 {
   for (unsigned int level=v.min_level();
-       level<=v.max_leve();++level)
+       level<=v.max_leve(); ++level)
     {
       unsigned int n = mg_dof.n_dofs (level);
       v[level].reinit(n);
@@ -60,8 +60,8 @@ reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
 template <typename Transfer>
 void
 make_matrix (const Transfer &transfer,
-            const unsigned int high_level,
-            FullMatrix<double> &matrix)
+             const unsigned int high_level,
+             FullMatrix<double> &matrix)
 {
   Vector<double> src (matrix.n());
   Vector<double> dst (matrix.m());
@@ -71,7 +71,7 @@ make_matrix (const Transfer &transfer,
       src(i) = 1;
       transfer.prolongate (high_level, dst, src);
       for (unsigned int j=0; j<dst.size(); ++j)
-       matrix(j,i) = dst(j);
+        matrix(j,i) = dst(j);
     }
 }
 
@@ -82,7 +82,7 @@ void print_matrix (const FullMatrix<double> &m)
   for (unsigned int i=0; i<m.m(); ++i)
     {
       for (unsigned int j=0; j<m.n(); ++j)
-       deallog << m(i,j) << ' ';
+        deallog << m(i,j) << ' ';
       deallog << std::endl;
     }
 }
@@ -93,21 +93,21 @@ void refine_mesh (Triangulation<dim> &triangulation)
 {
   bool cell_refined = false;
   for (typename Triangulation<dim>::active_cell_iterator
-      cell = triangulation.begin_active();
-      cell != triangulation.end(); ++cell)
-  {
+       cell = triangulation.begin_active();
+       cell != triangulation.end(); ++cell)
+    {
       const Point<dim> p = cell->center();
       bool positive = p(0) > 0;
       if (positive)
-      {
-        cell->set_refine_flag();
-        cell_refined = true;
-      }
-  }
-  if(!cell_refined)//if no cell was selected for refinement, refine global
+        {
+          cell->set_refine_flag();
+          cell_refined = true;
+        }
+    }
+  if (!cell_refined) //if no cell was selected for refinement, refine global
     for (typename Triangulation<dim>::active_cell_iterator
-        cell = triangulation.begin_active();
-        cell != triangulation.end(); ++cell)
+         cell = triangulation.begin_active();
+         cell != triangulation.end(); ++cell)
       cell->set_refine_flag();
   triangulation.execute_coarsening_and_refinement ();
 }
@@ -115,7 +115,7 @@ void refine_mesh (Triangulation<dim> &triangulation)
 
 
 template <int dim>
-void check (const FiniteElement<dim>fe)
+void check (const FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
 
@@ -125,21 +125,21 @@ void check (const FiniteElement<dim>& fe)
   subdivisions[0] = 2;
 
   const Point<dim> bottom_left = (dim == 2 ?
-      Point<dim>(-1,-1) : Point<dim>(-1,-1,-1));
+                                  Point<dim>(-1,-1) : Point<dim>(-1,-1,-1));
   const Point<dim> top_right   = (dim == 2 ?
-      Point<dim>(1,1) : Point<dim>(1,1,1));
+                                  Point<dim>(1,1) : Point<dim>(1,1,1));
   GridGenerator::subdivided_hyper_rectangle (tr,
-      subdivisions, bottom_left, top_right, true);
+                                             subdivisions, bottom_left, top_right, true);
   refine_mesh(tr);
 
   MGDoFHandler<dim> mg_dof_handler(tr);
   mg_dof_handler.distribute_dofs(fe);
 
   deallog << "Global  dofs: " << mg_dof_handler.n_dofs() << std::endl;
-  for(unsigned int l=0; l<tr.n_levels(); ++l)
+  for (unsigned int l=0; l<tr.n_levels(); ++l)
     {
       deallog << "Level " << l << " dofs:";
-       deallog << ' ' << mg_dof_handler.n_dofs(l);
+      deallog << ' ' << mg_dof_handler.n_dofs(l);
       deallog << std::endl;
     }
 
@@ -151,7 +151,7 @@ void check (const FiniteElement<dim>& fe)
   transfer.build_matrices(mg_dof_handler);
 
   FullMatrix<double> prolong_0_1 (mg_dof_handler.n_dofs(1),
-                                 mg_dof_handler.n_dofs(0));
+                                  mg_dof_handler.n_dofs(0));
 
   deallog << "Level 0->1" << std::endl;
   make_matrix (transfer, 1, prolong_0_1);
index 0b6274ba0e7415812ef5341e314c0ec59e8535a8..379ece26959ce17a41ad38876bd3a736fcc959ba 100644 (file)
@@ -15,7 +15,7 @@
 // ---------------------------------------------------------------------
 
 
-// test like _01 but with boundary conditions 
+// test like _01 but with boundary conditions
 #include "../tests.h"
 #include <deal.II/base/function.h>
 #include <deal.II/base/logstream.h>
@@ -45,10 +45,10 @@ using namespace std;
 template <int dim, typename number, int spacedim>
 void
 reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
-              MGLevelObject<dealii::Vector<number> > &v)
+               MGLevelObject<dealii::Vector<number> > &v)
 {
   for (unsigned int level=v.min_level();
-       level<=v.max_leve();++level)
+       level<=v.max_leve(); ++level)
     {
       unsigned int n = mg_dof.n_dofs (level);
       v[level].reinit(n);
@@ -60,8 +60,8 @@ reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
 template <typename Transfer>
 void
 make_matrix (const Transfer &transfer,
-            const unsigned int high_level,
-            FullMatrix<double> &matrix)
+             const unsigned int high_level,
+             FullMatrix<double> &matrix)
 {
   Vector<double> src (matrix.n());
   Vector<double> dst (matrix.m());
@@ -71,7 +71,7 @@ make_matrix (const Transfer &transfer,
       src(i) = 1;
       transfer.prolongate (high_level, dst, src);
       for (unsigned int j=0; j<dst.size(); ++j)
-       matrix(j,i) = dst(j);
+        matrix(j,i) = dst(j);
     }
 }
 
@@ -82,7 +82,7 @@ void print_matrix (const FullMatrix<double> &m)
   for (unsigned int i=0; i<m.m(); ++i)
     {
       for (unsigned int j=0; j<m.n(); ++j)
-       deallog << m(i,j) << ' ';
+        deallog << m(i,j) << ' ';
       deallog << std::endl;
     }
 }
@@ -91,23 +91,23 @@ void print_matrix (const FullMatrix<double> &m)
 template<int dim>
 void refine_mesh (Triangulation<dim> &triangulation)
 {
-    bool cell_refined = false;
+  bool cell_refined = false;
   for (typename Triangulation<dim>::active_cell_iterator
-      cell = triangulation.begin_active();
-      cell != triangulation.end(); ++cell)
-  {
+       cell = triangulation.begin_active();
+       cell != triangulation.end(); ++cell)
+    {
       const Point<dim> p = cell->center();
       bool positive = p(0) > 0;
       if (positive)
-      {
-        cell->set_refine_flag();
-        cell_refined = true;
-      }
-  }
-  if(!cell_refined)//if no cell was selected for refinement, refine global
+        {
+          cell->set_refine_flag();
+          cell_refined = true;
+        }
+    }
+  if (!cell_refined) //if no cell was selected for refinement, refine global
     for (typename Triangulation<dim>::active_cell_iterator
-        cell = triangulation.begin_active();
-        cell != triangulation.end(); ++cell)
+         cell = triangulation.begin_active();
+         cell != triangulation.end(); ++cell)
       cell->set_refine_flag();
   triangulation.execute_coarsening_and_refinement ();
 }
@@ -115,7 +115,7 @@ void refine_mesh (Triangulation<dim> &triangulation)
 
 
 template <int dim>
-void check (const FiniteElement<dim>fe)
+void check (const FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
 
@@ -125,21 +125,21 @@ void check (const FiniteElement<dim>& fe)
   subdivisions[0] = 2;
 
   const Point<dim> bottom_left = (dim == 2 ?
-      Point<dim>(-1,-1) : Point<dim>(-1,-1,-1));
+                                  Point<dim>(-1,-1) : Point<dim>(-1,-1,-1));
   const Point<dim> top_right   = (dim == 2 ?
-      Point<dim>(1,1) : Point<dim>(1,1,1));
+                                  Point<dim>(1,1) : Point<dim>(1,1,1));
   GridGenerator::subdivided_hyper_rectangle (tr,
-      subdivisions, bottom_left, top_right, true);
+                                             subdivisions, bottom_left, top_right, true);
   refine_mesh(tr);
 
   MGDoFHandler<dim> mg_dof_handler(tr);
   mg_dof_handler.distribute_dofs(fe);
 
   deallog << "Global  dofs: " << mg_dof_handler.n_dofs() << std::endl;
-  for(unsigned int l=0; l<tr.n_levels(); ++l)
+  for (unsigned int l=0; l<tr.n_levels(); ++l)
     {
       deallog << "Level " << l << " dofs:";
-       deallog << ' ' << mg_dof_handler.n_dofs(l);
+      deallog << ' ' << mg_dof_handler.n_dofs(l);
       deallog << std::endl;
     }
 
@@ -160,7 +160,7 @@ void check (const FiniteElement<dim>& fe)
   transfer.build_matrices(mg_dof_handler);
 
   FullMatrix<double> prolong_0_1 (mg_dof_handler.n_dofs(1),
-                                 mg_dof_handler.n_dofs(0));
+                                  mg_dof_handler.n_dofs(0));
 
   deallog << "Level 0->1" << std::endl;
   make_matrix (transfer, 1, prolong_0_1);
index efe0819b3db07f5b4ccd9c262c434d4128e9501b..ed1243f81ee131b752b792e37051a400ceb996c3 100644 (file)
@@ -15,7 +15,7 @@
 // ---------------------------------------------------------------------
 
 
-// test like _01 but with TransferSelect 
+// test like _01 but with TransferSelect
 
 #include "../tests.h"
 #include <deal.II/base/function.h>
@@ -46,10 +46,10 @@ using namespace std;
 template <int dim, typename number, int spacedim>
 void
 reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
-              MGLevelObject<dealii::Vector<number> > &v)
+               MGLevelObject<dealii::Vector<number> > &v)
 {
   for (unsigned int level=v.min_level();
-       level<=v.max_leve();++level)
+       level<=v.max_leve(); ++level)
     {
       unsigned int n = mg_dof.n_dofs (level);
       v[level].reinit(n);
@@ -61,8 +61,8 @@ reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
 template <typename Transfer>
 void
 make_matrix (const Transfer &transfer,
-            const unsigned int high_level,
-            FullMatrix<double> &matrix)
+             const unsigned int high_level,
+             FullMatrix<double> &matrix)
 {
   Vector<double> src (matrix.n());
   Vector<double> dst (matrix.m());
@@ -72,7 +72,7 @@ make_matrix (const Transfer &transfer,
       src(i) = 1;
       transfer.prolongate (high_level, dst, src);
       for (unsigned int j=0; j<dst.size(); ++j)
-       matrix(j,i) = dst(j);
+        matrix(j,i) = dst(j);
     }
 }
 
@@ -83,7 +83,7 @@ void print_matrix (const FullMatrix<double> &m)
   for (unsigned int i=0; i<m.m(); ++i)
     {
       for (unsigned int j=0; j<m.n(); ++j)
-       deallog << m(i,j) << ' ';
+        deallog << m(i,j) << ' ';
       deallog << std::endl;
     }
 }
@@ -92,23 +92,23 @@ void print_matrix (const FullMatrix<double> &m)
 template<int dim>
 void refine_mesh (Triangulation<dim> &triangulation)
 {
-    bool cell_refined = false;
+  bool cell_refined = false;
   for (typename Triangulation<dim>::active_cell_iterator
-      cell = triangulation.begin_active();
-      cell != triangulation.end(); ++cell)
-  {
+       cell = triangulation.begin_active();
+       cell != triangulation.end(); ++cell)
+    {
       const Point<dim> p = cell->center();
       bool positive = p(0) > 0;
       if (positive)
-      {
-        cell->set_refine_flag();
-        cell_refined = true;
-      }
-  }
-  if(!cell_refined)//if no cell was selected for refinement, refine global
+        {
+          cell->set_refine_flag();
+          cell_refined = true;
+        }
+    }
+  if (!cell_refined) //if no cell was selected for refinement, refine global
     for (typename Triangulation<dim>::active_cell_iterator
-        cell = triangulation.begin_active();
-        cell != triangulation.end(); ++cell)
+         cell = triangulation.begin_active();
+         cell != triangulation.end(); ++cell)
       cell->set_refine_flag();
   triangulation.execute_coarsening_and_refinement ();
 }
@@ -116,7 +116,7 @@ void refine_mesh (Triangulation<dim> &triangulation)
 
 
 template <int dim>
-void check (const FiniteElement<dim>fe)
+void check (const FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
 
@@ -126,21 +126,21 @@ void check (const FiniteElement<dim>& fe)
   subdivisions[0] = 2;
 
   const Point<dim> bottom_left = (dim == 2 ?
-      Point<dim>(-1,-1) : Point<dim>(-1,-1,-1));
+                                  Point<dim>(-1,-1) : Point<dim>(-1,-1,-1));
   const Point<dim> top_right   = (dim == 2 ?
-      Point<dim>(1,1) : Point<dim>(1,1,1));
+                                  Point<dim>(1,1) : Point<dim>(1,1,1));
   GridGenerator::subdivided_hyper_rectangle (tr,
-      subdivisions, bottom_left, top_right, true);
+                                             subdivisions, bottom_left, top_right, true);
   refine_mesh(tr);
 
   MGDoFHandler<dim> mg_dof_handler(tr);
   mg_dof_handler.distribute_dofs(fe);
 
   deallog << "Global  dofs: " << mg_dof_handler.n_dofs() << std::endl;
-  for(unsigned int l=0; l<tr.n_levels(); ++l)
+  for (unsigned int l=0; l<tr.n_levels(); ++l)
     {
       deallog << "Level " << l << " dofs:";
-       deallog << ' ' << mg_dof_handler.n_dofs(l);
+      deallog << ' ' << mg_dof_handler.n_dofs(l);
       deallog << std::endl;
     }
 
@@ -153,7 +153,7 @@ void check (const FiniteElement<dim>& fe)
   transfer.build_matrices(mg_dof_handler, mg_dof_handler, 0, 0, block_selected, block_selected);
 
   FullMatrix<double> prolong_0_1 (mg_dof_handler.n_dofs(1),
-                                 mg_dof_handler.n_dofs(0));
+                                  mg_dof_handler.n_dofs(0));
 
   deallog << "Level 0->1" << std::endl;
   make_matrix (transfer, 1, prolong_0_1);
index f62670a4220bd40ed1482c7de836c04d0261e98c..9936f01ce92d61756e1b998de60ade45b8bb5fdc 100644 (file)
@@ -15,7 +15,7 @@
 // ---------------------------------------------------------------------
 
 
-// test like _03 but with boundary conditions 
+// test like _03 but with boundary conditions
 #include "../tests.h"
 #include <deal.II/base/function.h>
 #include <deal.II/base/logstream.h>
@@ -45,10 +45,10 @@ using namespace std;
 template <int dim, typename number, int spacedim>
 void
 reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
-              MGLevelObject<dealii::Vector<number> > &v)
+               MGLevelObject<dealii::Vector<number> > &v)
 {
   for (unsigned int level=v.min_level();
-       level<=v.max_leve();++level)
+       level<=v.max_leve(); ++level)
     {
       unsigned int n = mg_dof.n_dofs (level);
       v[level].reinit(n);
@@ -60,8 +60,8 @@ reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
 template <typename Transfer>
 void
 make_matrix (const Transfer &transfer,
-            const unsigned int high_level,
-            FullMatrix<double> &matrix)
+             const unsigned int high_level,
+             FullMatrix<double> &matrix)
 {
   Vector<double> src (matrix.n());
   Vector<double> dst (matrix.m());
@@ -71,7 +71,7 @@ make_matrix (const Transfer &transfer,
       src(i) = 1;
       transfer.prolongate (high_level, dst, src);
       for (unsigned int j=0; j<dst.size(); ++j)
-       matrix(j,i) = dst(j);
+        matrix(j,i) = dst(j);
     }
 }
 
@@ -82,7 +82,7 @@ void print_matrix (const FullMatrix<double> &m)
   for (unsigned int i=0; i<m.m(); ++i)
     {
       for (unsigned int j=0; j<m.n(); ++j)
-       deallog << m(i,j) << ' ';
+        deallog << m(i,j) << ' ';
       deallog << std::endl;
     }
 }
@@ -91,23 +91,23 @@ void print_matrix (const FullMatrix<double> &m)
 template<int dim>
 void refine_mesh (Triangulation<dim> &triangulation)
 {
-    bool cell_refined = false;
+  bool cell_refined = false;
   for (typename Triangulation<dim>::active_cell_iterator
-      cell = triangulation.begin_active();
-      cell != triangulation.end(); ++cell)
-  {
+       cell = triangulation.begin_active();
+       cell != triangulation.end(); ++cell)
+    {
       const Point<dim> p = cell->center();
       bool positive = p(0) > 0;
       if (positive)
-      {
-        cell->set_refine_flag();
-        cell_refined = true;
-      }
-  }
-  if(!cell_refined)//if no cell was selected for refinement, refine global
+        {
+          cell->set_refine_flag();
+          cell_refined = true;
+        }
+    }
+  if (!cell_refined) //if no cell was selected for refinement, refine global
     for (typename Triangulation<dim>::active_cell_iterator
-        cell = triangulation.begin_active();
-        cell != triangulation.end(); ++cell)
+         cell = triangulation.begin_active();
+         cell != triangulation.end(); ++cell)
       cell->set_refine_flag();
   triangulation.execute_coarsening_and_refinement ();
 }
@@ -115,7 +115,7 @@ void refine_mesh (Triangulation<dim> &triangulation)
 
 
 template <int dim>
-void check (const FiniteElement<dim>fe)
+void check (const FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
 
@@ -125,21 +125,21 @@ void check (const FiniteElement<dim>& fe)
   subdivisions[0] = 2;
 
   const Point<dim> bottom_left = (dim == 2 ?
-      Point<dim>(-1,-1) : Point<dim>(-1,-1,-1));
+                                  Point<dim>(-1,-1) : Point<dim>(-1,-1,-1));
   const Point<dim> top_right   = (dim == 2 ?
-      Point<dim>(1,1) : Point<dim>(1,1,1));
+                                  Point<dim>(1,1) : Point<dim>(1,1,1));
   GridGenerator::subdivided_hyper_rectangle (tr,
-      subdivisions, bottom_left, top_right, true);
+                                             subdivisions, bottom_left, top_right, true);
   refine_mesh(tr);
 
   MGDoFHandler<dim> mg_dof_handler(tr);
   mg_dof_handler.distribute_dofs(fe);
 
   deallog << "Global  dofs: " << mg_dof_handler.n_dofs() << std::endl;
-  for(unsigned int l=0; l<tr.n_levels(); ++l)
+  for (unsigned int l=0; l<tr.n_levels(); ++l)
     {
       deallog << "Level " << l << " dofs:";
-       deallog << ' ' << mg_dof_handler.n_dofs(l);
+      deallog << ' ' << mg_dof_handler.n_dofs(l);
       deallog << std::endl;
     }
 
@@ -153,16 +153,16 @@ void check (const FiniteElement<dim>& fe)
   dirichlet_boundary[3] =             &dirichlet_bc;
 
   MGTools::make_boundary_list (mg_dof_handler, dirichlet_boundary,
-                              boundary_indices);
+                               boundary_indices);
 
   std::vector<unsigned int> block_selected(2,0U);
   MGTransferSelect<double> transfer;
-  transfer.build_matrices(mg_dof_handler, 
-      mg_dof_handler, 0,0, block_selected, 
-      block_selected, boundary_indices);
+  transfer.build_matrices(mg_dof_handler,
+                          mg_dof_handler, 0,0, block_selected,
+                          block_selected, boundary_indices);
 
   FullMatrix<double> prolong_0_1 (mg_dof_handler.n_dofs(1),
-                                 mg_dof_handler.n_dofs(0));
+                                  mg_dof_handler.n_dofs(0));
 
   deallog << "Level 0->1" << std::endl;
   make_matrix (transfer, 1, prolong_0_1);
index 3989ef44311683c98f692aa91e58ecbece05e1eb..eecee130a36b63764a77f42e15195dc8e855571f 100644 (file)
@@ -46,10 +46,10 @@ using namespace std;
 template <int dim, typename number, int spacedim>
 void
 reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
-              MGLevelObject<dealii::Vector<number> > &v)
+               MGLevelObject<dealii::Vector<number> > &v)
 {
   for (unsigned int level=v.min_level();
-       level<=v.max_leve();++level)
+       level<=v.max_leve(); ++level)
     {
       unsigned int n = mg_dof.n_dofs (level);
       v[level].reinit(n);
@@ -61,8 +61,8 @@ reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
 template <typename Transfer>
 void
 make_matrix (const Transfer &transfer,
-            const unsigned int high_level,
-            FullMatrix<double> &matrix)
+             const unsigned int high_level,
+             FullMatrix<double> &matrix)
 {
   Vector<double> src (matrix.n());
   Vector<double> dst (matrix.m());
@@ -72,7 +72,7 @@ make_matrix (const Transfer &transfer,
       src(i) = 1;
       transfer.prolongate (high_level, dst, src);
       for (unsigned int j=0; j<dst.size(); ++j)
-       matrix(j,i) = dst(j);
+        matrix(j,i) = dst(j);
     }
 }
 
@@ -83,7 +83,7 @@ void print_matrix (const FullMatrix<double> &m)
   for (unsigned int i=0; i<m.m(); ++i)
     {
       for (unsigned int j=0; j<m.n(); ++j)
-       deallog << m(i,j) << ' ';
+        deallog << m(i,j) << ' ';
       deallog << std::endl;
     }
 }
@@ -92,23 +92,23 @@ void print_matrix (const FullMatrix<double> &m)
 template<int dim>
 void refine_mesh (Triangulation<dim> &triangulation)
 {
-    bool cell_refined = false;
+  bool cell_refined = false;
   for (typename Triangulation<dim>::active_cell_iterator
-      cell = triangulation.begin_active();
-      cell != triangulation.end(); ++cell)
-  {
+       cell = triangulation.begin_active();
+       cell != triangulation.end(); ++cell)
+    {
       const Point<dim> p = cell->center();
       bool positive = p(0) > 0;
       if (positive)
-      {
-        cell->set_refine_flag();
-        cell_refined = true;
-      }
-  }
-  if(!cell_refined)//if no cell was selected for refinement, refine global
+        {
+          cell->set_refine_flag();
+          cell_refined = true;
+        }
+    }
+  if (!cell_refined) //if no cell was selected for refinement, refine global
     for (typename Triangulation<dim>::active_cell_iterator
-        cell = triangulation.begin_active();
-        cell != triangulation.end(); ++cell)
+         cell = triangulation.begin_active();
+         cell != triangulation.end(); ++cell)
       cell->set_refine_flag();
   triangulation.execute_coarsening_and_refinement ();
 }
@@ -116,7 +116,7 @@ void refine_mesh (Triangulation<dim> &triangulation)
 
 
 template <int dim>
-void check (const FiniteElement<dim>fe)
+void check (const FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
 
@@ -126,21 +126,21 @@ void check (const FiniteElement<dim>& fe)
   subdivisions[0] = 2;
 
   const Point<dim> bottom_left = (dim == 2 ?
-      Point<dim>(-1,-1) : Point<dim>(-1,-1,-1));
+                                  Point<dim>(-1,-1) : Point<dim>(-1,-1,-1));
   const Point<dim> top_right   = (dim == 2 ?
-      Point<dim>(1,1) : Point<dim>(1,1,1));
+                                  Point<dim>(1,1) : Point<dim>(1,1,1));
   GridGenerator::subdivided_hyper_rectangle (tr,
-      subdivisions, bottom_left, top_right, true);
+                                             subdivisions, bottom_left, top_right, true);
   refine_mesh(tr);
 
   MGDoFHandler<dim> mg_dof_handler(tr);
   mg_dof_handler.distribute_dofs(fe);
 
   deallog << "Global  dofs: " << mg_dof_handler.n_dofs() << std::endl;
-  for(unsigned int l=0; l<tr.n_levels(); ++l)
+  for (unsigned int l=0; l<tr.n_levels(); ++l)
     {
       deallog << "Level " << l << " dofs:";
-       deallog << ' ' << mg_dof_handler.n_dofs(l);
+      deallog << ' ' << mg_dof_handler.n_dofs(l);
       deallog << std::endl;
     }
 
@@ -157,7 +157,7 @@ void check (const FiniteElement<dim>& fe)
   // use only the first half of all
   // components
   FullMatrix<double> prolong_0_1 (mg_dof_handler.n_dofs(1)/2,
-                                 mg_dof_handler.n_dofs(0)/2);
+                                  mg_dof_handler.n_dofs(0)/2);
 
   deallog << "Level 0->1" << std::endl;
   make_matrix (transfer, 1, prolong_0_1);
index 36db2053e422ebb887fd46e5fae9957766d9a895..11b281a4b5b81621cff60cc1e0eeb4cabaa54740 100644 (file)
@@ -45,10 +45,10 @@ using namespace std;
 template <int dim, typename number, int spacedim>
 void
 reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
-              MGLevelObject<dealii::Vector<number> > &v)
+               MGLevelObject<dealii::Vector<number> > &v)
 {
   for (unsigned int level=v.min_level();
-       level<=v.max_leve();++level)
+       level<=v.max_leve(); ++level)
     {
       unsigned int n = mg_dof.n_dofs (level);
       v[level].reinit(n);
@@ -60,8 +60,8 @@ reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
 template <typename Transfer>
 void
 make_matrix (const Transfer &transfer,
-            const unsigned int high_level,
-            FullMatrix<double> &matrix)
+             const unsigned int high_level,
+             FullMatrix<double> &matrix)
 {
   Vector<double> src (matrix.n());
   Vector<double> dst (matrix.m());
@@ -71,7 +71,7 @@ make_matrix (const Transfer &transfer,
       src(i) = 1;
       transfer.prolongate (high_level, dst, src);
       for (unsigned int j=0; j<dst.size(); ++j)
-       matrix(j,i) = dst(j);
+        matrix(j,i) = dst(j);
     }
 }
 
@@ -82,7 +82,7 @@ void print_matrix (const FullMatrix<double> &m)
   for (unsigned int i=0; i<m.m(); ++i)
     {
       for (unsigned int j=0; j<m.n(); ++j)
-       deallog << m(i,j) << ' ';
+        deallog << m(i,j) << ' ';
       deallog << std::endl;
     }
 }
@@ -91,23 +91,23 @@ void print_matrix (const FullMatrix<double> &m)
 template<int dim>
 void refine_mesh (Triangulation<dim> &triangulation)
 {
-    bool cell_refined = false;
+  bool cell_refined = false;
   for (typename Triangulation<dim>::active_cell_iterator
-      cell = triangulation.begin_active();
-      cell != triangulation.end(); ++cell)
-  {
+       cell = triangulation.begin_active();
+       cell != triangulation.end(); ++cell)
+    {
       const Point<dim> p = cell->center();
       bool positive = p(0) > 0;
       if (positive)
-      {
-        cell->set_refine_flag();
-        cell_refined = true;
-      }
-  }
-  if(!cell_refined)//if no cell was selected for refinement, refine global
+        {
+          cell->set_refine_flag();
+          cell_refined = true;
+        }
+    }
+  if (!cell_refined) //if no cell was selected for refinement, refine global
     for (typename Triangulation<dim>::active_cell_iterator
-        cell = triangulation.begin_active();
-        cell != triangulation.end(); ++cell)
+         cell = triangulation.begin_active();
+         cell != triangulation.end(); ++cell)
       cell->set_refine_flag();
   triangulation.execute_coarsening_and_refinement ();
 }
@@ -115,7 +115,7 @@ void refine_mesh (Triangulation<dim> &triangulation)
 
 
 template <int dim>
-void check (const FiniteElement<dim>fe)
+void check (const FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
 
@@ -125,21 +125,21 @@ void check (const FiniteElement<dim>& fe)
   subdivisions[0] = 2;
 
   const Point<dim> bottom_left = (dim == 2 ?
-      Point<dim>(-1,-1) : Point<dim>(-1,-1,-1));
+                                  Point<dim>(-1,-1) : Point<dim>(-1,-1,-1));
   const Point<dim> top_right   = (dim == 2 ?
-      Point<dim>(1,1) : Point<dim>(1,1,1));
+                                  Point<dim>(1,1) : Point<dim>(1,1,1));
   GridGenerator::subdivided_hyper_rectangle (tr,
-      subdivisions, bottom_left, top_right, true);
+                                             subdivisions, bottom_left, top_right, true);
   refine_mesh(tr);
 
   MGDoFHandler<dim> mg_dof_handler(tr);
   mg_dof_handler.distribute_dofs(fe);
 
   deallog << "Global  dofs: " << mg_dof_handler.n_dofs() << std::endl;
-  for(unsigned int l=0; l<tr.n_levels(); ++l)
+  for (unsigned int l=0; l<tr.n_levels(); ++l)
     {
       deallog << "Level " << l << " dofs:";
-       deallog << ' ' << mg_dof_handler.n_dofs(l);
+      deallog << ' ' << mg_dof_handler.n_dofs(l);
       deallog << std::endl;
     }
 
@@ -153,7 +153,7 @@ void check (const FiniteElement<dim>& fe)
   dirichlet_boundary[3] =             &dirichlet_bc;
 
   MGTools::make_boundary_list (mg_dof_handler, dirichlet_boundary,
-                              boundary_indices);
+                               boundary_indices);
 
   std::vector<unsigned int> block_selected(2);
   block_selected[0] = 0;
@@ -164,7 +164,7 @@ void check (const FiniteElement<dim>& fe)
   // use only the first half of all
   // components
   FullMatrix<double> prolong_0_1 (mg_dof_handler.n_dofs(1)/2,
-                                 mg_dof_handler.n_dofs(0)/2);
+                                  mg_dof_handler.n_dofs(0)/2);
 
   deallog << "Level 0->1" << std::endl;
   make_matrix (transfer, 1, prolong_0_1);
index 5bf6d44d9b62dfdd4868e08af0fbf966a4037c7d..ffbeb5729f5a813befe9593492f374ee34853d48 100644 (file)
@@ -15,7 +15,7 @@
 // ---------------------------------------------------------------------
 
 
-// test like _05 but with a TransferSelect that selects the first two vector 
+// test like _05 but with a TransferSelect that selects the first two vector
 // components as the first block
 
 #include "../tests.h"
@@ -47,10 +47,10 @@ using namespace std;
 template <int dim, typename number, int spacedim>
 void
 reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
-              MGLevelObject<dealii::Vector<number> > &v)
+               MGLevelObject<dealii::Vector<number> > &v)
 {
   for (unsigned int level=v.min_level();
-       level<=v.max_leve();++level)
+       level<=v.max_leve(); ++level)
     {
       unsigned int n = mg_dof.n_dofs (level);
       v[level].reinit(n);
@@ -62,8 +62,8 @@ reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
 template <typename Transfer>
 void
 make_matrix (const Transfer &transfer,
-            const unsigned int high_level,
-            FullMatrix<double> &matrix)
+             const unsigned int high_level,
+             FullMatrix<double> &matrix)
 {
   Vector<double> src (matrix.n());
   Vector<double> dst (matrix.m());
@@ -73,7 +73,7 @@ make_matrix (const Transfer &transfer,
       src(i) = 1;
       transfer.prolongate (high_level, dst, src);
       for (unsigned int j=0; j<dst.size(); ++j)
-       matrix(j,i) = dst(j);
+        matrix(j,i) = dst(j);
     }
 }
 
@@ -84,7 +84,7 @@ void print_matrix (const FullMatrix<double> &m)
   for (unsigned int i=0; i<m.m(); ++i)
     {
       for (unsigned int j=0; j<m.n(); ++j)
-       deallog << m(i,j) << ' ';
+        deallog << m(i,j) << ' ';
       deallog << std::endl;
     }
 }
@@ -93,23 +93,23 @@ void print_matrix (const FullMatrix<double> &m)
 template<int dim>
 void refine_mesh (Triangulation<dim> &triangulation)
 {
-    bool cell_refined = false;
+  bool cell_refined = false;
   for (typename Triangulation<dim>::active_cell_iterator
-      cell = triangulation.begin_active();
-      cell != triangulation.end(); ++cell)
-  {
+       cell = triangulation.begin_active();
+       cell != triangulation.end(); ++cell)
+    {
       const Point<dim> p = cell->center();
       bool positive = p(0) > 0;
       if (positive)
-      {
-        cell->set_refine_flag();
-        cell_refined = true;
-      }
-  }
-  if(!cell_refined)//if no cell was selected for refinement, refine global
+        {
+          cell->set_refine_flag();
+          cell_refined = true;
+        }
+    }
+  if (!cell_refined) //if no cell was selected for refinement, refine global
     for (typename Triangulation<dim>::active_cell_iterator
-        cell = triangulation.begin_active();
-        cell != triangulation.end(); ++cell)
+         cell = triangulation.begin_active();
+         cell != triangulation.end(); ++cell)
       cell->set_refine_flag();
   triangulation.execute_coarsening_and_refinement ();
 }
@@ -117,7 +117,7 @@ void refine_mesh (Triangulation<dim> &triangulation)
 
 
 template <int dim>
-void check (const FiniteElement<dim>fe)
+void check (const FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
 
@@ -127,11 +127,11 @@ void check (const FiniteElement<dim>& fe)
   subdivisions[0] = 2;
 
   const Point<dim> bottom_left = (dim == 2 ?
-      Point<dim>(-1,-1) : Point<dim>(-1,-1,-1));
+                                  Point<dim>(-1,-1) : Point<dim>(-1,-1,-1));
   const Point<dim> top_right   = (dim == 2 ?
-      Point<dim>(1,1) : Point<dim>(1,1,1));
+                                  Point<dim>(1,1) : Point<dim>(1,1,1));
   GridGenerator::subdivided_hyper_rectangle (tr,
-      subdivisions, bottom_left, top_right, true);
+                                             subdivisions, bottom_left, top_right, true);
   refine_mesh(tr);
 
   MGDoFHandler<dim> mg_dof_handler(tr);
@@ -141,27 +141,27 @@ void check (const FiniteElement<dim>& fe)
   block_selected[2] = 1;
 
   deallog << "Global  dofs: " << mg_dof_handler.n_dofs() << std::endl;
-  for(unsigned int l=0; l<tr.n_levels(); ++l)
+  for (unsigned int l=0; l<tr.n_levels(); ++l)
     {
       deallog << "Level " << l << " dofs:";
-       deallog << ' ' << mg_dof_handler.n_dofs(l);
+      deallog << ' ' << mg_dof_handler.n_dofs(l);
       deallog << std::endl;
     }
 
-  DoFRenumbering::component_wise (mg_dof_handler, 
-      block_selected);
+  DoFRenumbering::component_wise (mg_dof_handler,
+                                  block_selected);
   for (unsigned int level=0; level<tr.n_levels(); ++level)
-    DoFRenumbering::component_wise (mg_dof_handler, 
-        level, block_selected);
+    DoFRenumbering::component_wise (mg_dof_handler,
+                                    level, block_selected);
 
   MGTransferSelect<double> transfer;
-  transfer.build_matrices(mg_dof_handler, mg_dof_handler, 
-      0, 0, block_selected, block_selected);
+  transfer.build_matrices(mg_dof_handler, mg_dof_handler,
+                          0, 0, block_selected, block_selected);
 
-  std::vector<std::vector<types::global_dof_index> > 
-    dofs_per_block(tr.n_levels(), std::vector<types::global_dof_index>(2));
-  MGTools::count_dofs_per_block(mg_dof_handler, 
-      dofs_per_block, block_selected);
+  std::vector<std::vector<types::global_dof_index> >
+  dofs_per_block(tr.n_levels(), std::vector<types::global_dof_index>(2));
+  MGTools::count_dofs_per_block(mg_dof_handler,
+                                dofs_per_block, block_selected);
 
   FullMatrix<double> prolong_0_1 (dofs_per_block[1][0],
                                   dofs_per_block[0][0]);
index 76bcbb8c92e4ed0c39b4068e4be33460962b6125..37e5c3be8a2e19e0af602a8656a51ec157c9453e 100644 (file)
@@ -46,10 +46,10 @@ using namespace std;
 template <int dim, typename number, int spacedim>
 void
 reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
-              MGLevelObject<dealii::Vector<number> > &v)
+               MGLevelObject<dealii::Vector<number> > &v)
 {
   for (unsigned int level=v.min_level();
-       level<=v.max_leve();++level)
+       level<=v.max_leve(); ++level)
     {
       unsigned int n = mg_dof.n_dofs (level);
       v[level].reinit(n);
@@ -61,8 +61,8 @@ reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
 template <typename Transfer>
 void
 make_matrix (const Transfer &transfer,
-            const unsigned int high_level,
-            FullMatrix<double> &matrix)
+             const unsigned int high_level,
+             FullMatrix<double> &matrix)
 {
   Vector<double> src (matrix.n());
   Vector<double> dst (matrix.m());
@@ -72,7 +72,7 @@ make_matrix (const Transfer &transfer,
       src(i) = 1;
       transfer.prolongate (high_level, dst, src);
       for (unsigned int j=0; j<dst.size(); ++j)
-       matrix(j,i) = dst(j);
+        matrix(j,i) = dst(j);
     }
 }
 
@@ -83,7 +83,7 @@ void print_matrix (const FullMatrix<double> &m)
   for (unsigned int i=0; i<m.m(); ++i)
     {
       for (unsigned int j=0; j<m.n(); ++j)
-       deallog << m(i,j) << ' ';
+        deallog << m(i,j) << ' ';
       deallog << std::endl;
     }
 }
@@ -92,23 +92,23 @@ void print_matrix (const FullMatrix<double> &m)
 template<int dim>
 void refine_mesh (Triangulation<dim> &triangulation)
 {
-    bool cell_refined = false;
+  bool cell_refined = false;
   for (typename Triangulation<dim>::active_cell_iterator
-      cell = triangulation.begin_active();
-      cell != triangulation.end(); ++cell)
-  {
+       cell = triangulation.begin_active();
+       cell != triangulation.end(); ++cell)
+    {
       const Point<dim> p = cell->center();
       bool positive = p(0) > 0;
       if (positive)
-      {
-        cell->set_refine_flag();
-        cell_refined = true;
-      }
-  }
-  if(!cell_refined)//if no cell was selected for refinement, refine global
+        {
+          cell->set_refine_flag();
+          cell_refined = true;
+        }
+    }
+  if (!cell_refined) //if no cell was selected for refinement, refine global
     for (typename Triangulation<dim>::active_cell_iterator
-        cell = triangulation.begin_active();
-        cell != triangulation.end(); ++cell)
+         cell = triangulation.begin_active();
+         cell != triangulation.end(); ++cell)
       cell->set_refine_flag();
   triangulation.execute_coarsening_and_refinement ();
 }
@@ -116,7 +116,7 @@ void refine_mesh (Triangulation<dim> &triangulation)
 
 
 template <int dim>
-void check (const FiniteElement<dim>fe)
+void check (const FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
 
@@ -126,11 +126,11 @@ void check (const FiniteElement<dim>& fe)
   subdivisions[0] = 2;
 
   const Point<dim> bottom_left = (dim == 2 ?
-      Point<dim>(-1,-1) : Point<dim>(-1,-1,-1));
+                                  Point<dim>(-1,-1) : Point<dim>(-1,-1,-1));
   const Point<dim> top_right   = (dim == 2 ?
-      Point<dim>(1,1) : Point<dim>(1,1,1));
+                                  Point<dim>(1,1) : Point<dim>(1,1,1));
   GridGenerator::subdivided_hyper_rectangle (tr,
-      subdivisions, bottom_left, top_right, true);
+                                             subdivisions, bottom_left, top_right, true);
   refine_mesh(tr);
 
   MGDoFHandler<dim> mg_dof_handler(tr);
@@ -140,18 +140,18 @@ void check (const FiniteElement<dim>& fe)
   block_selected[2] = 1;
 
   deallog << "Global  dofs: " << mg_dof_handler.n_dofs() << std::endl;
-  for(unsigned int l=0; l<tr.n_levels(); ++l)
+  for (unsigned int l=0; l<tr.n_levels(); ++l)
     {
       deallog << "Level " << l << " dofs:";
-       deallog << ' ' << mg_dof_handler.n_dofs(l);
+      deallog << ' ' << mg_dof_handler.n_dofs(l);
       deallog << std::endl;
     }
 
-  DoFRenumbering::component_wise (mg_dof_handler, 
-      block_selected);
+  DoFRenumbering::component_wise (mg_dof_handler,
+                                  block_selected);
   for (unsigned int level=0; level<tr.n_levels(); ++level)
-    DoFRenumbering::component_wise (mg_dof_handler, 
-        level, block_selected);
+    DoFRenumbering::component_wise (mg_dof_handler,
+                                    level, block_selected);
 
   std::vector<std::set<types::global_dof_index> > boundary_indices(tr.n_levels());
   typename FunctionMap<dim>::type      dirichlet_boundary;
@@ -159,16 +159,16 @@ void check (const FiniteElement<dim>& fe)
   dirichlet_boundary[3] =             &dirichlet_bc;
 
   MGTools::make_boundary_list (mg_dof_handler, dirichlet_boundary,
-                              boundary_indices);
+                               boundary_indices);
 
   MGTransferSelect<double> transfer;
-  transfer.build_matrices(mg_dof_handler, mg_dof_handler, 
-      0, 0, block_selected, block_selected, boundary_indices);
+  transfer.build_matrices(mg_dof_handler, mg_dof_handler,
+                          0, 0, block_selected, block_selected, boundary_indices);
 
-  std::vector<std::vector<types::global_dof_index> > 
-    dofs_per_block(tr.n_levels(), std::vector<types::global_dof_index>(2));
-  MGTools::count_dofs_per_block(mg_dof_handler, 
-      dofs_per_block, block_selected);
+  std::vector<std::vector<types::global_dof_index> >
+  dofs_per_block(tr.n_levels(), std::vector<types::global_dof_index>(2));
+  MGTools::count_dofs_per_block(mg_dof_handler,
+                                dofs_per_block, block_selected);
 
   FullMatrix<double> prolong_0_1 (dofs_per_block[1][0],
                                   dofs_per_block[0][0]);
index b2395c741af117a118c6cf9b04b9f5855a0b24a0..7534013357301fdea9e8bc47e4c9db18a3e3eac1 100644 (file)
@@ -47,29 +47,29 @@ using namespace std;
 template<int dim>
 void refine_mesh (Triangulation<dim> &triangulation)
 {
-    bool cell_refined = false;
+  bool cell_refined = false;
   for (typename Triangulation<dim>::active_cell_iterator
-      cell = triangulation.begin_active();
-      cell != triangulation.end(); ++cell)
-  {
+       cell = triangulation.begin_active();
+       cell != triangulation.end(); ++cell)
+    {
       const Point<dim> p = cell->center();
       bool positive = p(0) > 0;
       if (positive)
-      {
-        cell->set_refine_flag();
-        cell_refined = true;
-      }
-  }
-  if(!cell_refined)//if no cell was selected for refinement, refine global
+        {
+          cell->set_refine_flag();
+          cell_refined = true;
+        }
+    }
+  if (!cell_refined) //if no cell was selected for refinement, refine global
     for (typename Triangulation<dim>::active_cell_iterator
-        cell = triangulation.begin_active();
-        cell != triangulation.end(); ++cell)
+         cell = triangulation.begin_active();
+         cell != triangulation.end(); ++cell)
       cell->set_refine_flag();
   triangulation.execute_coarsening_and_refinement ();
 }
 
 template <int dim>
-void check (const FiniteElement<dim>fe, const unsigned int selected_block)
+void check (const FiniteElement<dim> &fe, const unsigned int selected_block)
 {
   deallog << fe.get_name() << std::endl;
 
@@ -78,11 +78,11 @@ void check (const FiniteElement<dim>& fe, const unsigned int selected_block)
   subdivisions[0] = 2;
 
   const Point<dim> bottom_left = (dim == 2 ?
-      Point<dim>(-1,-1) : Point<dim>(-1,-1,-1));
+                                  Point<dim>(-1,-1) : Point<dim>(-1,-1,-1));
   const Point<dim> top_right   = (dim == 2 ?
-      Point<dim>(1,1) : Point<dim>(1,1,1));
+                                  Point<dim>(1,1) : Point<dim>(1,1,1));
   GridGenerator::subdivided_hyper_rectangle (tr,
-      subdivisions, bottom_left, top_right, true);
+                                             subdivisions, bottom_left, top_right, true);
   refine_mesh(tr);
 
   std::ostringstream out_filename;
@@ -109,58 +109,58 @@ void check (const FiniteElement<dim>& fe, const unsigned int selected_block)
   MGTransferSelect<double> transfer;
 
   transfer.build_matrices(mg_dof_handler, mg_dof_handler,
-                         selected_block, selected_block,
-                         block_component, block_component);
+                          selected_block, selected_block,
+                          block_component, block_component);
 
   std::vector<types::global_dof_index> dofs_per_block(3);
   DoFTools::count_dofs_per_block(mg_dof_handler, dofs_per_block, block_component);
-  std::vector<std::vector<types::global_dof_index> > mg_dofs_per_block(tr.n_levels(), 
+  std::vector<std::vector<types::global_dof_index> > mg_dofs_per_block(tr.n_levels(),
       std::vector<types::global_dof_index>(3));
   MGTools::count_dofs_per_block(mg_dof_handler, mg_dofs_per_block, block_component);
 
   deallog << "Global  dofs:";
-  for (unsigned int i=0;i<dofs_per_block.size();++i)
+  for (unsigned int i=0; i<dofs_per_block.size(); ++i)
     deallog << ' ' << dofs_per_block[i];
   deallog << std::endl;
-  for (unsigned int l=0;l<mg_dofs_per_block.size();++l)
+  for (unsigned int l=0; l<mg_dofs_per_block.size(); ++l)
     {
       deallog << "Level " << l << " dofs:";
-      for (unsigned int i=0;i<mg_dofs_per_block[l].size();++i)
-       deallog << ' ' << mg_dofs_per_block[l][i];
+      for (unsigned int i=0; i<mg_dofs_per_block[l].size(); ++i)
+        deallog << ' ' << mg_dofs_per_block[l][i];
       deallog << std::endl;
     }
 
   BlockVector<double> u;
   u.reinit (dofs_per_block);
-  for (unsigned int i=0;i<u.size();++i)
+  for (unsigned int i=0; i<u.size(); ++i)
     u(i) = i;
-  
+
   MGLevelObject<Vector<double> > v(0,tr.n_levels()-1);
-  for(unsigned int l=0; l<tr.n_levels()-1; ++l)
+  for (unsigned int l=0; l<tr.n_levels()-1; ++l)
     v[l].reinit(mg_dofs_per_block[l][2]);
 
 
   transfer.copy_to_mg(mg_dof_handler, v, u);
-  for(unsigned int l=0; l<tr.n_levels(); ++l)
-  {
-    deallog << "Level " << l << std::endl;
-    for (unsigned int i=0; i<v[l].size();++i)
-      deallog << ' ' << (int) v[l](i);
-    deallog << std::endl;
-  }
-
-  for(unsigned int l=0; l<tr.n_levels(); ++l)
-    for (unsigned int i=0;i<v[l].size();++i)
+  for (unsigned int l=0; l<tr.n_levels(); ++l)
+    {
+      deallog << "Level " << l << std::endl;
+      for (unsigned int i=0; i<v[l].size(); ++i)
+        deallog << ' ' << (int) v[l](i);
+      deallog << std::endl;
+    }
+
+  for (unsigned int l=0; l<tr.n_levels(); ++l)
+    for (unsigned int i=0; i<v[l].size(); ++i)
       v[l](i) = i;
-  
+
   u=0;
   transfer.copy_from_mg(mg_dof_handler, u, v);
   deallog << "Global" << std::endl;
-  for (unsigned int i=0; i<u.block(selected_block).size();++i)
-      deallog << ' ' << (int) u.block(selected_block)(i);
+  for (unsigned int i=0; i<u.block(selected_block).size(); ++i)
+    deallog << ' ' << (int) u.block(selected_block)(i);
   deallog << std::endl;
-  for (unsigned int i=0; i<u.size();++i)
-      deallog << ' ' << (int) u(i);
+  for (unsigned int i=0; i<u.size(); ++i)
+    deallog << ' ' << (int) u(i);
   deallog << std::endl;
 }
 
index 47dd180b08ad4df225a4074da3140897e292e342..435685dc25f23cf46315fde8d936355b75df9d90 100644 (file)
 // PETScWrappers::SparseMatrix::set()
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_sparse_matrix.h>    
+#include <deal.II/lac/petsc_sparse_matrix.h>
 #include <fstream>
 #include <iostream>
 
 
 void test (PETScWrappers::SparseMatrix &m)
 {
-                                   // first set a few entries
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
 
   m.compress ();
-  
-                                   // then make sure we retrieve the same ones
+
+  // then make sure we retrieve the same ones
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -54,7 +54,7 @@ void test (PETScWrappers::SparseMatrix &m)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("01/output");
   deallog.attach(logfile);
@@ -68,30 +68,30 @@ int main (int argc,char **argv)
         PETScWrappers::SparseMatrix m (5,5,3);
         test (m);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 881abd1db8fff2c62059007308dd58c1d2643867..ebb1e570fbc88419fb97ee919cd166c2b94425a2 100644 (file)
 // PETScWrappers::SparseMatrix::add()
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_sparse_matrix.h>    
+#include <deal.II/lac/petsc_sparse_matrix.h>
 #include <fstream>
 #include <iostream>
 
 
 void test (PETScWrappers::SparseMatrix &m)
 {
-                                   // first set a few entries
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.add (i,j, i*j*.5+.5);
 
   m.compress ();
-  
-                                   // then make sure we retrieve the same ones
+
+  // then make sure we retrieve the same ones
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -54,7 +54,7 @@ void test (PETScWrappers::SparseMatrix &m)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("02/output");
   deallog.attach(logfile);
@@ -68,30 +68,30 @@ int main (int argc,char **argv)
         PETScWrappers::SparseMatrix m (5,5,3);
         test (m);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 948976b371ca59e105fb6381f74a4f95275a617d..8100d702c2d18f16fe06c7ecba1ff14d3ac92eb8 100644 (file)
@@ -19,7 +19,7 @@
 // check querying matrix sizes
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_sparse_matrix.h>    
+#include <deal.II/lac/petsc_sparse_matrix.h>
 #include <fstream>
 #include <iostream>
 
@@ -34,7 +34,7 @@ void test (PETScWrappers::SparseMatrix &m)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("04/output");
   deallog.attach(logfile);
@@ -48,30 +48,30 @@ int main (int argc,char **argv)
         PETScWrappers::SparseMatrix m (5,5,3);
         test (m);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index f466dba3bc532922ddffb666f8ab63850f62324c..4ace6e60340d560a3e5148db734a7c327029a674 100644 (file)
 // PETScWrappers::SparseMatrix
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_sparse_matrix.h>    
+#include <deal.II/lac/petsc_sparse_matrix.h>
 #include <fstream>
 #include <iostream>
 
 
 void test (PETScWrappers::SparseMatrix &m)
 {
-                                   // first set a few entries. count how many
-                                   // entries we have
+  // first set a few entries. count how many
+  // entries we have
   unsigned int counter = 0;
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
@@ -43,13 +43,13 @@ void test (PETScWrappers::SparseMatrix &m)
   deallog << m.n_nonzero_elements() << std::endl;
   Assert (m.n_nonzero_elements() == counter,
           ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("05/output");
   deallog.attach(logfile);
@@ -63,30 +63,30 @@ int main (int argc,char **argv)
         PETScWrappers::SparseMatrix m (5,5,3);
         test (m);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 203decd2ffaa42f69876164f797e8937f613341a..db3d852ccb6df0def32c3b7409fb2d5f1faf6462 100644 (file)
 // check PETScWrappers::SparseMatrix::l1_norm
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_sparse_matrix.h>    
+#include <deal.II/lac/petsc_sparse_matrix.h>
 #include <fstream>
 #include <iostream>
 
 
 void test (PETScWrappers::SparseMatrix &m)
 {
-                                   // first set a few entries. count how many
-                                   // entries we have
+  // first set a few entries. count how many
+  // entries we have
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
-        m.set (i,j, i*j*.5+.5);  
+        m.set (i,j, i*j*.5+.5);
 
   m.compress ();
 
-                                   // compare against the exact value of the
-                                   // l1-norm (max col-sum)
+  // compare against the exact value of the
+  // l1-norm (max col-sum)
   deallog << m.l1_norm() << std::endl;
   Assert (m.l1_norm() == 7, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("06/output");
   deallog.attach(logfile);
@@ -59,30 +59,30 @@ int main (int argc,char **argv)
         PETScWrappers::SparseMatrix m (5,5,3);
         test (m);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index f448f036b8cf1b40e2c651a6d8493f99c3b0e1d1..8df68660e59ecc287b88db779a84fff0f21fb3bc 100644 (file)
 // check PETScWrappers::SparseMatrix::linfty_norm
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_sparse_matrix.h>    
+#include <deal.II/lac/petsc_sparse_matrix.h>
 #include <fstream>
 #include <iostream>
 
 
 void test (PETScWrappers::SparseMatrix &m)
 {
-                                   // first set a few entries. count how many
-                                   // entries we have
+  // first set a few entries. count how many
+  // entries we have
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
-        m.set (i,j, i*j*.5+.5);  
+        m.set (i,j, i*j*.5+.5);
 
   m.compress ();
 
-                                   // compare against the exact value of the
-                                   // linfty-norm (max row-sum)
+  // compare against the exact value of the
+  // linfty-norm (max row-sum)
   deallog << m.linfty_norm() << std::endl;
   Assert (m.linfty_norm() == 8.5, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("07/output");
   deallog.attach(logfile);
@@ -59,30 +59,30 @@ int main (int argc,char **argv)
         PETScWrappers::SparseMatrix m (5,5,3);
         test (m);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index a8ee62c6d7d86f10e2c7d6b33263ecca3be906e5..c131f019994a07460f5f07299639d7aa7cb4796a 100644 (file)
 // check PETScWrappers::SparseMatrix::frobenius_norm
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_sparse_matrix.h>    
+#include <deal.II/lac/petsc_sparse_matrix.h>
 #include <fstream>
 #include <iostream>
 
 
 void test (PETScWrappers::SparseMatrix &m)
 {
-                                   // first set a few entries. count how many
-                                   // entries we have
+  // first set a few entries. count how many
+  // entries we have
   PetscScalar norm = 0;
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
@@ -40,17 +40,17 @@ void test (PETScWrappers::SparseMatrix &m)
 
   m.compress ();
 
-                                   // compare against the exact value of the
-                                   // l2-norm (max row-sum)
+  // compare against the exact value of the
+  // l2-norm (max row-sum)
   deallog << m.frobenius_norm() << std::endl;
   Assert (m.frobenius_norm() == norm, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("08/output");
   deallog.attach(logfile);
@@ -64,30 +64,30 @@ int main (int argc,char **argv)
         PETScWrappers::SparseMatrix m (5,5,3);
         test (m);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index a17198dff63b8a9de0440b9b37a300c936d68085..403cdf5a2f7f4569ffbc4f3d093fc15de97fb2e0 100644 (file)
 // check PETScWrappers::SparseMatrix::operator *=
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_sparse_matrix.h>    
+#include <deal.II/lac/petsc_sparse_matrix.h>
 #include <fstream>
 #include <iostream>
 
 
 void test (PETScWrappers::SparseMatrix &m)
 {
-                                   // first set a few entries
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
 
   m.compress ();
-  
-                                   // then multiply everything by 1.25 and
-                                   // make sure we retrieve the values we
-                                   // expect
+
+  // then multiply everything by 1.25 and
+  // make sure we retrieve the values we
+  // expect
   m *= 1.25;
-  
+
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -57,7 +57,7 @@ void test (PETScWrappers::SparseMatrix &m)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("09/output");
   deallog.attach(logfile);
@@ -71,30 +71,30 @@ int main (int argc,char **argv)
         PETScWrappers::SparseMatrix m (5,5,3);
         test (m);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 36c51dee635c2fcfd76e9aaa3103be10992c8a5c..2dd6880a74e76a53ec9e67cacc5099df29f321e6 100644 (file)
 // check PETScWrappers::SparseMatrix::operator /=
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_sparse_matrix.h>    
+#include <deal.II/lac/petsc_sparse_matrix.h>
 #include <fstream>
 #include <iostream>
 
 
 void test (PETScWrappers::SparseMatrix &m)
 {
-                                   // first set a few entries
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
 
   m.compress ();
-  
-                                   // then divide everything by 4/3 and
-                                   // make sure we retrieve the values we
-                                   // expect
+
+  // then divide everything by 4/3 and
+  // make sure we retrieve the values we
+  // expect
   m /= 4./3.;
-  
+
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -57,7 +57,7 @@ void test (PETScWrappers::SparseMatrix &m)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("10/output");
   deallog.attach(logfile);
@@ -71,30 +71,30 @@ int main (int argc,char **argv)
         PETScWrappers::SparseMatrix m (5,5,3);
         test (m);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 5e6f3d90b85dade5d9df8ad78f050ef9cd12f57e..5fb65931bf687125372fdfad86b8c2a291bba527 100644 (file)
 // check PETScWrappers::Vector::size()
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 
 
 void test (PETScWrappers::Vector &v)
 {
-                                   // set only certain elements of the vector
+  // set only certain elements of the vector
   for (unsigned int i=0; i<v.size(); i+=1+i)
     v(i) = i;
 
   v.compress ();
-  
+
   Assert (v.size() == 100, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -39,7 +39,7 @@ void test (PETScWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("11/output");
   deallog.attach(logfile);
@@ -53,30 +53,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector v (100);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 82ffb49c7e7e6d6ec7764aa7c02cc573fa1083d9..2f7735bb8aa3ef0f50ed94e7fbc5b6b3daa8604c 100644 (file)
@@ -19,7 +19,7 @@
 // check PETScWrappers::Vector::operator() in set-mode
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -27,9 +27,9 @@
 
 void test (PETScWrappers::Vector &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -39,12 +39,12 @@ void test (PETScWrappers::Vector &v)
 
   v.compress ();
 
-                                   // check that they are ok, and this time
-                                   // all of them
+  // check that they are ok, and this time
+  // all of them
   for (unsigned int i=0; i<v.size(); ++i)
     Assert ( ( (pattern[i] == true) && (v(i) == i) )
-            ||
-            ( (pattern[i] == false) && (v(i) == 0) ),
+             ||
+             ( (pattern[i] == false) && (v(i) == 0) ),
              ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -52,7 +52,7 @@ void test (PETScWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("12/output");
   deallog.attach(logfile);
@@ -66,30 +66,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector v (100);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 8c5a9d09ce1867a574738ee79c857e9b76df7962..20d273c60a206c98d4b5c36165b021273d0fd230 100644 (file)
@@ -19,7 +19,7 @@
 // check PETScWrappers::Vector::operator() in add-mode
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -27,9 +27,9 @@
 
 void test (PETScWrappers::Vector &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -39,8 +39,8 @@ void test (PETScWrappers::Vector &v)
 
   v.compress ();
 
-                                   // check that they are ok, and this time
-                                   // all of them
+  // check that they are ok, and this time
+  // all of them
   for (unsigned int i=0; i<v.size(); ++i)
     Assert ( ( (pattern[i] == true) && (v(i) == i) )
              ||
@@ -52,7 +52,7 @@ void test (PETScWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("13/output");
   deallog.attach(logfile);
@@ -66,30 +66,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector v (100);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index dfab9add3141ac1d7d29559cca63f0c684818ddc..acd4aea032bfa2c2de2faa3e4d37ed82e63b2b03 100644 (file)
@@ -19,7 +19,7 @@
 // check PETScWrappers::Vector::l1_norm()
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -27,7 +27,7 @@
 
 void test (PETScWrappers::Vector &v)
 {
-                                   // set some elements of the vector
+  // set some elements of the vector
   double norm = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -36,7 +36,7 @@ void test (PETScWrappers::Vector &v)
     }
   v.compress ();
 
-                                   // then check the norm
+  // then check the norm
   Assert (v.l1_norm() == norm, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -44,7 +44,7 @@ void test (PETScWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("17/output");
   deallog.attach(logfile);
@@ -58,30 +58,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector v (100);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index ca7aaefe67796b0823590bc2e61ca8683b8281b0..32f6826469a9a0002ee1c7d5738523cc6020b60e 100644 (file)
@@ -19,7 +19,7 @@
 // check PETScWrappers::Vector::l2_norm()
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -27,7 +27,7 @@
 
 void test (PETScWrappers::Vector &v)
 {
-                                   // set some elements of the vector
+  // set some elements of the vector
   PetscScalar norm = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -36,7 +36,7 @@ void test (PETScWrappers::Vector &v)
     }
   v.compress ();
 
-                                   // then check the norm
+  // then check the norm
   const double eps=typeid(PetscScalar)==typeid(double) ? 1e-14 : 1e-5;
   Assert (fabs(v.l2_norm()-std::sqrt(norm))<eps, ExcInternalError());
 
@@ -45,7 +45,7 @@ void test (PETScWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("18/output");
   deallog.attach(logfile);
@@ -59,30 +59,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector v (100);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 48f28dc995c4370790ffa809689a61f11606b4af..f1c63cd2b8d1c3139a081c19960ae4f3679ad273 100644 (file)
@@ -19,7 +19,7 @@
 // check PETScWrappers::Vector::linfty_norm()
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -27,7 +27,7 @@
 
 void test (PETScWrappers::Vector &v)
 {
-                                   // set some elements of the vector
+  // set some elements of the vector
   double norm = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -36,7 +36,7 @@ void test (PETScWrappers::Vector &v)
     }
   v.compress ();
 
-                                   // then check the norm
+  // then check the norm
   Assert (v.linfty_norm() == norm, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -44,7 +44,7 @@ void test (PETScWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("19/output");
   deallog.attach(logfile);
@@ -58,30 +58,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector v (100);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index f9370b99020b6184b64ddf838865127e43eb754a..093f7a5d0d111f413d2853cf459784019eb96481 100644 (file)
@@ -19,7 +19,7 @@
 // check PETScWrappers::Vector::operator *=
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -27,9 +27,9 @@
 
 void test (PETScWrappers::Vector &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -38,10 +38,10 @@ void test (PETScWrappers::Vector &v)
     }
   v.compress ();
 
-                                   // multiply v with 5/4
+  // multiply v with 5/4
   v *= 5./4.;
 
-                                   // check that the entries are ok
+  // check that the entries are ok
   for (unsigned int i=0; i<v.size(); ++i)
     Assert ( ( (pattern[i] == true) && (v(i) == i*5./4.) )
              ||
@@ -53,7 +53,7 @@ void test (PETScWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("20/output");
   deallog.attach(logfile);
@@ -67,30 +67,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector v (100);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index dbe02dab2332e79a89e28e311c8e0b6db95c07a0..025a0e739b5aeb4bdb856e44e9743ecc46e49c45 100644 (file)
@@ -19,7 +19,7 @@
 // check PETScWrappers::Vector::operator /=
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -27,9 +27,9 @@
 
 void test (PETScWrappers::Vector &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -38,10 +38,10 @@ void test (PETScWrappers::Vector &v)
     }
   v.compress ();
 
-                                   // multiply v with 3/4
+  // multiply v with 3/4
   v /= 4./3.;
 
-                                   // check that the entries are ok
+  // check that the entries are ok
   for (unsigned int i=0; i<v.size(); ++i)
     Assert ( ( (pattern[i] == true) && (v(i) == i*3./4.) )
              ||
@@ -53,7 +53,7 @@ void test (PETScWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("21/output");
   deallog.attach(logfile);
@@ -67,30 +67,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector v (100);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index d8432ee29ecee0fa98510457d6cec61404c8bbdb..ff3e68b321600a8797de112e50a9c951c6b51c6d 100644 (file)
@@ -20,7 +20,7 @@
 // orthogonal
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -29,8 +29,8 @@
 void test (PETScWrappers::Vector &v,
            PETScWrappers::Vector &w)
 {
-                                   // set only certain elements of each
-                                   // vector, but disjoint sets of elements
+  // set only certain elements of each
+  // vector, but disjoint sets of elements
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = i;
@@ -39,7 +39,7 @@ void test (PETScWrappers::Vector &v,
   v.compress ();
   w.compress ();
 
-                                   // make sure the scalar product is zero
+  // make sure the scalar product is zero
   Assert (v*w == 0, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -47,7 +47,7 @@ void test (PETScWrappers::Vector &v,
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("22/output");
   deallog.attach(logfile);
@@ -62,30 +62,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector w (100);
         test (v,w);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index a1d83ae81734ba9df5c8020542f2b7c1070df116..39cefff140964703297178959eb1b6536102d18d 100644 (file)
@@ -20,7 +20,7 @@
 // not orthogonal
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -29,9 +29,9 @@
 void test (PETScWrappers::Vector &v,
            PETScWrappers::Vector &w)
 {
-                                   // set only certain elements of each
-                                   // vector, and record the expected scalar
-                                   // product
+  // set only certain elements of each
+  // vector, and record the expected scalar
+  // product
   double product = 0;
   for (unsigned int i=0; i<v.size(); ++i)
     {
@@ -42,11 +42,11 @@ void test (PETScWrappers::Vector &v,
           product += i*(i+1);
         }
     }
-  
+
   v.compress ();
   w.compress ();
 
-                                   // make sure the scalar product is zero
+  // make sure the scalar product is zero
   Assert (v*w == product, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -54,7 +54,7 @@ void test (PETScWrappers::Vector &v,
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("23/output");
   deallog.attach(logfile);
@@ -69,30 +69,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector w (100);
         test (v,w);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 851fe2ead8bf7c474a1867b475ccf80e6b5164ad..83d244116cf498e59cbe0ea6618c2558c941b6b6 100644 (file)
@@ -21,7 +21,7 @@
 // may be covered by one of the other tests
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
 
 void test (PETScWrappers::Vector &v)
 {
-                                   // set some entries of the vector
+  // set some entries of the vector
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = i+1.;
   v.compress ();
 
-                                   // then clear it again and make sure the
-                                   // vector is really empty
+  // then clear it again and make sure the
+  // vector is really empty
   const unsigned int sz = v.size();
   v = 0;
   Assert (v.size() == sz, ExcInternalError());
@@ -47,7 +47,7 @@ void test (PETScWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("24/output");
   deallog.attach(logfile);
@@ -61,30 +61,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector v (100);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 32e213c69dd83605189b3ac44e4c0836c93f9fdd..664daabe1363d74ad41fb4e371c8fa67362e37ed 100644 (file)
@@ -19,7 +19,7 @@
 // check PETScWrappers::Vector::operator = (PetscScalar) with setting to zero
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
 
 void test (PETScWrappers::Vector &v)
 {
-                                   // set some entries of the vector
+  // set some entries of the vector
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = i+1.;
   v.compress ();
 
-                                   // then clear it again and make sure the
-                                   // vector is really empty
+  // then clear it again and make sure the
+  // vector is really empty
   const unsigned int sz = v.size();
   v = 0;
   Assert (v.size() == sz, ExcInternalError());
@@ -45,7 +45,7 @@ void test (PETScWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("25/output");
   deallog.attach(logfile);
@@ -59,30 +59,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector v (100);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index f1c8b27e0885cfec0f089a4d14e35c1784097b7f..99808a0f6cefbfde45cf1ebfd6c4074935b740e9 100644 (file)
@@ -20,7 +20,7 @@
 // nonzero value
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -28,7 +28,7 @@
 
 void test (PETScWrappers::Vector &v)
 {
-                                   // set some entries of the vector
+  // set some entries of the vector
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = i+1.;
@@ -44,7 +44,7 @@ void test (PETScWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("26/output");
   deallog.attach(logfile);
@@ -58,30 +58,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector v (100);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index fffd7ac22131d5aa3e8f21058d034eea64d2e4b3..977b667fb5a296d08e081cff770eafdcda47a95a 100644 (file)
 
 
 
-// check PETScWrappers::Vector::operator = (Vector) 
+// check PETScWrappers::Vector::operator = (Vector)
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
 
 void test (PETScWrappers::Vector &v)
 {
-                                   // set some entries of the vector
+  // set some entries of the vector
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = i+1.;
   v.compress ();
 
-                                   // then copy it
+  // then copy it
   PETScWrappers::Vector w (v.size());
   w = v;
 
-                                   // make sure they're equal
-  deallog << v*w << ' ' << v.l2_norm() * w.l2_norm()
-          << ' ' << v*w - v.l2_norm() * w.l2_norm() << std::endl;
+  // make sure they're equal
+  deallog << v *w << ' ' << v.l2_norm() * w.l2_norm()
+          << ' ' << v *w - v.l2_norm() * w.l2_norm() << std::endl;
   const double eps=typeid(PetscScalar)==typeid(double) ? 1e-14 : 1e-5;
   Assert (std::fabs(v*w - v.l2_norm() * w.l2_norm()) < eps*(v*w),
           ExcInternalError());
@@ -49,7 +49,7 @@ void test (PETScWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("27/output");
   deallog.attach(logfile);
@@ -63,30 +63,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector v (100);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 30a80741dfa2a4aa59c29aeb51d27bf0d6b6dcc2..caae5310e110cf9c88e1b47af376c164f31f2642 100644 (file)
@@ -20,7 +20,7 @@
 // resize the vector to be copied to beforehand
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
 
 void test (PETScWrappers::Vector &v)
 {
-                                   // set some entries of the vector
+  // set some entries of the vector
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = i+1.;
   v.compress ();
 
-                                   // then copy it to a vector of different
-                                   // size
+  // then copy it to a vector of different
+  // size
   PETScWrappers::Vector w (1);
   w = v;
 
-                                   // make sure they're equal
-  deallog << v*w << ' ' << v.l2_norm() * w.l2_norm()
-          << ' ' << v*w - v.l2_norm() * w.l2_norm() << std::endl;
+  // make sure they're equal
+  deallog << v *w << ' ' << v.l2_norm() * w.l2_norm()
+          << ' ' << v *w - v.l2_norm() * w.l2_norm() << std::endl;
   const double eps=typeid(PetscScalar)==typeid(double) ? 1e-14 : 1e-5;
   Assert (std::fabs(v*w - v.l2_norm() * w.l2_norm()) < eps*(v*w),
           ExcInternalError());
@@ -51,7 +51,7 @@ void test (PETScWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("28/output");
   deallog.attach(logfile);
@@ -65,30 +65,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector v (100);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 0572d59259dff678f3154596031518e8c015243b..6735d469257b916467ab050b336a439ca2e3804a 100644 (file)
@@ -19,7 +19,7 @@
 // check PETScWrappers::Vector::reinit(fast)
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -28,7 +28,7 @@
 void test (PETScWrappers::Vector &v)
 {
   v.reinit (13, true);
-  
+
   Assert (v.size() == 13, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -36,7 +36,7 @@ void test (PETScWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("29/output");
   deallog.attach(logfile);
@@ -50,30 +50,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector v (100);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index ebccf9ea38a1c6d80810cabc38b89ed4b6d2dccf..d19042b55f4279bcbfb3fe39d8bb967d997225bd 100644 (file)
@@ -19,7 +19,7 @@
 // check PETScWrappers::Vector::reinit(!fast)
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
 
 void test (PETScWrappers::Vector &v)
 {
-                                   // set some entries of the vector
+  // set some entries of the vector
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = i+1.;
   v.compress ();
 
-                                   // then resize with setting to zero
+  // then resize with setting to zero
   v.reinit (13, false);
-  
+
   Assert (v.size() == 13, ExcInternalError());
   Assert (v.l2_norm() == 0, ExcInternalError());
 
@@ -44,7 +44,7 @@ void test (PETScWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("30/output");
   deallog.attach(logfile);
@@ -58,30 +58,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector v (100);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index d40ae31b5e820b4b65ef5df279cf526b1ffa53d6..999875a194ace089dd8768c6668f37905b0a4252 100644 (file)
@@ -19,7 +19,7 @@
 // check PETScWrappers::Vector::l2_norm()
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -27,7 +27,7 @@
 
 void test (PETScWrappers::Vector &v)
 {
-                                   // set some elements of the vector
+  // set some elements of the vector
   PetscScalar norm = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -36,7 +36,7 @@ void test (PETScWrappers::Vector &v)
     }
   v.compress ();
 
-                                   // then check the norm
+  // then check the norm
   const double eps=typeid(PetscScalar)==typeid(double) ? 1e-14 : 1e-5;
   Assert (std::fabs(v.norm_sqr() - norm) < eps*norm,
           ExcInternalError());
@@ -46,7 +46,7 @@ void test (PETScWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("31/output");
   deallog.attach(logfile);
@@ -60,30 +60,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector v (100);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 5debd0866ee878431256a7eb06bffe620a08bfa0..a00689f96a02e30877bd3d88628edae885c74f4d 100644 (file)
@@ -19,7 +19,7 @@
 // check PETScWrappers::Vector::mean_value()
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -27,7 +27,7 @@
 
 void test (PETScWrappers::Vector &v)
 {
-                                   // set some elements of the vector
+  // set some elements of the vector
   PetscScalar sum = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -36,7 +36,7 @@ void test (PETScWrappers::Vector &v)
     }
   v.compress ();
 
-                                   // then check the norm
+  // then check the norm
   const double eps=typeid(PetscScalar)==typeid(double) ? 1e-14 : 1e-5;
   Assert (std::fabs(v.mean_value() - sum/v.size()) < eps*sum/v.size(),
           ExcInternalError());
@@ -46,7 +46,7 @@ void test (PETScWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("32/output");
   deallog.attach(logfile);
@@ -60,30 +60,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector v (100);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index f49f547bb84451988f25f24eee174424e2d1c9e5..e10e8edee6d706d9f69716f82fd9ba03ef3e4635 100644 (file)
@@ -19,7 +19,7 @@
 // check PETScWrappers::Vector::lp_norm(3)
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -27,7 +27,7 @@
 
 void test (PETScWrappers::Vector &v)
 {
-                                   // set some elements of the vector
+  // set some elements of the vector
   PetscScalar sum = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -36,7 +36,7 @@ void test (PETScWrappers::Vector &v)
     }
   v.compress ();
 
-                                   // then check the norm
+  // then check the norm
   const double eps=typeid(PetscScalar)==typeid(double) ? 1e-14 : 1e-5;
   const double true_value=std::pow(sum, static_cast<PetscScalar> (1./3.));
   Assert (std::fabs(v.lp_norm(3) - true_value) < eps*true_value,
@@ -47,7 +47,7 @@ void test (PETScWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("33/output");
   deallog.attach(logfile);
@@ -61,30 +61,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector v (100);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index cb038a90eba3b80efe411200fe9202baaa612f85..b2c73c1027518c65841ae884ac6cabcea8c6d4c3 100644 (file)
@@ -19,7 +19,7 @@
 // check PETScWrappers::Vector::all_zero
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -27,7 +27,7 @@
 
 void test (PETScWrappers::Vector &v)
 {
-                                   // set some elements of the vector
+  // set some elements of the vector
   double sum = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -36,10 +36,10 @@ void test (PETScWrappers::Vector &v)
     }
   v.compress ();
 
-                                   // set them to zero again
+  // set them to zero again
   v = 0;
 
-                                   // then check all_zero
+  // then check all_zero
   Assert (v.all_zero() == true, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -47,7 +47,7 @@ void test (PETScWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("34/output");
   deallog.attach(logfile);
@@ -61,30 +61,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector v (100);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index b8053d5953355efbc6dcd6c4a42752682bb3fa57..650f0e522fa3829ef2b19b27b2f5cc61050b5e1b 100644 (file)
 
 
 
-// check PETScWrappers::Vector::operator+=(Vector) 
+// check PETScWrappers::Vector::operator+=(Vector)
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
 void test (PETScWrappers::Vector &v,
            PETScWrappers::Vector &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       if (i%3 == 0)
         w(i) = i+1.;
     }
-  
+
   v.compress ();
   w.compress ();
 
   v += w;
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       if (i%3 == 0)
@@ -63,7 +63,7 @@ void test (PETScWrappers::Vector &v,
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("35/output");
   deallog.attach(logfile);
@@ -78,30 +78,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector w (100);
         test (v,w);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index aeb165a17676f5a32ebf9bfb1d045940a284fdda..ecee1fed235e200eaf2ea7fc445e510bdf9db976 100644 (file)
 
 
 
-// check PETScWrappers::Vector::operator-=(Vector) 
+// check PETScWrappers::Vector::operator-=(Vector)
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
 void test (PETScWrappers::Vector &v,
            PETScWrappers::Vector &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       if (i%3 == 0)
         w(i) = i+1.;
     }
-  
+
   v.compress ();
   w.compress ();
 
   v -= w;
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       if (i%3 == 0)
@@ -63,7 +63,7 @@ void test (PETScWrappers::Vector &v,
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("36/output");
   deallog.attach(logfile);
@@ -78,30 +78,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector w (100);
         test (v,w);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index af77925f6f146dc39fb276de82dfc05ca2eef413..d5168ca892127a47873384a7094e363f2ce419e4 100644 (file)
@@ -19,7 +19,7 @@
 // check PETScWrappers::Vector::add (scalar)
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -29,12 +29,12 @@ void test (PETScWrappers::Vector &v)
 {
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
-  
+
   v.compress ();
 
   v.add (1.);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     Assert (v(i) == i+1., ExcInternalError());
 
@@ -43,7 +43,7 @@ void test (PETScWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("37/output");
   deallog.attach(logfile);
@@ -57,30 +57,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector v (100);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 7f3cd20e7d2eb03614c26797722c471ad8ca3ab4..c27730483d6fc9b2e70cfa3b71b434da518b363d 100644 (file)
 
 
 
-// check PETScWrappers::Vector::add(Vector) 
+// check PETScWrappers::Vector::add(Vector)
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -33,13 +33,13 @@ void test (PETScWrappers::Vector &v,
       v(i) = i;
       w(i) = i+1.;
     }
-  
+
   v.compress ();
   w.compress ();
 
   v.add (w);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -51,7 +51,7 @@ void test (PETScWrappers::Vector &v,
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("38/output");
   deallog.attach(logfile);
@@ -66,30 +66,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector w (100);
         test (v,w);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 1501108e1036c581d4dd18867fb1f3689ce92b9d..bcbb87c189ace2b7fb9ef56b1797c7ab1881c498 100644 (file)
 
 
 
-// check PETScWrappers::Vector::add(scalar, Vector) 
+// check PETScWrappers::Vector::add(scalar, Vector)
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -33,13 +33,13 @@ void test (PETScWrappers::Vector &v,
       v(i) = i;
       w(i) = i+1.;
     }
-  
+
   v.compress ();
   w.compress ();
 
   v.add (2, w);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -51,7 +51,7 @@ void test (PETScWrappers::Vector &v,
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("39/output");
   deallog.attach(logfile);
@@ -66,30 +66,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector w (100);
         test (v,w);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 913cdc1dbe65248c4ac4bcfd14012902f76a30d7..197e3e2f1436a94495bd80468c3f164ebf7ceee9 100644 (file)
@@ -19,7 +19,7 @@
 // check PETScWrappers::Vector::add(s,V,s,V)
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -35,14 +35,14 @@ void test (PETScWrappers::Vector &v,
       w(i) = i+1.;
       x(i) = i+2.;
     }
-  
+
   v.compress ();
   w.compress ();
   x.compress ();
 
   v.add (2, w, 3, x);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -55,7 +55,7 @@ void test (PETScWrappers::Vector &v,
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("40/output");
   deallog.attach(logfile);
@@ -71,30 +71,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector x (100);
         test (v,w,x);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index a272d528824611342834e6d7308569c20da7197b..d873ec1e919b5d8468150d86662b039bb5b67af2 100644 (file)
 
 
 
-// check PETScWrappers::Vector::sadd(s, Vector) 
+// check PETScWrappers::Vector::sadd(s, Vector)
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -33,13 +33,13 @@ void test (PETScWrappers::Vector &v,
       v(i) = i;
       w(i) = i+1.;
     }
-  
+
   v.compress ();
   w.compress ();
 
   v.sadd (2, w);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -51,7 +51,7 @@ void test (PETScWrappers::Vector &v,
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("41/output");
   deallog.attach(logfile);
@@ -66,30 +66,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector w (100);
         test (v,w);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 2262e5c74bd7378cb2405994c58180cf02046a2e..2d23c07633d1c2638173f7bffddbcade796c4f62 100644 (file)
 
 
 
-// check PETScWrappers::Vector::sadd(scalar, scalar, Vector) 
+// check PETScWrappers::Vector::sadd(scalar, scalar, Vector)
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -33,13 +33,13 @@ void test (PETScWrappers::Vector &v,
       v(i) = i;
       w(i) = i+1.;
     }
-  
+
   v.compress ();
   w.compress ();
 
   v.sadd (3, 2, w);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -51,7 +51,7 @@ void test (PETScWrappers::Vector &v,
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("42/output");
   deallog.attach(logfile);
@@ -66,30 +66,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector w (100);
         test (v,w);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 44478bc5b0ae214c625d2888beac37d71c6670b0..c4d49ece4782accd2840d3a9e27d5d34c3f564c9 100644 (file)
@@ -19,7 +19,7 @@
 // check PETScWrappers::Vector::sadd(s,s,V,s,V)
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -35,14 +35,14 @@ void test (PETScWrappers::Vector &v,
       w(i) = i+1.;
       x(i) = i+2.;
     }
-  
+
   v.compress ();
   w.compress ();
   x.compress ();
 
   v.sadd (1.5, 2, w, 3, x);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -55,7 +55,7 @@ void test (PETScWrappers::Vector &v,
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("43/output");
   deallog.attach(logfile);
@@ -71,30 +71,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector x (100);
         test (v,w,x);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index d5dee5b1c13eda3f7645c75cb0f4bca087ddb388..263844e01212f2cb662eef8236ed805fda9fd71e 100644 (file)
@@ -19,7 +19,7 @@
 // check PETScWrappers::Vector::sadd(s,s,V,s,V,s,V)
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -37,7 +37,7 @@ void test (PETScWrappers::Vector &v,
       x(i) = i+2.;
       y(i) = i+3.;
     }
-  
+
   v.compress ();
   w.compress ();
   x.compress ();
@@ -45,7 +45,7 @@ void test (PETScWrappers::Vector &v,
 
   v.sadd (1.5, 2, w, 3, x, 4, y);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -59,7 +59,7 @@ void test (PETScWrappers::Vector &v,
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("44/output");
   deallog.attach(logfile);
@@ -76,30 +76,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector y (100);
         test (v,w,x,y);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 4e3294beceb5cef9246a74a60423f6093008a782..fa9189a20365fe67e91077e5fae4c75888429640 100644 (file)
@@ -19,7 +19,7 @@
 // check PETScWrappers::Vector::scale
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -33,13 +33,13 @@ void test (PETScWrappers::Vector &v,
       v(i) = i;
       w(i) = i+1.;
     }
-  
+
   v.compress ();
   w.compress ();
 
   v.scale (w);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -51,7 +51,7 @@ void test (PETScWrappers::Vector &v,
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("45/output");
   deallog.attach(logfile);
@@ -66,30 +66,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector w (100);
         test (v,w);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index b41f31376132d2cff4bc010b715c5f2464be23e8..ee89cbeda7915854917e2047ef3bc6f0cc8bcef0 100644 (file)
@@ -19,7 +19,7 @@
 // check PETScWrappers::Vector::equ (s,V)
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -33,13 +33,13 @@ void test (PETScWrappers::Vector &v,
       v(i) = i;
       w(i) = i+1.;
     }
-  
+
   v.compress ();
   w.compress ();
 
   v.equ (2, w);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -51,7 +51,7 @@ void test (PETScWrappers::Vector &v,
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("46/output");
   deallog.attach(logfile);
@@ -66,30 +66,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector w (100);
         test (v,w);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index f89c4a4cfc53601fb5a7bcff9548c92b4ba95551..fad3ae044be74ca0eae9eae6553aae72c62a216f 100644 (file)
@@ -19,7 +19,7 @@
 // check PETScWrappers::Vector::equ (s,V,s,V)
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -35,14 +35,14 @@ void test (PETScWrappers::Vector &v,
       w(i) = i+1.;
       x(i) = i+2.;
     }
-  
+
   v.compress ();
   w.compress ();
   x.compress ();
 
   v.equ (2, w, 3, x);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -55,7 +55,7 @@ void test (PETScWrappers::Vector &v,
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("47/output");
   deallog.attach(logfile);
@@ -71,30 +71,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector x (100);
         test (v,w,x);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 27dfbd5f9a69de95f7ecebaed893465c5ac23a56..d7e6ea1ff1f43f4f9fbbd934772caff3f7c24cb0 100644 (file)
@@ -19,7 +19,7 @@
 // check PETScWrappers::Vector::ratio
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -35,14 +35,14 @@ void test (PETScWrappers::Vector &v,
       w(i) = i+1.;
       x(i) = i+2.;
     }
-  
+
   v.compress ();
   w.compress ();
   x.compress ();
 
   v.ratio (w, x);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   const double eps=typeid(PetscScalar)==typeid(double) ? 1e-14 : 1e-5;
   for (unsigned int i=0; i<v.size(); ++i)
     {
@@ -57,7 +57,7 @@ void test (PETScWrappers::Vector &v,
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("48/output");
   deallog.attach(logfile);
@@ -73,30 +73,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector x (100);
         test (v,w,x);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 382dd6639ccf9a12a5494a5d24c47b4949d5392b..48ec7229e678a794a673b0ccbc2afcdadb02131f 100644 (file)
@@ -32,11 +32,11 @@ void test (PETScWrappers::Vector &v)
 
   for (unsigned int i=0; i<w.size(); ++i)
     w(i) = i;
-  
+
   v = w;
 
-  
-                                   // make sure we get the expected result
+
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i, ExcInternalError());
@@ -48,7 +48,7 @@ void test (PETScWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("49/output");
   deallog.attach(logfile);
@@ -62,30 +62,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector v (100);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 933ce6e49f7e2ec208d4717a5524860162db473b..57449973fd9194a2c2e334008d4257fdf21a8a40 100644 (file)
@@ -36,13 +36,13 @@ void test (PETScWrappers::Vector &v)
       w(i) = i;
       x(i) = i+1;
     }
-  
-                                   // first copy from w and make sure we get
-                                   // the expected result. then copy from x
-                                   // and do the same. in at least one of the
-                                   // two cases, the template argument to
-                                   // Vector<T> must be different from
-                                   // PetscScalar
+
+  // first copy from w and make sure we get
+  // the expected result. then copy from x
+  // and do the same. in at least one of the
+  // two cases, the template argument to
+  // Vector<T> must be different from
+  // PetscScalar
   v = w;
   for (unsigned int i=0; i<v.size(); ++i)
     {
@@ -58,13 +58,13 @@ void test (PETScWrappers::Vector &v)
       Assert (v(i) == i+1, ExcInternalError());
       Assert (x(i) == i+1, ExcInternalError());
     }
-  
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("50/output");
   deallog.attach(logfile);
@@ -78,30 +78,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector v (100);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 46d769aea5b2629839d05a0a4e4f90ba9611af6d..882019b01f67f3a4040cb3471125885da8e74277 100644 (file)
 
 
 
-// check copy constructor PETScWrappers::Vector::Vector(Vector) 
+// check copy constructor PETScWrappers::Vector::Vector(Vector)
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
 
 void test (PETScWrappers::Vector &v)
 {
-                                   // set some entries of the vector
+  // set some entries of the vector
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = i+1.;
   v.compress ();
 
-                                   // then copy it
+  // then copy it
   PETScWrappers::Vector w (v);
   w.compress ();
 
-                                   // make sure they're equal
-  deallog << v*w << ' ' << v.l2_norm() * w.l2_norm()
-          << ' ' << v*w - v.l2_norm() * w.l2_norm() << std::endl;
+  // make sure they're equal
+  deallog << v *w << ' ' << v.l2_norm() * w.l2_norm()
+          << ' ' << v *w - v.l2_norm() * w.l2_norm() << std::endl;
   const double eps=typeid(PetscScalar)==typeid(double) ? 1e-14 : 1e-5;
   Assert (std::fabs(v*w - v.l2_norm() * w.l2_norm()) < eps*(v*w),
           ExcInternalError());
@@ -49,7 +49,7 @@ void test (PETScWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("51/output");
   deallog.attach(logfile);
@@ -63,30 +63,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector v (100);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 47a68876ebd2ea39662235932f5e2e819d2f5176..84b539d51457b24f42bd1a78f51229ec21cd8cf1 100644 (file)
 // constructor for the sparse matrix
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_sparse_matrix.h>    
+#include <deal.II/lac/petsc_sparse_matrix.h>
 #include <fstream>
 #include <iostream>
 
 
 void test (PETScWrappers::SparseMatrix &m)
 {
-                                   // first set a few entries
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
 
   m.compress ();
-  
-                                   // then make sure we retrieve the same ones
+
+  // then make sure we retrieve the same ones
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -55,7 +55,7 @@ void test (PETScWrappers::SparseMatrix &m)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("52/output");
   deallog.attach(logfile);
@@ -66,37 +66,37 @@ int main (int argc,char **argv)
     {
       Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
       {
-       typedef PETScWrappers::SparseMatrix::size_type size_type;
-       
+        typedef PETScWrappers::SparseMatrix::size_type size_type;
+
         std::vector<size_type> row_lengths (5, 3U);
         row_lengths.back() = 2;
         PETScWrappers::SparseMatrix m (5,5,row_lengths);
         test (m);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 4284223f62e23e612bc4d2dcd256f38293da82c6..e1066837cf754c2229dc0a98f4d33fd5c573c1cc 100644 (file)
@@ -19,7 +19,7 @@
 // check PETScWrappers::Vector::operator() in set, and later in *= mode
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -27,9 +27,9 @@
 
 void test (PETScWrappers::Vector &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -41,8 +41,8 @@ void test (PETScWrappers::Vector &v)
 
   v.compress ();
 
-                                   // check that they are ok, and this time
-                                   // all of them
+  // check that they are ok, and this time
+  // all of them
   for (unsigned int i=0; i<v.size(); ++i)
     Assert ( ( (pattern[i] == true) && (v(i) == 2*i) )
              ||
@@ -54,7 +54,7 @@ void test (PETScWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("55/output");
   deallog.attach(logfile);
@@ -68,30 +68,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector v (100);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index ceffbf13133b7b629785241487500687b784077c..fd4cbf5e464b1b50d4cb9dea9aa18e478bdd3a44 100644 (file)
@@ -19,7 +19,7 @@
 // check PETScWrappers::Vector::operator() in set, and later in /= mode
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -27,9 +27,9 @@
 
 void test (PETScWrappers::Vector &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -41,8 +41,8 @@ void test (PETScWrappers::Vector &v)
 
   v.compress ();
 
-                                   // check that they are ok, and this time
-                                   // all of them
+  // check that they are ok, and this time
+  // all of them
   for (unsigned int i=0; i<v.size(); ++i)
     Assert ( ( (pattern[i] == true) && (v(i) == i) )
              ||
@@ -54,7 +54,7 @@ void test (PETScWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("56/output");
   deallog.attach(logfile);
@@ -68,30 +68,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector v (100);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index b733f235c3098691039852a606c1466190c79e3e..1ef259381b258699449e72f5c1ab6ac60148a4cf 100644 (file)
@@ -19,7 +19,7 @@
 // check PETScWrappers::Vector::is_non_zero
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -27,8 +27,8 @@
 
 void test (PETScWrappers::Vector &v)
 {
-                                   // set only certain elements of the
-                                   // vector. they are all positive
+  // set only certain elements of the
+  // vector. they are all positive
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -38,21 +38,21 @@ void test (PETScWrappers::Vector &v)
 
   v.compress ();
 
-                                   // check that the vector is really
-                                   // non-negative
+  // check that the vector is really
+  // non-negative
   Assert (v.is_non_negative() == true, ExcInternalError());
 
-                                   // then set a single element to a negative
-                                   // value and check again
+  // then set a single element to a negative
+  // value and check again
   v(v.size()/2) = -1;
-  Assert (v.is_non_negative() == false, ExcInternalError());  
+  Assert (v.is_non_negative() == false, ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("57/output");
   deallog.attach(logfile);
@@ -66,30 +66,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector v (100);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 9f480355c0df6f2450ab5a49099ef71adba310cb..ecac29e16744cd58b30f3f020b7d23f4d31a83b3 100644 (file)
@@ -29,8 +29,8 @@
 
 void test (PETScWrappers::Vector &v)
 {
-                                   // set only certain elements of the
-                                   // vector.
+  // set only certain elements of the
+  // vector.
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -42,19 +42,19 @@ void test (PETScWrappers::Vector &v)
 
   Vector<double> w (v);
   Vector<float>  x (v);
-  
+
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == w(i), ExcInternalError());
       Assert (v(i) == x(i), ExcInternalError());
     }
-      
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("58/output");
   deallog.attach(logfile);
@@ -68,30 +68,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector v (100);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index f02481f6fbd39f2a3438805841364fd192d76a82..48ec4809962773bac0c71874b6a86113c0684a61 100644 (file)
@@ -29,8 +29,8 @@
 
 void test (PETScWrappers::Vector &v)
 {
-                                   // set only certain elements of the
-                                   // vector.
+  // set only certain elements of the
+  // vector.
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -45,19 +45,19 @@ void test (PETScWrappers::Vector &v)
 
   PETScWrappers::Vector w1 (w);
   PETScWrappers::Vector x1 (x);
-  
+
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w1(i) == w(i), ExcInternalError());
       Assert (x1(i) == x(i), ExcInternalError());
     }
-      
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("59/output");
   deallog.attach(logfile);
@@ -71,30 +71,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector v (100);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 76958afa1558819e2f1286fac209f650c68944e9..2c75445db5f7a02b4d0a1a335d11102f921bfa36 100644 (file)
@@ -29,8 +29,8 @@
 
 void test (PETScWrappers::Vector &v)
 {
-                                   // set only certain elements of the
-                                   // vector.
+  // set only certain elements of the
+  // vector.
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -40,21 +40,23 @@ void test (PETScWrappers::Vector &v)
 
   v.compress ();
 
-  Vector<double> w; w=v;
-  Vector<float>  x; x=v;
-  
+  Vector<double> w;
+  w=v;
+  Vector<float>  x;
+  x=v;
+
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == w(i), ExcInternalError());
       Assert (v(i) == x(i), ExcInternalError());
     }
-      
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("60/output");
   deallog.attach(logfile);
@@ -68,30 +70,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector v (100);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index aa050b8936e81f7bf4ee02c892550945e2c99578..9d56614645d7ca783e5b86f245babc3c01692c45 100644 (file)
@@ -29,8 +29,8 @@
 
 void test (PETScWrappers::Vector &v)
 {
-                                   // set only certain elements of the
-                                   // vector.
+  // set only certain elements of the
+  // vector.
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -40,24 +40,28 @@ void test (PETScWrappers::Vector &v)
 
   v.compress ();
 
-  Vector<double> w; w=v;
-  Vector<float>  x; x=v;
+  Vector<double> w;
+  w=v;
+  Vector<float>  x;
+  x=v;
+
+  PETScWrappers::Vector w1;
+  w1=w;
+  PETScWrappers::Vector x1;
+  x1=x;
 
-  PETScWrappers::Vector w1; w1=w;
-  PETScWrappers::Vector x1; x1=x;
-  
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w1(i) == w(i), ExcInternalError());
       Assert (x1(i) == x(i), ExcInternalError());
     }
-      
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("61/output");
   deallog.attach(logfile);
@@ -71,30 +75,30 @@ int main (int argc,char **argv)
         PETScWrappers::Vector v (100);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index a759400f7cac746effe44c003a810fbdbf4eced1..80cfef438014c6b0f52e4738be5268cf518cee67 100644 (file)
@@ -42,7 +42,7 @@ void test (PETScWrappers::MatrixBase &m)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("62/output");
   deallog.attach(logfile);
@@ -56,30 +56,30 @@ int main (int argc,char **argv)
         PETScWrappers::SparseMatrix v (100,100,5);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 365634271880ceca106f20c778559c881768f6ae..1416c91a57c914e0927d93a5700cca1dbc88bcd7 100644 (file)
@@ -31,7 +31,7 @@ void test (PETScWrappers::MatrixBase &m)
   Assert (m.n() == 100, ExcInternalError());
 
   m = 0;
-  
+
   Assert (m.m() == 100, ExcInternalError());
   Assert (m.n() == 100, ExcInternalError());
 
@@ -40,7 +40,7 @@ void test (PETScWrappers::MatrixBase &m)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("63/output");
   deallog.attach(logfile);
@@ -54,30 +54,30 @@ int main (int argc,char **argv)
         PETScWrappers::SparseMatrix v (100,100,5);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 95ad85df9e979874e38ea31b1587108123fc5153..a51fc99056a7a0eacdc748c56fae016de1e37d37 100644 (file)
@@ -34,7 +34,7 @@
 template<typename MatrixType>
 void test (MatrixType &m)
 {
-  m.add(0,0,1);  
+  m.add(0,0,1);
   m = 0;
   m.compress();
 
@@ -45,7 +45,7 @@ void test (MatrixType &m)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("64/output");
   deallog.attach(logfile);
@@ -56,49 +56,49 @@ int main (int argc,char **argv)
     {
       Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
       {
-       const unsigned int n_dofs=420;
-                                        // check
-                                        // PETScWrappers::SparseMatrix
+        const unsigned int n_dofs=420;
+        // check
+        // PETScWrappers::SparseMatrix
         PETScWrappers::SparseMatrix
-         v1 (n_dofs, n_dofs, 5);
+        v1 (n_dofs, n_dofs, 5);
         test (v1);
 
-                                        // check
-                                        // PETScWrappers::MPI::SparseMatrix
-       MPI_Comm mpi_communicator (MPI_COMM_WORLD);     
-       int n_jobs=1;
-       MPI_Comm_size (mpi_communicator, &n_jobs);
-       const unsigned int n_mpi_processes=static_cast<unsigned int>(n_jobs);
-       Assert(n_dofs%n_mpi_processes==0, ExcInternalError());
-       const unsigned int n_local_dofs=n_dofs/n_mpi_processes;
+        // check
+        // PETScWrappers::MPI::SparseMatrix
+        MPI_Comm mpi_communicator (MPI_COMM_WORLD);
+        int n_jobs=1;
+        MPI_Comm_size (mpi_communicator, &n_jobs);
+        const unsigned int n_mpi_processes=static_cast<unsigned int>(n_jobs);
+        Assert(n_dofs%n_mpi_processes==0, ExcInternalError());
+        const unsigned int n_local_dofs=n_dofs/n_mpi_processes;
         PETScWrappers::MPI::SparseMatrix
-         v2 (mpi_communicator, n_dofs, n_dofs, n_local_dofs, n_local_dofs, 5);
+        v2 (mpi_communicator, n_dofs, n_dofs, n_local_dofs, n_local_dofs, 5);
         test (v2);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index a18ec697c785536615f5b8033957982df97a1b65..cb6f453615f8c63b1f031c83c9a3d9539562f1a5 100644 (file)
@@ -39,7 +39,7 @@ void test ()
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("65/output");
   deallog.attach(logfile);
@@ -52,30 +52,30 @@ int main (int argc,char **argv)
       {
         test ();
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 08f062b89c1fe1ba03424ea732de0852d1c3c3b1..0dbdbdd23c0b340ada920cf14ecf01836a405af4 100644 (file)
@@ -32,7 +32,7 @@ void test (PETScWrappers::MatrixBase &m)
   Assert (m.m() != 0, ExcInternalError());
   Assert (m.n() != 0, ExcInternalError());
 
-                                   // build a tri-diagonal pattern
+  // build a tri-diagonal pattern
   double norm_sqr = 0;
   unsigned int nnz = 0;
   const unsigned int N = m.m();
@@ -45,7 +45,7 @@ void test (PETScWrappers::MatrixBase &m)
           norm_sqr += s*s;
           ++nnz;
         }
-      
+
       if (i<N-5)
         {
           const double s = rand();
@@ -53,14 +53,14 @@ void test (PETScWrappers::MatrixBase &m)
           norm_sqr += s*s;
           ++nnz;
         }
-      
+
       const double s = rand();
       m.add (i,i,s);
       norm_sqr += s*s;
       ++nnz;
     }
   m.compress ();
-  
+
   deallog << m.frobenius_norm() << ' ' << std::sqrt (norm_sqr)
           << std::endl;
   deallog << m.n_nonzero_elements() << ' ' << nnz << std::endl;
@@ -70,14 +70,14 @@ void test (PETScWrappers::MatrixBase &m)
           ExcInternalError());
   Assert (m.n_nonzero_elements()-nnz == 0, ExcInternalError());
 
-                                   // now remove the entries of row N/2
+  // now remove the entries of row N/2
   for (unsigned int i=0; i<N; ++i)
     {
       const double s = m.el(N/2,i);
       norm_sqr -= s*s;
     }
   m.clear_row (N/2);
-  
+
   deallog << m.frobenius_norm() << ' ' << std::sqrt (norm_sqr)
           << std::endl;
   deallog << m.n_nonzero_elements() << ' ' << nnz << std::endl;
@@ -86,17 +86,17 @@ void test (PETScWrappers::MatrixBase &m)
           < std::fabs (std::sqrt (norm_sqr)),
           ExcInternalError());
 
-                                   // make sure that zeroing out rows does at
-                                   // least not add new nonzero entries (it
-                                   // may remove some, though)
+  // make sure that zeroing out rows does at
+  // least not add new nonzero entries (it
+  // may remove some, though)
   Assert (m.n_nonzero_elements() <= nnz, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("66/output");
   deallog.attach(logfile);
@@ -110,30 +110,30 @@ int main (int argc,char **argv)
         PETScWrappers::SparseMatrix v (14,14,3);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index f46f72342192c38d69daf2872e73e2e7359b808a..5b11211427f42a16e8d07654f296ece70bffba97 100644 (file)
@@ -34,7 +34,7 @@ void test (PETScWrappers::MatrixBase &m)
   Assert (m.m() != 0, ExcInternalError());
   Assert (m.n() != 0, ExcInternalError());
 
-                                   // build a tri-diagonal pattern
+  // build a tri-diagonal pattern
   double norm_sqr = 0;
   unsigned int nnz = 0;
   const size_type N = m.m();
@@ -47,7 +47,7 @@ void test (PETScWrappers::MatrixBase &m)
           norm_sqr += s*s;
           ++nnz;
         }
-      
+
       if (i<N-5)
         {
           const double s = rand();
@@ -55,14 +55,14 @@ void test (PETScWrappers::MatrixBase &m)
           norm_sqr += s*s;
           ++nnz;
         }
-      
+
       const double s = rand();
       m.add (i,i,s);
       norm_sqr += s*s;
       ++nnz;
     }
   m.compress ();
-  
+
   deallog << m.frobenius_norm() << ' ' << std::sqrt (norm_sqr)
           << std::endl;
   deallog << m.n_nonzero_elements() << ' ' << nnz << std::endl;
@@ -72,7 +72,7 @@ void test (PETScWrappers::MatrixBase &m)
           ExcInternalError());
   Assert (m.n_nonzero_elements()-nnz == 0, ExcInternalError());
 
-                                   // now remove the entries of rows N/2 and N/3
+  // now remove the entries of rows N/2 and N/3
   for (size_type i=0; i<N; ++i)
     {
       const double s = m.el(N/2,i);
@@ -85,7 +85,7 @@ void test (PETScWrappers::MatrixBase &m)
     }
   const size_type rows[2] = { N/3, N/2 };
   m.clear_rows (std::vector<size_type>(&rows[0], &rows[2]));
-  
+
   deallog << m.frobenius_norm() << ' ' << std::sqrt (norm_sqr)
           << std::endl;
   deallog << m.n_nonzero_elements() << ' ' << nnz << std::endl;
@@ -94,17 +94,17 @@ void test (PETScWrappers::MatrixBase &m)
           < std::fabs (std::sqrt (norm_sqr)),
           ExcInternalError());
 
-                                   // make sure that zeroing out rows does at
-                                   // least not add new nonzero entries (it
-                                   // may remove some, though)
+  // make sure that zeroing out rows does at
+  // least not add new nonzero entries (it
+  // may remove some, though)
   Assert (m.n_nonzero_elements() <= nnz, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("67/output");
   deallog.attach(logfile);
@@ -118,30 +118,30 @@ int main (int argc,char **argv)
         PETScWrappers::SparseMatrix v (14,14,3);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index a35987279015ba172a3d5d28d52d55e798c291b1..9df4c16f069c755a8ed6e41a24e9351150280769 100644 (file)
@@ -32,7 +32,7 @@ void test (PETScWrappers::MatrixBase &m)
   Assert (m.m() != 0, ExcInternalError());
   Assert (m.n() != 0, ExcInternalError());
 
-                                   // build a tri-diagonal pattern
+  // build a tri-diagonal pattern
   double norm_sqr = 0;
   unsigned int nnz = 0;
   const unsigned int N = m.m();
@@ -45,7 +45,7 @@ void test (PETScWrappers::MatrixBase &m)
           norm_sqr += s*s;
           ++nnz;
         }
-      
+
       if (i<N-5)
         {
           const double s = rand();
@@ -53,14 +53,14 @@ void test (PETScWrappers::MatrixBase &m)
           norm_sqr += s*s;
           ++nnz;
         }
-      
+
       const double s = rand();
       m.add (i,i,s);
       norm_sqr += s*s;
       ++nnz;
     }
   m.compress ();
-  
+
   deallog << m.frobenius_norm() << ' ' << std::sqrt (norm_sqr)
           << std::endl;
   deallog << m.n_nonzero_elements() << ' ' << nnz << std::endl;
@@ -70,8 +70,8 @@ void test (PETScWrappers::MatrixBase &m)
           ExcInternalError());
   Assert (m.n_nonzero_elements()-nnz == 0, ExcInternalError());
 
-                                   // now remove the entries of row N/2. set
-                                   // diagonal entries to rnd
+  // now remove the entries of row N/2. set
+  // diagonal entries to rnd
   const double rnd = rand();
   for (unsigned int i=0; i<N; ++i)
     {
@@ -79,9 +79,9 @@ void test (PETScWrappers::MatrixBase &m)
       norm_sqr -= s*s;
     }
   norm_sqr += rnd*rnd;
-  
+
   m.clear_row (N/2, rnd);
-  
+
   deallog << m.frobenius_norm() << ' ' << std::sqrt (norm_sqr)
           << std::endl;
   deallog << m.n_nonzero_elements() << ' ' << nnz << std::endl;
@@ -90,17 +90,17 @@ void test (PETScWrappers::MatrixBase &m)
           < std::fabs (std::sqrt (norm_sqr)),
           ExcInternalError());
 
-                                   // make sure that zeroing out rows does at
-                                   // least not add new nonzero entries (it
-                                   // may remove some, though)
+  // make sure that zeroing out rows does at
+  // least not add new nonzero entries (it
+  // may remove some, though)
   Assert (m.n_nonzero_elements() <= nnz, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("68/output");
   deallog.attach(logfile);
@@ -114,30 +114,30 @@ int main (int argc,char **argv)
         PETScWrappers::SparseMatrix v (14,14,3);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index b11b69cb5fb4c580311a14bb8f010e7a462a34e0..c7ad6487d9632c251ac6eb6d83773141b67e93d1 100644 (file)
@@ -34,7 +34,7 @@ void test (PETScWrappers::MatrixBase &m)
 
   typedef PETScWrappers::MatrixBase::size_type size_type;
 
-                                   // build a tri-diagonal pattern
+  // build a tri-diagonal pattern
   double norm_sqr = 0;
   unsigned int nnz = 0;
   const size_type N = m.m();
@@ -47,7 +47,7 @@ void test (PETScWrappers::MatrixBase &m)
           norm_sqr += s*s;
           ++nnz;
         }
-      
+
       if (i<N-5)
         {
           const double s = rand();
@@ -55,14 +55,14 @@ void test (PETScWrappers::MatrixBase &m)
           norm_sqr += s*s;
           ++nnz;
         }
-      
+
       const double s = rand();
       m.add (i,i,s);
       norm_sqr += s*s;
       ++nnz;
     }
   m.compress ();
-  
+
   deallog << m.frobenius_norm() << ' ' << std::sqrt (norm_sqr)
           << std::endl;
   deallog << m.n_nonzero_elements() << ' ' << nnz << std::endl;
@@ -72,8 +72,8 @@ void test (PETScWrappers::MatrixBase &m)
           ExcInternalError());
   Assert (m.n_nonzero_elements()-nnz == 0, ExcInternalError());
 
-                                   // now remove the entries of rows N/2 and
-                                   // N/3. set diagonal entries to rnd
+  // now remove the entries of rows N/2 and
+  // N/3. set diagonal entries to rnd
   const double rnd = rand();
   for (size_type i=0; i<N; ++i)
     {
@@ -86,10 +86,10 @@ void test (PETScWrappers::MatrixBase &m)
       norm_sqr -= s*s;
     }
   norm_sqr += 2*rnd*rnd;
-  
+
   const size_type rows[2] = { N/3, N/2 };
   m.clear_rows (std::vector<size_type>(&rows[0], &rows[2]), rnd);
-  
+
   deallog << m.frobenius_norm() << ' ' << std::sqrt (norm_sqr)
           << std::endl;
   deallog << m.n_nonzero_elements() << ' ' << nnz << std::endl;
@@ -98,17 +98,17 @@ void test (PETScWrappers::MatrixBase &m)
           < std::fabs (std::sqrt (norm_sqr)),
           ExcInternalError());
 
-                                   // make sure that zeroing out rows does at
-                                   // least not add new nonzero entries (it
-                                   // may remove some, though)
+  // make sure that zeroing out rows does at
+  // least not add new nonzero entries (it
+  // may remove some, though)
   Assert (m.n_nonzero_elements() <= nnz, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("69/output");
   deallog.attach(logfile);
@@ -122,30 +122,30 @@ int main (int argc,char **argv)
         PETScWrappers::SparseMatrix v (14,14,3);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index af28befe2b8131962655625094123fd171d317f6..7cd3b8b7410edb524ec4f984edadd3f704613019 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <fstream>
 
-int main () 
+int main ()
 {
   std::ofstream logfile("70/output");
   deallog.attach(logfile);
index b91cd09d418133db058027f8a8996cf98f5e234e..cfe7e2171b62d48efefe15e908fe2a2cf61fe464 100644 (file)
@@ -30,8 +30,8 @@ void test ()
   v(0) = 1;
   v(1) = 2;
 
-                                   // first check reading through a const
-                                   // iterator
+  // first check reading through a const
+  // iterator
   {
     PETScWrappers::BlockVector::const_iterator i=v.begin();
     Assert (*i == 1, ExcInternalError());
@@ -39,17 +39,17 @@ void test ()
     Assert (*i == 2, ExcInternalError());
   }
 
-                                   // same, but create iterator in a different
-                                   // way
+  // same, but create iterator in a different
+  // way
   {
     PETScWrappers::BlockVector::const_iterator
-      i=const_cast<const PETScWrappers::BlockVector&>(v).begin();
+    i=const_cast<const PETScWrappers::BlockVector &>(v).begin();
     Assert (*i == 1, ExcInternalError());
     ++i;
     Assert (*i == 2, ExcInternalError());
   }
 
-                                   // read through a read-write iterator
+  // read through a read-write iterator
   {
     PETScWrappers::BlockVector::iterator i = v.begin();
     Assert (*i == 1, ExcInternalError());
@@ -57,23 +57,23 @@ void test ()
     Assert (*i == 2, ExcInternalError());
   }
 
-                                   // write through a read-write iterator
+  // write through a read-write iterator
   {
     PETScWrappers::BlockVector::iterator i = v.begin();
 
     *i = 2;
     ++i;
     *i = 3;
-  }  
+  }
 
-                                   // and read again
+  // and read again
   {
     PETScWrappers::BlockVector::iterator i = v.begin();
     Assert (*i == 2, ExcInternalError());
     ++i;
     Assert (*i == 3, ExcInternalError());
   }
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -92,30 +92,30 @@ int main (int argc,char **argv)
       {
         test ();
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index b016b44c7094aa5d93504942926de81eefdb3cf0..32e94e2fe01efe24135752493aa091d52bb4fe07 100644 (file)
@@ -30,44 +30,44 @@ void test ()
   v(0) = 1;
   v(1) = 2;
 
-                                   // first check reading through a const
-                                   // iterator
+  // first check reading through a const
+  // iterator
   {
     PETScWrappers::BlockVector::const_iterator i=v.begin();
     Assert (i[0] == 1, ExcInternalError());
     Assert (i[1] == 2, ExcInternalError());
   }
 
-                                   // same, but create iterator in a different
-                                   // way
+  // same, but create iterator in a different
+  // way
   {
     PETScWrappers::BlockVector::const_iterator
-      i=const_cast<const PETScWrappers::BlockVector&>(v).begin();
+    i=const_cast<const PETScWrappers::BlockVector &>(v).begin();
     Assert (i[0] == 1, ExcInternalError());
     Assert (i[1] == 2, ExcInternalError());
   }
 
-                                   // read through a read-write iterator
+  // read through a read-write iterator
   {
     PETScWrappers::BlockVector::iterator i = v.begin();
     Assert (i[0] == 1, ExcInternalError());
     Assert (i[1] == 2, ExcInternalError());
   }
 
-                                   // write through a read-write iterator
+  // write through a read-write iterator
   {
     PETScWrappers::BlockVector::iterator i = v.begin();
     i[0] = 2;
     i[1] = 3;
-  }  
+  }
 
-                                   // and read again
+  // and read again
   {
     PETScWrappers::BlockVector::iterator i = v.begin();
     Assert (i[0] == 2, ExcInternalError());
     Assert (i[1] == 3, ExcInternalError());
   }
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -86,30 +86,30 @@ int main (int argc,char **argv)
       {
         test ();
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 13b60332ecfc570c3b038dc1275fb08380d9087a..fb1e2a5ea821a9bd644c1f5333fdeea26197a099 100644 (file)
@@ -31,7 +31,7 @@
 
 template <typename number>
 bool operator == (const PETScWrappers::BlockVector &v1,
-                 const PETScWrappers::BlockVector &v2)
+                  const PETScWrappers::BlockVector &v2)
 {
   if (v1.size() != v2.size())
     return false;
@@ -49,165 +49,165 @@ void test ()
   ivector[1] = 4;
   ivector[2] = 3;
   ivector[3] = 5;
-  
-                                  // Check 1: initialization via
-                                  // iterators
+
+  // Check 1: initialization via
+  // iterators
   if (true)
     {
       PETScWrappers::BlockVector v1(ivector);
       PETScWrappers::BlockVector v2(ivector);
 
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
-                                      // initialize other vector
-                                      // through iterators
+        v1(i) = i;
+      // initialize other vector
+      // through iterators
       PETScWrappers::BlockVector::iterator p2 = v2.begin();
       for (unsigned int i=0; i<v1.size(); ++i, ++p2)
-       *p2 = i;
+        *p2 = i;
       Assert (p2==v2.end(), ExcInternalError());
-      
-                                      // check that the two vectors are equal
+
+      // check that the two vectors are equal
       deallog << "Check 1: " << (v1==v2 ? "true" : "false") << std::endl;
     };
 
-                                  // Check 1: initialization via
-                                  // iterators
+  // Check 1: initialization via
+  // iterators
   if (true)
     {
       PETScWrappers::BlockVector v1(ivector);
 
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
-                                      // initialize other vector
-                                      // through iterators into first
-                                      // vector
+        v1(i) = i;
+      // initialize other vector
+      // through iterators into first
+      // vector
       PETScWrappers::BlockVector v2(ivector, v1.begin(), v1.end());
-                                      // check that the two vectors are equal
+      // check that the two vectors are equal
       deallog << "Check 2: " << (v1==v2 ? "true" : "false") << std::endl;
     };
 
-                                  // Check 3: loop forward and back
-                                  // and check that things are the
-                                  // same
+  // Check 3: loop forward and back
+  // and check that things are the
+  // same
   if (true)
     {
       PETScWrappers::BlockVector v1(ivector);
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
+        v1(i) = i;
 
       PETScWrappers::BlockVector::iterator p1 = v1.begin();
       for (unsigned int i=0; i<v1.size(); ++i, ++p1)
-       Assert (*p1 == i, ExcInternalError());
+        Assert (*p1 == i, ExcInternalError());
 
       Assert (p1 == v1.end(), ExcInternalError());
-      
-                                      // move back into allowable
-                                      // region
+
+      // move back into allowable
+      // region
       --p1;
 
-                                      // check backwards
+      // check backwards
       for (unsigned int i=0; i<v1.size(); ++i, --p1)
-       Assert (*p1 == v1.size()-i-1, ExcInternalError());
+        Assert (*p1 == v1.size()-i-1, ExcInternalError());
 
-                                      // if we came thus far,
-                                      // everything is alright
+      // if we came thus far,
+      // everything is alright
       deallog << "Check 3: true" << std::endl;
     };
 
 
-                                  // Check 4: same, but this time
-                                  // with const iterators
+  // Check 4: same, but this time
+  // with const iterators
   if (true)
     {
       PETScWrappers::BlockVector v1(ivector);
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
+        v1(i) = i;
 
       PETScWrappers::BlockVector::const_iterator p1 = v1.begin();
       for (unsigned int i=0; i<v1.size(); ++i, ++p1)
-       Assert (*p1 == i, ExcInternalError());
+        Assert (*p1 == i, ExcInternalError());
 
       Assert (p1 == v1.end(), ExcInternalError());
 
-                                      // move back into allowable
-                                      // region
+      // move back into allowable
+      // region
       --p1;
 
-                                      // check backwards
+      // check backwards
       for (unsigned int i=0; i<v1.size(); ++i, --p1)
-       {
-         const double val = *p1;
-         const double ref = v1.size()-i-1;
-         Assert (val==ref, ExcInternalError());
-       };
-
-                                      // if we came thus far,
-                                      // everything is alright
+        {
+          const double val = *p1;
+          const double ref = v1.size()-i-1;
+          Assert (val==ref, ExcInternalError());
+        };
+
+      // if we came thus far,
+      // everything is alright
       deallog << "Check 4: true" << std::endl;
     };
 
-                                  // Checks 5-14: use some standard
-                                  // algorithms
+  // Checks 5-14: use some standard
+  // algorithms
   if (true)
     {
       PETScWrappers::BlockVector v1(ivector);
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
+        v1(i) = i;
 
-                                      // check std::distance
-                                      // algorithm
+      // check std::distance
+      // algorithm
       deallog << "Check 5: "
-             << (std::distance (v1.begin(), v1.end()) ==
-                 static_cast<signed int>(v1.size()) ?
-                 "true" : "false")
-             << std::endl;
+              << (std::distance (v1.begin(), v1.end()) ==
+                  static_cast<signed int>(v1.size()) ?
+                  "true" : "false")
+              << std::endl;
 
-                                      // check std::copy
+      // check std::copy
       PETScWrappers::BlockVector v2(ivector);
       std::copy (v1.begin(), v1.end(), v2.begin());
       deallog << "Check 6: " << (v1 == v2 ? "true" : "false") << std::endl;
 
-                                      // check std::transform
+      // check std::transform
       std::transform (v1.begin(), v1.end(), v2.begin(),
-                     std::bind2nd (std::multiplies<double>(),
-                                   2.0));
+                      std::bind2nd (std::multiplies<double>(),
+                                    2.0));
       v2 *= 1./2.;
       deallog << "Check 7: " << (v1 == v2 ? "true" : "false") << std::endl;
 
 
-                                      // check operators +/-, +=/-=
+      // check operators +/-, +=/-=
       deallog << "Check 8: "
-             << (std::distance(v1.begin(), v1.begin()+3) == 3 ?
-                 "true" : "false")
-             << std::endl;
+              << (std::distance(v1.begin(), v1.begin()+3) == 3 ?
+                  "true" : "false")
+              << std::endl;
       deallog << "Check 9: "
-             << (std::distance(v1.end()-6, v1.end()) == 6 ?
-                 "true" : "false")
-             << std::endl;
+              << (std::distance(v1.end()-6, v1.end()) == 6 ?
+                  "true" : "false")
+              << std::endl;
       deallog << "Check 10: "
-             << (std::distance(v1.begin(), v1.end()) == (signed)v1.size() ?
-                 "true" : "false")
-             << std::endl;
+              << (std::distance(v1.begin(), v1.end()) == (signed)v1.size() ?
+                  "true" : "false")
+              << std::endl;
       deallog << "Check 11: "
-             << (std::distance(v1.begin(), (v1.begin()+=7)) == 7 ?
-                 "true" : "false")
-             << std::endl;
+              << (std::distance(v1.begin(), (v1.begin()+=7)) == 7 ?
+                  "true" : "false")
+              << std::endl;
       deallog << "Check 12: "
-             << (std::distance((v1.end()-=4), v1.end()) == 4 ?
-                 "true" : "false")
-             << std::endl;
+              << (std::distance((v1.end()-=4), v1.end()) == 4 ?
+                  "true" : "false")
+              << std::endl;
 
-                                      // check advance
+      // check advance
       PETScWrappers::BlockVector::iterator p2 = v1.begin();
       std::advance (p2, v1.size());
       deallog << "Check 13: " << (p2 == v1.end() ? "true" : "false") << std::endl;
@@ -217,104 +217,104 @@ void test ()
       deallog << "Check 14: " << (p3 == v1.end() ? "true" : "false") << std::endl;
     };
 
-                                  // Check 15: initialization through
-                                  // iterators
+  // Check 15: initialization through
+  // iterators
   if (true)
     {
       PETScWrappers::BlockVector v1(ivector);
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
+        v1(i) = i;
 
-                                      // initialize a normal vector
-                                      // from it
+      // initialize a normal vector
+      // from it
       Vector<double> v2(v1.begin(), v1.end());
 
-                                      // and reverse way
+      // and reverse way
       PETScWrappers::BlockVector v3(ivector, v2.begin(), v2.end());
       deallog << "Check 15: " << (v1==v3 ? "true" : "false") << std::endl;
     };
 
-                                  // Check 16: initialization through
-                                  // iterators. variant with one
-                                  // constant object
+  // Check 16: initialization through
+  // iterators. variant with one
+  // constant object
   if (true)
     {
       PETScWrappers::BlockVector v1(ivector);
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
+        v1(i) = i;
 
-                                      // initialize a normal vector
-                                      // from it
+      // initialize a normal vector
+      // from it
       const Vector<double> v2(v1.begin(), v1.end());
 
-                                      // and reverse way
+      // and reverse way
       PETScWrappers::BlockVector v3(ivector, v2.begin(), v2.end());
       deallog << "Check 16: " << (v1==v3 ? "true" : "false") << std::endl;
     };
-  
-                                  // Check 17: initialization through
-                                  // iterators. variant with two
-                                  // constant object
+
+  // Check 17: initialization through
+  // iterators. variant with two
+  // constant object
   if (true)
     {
       PETScWrappers::BlockVector v1(ivector);
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
+        v1(i) = i;
 
-                                      // initialize a normal vector
-                                      // from it
+      // initialize a normal vector
+      // from it
       const Vector<double> v2(v1.begin(), v1.end());
 
-                                      // and reverse way
+      // and reverse way
       const PETScWrappers::BlockVector v3(ivector, v2.begin(), v2.end());
       deallog << "Check 17: " << (v1==v3 ? "true" : "false") << std::endl;
     };
 
-                                  // Check 18: initialization through
-                                  // iterators. variant with three
-                                  // constant object
+  // Check 18: initialization through
+  // iterators. variant with three
+  // constant object
   if (true)
     {
       PETScWrappers::BlockVector v0(ivector);
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v0.size(); ++i)
-       v0(i) = i;
+        v0(i) = i;
 
       const PETScWrappers::BlockVector v1 = v0;
-      
-                                      // initialize a normal vector
-                                      // from it
+
+      // initialize a normal vector
+      // from it
       const Vector<double> v2(v1.begin(), v1.end());
 
-                                      // and reverse way
+      // and reverse way
       const PETScWrappers::BlockVector v3(ivector, v2.begin(), v2.end());
       deallog << "Check 18: " << (v1==v3 ? "true" : "false") << std::endl;
     };
-  
-                                  // Check 19: operator[]
+
+  // Check 19: operator[]
   if (true)
     {
       PETScWrappers::BlockVector v1(ivector);
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
+        v1(i) = i;
 
       for (unsigned int i=0; i<v1.size(); ++i)
-       {
-         const PETScWrappers::BlockVector::iterator p = (v1.begin()+i);
-         for (unsigned int j=0; j<v1.size(); ++j)
-           Assert (p[(signed)j-(signed)i] == j, ExcInternalError());
-       };
-
-                                      // if we came thus far,
-                                      // everything is alright
-      deallog << "Check 19: true" << std::endl;      
+        {
+          const PETScWrappers::BlockVector::iterator p = (v1.begin()+i);
+          for (unsigned int j=0; j<v1.size(); ++j)
+            Assert (p[(signed)j-(signed)i] == j, ExcInternalError());
+        };
+
+      // if we came thus far,
+      // everything is alright
+      deallog << "Check 19: true" << std::endl;
     };
 }
 
@@ -330,41 +330,41 @@ int main (int argc,char **argv)
   deallog.attach(logfile);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   try
     {
       Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
       {
         test ();
       }
-      
+
     }
   catch (std::exception &e)
     {
       std::cerr << std::endl << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << e.what() << std::endl
-          << "Aborting!" << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
-                                      // abort
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+      // abort
       return 2;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-          << "Aborting!" << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
-                                      // abort
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+      // abort
       return 3;
     };
-  
-  
+
+
   return 0;
 }
 
index 84abe745cc1ccb0b582474332801a2b60f6c7faa..8e7b050555d64e2e6d3f4d687207de30ac89c60a 100644 (file)
@@ -39,8 +39,8 @@
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
 
@@ -50,7 +50,7 @@ check_solve( SOLVER& solver, const MATRIX& A,
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -78,7 +78,7 @@ int main(int argc, char **argv)
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
 
-                                     // Make matrix
+    // Make matrix
     FDMatrix testproblem(size, size);
     PETScWrappers::SparseMatrix  A(dim, dim, 5);
     testproblem.five_point(A);
@@ -96,6 +96,6 @@ int main(int argc, char **argv)
     check_solve (solver, A,u,f, preconditioner);
   }
   GrowingVectorMemory<PETScWrappers::Vector>::release_unused_memory ();
-  
+
 }
 
index c9ddfb8bde240bde1c74daf979e1a29a7f8dd04e..a3371240449ae039c551184e8a35fef6fa506947 100644 (file)
@@ -41,8 +41,8 @@
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
 
@@ -52,7 +52,7 @@ check_solve( SOLVER& solver, const MATRIX& A,
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -80,7 +80,7 @@ int main(int argc, char **argv)
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
 
-                                     // Make matrix
+    // Make matrix
     FDMatrix testproblem(size, size);
     PETScWrappers::SparseMatrix  A(dim, dim, 5);
     testproblem.five_point(A);
@@ -98,6 +98,6 @@ int main(int argc, char **argv)
     check_solve (solver, A,u,f, preconditioner);
   }
   GrowingVectorMemory<PETScWrappers::Vector>::release_unused_memory ();
-  
+
 }
 
index 45b8ece5ff6ffa5a663bb4a8c5319d92240939a3..62abb6bd07130ef8e6bb2131f5e70cf1aee51199 100644 (file)
@@ -41,8 +41,8 @@
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
 
@@ -52,7 +52,7 @@ check_solve( SOLVER& solver, const MATRIX& A,
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -80,7 +80,7 @@ int main(int argc, char **argv)
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
 
-                                     // Make matrix
+    // Make matrix
     FDMatrix testproblem(size, size);
     PETScWrappers::SparseMatrix  A(dim, dim, 5);
     testproblem.five_point(A);
@@ -98,6 +98,6 @@ int main(int argc, char **argv)
     check_solve (solver, A,u,f, preconditioner);
   }
   GrowingVectorMemory<PETScWrappers::Vector>::release_unused_memory ();
-  
+
 }
 
index 2b79298189adeb044b6705bf4229abf5d6a5e72a..be1c544a2c5b5317577da4de91e704cd7604c0ac 100644 (file)
@@ -40,8 +40,8 @@
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
 
@@ -51,7 +51,7 @@ check_solve( SOLVER& solver, const MATRIX& A,
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -79,7 +79,7 @@ int main(int argc, char **argv)
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
 
-                                     // Make matrix
+    // Make matrix
     FDMatrix testproblem(size, size);
     PETScWrappers::SparseMatrix  A(dim, dim, 5);
     testproblem.five_point(A);
@@ -97,6 +97,6 @@ int main(int argc, char **argv)
     check_solve (solver, A,u,f, preconditioner);
   }
   GrowingVectorMemory<PETScWrappers::Vector>::release_unused_memory ();
-  
+
 }
 
index aa359e401f733cfbb5190c8446522fe941c56b44..81b77f6e88ec249e76ad95837d08877b8f3dd90b 100644 (file)
@@ -39,8 +39,8 @@
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
 
@@ -50,7 +50,7 @@ check_solve( SOLVER& solver, const MATRIX& A,
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -78,7 +78,7 @@ int main(int argc, char **argv)
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
 
-                                     // Make matrix
+    // Make matrix
     FDMatrix testproblem(size, size);
     PETScWrappers::SparseMatrix  A(dim, dim, 5);
     testproblem.five_point(A);
@@ -96,6 +96,6 @@ int main(int argc, char **argv)
     check_solve (solver, A,u,f, preconditioner);
   }
   GrowingVectorMemory<PETScWrappers::Vector>::release_unused_memory ();
-  
+
 }
 
index c3826371cd663c213756493935a5ccc296f240b6..1658be2a3a74d068375018f79159be0bc6d9e657 100644 (file)
 // PETScWrappers::FullMatrix::set()
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_full_matrix.h>    
+#include <deal.II/lac/petsc_full_matrix.h>
 #include <fstream>
 #include <iostream>
 
 
 void test (PETScWrappers::FullMatrix &m)
 {
-                                   // first set a few entries
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
 
   m.compress ();
-  
-                                   // then make sure we retrieve the same ones
+
+  // then make sure we retrieve the same ones
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -54,7 +54,7 @@ void test (PETScWrappers::FullMatrix &m)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("full_matrix_01/output");
   deallog.attach(logfile);
@@ -68,30 +68,30 @@ int main (int argc,char **argv)
         PETScWrappers::FullMatrix m (5,5);
         test (m);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 21e1a8887abc8d6ec942fa5b5a7041ade3795168..106c2befad51a2c3b6906fb148187eb23466cfd8 100644 (file)
 // PETScWrappers::FullMatrix::add()
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_full_matrix.h>    
+#include <deal.II/lac/petsc_full_matrix.h>
 #include <fstream>
 #include <iostream>
 
 
 void test (PETScWrappers::FullMatrix &m)
 {
-                                   // first set a few entries
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.add (i,j, i*j*.5+.5);
 
   m.compress ();
-  
-                                   // then make sure we retrieve the same ones
+
+  // then make sure we retrieve the same ones
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -54,7 +54,7 @@ void test (PETScWrappers::FullMatrix &m)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("full_matrix_02/output");
   deallog.attach(logfile);
@@ -68,30 +68,30 @@ int main (int argc,char **argv)
         PETScWrappers::FullMatrix m (5,5);
         test (m);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 8bd31b0893b0b252c9595447b2cde27e3b60f90d..af8c8367353d67927be5b5c8aede853c0802a6ad 100644 (file)
@@ -19,7 +19,7 @@
 // check querying matrix sizes
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_full_matrix.h>    
+#include <deal.II/lac/petsc_full_matrix.h>
 #include <fstream>
 #include <iostream>
 
@@ -34,7 +34,7 @@ void test (PETScWrappers::FullMatrix &m)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("full_matrix_04/output");
   deallog.attach(logfile);
@@ -48,30 +48,30 @@ int main (int argc,char **argv)
         PETScWrappers::FullMatrix m (5,5);
         test (m);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index c081805c244bd66c7035a6dd24c274a5a6353f03..592ffb17a129c88e022003b4976e53c6a2556e1b 100644 (file)
 // PETScWrappers::FullMatrix
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_full_matrix.h>    
+#include <deal.II/lac/petsc_full_matrix.h>
 #include <fstream>
 #include <iostream>
 
 
 void test (PETScWrappers::FullMatrix &m)
 {
-                                   // first set a few entries. count how many
-                                   // entries we have
+  // first set a few entries. count how many
+  // entries we have
   unsigned int counter = 0;
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
@@ -40,17 +40,17 @@ void test (PETScWrappers::FullMatrix &m)
 
   m.compress ();
 
-                                  // check n_nonzero_elements then
-                                  // output a dummy number.
+  // check n_nonzero_elements then
+  // output a dummy number.
   deallog << counter << std::endl;
   Assert (m.m() * m.m(), ExcInternalError());
-                                                                  
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("full_matrix_05/output");
   deallog.attach(logfile);
@@ -64,30 +64,30 @@ int main (int argc,char **argv)
         PETScWrappers::FullMatrix m (5,5);
         test (m);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index f66905dd9768882e43692355549fee736a14350b..c0938195717f8da7a5ed6e03310ff05108ded060 100644 (file)
 // check PETScWrappers::FullMatrix::l1_norm
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_full_matrix.h>    
+#include <deal.II/lac/petsc_full_matrix.h>
 #include <fstream>
 #include <iostream>
 
 
 void test (PETScWrappers::FullMatrix &m)
 {
-                                   // first set a few entries. count how many
-                                   // entries we have
+  // first set a few entries. count how many
+  // entries we have
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
-        m.set (i,j, i*j*.5+.5);  
+        m.set (i,j, i*j*.5+.5);
 
   m.compress ();
 
-                                   // compare against the exact value of the
-                                   // l1-norm (max col-sum)
+  // compare against the exact value of the
+  // l1-norm (max col-sum)
   deallog << m.l1_norm() << std::endl;
   Assert (m.l1_norm() == 7, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("full_matrix_06/output");
   deallog.attach(logfile);
@@ -59,30 +59,30 @@ int main (int argc,char **argv)
         PETScWrappers::FullMatrix m (5,5);
         test (m);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 1e0a9ec44ddf55e41728ceda07a8c307eff015e6..d9382dd187c0c3bc58c3e54c73234beef9a14379 100644 (file)
 // check PETScWrappers::FullMatrix::linfty_norm
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_full_matrix.h>    
+#include <deal.II/lac/petsc_full_matrix.h>
 #include <fstream>
 #include <iostream>
 
 
 void test (PETScWrappers::FullMatrix &m)
 {
-                                   // first set a few entries. count how many
-                                   // entries we have
+  // first set a few entries. count how many
+  // entries we have
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
-        m.set (i,j, i*j*.5+.5);  
+        m.set (i,j, i*j*.5+.5);
 
   m.compress ();
 
-                                   // compare against the exact value of the
-                                   // linfty-norm (max row-sum)
+  // compare against the exact value of the
+  // linfty-norm (max row-sum)
   deallog << m.linfty_norm() << std::endl;
   Assert (m.linfty_norm() == 8.5, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("full_matrix_07/output");
   deallog.attach(logfile);
@@ -59,30 +59,30 @@ int main (int argc,char **argv)
         PETScWrappers::FullMatrix m (5,5);
         test (m);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 83fb15d656706e536c4a4779ddac3324f8b14069..1ba700b999f2b89210ee1a1100a74ac77fd51823 100644 (file)
 // check PETScWrappers::FullMatrix::frobenius_norm
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_full_matrix.h>    
+#include <deal.II/lac/petsc_full_matrix.h>
 #include <fstream>
 #include <iostream>
 
 
 void test (PETScWrappers::FullMatrix &m)
 {
-                                   // first set a few entries. count how many
-                                   // entries we have
+  // first set a few entries. count how many
+  // entries we have
   PetscScalar norm = 0;
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
@@ -40,17 +40,17 @@ void test (PETScWrappers::FullMatrix &m)
 
   m.compress ();
 
-                                   // compare against the exact value of the
-                                   // l2-norm (max row-sum)
+  // compare against the exact value of the
+  // l2-norm (max row-sum)
   deallog << m.frobenius_norm() << std::endl;
   Assert (m.frobenius_norm() == norm, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("full_matrix_08/output");
   deallog.attach(logfile);
@@ -64,30 +64,30 @@ int main (int argc,char **argv)
         PETScWrappers::FullMatrix m (5,5);
         test (m);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 86689c54ea91dcf62ba7466defe43739d75562ce..35550c937606b19883fea609d3b0c3ce79b8d12e 100644 (file)
 // check PETScWrappers::FullMatrix::operator *=
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_full_matrix.h>    
+#include <deal.II/lac/petsc_full_matrix.h>
 #include <fstream>
 #include <iostream>
 
 
 void test (PETScWrappers::FullMatrix &m)
 {
-                                   // first set a few entries
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
 
   m.compress ();
-  
-                                   // then multiply everything by 1.25 and
-                                   // make sure we retrieve the values we
-                                   // expect
+
+  // then multiply everything by 1.25 and
+  // make sure we retrieve the values we
+  // expect
   m *= 1.25;
-  
+
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -57,7 +57,7 @@ void test (PETScWrappers::FullMatrix &m)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("full_matrix_09/output");
   deallog.attach(logfile);
@@ -71,30 +71,30 @@ int main (int argc,char **argv)
         PETScWrappers::FullMatrix m (5,5);
         test (m);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 44bbd49003319a1a752e14514fcb320f393b461d..030ad097855d4ac5ea4e6dd6eaff28609d9e6517 100644 (file)
 // check PETScWrappers::FullMatrix::operator /=
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_full_matrix.h>    
+#include <deal.II/lac/petsc_full_matrix.h>
 #include <fstream>
 #include <iostream>
 
 
 void test (PETScWrappers::FullMatrix &m)
 {
-                                   // first set a few entries
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
 
   m.compress ();
-  
-                                   // then divide everything by 4/3 and
-                                   // make sure we retrieve the values we
-                                   // expect
+
+  // then divide everything by 4/3 and
+  // make sure we retrieve the values we
+  // expect
   m /= 4./3.;
-  
+
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -57,7 +57,7 @@ void test (PETScWrappers::FullMatrix &m)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("full_matrix_10/output");
   deallog.attach(logfile);
@@ -71,30 +71,30 @@ int main (int argc,char **argv)
         PETScWrappers::FullMatrix m (5,5);
         test (m);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index aa0eb5b1d4a477a0757974dbf3e5f5fc62dc3557..4e9d3191f8cc00432ebc383d1102bf5342b71c38 100644 (file)
@@ -19,7 +19,7 @@
 // test PETScWrappers::MatrixBase::const_iterator
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_full_matrix.h>    
+#include <deal.II/lac/petsc_full_matrix.h>
 #include <fstream>
 #include <iostream>
 
@@ -29,7 +29,7 @@ void test ()
   PETScWrappers::FullMatrix m(5,5);
   m.set (0,0,1);
   m.set (1,1,2);
-  m.set (1,2,3);  
+  m.set (1,2,3);
   m.compress ();
   PETScWrappers::FullMatrix::const_iterator i = m.begin();
   deallog << i->row() << ' ' << i->column() << ' ' << i->value() << std::endl;
@@ -37,7 +37,7 @@ void test ()
   deallog << i->row() << ' ' << i->column() << ' ' << i->value() << std::endl;
   i++;
   deallog << i->row() << ' ' << i->column() << ' ' << i->value() << std::endl;
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -56,30 +56,30 @@ int main (int argc,char **argv)
       {
         test ();
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 4382b544dfbed2de4040e42f867362b4e28a5349..25462f756b4287805a7cd47831a750883b2e9267 100644 (file)
@@ -32,19 +32,19 @@ void test (PETScWrappers::Vector &v,
   PETScWrappers::FullMatrix m(v.size(),v.size());
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
-  
+
   m.compress ();
   v.compress ();
   w.compress ();
 
-                                   // w:=Mv
+  // w:=Mv
   m.vmult (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -75,30 +75,30 @@ int main (int argc, char **argv)
         PETScWrappers::Vector w (100);
         test (v,w);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index f8531ca1822c94936bd7a50fa72ad8721ff2e067..eed9d91174445cec6679fb7419e4d314892d8590 100644 (file)
@@ -32,19 +32,19 @@ void test (PETScWrappers::Vector &v,
   PETScWrappers::FullMatrix m(v.size(),v.size());
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
-  
+
   m.compress ();
   v.compress ();
   w.compress ();
 
-                                   // w:=Mv
+  // w:=Mv
   m.Tvmult (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -75,30 +75,30 @@ int main (int argc, char **argv)
         PETScWrappers::Vector w (100);
         test (v,w);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 375d21926888a6c3eac58e94ef0e0a49d1d95a00..ad3bfb5f94bd0d53f9d8c8a483d3527cdbcd43f9 100644 (file)
@@ -32,22 +32,22 @@ void test (PETScWrappers::Vector &v,
   PETScWrappers::FullMatrix m(v.size(),v.size());
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       w(i) = i;
     }
-  
+
   m.compress ();
   v.compress ();
   w.compress ();
 
-                                   // w:=Mv
+  // w:=Mv
   m.vmult_add (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -78,30 +78,30 @@ int main (int argc, char **argv)
         PETScWrappers::Vector w (100);
         test (v,w);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 0bd636e7015bbd68002a432937d883fdff7713cd..478c2f820ebaa0028536b276f9869f249a1ea798 100644 (file)
@@ -32,22 +32,22 @@ void test (PETScWrappers::Vector &v,
   PETScWrappers::FullMatrix m(v.size(),v.size());
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       w(i) = i;
     }
-  
+
   m.compress ();
   v.compress ();
   w.compress ();
 
-                                   // w:=Mv
+  // w:=Mv
   m.Tvmult_add (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -78,30 +78,30 @@ int main (int argc, char **argv)
         PETScWrappers::Vector w (100);
         test (v,w);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 48a16dd8ab901cc0276141f6a9e00802e1149560..f8c0c8464edebf0cf094b341d6fd26298bb6fb75 100644 (file)
@@ -32,22 +32,22 @@ void test (PETScWrappers::Vector &v,
   PETScWrappers::FullMatrix m(v.size(),v.size());
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       w(i) = i+1;
     }
-  
+
   m.compress ();
   v.compress ();
   w.compress ();
 
-                                   // <w,Mv>
+  // <w,Mv>
   const PetscScalar s = m.matrix_scalar_product (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -81,30 +81,30 @@ int main (int argc, char **argv)
         PETScWrappers::Vector w (100);
         test (v,w);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index ad643fa7520a8bec672813791119a7a12127bb6b..1a415ed0725f377708740965bcd63e2de5d09270 100644 (file)
@@ -31,18 +31,18 @@ void test (PETScWrappers::Vector &v)
   PETScWrappers::FullMatrix m(v.size(),v.size());
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
-  
+
   m.compress ();
   v.compress ();
 
-                                   // <w,Mv>
+  // <w,Mv>
   const PetscScalar s = m.matrix_norm_square (v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     Assert (v(i) == i, ExcInternalError());
 
@@ -72,30 +72,30 @@ int main (int argc, char **argv)
         PETScWrappers::Vector v (30);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 14d730ea65c8c97084ae0abcaff9ca47cee2a0fc..c1a6fcccdf9ca89a7d961db938d0b6c008e4f837 100644 (file)
@@ -33,22 +33,22 @@ void test (PETScWrappers::Vector &v,
   PETScWrappers::FullMatrix m(v.size(),v.size());
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       w(i) = i+1;
     }
-      
+
   m.compress ();
   v.compress ();
   w.compress ();
 
-                                   // x=w-Mv
+  // x=w-Mv
   const double s = m.residual (x, v, w);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -84,30 +84,30 @@ int main (int argc, char **argv)
         PETScWrappers::Vector x (100);
         test (v,w,x);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index d4d6bfd7ee6810c1987b92c0b209bcb22b61ba29..142d8bfe54a0a5dd14f79dfa0039327c9a1d181a 100644 (file)
@@ -39,7 +39,7 @@ get_n_mpi_processes ()
 {
   int n_jobs;
   MPI_Comm_size (MPI_COMM_WORLD, &n_jobs);
-    
+
   return n_jobs;
 }
 
@@ -50,7 +50,7 @@ get_this_mpi_process ()
 {
   int rank;
   MPI_Comm_rank (MPI_COMM_WORLD, &rank);
-    
+
   return rank;
 }
 
@@ -59,9 +59,9 @@ void test ()
 {
   typedef PETScWrappers::MPI::SparseMatrix::size_type size_type;
 
-                                   // create a parallel matrix where the first
-                                   // process has 10 rows, the second one 20,
-                                   // the third one 30, and so on
+  // create a parallel matrix where the first
+  // process has 10 rows, the second one 20,
+  // the third one 30, and so on
   unsigned int N = 0;
   std::vector<size_type> local_rows_per_process (get_n_mpi_processes());
   std::vector<size_type> start_row (get_n_mpi_processes());
@@ -72,10 +72,10 @@ void test ()
       start_row[i] += i*10;
     }
 
-                                   // here is a sparsity pattern for which we
-                                   // used to allocate additional memory for 2
-                                   // processes. note that only one of the
-                                   // four blocks uses Inodes
+  // here is a sparsity pattern for which we
+  // used to allocate additional memory for 2
+  // processes. note that only one of the
+  // four blocks uses Inodes
   CompressedSparsityPattern csp (N,N);
   for (unsigned int i=0; i<N; ++i)
     for (unsigned int j=0; j<N; ++j)
@@ -87,9 +87,9 @@ void test ()
           csp.add (i,i-local_rows_per_process.back());
       }
 
-                                   // here is a sparsity pattern for which no
-                                   // Inodes are used, but it doesn't allocate
-                                   // additional memory
+  // here is a sparsity pattern for which no
+  // Inodes are used, but it doesn't allocate
+  // additional memory
 //   for (unsigned int bi=0; bi<get_n_mpi_processes(); ++bi)
 //     for (unsigned int bj=0; bj<get_n_mpi_processes(); ++bj)
 //       for (unsigned int i=0; i<local_rows_per_process[bi]; ++i)
@@ -97,17 +97,17 @@ void test ()
 //           csp.add (start_row[bi] + i,
 //                    start_row[bj] + (i+2*k) % local_rows_per_process[bj]);
 
-  
-  
-                                   // now create a matrix with this sparsity
-                                   // pattern
+
+
+  // now create a matrix with this sparsity
+  // pattern
   PETScWrappers::MPI::SparseMatrix m;
   m.reinit (MPI_COMM_WORLD, csp, local_rows_per_process,
             local_rows_per_process, get_this_mpi_process());
 
-                                   // no write into the exact same matrix
-                                   // entries as have been created by the
-                                   // sparsity pattern above
+  // no write into the exact same matrix
+  // entries as have been created by the
+  // sparsity pattern above
   for (unsigned int i=0; i<N; ++i)
     for (unsigned int j=0; j<csp.row_length(i); ++j)
       m.add (i, csp.column_number(i,j), 1.);
@@ -119,7 +119,7 @@ void test ()
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("parallel_sparse_matrix_01/output");
   deallog.attach(logfile);
@@ -130,30 +130,30 @@ int main (int argc,char **argv)
     {
       Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
       test ();
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 0d9441323f77599ddff6d0b2a7c4226b6728e581..6132e73afe1a78fc8d7e1e09410d70048daa9181 100644 (file)
 
 class PetscFDMatrix : public dealii::PETScWrappers::MatrixFree
 {
-  public:
-                                    /**
-                                     * Constructor specifying grid resolution.
-                                     */
-    PetscFDMatrix(unsigned int size, unsigned int dim);
-
-                                         /**
-                                          * Matrix-vector multiplication:
-                                          * let <i>dst = M*src</i> with
-                                          * <i>M</i> being this matrix.
-                                          *
-                                          * Source and destination must
-                                          * not be the same vector.
-                                          */
-    void vmult (dealii::PETScWrappers::VectorBase       &dst,
-                const dealii::PETScWrappers::VectorBase &src) const;
-
-                                         /**
-                                          * Matrix-vector multiplication: let
-                                          * <i>dst = M<sup>T</sup>*src</i> with
-                                          * <i>M</i> being this matrix. This
-                                          * function does the same as @p vmult()
-                                          * but takes the transposed matrix.
-                                          *
-                                          * Source and destination must
-                                          * not be the same vector.
-                                          */
-    void Tvmult (dealii::PETScWrappers::VectorBase       &dst,
-                 const dealii::PETScWrappers::VectorBase &src) const;
-
-                                         /**
-                                          * Adding Matrix-vector
-                                          * multiplication. Add
-                                          * <i>M*src</i> on <i>dst</i>
-                                          * with <i>M</i> being this
-                                          * matrix.
-                                          *
-                                          * Source and destination must
-                                          * not be the same vector.
-                                          */
-    void vmult_add (dealii::PETScWrappers::VectorBase       &dst,
-                    const dealii::PETScWrappers::VectorBase &src) const;
-
-                                         /**
-                                          * Adding Matrix-vector
-                                          * multiplication. Add
-                                          * <i>M<sup>T</sup>*src</i> to
-                                          * <i>dst</i> with <i>M</i> being
-                                          * this matrix. This function
-                                          * does the same as @p vmult_add()
-                                          * but takes the transposed
-                                          * matrix.
-                                          *
-                                          * Source and destination must
-                                          * not be the same vector.
-                                          */
-    void Tvmult_add (dealii::PETScWrappers::VectorBase       &dst,
-                     const dealii::PETScWrappers::VectorBase &src) const;
+public:
+  /**
+   * Constructor specifying grid resolution.
+   */
+  PetscFDMatrix(unsigned int size, unsigned int dim);
+
+  /**
+   * Matrix-vector multiplication:
+   * let <i>dst = M*src</i> with
+   * <i>M</i> being this matrix.
+   *
+   * Source and destination must
+   * not be the same vector.
+   */
+  void vmult (dealii::PETScWrappers::VectorBase       &dst,
+              const dealii::PETScWrappers::VectorBase &src) const;
+
+  /**
+   * Matrix-vector multiplication: let
+   * <i>dst = M<sup>T</sup>*src</i> with
+   * <i>M</i> being this matrix. This
+   * function does the same as @p vmult()
+   * but takes the transposed matrix.
+   *
+   * Source and destination must
+   * not be the same vector.
+   */
+  void Tvmult (dealii::PETScWrappers::VectorBase       &dst,
+               const dealii::PETScWrappers::VectorBase &src) const;
+
+  /**
+   * Adding Matrix-vector
+   * multiplication. Add
+   * <i>M*src</i> on <i>dst</i>
+   * with <i>M</i> being this
+   * matrix.
+   *
+   * Source and destination must
+   * not be the same vector.
+   */
+  void vmult_add (dealii::PETScWrappers::VectorBase       &dst,
+                  const dealii::PETScWrappers::VectorBase &src) const;
+
+  /**
+   * Adding Matrix-vector
+   * multiplication. Add
+   * <i>M<sup>T</sup>*src</i> to
+   * <i>dst</i> with <i>M</i> being
+   * this matrix. This function
+   * does the same as @p vmult_add()
+   * but takes the transposed
+   * matrix.
+   *
+   * Source and destination must
+   * not be the same vector.
+   */
+  void Tvmult_add (dealii::PETScWrappers::VectorBase       &dst,
+                   const dealii::PETScWrappers::VectorBase &src) const;
 
 private:
-                                    /**
-                                     * Number of gridpoints in x-direction.
-                                     */
-    unsigned int nx;
-
-                                    /**
-                                     * Number of gridpoints in y-direction.
-                                     */
-    unsigned int ny;
+  /**
+   * Number of gridpoints in x-direction.
+   */
+  unsigned int nx;
+
+  /**
+   * Number of gridpoints in y-direction.
+   */
+  unsigned int ny;
 };
 
 
@@ -93,8 +93,8 @@ private:
 
 inline
 PetscFDMatrix::PetscFDMatrix(unsigned int size, unsigned int dim)
-             : PETScWrappers::MatrixFree (dim, dim, dim, dim),
-               nx (size), ny (size)
+  : PETScWrappers::MatrixFree (dim, dim, dim, dim),
+    nx (size), ny (size)
 {}
 
 
@@ -104,11 +104,11 @@ void
 PetscFDMatrix::vmult_add (dealii::PETScWrappers::VectorBase       &dst,
                           const dealii::PETScWrappers::VectorBase &src) const
 {
-  for(unsigned int i=0;i<=ny-2;i++)
+  for (unsigned int i=0; i<=ny-2; i++)
     {
-      for(unsigned int j=0;j<=nx-2; j++)
+      for (unsigned int j=0; j<=nx-2; j++)
         {
-                                                  // Number of the row to be entered
+          // Number of the row to be entered
           unsigned int row = j+(nx-1)*i;
 
           dst(row) += 4. * src(row);              // A.set(row, row, 4.);
@@ -124,7 +124,7 @@ PetscFDMatrix::vmult_add (dealii::PETScWrappers::VectorBase       &dst,
               dst(row) += -1. * src(row-(nx-1));  // A.set(row, row-(nx-1), -1.);
             }
         }
-    } 
+    }
 }
 
 
index 7908a67265e4e86345e19dbc0419a8f2f44c09f8..2a8e0c3101a96200bb4dfd3cb76e311316ed6e7c 100644 (file)
@@ -35,10 +35,10 @@ void test ()
 {
   const unsigned int N = 200;
 
-                                   // first build the sparsity pattern
+  // first build the sparsity pattern
   SparsityPattern sparsity (N*N, N*N, 5);
-  for(unsigned int i=0; i<N; i++)
-    for(unsigned int j=0; j<N; j++)
+  for (unsigned int i=0; i<N; i++)
+    for (unsigned int j=0; j<N; j++)
       {
         const unsigned int global = i*N+j;
         sparsity.add(global, global);
@@ -64,12 +64,12 @@ void test ()
           }
       }
   sparsity.compress();
-  
 
-                                   // next build the sparse matrix itself
+
+  // next build the sparse matrix itself
   SparseMatrix<double> matrix (sparsity);
-  for(unsigned int i=0; i<N; i++)
-    for(unsigned int j=0; j<N; j++)
+  for (unsigned int i=0; i<N; i++)
+    for (unsigned int j=0; j<N; j++)
       {
         const unsigned int global = i*N+j;
         matrix.add(global, global, 4);
@@ -94,21 +94,21 @@ void test ()
             matrix.add(global, global+N, -1);
           }
       }
-  
-                                   // then do a single matrix-vector
-                                   // multiplication with subsequent formation
-                                   // of the matrix norm
+
+  // then do a single matrix-vector
+  // multiplication with subsequent formation
+  // of the matrix norm
   Vector<double> v1(N*N), v2(N*N);
   for (unsigned int i=0; i<N*N; ++i)
     v1(i) = i;
   matrix.vmult (v2, v1);
-  
-  deallog << v1*v2 << std::endl;
+
+  deallog << v1 *v2 << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("slowness_01/output");
   deallog.attach(logfile);
@@ -120,30 +120,30 @@ int main (int argc,char **argv)
       {
         test ();
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index f9889d24665023f3697f5e2e85f5da1147bd6297..46c03176cf747ccf02a3394824ff989a5ee07170 100644 (file)
@@ -35,10 +35,10 @@ void test ()
 {
   const unsigned int N = 200;
 
-                                   // build the sparse matrix 
+  // build the sparse matrix
   PETScWrappers::SparseMatrix matrix (N*N, N*N, 5);
-  for(unsigned int i=0; i<N; i++)
-    for(unsigned int j=0; j<N; j++)
+  for (unsigned int i=0; i<N; i++)
+    for (unsigned int j=0; j<N; j++)
       {
         const unsigned int global = i*N+j;
         matrix.add(global, global, 4);
@@ -64,22 +64,22 @@ void test ()
           }
       }
   matrix.compress ();
-  
-  
-                                   // then do a single matrix-vector
-                                   // multiplication with subsequent formation
-                                   // of the matrix norm
+
+
+  // then do a single matrix-vector
+  // multiplication with subsequent formation
+  // of the matrix norm
   PETScWrappers::Vector v1(N*N), v2(N*N);
   for (unsigned int i=0; i<N*N; ++i)
     v1(i) = i;
   matrix.vmult (v2, v1);
-  
-  deallog << v1*v2 << std::endl;
+
+  deallog << v1 *v2 << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("slowness_02/output");
   deallog.attach(logfile);
@@ -91,30 +91,30 @@ int main (int argc,char **argv)
       {
         test ();
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index a424e68f490109421a4b4bf7429d1ca1c458b50f..5b75dd31320dc8dce5909f42309af4b5abb5a5c3 100644 (file)
@@ -35,13 +35,13 @@ void test ()
 {
   const unsigned int N = 200;
 
-                                   // build the sparse matrix 
+  // build the sparse matrix
   PETScWrappers::MPI::SparseMatrix matrix (PETSC_COMM_WORLD,
                                            N*N, N*N,
                                            N*N, N*N,
                                            5);
-  for(unsigned int i=0; i<N; i++)
-    for(unsigned int j=0; j<N; j++)
+  for (unsigned int i=0; i<N; i++)
+    for (unsigned int j=0; j<N; j++)
       {
         const unsigned int global = i*N+j;
         matrix.add(global, global, 4);
@@ -67,22 +67,22 @@ void test ()
           }
       }
   matrix.compress ();
-  
-                                   // then do a single matrix-vector
-                                   // multiplication with subsequent formation
-                                   // of the matrix norm
+
+  // then do a single matrix-vector
+  // multiplication with subsequent formation
+  // of the matrix norm
   PETScWrappers::MPI::Vector v1(PETSC_COMM_WORLD, N*N, N*N);
   PETScWrappers::MPI::Vector v2(PETSC_COMM_WORLD, N*N, N*N);
   for (unsigned int i=0; i<N*N; ++i)
     v1(i) = i;
   matrix.vmult (v2, v1);
-  
-  deallog << v1*v2 << std::endl;
+
+  deallog << v1 *v2 << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("slowness_03/output");
   deallog.attach(logfile);
@@ -94,30 +94,30 @@ int main (int argc,char **argv)
       {
         test ();
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 5ff8a195fcd8960640988cff506e1636974762ba..d5e0e3cd0c9cfbe4c452e6dc52cf054de720cdaf 100644 (file)
@@ -41,8 +41,8 @@ void test ()
 {
   const unsigned int N = 200;
 
-                                   // first find a random permutation of the
-                                   // indices
+  // first find a random permutation of the
+  // indices
   std::vector<unsigned int> permutation (N);
   {
     std::vector<unsigned int> unused_indices (N);
@@ -51,29 +51,29 @@ void test ()
 
     for (unsigned int i=0; i<N; i++)
       {
-                                         // pick a random element among the
-                                         // unused indices
+        // pick a random element among the
+        // unused indices
         const unsigned int k = rand() % (N-i);
         permutation[i] = unused_indices[k];
-        
-                                         // then swap this used element to the
-                                         // end where we won't consider it any
-                                         // more
+
+        // then swap this used element to the
+        // end where we won't consider it any
+        // more
         std::swap (unused_indices[k], unused_indices[N-i-1]);
-      }    
+      }
   }
-  
-                                   // build the sparse matrix 
+
+  // build the sparse matrix
   PETScWrappers::MPI::SparseMatrix matrix (PETSC_COMM_WORLD,
                                            N*N, N*N,
                                            N*N, N*N,
                                            5);
-  for(unsigned int i_=0; i_<N; i_++)
-    for(unsigned int j_=0; j_<N; j_++)
+  for (unsigned int i_=0; i_<N; i_++)
+    for (unsigned int j_=0; j_<N; j_++)
       {
         const unsigned int i=permutation[i_];
         const unsigned int j=permutation[j_];
-        
+
         const unsigned int global = i*N+j;
         matrix.add(global, global, rand());
         if (j>0)
@@ -98,22 +98,22 @@ void test ()
           }
       }
   matrix.compress ();
-  
-                                   // then do a single matrix-vector
-                                   // multiplication with subsequent formation
-                                   // of the matrix norm
+
+  // then do a single matrix-vector
+  // multiplication with subsequent formation
+  // of the matrix norm
   PETScWrappers::MPI::Vector v1(PETSC_COMM_WORLD, N*N, N*N);
   PETScWrappers::MPI::Vector v2(PETSC_COMM_WORLD, N*N, N*N);
   for (unsigned int i=0; i<N*N; ++i)
     v1(i) = i;
   matrix.vmult (v2, v1);
-  
-  deallog << v1*v2 << std::endl;
+
+  deallog << v1 *v2 << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("slowness_04/output");
   deallog.attach(logfile);
@@ -125,30 +125,30 @@ int main (int argc,char **argv)
       {
         test ();
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 3428d255ff22460902431f933cf4b29112415e19..c0c36e906e808684bb3cd162012ba9c2669eee57 100644 (file)
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
-  
+
   u = 0.;
   f = 1.;
-  try 
+  try
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
-                                       // it needs to be expected for the
-                                       // richardson solver that we end up
-                                       // here, so don't abort
+      // it needs to be expected for the
+      // richardson solver that we end up
+      // here, so don't abort
     }
 
   deallog << "Solver stopped after " << solver.control().last_step()
@@ -65,7 +65,7 @@ int main(int argc, char **argv)
   deallog << std::setprecision(4);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
   {
     SolverControl control(100, 1.e-3);
@@ -74,8 +74,8 @@ int main(int argc, char **argv)
     unsigned int dim = (size-1)*(size-1);
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                     // Make matrix
+
+    // Make matrix
     FDMatrix testproblem(size, size);
     PETScWrappers::SparseMatrix  A(dim, dim, 5);
     testproblem.five_point(A);
@@ -91,6 +91,6 @@ int main(int argc, char **argv)
     PETScWrappers::PreconditionJacobi preconditioner(A);
     check_solve (solver, A,u,f, preconditioner);
   }
-  
+
 }
 
index ba37184f8f21d50c5c9f9e6e99343bccde8620be..132d698da51dc4aa115318165d7345f0d4ba3aa2 100644 (file)
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
-  
+
   u = 0.;
   f = 1.;
-  try 
+  try
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
-                                       // just like for Richardson: we end up
-                                       // here normally for this solver
+      // just like for Richardson: we end up
+      // here normally for this solver
     }
 
   deallog << "Solver stopped after " << solver.control().last_step()
@@ -66,15 +66,15 @@ int main(int argc, char **argv)
   deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
-  {  
+  {
     SolverControl control(100, 1.e-3);
 
     const unsigned int size = 32;
     unsigned int dim = (size-1)*(size-1);
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                     // Make matrix
+
+    // Make matrix
     FDMatrix testproblem(size, size);
     PETScWrappers::SparseMatrix  A(dim, dim, 5);
     testproblem.five_point(A);
@@ -90,6 +90,6 @@ int main(int argc, char **argv)
     PETScWrappers::PreconditionJacobi preconditioner(A);
     check_solve (solver, A,u,f, preconditioner);
   }
-  
+
 }
 
index 2f3781892f2174d6a0b8e909785d608776a63ed0..2f9071927a0c41e20f194ca3045a15bb39ba17e0 100644 (file)
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
-  
+
   u = 0.;
   f = 1.;
-  try 
+  try
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -65,15 +65,15 @@ int main(int argc, char **argv)
   deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
-  {  
+  {
     SolverControl control(100, 1.e-3);
 
     const unsigned int size = 32;
     unsigned int dim = (size-1)*(size-1);
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                     // Make matrix
+
+    // Make matrix
     FDMatrix testproblem(size, size);
     PETScWrappers::SparseMatrix  A(dim, dim, 5);
     testproblem.five_point(A);
@@ -89,6 +89,6 @@ int main(int argc, char **argv)
     PETScWrappers::PreconditionJacobi preconditioner(A);
     check_solve (solver, A,u,f, preconditioner);
   }
-  
+
 }
 
index 8e84cec6de5dda64788d7aa032ed781e65f4ef05..c124121eb0eab006f745a75572dafcffdf03aa57 100644 (file)
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
 
   u = 0.;
   f = 1.;
-  try 
+  try
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       std::cout << e.what() << std::endl;
       deallog << e.what() << std::endl;
@@ -66,14 +66,14 @@ int main(int argc, char **argv)
   deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
-  {  
+  {
     SolverControl control(100, 1.e-3);
 
     const unsigned int size = 32;
     unsigned int dim = (size-1)*(size-1);
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
+
     PetscFDMatrix  A(size, dim);
 
     PETScWrappers::Vector  f(dim);
@@ -87,6 +87,6 @@ int main(int argc, char **argv)
     PETScWrappers::PreconditionNone preconditioner(A);
     check_solve (solver, A,u,f, preconditioner);
   }
-  
+
 }
 
index 39ec93dbcb705ae6072b7f60296c10e8b8448a63..62f679ede7e3547f074a9a41f9383b89e5e622a3 100644 (file)
@@ -35,8 +35,8 @@
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
 
@@ -46,7 +46,7 @@ check_solve( SOLVER& solver, const MATRIX& A,
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -74,7 +74,7 @@ int main(int argc, char **argv)
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
 
-                                     // Make matrix
+    // Make matrix
     FDMatrix testproblem(size, size);
     PETScWrappers::SparseMatrix  A(dim, dim, 5);
     testproblem.five_point(A);
@@ -90,6 +90,6 @@ int main(int argc, char **argv)
     PETScWrappers::PreconditionBoomerAMG preconditioner(A);
     check_solve (solver, A,u,f, preconditioner);
   }
-  
+
 }
 
index 5c09712b4a6759db781c9fb2822b23c4f641079b..709f3e837d2293e4ad498283aa08d4fffbfdcb99 100644 (file)
@@ -36,8 +36,8 @@
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
 
@@ -47,7 +47,7 @@ check_solve( SOLVER& solver, const MATRIX& A,
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -75,7 +75,7 @@ int main(int argc, char **argv)
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
 
-                                     // Make matrix
+    // Make matrix
     FDMatrix testproblem(size, size);
     PETScWrappers::SparseMatrix  A(dim, dim, 5);
     testproblem.five_point(A);
@@ -91,6 +91,6 @@ int main(int argc, char **argv)
     PETScWrappers::PreconditionBoomerAMG preconditioner(A, true);
     check_solve (solver, A,u,f, preconditioner);
   }
-  
+
 }
 
index 0dfbe697819b31fee3eb279544bd1356f01ee66a..03e98e0ad41e057bcafb2155b0c72ddce781e25e 100644 (file)
@@ -34,8 +34,8 @@
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
 
@@ -45,7 +45,7 @@ check_solve( SOLVER& solver, const MATRIX& A,
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -73,7 +73,7 @@ int main(int argc, char **argv)
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
 
-                                     // Make matrix
+    // Make matrix
     FDMatrix testproblem(size, size);
     PETScWrappers::SparseMatrix  A(dim, dim, 5);
     testproblem.five_point(A);
@@ -89,6 +89,6 @@ int main(int argc, char **argv)
     PETScWrappers::PreconditionEisenstat preconditioner(A);
     check_solve (solver, A,u,f, preconditioner);
   }
-  
+
 }
 
index 29ca9d7539051a1614c21d85b574c437cf1d40ae..c5916bc3afccfe8160a3530262708838f7b7bd24 100644 (file)
@@ -34,8 +34,8 @@
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
 
@@ -45,7 +45,7 @@ check_solve( SOLVER& solver, const MATRIX& A,
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -73,7 +73,7 @@ int main(int argc, char **argv)
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
 
-                                     // Make matrix
+    // Make matrix
     FDMatrix testproblem(size, size);
     PETScWrappers::SparseMatrix  A(dim, dim, 5);
     testproblem.five_point(A);
@@ -89,6 +89,6 @@ int main(int argc, char **argv)
     PETScWrappers::PreconditionICC preconditioner(A);
     check_solve (solver, A,u,f, preconditioner);
   }
-  
+
 }
 
index 439be7d951a19b0edb4c391a39a943a2d9995046..53edb1a149dd37ad223c8d0adcd8202844a117a8 100644 (file)
@@ -34,8 +34,8 @@
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
 
@@ -45,7 +45,7 @@ check_solve( SOLVER& solver, const MATRIX& A,
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -73,7 +73,7 @@ int main(int argc, char **argv)
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
 
-                                     // Make matrix
+    // Make matrix
     FDMatrix testproblem(size, size);
     PETScWrappers::SparseMatrix  A(dim, dim, 5);
     testproblem.five_point(A);
@@ -89,6 +89,6 @@ int main(int argc, char **argv)
     PETScWrappers::PreconditionILU preconditioner(A);
     check_solve (solver, A,u,f, preconditioner);
   }
-  
+
 }
 
index 703da4db497caa4cd05fb5f1164320ae4e623813..f0fafbb3b36fa86cb6684ff94a54d9ea5f5d34a9 100644 (file)
@@ -35,8 +35,8 @@
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
 
@@ -46,7 +46,7 @@ check_solve( SOLVER& solver, const MATRIX& A,
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -55,11 +55,11 @@ check_solve( SOLVER& solver, const MATRIX& A,
   deallog << "Solver stopped after " << solver.control().last_step()
           << " iterations" << std::endl;
 
-                                  // we use a direct solver as a
-                                  // preconditioner. this should
-                                  // converge in one step!
+  // we use a direct solver as a
+  // preconditioner. this should
+  // converge in one step!
   Assert (solver.control().last_step() == 1,
-         ExcInternalError());
+          ExcInternalError());
 }
 
 
@@ -80,7 +80,7 @@ int main(int argc, char **argv)
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
 
-                                     // Make matrix
+    // Make matrix
     FDMatrix testproblem(size, size);
     PETScWrappers::SparseMatrix  A(dim, dim, 5);
     testproblem.five_point(A);
@@ -96,6 +96,6 @@ int main(int argc, char **argv)
     PETScWrappers::PreconditionLU preconditioner(A);
     check_solve (solver, A,u,f, preconditioner);
   }
-  
+
 }
 
index d17e2368403b8634880709a9a13b0569159fd44b..2bc0ad648c5a7d3d3e66efb99efdea9dfef2429c 100644 (file)
@@ -34,8 +34,8 @@
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
 
@@ -45,7 +45,7 @@ check_solve( SOLVER& solver, const MATRIX& A,
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -73,7 +73,7 @@ int main(int argc, char **argv)
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
 
-                                     // Make matrix
+    // Make matrix
     FDMatrix testproblem(size, size);
     PETScWrappers::SparseMatrix  A(dim, dim, 5);
     testproblem.five_point(A);
@@ -89,6 +89,6 @@ int main(int argc, char **argv)
     PETScWrappers::PreconditionParaSails preconditioner(A);
     check_solve (solver, A,u,f, preconditioner);
   }
-  
+
 }
 
index 54e72ae2cc0b3a798317950a823b5e1dae237a6f..c2e0b8b9843f67d6d0f144ee81a2fb9e8e8e22c0 100644 (file)
@@ -34,8 +34,8 @@
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
 
@@ -45,7 +45,7 @@ check_solve( SOLVER& solver, const MATRIX& A,
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -73,7 +73,7 @@ int main(int argc, char **argv)
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
 
-                                     // Make matrix
+    // Make matrix
     FDMatrix testproblem(size, size);
     PETScWrappers::SparseMatrix  A(dim, dim, 5);
     testproblem.five_point(A);
@@ -89,6 +89,6 @@ int main(int argc, char **argv)
     PETScWrappers::PreconditionSOR preconditioner(A);
     check_solve (solver, A,u,f, preconditioner);
   }
-  
+
 }
 
index 8acf91baee62bc48a5d39cd8a883790e7f4aa7a4..59f7be8880516b72d590365a8931143d51329962 100644 (file)
@@ -34,8 +34,8 @@
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
 
@@ -45,7 +45,7 @@ check_solve( SOLVER& solver, const MATRIX& A,
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -73,7 +73,7 @@ int main(int argc, char **argv)
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
 
-                                     // Make matrix
+    // Make matrix
     FDMatrix testproblem(size, size);
     PETScWrappers::SparseMatrix  A(dim, dim, 5);
     testproblem.five_point(A);
@@ -89,6 +89,6 @@ int main(int argc, char **argv)
     PETScWrappers::PreconditionSSOR preconditioner(A);
     check_solve (solver, A,u,f, preconditioner);
   }
-  
+
 }
 
index 10b1cd19d5015dba0aabecbe01f1e9c7afe0c659..e9353efc03077070fca58938294b79b0d5ecfbf2 100644 (file)
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
-  
+
   u = 0.;
   f = 1.;
-  try 
+  try
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -65,15 +65,15 @@ int main(int argc, char **argv)
   deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
-  {  
+  {
     SolverControl control(100, 1.e-3);
 
     const unsigned int size = 32;
     unsigned int dim = (size-1)*(size-1);
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                     // Make matrix
+
+    // Make matrix
     FDMatrix testproblem(size, size);
     PETScWrappers::SparseMatrix  A(dim, dim, 5);
     testproblem.five_point(A);
@@ -89,6 +89,6 @@ int main(int argc, char **argv)
     PETScWrappers::PreconditionJacobi preconditioner(A);
     check_solve (solver, A,u,f, preconditioner);
   }
-  
+
 }
 
index bae9af789cfeeaf13e0390c4e7f7816516071a06..591d86af172c3c8f1d5af9119619aed17048a8fa 100644 (file)
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
-  
+
   u = 0.;
   f = 1.;
-  try 
+  try
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -65,15 +65,15 @@ int main(int argc, char **argv)
   deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
-  {  
+  {
     SolverControl control(100, 1.e-3);
 
     const unsigned int size = 32;
     unsigned int dim = (size-1)*(size-1);
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                     // Make matrix
+
+    // Make matrix
     FDMatrix testproblem(size, size);
     PETScWrappers::SparseMatrix  A(dim, dim, 5);
     testproblem.five_point(A);
@@ -89,6 +89,6 @@ int main(int argc, char **argv)
     PETScWrappers::PreconditionJacobi preconditioner(A);
     check_solve (solver, A,u,f, preconditioner);
   }
-  
+
 }
 
index 7372d11a2ac238da2878608f22a0124308444a9b..df97600cc7c53d525a3fa30b4ffc998af6028725 100644 (file)
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
-  
+
   u = 0.;
   f = 1.;
-  try 
+  try
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -63,7 +63,7 @@ int main(int argc, char **argv)
   deallog << std::setprecision(4);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
   {
     SolverControl control(100, 1.e-3);
@@ -72,8 +72,8 @@ int main(int argc, char **argv)
     unsigned int dim = (size-1)*(size-1);
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                     // Make matrix
+
+    // Make matrix
     FDMatrix testproblem(size, size);
     PETScWrappers::SparseMatrix  A(dim, dim, 5);
     testproblem.five_point(A);
@@ -89,6 +89,6 @@ int main(int argc, char **argv)
     PETScWrappers::PreconditionJacobi preconditioner(A);
     check_solve (solver, A,u,f, preconditioner);
   }
-  
+
 }
 
index 706c0dfc305529291bfa82f42c140e036ac0a577..007d238ab2e490a0fe227ac3ab2374d033a63980 100644 (file)
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
-  
+
   u = 0.;
   f = 1.;
-  try 
+  try
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -72,8 +72,8 @@ int main(int argc, char **argv)
     unsigned int dim = (size-1)*(size-1);
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                     // Make matrix
+
+    // Make matrix
     FDMatrix testproblem(size, size);
     PETScWrappers::SparseMatrix  A(dim, dim, 5);
     testproblem.five_point(A);
@@ -89,6 +89,6 @@ int main(int argc, char **argv)
     PETScWrappers::PreconditionJacobi preconditioner(A);
     check_solve (solver, A,u,f, preconditioner);
   }
-  
+
 }
 
index b0b5d5738deffcdd74bf416f7efd7521786f2206..8f2c12fa8b1bbfc67eccca964e61afa03be3e502 100644 (file)
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
-  
+
   u = 0.;
   f = 1.;
-  try 
+  try
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -63,7 +63,7 @@ int main(int argc, char **argv)
   deallog << std::setprecision(4);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
   {
     SolverControl control(100, 1.e-3);
@@ -72,8 +72,8 @@ int main(int argc, char **argv)
     unsigned int dim = (size-1)*(size-1);
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                     // Make matrix
+
+    // Make matrix
     FDMatrix testproblem(size, size);
     PETScWrappers::SparseMatrix  A(dim, dim, 5);
     testproblem.five_point(A);
@@ -89,6 +89,6 @@ int main(int argc, char **argv)
     PETScWrappers::PreconditionJacobi preconditioner(A);
     check_solve (solver, A,u,f, preconditioner);
   }
-  
+
 }
 
index 397ed1ccddcfb83cb568a0e1c7d2a828f0cd8e82..67ab1e62b49f28f6c264ab633fda31a539e21819 100644 (file)
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
-  
+
   u = 0.;
   f = 1.;
-  try 
+  try
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -67,7 +67,7 @@ int main(int argc, char **argv)
   deallog << std::setprecision(4);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
   {
     SolverControl control(100, 1.e-3);
@@ -76,8 +76,8 @@ int main(int argc, char **argv)
     unsigned int dim = (size-1)*(size-1);
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                     // Make matrix
+
+    // Make matrix
     FDMatrix testproblem(size, size);
     PETScWrappers::SparseMatrix  A(dim, dim, 5);
     testproblem.five_point(A);
@@ -93,6 +93,6 @@ int main(int argc, char **argv)
     PETScWrappers::PreconditionJacobi preconditioner(A);
     check_solve (solver, A,u,f, preconditioner);
   }
-  
+
 }
 
index 9abe203b5c36fdd5bc8d6c4c1531a01381602147..4fdb4c05c3b220214451b402860ac578bbe272bc 100644 (file)
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
-  
+
   u = 0.;
   f = 1.;
-  try 
+  try
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -63,7 +63,7 @@ int main(int argc, char **argv)
   deallog << std::setprecision(4);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
   {
     SolverControl control(100, 1.e-3);
@@ -72,8 +72,8 @@ int main(int argc, char **argv)
     unsigned int dim = (size-1)*(size-1);
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                     // Make matrix
+
+    // Make matrix
     FDMatrix testproblem(size, size);
     PETScWrappers::SparseMatrix  A(dim, dim, 5);
     testproblem.five_point(A);
@@ -89,6 +89,6 @@ int main(int argc, char **argv)
     PETScWrappers::PreconditionJacobi preconditioner(A);
     check_solve (solver, A,u,f, preconditioner);
   }
-  
+
 }
 
index c4f60f4c2402bb4dfbf5a73a0062e6e234bed5e2..c2bc733ad93f134467e1958f8915eb2f667b1826 100644 (file)
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
-  
+
   u = 0.;
   f = 1.;
-  try 
+  try
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
-                                       // just like for Richardson: expect to
-                                       // get here, don't abort the program
+      // just like for Richardson: expect to
+      // get here, don't abort the program
     }
 
   deallog << "Solver stopped after " << solver.control().last_step()
@@ -64,7 +64,7 @@ int main(int argc, char **argv)
   deallog << std::setprecision(4);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
   {
     SolverControl control(100, 1.e-3);
@@ -73,8 +73,8 @@ int main(int argc, char **argv)
     unsigned int dim = (size-1)*(size-1);
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                     // Make matrix
+
+    // Make matrix
     FDMatrix testproblem(size, size);
     PETScWrappers::SparseMatrix  A(dim, dim, 5);
     testproblem.five_point(A);
@@ -90,6 +90,6 @@ int main(int argc, char **argv)
     PETScWrappers::PreconditionJacobi preconditioner(A);
     check_solve (solver, A,u,f, preconditioner);
   }
-  
+
 }
 
index 85f3bf3e05e93376651ecefd62a45ae60b0f8202..6a99ee2ced903a6180cb721e0db1ec396fdbd636 100644 (file)
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
-  
+
   u = 0.;
   f = 1.;
 
@@ -56,7 +56,7 @@ int main(int argc, char **argv)
   deallog << std::setprecision(4);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
   {
     SolverControl control(100, 1.e-3);
@@ -65,8 +65,8 @@ int main(int argc, char **argv)
     unsigned int dim = (size-1)*(size-1);
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                     // Make matrix
+
+    // Make matrix
     FDMatrix testproblem(size, size);
     PETScWrappers::SparseMatrix  A(dim, dim, 5);
     testproblem.five_point(A);
@@ -79,13 +79,13 @@ int main(int argc, char **argv)
     u.compress ();
 
     PETScWrappers::SolverPreOnly solver(control);
-    
+
     PETScWrappers::PreconditionJacobi preconditioner(A);
     check_solve (solver, A,u,f, preconditioner);
 
-                                    //run twice because this errored out at some point
+    //run twice because this errored out at some point
     check_solve (solver, A,u,f, preconditioner);
   }
-  
+
 }
 
index 0f6828e2f0c1796266b19b94a43bcd6ee703a1dc..449383562682d07d037dad2878954d0dd0bf03cf 100644 (file)
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
-  deallog << "Solver type: " << typeid(solver).name() << std::endl;  
+  deallog << "Solver type: " << typeid(solver).name() << std::endl;
 
   solver.solve(A,u,f,P);
 
@@ -53,7 +53,7 @@ int main(int argc, char **argv)
   deallog << std::setprecision(4);
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
-  
+
   Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
   {
     SolverControl control(100, 1.e-3);
@@ -62,8 +62,8 @@ int main(int argc, char **argv)
     unsigned int dim = (size-1)*(size-1);
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                     // Make matrix
+
+    // Make matrix
     FDMatrix testproblem(size, size);
     PETScWrappers::SparseMatrix  A(dim, dim, 5);
     testproblem.five_point(A);
@@ -78,13 +78,13 @@ int main(int argc, char **argv)
     PETScWrappers::Vector t=u;
 
     PETScWrappers::SolverPreOnly solver(control);
-    
+
     PETScWrappers::PreconditionJacobi preconditioner(A);
-    
+
     check_solve (solver, A,u,f, preconditioner);
 
     deallog << u.l2_norm() << std::endl;
-    
+
     check_solve (solver, A,t,u, preconditioner);
 
     deallog << t.l2_norm() << std::endl;
@@ -93,8 +93,8 @@ int main(int argc, char **argv)
     preconditioner.vmult(u, f);
     deallog << u.l2_norm() << std::endl;
     preconditioner.vmult(t, u);
-    deallog << t.l2_norm() << std::endl;    
+    deallog << t.l2_norm() << std::endl;
   }
-  
+
 }
 
index 87fd10dd75b03476b49c074a49e030cd1868d24c..d6e6fcb7289df3930c8582a55b64671232303eda 100644 (file)
@@ -34,8 +34,8 @@
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
 
@@ -45,7 +45,7 @@ check_solve( SOLVER& solver, const MATRIX& A,
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -71,7 +71,7 @@ int main(int argc, char **argv)
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
 
-                                     // Make matrix
+    // Make matrix
     FDMatrix testproblem(size, size);
     PETScWrappers::SparseMatrix  A(dim, dim, 5);
     testproblem.five_point(A);
@@ -91,8 +91,8 @@ int main(int argc, char **argv)
 
     PETScWrappers::Vector  tmp(dim);
     deallog << "residual = " << A.residual (tmp, u, f)
-           << std::endl;
+            << std::endl;
   }
-  
+
 }
 
index a6143577837542b11a37820588dddfae1bd1a94a..d8f8f48abe40187b2446df7c690cfdeec5a6f307 100644 (file)
@@ -32,8 +32,8 @@ void test ()
   PETScWrappers::SparseMatrix m(s,s,s);
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<=i; ++j)
-        m.set (i,j, i+2*j);
-      
+      m.set (i,j, i+2*j);
+
   m.compress ();
 
   PETScWrappers::SparseMatrix m2(s,s,s);
@@ -45,26 +45,26 @@ void test ()
   // we now print the matrix m,
   // print after adding m2, and then subtract m2 again
   // to get the original matrix back.
-  
+
   deallog << "before: " << m(0,1) << std::endl;
-  for (unsigned int i=0;i<s;++i)
+  for (unsigned int i=0; i<s; ++i)
     deallog << m(i,i) << " ";
   deallog << std::endl;
 
   m.add(m2,1.0);
 
   deallog << "after: " << m(0,1) << std::endl;
-  for (unsigned int i=0;i<s;++i)
+  for (unsigned int i=0; i<s; ++i)
     deallog << m(i,i) << " ";
   deallog << std::endl;
 
   m.add(m2,-1.0);
 
   deallog << "back to original: " << m(0,1) << std::endl;
-  for (unsigned int i=0;i<s;++i)
+  for (unsigned int i=0; i<s; ++i)
     deallog << m(i,i) << " ";
   deallog << std::endl;
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -79,5 +79,5 @@ int main (int argc, char **argv)
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
   test ();
-  
+
 }
index 01d19e82f5adcf92450e0258da758ce2a41d67d2..9ab815a81a83d0107da4193753247f360af5cdcb 100644 (file)
@@ -32,33 +32,33 @@ void test ()
   PETScWrappers::SparseMatrix m(10,10,10);
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
 
   m.compress();
-  
+
   {
-    
-  
-  PETScWrappers::SparseMatrix m2;
 
-  Mat mm=m;
-  Mat m2m=m2;
-  
-  //deallog << mm << " " << m2m << std::endl;
 
-  //forbidden:  m2 = m;
-  {
-    //forbidden: PETScWrappers::SparseMatrix m3=m2;
+    PETScWrappers::SparseMatrix m2;
 
     Mat mm=m;
     Mat m2m=m2;
+
     //deallog << mm << " " << m2m << std::endl;
-      
-  }
-  
+
+    //forbidden:  m2 = m;
+    {
+      //forbidden: PETScWrappers::SparseMatrix m3=m2;
+
+      Mat mm=m;
+      Mat m2m=m2;
+      //deallog << mm << " " << m2m << std::endl;
+
+    }
+
   }
-  
+
 }
 
 
@@ -74,33 +74,33 @@ int main (int argc, char **argv)
       Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
       {
         test ();
-  
-       deallog << "OK" << std::endl;
+
+        deallog << "OK" << std::endl;
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 45e1d77cefea221367be64c6e28c643bb5c93d50..ccb85230d2180079b1e9827f9bdb7e6df27a066a 100644 (file)
@@ -19,7 +19,7 @@
 // test PETScWrappers::MatrixBase::const_iterator
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_sparse_matrix.h>    
+#include <deal.II/lac/petsc_sparse_matrix.h>
 #include <fstream>
 #include <iostream>
 
@@ -29,7 +29,7 @@ void test ()
   PETScWrappers::SparseMatrix m(5,5,5);
   m.set (0,0,1);
   m.set (1,1,2);
-  m.set (1,2,3);  
+  m.set (1,2,3);
   m.compress ();
   PETScWrappers::SparseMatrix::const_iterator i = m.begin();
   deallog << i->row() << ' ' << i->column() << ' ' << i->value() << std::endl;
@@ -37,7 +37,7 @@ void test ()
   deallog << i->row() << ' ' << i->column() << ' ' << i->value() << std::endl;
   i++;
   deallog << i->row() << ' ' << i->column() << ' ' << i->value() << std::endl;
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -56,30 +56,30 @@ int main (int argc,char **argv)
       {
         test ();
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 8f7f86737409266f137075c9f8e1ae1c508f90ec..89d38a30f5405a9bf46bf7317f64dbecbdabe45a 100644 (file)
@@ -32,19 +32,19 @@ void test (PETScWrappers::Vector &v,
   PETScWrappers::SparseMatrix m(v.size(),v.size(),v.size());
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
-  
+
   m.compress ();
   v.compress ();
   w.compress ();
 
-                                   // w:=Mv
+  // w:=Mv
   m.vmult (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -75,30 +75,30 @@ int main (int argc, char **argv)
         PETScWrappers::Vector w (100);
         test (v,w);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 2f59fcf37e29e482321d12fe097dcf2700079e83..3a5de57a12f9bbfd4fd55a4fe77103380b0ed066 100644 (file)
@@ -32,19 +32,19 @@ void test (PETScWrappers::Vector &v,
   PETScWrappers::SparseMatrix m(v.size(),v.size(),v.size());
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
-  
+
   m.compress ();
   v.compress ();
   w.compress ();
 
-                                   // w:=Mv
+  // w:=Mv
   m.Tvmult (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -75,30 +75,30 @@ int main (int argc, char **argv)
         PETScWrappers::Vector w (100);
         test (v,w);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 7a42434becd53153650787c49fe9b8b48fde6f2a..2fd2fb4f8574ccd6a3c65e429d23fe26d1a13d5e 100644 (file)
@@ -32,22 +32,22 @@ void test (PETScWrappers::Vector &v,
   PETScWrappers::SparseMatrix m(v.size(),v.size(),v.size());
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       w(i) = i;
     }
-  
+
   m.compress ();
   v.compress ();
   w.compress ();
 
-                                   // w:=Mv
+  // w:=Mv
   m.vmult_add (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -78,30 +78,30 @@ int main (int argc, char **argv)
         PETScWrappers::Vector w (100);
         test (v,w);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 8020cdd17f948a2aa1dc44bdc8abbf70a5b83656..f698ebdb31d7f5e32ea3a668b217352e47cb1798 100644 (file)
@@ -32,22 +32,22 @@ void test (PETScWrappers::Vector &v,
   PETScWrappers::SparseMatrix m(v.size(),v.size(),v.size());
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       w(i) = i;
     }
-  
+
   m.compress ();
   v.compress ();
   w.compress ();
 
-                                   // w:=Mv
+  // w:=Mv
   m.Tvmult_add (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -78,30 +78,30 @@ int main (int argc, char **argv)
         PETScWrappers::Vector w (100);
         test (v,w);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index dc42a5b78c622737fd47e83dd90d35cece5064f0..23ab3145d510c738d3115fc17f7c0462f41ac6a5 100644 (file)
@@ -32,22 +32,22 @@ void test (PETScWrappers::Vector &v,
   PETScWrappers::SparseMatrix m(v.size(),v.size(),v.size());
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       w(i) = i+1;
     }
-  
+
   m.compress ();
   v.compress ();
   w.compress ();
 
-                                   // <w,Mv>
+  // <w,Mv>
   const PetscScalar s = m.matrix_scalar_product (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -81,30 +81,30 @@ int main (int argc, char **argv)
         PETScWrappers::Vector w (100);
         test (v,w);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index bcebd8930a6b16d911e5c815309dc9db6c0238c9..2f8dd26a35063b5a1c190d5737cd016880d83db1 100644 (file)
@@ -31,18 +31,18 @@ void test (PETScWrappers::Vector &v)
   PETScWrappers::SparseMatrix m(v.size(),v.size(),v.size());
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
-  
+
   m.compress ();
   v.compress ();
 
-                                   // <w,Mv>
+  // <w,Mv>
   const PetscScalar s = m.matrix_norm_square (v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     Assert (v(i) == i, ExcInternalError());
 
@@ -72,30 +72,30 @@ int main (int argc, char **argv)
         PETScWrappers::Vector v (30);
         test (v);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index c275c62558bd89765ecbf156814f4a04818d87f5..9d1ca647de2988b678770709948cc2502c3a9c52 100644 (file)
@@ -33,22 +33,22 @@ void test (PETScWrappers::Vector &v,
   PETScWrappers::SparseMatrix m(v.size(),v.size(),v.size());
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       w(i) = i+1;
     }
-      
+
   m.compress ();
   v.compress ();
   w.compress ();
 
-                                   // x=w-Mv
+  // x=w-Mv
   const double s = m.residual (x, v, w);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -84,30 +84,30 @@ int main (int argc, char **argv)
         PETScWrappers::Vector x (100);
         test (v,w,x);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 3d40c496b78129fb0b7f25de816c2be0034f60b2..0f21c202b6de5faf3e06e834ec9f6c0b282000f5 100644 (file)
@@ -25,7 +25,7 @@
 // this was fixed 2004-04-05, and this test checks that it works
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
 void test (PETScWrappers::Vector &v,
            PETScWrappers::Vector &w)
 {
-                                   // set the first vector
+  // set the first vector
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
 
-                                   // copy elements by reference
+  // copy elements by reference
   for (unsigned int i=0; i<v.size(); ++i)
     w(i) = v(i);
 
-                                   // check that they're equal
+  // check that they're equal
   Assert (v==w, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -65,30 +65,30 @@ int main (int argc, char **argv)
         PETScWrappers::Vector w (100);
         test (v,w);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index fa79b215eb94bcfdfbec1e5f39fb60f67467f118..343f2b2e03a25f7b54208bc0146d83762cc1dfda 100644 (file)
@@ -24,7 +24,7 @@
 // wrote the test to make sure it works this way, let's keep it then...
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
 void test (PETScWrappers::Vector &v,
            PETScWrappers::Vector &w)
 {
-                                   // set the first vector
+  // set the first vector
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
 
-                                   // add elements by reference
+  // add elements by reference
   for (unsigned int i=0; i<v.size(); ++i)
     w(i) += v(i);
 
-                                   // check that they're equal
+  // check that they're equal
   Assert (v==w, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -64,30 +64,30 @@ int main (int argc, char **argv)
         PETScWrappers::Vector w (100);
         test (v,w);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 0f2e7352e510d5f536d70244718fa1b5ee2a6b2e..8f8a3061acfa722faa3902d9d34f4342f4c1ca8d 100644 (file)
@@ -20,7 +20,7 @@
 // equal
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -29,8 +29,8 @@
 void test (PETScWrappers::Vector &v,
            PETScWrappers::Vector &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
@@ -60,30 +60,30 @@ int main (int argc, char **argv)
         PETScWrappers::Vector w (100);
         test (v,w);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 4e59043ddbdc0313d141f2ae1d9ef6872bb761c8..16c0f76d27a8631610ed633064e2fce67e5ecdb1 100644 (file)
@@ -20,7 +20,7 @@
 // equal
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
 void test (PETScWrappers::Vector &v,
            PETScWrappers::Vector &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       if (i%3 == 0)
         w(i) = i+1.;
     }
-                                   // but then copy elements and make sure the
-                                   // vectors are actually equal
+  // but then copy elements and make sure the
+  // vectors are actually equal
   v = w;
   Assert (v==w, ExcInternalError());
 
@@ -62,30 +62,30 @@ int main (int argc, char **argv)
         PETScWrappers::Vector w (100);
         test (v,w);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 532330002fd50eaa5d6489193a0344a6014e3748..05e740b506a2f1e549c505b9c5d226aa065f79d2 100644 (file)
@@ -20,7 +20,7 @@
 // equal
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -29,8 +29,8 @@
 void test (PETScWrappers::Vector &v,
            PETScWrappers::Vector &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
@@ -60,30 +60,30 @@ int main (int argc, char **argv)
         PETScWrappers::Vector w (100);
         test (v,w);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index aeadf5d6de4c2f8203653fb0e4299dacf30ed5b3..41368c64507ccc3babdad1c3cd318c3019b90c74 100644 (file)
@@ -20,7 +20,7 @@
 // equal
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
 void test (PETScWrappers::Vector &v,
            PETScWrappers::Vector &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       if (i%3 == 0)
         w(i) = i+1.;
     }
-                                   // but then copy elements and make sure the
-                                   // vectors are actually equal
+  // but then copy elements and make sure the
+  // vectors are actually equal
   v = w;
   Assert (! (v!=w), ExcInternalError());
 
@@ -62,30 +62,30 @@ int main (int argc, char **argv)
         PETScWrappers::Vector w (100);
         test (v,w);
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index c78473c1349ed128b52c5a1c957d01a177c768c4..443bc4da747a563183be798e7e0775ae49ee29f5 100644 (file)
@@ -20,7 +20,7 @@
 // restores the previous value of the stream precision
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
 void test (PETScWrappers::Vector &v,
            PETScWrappers::Vector &w)
 {
-                                   // set the first vector
+  // set the first vector
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
 
-                                   // copy elements by reference
+  // copy elements by reference
   for (unsigned int i=0; i<v.size(); ++i)
     w(i) = v(i);
 
-                                   // check that they're equal
+  // check that they're equal
   Assert (v==w, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -57,46 +57,46 @@ int main (int argc, char **argv)
       Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
       {
         PETScWrappers::Vector v (5);
-       for (unsigned int i=0; i<v.size(); ++i)
-         v(i) = i*1.2345678901234567;
+        for (unsigned int i=0; i<v.size(); ++i)
+          v(i) = i*1.2345678901234567;
 
-       // print with old precision
-       deallog << numbers::PI << std::endl;
+        // print with old precision
+        deallog << numbers::PI << std::endl;
 
-       // print with prescribed precision
-       deallog << "across=false" << std::endl;
-       v.print (logfile, 10, true, false);
-       
-       deallog << "across=true" << std::endl;
-       v.print (logfile, 10, true, true);
+        // print with prescribed precision
+        deallog << "across=false" << std::endl;
+        v.print (logfile, 10, true, false);
 
-       // print once more. should be the old precision again
-       deallog << numbers::PI << std::endl;
+        deallog << "across=true" << std::endl;
+        v.print (logfile, 10, true, true);
+
+        // print once more. should be the old precision again
+        deallog << numbers::PI << std::endl;
       }
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 883d76414d3e77a4ea9c60aeef2615e68e176ce6..f1ca2cdc0f5f3a24bf668b4afcae14506f4ba943 100644 (file)
@@ -20,7 +20,7 @@
 // existing PETSc vector.
 
 #include "../tests.h"
-#include <deal.II/lac/petsc_vector.h>    
+#include <deal.II/lac/petsc_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
 void test (PETScWrappers::Vector &v,
            PETScWrappers::Vector &w)
 {
-                                   // set the first vector
+  // set the first vector
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
 
-                                   // copy elements by reference
+  // copy elements by reference
   for (unsigned int i=0; i<v.size(); ++i)
     w(i) = v(i);
 
-                                   // check that they're equal
+  // check that they're equal
   Assert (v==w, ExcInternalError());
-  
+
   v=w;
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -60,7 +60,7 @@ int main (int argc, char **argv)
       Vec vpetsc;
       int ierr = VecCreateSeq (PETSC_COMM_SELF, 100, &vpetsc);
       AssertThrow (ierr == 0, ExcPETScError(ierr));
-      {        
+      {
         PETScWrappers::Vector v (vpetsc);
         PETScWrappers::Vector w (100);
         test (v,w);
@@ -74,30 +74,30 @@ int main (int argc, char **argv)
 
       AssertThrow (ierr == 0, ExcPETScError(ierr));
 
-      
+
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 86a16af3ec06d369bc677cf2926b7a5f56dfc07e..701bbf4e147dad8c4c7ad8868707332127122a0d 100644 (file)
@@ -32,97 +32,97 @@ namespace dealii
 {
   template <int dim, int spacedim>
   bool operator == (const DoFHandler<dim,spacedim> &t1,
-                   const DoFHandler<dim,spacedim> &t2)
+                    const DoFHandler<dim,spacedim> &t2)
   {
-                                    // test a few attributes, though we can't
-                                    // test everything unfortunately...
+    // test a few attributes, though we can't
+    // test everything unfortunately...
     typename DoFHandler<dim,spacedim>::cell_iterator
-      c1 = t1.begin(),
-      c2 = t2.begin();
+    c1 = t1.begin(),
+    c2 = t2.begin();
     for (; (c1 != t1.end()) && (c2 != t2.end()); ++c1, ++c2)
       {
-       for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
-         {
-           if (c1->vertex(v) != c2->vertex(v))
-             return false;
-           if (c1->vertex_index(v) != c2->vertex_index(v))
-             return false;
-         }
-
-       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
-         {
-           if (c1->face(f)->at_boundary() != c2->face(f)->at_boundary())
-             return false;
-
-           if (c1->face(f)->at_boundary())
-             {
-               if (c1->face(f)->boundary_indicator() !=
-                   c2->face(f)->boundary_indicator())
-                 return false;
-             }
-           else
-             {
-               if (c1->neighbor(f)->level() != c2->neighbor(f)->level())
-                 return false;
-               if (c1->neighbor(f)->index() != c2->neighbor(f)->index())
-                 return false;
-             }
-         }
-
-       if (c1->active() && c2->active()
-           && (c1->subdomain_id() != c2->subdomain_id()))
-         return false;
-
-       if (c1->material_id() != c2->material_id())
-         return false;
-
-       if (c1->user_index() != c2->user_index())
-         return false;
-
-       if (c1->user_flag_set() != c2->user_flag_set())
-         return false;
-
-       if (c1->get_fe().get_name() != c2->get_fe().get_name())
-         return false;
-
-       if (c1->active_fe_index() != c2->active_fe_index())
-         return false;
-
-                                        // compare dofs on this cell and then on the faces
-       if (c1->has_children() == false)
-         {
-           std::vector<types::global_dof_index> local_dofs_1 (c1->get_fe().dofs_per_cell);
-           std::vector<types::global_dof_index> local_dofs_2 (c2->get_fe().dofs_per_cell);
-
-           c1->get_dof_indices (local_dofs_1);
-           c2->get_dof_indices (local_dofs_2);
-           if (local_dofs_1 != local_dofs_2)
-             return false;
-
-           for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
-             {
-               std::vector<types::global_dof_index> local_dofs_1 (c1->get_fe().dofs_per_face);
-               std::vector<types::global_dof_index> local_dofs_2 (c2->get_fe().dofs_per_face);
-
-               c1->face(f)->get_dof_indices (local_dofs_1);
-               c2->face(f)->get_dof_indices (local_dofs_2);
-               if (local_dofs_1 != local_dofs_2)
-                 return false;
-             }
-         }
+        for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
+          {
+            if (c1->vertex(v) != c2->vertex(v))
+              return false;
+            if (c1->vertex_index(v) != c2->vertex_index(v))
+              return false;
+          }
+
+        for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+          {
+            if (c1->face(f)->at_boundary() != c2->face(f)->at_boundary())
+              return false;
+
+            if (c1->face(f)->at_boundary())
+              {
+                if (c1->face(f)->boundary_indicator() !=
+                    c2->face(f)->boundary_indicator())
+                  return false;
+              }
+            else
+              {
+                if (c1->neighbor(f)->level() != c2->neighbor(f)->level())
+                  return false;
+                if (c1->neighbor(f)->index() != c2->neighbor(f)->index())
+                  return false;
+              }
+          }
+
+        if (c1->active() && c2->active()
+            && (c1->subdomain_id() != c2->subdomain_id()))
+          return false;
+
+        if (c1->material_id() != c2->material_id())
+          return false;
+
+        if (c1->user_index() != c2->user_index())
+          return false;
+
+        if (c1->user_flag_set() != c2->user_flag_set())
+          return false;
+
+        if (c1->get_fe().get_name() != c2->get_fe().get_name())
+          return false;
+
+        if (c1->active_fe_index() != c2->active_fe_index())
+          return false;
+
+        // compare dofs on this cell and then on the faces
+        if (c1->has_children() == false)
+          {
+            std::vector<types::global_dof_index> local_dofs_1 (c1->get_fe().dofs_per_cell);
+            std::vector<types::global_dof_index> local_dofs_2 (c2->get_fe().dofs_per_cell);
+
+            c1->get_dof_indices (local_dofs_1);
+            c2->get_dof_indices (local_dofs_2);
+            if (local_dofs_1 != local_dofs_2)
+              return false;
+
+            for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+              {
+                std::vector<types::global_dof_index> local_dofs_1 (c1->get_fe().dofs_per_face);
+                std::vector<types::global_dof_index> local_dofs_2 (c2->get_fe().dofs_per_face);
+
+                c1->face(f)->get_dof_indices (local_dofs_1);
+                c2->face(f)->get_dof_indices (local_dofs_2);
+                if (local_dofs_1 != local_dofs_2)
+                  return false;
+              }
+          }
       }
 
-                                    // also check the order of raw iterators as they contain
-                                    // something about the history of the triangulation
+    // also check the order of raw iterators as they contain
+    // something about the history of the triangulation
     typename DoFHandler<dim,spacedim>::cell_iterator
-      r1 = t1.begin(),
-      r2 = t2.begin();
+    r1 = t1.begin(),
+    r2 = t2.begin();
     for (; (r1 != t1.end()) && (r2 != t2.end()); ++r1, ++r2)
       {
-       if (r1->level() != r2->level())
-         return false;
-       if (r1->index() != r2->index())
-         return false;
+        if (r1->level() != r2->level())
+          return false;
+        if (r1->index() != r2->index())
+          return false;
       }
 
     return true;
@@ -133,11 +133,11 @@ template <int dim, int spacedim>
 void do_boundary (Triangulation<dim,spacedim> &t1)
 {
   typename Triangulation<dim,spacedim>::cell_iterator
-    c1 = t1.begin();
+  c1 = t1.begin();
   for (; c1 != t1.end(); ++c1)
     for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
       if (c1->at_boundary(f))
-       c1->face(f)->set_boundary_indicator (42);
+        c1->face(f)->set_boundary_indicator (42);
 }
 
 
@@ -162,7 +162,7 @@ void test ()
   do_boundary (tria);
 
   FESystem<dim,spacedim> fe (FE_Q<dim,spacedim>(2),dim,
-                            FE_Q<dim,spacedim>(1),1);
+                             FE_Q<dim,spacedim>(1),1);
 
   DoFHandler<dim,spacedim> dof_1 (tria);
   DoFHandler<dim,spacedim> dof_2 (tria);
index d1fc6fecd7055ccf10453dac609956d5fc9e6245..1203d69bcb2fe072655d95da589b4ff27c45bd54 100644 (file)
@@ -28,93 +28,93 @@ void test ()
 {
   ParameterHandler prm1;
   prm1.declare_entry ("int1",
-                    "1",
-                    Patterns::Integer(),
-                    "doc 1");
+                      "1",
+                      Patterns::Integer(),
+                      "doc 1");
   prm1.declare_entry ("int2",
-                    "2",
-                    Patterns::Integer(),
-                    "doc 2");
+                      "2",
+                      Patterns::Integer(),
+                      "doc 2");
   prm1.enter_subsection ("ss1");
   {
     prm1.declare_entry ("double 1",
-                      "1.234",
-                      Patterns::Double(),
-                      "doc 3");
+                        "1.234",
+                        Patterns::Double(),
+                        "doc 3");
 
     prm1.enter_subsection ("ss2");
     {
       prm1.declare_entry ("double 2",
-                        "4.321",
-                        Patterns::Double(),
-                        "doc 4");
+                          "4.321",
+                          Patterns::Double(),
+                          "doc 4");
     }
     prm1.leave_subsection ();
   }
   prm1.leave_subsection ();
 
-                                  // things with strange characters
+  // things with strange characters
   prm1.enter_subsection ("Testing%testing");
   {
     prm1.declare_entry ("string&list",
-                      "< & > ; /",
-                      Patterns::Anything(),
-                      "docs 1");
+                        "< & > ; /",
+                        Patterns::Anything(),
+                        "docs 1");
     prm1.declare_entry ("int*int",
-                      "2",
-                      Patterns::Integer());
+                        "2",
+                        Patterns::Integer());
     prm1.declare_entry ("double+double",
-                      "6.1415926",
-                      Patterns::Double(),
-                      "docs 3");
+                        "6.1415926",
+                        Patterns::Double(),
+                        "docs 3");
   }
   prm1.leave_subsection ();
-  
+
   ParameterHandler prm2;
   prm2.enter_subsection ("s234s1");
   {
     prm2.declare_entry ("dummy 1",
-                      "19.4",
-                      Patterns::Double(),
-                      "paper 4");
+                        "19.4",
+                        Patterns::Double(),
+                        "paper 4");
 
     prm2.enter_subsection ("s2skjds2");
     {
       prm2.declare_entry ("var 2",
-                        "6.321",
-                        Patterns::Double(),
-                        "invalid");
+                          "6.321",
+                          Patterns::Double(),
+                          "invalid");
     }
     prm2.leave_subsection ();
   }
   prm2.leave_subsection ();
 
-                                  // things with strange characters
+  // things with strange characters
   prm2.enter_subsection ("Testing%testing");
   {
     prm2.declare_entry ("int*int",
-                      "2",
-                      Patterns::Integer());
+                        "2",
+                        Patterns::Integer());
     prm2.declare_entry ("string&list",
-                      "< & > ; /",
-                      Patterns::Anything(),
-                      "docs 1");
+                        "< & > ; /",
+                        Patterns::Anything(),
+                        "docs 1");
   }
   prm2.leave_subsection ();
 
   prm2.declare_entry ("int1",
-                    "1.",
-                    Patterns::Double(),
-                    "doc 1");
+                      "1.",
+                      Patterns::Double(),
+                      "doc 1");
   prm2.declare_entry ("int2",
-                    "2",
-                    Patterns::Anything(),
-                    "doc 2");  
-                    
+                      "2",
+                      Patterns::Anything(),
+                      "doc 2");
+
   ParameterHandler prm3;
 
   verify (prm1, prm2);
-  
+
   verify (prm1, prm3);
 }
 
index 2c1b4c3da750bb1b80a9d3d91ba52e361b429643..52a1da4ad15272e83765dd9bda5d4660c9a27f24 100644 (file)
@@ -26,39 +26,39 @@ int object_number = 1;
 
 class C
 {
-  public:
-    C ()
-      {
-       object_number = ::object_number++;
-       deallog << "Default constructor. Object number "
-               << object_number
-               << std::endl;
-      }
-
-    C (const C&)
-      {
-       object_number = ::object_number++;
-       deallog << "copy constructor. Object number "
-               << object_number
-               << std::endl;
-      }
-
-    template <typename Archive>
-    void serialize (Archive &ar, const unsigned int version)
-      {
-       deallog << "Serializing object number "
-               << object_number
-               << " via " << typeid(Archive).name()
-               << std::endl;
-      }
-
-    bool operator == (const C &) const
-      {
-       return true;
-      }
-
-  private:
-    unsigned int object_number;
+public:
+  C ()
+  {
+    object_number = ::object_number++;
+    deallog << "Default constructor. Object number "
+            << object_number
+            << std::endl;
+  }
+
+  C (const C &)
+  {
+    object_number = ::object_number++;
+    deallog << "copy constructor. Object number "
+            << object_number
+            << std::endl;
+  }
+
+  template <typename Archive>
+  void serialize (Archive &ar, const unsigned int version)
+  {
+    deallog << "Serializing object number "
+            << object_number
+            << " via " << typeid(Archive).name()
+            << std::endl;
+  }
+
+  bool operator == (const C &) const
+  {
+    return true;
+  }
+
+private:
+  unsigned int object_number;
 };
 
 
@@ -66,12 +66,12 @@ void test ()
 {
   C *p1 = new C();
   C *p2;
-  
+
   verify (p1, p2);
 
-                                  // p2 should have been created, and should
-                                  // have been different from the address of
-                                  // p1
+  // p2 should have been created, and should
+  // have been different from the address of
+  // p1
   Assert (p2 != 0, ExcInternalError());
   Assert (p1 != p2, ExcInternalError());
 
index 5f642b8b615c0b75b54994d17b4f52a869601c66..2307043c863bdf12eb7b3f331648e88740670bca 100644 (file)
@@ -31,47 +31,47 @@ int objects_destroyed = 0;
 
 class C
 {
-  public:
-    C ()
-      {
-       object_number = ::object_number++;
-       deallog << "Default constructor. Object number "
-               << object_number
-               << std::endl;
-      }
-
-    C (const C&)
-      {
-       object_number = ::object_number++;
-       deallog << "copy constructor. Object number "
-               << object_number
-               << std::endl;
-      }
-
-    ~C ()
-      {
-       deallog << "destructor. Object number "
-               << object_number
-               << std::endl;
-       ++objects_destroyed;
-      }
-    
-    template <typename Archive>
-    void serialize (Archive &ar, const unsigned int version)
-      {
-       deallog << "Serializing object number "
-               << object_number
-               << " via " << typeid(Archive).name()
-               << std::endl;
-      }
-
-    bool operator == (const C &) const
-      {
-       return true;
-      }
-
-  private:
-    unsigned int object_number;
+public:
+  C ()
+  {
+    object_number = ::object_number++;
+    deallog << "Default constructor. Object number "
+            << object_number
+            << std::endl;
+  }
+
+  C (const C &)
+  {
+    object_number = ::object_number++;
+    deallog << "copy constructor. Object number "
+            << object_number
+            << std::endl;
+  }
+
+  ~C ()
+  {
+    deallog << "destructor. Object number "
+            << object_number
+            << std::endl;
+    ++objects_destroyed;
+  }
+
+  template <typename Archive>
+  void serialize (Archive &ar, const unsigned int version)
+  {
+    deallog << "Serializing object number "
+            << object_number
+            << " via " << typeid(Archive).name()
+            << std::endl;
+  }
+
+  bool operator == (const C &) const
+  {
+    return true;
+  }
+
+private:
+  unsigned int object_number;
 };
 
 
@@ -80,7 +80,7 @@ void test ()
   {
     C *p1 = new C();
     C *p2 = new C();
-  
+
     verify (p1, p2);
 
     Assert (p1 != p2, ExcInternalError());
@@ -89,10 +89,10 @@ void test ()
     delete p2;
   }
 
-                                  // as mentioned above, p2 is overwritten by
-                                  // a pointer to a new object, leaving the
-                                  // original object pointed to as a memory
-                                  // leak. assert that this behavior persists
+  // as mentioned above, p2 is overwritten by
+  // a pointer to a new object, leaving the
+  // original object pointed to as a memory
+  // leak. assert that this behavior persists
   Assert (objects_destroyed == 2, ExcInternalError());
 }
 
index 5860c935d9b91ad6d3ba218876003e5c7dbf6684..5d792daf395e60c7855d2cd5ddec9a144d034d2c 100644 (file)
@@ -27,52 +27,52 @@ int object_number = 1;
 
 class C
 {
-  public:
-    C ()
-      {
-       object_number = ::object_number++;
-       deallog << "Default constructor. Object number "
-               << object_number
-               << std::endl;
-      }
-
-    C (const C&)
-      {
-       object_number = ::object_number++;
-       deallog << "copy constructor. Object number "
-               << object_number
-               << std::endl;
-      }
-
-    ~C ()
-      {
-       deallog << "destructor. Object number "
-               << object_number
-               << std::endl;
-      }
-    
-    template <typename Archive>
-    void serialize (Archive &ar, const unsigned int version)
-      {
-       deallog << "Serializing object number "
-               << object_number
-               << " via " << typeid(Archive).name()
-               << std::endl;
-      }
-
-    bool operator == (const C &) const
-      {
-       return true;
-      }
-
-  private:
-    unsigned int object_number;
+public:
+  C ()
+  {
+    object_number = ::object_number++;
+    deallog << "Default constructor. Object number "
+            << object_number
+            << std::endl;
+  }
+
+  C (const C &)
+  {
+    object_number = ::object_number++;
+    deallog << "copy constructor. Object number "
+            << object_number
+            << std::endl;
+  }
+
+  ~C ()
+  {
+    deallog << "destructor. Object number "
+            << object_number
+            << std::endl;
+  }
+
+  template <typename Archive>
+  void serialize (Archive &ar, const unsigned int version)
+  {
+    deallog << "Serializing object number "
+            << object_number
+            << " via " << typeid(Archive).name()
+            << std::endl;
+  }
+
+  bool operator == (const C &) const
+  {
+    return true;
+  }
+
+private:
+  unsigned int object_number;
 };
 
 
 template <typename T>
-bool compare (const std::pair<T*,T*> &t1,
-             const std::pair<T*,T*> &t2)
+bool compare (const std::pair<T *,T *> &t1,
+              const std::pair<T *,T *> &t2)
 {
   return (*t1.first == *t2.first) && (*t1.second == *t2.second);
 }
@@ -82,24 +82,24 @@ void test ()
 {
   {
     C *p = new C();
-    std::pair<C*,C*> pair_1(p, p);
-    std::pair<C*,C*> pair_2;
-  
+    std::pair<C *,C *> pair_1(p, p);
+    std::pair<C *,C *> pair_2;
+
     verify (pair_1, pair_2);
 
-                                    // boost::serialize should have
-                                    // recognized that the two pointers in
-                                    // pair_1 point to the same object and
-                                    // consequently re-create only one object
-                                    // that the two components of the
-                                    // re-created pair point to
+    // boost::serialize should have
+    // recognized that the two pointers in
+    // pair_1 point to the same object and
+    // consequently re-create only one object
+    // that the two components of the
+    // re-created pair point to
     Assert (pair_2.first == pair_2.second, ExcInternalError());
     Assert (object_number == 3, ExcInternalError());
 
-                                    // destroy the newly created object. this
-                                    // must succeed
+    // destroy the newly created object. this
+    // must succeed
     delete pair_2.first;
-    
+
     delete p;
   }
 }
index 2f7c8cc6c62b16d5477dcb3b19d6f4bcbe21f5ba..af662e3c5203b048e3fe1c966260ce0e0fb12899 100644 (file)
@@ -31,52 +31,52 @@ int object_number = 1;
 
 class C
 {
-  public:
-    C ()
-      {
-       object_number = ::object_number++;
-       deallog << "Default constructor. Object number "
-               << object_number
-               << std::endl;
-      }
-
-    C (const C&)
-      {
-       object_number = ::object_number++;
-       deallog << "copy constructor. Object number "
-               << object_number
-               << std::endl;
-      }
-
-    ~C ()
-      {
-       deallog << "destructor. Object number "
-               << object_number
-               << std::endl;
-      }
-    
-    template <typename Archive>
-    void serialize (Archive &ar, const unsigned int version)
-      {
-       deallog << "Serializing object number "
-               << object_number
-               << " via " << typeid(Archive).name()
-               << std::endl;
-      }
-
-    bool operator == (const C &) const
-      {
-       return true;
-      }
-
-  private:
-    unsigned int object_number;
+public:
+  C ()
+  {
+    object_number = ::object_number++;
+    deallog << "Default constructor. Object number "
+            << object_number
+            << std::endl;
+  }
+
+  C (const C &)
+  {
+    object_number = ::object_number++;
+    deallog << "copy constructor. Object number "
+            << object_number
+            << std::endl;
+  }
+
+  ~C ()
+  {
+    deallog << "destructor. Object number "
+            << object_number
+            << std::endl;
+  }
+
+  template <typename Archive>
+  void serialize (Archive &ar, const unsigned int version)
+  {
+    deallog << "Serializing object number "
+            << object_number
+            << " via " << typeid(Archive).name()
+            << std::endl;
+  }
+
+  bool operator == (const C &) const
+  {
+    return true;
+  }
+
+private:
+  unsigned int object_number;
 };
 
 
 template <typename T>
-bool compare (const std::pair<T*,T*> &t1,
-             const std::pair<T*,T*> &t2)
+bool compare (const std::pair<T *,T *> &t1,
+              const std::pair<T *,T *> &t2)
 {
   return (*t1.first == *t2.first) && (*t1.second == *t2.second);
 }
@@ -86,25 +86,25 @@ void test ()
 {
   {
     C c;
-    std::pair<C*,C*> pair_1 (&c, &c);
-    std::pair<C*,C*> pair_2;
-  
+    std::pair<C *,C *> pair_1 (&c, &c);
+    std::pair<C *,C *> pair_2;
+
     verify (pair_1, pair_2);
 
-                                    // boost::serialize should have
-                                    // recognized that the two pointers in
-                                    // pair_1 point to the same object and
-                                    // consequently re-create only one object
-                                    // that the two components of the
-                                    // re-created pair point to
+    // boost::serialize should have
+    // recognized that the two pointers in
+    // pair_1 point to the same object and
+    // consequently re-create only one object
+    // that the two components of the
+    // re-created pair point to
     Assert (pair_2.first == pair_2.second, ExcInternalError());
     Assert (object_number == 3, ExcInternalError());
 
-                                    // destroy the newly created object. this
-                                    // must succeed and would likely throw
-                                    // some sort of error if the object
-                                    // pointed to was on the stack (like 'c')
-                                    // rather than on the heap
+    // destroy the newly created object. this
+    // must succeed and would likely throw
+    // some sort of error if the object
+    // pointed to was on the stack (like 'c')
+    // rather than on the heap
     delete pair_2.first;
   }
 }
index d0d0ebbdb57be94eead0e59288b4556150f0129a..8466e8c94ed7d9bc5a1cfc521e82f92504fe0268 100644 (file)
@@ -29,66 +29,66 @@ int object_number = 1;
 
 class C
 {
-  public:
-    C ()
-      {
-       object_number = ::object_number++;
-       deallog << "Default constructor. Object number "
-               << object_number
-               << std::endl;
-      }
-
-    C (const C&)
-      {
-       object_number = ::object_number++;
-       deallog << "copy constructor. Object number "
-               << object_number
-               << std::endl;
-      }
-
-    ~C ()
-      {
-       deallog << "destructor. Object number "
-               << object_number
-               << std::endl;
-      }
-    
-    template <typename Archive>
-    void serialize (Archive &ar, const unsigned int version)
-      {
-       deallog << "Serializing object number "
-               << object_number
-               << " via " << typeid(Archive).name()
-               << std::endl;
-      }
-
-    bool operator == (const C &) const
-      {
-       return true;
-      }
-
-  private:
-    unsigned int object_number;
+public:
+  C ()
+  {
+    object_number = ::object_number++;
+    deallog << "Default constructor. Object number "
+            << object_number
+            << std::endl;
+  }
+
+  C (const C &)
+  {
+    object_number = ::object_number++;
+    deallog << "copy constructor. Object number "
+            << object_number
+            << std::endl;
+  }
+
+  ~C ()
+  {
+    deallog << "destructor. Object number "
+            << object_number
+            << std::endl;
+  }
+
+  template <typename Archive>
+  void serialize (Archive &ar, const unsigned int version)
+  {
+    deallog << "Serializing object number "
+            << object_number
+            << " via " << typeid(Archive).name()
+            << std::endl;
+  }
+
+  bool operator == (const C &) const
+  {
+    return true;
+  }
+
+private:
+  unsigned int object_number;
 };
 
 
 struct P
 {
-    C *c;
-    template <typename Archive>
-    void serialize (Archive &ar, const unsigned int)
-      {
-       ar & c;
-      }
-
-    bool operator == (const P &p) const
-      {
-                                        // there is no useful operation we
-                                        // can do here for the purposes of
-                                        // serialization. do the actual tests
-                                        // below with assertions
-       return true;
-      }
+  C *c;
+  template <typename Archive>
+  void serialize (Archive &ar, const unsigned int)
+  {
+    ar &c;
+  }
+
+  bool operator == (const P &p) const
+  {
+    // there is no useful operation we
+    // can do here for the purposes of
+    // serialization. do the actual tests
+    // below with assertions
+    return true;
+  }
 };
 
 
@@ -103,23 +103,23 @@ void test ()
 
     pair_2.first.c = 0;
     pair_2.second.c = 0;
-  
+
     verify (pair_1, pair_2);
 
-                                    // boost::serialize should have
-                                    // recognized that the two pointers in
-                                    // pair_1 point to the same object and
-                                    // consequently re-create only one object
-                                    // that the two components of the
-                                    // re-created pair point to
+    // boost::serialize should have
+    // recognized that the two pointers in
+    // pair_1 point to the same object and
+    // consequently re-create only one object
+    // that the two components of the
+    // re-created pair point to
     Assert (pair_2.first.c == pair_2.second.c, ExcInternalError());
     Assert (object_number == 3, ExcInternalError());
 
-                                    // destroy the newly created object. this
-                                    // must succeed and would likely throw
-                                    // some sort of error if the object
-                                    // pointed to was on the stack (like 'c')
-                                    // rather than on the heap
+    // destroy the newly created object. this
+    // must succeed and would likely throw
+    // some sort of error if the object
+    // pointed to was on the stack (like 'c')
+    // rather than on the heap
     delete pair_2.first.c;
     delete c;
   }
index 9b5463c4ffd891660d7bc3c04d8c2dec8e5bcbb4..9981823c861c6b15145225d1158a7766898f83c8 100644 (file)
@@ -26,18 +26,18 @@ void test ()
 {
   double c1[3] = {1., 2., 3.};
   std::vector<double> coefficients1(c1, &c1[3]);
-  
+
   Polynomials::Polynomial<double> p1(coefficients1);
 
   double c2[3] = {4., 5., 6.};
   std::vector<double> coefficients2(c2, &c2[3]);
-  
+
   Polynomials::Polynomial<double> p2(coefficients2);
-  
+
   Polynomials::Polynomial<double> p3;
 
   verify (p1, p2);
-  
+
   verify (p1, p3);
 }
 
index 05e4526164f65f76123c0e80d9421015cb9a1ecc..58d5c9f60a341ae8c34eb7ea333759ec7becfafc 100644 (file)
 
 void test ()
 {
-  unsigned int degree1 = 3; 
+  unsigned int degree1 = 3;
   Polynomials::Hierarchical p1(degree1);
-  
+
   unsigned int degree2 = 7;
   Polynomials::Hierarchical p2(degree2);
-  
+
   verify (p1, p2);
 }
 
index 9e0d17019c4ba468c81b1c3ea5b90dbb9a5de357..262a956890f11b98e158eeb8ccc44ee541356876 100644 (file)
@@ -29,13 +29,13 @@ void test ()
   unsigned int support_point1 = 1;
   QGaussLobatto<1> quad1 (n1+1);
   Polynomials::Polynomial<double> p1 = Polynomials::
-    generate_complete_Lagrange_basis (quad1.get_points())[support_point1];
+                                       generate_complete_Lagrange_basis (quad1.get_points())[support_point1];
 
   unsigned int n2 = 4;
   unsigned int support_point2 = 2;
   QGaussLobatto<1> quad2 (n2+1);
   Polynomials::Polynomial<double> p2 = Polynomials::
-    generate_complete_Lagrange_basis (quad2.get_points())[support_point2];
+                                       generate_complete_Lagrange_basis (quad2.get_points())[support_point2];
 
   verify (p1, p2);
 }
index dac5cf9f534b150cd0993ea9bd945eca97e74758..2e3d5198159f7cc466e5da07519b212259369f8d 100644 (file)
@@ -26,12 +26,12 @@ void test ()
 {
   unsigned int n1 = 3;
   double coefficient1 = 5.;
-  
+
   Polynomials::Monomial<double> m1(n1, coefficient1);
 
   unsigned int n2 = 3;
   double coefficient2 = 2.;
-  
+
   Polynomials::Monomial<double> m2(n2, coefficient2);
 
   verify (m1, m2);
index 212bf36f7d41b755b8e92f95ae7b99070a0cbcda..7533277e9b7c04f531db9b3b4cef9c9c56aebbd7 100644 (file)
 void test ()
 {
   const unsigned int dim = 2;
-  
+
   std::vector<Point <dim> > points1;
   points1.push_back(Point<dim>(0,0));
   points1.push_back(Point<dim>(0,1));
   points1.push_back(Point<dim>(1,1));
   points1.push_back(Point<dim>(1,0));
-  
+
   double w1[4] = {0.20, 0.30, 0.15, 0.35};
   std::vector<double> weights1(w1, &w1[4]);
-  
+
   Quadrature<dim> q1(points1, weights1);
 
   std::vector<Point <dim> > points2;
@@ -41,16 +41,16 @@ void test ()
   points2.push_back(Point<dim>(1,0));
   points2.push_back(Point<dim>(0,0));
   points2.push_back(Point<dim>(0,1));
-  
+
   double w2[4] = {0.1, 0.2, 0.3, 0.4};
   std::vector<double> weights2(w2, &w2[4]);
-  
+
   Quadrature<dim> q2(points2, weights2);
-  
+
   Quadrature<dim> q3;
 
   verify (q1, q2);
-  
+
   verify (q1, q3);
 }
 
index e91e134dcefb2ff6bda24c22560748fdfc461d9f..1a297e3154dacc932971e5d60336da07ee185751 100644 (file)
 #include <boost/serialization/vector.hpp>
 
 void test ()
-{ 
+{
   const unsigned int dim = 2;
-  
+
   std::vector<Point <1> > points1;
   points1.push_back(Point<1>(0.));
   points1.push_back(Point<1>(1.));
   double w1[2] = {0.5, 0.5};
   std::vector<double> weights1(w1, &w1[2]);
-  
+
   std::vector<Point <1> > points2;
   points2.push_back(Point<1>(0.25));
   points2.push_back(Point<1>(0.75));
-  double w2[2] = {0.4, 0.6}; 
+  double w2[2] = {0.4, 0.6};
   std::vector<double> weights2(w2, &w2[2]);
-  
+
   Quadrature<1> qx(points1, weights1);
   Quadrature<1> qy(points2, weights2);
-  
+
   QAnisotropic<dim> q1(qx, qy);
-   
+
   QAnisotropic<dim> q2(qy, qx);
 
   verify (q1, q2);
index ca2be705491c34c636ed899fd22569239d01007b..095f85f29c3021ff5f5c9d794bad1bfd152dbe3e 100644 (file)
 #include <boost/serialization/vector.hpp>
 
 void test ()
-{ 
+{
   const unsigned int dim = 2;
   unsigned int n_copies = 3;
-  
+
   std::vector<Point <1> > points1;
   points1.push_back(Point<1>(0.));
   points1.push_back(Point<1>(1.));
   double w1[2] = {0.5, 0.5};
   std::vector<double> weights1(w1, &w1[2]);
-  
+
   std::vector<Point <1> > points2;
   points2.push_back(Point<1>(0.25));
   points2.push_back(Point<1>(0.75));
-  double w2[2] = {0.4, 0.6}; 
+  double w2[2] = {0.4, 0.6};
   std::vector<double> weights2(w2, &w2[2]);
-  
+
   Quadrature<1> qx(points1, weights1);
   Quadrature<1> qy(points2, weights2);
-  
+
   QIterated<dim> q1(qx, n_copies);
-   
+
   QIterated<dim> q2(qy, n_copies);
 
   verify (q1, q2);
index 7eb91029afb3d2bd070feee53881b69fc9519923..c70c2e7a3454a1efc97e019b3f3da138635a887a 100644 (file)
 // pointed to
 template <typename T>
 bool compare (const T &t1,
-             const T &t2)
+              const T &t2)
 {
   return t1 == t2;
 }
 
 template <typename T>
 bool compare (T *t1,
-             T *t2)
+              T *t2)
 {
   return *t1 == *t2;
 }
@@ -41,20 +41,20 @@ bool compare (T *t1,
 
 template <typename T>
 void verify (const T &t1,
-            T       &t2)
+             T       &t2)
 {
-                                  // save data to archive
+  // save data to archive
   std::ostringstream oss;
   {
     boost::archive::text_oarchive oa(oss);
     oa << t1;
-                                    // archive and stream closed when
-                                    // destructors are called
+    // archive and stream closed when
+    // destructors are called
   }
   deallog << oss.str() << std::endl;
 
-                                  // verify correctness of the
-                                  // serialization
+  // verify correctness of the
+  // serialization
   {
     std::istringstream  iss(oss.str());
     boost::archive::text_iarchive ia(iss);
index 573afd8a1e11115d0c4373a1b8d55c9d0911ac57..484495a1be14d9a0cabe535fad25714829115bf6 100644 (file)
@@ -28,16 +28,16 @@ void test ()
   SparsityPattern sp1((N1-1)*(N1-1), (N1-1)*(N1-1), 5);
   FDMatrix(N1,N1).five_point_structure (sp1);
   sp1.compress ();
+
   const unsigned int N2 = 3;
   SparsityPattern sp2((N2-1)*(N2-1), (N2-1)*(N2-1), 5);
   FDMatrix(N2,N2).five_point_structure (sp2);
   sp2.compress ();
 
   SparsityPattern sp3;
-  
+
   verify (sp1, sp2);
-  
+
   verify (sp1, sp3);
 }
 
index 91db2663b71561b53cf58b1efaee10eb9bc12447..0c8e6d8b9927ba3d41057cc255a177679105c96c 100644 (file)
@@ -27,16 +27,16 @@ void test ()
   const unsigned int rank=2;
 
   double a1[3][3] = {{1., 2., 3.},
-                     {2., 5., 6.},
-                     {3., 6., 9.}
-                    };
+    {2., 5., 6.},
+    {3., 6., 9.}
+  };
   SymmetricTensor<rank,dim> t1(a1);
-  
+
 
   double a2[3][3] = {{10., 11., 12.},
-                     {11., 14., 15.},
-                     {12., 15., 18.}
-                    };
+    {11., 14., 15.},
+    {12., 15., 18.}
+  };
   SymmetricTensor<rank,dim> t2(a2);
 
   verify (t1, t2);
index 4e72f06b16a1687f1f363f6699bd2468b60c7517..9595034076b6030ecadddc42fea9ed9ed8f52d9b 100644 (file)
 #include <boost/serialization/vector.hpp>
 
 void test ()
-{ 
+{
   unsigned int index1 = 3;
   Table<1, int> t1(index1);
-  
+
   Table<1, int> t2(index1);
 
   unsigned int index3 = 2;
   Table<1, int> t3(index3);
 
   for (unsigned int i = 0; i< index1; i++)
-  {
-    t1[i] = i + 1;
-    t2[i] = i + 1 + index1;
-  }
+    {
+      t1[i] = i + 1;
+      t2[i] = i + 1 + index1;
+    }
   verify (t1, t2);
-  
+
   verify (t1, t3);
 }
 
index aaa68354f43e5099f0f2c082e1d4d9e7721705a5..747f0b21414a1ec9bc60cd0b52c4fc4a7c5d8970 100644 (file)
 
 
 void test ()
-{ 
+{
   unsigned int index1 = 3, index2 = 4;
   TableIndices<2> indices1(index1, index2);
   unsigned int sum_of_indices = index1 + index2;
-  
+
   Table<2, int> t1(index1, index2);
   Table<2, int> t2(index1, index2);
 
-  index1 = 2; index2 = 5;
+  index1 = 2;
+  index2 = 5;
   Table<2, int> t3(index1, index2);
-  
+
   unsigned int counter = 0;
   for (unsigned int i1 = 0; i1 < indices1[0]; ++i1)
-  {
-    for (unsigned int i2 = 0; i2 < indices1[1]; ++i2)
     {
-      t1[i1][i2] = counter ++;
-      t2[i1][i2] = counter + sum_of_indices;
+      for (unsigned int i2 = 0; i2 < indices1[1]; ++i2)
+        {
+          t1[i1][i2] = counter ++;
+          t2[i1][i2] = counter + sum_of_indices;
+        }
     }
-  }
   verify (t1, t2);
-  
+
   verify (t1, t3);
 }
 
index 211f75d18c155b3f1afe1e1fe3f3957bebc494a3..74fa47dad7f7272890b32d65391be47a448a2aa1 100644 (file)
 
 
 void test ()
-{ 
+{
   unsigned int index1 = 3, index2 = 4, index3 = 2;
   TableIndices<3> indices1(index1, index2, index3);
   unsigned int sum_of_indices = index1 + index2 + index3;
-  
+
   Table<3, int> t1(index1, index2, index3);
   Table<3, int> t2(index1, index2, index3);
 
-  index1 = 2; index2 = 5; index3 = 4;
+  index1 = 2;
+  index2 = 5;
+  index3 = 4;
   Table<3, int> t3(index1, index2, index3);
-  
+
   unsigned int counter = 0;
   for (unsigned int i1 = 0; i1 < indices1[0]; ++i1)
-  {
-    for (unsigned int i2 = 0; i2 < indices1[1]; ++i2)
     {
-      for (unsigned int i3 = 0; i3 < indices1[2]; ++i3)
-      {
-        t1[i1][i2][i3] = counter ++;
-        t2[i1][i2][i3] = counter + sum_of_indices;
-      }
+      for (unsigned int i2 = 0; i2 < indices1[1]; ++i2)
+        {
+          for (unsigned int i3 = 0; i3 < indices1[2]; ++i3)
+            {
+              t1[i1][i2][i3] = counter ++;
+              t2[i1][i2][i3] = counter + sum_of_indices;
+            }
+        }
     }
-  }
-  
+
   verify (t1, t2);
-  
+
   verify (t1, t3);
 }
 
index dd156828dbc27c869a1ef914c8a935d49bedce7f..d73e8dd9f2f3d497be890ae38d677b6bffd05124 100644 (file)
 
 
 void test ()
-{ 
+{
   unsigned int index1 = 3, index2 = 4, index3 = 2, index4 = 5;
   TableIndices<4> indices1(index1, index2, index3, index4);
   unsigned int sum_of_indices = index1 + index2 + index3 + index4;
-  
+
   Table<4, int> t1(index1, index2, index3, index4);
   Table<4, int> t2(index1, index2, index3, index4);
 
-  index1 = 2; index2 = 5; index3 = 4; index4 = 1;
+  index1 = 2;
+  index2 = 5;
+  index3 = 4;
+  index4 = 1;
   Table<4, int> t3(index1, index2, index3, index4);
-  
+
   unsigned int counter = 0;
   for (unsigned int i1 = 0; i1 < indices1[0]; ++i1)
-  {
-    for (unsigned int i2 = 0; i2 < indices1[1]; ++i2)
     {
-      for (unsigned int i3 = 0; i3 < indices1[2]; ++i3)
-      {
-        for (unsigned int i4 = 0; i4 < indices1[3]; ++i4)
+      for (unsigned int i2 = 0; i2 < indices1[1]; ++i2)
         {
-          t1[i1][i2][i3][i4] = counter ++;
-          t2[i1][i2][i3][i4] = counter + sum_of_indices;
+          for (unsigned int i3 = 0; i3 < indices1[2]; ++i3)
+            {
+              for (unsigned int i4 = 0; i4 < indices1[3]; ++i4)
+                {
+                  t1[i1][i2][i3][i4] = counter ++;
+                  t2[i1][i2][i3][i4] = counter + sum_of_indices;
+                }
+            }
         }
-      }
     }
-  }
-  
+
   verify (t1, t2);
-  
+
   verify (t1, t3);
 }
 
index 933872d64adf0e27d83be3749ca038cd1cef4523..10d475b64093c92373a9b497b74f867d59bd29b3 100644 (file)
 #include <boost/serialization/vector.hpp>
 
 void test ()
-{ 
+{
   unsigned int index1 = 3, index2 = 4, index3 = 2, index4 = 5, index5 = 1;
   TableIndices<5> indices1(index1, index2, index3, index4, index5);
   unsigned int sum_of_indices = index1 + index2 + index3 + index4 + index5;
-  
+
   Table<5, int> t1(index1, index2, index3, index4, index5);
   Table<5, int> t2(index1, index2, index3, index4, index5);
 
-  index1 = 2; index2 = 5; index3 = 4; index4 = 1; index5 = 5;
+  index1 = 2;
+  index2 = 5;
+  index3 = 4;
+  index4 = 1;
+  index5 = 5;
   Table<5, int> t3(index1, index2, index3, index4, index5);
-  
+
   unsigned int counter = 0;
   for (unsigned int i1 = 0; i1 < indices1[0]; ++i1)
-  {
-    for (unsigned int i2 = 0; i2 < indices1[1]; ++i2)
     {
-      for (unsigned int i3 = 0; i3 < indices1[2]; ++i3)
-      {
-        for (unsigned int i4 = 0; i4 < indices1[3]; ++i4)
+      for (unsigned int i2 = 0; i2 < indices1[1]; ++i2)
         {
-          for (unsigned int i5 = 0; i5 < indices1[4]; ++i5)
-          {
-            t1[i1][i2][i3][i4][i5] = counter ++;
-            t2[i1][i2][i3][i4][i5] = counter + sum_of_indices;
-          }
+          for (unsigned int i3 = 0; i3 < indices1[2]; ++i3)
+            {
+              for (unsigned int i4 = 0; i4 < indices1[3]; ++i4)
+                {
+                  for (unsigned int i5 = 0; i5 < indices1[4]; ++i5)
+                    {
+                      t1[i1][i2][i3][i4][i5] = counter ++;
+                      t2[i1][i2][i3][i4][i5] = counter + sum_of_indices;
+                    }
+                }
+            }
         }
-      }
     }
-  }
-  
+
   verify (t1, t2);
-  
+
   verify (t1, t3);
 }
 
index 090e6d765299ad0683a4bb373230a50856ccf094..1c74b8e0be45945fba781989d18152f9d5e93030 100644 (file)
 
 
 void test ()
-{ 
+{
   unsigned int index1 = 3, index2 = 4, index3 = 2, index4 = 5, index5 = 1,
                index6 = 7;
   TableIndices<6> indices1(index1, index2, index3, index4, index5, index6);
   unsigned int sum_of_indices = index1 + index2 + index3 + index4 + index5
                                 + index6;
-  
+
   Table<6, int> t1(index1, index2, index3, index4, index5, index6);
   Table<6, int> t2(index1, index2, index3, index4, index5, index6);
 
-  index1 = 2; index2 = 5; index3 = 4; index4 = 1; index5 = 5; index6 = 8;
+  index1 = 2;
+  index2 = 5;
+  index3 = 4;
+  index4 = 1;
+  index5 = 5;
+  index6 = 8;
   Table<6, int> t3(index1, index2, index3, index4, index5, index6);
-  
+
   unsigned int counter = 0;
   for (unsigned int i1 = 0; i1 < indices1[0]; ++i1)
-  {
-    for (unsigned int i2 = 0; i2 < indices1[1]; ++i2)
     {
-      for (unsigned int i3 = 0; i3 < indices1[2]; ++i3)
-      {
-        for (unsigned int i4 = 0; i4 < indices1[3]; ++i4)
+      for (unsigned int i2 = 0; i2 < indices1[1]; ++i2)
         {
-          for (unsigned int i5 = 0; i5 < indices1[4]; ++i5)
-          {
-            for (unsigned int i6 = 0; i6 < indices1[5]; ++i6)
+          for (unsigned int i3 = 0; i3 < indices1[2]; ++i3)
             {
-              t1[i1][i2][i3][i4][i5][i6] = counter ++;
-              t2[i1][i2][i3][i4][i5][i6] = counter + sum_of_indices;
+              for (unsigned int i4 = 0; i4 < indices1[3]; ++i4)
+                {
+                  for (unsigned int i5 = 0; i5 < indices1[4]; ++i5)
+                    {
+                      for (unsigned int i6 = 0; i6 < indices1[5]; ++i6)
+                        {
+                          t1[i1][i2][i3][i4][i5][i6] = counter ++;
+                          t2[i1][i2][i3][i4][i5][i6] = counter + sum_of_indices;
+                        }
+                    }
+                }
             }
-          }
         }
-      }
     }
-  }
-  
+
   verify (t1, t2);
-  
+
   verify (t1, t3);
 }
 
index d6dad1423b3cdacaa8c696e29f8f0affb9835a24..dfdaaaeecdfbaf6253db8fbcbf053631a5c2b6f2 100644 (file)
 #include <boost/serialization/vector.hpp>
 
 void test ()
-{ 
+{
   unsigned int index1 = 3, index2 = 4, index3 = 2, index4 = 5, index5 = 1,
                index6 = 7, index7 = 6;
   TableIndices<7> indices1(index1, index2, index3, index4, index5, index6, index7);
   unsigned int sum_of_indices = index1 + index2 + index3 + index4 + index5
                                 + index6 + index7;
-  
+
   Table<7, int> t1(index1, index2, index3, index4, index5, index6, index7);
   Table<7, int> t2(index1, index2, index3, index4, index5, index6, index7);
 
-  index1 = 2; index2 = 5; index3 = 4; index4 = 1; index5 = 5; index6 = 8; index7 = 6;
+  index1 = 2;
+  index2 = 5;
+  index3 = 4;
+  index4 = 1;
+  index5 = 5;
+  index6 = 8;
+  index7 = 6;
   Table<7, int> t3(index1, index2, index3, index4, index5, index6, index7);
-  
+
   unsigned int counter = 0;
   for (unsigned int i1 = 0; i1 < indices1[0]; ++i1)
-  {
-    for (unsigned int i2 = 0; i2 < indices1[1]; ++i2)
     {
-      for (unsigned int i3 = 0; i3 < indices1[2]; ++i3)
-      {
-        for (unsigned int i4 = 0; i4 < indices1[3]; ++i4)
+      for (unsigned int i2 = 0; i2 < indices1[1]; ++i2)
         {
-          for (unsigned int i5 = 0; i5 < indices1[4]; ++i5)
-          {
-            for (unsigned int i6 = 0; i6 < indices1[5]; ++i6)
+          for (unsigned int i3 = 0; i3 < indices1[2]; ++i3)
             {
-              for (unsigned int i7 = 0; i7 < indices1[6]; ++i7)
-              {
-                t1[i1][i2][i3][i4][i5][i6][i7] = counter ++;
-                t2[i1][i2][i3][i4][i5][i6][i7] = counter + sum_of_indices;
-              }
+              for (unsigned int i4 = 0; i4 < indices1[3]; ++i4)
+                {
+                  for (unsigned int i5 = 0; i5 < indices1[4]; ++i5)
+                    {
+                      for (unsigned int i6 = 0; i6 < indices1[5]; ++i6)
+                        {
+                          for (unsigned int i7 = 0; i7 < indices1[6]; ++i7)
+                            {
+                              t1[i1][i2][i3][i4][i5][i6][i7] = counter ++;
+                              t2[i1][i2][i3][i4][i5][i6][i7] = counter + sum_of_indices;
+                            }
+                        }
+                    }
+                }
             }
-          }
         }
-      }
     }
-  }
-  
+
   verify (t1, t2);
-  
+
   verify (t1, t3);
 }
 
index de1e29884837227d9ba051cd3450fba600105d68..2e11dda4855993d143febbd1e616f73506e80791 100644 (file)
@@ -24,7 +24,7 @@
 namespace dealii
 {
   bool compare (const TableHandler &t1,
-               const TableHandler &t2)
+                const TableHandler &t2)
   {
     std::ostringstream o1, o2;
     t1.write_tex (o1);
@@ -44,12 +44,12 @@ void test ()
 
 
   for (unsigned int i=0; i<10; ++i)
-  {
-    t1.add_value(keys[(0+i)%4], i);
-    t1.add_value(keys[(1+i)%4], sqrt(i));
-    t1.add_value(keys[(2+i)%4], 'a'+i);
-    t1.add_value(keys[(3+i)%4], std::string("abc-")+"0123456789"[i]);
-  }
+    {
+      t1.add_value(keys[(0+i)%4], i);
+      t1.add_value(keys[(1+i)%4], sqrt(i));
+      t1.add_value(keys[(2+i)%4], 'a'+i);
+      t1.add_value(keys[(3+i)%4], std::string("abc-")+"0123456789"[i]);
+    }
   t1.set_tex_table_caption("This is a caption text with \\LaTeX{} symbols");
 
   verify (t1, t2);
index cbdb7abe03c0c3101212a39c64836a8833d3a1af..4caf7cc783b48f3f15f45f618df754adf387cca6 100644 (file)
@@ -35,15 +35,15 @@ void test ()
   const unsigned int rank=2;
 
   double a1[3][3] = {{1., 2., 3.},
-                     {4., 5., 6.},
-                     {7., 8., 9.}
-                    };
+    {4., 5., 6.},
+    {7., 8., 9.}
+  };
   Tensor<rank,dim> t1(a1);
 
   double a2[3][3] = {{10., 11., 12.},
-                     {13., 14., 15.},
-                     {16., 17., 18.}
-                    };
+    {13., 14., 15.},
+    {16., 17., 18.}
+  };
   Tensor<rank,dim> t2(a2);
 
   verify (t1, t2);
index 99c15e970df44b1172e45f05b46d7f19520f4149..1be9c3bee68dc63ca17ca669e26cf00751cfbe63 100644 (file)
@@ -25,46 +25,46 @@ int object_number = 1;
 
 class C
 {
-  public:
-    C ()
-      {
-       object_number = ::object_number++;
-       deallog << "Default constructor. Object number "
-               << object_number
-               << std::endl;
-      }
-
-    C (const C&)
-      {
-       object_number = ::object_number++;
-       deallog << "copy constructor. Object number "
-               << object_number
-               << std::endl;
-      }
-
-    template <typename Archive>
-    void serialize (Archive &ar, const unsigned int version)
-      {
-       deallog << "Serializing object number "
-               << object_number
-               << " via " << typeid(Archive).name()
-               << std::endl;
-      }
-
-    bool operator == (const C &) const
-      {
-       return true;
-      }
-
-  private:
-    unsigned int object_number;
+public:
+  C ()
+  {
+    object_number = ::object_number++;
+    deallog << "Default constructor. Object number "
+            << object_number
+            << std::endl;
+  }
+
+  C (const C &)
+  {
+    object_number = ::object_number++;
+    deallog << "copy constructor. Object number "
+            << object_number
+            << std::endl;
+  }
+
+  template <typename Archive>
+  void serialize (Archive &ar, const unsigned int version)
+  {
+    deallog << "Serializing object number "
+            << object_number
+            << " via " << typeid(Archive).name()
+            << std::endl;
+  }
+
+  bool operator == (const C &) const
+  {
+    return true;
+  }
+
+private:
+  unsigned int object_number;
 };
 
 
 void test ()
 {
   C p1, p2;
-  
+
   verify (p1, p2);
 }
 
index e0f0eaba0068b3c2b986c8abaf110fe1257b64ff..628c3b9e5450dbc77e1863d9ba9b6d8ef03d9fa4 100644 (file)
@@ -27,10 +27,10 @@ namespace dealii
 {
   template <int dim, int spacedim>
   bool operator == (const Triangulation<dim,spacedim> &t1,
-                   const Triangulation<dim,spacedim> &t2)
+                    const Triangulation<dim,spacedim> &t2)
   {
-                                    // test a few attributes, though we can't
-                                    // test everything unfortunately...
+    // test a few attributes, though we can't
+    // test everything unfortunately...
     if (t1.n_active_cells() != t2.n_active_cells())
       return false;
 
@@ -41,66 +41,66 @@ namespace dealii
       return false;
 
     typename Triangulation<dim,spacedim>::cell_iterator
-      c1 = t1.begin(),
-      c2 = t2.begin();
+    c1 = t1.begin(),
+    c2 = t2.begin();
     for (; (c1 != t1.end()) && (c2 != t2.end()); ++c1, ++c2)
       {
-       for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
-         {
-           if (c1->vertex(v) != c2->vertex(v))
-             return false;
-           if (c1->vertex_index(v) != c2->vertex_index(v))
-             return false;
-         }
-
-       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
-         {
-           if (c1->face(f)->at_boundary() != c2->face(f)->at_boundary())
-             return false;
-
-           if (c1->face(f)->at_boundary())
-             {
-               if (c1->face(f)->boundary_indicator() !=
-                   c2->face(f)->boundary_indicator())
-                 return false;
-             }
-           else
-             {
-               if (c1->neighbor(f)->level() != c2->neighbor(f)->level())
-                 return false;
-               if (c1->neighbor(f)->index() != c2->neighbor(f)->index())
-                 return false;
-             }
-         }
-
-       if (c1->active() && c2->active()
-           && (c1->subdomain_id() != c2->subdomain_id()))
-         return false;
-
-       if (c1->level_subdomain_id() != c2->level_subdomain_id())
-         return false;
-
-       if (c1->material_id() != c2->material_id())
-         return false;
-
-       if (c1->user_index() != c2->user_index())
-         return false;
-
-       if (c1->user_flag_set() != c2->user_flag_set())
-         return false;
+        for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
+          {
+            if (c1->vertex(v) != c2->vertex(v))
+              return false;
+            if (c1->vertex_index(v) != c2->vertex_index(v))
+              return false;
+          }
+
+        for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+          {
+            if (c1->face(f)->at_boundary() != c2->face(f)->at_boundary())
+              return false;
+
+            if (c1->face(f)->at_boundary())
+              {
+                if (c1->face(f)->boundary_indicator() !=
+                    c2->face(f)->boundary_indicator())
+                  return false;
+              }
+            else
+              {
+                if (c1->neighbor(f)->level() != c2->neighbor(f)->level())
+                  return false;
+                if (c1->neighbor(f)->index() != c2->neighbor(f)->index())
+                  return false;
+              }
+          }
+
+        if (c1->active() && c2->active()
+            && (c1->subdomain_id() != c2->subdomain_id()))
+          return false;
+
+        if (c1->level_subdomain_id() != c2->level_subdomain_id())
+          return false;
+
+        if (c1->material_id() != c2->material_id())
+          return false;
+
+        if (c1->user_index() != c2->user_index())
+          return false;
+
+        if (c1->user_flag_set() != c2->user_flag_set())
+          return false;
       }
 
-                                    // also check the order of raw iterators as they contain
-                                    // something about the history of the triangulation
+    // also check the order of raw iterators as they contain
+    // something about the history of the triangulation
     typename Triangulation<dim,spacedim>::cell_iterator
-      r1 = t1.begin(),
-      r2 = t2.begin();
+    r1 = t1.begin(),
+    r2 = t2.begin();
     for (; (r1 != t1.end()) && (r2 != t2.end()); ++r1, ++r2)
       {
-       if (r1->level() != r2->level())
-         return false;
-       if (r1->index() != r2->index())
-         return false;
+        if (r1->level() != r2->level())
+          return false;
+        if (r1->index() != r2->index())
+          return false;
       }
 
     return true;
@@ -112,11 +112,11 @@ template <int dim, int spacedim>
 void do_boundary (Triangulation<dim,spacedim> &t1)
 {
   typename Triangulation<dim,spacedim>::cell_iterator
-    c1 = t1.begin();
+  c1 = t1.begin();
   for (; c1 != t1.end(); ++c1)
     for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
       if (c1->at_boundary(f))
-       c1->face(f)->set_boundary_indicator (42);
+        c1->face(f)->set_boundary_indicator (42);
 }
 
 
index aa8c3e115abcd81d4594a8388c85bd240dafef87..bb5e9067e00d19535fbb000e42e058982a412ac9 100644 (file)
@@ -29,10 +29,10 @@ namespace dealii
 {
   template <int dim, int spacedim>
   bool operator == (const Triangulation<dim,spacedim> &t1,
-                   const Triangulation<dim,spacedim> &t2)
+                    const Triangulation<dim,spacedim> &t2)
   {
-                                    // test a few attributes, though we can't
-                                    // test everything unfortunately...
+    // test a few attributes, though we can't
+    // test everything unfortunately...
     if (t1.n_active_cells() != t2.n_active_cells())
       return false;
 
@@ -43,66 +43,66 @@ namespace dealii
       return false;
 
     typename Triangulation<dim,spacedim>::cell_iterator
-      c1 = t1.begin(),
-      c2 = t2.begin();
+    c1 = t1.begin(),
+    c2 = t2.begin();
     for (; (c1 != t1.end()) && (c2 != t2.end()); ++c1, ++c2)
       {
-       for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
-         {
-           if (c1->vertex(v) != c2->vertex(v))
-             return false;
-           if (c1->vertex_index(v) != c2->vertex_index(v))
-             return false;
-         }
-
-       for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
-         {
-           if (c1->face(f)->at_boundary() != c2->face(f)->at_boundary())
-             return false;
-
-           if (c1->face(f)->at_boundary())
-             {
-               if (c1->face(f)->boundary_indicator() !=
-                   c2->face(f)->boundary_indicator())
-                 return false;
-             }
-           else
-             {
-               if (c1->neighbor(f)->level() != c2->neighbor(f)->level())
-                 return false;
-               if (c1->neighbor(f)->index() != c2->neighbor(f)->index())
-                 return false;
-             }
-         }
-
-       if (c1->active() && c2->active()
-           && (c1->subdomain_id() != c2->subdomain_id()))
-         return false;
-
-       if (c1->level_subdomain_id() != c2->level_subdomain_id())
-         return false;
-
-       if (c1->material_id() != c2->material_id())
-         return false;
-
-       if (c1->user_index() != c2->user_index())
-         return false;
-
-       if (c1->user_flag_set() != c2->user_flag_set())
-         return false;
+        for (unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
+          {
+            if (c1->vertex(v) != c2->vertex(v))
+              return false;
+            if (c1->vertex_index(v) != c2->vertex_index(v))
+              return false;
+          }
+
+        for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+          {
+            if (c1->face(f)->at_boundary() != c2->face(f)->at_boundary())
+              return false;
+
+            if (c1->face(f)->at_boundary())
+              {
+                if (c1->face(f)->boundary_indicator() !=
+                    c2->face(f)->boundary_indicator())
+                  return false;
+              }
+            else
+              {
+                if (c1->neighbor(f)->level() != c2->neighbor(f)->level())
+                  return false;
+                if (c1->neighbor(f)->index() != c2->neighbor(f)->index())
+                  return false;
+              }
+          }
+
+        if (c1->active() && c2->active()
+            && (c1->subdomain_id() != c2->subdomain_id()))
+          return false;
+
+        if (c1->level_subdomain_id() != c2->level_subdomain_id())
+          return false;
+
+        if (c1->material_id() != c2->material_id())
+          return false;
+
+        if (c1->user_index() != c2->user_index())
+          return false;
+
+        if (c1->user_flag_set() != c2->user_flag_set())
+          return false;
       }
 
-                                    // also check the order of raw iterators as they contain
-                                    // something about the history of the triangulation
+    // also check the order of raw iterators as they contain
+    // something about the history of the triangulation
     typename Triangulation<dim,spacedim>::cell_iterator
-      r1 = t1.begin(),
-      r2 = t2.begin();
+    r1 = t1.begin(),
+    r2 = t2.begin();
     for (; (r1 != t1.end()) && (r2 != t2.end()); ++r1, ++r2)
       {
-       if (r1->level() != r2->level())
-         return false;
-       if (r1->index() != r2->index())
-         return false;
+        if (r1->level() != r2->level())
+          return false;
+        if (r1->index() != r2->index())
+          return false;
       }
 
     return true;
@@ -114,11 +114,11 @@ template <int dim, int spacedim>
 void do_boundary (Triangulation<dim,spacedim> &t1)
 {
   typename Triangulation<dim,spacedim>::cell_iterator
-    c1 = t1.begin();
+  c1 = t1.begin();
   for (; c1 != t1.end(); ++c1)
     for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
       if (c1->at_boundary(f))
-       c1->face(f)->set_boundary_indicator (42);
+        c1->face(f)->set_boundary_indicator (42);
 }
 
 
@@ -137,7 +137,7 @@ void test ()
   // coarsen again as this takes away the finest level but may leave
   // around some of this level's cells
   for (typename Triangulation<dim,spacedim>::active_cell_iterator
-    cell = tria_1.begin_active(2); cell != tria_1.end(); ++cell)
+       cell = tria_1.begin_active(2); cell != tria_1.end(); ++cell)
     cell->set_coarsen_flag ();
   tria_1.execute_coarsening_and_refinement();
   // now add one cell again
index c2e697c8df1f733395504f09515838e7aa591d06..9367c5959c53d9dffc19625274d836e516bc9420 100644 (file)
 void test ()
 {
   unsigned int n = 5;
-  
+
   Vector<double> v1(n);
   Vector<double> v2(n);
-  
+
   Vector<double> v3;
-  
+
   for (unsigned int i = 0; i<n; ++i)
-  {
-    v1(i) = i*1.;
-    v2(i) = i*1. + n*1.;
-  }
-   
+    {
+      v1(i) = i*1.;
+      v2(i) = i*1. + n*1.;
+    }
+
 
   verify (v1, v2);
-  
+
   verify (v1, v3);
 }
 
index c8f7c14ffff877151fa9615c2a910b1f1346251f..10faa919403c5c8d93c2da9233c44075c46f539e 100644 (file)
@@ -20,7 +20,7 @@
 // PETSc in the way we expect, ie. *a* PETSc object exist.
 
 #include "../tests.h"
-#include <deal.II/lac/slepc_solver.h>    
+#include <deal.II/lac/slepc_solver.h>
 #include <deal.II/base/logstream.h>
 #include <deal.II/base/numbers.h>
 #include <fstream>
@@ -28,7 +28,7 @@
 
 std::ofstream logfile ("00/output");
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   deallog.attach (logfile);
   deallog.depth_console (1);
@@ -36,62 +36,62 @@ int main (int argc,char **argv)
   try
     {
 
-      logfile << "Initializing SLEPc (PETSc): " 
-             << std::flush;
+      logfile << "Initializing SLEPc (PETSc): "
+              << std::flush;
 
       SlepcInitialize (&argc, &argv, 0, 0);
       {
-       logfile << "ok" 
-               << std::endl;
+        logfile << "ok"
+                << std::endl;
 
-       // Do something simple with PETSc
-       logfile << "Using PetscScalar:" 
-               << std::endl;
+        // Do something simple with PETSc
+        logfile << "Using PetscScalar:"
+                << std::endl;
 
-       const PetscScalar pi  = numbers::PI;
-       const PetscScalar two = 2.;
+        const PetscScalar pi  = numbers::PI;
+        const PetscScalar two = 2.;
 
-       logfile << "   pi:           " << pi 
-               << std::endl
-               << "   two:          " << two 
-               << std::endl
-               << "   two times pi: " << two*pi 
-               << std::endl;
+        logfile << "   pi:           " << pi
+                << std::endl
+                << "   two:          " << two
+                << std::endl
+                << "   two times pi: " << two *pi
+                << std::endl;
 
-       
-       logfile << "Finalizing SLEPc (PETSc): " 
-               << std::flush;
+
+        logfile << "Finalizing SLEPc (PETSc): "
+                << std::flush;
 
       }
       SlepcFinalize ();
 
-      logfile << "ok" 
-             << std::endl << std::endl;
+      logfile << "ok"
+              << std::endl << std::endl;
     }
 
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
 
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index b2feb8cb053f025cef930b0c22f4843bd1e273f7..a69c9a9e731880a8a8aec5024d32df64d4421c5d 100644 (file)
@@ -46,7 +46,7 @@ std::ofstream deallogfile;
 
 inline
 void
-initlog(const charfilename, bool console=false)
+initlog(const char *filename, bool console=false)
 {
   deallogname = JobIdentifier::base_name(filename) + std::string("/output");
   deallogfile.open(deallogname.c_str());
@@ -66,8 +66,8 @@ output_file_for_mpi (const std::string &directory)
 {
 #ifdef DEAL_II_WITH_MPI
   return (directory + "/ncpu_" +
-         Utilities::int_to_string (Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)) +
-         "/output");
+          Utilities::int_to_string (Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)) +
+          "/output");
 #else
   return (directory + "/ncpu_1/output");
 #endif
@@ -76,7 +76,7 @@ output_file_for_mpi (const std::string &directory)
 
 inline
 void
-mpi_initlog(const charfilename, bool console=false)
+mpi_initlog(const char *filename, bool console=false)
 {
 #ifdef DEAL_II_WITH_MPI
   unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
@@ -86,7 +86,7 @@ mpi_initlog(const char* filename, bool console=false)
       deallogfile.open(deallogname.c_str());
       deallog.attach(deallogfile);
       if (!console)
-       deallog.depth_console(0);
+        deallog.depth_console(0);
 
 //TODO: Remove this line and replace by test_mode()
       deallog.threshold_float(1.e-8);
@@ -103,71 +103,71 @@ mpi_initlog(const char* filename, bool console=false)
    on proc 0 */
 class MPILogInitAll
 {
-  public:
-    MPILogInitAll(const char* filename, bool console=false)
-                   : m_filename(filename)
-      {
+public:
+  MPILogInitAll(const char *filename, bool console=false)
+    : m_filename(filename)
+  {
 #ifdef DEAL_II_WITH_MPI
-       unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
-       deallogname = output_file_for_mpi(JobIdentifier::base_name(filename));
-       if (myid != 0)
-         deallogname = deallogname + Utilities::int_to_string(myid);
-       deallogfile.open(deallogname.c_str());
-       deallog.attach(deallogfile);
-       if (!console)
-         deallog.depth_console(0);
+    unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
+    deallogname = output_file_for_mpi(JobIdentifier::base_name(filename));
+    if (myid != 0)
+      deallogname = deallogname + Utilities::int_to_string(myid);
+    deallogfile.open(deallogname.c_str());
+    deallog.attach(deallogfile);
+    if (!console)
+      deallog.depth_console(0);
 
 //TODO: Remove this line and replace by test_mode()
-       deallog.threshold_float(1.e-8);
-       deallog.push(Utilities::int_to_string(myid));
+    deallog.threshold_float(1.e-8);
+    deallog.push(Utilities::int_to_string(myid));
 #else
-       // can't use this function if not using MPI
-       Assert (false, ExcInternalError());
+    // can't use this function if not using MPI
+    Assert (false, ExcInternalError());
 #endif
+  }
+
+  ~MPILogInitAll()
+  {
+#ifdef DEAL_II_WITH_MPI
+    unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
+    unsigned int nproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
+
+    deallog.pop();
+    if (myid!=0)
+      {
+        deallog.detach();
+        deallogfile.close();
       }
 
-    ~MPILogInitAll()
+    MPI_Barrier(MPI_COMM_WORLD);
+
+    if (myid==0)
       {
-#ifdef DEAL_II_WITH_MPI
-       unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
-       unsigned int nproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
-
-       deallog.pop();
-       if (myid!=0)
-         {
-           deallog.detach();
-           deallogfile.close();
-         }
-
-       MPI_Barrier(MPI_COMM_WORLD);
-
-       if (myid==0)
-         {
-           for (unsigned int i=1;i<nproc;++i)
-             {
-               std::string filename = output_file_for_mpi(JobIdentifier::base_name(m_filename.c_str()))
-                                      + Utilities::int_to_string(i);
-               std::ifstream in(filename.c_str());
-               Assert (in, ExcIO());
-
-               while (in)
-                 {
-                   std::string s;
-                   std::getline(in, s);
-                   deallog.get_file_stream() << s << "\n";
-                 }
-               in.close();
-               std::remove (filename.c_str());
-             }
-         }
+        for (unsigned int i=1; i<nproc; ++i)
+          {
+            std::string filename = output_file_for_mpi(JobIdentifier::base_name(m_filename.c_str()))
+                                   + Utilities::int_to_string(i);
+            std::ifstream in(filename.c_str());
+            Assert (in, ExcIO());
+
+            while (in)
+              {
+                std::string s;
+                std::getline(in, s);
+                deallog.get_file_stream() << s << "\n";
+              }
+            in.close();
+            std::remove (filename.c_str());
+          }
+      }
 #else
-       // can't use this function if not using MPI
-       Assert (false, ExcInternalError());
+    // can't use this function if not using MPI
+    Assert (false, ExcInternalError());
 #endif
-      }
-  private:
+  }
+private:
 
-    std::string m_filename;
+  std::string m_filename;
 
 };
 
@@ -185,10 +185,10 @@ class MPILogInitAll
 // baseline
 struct SwitchOffStacktrace
 {
-    SwitchOffStacktrace ()
-      {
-       deal_II_exceptions::suppress_stacktrace_in_exceptions ();
-      }
+  SwitchOffStacktrace ()
+  {
+    deal_II_exceptions::suppress_stacktrace_in_exceptions ();
+  }
 } deal_II_stacktrace_dummy;
 
 #endif
@@ -197,19 +197,19 @@ DEAL_II_NAMESPACE_OPEN
 namespace internal
 {
 
-    namespace Vector
-    {
+  namespace Vector
+  {
 
-      extern unsigned int minimum_parallel_grain_size;
+    extern unsigned int minimum_parallel_grain_size;
 
-    }
+  }
 
-    namespace SparseMatrix
-    {
+  namespace SparseMatrix
+  {
 
-      extern unsigned int minimum_parallel_grain_size;
+    extern unsigned int minimum_parallel_grain_size;
 
-    }
+  }
 
 }
 
@@ -219,14 +219,14 @@ namespace internal
 struct SetGrainSizes
 {
 
-    SetGrainSizes ()
-      {
+  SetGrainSizes ()
+  {
 
-       internal::Vector::minimum_parallel_grain_size = 2;
+    internal::Vector::minimum_parallel_grain_size = 2;
 
-       internal::SparseMatrix::minimum_parallel_grain_size = 2;
+    internal::SparseMatrix::minimum_parallel_grain_size = 2;
 
-      }
+  }
 
 }
 set_grain_sizes;
@@ -246,44 +246,44 @@ set_grain_sizes;
 
 struct DeadlockKiller
 {
-  private:
-    static void nuke_it ()
+private:
+  static void nuke_it ()
+  {
+    char *env = std::getenv("WALLTIME");
+
+    if (env != 0)
       {
-       char * env = std::getenv("WALLTIME");
-
-       if (env != 0)
-         {
-           std::istringstream conv (env);
-           int delay;
-           conv >> delay;
-           if (conv)
-             {
-               sleep (delay);
-               std::cerr << "Time's up: Killing job after "
-                         << delay
-                         << " seconds because it overran its allowed walltime."
-                         << std::endl;
-               std::abort ();
-             }
-           else
-             {
-               std::cerr << "Invalid value for WALLTIME environment variable."
-                         << std::endl;
-               std::abort ();
-             }
-         }
-       else
-          // environment variable is not set, so assume infinite wait time
-          // and simply quit this thread
-         {
-         }
+        std::istringstream conv (env);
+        int delay;
+        conv >> delay;
+        if (conv)
+          {
+            sleep (delay);
+            std::cerr << "Time's up: Killing job after "
+                      << delay
+                      << " seconds because it overran its allowed walltime."
+                      << std::endl;
+            std::abort ();
+          }
+        else
+          {
+            std::cerr << "Invalid value for WALLTIME environment variable."
+                      << std::endl;
+            std::abort ();
+          }
       }
-
-  public:
-    DeadlockKiller ()
+    else
+      // environment variable is not set, so assume infinite wait time
+      // and simply quit this thread
       {
-       dealii::Threads::new_thread (&nuke_it);
       }
+  }
+
+public:
+  DeadlockKiller ()
+  {
+    dealii::Threads::new_thread (&nuke_it);
+  }
 };
 
 #endif
index 33e773c8fed4f3cf4a376fee218309734505a6ab..bbc7c95ae19b0227d246b0d201b5b3a13b12a6eb 100644 (file)
@@ -19,7 +19,7 @@
 // check setting elements in a trilinos matrix using
 // TrilinosWrappers::SparseMatrix::set()
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/trilinos_sparse_matrix.h>
 #include <fstream>
@@ -28,7 +28,7 @@
 
 void test (TrilinosWrappers::SparseMatrix &m)
 {
-                                   // first set a few entries
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -36,7 +36,7 @@ void test (TrilinosWrappers::SparseMatrix &m)
 
   m.compress ();
 
-                                   // then make sure we retrieve the same ones
+  // then make sure we retrieve the same ones
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -54,12 +54,12 @@ void test (TrilinosWrappers::SparseMatrix &m)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("01/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -73,25 +73,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 87257ac0c848e52ec6e965e23a46a12c0a2ae490..231433049847d8a86e3308486ffd1ff8de3b053f 100644 (file)
 // check setting elements in a petsc matrix using
 // TrilinosWrappers::SparseMatrix::add()
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_sparse_matrix.h>    
+#include <deal.II/lac/trilinos_sparse_matrix.h>
 #include <fstream>
 #include <iostream>
 
 
 void test (TrilinosWrappers::SparseMatrix &m)
 {
-                                   // first set a few entries
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, 0.);
 
-                                   // then add values to these entries
+  // then add values to these entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.add (i,j, i*j*.5+.5);
 
   m.compress ();
-  
-                                   // then make sure we retrieve the same ones
+
+  // then make sure we retrieve the same ones
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -60,12 +60,12 @@ void test (TrilinosWrappers::SparseMatrix &m)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("02/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -79,25 +79,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 7e7652ca7d158ebcf72e13735aed5b10f518e8bb..5a9234a66e40547d47fb8e9872a9aac304b2a8d8 100644 (file)
 // intermixed. this poses PETSc some problems, since one has to flush some
 // buffer in between these two types of operations
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_sparse_matrix.h>    
+#include <deal.II/lac/trilinos_sparse_matrix.h>
 #include <fstream>
 #include <iostream>
 
 
 void test (TrilinosWrappers::SparseMatrix &m)
 {
-                                   // first set a few entries
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -37,7 +37,7 @@ void test (TrilinosWrappers::SparseMatrix &m)
 
   m.compress();
 
-                                   // then add/set values into these entries
+  // then add/set values into these entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -47,10 +47,10 @@ void test (TrilinosWrappers::SparseMatrix &m)
           else
             m.add (i,j, i*j*.5+.5);
         }
-  
+
   m.compress ();
-  
-                                   // then make sure we retrieve the same ones
+
+  // then make sure we retrieve the same ones
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -68,12 +68,12 @@ void test (TrilinosWrappers::SparseMatrix &m)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("03/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -87,25 +87,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 40c1117b9d48626f73f353f5d58eb23eb4e169b0..12daa9c01731d5680235a8d9945a67684c0dfa58 100644 (file)
 // in contrast to trilinos_03, we set and add the same elements here twice, to
 // get double the original value
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_sparse_matrix.h>    
+#include <deal.II/lac/trilinos_sparse_matrix.h>
 #include <fstream>
 #include <iostream>
 
 
 void test (TrilinosWrappers::SparseMatrix &m)
 {
-                                   // first set a few entries
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
-  
-                                   // then add the same elements again
+
+  // then add the same elements again
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.add (i,j, i*j*.5+.5);
-  
+
   m.compress ();
-  
-                                   // then make sure we retrieve the same ones
+
+  // then make sure we retrieve the same ones
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -64,12 +64,12 @@ void test (TrilinosWrappers::SparseMatrix &m)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("03a/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -83,25 +83,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index eacdbf092410a962471ca63a8d2a9cf06cb135f7..780ff49e1c5ac090023f94c7536873938aadc98a 100644 (file)
 // in contrast to trilinos_03a, we set and add the same elements here twice, then
 // overwrite them again to get the original value back
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_sparse_matrix.h>    
+#include <deal.II/lac/trilinos_sparse_matrix.h>
 #include <fstream>
 #include <iostream>
 
 
 void test (TrilinosWrappers::SparseMatrix &m)
 {
-                                   // first set a few entries
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
-                                   // then add the same elements again
+  // then add the same elements again
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -45,15 +45,15 @@ void test (TrilinosWrappers::SparseMatrix &m)
 
   m.compress();
 
-                                   // and overwrite everything again
+  // and overwrite everything again
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
-  
+
   m.compress ();
-  
-                                   // then make sure we retrieve the same ones
+
+  // then make sure we retrieve the same ones
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -71,12 +71,12 @@ void test (TrilinosWrappers::SparseMatrix &m)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("03b/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -90,25 +90,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 126ac9f585d675e94c7ac4bba597282162c873d3..b1a434fb2ebad06eab5ef627c5d5cb8e25903715 100644 (file)
@@ -18,9 +18,9 @@
 
 // check querying matrix sizes
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_sparse_matrix.h>    
+#include <deal.II/lac/trilinos_sparse_matrix.h>
 #include <fstream>
 #include <iostream>
 
@@ -35,12 +35,12 @@ void test (TrilinosWrappers::SparseMatrix &m)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("04/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -55,25 +55,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index cf00341e2b69168831394afac8959266c3cbb8ae..cc1c2bd3e2271dc3701bb817f288f0a2df89d070 100644 (file)
 // check querying the number of nonzero elements in
 // TrilinosWrappers::SparseMatrix
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_sparse_matrix.h>    
+#include <deal.II/lac/trilinos_sparse_matrix.h>
 #include <fstream>
 #include <iostream>
 
 
 void test (TrilinosWrappers::SparseMatrix &m)
 {
-                                   // first set a few entries. count how many
-                                   // entries we have
+  // first set a few entries. count how many
+  // entries we have
   unsigned int counter = 0;
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
@@ -44,18 +44,18 @@ void test (TrilinosWrappers::SparseMatrix &m)
   deallog << m.n_nonzero_elements() << std::endl;
   Assert (m.n_nonzero_elements() == counter,
           ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("05/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -70,25 +70,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index c438e7dd40f9da895d6c383dfea146d8fa5503d8..a85308af044072b323d9d0ab4a78d8a6cc519314 100644 (file)
 
 // check TrilinosWrappers::SparseMatrix::l1_norm
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_sparse_matrix.h>    
+#include <deal.II/lac/trilinos_sparse_matrix.h>
 #include <fstream>
 #include <iostream>
 
 
 void test (TrilinosWrappers::SparseMatrix &m)
 {
-                                   // first set a few entries. count how many
-                                   // entries we have
+  // first set a few entries. count how many
+  // entries we have
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
-        m.set (i,j, i*j*.5+.5);  
+        m.set (i,j, i*j*.5+.5);
 
   m.compress ();
 
-                                   // compare against the exact value of the
-                                   // l1-norm (max col-sum)
+  // compare against the exact value of the
+  // l1-norm (max col-sum)
   deallog << m.l1_norm() << std::endl;
   Assert (m.l1_norm() == 7, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("06/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -66,25 +66,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index d4d93de4b57dc407cffb4f7276477e4d8a5b6fee..cf7cf5d4b3dc0f421d8ecfa2ad8b822144d5e6c7 100644 (file)
 
 // check TrilinosWrappers::SparseMatrix::linfty_norm
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_sparse_matrix.h>    
+#include <deal.II/lac/trilinos_sparse_matrix.h>
 #include <fstream>
 #include <iostream>
 
 
 void test (TrilinosWrappers::SparseMatrix &m)
 {
-                                   // first set a few entries. count how many
-                                   // entries we have
+  // first set a few entries. count how many
+  // entries we have
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
-        m.set (i,j, i*j*.5+.5);  
+        m.set (i,j, i*j*.5+.5);
 
   m.compress ();
 
-                                   // compare against the exact value of the
-                                   // linfty-norm (max row-sum)
+  // compare against the exact value of the
+  // linfty-norm (max row-sum)
   deallog << m.linfty_norm() << std::endl;
   Assert (m.linfty_norm() == 8.5, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("07/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -66,25 +66,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 5eab64e79ff017f3596fc74ecf6d6669cb7bf6a5..5aef0bf0ef4b48c1923ea75ca50de961f26b56e8 100644 (file)
 
 // check TrilinosWrappers::SparseMatrix::frobenius_norm
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_sparse_matrix.h>    
+#include <deal.II/lac/trilinos_sparse_matrix.h>
 #include <fstream>
 #include <iostream>
 
 
 void test (TrilinosWrappers::SparseMatrix &m)
 {
-                                   // first set a few entries. count how many
-                                   // entries we have
+  // first set a few entries. count how many
+  // entries we have
   TrilinosScalar norm = 0;
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
@@ -41,22 +41,22 @@ void test (TrilinosWrappers::SparseMatrix &m)
 
   m.compress ();
 
-                                   // compare against the exact value of the
-                                   // l2-norm (max row-sum)
+  // compare against the exact value of the
+  // l2-norm (max row-sum)
   deallog << m.frobenius_norm() << std::endl;
   Assert (m.frobenius_norm() == norm, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("08/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -71,25 +71,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index b2a35f4729da7285f5cede509501890a3200780e..a503d2dade6cb003f3fd269225f391d9caf9c34e 100644 (file)
 
 // check TrilinosWrappers::SparseMatrix::operator *=
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_sparse_matrix.h>    
+#include <deal.II/lac/trilinos_sparse_matrix.h>
 #include <fstream>
 #include <iostream>
 
 
 void test (TrilinosWrappers::SparseMatrix &m)
 {
-                                   // first set a few entries
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
 
   m.compress ();
-  
-                                   // then multiply everything by 1.25 and
-                                   // make sure we retrieve the values we
-                                   // expect
+
+  // then multiply everything by 1.25 and
+  // make sure we retrieve the values we
+  // expect
   m *= 1.25;
-  
+
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -57,12 +57,12 @@ void test (TrilinosWrappers::SparseMatrix &m)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("09/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -77,25 +77,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index f92965cae278ba5b38b402682768bb88037c3c3e..df9b8899493638f6782e0fc684cd680456e4e8d5 100644 (file)
 
 // check TrilinosWrappers::SparseMatrix::operator /=
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_sparse_matrix.h>    
+#include <deal.II/lac/trilinos_sparse_matrix.h>
 #include <fstream>
 #include <iostream>
 
 
 void test (TrilinosWrappers::SparseMatrix &m)
 {
-                                   // first set a few entries
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
 
   m.compress ();
-  
-                                   // then divide everything by 4/3 and
-                                   // make sure we retrieve the values we
-                                   // expect
+
+  // then divide everything by 4/3 and
+  // make sure we retrieve the values we
+  // expect
   m /= 4./3.;
-  
+
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -57,12 +57,12 @@ void test (TrilinosWrappers::SparseMatrix &m)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("10/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -77,25 +77,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 980c3e150f4600cbbe21b86eade65690884b37d8..414cedd3771de3c0f1348b80e6e18ca086f6ce24 100644 (file)
 
 // check TrilinosWrappers::Vector::size()
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set only certain elements of the vector
+  // set only certain elements of the vector
   for (unsigned int i=0; i<v.size(); i+=1+i)
     v(i) = i;
 
   v.compress ();
-  
+
   Assert (v.size() == 100, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -40,12 +40,12 @@ void test (TrilinosWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("11/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -60,25 +60,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index d0afb57dcbb2585f0533644afc0c68a97bdd7820..1813e7463a411bf2d95a616c939052916a63e8c6 100644 (file)
@@ -18,9 +18,9 @@
 
 // check TrilinosWrappers::Vector::operator() in set-mode
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -28,9 +28,9 @@
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -40,25 +40,25 @@ void test (TrilinosWrappers::Vector &v)
 
   v.compress ();
 
-                                   // check that they are ok, and this time
-                                   // all of them
+  // check that they are ok, and this time
+  // all of them
   for (unsigned int i=0; i<v.size(); ++i)
     Assert ((((pattern[i] == true) && (v(i) == i))
              ||
              ((pattern[i] == false) && (v(i) == 0))),
-             ExcInternalError());
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("12/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -73,25 +73,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 2bc2799710bb9d932a75d82f32c8e7c3de6b0160..306d332f6ecf44c7460404a41a045ddc057640ce 100644 (file)
@@ -18,9 +18,9 @@
 
 // check TrilinosWrappers::Vector::operator() in add-mode
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -28,9 +28,9 @@
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -40,25 +40,25 @@ void test (TrilinosWrappers::Vector &v)
 
   v.compress ();
 
-                                   // check that they are ok, and this time
-                                   // all of them
+  // check that they are ok, and this time
+  // all of them
   for (unsigned int i=0; i<v.size(); ++i)
     Assert ((((pattern[i] == true) && (v(i) == i))
              ||
              ((pattern[i] == false) && (v(i) == 0))),
-             ExcInternalError());
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("13/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -73,25 +73,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index cf95db58a7efc989d2817b727b0c20c4eca6589b..b363b0d7b5cac3b5ee9b0f870b9320f1c70295b2 100644 (file)
@@ -18,9 +18,9 @@
 
 // check TrilinosWrappers::Vector::operator() in set/add-mode alternatingly
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -28,9 +28,9 @@
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   bool flag = false;
   for (unsigned int i=0; i<v.size(); i+=1+i)
@@ -40,31 +40,31 @@ void test (TrilinosWrappers::Vector &v)
       else
         v(i) = i;
       flag = !flag;
-      
+
       pattern[i] = true;
     }
 
   v.compress ();
 
-                                   // check that they are ok, and this time
-                                   // all of them
+  // check that they are ok, and this time
+  // all of them
   for (unsigned int i=0; i<v.size(); ++i)
     Assert ((((pattern[i] == true) && (v(i) == i))
              ||
              ((pattern[i] == false) && (v(i) == 0))),
-             ExcInternalError());
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("14/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -79,25 +79,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 352bfc25879abc32428e367da65233cccb00130d..40e4b9aecd0a425c6990a0ba816ceae74240b5ee 100644 (file)
@@ -19,9 +19,9 @@
 // check TrilinosWrappers::Vector::operator() in set/add-mode alternatingly, but
 // writing to the same elements
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -29,9 +29,9 @@
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -43,25 +43,25 @@ void test (TrilinosWrappers::Vector &v)
 
   v.compress ();
 
-                                   // check that they are ok, and this time
-                                   // all of them
+  // check that they are ok, and this time
+  // all of them
   for (unsigned int i=0; i<v.size(); ++i)
     Assert ((((pattern[i] == true) && (v(i) == 2*i))
              ||
              ((pattern[i] == false) && (v(i) == 0))),
-             ExcInternalError());
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("15/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -76,25 +76,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 685c87e128de02e3e254c2593677d65d62689a5b..f23f2c67ebdfe69f045fa74712f9357a15e39213 100644 (file)
@@ -19,9 +19,9 @@
 // check TrilinosWrappers::Vector::operator() in set/add-mode alternatingly, but
 // writing and overwriting the same elements
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -29,9 +29,9 @@
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -45,25 +45,25 @@ void test (TrilinosWrappers::Vector &v)
 
   v.compress ();
 
-                                   // check that they are ok, and this time
-                                   // all of them
+  // check that they are ok, and this time
+  // all of them
   for (unsigned int i=0; i<v.size(); ++i)
     Assert ((((pattern[i] == true) && (v(i) == i))
              ||
              ((pattern[i] == false) && (v(i) == 0))),
-             ExcInternalError());
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("16/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -78,25 +78,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index fa0691f40bf810480245d9e31ee2a8286d6a78e1..44296655bdb3af9f710a93e68dfac4825e87c3a4 100644 (file)
@@ -18,9 +18,9 @@
 
 // check TrilinosWrappers::Vector::l1_norm()
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -28,7 +28,7 @@
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set some elements of the vector
+  // set some elements of the vector
   double norm = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -37,7 +37,7 @@ void test (TrilinosWrappers::Vector &v)
     }
   v.compress ();
 
-                                   // then check the norm
+  // then check the norm
   Assert (v.l1_norm() == norm, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -45,12 +45,12 @@ void test (TrilinosWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("17/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -65,25 +65,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index de53f6018c5330b3cf8625c1b68c86c5a6b3df44..0c4651ce9e51533f1b139004b7fbc805abff6334 100644 (file)
@@ -18,9 +18,9 @@
 
 // check TrilinosWrappers::Vector::l2_norm()
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -28,7 +28,7 @@
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set some elements of the vector
+  // set some elements of the vector
   TrilinosScalar norm = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -37,7 +37,7 @@ void test (TrilinosWrappers::Vector &v)
     }
   v.compress ();
 
-                                   // then check the norm
+  // then check the norm
   const double eps=typeid(TrilinosScalar)==typeid(double) ? 1e-14 : 1e-5;
   Assert (fabs(v.l2_norm()-std::sqrt(norm))<eps, ExcInternalError());
 
@@ -46,12 +46,12 @@ void test (TrilinosWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("18/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -66,25 +66,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index ccda0937c6353abfa2745e4f8a041b5cea9f2885..49ff64e2731643541e6afcb889ff01eb4101ca5f 100644 (file)
@@ -18,9 +18,9 @@
 
 // check TrilinosWrappers::Vector::linfty_norm()
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -28,7 +28,7 @@
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set some elements of the vector
+  // set some elements of the vector
   double norm = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -37,7 +37,7 @@ void test (TrilinosWrappers::Vector &v)
     }
   v.compress ();
 
-                                   // then check the norm
+  // then check the norm
   Assert (v.linfty_norm() == norm, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -45,12 +45,12 @@ void test (TrilinosWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("19/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -65,25 +65,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 7ade4ef299ca5e6d3a86c8aefbe1effa4281c262..92bf30c6e386f8fc8921d0923d62d75029f82ac4 100644 (file)
@@ -18,9 +18,9 @@
 
 // check TrilinosWrappers::Vector::operator *=
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -28,9 +28,9 @@
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -39,27 +39,27 @@ void test (TrilinosWrappers::Vector &v)
     }
   v.compress ();
 
-                                   // multiply v with 5/4
+  // multiply v with 5/4
   v *= 5./4.;
 
-                                   // check that the entries are ok
+  // check that the entries are ok
   for (unsigned int i=0; i<v.size(); ++i)
     Assert ((((pattern[i] == true) && (v(i) == i*5./4.))
              ||
-            ((pattern[i] == false) && (v(i) == 0))),
-             ExcInternalError());
+             ((pattern[i] == false) && (v(i) == 0))),
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("20/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -74,25 +74,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 9f3af4ee7f453afd42543360971044dbbc115569..462468d28c33380c625314e5fd0137d7e8f75fb1 100644 (file)
@@ -18,9 +18,9 @@
 
 // check TrilinosWrappers::Vector::operator /=
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -28,9 +28,9 @@
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -39,27 +39,27 @@ void test (TrilinosWrappers::Vector &v)
     }
   v.compress ();
 
-                                   // multiply v with 3/4
+  // multiply v with 3/4
   v /= 4./3.;
 
-                                   // check that the entries are ok
+  // check that the entries are ok
   for (unsigned int i=0; i<v.size(); ++i)
     Assert ((((pattern[i] == true) && (v(i) == i*3./4.))
              ||
              ((pattern[i] == false) && (v(i) == 0))),
-             ExcInternalError());
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("21/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -74,25 +74,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index d86c77acd1cb3d838582051802d83382f586e738..b9f2b4778c5745fc22635499255a9e4d22b98909 100644 (file)
@@ -19,9 +19,9 @@
 // check TrilinosWrappers::Vector::operator*(Vector) on two vectors that are
 // orthogonal
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -30,8 +30,8 @@
 void test (TrilinosWrappers::Vector &v,
            TrilinosWrappers::Vector &w)
 {
-                                   // set only certain elements of each
-                                   // vector, but disjoint sets of elements
+  // set only certain elements of each
+  // vector, but disjoint sets of elements
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = i;
@@ -40,7 +40,7 @@ void test (TrilinosWrappers::Vector &v,
   v.compress ();
   w.compress ();
 
-                                   // make sure the scalar product is zero
+  // make sure the scalar product is zero
   Assert (v*w == 0, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -48,12 +48,12 @@ void test (TrilinosWrappers::Vector &v,
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("22/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -69,25 +69,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index f9209988e2f9d818043544925e27836a68d51158..f8491f49ed0d5b2f384a4a400baf914780b4c161 100644 (file)
@@ -19,9 +19,9 @@
 // check TrilinosWrappers::Vector::operator*(Vector) on two vectors that are
 // not orthogonal
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -30,9 +30,9 @@
 void test (TrilinosWrappers::Vector &v,
            TrilinosWrappers::Vector &w)
 {
-                                   // set only certain elements of each
-                                   // vector, and record the expected scalar
-                                   // product
+  // set only certain elements of each
+  // vector, and record the expected scalar
+  // product
   double product = 0;
   for (unsigned int i=0; i<v.size(); ++i)
     {
@@ -43,11 +43,11 @@ void test (TrilinosWrappers::Vector &v,
           product += i*(i+1);
         }
     }
-  
+
   v.compress ();
   w.compress ();
 
-                                   // make sure the scalar product is zero
+  // make sure the scalar product is zero
   Assert (v*w == product, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -55,12 +55,12 @@ void test (TrilinosWrappers::Vector &v,
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("23/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -76,25 +76,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 27b554ca417261950eee7157b0401ff655712b73..42c1b8874a61bb0da3cba6e24fd6c9df8abb543b 100644 (file)
@@ -20,9 +20,9 @@
 // function has since been removed, so we test for v=0 instead, although that
 // may be covered by one of the other tests
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set some entries of the vector
+  // set some entries of the vector
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = i+1.;
   v.compress ();
 
-                                   // then clear it again and make sure the
-                                   // vector is really empty
+  // then clear it again and make sure the
+  // vector is really empty
   const unsigned int sz = v.size();
   v = 0;
   Assert (v.size() == sz, ExcInternalError());
@@ -48,12 +48,12 @@ void test (TrilinosWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("24/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -68,25 +68,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 29cec464ea128c03b835e179a3c3a4bf39b8de59..eb792d49d65dc463186345dbbdd5b661345ec119 100644 (file)
@@ -18,9 +18,9 @@
 
 // check TrilinosWrappers::Vector::operator = (TrilinosScalar) with setting to zero
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set some entries of the vector
+  // set some entries of the vector
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = i+1.;
   v.compress ();
 
-                                   // then clear it again and make sure the
-                                   // vector is really empty
+  // then clear it again and make sure the
+  // vector is really empty
   const unsigned int sz = v.size();
   v = 0;
   Assert (v.size() == sz, ExcInternalError());
@@ -46,12 +46,12 @@ void test (TrilinosWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("25/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -66,25 +66,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 4278bb4f163975897396e1c33335b005a56c1680..3222e54f5d1e51630a7b01127a5b679af6171e34 100644 (file)
@@ -19,9 +19,9 @@
 // check TrilinosWrappers::Vector::operator = (TrilinosScalar) with setting to a
 // nonzero value
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -29,7 +29,7 @@
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set some entries of the vector
+  // set some entries of the vector
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = i+1.;
@@ -45,12 +45,12 @@ void test (TrilinosWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("26/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -65,25 +65,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index eaa7f8970dcda9027026761c56ac172e3bfdefd3..af961aef1eb2eae9036458abc605dc1f31a7378e 100644 (file)
 
 
 
-// check TrilinosWrappers::Vector::operator = (Vector) 
+// check TrilinosWrappers::Vector::operator = (Vector)
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set some entries of the vector
+  // set some entries of the vector
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = i+1.;
   v.compress ();
 
-                                   // then copy it
+  // then copy it
   TrilinosWrappers::Vector w (v.size());
   w = v;
 
-                                   // make sure they're equal
-  deallog << v*w << ' ' << v.l2_norm() * w.l2_norm()
-          << ' ' << v*w - v.l2_norm() * w.l2_norm() << std::endl;
+  // make sure they're equal
+  deallog << v *w << ' ' << v.l2_norm() * w.l2_norm()
+          << ' ' << v *w - v.l2_norm() * w.l2_norm() << std::endl;
   const double eps=typeid(TrilinosScalar)==typeid(double) ? 1e-14 : 1e-5;
   Assert (std::fabs(v*w - v.l2_norm() * w.l2_norm()) < eps*(v*w),
           ExcInternalError());
@@ -50,12 +50,12 @@ void test (TrilinosWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("27/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -70,25 +70,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index e1027a5ba625e58a52a711770b9b072f67238314..999b72ef0152b3b6ffba4615320db2522a9ce335 100644 (file)
@@ -19,9 +19,9 @@
 // check TrilinosWrappers::Vector::operator = (Vector), except that we don't
 // resize the vector to be copied to beforehand
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set some entries of the vector
+  // set some entries of the vector
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = i+1.;
   v.compress ();
 
-                                   // then copy it to a vector of different
-                                   // size
+  // then copy it to a vector of different
+  // size
   TrilinosWrappers::Vector w (1);
   w = v;
 
-                                   // make sure they're equal
-  deallog << v*w << ' ' << v.l2_norm() * w.l2_norm()
-          << ' ' << v*w - v.l2_norm() * w.l2_norm() << std::endl;
+  // make sure they're equal
+  deallog << v *w << ' ' << v.l2_norm() * w.l2_norm()
+          << ' ' << v *w - v.l2_norm() * w.l2_norm() << std::endl;
   const double eps=typeid(TrilinosScalar)==typeid(double) ? 1e-14 : 1e-5;
   Assert (std::fabs(v*w - v.l2_norm() * w.l2_norm()) < eps*(v*w),
           ExcInternalError());
@@ -52,12 +52,12 @@ void test (TrilinosWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("28/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -72,25 +72,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 006e5a7c87ead22bf1bc7f12f5e78804a7a35f4c..355e0cb220904ae2abc9df3caab3731a3492ecb8 100644 (file)
@@ -18,9 +18,9 @@
 
 // check TrilinosWrappers::Vector::reinit(fast)
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -29,7 +29,7 @@
 void test (TrilinosWrappers::Vector &v)
 {
   v.reinit (13);
-  
+
   Assert (v.size() == 13, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -37,12 +37,12 @@ void test (TrilinosWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("29/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -57,25 +57,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 40e9811ea5bbb937e3975bd6a71c54fc7978509b..3b0fe84a41375a3ab4252931848272eb28159e0d 100644 (file)
@@ -18,9 +18,9 @@
 
 // check TrilinosWrappers::Vector::reinit(!fast)
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set some entries of the vector
+  // set some entries of the vector
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = i+1.;
   v.compress ();
 
-                                   // then resize with setting to zero
+  // then resize with setting to zero
   v.reinit (13);
-  
+
   Assert (v.size() == 13, ExcInternalError());
   Assert (v.l2_norm() == 0, ExcInternalError());
 
@@ -45,12 +45,12 @@ void test (TrilinosWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("30/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -65,25 +65,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 70b1158d83f1a8635ab62feaf90b09fdd0a872b3..bea52ade3da2b40f75c4271797c29b166480e772 100644 (file)
@@ -18,9 +18,9 @@
 
 // check TrilinosWrappers::Vector::l2_norm()
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -28,7 +28,7 @@
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set some elements of the vector
+  // set some elements of the vector
   TrilinosScalar norm = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -37,7 +37,7 @@ void test (TrilinosWrappers::Vector &v)
     }
   v.compress ();
 
-                                   // then check the norm
+  // then check the norm
   const double eps=typeid(TrilinosScalar)==typeid(double) ? 1e-14 : 1e-5;
   Assert (std::fabs(v.norm_sqr() - norm) < eps*norm,
           ExcInternalError());
@@ -47,12 +47,12 @@ void test (TrilinosWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("31/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -67,25 +67,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index d1d03902195e771338036a201098823b075fc0bd..4bb4f0fbd451d48b39fd444ae98da58b500322ff 100644 (file)
@@ -18,9 +18,9 @@
 
 // check TrilinosWrappers::Vector::mean_value()
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -28,7 +28,7 @@
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set some elements of the vector
+  // set some elements of the vector
   TrilinosScalar sum = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -37,7 +37,7 @@ void test (TrilinosWrappers::Vector &v)
     }
   v.compress ();
 
-                                   // then check the norm
+  // then check the norm
   const double eps=typeid(TrilinosScalar)==typeid(double) ? 1e-14 : 1e-5;
   Assert (std::fabs(v.mean_value() - sum/v.size()) < eps*sum/v.size(),
           ExcInternalError());
@@ -47,12 +47,12 @@ void test (TrilinosWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("32/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -67,25 +67,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 4aea7c9146e4ad9d1643959c73126fbac775cb0c..d2907c38ab5ef9125bdd18eaa7e817259fdb2c85 100644 (file)
@@ -18,9 +18,9 @@
 
 // check TrilinosWrappers::Vector::lp_norm(3)
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -28,7 +28,7 @@
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set some elements of the vector
+  // set some elements of the vector
   TrilinosScalar sum = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -37,7 +37,7 @@ void test (TrilinosWrappers::Vector &v)
     }
   v.compress ();
 
-                                   // then check the norm
+  // then check the norm
   const double eps=typeid(TrilinosScalar)==typeid(double) ? 1e-14 : 1e-5;
   const double true_value=std::pow(sum, static_cast<TrilinosScalar> (1./3.));
   Assert (std::fabs(v.lp_norm(3) - true_value) < eps*true_value,
@@ -48,12 +48,12 @@ void test (TrilinosWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("33/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -68,25 +68,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 7dcaa8c90d7664f909adea0a7031c6608d0f3b91..1f6bf7d04149b7626ee363e7beaeae8c0a972538 100644 (file)
@@ -18,9 +18,9 @@
 
 // check TrilinosWrappers::Vector::all_zero
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -28,7 +28,7 @@
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set some elements of the vector
+  // set some elements of the vector
   double sum = 0;
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -37,10 +37,10 @@ void test (TrilinosWrappers::Vector &v)
     }
   v.compress ();
 
-                                   // set them to zero again
+  // set them to zero again
   v = 0;
 
-                                   // then check all_zero
+  // then check all_zero
   Assert (v.all_zero() == true, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -48,12 +48,12 @@ void test (TrilinosWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("34/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -68,25 +68,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index f0d50331c2e9b48028025933cf737aa32246c7c2..1c96f41db68aeee6d06ce2de8662f9cb6beaa61c 100644 (file)
 
 
 
-// check TrilinosWrappers::Vector::operator+=(Vector) 
+// check TrilinosWrappers::Vector::operator+=(Vector)
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
 void test (TrilinosWrappers::Vector &v,
            TrilinosWrappers::Vector &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       if (i%3 == 0)
         w(i) = i+1.;
     }
-  
+
   v.compress ();
   w.compress ();
 
   v += w;
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       if (i%3 == 0)
@@ -64,12 +64,12 @@ void test (TrilinosWrappers::Vector &v,
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("35/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -85,25 +85,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 0855c4964a819f8b602358f34fc2a079145e3aa7..589530328d1f925d62ea68c0fd9a93159fad28b0 100644 (file)
 
 
 
-// check TrilinosWrappers::Vector::operator-=(Vector) 
+// check TrilinosWrappers::Vector::operator-=(Vector)
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
 void test (TrilinosWrappers::Vector &v,
            TrilinosWrappers::Vector &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       if (i%3 == 0)
         w(i) = i+1.;
     }
-  
+
   v.compress ();
   w.compress ();
 
   v -= w;
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       if (i%3 == 0)
@@ -64,12 +64,12 @@ void test (TrilinosWrappers::Vector &v,
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("36/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -85,25 +85,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 6f08493224814d243ae9b6d126558ee1f4f0452f..a7710058cebf2d311eb2d6cab307305a7f99ed7a 100644 (file)
@@ -18,9 +18,9 @@
 
 // check TrilinosWrappers::Vector::add (scalar)
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -30,12 +30,12 @@ void test (TrilinosWrappers::Vector &v)
 {
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
-  
+
   v.compress ();
 
   v.add (1.);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     Assert (v(i) == i+1., ExcInternalError());
 
@@ -44,12 +44,12 @@ void test (TrilinosWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("37/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -64,25 +64,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index e48cf4f1edf01878d22b9ae6f8adc086e2bdfc8f..e83c7422ad0fdaea08c29e5304e2be60669ba08b 100644 (file)
 
 
 
-// check TrilinosWrappers::Vector::add(Vector) 
+// check TrilinosWrappers::Vector::add(Vector)
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -34,13 +34,13 @@ void test (TrilinosWrappers::Vector &v,
       v(i) = i;
       w(i) = i+1.;
     }
-  
+
   v.compress ();
   w.compress ();
 
   v.add (w);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -52,12 +52,12 @@ void test (TrilinosWrappers::Vector &v,
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("38/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -73,25 +73,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 3305804f41ee07091c997ad88fba2667b8a6ffa4..877be625e5506d9de619e6c34879bf050c98b50a 100644 (file)
 
 
 
-// check TrilinosWrappers::Vector::add(scalar, Vector) 
+// check TrilinosWrappers::Vector::add(scalar, Vector)
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -34,13 +34,13 @@ void test (TrilinosWrappers::Vector &v,
       v(i) = i;
       w(i) = i+1.;
     }
-  
+
   v.compress ();
   w.compress ();
 
   v.add (2, w);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -52,12 +52,12 @@ void test (TrilinosWrappers::Vector &v,
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("39/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -73,25 +73,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 822e4b012ed58792bd6437801063db7670fa3749..c766fadab98de81d3bac2a8ebbb621441a4c184c 100644 (file)
@@ -18,9 +18,9 @@
 
 // check TrilinosWrappers::Vector::add(s,V,s,V)
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -36,14 +36,14 @@ void test (TrilinosWrappers::Vector &v,
       w(i) = i+1.;
       x(i) = i+2.;
     }
-  
+
   v.compress ();
   w.compress ();
   x.compress ();
 
   v.add (2, w, 3, x);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -56,12 +56,12 @@ void test (TrilinosWrappers::Vector &v,
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("40/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -78,25 +78,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 4d5e814f36889d9d7f8bc775619288c749f22a06..6a321378ee0b8fc1bb5e75957bcd810fa11a43cc 100644 (file)
 
 
 
-// check TrilinosWrappers::Vector::sadd(s, Vector) 
+// check TrilinosWrappers::Vector::sadd(s, Vector)
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -34,13 +34,13 @@ void test (TrilinosWrappers::Vector &v,
       v(i) = i;
       w(i) = i+1.;
     }
-  
+
   v.compress ();
   w.compress ();
 
   v.sadd (2, w);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -52,12 +52,12 @@ void test (TrilinosWrappers::Vector &v,
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("41/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -73,25 +73,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 1a05d476d6630109cdcc709bd7136b43cf41ab00..be08f159e207b4d47cf1b9ded869a3c6d42952b7 100644 (file)
 
 
 
-// check TrilinosWrappers::Vector::sadd(scalar, scalar, Vector) 
+// check TrilinosWrappers::Vector::sadd(scalar, scalar, Vector)
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -34,13 +34,13 @@ void test (TrilinosWrappers::Vector &v,
       v(i) = i;
       w(i) = i+1.;
     }
-  
+
   v.compress ();
   w.compress ();
 
   v.sadd (3, 2, w);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -52,12 +52,12 @@ void test (TrilinosWrappers::Vector &v,
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("42/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -73,25 +73,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 248fe32c451d05746545fe8f4d16e839ce60f225..e41b82e3681791ef68bf31108f340b7de64790ba 100644 (file)
@@ -18,9 +18,9 @@
 
 // check TrilinosWrappers::Vector::sadd(s,s,V,s,V)
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -36,14 +36,14 @@ void test (TrilinosWrappers::Vector &v,
       w(i) = i+1.;
       x(i) = i+2.;
     }
-  
+
   v.compress ();
   w.compress ();
   x.compress ();
 
   v.sadd (1.5, 2, w, 3, x);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -56,12 +56,12 @@ void test (TrilinosWrappers::Vector &v,
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("43/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -78,25 +78,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 7f0ad70124a04235c01cd5786ca15d07f5fcfd17..a1ad48d97eb4f07ae24cc7f294bec31bfd431272 100644 (file)
@@ -18,9 +18,9 @@
 
 // check TrilinosWrappers::Vector::sadd(s,s,V,s,V,s,V)
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -38,7 +38,7 @@ void test (TrilinosWrappers::Vector &v,
       x(i) = i+2.;
       y(i) = i+3.;
     }
-  
+
   v.compress ();
   w.compress ();
   x.compress ();
@@ -46,7 +46,7 @@ void test (TrilinosWrappers::Vector &v,
 
   v.sadd (1.5, 2, w, 3, x, 4, y);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -60,12 +60,12 @@ void test (TrilinosWrappers::Vector &v,
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("44/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -83,25 +83,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index fef1e5f601e436fe3be2283bb3f66c32b853d8ac..f20d19ba3fe1a8b913dccff65709f49182246f8c 100644 (file)
@@ -18,9 +18,9 @@
 
 // check TrilinosWrappers::Vector::scale
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -34,13 +34,13 @@ void test (TrilinosWrappers::Vector &v,
       v(i) = i;
       w(i) = i+1.;
     }
-  
+
   v.compress ();
   w.compress ();
 
   v.scale (w);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -52,12 +52,12 @@ void test (TrilinosWrappers::Vector &v,
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("45/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -73,25 +73,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index c8080c1bb7687903ddc95484dae3673f58380d4b..5485b473aa3bd9f7e049db15f0e80a4f4787197f 100644 (file)
@@ -18,9 +18,9 @@
 
 // check TrilinosWrappers::Vector::equ (s,V)
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -34,13 +34,13 @@ void test (TrilinosWrappers::Vector &v,
       v(i) = i;
       w(i) = i+1.;
     }
-  
+
   v.compress ();
   w.compress ();
 
   v.equ (2, w);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -52,12 +52,12 @@ void test (TrilinosWrappers::Vector &v,
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("46/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -73,25 +73,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 38e06ea250d4f09e3aa4df0fc42c527fa381725e..065f7b385dcb8bbde5126063a4b1652e78da6e40 100644 (file)
@@ -18,9 +18,9 @@
 
 // check TrilinosWrappers::Vector::equ (s,V,s,V)
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -36,14 +36,14 @@ void test (TrilinosWrappers::Vector &v,
       w(i) = i+1.;
       x(i) = i+2.;
     }
-  
+
   v.compress ();
   w.compress ();
   x.compress ();
 
   v.equ (2, w, 3, x);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i+1., ExcInternalError());
@@ -56,12 +56,12 @@ void test (TrilinosWrappers::Vector &v,
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("47/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -78,25 +78,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 50a31e6581e7b786cae6e1026cb6e920a7c1741e..8ef6de50d818e723fe06f48642e80e899de9539b 100644 (file)
@@ -18,9 +18,9 @@
 
 // check TrilinosWrappers::Vector::ratio
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -36,14 +36,14 @@ void test (TrilinosWrappers::Vector &v,
       w(i) = i+1.;
       x(i) = i+2.;
     }
-  
+
   v.compress ();
   w.compress ();
   x.compress ();
 
   v.ratio (w, x);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   const double eps=typeid(TrilinosScalar)==typeid(double) ? 1e-14 : 1e-5;
   for (unsigned int i=0; i<v.size(); ++i)
     {
@@ -58,12 +58,12 @@ void test (TrilinosWrappers::Vector &v,
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("48/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -80,25 +80,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index f55175db674069e2b2a0ab5b3f5e965686870a53..42818461a300f4e7678000bd7b6afd810d0e4f10 100644 (file)
@@ -18,7 +18,7 @@
 
 // check TrilinosWrappers::Vector::operator = (dealii::Vector<TrilinosScalar>)
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/trilinos_vector.h>
 #include <deal.II/lac/vector.h>
@@ -33,11 +33,11 @@ void test (TrilinosWrappers::Vector &v)
 
   for (unsigned int i=0; i<w.size(); ++i)
     w(i) = i;
-  
+
   v = w;
 
-  
-                                   // make sure we get the expected result
+
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i, ExcInternalError());
@@ -49,12 +49,12 @@ void test (TrilinosWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("49/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -69,25 +69,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index bb1df0ef757fc3db3c2c1311592fed6a5d2e8ed0..c02cda37d5ed86b4ec8e687cea0b8da928aaf228 100644 (file)
@@ -21,7 +21,7 @@
 //         ::operator = (dealii::BlockVector<TrilinosScalar>)
 // with block vectors instead of plain vectors
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/trilinos_block_vector.h>
 #include <deal.II/lac/block_vector.h>
@@ -37,18 +37,18 @@ void test (TrilinosWrappers::BlockVector &v)
 
   for (unsigned int i=0; i<w.size(); ++i)
     w(i) = i;
-  
+
   v = w;
 
-  
-                                   // make sure we get the expected result
+
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i, ExcInternalError());
       Assert (v(i) == i, ExcInternalError());
     }
 
-                                  // now also check the reverse assignment
+  // now also check the reverse assignment
   w = 0;
   w = v;
   for (unsigned int i=0; i<v.size(); ++i)
@@ -56,19 +56,19 @@ void test (TrilinosWrappers::BlockVector &v)
       Assert (w(i) == i, ExcInternalError());
       Assert (v(i) == i, ExcInternalError());
     }
-  
-  
+
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("49a/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -76,7 +76,7 @@ int main (int argc,char **argv)
   try
     {
       {
-       std::vector<types::global_dof_index> sizes (2, 3);
+        std::vector<types::global_dof_index> sizes (2, 3);
         TrilinosWrappers::BlockVector v (sizes);
         test (v);
       }
@@ -84,25 +84,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 1a5a273b6395907e8e4e63956867a15e51e8e5f4..8d11220cb6a3c5bdd01c0032fd08b42b0b3115c1 100644 (file)
@@ -41,14 +41,14 @@ void test (TrilinosWrappers::MPI::BlockVector &v)
   v = w;
 
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w(i) == i, ExcInternalError());
       Assert (v(i) == i, ExcInternalError());
     }
 
-                                  // now also check the reverse assignment
+  // now also check the reverse assignment
   w = 0;
   w = v;
   for (unsigned int i=0; i<v.size(); ++i)
@@ -76,13 +76,13 @@ int main (int argc,char **argv)
   try
     {
       {
-       std::vector<Epetra_Map> sizes;
-       Epetra_Map map(TrilinosWrappers::types::int_type(3),
-                      TrilinosWrappers::types::int_type(3),
-                      0,
-                      Utilities::Trilinos::comm_world());
-       sizes.push_back (map);
-       sizes.push_back (map);
+        std::vector<Epetra_Map> sizes;
+        Epetra_Map map(TrilinosWrappers::types::int_type(3),
+                       TrilinosWrappers::types::int_type(3),
+                       0,
+                       Utilities::Trilinos::comm_world());
+        sizes.push_back (map);
+        sizes.push_back (map);
 
         TrilinosWrappers::MPI::BlockVector v (sizes);
         test (v);
@@ -91,25 +91,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
 
       return 1;
     }
   catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index ed25b2760708d7011d892a59c97999e5512bff70..8a41ce31dd284de4e2ef7fad5a200fde7080a8ac 100644 (file)
@@ -18,7 +18,7 @@
 
 // check TrilinosWrappers::Vector::operator = (Vector<T>) with T!=TrilinosScalar
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/trilinos_vector.h>
 #include <deal.II/lac/vector.h>
@@ -37,13 +37,13 @@ void test (TrilinosWrappers::Vector &v)
       w(i) = i;
       x(i) = i+1;
     }
-  
-                                   // first copy from w and make sure we get
-                                   // the expected result. then copy from x
-                                   // and do the same. in at least one of the
-                                   // two cases, the template argument to
-                                   // Vector<T> must be different from
-                                   // TrilinosScalar
+
+  // first copy from w and make sure we get
+  // the expected result. then copy from x
+  // and do the same. in at least one of the
+  // two cases, the template argument to
+  // Vector<T> must be different from
+  // TrilinosScalar
   v = w;
   for (unsigned int i=0; i<v.size(); ++i)
     {
@@ -59,18 +59,18 @@ void test (TrilinosWrappers::Vector &v)
       Assert (v(i) == i+1, ExcInternalError());
       Assert (x(i) == i+1, ExcInternalError());
     }
-  
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("50/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -85,25 +85,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 64fcf8d82b95dc7c361a57e16518b431b90b4564..0840a069e3de70dc058c680da8f797a7acfef7d2 100644 (file)
 
 
 
-// check copy constructor TrilinosWrappers::Vector::Vector(Vector) 
+// check copy constructor TrilinosWrappers::Vector::Vector(Vector)
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set some entries of the vector
+  // set some entries of the vector
   for (unsigned int i=0; i<v.size(); ++i)
     if (i%3 == 0)
       v(i) = i+1.;
   v.compress ();
 
-                                   // then copy it
+  // then copy it
   TrilinosWrappers::Vector w (v);
   w.compress ();
 
-                                   // make sure they're equal
-  deallog << v*w << ' ' << v.l2_norm() * w.l2_norm()
-          << ' ' << v*w - v.l2_norm() * w.l2_norm() << std::endl;
+  // make sure they're equal
+  deallog << v *w << ' ' << v.l2_norm() * w.l2_norm()
+          << ' ' << v *w - v.l2_norm() * w.l2_norm() << std::endl;
   const double eps=typeid(TrilinosScalar)==typeid(double) ? 1e-14 : 1e-5;
   Assert (std::fabs(v*w - v.l2_norm() * w.l2_norm()) < eps*(v*w),
           ExcInternalError());
@@ -50,12 +50,12 @@ void test (TrilinosWrappers::Vector &v)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("51/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -70,25 +70,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index ca55d7a8e0163de929b780a3da16a7d184446108..3d52338df82ee1ec7ab864d8a8f93198a7381dac 100644 (file)
 // TrilinosWrappers::SparseMatrix::set(). like trilinos_01, but use a different
 // constructor for the sparse matrix
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_sparse_matrix.h>    
+#include <deal.II/lac/trilinos_sparse_matrix.h>
 #include <fstream>
 #include <iostream>
 
 
 void test (TrilinosWrappers::SparseMatrix &m)
 {
-                                   // first set a few entries
+  // first set a few entries
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
         m.set (i,j, i*j*.5+.5);
 
   m.compress ();
-  
-                                   // then make sure we retrieve the same ones
+
+  // then make sure we retrieve the same ones
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -55,12 +55,12 @@ void test (TrilinosWrappers::SparseMatrix &m)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("52/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -71,32 +71,32 @@ int main (int argc,char **argv)
         std::vector<unsigned int> row_lengths (5,3U);
         row_lengths.back() = 2;
         TrilinosWrappers::SparseMatrix m (static_cast<types::global_dof_index>(5U),
-            static_cast<types::global_dof_index>(5U),row_lengths);
+                                          static_cast<types::global_dof_index>(5U),row_lengths);
         test (m);
       }
     }
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index aad3c358dbc2a169680c652f095fa6e51897cd2e..1a0303f83f3cb7680c41fce08a22ea23abf81923 100644 (file)
@@ -18,9 +18,9 @@
 
 // check TrilinosWrappers::Vector::operator() in set, and later in add-mode
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -28,9 +28,9 @@
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -42,25 +42,25 @@ void test (TrilinosWrappers::Vector &v)
 
   v.compress ();
 
-                                   // check that they are ok, and this time
-                                   // all of them
+  // check that they are ok, and this time
+  // all of them
   for (unsigned int i=0; i<v.size(); ++i)
     Assert ((((pattern[i] == true) && (v(i) == 2*i))
              ||
              ((pattern[i] == false) && (v(i) == 0))),
-             ExcInternalError());
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("53/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -75,25 +75,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index a251d983c3be2fdcf08c18249bcb2d4114b8250b..e3c22e54610462b3e5002f185e75839a23033fac 100644 (file)
@@ -18,9 +18,9 @@
 
 // check TrilinosWrappers::Vector::operator() in set, and later in -= mode
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -28,9 +28,9 @@
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -42,25 +42,25 @@ void test (TrilinosWrappers::Vector &v)
 
   v.compress ();
 
-                                   // check that they are ok, and this time
-                                   // all of them
+  // check that they are ok, and this time
+  // all of them
   for (unsigned int i=0; i<v.size(); ++i)
     Assert ((((pattern[i] == true) && (v(i) == i))
              ||
              ((pattern[i] == false) && (v(i) == 0))),
-             ExcInternalError());
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("54/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -75,25 +75,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 6a4716ee309d7ad1e7be902d08d30c6d51896cb1..e78d1208685f59de9f10dc1d18e163f081b290e2 100644 (file)
@@ -18,9 +18,9 @@
 
 // check TrilinosWrappers::Vector::operator() in set, and later in *= mode
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -28,9 +28,9 @@
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -42,25 +42,25 @@ void test (TrilinosWrappers::Vector &v)
 
   v.compress ();
 
-                                   // check that they are ok, and this time
-                                   // all of them
+  // check that they are ok, and this time
+  // all of them
   for (unsigned int i=0; i<v.size(); ++i)
     Assert ((((pattern[i] == true) && (v(i) == 2*i))
              ||
              ((pattern[i] == false) && (v(i) == 0))),
-             ExcInternalError());
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("55/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -75,25 +75,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index ec086eb542ff30bd25ade2628a5f0188ca3cc037..9ed16320e00344d81e986076589f6bb916f63982 100644 (file)
@@ -18,9 +18,9 @@
 
 // check TrilinosWrappers::Vector::operator() in set, and later in /= mode
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -28,9 +28,9 @@
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set only certain elements of the
-                                   // vector. have a bit pattern of where we
-                                   // actually wrote elements to
+  // set only certain elements of the
+  // vector. have a bit pattern of where we
+  // actually wrote elements to
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -42,25 +42,25 @@ void test (TrilinosWrappers::Vector &v)
 
   v.compress ();
 
-                                   // check that they are ok, and this time
-                                   // all of them
+  // check that they are ok, and this time
+  // all of them
   for (unsigned int i=0; i<v.size(); ++i)
     Assert ((((pattern[i] == true) && (v(i) == i))
              ||
              ((pattern[i] == false) && (v(i) == 0))),
-             ExcInternalError());
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("56/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -75,25 +75,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index f75d300553145f0f6a0694d76aeb0ddcbf94cc80..d2b0d186dcd052e0241bafd36bd6a0f6521abd1c 100644 (file)
@@ -18,9 +18,9 @@
 
 // check TrilinosWrappers::Vector::is_non_zero
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -28,8 +28,8 @@
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set only certain elements of the
-                                   // vector. they are all positive
+  // set only certain elements of the
+  // vector. they are all positive
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -39,26 +39,26 @@ void test (TrilinosWrappers::Vector &v)
 
   v.compress ();
 
-                                   // check that the vector is really
-                                   // non-negative
+  // check that the vector is really
+  // non-negative
   Assert (v.is_non_negative() == true, ExcInternalError());
 
-                                   // then set a single element to a negative
-                                   // value and check again
+  // then set a single element to a negative
+  // value and check again
   v(v.size()/2) = -1;
-  Assert (v.is_non_negative() == false, ExcInternalError());  
+  Assert (v.is_non_negative() == false, ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("57/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -73,25 +73,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 4a3e896674627f81bf2c19e36187beaddaa6ebad..53965c80e2cfbed007507a6ed64d1369d869b81e 100644 (file)
@@ -18,7 +18,7 @@
 
 // check ::Vector (const TrilinosWrappers::Vector &) copy constructor
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/trilinos_vector.h>
 #include <deal.II/lac/vector.h>
@@ -30,8 +30,8 @@
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set only certain elements of the
-                                   // vector.
+  // set only certain elements of the
+  // vector.
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -43,24 +43,24 @@ void test (TrilinosWrappers::Vector &v)
 
   Vector<double> w (v);
   Vector<float>  x (v);
-  
+
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == w(i), ExcInternalError());
       Assert (v(i) == x(i), ExcInternalError());
     }
-      
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("58/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -75,25 +75,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 01c646d352ee284fa08c139f3cd8752cbceedeb0..cf6b7b26155daa8242a2673d1de88ca20f5d6fea 100644 (file)
@@ -18,7 +18,7 @@
 
 // check TrilinosWrappers::Vector (const ::Vector &) copy constructor
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/trilinos_vector.h>
 #include <deal.II/lac/vector.h>
@@ -30,8 +30,8 @@
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set only certain elements of the
-                                   // vector.
+  // set only certain elements of the
+  // vector.
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -46,24 +46,24 @@ void test (TrilinosWrappers::Vector &v)
 
   TrilinosWrappers::Vector w1 (w);
   TrilinosWrappers::Vector x1 (x);
-  
+
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w1(i) == w(i), ExcInternalError());
       Assert (x1(i) == x(i), ExcInternalError());
     }
-      
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("59/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -78,25 +78,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index ff005897a77d84f652911709bb8ed7d6804d97e7..a2926b92be7eccc9ed94463000590acdd81ad503 100644 (file)
@@ -18,7 +18,7 @@
 
 // check ::Vector::operator = (const TrilinosWrappers::Vector &)
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/trilinos_vector.h>
 #include <deal.II/lac/vector.h>
@@ -30,8 +30,8 @@
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set only certain elements of the
-                                   // vector.
+  // set only certain elements of the
+  // vector.
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -41,26 +41,28 @@ void test (TrilinosWrappers::Vector &v)
 
   v.compress ();
 
-  Vector<double> w; w=v;
-  Vector<float>  x; x=v;
-  
+  Vector<double> w;
+  w=v;
+  Vector<float>  x;
+  x=v;
+
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == w(i), ExcInternalError());
       Assert (v(i) == x(i), ExcInternalError());
     }
-      
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("60/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -75,25 +77,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 3391f16cfa1241db87c5f93c8a30d93142c7e7fe..1ce9d92c6c6db99afe63fbcce5879f7c8a0d15b1 100644 (file)
@@ -18,7 +18,7 @@
 
 // check TrilinosWrappers::Vector::operator = (const ::Vector &)
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/trilinos_vector.h>
 #include <deal.II/lac/vector.h>
@@ -30,8 +30,8 @@
 
 void test (TrilinosWrappers::Vector &v)
 {
-                                   // set only certain elements of the
-                                   // vector.
+  // set only certain elements of the
+  // vector.
   std::vector<bool> pattern (v.size(), false);
   for (unsigned int i=0; i<v.size(); i+=1+i)
     {
@@ -41,29 +41,33 @@ void test (TrilinosWrappers::Vector &v)
 
   v.compress ();
 
-  Vector<double> w(v.size()); w=v;
-  Vector<float>  x(v.size()); x=v;
+  Vector<double> w(v.size());
+  w=v;
+  Vector<float>  x(v.size());
+  x=v;
+
+  TrilinosWrappers::Vector w1(v.size());
+  w1=w;
+  TrilinosWrappers::Vector x1(v.size());
+  x1=x;
 
-  TrilinosWrappers::Vector w1(v.size()); w1=w;
-  TrilinosWrappers::Vector x1(v.size()); x1=x;
-  
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (w1(i) == w(i), ExcInternalError());
       Assert (x1(i) == x(i), ExcInternalError());
     }
-      
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("61/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -78,25 +82,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index fa735847dff8734490c02b0f197ec5794bd2173d..ccc7997a96d96b4866061d94619b4255629e07c9 100644 (file)
@@ -18,7 +18,7 @@
 
 // check TrilinosWrappers::SparseMatrix::clear ()
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/trilinos_sparse_matrix.h>
 #include <deal.II/lac/vector.h>
@@ -43,12 +43,12 @@ void test (TrilinosWrappers::SparseMatrix &m)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("62/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -63,25 +63,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 4c2381e57b481d29c5f7801f6dc555d33d32ce08..9a450d4a32a39ee0802401af3f3cf93d8efd32ed 100644 (file)
@@ -16,7 +16,7 @@
 
 
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/trilinos_sparse_matrix.h>
 #include <deal.II/lac/vector.h>
@@ -32,7 +32,7 @@ void test (TrilinosWrappers::SparseMatrix &m)
   Assert (m.n() == 100, ExcInternalError());
 
   m = 0;
-  
+
   Assert (m.m() == 100, ExcInternalError());
   Assert (m.n() == 100, ExcInternalError());
 
@@ -41,12 +41,12 @@ void test (TrilinosWrappers::SparseMatrix &m)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("63/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -61,25 +61,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 8cbefaf85ff27cc04140754ce2780018908eb9c5..b769be1cd582d295c55eb3a6e0ee040339a8d2ad 100644 (file)
@@ -59,22 +59,22 @@ int main (int argc,char **argv)
   try
     {
       {
-       const unsigned int n_dofs=420;
-                                        // check
-                                        // TrilinosWrappers::SparseMatrix
+        const unsigned int n_dofs=420;
+        // check
+        // TrilinosWrappers::SparseMatrix
         TrilinosWrappers::SparseMatrix
-         v1 (n_dofs, n_dofs, 5U);
+        v1 (n_dofs, n_dofs, 5U);
         test (v1);
 
-                                        // check
-                                        // TrilinosWrappers::SparseMatrix
-       const unsigned int n_jobs =
-         Utilities::Trilinos::get_n_mpi_processes(Utilities::Trilinos::comm_world());
-       Assert(n_dofs%n_jobs==0, ExcInternalError());
-       const unsigned int n_local_dofs=n_dofs/n_jobs;
-       Epetra_Map map(static_cast<TrilinosWrappers::types::int_type>(n_dofs),
-                      static_cast<TrilinosWrappers::types::int_type>(n_local_dofs),
-                      Utilities::Trilinos::comm_world());
+        // check
+        // TrilinosWrappers::SparseMatrix
+        const unsigned int n_jobs =
+          Utilities::Trilinos::get_n_mpi_processes(Utilities::Trilinos::comm_world());
+        Assert(n_dofs%n_jobs==0, ExcInternalError());
+        const unsigned int n_local_dofs=n_dofs/n_jobs;
+        Epetra_Map map(static_cast<TrilinosWrappers::types::int_type>(n_dofs),
+                       static_cast<TrilinosWrappers::types::int_type>(n_local_dofs),
+                       Utilities::Trilinos::comm_world());
         TrilinosWrappers::SparseMatrix v2 (map, 5);
         test (v2);
       }
@@ -82,25 +82,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
 
       return 1;
     }
   catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 9c7243a970626063911e4c2559a7add1a1655464..956de0cc21db237b38e3e319f20c862d3934bcc6 100644 (file)
@@ -31,8 +31,8 @@
 void test ()
 {
   TrilinosWrappers::MPI::Vector
-    v (Epetra_Map(TrilinosWrappers::types::int_type(100),0,
-                 Utilities::Trilinos::comm_world()));
+  v (Epetra_Map(TrilinosWrappers::types::int_type(100),0,
+                Utilities::Trilinos::comm_world()));
   v(0) = 1;
   v = 0;
 
@@ -60,25 +60,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
 
       return 1;
     }
   catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index b5f253789a2cca95f9dd0354f0102a6ed585f8ea..438528210784f9e93bb81d96a71630e0427fbfc4 100644 (file)
@@ -18,7 +18,7 @@
 
 // check TrilinosWrappers::MatrixBase::clear_row ()
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/trilinos_sparse_matrix.h>
 #include <deal.II/lac/vector.h>
@@ -33,7 +33,7 @@ void test (TrilinosWrappers::SparseMatrix &m)
   Assert (m.m() != 0, ExcInternalError());
   Assert (m.n() != 0, ExcInternalError());
 
-                                   // build a tri-diagonal pattern
+  // build a tri-diagonal pattern
   double norm_sqr = 0;
   unsigned int nnz = 0;
   const unsigned int N = m.m();
@@ -46,7 +46,7 @@ void test (TrilinosWrappers::SparseMatrix &m)
           norm_sqr += s*s;
           ++nnz;
         }
-      
+
       if (i<N-5)
         {
           const double s = rand();
@@ -54,14 +54,14 @@ void test (TrilinosWrappers::SparseMatrix &m)
           norm_sqr += s*s;
           ++nnz;
         }
-      
+
       const double s = rand();
       m.set (i,i,s);
       norm_sqr += s*s;
       ++nnz;
     }
   m.compress (VectorOperation::insert);
-  
+
   deallog << m.frobenius_norm() << ' ' << std::sqrt (norm_sqr)
           << std::endl;
   deallog << m.n_nonzero_elements() << ' ' << nnz << std::endl;
@@ -71,14 +71,14 @@ void test (TrilinosWrappers::SparseMatrix &m)
           ExcInternalError());
   Assert (m.n_nonzero_elements()-nnz == 0, ExcInternalError());
 
-                                   // now remove the entries of row N/2
+  // now remove the entries of row N/2
   for (unsigned int i=0; i<N; ++i)
     {
       const double s = m.el(N/2,i);
       norm_sqr -= s*s;
     }
   m.clear_row (N/2);
-  
+
   deallog << m.frobenius_norm() << ' ' << std::sqrt (norm_sqr)
           << std::endl;
   deallog << m.n_nonzero_elements() << ' ' << nnz << std::endl;
@@ -87,22 +87,22 @@ void test (TrilinosWrappers::SparseMatrix &m)
           < std::fabs (std::sqrt (norm_sqr)),
           ExcInternalError());
 
-                                   // make sure that zeroing out rows does at
-                                   // least not add new nonzero entries (it
-                                   // may remove some, though)
+  // make sure that zeroing out rows does at
+  // least not add new nonzero entries (it
+  // may remove some, though)
   Assert (m.n_nonzero_elements() <= nnz, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("66/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -117,25 +117,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index d85e07dee9c52505eb218897da80a4b5d5d7bc1d..9421b0a01842574d32bc82326a06dde5dadf33bb 100644 (file)
@@ -18,7 +18,7 @@
 
 // check TrilinosWrappers::MatrixBase::clear_rows ()
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/trilinos_sparse_matrix.h>
 #include <deal.II/lac/vector.h>
@@ -33,7 +33,7 @@ void test (TrilinosWrappers::SparseMatrix &m)
   Assert (m.m() != 0, ExcInternalError());
   Assert (m.n() != 0, ExcInternalError());
 
-                                   // build a tri-diagonal pattern
+  // build a tri-diagonal pattern
   double norm_sqr = 0;
   unsigned int nnz = 0;
   const unsigned int N = m.m();
@@ -46,7 +46,7 @@ void test (TrilinosWrappers::SparseMatrix &m)
           norm_sqr += s*s;
           ++nnz;
         }
-      
+
       if (i<N-5)
         {
           const double s = rand();
@@ -54,14 +54,14 @@ void test (TrilinosWrappers::SparseMatrix &m)
           norm_sqr += s*s;
           ++nnz;
         }
-      
+
       const double s = rand();
       m.set (i,i,s);
       norm_sqr += s*s;
       ++nnz;
     }
   m.compress (VectorOperation::insert);
-  
+
   deallog << m.frobenius_norm() << ' ' << std::sqrt (norm_sqr)
           << std::endl;
   deallog << m.n_nonzero_elements() << ' ' << nnz << std::endl;
@@ -71,7 +71,7 @@ void test (TrilinosWrappers::SparseMatrix &m)
           ExcInternalError());
   Assert (m.n_nonzero_elements()-nnz == 0, ExcInternalError());
 
-                                   // now remove the entries of rows N/2 and N/3
+  // now remove the entries of rows N/2 and N/3
   for (unsigned int i=0; i<N; ++i)
     {
       const double s = m.el(N/2,i);
@@ -84,7 +84,7 @@ void test (TrilinosWrappers::SparseMatrix &m)
     }
   const types::global_dof_index rows[2] = { N/3, N/2 };
   m.clear_rows (std::vector<types::global_dof_index>(&rows[0], &rows[2]));
-  
+
   deallog << m.frobenius_norm() << ' ' << std::sqrt (norm_sqr)
           << std::endl;
   deallog << m.n_nonzero_elements() << ' ' << nnz << std::endl;
@@ -93,22 +93,22 @@ void test (TrilinosWrappers::SparseMatrix &m)
           < std::fabs (std::sqrt (norm_sqr)),
           ExcInternalError());
 
-                                   // make sure that zeroing out rows does at
-                                   // least not add new nonzero entries (it
-                                   // may remove some, though)
+  // make sure that zeroing out rows does at
+  // least not add new nonzero entries (it
+  // may remove some, though)
   Assert (m.n_nonzero_elements() <= nnz, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("67/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -123,25 +123,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index ade8e96ff8e1930a235b12faa76ef17e55d6fa88..603cdf7bb2becba67aef60e47896fba615fbf4e8 100644 (file)
@@ -18,7 +18,7 @@
 
 // check TrilinosWrappers::MatrixBase::clear_row () with used second argument
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/trilinos_sparse_matrix.h>
 #include <deal.II/lac/vector.h>
@@ -33,7 +33,7 @@ void test (TrilinosWrappers::SparseMatrix &m)
   Assert (m.m() != 0, ExcInternalError());
   Assert (m.n() != 0, ExcInternalError());
 
-                                   // build a tri-diagonal pattern
+  // build a tri-diagonal pattern
   double norm_sqr = 0;
   unsigned int nnz = 0;
   const unsigned int N = m.m();
@@ -46,7 +46,7 @@ void test (TrilinosWrappers::SparseMatrix &m)
           norm_sqr += s*s;
           ++nnz;
         }
-      
+
       if (i<N-5)
         {
           const double s = rand();
@@ -54,14 +54,14 @@ void test (TrilinosWrappers::SparseMatrix &m)
           norm_sqr += s*s;
           ++nnz;
         }
-      
+
       const double s = rand();
       m.set (i,i,s);
       norm_sqr += s*s;
       ++nnz;
     }
   m.compress (VectorOperation::insert);
-  
+
   deallog << m.frobenius_norm() << ' ' << std::sqrt (norm_sqr)
           << std::endl;
   deallog << m.n_nonzero_elements() << ' ' << nnz << std::endl;
@@ -71,8 +71,8 @@ void test (TrilinosWrappers::SparseMatrix &m)
           ExcInternalError());
   Assert (m.n_nonzero_elements()-nnz == 0, ExcInternalError());
 
-                                   // now remove the entries of row N/2. set
-                                   // diagonal entries to rnd
+  // now remove the entries of row N/2. set
+  // diagonal entries to rnd
   const double rnd = rand();
   for (unsigned int i=0; i<N; ++i)
     {
@@ -80,9 +80,9 @@ void test (TrilinosWrappers::SparseMatrix &m)
       norm_sqr -= s*s;
     }
   norm_sqr += rnd*rnd;
-  
+
   m.clear_row (N/2, rnd);
-  
+
   deallog << m.frobenius_norm() << ' ' << std::sqrt (norm_sqr)
           << std::endl;
   deallog << m.n_nonzero_elements() << ' ' << nnz << std::endl;
@@ -91,22 +91,22 @@ void test (TrilinosWrappers::SparseMatrix &m)
           < std::fabs (std::sqrt (norm_sqr)),
           ExcInternalError());
 
-                                   // make sure that zeroing out rows does at
-                                   // least not add new nonzero entries (it
-                                   // may remove some, though)
+  // make sure that zeroing out rows does at
+  // least not add new nonzero entries (it
+  // may remove some, though)
   Assert (m.n_nonzero_elements() <= nnz, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("68/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -121,25 +121,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index f7d105a9d5afcb9f12c87a667efec1a8726c109f..3996ea2dff809baf020f450e7a3f4e311ac652f5 100644 (file)
@@ -18,7 +18,7 @@
 
 // check TrilinosWrappers::MatrixBase::clear_rows () with used second argument
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/trilinos_sparse_matrix.h>
 #include <deal.II/lac/vector.h>
@@ -33,7 +33,7 @@ void test (TrilinosWrappers::SparseMatrix &m)
   Assert (m.m() != 0, ExcInternalError());
   Assert (m.n() != 0, ExcInternalError());
 
-                                   // build a tri-diagonal pattern
+  // build a tri-diagonal pattern
   double norm_sqr = 0;
   unsigned int nnz = 0;
   const unsigned int N = m.m();
@@ -46,7 +46,7 @@ void test (TrilinosWrappers::SparseMatrix &m)
           norm_sqr += s*s;
           ++nnz;
         }
-      
+
       if (i<N-5)
         {
           const double s = rand();
@@ -54,14 +54,14 @@ void test (TrilinosWrappers::SparseMatrix &m)
           norm_sqr += s*s;
           ++nnz;
         }
-      
+
       const double s = rand();
       m.set (i,i,s);
       norm_sqr += s*s;
       ++nnz;
     }
   m.compress (VectorOperation::insert);
-  
+
   deallog << m.frobenius_norm() << ' ' << std::sqrt (norm_sqr)
           << std::endl;
   deallog << m.n_nonzero_elements() << ' ' << nnz << std::endl;
@@ -71,8 +71,8 @@ void test (TrilinosWrappers::SparseMatrix &m)
           ExcInternalError());
   Assert (m.n_nonzero_elements()-nnz == 0, ExcInternalError());
 
-                                   // now remove the entries of rows N/2 and
-                                   // N/3. set diagonal entries to rnd
+  // now remove the entries of rows N/2 and
+  // N/3. set diagonal entries to rnd
   const double rnd = rand();
   for (unsigned int i=0; i<N; ++i)
     {
@@ -85,10 +85,10 @@ void test (TrilinosWrappers::SparseMatrix &m)
       norm_sqr -= s*s;
     }
   norm_sqr += 2*rnd*rnd;
-  
+
   const types::global_dof_index rows[2] = { N/3, N/2 };
   m.clear_rows (std::vector<types::global_dof_index>(&rows[0], &rows[2]), rnd);
-  
+
   deallog << m.frobenius_norm() << ' ' << std::sqrt (norm_sqr)
           << std::endl;
   deallog << m.n_nonzero_elements() << ' ' << nnz << std::endl;
@@ -97,22 +97,22 @@ void test (TrilinosWrappers::SparseMatrix &m)
           < std::fabs (std::sqrt (norm_sqr)),
           ExcInternalError());
 
-                                   // make sure that zeroing out rows does at
-                                   // least not add new nonzero entries (it
-                                   // may remove some, though)
+  // make sure that zeroing out rows does at
+  // least not add new nonzero entries (it
+  // may remove some, though)
   Assert (m.n_nonzero_elements() <= nnz, ExcInternalError());
-  
+
   deallog << "OK" << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("69/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -127,25 +127,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 1fb4fcfd85f6311f39d416abf5bdec2959bc79da..b4dcdafa1084d133354d2dc326e576f8c192f522 100644 (file)
 
 // check TrilinosScalar
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/base/logstream.h>
 #include <deal.II/lac/trilinos_vector.h>
 
 #include <fstream>
 
-int main (int argc, char** argv) 
+int main (int argc, char **argv)
 {
   std::ofstream logfile("70/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
index 860d98e3259345f4197310319d43e713a15d50d7..eb0fba5888d4ddd656424dc504e32a4ba7f31d4b 100644 (file)
@@ -22,7 +22,7 @@
 // as they would result from a vector-valued problem with a Laplace operator
 // in 1D in each component
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/trilinos_block_sparse_matrix.h>
 #include <deal.II/lac/full_matrix.h>
 
 void test ()
 {
-                                   // first set a few entries one-by-one in
-                                   // a small matrix
+  // first set a few entries one-by-one in
+  // a small matrix
   const unsigned int block_size = 16;
   TrilinosWrappers::SparseMatrix m_small (block_size,block_size,3U);
   for (unsigned int i=0; i<block_size; ++i)
     for (unsigned int j=0; j<block_size; ++j)
       if (std::fabs((double)i-j) < 2)
-       {
-         double value;
-         if (i == j) 
-           if (i>0 && i<m_small.m()-1)
-             value = 2.;
-           else 
-             value = 1.;
-         else
-           value = -1.;
-
-         m_small.set (i,j, value);
-       }
+        {
+          double value;
+          if (i == j)
+            if (i>0 && i<m_small.m()-1)
+              value = 2.;
+            else
+              value = 1.;
+          else
+            value = -1.;
+
+          m_small.set (i,j, value);
+        }
   m_small.compress();
 
-                                  // Then build two matrices consisting of
-                                  // several copies of the small
-                                  // matrix. The matrix m2 will be filled
-                                  // later.
+  // Then build two matrices consisting of
+  // several copies of the small
+  // matrix. The matrix m2 will be filled
+  // later.
   TrilinosWrappers::BlockSparseMatrix m, m2;
   m.reinit(3,2);
   m2.reinit(3,2);
@@ -65,61 +65,61 @@ void test ()
       m.block(block_row, block_col).copy_from(m_small);
   m.collect_sizes();
 
-                                  // fill the second matrix with the
-                                  // sparsity pattern (but not the
-                                  // values)
+  // fill the second matrix with the
+  // sparsity pattern (but not the
+  // values)
   for (unsigned int block_row = 0; block_row<m.n_block_rows(); ++block_row)
     for (unsigned int block_col = 0; block_col<m.n_block_cols(); ++block_col)
       m2.block(block_row, block_col).reinit(m_small);
   m2.collect_sizes();
 
-                                  // now add the same elements from a full
-                                  // matrix
+  // now add the same elements from a full
+  // matrix
   {
     FullMatrix<double> full_matrix(2*m.n_block_rows(),2*m.n_block_cols());
     for (unsigned int block_row = 0; block_row<m.n_block_rows(); ++block_row)
       for (unsigned int block_col = 0; block_col<m.n_block_cols(); ++block_col)
-       {
-         full_matrix(block_row*2,block_col*2) = 1;
-         full_matrix(block_row*2+1,block_col*2+1) = 1.;
-         full_matrix(block_row*2,block_col*2+1) = -1;
-         full_matrix(block_row*2+1,block_col*2) = -1.;
-       }
+        {
+          full_matrix(block_row*2,block_col*2) = 1;
+          full_matrix(block_row*2+1,block_col*2+1) = 1.;
+          full_matrix(block_row*2,block_col*2+1) = -1;
+          full_matrix(block_row*2+1,block_col*2) = -1.;
+        }
 
     std::vector<types::global_dof_index> local_row_indices (2*m.n_block_rows());
     std::vector<types::global_dof_index> local_col_indices (2*m.n_block_cols());
 
     for (unsigned int i=0; i<block_size-1; ++i)
       {
-       for (unsigned int block_row = 0; block_row<m.n_block_rows(); ++block_row)
-         {
-           local_row_indices[2*block_row] = block_row*block_size + i;
-           local_row_indices[2*block_row+1] = block_row*block_size + i + 1;
-         }
-       for (unsigned int block_col = 0; block_col<m.n_block_cols(); ++block_col)
-         {
-           local_col_indices[2*block_col] = block_col*block_size + i;
-           local_col_indices[2*block_col+1] = block_col*block_size + i + 1;
-         }
-
-       m2.add (local_row_indices, local_col_indices, full_matrix);
+        for (unsigned int block_row = 0; block_row<m.n_block_rows(); ++block_row)
+          {
+            local_row_indices[2*block_row] = block_row*block_size + i;
+            local_row_indices[2*block_row+1] = block_row*block_size + i + 1;
+          }
+        for (unsigned int block_col = 0; block_col<m.n_block_cols(); ++block_col)
+          {
+            local_col_indices[2*block_col] = block_col*block_size + i;
+            local_col_indices[2*block_col+1] = block_col*block_size + i + 1;
+          }
+
+        m2.add (local_row_indices, local_col_indices, full_matrix);
       }
   }
 
   m2.compress();
 
-                                  // subtract the matrix m from this one,
-                                  // we should get a zero matrix
+  // subtract the matrix m from this one,
+  // we should get a zero matrix
   double norm = 0;
   for (unsigned int block_row = 0; block_row<m.n_block_rows(); ++block_row)
     for (unsigned int block_col = 0; block_col<m.n_block_cols(); ++block_col)
       {
-       m2.block(block_row,block_col).add(-1.0, m.block(block_row,block_col));
+        m2.block(block_row,block_col).add(-1.0, m.block(block_row,block_col));
 
-                                  // calculate the Frobenius norm of the
-                                  // matrix in order to check whether all
-                                  // elements really are zero
-       norm += m2.block(block_row,block_col).frobenius_norm();
+        // calculate the Frobenius norm of the
+        // matrix in order to check whether all
+        // elements really are zero
+        norm += m2.block(block_row,block_col).frobenius_norm();
       }
   Assert (norm == 0, ExcInternalError());
 
@@ -128,12 +128,12 @@ void test ()
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("block_sparse_matrix_add_01/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -146,25 +146,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 8b5795b6652bc0565f4e1a557efbeefc9ebdec6a..8e9a11243e5c62feb087ed79b8c113aa61fdc03d 100644 (file)
@@ -22,7 +22,7 @@
 // would result from a vector-valued problem with a Laplace operator in 1D
 // in each component
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/trilinos_block_sparse_matrix.h>
 #include <deal.II/lac/full_matrix.h>
 
 void test ()
 {
-                                   // first set a few entries one-by-one in
-                                   // a small matrix
+  // first set a few entries one-by-one in
+  // a small matrix
   const unsigned int block_size = 16;
   TrilinosWrappers::SparseMatrix m_small (block_size,block_size,3U);
   for (unsigned int i=0; i<block_size; ++i)
     for (unsigned int j=0; j<block_size; ++j)
       if (std::fabs((double)i-j) < 2)
-       {
-         double value;
-         if (i == j) 
-           value = 1.;            // for this example, set the values to
-                                  // one and not some to two, since we do
-                                  // not insert elements into the sparsity
-                                  // pattern, but only set already present
-                                  // ones.
-         else
-           value = -1.;
-
-         m_small.set (i,j, value);
-       }
+        {
+          double value;
+          if (i == j)
+            value = 1.;      // for this example, set the values to
+          // one and not some to two, since we do
+          // not insert elements into the sparsity
+          // pattern, but only set already present
+          // ones.
+          else
+            value = -1.;
+
+          m_small.set (i,j, value);
+        }
   m_small.compress();
 
-                                  // Then build two matrices consisting of
-                                  // several copies of the small
-                                  // matrix. The matrix m2 will be filled
-                                  // later.
+  // Then build two matrices consisting of
+  // several copies of the small
+  // matrix. The matrix m2 will be filled
+  // later.
   TrilinosWrappers::BlockSparseMatrix m, m2;
   m.reinit(3,2);
   m2.reinit(3,2);
@@ -66,61 +66,61 @@ void test ()
       m.block(block_row, block_col).copy_from(m_small);
   m.collect_sizes();
 
-                                  // fill the second matrix with the
-                                  // sparsity pattern (but not the
-                                  // values)
+  // fill the second matrix with the
+  // sparsity pattern (but not the
+  // values)
   for (unsigned int block_row = 0; block_row<m.n_block_rows(); ++block_row)
     for (unsigned int block_col = 0; block_col<m.n_block_cols(); ++block_col)
       m2.block(block_row, block_col).reinit(m_small);
   m2.collect_sizes();
 
-                                  // now add the same elements from a full
-                                  // matrix
+  // now add the same elements from a full
+  // matrix
   {
     FullMatrix<double> full_matrix(2*m.n_block_rows(),2*m.n_block_cols());
     for (unsigned int block_row = 0; block_row<m.n_block_rows(); ++block_row)
       for (unsigned int block_col = 0; block_col<m.n_block_cols(); ++block_col)
-       {
-         full_matrix(block_row*2,block_col*2) = 1;
-         full_matrix(block_row*2+1,block_col*2+1) = 1.;
-         full_matrix(block_row*2,block_col*2+1) = -1;
-         full_matrix(block_row*2+1,block_col*2) = -1.;
-       }
+        {
+          full_matrix(block_row*2,block_col*2) = 1;
+          full_matrix(block_row*2+1,block_col*2+1) = 1.;
+          full_matrix(block_row*2,block_col*2+1) = -1;
+          full_matrix(block_row*2+1,block_col*2) = -1.;
+        }
 
     std::vector<types::global_dof_index> local_row_indices (2*m.n_block_rows());
     std::vector<types::global_dof_index> local_col_indices (2*m.n_block_cols());
 
     for (unsigned int i=0; i<block_size-1; ++i)
       {
-       for (unsigned int block_row = 0; block_row<m.n_block_rows(); ++block_row)
-         {
-           local_row_indices[2*block_row] = block_row*block_size + i;
-           local_row_indices[2*block_row+1] = block_row*block_size + i + 1;
-         }
-       for (unsigned int block_col = 0; block_col<m.n_block_cols(); ++block_col)
-         {
-           local_col_indices[2*block_col] = block_col*block_size + i;
-           local_col_indices[2*block_col+1] = block_col*block_size + i + 1;
-         }
-
-       m2.set (local_row_indices, local_col_indices, full_matrix);
+        for (unsigned int block_row = 0; block_row<m.n_block_rows(); ++block_row)
+          {
+            local_row_indices[2*block_row] = block_row*block_size + i;
+            local_row_indices[2*block_row+1] = block_row*block_size + i + 1;
+          }
+        for (unsigned int block_col = 0; block_col<m.n_block_cols(); ++block_col)
+          {
+            local_col_indices[2*block_col] = block_col*block_size + i;
+            local_col_indices[2*block_col+1] = block_col*block_size + i + 1;
+          }
+
+        m2.set (local_row_indices, local_col_indices, full_matrix);
       }
   }
 
   m2.compress();
 
-                                  // subtract the matrix m from this one,
-                                  // we should get a zero matrix
+  // subtract the matrix m from this one,
+  // we should get a zero matrix
   double norm = 0;
   for (unsigned int block_row = 0; block_row<m.n_block_rows(); ++block_row)
     for (unsigned int block_col = 0; block_col<m.n_block_cols(); ++block_col)
       {
-       m2.block(block_row,block_col).add(-1.0, m.block(block_row,block_col));
+        m2.block(block_row,block_col).add(-1.0, m.block(block_row,block_col));
 
-                                  // calculate the Frobenius norm of the
-                                  // matrix in order to check whether all
-                                  // elements really are zero
-       norm += m2.block(block_row,block_col).frobenius_norm();
+        // calculate the Frobenius norm of the
+        // matrix in order to check whether all
+        // elements really are zero
+        norm += m2.block(block_row,block_col).frobenius_norm();
       }
   Assert (norm == 0, ExcInternalError());
 
@@ -129,12 +129,12 @@ void test ()
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("block_sparse_matrix_set_01/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -147,25 +147,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index bee5eb70b022cee771b26670c02086b0e9329c98..5023bdcad929d84723987ccaa3ea512165bbd431 100644 (file)
@@ -32,7 +32,7 @@ void test (const unsigned int size_1, const unsigned int size_2)
   TrilinosWrappers::SparseMatrix m(size_1, size_2, size_2);
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
   m.compress (VectorOperation::insert);
 
   TrilinosWrappers::BlockSparseMatrix m_block;
@@ -53,10 +53,10 @@ void test (const unsigned int size_1, const unsigned int size_2)
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
 
-                                   // w:=Mv
+  // w:=Mv
   m_block.vmult (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<m.m(); ++i)
     {
       double result = 0;
@@ -72,7 +72,7 @@ void test (const unsigned int size_1, const unsigned int size_2)
     w(i) = i;
 
   m_block.Tvmult (v, w);
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<m.n(); ++i)
     {
       double result = 0;
@@ -106,25 +106,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
 
       return 1;
     }
   catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 7332bc53f3fd9fa82cd2d6674b04b9f26a570aff..f751fdb2190ec907cc730a7a489707e9e64f5c83 100644 (file)
@@ -33,7 +33,7 @@ void test (const unsigned int size_1, const unsigned int size_2)
   TrilinosWrappers::SparseMatrix m(size_1, size_2, size_2);
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
   m.compress (VectorOperation::insert);
 
   TrilinosWrappers::BlockSparseMatrix m_block;
@@ -50,10 +50,10 @@ void test (const unsigned int size_1, const unsigned int size_2)
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
 
-                                   // w:=Mv
+  // w:=Mv
   m_block.vmult (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<m.m(); ++i)
     {
       double result = 0;
@@ -67,7 +67,7 @@ void test (const unsigned int size_1, const unsigned int size_2)
     w(i) = i;
 
   m_block.Tvmult (v, w);
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<m.n(); ++i)
     {
       double result = 0;
@@ -100,25 +100,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
 
       return 1;
     }
   catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 752e8a87580befff88448f01eaf7aaad088f44c9..b056a42e120e3d48fe48053f65e2c8bdfb38fe89 100644 (file)
@@ -33,7 +33,7 @@ void test (const unsigned int size_1, const unsigned int size_2)
   TrilinosWrappers::SparseMatrix m(size_1, size_2, size_2);
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
   m.compress (VectorOperation::insert);
 
   TrilinosWrappers::BlockSparseMatrix m_block;
@@ -50,10 +50,10 @@ void test (const unsigned int size_1, const unsigned int size_2)
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
 
-                                   // w:=Mv
+  // w:=Mv
   m_block.vmult (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<m.m(); ++i)
     {
       double result = 0;
@@ -68,7 +68,7 @@ void test (const unsigned int size_1, const unsigned int size_2)
     w(i) = i;
 
   m_block.Tvmult (v, w);
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<m.n(); ++i)
     {
       double result = 0;
@@ -100,25 +100,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
 
       return 1;
     }
   catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 15f2a2117a2a907edfeccd61ab36977d0091e512..31508f28c1b77e58502c9b5183cb75bffa3953aa 100644 (file)
@@ -33,7 +33,7 @@ void test (const unsigned int size_1, const unsigned int size_2)
   TrilinosWrappers::SparseMatrix m(size_1, size_2, size_2);
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
   m.compress (VectorOperation::insert);
 
   TrilinosWrappers::BlockSparseMatrix m_block;
@@ -45,10 +45,10 @@ void test (const unsigned int size_1, const unsigned int size_2)
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
 
-                                   // w:=Mv
+  // w:=Mv
   m_block.vmult (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<m.m(); ++i)
     {
       double result = 0;
@@ -61,7 +61,7 @@ void test (const unsigned int size_1, const unsigned int size_2)
     w(i) = i;
 
   m_block.Tvmult (v, w);
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<m.n(); ++i)
     {
       double result = 0;
@@ -92,25 +92,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
 
       return 1;
     }
   catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 19fa2712552a1d40d29df6397f9d8e5ab9cd1a3c..e6675aa06855a2b924c6c0fc3c0114403a524592 100644 (file)
@@ -18,7 +18,7 @@
 
 // make sure that block vector iterator allows reading and writing correctly
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/trilinos_block_vector.h>
 #include <fstream>
@@ -35,8 +35,8 @@ void test ()
   v(0) = 1;
   v(1) = 2;
 
-                                   // first check reading through a const
-                                   // iterator
+  // first check reading through a const
+  // iterator
   {
     TrilinosWrappers::BlockVector::const_iterator i=v.begin();
     Assert (*i == 1, ExcInternalError());
@@ -44,17 +44,17 @@ void test ()
     Assert (*i == 2, ExcInternalError());
   }
 
-                                   // same, but create iterator in a different
-                                   // way
+  // same, but create iterator in a different
+  // way
   {
     TrilinosWrappers::BlockVector::const_iterator
-      i=const_cast<const TrilinosWrappers::BlockVector&>(v).begin();
+    i=const_cast<const TrilinosWrappers::BlockVector &>(v).begin();
     Assert (*i == 1, ExcInternalError());
     ++i;
     Assert (*i == 2, ExcInternalError());
   }
 
-                                   // read through a read-write iterator
+  // read through a read-write iterator
   {
     TrilinosWrappers::BlockVector::iterator i = v.begin();
     Assert (*i == 1, ExcInternalError());
@@ -62,23 +62,23 @@ void test ()
     Assert (*i == 2, ExcInternalError());
   }
 
-                                   // write through a read-write iterator
+  // write through a read-write iterator
   {
     TrilinosWrappers::BlockVector::iterator i = v.begin();
 
     *i = 2;
     ++i;
     *i = 3;
-  }  
+  }
 
-                                   // and read again
+  // and read again
   {
     TrilinosWrappers::BlockVector::iterator i = v.begin();
     Assert (*i == 2, ExcInternalError());
     ++i;
     Assert (*i == 3, ExcInternalError());
   }
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -89,7 +89,7 @@ int main (int argc,char **argv)
   std::ofstream logfile("block_vector_iterator_01/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -103,25 +103,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 95cb1e25263d49ecce4a86ce4496febd578632f0..132560c4a2ddd277c13c30368554a8108d0f71cb 100644 (file)
@@ -18,7 +18,7 @@
 
 // like _01, except that we use operator[] instead of operator*
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/trilinos_block_vector.h>
 #include <fstream>
@@ -35,44 +35,44 @@ void test ()
   v(0) = 1;
   v(1) = 2;
 
-                                   // first check reading through a const
-                                   // iterator
+  // first check reading through a const
+  // iterator
   {
     TrilinosWrappers::BlockVector::const_iterator i=v.begin();
     Assert (i[0] == 1, ExcInternalError());
     Assert (i[1] == 2, ExcInternalError());
   }
 
-                                   // same, but create iterator in a different
-                                   // way
+  // same, but create iterator in a different
+  // way
   {
     TrilinosWrappers::BlockVector::const_iterator
-      i=const_cast<const TrilinosWrappers::BlockVector&>(v).begin();
+    i=const_cast<const TrilinosWrappers::BlockVector &>(v).begin();
     Assert (i[0] == 1, ExcInternalError());
     Assert (i[1] == 2, ExcInternalError());
   }
 
-                                   // read through a read-write iterator
+  // read through a read-write iterator
   {
     TrilinosWrappers::BlockVector::iterator i = v.begin();
     Assert (i[0] == 1, ExcInternalError());
     Assert (i[1] == 2, ExcInternalError());
   }
 
-                                   // write through a read-write iterator
+  // write through a read-write iterator
   {
     TrilinosWrappers::BlockVector::iterator i = v.begin();
     i[0] = 2;
     i[1] = 3;
-  }  
+  }
 
-                                   // and read again
+  // and read again
   {
     TrilinosWrappers::BlockVector::iterator i = v.begin();
     Assert (i[0] == 2, ExcInternalError());
     Assert (i[1] == 3, ExcInternalError());
   }
-  
+
   deallog << "OK" << std::endl;
 }
 
@@ -83,7 +83,7 @@ int main (int argc,char **argv)
   std::ofstream logfile("block_vector_iterator_02/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -97,25 +97,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index f8ddd42db79fcb4a13bc96106976e92a7c1f72a2..d15d5e5f8c2f7fd2fba8af026aeb157d45ff3511 100644 (file)
@@ -18,7 +18,7 @@
 // this test is an adaptation of lac/block_vector_iterator for PETSc block
 // vectors
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/base/logstream.h>
 #include <deal.II/lac/trilinos_block_vector.h>
@@ -32,7 +32,7 @@
 
 template <typename number>
 bool operator == (const TrilinosWrappers::BlockVector &v1,
-                 const TrilinosWrappers::BlockVector &v2)
+                  const TrilinosWrappers::BlockVector &v2)
 {
   if (v1.size() != v2.size())
     return false;
@@ -50,165 +50,165 @@ void test ()
   ivector[1] = 4;
   ivector[2] = 3;
   ivector[3] = 5;
-  
-                                  // Check 1: initialization via
-                                  // iterators
+
+  // Check 1: initialization via
+  // iterators
   if (true)
     {
       TrilinosWrappers::BlockVector v1(ivector);
       TrilinosWrappers::BlockVector v2(ivector);
 
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
-                                      // initialize other vector
-                                      // through iterators
+        v1(i) = i;
+      // initialize other vector
+      // through iterators
       TrilinosWrappers::BlockVector::iterator p2 = v2.begin();
       for (unsigned int i=0; i<v1.size(); ++i, ++p2)
-       *p2 = i;
+        *p2 = i;
       Assert (p2==v2.end(), ExcInternalError());
-      
-                                      // check that the two vectors are equal
+
+      // check that the two vectors are equal
       deallog << "Check 1: " << (v1==v2 ? "true" : "false") << std::endl;
     };
 
-                                  // Check 1: initialization via
-                                  // iterators
+  // Check 1: initialization via
+  // iterators
   if (true)
     {
       TrilinosWrappers::BlockVector v1(ivector);
 
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
-                                      // initialize other vector
-                                      // through iterators into first
-                                      // vector
+        v1(i) = i;
+      // initialize other vector
+      // through iterators into first
+      // vector
       TrilinosWrappers::BlockVector v2(ivector, v1.begin(), v1.end());
-                                      // check that the two vectors are equal
+      // check that the two vectors are equal
       deallog << "Check 2: " << (v1==v2 ? "true" : "false") << std::endl;
     };
 
-                                  // Check 3: loop forward and back
-                                  // and check that things are the
-                                  // same
+  // Check 3: loop forward and back
+  // and check that things are the
+  // same
   if (true)
     {
       TrilinosWrappers::BlockVector v1(ivector);
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
+        v1(i) = i;
 
       TrilinosWrappers::BlockVector::iterator p1 = v1.begin();
       for (unsigned int i=0; i<v1.size(); ++i, ++p1)
-       Assert (*p1 == i, ExcInternalError());
+        Assert (*p1 == i, ExcInternalError());
 
       Assert (p1 == v1.end(), ExcInternalError());
-      
-                                      // move back into allowable
-                                      // region
+
+      // move back into allowable
+      // region
       --p1;
 
-                                      // check backwards
+      // check backwards
       for (unsigned int i=0; i<v1.size(); ++i, --p1)
-       Assert (*p1 == v1.size()-i-1, ExcInternalError());
+        Assert (*p1 == v1.size()-i-1, ExcInternalError());
 
-                                      // if we came thus far,
-                                      // everything is alright
+      // if we came thus far,
+      // everything is alright
       deallog << "Check 3: true" << std::endl;
     };
 
 
-                                  // Check 4: same, but this time
-                                  // with const iterators
+  // Check 4: same, but this time
+  // with const iterators
   if (true)
     {
       TrilinosWrappers::BlockVector v1(ivector);
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
+        v1(i) = i;
 
       TrilinosWrappers::BlockVector::const_iterator p1 = v1.begin();
       for (unsigned int i=0; i<v1.size(); ++i, ++p1)
-       Assert (*p1 == i, ExcInternalError());
+        Assert (*p1 == i, ExcInternalError());
 
       Assert (p1 == v1.end(), ExcInternalError());
 
-                                      // move back into allowable
-                                      // region
+      // move back into allowable
+      // region
       --p1;
 
-                                      // check backwards
+      // check backwards
       for (unsigned int i=0; i<v1.size(); ++i, --p1)
-       {
-         const double val = *p1;
-         const double ref = v1.size()-i-1;
-         Assert (val==ref, ExcInternalError());
-       };
-
-                                      // if we came thus far,
-                                      // everything is alright
+        {
+          const double val = *p1;
+          const double ref = v1.size()-i-1;
+          Assert (val==ref, ExcInternalError());
+        };
+
+      // if we came thus far,
+      // everything is alright
       deallog << "Check 4: true" << std::endl;
     };
 
-                                  // Checks 5-14: use some standard
-                                  // algorithms
+  // Checks 5-14: use some standard
+  // algorithms
   if (true)
     {
       TrilinosWrappers::BlockVector v1(ivector);
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
+        v1(i) = i;
 
-                                      // check std::distance
-                                      // algorithm
+      // check std::distance
+      // algorithm
       deallog << "Check 5: "
-             << (std::distance (v1.begin(), v1.end()) ==
-                 static_cast<signed int>(v1.size()) ?
-                 "true" : "false")
-             << std::endl;
+              << (std::distance (v1.begin(), v1.end()) ==
+                  static_cast<signed int>(v1.size()) ?
+                  "true" : "false")
+              << std::endl;
 
-                                      // check std::copy
+      // check std::copy
       TrilinosWrappers::BlockVector v2(ivector);
       std::copy (v1.begin(), v1.end(), v2.begin());
       deallog << "Check 6: " << (v1 == v2 ? "true" : "false") << std::endl;
 
-                                      // check std::transform
+      // check std::transform
       std::transform (v1.begin(), v1.end(), v2.begin(),
-                     std::bind2nd (std::multiplies<double>(),
-                                   2.0));
+                      std::bind2nd (std::multiplies<double>(),
+                                    2.0));
       v2 *= 1./2.;
       deallog << "Check 7: " << (v1 == v2 ? "true" : "false") << std::endl;
 
 
-                                      // check operators +/-, +=/-=
+      // check operators +/-, +=/-=
       deallog << "Check 8: "
-             << (std::distance(v1.begin(), v1.begin()+3) == 3 ?
-                 "true" : "false")
-             << std::endl;
+              << (std::distance(v1.begin(), v1.begin()+3) == 3 ?
+                  "true" : "false")
+              << std::endl;
       deallog << "Check 9: "
-             << (std::distance(v1.end()-6, v1.end()) == 6 ?
-                 "true" : "false")
-             << std::endl;
+              << (std::distance(v1.end()-6, v1.end()) == 6 ?
+                  "true" : "false")
+              << std::endl;
       deallog << "Check 10: "
-             << (std::distance(v1.begin(), v1.end()) == (signed)v1.size() ?
-                 "true" : "false")
-             << std::endl;
+              << (std::distance(v1.begin(), v1.end()) == (signed)v1.size() ?
+                  "true" : "false")
+              << std::endl;
       deallog << "Check 11: "
-             << (std::distance(v1.begin(), (v1.begin()+=7)) == 7 ?
-                 "true" : "false")
-             << std::endl;
+              << (std::distance(v1.begin(), (v1.begin()+=7)) == 7 ?
+                  "true" : "false")
+              << std::endl;
       deallog << "Check 12: "
-             << (std::distance((v1.end()-=4), v1.end()) == 4 ?
-                 "true" : "false")
-             << std::endl;
+              << (std::distance((v1.end()-=4), v1.end()) == 4 ?
+                  "true" : "false")
+              << std::endl;
 
-                                      // check advance
+      // check advance
       TrilinosWrappers::BlockVector::iterator p2 = v1.begin();
       std::advance (p2, v1.size());
       deallog << "Check 13: " << (p2 == v1.end() ? "true" : "false") << std::endl;
@@ -218,104 +218,104 @@ void test ()
       deallog << "Check 14: " << (p3 == v1.end() ? "true" : "false") << std::endl;
     };
 
-                                  // Check 15: initialization through
-                                  // iterators
+  // Check 15: initialization through
+  // iterators
   if (true)
     {
       TrilinosWrappers::BlockVector v1(ivector);
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
+        v1(i) = i;
 
-                                      // initialize a normal vector
-                                      // from it
+      // initialize a normal vector
+      // from it
       Vector<double> v2(v1.begin(), v1.end());
 
-                                      // and reverse way
+      // and reverse way
       TrilinosWrappers::BlockVector v3(ivector, v2.begin(), v2.end());
       deallog << "Check 15: " << (v1==v3 ? "true" : "false") << std::endl;
     };
 
-                                  // Check 16: initialization through
-                                  // iterators. variant with one
-                                  // constant object
+  // Check 16: initialization through
+  // iterators. variant with one
+  // constant object
   if (true)
     {
       TrilinosWrappers::BlockVector v1(ivector);
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
+        v1(i) = i;
 
-                                      // initialize a normal vector
-                                      // from it
+      // initialize a normal vector
+      // from it
       const Vector<double> v2(v1.begin(), v1.end());
 
-                                      // and reverse way
+      // and reverse way
       TrilinosWrappers::BlockVector v3(ivector, v2.begin(), v2.end());
       deallog << "Check 16: " << (v1==v3 ? "true" : "false") << std::endl;
     };
-  
-                                  // Check 17: initialization through
-                                  // iterators. variant with two
-                                  // constant object
+
+  // Check 17: initialization through
+  // iterators. variant with two
+  // constant object
   if (true)
     {
       TrilinosWrappers::BlockVector v1(ivector);
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
+        v1(i) = i;
 
-                                      // initialize a normal vector
-                                      // from it
+      // initialize a normal vector
+      // from it
       const Vector<double> v2(v1.begin(), v1.end());
 
-                                      // and reverse way
+      // and reverse way
       const TrilinosWrappers::BlockVector v3(ivector, v2.begin(), v2.end());
       deallog << "Check 17: " << (v1==v3 ? "true" : "false") << std::endl;
     };
 
-                                  // Check 18: initialization through
-                                  // iterators. variant with three
-                                  // constant object
+  // Check 18: initialization through
+  // iterators. variant with three
+  // constant object
   if (true)
     {
       TrilinosWrappers::BlockVector v0(ivector);
-                                      // initialize first vector with
-                                      // simple loop
+      // initialize first vector with
+      // simple loop
       for (unsigned int i=0; i<v0.size(); ++i)
-       v0(i) = i;
+        v0(i) = i;
 
       const TrilinosWrappers::BlockVector v1 = v0;
-      
-                                      // initialize a normal vector
-                                      // from it
+
+      // initialize a normal vector
+      // from it
       const Vector<double> v2(v1.begin(), v1.end());
 
-                                      // and reverse way
+      // and reverse way
       const TrilinosWrappers::BlockVector v3(ivector, v2.begin(), v2.end());
       deallog << "Check 18: " << (v1==v3 ? "true" : "false") << std::endl;
     };
-  
-                                  // Check 19: operator[]
+
+  // Check 19: operator[]
   if (true)
     {
       TrilinosWrappers::BlockVector v1(ivector);
       for (unsigned int i=0; i<v1.size(); ++i)
-       v1(i) = i;
+        v1(i) = i;
 
       for (unsigned int i=0; i<v1.size(); ++i)
-       {
-         const TrilinosWrappers::BlockVector::iterator p = (v1.begin()+i);
-         for (unsigned int j=0; j<v1.size(); ++j)
-           Assert (p[(signed)j-(signed)i] == j, ExcInternalError());
-       };
-
-                                      // if we came thus far,
-                                      // everything is alright
-      deallog << "Check 19: true" << std::endl;      
+        {
+          const TrilinosWrappers::BlockVector::iterator p = (v1.begin()+i);
+          for (unsigned int j=0; j<v1.size(); ++j)
+            Assert (p[(signed)j-(signed)i] == j, ExcInternalError());
+        };
+
+      // if we came thus far,
+      // everything is alright
+      deallog << "Check 19: true" << std::endl;
     };
 }
 
@@ -330,11 +330,11 @@ int main (int argc,char **argv)
   logfile.precision(3);
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
-  
+
   try
     {
       {
@@ -344,29 +344,29 @@ int main (int argc,char **argv)
   catch (std::exception &e)
     {
       std::cerr << std::endl << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << e.what() << std::endl
-          << "Aborting!" << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
-                                      // abort
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+      // abort
       return 2;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-          << "Aborting!" << std::endl
-          << "----------------------------------------------------"
-          << std::endl;
-                                      // abort
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+      // abort
       return 3;
     };
-  
-  
+
+
   return 0;
 }
 
index 94153a362899da02b9acc6ac7997eab75680f098..87eeaeb305875f7017b17c57c00b33cf29d598b3 100644 (file)
@@ -18,7 +18,7 @@
 // test the CG solver using the Trilinos matrix and vector classes
 
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include "../lac/testmatrix.h"
 #include <cmath>
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
-  
+
   u = 0.;
   f = 1.;
-  try 
+  try
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -68,7 +68,7 @@ int main(int argc, char **argv)
   logfile.precision(4);
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -80,8 +80,8 @@ int main(int argc, char **argv)
     unsigned int dim = (size-1)*(size-1);
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                     // Make matrix
+
+    // Make matrix
     FDMatrix testproblem(size, size);
     CompressedSimpleSparsityPattern csp (dim, dim);
     testproblem.five_point_structure(csp);
index ac18e825d2a8021d8986adb6ce1e1964169de397..8c4b3c31b833ffcb9ea3950c6ecf3236833f678a 100644 (file)
@@ -19,7 +19,7 @@
 
 
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include "../lac/testmatrix.h"
 #include <cmath>
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
-  
+
   u = 0.;
   f = 1.;
-  try 
+  try
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -70,11 +70,11 @@ int main(int argc, char **argv)
   deallog.attach(logfile);
   deallog << std::setprecision(4);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
-  
+
   {
     SolverControl control(200, 1.e-10);
 
@@ -82,8 +82,8 @@ int main(int argc, char **argv)
     unsigned int dim = (size-1)*(size-1);
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                     // Make matrix
+
+    // Make matrix
     FDMatrix testproblem(size, size);
     CompressedSimpleSparsityPattern csp (dim, dim);
     testproblem.five_point_structure(csp);
index 47906cd0b5cb4ebfb7e6e339074c229818667a42..02d9c057a84254fac872ea198cfacc823cb22488 100644 (file)
@@ -19,7 +19,7 @@
 
 
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include "../lac/testmatrix.h"
 #include <cmath>
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
-  
+
   u = 0.;
   f = 1.;
-  try 
+  try
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -70,11 +70,11 @@ int main(int argc, char **argv)
   logfile.precision(2);
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
-  
+
   {
     SolverControl control(2000, 1.e-3);
 
@@ -82,8 +82,8 @@ int main(int argc, char **argv)
     unsigned int dim = (size-1)*(size-1);
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                     // Make matrix
+
+    // Make matrix
     FDMatrix testproblem(size, size);
     CompressedSimpleSparsityPattern csp (dim, dim);
     testproblem.five_point_structure(csp);
index d1d92621f9781982eb0fd477f7404c89917f8a6f..7a1c5359a2cb27eaad649acee9507d6f1e28dbd8 100644 (file)
@@ -18,7 +18,7 @@
 // test the MINRES solver using the Trilinos matrix and vector classes
 
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include "../lac/testmatrix.h"
 #include <cmath>
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
-  
+
   u = 0.;
   f = 1.;
-  try 
+  try
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -69,11 +69,11 @@ int main(int argc, char **argv)
   logfile.precision(4);
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
-  
+
   {
     SolverControl control(100, 1.e-3);
 
@@ -81,8 +81,8 @@ int main(int argc, char **argv)
     unsigned int dim = (size-1)*(size-1);
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                     // Make matrix
+
+    // Make matrix
     FDMatrix testproblem(size, size);
     CompressedSimpleSparsityPattern csp (dim, dim);
     testproblem.five_point_structure(csp);
index 0aa6a5cd137f7285c49e69ed29983aeab3406bd1..3cbb11057218a24d6a77d0f8969e02ac96adfe4c 100644 (file)
@@ -18,7 +18,7 @@
 // test the QMRS solver using the Trilinos matrix and vector classes
 
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include "../lac/testmatrix.h"
 #include <cmath>
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
-  
+
   u = 0.;
   f = 1.;
-  try 
+  try
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -68,11 +68,11 @@ int main(int argc, char **argv)
   logfile.precision(4);
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
-  
+
   {
     SolverControl control(200, 1.e-3);
 
@@ -80,8 +80,8 @@ int main(int argc, char **argv)
     unsigned int dim = (size-1)*(size-1);
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                     // Make matrix
+
+    // Make matrix
     FDMatrix testproblem(size, size);
     CompressedSimpleSparsityPattern csp (dim, dim);
     testproblem.five_point_structure(csp);
index a92149731775d0544f8868a74ac47f82bc2c3e0d..276397b1a45a94d33973b4fbf5064b016b7dcd75 100644 (file)
@@ -40,8 +40,8 @@
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
 
@@ -51,7 +51,7 @@ check_solve( SOLVER& solver, const MATRIX& A,
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
     }
@@ -79,7 +79,7 @@ int main(int argc, char **argv)
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
 
-                                     // Make matrix
+    // Make matrix
     FDMatrix testproblem(size, size);
     CompressedSimpleSparsityPattern csp (dim, dim);
     testproblem.five_point_structure(csp);
index 8f10a30fd80e6664af4a598cc699eb35aa06743a..9fd6d336f45b4484a5405d12a763adc46b267787 100644 (file)
@@ -42,15 +42,15 @@ using namespace std;
 template <int dim, int spacedim>
 void
 reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
-              MGLevelObject<TrilinosWrappers::MPI::Vector> &v)
+               MGLevelObject<TrilinosWrappers::MPI::Vector> &v)
 {
-  const dealii::parallel::distributed::Triangulation<dim,spacedim> * tria =
+  const dealii::parallel::distributed::Triangulation<dim,spacedim> *tria =
     (dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>
      (&mg_dof.get_tria()));
   AssertThrow(tria!=NULL, ExcMessage("multigrid with Trilinos vectors only works with distributed Triangulation!"));
-  
+
   for (unsigned int level=v.get_minlevel();
-       level<=v.get_maxlevel();++level)
+       level<=v.get_maxlevel(); ++level)
     {
       v[level].reinit(mg_dof.locally_owned_mg_dofs(level), tria->get_communicator());
     }
@@ -58,15 +58,15 @@ reinit_vector (const dealii::MGDoFHandler<dim,spacedim> &mg_dof,
 
 
 template <int dim>
-void check_simple(const FiniteElement<dim>fe)
+void check_simple(const FiniteElement<dim> &fe)
 {
   deallog << fe.get_name() << std::endl;
 
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD,
-                                              Triangulation<dim>::
-    limit_level_difference_at_vertices,
-                                              parallel::distributed::Triangulation<dim>::construct_multigrid_hierarchy);
-   
+                                               Triangulation<dim>::
+                                               limit_level_difference_at_vertices,
+                                               parallel::distributed::Triangulation<dim>::construct_multigrid_hierarchy);
+
   GridGenerator::hyper_cube(tr);
   tr.refine_global(2);
 
@@ -78,61 +78,61 @@ void check_simple(const FiniteElement<dim>& fe)
 
   MGLevelObject<TrilinosWrappers::MPI::Vector> u(0, tr.n_levels()-1);
   reinit_vector(mgdof, u);
-                                  // First prolongate the constant
-                                  // vector.  For Lagrange elements,
-                                  // the values are just the number
-                                  // of degrees of freedom.
+  // First prolongate the constant
+  // vector.  For Lagrange elements,
+  // the values are just the number
+  // of degrees of freedom.
   u[0] = 1.;
   transfer.prolongate(1,u[1],u[0]);
   transfer.prolongate(2,u[2],u[1]);
   deallog << "u0\t" <<  (u[0]*u[0]+.5) << std::endl
-         << "u1\t" <<  (u[1]*u[1]+.5) << std::endl
-         << "u2\t" <<  (u[2]*u[2]+.5) << std::endl;
-                                  // Now restrict the same vectors.
+          << "u1\t" <<  (u[1]*u[1]+.5) << std::endl
+          << "u2\t" <<  (u[2]*u[2]+.5) << std::endl;
+  // Now restrict the same vectors.
   u[1] = 0.;
   u[0] = 0.;
   transfer.restrict_and_add(2,u[1],u[2]);
   transfer.restrict_and_add(1,u[0],u[1]);
   deallog << "u1\t" <<  (u[1]*u[1]+.5) << std::endl
-         << "u0\t" <<  (u[0]*u[0]+.5) << std::endl;
+          << "u0\t" <<  (u[0]*u[0]+.5) << std::endl;
 
-                                  // Now the same for a non-constant
-                                  // vector
-  for (unsigned int i=0;i<u[0].size();++i)
+  // Now the same for a non-constant
+  // vector
+  for (unsigned int i=0; i<u[0].size(); ++i)
     u[0](i) = i;
   transfer.prolongate(1,u[1],u[0]);
   transfer.prolongate(2,u[2],u[1]);
   deallog << "u0\t" <<  (u[0]*u[0]+.5) << std::endl
-         << "u1\t" <<  (u[1]*u[1]+.5) << std::endl
-         << "u2\t" <<  (u[2]*u[2]+.5) << std::endl;
-                                  // Now restrict the same vectors.
+          << "u1\t" <<  (u[1]*u[1]+.5) << std::endl
+          << "u2\t" <<  (u[2]*u[2]+.5) << std::endl;
+  // Now restrict the same vectors.
   u[1] = 0.;
   u[0] = 0.;
   transfer.restrict_and_add(2,u[1],u[2]);
   transfer.restrict_and_add(1,u[0],u[1]);
   deallog << "u1\t" <<  (u[1]*u[1]+.5) << std::endl
-         << "u0\t" <<  (u[0]*u[0]+.5) << std::endl;
+          << "u0\t" <<  (u[0]*u[0]+.5) << std::endl;
 
-                                  // Fill a global vector by counting
-                                  // from one up
+  // Fill a global vector by counting
+  // from one up
   TrilinosWrappers::MPI::Vector v;
   v.reinit(mgdof.locally_owned_dofs(), MPI_COMM_WORLD);
-  for (unsigned int i=0;i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i+1;
 
   transfer.copy_to_mg(mgdof, u, v);
-  for (unsigned int i=0; i<u[2].size();++i)
+  for (unsigned int i=0; i<u[2].size(); ++i)
     deallog << ' ' << (int) u[2](i);
   deallog << std::endl;
 
-                                  // Now do the opposite: fill a
-                                  // multigrid vector counting the
-                                  // dofs and see where the numbers go
+  // Now do the opposite: fill a
+  // multigrid vector counting the
+  // dofs and see where the numbers go
   v = 0.;
-  for (unsigned int i=0;i<u[2].size();++i)
+  for (unsigned int i=0; i<u[2].size(); ++i)
     u[2](i) = i+1;
   transfer.copy_from_mg(mgdof, v, u);
-  for (unsigned int i=0; i<v.size();++i)
+  for (unsigned int i=0; i<v.size(); ++i)
     deallog << ' ' << (int) v(i);
   deallog << std::endl;
   v.equ(-1., v);
@@ -141,17 +141,17 @@ void check_simple(const FiniteElement<dim>& fe)
 }
 
 
-int main(int argc, char** argv)
+int main(int argc, char **argv)
 {
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
-  
+
   const std::string logname = JobIdentifier::base_name(__FILE__) + std::string("/output");
   std::ofstream logfile(logname.c_str());
   deallog << std::setprecision(6);
   deallog.threshold_double(1.e-10);
   deallog.attach(logfile);
-//  deallog.depth_console (0);  
-  
+//  deallog.depth_console (0);
+
   check_simple (FE_DGP<2>(0));
   check_simple (FE_DGP<2>(1));
   check_simple (FE_DGQ<2>(1));
@@ -165,7 +165,7 @@ int main(int argc, char** argv)
   check_simple (FESystem<2>(FE_RaviartThomas<2>(1),1,FE_DGQ<2>(0),2));
 
 //TODO: Reenable after implementing renumber_dofs in 3D
-  
+
   // check_simple (FE_DGQ<3>(1));
   // check_simple (FE_Q<3>(2));
 }
index afde5c364c1ee517d2c4d00ae40a4bafe156c5fb..5be16d1c25a71366ebcfae05147e3fdf76898f4c 100644 (file)
 
 void test ()
 {
-                                   // create a parallel matrix where the first
-                                   // process has 10 rows, the second one 20,
-                                   // the third one 30, and so on
+  // create a parallel matrix where the first
+  // process has 10 rows, the second one 20,
+  // the third one 30, and so on
   unsigned int N = 0;
   std::vector<unsigned int> local_rows_per_process
-    (Utilities::Trilinos::get_n_mpi_processes(Utilities::Trilinos::comm_world()));
+  (Utilities::Trilinos::get_n_mpi_processes(Utilities::Trilinos::comm_world()));
   std::vector<unsigned int> start_row
-    (Utilities::Trilinos::get_n_mpi_processes(Utilities::Trilinos::comm_world()));
+  (Utilities::Trilinos::get_n_mpi_processes(Utilities::Trilinos::comm_world()));
   for (unsigned int i=0;
        i<Utilities::Trilinos::get_n_mpi_processes(Utilities::Trilinos::comm_world());
        ++i)
@@ -54,10 +54,10 @@ void test ()
       start_row[i] += i*10;
     }
 
-                                   // here is a sparsity pattern for which we
-                                   // used to allocate additional memory for 2
-                                   // processes. note that only one of the
-                                   // four blocks uses Inodes
+  // here is a sparsity pattern for which we
+  // used to allocate additional memory for 2
+  // processes. note that only one of the
+  // four blocks uses Inodes
   CompressedSparsityPattern csp (N,N);
   for (unsigned int i=0; i<N; ++i)
     for (unsigned int j=0; j<N; ++j)
@@ -69,9 +69,9 @@ void test ()
           csp.add (i,i-local_rows_per_process.back());
       }
 
-                                   // here is a sparsity pattern for which no
-                                   // Inodes are used, but it doesn't allocate
-                                   // additional memory
+  // here is a sparsity pattern for which no
+  // Inodes are used, but it doesn't allocate
+  // additional memory
 //   for (unsigned int bi=0; bi<get_n_mpi_processes(); ++bi)
 //     for (unsigned int bj=0; bj<get_n_mpi_processes(); ++bj)
 //       for (unsigned int i=0; i<local_rows_per_process[bi]; ++i)
@@ -81,19 +81,19 @@ void test ()
 
 
 
-                                   // now create a matrix with this sparsity
-                                   // pattern
+  // now create a matrix with this sparsity
+  // pattern
   Epetra_Map map (TrilinosWrappers::types::int_type(-1),
-                 TrilinosWrappers::types::int_type
-                 (local_rows_per_process[Utilities::Trilinos::get_this_mpi_process
-                                         (Utilities::Trilinos::comm_world())]),
-                 0, Utilities::Trilinos::comm_world());
+                  TrilinosWrappers::types::int_type
+                  (local_rows_per_process[Utilities::Trilinos::get_this_mpi_process
+                                          (Utilities::Trilinos::comm_world())]),
+                  0, Utilities::Trilinos::comm_world());
 
   TrilinosWrappers::SparseMatrix m;
   m.reinit (map, csp);
-                                   // now write into the exact same matrix
-                                   // entries as have been created by the
-                                   // sparsity pattern above
+  // now write into the exact same matrix
+  // entries as have been created by the
+  // sparsity pattern above
   for (unsigned int i=0; i<N; ++i)
     for (unsigned int j=0; j<csp.row_length(i); ++j)
       m.add (i, csp.column_number(i,j), 1.);
@@ -122,25 +122,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
 
       return 1;
     }
   catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 5fe432454db875b0d7a6aec8e43657671ef851bf..85e717784fa138aade73633ba2cb27b99a946385 100644 (file)
@@ -331,25 +331,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index c6424bf8c791c0d31440b1a09d2a1a53885ac172..40d9333feb7bebab3a5a2caf1997d3a0cda6f848 100644 (file)
@@ -23,7 +23,7 @@
 //
 // the tests build the 5-point stencil matrix for a uniform grid of size N*N
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/sparse_matrix.h>
 #include <deal.II/lac/vector.h>
@@ -36,10 +36,10 @@ void test ()
 {
   const unsigned int N = 200;
 
-                                   // first build the sparsity pattern
+  // first build the sparsity pattern
   SparsityPattern sparsity (N*N, N*N, 5);
-  for(unsigned int i=0; i<N; i++)
-    for(unsigned int j=0; j<N; j++)
+  for (unsigned int i=0; i<N; i++)
+    for (unsigned int j=0; j<N; j++)
       {
         const unsigned int global = i*N+j;
         sparsity.add(global, global);
@@ -65,12 +65,12 @@ void test ()
           }
       }
   sparsity.compress();
-  
 
-                                   // next build the sparse matrix itself
+
+  // next build the sparse matrix itself
   SparseMatrix<double> matrix (sparsity);
-  for(unsigned int i=0; i<N; i++)
-    for(unsigned int j=0; j<N; j++)
+  for (unsigned int i=0; i<N; i++)
+    for (unsigned int j=0; j<N; j++)
       {
         const unsigned int global = i*N+j;
         matrix.add(global, global, 4);
@@ -95,21 +95,21 @@ void test ()
             matrix.add(global, global+N, -1);
           }
       }
-  
-                                   // then do a single matrix-vector
-                                   // multiplication with subsequent formation
-                                   // of the matrix norm
+
+  // then do a single matrix-vector
+  // multiplication with subsequent formation
+  // of the matrix norm
   Vector<double> v1(N*N), v2(N*N);
   for (unsigned int i=0; i<N*N; ++i)
     v1(i) = i;
   matrix.vmult (v2, v1);
-  
-  deallog << v1*v2 << std::endl;
+
+  deallog << v1 *v2 << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("slowness_01/output");
   deallog.attach(logfile);
@@ -126,25 +126,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
   return 0;
index 5d6ae8acdaf33915ff434c40bd24d1b0a1b18a2f..42df63806c35f1bba0941ac7093b07cebf3f3e7e 100644 (file)
@@ -23,7 +23,7 @@
 //
 // the tests build the 5-point stencil matrix for a uniform grid of size N*N
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/sparse_matrix.h>
 #include <deal.II/lac/trilinos_sparse_matrix.h>
@@ -36,10 +36,10 @@ void test ()
 {
   const unsigned int N = 200;
 
-                                   // build the sparse matrix 
+  // build the sparse matrix
   TrilinosWrappers::SparseMatrix matrix (N*N, N*N, 5U);
-  for(unsigned int i=0; i<N; i++)
-    for(unsigned int j=0; j<N; j++)
+  for (unsigned int i=0; i<N; i++)
+    for (unsigned int j=0; j<N; j++)
       {
         const unsigned int global = i*N+j;
         matrix.set(global, global, 4);
@@ -65,22 +65,22 @@ void test ()
           }
       }
   matrix.compress ();
-  
-  
-                                   // then do a single matrix-vector
-                                   // multiplication with subsequent formation
-                                   // of the matrix norm
+
+
+  // then do a single matrix-vector
+  // multiplication with subsequent formation
+  // of the matrix norm
   TrilinosWrappers::Vector v1(N*N), v2(N*N);
   for (unsigned int i=0; i<N*N; ++i)
     v1(i) = i;
   matrix.vmult (v2, v1);
-  
-  deallog << v1*v2 << std::endl;
+
+  deallog << v1 *v2 << std::endl;
 }
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("slowness_02/output");
   deallog.attach(logfile);
@@ -97,25 +97,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
   return 0;
index 74b1bb22c8a6654a2ecc00088d1484efe521a467..f1357733143e98c9d1f4d479723c839df7126a73 100644 (file)
@@ -36,12 +36,12 @@ void test ()
 {
   const unsigned int N = 200;
 
-                                   // build the sparse matrix
+  // build the sparse matrix
   Epetra_Map map (TrilinosWrappers::types::int_type(N*N), 0,
-                 Utilities::Trilinos::comm_world());
+                  Utilities::Trilinos::comm_world());
   TrilinosWrappers::SparseMatrix matrix (map, 5);
-  for(unsigned int i=0; i<N; i++)
-    for(unsigned int j=0; j<N; j++)
+  for (unsigned int i=0; i<N; i++)
+    for (unsigned int j=0; j<N; j++)
       {
         const unsigned int global = i*N+j;
         matrix.set(global, global, 4);
@@ -68,16 +68,16 @@ void test ()
       }
   matrix.compress ();
 
-                                   // then do a single matrix-vector
-                                   // multiplication with subsequent formation
-                                   // of the matrix norm
+  // then do a single matrix-vector
+  // multiplication with subsequent formation
+  // of the matrix norm
   TrilinosWrappers::MPI::Vector v1(map);
   TrilinosWrappers::MPI::Vector v2(map);
   for (unsigned int i=0; i<N*N; ++i)
     v1(i) = i;
   matrix.vmult (v2, v1);
 
-  deallog << v1*v2 << std::endl;
+  deallog << v1 *v2 << std::endl;
 }
 
 
@@ -99,25 +99,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
 
       return 1;
     }
   catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 
index 666f530e187836c89ca78692567951bdbef58e97..c732e47dbe087e11d8f8d6a6704fb3d2776c0ade 100644 (file)
@@ -42,8 +42,8 @@ void test ()
 {
   const unsigned int N = 200;
 
-                                   // first find a random permutation of the
-                                   // indices
+  // first find a random permutation of the
+  // indices
   std::vector<unsigned int> permutation (N);
   {
     std::vector<unsigned int> unused_indices (N);
@@ -52,24 +52,24 @@ void test ()
 
     for (unsigned int i=0; i<N; i++)
       {
-                                         // pick a random element among the
-                                         // unused indices
+        // pick a random element among the
+        // unused indices
         const unsigned int k = rand() % (N-i);
         permutation[i] = unused_indices[k];
 
-                                         // then swap this used element to the
-                                         // end where we won't consider it any
-                                         // more
+        // then swap this used element to the
+        // end where we won't consider it any
+        // more
         std::swap (unused_indices[k], unused_indices[N-i-1]);
       }
   }
 
-                                   // build the sparse matrix
+  // build the sparse matrix
   Epetra_Map map (TrilinosWrappers::types::int_type(N*N), 0,
-                 Utilities::Trilinos::comm_world());
+                  Utilities::Trilinos::comm_world());
   TrilinosWrappers::SparseMatrix matrix (map, 5);
-  for(unsigned int i_=0; i_<N; i_++)
-    for(unsigned int j_=0; j_<N; j_++)
+  for (unsigned int i_=0; i_<N; i_++)
+    for (unsigned int j_=0; j_<N; j_++)
       {
         const unsigned int i=permutation[i_];
         const unsigned int j=permutation[j_];
@@ -99,16 +99,16 @@ void test ()
       }
   matrix.compress (VectorOperation::insert);
 
-                                   // then do a single matrix-vector
-                                   // multiplication with subsequent formation
-                                   // of the matrix norm
+  // then do a single matrix-vector
+  // multiplication with subsequent formation
+  // of the matrix norm
   TrilinosWrappers::MPI::Vector v1(map);
   TrilinosWrappers::MPI::Vector v2(map);
   for (unsigned int i=0; i<N*N; ++i)
     v1(i) = i;
   matrix.vmult (v2, v1);
 
-  deallog << v1*v2 << std::endl;
+  deallog << v1 *v2 << std::endl;
 }
 
 
@@ -130,25 +130,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
 
       return 1;
     }
   catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
   return 0;
index a8741296e63baeb322e499cee35487d6fc26d0c0..129295c374c0708afb087b423876e45a6ac581fa 100644 (file)
@@ -18,7 +18,7 @@
 // test the Trilinos CG solver
 
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include "../lac/testmatrix.h"
 #include <cmath>
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
-  
+
   u = 0.;
   f = 1.;
-  try 
+  try
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -63,20 +63,20 @@ int main(int argc, char **argv)
   logfile.precision(4);
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
 
-  {  
+  {
     SolverControl control(2000, 1.e-3);
 
     const unsigned int size = 32;
     unsigned int dim = (size-1)*(size-1);
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                     // Make matrix
+
+    // Make matrix
     FDMatrix testproblem(size, size);
     CompressedSimpleSparsityPattern csp (dim, dim);
     testproblem.five_point_structure(csp);
index 7ac2d525e95052d625653a9f8efa506f48a3a0a3..8737d7238157fe834f319a1292c1dbeb96b94027 100644 (file)
@@ -18,7 +18,7 @@
 // test the Trilinos GMRES solver
 
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include "../lac/testmatrix.h"
 #include <cmath>
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
-  
+
   u = 0.;
   f = 1.;
-  try 
+  try
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -63,20 +63,20 @@ int main(int argc, char **argv)
   logfile.precision(4);
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
 
-  {  
+  {
     SolverControl control(200, 1.e-3);
 
     const unsigned int size = 32;
     unsigned int dim = (size-1)*(size-1);
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                     // Make matrix
+
+    // Make matrix
     FDMatrix testproblem(size, size);
     CompressedSimpleSparsityPattern csp (dim, dim);
     testproblem.five_point_structure(csp);
index 598b1931eca4e8638da4e0b067625914cd7d3d03..73b79462543be5e3681d4ad4c2659057201959ec 100644 (file)
 
 template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
 void
-check_solve( SOLVER& solver, const MATRIX& A,
-            VECTOR& u, VECTOR& f, const PRECONDITION& P)
+check_solve( SOLVER &solver, const MATRIX &A,
+             VECTOR &u, VECTOR &f, const PRECONDITION &P)
 {
   deallog << "Solver type: " << typeid(solver).name() << std::endl;
-  
+
   u = 0.;
   f = 1.;
-  try 
+  try
     {
       solver.solve(A,u,f,P);
     }
-  catch (std::exceptione)
+  catch (std::exception &e)
     {
       deallog << e.what() << std::endl;
       abort ();
@@ -74,8 +74,8 @@ int main(int argc, char **argv)
     unsigned int dim = (size-1)*(size-1);
 
     deallog << "Size " << size << " Unknowns " << dim << std::endl;
-      
-                                     // Make matrix
+
+    // Make matrix
     FDMatrix testproblem(size, size);
     CompressedSimpleSparsityPattern csp (dim, dim);
     testproblem.five_point_structure(csp);
index 92fd36049576656b1e506109e26b6c1d9de32959..61ae2f974138eb565ff18d686e496ff0d6679392 100644 (file)
@@ -46,7 +46,7 @@ int main (int argc,char **argv)
   row_partitioning.add_range(0, 3);
   col_partitioning.add_range(0, 4);
 
-                                  // Add element (2,3) to the matrix
+  // Add element (2,3) to the matrix
   TrilinosWrappers::SparsityPattern sp (row_partitioning, col_partitioning);
   sp.add (2,3);
   sp.compress();
@@ -55,10 +55,10 @@ int main (int argc,char **argv)
   A.add (2, 3, 2.0);
   A.compress();
 
-                                  // verify that entry (2,3) is
-                                  // indeed what we expect. verify
-                                  // that both methods of accessing
-                                  // the entry work
+  // verify that entry (2,3) is
+  // indeed what we expect. verify
+  // that both methods of accessing
+  // the entry work
   Assert (A.el(2, 3) == 2, ExcInternalError());
   Assert (A(2, 3) == 2, ExcInternalError());
 
index 07a2b7c6066c803bc883bbf875a87f76977a4ba7..51e0cb9d1e8dc5b3440a325257fcf859dfa116cb 100644 (file)
@@ -47,7 +47,7 @@ int main (int argc,char **argv)
   {
     double value = 1;
     for (SparseMatrix<double>::iterator p=matrix.begin();
-        p != matrix.end(); ++p, ++value)
+         p != matrix.end(); ++p, ++value)
       p->value() = value;
   }
   deallog << "Original:" << std::endl;
@@ -55,9 +55,9 @@ int main (int argc,char **argv)
 
   // now copy everything into a Trilinos matrix
   Epetra_Map map(TrilinosWrappers::types::int_type(5),
-                TrilinosWrappers::types::int_type(5),
-                0,
-                Utilities::Trilinos::comm_world());
+                 TrilinosWrappers::types::int_type(5),
+                 0,
+                 Utilities::Trilinos::comm_world());
   TrilinosWrappers::SparseMatrix tmatrix;
   tmatrix.reinit (map, map, matrix);
 
index 22453a2a285c941d8f7dd3fc0d229f2a2a3ba8ec..57ba1f16ff0000888c34fdb41eb949af521b592f 100644 (file)
@@ -47,7 +47,7 @@ int main (int argc,char **argv)
   {
     double value = 1;
     for (SparseMatrix<double>::iterator p=matrix.begin();
-        p != matrix.end(); ++p, ++value)
+         p != matrix.end(); ++p, ++value)
       p->value() = value;
   }
   deallog << "Original:" << std::endl;
@@ -55,7 +55,7 @@ int main (int argc,char **argv)
 
   // now copy everything into a Trilinos matrix
   Epetra_Map map(TrilinosWrappers::types::int_type(5),
-                5,0,Utilities::Trilinos::comm_world());
+                 5,0,Utilities::Trilinos::comm_world());
   TrilinosWrappers::SparseMatrix tmatrix;
   tmatrix.reinit (map, map, matrix, 4.);
 
index c78db11492d1ff746a2ebdfa4c15d1aae22089aa..50da59ddf8885029f5ac7f5be544c8a15e0fc352 100644 (file)
@@ -47,7 +47,7 @@ int main (int argc,char **argv)
   {
     double value = 1;
     for (SparseMatrix<double>::iterator p=matrix.begin();
-        p != matrix.end(); ++p, ++value)
+         p != matrix.end(); ++p, ++value)
       p->value() = value;
   }
   deallog << "Original:" << std::endl;
@@ -55,9 +55,9 @@ int main (int argc,char **argv)
 
   // now copy everything into a Trilinos matrix
   Epetra_Map map(TrilinosWrappers::types::int_type(5),
-                TrilinosWrappers::types::int_type(5),
-                0,
-                Utilities::Trilinos::comm_world());
+                 TrilinosWrappers::types::int_type(5),
+                 0,
+                 Utilities::Trilinos::comm_world());
 
   TrilinosWrappers::SparseMatrix tmatrix;
   tmatrix.reinit (map, map, matrix, 0, false);
index 0a53c005d3633fde04566726963d4047867225a9..64f4d39681d1a467cb30dd4e2835ae2db72a8ec0 100644 (file)
@@ -47,7 +47,7 @@ int main (int argc,char **argv)
   {
     double value = 1;
     for (SparseMatrix<double>::iterator p=matrix.begin();
-        p != matrix.end(); ++p, ++value)
+         p != matrix.end(); ++p, ++value)
       p->value() = value;
   }
   deallog << "Original:" << std::endl;
@@ -62,7 +62,7 @@ int main (int argc,char **argv)
 
   // now copy everything into a Trilinos matrix
   Epetra_Map map(TrilinosWrappers::types::int_type(5),
-                5,0,Utilities::Trilinos::comm_world());
+                 5,0,Utilities::Trilinos::comm_world());
   TrilinosWrappers::SparseMatrix tmatrix;
   tmatrix.reinit (map, map, matrix, 0, true, &xsparsity);
 
index a25c5081bb27bae011de05b166b574d948ccc16b..ba7123f03afdbd39d539395c953064fa89414556 100644 (file)
@@ -47,7 +47,7 @@ int main (int argc,char **argv)
   {
     double value = 1;
     for (SparseMatrix<double>::iterator p=matrix.begin();
-        p != matrix.end(); ++p, ++value)
+         p != matrix.end(); ++p, ++value)
       p->value() = value;
   }
   deallog << "Original:" << std::endl;
@@ -66,7 +66,7 @@ int main (int argc,char **argv)
 
   // now copy everything into a Trilinos matrix
   Epetra_Map map(TrilinosWrappers::types::int_type(5),
-                5,0,Utilities::Trilinos::comm_world());
+                 5,0,Utilities::Trilinos::comm_world());
   TrilinosWrappers::SparseMatrix tmatrix;
   tmatrix.reinit (map, map, matrix, 0, true, &xsparsity);
 
index 331677d8560a7896747d1c739dbcf5391fa4c645..9fb6a488323a5c07cb6615db742ee894ba4a29ed 100644 (file)
@@ -47,7 +47,7 @@ int main (int argc,char **argv)
   {
     double value = 1;
     for (SparseMatrix<double>::iterator p=matrix.begin();
-        p != matrix.end(); ++p, ++value)
+         p != matrix.end(); ++p, ++value)
       p->value() = value;
   }
   deallog << "Original:" << std::endl;
index 3cb83c0c4275fdff728d98046aafbbae1c6b91bb..3147e7a5a9b51715eda1cbb8ee1da09dd41e73f2 100644 (file)
@@ -19,7 +19,7 @@
 // compare collective adding of elements in a trilinos matrix using
 // TrilinosWrappers::SparseMatrix::add() with element-wise setting
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/trilinos_sparse_matrix.h>
 #include <fstream>
@@ -30,56 +30,56 @@ void test (TrilinosWrappers::SparseMatrix &m)
 {
   TrilinosWrappers::SparseMatrix m2(m.m(), m.n(), m.m()/3+1);
 
-                                   // first set a few entries one-by-one
+  // first set a few entries one-by-one
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
-       {
-         m.set (i,j, i*j*.5+.5);
-         m2.set (i,j, 0.);
-       }
+        {
+          m.set (i,j, i*j*.5+.5);
+          m2.set (i,j, 0.);
+        }
 
   m.compress ();
   m2.compress();
 
-                                  // now add the same elements row-wise
+  // now add the same elements row-wise
   {
     std::vector<types::global_dof_index> col_indices (m.n()/3+1);
     std::vector<double> col_values (m.n()/3+1);
     for (unsigned int i=0; i<m.m(); ++i)
       {
-       unsigned int col_index = 0;
-                                  // count the number of elements in this
-                                  // row
-       for (unsigned int j=0; j<m.n(); ++j)
-         if ((i+2*j+1) % 3 == 0)
-           ++col_index;
-
-       col_indices.resize(col_index);
-       col_values.resize(col_index);
-       col_index = 0;
-
-                                  // extract column values
-       for (unsigned int j=0; j<m.n(); ++j)
-         if ((i+2*j+1) % 3 == 0)
-           {
-             col_indices[col_index] = j;
-             col_values[col_index] =  i*j*.5+.5;
-             col_index++;
-           }
-
-       m2.add (i, col_indices, col_values);
+        unsigned int col_index = 0;
+        // count the number of elements in this
+        // row
+        for (unsigned int j=0; j<m.n(); ++j)
+          if ((i+2*j+1) % 3 == 0)
+            ++col_index;
+
+        col_indices.resize(col_index);
+        col_values.resize(col_index);
+        col_index = 0;
+
+        // extract column values
+        for (unsigned int j=0; j<m.n(); ++j)
+          if ((i+2*j+1) % 3 == 0)
+            {
+              col_indices[col_index] = j;
+              col_values[col_index] =  i*j*.5+.5;
+              col_index++;
+            }
+
+        m2.add (i, col_indices, col_values);
       }
   }
 
   m2.compress();
 
-                                  // subtract the matrix m from this one,
-                                  // we should get a zero matrix
+  // subtract the matrix m from this one,
+  // we should get a zero matrix
   m2.add(-1.0, m);
-                                  // calculate the Frobenius norm of the
-                                  // matrix in order to check whether all
-                                  // elements really are zero
+  // calculate the Frobenius norm of the
+  // matrix in order to check whether all
+  // elements really are zero
   double norm = m2.frobenius_norm();
   Assert (norm == 0, ExcInternalError());
 
@@ -88,12 +88,12 @@ void test (TrilinosWrappers::SparseMatrix &m)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("sparse_matrix_add_01/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -108,25 +108,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 6ba76e775937d7d07aacef389309f1f9ef80a223..91b6da78fc8e24ac45a5c5146e905166038f77bb 100644 (file)
@@ -21,7 +21,7 @@
 // setting the same elements on an element-by-element level. Use the entries
 // as they would result from a Laplace operator in 1D.
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/trilinos_sparse_matrix.h>
 #include <deal.II/lac/full_matrix.h>
@@ -33,30 +33,30 @@ void test (TrilinosWrappers::SparseMatrix &m)
 {
   TrilinosWrappers::SparseMatrix m2(m.m(), m.n(), 3U);
 
-                                   // first set a few entries one-by-one and
-                                   // initialize the sparsity pattern for m2
+  // first set a few entries one-by-one and
+  // initialize the sparsity pattern for m2
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if (std::fabs((double)i-j) < 2)
-       {
-         double value;
-         if (i == j) 
-           if (i>0 && i<m.m()-1)
-             value = 2.;
-           else 
-             value = 1.;
-         else
-           value = -1.;
-
-         m.set (i,j, value);
-         m2.set (i,j, 0.);
-       }
+        {
+          double value;
+          if (i == j)
+            if (i>0 && i<m.m()-1)
+              value = 2.;
+            else
+              value = 1.;
+          else
+            value = -1.;
+
+          m.set (i,j, value);
+          m2.set (i,j, 0.);
+        }
 
   m.compress ();
   m2.compress();
 
-                                  // now add the same elements from a full
-                                  // matrix
+  // now add the same elements from a full
+  // matrix
   {
     FullMatrix<double> full_matrix(2,2);
     full_matrix(0,0) = full_matrix(1,1) = 1.;
@@ -65,21 +65,21 @@ void test (TrilinosWrappers::SparseMatrix &m)
 
     for (unsigned int i=0; i<m.m()-1; ++i)
       {
-       local_indices[0] = i;
-       local_indices[1] = i+1;
+        local_indices[0] = i;
+        local_indices[1] = i+1;
 
-       m2.add (local_indices, local_indices, full_matrix);
+        m2.add (local_indices, local_indices, full_matrix);
       }
   }
 
   m2.compress();
 
-                                  // subtract the matrix m from this one,
-                                  // we should get a zero matrix
+  // subtract the matrix m from this one,
+  // we should get a zero matrix
   m2.add(-1.0, m);
-                                  // calculate the Frobenius norm of the
-                                  // matrix in order to check whether all
-                                  // elements really are zero
+  // calculate the Frobenius norm of the
+  // matrix in order to check whether all
+  // elements really are zero
   double norm = m2.frobenius_norm();
   Assert (norm == 0, ExcInternalError());
 
@@ -88,12 +88,12 @@ void test (TrilinosWrappers::SparseMatrix &m)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("sparse_matrix_add_02/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -107,25 +107,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index c52a7d2038b57cbb879b46e02c2b0b6252a6aebe..e0a127aa2a1a68243b82e42b730febadec4a1917 100644 (file)
@@ -48,7 +48,7 @@ int main (int argc,char **argv)
   {
     double value = 1;
     for (SparseMatrix<double>::iterator p=matrix.begin();
-        p != matrix.end(); ++p, ++value)
+         p != matrix.end(); ++p, ++value)
       p->value() = value;
   }
   deallog << "Original:" << std::endl;
@@ -69,7 +69,7 @@ int main (int argc,char **argv)
 
   // also compare for equality with the original
   for (SparsityPattern::const_iterator
-        p = sparsity.begin(); p != sparsity.end(); ++p)
+       p = sparsity.begin(); p != sparsity.end(); ++p)
     Assert (copy(p->row(), p->column()) == matrix(p->row(), p->column()),
-           ExcInternalError());
+            ExcInternalError());
 }
index 6edaacd46ede8193453830b628d9355b240fe68c..3704dcd2c0e4d0a14c85edbc33946d9b0c66a01e 100644 (file)
@@ -20,7 +20,7 @@
 #include <deal.II/lac/trilinos_sparsity_pattern.h>
 #include <deal.II/lac/trilinos_sparse_matrix.h>
 
-int main(int argc, char ** argv)
+int main(int argc, char **argv)
 {
   const std::string logname = JobIdentifier::base_name(__FILE__) + std::string("/output");
   std::ofstream logfile(logname.c_str());
@@ -28,7 +28,7 @@ int main(int argc, char ** argv)
   deallog.depth_console (0);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
-  
+
   TrilinosWrappers::SparsityPattern pattern(4,5,2);
   pattern.add(0,2);
   pattern.add(0,0);
@@ -39,7 +39,7 @@ int main(int argc, char ** argv)
   pattern.add(3,0);
   pattern.add(3,4);
   pattern.compress();
-  
+
   TrilinosWrappers::SparseMatrix matrix(pattern);
   matrix.set(0,2, 3.5);
   matrix.set(0,0, 1.);
@@ -50,33 +50,33 @@ int main(int argc, char ** argv)
   matrix.set(3,0, 2.);
   matrix.set(3,4, 0.);
 
-                                  // Print the matrix
-  for (TrilinosWrappers::SparseMatrix::const_iterator i=matrix.begin(); i != matrix.end();++i)
+  // Print the matrix
+  for (TrilinosWrappers::SparseMatrix::const_iterator i=matrix.begin(); i != matrix.end(); ++i)
     deallog << i->row() << ' ' << i->column() << ' ' << i->value() << std::endl;
   deallog << std::endl;
-  
-                                  // Add 0.5 to each element
-  for (TrilinosWrappers::SparseMatrix::iterator i=matrix.begin(); i != matrix.end();++i)
+
+  // Add 0.5 to each element
+  for (TrilinosWrappers::SparseMatrix::iterator i=matrix.begin(); i != matrix.end(); ++i)
     i->value() += .5;
-  
-                                  // Print the matrix
-  for (TrilinosWrappers::SparseMatrix::const_iterator i=matrix.begin(); i != matrix.end();++i)
+
+  // Print the matrix
+  for (TrilinosWrappers::SparseMatrix::const_iterator i=matrix.begin(); i != matrix.end(); ++i)
     deallog << i->row() << ' ' << i->column() << ' ' << i->value() << std::endl;
   deallog << std::endl;
-  
-                                  // Subtract 1 from each element in row 2
-  for (TrilinosWrappers::SparseMatrix::iterator i=matrix.begin(2); i != matrix.end(2);++i)
+
+  // Subtract 1 from each element in row 2
+  for (TrilinosWrappers::SparseMatrix::iterator i=matrix.begin(2); i != matrix.end(2); ++i)
     i->value() -= 1.;
 
-                                  //  Double each element in row 1
-  for (TrilinosWrappers::SparseMatrix::iterator i=matrix.begin(1); i != matrix.end(1);++i)
+  //  Double each element in row 1
+  for (TrilinosWrappers::SparseMatrix::iterator i=matrix.begin(1); i != matrix.end(1); ++i)
     i->value() *= 2;
 
-                                  // Set the first entry to zero
+  // Set the first entry to zero
   matrix.begin()->value() = 0;
-  
-                                  // Print the matrix
-  for (TrilinosWrappers::SparseMatrix::const_iterator i=matrix.begin(); i != matrix.end();++i)
+
+  // Print the matrix
+  for (TrilinosWrappers::SparseMatrix::const_iterator i=matrix.begin(); i != matrix.end(); ++i)
     deallog << i->row() << ' ' << i->column() << ' ' << i->value() << std::endl;
   deallog << std::endl;
 }
index 08b9a1ac0fc0a25d932c8ebf36d1e68bfbf2d7c6..ea8f486f59b19a927bae8cf41eafc2355485295b 100644 (file)
@@ -63,25 +63,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
 
       return 1;
     }
   catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 71de2c45c1792f87fbdac863e370f611bb40676e..f7ac2d0e40e74356678183f2a80bfe5bf32c230e 100644 (file)
@@ -19,7 +19,7 @@
 // compare collective setting of elements in a trilinos matrix using
 // TrilinosWrappers::SparseMatrix::set() with element-wise setting
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/trilinos_sparse_matrix.h>
 #include <fstream>
@@ -28,7 +28,7 @@
 
 void test (TrilinosWrappers::SparseMatrix &m)
 {
-                                   // first set a few entries one-by-one
+  // first set a few entries one-by-one
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if ((i+2*j+1) % 3 == 0)
@@ -38,44 +38,44 @@ void test (TrilinosWrappers::SparseMatrix &m)
 
   TrilinosWrappers::SparseMatrix m2(m.m(), m.n(), m.n()/3+1);
 
-                                  // now set the same elements row-wise
-   {
+  // now set the same elements row-wise
+  {
     std::vector<types::global_dof_index> col_indices (m.n()/3+1);
     std::vector<double> col_values (m.n()/3+1);
     for (unsigned int i=0; i<m.m(); ++i)
       {
-       unsigned int col_index = 0;
-                                  // count the number of elements in this
-                                  // row
-       for (unsigned int j=0; j<m.n(); ++j)
-         if ((i+2*j+1) % 3 == 0)
-           ++col_index;
-
-       col_indices.resize(col_index);
-       col_values.resize(col_index);
-       col_index = 0;
-
-                                  // extract column values
-       for (unsigned int j=0; j<m.n(); ++j)
-         if ((i+2*j+1) % 3 == 0)
-           {
-             col_indices[col_index] = j;
-             col_values[col_index] =  i*j*.5+.5;
-             col_index++;
-           }
-
-       m2.set (i, col_indices, col_values);
+        unsigned int col_index = 0;
+        // count the number of elements in this
+        // row
+        for (unsigned int j=0; j<m.n(); ++j)
+          if ((i+2*j+1) % 3 == 0)
+            ++col_index;
+
+        col_indices.resize(col_index);
+        col_values.resize(col_index);
+        col_index = 0;
+
+        // extract column values
+        for (unsigned int j=0; j<m.n(); ++j)
+          if ((i+2*j+1) % 3 == 0)
+            {
+              col_indices[col_index] = j;
+              col_values[col_index] =  i*j*.5+.5;
+              col_index++;
+            }
+
+        m2.set (i, col_indices, col_values);
       }
   }
 
   m2.compress();
 
-                                  // subtract the matrix m from this one,
-                                  // we should get a zero matrix.
+  // subtract the matrix m from this one,
+  // we should get a zero matrix.
   m2.add(-1.0, m);
-                                  // Calculate the Frobenius norm of the
-                                  // matrix in order to check whether all
-                                  // elements really are zero.
+  // Calculate the Frobenius norm of the
+  // matrix in order to check whether all
+  // elements really are zero.
   double norm = m2.frobenius_norm();
   Assert (norm == 0, ExcInternalError());
 
@@ -84,12 +84,12 @@ void test (TrilinosWrappers::SparseMatrix &m)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("sparse_matrix_set_01/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -103,25 +103,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 782cd4498822c54732d1a2975f485fa219744715..cdadd29288f1abe8b0958ad510d2cf3334731f68 100644 (file)
@@ -21,7 +21,7 @@
 // setting the same elements on an element-by-element level. Use the entries
 // as they would result from a Laplace operator in 1D.
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/trilinos_sparse_matrix.h>
 #include <deal.II/lac/full_matrix.h>
@@ -33,27 +33,27 @@ void test (TrilinosWrappers::SparseMatrix &m)
 {
   TrilinosWrappers::SparseMatrix m2(m.m(), m.n(), 3U);
 
-                                   // first set a few entries one-by-one and
-                                   // initialize the sparsity pattern for m2
+  // first set a few entries one-by-one and
+  // initialize the sparsity pattern for m2
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
       if (std::fabs((double)i-j) < 2)
-       {
-         double value;
-         if (i == j) 
-           if (i>0 && i<m.m()-1)
-             value = 2.;
-           else 
-             value = 1.;
-         else
-           value = -1.;
-
-         m.set (i,j, value);
-       }
+        {
+          double value;
+          if (i == j)
+            if (i>0 && i<m.m()-1)
+              value = 2.;
+            else
+              value = 1.;
+          else
+            value = -1.;
+
+          m.set (i,j, value);
+        }
   m.compress ();
-                                  // now add the same elements from a full
-                                  // matrix (if the same element is set
-                                  // more than once, Trilinos adds them)
+  // now add the same elements from a full
+  // matrix (if the same element is set
+  // more than once, Trilinos adds them)
   {
     FullMatrix<double> full_matrix(2,2);
     full_matrix(0,0) = full_matrix(1,1) = 1.;
@@ -62,21 +62,21 @@ void test (TrilinosWrappers::SparseMatrix &m)
 
     for (unsigned int i=0; i<m.m()-1; ++i)
       {
-       local_indices[0] = i;
-       local_indices[1] = i+1;
+        local_indices[0] = i;
+        local_indices[1] = i+1;
 
-       m2.set (local_indices, local_indices, full_matrix);
+        m2.set (local_indices, local_indices, full_matrix);
       }
   }
 
   m2.compress();
 
-                                  // subtract the matrix m from this one,
-                                  // we should get a zero matrix
+  // subtract the matrix m from this one,
+  // we should get a zero matrix
   m2.add(-1.0, m);
-                                  // calculate the Frobenius norm of the
-                                  // matrix in order to check whether all
-                                  // elements really are zero
+  // calculate the Frobenius norm of the
+  // matrix in order to check whether all
+  // elements really are zero
   double norm = m2.frobenius_norm();
   Assert (norm == 0, ExcInternalError());
 
@@ -85,12 +85,12 @@ void test (TrilinosWrappers::SparseMatrix &m)
 
 
 
-int main (int argc,char **argv) 
+int main (int argc,char **argv)
 {
   std::ofstream logfile("sparse_matrix_set_02/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -104,25 +104,25 @@ int main (int argc,char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 2ae6342268564927f87c65b8d8cb1d36aaab0ba3..4c4bd642644cc6ddc5c662c950faea278fa503a6 100644 (file)
@@ -18,7 +18,7 @@
 
 // check SparseMatrix::vmult
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/trilinos_vector.h>
 #include <deal.II/lac/trilinos_sparse_matrix.h>
@@ -33,19 +33,19 @@ void test (TrilinosWrappers::Vector &v,
   TrilinosWrappers::SparseMatrix m(v.size(),v.size(),v.size());
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
-  
+
   m.compress ();
   v.compress ();
   w.compress ();
 
-                                   // w:=Mv
+  // w:=Mv
   m.vmult (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -66,7 +66,7 @@ int main (int argc, char **argv)
   std::ofstream logfile("sparse_matrix_vector_01/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -82,25 +82,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index f01238c177418adf0d02a18ec79b9b99037e843e..e07398e2e38c876bc44be73a0b71c44f0d68692a 100644 (file)
@@ -18,7 +18,7 @@
 
 // check SparseMatrix::Tvmult
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/trilinos_vector.h>
 #include <deal.II/lac/trilinos_sparse_matrix.h>
@@ -33,19 +33,19 @@ void test (TrilinosWrappers::Vector &v,
   TrilinosWrappers::SparseMatrix m(v.size(),v.size(),v.size());
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
-  
+
   m.compress ();
   v.compress ();
   w.compress ();
 
-                                   // w:=Mv
+  // w:=Mv
   m.Tvmult (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -66,7 +66,7 @@ int main (int argc, char **argv)
   std::ofstream logfile("sparse_matrix_vector_02/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -82,25 +82,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 10d9d01b426a62b39c7e1312fc67a8efe387e1e2..35dcc9b26b85949e31e3a72d1076cac4b807aff6 100644 (file)
@@ -18,7 +18,7 @@
 
 // check SparseMatrix::vmult_add
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/trilinos_vector.h>
 #include <deal.II/lac/trilinos_sparse_matrix.h>
@@ -33,22 +33,22 @@ void test (TrilinosWrappers::Vector &v,
   TrilinosWrappers::SparseMatrix m(v.size(),v.size(),v.size());
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       w(i) = i;
     }
-  
+
   m.compress ();
   v.compress ();
   w.compress ();
 
-                                   // w:=Mv
+  // w:=Mv
   m.vmult_add (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -69,7 +69,7 @@ int main (int argc, char **argv)
   std::ofstream logfile("sparse_matrix_vector_03/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -85,25 +85,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 7c722b46fe14632b228cf9748ada9d19a471c799..b4c52255553729d9f9520a006c0ed69ca983e424 100644 (file)
@@ -18,7 +18,7 @@
 
 // check SparseMatrix::Tvmult_add
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/trilinos_vector.h>
 #include <deal.II/lac/trilinos_sparse_matrix.h>
@@ -40,14 +40,14 @@ void test (TrilinosWrappers::Vector &v,
       v(i) = i;
       w(i) = i;
     }
-  
+
   m.compress ();
   v.compress ();
   w.compress ();
-                                   // w:=Mv
+  // w:=Mv
   m.Tvmult_add (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -68,7 +68,7 @@ int main (int argc, char **argv)
   std::ofstream logfile("sparse_matrix_vector_04/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -84,25 +84,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 20c2dac24c1ae2c42888637383fcf327839f28cc..9e581f0035db46016780141b9a458c2683c0471e 100644 (file)
@@ -18,7 +18,7 @@
 
 // check SparseMatrix::matrix_scalar_product
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/trilinos_vector.h>
 #include <deal.II/lac/trilinos_sparse_matrix.h>
@@ -33,22 +33,22 @@ void test (TrilinosWrappers::Vector &v,
   TrilinosWrappers::SparseMatrix m(v.size(),v.size(),v.size());
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       w(i) = i+1;
     }
-  
+
   m.compress ();
   v.compress ();
   w.compress ();
 
-                                   // <w,Mv>
+  // <w,Mv>
   const TrilinosScalar s = m.matrix_scalar_product (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -72,7 +72,7 @@ int main (int argc, char **argv)
   std::ofstream logfile("sparse_matrix_vector_05/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -88,25 +88,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index e78a5340f36a1de3341de745f9ed964ce78a652a..c4a508416f7291fae35c70a5fbbb12be5e3cd050 100644 (file)
@@ -18,7 +18,7 @@
 
 // check SparseMatrix::matrix_norm_square
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/trilinos_vector.h>
 #include <deal.II/lac/trilinos_sparse_matrix.h>
@@ -32,18 +32,18 @@ void test (TrilinosWrappers::Vector &v)
   TrilinosWrappers::SparseMatrix m(v.size(),v.size(),v.size());
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
-  
+
   m.compress ();
   v.compress ();
 
-                                   // <w,Mv>
+  // <w,Mv>
   const TrilinosScalar s = m.matrix_norm_square (v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     Assert (v(i) == i, ExcInternalError());
 
@@ -64,7 +64,7 @@ int main (int argc, char **argv)
   std::ofstream logfile("sparse_matrix_vector_06/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -79,25 +79,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 387ee7e5ef2fbab884793bd68db58aade685e3c9..1c538d9ebd9e4b56908c2f8b56bdf37fa629336c 100644 (file)
@@ -18,7 +18,7 @@
 
 // check SparseMatrix::matrix_norm_square
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/trilinos_vector.h>
 #include <deal.II/lac/trilinos_sparse_matrix.h>
@@ -34,22 +34,22 @@ void test (TrilinosWrappers::Vector &v,
   TrilinosWrappers::SparseMatrix m(v.size(),v.size(),v.size());
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.m(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       w(i) = i+1;
     }
-      
+
   m.compress ();
   v.compress ();
   w.compress ();
 
-                                   // x=w-Mv
+  // x=w-Mv
   const double s = m.residual (x, v, w);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<v.size(); ++i)
     {
       Assert (v(i) == i, ExcInternalError());
@@ -74,7 +74,7 @@ int main (int argc, char **argv)
   std::ofstream logfile("sparse_matrix_vector_07/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -91,25 +91,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index a57ad65ac30f673ffb8fb936700320e27b561346..d07e608efe4e16f3846e1463610fb0f9a5a2d206 100644 (file)
@@ -18,7 +18,7 @@
 
 // check SparseMatrix::vmult, vmult_add with deal.II vector
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/vector.h>
 #include <deal.II/lac/trilinos_sparse_matrix.h>
@@ -33,17 +33,17 @@ void test (Vector<double> &v,
   TrilinosWrappers::SparseMatrix m(w.size(),v.size(),v.size());
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
-  
+
   m.compress (VectorOperation::insert);
 
-                                   // w:=Mv
+  // w:=Mv
   m.vmult (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<m.m(); ++i)
     {
       double result = 0;
@@ -53,7 +53,7 @@ void test (Vector<double> &v,
     }
 
   m.vmult_add (w, v);
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<m.m(); ++i)
     {
       double result = 0;
@@ -72,7 +72,7 @@ int main (int argc, char **argv)
   std::ofstream logfile("sparse_matrix_vector_08/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -88,25 +88,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 7460464daf558eee74de60415275973a4fae79c3..3ab85b74349ddd2211f4ef4a00d633a1397e89a4 100644 (file)
@@ -18,7 +18,7 @@
 
 // check SparseMatrix::Tvmult, Tvmult_add with deal.II vector
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/vector.h>
 #include <deal.II/lac/trilinos_sparse_matrix.h>
@@ -33,17 +33,17 @@ void test (Vector<double> &v,
   TrilinosWrappers::SparseMatrix m(v.size(),w.size(),w.size());
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
-  
+
   m.compress (VectorOperation::insert);
 
-                                   // w:=Mv
+  // w:=Mv
   m.Tvmult (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<m.n(); ++i)
     {
       double result = 0;
@@ -53,7 +53,7 @@ void test (Vector<double> &v,
     }
 
   m.Tvmult_add (w, v);
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<m.n(); ++i)
     {
       double result = 0;
@@ -72,7 +72,7 @@ int main (int argc, char **argv)
   std::ofstream logfile("sparse_matrix_vector_09/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -88,25 +88,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 65e220dc1b1eefc2879d3a26f93e97e9dc8f7b5c..f43ef273f8d4fa8fa8b7a1681700977d9b117a98 100644 (file)
@@ -19,7 +19,7 @@
 // check SparseMatrix::vmult, vmult_add with distributed deal.II vector (but
 // without using distributed things)
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/parallel_vector.h>
 #include <deal.II/lac/trilinos_sparse_matrix.h>
@@ -34,17 +34,17 @@ void test (parallel::distributed::Vector<double> &v,
   TrilinosWrappers::SparseMatrix m(w.size(),v.size(),v.size());
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
-  
+
   m.compress (VectorOperation::insert);
 
-                                   // w:=Mv
+  // w:=Mv
   m.vmult (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<m.m(); ++i)
     {
       double result = 0;
@@ -54,7 +54,7 @@ void test (parallel::distributed::Vector<double> &v,
     }
 
   m.vmult_add (w, v);
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<m.m(); ++i)
     {
       double result = 0;
@@ -73,7 +73,7 @@ int main (int argc, char **argv)
   std::ofstream logfile("sparse_matrix_vector_10/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -89,25 +89,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 1f793dcadc3540ce3b11837390bb50bcc5ab4fe0..db114775a50fda022a1f4470159b87a584435962 100644 (file)
@@ -18,7 +18,7 @@
 
 // check SparseMatrix::Tvmult, Tvmult_add with distributed deal.II vector
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
 #include <deal.II/lac/parallel_vector.h>
 #include <deal.II/lac/trilinos_sparse_matrix.h>
@@ -33,17 +33,17 @@ void test (parallel::distributed::Vector<double> &v,
   TrilinosWrappers::SparseMatrix m(v.size(),w.size(),w.size());
   for (unsigned int i=0; i<m.m(); ++i)
     for (unsigned int j=0; j<m.n(); ++j)
-        m.set (i,j, i+2*j);
+      m.set (i,j, i+2*j);
 
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
-  
+
   m.compress (VectorOperation::insert);
 
-                                   // w:=Mv
+  // w:=Mv
   m.Tvmult (w,v);
 
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<m.n(); ++i)
     {
       double result = 0;
@@ -53,7 +53,7 @@ void test (parallel::distributed::Vector<double> &v,
     }
 
   m.Tvmult_add (w, v);
-                                   // make sure we get the expected result
+  // make sure we get the expected result
   for (unsigned int i=0; i<m.n(); ++i)
     {
       double result = 0;
@@ -72,7 +72,7 @@ int main (int argc, char **argv)
   std::ofstream logfile("sparse_matrix_vector_11/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -88,25 +88,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 9ada2461a13a31ce67fc8a6a59434a0c37b60e7d..6df6ee2ecd163c5bf98f942027f63405ae4a83d2 100644 (file)
@@ -21,7 +21,7 @@
 #include "sparsity_pattern_common.h"
 #include <deal.II/base/utilities.h>
 
-int main (int argc, char** argv)
+int main (int argc, char **argv)
 {
   Utilities::MPI::MPI_InitFinalize mpi_init (argc, argv);
   std::ofstream logfile("sparsity_pattern_01/output");
@@ -34,5 +34,5 @@ int main (int argc, char** argv)
   row_length ();
 }
 
-  
-  
+
+
index c7da3170340d687228b2a754afd10da71522eb76..ee07b8e4447c1c206430ce34552fe6e5bf5a8b29 100644 (file)
@@ -21,7 +21,7 @@
 #include "sparsity_pattern_common.h"
 #include <deal.II/base/utilities.h>
 
-int main (int argc, char** argv)
+int main (int argc, char **argv)
 {
   Utilities::MPI::MPI_InitFinalize mpi_init (argc, argv);
   std::ofstream logfile("sparsity_pattern_02/output");
@@ -34,5 +34,5 @@ int main (int argc, char** argv)
   print_gnuplot ();
 }
 
-  
-  
+
+
index 036c0d9bd5fc851b320d8c2b21593dc50cfb57fb..8221cbf1239814bdb5ce47c606c8c27780e9b5ee 100644 (file)
@@ -21,7 +21,7 @@
 #include "sparsity_pattern_common.h"
 #include <deal.II/base/utilities.h>
 
-int main (int argc, char** argv)
+int main (int argc, char **argv)
 {
   Utilities::MPI::MPI_InitFinalize mpi_init (argc, argv);
 
@@ -35,5 +35,5 @@ int main (int argc, char** argv)
   print ();
 }
 
-  
-  
+
+
index f3332586d4bd1ccfbe48b9c67419484090b87d0b..1fe40d59bc0027b70fbaf456be7a932e2282f755 100644 (file)
@@ -1,6 +1,6 @@
 //---------------------------  sparsity_pattern_common.h  -------------------------
 //    $Id$
-//    Version: $Name$ 
+//    Version: $Name$
 //
 //    Copyright (C) 2008 by the deal.II authors
 //
@@ -32,16 +32,16 @@ void do_reinit (TrilinosWrappers::SparsityPattern &sp)
 
 void build_sparsity (TrilinosWrappers::SparsityPattern &sparsity_pattern)
 {
-                                  // generate usual 5-point sparsity pattern
+  // generate usual 5-point sparsity pattern
   do_reinit (sparsity_pattern);
   FDMatrix(N,N).five_point_structure (sparsity_pattern);
   sparsity_pattern.compress ();
 
   deallog << sparsity_pattern.n_rows() << " "
-         << sparsity_pattern.n_cols() << " "
-         << sparsity_pattern.bandwidth() << " "
-         << sparsity_pattern.n_nonzero_elements()
-         << std::endl;
+          << sparsity_pattern.n_cols() << " "
+          << sparsity_pattern.bandwidth() << " "
+          << sparsity_pattern.n_nonzero_elements()
+          << std::endl;
 }
 
 
@@ -50,7 +50,7 @@ void row_length ()
 {
   TrilinosWrappers::SparsityPattern sparsity_pattern;
   build_sparsity (sparsity_pattern);
-  
+
   for (unsigned int i=0; i<sparsity_pattern.n_rows(); ++i)
     deallog << sparsity_pattern.row_length(i) << std::endl;
 
@@ -82,4 +82,4 @@ void print ()
 }
 
 
-  
+
index 905355e1bcd7d1b5026055d5fa9b59ab9b884839..73dd149ea2fb99f6ed7ea348214845c0c6b625e7 100644 (file)
@@ -34,16 +34,16 @@ template <typename int_type>
 void test ()
 {
   const Epetra_Map map (int_type(1),
-                       0,
-                       Epetra_MpiComm(MPI_COMM_SELF));
+                        0,
+                        Epetra_MpiComm(MPI_COMM_SELF));
 
   int n_entries_per_row[1] = {1};
   Epetra_CrsGraph graph (Copy, map, map,
-                        &n_entries_per_row[0], true);
+                         &n_entries_per_row[0], true);
 
   int_type row_indices[1] = {0};
   graph.InsertGlobalIndices (int_type(0),
-                            1, &row_indices[0]);
+                             1, &row_indices[0]);
 
   graph.FillComplete(map, map);
 }
index a5388d3d2de0f91074e0ef874f0798987b1afda6..aff7adc1a1638f6915be53b2dd25af371e2972cb 100644 (file)
@@ -64,25 +64,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 9a907bb844c8fa379ff521b83a57f16c8b04bd9c..e9269db26dfd823aeb1c9f74202ffc8796381c10 100644 (file)
@@ -75,25 +75,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 8059068ef01c68a77c5a7ddfba5a133a37f00dc3..09a863c15f020cc3d04683dc3122ff65a078493a 100644 (file)
@@ -75,25 +75,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index b78c88037200e6b41ef7feba74d0b3fc36d6d278..5783f82a48bba78b98621e76e744a58ca6eadd23 100644 (file)
@@ -74,25 +74,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index dc90c649d376d87da619e5827a095dbf6ead06f5..55b51f10db612c2d1b9b088b3ec6d2ef6e2b263e 100644 (file)
@@ -81,25 +81,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 1f3460c7dacc20489cd69b0dee31a17a09d13f34..c3bd4749c092e64a77dd427f2d3deaa1c5f8a8b2 100644 (file)
@@ -81,25 +81,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 6e48c87d7d2a82f10d0eacbd9da8f09b0d74256d..34960c9b9825adebdeba4df8f067e6c21f8cd806 100644 (file)
@@ -81,25 +81,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 7267ba7d691198e6b1777828e1e45d607571ec6f..128b02912267825c1f265301fc308bc6df4be60d 100644 (file)
@@ -81,25 +81,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 661e34581d64aa95afff8957e330ef2214cccabf..43842be00da04ec5c484a7aa3b5267d456cd8179 100644 (file)
 
 void test ()
 {
-                                   // create a sparsity pattern with totally
-                                   // empty lines (not even diagonals, since
-                                   // not quadratic)
+  // create a sparsity pattern with totally
+  // empty lines (not even diagonals, since
+  // not quadratic)
   TrilinosWrappers::SparsityPattern sparsity(4,5,1);
   sparsity.add (1,1);
   sparsity.add (3,1);
   sparsity.compress ();
 
-                                   // attach a sparse matrix to it
+  // attach a sparse matrix to it
   TrilinosWrappers::SparseMatrix A(sparsity);
 
-                                   // and loop over the elements of it
+  // and loop over the elements of it
   for (TrilinosWrappers::SparseMatrix::const_iterator k=A.begin();
        k!=A.end(); ++k)
     deallog << k->row() << ' ' << k->column() << ' ' << k->value()
@@ -65,25 +65,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index b8b487a19635ea18a06cc7538cca97fa94163d78..e234de7d4de94372d0f6a29c8b23ccd086f197ba 100644 (file)
 
 void test ()
 {
-                                   // create a sparsity pattern with totally
-                                   // empty lines (not even diagonals, since
-                                   // not quadratic)
+  // create a sparsity pattern with totally
+  // empty lines (not even diagonals, since
+  // not quadratic)
   TrilinosWrappers::SparsityPattern sparsity(4,5,1);
   sparsity.add (1,1);
   sparsity.add (3,1);
   sparsity.compress ();
 
-                                   // attach a sparse matrix to it
+  // attach a sparse matrix to it
   TrilinosWrappers::SparseMatrix A(sparsity);
 
-                                   // and loop over the elements of it
+  // and loop over the elements of it
   for (TrilinosWrappers::SparseMatrix::const_iterator k=A.begin();
        k!=A.end(); k++)
     deallog << k->row() << ' ' << k->column() << ' ' << k->value()
@@ -67,25 +67,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 148518f7657bfe7f851e1f08cf87d02c2b06b91b..1de5ad549ae8fe85b0819494a206fffd06afcb98 100644 (file)
 
 void test ()
 {
-                                   // create a sparsity pattern with totally
-                                   // empty lines (not even diagonals, since
-                                   // not quadratic)
+  // create a sparsity pattern with totally
+  // empty lines (not even diagonals, since
+  // not quadratic)
   TrilinosWrappers::SparsityPattern sparsity(4,5,1);
   sparsity.add (1,1);
   sparsity.add (3,1);
   sparsity.compress ();
 
-                                   // attach a sparse matrix to it
+  // attach a sparse matrix to it
   TrilinosWrappers::SparseMatrix A(sparsity);
 
   TrilinosWrappers::SparseMatrix::iterator k = A.begin(),
-                                 j = ++A.begin();
+                                           j = ++A.begin();
 
   Assert (k < j, ExcInternalError());
   Assert (j > k, ExcInternalError());
@@ -75,25 +75,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 65d8ba8b9bf99a7402a46ea08e2dbf1449e83ed0..8106080bb3bc23173fd2d7ef4d8d25d31aa47526 100644 (file)
 
 void test ()
 {
-                                   // create a sparsity pattern with totally
-                                   // empty lines (not even diagonals, since
-                                   // not quadratic)
+  // create a sparsity pattern with totally
+  // empty lines (not even diagonals, since
+  // not quadratic)
   TrilinosWrappers::SparsityPattern sparsity(4,5,1);
   sparsity.add (1,1);
   sparsity.add (3,1);
   sparsity.compress ();
 
-                                   // attach a sparse matrix to it
+  // attach a sparse matrix to it
   TrilinosWrappers::SparseMatrix A(sparsity);
 
   TrilinosWrappers::SparseMatrix::const_iterator k = A.begin(),
-                                       j = ++A.begin();
+                                                 j = ++A.begin();
 
   Assert (k < j, ExcInternalError());
   Assert (j > k, ExcInternalError());
@@ -75,25 +75,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << exc.what() << std::endl
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
 
       return 1;
     }
   catch (...)
     {
       deallog << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "----------------------------------------------------"
+              << std::endl;
       deallog << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+              << "Aborting!" << std::endl
+              << "----------------------------------------------------"
+              << std::endl;
       return 1;
     };
 }
index 8ca0a29e0774dcc1ebbbdc7059c6cd104aac294c..424bdc096956b916bb2b593a7be635cbe74d0109 100644 (file)
@@ -24,9 +24,9 @@
 //
 // this was fixed 2004-04-05, and this test checks that it works
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
 void test (TrilinosWrappers::Vector &v,
            TrilinosWrappers::Vector &w)
 {
-                                   // set the first vector
+  // set the first vector
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
 
-                                   // copy elements by reference
+  // copy elements by reference
   for (unsigned int i=0; i<v.size(); ++i)
     w(i) = v(i);
 
-                                   // check that they're equal
+  // check that they're equal
   Assert (v==w, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -56,7 +56,7 @@ int main (int argc, char **argv)
   std::ofstream logfile("vector_assign_01/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -72,25 +72,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 0a6e1fc4b5acab81d6549f57c80e6e1621ee99e5..7ed6a960c3a31cd17994cac26ba2aa63a608d434 100644 (file)
@@ -23,9 +23,9 @@
 // argument to the user-defined operator+=. This is not exciting, but since I
 // wrote the test to make sure it works this way, let's keep it then...
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
 void test (TrilinosWrappers::Vector &v,
            TrilinosWrappers::Vector &w)
 {
-                                   // set the first vector
+  // set the first vector
   for (unsigned int i=0; i<v.size(); ++i)
     v(i) = i;
 
-                                   // add elements by reference
+  // add elements by reference
   for (unsigned int i=0; i<v.size(); ++i)
     w(i) += v(i);
 
-                                   // check that they're equal
+  // check that they're equal
   Assert (v==w, ExcInternalError());
 
   deallog << "OK" << std::endl;
@@ -55,7 +55,7 @@ int main (int argc, char **argv)
   std::ofstream logfile("vector_assign_02/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -71,25 +71,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 37bf3929d1e27fd6929bb9262bfaf60e2ec0f55f..8e09bd04712a19314e7468aeadab450c9ed08791 100644 (file)
@@ -19,9 +19,9 @@
 // check TrilinosWrappers::Vector::operator==(TrilinosWrappers::Vector) for vectors that are not
 // equal
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -30,8 +30,8 @@
 void test (TrilinosWrappers::Vector &v,
            TrilinosWrappers::Vector &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
@@ -51,7 +51,7 @@ int main (int argc, char **argv)
   std::ofstream logfile("vector_equality_1/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -67,25 +67,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index ae22d50e7d7876161cf1e0aaacac4c855579311e..580260ad3dde608b84ec3f80704e843bdb6fbdbf 100644 (file)
@@ -19,9 +19,9 @@
 // check TrilinosWrappers::Vector::operator==(TrilinosWrappers::Vector) for vectors that are
 // equal
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
 void test (TrilinosWrappers::Vector &v,
            TrilinosWrappers::Vector &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       if (i%3 == 0)
         w(i) = i+1.;
     }
-                                   // but then copy elements and make sure the
-                                   // vectors are actually equal
+  // but then copy elements and make sure the
+  // vectors are actually equal
   v = w;
   Assert (v==w, ExcInternalError());
 
@@ -53,7 +53,7 @@ int main (int argc, char **argv)
   std::ofstream logfile("vector_equality_2/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -69,25 +69,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index e68e477321cbe24507a58a573289ee266f72b759..078b1e3a39022ed19576e941d2be4af3be9e009e 100644 (file)
@@ -19,9 +19,9 @@
 // check TrilinosWrappers::Vector::operator!=(TrilinosWrappers::Vector) for vectors that are not
 // equal
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -30,8 +30,8 @@
 void test (TrilinosWrappers::Vector &v,
            TrilinosWrappers::Vector &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
@@ -51,7 +51,7 @@ int main (int argc, char **argv)
   std::ofstream logfile("vector_equality_3/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -67,25 +67,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 2c1fe408d38023fadecd26eb6f1e707546ca15b0..5f92585830f4a17368da478b8e4a8638ec7c6711 100644 (file)
@@ -19,9 +19,9 @@
 // check TrilinosWrappers::Vector::operator!=(TrilinosWrappers::Vector) for vectors that are
 // equal
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
 void test (TrilinosWrappers::Vector &v,
            TrilinosWrappers::Vector &w)
 {
-                                   // set only certain elements of each
-                                   // vector
+  // set only certain elements of each
+  // vector
   for (unsigned int i=0; i<v.size(); ++i)
     {
       v(i) = i;
       if (i%3 == 0)
         w(i) = i+1.;
     }
-                                   // but then copy elements and make sure the
-                                   // vectors are actually equal
+  // but then copy elements and make sure the
+  // vectors are actually equal
   v = w;
   Assert (! (v!=w), ExcInternalError());
 
@@ -53,7 +53,7 @@ int main (int argc, char **argv)
   std::ofstream logfile("vector_equality_4/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -69,25 +69,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index 2ee620094d12b2d099630bd5b70cf8df6d4cd065..5a7bf0922ff18420af864c06d63c48e626b50e2e 100644 (file)
@@ -20,9 +20,9 @@
  */
 
 
-#include "../tests.h" 
+#include "../tests.h"
 #include <deal.II/base/utilities.h>
-#include <deal.II/lac/trilinos_vector.h>    
+#include <deal.II/lac/trilinos_vector.h>
 #include <fstream>
 #include <iostream>
 #include <vector>
@@ -30,8 +30,8 @@
 void print(TrilinosWrappers::Vector &v)
 {
   deallog << "size= " << v.size()
-         << " el(0)= " << v(0)
-         << " l2norm()= " << v.l2_norm() << std::endl;
+          << " el(0)= " << v(0)
+          << " l2norm()= " << v.l2_norm() << std::endl;
 }
 
 
@@ -43,17 +43,21 @@ void test ()
   TrilinosWrappers::Vector w(9);
   for (unsigned int i=0; i<w.size(); ++i)
     w(i) = 2;
-  
-  
-  deallog << "v: "; print(v);
-  deallog << "w: "; print(w);
+
+
+  deallog << "v: ";
+  print(v);
+  deallog << "w: ";
+  print(w);
 
   deallog << "**swap**" << std::endl;
-  
+
   swap(v,w);
 
-  deallog << "v: "; print(v);
-  deallog << "w: "; print(w);
+  deallog << "v: ";
+  print(v);
+  deallog << "w: ";
+  print(w);
 
   Assert (v.size()==9, ExcInternalError());
 
@@ -67,7 +71,7 @@ int main (int argc, char **argv)
   std::ofstream logfile("vector_swap_01/output");
   deallog.attach(logfile);
   deallog.depth_console(0);
-  deallog.threshold_double(1.e-10); 
+  deallog.threshold_double(1.e-10);
 
   Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
 
@@ -79,25 +83,25 @@ int main (int argc, char **argv)
   catch (std::exception &exc)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Exception on processing: " << std::endl
-               << exc.what() << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
-      
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+
       return 1;
     }
-  catch (...) 
+  catch (...)
     {
       std::cerr << std::endl << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "----------------------------------------------------"
+                << std::endl;
       std::cerr << "Unknown exception!" << std::endl
-               << "Aborting!" << std::endl
-               << "----------------------------------------------------"
-               << std::endl;
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
       return 1;
     };
 }
index a1505dbd047077ed20b24a53fb5b86bfb2be1e52..a65672a3040d3ad5c80ca12e09e6cd53c627ebfd 100644 (file)
@@ -47,13 +47,13 @@ template <int dim>
 void test (bool transpose = false)
 {
   deallog << dim << 'd' << std::endl;
-  
-  Triangulation<dim> tria;  
+
+  Triangulation<dim> tria;
   GridGenerator::hyper_cube (tria,0,1);
   tria.refine_global (1);
 
-                                   // destroy the uniformity of the matrix by
-                                   // refining one cell
+  // destroy the uniformity of the matrix by
+  // refining one cell
   tria.begin_active()->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
   tria.refine_global(8-2*dim);
@@ -61,25 +61,25 @@ void test (bool transpose = false)
   FE_Q<dim> fe (1);
   DoFHandler<dim> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
-    
+
   deallog << "Number of dofs = " << dof_handler.n_dofs() << std::endl;
-  
+
   SparsityPattern sparsity_pattern;
   sparsity_pattern.reinit (dof_handler.n_dofs(),
                            dof_handler.n_dofs(),
                            dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
   sparsity_pattern.compress ();
-  
+
   SparseMatrix<double> B;
-  B.reinit (sparsity_pattern);  
-  
+  B.reinit (sparsity_pattern);
+
   QGauss<dim> qr (2);
   MatrixTools::create_mass_matrix (dof_handler, qr, B);
 
-                                   // for a number of different solution
-                                   // vectors, make up a matching rhs vector
-                                   // and check what the UMFPACK solver finds
+  // for a number of different solution
+  // vectors, make up a matching rhs vector
+  // and check what the UMFPACK solver finds
   for (unsigned int i=0; i<3; ++i)
     {
       Vector<double> solution (dof_handler.n_dofs());
index 3cef766639b886b3811a70c1593ca760c561af19..dc46d6c8d72bcaf0243bbca27df94c252dc7c8a3 100644 (file)
@@ -48,13 +48,13 @@ template <int dim>
 void test (bool transpose = false)
 {
   deallog << dim << 'd' << std::endl;
-  
-  Triangulation<dim> tria;  
+
+  Triangulation<dim> tria;
   GridGenerator::hyper_cube (tria,0,1);
   tria.refine_global (1);
 
-                                   // destroy the uniformity of the matrix by
-                                   // refining one cell
+  // destroy the uniformity of the matrix by
+  // refining one cell
   tria.begin_active()->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
   tria.refine_global(8-2*dim);
@@ -62,29 +62,29 @@ void test (bool transpose = false)
   FE_Q<dim> fe (1);
   DoFHandler<dim> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
-    
+
   deallog << "Number of dofs = " << dof_handler.n_dofs() << std::endl;
-  
+
   SparsityPattern sparsity_pattern;
   sparsity_pattern.reinit (dof_handler.n_dofs(),
                            dof_handler.n_dofs(),
                            dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
   sparsity_pattern.compress ();
-  
+
   SparseMatrix<double> B;
-  B.reinit (sparsity_pattern);  
-  
+  B.reinit (sparsity_pattern);
+
   QGauss<dim> qr (2);
   MatrixTools::create_mass_matrix (dof_handler, qr, B);
 
-                                   // compute a decomposition of the matrix
+  // compute a decomposition of the matrix
   SparseDirectUMFPACK Binv;
   Binv.factorize (B);
-      
-                                   // for a number of different solution
-                                   // vectors, make up a matching rhs vector
-                                   // and check what the UMFPACK solver finds
+
+  // for a number of different solution
+  // vectors, make up a matching rhs vector
+  // and check what the UMFPACK solver finds
   for (unsigned int i=0; i<3; ++i)
     {
       Vector<double> solution (dof_handler.n_dofs());
index 7ce33598796458a8d9841c17689859c642b23bef..70a24c8d244ff080959a99b8f56d553d9e41510f 100644 (file)
@@ -52,8 +52,8 @@ void test (bool transpose = false)
   GridGenerator::hyper_cube (tria,0,1);
   tria.refine_global (1);
 
-                                   // destroy the uniformity of the matrix by
-                                   // refining one cell
+  // destroy the uniformity of the matrix by
+  // refining one cell
   tria.begin_active()->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
   tria.refine_global(8-2*dim);
@@ -77,9 +77,9 @@ void test (bool transpose = false)
   QGauss<dim> qr (2);
   MatrixTools::create_mass_matrix (dof_handler, qr, B);
 
-                                   // scale lower left part of the matrix by
-                                   // 1/2 and upper right part by 2 to make
-                                   // matrix nonsymmetric
+  // scale lower left part of the matrix by
+  // 1/2 and upper right part by 2 to make
+  // matrix nonsymmetric
   for (SparseMatrix<double>::iterator p=B.begin();
        p!=B.end(); ++p)
     if (p->column() < p->row())
@@ -87,16 +87,16 @@ void test (bool transpose = false)
     else if (p->column() > p->row())
       p->value() = p->value() * 2;
 
-                                   // check that we've done it right
+  // check that we've done it right
   for (SparseMatrix<double>::iterator p=B.begin();
        p!=B.end(); ++p)
     if (p->column() != p->row())
       Assert (B(p->row(),p->column()) != B(p->column(),p->row()),
               ExcInternalError());
 
-                                   // for a number of different solution
-                                   // vectors, make up a matching rhs vector
-                                   // and check what the UMFPACK solver finds
+  // for a number of different solution
+  // vectors, make up a matching rhs vector
+  // and check what the UMFPACK solver finds
   for (unsigned int i=0; i<3; ++i)
     {
       Vector<double> solution (dof_handler.n_dofs());
index 7b460dd91eefb35864b126d18274009e1c77e700..7539bb7ef4841ff17c69a4f48f0547c76fa7230d 100644 (file)
@@ -49,56 +49,58 @@ template <int dim, typename MATRIX, typename VECTOR>
 void assemble_laplace (MATRIX &B, VECTOR &bb, DoFHandler<dim> &dof_handler, FiniteElement<dim> &fe)
 {
   QGauss<dim>  quadrature_formula(2);
-  FEValues<dim> fe_values (fe, quadrature_formula, 
-                          update_values | update_gradients | update_JxW_values);
-  
+  FEValues<dim> fe_values (fe, quadrature_formula,
+                           update_values | update_gradients | update_JxW_values);
+
   const unsigned int   dofs_per_cell = fe.dofs_per_cell;
   const unsigned int   n_q_points    = quadrature_formula.size();
-  
+
   FullMatrix<double>   cell_matrix (dofs_per_cell, dofs_per_cell);
   Vector<double>       cell_rhs (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();
+  cell = dof_handler.begin_active(),
+  endc = dof_handler.end();
   for (; cell!=endc; ++cell)
     {
       fe_values.reinit (cell);
-      
+
       cell_matrix = 0;
       cell_rhs = 0;
-      
+
       unsigned int comp_i, comp_j;
-      
-      for (unsigned int i=0; i<dofs_per_cell; ++i) {
-       comp_i = fe.system_to_component_index(i).first;
-       for (unsigned int j=0; j<dofs_per_cell; ++j) {
-         comp_j = fe.system_to_component_index(j).first;
-         if(comp_i == comp_j) 
-           for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-             cell_matrix(i,j) += (fe_values.shape_grad (i, q_point) *
-                                  fe_values.shape_grad (j, q_point) *
-                                  fe_values.JxW (q_point));
-       }
-       for (unsigned int i=0; i<dofs_per_cell; ++i)
-         for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
-           cell_rhs(i) += (fe_values.shape_value (i, q_point) *
-                           1 *
-                           fe_values.JxW (q_point));
-      }
-      
+
+      for (unsigned int i=0; i<dofs_per_cell; ++i)
+        {
+          comp_i = fe.system_to_component_index(i).first;
+          for (unsigned int j=0; j<dofs_per_cell; ++j)
+            {
+              comp_j = fe.system_to_component_index(j).first;
+              if (comp_i == comp_j)
+                for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+                  cell_matrix(i,j) += (fe_values.shape_grad (i, q_point) *
+                                       fe_values.shape_grad (j, q_point) *
+                                       fe_values.JxW (q_point));
+            }
+          for (unsigned int i=0; i<dofs_per_cell; ++i)
+            for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+              cell_rhs(i) += (fe_values.shape_value (i, q_point) *
+                              1 *
+                              fe_values.JxW (q_point));
+        }
+
       cell->get_dof_indices (local_dof_indices);
-      
+
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       for (unsigned int j=0; j<dofs_per_cell; ++j)
-         B.add (local_dof_indices[i],
-                local_dof_indices[j],
-                cell_matrix(i,j));
-      
+        for (unsigned int j=0; j<dofs_per_cell; ++j)
+          B.add (local_dof_indices[i],
+                 local_dof_indices[j],
+                 cell_matrix(i,j));
+
       for (unsigned int i=0; i<dofs_per_cell; ++i)
-       bb(local_dof_indices[i]) += cell_rhs(i);
+        bb(local_dof_indices[i]) += cell_rhs(i);
     }
 }
 
@@ -108,13 +110,13 @@ template <int dim>
 void test ()
 {
   deallog << dim << 'd' << std::endl;
-  
-  Triangulation<dim> tria;  
+
+  Triangulation<dim> tria;
   GridGenerator::hyper_cube (tria,0,1);
   tria.refine_global (1);
 
-                                   // destroy the uniformity of the matrix by
-                                   // refining one cell
+  // destroy the uniformity of the matrix by
+  // refining one cell
   tria.begin_active()->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
   tria.refine_global(7-2*dim);
@@ -123,44 +125,44 @@ void test ()
   DoFHandler<dim> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
   DoFRenumbering::component_wise (dof_handler);
-  
+
   deallog << "Number of dofs = " << dof_handler.n_dofs() << std::endl;
-  
+
   std::vector<types::global_dof_index> size (dim);
   DoFTools::count_dofs_per_component(dof_handler, size);
-  
+
   BlockSparsityPattern b_sparsity_pattern;
   SparsityPattern sparsity_pattern;
 
   b_sparsity_pattern.reinit(size.size(),size.size());
-  for (unsigned int k=0; k<size.size();++k)
-    for (unsigned int l=0; l<size.size();++l)
+  for (unsigned int k=0; k<size.size(); ++k)
+    for (unsigned int l=0; l<size.size(); ++l)
       b_sparsity_pattern.block(k,l).reinit(size[k],
-                                        size[l],
-                                        dof_handler.max_couplings_between_dofs());
+                                           size[l],
+                                           dof_handler.max_couplings_between_dofs());
   b_sparsity_pattern.collect_sizes();
-  
+
   sparsity_pattern.reinit(dof_handler.n_dofs(), dof_handler.n_dofs(), dof_handler.max_couplings_between_dofs());
-  
+
   DoFTools::make_sparsity_pattern (dof_handler, b_sparsity_pattern);
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
 
   b_sparsity_pattern.compress();
   sparsity_pattern.compress ();
-  
+
   BlockSparseMatrix<double> Bb;
-  Bb.reinit (b_sparsity_pattern);  
-  
+  Bb.reinit (b_sparsity_pattern);
+
   SparseMatrix<double> B;
   B.reinit(sparsity_pattern);
-  
+
   BlockVector<double> bb(size), bx(size);
-  Vector<double> b(dof_handler.n_dofs()), x(dof_handler.n_dofs()), 
-    ub(dof_handler.n_dofs()), ubb(dof_handler.n_dofs());
+  Vector<double> b(dof_handler.n_dofs()), x(dof_handler.n_dofs()),
+         ub(dof_handler.n_dofs()), ubb(dof_handler.n_dofs());
 
   assemble_laplace(Bb, bb, dof_handler, fe);
   assemble_laplace(B, b, dof_handler, fe);
-  
+
   std::map<types::global_dof_index,double> boundary_values;
   VectorTools::interpolate_boundary_values (dof_handler,
                                             0,
@@ -168,7 +170,7 @@ void test ()
                                             boundary_values);
   MatrixTools::apply_boundary_values (boundary_values, Bb, bx, bb);
   MatrixTools::apply_boundary_values (boundary_values, B, x, b);
-  
+
   ub = b;
   ubb = bb;
 
@@ -185,31 +187,31 @@ void test ()
   umfpack.factorize(B);
   umfpack.solve(ub);
   deallog << "absolute norms = "
-         << x.l2_norm() << ' ' << ub.l2_norm()
-         << std::endl;
+          << x.l2_norm() << ' ' << ub.l2_norm()
+          << std::endl;
   x -= ub;
 
   deallog << "relative norm distance = "
-         << x.l2_norm() / ub.l2_norm()
-         << std::endl;
+          << x.l2_norm() / ub.l2_norm()
+          << std::endl;
   Assert (x.l2_norm() / ub.l2_norm() < 1e-12,
-         ExcInternalError());
+          ExcInternalError());
 
   deallog << "Block Sparse Factorization" << std::endl;
   umfpackb.factorize(Bb);
   // umfpackb.factorize(B);
   umfpackb.solve(ubb);
   deallog << "absolute norms = "
-         << bx.l2_norm() << ' ' << ubb.l2_norm()
-         << std::endl;
-   b = bx;
-   b -= ubb;
-   
+          << bx.l2_norm() << ' ' << ubb.l2_norm()
+          << std::endl;
+  b = bx;
+  b -= ubb;
+
   deallog << "relative norm distance = "
-         << b.l2_norm() / ubb.l2_norm()
-         << std::endl;
+          << b.l2_norm() / ubb.l2_norm()
+          << std::endl;
   Assert (b.l2_norm() / ubb.l2_norm() < 1e-12,
-         ExcInternalError());
+          ExcInternalError());
 }
 
 
index 0277336af6424fbeb308d3ef41c69ce8b8d11717..79adfe22c2838838ba78b7808749c713d638238f 100644 (file)
 void test ()
 {
   std::vector<unsigned int> size (2,2U);
-  
+
   BlockSparsityPattern b_sparsity_pattern;
   b_sparsity_pattern.reinit(size.size(),size.size());
-  for (unsigned int k=0; k<size.size();++k)
-    for (unsigned int l=0; l<size.size();++l)
+  for (unsigned int k=0; k<size.size(); ++k)
+    for (unsigned int l=0; l<size.size(); ++l)
       b_sparsity_pattern.block(k,l).reinit(size[k],
-                                          size[l],
-                                          2);
+                                           size[l],
+                                           2);
   b_sparsity_pattern.collect_sizes();
   for (unsigned int i=0; i<4; ++i)
     for (unsigned int j=0; j<4; ++j)
       b_sparsity_pattern.add (i,j);
   b_sparsity_pattern.compress();
-  
-  BlockSparseMatrix<double> Bb (b_sparsity_pattern);  
+
+  BlockSparseMatrix<double> Bb (b_sparsity_pattern);
   for (unsigned int i=0; i<4; ++i)
     Bb.add (i,i,1);
 
@@ -56,12 +56,12 @@ void test ()
   Vector<double> ubb(4);
   for (unsigned int i=0; i<4; ++i)
     ubb(i) = i;
-  
+
   umfpackb.solve(ubb);
 
   for (unsigned int i=0; i<4; ++i)
     Assert (std::fabs (ubb(i) - i) < 1e-12,
-           ExcInternalError());
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
index 0cc3ba7cb25ee8f3991829c000a58b0632440599..9e4885fb0e5fb38155d83d0487bd308d3b88aab5 100644 (file)
@@ -36,21 +36,21 @@ void test ()
   std::vector<unsigned int> size (2);
   size[0] = 3;
   size[1] = 1;
-  
+
   BlockSparsityPattern b_sparsity_pattern;
   b_sparsity_pattern.reinit(size.size(),size.size());
-  for (unsigned int k=0; k<size.size();++k)
-    for (unsigned int l=0; l<size.size();++l)
+  for (unsigned int k=0; k<size.size(); ++k)
+    for (unsigned int l=0; l<size.size(); ++l)
       b_sparsity_pattern.block(k,l).reinit(size[k],
-                                          size[l],
-                                          3);
+                                           size[l],
+                                           3);
   b_sparsity_pattern.collect_sizes();
   for (unsigned int i=0; i<4; ++i)
     for (unsigned int j=0; j<4; ++j)
       b_sparsity_pattern.add (i,j);
   b_sparsity_pattern.compress();
-  
-  BlockSparseMatrix<double> Bb (b_sparsity_pattern);  
+
+  BlockSparseMatrix<double> Bb (b_sparsity_pattern);
   for (unsigned int i=0; i<4; ++i)
     Bb.add (i,i,1);
 
@@ -60,12 +60,12 @@ void test ()
   Vector<double> ubb(4);
   for (unsigned int i=0; i<4; ++i)
     ubb(i) = i;
-  
+
   umfpackb.solve(ubb);
 
   for (unsigned int i=0; i<4; ++i)
     Assert (std::fabs (ubb(i) - i) < 1e-12,
-           ExcInternalError());
+            ExcInternalError());
 
   deallog << "OK" << std::endl;
 }
index 7b568eb3fc99b6a4721d6ac1e739ef28dbab598d..1ccb7e0ccd70ad785c6ee561f864fd6d4938a398 100644 (file)
@@ -48,13 +48,13 @@ template <int dim>
 void test ()
 {
   deallog << dim << 'd' << std::endl;
-  
-  Triangulation<dim> tria;  
+
+  Triangulation<dim> tria;
   GridGenerator::hyper_cube (tria,0,1);
   tria.refine_global (1);
 
-                                   // destroy the uniformity of the matrix by
-                                   // refining one cell
+  // destroy the uniformity of the matrix by
+  // refining one cell
   tria.begin_active()->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
   tria.refine_global(8-2*dim);
@@ -62,25 +62,25 @@ void test ()
   FE_Q<dim> fe (1);
   DoFHandler<dim> dof_handler (tria);
   dof_handler.distribute_dofs (fe);
-    
+
   deallog << "Number of dofs = " << dof_handler.n_dofs() << std::endl;
-  
+
   SparsityPattern sparsity_pattern;
   sparsity_pattern.reinit (dof_handler.n_dofs(),
                            dof_handler.n_dofs(),
                            dof_handler.max_couplings_between_dofs());
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
   sparsity_pattern.compress ();
-  
+
   SparseMatrix<float> B;
-  B.reinit (sparsity_pattern);  
-  
+  B.reinit (sparsity_pattern);
+
   QGauss<dim> qr (2);
   MatrixTools::create_mass_matrix (dof_handler, qr, B);
 
-                                   // scale lower left part of the matrix by
-                                   // 1/2 and upper right part by 2 to make
-                                   // matrix nonsymmetric
+  // scale lower left part of the matrix by
+  // 1/2 and upper right part by 2 to make
+  // matrix nonsymmetric
   for (SparseMatrix<float>::iterator p=B.begin();
        p!=B.end(); ++p)
     if (p->column() < p->row())
@@ -88,16 +88,16 @@ void test ()
     else if (p->column() > p->row())
       p->value() = p->value() * 2;
 
-                                   // check that we've done it right
+  // check that we've done it right
   for (SparseMatrix<float>::iterator p=B.begin();
        p!=B.end(); ++p)
     if (p->column() != p->row())
       Assert (B(p->row(),p->column()) != B(p->column(),p->row()),
               ExcInternalError());
-  
-                                   // for a number of different solution
-                                   // vectors, make up a matching rhs vector
-                                   // and check what the UMFPACK solver finds
+
+  // for a number of different solution
+  // vectors, make up a matching rhs vector
+  // and check what the UMFPACK solver finds
   for (unsigned int i=0; i<3; ++i)
     {
       Vector<double> solution (dof_handler.n_dofs());
index 30b085df6034c89fe5b14e9b2e87731c8f7c490d..40368c32e91c93da7eb7f7b38a49d439965e46be 100644 (file)
@@ -53,8 +53,8 @@ void test ()
   GridGenerator::hyper_cube (tria,0,1);
   tria.refine_global (1);
 
-                                   // destroy the uniformity of the matrix by
-                                   // refining one cell
+  // destroy the uniformity of the matrix by
+  // refining one cell
   tria.begin_active()->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
   tria.refine_global(8-2*dim);
@@ -70,13 +70,13 @@ void test ()
   for (unsigned int i=0; i<3; ++i)
     for (unsigned int j=0; j<3; ++j)
       sparsity_pattern.block(i,j).reinit (i!=2 ?
-                                         dof_handler.n_dofs()/3 :
-                                         dof_handler.n_dofs()-2*(dof_handler.n_dofs()/3),
-                                         j!=2 ?
-                                         dof_handler.n_dofs()/3 :
-                                         dof_handler.n_dofs()-2*(dof_handler.n_dofs()/3),
-                                         dof_handler.max_couplings_between_dofs(),
-                                         false);
+                                          dof_handler.n_dofs()/3 :
+                                          dof_handler.n_dofs()-2*(dof_handler.n_dofs()/3),
+                                          j!=2 ?
+                                          dof_handler.n_dofs()/3 :
+                                          dof_handler.n_dofs()-2*(dof_handler.n_dofs()/3),
+                                          dof_handler.max_couplings_between_dofs(),
+                                          false);
   sparsity_pattern.collect_sizes();
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
   sparsity_pattern.compress ();
@@ -85,13 +85,13 @@ void test ()
   B.reinit (sparsity_pattern);
 
   {
-                                    // for some reason, we can't
-                                    // create block matrices directly
-                                    // in matrixtools...
+    // for some reason, we can't
+    // create block matrices directly
+    // in matrixtools...
     SparsityPattern xsparsity_pattern;
     xsparsity_pattern.reinit (dof_handler.n_dofs(),
-                             dof_handler.n_dofs(),
-                             dof_handler.max_couplings_between_dofs());
+                              dof_handler.n_dofs(),
+                              dof_handler.max_couplings_between_dofs());
     DoFTools::make_sparsity_pattern (dof_handler, xsparsity_pattern);
     xsparsity_pattern.compress ();
 
@@ -101,32 +101,32 @@ void test ()
     QGauss<dim> qr (2);
     MatrixTools::create_mass_matrix (dof_handler, qr, xB);
 
-                                    // scale lower left part of the matrix by
-                                    // 1/2 and upper right part by 2 to make
-                                    // matrix nonsymmetric
+    // scale lower left part of the matrix by
+    // 1/2 and upper right part by 2 to make
+    // matrix nonsymmetric
     for (SparseMatrix<double>::iterator p=xB.begin();
-        p!=xB.end(); ++p)
+         p!=xB.end(); ++p)
       if (p->column() < p->row())
-       p->value() = p->value()/2;
+        p->value() = p->value()/2;
       else if (p->column() > p->row())
-       p->value() = p->value() * 2;
+        p->value() = p->value() * 2;
 
-                                    // check that we've done it right
+    // check that we've done it right
     for (SparseMatrix<double>::iterator p=xB.begin();
-        p!=xB.end(); ++p)
+         p!=xB.end(); ++p)
       if (p->column() != p->row())
-       Assert (xB(p->row(),p->column()) != xB(p->column(),p->row()),
-               ExcInternalError());
+        Assert (xB(p->row(),p->column()) != xB(p->column(),p->row()),
+                ExcInternalError());
 
-                                    // now copy stuff over
+    // now copy stuff over
     for (SparseMatrix<double>::const_iterator i = xB.begin(); i != xB.end(); ++i)
       B.set (i->row(), i->column(), i->value());
   }
 
 
-                                   // for a number of different solution
-                                   // vectors, make up a matching rhs vector
-                                   // and check what the UMFPACK solver finds
+  // for a number of different solution
+  // vectors, make up a matching rhs vector
+  // and check what the UMFPACK solver finds
   for (unsigned int i=0; i<3; ++i)
     {
       BlockVector<double> solution (3);
index c29e0a7abe4a35805f76f9352206513368189875..3eb7b302724a3e79e090982059e7e01478d98273 100644 (file)
@@ -53,8 +53,8 @@ void test ()
   GridGenerator::hyper_cube (tria,0,1);
   tria.refine_global (1);
 
-                                   // destroy the uniformity of the matrix by
-                                   // refining one cell
+  // destroy the uniformity of the matrix by
+  // refining one cell
   tria.begin_active()->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
   tria.refine_global(8-2*dim);
@@ -70,13 +70,13 @@ void test ()
   for (unsigned int i=0; i<3; ++i)
     for (unsigned int j=0; j<3; ++j)
       sparsity_pattern.block(i,j).reinit (i!=2 ?
-                                         dof_handler.n_dofs()/3 :
-                                         dof_handler.n_dofs()-2*(dof_handler.n_dofs()/3),
-                                         j!=2 ?
-                                         dof_handler.n_dofs()/3 :
-                                         dof_handler.n_dofs()-2*(dof_handler.n_dofs()/3),
-                                         dof_handler.max_couplings_between_dofs(),
-                                         false);
+                                          dof_handler.n_dofs()/3 :
+                                          dof_handler.n_dofs()-2*(dof_handler.n_dofs()/3),
+                                          j!=2 ?
+                                          dof_handler.n_dofs()/3 :
+                                          dof_handler.n_dofs()-2*(dof_handler.n_dofs()/3),
+                                          dof_handler.max_couplings_between_dofs(),
+                                          false);
   sparsity_pattern.collect_sizes();
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
   sparsity_pattern.compress ();
@@ -85,13 +85,13 @@ void test ()
   B.reinit (sparsity_pattern);
 
   {
-                                    // for some reason, we can't
-                                    // create block matrices directly
-                                    // in matrixtools...
+    // for some reason, we can't
+    // create block matrices directly
+    // in matrixtools...
     SparsityPattern xsparsity_pattern;
     xsparsity_pattern.reinit (dof_handler.n_dofs(),
-                             dof_handler.n_dofs(),
-                             dof_handler.max_couplings_between_dofs());
+                              dof_handler.n_dofs(),
+                              dof_handler.max_couplings_between_dofs());
     DoFTools::make_sparsity_pattern (dof_handler, xsparsity_pattern);
     xsparsity_pattern.compress ();
 
@@ -101,32 +101,32 @@ void test ()
     QGauss<dim> qr (2);
     MatrixTools::create_mass_matrix (dof_handler, qr, xB);
 
-                                    // scale lower left part of the matrix by
-                                    // 1/2 and upper right part by 2 to make
-                                    // matrix nonsymmetric
+    // scale lower left part of the matrix by
+    // 1/2 and upper right part by 2 to make
+    // matrix nonsymmetric
     for (SparseMatrix<double>::iterator p=xB.begin();
-        p!=xB.end(); ++p)
+         p!=xB.end(); ++p)
       if (p->column() < p->row())
-       p->value() = p->value()/2;
+        p->value() = p->value()/2;
       else if (p->column() > p->row())
-       p->value() = p->value() * 2;
+        p->value() = p->value() * 2;
 
-                                    // check that we've done it right
+    // check that we've done it right
     for (SparseMatrix<double>::iterator p=xB.begin();
-        p!=xB.end(); ++p)
+         p!=xB.end(); ++p)
       if (p->column() != p->row())
-       Assert (xB(p->row(),p->column()) != xB(p->column(),p->row()),
-               ExcInternalError());
+        Assert (xB(p->row(),p->column()) != xB(p->column(),p->row()),
+                ExcInternalError());
 
-                                    // now copy stuff over
+    // now copy stuff over
     for (SparseMatrix<double>::const_iterator i = xB.begin(); i != xB.end(); ++i)
       B.set (i->row(), i->column(), i->value());
   }
 
 
-                                   // for a number of different solution
-                                   // vectors, make up a matching rhs vector
-                                   // and check what the UMFPACK solver finds
+  // for a number of different solution
+  // vectors, make up a matching rhs vector
+  // and check what the UMFPACK solver finds
   for (unsigned int i=0; i<3; ++i)
     {
       BlockVector<double> solution (3);
index 11a17fc46a1f30e22b841efde5bb50450fa9088f..cb18abd72648c7a32bacb6dcc335117cdc0d700d 100644 (file)
@@ -52,8 +52,8 @@ void test ()
   GridGenerator::hyper_cube (tria,0,1);
   tria.refine_global (1);
 
-                                   // destroy the uniformity of the matrix by
-                                   // refining one cell
+  // destroy the uniformity of the matrix by
+  // refining one cell
   tria.begin_active()->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
   tria.refine_global(8-2*dim);
@@ -77,9 +77,9 @@ void test ()
   QGauss<dim> qr (2);
   MatrixTools::create_mass_matrix (dof_handler, qr, B);
 
-                                   // scale lower left part of the matrix by
-                                   // 1/2 and upper right part by 2 to make
-                                   // matrix nonsymmetric
+  // scale lower left part of the matrix by
+  // 1/2 and upper right part by 2 to make
+  // matrix nonsymmetric
   for (SparseMatrix<double>::iterator p=B.begin();
        p!=B.end(); ++p)
     if (p->column() < p->row())
@@ -87,7 +87,7 @@ void test ()
     else if (p->column() > p->row())
       p->value() = p->value() * 2;
 
-                                   // check that we've done it right
+  // check that we've done it right
   for (SparseMatrix<double>::iterator p=B.begin();
        p!=B.end(); ++p)
     if (p->column() != p->row())
@@ -96,13 +96,13 @@ void test ()
 
 
   SparseMatrixEZ<double> B_ez(dof_handler.n_dofs(),
-                             dof_handler.n_dofs());
+                              dof_handler.n_dofs());
   B_ez.copy_from (B);
   B.clear ();
-  
-                                   // for a number of different solution
-                                   // vectors, make up a matching rhs vector
-                                   // and check what the UMFPACK solver finds
+
+  // for a number of different solution
+  // vectors, make up a matching rhs vector
+  // and check what the UMFPACK solver finds
   for (unsigned int i=0; i<3; ++i)
     {
       Vector<double> solution (dof_handler.n_dofs());
index 7f3d2f73a3de2533d54f3e9be43a2cc4414d5c8d..c90f9d61150a939216c174d61f5b6fbc9e0fce61 100644 (file)
@@ -54,8 +54,8 @@ void test ()
   GridGenerator::hyper_cube (tria,0,1);
   tria.refine_global (1);
 
-                                   // destroy the uniformity of the matrix by
-                                   // refining one cell
+  // destroy the uniformity of the matrix by
+  // refining one cell
   tria.begin_active()->set_refine_flag ();
   tria.execute_coarsening_and_refinement ();
   tria.refine_global(8-2*dim);
@@ -71,13 +71,13 @@ void test ()
   for (unsigned int i=0; i<3; ++i)
     for (unsigned int j=0; j<3; ++j)
       sparsity_pattern.block(i,j).reinit (i!=2 ?
-                                         dof_handler.n_dofs()/3 :
-                                         dof_handler.n_dofs()-2*(dof_handler.n_dofs()/3),
-                                         j!=2 ?
-                                         dof_handler.n_dofs()/3 :
-                                         dof_handler.n_dofs()-2*(dof_handler.n_dofs()/3),
-                                         dof_handler.max_couplings_between_dofs(),
-                                         false);
+                                          dof_handler.n_dofs()/3 :
+                                          dof_handler.n_dofs()-2*(dof_handler.n_dofs()/3),
+                                          j!=2 ?
+                                          dof_handler.n_dofs()/3 :
+                                          dof_handler.n_dofs()-2*(dof_handler.n_dofs()/3),
+                                          dof_handler.max_couplings_between_dofs(),
+                                          false);
   sparsity_pattern.collect_sizes();
   DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
   sparsity_pattern.compress ();
@@ -86,13 +86,13 @@ void test ()
   B.reinit (sparsity_pattern);
 
   {
-                                    // for some reason, we can't
-                                    // create block matrices directly
-                                    // in matrixtools...
+    // for some reason, we can't
+    // create block matrices directly
+    // in matrixtools...
     SparsityPattern xsparsity_pattern;
     xsparsity_pattern.reinit (dof_handler.n_dofs(),
-                             dof_handler.n_dofs(),
-                             dof_handler.max_couplings_between_dofs());
+                              dof_handler.n_dofs(),
+                              dof_handler.max_couplings_between_dofs());
     DoFTools::make_sparsity_pattern (dof_handler, xsparsity_pattern);
     xsparsity_pattern.compress ();
 
@@ -102,32 +102,32 @@ void test ()
     QGauss<dim> qr (2);
     MatrixTools::create_mass_matrix (dof_handler, qr, xB);
 
-                                    // scale lower left part of the matrix by
-                                    // 1/2 and upper right part by 2 to make
-                                    // matrix nonsymmetric
+    // scale lower left part of the matrix by
+    // 1/2 and upper right part by 2 to make
+    // matrix nonsymmetric
     for (SparseMatrix<double>::iterator p=xB.begin();
-        p!=xB.end(); ++p)
+         p!=xB.end(); ++p)
       if (p->column() < p->row())
-       p->value() = p->value()/2;
+        p->value() = p->value()/2;
       else if (p->column() > p->row())
-       p->value() = p->value() * 2;
+        p->value() = p->value() * 2;
 
-                                    // check that we've done it right
+    // check that we've done it right
     for (SparseMatrix<double>::iterator p=xB.begin();
-        p!=xB.end(); ++p)
+         p!=xB.end(); ++p)
       if (p->column() != p->row())
-       Assert (xB(p->row(),p->column()) != xB(p->column(),p->row()),
-               ExcInternalError());
+        Assert (xB(p->row(),p->column()) != xB(p->column(),p->row()),
+                ExcInternalError());
 
-                                    // now copy stuff over
+    // now copy stuff over
     for (SparseMatrix<double>::const_iterator i = xB.begin(); i != xB.end(); ++i)
       B.set (i->row(), i->column(), i->value());
   }
 
 
-                                   // for a number of different solution
-                                   // vectors, make up a matching rhs vector
-                                   // and check what the UMFPACK solver finds
+  // for a number of different solution
+  // vectors, make up a matching rhs vector
+  // and check what the UMFPACK solver finds
   for (unsigned int i=0; i<3; ++i)
     {
       BlockVector<double> solution (3);

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.